@wispbit/local 1.0.37 → 1.0.39
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/cli-bundle.js +63 -67
- package/package.json +1 -1
package/cli-bundle.js
CHANGED
|
@@ -1,102 +1,98 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';import { fileURLToPath } from 'url';import { dirname } from 'path';const require = createRequire(import.meta.url);const __filename = fileURLToPath(import.meta.url);const __dirname = dirname(__filename);
|
|
3
|
-
var Ty=Object.create;var
|
|
4
|
-
`);let i;for(;(i=
|
|
5
|
-
`),n=n.replace(/\\r/g,"\r")),e[s]=n}return e}function db(t){let e=fu(t),r=_e.configDotenv({path:e});if(!r.parsed){let a=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw a.code="MISSING_DATA",a}let i=uu(t).split(","),s=i.length,n;for(let a=0;a<s;a++)try{let o=i[a].trim(),c=yb(r,o);n=_e.decrypt(c.ciphertext,c.key);break}catch(o){if(a+1>=s)throw o}return _e.parse(n)}function mb(t){console.log(`[dotenv@${Vo}][INFO] ${t}`)}function gb(t){console.log(`[dotenv@${Vo}][WARN] ${t}`)}function Ks(t){console.log(`[dotenv@${Vo}][DEBUG] ${t}`)}function uu(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function yb(t,e){let r;try{r=new URL(e)}catch(o){if(o.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw o}let i=r.password;if(!i){let o=new Error("INVALID_DOTENV_KEY: Missing key part");throw o.code="INVALID_DOTENV_KEY",o}let s=r.searchParams.get("environment");if(!s){let o=new Error("INVALID_DOTENV_KEY: Missing environment part");throw o.code="INVALID_DOTENV_KEY",o}let n=`DOTENV_VAULT_${s.toUpperCase()}`,a=t.parsed[n];if(!a){let o=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);throw o.code="NOT_FOUND_DOTENV_ENVIRONMENT",o}return{ciphertext:a,key:i}}function fu(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)zo.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=Wo.resolve(process.cwd(),".env.vault");return zo.existsSync(e)?e:null}function lu(t){return t[0]==="~"?Wo.join(lb.homedir(),t.slice(1)):t}function bb(t){mb("Loading env from encrypted .env.vault");let e=_e._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),_e.populate(r,e,t),{parsed:e}}function vb(t){let e=Wo.resolve(process.cwd(),".env"),r="utf8",i=!!(t&&t.debug);t&&t.encoding?r=t.encoding:i&&Ks("No encoding is specified. UTF-8 is used by default");let s=[e];if(t&&t.path)if(!Array.isArray(t.path))s=[lu(t.path)];else{s=[];for(let c of t.path)s.push(lu(c))}let n,a={};for(let c of s)try{let l=_e.parse(zo.readFileSync(c,{encoding:r}));_e.populate(a,l,t)}catch(l){i&&Ks(`Failed to load ${c} ${l.message}`),n=l}let o=process.env;return t&&t.processEnv!=null&&(o=t.processEnv),_e.populate(o,a,t),n?{parsed:a,error:n}:{parsed:a}}function wb(t){if(uu(t).length===0)return _e.configDotenv(t);let e=fu(t);return e?_e._configVault(t):(gb(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),_e.configDotenv(t))}function xb(t,e){let r=Buffer.from(e.slice(-64),"hex"),i=Buffer.from(t,"base64"),s=i.subarray(0,12),n=i.subarray(-16);i=i.subarray(12,-16);try{let a=ub.createDecipheriv("aes-256-gcm",r,s);return a.setAuthTag(n),`${a.update(i)}${a.final()}`}catch(a){let o=a instanceof RangeError,c=a.message==="Invalid key length",l=a.message==="Unsupported state or unable to authenticate data";if(o||c){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(l){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw a}}function Eb(t,e,r={}){let i=!!(r&&r.debug),s=!!(r&&r.override);if(typeof e!="object"){let n=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw n.code="OBJECT_REQUIRED",n}for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(t,n)?(s===!0&&(t[n]=e[n]),i&&Ks(s===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):t[n]=e[n]}var _e={configDotenv:vb,_configVault:bb,_parseVault:db,config:wb,decrypt:xb,parse:pb,populate:Eb};At.exports.configDotenv=_e.configDotenv;At.exports._configVault=_e._configVault;At.exports._parseVault=_e._parseVault;At.exports.config=_e.config;At.exports.decrypt=_e.decrypt;At.exports.parse=_e.parse;At.exports.populate=_e.populate;At.exports=_e});var Wi=j((FT,Kf)=>{"use strict";var y1="2.0.0",b1=Number.MAX_SAFE_INTEGER||9007199254740991,v1=16,w1=250,x1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Kf.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:v1,MAX_SAFE_BUILD_LENGTH:w1,MAX_SAFE_INTEGER:b1,RELEASE_TYPES:x1,SEMVER_SPEC_VERSION:y1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Vi=j((NT,Yf)=>{"use strict";var E1=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Yf.exports=E1});var Xr=j((vt,Xf)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ua,MAX_SAFE_BUILD_LENGTH:_1,MAX_LENGTH:S1}=Wi(),R1=Vi();vt=Xf.exports={};var C1=vt.re=[],A1=vt.safeRe=[],z=vt.src=[],L1=vt.safeSrc=[],W=vt.t={},O1=0,Ga="[a-zA-Z0-9-]",$1=[["\\s",1],["\\d",S1],[Ga,_1]],T1=t=>{for(let[e,r]of $1)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ie=(t,e,r)=>{let i=T1(e),s=O1++;R1(t,s,e),W[t]=s,z[s]=e,L1[s]=i,C1[s]=new RegExp(e,r?"g":void 0),A1[s]=new RegExp(i,r?"g":void 0)};ie("NUMERICIDENTIFIER","0|[1-9]\\d*");ie("NUMERICIDENTIFIERLOOSE","\\d+");ie("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ga}*`);ie("MAINVERSION",`(${z[W.NUMERICIDENTIFIER]})\\.(${z[W.NUMERICIDENTIFIER]})\\.(${z[W.NUMERICIDENTIFIER]})`);ie("MAINVERSIONLOOSE",`(${z[W.NUMERICIDENTIFIERLOOSE]})\\.(${z[W.NUMERICIDENTIFIERLOOSE]})\\.(${z[W.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASEIDENTIFIER",`(?:${z[W.NONNUMERICIDENTIFIER]}|${z[W.NUMERICIDENTIFIER]})`);ie("PRERELEASEIDENTIFIERLOOSE",`(?:${z[W.NONNUMERICIDENTIFIER]}|${z[W.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASE",`(?:-(${z[W.PRERELEASEIDENTIFIER]}(?:\\.${z[W.PRERELEASEIDENTIFIER]})*))`);ie("PRERELEASELOOSE",`(?:-?(${z[W.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[W.PRERELEASEIDENTIFIERLOOSE]})*))`);ie("BUILDIDENTIFIER",`${Ga}+`);ie("BUILD",`(?:\\+(${z[W.BUILDIDENTIFIER]}(?:\\.${z[W.BUILDIDENTIFIER]})*))`);ie("FULLPLAIN",`v?${z[W.MAINVERSION]}${z[W.PRERELEASE]}?${z[W.BUILD]}?`);ie("FULL",`^${z[W.FULLPLAIN]}$`);ie("LOOSEPLAIN",`[v=\\s]*${z[W.MAINVERSIONLOOSE]}${z[W.PRERELEASELOOSE]}?${z[W.BUILD]}?`);ie("LOOSE",`^${z[W.LOOSEPLAIN]}$`);ie("GTLT","((?:<|>)?=?)");ie("XRANGEIDENTIFIERLOOSE",`${z[W.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ie("XRANGEIDENTIFIER",`${z[W.NUMERICIDENTIFIER]}|x|X|\\*`);ie("XRANGEPLAIN",`[v=\\s]*(${z[W.XRANGEIDENTIFIER]})(?:\\.(${z[W.XRANGEIDENTIFIER]})(?:\\.(${z[W.XRANGEIDENTIFIER]})(?:${z[W.PRERELEASE]})?${z[W.BUILD]}?)?)?`);ie("XRANGEPLAINLOOSE",`[v=\\s]*(${z[W.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[W.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[W.XRANGEIDENTIFIERLOOSE]})(?:${z[W.PRERELEASELOOSE]})?${z[W.BUILD]}?)?)?`);ie("XRANGE",`^${z[W.GTLT]}\\s*${z[W.XRANGEPLAIN]}$`);ie("XRANGELOOSE",`^${z[W.GTLT]}\\s*${z[W.XRANGEPLAINLOOSE]}$`);ie("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ua}})(?:\\.(\\d{1,${Ua}}))?(?:\\.(\\d{1,${Ua}}))?`);ie("COERCE",`${z[W.COERCEPLAIN]}(?:$|[^\\d])`);ie("COERCEFULL",z[W.COERCEPLAIN]+`(?:${z[W.PRERELEASE]})?(?:${z[W.BUILD]})?(?:$|[^\\d])`);ie("COERCERTL",z[W.COERCE],!0);ie("COERCERTLFULL",z[W.COERCEFULL],!0);ie("LONETILDE","(?:~>?)");ie("TILDETRIM",`(\\s*)${z[W.LONETILDE]}\\s+`,!0);vt.tildeTrimReplace="$1~";ie("TILDE",`^${z[W.LONETILDE]}${z[W.XRANGEPLAIN]}$`);ie("TILDELOOSE",`^${z[W.LONETILDE]}${z[W.XRANGEPLAINLOOSE]}$`);ie("LONECARET","(?:\\^)");ie("CARETTRIM",`(\\s*)${z[W.LONECARET]}\\s+`,!0);vt.caretTrimReplace="$1^";ie("CARET",`^${z[W.LONECARET]}${z[W.XRANGEPLAIN]}$`);ie("CARETLOOSE",`^${z[W.LONECARET]}${z[W.XRANGEPLAINLOOSE]}$`);ie("COMPARATORLOOSE",`^${z[W.GTLT]}\\s*(${z[W.LOOSEPLAIN]})$|^$`);ie("COMPARATOR",`^${z[W.GTLT]}\\s*(${z[W.FULLPLAIN]})$|^$`);ie("COMPARATORTRIM",`(\\s*)${z[W.GTLT]}\\s*(${z[W.LOOSEPLAIN]}|${z[W.XRANGEPLAIN]})`,!0);vt.comparatorTrimReplace="$1$2$3";ie("HYPHENRANGE",`^\\s*(${z[W.XRANGEPLAIN]})\\s+-\\s+(${z[W.XRANGEPLAIN]})\\s*$`);ie("HYPHENRANGELOOSE",`^\\s*(${z[W.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[W.XRANGEPLAINLOOSE]})\\s*$`);ie("STAR","(<|>)?=?\\s*\\*");ie("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ie("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var en=j((DT,Jf)=>{"use strict";var P1=Object.freeze({loose:!0}),I1=Object.freeze({}),F1=t=>t?typeof t!="object"?P1:t:I1;Jf.exports=F1});var qa=j((MT,eh)=>{"use strict";var Zf=/^[0-9]+$/,Qf=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Zf.test(t),i=Zf.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:t<e?-1:1},N1=(t,e)=>Qf(e,t);eh.exports={compareIdentifiers:Qf,rcompareIdentifiers:N1}});var Ie=j((kT,rh)=>{"use strict";var tn=Vi(),{MAX_LENGTH:th,MAX_SAFE_INTEGER:rn}=Wi(),{safeRe:sn,t:nn}=Xr(),D1=en(),{compareIdentifiers:za}=qa(),Wa=class t{constructor(e,r){if(r=D1(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.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>th)throw new TypeError(`version is longer than ${th} characters`);tn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=e.trim().match(r.loose?sn[nn.LOOSE]:sn[nn.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>rn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>rn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>rn||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let n=+s;if(n>=0&&n<rn)return n}return s}):this.prerelease=[],this.build=i[5]?i[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(tn("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 r=0;do{let i=this.prerelease[r],s=e.prerelease[r];if(tn("prerelease compare",r,i,s),i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(i===s)continue;return za(i,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let i=this.build[r],s=e.build[r];if(tn("build compare",r,i,s),i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(i===s)continue;return za(i,s)}while(++r)}inc(e,r,i){if(e.startsWith("pre")){if(!r&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?sn[nn.PRERELEASELOOSE]:sn[nn.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,i),this.inc("pre",r,i);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 s=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let n=[r,s];i===!1&&(n=[r]),za(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};rh.exports=Wa});var ar=j((jT,sh)=>{"use strict";var ih=Ie(),M1=(t,e,r=!1)=>{if(t instanceof ih)return t;try{return new ih(t,e)}catch(i){if(!r)return null;throw i}};sh.exports=M1});var oh=j((BT,nh)=>{"use strict";var k1=ar(),j1=(t,e)=>{let r=k1(t,e);return r?r.version:null};nh.exports=j1});var ch=j((UT,ah)=>{"use strict";var B1=ar(),U1=(t,e)=>{let r=B1(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};ah.exports=U1});var fh=j((GT,uh)=>{"use strict";var lh=Ie(),G1=(t,e,r,i,s)=>{typeof r=="string"&&(s=i,i=r,r=void 0);try{return new lh(t instanceof lh?t.version:t,r).inc(e,i,s).version}catch{return null}};uh.exports=G1});var dh=j((qT,ph)=>{"use strict";var hh=ar(),q1=(t,e)=>{let r=hh(t,null,!0),i=hh(e,null,!0),s=r.compare(i);if(s===0)return null;let n=s>0,a=n?r:i,o=n?i:r,c=!!a.prerelease.length;if(!!o.prerelease.length&&!c){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"};ph.exports=q1});var gh=j((zT,mh)=>{"use strict";var z1=Ie(),W1=(t,e)=>new z1(t,e).major;mh.exports=W1});var bh=j((WT,yh)=>{"use strict";var V1=Ie(),H1=(t,e)=>new V1(t,e).minor;yh.exports=H1});var wh=j((VT,vh)=>{"use strict";var K1=Ie(),Y1=(t,e)=>new K1(t,e).patch;vh.exports=Y1});var Eh=j((HT,xh)=>{"use strict";var X1=ar(),J1=(t,e)=>{let r=X1(t,e);return r&&r.prerelease.length?r.prerelease:null};xh.exports=J1});var Ze=j((KT,Sh)=>{"use strict";var _h=Ie(),Z1=(t,e,r)=>new _h(t,r).compare(new _h(e,r));Sh.exports=Z1});var Ch=j((YT,Rh)=>{"use strict";var Q1=Ze(),ex=(t,e,r)=>Q1(e,t,r);Rh.exports=ex});var Lh=j((XT,Ah)=>{"use strict";var tx=Ze(),rx=(t,e)=>tx(t,e,!0);Ah.exports=rx});var on=j((JT,$h)=>{"use strict";var Oh=Ie(),ix=(t,e,r)=>{let i=new Oh(t,r),s=new Oh(e,r);return i.compare(s)||i.compareBuild(s)};$h.exports=ix});var Ph=j((ZT,Th)=>{"use strict";var sx=on(),nx=(t,e)=>t.sort((r,i)=>sx(r,i,e));Th.exports=nx});var Fh=j((QT,Ih)=>{"use strict";var ox=on(),ax=(t,e)=>t.sort((r,i)=>ox(i,r,e));Ih.exports=ax});var Hi=j((eP,Nh)=>{"use strict";var cx=Ze(),lx=(t,e,r)=>cx(t,e,r)>0;Nh.exports=lx});var an=j((tP,Dh)=>{"use strict";var ux=Ze(),fx=(t,e,r)=>ux(t,e,r)<0;Dh.exports=fx});var Va=j((rP,Mh)=>{"use strict";var hx=Ze(),px=(t,e,r)=>hx(t,e,r)===0;Mh.exports=px});var Ha=j((iP,kh)=>{"use strict";var dx=Ze(),mx=(t,e,r)=>dx(t,e,r)!==0;kh.exports=mx});var cn=j((sP,jh)=>{"use strict";var gx=Ze(),yx=(t,e,r)=>gx(t,e,r)>=0;jh.exports=yx});var ln=j((nP,Bh)=>{"use strict";var bx=Ze(),vx=(t,e,r)=>bx(t,e,r)<=0;Bh.exports=vx});var Ka=j((oP,Uh)=>{"use strict";var wx=Va(),xx=Ha(),Ex=Hi(),_x=cn(),Sx=an(),Rx=ln(),Cx=(t,e,r,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return wx(t,r,i);case"!=":return xx(t,r,i);case">":return Ex(t,r,i);case">=":return _x(t,r,i);case"<":return Sx(t,r,i);case"<=":return Rx(t,r,i);default:throw new TypeError(`Invalid operator: ${e}`)}};Uh.exports=Cx});var qh=j((aP,Gh)=>{"use strict";var Ax=Ie(),Lx=ar(),{safeRe:un,t:fn}=Xr(),Ox=(t,e)=>{if(t instanceof Ax)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?un[fn.COERCEFULL]:un[fn.COERCE]);else{let c=e.includePrerelease?un[fn.COERCERTLFULL]:un[fn.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let i=r[2],s=r[3]||"0",n=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",o=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Lx(`${i}.${s}.${n}${a}${o}`,e)};Gh.exports=Ox});var Wh=j((cP,zh)=>{"use strict";var Ya=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};zh.exports=Ya});var Qe=j((lP,Yh)=>{"use strict";var $x=/\s+/g,Xa=class t{constructor(e,r){if(r=Px(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ja)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace($x," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(s=>!Hh(s[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&jx(s[0])){this.set=[s];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 r=this.set[e];for(let i=0;i<r.length;i++)i>0&&(this.formatted+=" "),this.formatted+=r[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let i=((this.options.includePrerelease&&Mx)|(this.options.loose&&kx))+":"+e,s=Vh.get(i);if(s)return s;let n=this.options.loose,a=n?Ue[Fe.HYPHENRANGELOOSE]:Ue[Fe.HYPHENRANGE];e=e.replace(a,Yx(this.options.includePrerelease)),pe("hyphen replace",e),e=e.replace(Ue[Fe.COMPARATORTRIM],Fx),pe("comparator trim",e),e=e.replace(Ue[Fe.TILDETRIM],Nx),pe("tilde trim",e),e=e.replace(Ue[Fe.CARETTRIM],Dx),pe("caret trim",e);let o=e.split(" ").map(d=>Bx(d,this.options)).join(" ").split(/\s+/).map(d=>Kx(d,this.options));n&&(o=o.filter(d=>(pe("loose invalid filter",d,this.options),!!d.match(Ue[Fe.COMPARATORLOOSE])))),pe("range list",o);let c=new Map,l=o.map(d=>new Ja(d,this.options));for(let d of l){if(Hh(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Vh.set(i,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>Kh(i,r)&&e.set.some(s=>Kh(s,r)&&i.every(n=>s.every(a=>n.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Ix(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Xx(this.set[r],e,this.options))return!0;return!1}};Yh.exports=Xa;var Tx=Wh(),Vh=new Tx,Px=en(),Ja=Ki(),pe=Vi(),Ix=Ie(),{safeRe:Ue,t:Fe,comparatorTrimReplace:Fx,tildeTrimReplace:Nx,caretTrimReplace:Dx}=Xr(),{FLAG_INCLUDE_PRERELEASE:Mx,FLAG_LOOSE:kx}=Wi(),Hh=t=>t.value==="<0.0.0-0",jx=t=>t.value==="",Kh=(t,e)=>{let r=!0,i=t.slice(),s=i.pop();for(;r&&i.length;)r=i.every(n=>s.intersects(n,e)),s=i.pop();return r},Bx=(t,e)=>(t=t.replace(Ue[Fe.BUILD],""),pe("comp",t,e),t=qx(t,e),pe("caret",t),t=Ux(t,e),pe("tildes",t),t=Wx(t,e),pe("xrange",t),t=Hx(t,e),pe("stars",t),t),Ge=t=>!t||t.toLowerCase()==="x"||t==="*",Ux=(t,e)=>t.trim().split(/\s+/).map(r=>Gx(r,e)).join(" "),Gx=(t,e)=>{let r=e.loose?Ue[Fe.TILDELOOSE]:Ue[Fe.TILDE];return t.replace(r,(i,s,n,a,o)=>{pe("tilde",t,i,s,n,a,o);let c;return Ge(s)?c="":Ge(n)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:Ge(a)?c=`>=${s}.${n}.0 <${s}.${+n+1}.0-0`:o?(pe("replaceTilde pr",o),c=`>=${s}.${n}.${a}-${o} <${s}.${+n+1}.0-0`):c=`>=${s}.${n}.${a} <${s}.${+n+1}.0-0`,pe("tilde return",c),c})},qx=(t,e)=>t.trim().split(/\s+/).map(r=>zx(r,e)).join(" "),zx=(t,e)=>{pe("caret",t,e);let r=e.loose?Ue[Fe.CARETLOOSE]:Ue[Fe.CARET],i=e.includePrerelease?"-0":"";return t.replace(r,(s,n,a,o,c)=>{pe("caret",t,s,n,a,o,c);let l;return Ge(n)?l="":Ge(a)?l=`>=${n}.0.0${i} <${+n+1}.0.0-0`:Ge(o)?n==="0"?l=`>=${n}.${a}.0${i} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.0${i} <${+n+1}.0.0-0`:c?(pe("replaceCaret pr",c),n==="0"?a==="0"?l=`>=${n}.${a}.${o}-${c} <${n}.${a}.${+o+1}-0`:l=`>=${n}.${a}.${o}-${c} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${o}-${c} <${+n+1}.0.0-0`):(pe("no pr"),n==="0"?a==="0"?l=`>=${n}.${a}.${o}${i} <${n}.${a}.${+o+1}-0`:l=`>=${n}.${a}.${o}${i} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${o} <${+n+1}.0.0-0`),pe("caret return",l),l})},Wx=(t,e)=>(pe("replaceXRanges",t,e),t.split(/\s+/).map(r=>Vx(r,e)).join(" ")),Vx=(t,e)=>{t=t.trim();let r=e.loose?Ue[Fe.XRANGELOOSE]:Ue[Fe.XRANGE];return t.replace(r,(i,s,n,a,o,c)=>{pe("xRange",t,i,s,n,a,o,c);let l=Ge(n),u=l||Ge(a),d=u||Ge(o),b=d;return s==="="&&b&&(s=""),c=e.includePrerelease?"-0":"",l?s===">"||s==="<"?i="<0.0.0-0":i="*":s&&b?(u&&(a=0),o=0,s===">"?(s=">=",u?(n=+n+1,a=0,o=0):(a=+a+1,o=0)):s==="<="&&(s="<",u?n=+n+1:a=+a+1),s==="<"&&(c="-0"),i=`${s+n}.${a}.${o}${c}`):u?i=`>=${n}.0.0${c} <${+n+1}.0.0-0`:d&&(i=`>=${n}.${a}.0${c} <${n}.${+a+1}.0-0`),pe("xRange return",i),i})},Hx=(t,e)=>(pe("replaceStars",t,e),t.trim().replace(Ue[Fe.STAR],"")),Kx=(t,e)=>(pe("replaceGTE0",t,e),t.trim().replace(Ue[e.includePrerelease?Fe.GTE0PRE:Fe.GTE0],"")),Yx=t=>(e,r,i,s,n,a,o,c,l,u,d,b)=>(Ge(i)?r="":Ge(s)?r=`>=${i}.0.0${t?"-0":""}`:Ge(n)?r=`>=${i}.${s}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ge(l)?c="":Ge(u)?c=`<${+l+1}.0.0-0`:Ge(d)?c=`<${l}.${+u+1}.0-0`:b?c=`<=${l}.${u}.${d}-${b}`:t?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Xx=(t,e,r)=>{for(let i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let i=0;i<t.length;i++)if(pe(t[i].semver),t[i].semver!==Ja.ANY&&t[i].semver.prerelease.length>0){let s=t[i].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Ki=j((uP,tp)=>{"use strict";var Yi=Symbol("SemVer ANY"),ec=class t{static get ANY(){return Yi}constructor(e,r){if(r=Xh(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Qa("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Yi?this.value="":this.value=this.operator+this.semver.version,Qa("comp",this)}parse(e){let r=this.options.loose?Jh[Zh.COMPARATORLOOSE]:Jh[Zh.COMPARATOR],i=e.match(r);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new Qh(i[2],this.options.loose):this.semver=Yi}toString(){return this.value}test(e){if(Qa("Comparator.test",e,this.options.loose),this.semver===Yi||e===Yi)return!0;if(typeof e=="string")try{e=new Qh(e,this.options)}catch{return!1}return Za(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new ep(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new ep(this.value,r).test(e.semver):(r=Xh(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.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("=")||Za(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Za(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};tp.exports=ec;var Xh=en(),{safeRe:Jh,t:Zh}=Xr(),Za=Ka(),Qa=Vi(),Qh=Ie(),ep=Qe()});var Xi=j((fP,rp)=>{"use strict";var Jx=Qe(),Zx=(t,e,r)=>{try{e=new Jx(e,r)}catch{return!1}return e.test(t)};rp.exports=Zx});var sp=j((hP,ip)=>{"use strict";var Qx=Qe(),eE=(t,e)=>new Qx(t,e).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));ip.exports=eE});var op=j((pP,np)=>{"use strict";var tE=Ie(),rE=Qe(),iE=(t,e,r)=>{let i=null,s=null,n=null;try{n=new rE(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!i||s.compare(a)===-1)&&(i=a,s=new tE(i,r))}),i};np.exports=iE});var cp=j((dP,ap)=>{"use strict";var sE=Ie(),nE=Qe(),oE=(t,e,r)=>{let i=null,s=null,n=null;try{n=new nE(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!i||s.compare(a)===1)&&(i=a,s=new sE(i,r))}),i};ap.exports=oE});var fp=j((mP,up)=>{"use strict";var tc=Ie(),aE=Qe(),lp=Hi(),cE=(t,e)=>{t=new aE(t,e);let r=new tc("0.0.0");if(t.test(r)||(r=new tc("0.0.0-0"),t.test(r)))return r;r=null;for(let i=0;i<t.set.length;++i){let s=t.set[i],n=null;s.forEach(a=>{let o=new tc(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||lp(o,n))&&(n=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!r||lp(r,n))&&(r=n)}return r&&t.test(r)?r:null};up.exports=cE});var pp=j((gP,hp)=>{"use strict";var lE=Qe(),uE=(t,e)=>{try{return new lE(t,e).range||"*"}catch{return null}};hp.exports=uE});var hn=j((yP,yp)=>{"use strict";var fE=Ie(),gp=Ki(),{ANY:hE}=gp,pE=Qe(),dE=Xi(),dp=Hi(),mp=an(),mE=ln(),gE=cn(),yE=(t,e,r,i)=>{t=new fE(t,i),e=new pE(e,i);let s,n,a,o,c;switch(r){case">":s=dp,n=mE,a=mp,o=">",c=">=";break;case"<":s=mp,n=gE,a=dp,o="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(dE(t,e,i))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],d=null,b=null;if(u.forEach(f=>{f.semver===hE&&(f=new gp(">=0.0.0")),d=d||f,b=b||f,s(f.semver,d.semver,i)?d=f:a(f.semver,b.semver,i)&&(b=f)}),d.operator===o||d.operator===c||(!b.operator||b.operator===o)&&n(t,b.semver))return!1;if(b.operator===c&&a(t,b.semver))return!1}return!0};yp.exports=yE});var vp=j((bP,bp)=>{"use strict";var bE=hn(),vE=(t,e,r)=>bE(t,e,">",r);bp.exports=vE});var xp=j((vP,wp)=>{"use strict";var wE=hn(),xE=(t,e,r)=>wE(t,e,"<",r);wp.exports=xE});var Sp=j((wP,_p)=>{"use strict";var Ep=Qe(),EE=(t,e,r)=>(t=new Ep(t,r),e=new Ep(e,r),t.intersects(e,r));_p.exports=EE});var Cp=j((xP,Rp)=>{"use strict";var _E=Xi(),SE=Ze();Rp.exports=(t,e,r)=>{let i=[],s=null,n=null,a=t.sort((u,d)=>SE(u,d,r));for(let u of a)_E(u,e,r)?(n=u,s||(s=u)):(n&&i.push([s,n]),n=null,s=null);s&&i.push([s,null]);let o=[];for(let[u,d]of i)u===d?o.push(u):!d&&u===a[0]?o.push("*"):d?u===a[0]?o.push(`<=${d}`):o.push(`${u} - ${d}`):o.push(`>=${u}`);let c=o.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Pp=j((EP,Tp)=>{"use strict";var Ap=Qe(),ic=Ki(),{ANY:rc}=ic,Ji=Xi(),sc=Ze(),RE=(t,e,r={})=>{if(t===e)return!0;t=new Ap(t,r),e=new Ap(e,r);let i=!1;e:for(let s of t.set){for(let n of e.set){let a=AE(s,n,r);if(i=i||a!==null,a)continue e}if(i)return!1}return!0},CE=[new ic(">=0.0.0-0")],Lp=[new ic(">=0.0.0")],AE=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===rc){if(e.length===1&&e[0].semver===rc)return!0;r.includePrerelease?t=CE:t=Lp}if(e.length===1&&e[0].semver===rc){if(r.includePrerelease)return!0;e=Lp}let i=new Set,s,n;for(let f of t)f.operator===">"||f.operator===">="?s=Op(s,f,r):f.operator==="<"||f.operator==="<="?n=$p(n,f,r):i.add(f.semver);if(i.size>1)return null;let a;if(s&&n){if(a=sc(s.semver,n.semver,r),a>0)return null;if(a===0&&(s.operator!==">="||n.operator!=="<="))return null}for(let f of i){if(s&&!Ji(f,String(s),r)||n&&!Ji(f,String(n),r))return null;for(let p of e)if(!Ji(f,String(p),r))return!1;return!0}let o,c,l,u,d=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1,b=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&n.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of e){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",s){if(b&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===b.major&&f.semver.minor===b.minor&&f.semver.patch===b.patch&&(b=!1),f.operator===">"||f.operator===">="){if(o=Op(s,f,r),o===f&&o!==s)return!1}else if(s.operator===">="&&!Ji(s.semver,String(f),r))return!1}if(n){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=$p(n,f,r),c===f&&c!==n)return!1}else if(n.operator==="<="&&!Ji(n.semver,String(f),r))return!1}if(!f.operator&&(n||s)&&a!==0)return!1}return!(s&&l&&!n&&a!==0||n&&u&&!s&&a!==0||b||d)},Op=(t,e,r)=>{if(!t)return e;let i=sc(t.semver,e.semver,r);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},$p=(t,e,r)=>{if(!t)return e;let i=sc(t.semver,e.semver,r);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};Tp.exports=RE});var oc=j((_P,Np)=>{"use strict";var nc=Xr(),Ip=Wi(),LE=Ie(),Fp=qa(),OE=ar(),$E=oh(),TE=ch(),PE=fh(),IE=dh(),FE=gh(),NE=bh(),DE=wh(),ME=Eh(),kE=Ze(),jE=Ch(),BE=Lh(),UE=on(),GE=Ph(),qE=Fh(),zE=Hi(),WE=an(),VE=Va(),HE=Ha(),KE=cn(),YE=ln(),XE=Ka(),JE=qh(),ZE=Ki(),QE=Qe(),e_=Xi(),t_=sp(),r_=op(),i_=cp(),s_=fp(),n_=pp(),o_=hn(),a_=vp(),c_=xp(),l_=Sp(),u_=Cp(),f_=Pp();Np.exports={parse:OE,valid:$E,clean:TE,inc:PE,diff:IE,major:FE,minor:NE,patch:DE,prerelease:ME,compare:kE,rcompare:jE,compareLoose:BE,compareBuild:UE,sort:GE,rsort:qE,gt:zE,lt:WE,eq:VE,neq:HE,gte:KE,lte:YE,cmp:XE,coerce:JE,Comparator:ZE,Range:QE,satisfies:e_,toComparators:t_,maxSatisfying:r_,minSatisfying:i_,minVersion:s_,validRange:n_,outside:o_,gtr:a_,ltr:c_,intersects:l_,simplifyRange:u_,subset:f_,SemVer:LE,re:nc.re,src:nc.src,tokens:nc.t,SEMVER_SPEC_VERSION:Ip.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ip.RELEASE_TYPES,compareIdentifiers:Fp.compareIdentifiers,rcompareIdentifiers:Fp.rcompareIdentifiers}});var Mp=j((SP,Dp)=>{function et(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Dp.exports=et;et.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};et.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};et.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},r),this._options.unref&&this._timer.unref(),!0};et.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};et.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};et.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};et.prototype.start=et.prototype.try;et.prototype.errors=function(){return this._errors};et.prototype.attempts=function(){return this._attempts};et.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,i=0;i<this._errors.length;i++){var s=this._errors[i],n=s.message,a=(t[n]||0)+1;t[n]=a,a>=r&&(e=s,r=a)}return e}});var kp=j(cr=>{var h_=Mp();cr.operation=function(t){var e=cr.timeouts(t);return new h_(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};cr.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],s=0;s<e.retries;s++)i.push(this.createTimeout(s,e));return t&&t.forever&&!i.length&&i.push(this.createTimeout(s,e)),i.sort(function(n,a){return n-a}),i};cr.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,i=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return i=Math.min(i,e.maxTimeout),i};cr.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var i in t)typeof t[i]=="function"&&r.push(i)}for(var s=0;s<r.length;s++){var n=r[s],a=t[n];t[n]=function(c){var l=cr.operation(e),u=Array.prototype.slice.call(arguments,1),d=u.pop();u.push(function(b){l.retry(b)||(b&&(arguments[0]=l.mainError()),d.apply(this,arguments))}),l.attempt(function(){c.apply(t,u)})}.bind(t,a),t[n].options=e}}});var Bp=j((CP,jp)=>{jp.exports=kp()});var xc=j(Rr=>{Rr.parse=Rr.decode=BS;Rr.stringify=Rr.encode=dd;Rr.safe=ai;Rr.unsafe=_n;var wc=typeof process<"u"&&process.platform==="win32"?`\r
|
|
3
|
+
var Ty=Object.create;var qs=Object.defineProperty;var Py=Object.getOwnPropertyDescriptor;var Iy=Object.getOwnPropertyNames;var Fy=Object.getPrototypeOf,Ny=Object.prototype.hasOwnProperty;var D=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Dy=(t,e)=>()=>(t&&(e=t(t=0)),e);var j=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),jo=(t,e)=>{for(var r in e)qs(t,r,{get:e[r],enumerable:!0})},Hl=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Iy(e))!Ny.call(t,s)&&s!==r&&qs(t,s,{get:()=>e[s],enumerable:!(i=Py(e,s))||i.enumerable});return t};var We=(t,e,r)=>(r=t!=null?Ty(Fy(t)):{},Hl(e||!t||!t.__esModule?qs(r,"default",{value:t,enumerable:!0}):r,t)),My=t=>Hl(qs({},"__esModule",{value:!0}),t);var cu=j((Z$,cb)=>{cb.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var fu=j((Q$,At)=>{var qo=D("fs"),Wo=D("path"),lb=D("os"),ub=D("crypto"),hb=cu(),Vo=hb.version,fb=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function pb(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
|
4
|
+
`);let i;for(;(i=fb.exec(r))!=null;){let s=i[1],n=i[2]||"";n=n.trim();let a=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),a==='"'&&(n=n.replace(/\\n/g,`
|
|
5
|
+
`),n=n.replace(/\\r/g,"\r")),e[s]=n}return e}function db(t){let e=hu(t),r=_e.configDotenv({path:e});if(!r.parsed){let a=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw a.code="MISSING_DATA",a}let i=uu(t).split(","),s=i.length,n;for(let a=0;a<s;a++)try{let o=i[a].trim(),c=yb(r,o);n=_e.decrypt(c.ciphertext,c.key);break}catch(o){if(a+1>=s)throw o}return _e.parse(n)}function mb(t){console.log(`[dotenv@${Vo}][INFO] ${t}`)}function gb(t){console.log(`[dotenv@${Vo}][WARN] ${t}`)}function Ks(t){console.log(`[dotenv@${Vo}][DEBUG] ${t}`)}function uu(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function yb(t,e){let r;try{r=new URL(e)}catch(o){if(o.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw o}let i=r.password;if(!i){let o=new Error("INVALID_DOTENV_KEY: Missing key part");throw o.code="INVALID_DOTENV_KEY",o}let s=r.searchParams.get("environment");if(!s){let o=new Error("INVALID_DOTENV_KEY: Missing environment part");throw o.code="INVALID_DOTENV_KEY",o}let n=`DOTENV_VAULT_${s.toUpperCase()}`,a=t.parsed[n];if(!a){let o=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);throw o.code="NOT_FOUND_DOTENV_ENVIRONMENT",o}return{ciphertext:a,key:i}}function hu(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)qo.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=Wo.resolve(process.cwd(),".env.vault");return qo.existsSync(e)?e:null}function lu(t){return t[0]==="~"?Wo.join(lb.homedir(),t.slice(1)):t}function bb(t){mb("Loading env from encrypted .env.vault");let e=_e._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),_e.populate(r,e,t),{parsed:e}}function vb(t){let e=Wo.resolve(process.cwd(),".env"),r="utf8",i=!!(t&&t.debug);t&&t.encoding?r=t.encoding:i&&Ks("No encoding is specified. UTF-8 is used by default");let s=[e];if(t&&t.path)if(!Array.isArray(t.path))s=[lu(t.path)];else{s=[];for(let c of t.path)s.push(lu(c))}let n,a={};for(let c of s)try{let l=_e.parse(qo.readFileSync(c,{encoding:r}));_e.populate(a,l,t)}catch(l){i&&Ks(`Failed to load ${c} ${l.message}`),n=l}let o=process.env;return t&&t.processEnv!=null&&(o=t.processEnv),_e.populate(o,a,t),n?{parsed:a,error:n}:{parsed:a}}function wb(t){if(uu(t).length===0)return _e.configDotenv(t);let e=hu(t);return e?_e._configVault(t):(gb(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),_e.configDotenv(t))}function xb(t,e){let r=Buffer.from(e.slice(-64),"hex"),i=Buffer.from(t,"base64"),s=i.subarray(0,12),n=i.subarray(-16);i=i.subarray(12,-16);try{let a=ub.createDecipheriv("aes-256-gcm",r,s);return a.setAuthTag(n),`${a.update(i)}${a.final()}`}catch(a){let o=a instanceof RangeError,c=a.message==="Invalid key length",l=a.message==="Unsupported state or unable to authenticate data";if(o||c){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(l){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw a}}function Eb(t,e,r={}){let i=!!(r&&r.debug),s=!!(r&&r.override);if(typeof e!="object"){let n=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw n.code="OBJECT_REQUIRED",n}for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(t,n)?(s===!0&&(t[n]=e[n]),i&&Ks(s===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):t[n]=e[n]}var _e={configDotenv:vb,_configVault:bb,_parseVault:db,config:wb,decrypt:xb,parse:pb,populate:Eb};At.exports.configDotenv=_e.configDotenv;At.exports._configVault=_e._configVault;At.exports._parseVault=_e._parseVault;At.exports.config=_e.config;At.exports.decrypt=_e.decrypt;At.exports.parse=_e.parse;At.exports.populate=_e.populate;At.exports=_e});var Wi=j((FT,Hh)=>{"use strict";var y1="2.0.0",b1=Number.MAX_SAFE_INTEGER||9007199254740991,v1=16,w1=250,x1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Hh.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:v1,MAX_SAFE_BUILD_LENGTH:w1,MAX_SAFE_INTEGER:b1,RELEASE_TYPES:x1,SEMVER_SPEC_VERSION:y1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Vi=j((NT,Kh)=>{"use strict";var E1=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Kh.exports=E1});var Xr=j((vt,Yh)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ua,MAX_SAFE_BUILD_LENGTH:_1,MAX_LENGTH:S1}=Wi(),R1=Vi();vt=Yh.exports={};var C1=vt.re=[],A1=vt.safeRe=[],q=vt.src=[],L1=vt.safeSrc=[],W=vt.t={},O1=0,Ga="[a-zA-Z0-9-]",$1=[["\\s",1],["\\d",S1],[Ga,_1]],T1=t=>{for(let[e,r]of $1)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ie=(t,e,r)=>{let i=T1(e),s=O1++;R1(t,s,e),W[t]=s,q[s]=e,L1[s]=i,C1[s]=new RegExp(e,r?"g":void 0),A1[s]=new RegExp(i,r?"g":void 0)};ie("NUMERICIDENTIFIER","0|[1-9]\\d*");ie("NUMERICIDENTIFIERLOOSE","\\d+");ie("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ga}*`);ie("MAINVERSION",`(${q[W.NUMERICIDENTIFIER]})\\.(${q[W.NUMERICIDENTIFIER]})\\.(${q[W.NUMERICIDENTIFIER]})`);ie("MAINVERSIONLOOSE",`(${q[W.NUMERICIDENTIFIERLOOSE]})\\.(${q[W.NUMERICIDENTIFIERLOOSE]})\\.(${q[W.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASEIDENTIFIER",`(?:${q[W.NONNUMERICIDENTIFIER]}|${q[W.NUMERICIDENTIFIER]})`);ie("PRERELEASEIDENTIFIERLOOSE",`(?:${q[W.NONNUMERICIDENTIFIER]}|${q[W.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASE",`(?:-(${q[W.PRERELEASEIDENTIFIER]}(?:\\.${q[W.PRERELEASEIDENTIFIER]})*))`);ie("PRERELEASELOOSE",`(?:-?(${q[W.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${q[W.PRERELEASEIDENTIFIERLOOSE]})*))`);ie("BUILDIDENTIFIER",`${Ga}+`);ie("BUILD",`(?:\\+(${q[W.BUILDIDENTIFIER]}(?:\\.${q[W.BUILDIDENTIFIER]})*))`);ie("FULLPLAIN",`v?${q[W.MAINVERSION]}${q[W.PRERELEASE]}?${q[W.BUILD]}?`);ie("FULL",`^${q[W.FULLPLAIN]}$`);ie("LOOSEPLAIN",`[v=\\s]*${q[W.MAINVERSIONLOOSE]}${q[W.PRERELEASELOOSE]}?${q[W.BUILD]}?`);ie("LOOSE",`^${q[W.LOOSEPLAIN]}$`);ie("GTLT","((?:<|>)?=?)");ie("XRANGEIDENTIFIERLOOSE",`${q[W.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ie("XRANGEIDENTIFIER",`${q[W.NUMERICIDENTIFIER]}|x|X|\\*`);ie("XRANGEPLAIN",`[v=\\s]*(${q[W.XRANGEIDENTIFIER]})(?:\\.(${q[W.XRANGEIDENTIFIER]})(?:\\.(${q[W.XRANGEIDENTIFIER]})(?:${q[W.PRERELEASE]})?${q[W.BUILD]}?)?)?`);ie("XRANGEPLAINLOOSE",`[v=\\s]*(${q[W.XRANGEIDENTIFIERLOOSE]})(?:\\.(${q[W.XRANGEIDENTIFIERLOOSE]})(?:\\.(${q[W.XRANGEIDENTIFIERLOOSE]})(?:${q[W.PRERELEASELOOSE]})?${q[W.BUILD]}?)?)?`);ie("XRANGE",`^${q[W.GTLT]}\\s*${q[W.XRANGEPLAIN]}$`);ie("XRANGELOOSE",`^${q[W.GTLT]}\\s*${q[W.XRANGEPLAINLOOSE]}$`);ie("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ua}})(?:\\.(\\d{1,${Ua}}))?(?:\\.(\\d{1,${Ua}}))?`);ie("COERCE",`${q[W.COERCEPLAIN]}(?:$|[^\\d])`);ie("COERCEFULL",q[W.COERCEPLAIN]+`(?:${q[W.PRERELEASE]})?(?:${q[W.BUILD]})?(?:$|[^\\d])`);ie("COERCERTL",q[W.COERCE],!0);ie("COERCERTLFULL",q[W.COERCEFULL],!0);ie("LONETILDE","(?:~>?)");ie("TILDETRIM",`(\\s*)${q[W.LONETILDE]}\\s+`,!0);vt.tildeTrimReplace="$1~";ie("TILDE",`^${q[W.LONETILDE]}${q[W.XRANGEPLAIN]}$`);ie("TILDELOOSE",`^${q[W.LONETILDE]}${q[W.XRANGEPLAINLOOSE]}$`);ie("LONECARET","(?:\\^)");ie("CARETTRIM",`(\\s*)${q[W.LONECARET]}\\s+`,!0);vt.caretTrimReplace="$1^";ie("CARET",`^${q[W.LONECARET]}${q[W.XRANGEPLAIN]}$`);ie("CARETLOOSE",`^${q[W.LONECARET]}${q[W.XRANGEPLAINLOOSE]}$`);ie("COMPARATORLOOSE",`^${q[W.GTLT]}\\s*(${q[W.LOOSEPLAIN]})$|^$`);ie("COMPARATOR",`^${q[W.GTLT]}\\s*(${q[W.FULLPLAIN]})$|^$`);ie("COMPARATORTRIM",`(\\s*)${q[W.GTLT]}\\s*(${q[W.LOOSEPLAIN]}|${q[W.XRANGEPLAIN]})`,!0);vt.comparatorTrimReplace="$1$2$3";ie("HYPHENRANGE",`^\\s*(${q[W.XRANGEPLAIN]})\\s+-\\s+(${q[W.XRANGEPLAIN]})\\s*$`);ie("HYPHENRANGELOOSE",`^\\s*(${q[W.XRANGEPLAINLOOSE]})\\s+-\\s+(${q[W.XRANGEPLAINLOOSE]})\\s*$`);ie("STAR","(<|>)?=?\\s*\\*");ie("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ie("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var en=j((DT,Xh)=>{"use strict";var P1=Object.freeze({loose:!0}),I1=Object.freeze({}),F1=t=>t?typeof t!="object"?P1:t:I1;Xh.exports=F1});var za=j((MT,Qh)=>{"use strict";var Jh=/^[0-9]+$/,Zh=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Jh.test(t),i=Jh.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:t<e?-1:1},N1=(t,e)=>Zh(e,t);Qh.exports={compareIdentifiers:Zh,rcompareIdentifiers:N1}});var Ie=j((kT,tf)=>{"use strict";var tn=Vi(),{MAX_LENGTH:ef,MAX_SAFE_INTEGER:rn}=Wi(),{safeRe:sn,t:nn}=Xr(),D1=en(),{compareIdentifiers:qa}=za(),Wa=class t{constructor(e,r){if(r=D1(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.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>ef)throw new TypeError(`version is longer than ${ef} characters`);tn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=e.trim().match(r.loose?sn[nn.LOOSE]:sn[nn.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>rn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>rn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>rn||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let n=+s;if(n>=0&&n<rn)return n}return s}):this.prerelease=[],this.build=i[5]?i[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(tn("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 r=0;do{let i=this.prerelease[r],s=e.prerelease[r];if(tn("prerelease compare",r,i,s),i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(i===s)continue;return qa(i,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let i=this.build[r],s=e.build[r];if(tn("build compare",r,i,s),i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(i===s)continue;return qa(i,s)}while(++r)}inc(e,r,i){if(e.startsWith("pre")){if(!r&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?sn[nn.PRERELEASELOOSE]:sn[nn.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,i),this.inc("pre",r,i);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 s=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let n=[r,s];i===!1&&(n=[r]),qa(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};tf.exports=Wa});var ar=j((jT,sf)=>{"use strict";var rf=Ie(),M1=(t,e,r=!1)=>{if(t instanceof rf)return t;try{return new rf(t,e)}catch(i){if(!r)return null;throw i}};sf.exports=M1});var of=j((BT,nf)=>{"use strict";var k1=ar(),j1=(t,e)=>{let r=k1(t,e);return r?r.version:null};nf.exports=j1});var cf=j((UT,af)=>{"use strict";var B1=ar(),U1=(t,e)=>{let r=B1(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};af.exports=U1});var hf=j((GT,uf)=>{"use strict";var lf=Ie(),G1=(t,e,r,i,s)=>{typeof r=="string"&&(s=i,i=r,r=void 0);try{return new lf(t instanceof lf?t.version:t,r).inc(e,i,s).version}catch{return null}};uf.exports=G1});var df=j((zT,pf)=>{"use strict";var ff=ar(),z1=(t,e)=>{let r=ff(t,null,!0),i=ff(e,null,!0),s=r.compare(i);if(s===0)return null;let n=s>0,a=n?r:i,o=n?i:r,c=!!a.prerelease.length;if(!!o.prerelease.length&&!c){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"};pf.exports=z1});var gf=j((qT,mf)=>{"use strict";var q1=Ie(),W1=(t,e)=>new q1(t,e).major;mf.exports=W1});var bf=j((WT,yf)=>{"use strict";var V1=Ie(),H1=(t,e)=>new V1(t,e).minor;yf.exports=H1});var wf=j((VT,vf)=>{"use strict";var K1=Ie(),Y1=(t,e)=>new K1(t,e).patch;vf.exports=Y1});var Ef=j((HT,xf)=>{"use strict";var X1=ar(),J1=(t,e)=>{let r=X1(t,e);return r&&r.prerelease.length?r.prerelease:null};xf.exports=J1});var Ze=j((KT,Sf)=>{"use strict";var _f=Ie(),Z1=(t,e,r)=>new _f(t,r).compare(new _f(e,r));Sf.exports=Z1});var Cf=j((YT,Rf)=>{"use strict";var Q1=Ze(),ex=(t,e,r)=>Q1(e,t,r);Rf.exports=ex});var Lf=j((XT,Af)=>{"use strict";var tx=Ze(),rx=(t,e)=>tx(t,e,!0);Af.exports=rx});var on=j((JT,$f)=>{"use strict";var Of=Ie(),ix=(t,e,r)=>{let i=new Of(t,r),s=new Of(e,r);return i.compare(s)||i.compareBuild(s)};$f.exports=ix});var Pf=j((ZT,Tf)=>{"use strict";var sx=on(),nx=(t,e)=>t.sort((r,i)=>sx(r,i,e));Tf.exports=nx});var Ff=j((QT,If)=>{"use strict";var ox=on(),ax=(t,e)=>t.sort((r,i)=>ox(i,r,e));If.exports=ax});var Hi=j((eP,Nf)=>{"use strict";var cx=Ze(),lx=(t,e,r)=>cx(t,e,r)>0;Nf.exports=lx});var an=j((tP,Df)=>{"use strict";var ux=Ze(),hx=(t,e,r)=>ux(t,e,r)<0;Df.exports=hx});var Va=j((rP,Mf)=>{"use strict";var fx=Ze(),px=(t,e,r)=>fx(t,e,r)===0;Mf.exports=px});var Ha=j((iP,kf)=>{"use strict";var dx=Ze(),mx=(t,e,r)=>dx(t,e,r)!==0;kf.exports=mx});var cn=j((sP,jf)=>{"use strict";var gx=Ze(),yx=(t,e,r)=>gx(t,e,r)>=0;jf.exports=yx});var ln=j((nP,Bf)=>{"use strict";var bx=Ze(),vx=(t,e,r)=>bx(t,e,r)<=0;Bf.exports=vx});var Ka=j((oP,Uf)=>{"use strict";var wx=Va(),xx=Ha(),Ex=Hi(),_x=cn(),Sx=an(),Rx=ln(),Cx=(t,e,r,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return wx(t,r,i);case"!=":return xx(t,r,i);case">":return Ex(t,r,i);case">=":return _x(t,r,i);case"<":return Sx(t,r,i);case"<=":return Rx(t,r,i);default:throw new TypeError(`Invalid operator: ${e}`)}};Uf.exports=Cx});var zf=j((aP,Gf)=>{"use strict";var Ax=Ie(),Lx=ar(),{safeRe:un,t:hn}=Xr(),Ox=(t,e)=>{if(t instanceof Ax)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?un[hn.COERCEFULL]:un[hn.COERCE]);else{let c=e.includePrerelease?un[hn.COERCERTLFULL]:un[hn.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let i=r[2],s=r[3]||"0",n=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",o=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Lx(`${i}.${s}.${n}${a}${o}`,e)};Gf.exports=Ox});var Wf=j((cP,qf)=>{"use strict";var Ya=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};qf.exports=Ya});var Qe=j((lP,Yf)=>{"use strict";var $x=/\s+/g,Xa=class t{constructor(e,r){if(r=Px(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ja)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace($x," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(s=>!Hf(s[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&jx(s[0])){this.set=[s];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 r=this.set[e];for(let i=0;i<r.length;i++)i>0&&(this.formatted+=" "),this.formatted+=r[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let i=((this.options.includePrerelease&&Mx)|(this.options.loose&&kx))+":"+e,s=Vf.get(i);if(s)return s;let n=this.options.loose,a=n?Ue[Fe.HYPHENRANGELOOSE]:Ue[Fe.HYPHENRANGE];e=e.replace(a,Yx(this.options.includePrerelease)),de("hyphen replace",e),e=e.replace(Ue[Fe.COMPARATORTRIM],Fx),de("comparator trim",e),e=e.replace(Ue[Fe.TILDETRIM],Nx),de("tilde trim",e),e=e.replace(Ue[Fe.CARETTRIM],Dx),de("caret trim",e);let o=e.split(" ").map(d=>Bx(d,this.options)).join(" ").split(/\s+/).map(d=>Kx(d,this.options));n&&(o=o.filter(d=>(de("loose invalid filter",d,this.options),!!d.match(Ue[Fe.COMPARATORLOOSE])))),de("range list",o);let c=new Map,l=o.map(d=>new Ja(d,this.options));for(let d of l){if(Hf(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Vf.set(i,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>Kf(i,r)&&e.set.some(s=>Kf(s,r)&&i.every(n=>s.every(a=>n.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Ix(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Xx(this.set[r],e,this.options))return!0;return!1}};Yf.exports=Xa;var Tx=Wf(),Vf=new Tx,Px=en(),Ja=Ki(),de=Vi(),Ix=Ie(),{safeRe:Ue,t:Fe,comparatorTrimReplace:Fx,tildeTrimReplace:Nx,caretTrimReplace:Dx}=Xr(),{FLAG_INCLUDE_PRERELEASE:Mx,FLAG_LOOSE:kx}=Wi(),Hf=t=>t.value==="<0.0.0-0",jx=t=>t.value==="",Kf=(t,e)=>{let r=!0,i=t.slice(),s=i.pop();for(;r&&i.length;)r=i.every(n=>s.intersects(n,e)),s=i.pop();return r},Bx=(t,e)=>(t=t.replace(Ue[Fe.BUILD],""),de("comp",t,e),t=zx(t,e),de("caret",t),t=Ux(t,e),de("tildes",t),t=Wx(t,e),de("xrange",t),t=Hx(t,e),de("stars",t),t),Ge=t=>!t||t.toLowerCase()==="x"||t==="*",Ux=(t,e)=>t.trim().split(/\s+/).map(r=>Gx(r,e)).join(" "),Gx=(t,e)=>{let r=e.loose?Ue[Fe.TILDELOOSE]:Ue[Fe.TILDE];return t.replace(r,(i,s,n,a,o)=>{de("tilde",t,i,s,n,a,o);let c;return Ge(s)?c="":Ge(n)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:Ge(a)?c=`>=${s}.${n}.0 <${s}.${+n+1}.0-0`:o?(de("replaceTilde pr",o),c=`>=${s}.${n}.${a}-${o} <${s}.${+n+1}.0-0`):c=`>=${s}.${n}.${a} <${s}.${+n+1}.0-0`,de("tilde return",c),c})},zx=(t,e)=>t.trim().split(/\s+/).map(r=>qx(r,e)).join(" "),qx=(t,e)=>{de("caret",t,e);let r=e.loose?Ue[Fe.CARETLOOSE]:Ue[Fe.CARET],i=e.includePrerelease?"-0":"";return t.replace(r,(s,n,a,o,c)=>{de("caret",t,s,n,a,o,c);let l;return Ge(n)?l="":Ge(a)?l=`>=${n}.0.0${i} <${+n+1}.0.0-0`:Ge(o)?n==="0"?l=`>=${n}.${a}.0${i} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.0${i} <${+n+1}.0.0-0`:c?(de("replaceCaret pr",c),n==="0"?a==="0"?l=`>=${n}.${a}.${o}-${c} <${n}.${a}.${+o+1}-0`:l=`>=${n}.${a}.${o}-${c} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${o}-${c} <${+n+1}.0.0-0`):(de("no pr"),n==="0"?a==="0"?l=`>=${n}.${a}.${o}${i} <${n}.${a}.${+o+1}-0`:l=`>=${n}.${a}.${o}${i} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${o} <${+n+1}.0.0-0`),de("caret return",l),l})},Wx=(t,e)=>(de("replaceXRanges",t,e),t.split(/\s+/).map(r=>Vx(r,e)).join(" ")),Vx=(t,e)=>{t=t.trim();let r=e.loose?Ue[Fe.XRANGELOOSE]:Ue[Fe.XRANGE];return t.replace(r,(i,s,n,a,o,c)=>{de("xRange",t,i,s,n,a,o,c);let l=Ge(n),u=l||Ge(a),d=u||Ge(o),g=d;return s==="="&&g&&(s=""),c=e.includePrerelease?"-0":"",l?s===">"||s==="<"?i="<0.0.0-0":i="*":s&&g?(u&&(a=0),o=0,s===">"?(s=">=",u?(n=+n+1,a=0,o=0):(a=+a+1,o=0)):s==="<="&&(s="<",u?n=+n+1:a=+a+1),s==="<"&&(c="-0"),i=`${s+n}.${a}.${o}${c}`):u?i=`>=${n}.0.0${c} <${+n+1}.0.0-0`:d&&(i=`>=${n}.${a}.0${c} <${n}.${+a+1}.0-0`),de("xRange return",i),i})},Hx=(t,e)=>(de("replaceStars",t,e),t.trim().replace(Ue[Fe.STAR],"")),Kx=(t,e)=>(de("replaceGTE0",t,e),t.trim().replace(Ue[e.includePrerelease?Fe.GTE0PRE:Fe.GTE0],"")),Yx=t=>(e,r,i,s,n,a,o,c,l,u,d,g)=>(Ge(i)?r="":Ge(s)?r=`>=${i}.0.0${t?"-0":""}`:Ge(n)?r=`>=${i}.${s}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ge(l)?c="":Ge(u)?c=`<${+l+1}.0.0-0`:Ge(d)?c=`<${l}.${+u+1}.0-0`:g?c=`<=${l}.${u}.${d}-${g}`:t?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Xx=(t,e,r)=>{for(let i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let i=0;i<t.length;i++)if(de(t[i].semver),t[i].semver!==Ja.ANY&&t[i].semver.prerelease.length>0){let s=t[i].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Ki=j((uP,tp)=>{"use strict";var Yi=Symbol("SemVer ANY"),ec=class t{static get ANY(){return Yi}constructor(e,r){if(r=Xf(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Qa("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Yi?this.value="":this.value=this.operator+this.semver.version,Qa("comp",this)}parse(e){let r=this.options.loose?Jf[Zf.COMPARATORLOOSE]:Jf[Zf.COMPARATOR],i=e.match(r);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new Qf(i[2],this.options.loose):this.semver=Yi}toString(){return this.value}test(e){if(Qa("Comparator.test",e,this.options.loose),this.semver===Yi||e===Yi)return!0;if(typeof e=="string")try{e=new Qf(e,this.options)}catch{return!1}return Za(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new ep(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new ep(this.value,r).test(e.semver):(r=Xf(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.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("=")||Za(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Za(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};tp.exports=ec;var Xf=en(),{safeRe:Jf,t:Zf}=Xr(),Za=Ka(),Qa=Vi(),Qf=Ie(),ep=Qe()});var Xi=j((hP,rp)=>{"use strict";var Jx=Qe(),Zx=(t,e,r)=>{try{e=new Jx(e,r)}catch{return!1}return e.test(t)};rp.exports=Zx});var sp=j((fP,ip)=>{"use strict";var Qx=Qe(),eE=(t,e)=>new Qx(t,e).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));ip.exports=eE});var op=j((pP,np)=>{"use strict";var tE=Ie(),rE=Qe(),iE=(t,e,r)=>{let i=null,s=null,n=null;try{n=new rE(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!i||s.compare(a)===-1)&&(i=a,s=new tE(i,r))}),i};np.exports=iE});var cp=j((dP,ap)=>{"use strict";var sE=Ie(),nE=Qe(),oE=(t,e,r)=>{let i=null,s=null,n=null;try{n=new nE(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!i||s.compare(a)===1)&&(i=a,s=new sE(i,r))}),i};ap.exports=oE});var hp=j((mP,up)=>{"use strict";var tc=Ie(),aE=Qe(),lp=Hi(),cE=(t,e)=>{t=new aE(t,e);let r=new tc("0.0.0");if(t.test(r)||(r=new tc("0.0.0-0"),t.test(r)))return r;r=null;for(let i=0;i<t.set.length;++i){let s=t.set[i],n=null;s.forEach(a=>{let o=new tc(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||lp(o,n))&&(n=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!r||lp(r,n))&&(r=n)}return r&&t.test(r)?r:null};up.exports=cE});var pp=j((gP,fp)=>{"use strict";var lE=Qe(),uE=(t,e)=>{try{return new lE(t,e).range||"*"}catch{return null}};fp.exports=uE});var fn=j((yP,yp)=>{"use strict";var hE=Ie(),gp=Ki(),{ANY:fE}=gp,pE=Qe(),dE=Xi(),dp=Hi(),mp=an(),mE=ln(),gE=cn(),yE=(t,e,r,i)=>{t=new hE(t,i),e=new pE(e,i);let s,n,a,o,c;switch(r){case">":s=dp,n=mE,a=mp,o=">",c=">=";break;case"<":s=mp,n=gE,a=dp,o="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(dE(t,e,i))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],d=null,g=null;if(u.forEach(h=>{h.semver===fE&&(h=new gp(">=0.0.0")),d=d||h,g=g||h,s(h.semver,d.semver,i)?d=h:a(h.semver,g.semver,i)&&(g=h)}),d.operator===o||d.operator===c||(!g.operator||g.operator===o)&&n(t,g.semver))return!1;if(g.operator===c&&a(t,g.semver))return!1}return!0};yp.exports=yE});var vp=j((bP,bp)=>{"use strict";var bE=fn(),vE=(t,e,r)=>bE(t,e,">",r);bp.exports=vE});var xp=j((vP,wp)=>{"use strict";var wE=fn(),xE=(t,e,r)=>wE(t,e,"<",r);wp.exports=xE});var Sp=j((wP,_p)=>{"use strict";var Ep=Qe(),EE=(t,e,r)=>(t=new Ep(t,r),e=new Ep(e,r),t.intersects(e,r));_p.exports=EE});var Cp=j((xP,Rp)=>{"use strict";var _E=Xi(),SE=Ze();Rp.exports=(t,e,r)=>{let i=[],s=null,n=null,a=t.sort((u,d)=>SE(u,d,r));for(let u of a)_E(u,e,r)?(n=u,s||(s=u)):(n&&i.push([s,n]),n=null,s=null);s&&i.push([s,null]);let o=[];for(let[u,d]of i)u===d?o.push(u):!d&&u===a[0]?o.push("*"):d?u===a[0]?o.push(`<=${d}`):o.push(`${u} - ${d}`):o.push(`>=${u}`);let c=o.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Pp=j((EP,Tp)=>{"use strict";var Ap=Qe(),ic=Ki(),{ANY:rc}=ic,Ji=Xi(),sc=Ze(),RE=(t,e,r={})=>{if(t===e)return!0;t=new Ap(t,r),e=new Ap(e,r);let i=!1;e:for(let s of t.set){for(let n of e.set){let a=AE(s,n,r);if(i=i||a!==null,a)continue e}if(i)return!1}return!0},CE=[new ic(">=0.0.0-0")],Lp=[new ic(">=0.0.0")],AE=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===rc){if(e.length===1&&e[0].semver===rc)return!0;r.includePrerelease?t=CE:t=Lp}if(e.length===1&&e[0].semver===rc){if(r.includePrerelease)return!0;e=Lp}let i=new Set,s,n;for(let h of t)h.operator===">"||h.operator===">="?s=Op(s,h,r):h.operator==="<"||h.operator==="<="?n=$p(n,h,r):i.add(h.semver);if(i.size>1)return null;let a;if(s&&n){if(a=sc(s.semver,n.semver,r),a>0)return null;if(a===0&&(s.operator!==">="||n.operator!=="<="))return null}for(let h of i){if(s&&!Ji(h,String(s),r)||n&&!Ji(h,String(n),r))return null;for(let p of e)if(!Ji(h,String(p),r))return!1;return!0}let o,c,l,u,d=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1,g=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&n.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of e){if(u=u||h.operator===">"||h.operator===">=",l=l||h.operator==="<"||h.operator==="<=",s){if(g&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===g.major&&h.semver.minor===g.minor&&h.semver.patch===g.patch&&(g=!1),h.operator===">"||h.operator===">="){if(o=Op(s,h,r),o===h&&o!==s)return!1}else if(s.operator===">="&&!Ji(s.semver,String(h),r))return!1}if(n){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(c=$p(n,h,r),c===h&&c!==n)return!1}else if(n.operator==="<="&&!Ji(n.semver,String(h),r))return!1}if(!h.operator&&(n||s)&&a!==0)return!1}return!(s&&l&&!n&&a!==0||n&&u&&!s&&a!==0||g||d)},Op=(t,e,r)=>{if(!t)return e;let i=sc(t.semver,e.semver,r);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},$p=(t,e,r)=>{if(!t)return e;let i=sc(t.semver,e.semver,r);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};Tp.exports=RE});var oc=j((_P,Np)=>{"use strict";var nc=Xr(),Ip=Wi(),LE=Ie(),Fp=za(),OE=ar(),$E=of(),TE=cf(),PE=hf(),IE=df(),FE=gf(),NE=bf(),DE=wf(),ME=Ef(),kE=Ze(),jE=Cf(),BE=Lf(),UE=on(),GE=Pf(),zE=Ff(),qE=Hi(),WE=an(),VE=Va(),HE=Ha(),KE=cn(),YE=ln(),XE=Ka(),JE=zf(),ZE=Ki(),QE=Qe(),e_=Xi(),t_=sp(),r_=op(),i_=cp(),s_=hp(),n_=pp(),o_=fn(),a_=vp(),c_=xp(),l_=Sp(),u_=Cp(),h_=Pp();Np.exports={parse:OE,valid:$E,clean:TE,inc:PE,diff:IE,major:FE,minor:NE,patch:DE,prerelease:ME,compare:kE,rcompare:jE,compareLoose:BE,compareBuild:UE,sort:GE,rsort:zE,gt:qE,lt:WE,eq:VE,neq:HE,gte:KE,lte:YE,cmp:XE,coerce:JE,Comparator:ZE,Range:QE,satisfies:e_,toComparators:t_,maxSatisfying:r_,minSatisfying:i_,minVersion:s_,validRange:n_,outside:o_,gtr:a_,ltr:c_,intersects:l_,simplifyRange:u_,subset:h_,SemVer:LE,re:nc.re,src:nc.src,tokens:nc.t,SEMVER_SPEC_VERSION:Ip.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ip.RELEASE_TYPES,compareIdentifiers:Fp.compareIdentifiers,rcompareIdentifiers:Fp.rcompareIdentifiers}});var Mp=j((SP,Dp)=>{function et(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Dp.exports=et;et.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};et.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};et.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},r),this._options.unref&&this._timer.unref(),!0};et.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};et.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};et.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};et.prototype.start=et.prototype.try;et.prototype.errors=function(){return this._errors};et.prototype.attempts=function(){return this._attempts};et.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,i=0;i<this._errors.length;i++){var s=this._errors[i],n=s.message,a=(t[n]||0)+1;t[n]=a,a>=r&&(e=s,r=a)}return e}});var kp=j(cr=>{var f_=Mp();cr.operation=function(t){var e=cr.timeouts(t);return new f_(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};cr.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],s=0;s<e.retries;s++)i.push(this.createTimeout(s,e));return t&&t.forever&&!i.length&&i.push(this.createTimeout(s,e)),i.sort(function(n,a){return n-a}),i};cr.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,i=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return i=Math.min(i,e.maxTimeout),i};cr.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var i in t)typeof t[i]=="function"&&r.push(i)}for(var s=0;s<r.length;s++){var n=r[s],a=t[n];t[n]=function(c){var l=cr.operation(e),u=Array.prototype.slice.call(arguments,1),d=u.pop();u.push(function(g){l.retry(g)||(g&&(arguments[0]=l.mainError()),d.apply(this,arguments))}),l.attempt(function(){c.apply(t,u)})}.bind(t,a),t[n].options=e}}});var Bp=j((CP,jp)=>{jp.exports=kp()});var xc=j(Rr=>{Rr.parse=Rr.decode=BS;Rr.stringify=Rr.encode=dd;Rr.safe=ai;Rr.unsafe=_n;var wc=typeof process<"u"&&process.platform==="win32"?`\r
|
|
6
6
|
`:`
|
|
7
7
|
`;function dd(t,e){var r=[],i="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var s=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(n,a,o){var c=t[n];c&&Array.isArray(c)?c.forEach(function(l){i+=ai(n+"[]")+s+ai(l)+`
|
|
8
|
-
`}):c&&typeof c=="object"?r.push(n):i+=ai(n)+s+ai(c)+wc}),e.section&&i.length&&(i="["+ai(e.section)+"]"+wc+i),r.forEach(function(n,a,o){var c=md(n).join("\\."),l=(e.section?e.section+".":"")+c,u=dd(t[n],{section:l,whitespace:e.whitespace});i.length&&u.length&&(i+=wc),i+=u}),i}function md(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function BS(t){var e={},r=e,i=null,s=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,n=t.split(/[\r\n]+/g);return n.forEach(function(a,o,c){if(!(!a||a.match(/^\s*[;#]/))){var l=a.match(s);if(l){if(l[1]!==void 0){if(i=_n(l[1]),i==="__proto__"){r={};return}r=e[i]=e[i]||{};return}var u=_n(l[2]);if(u!=="__proto__"){var d=l[3]?_n(l[4]):!0;switch(d){case"true":case"false":case"null":d=JSON.parse(d)}if(u.length>2&&u.slice(-2)==="[]"){if(u=u.substring(0,u.length-2),u==="__proto__")return;r[u]?Array.isArray(r[u])||(r[u]=[r[u]]):r[u]=[]}Array.isArray(r[u])?r[u].push(d):r[u]=d}}}}),Object.keys(e).filter(function(a,o,c){if(!e[a]||typeof e[a]!="object"||Array.isArray(e[a]))return!1;var l=md(a),u=e,d=l.pop(),
|
|
8
|
+
`}):c&&typeof c=="object"?r.push(n):i+=ai(n)+s+ai(c)+wc}),e.section&&i.length&&(i="["+ai(e.section)+"]"+wc+i),r.forEach(function(n,a,o){var c=md(n).join("\\."),l=(e.section?e.section+".":"")+c,u=dd(t[n],{section:l,whitespace:e.whitespace});i.length&&u.length&&(i+=wc),i+=u}),i}function md(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function BS(t){var e={},r=e,i=null,s=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,n=t.split(/[\r\n]+/g);return n.forEach(function(a,o,c){if(!(!a||a.match(/^\s*[;#]/))){var l=a.match(s);if(l){if(l[1]!==void 0){if(i=_n(l[1]),i==="__proto__"){r={};return}r=e[i]=e[i]||{};return}var u=_n(l[2]);if(u!=="__proto__"){var d=l[3]?_n(l[4]):!0;switch(d){case"true":case"false":case"null":d=JSON.parse(d)}if(u.length>2&&u.slice(-2)==="[]"){if(u=u.substring(0,u.length-2),u==="__proto__")return;r[u]?Array.isArray(r[u])||(r[u]=[r[u]]):r[u]=[]}Array.isArray(r[u])?r[u].push(d):r[u]=d}}}}),Object.keys(e).filter(function(a,o,c){if(!e[a]||typeof e[a]!="object"||Array.isArray(e[a]))return!1;var l=md(a),u=e,d=l.pop(),g=d.replace(/\\\./g,".");return l.forEach(function(h,p,m){h!=="__proto__"&&((!u[h]||typeof u[h]!="object")&&(u[h]={}),u=u[h])}),u===e&&g===d?!1:(u[g]=e[a],!0)}).forEach(function(a,o,c){delete e[a]}),e}function gd(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ai(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&gd(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function _n(t,e){if(t=(t||"").trim(),gd(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,i="",s=0,n=t.length;s<n;s++){var a=t.charAt(s);if(r)"\\;#".indexOf(a)!==-1?i+=a:i+="\\"+a,r=!1;else{if(";#".indexOf(a)!==-1)break;a==="\\"?r=!0:i+=a}}return r&&(i+="\\"),i.trim()}return t}});var vd=j((DI,bd)=>{"use strict";var Ec=1,yd=2;function US(){return""}function GS(t,e,r){return t.slice(e,r).replace(/\S/g," ")}bd.exports=function(t,e){e=e||{};for(var r,i,s=!1,n=!1,a=0,o="",c=e.whitespace===!1?US:GS,l=0;l<t.length;l++){if(r=t[l],i=t[l+1],!n&&r==='"'){var u=t[l-1]==="\\"&&t[l-2]!=="\\";u||(s=!s)}if(!s){if(!n&&r+i==="//")o+=t.slice(a,l),a=l,n=Ec,l++;else if(n===Ec&&r+i===`\r
|
|
9
9
|
`){l++,n=!1,o+=c(t,a,l),a=l;continue}else if(n===Ec&&r===`
|
|
10
|
-
`)n=!1,o+=c(t,a,l),a=l;else if(!n&&r+i==="/*"){o+=t.slice(a,l),a=l,n=yd,l++;continue}else if(n===yd&&r+i==="*/"){l++,n=!1,o+=c(t,a,l+1),a=l+1;continue}}}return o+(n?c(t.substr(a)):t.substr(a))}});var xd=j(ci=>{"use strict";var wd=D("fs"),qS=xc(),ns=D("path"),zS=vd(),WS=ci.parse=function(t){return/^\s*{/.test(t)?JSON.parse(zS(t)):qS.parse(t)},VS=ci.file=function(){var t=[].slice.call(arguments).filter(function(s){return s!=null});for(var e in t)if(typeof t[e]!="string")return;var r=ns.join.apply(null,t),i;try{return wd.readFileSync(r,"utf-8")}catch{return}},MI=ci.json=function(){var t=VS.apply(null,arguments);return t?WS(t):null},kI=ci.env=function(t,e){e=e||process.env;var r={},i=t.length;for(var s in e)if(s.toLowerCase().indexOf(t.toLowerCase())===0){for(var n=s.substring(i).split("__"),a;(a=n.indexOf(""))>-1;)n.splice(a,1);var o=r;n.forEach(function(l,u){!l||typeof o!="object"||(u===n.length-1&&(o[l]=e[s]),o[l]===void 0&&(o[l]={}),o=o[l])})}return r},jI=ci.find=function(){var t=ns.join.apply(null,[].slice.call(arguments));function e(r,i){var s=ns.join(r,i);try{return wd.statSync(s),s}catch{if(ns.dirname(r)!==r)return e(ns.dirname(r),i)}}return e(process.cwd(),t)}});var Ad=j((UI,Cd)=>{"use strict";function _d(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Sd(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Rd(t){var e=[];return t.forEach(function(r,i){typeof r=="object"&&r!==null?Array.isArray(r)?e[i]=Rd(r):_d(r)?e[i]=Sd(r):e[i]=_c({},r):e[i]=r}),e}function Ed(t,e){return e==="__proto__"?void 0:t[e]}var _c=Cd.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,i,s;return e.forEach(function(n){typeof n!="object"||n===null||Array.isArray(n)||Object.keys(n).forEach(function(a){if(i=Ed(t,a),r=Ed(n,a),r!==t)if(typeof r!="object"||r===null){t[a]=r;return}else if(Array.isArray(r)){t[a]=Rd(r);return}else if(_d(r)){t[a]=Sd(r);return}else if(typeof i!="object"||i===null||Array.isArray(i)){t[a]=_c({},r);return}else{t[a]=_c(i,r);return}})}),t}});var Td=j((GI,$d)=>{"use strict";function HS(t,e){var r=t;e.slice(0,-1).forEach(function(s){r=r[s]||{}});var i=e[e.length-1];return i in r}function Ld(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Od(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}$d.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(h){r.bools[h]=!0});var i={};function s(h){return i[h].some(function(v){return r.bools[v]})}Object.keys(e.alias||{}).forEach(function(h){i[h]=[].concat(e.alias[h]),i[h].forEach(function(v){i[v]=[h].concat(i[h].filter(function(x){return v!==x}))})}),[].concat(e.string).filter(Boolean).forEach(function(h){r.strings[h]=!0,i[h]&&[].concat(i[h]).forEach(function(v){r.strings[v]=!0})});var n=e.default||{},a={_:[]};function o(h,v){return r.allBools&&/^--[^=]+$/.test(v)||r.strings[h]||r.bools[h]||i[h]}function c(h,v,x){for(var _=h,A=0;A<v.length-1;A++){var C=v[A];if(Od(_,C))return;_[C]===void 0&&(_[C]={}),(_[C]===Object.prototype||_[C]===Number.prototype||_[C]===String.prototype)&&(_[C]={}),_[C]===Array.prototype&&(_[C]=[]),_=_[C]}var O=v[v.length-1];Od(_,O)||((_===Object.prototype||_===Number.prototype||_===String.prototype)&&(_={}),_===Array.prototype&&(_=[]),_[O]===void 0||r.bools[O]||typeof _[O]=="boolean"?_[O]=x:Array.isArray(_[O])?_[O].push(x):_[O]=[_[O],x])}function l(h,v,x){if(!(x&&r.unknownFn&&!o(h,x)&&r.unknownFn(x)===!1)){var _=!r.strings[h]&&Ld(v)?Number(v):v;c(a,h.split("."),_),(i[h]||[]).forEach(function(A){c(a,A.split("."),_)})}}Object.keys(r.bools).forEach(function(h){l(h,n[h]===void 0?!1:n[h])});var u=[];t.indexOf("--")!==-1&&(u=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var d=0;d<t.length;d++){var b=t[d],f,p;if(/^--.+=/.test(b)){var m=b.match(/^--([^=]+)=([\s\S]*)$/);f=m[1];var y=m[2];r.bools[f]&&(y=y!=="false"),l(f,y,b)}else if(/^--no-.+/.test(b))f=b.match(/^--no-(.+)/)[1],l(f,!1,b);else if(/^--.+/.test(b))f=b.match(/^--(.+)/)[1],p=t[d+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!r.bools[f]&&!r.allBools&&(!i[f]||!s(f))?(l(f,p,b),d+=1):/^(true|false)$/.test(p)?(l(f,p==="true",b),d+=1):l(f,r.strings[f]?"":!0,b);else if(/^-[^-]+/.test(b)){for(var g=b.slice(1,-1).split(""),w=!1,E=0;E<g.length;E++){if(p=b.slice(E+2),p==="-"){l(g[E],p,b);continue}if(/[A-Za-z]/.test(g[E])&&p[0]==="="){l(g[E],p.slice(1),b),w=!0;break}if(/[A-Za-z]/.test(g[E])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){l(g[E],p,b),w=!0;break}if(g[E+1]&&g[E+1].match(/\W/)){l(g[E],b.slice(E+2),b),w=!0;break}else l(g[E],r.strings[g[E]]?"":!0,b)}f=b.slice(-1)[0],!w&&f!=="-"&&(t[d+1]&&!/^(-|--)[^-]/.test(t[d+1])&&!r.bools[f]&&(!i[f]||!s(f))?(l(f,t[d+1],b),d+=1):t[d+1]&&/^(true|false)$/.test(t[d+1])?(l(f,t[d+1]==="true",b),d+=1):l(f,r.strings[f]?"":!0,b))}else if((!r.unknownFn||r.unknownFn(b)!==!1)&&a._.push(r.strings._||!Ld(b)?b:Number(b)),e.stopEarly){a._.push.apply(a._,t.slice(d+1));break}}return Object.keys(n).forEach(function(h){HS(a,h.split("."))||(c(a,h.split("."),n[h]),(i[h]||[]).forEach(function(v){c(a,v.split("."),n[h])}))}),e["--"]?a["--"]=u.slice():u.forEach(function(h){a._.push(h)}),a}});var Nd=j((qI,Fd)=>{var os=xd(),li=D("path").join,KS=Ad(),Pd="/etc",Id=process.platform==="win32",as=Id?process.env.USERPROFILE:process.env.HOME;Fd.exports=function(t,e,r,i){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=Td()(process.argv.slice(2))),e=(typeof e=="string"?os.json(e):e)||{},i=i||os.parse;var s=os.env(t+"_"),n=[e],a=[];function o(c){if(!(a.indexOf(c)>=0)){var l=os.file(c);l&&(n.push(i(l)),a.push(c))}}return Id||[li(Pd,t,"config"),li(Pd,t+"rc")].forEach(o),as&&[li(as,".config",t,"config"),li(as,".config",t),li(as,"."+t,"config"),li(as,"."+t+"rc")].forEach(o),o(os.find("."+t+"rc")),s.config&&o(s.config),r.config&&o(r.config),KS.apply(null,n.concat([s,r,a.length?{configs:a,config:a[a.length-1]}:void 0]))}});var kd=j((WI,Md)=>{var Ht=D("constants"),YS=process.cwd,Sn=null,XS=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Sn||(Sn=YS.call(process)),Sn};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Rc=process.chdir,process.chdir=function(t){Sn=null,Rc.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rc));var Rc;Md.exports=JS;function JS(t){Ht.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=n(t.chown),t.fchown=n(t.fchown),t.lchown=n(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=o(t.stat),t.fstat=o(t.fstat),t.lstat=o(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,d,b){b&&process.nextTick(b)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,d,b,f){f&&process.nextTick(f)},t.lchownSync=function(){}),XS==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function d(b,f,p){var m=Date.now(),y=0;u(b,f,function g(w){if(w&&(w.code==="EACCES"||w.code==="EPERM")&&Date.now()-m<6e4){setTimeout(function(){t.stat(f,function(E,h){E&&E.code==="ENOENT"?u(b,f,g):p(w)})},y),y<100&&(y+=10);return}p&&p(w)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function d(b,f,p,m,y,g){var w;if(g&&typeof g=="function"){var E=0;w=function(h,v,x){if(h&&h.code==="EAGAIN"&&E<10)return E++,u.call(t,b,f,p,m,y,w);g.apply(this,arguments)}}return u.call(t,b,f,p,m,y,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(d,b,f,p,m){for(var y=0;;)try{return u.call(t,d,b,f,p,m)}catch(g){if(g.code==="EAGAIN"&&y<10){y++;continue}throw g}}})(t.readSync);function e(u){u.lchmod=function(d,b,f){u.open(d,Ht.O_WRONLY|Ht.O_SYMLINK,b,function(p,m){if(p){f&&f(p);return}u.fchmod(m,b,function(y){u.close(m,function(g){f&&f(y||g)})})})},u.lchmodSync=function(d,b){var f=u.openSync(d,Ht.O_WRONLY|Ht.O_SYMLINK,b),p=!0,m;try{m=u.fchmodSync(f,b),p=!1}finally{if(p)try{u.closeSync(f)}catch{}else u.closeSync(f)}return m}}function r(u){Ht.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,b,f,p){u.open(d,Ht.O_SYMLINK,function(m,y){if(m){p&&p(m);return}u.futimes(y,b,f,function(g){u.close(y,function(w){p&&p(g||w)})})})},u.lutimesSync=function(d,b,f){var p=u.openSync(d,Ht.O_SYMLINK),m,y=!0;try{m=u.futimesSync(p,b,f),y=!1}finally{if(y)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}):u.futimes&&(u.lutimes=function(d,b,f,p){p&&process.nextTick(p)},u.lutimesSync=function(){})}function i(u){return u&&function(d,b,f){return u.call(t,d,b,function(p){l(p)&&(p=null),f&&f.apply(this,arguments)})}}function s(u){return u&&function(d,b){try{return u.call(t,d,b)}catch(f){if(!l(f))throw f}}}function n(u){return u&&function(d,b,f,p){return u.call(t,d,b,f,function(m){l(m)&&(m=null),p&&p.apply(this,arguments)})}}function a(u){return u&&function(d,b,f){try{return u.call(t,d,b,f)}catch(p){if(!l(p))throw p}}}function o(u){return u&&function(d,b,f){typeof b=="function"&&(f=b,b=null);function p(m,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),f&&f.apply(this,arguments)}return b?u.call(t,d,b,p):u.call(t,d,p)}}function c(u){return u&&function(d,b){var f=b?u.call(t,d,b):u.call(t,d);return f&&(f.uid<0&&(f.uid+=4294967296),f.gid<0&&(f.gid+=4294967296)),f}}function l(u){if(!u||u.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Ud=j((VI,Bd)=>{var jd=D("stream").Stream;Bd.exports=ZS;function ZS(t){return{ReadStream:e,WriteStream:r};function e(i,s){if(!(this instanceof e))return new e(i,s);jd.call(this);var n=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var a=Object.keys(s),o=0,c=a.length;o<c;o++){var l=a[o];this[l]=s[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){n._read()});return}t.open(this.path,this.flags,this.mode,function(u,d){if(u){n.emit("error",u),n.readable=!1;return}n.fd=d,n.emit("open",d),n._read()})}function r(i,s){if(!(this instanceof r))return new r(i,s);jd.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var n=Object.keys(s),a=0,o=n.length;a<o;a++){var c=n[a];this[c]=s[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var qd=j((HI,Gd)=>{"use strict";Gd.exports=eR;var QS=Object.getPrototypeOf||function(t){return t.__proto__};function eR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:QS(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Hd=j((KI,Lc)=>{var ve=D("fs"),tR=kd(),rR=Ud(),iR=qd(),Rn=D("util"),Te,An;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Te=Symbol.for("graceful-fs.queue"),An=Symbol.for("graceful-fs.previous")):(Te="___graceful-fs.queue",An="___graceful-fs.previous");function sR(){}function Vd(t,e){Object.defineProperty(t,Te,{get:function(){return e}})}var Cr=sR;Rn.debuglog?Cr=Rn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Cr=function(){var t=Rn.format.apply(Rn,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
11
|
-
GFS4: `),console.error(t)});ve[Te]||(zd=global[Te]||[],Vd(ve,zd),ve.close=(function(t){function e(r,i){return t.call(ve,r,function(s){s||Wd(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(e,An,{value:t}),e})(ve.close),ve.closeSync=(function(t){function e(r){t.apply(ve,arguments),Wd()}return Object.defineProperty(e,An,{value:t}),e})(ve.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Cr(ve[Te]),D("assert").equal(ve[Te].length,0)}));var zd;global[Te]||Vd(global,ve[Te]);Lc.exports=Cc(iR(ve));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ve.__patched&&(Lc.exports=Cc(ve),ve.__patched=!0);function Cc(t){tR(t),t.gracefulify=Cc,t.createReadStream=v,t.createWriteStream=x;var e=t.readFile;t.readFile=r;function r(C,O,F){return typeof O=="function"&&(F=O,O=null),M(C,O,F);function M(I,Y,Z,G){return e(I,Y,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?ui([M,[I,Y,Z],V,G||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}var i=t.writeFile;t.writeFile=s;function s(C,O,F,M){return typeof F=="function"&&(M=F,F=null),I(C,O,F,M);function I(Y,Z,G,V,se){return i(Y,Z,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.appendFile;n&&(t.appendFile=a);function a(C,O,F,M){return typeof F=="function"&&(M=F,F=null),I(C,O,F,M);function I(Y,Z,G,V,se){return n(Y,Z,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var o=t.copyFile;o&&(t.copyFile=c);function c(C,O,F,M){return typeof F=="function"&&(M=F,F=0),I(C,O,F,M);function I(Y,Z,G,V,se){return o(Y,Z,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var l=t.readdir;t.readdir=d;var u=/^v[0-5]\./;function d(C,O,F){typeof O=="function"&&(F=O,O=null);var M=u.test(process.version)?function(Z,G,V,se){return l(Z,I(Z,G,V,se))}:function(Z,G,V,se){return l(Z,G,I(Z,G,V,se))};return M(C,O,F);function I(Y,Z,G,V){return function(se,ee){se&&(se.code==="EMFILE"||se.code==="ENFILE")?ui([M,[Y,Z,G],se,V||Date.now(),Date.now()]):(ee&&ee.sort&&ee.sort(),typeof G=="function"&&G.call(this,se,ee))}}}if(process.version.substr(0,4)==="v0.8"){var b=rR(t);g=b.ReadStream,E=b.WriteStream}var f=t.ReadStream;f&&(g.prototype=Object.create(f.prototype),g.prototype.open=w);var p=t.WriteStream;p&&(E.prototype=Object.create(p.prototype),E.prototype.open=h),Object.defineProperty(t,"ReadStream",{get:function(){return g},set:function(C){g=C},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return E},set:function(C){E=C},enumerable:!0,configurable:!0});var m=g;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(C){m=C},enumerable:!0,configurable:!0});var y=E;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(C){y=C},enumerable:!0,configurable:!0});function g(C,O){return this instanceof g?(f.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function w(){var C=this;A(C.path,C.flags,C.mode,function(O,F){O?(C.autoClose&&C.destroy(),C.emit("error",O)):(C.fd=F,C.emit("open",F),C.read())})}function E(C,O){return this instanceof E?(p.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function h(){var C=this;A(C.path,C.flags,C.mode,function(O,F){O?(C.destroy(),C.emit("error",O)):(C.fd=F,C.emit("open",F))})}function v(C,O){return new t.ReadStream(C,O)}function x(C,O){return new t.WriteStream(C,O)}var _=t.open;t.open=A;function A(C,O,F,M){return typeof F=="function"&&(M=F,F=null),I(C,O,F,M);function I(Y,Z,G,V,se){return _(Y,Z,G,function(ee,we){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}return t}function ui(t){Cr("ENQUEUE",t[0].name,t[1]),ve[Te].push(t),Ac()}var Cn;function Wd(){for(var t=Date.now(),e=0;e<ve[Te].length;++e)ve[Te][e].length>2&&(ve[Te][e][3]=t,ve[Te][e][4]=t);Ac()}function Ac(){if(clearTimeout(Cn),Cn=void 0,ve[Te].length!==0){var t=ve[Te].shift(),e=t[0],r=t[1],i=t[2],s=t[3],n=t[4];if(s===void 0)Cr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Cr("TIMEOUT",e.name,r);var a=r.pop();typeof a=="function"&&a.call(null,i)}else{var o=Date.now()-n,c=Math.max(n-s,1),l=Math.min(c*1.2,100);o>=l?(Cr("RETRY",e.name,r),e.apply(null,r.concat([s]))):ve[Te].push(t)}Cn===void 0&&(Cn=setTimeout(Ac,0))}}});var Kd=j(fi=>{"use strict";var nR=fi&&fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fi,"__esModule",{value:!0});fi.readCAFileSync=void 0;var oR=nR(Hd());function aR(t){try{let e=oR.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(s=>!!s.trim()).map(s=>`${s.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}fi.readCAFileSync=aR});var Yd=j(Ar=>{"use strict";var cR=Ar&&Ar.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),lR=Ar&&Ar.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cR(e,t,r)};Object.defineProperty(Ar,"__esModule",{value:!0});lR(Kd(),Ar)});var Zd=j((JI,Jd)=>{Jd.exports=Xd;function Lr(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Xd(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&Lr(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Xd.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&Lr(this.list[this.list.length-1],t),Lr(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&Lr(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return Lr(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&Lr(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)Lr(this.list[e],this.list[e+1]||this.root);return t}}});var rm=j((It,tm)=>{var Qd=Zd(),cs=D("path"),Ln=D("fs"),Oc=xc(),$c=D("events").EventEmitter,uR=D("url"),fR=D("http"),It=tm.exports=function(){for(var t=[].slice.call(arguments),e=new De;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?pR(r):r)}return e},ZI=It.find=function(){var t=cs.join.apply(null,[].slice.call(arguments));function e(r,i){var s=cs.join(r,i);try{return Ln.statSync(s),s}catch{if(cs.dirname(r)!==r)return e(cs.dirname(r),i)}}return e(__dirname,t)},hR=It.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(i){this.emit("error",i)}else return JSON.parse(t);else return Oc.parse(t);else try{return JSON.parse(t)}catch{return Oc.parse(t)}},pR=It.json=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null}),e=cs.join.apply(null,t),r;try{r=Ln.readFileSync(e,"utf-8")}catch{return}return hR(r,e,"json")},QI=It.env=function(t,e){e=e||process.env;var r={},i=t.length;for(var s in e)s.indexOf(t)===0&&(r[s.substring(i)]=e[s]);return r};It.ConfigChain=De;function De(){$c.apply(this),Qd.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var em={constructor:{value:De}};Object.keys($c.prototype).forEach(function(t){em[t]=Object.getOwnPropertyDescriptor($c.prototype,t)});De.prototype=Object.create(Qd.prototype,em);De.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var i=0,s=this.list.length;i<s;i++)delete this.list[i][t];return this};De.prototype.set=function(t,e,r){var i;if(r){if(i=this.sources[r],i=i&&i.data,!i)return this.emit("error",new Error("not found "+r))}else if(i=this.list[0],!i)return this.emit("error",new Error("cannot set, no confs!"));return i[t]=e,this};De.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};De.prototype.save=function(t,n,r){typeof n=="function"&&(r=n,n=null);var i=this.sources[t];if(!i||!(i.path||i.source)||!i.data)return this.emit("error",new Error("bad save target: "+t));if(i.source){var s=i.prefix||"";return Object.keys(i.data).forEach(function(o){i.source[s+o]=i.data[o]}),this}var n=n||i.type,a=i.data;return i.type==="json"?a=JSON.stringify(a):a=Oc.stringify(a),this._saving++,Ln.writeFile(i.path,a,"utf8",function(o){if(this._saving--,o)return r?r(o):this.emit("error",o);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};De.prototype.addFile=function(t,e,r){r=r||t;var i={__source__:r};return this.sources[r]={path:t,type:e},this.push(i),this._await(),Ln.readFile(t,"utf8",function(s,n){s&&this.emit("error",s),this.addString(n,t,e,i)}.bind(this)),this};De.prototype.addEnv=function(t,e,r){r=r||"env";var i=It.env(t,e);return this.sources[r]={data:i,source:e,prefix:t},this.add(i,r)};De.prototype.addUrl=function(t,e,r){this._await();var i=uR.format(t);r=r||i;var s={__source__:r};return this.sources[r]={href:i,type:e},this.push(s),fR.request(t,function(n){var a=[],o=n.headers["content-type"];e||(e=o.indexOf("json")!==-1?"json":o.indexOf("ini")!==-1?"ini":i.match(/\.json$/)?"json":i.match(/\.ini$/)?"ini":null,s.type=e),n.on("data",a.push.bind(a)).on("end",function(){this.addString(Buffer.concat(a),i,e,s)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};De.prototype.addString=function(t,e,r,i){return t=this.parse(t,e,r),this.add(t,i),this};De.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};De.prototype.parse=It.parse;De.prototype._await=function(){this._awaiting++};De.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var sm=j((e2,im)=>{im.exports=function(t){let e=t.indexOf(":");if(e===-1)return Tc(t);let r=t.substr(0,e),i=t.substr(e+1);return`${Tc(r)}:${Tc(i)}`};function Tc(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var nm=j(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.envReplace=void 0;var dR=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function mR(t,e){return t.replace(dR,gR.bind(null,e))}On.envReplace=mR;function gR(t,e,r,i){if(r.length%2)return e.slice((r.length+1)/2);let s=bR(t,i);if(s===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${s}`}var yR=/([^:-]+)(:?)-(.+)/;function bR(t,e){let r=e.match(yR);if(!r)return t[e];let[,i,s,n]=r;return Object.prototype.hasOwnProperty.call(t,i)?!t[i]&&s?n:t[i]:n}});var om=j($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.envReplace=void 0;var vR=nm();Object.defineProperty($n,"envReplace",{enumerable:!0,get:function(){return vR.envReplace}})});var am=j(ls=>{"use strict";var wR=D("fs"),Or=D("path"),{envReplace:Pc}=om(),xR=t=>typeof t!="string"?t:Pc(t,process.env),ER=(t,e,r)=>{if(typeof e!="string")return e;let i=[].concat(t[r]),s=i.indexOf(Or)!==-1,n=i.indexOf(Boolean)!==-1,a=i.indexOf(String)!==-1,o=i.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(n&&!a&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=Pc(e,process.env),s&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Or.resolve(process.env.HOME,e.substr(2))),e=Or.resolve(e)),o&&!isNaN(e)&&(e=Number(e)),e},_R=t=>{t=Or.resolve(t);let e=!1;for(;Or.basename(t)==="node_modules";)t=Or.dirname(t),e=!0;if(e)return t;let r=(i,s)=>{let n=/^[a-zA-Z]:(\\|\/)?$/;if(i==="/"||process.platform==="win32"&&n.test(i))return s;try{let a=wR.readdirSync(i);if(a.includes("node_modules")||a.includes("package.json")||a.includes("package.json5")||a.includes("package.yaml")||a.includes("pnpm-workspace.yaml"))return i;let o=Or.dirname(i);return o===i?s:r(o,s)}catch(a){if(i===s){if(a.code==="ENOENT")return s;throw a}return s}};return r(t,t)};ls.envReplace=Pc;ls.findPrefix=_R;ls.parseField=ER;ls.parseKey=xR});var um=j(lm=>{"use strict";var $r=D("path"),SR=D("stream").Stream,Tn=D("url"),RR=()=>{},CR=()=>[],cm=()=>{};lm.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:$r,cache:$r,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:$r,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Tn],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":$r,"init-author-name":String,"init-author-email":String,"init-author-url":["",Tn],"init-license":String,"init-version":cm,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":CR(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:SR,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,cm],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:$r,production:Boolean,progress:Boolean,proxy:[null,!1,Tn],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Tn],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:$r,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:$r,umask:RR,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var pm=j((n2,hm)=>{"use strict";var{readCAFileSync:AR}=Yd(),fm=D("fs"),Ic=D("path"),{ConfigChain:LR}=rm(),OR=sm(),Fc=am(),Nc=class extends LR{constructor(e,r){super(e),this.root=e,this._parseField=Fc.parseField.bind(null,r||um())}add(e,r){try{for(let[i,s]of Object.entries(e)){let n=Fc.parseKey(i);n!==i&&delete e[i],e[n]=this._parseField(s,n)}}catch(i){throw i}return super.add(e,r)}addFile(e,r){r=r||e;let i={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(i),this._await();try{let s=fm.readFileSync(e,"utf8");this.addString(s,e,"ini",i)}catch(s){if(s.code==="ENOENT")this.add({},i);else if(s.code!=="EISDIR")return`Issue while reading "${e}". ${s.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(i=>/^npm_config_/i.test(i)).forEach(i=>{if(!e[i])return;let s=OR(i.substr(11)),n=e[i];r[s]=$R(s,n)}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:i=>{let s=this.get("global");this[s?"globalPrefix":"localPrefix"]=i},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:i=>{this.set("prefix",i)},get:()=>Ic.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:i=>{r=i},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=Ic.resolve(e.prefix);else try{r=Fc.findPrefix(process.cwd())}catch(i){throw i}return r}loadCAFile(e){if(!e)return;let r=AR(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=Ic.resolve(this.get("prefix"));try{let i=fm.statSync(r);e.user=i.uid}catch(i){if(i.code==="ENOENT")return;throw i}}};function $R(t,e){function r(i){return i.indexOf(`
|
|
10
|
+
`)n=!1,o+=c(t,a,l),a=l;else if(!n&&r+i==="/*"){o+=t.slice(a,l),a=l,n=yd,l++;continue}else if(n===yd&&r+i==="*/"){l++,n=!1,o+=c(t,a,l+1),a=l+1;continue}}}return o+(n?c(t.substr(a)):t.substr(a))}});var xd=j(ci=>{"use strict";var wd=D("fs"),zS=xc(),ns=D("path"),qS=vd(),WS=ci.parse=function(t){return/^\s*{/.test(t)?JSON.parse(qS(t)):zS.parse(t)},VS=ci.file=function(){var t=[].slice.call(arguments).filter(function(s){return s!=null});for(var e in t)if(typeof t[e]!="string")return;var r=ns.join.apply(null,t),i;try{return wd.readFileSync(r,"utf-8")}catch{return}},MI=ci.json=function(){var t=VS.apply(null,arguments);return t?WS(t):null},kI=ci.env=function(t,e){e=e||process.env;var r={},i=t.length;for(var s in e)if(s.toLowerCase().indexOf(t.toLowerCase())===0){for(var n=s.substring(i).split("__"),a;(a=n.indexOf(""))>-1;)n.splice(a,1);var o=r;n.forEach(function(l,u){!l||typeof o!="object"||(u===n.length-1&&(o[l]=e[s]),o[l]===void 0&&(o[l]={}),o=o[l])})}return r},jI=ci.find=function(){var t=ns.join.apply(null,[].slice.call(arguments));function e(r,i){var s=ns.join(r,i);try{return wd.statSync(s),s}catch{if(ns.dirname(r)!==r)return e(ns.dirname(r),i)}}return e(process.cwd(),t)}});var Ad=j((UI,Cd)=>{"use strict";function _d(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Sd(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Rd(t){var e=[];return t.forEach(function(r,i){typeof r=="object"&&r!==null?Array.isArray(r)?e[i]=Rd(r):_d(r)?e[i]=Sd(r):e[i]=_c({},r):e[i]=r}),e}function Ed(t,e){return e==="__proto__"?void 0:t[e]}var _c=Cd.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,i,s;return e.forEach(function(n){typeof n!="object"||n===null||Array.isArray(n)||Object.keys(n).forEach(function(a){if(i=Ed(t,a),r=Ed(n,a),r!==t)if(typeof r!="object"||r===null){t[a]=r;return}else if(Array.isArray(r)){t[a]=Rd(r);return}else if(_d(r)){t[a]=Sd(r);return}else if(typeof i!="object"||i===null||Array.isArray(i)){t[a]=_c({},r);return}else{t[a]=_c(i,r);return}})}),t}});var Td=j((GI,$d)=>{"use strict";function HS(t,e){var r=t;e.slice(0,-1).forEach(function(s){r=r[s]||{}});var i=e[e.length-1];return i in r}function Ld(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Od(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}$d.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(f){r.bools[f]=!0});var i={};function s(f){return i[f].some(function(v){return r.bools[v]})}Object.keys(e.alias||{}).forEach(function(f){i[f]=[].concat(e.alias[f]),i[f].forEach(function(v){i[v]=[f].concat(i[f].filter(function(E){return v!==E}))})}),[].concat(e.string).filter(Boolean).forEach(function(f){r.strings[f]=!0,i[f]&&[].concat(i[f]).forEach(function(v){r.strings[v]=!0})});var n=e.default||{},a={_:[]};function o(f,v){return r.allBools&&/^--[^=]+$/.test(v)||r.strings[f]||r.bools[f]||i[f]}function c(f,v,E){for(var _=f,O=0;O<v.length-1;O++){var C=v[O];if(Od(_,C))return;_[C]===void 0&&(_[C]={}),(_[C]===Object.prototype||_[C]===Number.prototype||_[C]===String.prototype)&&(_[C]={}),_[C]===Array.prototype&&(_[C]=[]),_=_[C]}var $=v[v.length-1];Od(_,$)||((_===Object.prototype||_===Number.prototype||_===String.prototype)&&(_={}),_===Array.prototype&&(_=[]),_[$]===void 0||r.bools[$]||typeof _[$]=="boolean"?_[$]=E:Array.isArray(_[$])?_[$].push(E):_[$]=[_[$],E])}function l(f,v,E){if(!(E&&r.unknownFn&&!o(f,E)&&r.unknownFn(E)===!1)){var _=!r.strings[f]&&Ld(v)?Number(v):v;c(a,f.split("."),_),(i[f]||[]).forEach(function(O){c(a,O.split("."),_)})}}Object.keys(r.bools).forEach(function(f){l(f,n[f]===void 0?!1:n[f])});var u=[];t.indexOf("--")!==-1&&(u=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var d=0;d<t.length;d++){var g=t[d],h,p;if(/^--.+=/.test(g)){var m=g.match(/^--([^=]+)=([\s\S]*)$/);h=m[1];var y=m[2];r.bools[h]&&(y=y!=="false"),l(h,y,g)}else if(/^--no-.+/.test(g))h=g.match(/^--no-(.+)/)[1],l(h,!1,g);else if(/^--.+/.test(g))h=g.match(/^--(.+)/)[1],p=t[d+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!r.bools[h]&&!r.allBools&&(!i[h]||!s(h))?(l(h,p,g),d+=1):/^(true|false)$/.test(p)?(l(h,p==="true",g),d+=1):l(h,r.strings[h]?"":!0,g);else if(/^-[^-]+/.test(g)){for(var b=g.slice(1,-1).split(""),w=!1,x=0;x<b.length;x++){if(p=g.slice(x+2),p==="-"){l(b[x],p,g);continue}if(/[A-Za-z]/.test(b[x])&&p[0]==="="){l(b[x],p.slice(1),g),w=!0;break}if(/[A-Za-z]/.test(b[x])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){l(b[x],p,g),w=!0;break}if(b[x+1]&&b[x+1].match(/\W/)){l(b[x],g.slice(x+2),g),w=!0;break}else l(b[x],r.strings[b[x]]?"":!0,g)}h=g.slice(-1)[0],!w&&h!=="-"&&(t[d+1]&&!/^(-|--)[^-]/.test(t[d+1])&&!r.bools[h]&&(!i[h]||!s(h))?(l(h,t[d+1],g),d+=1):t[d+1]&&/^(true|false)$/.test(t[d+1])?(l(h,t[d+1]==="true",g),d+=1):l(h,r.strings[h]?"":!0,g))}else if((!r.unknownFn||r.unknownFn(g)!==!1)&&a._.push(r.strings._||!Ld(g)?g:Number(g)),e.stopEarly){a._.push.apply(a._,t.slice(d+1));break}}return Object.keys(n).forEach(function(f){HS(a,f.split("."))||(c(a,f.split("."),n[f]),(i[f]||[]).forEach(function(v){c(a,v.split("."),n[f])}))}),e["--"]?a["--"]=u.slice():u.forEach(function(f){a._.push(f)}),a}});var Nd=j((zI,Fd)=>{var os=xd(),li=D("path").join,KS=Ad(),Pd="/etc",Id=process.platform==="win32",as=Id?process.env.USERPROFILE:process.env.HOME;Fd.exports=function(t,e,r,i){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=Td()(process.argv.slice(2))),e=(typeof e=="string"?os.json(e):e)||{},i=i||os.parse;var s=os.env(t+"_"),n=[e],a=[];function o(c){if(!(a.indexOf(c)>=0)){var l=os.file(c);l&&(n.push(i(l)),a.push(c))}}return Id||[li(Pd,t,"config"),li(Pd,t+"rc")].forEach(o),as&&[li(as,".config",t,"config"),li(as,".config",t),li(as,"."+t,"config"),li(as,"."+t+"rc")].forEach(o),o(os.find("."+t+"rc")),s.config&&o(s.config),r.config&&o(r.config),KS.apply(null,n.concat([s,r,a.length?{configs:a,config:a[a.length-1]}:void 0]))}});var kd=j((WI,Md)=>{var Ht=D("constants"),YS=process.cwd,Sn=null,XS=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Sn||(Sn=YS.call(process)),Sn};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Rc=process.chdir,process.chdir=function(t){Sn=null,Rc.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rc));var Rc;Md.exports=JS;function JS(t){Ht.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=n(t.chown),t.fchown=n(t.fchown),t.lchown=n(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=o(t.stat),t.fstat=o(t.fstat),t.lstat=o(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,d,g){g&&process.nextTick(g)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,d,g,h){h&&process.nextTick(h)},t.lchownSync=function(){}),XS==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function d(g,h,p){var m=Date.now(),y=0;u(g,h,function b(w){if(w&&(w.code==="EACCES"||w.code==="EPERM")&&Date.now()-m<6e4){setTimeout(function(){t.stat(h,function(x,f){x&&x.code==="ENOENT"?u(g,h,b):p(w)})},y),y<100&&(y+=10);return}p&&p(w)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function d(g,h,p,m,y,b){var w;if(b&&typeof b=="function"){var x=0;w=function(f,v,E){if(f&&f.code==="EAGAIN"&&x<10)return x++,u.call(t,g,h,p,m,y,w);b.apply(this,arguments)}}return u.call(t,g,h,p,m,y,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(d,g,h,p,m){for(var y=0;;)try{return u.call(t,d,g,h,p,m)}catch(b){if(b.code==="EAGAIN"&&y<10){y++;continue}throw b}}})(t.readSync);function e(u){u.lchmod=function(d,g,h){u.open(d,Ht.O_WRONLY|Ht.O_SYMLINK,g,function(p,m){if(p){h&&h(p);return}u.fchmod(m,g,function(y){u.close(m,function(b){h&&h(y||b)})})})},u.lchmodSync=function(d,g){var h=u.openSync(d,Ht.O_WRONLY|Ht.O_SYMLINK,g),p=!0,m;try{m=u.fchmodSync(h,g),p=!1}finally{if(p)try{u.closeSync(h)}catch{}else u.closeSync(h)}return m}}function r(u){Ht.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,g,h,p){u.open(d,Ht.O_SYMLINK,function(m,y){if(m){p&&p(m);return}u.futimes(y,g,h,function(b){u.close(y,function(w){p&&p(b||w)})})})},u.lutimesSync=function(d,g,h){var p=u.openSync(d,Ht.O_SYMLINK),m,y=!0;try{m=u.futimesSync(p,g,h),y=!1}finally{if(y)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}):u.futimes&&(u.lutimes=function(d,g,h,p){p&&process.nextTick(p)},u.lutimesSync=function(){})}function i(u){return u&&function(d,g,h){return u.call(t,d,g,function(p){l(p)&&(p=null),h&&h.apply(this,arguments)})}}function s(u){return u&&function(d,g){try{return u.call(t,d,g)}catch(h){if(!l(h))throw h}}}function n(u){return u&&function(d,g,h,p){return u.call(t,d,g,h,function(m){l(m)&&(m=null),p&&p.apply(this,arguments)})}}function a(u){return u&&function(d,g,h){try{return u.call(t,d,g,h)}catch(p){if(!l(p))throw p}}}function o(u){return u&&function(d,g,h){typeof g=="function"&&(h=g,g=null);function p(m,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),h&&h.apply(this,arguments)}return g?u.call(t,d,g,p):u.call(t,d,p)}}function c(u){return u&&function(d,g){var h=g?u.call(t,d,g):u.call(t,d);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function l(u){if(!u||u.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Ud=j((VI,Bd)=>{var jd=D("stream").Stream;Bd.exports=ZS;function ZS(t){return{ReadStream:e,WriteStream:r};function e(i,s){if(!(this instanceof e))return new e(i,s);jd.call(this);var n=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var a=Object.keys(s),o=0,c=a.length;o<c;o++){var l=a[o];this[l]=s[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){n._read()});return}t.open(this.path,this.flags,this.mode,function(u,d){if(u){n.emit("error",u),n.readable=!1;return}n.fd=d,n.emit("open",d),n._read()})}function r(i,s){if(!(this instanceof r))return new r(i,s);jd.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var n=Object.keys(s),a=0,o=n.length;a<o;a++){var c=n[a];this[c]=s[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var zd=j((HI,Gd)=>{"use strict";Gd.exports=eR;var QS=Object.getPrototypeOf||function(t){return t.__proto__};function eR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:QS(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Hd=j((KI,Lc)=>{var ve=D("fs"),tR=kd(),rR=Ud(),iR=zd(),Rn=D("util"),Te,An;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Te=Symbol.for("graceful-fs.queue"),An=Symbol.for("graceful-fs.previous")):(Te="___graceful-fs.queue",An="___graceful-fs.previous");function sR(){}function Vd(t,e){Object.defineProperty(t,Te,{get:function(){return e}})}var Cr=sR;Rn.debuglog?Cr=Rn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Cr=function(){var t=Rn.format.apply(Rn,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
11
|
+
GFS4: `),console.error(t)});ve[Te]||(qd=global[Te]||[],Vd(ve,qd),ve.close=(function(t){function e(r,i){return t.call(ve,r,function(s){s||Wd(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(e,An,{value:t}),e})(ve.close),ve.closeSync=(function(t){function e(r){t.apply(ve,arguments),Wd()}return Object.defineProperty(e,An,{value:t}),e})(ve.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Cr(ve[Te]),D("assert").equal(ve[Te].length,0)}));var qd;global[Te]||Vd(global,ve[Te]);Lc.exports=Cc(iR(ve));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ve.__patched&&(Lc.exports=Cc(ve),ve.__patched=!0);function Cc(t){tR(t),t.gracefulify=Cc,t.createReadStream=v,t.createWriteStream=E;var e=t.readFile;t.readFile=r;function r(C,$,F){return typeof $=="function"&&(F=$,$=null),M(C,$,F);function M(I,Y,Z,G){return e(I,Y,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?ui([M,[I,Y,Z],V,G||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}var i=t.writeFile;t.writeFile=s;function s(C,$,F,M){return typeof F=="function"&&(M=F,F=null),I(C,$,F,M);function I(Y,Z,G,V,se){return i(Y,Z,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.appendFile;n&&(t.appendFile=a);function a(C,$,F,M){return typeof F=="function"&&(M=F,F=null),I(C,$,F,M);function I(Y,Z,G,V,se){return n(Y,Z,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var o=t.copyFile;o&&(t.copyFile=c);function c(C,$,F,M){return typeof F=="function"&&(M=F,F=0),I(C,$,F,M);function I(Y,Z,G,V,se){return o(Y,Z,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var l=t.readdir;t.readdir=d;var u=/^v[0-5]\./;function d(C,$,F){typeof $=="function"&&(F=$,$=null);var M=u.test(process.version)?function(Z,G,V,se){return l(Z,I(Z,G,V,se))}:function(Z,G,V,se){return l(Z,G,I(Z,G,V,se))};return M(C,$,F);function I(Y,Z,G,V){return function(se,ee){se&&(se.code==="EMFILE"||se.code==="ENFILE")?ui([M,[Y,Z,G],se,V||Date.now(),Date.now()]):(ee&&ee.sort&&ee.sort(),typeof G=="function"&&G.call(this,se,ee))}}}if(process.version.substr(0,4)==="v0.8"){var g=rR(t);b=g.ReadStream,x=g.WriteStream}var h=t.ReadStream;h&&(b.prototype=Object.create(h.prototype),b.prototype.open=w);var p=t.WriteStream;p&&(x.prototype=Object.create(p.prototype),x.prototype.open=f),Object.defineProperty(t,"ReadStream",{get:function(){return b},set:function(C){b=C},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return x},set:function(C){x=C},enumerable:!0,configurable:!0});var m=b;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(C){m=C},enumerable:!0,configurable:!0});var y=x;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(C){y=C},enumerable:!0,configurable:!0});function b(C,$){return this instanceof b?(h.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function w(){var C=this;O(C.path,C.flags,C.mode,function($,F){$?(C.autoClose&&C.destroy(),C.emit("error",$)):(C.fd=F,C.emit("open",F),C.read())})}function x(C,$){return this instanceof x?(p.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function f(){var C=this;O(C.path,C.flags,C.mode,function($,F){$?(C.destroy(),C.emit("error",$)):(C.fd=F,C.emit("open",F))})}function v(C,$){return new t.ReadStream(C,$)}function E(C,$){return new t.WriteStream(C,$)}var _=t.open;t.open=O;function O(C,$,F,M){return typeof F=="function"&&(M=F,F=null),I(C,$,F,M);function I(Y,Z,G,V,se){return _(Y,Z,G,function(ee,we){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}return t}function ui(t){Cr("ENQUEUE",t[0].name,t[1]),ve[Te].push(t),Ac()}var Cn;function Wd(){for(var t=Date.now(),e=0;e<ve[Te].length;++e)ve[Te][e].length>2&&(ve[Te][e][3]=t,ve[Te][e][4]=t);Ac()}function Ac(){if(clearTimeout(Cn),Cn=void 0,ve[Te].length!==0){var t=ve[Te].shift(),e=t[0],r=t[1],i=t[2],s=t[3],n=t[4];if(s===void 0)Cr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Cr("TIMEOUT",e.name,r);var a=r.pop();typeof a=="function"&&a.call(null,i)}else{var o=Date.now()-n,c=Math.max(n-s,1),l=Math.min(c*1.2,100);o>=l?(Cr("RETRY",e.name,r),e.apply(null,r.concat([s]))):ve[Te].push(t)}Cn===void 0&&(Cn=setTimeout(Ac,0))}}});var Kd=j(hi=>{"use strict";var nR=hi&&hi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hi,"__esModule",{value:!0});hi.readCAFileSync=void 0;var oR=nR(Hd());function aR(t){try{let e=oR.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(s=>!!s.trim()).map(s=>`${s.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}hi.readCAFileSync=aR});var Yd=j(Ar=>{"use strict";var cR=Ar&&Ar.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),lR=Ar&&Ar.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cR(e,t,r)};Object.defineProperty(Ar,"__esModule",{value:!0});lR(Kd(),Ar)});var Zd=j((JI,Jd)=>{Jd.exports=Xd;function Lr(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Xd(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&Lr(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Xd.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&Lr(this.list[this.list.length-1],t),Lr(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&Lr(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return Lr(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&Lr(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)Lr(this.list[e],this.list[e+1]||this.root);return t}}});var rm=j((It,tm)=>{var Qd=Zd(),cs=D("path"),Ln=D("fs"),Oc=xc(),$c=D("events").EventEmitter,uR=D("url"),hR=D("http"),It=tm.exports=function(){for(var t=[].slice.call(arguments),e=new De;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?pR(r):r)}return e},ZI=It.find=function(){var t=cs.join.apply(null,[].slice.call(arguments));function e(r,i){var s=cs.join(r,i);try{return Ln.statSync(s),s}catch{if(cs.dirname(r)!==r)return e(cs.dirname(r),i)}}return e(__dirname,t)},fR=It.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(i){this.emit("error",i)}else return JSON.parse(t);else return Oc.parse(t);else try{return JSON.parse(t)}catch{return Oc.parse(t)}},pR=It.json=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null}),e=cs.join.apply(null,t),r;try{r=Ln.readFileSync(e,"utf-8")}catch{return}return fR(r,e,"json")},QI=It.env=function(t,e){e=e||process.env;var r={},i=t.length;for(var s in e)s.indexOf(t)===0&&(r[s.substring(i)]=e[s]);return r};It.ConfigChain=De;function De(){$c.apply(this),Qd.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var em={constructor:{value:De}};Object.keys($c.prototype).forEach(function(t){em[t]=Object.getOwnPropertyDescriptor($c.prototype,t)});De.prototype=Object.create(Qd.prototype,em);De.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var i=0,s=this.list.length;i<s;i++)delete this.list[i][t];return this};De.prototype.set=function(t,e,r){var i;if(r){if(i=this.sources[r],i=i&&i.data,!i)return this.emit("error",new Error("not found "+r))}else if(i=this.list[0],!i)return this.emit("error",new Error("cannot set, no confs!"));return i[t]=e,this};De.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};De.prototype.save=function(t,n,r){typeof n=="function"&&(r=n,n=null);var i=this.sources[t];if(!i||!(i.path||i.source)||!i.data)return this.emit("error",new Error("bad save target: "+t));if(i.source){var s=i.prefix||"";return Object.keys(i.data).forEach(function(o){i.source[s+o]=i.data[o]}),this}var n=n||i.type,a=i.data;return i.type==="json"?a=JSON.stringify(a):a=Oc.stringify(a),this._saving++,Ln.writeFile(i.path,a,"utf8",function(o){if(this._saving--,o)return r?r(o):this.emit("error",o);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};De.prototype.addFile=function(t,e,r){r=r||t;var i={__source__:r};return this.sources[r]={path:t,type:e},this.push(i),this._await(),Ln.readFile(t,"utf8",function(s,n){s&&this.emit("error",s),this.addString(n,t,e,i)}.bind(this)),this};De.prototype.addEnv=function(t,e,r){r=r||"env";var i=It.env(t,e);return this.sources[r]={data:i,source:e,prefix:t},this.add(i,r)};De.prototype.addUrl=function(t,e,r){this._await();var i=uR.format(t);r=r||i;var s={__source__:r};return this.sources[r]={href:i,type:e},this.push(s),hR.request(t,function(n){var a=[],o=n.headers["content-type"];e||(e=o.indexOf("json")!==-1?"json":o.indexOf("ini")!==-1?"ini":i.match(/\.json$/)?"json":i.match(/\.ini$/)?"ini":null,s.type=e),n.on("data",a.push.bind(a)).on("end",function(){this.addString(Buffer.concat(a),i,e,s)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};De.prototype.addString=function(t,e,r,i){return t=this.parse(t,e,r),this.add(t,i),this};De.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};De.prototype.parse=It.parse;De.prototype._await=function(){this._awaiting++};De.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var sm=j((e2,im)=>{im.exports=function(t){let e=t.indexOf(":");if(e===-1)return Tc(t);let r=t.substr(0,e),i=t.substr(e+1);return`${Tc(r)}:${Tc(i)}`};function Tc(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var nm=j(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.envReplace=void 0;var dR=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function mR(t,e){return t.replace(dR,gR.bind(null,e))}On.envReplace=mR;function gR(t,e,r,i){if(r.length%2)return e.slice((r.length+1)/2);let s=bR(t,i);if(s===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${s}`}var yR=/([^:-]+)(:?)-(.+)/;function bR(t,e){let r=e.match(yR);if(!r)return t[e];let[,i,s,n]=r;return Object.prototype.hasOwnProperty.call(t,i)?!t[i]&&s?n:t[i]:n}});var om=j($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.envReplace=void 0;var vR=nm();Object.defineProperty($n,"envReplace",{enumerable:!0,get:function(){return vR.envReplace}})});var am=j(ls=>{"use strict";var wR=D("fs"),Or=D("path"),{envReplace:Pc}=om(),xR=t=>typeof t!="string"?t:Pc(t,process.env),ER=(t,e,r)=>{if(typeof e!="string")return e;let i=[].concat(t[r]),s=i.indexOf(Or)!==-1,n=i.indexOf(Boolean)!==-1,a=i.indexOf(String)!==-1,o=i.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(n&&!a&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=Pc(e,process.env),s&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Or.resolve(process.env.HOME,e.substr(2))),e=Or.resolve(e)),o&&!isNaN(e)&&(e=Number(e)),e},_R=t=>{t=Or.resolve(t);let e=!1;for(;Or.basename(t)==="node_modules";)t=Or.dirname(t),e=!0;if(e)return t;let r=(i,s)=>{let n=/^[a-zA-Z]:(\\|\/)?$/;if(i==="/"||process.platform==="win32"&&n.test(i))return s;try{let a=wR.readdirSync(i);if(a.includes("node_modules")||a.includes("package.json")||a.includes("package.json5")||a.includes("package.yaml")||a.includes("pnpm-workspace.yaml"))return i;let o=Or.dirname(i);return o===i?s:r(o,s)}catch(a){if(i===s){if(a.code==="ENOENT")return s;throw a}return s}};return r(t,t)};ls.envReplace=Pc;ls.findPrefix=_R;ls.parseField=ER;ls.parseKey=xR});var um=j(lm=>{"use strict";var $r=D("path"),SR=D("stream").Stream,Tn=D("url"),RR=()=>{},CR=()=>[],cm=()=>{};lm.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:$r,cache:$r,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:$r,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Tn],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":$r,"init-author-name":String,"init-author-email":String,"init-author-url":["",Tn],"init-license":String,"init-version":cm,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":CR(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:SR,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,cm],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:$r,production:Boolean,progress:Boolean,proxy:[null,!1,Tn],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Tn],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:$r,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:$r,umask:RR,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var pm=j((n2,fm)=>{"use strict";var{readCAFileSync:AR}=Yd(),hm=D("fs"),Ic=D("path"),{ConfigChain:LR}=rm(),OR=sm(),Fc=am(),Nc=class extends LR{constructor(e,r){super(e),this.root=e,this._parseField=Fc.parseField.bind(null,r||um())}add(e,r){try{for(let[i,s]of Object.entries(e)){let n=Fc.parseKey(i);n!==i&&delete e[i],e[n]=this._parseField(s,n)}}catch(i){throw i}return super.add(e,r)}addFile(e,r){r=r||e;let i={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(i),this._await();try{let s=hm.readFileSync(e,"utf8");this.addString(s,e,"ini",i)}catch(s){if(s.code==="ENOENT")this.add({},i);else if(s.code!=="EISDIR")return`Issue while reading "${e}". ${s.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(i=>/^npm_config_/i.test(i)).forEach(i=>{if(!e[i])return;let s=OR(i.substr(11)),n=e[i];r[s]=$R(s,n)}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:i=>{let s=this.get("global");this[s?"globalPrefix":"localPrefix"]=i},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:i=>{this.set("prefix",i)},get:()=>Ic.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:i=>{r=i},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=Ic.resolve(e.prefix);else try{r=Fc.findPrefix(process.cwd())}catch(i){throw i}return r}loadCAFile(e){if(!e)return;let r=AR(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=Ic.resolve(this.get("prefix"));try{let i=hm.statSync(r);e.user=i.uid}catch(i){if(i.code==="ENOENT")return;throw i}}};function $R(t,e){function r(i){return i.indexOf(`
|
|
12
12
|
|
|
13
13
|
`)?i.split(`
|
|
14
14
|
|
|
15
|
-
`):i.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}hm.exports=Nc});var vm=j(bm=>{"use strict";var gm=D("os"),Ft=D("path"),ym=gm.tmpdir(),TR=process.getuid?process.getuid():process.pid,PR=()=>!0,dm=process.platform==="win32",mm={editor:()=>process.env.EDITOR||process.env.VISUAL||(dm?"notepad.exe":"vi"),shell:()=>dm?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},IR={fromString:()=>process.umask()},hi=gm.homedir();hi?process.env.HOME=hi:hi=Ft.resolve(ym,"npm-"+TR);var FR=process.platform==="win32"?"npm-cache":".npm",NR=process.platform==="win32"&&process.env.APPDATA||hi,DR=Ft.resolve(NR,FR),Pn,Tr;Object.defineProperty(bm,"defaults",{get:function(){return Pn||(process.env.PREFIX?Tr=process.env.PREFIX:process.platform==="win32"?Tr=Ft.dirname(process.execPath):(Tr=Ft.dirname(Ft.dirname(process.execPath)),process.env.DESTDIR&&(Tr=Ft.join(process.env.DESTDIR,Tr))),Pn={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:DR,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:mm.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ft.resolve(Tr,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ft.resolve(hi,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Tr,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:mm.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:ym,unicode:PR(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ft.resolve(hi,".npmrc"),umask:process.umask?process.umask():IR.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Pn)}})});var xm=j((a2,Dc)=>{"use strict";var Pr=D("path"),MR=pm(),wm=vm();Dc.exports=(t,e,r)=>{let i=new MR(Object.assign({},wm.defaults,r),e);i.add(Object.assign({},t),"cli");let s=[],n=!1;if(D.resolve.paths){let l=D.resolve.paths("npm"),u;try{u=D.resolve("npm",{paths:l.slice(-1)})}catch{n=!0}u&&s.push(i.addFile(Pr.resolve(Pr.dirname(u),"..","npmrc"),"builtin"))}i.addEnv(),i.loadPrefix();let a=Pr.resolve(i.localPrefix,".npmrc"),o=i.get("userconfig");if(!i.get("global")&&a!==o?s.push(i.addFile(a,"project")):i.add({},"project"),i.get("workspace-prefix")&&i.get("workspace-prefix")!==a){let l=Pr.resolve(i.get("workspace-prefix"),".npmrc");s.push(i.addFile(l,"workspace"))}if(s.push(i.addFile(i.get("userconfig"),"user")),i.get("prefix")){let l=Pr.resolve(i.get("prefix"),"etc");i.root.globalconfig=Pr.resolve(l,"npmrc"),i.root.globalignorefile=Pr.resolve(l,"npmignore")}s.push(i.addFile(i.get("globalconfig"),"global")),i.loadUser();let c=i.get("cafile");return c&&i.loadCAFile(c),{config:i,warnings:s.filter(Boolean),failedToLoadBuiltInConfig:n}};Object.defineProperty(Dc.exports,"defaults",{get(){return wm.defaults},enumerable:!0})});var Om=j((l2,Lm)=>{var Em=xm(),_m=":_authToken",Sm=":_auth",Rm=":username",Cm=":_password";Lm.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let i=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:s=>i[s]}}:Em()).config,e=e||r.npmrc.get("registry")||Em.defaults.registry,Am(e,r)||jR(r.npmrc)};function kR(t,e){let r=new URL(e,new URL(t.startsWith("//")?`./${t}`:t,"resolve://"));if(r.protocol==="resolve:"){let{pathname:i,search:s,hash:n}=r;return i+s+n}return r.toString()}function Am(t,e){let r=t instanceof URL?t:new URL(t.startsWith("//")?`http:${t}`:t),i;for(;i!=="/"&&r.pathname!==i;){i=r.pathname||"/";let s="//"+r.host+i.replace(/\/$/,""),n=UR(s,e.npmrc);if(n)return n;if(!e.recursive)return/\/$/.test(t)?void 0:Am(new URL("./",r),e);r.pathname=kR(BR(i),"..")||"/"}}function jR(t){return t.get("_auth")?{token:In(t.get("_auth")),type:"Basic"}:void 0}function BR(t){return t[t.length-1]==="/"?t:t+"/"}function UR(t,e){let r=GR(e.get(t+_m)||e.get(t+"/"+_m));if(r)return r;let i=e.get(t+Rm)||e.get(t+"/"+Rm),s=e.get(t+Cm)||e.get(t+"/"+Cm),n=qR(i,s);if(n)return n;let a=zR(e.get(t+Sm)||e.get(t+"/"+Sm));if(a)return a}function In(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function GR(t){return t?{token:In(t),type:"Bearer"}:void 0}function qR(t,e){if(!t||!e)return;let r=Buffer.from(In(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function zR(t){return t?{token:In(t),type:"Basic"}:void 0}});var fg=j((U2,kn)=>{var Wm,Vm,Hm,Km,Ym,Xm,Jm,Zm,Qm,Mn,Kc,eg,tg,di,rg,ig,sg,ng,og,ag,cg,lg,ug;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof kn=="object"&&typeof kn.exports=="object"?t(r(e,r(kn.exports))):t(r(e));function r(i,s){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(n,a){return i[n]=s?s(n,a):a}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])};Wm=function(r,i){e(r,i);function s(){this.constructor=r}r.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},Vm=Object.assign||function(r){for(var i,s=1,n=arguments.length;s<n;s++){i=arguments[s];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},Hm=function(r,i){var s={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&i.indexOf(n)<0&&(s[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(r);a<n.length;a++)i.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(r,n[a])&&(s[n[a]]=r[n[a]]);return s},Km=function(r,i,s,n){var a=arguments.length,o=a<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,s):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,i,s,n);else for(var l=r.length-1;l>=0;l--)(c=r[l])&&(o=(a<3?c(o):a>3?c(i,s,o):c(i,s))||o);return a>3&&o&&Object.defineProperty(i,s,o),o},Ym=function(r,i){return function(s,n){i(s,n,r)}},Xm=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},Jm=function(r,i,s,n){function a(o){return o instanceof s?o:new s(function(c){c(o)})}return new(s||(s=Promise))(function(o,c){function l(b){try{d(n.next(b))}catch(f){c(f)}}function u(b){try{d(n.throw(b))}catch(f){c(f)}}function d(b){b.done?o(b.value):a(b.value).then(l,u)}d((n=n.apply(r,i||[])).next())})},Zm=function(r,i){var s={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(b){return u([d,b])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,a&&(o=d[0]&2?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return s.label++,{value:d[1],done:!1};case 5:s.label++,a=d[1],d=[0];continue;case 7:d=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){s=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){s.label=d[1];break}if(d[0]===6&&s.label<o[1]){s.label=o[1],o=d;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(d);break}o[2]&&s.ops.pop(),s.trys.pop();continue}d=i.call(r,s)}catch(b){d=[6,b],a=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},ug=function(r,i,s,n){n===void 0&&(n=s),r[n]=i[s]},Qm=function(r,i){for(var s in r)s!=="default"&&!i.hasOwnProperty(s)&&(i[s]=r[s])},Mn=function(r){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&r[i],n=0;if(s)return s.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},Kc=function(r,i){var s=typeof Symbol=="function"&&r[Symbol.iterator];if(!s)return r;var n=s.call(r),a,o=[],c;try{for(;(i===void 0||i-- >0)&&!(a=n.next()).done;)o.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(s=n.return)&&s.call(n)}finally{if(c)throw c.error}}return o},eg=function(){for(var r=[],i=0;i<arguments.length;i++)r=r.concat(Kc(arguments[i]));return r},tg=function(){for(var r=0,i=0,s=arguments.length;i<s;i++)r+=arguments[i].length;for(var n=Array(r),a=0,i=0;i<s;i++)for(var o=arguments[i],c=0,l=o.length;c<l;c++,a++)n[a]=o[c];return n},di=function(r){return this instanceof di?(this.v=r,this):new di(r)},rg=function(r,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=s.apply(r,i||[]),a,o=[];return a={},c("next"),c("throw"),c("return"),a[Symbol.asyncIterator]=function(){return this},a;function c(p){n[p]&&(a[p]=function(m){return new Promise(function(y,g){o.push([p,m,y,g])>1||l(p,m)})})}function l(p,m){try{u(n[p](m))}catch(y){f(o[0][3],y)}}function u(p){p.value instanceof di?Promise.resolve(p.value.v).then(d,b):f(o[0][2],p)}function d(p){l("next",p)}function b(p){l("throw",p)}function f(p,m){p(m),o.shift(),o.length&&l(o[0][0],o[0][1])}},ig=function(r){var i,s;return i={},n("next"),n("throw",function(a){throw a}),n("return"),i[Symbol.iterator]=function(){return this},i;function n(a,o){i[a]=r[a]?function(c){return(s=!s)?{value:di(r[a](c)),done:a==="return"}:o?o(c):c}:o}},sg=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],s;return i?i.call(r):(r=typeof Mn=="function"?Mn(r):r[Symbol.iterator](),s={},n("next"),n("throw"),n("return"),s[Symbol.asyncIterator]=function(){return this},s);function n(o){s[o]=r[o]&&function(c){return new Promise(function(l,u){c=r[o](c),a(l,u,c.done,c.value)})}}function a(o,c,l,u){Promise.resolve(u).then(function(d){o({value:d,done:l})},c)}},ng=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},og=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)Object.hasOwnProperty.call(r,s)&&(i[s]=r[s]);return i.default=r,i},ag=function(r){return r&&r.__esModule?r:{default:r}},cg=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},lg=function(r,i,s){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,s),s},t("__extends",Wm),t("__assign",Vm),t("__rest",Hm),t("__decorate",Km),t("__param",Ym),t("__metadata",Xm),t("__awaiter",Jm),t("__generator",Zm),t("__exportStar",Qm),t("__createBinding",ug),t("__values",Mn),t("__read",Kc),t("__spread",eg),t("__spreadArrays",tg),t("__await",di),t("__asyncGenerator",rg),t("__asyncDelegator",ig),t("__asyncValues",sg),t("__makeTemplateObject",ng),t("__importStar",og),t("__importDefault",ag),t("__classPrivateFieldGet",cg),t("__classPrivateFieldSet",lg)})});var pg={};jo(pg,{__assign:()=>pC,__asyncDelegator:()=>LC,__asyncGenerator:()=>AC,__asyncValues:()=>OC,__await:()=>CC,__awaiter:()=>bC,__classPrivateFieldGet:()=>IC,__classPrivateFieldSet:()=>FC,__createBinding:()=>xC,__decorate:()=>mC,__exportStar:()=>wC,__extends:()=>hC,__generator:()=>vC,__importDefault:()=>PC,__importStar:()=>TC,__makeTemplateObject:()=>$C,__metadata:()=>yC,__param:()=>gC,__read:()=>_C,__rest:()=>dC,__spread:()=>SC,__spreadArrays:()=>RC,__values:()=>EC});var hg,hC,pC,dC,mC,gC,yC,bC,vC,wC,xC,EC,_C,SC,RC,CC,AC,LC,OC,$C,TC,PC,IC,FC,dg=Dy(()=>{hg=We(fg(),1),{__extends:hC,__assign:pC,__rest:dC,__decorate:mC,__param:gC,__metadata:yC,__awaiter:bC,__generator:vC,__exportStar:wC,__createBinding:xC,__values:EC,__read:_C,__spread:SC,__spreadArrays:RC,__await:CC,__asyncGenerator:AC,__asyncDelegator:LC,__asyncValues:OC,__makeTemplateObject:$C,__importStar:TC,__importDefault:PC,__classPrivateFieldGet:IC,__classPrivateFieldSet:FC}=hg.default});var bg=j((G2,yg)=>{"use strict";var Yc=Object.defineProperty,NC=Object.getOwnPropertyDescriptor,DC=Object.getOwnPropertyNames,MC=Object.prototype.hasOwnProperty,kC=(t,e)=>{for(var r in e)Yc(t,r,{get:e[r],enumerable:!0})},jC=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of DC(e))!MC.call(t,s)&&s!==r&&Yc(t,s,{get:()=>e[s],enumerable:!(i=NC(e,s))||i.enumerable});return t},BC=t=>jC(Yc({},"__esModule",{value:!0}),t),mg={};kC(mg,{defaultDeserialize:()=>GC,defaultSerialize:()=>UC});yg.exports=BC(mg);var gg=D("buffer"),jn=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(gg.Buffer.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",i=Array.isArray(t);r=i?"[":"{";let s=!0;for(let n in t){let a=typeof t[n]=="function"||!i&&t[n]===void 0;!Object.hasOwn(t,n)||a||(s||(r+=","),s=!1,i?r+=jn(t[n],e):t[n]!==void 0&&(r+=`${jn(n,!1)}:${jn(t[n],e)}`))}return r+=i?"]":"}",r}return JSON.stringify(t)},UC=t=>jn(t,!0),GC=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?gg.Buffer.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r)});var vg=j(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.Field=void 0;ps.makeField=qC;var Bn=class{kv;key;defaults;constructor(e,r,i){this.kv=e,this.key=r,this.defaults=i}async get(e=this.defaults){return await this.kv.get(this.key)??e}getSync(e=this.defaults){if("getSync"in this.kv)return this.kv.getSync(this.key)??e;throw new Error("kv does not support getSync")}set(e,r){return this.kv.set(this.key,e,r)}delete(){return this.kv.delete(this.key)}};ps.Field=Bn;function qC(t,e,r){return new Bn(t,e,r)}});var _g=j(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.KeyvFile=Nt.defaultOpts=void 0;var mi=(dg(),My(pg)),zC=mi.__importStar(D("os")),Un=mi.__importStar(D("fs")),wg=mi.__importStar(D("fs/promises")),WC=mi.__importDefault(D("events")),xg=bg(),VC=mi.__importDefault(D("path"));mi.__exportStar(vg(),Nt);Nt.defaultOpts={deserialize:xg.defaultDeserialize,dialect:"redis",expiredCheckDelay:24*3600*1e3,filename:`${zC.tmpdir()}/keyv-file/default.json`,serialize:xg.defaultSerialize,writeDelay:100,checkFileLock:!1};function Eg(t){return typeof t=="number"}var Gn=class extends WC.default{ttlSupport=!0;namespace;opts;_data;_lastExpire;constructor(e){super(),this.opts=Object.assign({},Nt.defaultOpts,e),this.opts.checkFileLock&&this.acquireFileLock();try{let r=this.opts.deserialize(Un.readFileSync(this.opts.filename,"utf8"));if(!Array.isArray(r.cache)){let i=r.cache;r.cache=[];for(let s in i)i.hasOwnProperty(s)&&r.cache.push([s,i[s]])}this._data=new Map(r.cache),this._lastExpire=r.lastExpire}catch{this._data=new Map,this._lastExpire=Date.now()}}get _lockFile(){return this.opts.filename+".lock"}acquireFileLock(){try{let e=Un.openSync(this._lockFile,"wx");Un.closeSync(e),process.on("SIGINT",()=>{this.releaseFileLock(),process.exit(0)}),process.on("exit",()=>{this.releaseFileLock()})}catch(e){throw console.error("[keyv-file] There is another process using this file"),e}}releaseFileLock(){try{Un.unlinkSync(this._lockFile)}catch{}}async get(e){return this.getSync(e)}getSync(e){try{let r=this._data.get(e);if(r)if(this.isExpired(r)){this.delete(e);return}else return r.value;else return}catch{}}async getMany(e){return e.map(r=>this.getSync(r))}async set(e,r,i){return i===0&&(i=void 0),this._data.set(e,{expire:Eg(i)?Date.now()+i:void 0,value:r}),this.save()}async delete(e){let r=this._data.delete(e);return await this.save(),r}async deleteMany(e){let r=e.every(i=>this._data.delete(i));return await this.save(),r}async clear(){return this._data=new Map,this._lastExpire=Date.now(),this.save()}async has(e){return await this.get(e)!==void 0}isExpired(e){return Eg(e.expire)&&e.expire<=Date.now()}clearExpire(){let e=Date.now();if(!(e-this._lastExpire<=this.opts.expiredCheckDelay)){for(let r of this._data.keys()){let i=this._data.get(r);this.isExpired(i)&&this._data.delete(r)}this._lastExpire=e}}async saveToDisk(){let e=[];for(let[i,s]of this._data)e.push([i,s]);let r=this.opts.serialize({cache:e,lastExpire:this._lastExpire});return await wg.mkdir(VC.default.dirname(this.opts.filename),{recursive:!0}),wg.writeFile(this.opts.filename,r)}_savePromise;save(){return this.clearExpire(),this._savePromise?this._savePromise:(this._savePromise=new Promise((e,r)=>{setTimeout(()=>{this.saveToDisk().then(e,r).finally(()=>{this._savePromise=void 0})},this.opts.writeDelay)}),this._savePromise)}disconnect(){return Promise.resolve()}async*iterator(e){for(let[r,i]of this._data.entries())r!==void 0&&(!e||r.includes(e))&&(yield[r,i.value])}};Nt.KeyvFile=Gn;Nt.default=Gn});var Xc=j((Q2,Re)=>{var{createRequire:YC}=D("node:module");D=YC(__filename);var{readFileSync:XC}=D("node:fs"),ge=null,X=[],zn=()=>{let t=!1;return process.platform==="linux"&&(t=ZC(),t===null&&(t=QC()),t===null&&(t=eA())),t},JC=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),ZC=()=>{try{return XC("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},QC=()=>{let t=null;return typeof process.report?.getReport=="function"&&(process.report.excludeNetwork=!0,t=process.report.getReport()),t?t.header&&t.header.glibcVersionRuntime?!1:!!(Array.isArray(t.sharedObjects)&&t.sharedObjects.some(JC)):null},eA=()=>{try{return D("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}};function tA(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{ge=D(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)}catch(t){X.push(t)}else if(process.platform==="android")if(process.arch==="arm64"){try{return D("./ast-grep-napi.android-arm64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-android-arm64")}catch(t){X.push(t)}}else if(process.arch==="arm"){try{return D("./ast-grep-napi.android-arm-eabi.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-android-arm-eabi")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64"){try{return D("./ast-grep-napi.win32-x64-msvc.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-win32-x64-msvc")}catch(t){X.push(t)}}else if(process.arch==="ia32"){try{return D("./ast-grep-napi.win32-ia32-msvc.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-win32-ia32-msvc")}catch(t){X.push(t)}}else if(process.arch==="arm64"){try{return D("./ast-grep-napi.win32-arm64-msvc.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-win32-arm64-msvc")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return D("./ast-grep-napi.darwin-universal.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-darwin-universal")}catch(t){X.push(t)}if(process.arch==="x64"){try{return D("./ast-grep-napi.darwin-x64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-darwin-x64")}catch(t){X.push(t)}}else if(process.arch==="arm64"){try{return D("./ast-grep-napi.darwin-arm64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-darwin-arm64")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return D("./ast-grep-napi.freebsd-x64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-freebsd-x64")}catch(t){X.push(t)}}else if(process.arch==="arm64"){try{return D("./ast-grep-napi.freebsd-arm64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-freebsd-arm64")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(zn()){try{return D("./ast-grep-napi.linux-x64-musl.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-x64-musl")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-x64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-x64-gnu")}catch(t){X.push(t)}}else if(process.arch==="arm64")if(zn()){try{return D("./ast-grep-napi.linux-arm64-musl.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm64-musl")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-arm64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm64-gnu")}catch(t){X.push(t)}}else if(process.arch==="arm")if(zn()){try{return D("./ast-grep-napi.linux-arm-musleabihf.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm-musleabihf")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-arm-gnueabihf.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm-gnueabihf")}catch(t){X.push(t)}}else if(process.arch==="riscv64")if(zn()){try{return D("./ast-grep-napi.linux-riscv64-musl.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-riscv64-musl")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-riscv64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-riscv64-gnu")}catch(t){X.push(t)}}else if(process.arch==="ppc64"){try{return D("./ast-grep-napi.linux-ppc64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-ppc64-gnu")}catch(t){X.push(t)}}else if(process.arch==="s390x"){try{return D("./ast-grep-napi.linux-s390x-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-s390x-gnu")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return D("./ast-grep-napi.linux-arm64-ohos.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm64-ohos")}catch(t){X.push(t)}}else if(process.arch==="x64"){try{return D("./ast-grep-napi.linux-x64-ohos.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-x64-ohos")}catch(t){X.push(t)}}else if(process.arch==="arm"){try{return D("./ast-grep-napi.linux-arm-ohos.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm-ohos")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else X.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}ge=tA();if(!ge||process.env.NAPI_RS_FORCE_WASI){try{ge=D("./ast-grep-napi.wasi.cjs")}catch(t){process.env.NAPI_RS_FORCE_WASI&&X.push(t)}if(!ge)try{ge=D("@ast-grep/napi-wasm32-wasi")}catch(t){process.env.NAPI_RS_FORCE_WASI&&X.push(t)}}if(!ge)throw X.length>0?new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.",{cause:X}):new Error("Failed to load native binding");Re.exports=ge;Re.exports.SgNode=ge.SgNode;Re.exports.SgRoot=ge.SgRoot;Re.exports.findInFiles=ge.findInFiles;Re.exports.kind=ge.kind;Re.exports.Lang=ge.Lang;Re.exports.parse=ge.parse;Re.exports.parseAsync=ge.parseAsync;Re.exports.parseFiles=ge.parseFiles;Re.exports.pattern=ge.pattern;Re.exports.registerDynamicLanguage=ge.registerDynamicLanguage;Re.exports.css=ge.css;Re.exports.html=ge.html;Re.exports.js=ge.js;Re.exports.jsx=ge.jsx;Re.exports.ts=ge.ts;Re.exports.tsx=ge.tsx});var Pg=j((nF,Tg)=>{"use strict";Tg.exports=Og;function Og(t,e,r){t instanceof RegExp&&(t=Lg(t,r)),e instanceof RegExp&&(e=Lg(e,r));var i=$g(t,e,r);return i&&{start:i[0],end:i[1],pre:r.slice(0,i[0]),body:r.slice(i[0]+t.length,i[1]),post:r.slice(i[1]+e.length)}}function Lg(t,e){var r=e.match(t);return r?r[0]:null}Og.range=$g;function $g(t,e,r){var i,s,n,a,o,c=r.indexOf(t),l=r.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(i=[],n=r.length;u>=0&&!o;)u==c?(i.push(u),c=r.indexOf(t,u+1)):i.length==1?o=[i.pop(),l]:(s=i.pop(),s<n&&(n=s,a=l),l=r.indexOf(e,u+1)),u=c<l&&c>=0?c:l;i.length&&(o=[n,a])}return o}});var Bg=j((oF,jg)=>{var Ig=Pg();jg.exports=kA;var Fg="\0SLASH"+Math.random()+"\0",Ng="\0OPEN"+Math.random()+"\0",Qc="\0CLOSE"+Math.random()+"\0",Dg="\0COMMA"+Math.random()+"\0",Mg="\0PERIOD"+Math.random()+"\0";function Zc(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function DA(t){return t.split("\\\\").join(Fg).split("\\{").join(Ng).split("\\}").join(Qc).split("\\,").join(Dg).split("\\.").join(Mg)}function MA(t){return t.split(Fg).join("\\").split(Ng).join("{").split(Qc).join("}").split(Dg).join(",").split(Mg).join(".")}function kg(t){if(!t)return[""];var e=[],r=Ig("{","}",t);if(!r)return t.split(",");var i=r.pre,s=r.body,n=r.post,a=i.split(",");a[a.length-1]+="{"+s+"}";var o=kg(n);return n.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function kA(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),ms(DA(t),!0).map(MA)):[]}function jA(t){return"{"+t+"}"}function BA(t){return/^-?0\d/.test(t)}function UA(t,e){return t<=e}function GA(t,e){return t>=e}function ms(t,e){var r=[],i=Ig("{","}",t);if(!i)return[t];var s=i.pre,n=i.post.length?ms(i.post,!1):[""];if(/\$$/.test(i.pre))for(var a=0;a<n.length;a++){var o=s+"{"+i.body+"}"+n[a];r.push(o)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=c||l,d=i.body.indexOf(",")>=0;if(!u&&!d)return i.post.match(/,.*\}/)?(t=i.pre+"{"+i.body+Qc+i.post,ms(t)):[t];var b;if(u)b=i.body.split(/\.\./);else if(b=kg(i.body),b.length===1&&(b=ms(b[0],!1).map(jA),b.length===1))return n.map(function(O){return i.pre+b[0]+O});var f;if(u){var p=Zc(b[0]),m=Zc(b[1]),y=Math.max(b[0].length,b[1].length),g=b.length==3?Math.abs(Zc(b[2])):1,w=UA,E=m<p;E&&(g*=-1,w=GA);var h=b.some(BA);f=[];for(var v=p;w(v,m);v+=g){var x;if(l)x=String.fromCharCode(v),x==="\\"&&(x="");else if(x=String(v),h){var _=y-x.length;if(_>0){var A=new Array(_+1).join("0");v<0?x="-"+A+x.slice(1):x=A+x}}f.push(x)}}else{f=[];for(var C=0;C<b.length;C++)f.push.apply(f,ms(b[C],!1))}for(var C=0;C<f.length;C++)for(var a=0;a<n.length;a++){var o=s+f[C]+n[a];(!e||u||o)&&r.push(o)}}return r}});var po=j((dN,ho)=>{function L0(t){return Array.isArray(t)?t:[t]}var fO=void 0,wl="",C0=" ",vl="\\",hO=/^\s+$/,pO=/(?:[^\\]|^)\\$/,dO=/^\\!/,mO=/^\\#/,gO=/\r?\n/g,yO=/^\.{0,2}\/|^\.{1,2}$/,bO=/\/$/,Ai="/",O0="node-ignore";typeof Symbol<"u"&&(O0=Symbol.for("node-ignore"));var $0=O0,Li=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),vO=/([0-z])-([0-z])/g,T0=()=>!1,wO=t=>t.replace(vO,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:wl),xO=t=>{let{length:e}=t;return t.slice(0,e-e%2)},EO=[[/^\uFEFF/,()=>wl],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?C0:wl)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+C0}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>vl],[/\\\\/g,()=>vl],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,s)=>e===vl?`\\[${r}${xO(i)}${s}`:s==="]"&&i.length%2===0?`[${wO(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],_O=/(^|\\\/)?\\\*$/,Ts="regex",uo="checkRegex",A0="_",SO={[Ts](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[uo](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},RO=t=>EO.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),fo=t=>typeof t=="string",CO=t=>t&&fo(t)&&!hO.test(t)&&!pO.test(t)&&t.indexOf("#")!==0,AO=t=>t.split(gO).filter(Boolean),xl=class{constructor(e,r,i,s,n,a){this.pattern=e,this.mark=r,this.negative=n,Li(this,"body",i),Li(this,"ignoreCase",s),Li(this,"regexPrefix",a)}get regex(){let e=A0+Ts;return this[e]?this[e]:this._make(Ts,e)}get checkRegex(){let e=A0+uo;return this[e]?this[e]:this._make(uo,e)}_make(e,r){let i=this.regexPrefix.replace(_O,SO[e]),s=this.ignoreCase?new RegExp(i,"i"):new RegExp(i);return Li(this,r,s)}},LO=({pattern:t,mark:e},r)=>{let i=!1,s=t;s.indexOf("!")===0&&(i=!0,s=s.substr(1)),s=s.replace(dO,"!").replace(mO,"#");let n=RO(s);return new xl(t,e,s,r,i,n)},El=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[$0]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(fo(e)&&(e={pattern:e}),CO(e.pattern)){let r=LO(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,L0(fo(e)?AO(e):e).forEach(this._add,this),this._added}test(e,r,i){let s=!1,n=!1,a;this._rules.forEach(c=>{let{negative:l}=c;n===l&&s!==n||l&&!s&&!n&&!r||!c[i].test(e)||(s=!l,n=l,a=l?fO:c)});let o={ignored:s,unignored:n};return a&&(o.rule=a),o}},OO=(t,e)=>{throw new e(t)},kt=(t,e,r)=>fo(t)?t?kt.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),P0=t=>yO.test(t);kt.isNotRelative=P0;kt.convert=t=>t;var _l=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){Li(this,$0,!0),this._rules=new El(r),this._strictPathCheck=!i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,i,s){let n=e&&kt.convert(e);return kt(n,e,this._strictPathCheck?OO:T0),this._t(n,r,i,s)}checkIgnore(e){if(!bO.test(e))return this.test(e);let r=e.split(Ai).filter(Boolean);if(r.pop(),r.length){let i=this._t(r.join(Ai)+Ai,this._testCache,!0,r);if(i.ignored)return i}return this._rules.test(e,!1,uo)}_t(e,r,i,s){if(e in r)return r[e];if(s||(s=e.split(Ai).filter(Boolean)),s.pop(),!s.length)return r[e]=this._rules.test(e,i,Ts);let n=this._t(s.join(Ai)+Ai,r,i,s);return r[e]=n.ignored?n:this._rules.test(e,i,Ts)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return L0(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},Sl=t=>new _l(t),$O=t=>kt(t&&kt.convert(t),t,T0),I0=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");kt.convert=t;let e=/^[a-z]:\//i;kt.isNotRelative=r=>e.test(r)||P0(r)};typeof process<"u"&&process.platform==="win32"&&I0();ho.exports=Sl;Sl.default=Sl;ho.exports.isPathValid=$O;Li(ho.exports,Symbol.for("setupWindows"),I0)});import*as Br from"fs/promises";import*as wy from"os";import*as ko from"path";var ky=20,jy=1,rr=1e6,Kl=1e6,By=-7,Uy=21,Gy=!1,Mi="[big.js] ",ir=Mi+"Invalid ",Ws=ir+"decimal places",qy=ir+"rounding mode",Yl=Mi+"Division by zero",ue={},bt=void 0,zy=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Xl(){function t(e){var r=this;if(!(r instanceof t))return e===bt&&arguments.length===0?Xl():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(ir+"value");e=e===0&&1/e<0?"-0":String(e)}Wy(r,e)}r.constructor=t}return t.prototype=ue,t.DP=ky,t.RM=jy,t.NE=By,t.PE=Uy,t.strict=Gy,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function Wy(t,e){var r,i,s;if(!zy.test(e))throw Error(ir+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(i=e.search(/e/i))>0?(r<0&&(r=i),r+=+e.slice(i+1),e=e.substring(0,i)):r<0&&(r=e.length),s=e.length,i=0;i<s&&e.charAt(i)=="0";)++i;if(i==s)t.c=[t.e=0];else{for(;s>0&&e.charAt(--s)=="0";);for(t.e=r-i-1,t.c=[],r=0;i<=s;)t.c[r++]=+e.charAt(i++)}return t}function sr(t,e,r,i){var s=t.c;if(r===bt&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(qy);if(e<1)i=r===3&&(i||!!s[0])||e===0&&(r===1&&s[0]>=5||r===2&&(s[0]>5||s[0]===5&&(i||s[1]!==bt))),s.length=1,i?(t.e=t.e-e+1,s[0]=1):s[0]=t.e=0;else if(e<s.length){if(i=r===1&&s[e]>=5||r===2&&(s[e]>5||s[e]===5&&(i||s[e+1]!==bt||s[e-1]&1))||r===3&&(i||!!s[0]),s.length=e,i){for(;++s[--e]>9;)if(s[e]=0,e===0){++t.e,s.unshift(1);break}}for(e=s.length;!s[--e];)s.pop()}return t}function nr(t,e,r){var i=t.e,s=t.c.join(""),n=s.length;if(e)s=s.charAt(0)+(n>1?"."+s.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)s="0"+s;s="0."+s}else if(i>0)if(++i>n)for(i-=n;i--;)s+="0";else i<n&&(s=s.slice(0,i)+"."+s.slice(i));else n>1&&(s=s.charAt(0)+"."+s.slice(1));return t.s<0&&r?"-"+s:s}ue.abs=function(){var t=new this.constructor(this);return t.s=1,t};ue.cmp=function(t){var e,r=this,i=r.c,s=(t=new r.constructor(t)).c,n=r.s,a=t.s,o=r.e,c=t.e;if(!i[0]||!s[0])return i[0]?n:s[0]?-a:0;if(n!=a)return n;if(e=n<0,o!=c)return o>c^e?1:-1;for(a=(o=i.length)<(c=s.length)?o:c,n=-1;++n<a;)if(i[n]!=s[n])return i[n]>s[n]^e?1:-1;return o==c?0:o>c^e?1:-1};ue.div=function(t){var e=this,r=e.constructor,i=e.c,s=(t=new r(t)).c,n=e.s==t.s?1:-1,a=r.DP;if(a!==~~a||a<0||a>rr)throw Error(Ws);if(!s[0])throw Error(Yl);if(!i[0])return t.s=n,t.c=[t.e=0],t;var o,c,l,u,d,b=s.slice(),f=o=s.length,p=i.length,m=i.slice(0,o),y=m.length,g=t,w=g.c=[],E=0,h=a+(g.e=e.e-t.e)+1;for(g.s=n,n=h<0?0:h,b.unshift(0);y++<o;)m.push(0);do{for(l=0;l<10;l++){if(o!=(y=m.length))u=o>y?1:-1;else for(d=-1,u=0;++d<o;)if(s[d]!=m[d]){u=s[d]>m[d]?1:-1;break}if(u<0){for(c=y==o?s:b;y;){if(m[--y]<c[y]){for(d=y;d&&!m[--d];)m[d]=9;--m[d],m[y]+=10}m[y]-=c[y]}for(;!m[0];)m.shift()}else break}w[E++]=u?l:++l,m[0]&&u?m[y]=i[f]||0:m=[i[f]]}while((f++<p||m[0]!==bt)&&n--);return!w[0]&&E!=1&&(w.shift(),g.e--,h--),E>h&&sr(g,h,r.RM,m[0]!==bt),g};ue.eq=function(t){return this.cmp(t)===0};ue.gt=function(t){return this.cmp(t)>0};ue.gte=function(t){return this.cmp(t)>-1};ue.lt=function(t){return this.cmp(t)<0};ue.lte=function(t){return this.cmp(t)<1};ue.minus=ue.sub=function(t){var e,r,i,s,n=this,a=n.constructor,o=n.s,c=(t=new a(t)).s;if(o!=c)return t.s=-c,n.plus(t);var l=n.c.slice(),u=n.e,d=t.c,b=t.e;if(!l[0]||!d[0])return d[0]?t.s=-c:l[0]?t=new a(n):t.s=1,t;if(o=u-b){for((s=o<0)?(o=-o,i=l):(b=u,i=d),i.reverse(),c=o;c--;)i.push(0);i.reverse()}else for(r=((s=l.length<d.length)?l:d).length,o=c=0;c<r;c++)if(l[c]!=d[c]){s=l[c]<d[c];break}if(s&&(i=l,l=d,d=i,t.s=-t.s),(c=(r=d.length)-(e=l.length))>0)for(;c--;)l[e++]=0;for(c=e;r>o;){if(l[--r]<d[r]){for(e=r;e&&!l[--e];)l[e]=9;--l[e],l[r]+=10}l[r]-=d[r]}for(;l[--c]===0;)l.pop();for(;l[0]===0;)l.shift(),--b;return l[0]||(t.s=1,l=[b=0]),t.c=l,t.e=b,t};ue.mod=function(t){var e,r=this,i=r.constructor,s=r.s,n=(t=new i(t)).s;if(!t.c[0])throw Error(Yl);return r.s=t.s=1,e=t.cmp(r)==1,r.s=s,t.s=n,e?new i(r):(s=i.DP,n=i.RM,i.DP=i.RM=0,r=r.div(t),i.DP=s,i.RM=n,this.minus(r.times(t)))};ue.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};ue.plus=ue.add=function(t){var e,r,i,s=this,n=s.constructor;if(t=new n(t),s.s!=t.s)return t.s=-t.s,s.minus(t);var a=s.e,o=s.c,c=t.e,l=t.c;if(!o[0]||!l[0])return l[0]||(o[0]?t=new n(s):t.s=s.s),t;if(o=o.slice(),e=a-c){for(e>0?(c=a,i=l):(e=-e,i=o),i.reverse();e--;)i.push(0);i.reverse()}for(o.length-l.length<0&&(i=l,l=o,o=i),e=l.length,r=0;e;o[e]%=10)r=(o[--e]=o[e]+l[e]+r)/10|0;for(r&&(o.unshift(r),++c),e=o.length;o[--e]===0;)o.pop();return t.c=o,t.e=c,t};ue.pow=function(t){var e=this,r=new e.constructor("1"),i=r,s=t<0;if(t!==~~t||t<-Kl||t>Kl)throw Error(ir+"exponent");for(s&&(t=-t);t&1&&(i=i.times(e)),t>>=1,!!t;)e=e.times(e);return s?r.div(i):i};ue.prec=function(t,e){if(t!==~~t||t<1||t>rr)throw Error(ir+"precision");return sr(new this.constructor(this),t,e)};ue.round=function(t,e){if(t===bt)t=0;else if(t!==~~t||t<-rr||t>rr)throw Error(Ws);return sr(new this.constructor(this),t+this.e+1,e)};ue.sqrt=function(){var t,e,r,i=this,s=i.constructor,n=i.s,a=i.e,o=new s("0.5");if(!i.c[0])return new s(i);if(n<0)throw Error(Mi+"No square root");n=Math.sqrt(+nr(i,!0,!0)),n===0||n===1/0?(e=i.c.join(""),e.length+a&1||(e+="0"),n=Math.sqrt(e),a=((a+1)/2|0)-(a<0||a&1),t=new s((n==1/0?"5e":(n=n.toExponential()).slice(0,n.indexOf("e")+1))+a)):t=new s(n+""),a=t.e+(s.DP+=4);do r=t,t=o.times(r.plus(i.div(r)));while(r.c.slice(0,a).join("")!==t.c.slice(0,a).join(""));return sr(t,(s.DP-=4)+t.e+1,s.RM)};ue.times=ue.mul=function(t){var e,r=this,i=r.constructor,s=r.c,n=(t=new i(t)).c,a=s.length,o=n.length,c=r.e,l=t.e;if(t.s=r.s==t.s?1:-1,!s[0]||!n[0])return t.c=[t.e=0],t;for(t.e=c+l,a<o&&(e=s,s=n,n=e,l=a,a=o,o=l),e=new Array(l=a+o);l--;)e[l]=0;for(c=o;c--;){for(o=0,l=a+c;l>c;)o=e[l]+n[c]*s[l-c-1]+o,e[l--]=o%10,o=o/10|0;e[l]=o}for(o?++t.e:e.shift(),c=e.length;!e[--c];)e.pop();return t.c=e,t};ue.toExponential=function(t,e){var r=this,i=r.c[0];if(t!==bt){if(t!==~~t||t<0||t>rr)throw Error(Ws);for(r=sr(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return nr(r,!0,!!i)};ue.toFixed=function(t,e){var r=this,i=r.c[0];if(t!==bt){if(t!==~~t||t<0||t>rr)throw Error(Ws);for(r=sr(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return nr(r,!1,!!i)};ue.toJSON=ue.toString=function(){var t=this,e=t.constructor;return nr(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};typeof Symbol<"u"&&(ue[Symbol.for("nodejs.util.inspect.custom")]=ue.toJSON);ue.toNumber=function(){var t=+nr(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(Mi+"Imprecise conversion");return t};ue.toPrecision=function(t,e){var r=this,i=r.constructor,s=r.c[0];if(t!==bt){if(t!==~~t||t<1||t>rr)throw Error(ir+"precision");for(r=sr(new i(r),t,e);r.c.length<t;)r.c.push(0)}return nr(r,t<=r.e||r.e<=i.NE||r.e>=i.PE,!!s)};ue.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(Mi+"valueOf disallowed");return nr(t,t.e<=e.NE||t.e>=e.PE,!0)};var Vy=Xl(),Ke=Vy;var Jl=(t=0)=>e=>`\x1B[${e+t}m`,Zl=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ql=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,de={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},j$=Object.keys(de.modifier),Hy=Object.keys(de.color),Ky=Object.keys(de.bgColor),B$=[...Hy,...Ky];function Yy(){let t=new Map;for(let[e,r]of Object.entries(de)){for(let[i,s]of Object.entries(r))de[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=de[i],t.set(s[0],s[1]);Object.defineProperty(de,e,{value:r,enumerable:!1})}return Object.defineProperty(de,"codes",{value:t,enumerable:!1}),de.color.close="\x1B[39m",de.bgColor.close="\x1B[49m",de.color.ansi=Jl(),de.color.ansi256=Zl(),de.color.ansi16m=Ql(),de.bgColor.ansi=Jl(10),de.bgColor.ansi256=Zl(10),de.bgColor.ansi16m=Ql(10),Object.defineProperties(de,{rgbToAnsi256:{value(e,r,i){return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(n=>n+n).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>de.rgbToAnsi256(...de.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,i,s;if(e>=232)r=((e-232)*10+8)/255,i=r,s=r;else{e-=16;let o=e%36;r=Math.floor(e/36)/5,i=Math.floor(o/6)/5,s=o%6/5}let n=Math.max(r,i,s)*2;if(n===0)return 30;let a=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return n===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,r,i)=>de.ansi256ToAnsi(de.rgbToAnsi256(e,r,i)),enumerable:!1},hexToAnsi:{value:e=>de.ansi256ToAnsi(de.hexToAnsi256(e)),enumerable:!1}}),de}var Xy=Yy(),ft=Xy;import Bo from"node:process";import Jy from"node:os";import eu from"node:tty";function Je(t,e=globalThis.Deno?globalThis.Deno.args:Bo.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)}var{env:me}=Bo,Vs;Je("no-color")||Je("no-colors")||Je("color=false")||Je("color=never")?Vs=0:(Je("color")||Je("colors")||Je("color=true")||Je("color=always"))&&(Vs=1);function Zy(){if("FORCE_COLOR"in me)return me.FORCE_COLOR==="true"?1:me.FORCE_COLOR==="false"?0:me.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(me.FORCE_COLOR,10),3)}function Qy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function eb(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let i=Zy();i!==void 0&&(Vs=i);let s=r?Vs:i;if(s===0)return 0;if(r){if(Je("color=16m")||Je("color=full")||Je("color=truecolor"))return 3;if(Je("color=256"))return 2}if("TF_BUILD"in me&&"AGENT_NAME"in me)return 1;if(t&&!e&&s===void 0)return 0;let n=s||0;if(me.TERM==="dumb")return n;if(Bo.platform==="win32"){let a=Jy.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in me)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in me)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in me)||me.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in me)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(me.TEAMCITY_VERSION)?1:0;if(me.COLORTERM==="truecolor"||me.TERM==="xterm-kitty"||me.TERM==="xterm-ghostty"||me.TERM==="wezterm")return 3;if("TERM_PROGRAM"in me){let a=Number.parseInt((me.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(me.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(me.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(me.TERM)||"COLORTERM"in me?1:n}function tu(t,e={}){let r=eb(t,{streamIsTTY:t&&t.isTTY,...e});return Qy(r)}var tb={stdout:tu({isTTY:eu.isatty(1)}),stderr:tu({isTTY:eu.isatty(2)})},ru=tb;function iu(t,e,r){let i=t.indexOf(e);if(i===-1)return t;let s=e.length,n=0,a="";do a+=t.slice(n,i)+e+r,n=i+s,i=t.indexOf(e,n);while(i!==-1);return a+=t.slice(n),a}function su(t,e,r,i){let s=0,n="";do{let a=t[i-1]==="\r";n+=t.slice(s,a?i-1:i)+e+(a?`\r
|
|
15
|
+
`):i.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}fm.exports=Nc});var vm=j(bm=>{"use strict";var gm=D("os"),Ft=D("path"),ym=gm.tmpdir(),TR=process.getuid?process.getuid():process.pid,PR=()=>!0,dm=process.platform==="win32",mm={editor:()=>process.env.EDITOR||process.env.VISUAL||(dm?"notepad.exe":"vi"),shell:()=>dm?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},IR={fromString:()=>process.umask()},fi=gm.homedir();fi?process.env.HOME=fi:fi=Ft.resolve(ym,"npm-"+TR);var FR=process.platform==="win32"?"npm-cache":".npm",NR=process.platform==="win32"&&process.env.APPDATA||fi,DR=Ft.resolve(NR,FR),Pn,Tr;Object.defineProperty(bm,"defaults",{get:function(){return Pn||(process.env.PREFIX?Tr=process.env.PREFIX:process.platform==="win32"?Tr=Ft.dirname(process.execPath):(Tr=Ft.dirname(Ft.dirname(process.execPath)),process.env.DESTDIR&&(Tr=Ft.join(process.env.DESTDIR,Tr))),Pn={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:DR,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:mm.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ft.resolve(Tr,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ft.resolve(fi,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Tr,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:mm.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:ym,unicode:PR(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ft.resolve(fi,".npmrc"),umask:process.umask?process.umask():IR.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Pn)}})});var xm=j((a2,Dc)=>{"use strict";var Pr=D("path"),MR=pm(),wm=vm();Dc.exports=(t,e,r)=>{let i=new MR(Object.assign({},wm.defaults,r),e);i.add(Object.assign({},t),"cli");let s=[],n=!1;if(D.resolve.paths){let l=D.resolve.paths("npm"),u;try{u=D.resolve("npm",{paths:l.slice(-1)})}catch{n=!0}u&&s.push(i.addFile(Pr.resolve(Pr.dirname(u),"..","npmrc"),"builtin"))}i.addEnv(),i.loadPrefix();let a=Pr.resolve(i.localPrefix,".npmrc"),o=i.get("userconfig");if(!i.get("global")&&a!==o?s.push(i.addFile(a,"project")):i.add({},"project"),i.get("workspace-prefix")&&i.get("workspace-prefix")!==a){let l=Pr.resolve(i.get("workspace-prefix"),".npmrc");s.push(i.addFile(l,"workspace"))}if(s.push(i.addFile(i.get("userconfig"),"user")),i.get("prefix")){let l=Pr.resolve(i.get("prefix"),"etc");i.root.globalconfig=Pr.resolve(l,"npmrc"),i.root.globalignorefile=Pr.resolve(l,"npmignore")}s.push(i.addFile(i.get("globalconfig"),"global")),i.loadUser();let c=i.get("cafile");return c&&i.loadCAFile(c),{config:i,warnings:s.filter(Boolean),failedToLoadBuiltInConfig:n}};Object.defineProperty(Dc.exports,"defaults",{get(){return wm.defaults},enumerable:!0})});var Om=j((l2,Lm)=>{var Em=xm(),_m=":_authToken",Sm=":_auth",Rm=":username",Cm=":_password";Lm.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let i=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:s=>i[s]}}:Em()).config,e=e||r.npmrc.get("registry")||Em.defaults.registry,Am(e,r)||jR(r.npmrc)};function kR(t,e){let r=new URL(e,new URL(t.startsWith("//")?`./${t}`:t,"resolve://"));if(r.protocol==="resolve:"){let{pathname:i,search:s,hash:n}=r;return i+s+n}return r.toString()}function Am(t,e){let r=t instanceof URL?t:new URL(t.startsWith("//")?`http:${t}`:t),i;for(;i!=="/"&&r.pathname!==i;){i=r.pathname||"/";let s="//"+r.host+i.replace(/\/$/,""),n=UR(s,e.npmrc);if(n)return n;if(!e.recursive)return/\/$/.test(t)?void 0:Am(new URL("./",r),e);r.pathname=kR(BR(i),"..")||"/"}}function jR(t){return t.get("_auth")?{token:In(t.get("_auth")),type:"Basic"}:void 0}function BR(t){return t[t.length-1]==="/"?t:t+"/"}function UR(t,e){let r=GR(e.get(t+_m)||e.get(t+"/"+_m));if(r)return r;let i=e.get(t+Rm)||e.get(t+"/"+Rm),s=e.get(t+Cm)||e.get(t+"/"+Cm),n=zR(i,s);if(n)return n;let a=qR(e.get(t+Sm)||e.get(t+"/"+Sm));if(a)return a}function In(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function GR(t){return t?{token:In(t),type:"Bearer"}:void 0}function zR(t,e){if(!t||!e)return;let r=Buffer.from(In(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function qR(t){return t?{token:In(t),type:"Basic"}:void 0}});var hg=j((U2,kn)=>{var Wm,Vm,Hm,Km,Ym,Xm,Jm,Zm,Qm,Mn,Kc,eg,tg,di,rg,ig,sg,ng,og,ag,cg,lg,ug;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof kn=="object"&&typeof kn.exports=="object"?t(r(e,r(kn.exports))):t(r(e));function r(i,s){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(n,a){return i[n]=s?s(n,a):a}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])};Wm=function(r,i){e(r,i);function s(){this.constructor=r}r.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},Vm=Object.assign||function(r){for(var i,s=1,n=arguments.length;s<n;s++){i=arguments[s];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},Hm=function(r,i){var s={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&i.indexOf(n)<0&&(s[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(r);a<n.length;a++)i.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(r,n[a])&&(s[n[a]]=r[n[a]]);return s},Km=function(r,i,s,n){var a=arguments.length,o=a<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,s):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,i,s,n);else for(var l=r.length-1;l>=0;l--)(c=r[l])&&(o=(a<3?c(o):a>3?c(i,s,o):c(i,s))||o);return a>3&&o&&Object.defineProperty(i,s,o),o},Ym=function(r,i){return function(s,n){i(s,n,r)}},Xm=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},Jm=function(r,i,s,n){function a(o){return o instanceof s?o:new s(function(c){c(o)})}return new(s||(s=Promise))(function(o,c){function l(g){try{d(n.next(g))}catch(h){c(h)}}function u(g){try{d(n.throw(g))}catch(h){c(h)}}function d(g){g.done?o(g.value):a(g.value).then(l,u)}d((n=n.apply(r,i||[])).next())})},Zm=function(r,i){var s={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(g){return u([d,g])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,a&&(o=d[0]&2?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return s.label++,{value:d[1],done:!1};case 5:s.label++,a=d[1],d=[0];continue;case 7:d=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){s=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){s.label=d[1];break}if(d[0]===6&&s.label<o[1]){s.label=o[1],o=d;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(d);break}o[2]&&s.ops.pop(),s.trys.pop();continue}d=i.call(r,s)}catch(g){d=[6,g],a=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},ug=function(r,i,s,n){n===void 0&&(n=s),r[n]=i[s]},Qm=function(r,i){for(var s in r)s!=="default"&&!i.hasOwnProperty(s)&&(i[s]=r[s])},Mn=function(r){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&r[i],n=0;if(s)return s.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},Kc=function(r,i){var s=typeof Symbol=="function"&&r[Symbol.iterator];if(!s)return r;var n=s.call(r),a,o=[],c;try{for(;(i===void 0||i-- >0)&&!(a=n.next()).done;)o.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(s=n.return)&&s.call(n)}finally{if(c)throw c.error}}return o},eg=function(){for(var r=[],i=0;i<arguments.length;i++)r=r.concat(Kc(arguments[i]));return r},tg=function(){for(var r=0,i=0,s=arguments.length;i<s;i++)r+=arguments[i].length;for(var n=Array(r),a=0,i=0;i<s;i++)for(var o=arguments[i],c=0,l=o.length;c<l;c++,a++)n[a]=o[c];return n},di=function(r){return this instanceof di?(this.v=r,this):new di(r)},rg=function(r,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=s.apply(r,i||[]),a,o=[];return a={},c("next"),c("throw"),c("return"),a[Symbol.asyncIterator]=function(){return this},a;function c(p){n[p]&&(a[p]=function(m){return new Promise(function(y,b){o.push([p,m,y,b])>1||l(p,m)})})}function l(p,m){try{u(n[p](m))}catch(y){h(o[0][3],y)}}function u(p){p.value instanceof di?Promise.resolve(p.value.v).then(d,g):h(o[0][2],p)}function d(p){l("next",p)}function g(p){l("throw",p)}function h(p,m){p(m),o.shift(),o.length&&l(o[0][0],o[0][1])}},ig=function(r){var i,s;return i={},n("next"),n("throw",function(a){throw a}),n("return"),i[Symbol.iterator]=function(){return this},i;function n(a,o){i[a]=r[a]?function(c){return(s=!s)?{value:di(r[a](c)),done:a==="return"}:o?o(c):c}:o}},sg=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],s;return i?i.call(r):(r=typeof Mn=="function"?Mn(r):r[Symbol.iterator](),s={},n("next"),n("throw"),n("return"),s[Symbol.asyncIterator]=function(){return this},s);function n(o){s[o]=r[o]&&function(c){return new Promise(function(l,u){c=r[o](c),a(l,u,c.done,c.value)})}}function a(o,c,l,u){Promise.resolve(u).then(function(d){o({value:d,done:l})},c)}},ng=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},og=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)Object.hasOwnProperty.call(r,s)&&(i[s]=r[s]);return i.default=r,i},ag=function(r){return r&&r.__esModule?r:{default:r}},cg=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},lg=function(r,i,s){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,s),s},t("__extends",Wm),t("__assign",Vm),t("__rest",Hm),t("__decorate",Km),t("__param",Ym),t("__metadata",Xm),t("__awaiter",Jm),t("__generator",Zm),t("__exportStar",Qm),t("__createBinding",ug),t("__values",Mn),t("__read",Kc),t("__spread",eg),t("__spreadArrays",tg),t("__await",di),t("__asyncGenerator",rg),t("__asyncDelegator",ig),t("__asyncValues",sg),t("__makeTemplateObject",ng),t("__importStar",og),t("__importDefault",ag),t("__classPrivateFieldGet",cg),t("__classPrivateFieldSet",lg)})});var pg={};jo(pg,{__assign:()=>pC,__asyncDelegator:()=>LC,__asyncGenerator:()=>AC,__asyncValues:()=>OC,__await:()=>CC,__awaiter:()=>bC,__classPrivateFieldGet:()=>IC,__classPrivateFieldSet:()=>FC,__createBinding:()=>xC,__decorate:()=>mC,__exportStar:()=>wC,__extends:()=>fC,__generator:()=>vC,__importDefault:()=>PC,__importStar:()=>TC,__makeTemplateObject:()=>$C,__metadata:()=>yC,__param:()=>gC,__read:()=>_C,__rest:()=>dC,__spread:()=>SC,__spreadArrays:()=>RC,__values:()=>EC});var fg,fC,pC,dC,mC,gC,yC,bC,vC,wC,xC,EC,_C,SC,RC,CC,AC,LC,OC,$C,TC,PC,IC,FC,dg=Dy(()=>{fg=We(hg(),1),{__extends:fC,__assign:pC,__rest:dC,__decorate:mC,__param:gC,__metadata:yC,__awaiter:bC,__generator:vC,__exportStar:wC,__createBinding:xC,__values:EC,__read:_C,__spread:SC,__spreadArrays:RC,__await:CC,__asyncGenerator:AC,__asyncDelegator:LC,__asyncValues:OC,__makeTemplateObject:$C,__importStar:TC,__importDefault:PC,__classPrivateFieldGet:IC,__classPrivateFieldSet:FC}=fg.default});var bg=j((G2,yg)=>{"use strict";var Yc=Object.defineProperty,NC=Object.getOwnPropertyDescriptor,DC=Object.getOwnPropertyNames,MC=Object.prototype.hasOwnProperty,kC=(t,e)=>{for(var r in e)Yc(t,r,{get:e[r],enumerable:!0})},jC=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of DC(e))!MC.call(t,s)&&s!==r&&Yc(t,s,{get:()=>e[s],enumerable:!(i=NC(e,s))||i.enumerable});return t},BC=t=>jC(Yc({},"__esModule",{value:!0}),t),mg={};kC(mg,{defaultDeserialize:()=>GC,defaultSerialize:()=>UC});yg.exports=BC(mg);var gg=D("buffer"),jn=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(gg.Buffer.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",i=Array.isArray(t);r=i?"[":"{";let s=!0;for(let n in t){let a=typeof t[n]=="function"||!i&&t[n]===void 0;!Object.hasOwn(t,n)||a||(s||(r+=","),s=!1,i?r+=jn(t[n],e):t[n]!==void 0&&(r+=`${jn(n,!1)}:${jn(t[n],e)}`))}return r+=i?"]":"}",r}return JSON.stringify(t)},UC=t=>jn(t,!0),GC=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?gg.Buffer.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r)});var vg=j(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.Field=void 0;ps.makeField=zC;var Bn=class{kv;key;defaults;constructor(e,r,i){this.kv=e,this.key=r,this.defaults=i}async get(e=this.defaults){return await this.kv.get(this.key)??e}getSync(e=this.defaults){if("getSync"in this.kv)return this.kv.getSync(this.key)??e;throw new Error("kv does not support getSync")}set(e,r){return this.kv.set(this.key,e,r)}delete(){return this.kv.delete(this.key)}};ps.Field=Bn;function zC(t,e,r){return new Bn(t,e,r)}});var _g=j(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.KeyvFile=Nt.defaultOpts=void 0;var mi=(dg(),My(pg)),qC=mi.__importStar(D("os")),Un=mi.__importStar(D("fs")),wg=mi.__importStar(D("fs/promises")),WC=mi.__importDefault(D("events")),xg=bg(),VC=mi.__importDefault(D("path"));mi.__exportStar(vg(),Nt);Nt.defaultOpts={deserialize:xg.defaultDeserialize,dialect:"redis",expiredCheckDelay:24*3600*1e3,filename:`${qC.tmpdir()}/keyv-file/default.json`,serialize:xg.defaultSerialize,writeDelay:100,checkFileLock:!1};function Eg(t){return typeof t=="number"}var Gn=class extends WC.default{ttlSupport=!0;namespace;opts;_data;_lastExpire;constructor(e){super(),this.opts=Object.assign({},Nt.defaultOpts,e),this.opts.checkFileLock&&this.acquireFileLock();try{let r=this.opts.deserialize(Un.readFileSync(this.opts.filename,"utf8"));if(!Array.isArray(r.cache)){let i=r.cache;r.cache=[];for(let s in i)i.hasOwnProperty(s)&&r.cache.push([s,i[s]])}this._data=new Map(r.cache),this._lastExpire=r.lastExpire}catch{this._data=new Map,this._lastExpire=Date.now()}}get _lockFile(){return this.opts.filename+".lock"}acquireFileLock(){try{let e=Un.openSync(this._lockFile,"wx");Un.closeSync(e),process.on("SIGINT",()=>{this.releaseFileLock(),process.exit(0)}),process.on("exit",()=>{this.releaseFileLock()})}catch(e){throw console.error("[keyv-file] There is another process using this file"),e}}releaseFileLock(){try{Un.unlinkSync(this._lockFile)}catch{}}async get(e){return this.getSync(e)}getSync(e){try{let r=this._data.get(e);if(r)if(this.isExpired(r)){this.delete(e);return}else return r.value;else return}catch{}}async getMany(e){return e.map(r=>this.getSync(r))}async set(e,r,i){return i===0&&(i=void 0),this._data.set(e,{expire:Eg(i)?Date.now()+i:void 0,value:r}),this.save()}async delete(e){let r=this._data.delete(e);return await this.save(),r}async deleteMany(e){let r=e.every(i=>this._data.delete(i));return await this.save(),r}async clear(){return this._data=new Map,this._lastExpire=Date.now(),this.save()}async has(e){return await this.get(e)!==void 0}isExpired(e){return Eg(e.expire)&&e.expire<=Date.now()}clearExpire(){let e=Date.now();if(!(e-this._lastExpire<=this.opts.expiredCheckDelay)){for(let r of this._data.keys()){let i=this._data.get(r);this.isExpired(i)&&this._data.delete(r)}this._lastExpire=e}}async saveToDisk(){let e=[];for(let[i,s]of this._data)e.push([i,s]);let r=this.opts.serialize({cache:e,lastExpire:this._lastExpire});return await wg.mkdir(VC.default.dirname(this.opts.filename),{recursive:!0}),wg.writeFile(this.opts.filename,r)}_savePromise;save(){return this.clearExpire(),this._savePromise?this._savePromise:(this._savePromise=new Promise((e,r)=>{setTimeout(()=>{this.saveToDisk().then(e,r).finally(()=>{this._savePromise=void 0})},this.opts.writeDelay)}),this._savePromise)}disconnect(){return Promise.resolve()}async*iterator(e){for(let[r,i]of this._data.entries())r!==void 0&&(!e||r.includes(e))&&(yield[r,i.value])}};Nt.KeyvFile=Gn;Nt.default=Gn});var Xc=j((Q2,Re)=>{var{createRequire:YC}=D("node:module");D=YC(__filename);var{readFileSync:XC}=D("node:fs"),ye=null,X=[],qn=()=>{let t=!1;return process.platform==="linux"&&(t=ZC(),t===null&&(t=QC()),t===null&&(t=eA())),t},JC=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),ZC=()=>{try{return XC("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},QC=()=>{let t=null;return typeof process.report?.getReport=="function"&&(process.report.excludeNetwork=!0,t=process.report.getReport()),t?t.header&&t.header.glibcVersionRuntime?!1:!!(Array.isArray(t.sharedObjects)&&t.sharedObjects.some(JC)):null},eA=()=>{try{return D("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}};function tA(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{ye=D(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)}catch(t){X.push(t)}else if(process.platform==="android")if(process.arch==="arm64"){try{return D("./ast-grep-napi.android-arm64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-android-arm64")}catch(t){X.push(t)}}else if(process.arch==="arm"){try{return D("./ast-grep-napi.android-arm-eabi.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-android-arm-eabi")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64"){try{return D("./ast-grep-napi.win32-x64-msvc.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-win32-x64-msvc")}catch(t){X.push(t)}}else if(process.arch==="ia32"){try{return D("./ast-grep-napi.win32-ia32-msvc.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-win32-ia32-msvc")}catch(t){X.push(t)}}else if(process.arch==="arm64"){try{return D("./ast-grep-napi.win32-arm64-msvc.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-win32-arm64-msvc")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return D("./ast-grep-napi.darwin-universal.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-darwin-universal")}catch(t){X.push(t)}if(process.arch==="x64"){try{return D("./ast-grep-napi.darwin-x64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-darwin-x64")}catch(t){X.push(t)}}else if(process.arch==="arm64"){try{return D("./ast-grep-napi.darwin-arm64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-darwin-arm64")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return D("./ast-grep-napi.freebsd-x64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-freebsd-x64")}catch(t){X.push(t)}}else if(process.arch==="arm64"){try{return D("./ast-grep-napi.freebsd-arm64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-freebsd-arm64")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(qn()){try{return D("./ast-grep-napi.linux-x64-musl.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-x64-musl")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-x64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-x64-gnu")}catch(t){X.push(t)}}else if(process.arch==="arm64")if(qn()){try{return D("./ast-grep-napi.linux-arm64-musl.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm64-musl")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-arm64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm64-gnu")}catch(t){X.push(t)}}else if(process.arch==="arm")if(qn()){try{return D("./ast-grep-napi.linux-arm-musleabihf.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm-musleabihf")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-arm-gnueabihf.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm-gnueabihf")}catch(t){X.push(t)}}else if(process.arch==="riscv64")if(qn()){try{return D("./ast-grep-napi.linux-riscv64-musl.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-riscv64-musl")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-riscv64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-riscv64-gnu")}catch(t){X.push(t)}}else if(process.arch==="ppc64"){try{return D("./ast-grep-napi.linux-ppc64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-ppc64-gnu")}catch(t){X.push(t)}}else if(process.arch==="s390x"){try{return D("./ast-grep-napi.linux-s390x-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-s390x-gnu")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return D("./ast-grep-napi.linux-arm64-ohos.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm64-ohos")}catch(t){X.push(t)}}else if(process.arch==="x64"){try{return D("./ast-grep-napi.linux-x64-ohos.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-x64-ohos")}catch(t){X.push(t)}}else if(process.arch==="arm"){try{return D("./ast-grep-napi.linux-arm-ohos.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm-ohos")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else X.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}ye=tA();if(!ye||process.env.NAPI_RS_FORCE_WASI){try{ye=D("./ast-grep-napi.wasi.cjs")}catch(t){process.env.NAPI_RS_FORCE_WASI&&X.push(t)}if(!ye)try{ye=D("@ast-grep/napi-wasm32-wasi")}catch(t){process.env.NAPI_RS_FORCE_WASI&&X.push(t)}}if(!ye)throw X.length>0?new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.",{cause:X}):new Error("Failed to load native binding");Re.exports=ye;Re.exports.SgNode=ye.SgNode;Re.exports.SgRoot=ye.SgRoot;Re.exports.findInFiles=ye.findInFiles;Re.exports.kind=ye.kind;Re.exports.Lang=ye.Lang;Re.exports.parse=ye.parse;Re.exports.parseAsync=ye.parseAsync;Re.exports.parseFiles=ye.parseFiles;Re.exports.pattern=ye.pattern;Re.exports.registerDynamicLanguage=ye.registerDynamicLanguage;Re.exports.css=ye.css;Re.exports.html=ye.html;Re.exports.js=ye.js;Re.exports.jsx=ye.jsx;Re.exports.ts=ye.ts;Re.exports.tsx=ye.tsx});var Pg=j((nF,Tg)=>{"use strict";Tg.exports=Og;function Og(t,e,r){t instanceof RegExp&&(t=Lg(t,r)),e instanceof RegExp&&(e=Lg(e,r));var i=$g(t,e,r);return i&&{start:i[0],end:i[1],pre:r.slice(0,i[0]),body:r.slice(i[0]+t.length,i[1]),post:r.slice(i[1]+e.length)}}function Lg(t,e){var r=e.match(t);return r?r[0]:null}Og.range=$g;function $g(t,e,r){var i,s,n,a,o,c=r.indexOf(t),l=r.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(i=[],n=r.length;u>=0&&!o;)u==c?(i.push(u),c=r.indexOf(t,u+1)):i.length==1?o=[i.pop(),l]:(s=i.pop(),s<n&&(n=s,a=l),l=r.indexOf(e,u+1)),u=c<l&&c>=0?c:l;i.length&&(o=[n,a])}return o}});var Bg=j((oF,jg)=>{var Ig=Pg();jg.exports=kA;var Fg="\0SLASH"+Math.random()+"\0",Ng="\0OPEN"+Math.random()+"\0",Qc="\0CLOSE"+Math.random()+"\0",Dg="\0COMMA"+Math.random()+"\0",Mg="\0PERIOD"+Math.random()+"\0";function Zc(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function DA(t){return t.split("\\\\").join(Fg).split("\\{").join(Ng).split("\\}").join(Qc).split("\\,").join(Dg).split("\\.").join(Mg)}function MA(t){return t.split(Fg).join("\\").split(Ng).join("{").split(Qc).join("}").split(Dg).join(",").split(Mg).join(".")}function kg(t){if(!t)return[""];var e=[],r=Ig("{","}",t);if(!r)return t.split(",");var i=r.pre,s=r.body,n=r.post,a=i.split(",");a[a.length-1]+="{"+s+"}";var o=kg(n);return n.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function kA(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),ms(DA(t),!0).map(MA)):[]}function jA(t){return"{"+t+"}"}function BA(t){return/^-?0\d/.test(t)}function UA(t,e){return t<=e}function GA(t,e){return t>=e}function ms(t,e){var r=[],i=Ig("{","}",t);if(!i)return[t];var s=i.pre,n=i.post.length?ms(i.post,!1):[""];if(/\$$/.test(i.pre))for(var a=0;a<n.length;a++){var o=s+"{"+i.body+"}"+n[a];r.push(o)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=c||l,d=i.body.indexOf(",")>=0;if(!u&&!d)return i.post.match(/,.*\}/)?(t=i.pre+"{"+i.body+Qc+i.post,ms(t)):[t];var g;if(u)g=i.body.split(/\.\./);else if(g=kg(i.body),g.length===1&&(g=ms(g[0],!1).map(jA),g.length===1))return n.map(function($){return i.pre+g[0]+$});var h;if(u){var p=Zc(g[0]),m=Zc(g[1]),y=Math.max(g[0].length,g[1].length),b=g.length==3?Math.abs(Zc(g[2])):1,w=UA,x=m<p;x&&(b*=-1,w=GA);var f=g.some(BA);h=[];for(var v=p;w(v,m);v+=b){var E;if(l)E=String.fromCharCode(v),E==="\\"&&(E="");else if(E=String(v),f){var _=y-E.length;if(_>0){var O=new Array(_+1).join("0");v<0?E="-"+O+E.slice(1):E=O+E}}h.push(E)}}else{h=[];for(var C=0;C<g.length;C++)h.push.apply(h,ms(g[C],!1))}for(var C=0;C<h.length;C++)for(var a=0;a<n.length;a++){var o=s+h[C]+n[a];(!e||u||o)&&r.push(o)}}return r}});var po=j((dN,fo)=>{function L0(t){return Array.isArray(t)?t:[t]}var hO=void 0,wl="",C0=" ",vl="\\",fO=/^\s+$/,pO=/(?:[^\\]|^)\\$/,dO=/^\\!/,mO=/^\\#/,gO=/\r?\n/g,yO=/^\.{0,2}\/|^\.{1,2}$/,bO=/\/$/,Ai="/",O0="node-ignore";typeof Symbol<"u"&&(O0=Symbol.for("node-ignore"));var $0=O0,Li=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),vO=/([0-z])-([0-z])/g,T0=()=>!1,wO=t=>t.replace(vO,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:wl),xO=t=>{let{length:e}=t;return t.slice(0,e-e%2)},EO=[[/^\uFEFF/,()=>wl],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?C0:wl)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+C0}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>vl],[/\\\\/g,()=>vl],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,s)=>e===vl?`\\[${r}${xO(i)}${s}`:s==="]"&&i.length%2===0?`[${wO(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],_O=/(^|\\\/)?\\\*$/,Ts="regex",uo="checkRegex",A0="_",SO={[Ts](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[uo](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},RO=t=>EO.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),ho=t=>typeof t=="string",CO=t=>t&&ho(t)&&!fO.test(t)&&!pO.test(t)&&t.indexOf("#")!==0,AO=t=>t.split(gO).filter(Boolean),xl=class{constructor(e,r,i,s,n,a){this.pattern=e,this.mark=r,this.negative=n,Li(this,"body",i),Li(this,"ignoreCase",s),Li(this,"regexPrefix",a)}get regex(){let e=A0+Ts;return this[e]?this[e]:this._make(Ts,e)}get checkRegex(){let e=A0+uo;return this[e]?this[e]:this._make(uo,e)}_make(e,r){let i=this.regexPrefix.replace(_O,SO[e]),s=this.ignoreCase?new RegExp(i,"i"):new RegExp(i);return Li(this,r,s)}},LO=({pattern:t,mark:e},r)=>{let i=!1,s=t;s.indexOf("!")===0&&(i=!0,s=s.substr(1)),s=s.replace(dO,"!").replace(mO,"#");let n=RO(s);return new xl(t,e,s,r,i,n)},El=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[$0]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(ho(e)&&(e={pattern:e}),CO(e.pattern)){let r=LO(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,L0(ho(e)?AO(e):e).forEach(this._add,this),this._added}test(e,r,i){let s=!1,n=!1,a;this._rules.forEach(c=>{let{negative:l}=c;n===l&&s!==n||l&&!s&&!n&&!r||!c[i].test(e)||(s=!l,n=l,a=l?hO:c)});let o={ignored:s,unignored:n};return a&&(o.rule=a),o}},OO=(t,e)=>{throw new e(t)},kt=(t,e,r)=>ho(t)?t?kt.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),P0=t=>yO.test(t);kt.isNotRelative=P0;kt.convert=t=>t;var _l=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){Li(this,$0,!0),this._rules=new El(r),this._strictPathCheck=!i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,i,s){let n=e&&kt.convert(e);return kt(n,e,this._strictPathCheck?OO:T0),this._t(n,r,i,s)}checkIgnore(e){if(!bO.test(e))return this.test(e);let r=e.split(Ai).filter(Boolean);if(r.pop(),r.length){let i=this._t(r.join(Ai)+Ai,this._testCache,!0,r);if(i.ignored)return i}return this._rules.test(e,!1,uo)}_t(e,r,i,s){if(e in r)return r[e];if(s||(s=e.split(Ai).filter(Boolean)),s.pop(),!s.length)return r[e]=this._rules.test(e,i,Ts);let n=this._t(s.join(Ai)+Ai,r,i,s);return r[e]=n.ignored?n:this._rules.test(e,i,Ts)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return L0(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},Sl=t=>new _l(t),$O=t=>kt(t&&kt.convert(t),t,T0),I0=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");kt.convert=t;let e=/^[a-z]:\//i;kt.isNotRelative=r=>e.test(r)||P0(r)};typeof process<"u"&&process.platform==="win32"&&I0();fo.exports=Sl;Sl.default=Sl;fo.exports.isPathValid=$O;Li(fo.exports,Symbol.for("setupWindows"),I0)});import*as Br from"fs/promises";import*as wy from"os";import*as ko from"path";var ky=20,jy=1,rr=1e6,Kl=1e6,By=-7,Uy=21,Gy=!1,Mi="[big.js] ",ir=Mi+"Invalid ",Ws=ir+"decimal places",zy=ir+"rounding mode",Yl=Mi+"Division by zero",ue={},bt=void 0,qy=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Xl(){function t(e){var r=this;if(!(r instanceof t))return e===bt&&arguments.length===0?Xl():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(ir+"value");e=e===0&&1/e<0?"-0":String(e)}Wy(r,e)}r.constructor=t}return t.prototype=ue,t.DP=ky,t.RM=jy,t.NE=By,t.PE=Uy,t.strict=Gy,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function Wy(t,e){var r,i,s;if(!qy.test(e))throw Error(ir+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(i=e.search(/e/i))>0?(r<0&&(r=i),r+=+e.slice(i+1),e=e.substring(0,i)):r<0&&(r=e.length),s=e.length,i=0;i<s&&e.charAt(i)=="0";)++i;if(i==s)t.c=[t.e=0];else{for(;s>0&&e.charAt(--s)=="0";);for(t.e=r-i-1,t.c=[],r=0;i<=s;)t.c[r++]=+e.charAt(i++)}return t}function sr(t,e,r,i){var s=t.c;if(r===bt&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(zy);if(e<1)i=r===3&&(i||!!s[0])||e===0&&(r===1&&s[0]>=5||r===2&&(s[0]>5||s[0]===5&&(i||s[1]!==bt))),s.length=1,i?(t.e=t.e-e+1,s[0]=1):s[0]=t.e=0;else if(e<s.length){if(i=r===1&&s[e]>=5||r===2&&(s[e]>5||s[e]===5&&(i||s[e+1]!==bt||s[e-1]&1))||r===3&&(i||!!s[0]),s.length=e,i){for(;++s[--e]>9;)if(s[e]=0,e===0){++t.e,s.unshift(1);break}}for(e=s.length;!s[--e];)s.pop()}return t}function nr(t,e,r){var i=t.e,s=t.c.join(""),n=s.length;if(e)s=s.charAt(0)+(n>1?"."+s.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)s="0"+s;s="0."+s}else if(i>0)if(++i>n)for(i-=n;i--;)s+="0";else i<n&&(s=s.slice(0,i)+"."+s.slice(i));else n>1&&(s=s.charAt(0)+"."+s.slice(1));return t.s<0&&r?"-"+s:s}ue.abs=function(){var t=new this.constructor(this);return t.s=1,t};ue.cmp=function(t){var e,r=this,i=r.c,s=(t=new r.constructor(t)).c,n=r.s,a=t.s,o=r.e,c=t.e;if(!i[0]||!s[0])return i[0]?n:s[0]?-a:0;if(n!=a)return n;if(e=n<0,o!=c)return o>c^e?1:-1;for(a=(o=i.length)<(c=s.length)?o:c,n=-1;++n<a;)if(i[n]!=s[n])return i[n]>s[n]^e?1:-1;return o==c?0:o>c^e?1:-1};ue.div=function(t){var e=this,r=e.constructor,i=e.c,s=(t=new r(t)).c,n=e.s==t.s?1:-1,a=r.DP;if(a!==~~a||a<0||a>rr)throw Error(Ws);if(!s[0])throw Error(Yl);if(!i[0])return t.s=n,t.c=[t.e=0],t;var o,c,l,u,d,g=s.slice(),h=o=s.length,p=i.length,m=i.slice(0,o),y=m.length,b=t,w=b.c=[],x=0,f=a+(b.e=e.e-t.e)+1;for(b.s=n,n=f<0?0:f,g.unshift(0);y++<o;)m.push(0);do{for(l=0;l<10;l++){if(o!=(y=m.length))u=o>y?1:-1;else for(d=-1,u=0;++d<o;)if(s[d]!=m[d]){u=s[d]>m[d]?1:-1;break}if(u<0){for(c=y==o?s:g;y;){if(m[--y]<c[y]){for(d=y;d&&!m[--d];)m[d]=9;--m[d],m[y]+=10}m[y]-=c[y]}for(;!m[0];)m.shift()}else break}w[x++]=u?l:++l,m[0]&&u?m[y]=i[h]||0:m=[i[h]]}while((h++<p||m[0]!==bt)&&n--);return!w[0]&&x!=1&&(w.shift(),b.e--,f--),x>f&&sr(b,f,r.RM,m[0]!==bt),b};ue.eq=function(t){return this.cmp(t)===0};ue.gt=function(t){return this.cmp(t)>0};ue.gte=function(t){return this.cmp(t)>-1};ue.lt=function(t){return this.cmp(t)<0};ue.lte=function(t){return this.cmp(t)<1};ue.minus=ue.sub=function(t){var e,r,i,s,n=this,a=n.constructor,o=n.s,c=(t=new a(t)).s;if(o!=c)return t.s=-c,n.plus(t);var l=n.c.slice(),u=n.e,d=t.c,g=t.e;if(!l[0]||!d[0])return d[0]?t.s=-c:l[0]?t=new a(n):t.s=1,t;if(o=u-g){for((s=o<0)?(o=-o,i=l):(g=u,i=d),i.reverse(),c=o;c--;)i.push(0);i.reverse()}else for(r=((s=l.length<d.length)?l:d).length,o=c=0;c<r;c++)if(l[c]!=d[c]){s=l[c]<d[c];break}if(s&&(i=l,l=d,d=i,t.s=-t.s),(c=(r=d.length)-(e=l.length))>0)for(;c--;)l[e++]=0;for(c=e;r>o;){if(l[--r]<d[r]){for(e=r;e&&!l[--e];)l[e]=9;--l[e],l[r]+=10}l[r]-=d[r]}for(;l[--c]===0;)l.pop();for(;l[0]===0;)l.shift(),--g;return l[0]||(t.s=1,l=[g=0]),t.c=l,t.e=g,t};ue.mod=function(t){var e,r=this,i=r.constructor,s=r.s,n=(t=new i(t)).s;if(!t.c[0])throw Error(Yl);return r.s=t.s=1,e=t.cmp(r)==1,r.s=s,t.s=n,e?new i(r):(s=i.DP,n=i.RM,i.DP=i.RM=0,r=r.div(t),i.DP=s,i.RM=n,this.minus(r.times(t)))};ue.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};ue.plus=ue.add=function(t){var e,r,i,s=this,n=s.constructor;if(t=new n(t),s.s!=t.s)return t.s=-t.s,s.minus(t);var a=s.e,o=s.c,c=t.e,l=t.c;if(!o[0]||!l[0])return l[0]||(o[0]?t=new n(s):t.s=s.s),t;if(o=o.slice(),e=a-c){for(e>0?(c=a,i=l):(e=-e,i=o),i.reverse();e--;)i.push(0);i.reverse()}for(o.length-l.length<0&&(i=l,l=o,o=i),e=l.length,r=0;e;o[e]%=10)r=(o[--e]=o[e]+l[e]+r)/10|0;for(r&&(o.unshift(r),++c),e=o.length;o[--e]===0;)o.pop();return t.c=o,t.e=c,t};ue.pow=function(t){var e=this,r=new e.constructor("1"),i=r,s=t<0;if(t!==~~t||t<-Kl||t>Kl)throw Error(ir+"exponent");for(s&&(t=-t);t&1&&(i=i.times(e)),t>>=1,!!t;)e=e.times(e);return s?r.div(i):i};ue.prec=function(t,e){if(t!==~~t||t<1||t>rr)throw Error(ir+"precision");return sr(new this.constructor(this),t,e)};ue.round=function(t,e){if(t===bt)t=0;else if(t!==~~t||t<-rr||t>rr)throw Error(Ws);return sr(new this.constructor(this),t+this.e+1,e)};ue.sqrt=function(){var t,e,r,i=this,s=i.constructor,n=i.s,a=i.e,o=new s("0.5");if(!i.c[0])return new s(i);if(n<0)throw Error(Mi+"No square root");n=Math.sqrt(+nr(i,!0,!0)),n===0||n===1/0?(e=i.c.join(""),e.length+a&1||(e+="0"),n=Math.sqrt(e),a=((a+1)/2|0)-(a<0||a&1),t=new s((n==1/0?"5e":(n=n.toExponential()).slice(0,n.indexOf("e")+1))+a)):t=new s(n+""),a=t.e+(s.DP+=4);do r=t,t=o.times(r.plus(i.div(r)));while(r.c.slice(0,a).join("")!==t.c.slice(0,a).join(""));return sr(t,(s.DP-=4)+t.e+1,s.RM)};ue.times=ue.mul=function(t){var e,r=this,i=r.constructor,s=r.c,n=(t=new i(t)).c,a=s.length,o=n.length,c=r.e,l=t.e;if(t.s=r.s==t.s?1:-1,!s[0]||!n[0])return t.c=[t.e=0],t;for(t.e=c+l,a<o&&(e=s,s=n,n=e,l=a,a=o,o=l),e=new Array(l=a+o);l--;)e[l]=0;for(c=o;c--;){for(o=0,l=a+c;l>c;)o=e[l]+n[c]*s[l-c-1]+o,e[l--]=o%10,o=o/10|0;e[l]=o}for(o?++t.e:e.shift(),c=e.length;!e[--c];)e.pop();return t.c=e,t};ue.toExponential=function(t,e){var r=this,i=r.c[0];if(t!==bt){if(t!==~~t||t<0||t>rr)throw Error(Ws);for(r=sr(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return nr(r,!0,!!i)};ue.toFixed=function(t,e){var r=this,i=r.c[0];if(t!==bt){if(t!==~~t||t<0||t>rr)throw Error(Ws);for(r=sr(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return nr(r,!1,!!i)};ue.toJSON=ue.toString=function(){var t=this,e=t.constructor;return nr(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};typeof Symbol<"u"&&(ue[Symbol.for("nodejs.util.inspect.custom")]=ue.toJSON);ue.toNumber=function(){var t=+nr(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(Mi+"Imprecise conversion");return t};ue.toPrecision=function(t,e){var r=this,i=r.constructor,s=r.c[0];if(t!==bt){if(t!==~~t||t<1||t>rr)throw Error(ir+"precision");for(r=sr(new i(r),t,e);r.c.length<t;)r.c.push(0)}return nr(r,t<=r.e||r.e<=i.NE||r.e>=i.PE,!!s)};ue.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(Mi+"valueOf disallowed");return nr(t,t.e<=e.NE||t.e>=e.PE,!0)};var Vy=Xl(),Ke=Vy;var Jl=(t=0)=>e=>`\x1B[${e+t}m`,Zl=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ql=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,me={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},j$=Object.keys(me.modifier),Hy=Object.keys(me.color),Ky=Object.keys(me.bgColor),B$=[...Hy,...Ky];function Yy(){let t=new Map;for(let[e,r]of Object.entries(me)){for(let[i,s]of Object.entries(r))me[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=me[i],t.set(s[0],s[1]);Object.defineProperty(me,e,{value:r,enumerable:!1})}return Object.defineProperty(me,"codes",{value:t,enumerable:!1}),me.color.close="\x1B[39m",me.bgColor.close="\x1B[49m",me.color.ansi=Jl(),me.color.ansi256=Zl(),me.color.ansi16m=Ql(),me.bgColor.ansi=Jl(10),me.bgColor.ansi256=Zl(10),me.bgColor.ansi16m=Ql(10),Object.defineProperties(me,{rgbToAnsi256:{value(e,r,i){return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(n=>n+n).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>me.rgbToAnsi256(...me.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,i,s;if(e>=232)r=((e-232)*10+8)/255,i=r,s=r;else{e-=16;let o=e%36;r=Math.floor(e/36)/5,i=Math.floor(o/6)/5,s=o%6/5}let n=Math.max(r,i,s)*2;if(n===0)return 30;let a=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return n===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,r,i)=>me.ansi256ToAnsi(me.rgbToAnsi256(e,r,i)),enumerable:!1},hexToAnsi:{value:e=>me.ansi256ToAnsi(me.hexToAnsi256(e)),enumerable:!1}}),me}var Xy=Yy(),ht=Xy;import Bo from"node:process";import Jy from"node:os";import eu from"node:tty";function Je(t,e=globalThis.Deno?globalThis.Deno.args:Bo.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)}var{env:ge}=Bo,Vs;Je("no-color")||Je("no-colors")||Je("color=false")||Je("color=never")?Vs=0:(Je("color")||Je("colors")||Je("color=true")||Je("color=always"))&&(Vs=1);function Zy(){if("FORCE_COLOR"in ge)return ge.FORCE_COLOR==="true"?1:ge.FORCE_COLOR==="false"?0:ge.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ge.FORCE_COLOR,10),3)}function Qy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function eb(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let i=Zy();i!==void 0&&(Vs=i);let s=r?Vs:i;if(s===0)return 0;if(r){if(Je("color=16m")||Je("color=full")||Je("color=truecolor"))return 3;if(Je("color=256"))return 2}if("TF_BUILD"in ge&&"AGENT_NAME"in ge)return 1;if(t&&!e&&s===void 0)return 0;let n=s||0;if(ge.TERM==="dumb")return n;if(Bo.platform==="win32"){let a=Jy.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in ge)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in ge)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in ge)||ge.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in ge)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ge.TEAMCITY_VERSION)?1:0;if(ge.COLORTERM==="truecolor"||ge.TERM==="xterm-kitty"||ge.TERM==="xterm-ghostty"||ge.TERM==="wezterm")return 3;if("TERM_PROGRAM"in ge){let a=Number.parseInt((ge.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ge.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ge.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ge.TERM)||"COLORTERM"in ge?1:n}function tu(t,e={}){let r=eb(t,{streamIsTTY:t&&t.isTTY,...e});return Qy(r)}var tb={stdout:tu({isTTY:eu.isatty(1)}),stderr:tu({isTTY:eu.isatty(2)})},ru=tb;function iu(t,e,r){let i=t.indexOf(e);if(i===-1)return t;let s=e.length,n=0,a="";do a+=t.slice(n,i)+e+r,n=i+s,i=t.indexOf(e,n);while(i!==-1);return a+=t.slice(n),a}function su(t,e,r,i){let s=0,n="";do{let a=t[i-1]==="\r";n+=t.slice(s,a?i-1:i)+e+(a?`\r
|
|
16
16
|
`:`
|
|
17
17
|
`)+r,s=i+1,i=t.indexOf(`
|
|
18
|
-
`,s)}while(i!==-1);return n+=t.slice(s),n}var{stdout:nu,stderr:ou}=ru,Uo=Symbol("GENERATOR"),
|
|
19
|
-
`);return n!==-1&&(e=su(e,s,i,n)),i+e+s};Object.defineProperties(ji.prototype,zr);var ab=ji(),X$=ji({level:ou?ou.level:0});var S=ab;var xy=We(hu(),1);import Ba from"node:process";import gf,{format as _b}from"util";import{resolve as Sb,normalize as Rb}from"path";import{readFileSync as Cb}from"fs";import yf,{createRequire as pu}from"node:module";import Gt from"node:path";import Ab from"node:process";import Lb,{fileURLToPath as bf}from"node:url";import vf from"node:fs";import Da from"url";function qi(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",i=!1,s=t.match(/^-+/);for(let n=s?s[0].length:0;n<t.length;n++){let a=t.charAt(n);i&&(i=!1,a=a.toUpperCase()),n!==0&&(a==="-"||a==="_")?i=!0:a!=="-"&&a!=="_"&&(r+=a)}return r}}function wf(t,e){let r=t.toLowerCase();e=e||"-";let i="";for(let s=0;s<t.length;s++){let n=r.charAt(s),a=t.charAt(s);n!==a&&s>0?i+=`${e}${r.charAt(s)}`:i+=a}return i}function xf(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Ob(t){if(Array.isArray(t))return t.map(a=>typeof a!="string"?a+"":a);t=t.trim();let e=0,r=null,i=null,s=null,n=[];for(let a=0;a<t.length;a++){if(r=i,i=t.charAt(a),i===" "&&!s){r!==" "&&e++;continue}i===s?s=null:(i==="'"||i==='"')&&!s&&(s=i),n[e]||(n[e]=""),n[e]+=i}return n}var ht;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(ht||(ht={}));var Lt,Pa=class{constructor(e){Lt=e}parse(e,r){let i=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),s=Ob(e),n=typeof e=="string",a=$b(Object.assign(Object.create(null),i.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},i.configuration),c=Object.assign(Object.create(null),i.default),l=i.configObjects||[],u=i.envPrefix,d=o["populate--"],b=d?"--":"_",f=Object.create(null),p=Object.create(null),m=i.__||Lt.format,y={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,w=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(R){let $=typeof R=="object"?R.key:R,k=Object.keys(R).map(function(T){return{boolean:"bools",string:"strings",number:"numbers"}[T]}).filter(Boolean).pop();k&&(y[k][$]=!0),y.arrays[$]=!0,y.keys.push($)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(R){y.bools[R]=!0,y.keys.push(R)}),[].concat(i.string||[]).filter(Boolean).forEach(function(R){y.strings[R]=!0,y.keys.push(R)}),[].concat(i.number||[]).filter(Boolean).forEach(function(R){y.numbers[R]=!0,y.keys.push(R)}),[].concat(i.count||[]).filter(Boolean).forEach(function(R){y.counts[R]=!0,y.keys.push(R)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(R){y.normalize[R]=!0,y.keys.push(R)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([R,$])=>{typeof $=="number"&&(y.nargs[R]=$,y.keys.push(R))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([R,$])=>{typeof $=="function"&&(y.coercions[R]=$,y.keys.push(R))}),typeof i.config<"u"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(R){y.configs[R]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([R,$])=>{(typeof $=="boolean"||typeof $=="function")&&(y.configs[R]=$)})),Ur(i.key,a,i.default,y.arrays),Object.keys(c).forEach(function(R){(y.aliases[R]||[]).forEach(function($){c[$]=c[R]})});let E=null;$y();let h=[],v=Object.assign(Object.create(null),{_:[]}),x={};for(let R=0;R<s.length;R++){let $=s[R],k=$.replace(/^-{3,}/,"---"),T,L,H,q,J,Se;if($!=="--"&&/^-/.test($)&&qs($))_($);else if(k.match(/^---+(=|$)/)){_($);continue}else if($.match(/^--.+=/)||!o["short-option-groups"]&&$.match(/^-.+=/))q=$.match(/^--?([^=]+)=([\s\S]*)$/),q!==null&&Array.isArray(q)&&q.length>=3&&(re(q[1],y.arrays)?R=C(R,q[1],s,q[2]):re(q[1],y.nargs)!==!1?R=A(R,q[1],s,q[2]):O(q[1],q[2],!0));else if($.match(w)&&o["boolean-negation"])q=$.match(w),q!==null&&Array.isArray(q)&&q.length>=2&&(L=q[1],O(L,re(L,y.arrays)?[!1]:!1));else if($.match(/^--.+/)||!o["short-option-groups"]&&$.match(/^-[^-]+/))q=$.match(/^--?(.+)/),q!==null&&Array.isArray(q)&&q.length>=2&&(L=q[1],re(L,y.arrays)?R=C(R,L,s):re(L,y.nargs)!==!1?R=A(R,L,s):(J=s[R+1],J!==void 0&&(!J.match(/^-/)||J.match(g))&&!re(L,y.bools)&&!re(L,y.counts)||/^(true|false)$/.test(J)?(O(L,J),R++):O(L,Gr(L))));else if($.match(/^-.\..+=/))q=$.match(/^-([^=]+)=([\s\S]*)$/),q!==null&&Array.isArray(q)&&q.length>=3&&O(q[1],q[2]);else if($.match(/^-.\..+/)&&!$.match(g))J=s[R+1],q=$.match(/^-(.\..+)/),q!==null&&Array.isArray(q)&&q.length>=2&&(L=q[1],J!==void 0&&!J.match(/^-/)&&!re(L,y.bools)&&!re(L,y.counts)?(O(L,J),R++):O(L,Gr(L)));else if($.match(/^-[^-]+/)&&!$.match(g)){H=$.slice(1,-1).split(""),T=!1;for(let Be=0;Be<H.length;Be++){if(J=$.slice(Be+2),H[Be+1]&&H[Be+1]==="="){Se=$.slice(Be+3),L=H[Be],re(L,y.arrays)?R=C(R,L,s,Se):re(L,y.nargs)!==!1?R=A(R,L,s,Se):O(L,Se),T=!0;break}if(J==="-"){O(H[Be],J);continue}if(/[A-Za-z]/.test(H[Be])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(J)&&re(J,y.bools)===!1){O(H[Be],J),T=!0;break}if(H[Be+1]&&H[Be+1].match(/\W/)){O(H[Be],J),T=!0;break}else O(H[Be],Gr(H[Be]))}L=$.slice(-1)[0],!T&&L!=="-"&&(re(L,y.arrays)?R=C(R,L,s):re(L,y.nargs)!==!1?R=A(R,L,s):(J=s[R+1],J!==void 0&&(!/^(-|--)[^-]/.test(J)||J.match(g))&&!re(L,y.bools)&&!re(L,y.counts)||/^(true|false)$/.test(J)?(O(L,J),R++):O(L,Gr(L))))}else if($.match(/^-[0-9]$/)&&$.match(g)&&re($.slice(1),y.bools))L=$.slice(1),O(L,Gr(L));else if($==="--"){h=s.slice(R+1);break}else if(o["halt-at-non-option"]){h=s.slice(R);break}else _($)}V(v,!0),V(v,!1),Y(v),G(),we(v,y.aliases,c,!0),se(v),o["set-placeholder-key"]&&ee(v),Object.keys(y.counts).forEach(function(R){xe(v,R.split("."))||O(R,0)}),d&&h.length&&(v[b]=[]),h.forEach(function(R){v[b].push(R)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(v).filter(R=>R!=="--"&&R.includes("-")).forEach(R=>{delete v[R]}),o["strip-aliased"]&&[].concat(...Object.keys(a).map(R=>a[R])).forEach(R=>{o["camel-case-expansion"]&&R.includes("-")&&delete v[R.split(".").map($=>qi($)).join(".")],delete v[R]});function _(R){let $=I("_",R);(typeof $=="string"||typeof $=="number")&&v._.push($)}function A(R,$,k,T){let L,H=re($,y.nargs);if(H=typeof H!="number"||isNaN(H)?1:H,H===0)return Ct(T)||(E=Error(m("Argument unexpected for: %s",$))),O($,Gr($)),R;let q=Ct(T)?0:1;if(o["nargs-eats-options"])k.length-(R+1)+q<H&&(E=Error(m("Not enough arguments following: %s",$))),q=H;else{for(L=R+1;L<k.length&&(!k[L].match(/^-[^0-9]/)||k[L].match(g)||qs(k[L]));L++)q++;q<H&&(E=Error(m("Not enough arguments following: %s",$)))}let J=Math.min(q,H);for(!Ct(T)&&J>0&&(O($,T),J--),L=R+1;L<J+R+1;L++)O($,k[L]);return R+J}function C(R,$,k,T){let L=[],H=T||k[R+1],q=re($,y.nargs);if(re($,y.bools)&&!/^(true|false)$/.test(H))L.push(!0);else if(Ct(H)||Ct(T)&&/^-/.test(H)&&!g.test(H)&&!qs(H)){if(c[$]!==void 0){let J=c[$];L=Array.isArray(J)?J:[J]}}else{Ct(T)||L.push(M($,T,!0));for(let J=R+1;J<k.length&&!(!o["greedy-arrays"]&&L.length>0||q&&typeof q=="number"&&L.length>=q||(H=k[J],/^-/.test(H)&&!g.test(H)&&!qs(H)));J++)R=J,L.push(M($,H,n))}return typeof q=="number"&&(q&&L.length<q||isNaN(q)&&L.length===0)&&(E=Error(m("Not enough arguments following: %s",$))),O($,L),R}function O(R,$,k=n){if(/-/.test(R)&&o["camel-case-expansion"]){let H=R.split(".").map(function(q){return qi(q)}).join(".");F(R,H)}let T=M(R,$,k),L=R.split(".");Oe(v,L,T),y.aliases[R]&&y.aliases[R].forEach(function(H){let q=H.split(".");Oe(v,q,T)}),L.length>1&&o["dot-notation"]&&(y.aliases[L[0]]||[]).forEach(function(H){let q=H.split("."),J=[].concat(L);J.shift(),q=q.concat(J),(y.aliases[R]||[]).includes(q.join("."))||Oe(v,q,T)}),re(R,y.normalize)&&!re(R,y.arrays)&&[R].concat(y.aliases[R]||[]).forEach(function(q){Object.defineProperty(x,q,{enumerable:!0,get(){return $},set(J){$=typeof J=="string"?Lt.normalize(J):J}})})}function F(R,$){y.aliases[R]&&y.aliases[R].length||(y.aliases[R]=[$],f[$]=!0),y.aliases[$]&&y.aliases[$].length||F($,R)}function M(R,$,k){k&&($=Tb($)),(re(R,y.bools)||re(R,y.counts))&&typeof $=="string"&&($=$==="true");let T=Array.isArray($)?$.map(function(L){return I(R,L)}):I(R,$);return re(R,y.counts)&&(Ct(T)||typeof T=="boolean")&&(T=Ho()),re(R,y.normalize)&&re(R,y.arrays)&&(Array.isArray($)?T=$.map(L=>Lt.normalize(L)):T=Lt.normalize($)),T}function I(R,$){return!o["parse-positional-numbers"]&&R==="_"||!re(R,y.strings)&&!re(R,y.bools)&&!Array.isArray($)&&(xf($)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${$}`)))||!Ct($)&&re(R,y.numbers))&&($=Number($)),$}function Y(R){let $=Object.create(null);we($,y.aliases,c),Object.keys(y.configs).forEach(function(k){let T=R[k]||$[k];if(T)try{let L=null,H=Lt.resolve(Lt.cwd(),T),q=y.configs[k];if(typeof q=="function"){try{L=q(H)}catch(J){L=J}if(L instanceof Error){E=L;return}}else L=Lt.require(H);Z(L)}catch(L){L.name==="PermissionDenied"?E=L:R[k]&&(E=Error(m("Invalid JSON config file: %s",T)))}})}function Z(R,$){Object.keys(R).forEach(function(k){let T=R[k],L=$?$+"."+k:k;typeof T=="object"&&T!==null&&!Array.isArray(T)&&o["dot-notation"]?Z(T,L):(!xe(v,L.split("."))||re(L,y.arrays)&&o["combine-arrays"])&&O(L,T)})}function G(){typeof l<"u"&&l.forEach(function(R){Z(R)})}function V(R,$){if(typeof u>"u")return;let k=typeof u=="string"?u:"",T=Lt.env();Object.keys(T).forEach(function(L){if(k===""||L.lastIndexOf(k,0)===0){let H=L.split("__").map(function(q,J){return J===0&&(q=q.substring(k.length)),qi(q)});($&&y.configs[H.join(".")]||!$)&&!xe(R,H)&&O(H.join("."),T[L])}})}function se(R){let $,k=new Set;Object.keys(R).forEach(function(T){if(!k.has(T)&&($=re(T,y.coercions),typeof $=="function"))try{let L=I(T,$(R[T]));[].concat(y.aliases[T]||[],T).forEach(H=>{k.add(H),R[H]=L})}catch(L){E=L}})}function ee(R){return y.keys.forEach($=>{~$.indexOf(".")||typeof R[$]>"u"&&(R[$]=void 0)}),R}function we(R,$,k,T=!1){Object.keys(k).forEach(function(L){xe(R,L.split("."))||(Oe(R,L.split("."),k[L]),T&&(p[L]=!0),($[L]||[]).forEach(function(H){xe(R,H.split("."))||Oe(R,H.split("."),k[L])}))})}function xe(R,$){let k=R;o["dot-notation"]||($=[$.join(".")]),$.slice(0,-1).forEach(function(L){k=k[L]||{}});let T=$[$.length-1];return typeof k!="object"?!1:T in k}function Oe(R,$,k){let T=R;o["dot-notation"]||($=[$.join(".")]),$.slice(0,-1).forEach(function(Se){Se=du(Se),typeof T=="object"&&T[Se]===void 0&&(T[Se]={}),typeof T[Se]!="object"||Array.isArray(T[Se])?(Array.isArray(T[Se])?T[Se].push({}):T[Se]=[T[Se],{}],T=T[Se][T[Se].length-1]):T=T[Se]});let L=du($[$.length-1]),H=re($.join("."),y.arrays),q=Array.isArray(k),J=o["duplicate-arguments-array"];!J&&re(L,y.nargs)&&(J=!0,(!Ct(T[L])&&y.nargs[L]===1||Array.isArray(T[L])&&T[L].length===y.nargs[L])&&(T[L]=void 0)),k===Ho()?T[L]=Ho(T[L]):Array.isArray(T[L])?J&&H&&q?T[L]=o["flatten-duplicate-arrays"]?T[L].concat(k):(Array.isArray(T[L][0])?T[L]:[T[L]]).concat([k]):!J&&!!H==!!q?T[L]=k:T[L]=T[L].concat([k]):T[L]===void 0&&H?T[L]=q?k:[k]:J&&!(T[L]===void 0||re(L,y.counts)||re(L,y.bools))?T[L]=[T[L],k]:T[L]=k}function Ur(...R){R.forEach(function($){Object.keys($||{}).forEach(function(k){y.aliases[k]||(y.aliases[k]=[].concat(a[k]||[]),y.aliases[k].concat(k).forEach(function(T){if(/-/.test(T)&&o["camel-case-expansion"]){let L=qi(T);L!==k&&y.aliases[k].indexOf(L)===-1&&(y.aliases[k].push(L),f[L]=!0)}}),y.aliases[k].concat(k).forEach(function(T){if(T.length>1&&/[A-Z]/.test(T)&&o["camel-case-expansion"]){let L=wf(T,"-");L!==k&&y.aliases[k].indexOf(L)===-1&&(y.aliases[k].push(L),f[L]=!0)}}),y.aliases[k].forEach(function(T){y.aliases[T]=[k].concat(y.aliases[k].filter(function(L){return T!==L}))}))})})}function re(R,$){let k=[].concat(y.aliases[R]||[],R),T=Object.keys($),L=k.find(H=>T.includes(H));return L?$[L]:!1}function Gs(R){let $=Object.keys(y);return[].concat($.map(T=>y[T])).some(function(T){return Array.isArray(T)?T.includes(R):T[R]})}function Ry(R,...$){return[].concat(...$).some(function(T){let L=R.match(T);return L&&Gs(L[1])})}function Cy(R){if(R.match(g)||!R.match(/^-[^-]+/))return!1;let $=!0,k,T=R.slice(1).split("");for(let L=0;L<T.length;L++){if(k=R.slice(L+2),!Gs(T[L])){$=!1;break}if(T[L+1]&&T[L+1]==="="||k==="-"||/[A-Za-z]/.test(T[L])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(k)||T[L+1]&&T[L+1].match(/\W/))break}return $}function qs(R){return o["unknown-options-as-args"]&&Ay(R)}function Ay(R){return R=R.replace(/^-{3,}/,"--"),R.match(g)||Cy(R)?!1:!Ry(R,/^-+([^=]+?)=[\s\S]*$/,w,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function Gr(R){return!re(R,y.bools)&&!re(R,y.counts)&&`${R}`in c?c[R]:Ly(Oy(R))}function Ly(R){return{[ht.BOOLEAN]:!0,[ht.STRING]:"",[ht.NUMBER]:void 0,[ht.ARRAY]:[]}[R]}function Oy(R){let $=ht.BOOLEAN;return re(R,y.strings)?$=ht.STRING:re(R,y.numbers)?$=ht.NUMBER:re(R,y.bools)?$=ht.BOOLEAN:re(R,y.arrays)&&($=ht.ARRAY),$}function Ct(R){return R===void 0}function $y(){Object.keys(y.counts).find(R=>re(R,y.arrays)?(E=Error(m("Invalid configuration: %s, opts.count excludes opts.array.",R)),!0):re(R,y.nargs)?(E=Error(m("Invalid configuration: %s, opts.count excludes opts.narg.",R)),!0):!1)}return{aliases:Object.assign({},y.aliases),argv:Object.assign(x,v),configuration:o,defaulted:Object.assign({},p),error:E,newAliases:Object.assign({},f)}}};function $b(t){let e=[],r=Object.create(null),i=!0;for(Object.keys(t).forEach(function(s){e.push([].concat(t[s],s))});i;){i=!1;for(let s=0;s<e.length;s++)for(let n=s+1;n<e.length;n++)if(e[s].filter(function(o){return e[n].indexOf(o)!==-1}).length){e[s]=e[s].concat(e[n]),e.splice(n,1),i=!0;break}}return e.forEach(function(s){s=s.filter(function(a,o,c){return c.indexOf(a)===o});let n=s.pop();n!==void 0&&typeof n=="string"&&(r[n]=s)}),r}function Ho(t){return t!==void 0?t+1:1}function du(t){return t==="__proto__"?"___proto___":t}function Tb(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var Ko,Yo,Xo,mu=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,gu=(Yo=(Ko=process==null?void 0:process.versions)===null||Ko===void 0?void 0:Ko.node)!==null&&Yo!==void 0?Yo:(Xo=process==null?void 0:process.version)===null||Xo===void 0?void 0:Xo.slice(1);if(gu&&Number(gu.match(/^([^.]+)/)[1])<mu)throw Error(`yargs parser supports a minimum Node.js version of ${mu}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Pb=process?process.env:{},yu=pu?pu(import.meta.url):void 0,Ef=new Pa({cwd:process.cwd,env:()=>Pb,format:_b,normalize:Rb,resolve:Sb,require:t=>{if(typeof yu<"u")return yu(t);if(t.match(/\.json$/))return JSON.parse(Cb(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),Yr=function(e,r){return Ef.parse(e.slice(),r).argv};Yr.detailed=function(t,e){return Ef.parse(t.slice(),e)};Yr.camelCase=qi;Yr.decamelize=wf;Yr.looksLikeNumber=xf;var _f=t=>typeof t=="object"&&t!==null,bu=t=>_f(t)&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date)&&!(globalThis.Blob&&t instanceof globalThis.Blob),Ib=Symbol("mapObjectSkip"),Ia=(t,e,r,i=new WeakMap)=>{if(r={deep:!1,target:{},...r},i.has(t))return i.get(t);i.set(t,r.target);let{target:s}=r;delete r.target;let n=a=>a.map(o=>bu(o)?Ia(o,e,r,i):o);if(Array.isArray(t))return n(t);for(let[a,o]of Object.entries(t)){let c=e(a,o,t);if(c===Ib)continue;let[l,u,{shouldRecurse:d=!0}={}]=c;l!=="__proto__"&&(r.deep&&d&&bu(u)&&(u=Array.isArray(u)?n(u):Ia(u,e,r,i)),s[l]=u)}return s};function Fb(t,e,r){if(!_f(t))throw new TypeError(`Expected an object, got \`${t}\` (${typeof t})`);if(Array.isArray(t))throw new TypeError("Expected an object, got an array");return Ia(t,e,r)}var Nb=/[\p{Lu}]/u,Db=/[\p{Ll}]/u,vu=/^[\p{Lu}](?![\p{Lu}])/gu,Sf=/([\p{Alpha}\p{N}_]|$)/u,Ma=/[_.\- ]+/,Mb=new RegExp("^"+Ma.source),wu=new RegExp(Ma.source+Sf.source,"gu"),xu=new RegExp("\\d+"+Sf.source,"gu"),kb=(t,e,r,i)=>{let s=!1,n=!1,a=!1,o=!1;for(let c=0;c<t.length;c++){let l=t[c];o=c>2?t[c-3]==="-":!0,s&&Nb.test(l)?(t=t.slice(0,c)+"-"+t.slice(c),s=!1,a=n,n=!0,c++):n&&a&&Db.test(l)&&(!o||i)?(t=t.slice(0,c-1)+"-"+t.slice(c-1),a=n,n=!1,s=!0):(s=e(l)===l&&r(l)!==l,a=n,n=r(l)===l&&e(l)!==l)}return t},jb=(t,e)=>(vu.lastIndex=0,t.replaceAll(vu,r=>e(r))),Bb=(t,e)=>(wu.lastIndex=0,xu.lastIndex=0,t.replaceAll(xu,(r,i,s)=>["_","-"].includes(t.charAt(s+r.length))?r:e(r)).replaceAll(wu,(r,i)=>e(i)));function Ub(t,e){if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(t)?t=t.map(n=>n.trim()).filter(n=>n.length).join("-"):t=t.trim(),t.length===0)return"";let r=e.locale===!1?n=>n.toLowerCase():n=>n.toLocaleLowerCase(e.locale),i=e.locale===!1?n=>n.toUpperCase():n=>n.toLocaleUpperCase(e.locale);return t.length===1?Ma.test(t)?"":e.pascalCase?i(t):r(t):(t!==r(t)&&(t=kb(t,r,i,e.preserveConsecutiveUppercase)),t=t.replace(Mb,""),t=e.preserveConsecutiveUppercase?jb(t,r):r(t),e.pascalCase&&(t=i(t.charAt(0))+t.slice(1)),Bb(t,i))}var Gb=class extends Map{#t=0;#r=new Map;#e=new Map;#n;#f;#w;constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.#n=e.maxSize,this.#f=e.maxAge||Number.POSITIVE_INFINITY,this.#w=e.onEviction}get __oldCache(){return this.#e}#a(e){if(typeof this.#w=="function")for(let[r,i]of e)this.#w(r,i.value)}#u(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.#w=="function"&&this.#w(e,r.value),this.delete(e)):!1}#s(e,r){if(this.#u(e,r)===!1)return r.value}#c(e,r){return r.expiry?this.#s(e,r):r.value}#i(e,r){let i=r.get(e);return this.#c(e,i)}#l(e,r){this.#r.set(e,r),this.#t++,this.#t>=this.#n&&(this.#t=0,this.#a(this.#e),this.#e=this.#r,this.#r=new Map)}#o(e,r){this.#e.delete(e),this.#l(e,r)}*#d(){for(let e of this.#e){let[r,i]=e;this.#r.has(r)||this.#u(r,i)===!1&&(yield e)}for(let e of this.#r){let[r,i]=e;this.#u(r,i)===!1&&(yield e)}}get(e){if(this.#r.has(e)){let r=this.#r.get(e);return this.#c(e,r)}if(this.#e.has(e)){let r=this.#e.get(e);if(this.#u(e,r)===!1)return this.#o(e,r),r.value}}set(e,r,{maxAge:i=this.#f}={}){let s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.#r.has(e)?this.#r.set(e,{value:r,expiry:s}):this.#l(e,{value:r,expiry:s}),this}has(e){return this.#r.has(e)?!this.#u(e,this.#r.get(e)):this.#e.has(e)?!this.#u(e,this.#e.get(e)):!1}peek(e){if(this.#r.has(e))return this.#i(e,this.#r);if(this.#e.has(e))return this.#i(e,this.#e)}expiresIn(e){let r=this.#r.get(e)??this.#e.get(e);if(r)return r.expiry?r.expiry-Date.now():Number.POSITIVE_INFINITY}delete(e){let r=this.#r.delete(e);return r&&this.#t--,this.#e.delete(e)||r}clear(){this.#r.clear(),this.#e.clear(),this.#t=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this.#d()],i=r.length-e;i<0?(this.#r=new Map(r),this.#e=new Map,this.#t=r.length):(i>0&&this.#a(r.slice(0,i)),this.#e=new Map(r.slice(i)),this.#r=new Map,this.#t=0),this.#n=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.#r){let[r,i]=e;this.#u(r,i)===!1&&(yield[r,i.value])}for(let e of this.#e){let[r,i]=e;this.#r.has(r)||this.#u(r,i)===!1&&(yield[r,i.value])}}*entriesDescending(){let e=[...this.#r];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this.#u(s,n)===!1&&(yield[s,n.value])}e=[...this.#e];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this.#r.has(s)||this.#u(s,n)===!1&&(yield[s,n.value])}}*entriesAscending(){for(let[e,r]of this.#d())yield[e,r.value]}get size(){if(!this.#t)return this.#e.size;let e=0;for(let r of this.#e.keys())this.#r.has(r)||e++;return Math.min(this.#t+e,this.#n)}get maxSize(){return this.#n}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[i,s]of this.entriesAscending())e.call(r,s,i,this)}get[Symbol.toStringTag](){return"QuickLRU"}toString(){return`QuickLRU(${this.size}/${this.maxSize})`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},qb=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),Jo=new Gb({maxSize:1e5}),Hr=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),Kr=(t,e={},r=new WeakMap,i)=>{if(!Hr(t))return t;if(r.has(t))return r.get(t);let{exclude:s,pascalCase:n=!1,stopPaths:a,deep:o=!1,preserveConsecutiveUppercase:c=!1}=e,l=new Set(a);if(Array.isArray(t)){let p=[];r.set(t,p);for(let m of t)p.push(Hr(m)?Kr(m,e,r,i):m);return p}let u={};r.set(t,u);let b=Fb(t,(p=>(m,y)=>{if(o&&Hr(y)){let g=p===void 0?m:`${p}.${m}`;l.has(g)||(y=Array.isArray(y)?y.map(w=>Hr(w)?Kr(w,e,r,g):w):Kr(y,e,r,g))}if(typeof m=="string"&&!(s&&qb(s,m))){let g=n?`${m}_`:m;if(Jo.has(g))m=Jo.get(g);else{let w=Ub(m,{pascalCase:n,locale:!1,preserveConsecutiveUppercase:c});m.length<100&&Jo.set(g,w),m=w}}return[m,y]})(i),{deep:!1});Object.assign(u,b);let f=Object.getOwnPropertySymbols(t);for(let p of f)u[p]=o&&Hr(t[p])?Kr(t[p],e,r,i):t[p];return u};function Rf(t,e){let r=new WeakMap;return Array.isArray(t)?t.map((i,s)=>Hr(i)?Kr(i,e,r,String(s)):i):Kr(t,e,r)}function Cf(t){let e=0,r=t.length;for(;e<r&&(t[e]==="\r"||t[e]===`
|
|
18
|
+
`,s)}while(i!==-1);return n+=t.slice(s),n}var{stdout:nu,stderr:ou}=ru,Uo=Symbol("GENERATOR"),zr=Symbol("STYLER"),ki=Symbol("IS_EMPTY"),au=["ansi","ansi","ansi256","ansi16m"],qr=Object.create(null),rb=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=nu?nu.level:0;t.level=e.level===void 0?r:e.level};var ib=t=>{let e=(...r)=>r.join(" ");return rb(e,t),Object.setPrototypeOf(e,ji.prototype),e};function ji(t){return ib(t)}Object.setPrototypeOf(ji.prototype,Function.prototype);for(let[t,e]of Object.entries(ht))qr[t]={get(){let r=Hs(this,zo(e.open,e.close,this[zr]),this[ki]);return Object.defineProperty(this,t,{value:r}),r}};qr.visible={get(){let t=Hs(this,this[zr],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var Go=(t,e,r,...i)=>t==="rgb"?e==="ansi16m"?ht[r].ansi16m(...i):e==="ansi256"?ht[r].ansi256(ht.rgbToAnsi256(...i)):ht[r].ansi(ht.rgbToAnsi(...i)):t==="hex"?Go("rgb",e,r,...ht.hexToRgb(...i)):ht[r][t](...i),sb=["rgb","hex","ansi256"];for(let t of sb){qr[t]={get(){let{level:r}=this;return function(...i){let s=zo(Go(t,au[r],"color",...i),ht.color.close,this[zr]);return Hs(this,s,this[ki])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);qr[e]={get(){let{level:r}=this;return function(...i){let s=zo(Go(t,au[r],"bgColor",...i),ht.bgColor.close,this[zr]);return Hs(this,s,this[ki])}}}}var nb=Object.defineProperties(()=>{},{...qr,level:{enumerable:!0,get(){return this[Uo].level},set(t){this[Uo].level=t}}}),zo=(t,e,r)=>{let i,s;return r===void 0?(i=t,s=e):(i=r.openAll+t,s=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:s,parent:r}},Hs=(t,e,r)=>{let i=(...s)=>ob(i,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(i,nb),i[Uo]=t,i[zr]=e,i[ki]=r,i},ob=(t,e)=>{if(t.level<=0||!e)return t[ki]?"":e;let r=t[zr];if(r===void 0)return e;let{openAll:i,closeAll:s}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=iu(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
|
|
19
|
+
`);return n!==-1&&(e=su(e,s,i,n)),i+e+s};Object.defineProperties(ji.prototype,qr);var ab=ji(),X$=ji({level:ou?ou.level:0});var S=ab;var xy=We(fu(),1);import Ba from"node:process";import mh,{format as _b}from"util";import{resolve as Sb,normalize as Rb}from"path";import{readFileSync as Cb}from"fs";import gh,{createRequire as pu}from"node:module";import Gt from"node:path";import Ab from"node:process";import Lb,{fileURLToPath as yh}from"node:url";import bh from"node:fs";import Da from"url";function zi(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",i=!1,s=t.match(/^-+/);for(let n=s?s[0].length:0;n<t.length;n++){let a=t.charAt(n);i&&(i=!1,a=a.toUpperCase()),n!==0&&(a==="-"||a==="_")?i=!0:a!=="-"&&a!=="_"&&(r+=a)}return r}}function vh(t,e){let r=t.toLowerCase();e=e||"-";let i="";for(let s=0;s<t.length;s++){let n=r.charAt(s),a=t.charAt(s);n!==a&&s>0?i+=`${e}${r.charAt(s)}`:i+=a}return i}function wh(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Ob(t){if(Array.isArray(t))return t.map(a=>typeof a!="string"?a+"":a);t=t.trim();let e=0,r=null,i=null,s=null,n=[];for(let a=0;a<t.length;a++){if(r=i,i=t.charAt(a),i===" "&&!s){r!==" "&&e++;continue}i===s?s=null:(i==="'"||i==='"')&&!s&&(s=i),n[e]||(n[e]=""),n[e]+=i}return n}var ft;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(ft||(ft={}));var Lt,Pa=class{constructor(e){Lt=e}parse(e,r){let i=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),s=Ob(e),n=typeof e=="string",a=$b(Object.assign(Object.create(null),i.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},i.configuration),c=Object.assign(Object.create(null),i.default),l=i.configObjects||[],u=i.envPrefix,d=o["populate--"],g=d?"--":"_",h=Object.create(null),p=Object.create(null),m=i.__||Lt.format,y={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},b=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,w=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(R){let L=typeof R=="object"?R.key:R,k=Object.keys(R).map(function(P){return{boolean:"bools",string:"strings",number:"numbers"}[P]}).filter(Boolean).pop();k&&(y[k][L]=!0),y.arrays[L]=!0,y.keys.push(L)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(R){y.bools[R]=!0,y.keys.push(R)}),[].concat(i.string||[]).filter(Boolean).forEach(function(R){y.strings[R]=!0,y.keys.push(R)}),[].concat(i.number||[]).filter(Boolean).forEach(function(R){y.numbers[R]=!0,y.keys.push(R)}),[].concat(i.count||[]).filter(Boolean).forEach(function(R){y.counts[R]=!0,y.keys.push(R)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(R){y.normalize[R]=!0,y.keys.push(R)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([R,L])=>{typeof L=="number"&&(y.nargs[R]=L,y.keys.push(R))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([R,L])=>{typeof L=="function"&&(y.coercions[R]=L,y.keys.push(R))}),typeof i.config<"u"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(R){y.configs[R]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([R,L])=>{(typeof L=="boolean"||typeof L=="function")&&(y.configs[R]=L)})),Ur(i.key,a,i.default,y.arrays),Object.keys(c).forEach(function(R){(y.aliases[R]||[]).forEach(function(L){c[L]=c[R]})});let x=null;$y();let f=[],v=Object.assign(Object.create(null),{_:[]}),E={};for(let R=0;R<s.length;R++){let L=s[R],k=L.replace(/^-{3,}/,"---"),P,A,H,z,J,Se;if(L!=="--"&&/^-/.test(L)&&zs(L))_(L);else if(k.match(/^---+(=|$)/)){_(L);continue}else if(L.match(/^--.+=/)||!o["short-option-groups"]&&L.match(/^-.+=/))z=L.match(/^--?([^=]+)=([\s\S]*)$/),z!==null&&Array.isArray(z)&&z.length>=3&&(re(z[1],y.arrays)?R=C(R,z[1],s,z[2]):re(z[1],y.nargs)!==!1?R=O(R,z[1],s,z[2]):$(z[1],z[2],!0));else if(L.match(w)&&o["boolean-negation"])z=L.match(w),z!==null&&Array.isArray(z)&&z.length>=2&&(A=z[1],$(A,re(A,y.arrays)?[!1]:!1));else if(L.match(/^--.+/)||!o["short-option-groups"]&&L.match(/^-[^-]+/))z=L.match(/^--?(.+)/),z!==null&&Array.isArray(z)&&z.length>=2&&(A=z[1],re(A,y.arrays)?R=C(R,A,s):re(A,y.nargs)!==!1?R=O(R,A,s):(J=s[R+1],J!==void 0&&(!J.match(/^-/)||J.match(b))&&!re(A,y.bools)&&!re(A,y.counts)||/^(true|false)$/.test(J)?($(A,J),R++):$(A,Gr(A))));else if(L.match(/^-.\..+=/))z=L.match(/^-([^=]+)=([\s\S]*)$/),z!==null&&Array.isArray(z)&&z.length>=3&&$(z[1],z[2]);else if(L.match(/^-.\..+/)&&!L.match(b))J=s[R+1],z=L.match(/^-(.\..+)/),z!==null&&Array.isArray(z)&&z.length>=2&&(A=z[1],J!==void 0&&!J.match(/^-/)&&!re(A,y.bools)&&!re(A,y.counts)?($(A,J),R++):$(A,Gr(A)));else if(L.match(/^-[^-]+/)&&!L.match(b)){H=L.slice(1,-1).split(""),P=!1;for(let Be=0;Be<H.length;Be++){if(J=L.slice(Be+2),H[Be+1]&&H[Be+1]==="="){Se=L.slice(Be+3),A=H[Be],re(A,y.arrays)?R=C(R,A,s,Se):re(A,y.nargs)!==!1?R=O(R,A,s,Se):$(A,Se),P=!0;break}if(J==="-"){$(H[Be],J);continue}if(/[A-Za-z]/.test(H[Be])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(J)&&re(J,y.bools)===!1){$(H[Be],J),P=!0;break}if(H[Be+1]&&H[Be+1].match(/\W/)){$(H[Be],J),P=!0;break}else $(H[Be],Gr(H[Be]))}A=L.slice(-1)[0],!P&&A!=="-"&&(re(A,y.arrays)?R=C(R,A,s):re(A,y.nargs)!==!1?R=O(R,A,s):(J=s[R+1],J!==void 0&&(!/^(-|--)[^-]/.test(J)||J.match(b))&&!re(A,y.bools)&&!re(A,y.counts)||/^(true|false)$/.test(J)?($(A,J),R++):$(A,Gr(A))))}else if(L.match(/^-[0-9]$/)&&L.match(b)&&re(L.slice(1),y.bools))A=L.slice(1),$(A,Gr(A));else if(L==="--"){f=s.slice(R+1);break}else if(o["halt-at-non-option"]){f=s.slice(R);break}else _(L)}V(v,!0),V(v,!1),Y(v),G(),we(v,y.aliases,c,!0),se(v),o["set-placeholder-key"]&&ee(v),Object.keys(y.counts).forEach(function(R){xe(v,R.split("."))||$(R,0)}),d&&f.length&&(v[g]=[]),f.forEach(function(R){v[g].push(R)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(v).filter(R=>R!=="--"&&R.includes("-")).forEach(R=>{delete v[R]}),o["strip-aliased"]&&[].concat(...Object.keys(a).map(R=>a[R])).forEach(R=>{o["camel-case-expansion"]&&R.includes("-")&&delete v[R.split(".").map(L=>zi(L)).join(".")],delete v[R]});function _(R){let L=I("_",R);(typeof L=="string"||typeof L=="number")&&v._.push(L)}function O(R,L,k,P){let A,H=re(L,y.nargs);if(H=typeof H!="number"||isNaN(H)?1:H,H===0)return Ct(P)||(x=Error(m("Argument unexpected for: %s",L))),$(L,Gr(L)),R;let z=Ct(P)?0:1;if(o["nargs-eats-options"])k.length-(R+1)+z<H&&(x=Error(m("Not enough arguments following: %s",L))),z=H;else{for(A=R+1;A<k.length&&(!k[A].match(/^-[^0-9]/)||k[A].match(b)||zs(k[A]));A++)z++;z<H&&(x=Error(m("Not enough arguments following: %s",L)))}let J=Math.min(z,H);for(!Ct(P)&&J>0&&($(L,P),J--),A=R+1;A<J+R+1;A++)$(L,k[A]);return R+J}function C(R,L,k,P){let A=[],H=P||k[R+1],z=re(L,y.nargs);if(re(L,y.bools)&&!/^(true|false)$/.test(H))A.push(!0);else if(Ct(H)||Ct(P)&&/^-/.test(H)&&!b.test(H)&&!zs(H)){if(c[L]!==void 0){let J=c[L];A=Array.isArray(J)?J:[J]}}else{Ct(P)||A.push(M(L,P,!0));for(let J=R+1;J<k.length&&!(!o["greedy-arrays"]&&A.length>0||z&&typeof z=="number"&&A.length>=z||(H=k[J],/^-/.test(H)&&!b.test(H)&&!zs(H)));J++)R=J,A.push(M(L,H,n))}return typeof z=="number"&&(z&&A.length<z||isNaN(z)&&A.length===0)&&(x=Error(m("Not enough arguments following: %s",L))),$(L,A),R}function $(R,L,k=n){if(/-/.test(R)&&o["camel-case-expansion"]){let H=R.split(".").map(function(z){return zi(z)}).join(".");F(R,H)}let P=M(R,L,k),A=R.split(".");Oe(v,A,P),y.aliases[R]&&y.aliases[R].forEach(function(H){let z=H.split(".");Oe(v,z,P)}),A.length>1&&o["dot-notation"]&&(y.aliases[A[0]]||[]).forEach(function(H){let z=H.split("."),J=[].concat(A);J.shift(),z=z.concat(J),(y.aliases[R]||[]).includes(z.join("."))||Oe(v,z,P)}),re(R,y.normalize)&&!re(R,y.arrays)&&[R].concat(y.aliases[R]||[]).forEach(function(z){Object.defineProperty(E,z,{enumerable:!0,get(){return L},set(J){L=typeof J=="string"?Lt.normalize(J):J}})})}function F(R,L){y.aliases[R]&&y.aliases[R].length||(y.aliases[R]=[L],h[L]=!0),y.aliases[L]&&y.aliases[L].length||F(L,R)}function M(R,L,k){k&&(L=Tb(L)),(re(R,y.bools)||re(R,y.counts))&&typeof L=="string"&&(L=L==="true");let P=Array.isArray(L)?L.map(function(A){return I(R,A)}):I(R,L);return re(R,y.counts)&&(Ct(P)||typeof P=="boolean")&&(P=Ho()),re(R,y.normalize)&&re(R,y.arrays)&&(Array.isArray(L)?P=L.map(A=>Lt.normalize(A)):P=Lt.normalize(L)),P}function I(R,L){return!o["parse-positional-numbers"]&&R==="_"||!re(R,y.strings)&&!re(R,y.bools)&&!Array.isArray(L)&&(wh(L)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${L}`)))||!Ct(L)&&re(R,y.numbers))&&(L=Number(L)),L}function Y(R){let L=Object.create(null);we(L,y.aliases,c),Object.keys(y.configs).forEach(function(k){let P=R[k]||L[k];if(P)try{let A=null,H=Lt.resolve(Lt.cwd(),P),z=y.configs[k];if(typeof z=="function"){try{A=z(H)}catch(J){A=J}if(A instanceof Error){x=A;return}}else A=Lt.require(H);Z(A)}catch(A){A.name==="PermissionDenied"?x=A:R[k]&&(x=Error(m("Invalid JSON config file: %s",P)))}})}function Z(R,L){Object.keys(R).forEach(function(k){let P=R[k],A=L?L+"."+k:k;typeof P=="object"&&P!==null&&!Array.isArray(P)&&o["dot-notation"]?Z(P,A):(!xe(v,A.split("."))||re(A,y.arrays)&&o["combine-arrays"])&&$(A,P)})}function G(){typeof l<"u"&&l.forEach(function(R){Z(R)})}function V(R,L){if(typeof u>"u")return;let k=typeof u=="string"?u:"",P=Lt.env();Object.keys(P).forEach(function(A){if(k===""||A.lastIndexOf(k,0)===0){let H=A.split("__").map(function(z,J){return J===0&&(z=z.substring(k.length)),zi(z)});(L&&y.configs[H.join(".")]||!L)&&!xe(R,H)&&$(H.join("."),P[A])}})}function se(R){let L,k=new Set;Object.keys(R).forEach(function(P){if(!k.has(P)&&(L=re(P,y.coercions),typeof L=="function"))try{let A=I(P,L(R[P]));[].concat(y.aliases[P]||[],P).forEach(H=>{k.add(H),R[H]=A})}catch(A){x=A}})}function ee(R){return y.keys.forEach(L=>{~L.indexOf(".")||typeof R[L]>"u"&&(R[L]=void 0)}),R}function we(R,L,k,P=!1){Object.keys(k).forEach(function(A){xe(R,A.split("."))||(Oe(R,A.split("."),k[A]),P&&(p[A]=!0),(L[A]||[]).forEach(function(H){xe(R,H.split("."))||Oe(R,H.split("."),k[A])}))})}function xe(R,L){let k=R;o["dot-notation"]||(L=[L.join(".")]),L.slice(0,-1).forEach(function(A){k=k[A]||{}});let P=L[L.length-1];return typeof k!="object"?!1:P in k}function Oe(R,L,k){let P=R;o["dot-notation"]||(L=[L.join(".")]),L.slice(0,-1).forEach(function(Se){Se=du(Se),typeof P=="object"&&P[Se]===void 0&&(P[Se]={}),typeof P[Se]!="object"||Array.isArray(P[Se])?(Array.isArray(P[Se])?P[Se].push({}):P[Se]=[P[Se],{}],P=P[Se][P[Se].length-1]):P=P[Se]});let A=du(L[L.length-1]),H=re(L.join("."),y.arrays),z=Array.isArray(k),J=o["duplicate-arguments-array"];!J&&re(A,y.nargs)&&(J=!0,(!Ct(P[A])&&y.nargs[A]===1||Array.isArray(P[A])&&P[A].length===y.nargs[A])&&(P[A]=void 0)),k===Ho()?P[A]=Ho(P[A]):Array.isArray(P[A])?J&&H&&z?P[A]=o["flatten-duplicate-arrays"]?P[A].concat(k):(Array.isArray(P[A][0])?P[A]:[P[A]]).concat([k]):!J&&!!H==!!z?P[A]=k:P[A]=P[A].concat([k]):P[A]===void 0&&H?P[A]=z?k:[k]:J&&!(P[A]===void 0||re(A,y.counts)||re(A,y.bools))?P[A]=[P[A],k]:P[A]=k}function Ur(...R){R.forEach(function(L){Object.keys(L||{}).forEach(function(k){y.aliases[k]||(y.aliases[k]=[].concat(a[k]||[]),y.aliases[k].concat(k).forEach(function(P){if(/-/.test(P)&&o["camel-case-expansion"]){let A=zi(P);A!==k&&y.aliases[k].indexOf(A)===-1&&(y.aliases[k].push(A),h[A]=!0)}}),y.aliases[k].concat(k).forEach(function(P){if(P.length>1&&/[A-Z]/.test(P)&&o["camel-case-expansion"]){let A=vh(P,"-");A!==k&&y.aliases[k].indexOf(A)===-1&&(y.aliases[k].push(A),h[A]=!0)}}),y.aliases[k].forEach(function(P){y.aliases[P]=[k].concat(y.aliases[k].filter(function(A){return P!==A}))}))})})}function re(R,L){let k=[].concat(y.aliases[R]||[],R),P=Object.keys(L),A=k.find(H=>P.includes(H));return A?L[A]:!1}function Gs(R){let L=Object.keys(y);return[].concat(L.map(P=>y[P])).some(function(P){return Array.isArray(P)?P.includes(R):P[R]})}function Ry(R,...L){return[].concat(...L).some(function(P){let A=R.match(P);return A&&Gs(A[1])})}function Cy(R){if(R.match(b)||!R.match(/^-[^-]+/))return!1;let L=!0,k,P=R.slice(1).split("");for(let A=0;A<P.length;A++){if(k=R.slice(A+2),!Gs(P[A])){L=!1;break}if(P[A+1]&&P[A+1]==="="||k==="-"||/[A-Za-z]/.test(P[A])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(k)||P[A+1]&&P[A+1].match(/\W/))break}return L}function zs(R){return o["unknown-options-as-args"]&&Ay(R)}function Ay(R){return R=R.replace(/^-{3,}/,"--"),R.match(b)||Cy(R)?!1:!Ry(R,/^-+([^=]+?)=[\s\S]*$/,w,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function Gr(R){return!re(R,y.bools)&&!re(R,y.counts)&&`${R}`in c?c[R]:Ly(Oy(R))}function Ly(R){return{[ft.BOOLEAN]:!0,[ft.STRING]:"",[ft.NUMBER]:void 0,[ft.ARRAY]:[]}[R]}function Oy(R){let L=ft.BOOLEAN;return re(R,y.strings)?L=ft.STRING:re(R,y.numbers)?L=ft.NUMBER:re(R,y.bools)?L=ft.BOOLEAN:re(R,y.arrays)&&(L=ft.ARRAY),L}function Ct(R){return R===void 0}function $y(){Object.keys(y.counts).find(R=>re(R,y.arrays)?(x=Error(m("Invalid configuration: %s, opts.count excludes opts.array.",R)),!0):re(R,y.nargs)?(x=Error(m("Invalid configuration: %s, opts.count excludes opts.narg.",R)),!0):!1)}return{aliases:Object.assign({},y.aliases),argv:Object.assign(E,v),configuration:o,defaulted:Object.assign({},p),error:x,newAliases:Object.assign({},h)}}};function $b(t){let e=[],r=Object.create(null),i=!0;for(Object.keys(t).forEach(function(s){e.push([].concat(t[s],s))});i;){i=!1;for(let s=0;s<e.length;s++)for(let n=s+1;n<e.length;n++)if(e[s].filter(function(o){return e[n].indexOf(o)!==-1}).length){e[s]=e[s].concat(e[n]),e.splice(n,1),i=!0;break}}return e.forEach(function(s){s=s.filter(function(a,o,c){return c.indexOf(a)===o});let n=s.pop();n!==void 0&&typeof n=="string"&&(r[n]=s)}),r}function Ho(t){return t!==void 0?t+1:1}function du(t){return t==="__proto__"?"___proto___":t}function Tb(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var Ko,Yo,Xo,mu=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,gu=(Yo=(Ko=process==null?void 0:process.versions)===null||Ko===void 0?void 0:Ko.node)!==null&&Yo!==void 0?Yo:(Xo=process==null?void 0:process.version)===null||Xo===void 0?void 0:Xo.slice(1);if(gu&&Number(gu.match(/^([^.]+)/)[1])<mu)throw Error(`yargs parser supports a minimum Node.js version of ${mu}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Pb=process?process.env:{},yu=pu?pu(import.meta.url):void 0,xh=new Pa({cwd:process.cwd,env:()=>Pb,format:_b,normalize:Rb,resolve:Sb,require:t=>{if(typeof yu<"u")return yu(t);if(t.match(/\.json$/))return JSON.parse(Cb(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),Yr=function(e,r){return xh.parse(e.slice(),r).argv};Yr.detailed=function(t,e){return xh.parse(t.slice(),e)};Yr.camelCase=zi;Yr.decamelize=vh;Yr.looksLikeNumber=wh;var Eh=t=>typeof t=="object"&&t!==null,bu=t=>Eh(t)&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date)&&!(globalThis.Blob&&t instanceof globalThis.Blob),Ib=Symbol("mapObjectSkip"),Ia=(t,e,r,i=new WeakMap)=>{if(r={deep:!1,target:{},...r},i.has(t))return i.get(t);i.set(t,r.target);let{target:s}=r;delete r.target;let n=a=>a.map(o=>bu(o)?Ia(o,e,r,i):o);if(Array.isArray(t))return n(t);for(let[a,o]of Object.entries(t)){let c=e(a,o,t);if(c===Ib)continue;let[l,u,{shouldRecurse:d=!0}={}]=c;l!=="__proto__"&&(r.deep&&d&&bu(u)&&(u=Array.isArray(u)?n(u):Ia(u,e,r,i)),s[l]=u)}return s};function Fb(t,e,r){if(!Eh(t))throw new TypeError(`Expected an object, got \`${t}\` (${typeof t})`);if(Array.isArray(t))throw new TypeError("Expected an object, got an array");return Ia(t,e,r)}var Nb=/[\p{Lu}]/u,Db=/[\p{Ll}]/u,vu=/^[\p{Lu}](?![\p{Lu}])/gu,_h=/([\p{Alpha}\p{N}_]|$)/u,Ma=/[_.\- ]+/,Mb=new RegExp("^"+Ma.source),wu=new RegExp(Ma.source+_h.source,"gu"),xu=new RegExp("\\d+"+_h.source,"gu"),kb=(t,e,r,i)=>{let s=!1,n=!1,a=!1,o=!1;for(let c=0;c<t.length;c++){let l=t[c];o=c>2?t[c-3]==="-":!0,s&&Nb.test(l)?(t=t.slice(0,c)+"-"+t.slice(c),s=!1,a=n,n=!0,c++):n&&a&&Db.test(l)&&(!o||i)?(t=t.slice(0,c-1)+"-"+t.slice(c-1),a=n,n=!1,s=!0):(s=e(l)===l&&r(l)!==l,a=n,n=r(l)===l&&e(l)!==l)}return t},jb=(t,e)=>(vu.lastIndex=0,t.replaceAll(vu,r=>e(r))),Bb=(t,e)=>(wu.lastIndex=0,xu.lastIndex=0,t.replaceAll(xu,(r,i,s)=>["_","-"].includes(t.charAt(s+r.length))?r:e(r)).replaceAll(wu,(r,i)=>e(i)));function Ub(t,e){if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(t)?t=t.map(n=>n.trim()).filter(n=>n.length).join("-"):t=t.trim(),t.length===0)return"";let r=e.locale===!1?n=>n.toLowerCase():n=>n.toLocaleLowerCase(e.locale),i=e.locale===!1?n=>n.toUpperCase():n=>n.toLocaleUpperCase(e.locale);return t.length===1?Ma.test(t)?"":e.pascalCase?i(t):r(t):(t!==r(t)&&(t=kb(t,r,i,e.preserveConsecutiveUppercase)),t=t.replace(Mb,""),t=e.preserveConsecutiveUppercase?jb(t,r):r(t),e.pascalCase&&(t=i(t.charAt(0))+t.slice(1)),Bb(t,i))}var Gb=class extends Map{#t=0;#r=new Map;#e=new Map;#n;#h;#w;constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.#n=e.maxSize,this.#h=e.maxAge||Number.POSITIVE_INFINITY,this.#w=e.onEviction}get __oldCache(){return this.#e}#a(e){if(typeof this.#w=="function")for(let[r,i]of e)this.#w(r,i.value)}#u(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.#w=="function"&&this.#w(e,r.value),this.delete(e)):!1}#s(e,r){if(this.#u(e,r)===!1)return r.value}#c(e,r){return r.expiry?this.#s(e,r):r.value}#i(e,r){let i=r.get(e);return this.#c(e,i)}#l(e,r){this.#r.set(e,r),this.#t++,this.#t>=this.#n&&(this.#t=0,this.#a(this.#e),this.#e=this.#r,this.#r=new Map)}#o(e,r){this.#e.delete(e),this.#l(e,r)}*#d(){for(let e of this.#e){let[r,i]=e;this.#r.has(r)||this.#u(r,i)===!1&&(yield e)}for(let e of this.#r){let[r,i]=e;this.#u(r,i)===!1&&(yield e)}}get(e){if(this.#r.has(e)){let r=this.#r.get(e);return this.#c(e,r)}if(this.#e.has(e)){let r=this.#e.get(e);if(this.#u(e,r)===!1)return this.#o(e,r),r.value}}set(e,r,{maxAge:i=this.#h}={}){let s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.#r.has(e)?this.#r.set(e,{value:r,expiry:s}):this.#l(e,{value:r,expiry:s}),this}has(e){return this.#r.has(e)?!this.#u(e,this.#r.get(e)):this.#e.has(e)?!this.#u(e,this.#e.get(e)):!1}peek(e){if(this.#r.has(e))return this.#i(e,this.#r);if(this.#e.has(e))return this.#i(e,this.#e)}expiresIn(e){let r=this.#r.get(e)??this.#e.get(e);if(r)return r.expiry?r.expiry-Date.now():Number.POSITIVE_INFINITY}delete(e){let r=this.#r.delete(e);return r&&this.#t--,this.#e.delete(e)||r}clear(){this.#r.clear(),this.#e.clear(),this.#t=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this.#d()],i=r.length-e;i<0?(this.#r=new Map(r),this.#e=new Map,this.#t=r.length):(i>0&&this.#a(r.slice(0,i)),this.#e=new Map(r.slice(i)),this.#r=new Map,this.#t=0),this.#n=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.#r){let[r,i]=e;this.#u(r,i)===!1&&(yield[r,i.value])}for(let e of this.#e){let[r,i]=e;this.#r.has(r)||this.#u(r,i)===!1&&(yield[r,i.value])}}*entriesDescending(){let e=[...this.#r];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this.#u(s,n)===!1&&(yield[s,n.value])}e=[...this.#e];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this.#r.has(s)||this.#u(s,n)===!1&&(yield[s,n.value])}}*entriesAscending(){for(let[e,r]of this.#d())yield[e,r.value]}get size(){if(!this.#t)return this.#e.size;let e=0;for(let r of this.#e.keys())this.#r.has(r)||e++;return Math.min(this.#t+e,this.#n)}get maxSize(){return this.#n}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[i,s]of this.entriesAscending())e.call(r,s,i,this)}get[Symbol.toStringTag](){return"QuickLRU"}toString(){return`QuickLRU(${this.size}/${this.maxSize})`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},zb=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),Jo=new Gb({maxSize:1e5}),Hr=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),Kr=(t,e={},r=new WeakMap,i)=>{if(!Hr(t))return t;if(r.has(t))return r.get(t);let{exclude:s,pascalCase:n=!1,stopPaths:a,deep:o=!1,preserveConsecutiveUppercase:c=!1}=e,l=new Set(a);if(Array.isArray(t)){let p=[];r.set(t,p);for(let m of t)p.push(Hr(m)?Kr(m,e,r,i):m);return p}let u={};r.set(t,u);let g=Fb(t,(p=>(m,y)=>{if(o&&Hr(y)){let b=p===void 0?m:`${p}.${m}`;l.has(b)||(y=Array.isArray(y)?y.map(w=>Hr(w)?Kr(w,e,r,b):w):Kr(y,e,r,b))}if(typeof m=="string"&&!(s&&zb(s,m))){let b=n?`${m}_`:m;if(Jo.has(b))m=Jo.get(b);else{let w=Ub(m,{pascalCase:n,locale:!1,preserveConsecutiveUppercase:c});m.length<100&&Jo.set(b,w),m=w}}return[m,y]})(i),{deep:!1});Object.assign(u,g);let h=Object.getOwnPropertySymbols(t);for(let p of h)u[p]=o&&Hr(t[p])?Kr(t[p],e,r,i):t[p];return u};function Sh(t,e){let r=new WeakMap;return Array.isArray(t)?t.map((i,s)=>Hr(i)?Kr(i,e,r,String(s)):i):Kr(t,e,r)}function Rh(t){let e=0,r=t.length;for(;e<r&&(t[e]==="\r"||t[e]===`
|
|
20
20
|
`);)e++;for(;r>e&&(t[r-1]==="\r"||t[r-1]===`
|
|
21
|
-
`);)r--;return e>0||r<t.length?t.slice(e,r):t}function zb(t){let e=t.match(/^[ \t]*(?=\S)/gm);if(!e)return t;let r=Number.POSITIVE_INFINITY;for(let i of e)r=Math.min(r,i.length);return r===0||r===Number.POSITIVE_INFINITY?t:t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),"")}function Wb(t,e=1,r={}){let{indent:i=" ",includeEmptyLines:s=!1}=r;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof i!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof i}\``);if(e===0)return t;let n=s?/^/gm:/^(?!\s*$)/gm;return t.replace(n,i.repeat(e))}function ka(t,e=0,r={}){return Wb(zb(t),e,r)}var Eu=t=>t instanceof URL?bf(t):t;function Vb(t,{cwd:e=Ab.cwd(),type:r="file",stopAt:i}={}){let s=Gt.resolve(Eu(e)??""),{root:n}=Gt.parse(s);i=Gt.resolve(s,Eu(i)??n);let a=Gt.isAbsolute(t);for(;s;){let o=a?t:Gt.join(s,t);try{let c=vf.statSync(o,{throwIfNoEntry:!1});if(r==="file"&&c?.isFile()||r==="directory"&&c?.isDirectory())return o}catch{}if(s===i||s===n)break;s=Gt.dirname(s)}}function Qs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wr={},Ys={exports:{}},_u;function Hb(){if(_u)return Ys.exports;_u=1;let t=process||{},e=t.argv||[],r=t.env||{},i=!(r.NO_COLOR||e.includes("--no-color"))&&(!!r.FORCE_COLOR||e.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&r.TERM!=="dumb"||!!r.CI),s=(o,c,l=o)=>u=>{let d=""+u,b=d.indexOf(c,o.length);return~b?o+n(d,c,l,b)+c:o+d+c},n=(o,c,l,u)=>{let d="",b=0;do d+=o.substring(b,u)+l,b=u+c.length,u=o.indexOf(c,b);while(~u);return d+o.substring(b)},a=(o=i)=>{let c=o?s:()=>String;return{isColorSupported:o,reset:c("\x1B[0m","\x1B[0m"),bold:c("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:c("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:c("\x1B[3m","\x1B[23m"),underline:c("\x1B[4m","\x1B[24m"),inverse:c("\x1B[7m","\x1B[27m"),hidden:c("\x1B[8m","\x1B[28m"),strikethrough:c("\x1B[9m","\x1B[29m"),black:c("\x1B[30m","\x1B[39m"),red:c("\x1B[31m","\x1B[39m"),green:c("\x1B[32m","\x1B[39m"),yellow:c("\x1B[33m","\x1B[39m"),blue:c("\x1B[34m","\x1B[39m"),magenta:c("\x1B[35m","\x1B[39m"),cyan:c("\x1B[36m","\x1B[39m"),white:c("\x1B[37m","\x1B[39m"),gray:c("\x1B[90m","\x1B[39m"),bgBlack:c("\x1B[40m","\x1B[49m"),bgRed:c("\x1B[41m","\x1B[49m"),bgGreen:c("\x1B[42m","\x1B[49m"),bgYellow:c("\x1B[43m","\x1B[49m"),bgBlue:c("\x1B[44m","\x1B[49m"),bgMagenta:c("\x1B[45m","\x1B[49m"),bgCyan:c("\x1B[46m","\x1B[49m"),bgWhite:c("\x1B[47m","\x1B[49m"),blackBright:c("\x1B[90m","\x1B[39m"),redBright:c("\x1B[91m","\x1B[39m"),greenBright:c("\x1B[92m","\x1B[39m"),yellowBright:c("\x1B[93m","\x1B[39m"),blueBright:c("\x1B[94m","\x1B[39m"),magentaBright:c("\x1B[95m","\x1B[39m"),cyanBright:c("\x1B[96m","\x1B[39m"),whiteBright:c("\x1B[97m","\x1B[39m"),bgBlackBright:c("\x1B[100m","\x1B[49m"),bgRedBright:c("\x1B[101m","\x1B[49m"),bgGreenBright:c("\x1B[102m","\x1B[49m"),bgYellowBright:c("\x1B[103m","\x1B[49m"),bgBlueBright:c("\x1B[104m","\x1B[49m"),bgMagentaBright:c("\x1B[105m","\x1B[49m"),bgCyanBright:c("\x1B[106m","\x1B[49m"),bgWhiteBright:c("\x1B[107m","\x1B[49m")}};return Ys.exports=a(),Ys.exports.createColors=a,Ys.exports}var Bi={},Su;function Kb(){return Su||(Su=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,Bi.matchToToken=function(t){var e={type:"invalid",value:t[0],closed:void 0};return t[1]?(e.type="string",e.closed=!!(t[3]||t[4])):t[5]?e.type="comment":t[6]?(e.type="comment",e.closed=!!t[7]):t[8]?e.type="regex":t[9]?e.type="number":t[10]?e.type="name":t[11]?e.type="punctuator":t[12]&&(e.type="whitespace"),e}),Bi}var Zo={},Vr={},Ru;function Yb(){if(Ru)return Vr;Ru=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.isIdentifierChar=c,Vr.isIdentifierName=l,Vr.isIdentifierStart=o;let t="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",e="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",r=new RegExp("["+t+"]"),i=new RegExp("["+t+e+"]");t=e=null;let s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],n=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function a(u,d){let b=65536;for(let f=0,p=d.length;f<p;f+=2){if(b+=d[f],b>u)return!1;if(b+=d[f+1],b>=u)return!0}return!1}function o(u){return u<65?u===36:u<=90?!0:u<97?u===95:u<=122?!0:u<=65535?u>=170&&r.test(String.fromCharCode(u)):a(u,s)}function c(u){return u<48?u===36:u<58?!0:u<65?!1:u<=90?!0:u<97?u===95:u<=122?!0:u<=65535?u>=170&&i.test(String.fromCharCode(u)):a(u,s)||a(u,n)}function l(u){let d=!0;for(let b=0;b<u.length;b++){let f=u.charCodeAt(b);if((f&64512)===55296&&b+1<u.length){let p=u.charCodeAt(++b);(p&64512)===56320&&(f=65536+((f&1023)<<10)+(p&1023))}if(d){if(d=!1,!o(f))return!1}else if(!c(f))return!1}return!d}return Vr}var Ut={},Cu;function Xb(){if(Cu)return Ut;Cu=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.isKeyword=c,Ut.isReservedWord=s,Ut.isStrictBindOnlyReservedWord=a,Ut.isStrictBindReservedWord=o,Ut.isStrictReservedWord=n;let t={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},e=new Set(t.keyword),r=new Set(t.strict),i=new Set(t.strictBind);function s(l,u){return u&&l==="await"||l==="enum"}function n(l,u){return s(l,u)||r.has(l)}function a(l){return i.has(l)}function o(l,u){return n(l,u)||a(l)}function c(l){return e.has(l)}return Ut}var Au;function Jb(){return Au||(Au=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isIdentifierChar",{enumerable:!0,get:function(){return e.isIdentifierChar}}),Object.defineProperty(t,"isIdentifierName",{enumerable:!0,get:function(){return e.isIdentifierName}}),Object.defineProperty(t,"isIdentifierStart",{enumerable:!0,get:function(){return e.isIdentifierStart}}),Object.defineProperty(t,"isKeyword",{enumerable:!0,get:function(){return r.isKeyword}}),Object.defineProperty(t,"isReservedWord",{enumerable:!0,get:function(){return r.isReservedWord}}),Object.defineProperty(t,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return r.isStrictBindOnlyReservedWord}}),Object.defineProperty(t,"isStrictBindReservedWord",{enumerable:!0,get:function(){return r.isStrictBindReservedWord}}),Object.defineProperty(t,"isStrictReservedWord",{enumerable:!0,get:function(){return r.isStrictReservedWord}});var e=Yb(),r=Xb()})(Zo)),Zo}var Lu;function Zb(){if(Lu)return Wr;Lu=1,Object.defineProperty(Wr,"__esModule",{value:!0});var t=Hb(),e=Kb(),r=Jb();function i(){return typeof process=="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?!1:t.isColorSupported}let s=(E,h)=>v=>E(h(v));function n(E){return{keyword:E.cyan,capitalized:E.yellow,jsxIdentifier:E.yellow,punctuator:E.yellow,number:E.magenta,string:E.green,regex:E.magenta,comment:E.gray,invalid:s(s(E.white,E.bgRed),E.bold),gutter:E.gray,marker:s(E.red,E.bold),message:s(E.red,E.bold),reset:E.reset}}let a=n(t.createColors(!0)),o=n(t.createColors(!1));function c(E){return E?a:o}let l=new Set(["as","async","from","get","of","set"]),u=/\r\n|[\n\r\u2028\u2029]/,d=/^[()[\]{}]$/,b;{let E=/^[a-z][\w-]*$/i,h=function(v,x,_){if(v.type==="name"){if(r.isKeyword(v.value)||r.isStrictReservedWord(v.value,!0)||l.has(v.value))return"keyword";if(E.test(v.value)&&(_[x-1]==="<"||_.slice(x-2,x)==="</"))return"jsxIdentifier";if(v.value[0]!==v.value[0].toLowerCase())return"capitalized"}return v.type==="punctuator"&&d.test(v.value)?"bracket":v.type==="invalid"&&(v.value==="@"||v.value==="#")?"punctuator":v.type};b=function*(v){let x;for(;x=e.default.exec(v);){let _=e.matchToToken(x);yield{type:h(_,x.index,v),value:_.value}}}}function f(E){if(E==="")return"";let h=c(!0),v="";for(let{type:x,value:_}of b(E))x in h?v+=_.split(u).map(A=>h[x](A)).join(`
|
|
22
|
-
`):v+=_;return v}let p=!1,m=/\r\n|[\n\r\u2028\u2029]/;function y(
|
|
21
|
+
`);)r--;return e>0||r<t.length?t.slice(e,r):t}function qb(t){let e=t.match(/^[ \t]*(?=\S)/gm);if(!e)return t;let r=Number.POSITIVE_INFINITY;for(let i of e)r=Math.min(r,i.length);return r===0||r===Number.POSITIVE_INFINITY?t:t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),"")}function Wb(t,e=1,r={}){let{indent:i=" ",includeEmptyLines:s=!1}=r;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof i!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof i}\``);if(e===0)return t;let n=s?/^/gm:/^(?!\s*$)/gm;return t.replace(n,i.repeat(e))}function ka(t,e=0,r={}){return Wb(qb(t),e,r)}var Eu=t=>t instanceof URL?yh(t):t;function Vb(t,{cwd:e=Ab.cwd(),type:r="file",stopAt:i}={}){let s=Gt.resolve(Eu(e)??""),{root:n}=Gt.parse(s);i=Gt.resolve(s,Eu(i)??n);let a=Gt.isAbsolute(t);for(;s;){let o=a?t:Gt.join(s,t);try{let c=bh.statSync(o,{throwIfNoEntry:!1});if(r==="file"&&c?.isFile()||r==="directory"&&c?.isDirectory())return o}catch{}if(s===i||s===n)break;s=Gt.dirname(s)}}function Qs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wr={},Ys={exports:{}},_u;function Hb(){if(_u)return Ys.exports;_u=1;let t=process||{},e=t.argv||[],r=t.env||{},i=!(r.NO_COLOR||e.includes("--no-color"))&&(!!r.FORCE_COLOR||e.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&r.TERM!=="dumb"||!!r.CI),s=(o,c,l=o)=>u=>{let d=""+u,g=d.indexOf(c,o.length);return~g?o+n(d,c,l,g)+c:o+d+c},n=(o,c,l,u)=>{let d="",g=0;do d+=o.substring(g,u)+l,g=u+c.length,u=o.indexOf(c,g);while(~u);return d+o.substring(g)},a=(o=i)=>{let c=o?s:()=>String;return{isColorSupported:o,reset:c("\x1B[0m","\x1B[0m"),bold:c("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:c("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:c("\x1B[3m","\x1B[23m"),underline:c("\x1B[4m","\x1B[24m"),inverse:c("\x1B[7m","\x1B[27m"),hidden:c("\x1B[8m","\x1B[28m"),strikethrough:c("\x1B[9m","\x1B[29m"),black:c("\x1B[30m","\x1B[39m"),red:c("\x1B[31m","\x1B[39m"),green:c("\x1B[32m","\x1B[39m"),yellow:c("\x1B[33m","\x1B[39m"),blue:c("\x1B[34m","\x1B[39m"),magenta:c("\x1B[35m","\x1B[39m"),cyan:c("\x1B[36m","\x1B[39m"),white:c("\x1B[37m","\x1B[39m"),gray:c("\x1B[90m","\x1B[39m"),bgBlack:c("\x1B[40m","\x1B[49m"),bgRed:c("\x1B[41m","\x1B[49m"),bgGreen:c("\x1B[42m","\x1B[49m"),bgYellow:c("\x1B[43m","\x1B[49m"),bgBlue:c("\x1B[44m","\x1B[49m"),bgMagenta:c("\x1B[45m","\x1B[49m"),bgCyan:c("\x1B[46m","\x1B[49m"),bgWhite:c("\x1B[47m","\x1B[49m"),blackBright:c("\x1B[90m","\x1B[39m"),redBright:c("\x1B[91m","\x1B[39m"),greenBright:c("\x1B[92m","\x1B[39m"),yellowBright:c("\x1B[93m","\x1B[39m"),blueBright:c("\x1B[94m","\x1B[39m"),magentaBright:c("\x1B[95m","\x1B[39m"),cyanBright:c("\x1B[96m","\x1B[39m"),whiteBright:c("\x1B[97m","\x1B[39m"),bgBlackBright:c("\x1B[100m","\x1B[49m"),bgRedBright:c("\x1B[101m","\x1B[49m"),bgGreenBright:c("\x1B[102m","\x1B[49m"),bgYellowBright:c("\x1B[103m","\x1B[49m"),bgBlueBright:c("\x1B[104m","\x1B[49m"),bgMagentaBright:c("\x1B[105m","\x1B[49m"),bgCyanBright:c("\x1B[106m","\x1B[49m"),bgWhiteBright:c("\x1B[107m","\x1B[49m")}};return Ys.exports=a(),Ys.exports.createColors=a,Ys.exports}var Bi={},Su;function Kb(){return Su||(Su=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,Bi.matchToToken=function(t){var e={type:"invalid",value:t[0],closed:void 0};return t[1]?(e.type="string",e.closed=!!(t[3]||t[4])):t[5]?e.type="comment":t[6]?(e.type="comment",e.closed=!!t[7]):t[8]?e.type="regex":t[9]?e.type="number":t[10]?e.type="name":t[11]?e.type="punctuator":t[12]&&(e.type="whitespace"),e}),Bi}var Zo={},Vr={},Ru;function Yb(){if(Ru)return Vr;Ru=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.isIdentifierChar=c,Vr.isIdentifierName=l,Vr.isIdentifierStart=o;let t="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",e="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",r=new RegExp("["+t+"]"),i=new RegExp("["+t+e+"]");t=e=null;let s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],n=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function a(u,d){let g=65536;for(let h=0,p=d.length;h<p;h+=2){if(g+=d[h],g>u)return!1;if(g+=d[h+1],g>=u)return!0}return!1}function o(u){return u<65?u===36:u<=90?!0:u<97?u===95:u<=122?!0:u<=65535?u>=170&&r.test(String.fromCharCode(u)):a(u,s)}function c(u){return u<48?u===36:u<58?!0:u<65?!1:u<=90?!0:u<97?u===95:u<=122?!0:u<=65535?u>=170&&i.test(String.fromCharCode(u)):a(u,s)||a(u,n)}function l(u){let d=!0;for(let g=0;g<u.length;g++){let h=u.charCodeAt(g);if((h&64512)===55296&&g+1<u.length){let p=u.charCodeAt(++g);(p&64512)===56320&&(h=65536+((h&1023)<<10)+(p&1023))}if(d){if(d=!1,!o(h))return!1}else if(!c(h))return!1}return!d}return Vr}var Ut={},Cu;function Xb(){if(Cu)return Ut;Cu=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.isKeyword=c,Ut.isReservedWord=s,Ut.isStrictBindOnlyReservedWord=a,Ut.isStrictBindReservedWord=o,Ut.isStrictReservedWord=n;let t={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},e=new Set(t.keyword),r=new Set(t.strict),i=new Set(t.strictBind);function s(l,u){return u&&l==="await"||l==="enum"}function n(l,u){return s(l,u)||r.has(l)}function a(l){return i.has(l)}function o(l,u){return n(l,u)||a(l)}function c(l){return e.has(l)}return Ut}var Au;function Jb(){return Au||(Au=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isIdentifierChar",{enumerable:!0,get:function(){return e.isIdentifierChar}}),Object.defineProperty(t,"isIdentifierName",{enumerable:!0,get:function(){return e.isIdentifierName}}),Object.defineProperty(t,"isIdentifierStart",{enumerable:!0,get:function(){return e.isIdentifierStart}}),Object.defineProperty(t,"isKeyword",{enumerable:!0,get:function(){return r.isKeyword}}),Object.defineProperty(t,"isReservedWord",{enumerable:!0,get:function(){return r.isReservedWord}}),Object.defineProperty(t,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return r.isStrictBindOnlyReservedWord}}),Object.defineProperty(t,"isStrictBindReservedWord",{enumerable:!0,get:function(){return r.isStrictBindReservedWord}}),Object.defineProperty(t,"isStrictReservedWord",{enumerable:!0,get:function(){return r.isStrictReservedWord}});var e=Yb(),r=Xb()})(Zo)),Zo}var Lu;function Zb(){if(Lu)return Wr;Lu=1,Object.defineProperty(Wr,"__esModule",{value:!0});var t=Hb(),e=Kb(),r=Jb();function i(){return typeof process=="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?!1:t.isColorSupported}let s=(x,f)=>v=>x(f(v));function n(x){return{keyword:x.cyan,capitalized:x.yellow,jsxIdentifier:x.yellow,punctuator:x.yellow,number:x.magenta,string:x.green,regex:x.magenta,comment:x.gray,invalid:s(s(x.white,x.bgRed),x.bold),gutter:x.gray,marker:s(x.red,x.bold),message:s(x.red,x.bold),reset:x.reset}}let a=n(t.createColors(!0)),o=n(t.createColors(!1));function c(x){return x?a:o}let l=new Set(["as","async","from","get","of","set"]),u=/\r\n|[\n\r\u2028\u2029]/,d=/^[()[\]{}]$/,g;{let x=/^[a-z][\w-]*$/i,f=function(v,E,_){if(v.type==="name"){if(r.isKeyword(v.value)||r.isStrictReservedWord(v.value,!0)||l.has(v.value))return"keyword";if(x.test(v.value)&&(_[E-1]==="<"||_.slice(E-2,E)==="</"))return"jsxIdentifier";if(v.value[0]!==v.value[0].toLowerCase())return"capitalized"}return v.type==="punctuator"&&d.test(v.value)?"bracket":v.type==="invalid"&&(v.value==="@"||v.value==="#")?"punctuator":v.type};g=function*(v){let E;for(;E=e.default.exec(v);){let _=e.matchToToken(E);yield{type:f(_,E.index,v),value:_.value}}}}function h(x){if(x==="")return"";let f=c(!0),v="";for(let{type:E,value:_}of g(x))E in f?v+=_.split(u).map(O=>f[E](O)).join(`
|
|
22
|
+
`):v+=_;return v}let p=!1,m=/\r\n|[\n\r\u2028\u2029]/;function y(x,f,v){let E=Object.assign({column:0,line:-1},x.start),_=Object.assign({},E,x.end),{linesAbove:O=2,linesBelow:C=3}=v||{},$=E.line,F=E.column,M=_.line,I=_.column,Y=Math.max($-(O+1),0),Z=Math.min(f.length,M+C);$===-1&&(Y=0),M===-1&&(Z=f.length);let G=M-$,V={};if(G)for(let se=0;se<=G;se++){let ee=se+$;if(!F)V[ee]=!0;else if(se===0){let we=f[ee-1].length;V[ee]=[F,we-F+1]}else if(se===G)V[ee]=[0,I];else{let we=f[ee-se].length;V[ee]=[0,we]}}else F===I?F?V[$]=[F,0]:V[$]=!0:V[$]=[F,I-F];return{start:Y,end:Z,markerLines:V}}function b(x,f,v={}){let E=v.forceColor||i()&&v.highlightCode,_=c(E),O=x.split(m),{start:C,end:$,markerLines:F}=y(f,O,v),M=f.start&&typeof f.start.column=="number",I=String($).length,Z=(E?h(x):x).split(m,$).slice(C,$).map((G,V)=>{let se=C+1+V,we=` ${` ${se}`.slice(-I)} |`,xe=F[se],Oe=!F[se+1];if(xe){let Ur="";if(Array.isArray(xe)){let re=G.slice(0,Math.max(xe[0]-1,0)).replace(/[^\t]/g," "),Gs=xe[1]||1;Ur=[`
|
|
23
23
|
`,_.gutter(we.replace(/\d/g," "))," ",re,_.marker("^").repeat(Gs)].join(""),Oe&&v.message&&(Ur+=" "+_.message(v.message))}return[_.marker(">"),_.gutter(we),G.length>0?` ${G}`:"",Ur].join("")}else return` ${_.gutter(we)}${G.length>0?` ${G}`:""}`}).join(`
|
|
24
24
|
`);return v.message&&!M&&(Z=`${" ".repeat(I+1)}${v.message}
|
|
25
|
-
${Z}`),
|
|
26
|
-
`,e-1);return{line:r===-1?0:t.slice(0,r+1).match(/\n/g).length,column:e-r-1}}function tv(t,e,{oneBased:r=!1}={}){if(typeof t!="string")throw new TypeError("Text parameter should be a string");if(!Number.isInteger(e))throw new TypeError("Index parameter should be an integer");if(e<0||e>t.length)throw new RangeError("Index out of bounds");let i=ev(t,e);return r?{line:i.line+1,column:i.column+1}:i}var rv=t=>`\\u{${t.codePointAt(0).toString(16)}}`,Fa=class t extends Error{name="JSONError";fileName;#t;#r;#e;#n;#
|
|
25
|
+
${Z}`),E?_.reset(Z):Z}function w(x,f,v,E={}){if(!p){p=!0;let O="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(O,"DeprecationWarning");else{let C=new Error(O);C.name="DeprecationWarning",console.warn(new Error(O))}}return v=Math.max(v,0),b(x,{start:{column:v,line:f}},E)}return Wr.codeFrameColumns=b,Wr.default=w,Wr.highlight=h,Wr}var Qb=Zb();function ev(t,e){let r=e===0?-1:t.lastIndexOf(`
|
|
26
|
+
`,e-1);return{line:r===-1?0:t.slice(0,r+1).match(/\n/g).length,column:e-r-1}}function tv(t,e,{oneBased:r=!1}={}){if(typeof t!="string")throw new TypeError("Text parameter should be a string");if(!Number.isInteger(e))throw new TypeError("Index parameter should be an integer");if(e<0||e>t.length)throw new RangeError("Index out of bounds");let i=ev(t,e);return r?{line:i.line+1,column:i.column+1}:i}var rv=t=>`\\u{${t.codePointAt(0).toString(16)}}`,Fa=class t extends Error{name="JSONError";fileName;#t;#r;#e;#n;#h;constructor(e){if(typeof e=="string")super(),this.#e=e;else{let{jsonParseError:r,fileName:i,input:s}=e;super(void 0,{cause:r}),this.#t=s,this.#r=r,this.fileName=i}Error.captureStackTrace?.(this,t)}get message(){this.#e??=`${sv(this.#r.message)}${this.#t===""?" while parsing empty string":""}`;let{codeFrame:e}=this;return`${this.#e}${this.fileName?` in ${this.fileName}`:""}${e?`
|
|
27
27
|
|
|
28
28
|
${e}
|
|
29
|
-
`:""}`}set message(e){this.#e=e}#w(e){if(!this.#r)return;let r=this.#t,i=iv(r,this.#r.message);if(i)return Qb.codeFrameColumns(r,{start:i},{highlightCode:e})}get codeFrame(){return this.#n??=this.#w(!0),this.#n}get rawCodeFrame(){return this.#f??=this.#w(!1),this.#f}},iv=(t,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:i,line:s,column:n}=r.groups;return s&&n?{line:Number(s),column:Number(n)}:tv(t,Number(i),{oneBased:!0})},sv=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,i)=>`"${i}"(${rv(i)})`);function nv(t,e,r){try{return JSON.parse(t,e)}catch(i){throw new Fa({jsonParseError:i,fileName:r,input:t})}}var Qo,Ou;function Af(){return Ou||(Ou=1,Qo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Qo}var ea,$u;function Lf(){if($u)return ea;$u=1;let t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,s=e-6;return ea={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ea}var Xs={exports:{}},Tu;function ov(){return Tu||(Tu=1,(function(t,e){let{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:s}=Lf(),n=Af();e=t.exports={};let a=e.re=[],o=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,b="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",s],[b,i]],p=y=>{for(let[g,w]of f)y=y.split(`${g}*`).join(`${g}{0,${w}}`).split(`${g}+`).join(`${g}{1,${w}}`);return y},m=(y,g,w)=>{let E=p(g),h=d++;n(y,h,g),u[y]=h,c[h]=g,l[h]=E,a[h]=new RegExp(g,w?"g":void 0),o[h]=new RegExp(E,w?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${b}*`),m("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${b}+`),m("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),m("FULL",`^${c[u.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),m("LOOSE",`^${c[u.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),m("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",c[u.COERCE],!0),m("COERCERTLFULL",c[u.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",m("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",m("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Xs,Xs.exports)),Xs.exports}var ta,Pu;function av(){if(Pu)return ta;Pu=1;let t=Object.freeze({loose:!0}),e=Object.freeze({});return ta=i=>i?typeof i!="object"?t:i:e,ta}var ra,Iu;function cv(){if(Iu)return ra;Iu=1;let t=/^[0-9]+$/,e=(i,s)=>{let n=t.test(i),a=t.test(s);return n&&a&&(i=+i,s=+s),i===s?0:n&&!a?-1:a&&!n?1:i<s?-1:1};return ra={compareIdentifiers:e,rcompareIdentifiers:(i,s)=>e(s,i)},ra}var ia,Fu;function lv(){if(Fu)return ia;Fu=1;let t=Af(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=Lf(),{safeRe:i,t:s}=ov(),n=av(),{compareIdentifiers:a}=cv();class o{constructor(l,u){if(u=n(u),l instanceof o){if(l.loose===!!u.loose&&l.includePrerelease===!!u.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",l,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;let d=l.trim().match(u.loose?i[s.LOOSE]:i[s.FULL]);if(!d)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(b=>{if(/^[0-9]+$/.test(b)){let f=+b;if(f>=0&&f<r)return f}return b}):this.prerelease=[],this.build=d[5]?d[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(l){if(t("SemVer.compare",this.version,this.options,l),!(l instanceof o)){if(typeof l=="string"&&l===this.version)return 0;l=new o(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof o||(l=new o(l,this.options)),a(this.major,l.major)||a(this.minor,l.minor)||a(this.patch,l.patch)}comparePre(l){if(l instanceof o||(l=new o(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let u=0;do{let d=this.prerelease[u],b=l.prerelease[u];if(t("prerelease compare",u,d,b),d===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(d===void 0)return-1;if(d===b)continue;return a(d,b)}while(++u)}compareBuild(l){l instanceof o||(l=new o(l,this.options));let u=0;do{let d=this.build[u],b=l.build[u];if(t("build compare",u,d,b),d===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(d===void 0)return-1;if(d===b)continue;return a(d,b)}while(++u)}inc(l,u,d){if(l.startsWith("pre")){if(!u&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(u){let b=`-${u}`.match(this.options.loose?i[s.PRERELEASELOOSE]:i[s.PRERELEASE]);if(!b||b[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,d),this.inc("pre",u,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,d),this.inc("pre",u,d);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 b=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[b];else{let f=this.prerelease.length;for(;--f>=0;)typeof this.prerelease[f]=="number"&&(this.prerelease[f]++,f=-2);if(f===-1){if(u===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(b)}}if(u){let f=[u,b];d===!1&&(f=[u]),a(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=f):this.prerelease=f}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ia=o,ia}var sa,Nu;function Of(){if(Nu)return sa;Nu=1;let t=lv();return sa=(r,i,s=!1)=>{if(r instanceof t)return r;try{return new t(r,i)}catch(n){if(!s)return null;throw n}},sa}var na,Du;function $f(){if(Du)return na;Du=1;let t=Of();return na=(r,i)=>{let s=t(r,i);return s?s.version:null},na}var oa,Mu;function Tf(){if(Mu)return oa;Mu=1;let t=Of();return oa=(r,i)=>{let s=t(r.trim().replace(/^[=v]+/,""),i);return s?s.version:null},oa}var Pf=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"],uv=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"],fv=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"],aa,ku;function hv(){if(ku)return aa;ku=1;var t=[].concat(Pf).concat(uv),e=fv;return aa=function(r){var i=0;function s(){return i<r.length}function n(y){if(y instanceof RegExp){var g=r.slice(i),w=g.match(y);if(w)return i+=w[0].length,w[0]}else if(r.indexOf(y,i)===i)return i+=y.length,y}function a(){n(/[ ]*/)}function o(){for(var y,g=["WITH","AND","OR","(",")",":","+"],w=0;w<g.length&&(y=n(g[w]),!y);w++);if(y==="+"&&i>1&&r[i-2]===" ")throw new Error("Space before `+`");return y&&{type:"OPERATOR",string:y}}function c(){return n(/[A-Za-z0-9-.]+/)}function l(){var y=c();if(!y)throw new Error("Expected idstring at offset "+i);return y}function u(){if(n("DocumentRef-")){var y=l();return{type:"DOCUMENTREF",string:y}}}function d(){if(n("LicenseRef-")){var y=l();return{type:"LICENSEREF",string:y}}}function b(){var y=i,g=c();if(t.indexOf(g)!==-1)return{type:"LICENSE",string:g};if(e.indexOf(g)!==-1)return{type:"EXCEPTION",string:g};i=y}function f(){return o()||u()||d()||b()}for(var p=[];s()&&(a(),!!s());){var m=f();if(!m)throw new Error("Unexpected `"+r[i]+"` at offset "+i);p.push(m)}return p},aa}var ca,ju;function pv(){return ju||(ju=1,ca=function(t){var e=0;function r(){return e<t.length}function i(){return r()?t[e]:null}function s(){if(!r())throw new Error;e++}function n(m){var y=i();if(y&&y.type==="OPERATOR"&&m===y.string)return s(),y.string}function a(){if(n("WITH")){var m=i();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function o(){var m=e,y="",g=i();if(g.type==="DOCUMENTREF"&&(s(),y+="DocumentRef-"+g.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(g=i(),g.type==="LICENSEREF")return s(),y+="LicenseRef-"+g.string,{license:y};e=m}function c(){var m=i();if(m&&m.type==="LICENSE"){s();var y={license:m.string};n("+")&&(y.plus=!0);var g=a();return g&&(y.exception=g),y}}function l(){var m=n("(");if(m){var y=f();if(!n(")"))throw new Error("Expected `)`");return y}}function u(){return l()||o()||c()}function d(m,y){return function g(){var w=y();if(w){if(!n(m))return w;var E=g();if(!E)throw new Error("Expected expression");return{left:w,conjunction:m.toLowerCase(),right:E}}}}var b=d("AND",u),f=d("OR",b),p=f();if(!p||r())throw new Error("Syntax error");return p}),ca}var la,Bu;function If(){if(Bu)return la;Bu=1;var t=hv(),e=pv();return la=function(r){return e(t(r))},la}var ua,Uu;function dv(){if(Uu)return ua;Uu=1;var t=If(),e=Pf;function r(g){try{return t(g),!0}catch{return!1}}function i(g,w){var E=w[0].length-g[0].length;return E!==0?E:g[0].toUpperCase().localeCompare(w[0].toUpperCase())}var s=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(i),n=0,a=1,o=[function(g){return g.toUpperCase()},function(g){return g.trim()},function(g){return g.replace(/\./g,"")},function(g){return g.replace(/\s+/g,"")},function(g){return g.replace(/\s+/g,"-")},function(g){return g.replace("v","-")},function(g){return g.replace(/,?\s*(\d)/,"-$1")},function(g){return g.replace(/,?\s*(\d)/,"-$1.0")},function(g){return g.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(g){return g.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(g){return g[0].toUpperCase()+g.slice(1)},function(g){return g.replace("/","-")},function(g){return g.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(g){return g.indexOf("3.0")!==-1?g+"-or-later":g+"-only"},function(g){return g+"only"},function(g){return g.replace(/(\d)$/,"-$1.0")},function(g){return g.replace(/(-| )?(\d)$/,"-$2-Clause")},function(g){return g.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(g){return g.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(g){return g.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(g){return g.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(g){return g.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(g){return g.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(g){return"CC-"+g},function(g){return"CC-"+g+"-4.0"},function(g){return g.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(g){return"CC-"+g.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],c=e.map(function(g){var w=/^(.*)-\d+\.\d+$/.exec(g);return w?[w[0],w[1]]:[g,null]}).reduce(function(g,w){var E=w[1];return g[E]=g[E]||[],g[E].push(w[0]),g},{}),l=Object.keys(c).map(function(w){return[w,c[w]]}).filter(function(w){return w[1].length===1&&w[0]!==null&&w[0]!=="APL"}).map(function(w){return[w[0],w[1][0]]});c=void 0;var u=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(l).sort(i),d=0,b=1,f=function(g){for(var w=0;w<o.length;w++){var E=o[w](g).trim();if(E!==g&&r(E))return E}return null},p=function(g){for(var w=g.toUpperCase(),E=0;E<u.length;E++){var h=u[E];if(w.indexOf(h[d])>-1)return h[b]}return null},m=function(g,w){for(var E=0;E<s.length;E++){var h=s[E],v=h[n];if(g.indexOf(v)>-1){var x=g.replace(v,h[a]),_=w(x);if(_!==null)return _}}return null};ua=function(g,w){w=w||{};var E=w.upgrade===void 0?!0:!!w.upgrade;function h(A){return E?y(A):A}var v=typeof g=="string"&&g.trim().length!==0;if(!v)throw Error("Invalid argument. Expected non-empty string.");if(g=g.trim(),r(g))return h(g);var x=g.replace(/\+$/,"").trim();if(r(x))return h(x);var _=f(g);return _!==null||(_=m(g,function(A){return r(A)?A:f(A)}),_!==null)||(_=p(g),_!==null)||(_=m(g,p),_!==null)?h(_):null};function y(g){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(g)!==-1?g+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(g)!==-1?g.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(g)!==-1?g+"-or-later":g}return ua}var fa,Gu;function Ff(){if(Gu)return fa;Gu=1;var t=If(),e=dv(),r='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',i=/^SEE LICEN[CS]E IN (.+)$/;function s(a,o){return o.slice(0,a.length)===a}function n(a){if(a.hasOwnProperty("license")){var o=a.license;return s("LicenseRef",o)||s("DocumentRef",o)}else return n(a.left)||n(a.right)}return fa=function(a){var o;try{o=t(a)}catch{var c;if(a==="UNLICENSED"||a==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(c=i.exec(a))return{validForOldPackages:!0,validForNewPackages:!0,inFile:c[1]};var l={validForOldPackages:!1,validForNewPackages:!1,warnings:[r]};if(a.trim().length!==0){var u=e(a);u&&l.warnings.push('license is similar to the valid expression "'+u+'"')}return l}return n(o)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[r]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},fa}var Ui={},qu;function mv(){if(qu)return Ui;qu=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.LRUCache=void 0;let t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e=new Set,r=typeof process=="object"&&process?process:{},i=(b,f,p,m)=>{typeof r.emitWarning=="function"?r.emitWarning(b,f,p,m):console.error(`[${p}] ${f}: ${b}`)},s=globalThis.AbortController,n=globalThis.AbortSignal;if(typeof s>"u"){n=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(m,y){this._onabort.push(y)}},s=class{constructor(){f()}signal=new n;abort(m){if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let y of this.signal._onabort)y(m);this.signal.onabort?.(m)}}};let b=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",f=()=>{b&&(b=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",f))}}let a=b=>!e.has(b),o=b=>b&&b===Math.floor(b)&&b>0&&isFinite(b),c=b=>o(b)?b<=Math.pow(2,8)?Uint8Array:b<=Math.pow(2,16)?Uint16Array:b<=Math.pow(2,32)?Uint32Array:b<=Number.MAX_SAFE_INTEGER?l:null:null;class l extends Array{constructor(f){super(f),this.fill(0)}}class u{heap;length;static#t=!1;static create(f){let p=c(f);if(!p)return[];u.#t=!0;let m=new u(f,p);return u.#t=!1,m}constructor(f,p){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new p(f),this.length=0}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}}class d{#t;#r;#e;#n;#f;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#u;#s;#c;#i;#l;#o;#d;#g;#y;#p;#C;#x;#E;#_;#S;#v;static unsafeExposeInternals(f){return{starts:f.#x,ttls:f.#E,sizes:f.#C,keyMap:f.#s,keyList:f.#c,valList:f.#i,next:f.#l,prev:f.#o,get head(){return f.#d},get tail(){return f.#g},free:f.#y,isBackgroundFetch:p=>f.#m(p),backgroundFetch:(p,m,y,g)=>f.#F(p,m,y,g),moveToTail:p=>f.#D(p),indexes:p=>f.#L(p),rindexes:p=>f.#$(p),isStale:p=>f.#R(p)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#a}get fetchMethod(){return this.#f}get memoMethod(){return this.#w}get dispose(){return this.#e}get disposeAfter(){return this.#n}constructor(f){let{max:p=0,ttl:m,ttlResolution:y=1,ttlAutopurge:g,updateAgeOnGet:w,updateAgeOnHas:E,allowStale:h,dispose:v,disposeAfter:x,noDisposeOnSet:_,noUpdateTTL:A,maxSize:C=0,maxEntrySize:O=0,sizeCalculation:F,fetchMethod:M,memoMethod:I,noDeleteOnFetchRejection:Y,noDeleteOnStaleGet:Z,allowStaleOnFetchRejection:G,allowStaleOnFetchAbort:V,ignoreFetchAbort:se}=f;if(p!==0&&!o(p))throw new TypeError("max option must be a nonnegative integer");let ee=p?c(p):Array;if(!ee)throw new Error("invalid max value: "+p);if(this.#t=p,this.#r=C,this.maxEntrySize=O||this.#r,this.sizeCalculation=F,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(I!==void 0&&typeof I!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=I,M!==void 0&&typeof M!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#f=M,this.#S=!!M,this.#s=new Map,this.#c=new Array(p).fill(void 0),this.#i=new Array(p).fill(void 0),this.#l=new ee(p),this.#o=new ee(p),this.#d=0,this.#g=0,this.#y=u.create(p),this.#a=0,this.#u=0,typeof v=="function"&&(this.#e=v),typeof x=="function"?(this.#n=x,this.#p=[]):(this.#n=void 0,this.#p=void 0),this.#_=!!this.#e,this.#v=!!this.#n,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!A,this.noDeleteOnFetchRejection=!!Y,this.allowStaleOnFetchRejection=!!G,this.allowStaleOnFetchAbort=!!V,this.ignoreFetchAbort=!!se,this.maxEntrySize!==0){if(this.#r!==0&&!o(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!Z,this.updateAgeOnGet=!!w,this.updateAgeOnHas=!!E,this.ttlResolution=o(y)||y===0?y:1,this.ttlAutopurge=!!g,this.ttl=m||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let we="LRU_CACHE_UNBOUNDED";a(we)&&(e.add(we),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",we,d))}}getRemainingTTL(f){return this.#s.has(f)?1/0:0}#P(){let f=new l(this.#t),p=new l(this.#t);this.#E=f,this.#x=p,this.#M=(g,w,E=t.now())=>{if(p[g]=w!==0?E:0,f[g]=w,w!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#R(g)&&this.#b(this.#c[g],"expire")},w+1);h.unref&&h.unref()}},this.#A=g=>{p[g]=f[g]!==0?t.now():0},this.#h=(g,w)=>{if(f[w]){let E=f[w],h=p[w];if(!E||!h)return;g.ttl=E,g.start=h,g.now=m||y();let v=g.now-h;g.remainingTTL=E-v}};let m=0,y=()=>{let g=t.now();if(this.ttlResolution>0){m=g;let w=setTimeout(()=>m=0,this.ttlResolution);w.unref&&w.unref()}return g};this.getRemainingTTL=g=>{let w=this.#s.get(g);if(w===void 0)return 0;let E=f[w],h=p[w];if(!E||!h)return 1/0;let v=(m||y())-h;return E-v},this.#R=g=>{let w=p[g],E=f[g];return!!E&&!!w&&(m||y())-w>E}}#A=()=>{};#h=()=>{};#M=()=>{};#R=()=>!1;#I(){let f=new l(this.#t);this.#u=0,this.#C=f,this.#N=p=>{this.#u-=f[p],f[p]=0},this.#B=(p,m,y,g)=>{if(this.#m(m))return 0;if(!o(y))if(g){if(typeof g!="function")throw new TypeError("sizeCalculation must be a function");if(y=g(m,p),!o(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return y},this.#O=(p,m,y)=>{if(f[p]=m,this.#r){let g=this.#r-f[p];for(;this.#u>g;)this.#T(!0)}this.#u+=f[p],y&&(y.entrySize=m,y.totalCalculatedSize=this.#u)}}#N=f=>{};#O=(f,p,m)=>{};#B=(f,p,m,y)=>{if(m||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#L({allowStale:f=this.allowStale}={}){if(this.#a)for(let p=this.#g;!(!this.#k(p)||((f||!this.#R(p))&&(yield p),p===this.#d));)p=this.#o[p]}*#$({allowStale:f=this.allowStale}={}){if(this.#a)for(let p=this.#d;!(!this.#k(p)||((f||!this.#R(p))&&(yield p),p===this.#g));)p=this.#l[p]}#k(f){return f!==void 0&&this.#s.get(this.#c[f])===f}*entries(){for(let f of this.#L())this.#i[f]!==void 0&&this.#c[f]!==void 0&&!this.#m(this.#i[f])&&(yield[this.#c[f],this.#i[f]])}*rentries(){for(let f of this.#$())this.#i[f]!==void 0&&this.#c[f]!==void 0&&!this.#m(this.#i[f])&&(yield[this.#c[f],this.#i[f]])}*keys(){for(let f of this.#L()){let p=this.#c[f];p!==void 0&&!this.#m(this.#i[f])&&(yield p)}}*rkeys(){for(let f of this.#$()){let p=this.#c[f];p!==void 0&&!this.#m(this.#i[f])&&(yield p)}}*values(){for(let f of this.#L())this.#i[f]!==void 0&&!this.#m(this.#i[f])&&(yield this.#i[f])}*rvalues(){for(let f of this.#$())this.#i[f]!==void 0&&!this.#m(this.#i[f])&&(yield this.#i[f])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(f,p={}){for(let m of this.#L()){let y=this.#i[m],g=this.#m(y)?y.__staleWhileFetching:y;if(g!==void 0&&f(g,this.#c[m],this))return this.get(this.#c[m],p)}}forEach(f,p=this){for(let m of this.#L()){let y=this.#i[m],g=this.#m(y)?y.__staleWhileFetching:y;g!==void 0&&f.call(p,g,this.#c[m],this)}}rforEach(f,p=this){for(let m of this.#$()){let y=this.#i[m],g=this.#m(y)?y.__staleWhileFetching:y;g!==void 0&&f.call(p,g,this.#c[m],this)}}purgeStale(){let f=!1;for(let p of this.#$({allowStale:!0}))this.#R(p)&&(this.#b(this.#c[p],"expire"),f=!0);return f}info(f){let p=this.#s.get(f);if(p===void 0)return;let m=this.#i[p],y=this.#m(m)?m.__staleWhileFetching:m;if(y===void 0)return;let g={value:y};if(this.#E&&this.#x){let w=this.#E[p],E=this.#x[p];if(w&&E){let h=w-(t.now()-E);g.ttl=h,g.start=Date.now()}}return this.#C&&(g.size=this.#C[p]),g}dump(){let f=[];for(let p of this.#L({allowStale:!0})){let m=this.#c[p],y=this.#i[p],g=this.#m(y)?y.__staleWhileFetching:y;if(g===void 0||m===void 0)continue;let w={value:g};if(this.#E&&this.#x){w.ttl=this.#E[p];let E=t.now()-this.#x[p];w.start=Math.floor(Date.now()-E)}this.#C&&(w.size=this.#C[p]),f.unshift([m,w])}return f}load(f){this.clear();for(let[p,m]of f){if(m.start){let y=Date.now()-m.start;m.start=t.now()-y}this.set(p,m.value,m)}}set(f,p,m={}){if(p===void 0)return this.delete(f),this;let{ttl:y=this.ttl,start:g,noDisposeOnSet:w=this.noDisposeOnSet,sizeCalculation:E=this.sizeCalculation,status:h}=m,{noUpdateTTL:v=this.noUpdateTTL}=m,x=this.#B(f,p,m.size||0,E);if(this.maxEntrySize&&x>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#b(f,"set"),this;let _=this.#a===0?void 0:this.#s.get(f);if(_===void 0)_=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#t?this.#T(!1):this.#a,this.#c[_]=f,this.#i[_]=p,this.#s.set(f,_),this.#l[this.#g]=_,this.#o[_]=this.#g,this.#g=_,this.#a++,this.#O(_,x,h),h&&(h.set="add"),v=!1;else{this.#D(_);let A=this.#i[_];if(p!==A){if(this.#S&&this.#m(A)){A.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:C}=A;C!==void 0&&!w&&(this.#_&&this.#e?.(C,f,"set"),this.#v&&this.#p?.push([C,f,"set"]))}else w||(this.#_&&this.#e?.(A,f,"set"),this.#v&&this.#p?.push([A,f,"set"]));if(this.#N(_),this.#O(_,x,h),this.#i[_]=p,h){h.set="replace";let C=A&&this.#m(A)?A.__staleWhileFetching:A;C!==void 0&&(h.oldValue=C)}}else h&&(h.set="update")}if(y!==0&&!this.#E&&this.#P(),this.#E&&(v||this.#M(_,y,g),h&&this.#h(h,_)),!w&&this.#v&&this.#p){let A=this.#p,C;for(;C=A?.shift();)this.#n?.(...C)}return this}pop(){try{for(;this.#a;){let f=this.#i[this.#d];if(this.#T(!0),this.#m(f)){if(f.__staleWhileFetching)return f.__staleWhileFetching}else if(f!==void 0)return f}}finally{if(this.#v&&this.#p){let f=this.#p,p;for(;p=f?.shift();)this.#n?.(...p)}}}#T(f){let p=this.#d,m=this.#c[p],y=this.#i[p];return this.#S&&this.#m(y)?y.__abortController.abort(new Error("evicted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(y,m,"evict"),this.#v&&this.#p?.push([y,m,"evict"])),this.#N(p),f&&(this.#c[p]=void 0,this.#i[p]=void 0,this.#y.push(p)),this.#a===1?(this.#d=this.#g=0,this.#y.length=0):this.#d=this.#l[p],this.#s.delete(m),this.#a--,p}has(f,p={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=p,g=this.#s.get(f);if(g!==void 0){let w=this.#i[g];if(this.#m(w)&&w.__staleWhileFetching===void 0)return!1;if(this.#R(g))y&&(y.has="stale",this.#h(y,g));else return m&&this.#A(g),y&&(y.has="hit",this.#h(y,g)),!0}else y&&(y.has="miss");return!1}peek(f,p={}){let{allowStale:m=this.allowStale}=p,y=this.#s.get(f);if(y===void 0||!m&&this.#R(y))return;let g=this.#i[y];return this.#m(g)?g.__staleWhileFetching:g}#F(f,p,m,y){let g=p===void 0?void 0:this.#i[p];if(this.#m(g))return g;let w=new s,{signal:E}=m;E?.addEventListener("abort",()=>w.abort(E.reason),{signal:w.signal});let h={signal:w.signal,options:m,context:y},v=(F,M=!1)=>{let{aborted:I}=w.signal,Y=m.ignoreFetchAbort&&F!==void 0;if(m.status&&(I&&!M?(m.status.fetchAborted=!0,m.status.fetchError=w.signal.reason,Y&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),I&&!Y&&!M)return _(w.signal.reason);let Z=C;return this.#i[p]===C&&(F===void 0?Z.__staleWhileFetching?this.#i[p]=Z.__staleWhileFetching:this.#b(f,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(f,F,h.options))),F},x=F=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=F),_(F)),_=F=>{let{aborted:M}=w.signal,I=M&&m.allowStaleOnFetchAbort,Y=I||m.allowStaleOnFetchRejection,Z=Y||m.noDeleteOnFetchRejection,G=C;if(this.#i[p]===C&&(!Z||G.__staleWhileFetching===void 0?this.#b(f,"fetch"):I||(this.#i[p]=G.__staleWhileFetching)),Y)return m.status&&G.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw F},A=(F,M)=>{let I=this.#f?.(f,g,h);I&&I instanceof Promise&&I.then(Y=>F(Y===void 0?void 0:Y),M),w.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(F(void 0),m.allowStaleOnFetchAbort&&(F=Y=>v(Y,!0)))})};m.status&&(m.status.fetchDispatched=!0);let C=new Promise(A).then(v,x),O=Object.assign(C,{__abortController:w,__staleWhileFetching:g,__returned:void 0});return p===void 0?(this.set(f,O,{...h.options,status:void 0}),p=this.#s.get(f)):this.#i[p]=O,O}#m(f){if(!this.#S)return!1;let p=f;return!!p&&p instanceof Promise&&p.hasOwnProperty("__staleWhileFetching")&&p.__abortController instanceof s}async fetch(f,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:g=this.noDeleteOnStaleGet,ttl:w=this.ttl,noDisposeOnSet:E=this.noDisposeOnSet,size:h=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:x=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:A=this.allowStaleOnFetchRejection,ignoreFetchAbort:C=this.ignoreFetchAbort,allowStaleOnFetchAbort:O=this.allowStaleOnFetchAbort,context:F,forceRefresh:M=!1,status:I,signal:Y}=p;if(!this.#S)return I&&(I.fetch="get"),this.get(f,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:g,status:I});let Z={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:g,ttl:w,noDisposeOnSet:E,size:h,sizeCalculation:v,noUpdateTTL:x,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:O,ignoreFetchAbort:C,status:I,signal:Y},G=this.#s.get(f);if(G===void 0){I&&(I.fetch="miss");let V=this.#F(f,G,Z,F);return V.__returned=V}else{let V=this.#i[G];if(this.#m(V)){let Oe=m&&V.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",Oe&&(I.returnedStale=!0)),Oe?V.__staleWhileFetching:V.__returned=V}let se=this.#R(G);if(!M&&!se)return I&&(I.fetch="hit"),this.#D(G),y&&this.#A(G),I&&this.#h(I,G),V;let ee=this.#F(f,G,Z,F),xe=ee.__staleWhileFetching!==void 0&&m;return I&&(I.fetch=se?"stale":"refresh",xe&&se&&(I.returnedStale=!0)),xe?ee.__staleWhileFetching:ee.__returned=ee}}async forceFetch(f,p={}){let m=await this.fetch(f,p);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(f,p={}){let m=this.#w;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:g,...w}=p,E=this.get(f,w);if(!g&&E!==void 0)return E;let h=m(f,E,{options:w,context:y});return this.set(f,h,w),h}get(f,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:g=this.noDeleteOnStaleGet,status:w}=p,E=this.#s.get(f);if(E!==void 0){let h=this.#i[E],v=this.#m(h);return w&&this.#h(w,E),this.#R(E)?(w&&(w.get="stale"),v?(w&&m&&h.__staleWhileFetching!==void 0&&(w.returnedStale=!0),m?h.__staleWhileFetching:void 0):(g||this.#b(f,"expire"),w&&m&&(w.returnedStale=!0),m?h:void 0)):(w&&(w.get="hit"),v?h.__staleWhileFetching:(this.#D(E),y&&this.#A(E),h))}else w&&(w.get="miss")}#j(f,p){this.#o[p]=f,this.#l[f]=p}#D(f){f!==this.#g&&(f===this.#d?this.#d=this.#l[f]:this.#j(this.#o[f],this.#l[f]),this.#j(this.#g,f),this.#g=f)}delete(f){return this.#b(f,"delete")}#b(f,p){let m=!1;if(this.#a!==0){let y=this.#s.get(f);if(y!==void 0)if(m=!0,this.#a===1)this.#G(p);else{this.#N(y);let g=this.#i[y];if(this.#m(g)?g.__abortController.abort(new Error("deleted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(g,f,p),this.#v&&this.#p?.push([g,f,p])),this.#s.delete(f),this.#c[y]=void 0,this.#i[y]=void 0,y===this.#g)this.#g=this.#o[y];else if(y===this.#d)this.#d=this.#l[y];else{let w=this.#o[y];this.#l[w]=this.#l[y];let E=this.#l[y];this.#o[E]=this.#o[y]}this.#a--,this.#y.push(y)}}if(this.#v&&this.#p?.length){let y=this.#p,g;for(;g=y?.shift();)this.#n?.(...g)}return m}clear(){return this.#G("delete")}#G(f){for(let p of this.#$({allowStale:!0})){let m=this.#i[p];if(this.#m(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#c[p];this.#_&&this.#e?.(m,y,f),this.#v&&this.#p?.push([m,y,f])}}if(this.#s.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#E&&this.#x&&(this.#E.fill(0),this.#x.fill(0)),this.#C&&this.#C.fill(0),this.#d=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#v&&this.#p){let p=this.#p,m;for(;m=p?.shift();)this.#n?.(...m)}}}return Ui.LRUCache=d,Ui}var ha,zu;function gv(){if(zu)return ha;zu=1;let t=(...n)=>n.every(a=>a)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",r=n=>n.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:n,user:a,project:o,committish:c})=>`git@${n}:${a}/${o}.git${t("#",c)}`,sshurltemplate:({domain:n,user:a,project:o,committish:c})=>`git+ssh://git@${n}/${a}/${o}.git${t("#",c)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l,path:u})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u)}`,browsetemplate:({domain:n,user:a,project:o,committish:c,treepath:l})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c))}`,browsetreetemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,fragment:d,hashformat:b})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",b(d||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:d,hashformat:b})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",b(d||""))}`,docstemplate:({domain:n,user:a,project:o,treepath:c,committish:l})=>`https://${n}/${a}/${o}${t("/",c,"/",e(l))}#readme`,httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/raw/${e(c||"HEAD")}/${l}`,shortcuttemplate:({type:n,user:a,project:o,committish:c})=>`${n}:${a}/${o}${t("#",c)}`,pathtemplate:({user:n,project:a,committish:o})=>`${n}/${a}${t("#",o)}`,bugstemplate:({domain:n,user:a,project:o})=>`https://${n}/${a}/${o}/issues`,hashformat:r},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:a,project:o,committish:c,path:l})=>`https://${t(n,"@")}raw.githubusercontent.com/${a}/${o}/${e(c||"HEAD")}/${l}`,gittemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://codeload.${n}/${a}/${o}/tar.gz/${e(c||"HEAD")}`,extract:n=>{let[,a,o,c,l]=n.pathname.split("/",5);if(!(c&&c!=="tree")&&(c||(l=n.hash.slice(1)),o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:l}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,editpath:d})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,d)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/get/${e(c||"HEAD")}.tar.gz`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["get"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/repository/archive.tar.gz?ref=${e(c||"HEAD")}`,extract:n=>{let a=n.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;let o=a.split("/"),c=o.pop();c.endsWith(".git")&&(c=c.slice(0,-4));let l=o.join("/");if(!(!l||!c))return{user:l,project:c,committish:n.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:a,committish:o})=>`git@${n}:${a}.git${t("#",o)}`,sshurltemplate:({domain:n,project:a,committish:o})=>`git+ssh://git@${n}/${a}.git${t("#",o)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l})=>`https://${n}/${a}/${o}${t("/",e(c))}/${l}`,browsetemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,browsetreetemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,browseblobtemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,docstemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,httpstemplate:({domain:n,project:a,committish:o})=>`git+https://${n}/${a}.git${t("#",o)}`,filetemplate:({user:n,project:a,committish:o,path:c})=>`https://gist.githubusercontent.com/${n}/${a}/raw${t("/",e(o))}/${c}`,shortcuttemplate:({type:n,project:a,committish:o})=>`${n}:${a}${t("#",o)}`,pathtemplate:({project:n,committish:a})=>`${n}${t("#",a)}`,bugstemplate:({domain:n,project:a})=>`https://${n}/${a}`,gittemplate:({domain:n,project:a,committish:o})=>`git://${n}/${a}.git${t("#",o)}`,tarballtemplate:({project:n,committish:a})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(a||"HEAD")}`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(c!=="raw"){if(!o){if(!a)return;o=a,a=null}return o.endsWith(".git")&&(o=o.slice(0,-4)),{user:a,project:o,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+r(n)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/blob/${e(c)||"HEAD"}/${l}`,httpstemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}.git${t("#",c)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/archive/${e(c)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["archive"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}};for(let[n,a]of Object.entries(s))s[n]=Object.assign({},i,a);return ha=s,ha}var pa,Wu;function Nf(){if(Wu)return pa;Wu=1;let t=Da,e=(n,a,o)=>{let c=n.indexOf(o);return n.lastIndexOf(a,c>-1?c:1/0)},r=n=>{try{return new t.URL(n)}catch{}},i=(n,a)=>{let o=n.indexOf(":"),c=n.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(a,c))return n;let l=n.indexOf("@");return l>-1?l>o?`git+ssh://${n}`:n:n.indexOf("//")===o+1?n:`${n.slice(0,o+1)}//${n.slice(o+1)}`},s=n=>{let a=e(n,"@","#"),o=e(n,":","#");return o>a&&(n=n.slice(0,o)+"/"+n.slice(o+1)),e(n,":","#")===-1&&n.indexOf("//")===-1&&(n=`git+ssh://${n}`),n};return pa=(n,a)=>{let o=a?i(n,a):n;return r(o)||r(s(o))},pa}var da,Vu;function yv(){if(Vu)return da;Vu=1;let t=Nf(),e=r=>{let i=r.indexOf("#"),s=r.indexOf("/"),n=r.indexOf("/",s+1),a=r.indexOf(":"),o=/\s/.exec(r),c=r.indexOf("@"),l=!o||i>-1&&o.index>i,u=c===-1||i>-1&&c>i,d=a===-1||i>-1&&a>i,b=n===-1||i>-1&&n>i,f=s>0,p=i>-1?r[i-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&f&&p&&m&&u&&d&&b};return da=(r,i,{gitHosts:s,protocols:n})=>{if(!r)return;let a=e(r)?`github:${r}`:r,o=t(a,n);if(!o)return;let c=s.byShortcut[o.protocol],l=s.byDomain[o.hostname.startsWith("www.")?o.hostname.slice(4):o.hostname],u=c||l;if(!u)return;let d=s[c||l],b=null;n[o.protocol]?.auth&&(o.username||o.password)&&(b=`${o.username}${o.password?":"+o.password:""}`);let f=null,p=null,m=null,y=null;try{if(c){let g=o.pathname.startsWith("/")?o.pathname.slice(1):o.pathname,w=g.indexOf("@");w>-1&&(g=g.slice(w+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),o.hash&&(f=decodeURIComponent(o.hash.slice(1))),y="shortcut"}else{if(!d.protocols.includes(o.protocol))return;let g=d.extract(o);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=n[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,b,m,f,y,i]},da}var ma,Hu;function bv(){if(Hu)return ma;Hu=1;let{LRUCache:t}=mv(),e=gv(),r=yv(),i=Nf(),s=new t({max:1e3});class n{constructor(o,c,l,u,d,b,f={}){Object.assign(this,n.#t[o],{type:o,user:c,auth:l,project:u,committish:d,default:b,opts:f})}static#t={byShortcut:{},byDomain:{}};static#r={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(o,c){n.#t[o]=c,n.#t.byDomain[c.domain]=o,n.#t.byShortcut[`${o}:`]=o,n.#r[`${o}:`]={name:o}}static fromUrl(o,c){if(typeof o!="string")return;let l=o+JSON.stringify(c||{});if(!s.has(l)){let u=r(o,c,{gitHosts:n.#t,protocols:n.#r});s.set(l,u?new n(...u):void 0)}return s.get(l)}static parseUrl(o){return i(o)}#e(o,c){if(typeof o!="function")return null;let l={...this,...this.opts,...c};l.path||(l.path=""),l.path.startsWith("/")&&(l.path=l.path.slice(1)),l.noCommittish&&(l.committish=null);let u=o(l);return l.noGitPlus&&u.startsWith("git+")?u.slice(4):u}hash(){return this.committish?`#${this.committish}`:""}ssh(o){return this.#e(this.sshtemplate,o)}sshurl(o){return this.#e(this.sshurltemplate,o)}browse(o,...c){return typeof o!="string"?this.#e(this.browsetemplate,o):typeof c[0]!="string"?this.#e(this.browsetreetemplate,{...c[0],path:o}):this.#e(this.browsetreetemplate,{...c[1],fragment:c[0],path:o})}browseFile(o,...c){return typeof c[0]!="string"?this.#e(this.browseblobtemplate,{...c[0],path:o}):this.#e(this.browseblobtemplate,{...c[1],fragment:c[0],path:o})}docs(o){return this.#e(this.docstemplate,o)}bugs(o){return this.#e(this.bugstemplate,o)}https(o){return this.#e(this.httpstemplate,o)}git(o){return this.#e(this.gittemplate,o)}shortcut(o){return this.#e(this.shortcuttemplate,o)}path(o){return this.#e(this.pathtemplate,o)}tarball(o){return this.#e(this.tarballtemplate,{...o,noCommittish:!1})}file(o,c){return this.#e(this.filetemplate,{...c,path:o})}edit(o,c){return this.#e(this.edittemplate,{...c,path:o})}getDefaultRepresentation(){return this.default}toString(o){return this.default&&typeof this[this.default]=="function"?this[this.default](o):this.sshurl(o)}}for(let[a,o]of Object.entries(e))n.addHost(a,o);return ma=n,ma}var ga,Ku;function vv(){if(Ku)return ga;Ku=1,ga=t;function t(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
30
|
-
`);let r=0;for(;e[r]&&e[r].trim().match(/^(#|$)/);)r++;let i=e.length,s=r+1;for(;s<i&&e[s].trim();)s++;return e.slice(r,s).join(" ").trim()}return ga}var wv={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},xv={web:"url",name:"url"},Ev={server:"start",tests:"test"},_v={topLevel:wv,bugs:xv,script:Ev},ya,Yu;function Sv(){if(Yu)return ya;Yu=1;var t=$f(),e=Tf(),r=Ff(),i=bv(),s=yf,n=["dependencies","devDependencies","optionalDependencies"],a=vv(),o=Da,c=_v,l=h=>h.includes("@")&&h.indexOf("@")<h.lastIndexOf(".");ya={warn:function(){},fixRepositoryField:function(h){if(h.repositories&&(this.warn("repositories"),h.repository=h.repositories[0]),!h.repository)return this.warn("missingRepository");typeof h.repository=="string"&&(h.repository={type:"git",url:h.repository});var v=h.repository.url||"";if(v){var x=i.fromUrl(v);x&&(v=h.repository.url=x.getDefaultRepresentation()==="shortcut"?x.https():x.toString())}v.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",v)},fixTypos:function(h){Object.keys(c.topLevel).forEach(function(v){Object.prototype.hasOwnProperty.call(h,v)&&this.warn("typo",v,c.topLevel[v])},this)},fixScriptsField:function(h){if(h.scripts){if(typeof h.scripts!="object"){this.warn("nonObjectScripts"),delete h.scripts;return}Object.keys(h.scripts).forEach(function(v){typeof h.scripts[v]!="string"?(this.warn("nonStringScript"),delete h.scripts[v]):c.script[v]&&!h.scripts[c.script[v]]&&this.warn("typo",v,c.script[v],"scripts")},this)}},fixFilesField:function(h){var v=h.files;v&&!Array.isArray(v)?(this.warn("nonArrayFiles"),delete h.files):h.files&&(h.files=h.files.filter(function(x){return!x||typeof x!="string"?(this.warn("invalidFilename",x),!1):!0},this))},fixBinField:function(h){if(h.bin&&typeof h.bin=="string"){var v={},x;(x=h.name.match(/^@[^/]+[/](.*)$/))?v[x[1]]=h.bin:v[h.name]=h.bin,h.bin=v}},fixManField:function(h){h.man&&typeof h.man=="string"&&(h.man=[h.man])},fixBundleDependenciesField:function(h){var v="bundledDependencies",x="bundleDependencies";h[v]&&!h[x]&&(h[x]=h[v],delete h[v]),h[x]&&!Array.isArray(h[x])?(this.warn("nonArrayBundleDependencies"),delete h[x]):h[x]&&(h[x]=h[x].filter(function(_){return!_||typeof _!="string"?(this.warn("nonStringBundleDependency",_),!1):(h.dependencies||(h.dependencies={}),Object.prototype.hasOwnProperty.call(h.dependencies,_)||(this.warn("nonDependencyBundleDependency",_),h.dependencies[_]="*"),!0)},this))},fixDependencies:function(h){w(h,this.warn),y(h,this.warn),this.fixBundleDependenciesField(h),["dependencies","devDependencies"].forEach(function(v){if(v in h){if(!h[v]||typeof h[v]!="object"){this.warn("nonObjectDependencies",v),delete h[v];return}Object.keys(h[v]).forEach(function(x){var _=h[v][x];typeof _!="string"&&(this.warn("nonStringDependency",x,JSON.stringify(_)),delete h[v][x]);var A=i.fromUrl(h[v][x]);A&&(h[v][x]=A.toString())},this)}},this)},fixModulesField:function(h){h.modules&&(this.warn("deprecatedModules"),delete h.modules)},fixKeywordsField:function(h){typeof h.keywords=="string"&&(h.keywords=h.keywords.split(/,\s+/)),h.keywords&&!Array.isArray(h.keywords)?(delete h.keywords,this.warn("nonArrayKeywords")):h.keywords&&(h.keywords=h.keywords.filter(function(v){return typeof v!="string"||!v?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(h,v){var x=!v;if(!h.version)return h.version="",!0;if(!t(h.version,x))throw new Error('Invalid version: "'+h.version+'"');return h.version=e(h.version,x),!0},fixPeople:function(h){f(h,p),f(h,m)},fixNameField:function(h,v){typeof v=="boolean"?v={strict:v}:typeof v>"u"&&(v={});var x=v.strict;if(!h.name&&!x){h.name="";return}if(typeof h.name!="string")throw new Error("name field must be a string.");x||(h.name=h.name.trim()),b(h.name,x,v.allowLegacyCase),s.builtinModules.includes(h.name)&&this.warn("conflictingName",h.name)},fixDescriptionField:function(h){h.description&&typeof h.description!="string"&&(this.warn("nonStringDescription"),delete h.description),h.readme&&!h.description&&(h.description=a(h.readme)),h.description===void 0&&delete h.description,h.description||this.warn("missingDescription")},fixReadmeField:function(h){h.readme||(this.warn("missingReadme"),h.readme="ERROR: No README data found!")},fixBugsField:function(h){if(!h.bugs&&h.repository&&h.repository.url){var v=i.fromUrl(h.repository.url);v&&v.bugs()&&(h.bugs={url:v.bugs()})}else if(h.bugs){if(typeof h.bugs=="string")l(h.bugs)?h.bugs={email:h.bugs}:o.parse(h.bugs).protocol?h.bugs={url:h.bugs}:this.warn("nonEmailUrlBugsString");else{E(h.bugs,this.warn);var x=h.bugs;h.bugs={},x.url&&(typeof x.url=="string"&&o.parse(x.url).protocol?h.bugs.url=x.url:this.warn("nonUrlBugsUrlField")),x.email&&(typeof x.email=="string"&&l(x.email)?h.bugs.email=x.email:this.warn("nonEmailBugsEmailField"))}!h.bugs.email&&!h.bugs.url&&(delete h.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(h){if(!h.homepage&&h.repository&&h.repository.url){var v=i.fromUrl(h.repository.url);v&&v.docs()&&(h.homepage=v.docs())}if(h.homepage){if(typeof h.homepage!="string")return this.warn("nonUrlHomepage"),delete h.homepage;o.parse(h.homepage).protocol||(h.homepage="http://"+h.homepage)}},fixLicenseField:function(h){let v=h.license||h.licence;if(!v)return this.warn("missingLicense");if(typeof v!="string"||v.length<1||v.trim()==="")return this.warn("invalidLicense");if(!r(v).validForNewPackages)return this.warn("invalidLicense")}};function u(h){if(h.charAt(0)!=="@")return!1;var v=h.slice(1).split("/");return v.length!==2?!1:v[0]&&v[1]&&v[0]===encodeURIComponent(v[0])&&v[1]===encodeURIComponent(v[1])}function d(h){return!h.match(/[/@\s+%:]/)&&h===encodeURIComponent(h)}function b(h,v,x){if(h.charAt(0)==="."||!(u(h)||d(h))||v&&!x&&h!==h.toLowerCase()||h.toLowerCase()==="node_modules"||h.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(h))}function f(h,v){return h.author&&(h.author=v(h.author)),["maintainers","contributors"].forEach(function(x){Array.isArray(h[x])&&(h[x]=h[x].map(v))}),h}function p(h){if(typeof h=="string")return h;var v=h.name||"",x=h.url||h.web,_=x?" ("+x+")":"",A=h.email||h.mail,C=A?" <"+A+">":"";return v+C+_}function m(h){if(typeof h!="string")return h;var v=h.match(/^([^(<]+)/),x=h.match(/\(([^()]+)\)/),_=h.match(/<([^<>]+)>/),A={};return v&&v[0].trim()&&(A.name=v[0].trim()),_&&(A.email=_[1]),x&&(A.url=x[1]),A}function y(h){var v=h.optionalDependencies;if(v){var x=h.dependencies||{};Object.keys(v).forEach(function(_){x[_]=v[_]}),h.dependencies=x}}function g(h,v,x){if(!h)return{};if(typeof h=="string"&&(h=h.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(h))return h;x("deprecatedArrayDependencies",v);var _={};return h.filter(function(A){return typeof A=="string"}).forEach(function(A){A=A.trim().split(/(:?[@\s><=])/);var C=A.shift(),O=A.join("");O=O.trim(),O=O.replace(/^@/,""),_[C]=O}),_}function w(h,v){n.forEach(function(x){h[x]&&(h[x]=g(h[x],x,v))})}function E(h,v){h&&Object.keys(h).forEach(function(x){c.bugs[x]&&(v("typo",x,c.bugs[x],"bugs"),h[c.bugs[x]]=h[x],delete h[x])})}return ya}var Rv="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Cv="No repository field.",Av="Probably broken git url: %s",Lv="scripts must be an object",Ov="script values must be string commands",$v="Invalid 'files' member",Tv="Invalid filename in 'files' list: %s",Pv="Invalid 'bundleDependencies' list. Must be array of package names",Iv="Invalid bundleDependencies member: %s",Fv="Non-dependency in bundleDependencies: %s",Nv="%s field must be an object",Dv="Invalid dependency: %s %s",Mv="specifying %s as array is deprecated",kv="modules field is deprecated",jv="keywords should be an array of strings",Bv="keywords should be an array of strings",Uv="%s is also the name of a node core module.",Gv="'description' field should be a string",qv="No description",zv="No README data",Wv="No license field.",Vv="Bug string field must be url, email, or {email,url}",Hv="bugs.url field must be a string url. Deleted.",Kv="bugs.email field must be a string email. Deleted.",Yv="Normalized value of bugs field is an empty object. Deleted.",Xv="homepage field must be a string url. Deleted.",Jv="license should be a valid SPDX license expression",Zv="%s should probably be %s.",Qv={repositories:Rv,missingRepository:Cv,brokenGitUrl:Av,nonObjectScripts:Lv,nonStringScript:Ov,nonArrayFiles:$v,invalidFilename:Tv,nonArrayBundleDependencies:Pv,nonStringBundleDependency:Iv,nonDependencyBundleDependency:Fv,nonObjectDependencies:Nv,nonStringDependency:Dv,deprecatedArrayDependencies:Mv,deprecatedModules:kv,nonArrayKeywords:jv,nonStringKeyword:Bv,conflictingName:Uv,nonStringDescription:Gv,missingDescription:qv,missingReadme:zv,missingLicense:Wv,nonEmailUrlBugsString:Vv,nonUrlBugsUrlField:Hv,nonEmailBugsEmailField:Kv,emptyNormalizedBugs:Yv,nonUrlHomepage:Xv,invalidLicense:Jv,typo:Zv},ba,Xu;function ew(){if(Xu)return ba;Xu=1;var t=gf,e=Qv;ba=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return r.apply(null,i);var n=e[s]?e[s]:s+": '%s'";return i.unshift(n),t.format.apply(null,i)};function r(i,s,n){return n&&(i=n+"['"+i+"']",s=n+"['"+s+"']"),t.format(e.typo,i,s)}return ba}var va,Ju;function tw(){if(Ju)return va;Ju=1,va=n;var t=Sv();n.fixer=t;var e=ew(),r=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=r.map(function(o){return a(o)+"Field"});s=s.concat(i);function n(o,c,l){c===!0&&(c=null,l=!0),l||(l=!1),(!c||o.private)&&(c=function(){}),o.scripts&&o.scripts.install==="node-gyp rebuild"&&!o.scripts.preinstall&&(o.gypfile=!0),t.warn=function(){c(e.apply(null,arguments))},s.forEach(function(u){t["fix"+a(u)](o,l)}),o._id=o.name+"@"+o.version}function a(o){return o.charAt(0).toUpperCase()+o.slice(1)}return va}var rw=tw(),iw=Qs(rw);function sw(t){return t instanceof URL?bf(t):t}var nw=t=>Gt.resolve(sw(t)??".","package.json"),ow=(t,e)=>{let r=typeof t=="string"?nv(t):t;return e&&iw(r),r};function aw({cwd:t,normalize:e=!0}={}){let r=vf.readFileSync(nw(t),"utf8");return ow(r,e)}function Df(t){let e=Vb("package.json",t);if(e)return{packageJson:aw({...t,cwd:Gt.dirname(e)}),path:e}}var Gi={},Zu;function cw(){if(Zu)return Gi;Zu=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.LRUCache=void 0;let t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e=new Set,r=typeof process=="object"&&process?process:{},i=(b,f,p,m)=>{typeof r.emitWarning=="function"?r.emitWarning(b,f,p,m):console.error(`[${p}] ${f}: ${b}`)},s=globalThis.AbortController,n=globalThis.AbortSignal;if(typeof s>"u"){n=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(m,y){this._onabort.push(y)}},s=class{constructor(){f()}signal=new n;abort(m){if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let y of this.signal._onabort)y(m);this.signal.onabort?.(m)}}};let b=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",f=()=>{b&&(b=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",f))}}let a=b=>!e.has(b),o=b=>b&&b===Math.floor(b)&&b>0&&isFinite(b),c=b=>o(b)?b<=Math.pow(2,8)?Uint8Array:b<=Math.pow(2,16)?Uint16Array:b<=Math.pow(2,32)?Uint32Array:b<=Number.MAX_SAFE_INTEGER?l:null:null;class l extends Array{constructor(f){super(f),this.fill(0)}}class u{heap;length;static#t=!1;static create(f){let p=c(f);if(!p)return[];u.#t=!0;let m=new u(f,p);return u.#t=!1,m}constructor(f,p){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new p(f),this.length=0}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}}class d{#t;#r;#e;#n;#f;#w;#a;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#c;#i;#l;#o;#d;#g;#y;#p;#C;#x;#E;#_;#S;#v;#P;#A;#h;static unsafeExposeInternals(f){return{starts:f.#_,ttls:f.#S,sizes:f.#E,keyMap:f.#i,keyList:f.#l,valList:f.#o,next:f.#d,prev:f.#g,get head(){return f.#y},get tail(){return f.#p},free:f.#C,isBackgroundFetch:p=>f.#b(p),backgroundFetch:(p,m,y,g)=>f.#D(p,m,y,g),moveToTail:p=>f.#q(p),indexes:p=>f.#T(p),rindexes:p=>f.#F(p),isStale:p=>f.#O(p)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#c}get size(){return this.#s}get fetchMethod(){return this.#w}get memoMethod(){return this.#a}get dispose(){return this.#e}get onInsert(){return this.#n}get disposeAfter(){return this.#f}constructor(f){let{max:p=0,ttl:m,ttlResolution:y=1,ttlAutopurge:g,updateAgeOnGet:w,updateAgeOnHas:E,allowStale:h,dispose:v,onInsert:x,disposeAfter:_,noDisposeOnSet:A,noUpdateTTL:C,maxSize:O=0,maxEntrySize:F=0,sizeCalculation:M,fetchMethod:I,memoMethod:Y,noDeleteOnFetchRejection:Z,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:V,allowStaleOnFetchAbort:se,ignoreFetchAbort:ee,perf:we}=f;if(we!==void 0&&typeof we?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=we??t,p!==0&&!o(p))throw new TypeError("max option must be a nonnegative integer");let xe=p?c(p):Array;if(!xe)throw new Error("invalid max value: "+p);if(this.#t=p,this.#r=O,this.maxEntrySize=F||this.#r,this.sizeCalculation=M,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Y!==void 0&&typeof Y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#a=Y,I!==void 0&&typeof I!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#w=I,this.#P=!!I,this.#i=new Map,this.#l=new Array(p).fill(void 0),this.#o=new Array(p).fill(void 0),this.#d=new xe(p),this.#g=new xe(p),this.#y=0,this.#p=0,this.#C=u.create(p),this.#s=0,this.#c=0,typeof v=="function"&&(this.#e=v),typeof x=="function"&&(this.#n=x),typeof _=="function"?(this.#f=_,this.#x=[]):(this.#f=void 0,this.#x=void 0),this.#v=!!this.#e,this.#h=!!this.#n,this.#A=!!this.#f,this.noDisposeOnSet=!!A,this.noUpdateTTL=!!C,this.noDeleteOnFetchRejection=!!Z,this.allowStaleOnFetchRejection=!!V,this.allowStaleOnFetchAbort=!!se,this.ignoreFetchAbort=!!ee,this.maxEntrySize!==0){if(this.#r!==0&&!o(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!w,this.updateAgeOnHas=!!E,this.ttlResolution=o(y)||y===0?y:1,this.ttlAutopurge=!!g,this.ttl=m||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let Oe="LRU_CACHE_UNBOUNDED";a(Oe)&&(e.add(Oe),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Oe,d))}}getRemainingTTL(f){return this.#i.has(f)?1/0:0}#M(){let f=new l(this.#t),p=new l(this.#t);this.#S=f,this.#_=p,this.#N=(g,w,E=this.#u.now())=>{if(p[g]=w!==0?E:0,f[g]=w,w!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#O(g)&&this.#U(this.#l[g],"expire")},w+1);h.unref&&h.unref()}},this.#R=g=>{p[g]=f[g]!==0?this.#u.now():0},this.#I=(g,w)=>{if(f[w]){let E=f[w],h=p[w];if(!E||!h)return;g.ttl=E,g.start=h,g.now=m||y();let v=g.now-h;g.remainingTTL=E-v}};let m=0,y=()=>{let g=this.#u.now();if(this.ttlResolution>0){m=g;let w=setTimeout(()=>m=0,this.ttlResolution);w.unref&&w.unref()}return g};this.getRemainingTTL=g=>{let w=this.#i.get(g);if(w===void 0)return 0;let E=f[w],h=p[w];if(!E||!h)return 1/0;let v=(m||y())-h;return E-v},this.#O=g=>{let w=p[g],E=f[g];return!!E&&!!w&&(m||y())-w>E}}#R=()=>{};#I=()=>{};#N=()=>{};#O=()=>!1;#B(){let f=new l(this.#t);this.#c=0,this.#E=f,this.#L=p=>{this.#c-=f[p],f[p]=0},this.#k=(p,m,y,g)=>{if(this.#b(m))return 0;if(!o(y))if(g){if(typeof g!="function")throw new TypeError("sizeCalculation must be a function");if(y=g(m,p),!o(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return y},this.#$=(p,m,y)=>{if(f[p]=m,this.#r){let g=this.#r-f[p];for(;this.#c>g;)this.#j(!0)}this.#c+=f[p],y&&(y.entrySize=m,y.totalCalculatedSize=this.#c)}}#L=f=>{};#$=(f,p,m)=>{};#k=(f,p,m,y)=>{if(m||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:f=this.allowStale}={}){if(this.#s)for(let p=this.#p;!(!this.#m(p)||((f||!this.#O(p))&&(yield p),p===this.#y));)p=this.#g[p]}*#F({allowStale:f=this.allowStale}={}){if(this.#s)for(let p=this.#y;!(!this.#m(p)||((f||!this.#O(p))&&(yield p),p===this.#p));)p=this.#d[p]}#m(f){return f!==void 0&&this.#i.get(this.#l[f])===f}*entries(){for(let f of this.#T())this.#o[f]!==void 0&&this.#l[f]!==void 0&&!this.#b(this.#o[f])&&(yield[this.#l[f],this.#o[f]])}*rentries(){for(let f of this.#F())this.#o[f]!==void 0&&this.#l[f]!==void 0&&!this.#b(this.#o[f])&&(yield[this.#l[f],this.#o[f]])}*keys(){for(let f of this.#T()){let p=this.#l[f];p!==void 0&&!this.#b(this.#o[f])&&(yield p)}}*rkeys(){for(let f of this.#F()){let p=this.#l[f];p!==void 0&&!this.#b(this.#o[f])&&(yield p)}}*values(){for(let f of this.#T())this.#o[f]!==void 0&&!this.#b(this.#o[f])&&(yield this.#o[f])}*rvalues(){for(let f of this.#F())this.#o[f]!==void 0&&!this.#b(this.#o[f])&&(yield this.#o[f])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(f,p={}){for(let m of this.#T()){let y=this.#o[m],g=this.#b(y)?y.__staleWhileFetching:y;if(g!==void 0&&f(g,this.#l[m],this))return this.get(this.#l[m],p)}}forEach(f,p=this){for(let m of this.#T()){let y=this.#o[m],g=this.#b(y)?y.__staleWhileFetching:y;g!==void 0&&f.call(p,g,this.#l[m],this)}}rforEach(f,p=this){for(let m of this.#F()){let y=this.#o[m],g=this.#b(y)?y.__staleWhileFetching:y;g!==void 0&&f.call(p,g,this.#l[m],this)}}purgeStale(){let f=!1;for(let p of this.#F({allowStale:!0}))this.#O(p)&&(this.#U(this.#l[p],"expire"),f=!0);return f}info(f){let p=this.#i.get(f);if(p===void 0)return;let m=this.#o[p],y=this.#b(m)?m.__staleWhileFetching:m;if(y===void 0)return;let g={value:y};if(this.#S&&this.#_){let w=this.#S[p],E=this.#_[p];if(w&&E){let h=w-(this.#u.now()-E);g.ttl=h,g.start=Date.now()}}return this.#E&&(g.size=this.#E[p]),g}dump(){let f=[];for(let p of this.#T({allowStale:!0})){let m=this.#l[p],y=this.#o[p],g=this.#b(y)?y.__staleWhileFetching:y;if(g===void 0||m===void 0)continue;let w={value:g};if(this.#S&&this.#_){w.ttl=this.#S[p];let E=this.#u.now()-this.#_[p];w.start=Math.floor(Date.now()-E)}this.#E&&(w.size=this.#E[p]),f.unshift([m,w])}return f}load(f){this.clear();for(let[p,m]of f){if(m.start){let y=Date.now()-m.start;m.start=this.#u.now()-y}this.set(p,m.value,m)}}set(f,p,m={}){if(p===void 0)return this.delete(f),this;let{ttl:y=this.ttl,start:g,noDisposeOnSet:w=this.noDisposeOnSet,sizeCalculation:E=this.sizeCalculation,status:h}=m,{noUpdateTTL:v=this.noUpdateTTL}=m,x=this.#k(f,p,m.size||0,E);if(this.maxEntrySize&&x>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#U(f,"set"),this;let _=this.#s===0?void 0:this.#i.get(f);if(_===void 0)_=this.#s===0?this.#p:this.#C.length!==0?this.#C.pop():this.#s===this.#t?this.#j(!1):this.#s,this.#l[_]=f,this.#o[_]=p,this.#i.set(f,_),this.#d[this.#p]=_,this.#g[_]=this.#p,this.#p=_,this.#s++,this.#$(_,x,h),h&&(h.set="add"),v=!1,this.#h&&this.#n?.(p,f,"add");else{this.#q(_);let A=this.#o[_];if(p!==A){if(this.#P&&this.#b(A)){A.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:C}=A;C!==void 0&&!w&&(this.#v&&this.#e?.(C,f,"set"),this.#A&&this.#x?.push([C,f,"set"]))}else w||(this.#v&&this.#e?.(A,f,"set"),this.#A&&this.#x?.push([A,f,"set"]));if(this.#L(_),this.#$(_,x,h),this.#o[_]=p,h){h.set="replace";let C=A&&this.#b(A)?A.__staleWhileFetching:A;C!==void 0&&(h.oldValue=C)}}else h&&(h.set="update");this.#h&&this.onInsert?.(p,f,p===A?"update":"replace")}if(y!==0&&!this.#S&&this.#M(),this.#S&&(v||this.#N(_,y,g),h&&this.#I(h,_)),!w&&this.#A&&this.#x){let A=this.#x,C;for(;C=A?.shift();)this.#f?.(...C)}return this}pop(){try{for(;this.#s;){let f=this.#o[this.#y];if(this.#j(!0),this.#b(f)){if(f.__staleWhileFetching)return f.__staleWhileFetching}else if(f!==void 0)return f}}finally{if(this.#A&&this.#x){let f=this.#x,p;for(;p=f?.shift();)this.#f?.(...p)}}}#j(f){let p=this.#y,m=this.#l[p],y=this.#o[p];return this.#P&&this.#b(y)?y.__abortController.abort(new Error("evicted")):(this.#v||this.#A)&&(this.#v&&this.#e?.(y,m,"evict"),this.#A&&this.#x?.push([y,m,"evict"])),this.#L(p),f&&(this.#l[p]=void 0,this.#o[p]=void 0,this.#C.push(p)),this.#s===1?(this.#y=this.#p=0,this.#C.length=0):this.#y=this.#d[p],this.#i.delete(m),this.#s--,p}has(f,p={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=p,g=this.#i.get(f);if(g!==void 0){let w=this.#o[g];if(this.#b(w)&&w.__staleWhileFetching===void 0)return!1;if(this.#O(g))y&&(y.has="stale",this.#I(y,g));else return m&&this.#R(g),y&&(y.has="hit",this.#I(y,g)),!0}else y&&(y.has="miss");return!1}peek(f,p={}){let{allowStale:m=this.allowStale}=p,y=this.#i.get(f);if(y===void 0||!m&&this.#O(y))return;let g=this.#o[y];return this.#b(g)?g.__staleWhileFetching:g}#D(f,p,m,y){let g=p===void 0?void 0:this.#o[p];if(this.#b(g))return g;let w=new s,{signal:E}=m;E?.addEventListener("abort",()=>w.abort(E.reason),{signal:w.signal});let h={signal:w.signal,options:m,context:y},v=(F,M=!1)=>{let{aborted:I}=w.signal,Y=m.ignoreFetchAbort&&F!==void 0;if(m.status&&(I&&!M?(m.status.fetchAborted=!0,m.status.fetchError=w.signal.reason,Y&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),I&&!Y&&!M)return _(w.signal.reason);let Z=C;return this.#o[p]===C&&(F===void 0?Z.__staleWhileFetching!==void 0?this.#o[p]=Z.__staleWhileFetching:this.#U(f,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(f,F,h.options))),F},x=F=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=F),_(F)),_=F=>{let{aborted:M}=w.signal,I=M&&m.allowStaleOnFetchAbort,Y=I||m.allowStaleOnFetchRejection,Z=Y||m.noDeleteOnFetchRejection,G=C;if(this.#o[p]===C&&(!Z||G.__staleWhileFetching===void 0?this.#U(f,"fetch"):I||(this.#o[p]=G.__staleWhileFetching)),Y)return m.status&&G.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw F},A=(F,M)=>{let I=this.#w?.(f,g,h);I&&I instanceof Promise&&I.then(Y=>F(Y===void 0?void 0:Y),M),w.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(F(void 0),m.allowStaleOnFetchAbort&&(F=Y=>v(Y,!0)))})};m.status&&(m.status.fetchDispatched=!0);let C=new Promise(A).then(v,x),O=Object.assign(C,{__abortController:w,__staleWhileFetching:g,__returned:void 0});return p===void 0?(this.set(f,O,{...h.options,status:void 0}),p=this.#i.get(f)):this.#o[p]=O,O}#b(f){if(!this.#P)return!1;let p=f;return!!p&&p instanceof Promise&&p.hasOwnProperty("__staleWhileFetching")&&p.__abortController instanceof s}async fetch(f,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:g=this.noDeleteOnStaleGet,ttl:w=this.ttl,noDisposeOnSet:E=this.noDisposeOnSet,size:h=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:x=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:A=this.allowStaleOnFetchRejection,ignoreFetchAbort:C=this.ignoreFetchAbort,allowStaleOnFetchAbort:O=this.allowStaleOnFetchAbort,context:F,forceRefresh:M=!1,status:I,signal:Y}=p;if(!this.#P)return I&&(I.fetch="get"),this.get(f,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:g,status:I});let Z={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:g,ttl:w,noDisposeOnSet:E,size:h,sizeCalculation:v,noUpdateTTL:x,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:O,ignoreFetchAbort:C,status:I,signal:Y},G=this.#i.get(f);if(G===void 0){I&&(I.fetch="miss");let V=this.#D(f,G,Z,F);return V.__returned=V}else{let V=this.#o[G];if(this.#b(V)){let Oe=m&&V.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",Oe&&(I.returnedStale=!0)),Oe?V.__staleWhileFetching:V.__returned=V}let se=this.#O(G);if(!M&&!se)return I&&(I.fetch="hit"),this.#q(G),y&&this.#R(G),I&&this.#I(I,G),V;let ee=this.#D(f,G,Z,F),xe=ee.__staleWhileFetching!==void 0&&m;return I&&(I.fetch=se?"stale":"refresh",xe&&se&&(I.returnedStale=!0)),xe?ee.__staleWhileFetching:ee.__returned=ee}}async forceFetch(f,p={}){let m=await this.fetch(f,p);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(f,p={}){let m=this.#a;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:g,...w}=p,E=this.get(f,w);if(!g&&E!==void 0)return E;let h=m(f,E,{options:w,context:y});return this.set(f,h,w),h}get(f,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:g=this.noDeleteOnStaleGet,status:w}=p,E=this.#i.get(f);if(E!==void 0){let h=this.#o[E],v=this.#b(h);return w&&this.#I(w,E),this.#O(E)?(w&&(w.get="stale"),v?(w&&m&&h.__staleWhileFetching!==void 0&&(w.returnedStale=!0),m?h.__staleWhileFetching:void 0):(g||this.#U(f,"expire"),w&&m&&(w.returnedStale=!0),m?h:void 0)):(w&&(w.get="hit"),v?h.__staleWhileFetching:(this.#q(E),y&&this.#R(E),h))}else w&&(w.get="miss")}#G(f,p){this.#g[p]=f,this.#d[f]=p}#q(f){f!==this.#p&&(f===this.#y?this.#y=this.#d[f]:this.#G(this.#g[f],this.#d[f]),this.#G(this.#p,f),this.#p=f)}delete(f){return this.#U(f,"delete")}#U(f,p){let m=!1;if(this.#s!==0){let y=this.#i.get(f);if(y!==void 0)if(m=!0,this.#s===1)this.#z(p);else{this.#L(y);let g=this.#o[y];if(this.#b(g)?g.__abortController.abort(new Error("deleted")):(this.#v||this.#A)&&(this.#v&&this.#e?.(g,f,p),this.#A&&this.#x?.push([g,f,p])),this.#i.delete(f),this.#l[y]=void 0,this.#o[y]=void 0,y===this.#p)this.#p=this.#g[y];else if(y===this.#y)this.#y=this.#d[y];else{let w=this.#g[y];this.#d[w]=this.#d[y];let E=this.#d[y];this.#g[E]=this.#g[y]}this.#s--,this.#C.push(y)}}if(this.#A&&this.#x?.length){let y=this.#x,g;for(;g=y?.shift();)this.#f?.(...g)}return m}clear(){return this.#z("delete")}#z(f){for(let p of this.#F({allowStale:!0})){let m=this.#o[p];if(this.#b(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#l[p];this.#v&&this.#e?.(m,y,f),this.#A&&this.#x?.push([m,y,f])}}if(this.#i.clear(),this.#o.fill(void 0),this.#l.fill(void 0),this.#S&&this.#_&&(this.#S.fill(0),this.#_.fill(0)),this.#E&&this.#E.fill(0),this.#y=0,this.#p=0,this.#C.length=0,this.#c=0,this.#s=0,this.#A&&this.#x){let p=this.#x,m;for(;m=p?.shift();)this.#f?.(...m)}}}return Gi.LRUCache=d,Gi}var wa,Qu;function lw(){if(Qu)return wa;Qu=1;let t=(...n)=>n.every(a=>a)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",r=n=>n.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:n,user:a,project:o,committish:c})=>`git@${n}:${a}/${o}.git${t("#",c)}`,sshurltemplate:({domain:n,user:a,project:o,committish:c})=>`git+ssh://git@${n}/${a}/${o}.git${t("#",c)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l,path:u})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u)}`,browsetemplate:({domain:n,user:a,project:o,committish:c,treepath:l})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c))}`,browsetreetemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,fragment:d,hashformat:b})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",b(d||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:d,hashformat:b})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",b(d||""))}`,docstemplate:({domain:n,user:a,project:o,treepath:c,committish:l})=>`https://${n}/${a}/${o}${t("/",c,"/",e(l))}#readme`,httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/raw/${e(c||"HEAD")}/${l}`,shortcuttemplate:({type:n,user:a,project:o,committish:c})=>`${n}:${a}/${o}${t("#",c)}`,pathtemplate:({user:n,project:a,committish:o})=>`${n}/${a}${t("#",o)}`,bugstemplate:({domain:n,user:a,project:o})=>`https://${n}/${a}/${o}/issues`,hashformat:r},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:a,project:o,committish:c,path:l})=>`https://${t(n,"@")}raw.githubusercontent.com/${a}/${o}/${e(c||"HEAD")}/${l}`,gittemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://codeload.${n}/${a}/${o}/tar.gz/${e(c||"HEAD")}`,extract:n=>{let[,a,o,c,l]=n.pathname.split("/",5);if(!(c&&c!=="tree")&&(c||(l=n.hash.slice(1)),o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:l}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,editpath:d})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,d)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/get/${e(c||"HEAD")}.tar.gz`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["get"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/repository/archive.tar.gz?ref=${e(c||"HEAD")}`,extract:n=>{let a=n.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;let o=a.split("/"),c=o.pop();c.endsWith(".git")&&(c=c.slice(0,-4));let l=o.join("/");if(!(!l||!c))return{user:l,project:c,committish:n.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:a,committish:o})=>`git@${n}:${a}.git${t("#",o)}`,sshurltemplate:({domain:n,project:a,committish:o})=>`git+ssh://git@${n}/${a}.git${t("#",o)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l})=>`https://${n}/${a}/${o}${t("/",e(c))}/${l}`,browsetemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,browsetreetemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,browseblobtemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,docstemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,httpstemplate:({domain:n,project:a,committish:o})=>`git+https://${n}/${a}.git${t("#",o)}`,filetemplate:({user:n,project:a,committish:o,path:c})=>`https://gist.githubusercontent.com/${n}/${a}/raw${t("/",e(o))}/${c}`,shortcuttemplate:({type:n,project:a,committish:o})=>`${n}:${a}${t("#",o)}`,pathtemplate:({project:n,committish:a})=>`${n}${t("#",a)}`,bugstemplate:({domain:n,project:a})=>`https://${n}/${a}`,gittemplate:({domain:n,project:a,committish:o})=>`git://${n}/${a}.git${t("#",o)}`,tarballtemplate:({project:n,committish:a})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(a||"HEAD")}`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(c!=="raw"){if(!o){if(!a)return;o=a,a=null}return o.endsWith(".git")&&(o=o.slice(0,-4)),{user:a,project:o,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+r(n)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/blob/${e(c)||"HEAD"}/${l}`,httpstemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}.git${t("#",c)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/archive/${e(c)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["archive"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}};for(let[n,a]of Object.entries(s))s[n]=Object.assign({},i,a);return wa=s,wa}var xa,ef;function Mf(){if(ef)return xa;ef=1;let t=Da,e=(n,a,o)=>{let c=n.indexOf(o);return n.lastIndexOf(a,c>-1?c:1/0)},r=n=>{try{return new t.URL(n)}catch{}},i=(n,a)=>{let o=n.indexOf(":"),c=n.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(a,c))return n;let l=n.indexOf("@");return l>-1?l>o?`git+ssh://${n}`:n:n.indexOf("//")===o+1?n:`${n.slice(0,o+1)}//${n.slice(o+1)}`},s=n=>{let a=e(n,"@","#"),o=e(n,":","#");return o>a&&(n=n.slice(0,o)+"/"+n.slice(o+1)),e(n,":","#")===-1&&n.indexOf("//")===-1&&(n=`git+ssh://${n}`),n};return xa=(n,a)=>{let o=a?i(n,a):n;return r(o)||r(s(o))},xa}var Ea,tf;function uw(){if(tf)return Ea;tf=1;let t=Mf(),e=r=>{let i=r.indexOf("#"),s=r.indexOf("/"),n=r.indexOf("/",s+1),a=r.indexOf(":"),o=/\s/.exec(r),c=r.indexOf("@"),l=!o||i>-1&&o.index>i,u=c===-1||i>-1&&c>i,d=a===-1||i>-1&&a>i,b=n===-1||i>-1&&n>i,f=s>0,p=i>-1?r[i-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&f&&p&&m&&u&&d&&b};return Ea=(r,i,{gitHosts:s,protocols:n})=>{if(!r)return;let a=e(r)?`github:${r}`:r,o=t(a,n);if(!o)return;let c=s.byShortcut[o.protocol],l=s.byDomain[o.hostname.startsWith("www.")?o.hostname.slice(4):o.hostname],u=c||l;if(!u)return;let d=s[c||l],b=null;n[o.protocol]?.auth&&(o.username||o.password)&&(b=`${o.username}${o.password?":"+o.password:""}`);let f=null,p=null,m=null,y=null;try{if(c){let g=o.pathname.startsWith("/")?o.pathname.slice(1):o.pathname,w=g.indexOf("@");w>-1&&(g=g.slice(w+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),o.hash&&(f=decodeURIComponent(o.hash.slice(1))),y="shortcut"}else{if(!d.protocols.includes(o.protocol))return;let g=d.extract(o);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=n[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,b,m,f,y,i]},Ea}var _a,rf;function fw(){if(rf)return _a;rf=1;let{LRUCache:t}=cw(),e=lw(),r=uw(),i=Mf(),s=new t({max:1e3});function n(o){try{let{protocol:c,hostname:l,pathname:u}=new URL(o);if(!l)return null;let d=/(?:git\+)http:$/.test(c)?"http:":"https:",b=u.replace(/\.git$/,"");return`${d}//${l}${b}`}catch{return null}}class a{constructor(c,l,u,d,b,f,p={}){Object.assign(this,a.#t[c],{type:c,user:l,auth:u,project:d,committish:b,default:f,opts:p})}static#t={byShortcut:{},byDomain:{}};static#r={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(c,l){a.#t[c]=l,a.#t.byDomain[l.domain]=c,a.#t.byShortcut[`${c}:`]=c,a.#r[`${c}:`]={name:c}}static fromUrl(c,l){if(typeof c!="string")return;let u=c+JSON.stringify(l||{});if(!s.has(u)){let d=r(c,l,{gitHosts:a.#t,protocols:a.#r});s.set(u,d?new a(...d):void 0)}return s.get(u)}static fromManifest(c,l={}){if(!c||typeof c!="object")return;let u=c.repository,d=u&&(typeof u=="string"?u:typeof u=="object"&&typeof u.url=="string"?u.url:null);if(!d)throw new Error("no repository");let b=d&&a.fromUrl(d.replace(/^git\+/,""),l)||null;if(b)return b;let f=n(d);return a.fromUrl(f,l)||f}static parseUrl(c){return i(c)}#e(c,l){if(typeof c!="function")return null;let u={...this,...this.opts,...l};u.path||(u.path=""),u.path.startsWith("/")&&(u.path=u.path.slice(1)),u.noCommittish&&(u.committish=null);let d=c(u);return u.noGitPlus&&d.startsWith("git+")?d.slice(4):d}hash(){return this.committish?`#${this.committish}`:""}ssh(c){return this.#e(this.sshtemplate,c)}sshurl(c){return this.#e(this.sshurltemplate,c)}browse(c,...l){return typeof c!="string"?this.#e(this.browsetemplate,c):typeof l[0]!="string"?this.#e(this.browsetreetemplate,{...l[0],path:c}):this.#e(this.browsetreetemplate,{...l[1],fragment:l[0],path:c})}browseFile(c,...l){return typeof l[0]!="string"?this.#e(this.browseblobtemplate,{...l[0],path:c}):this.#e(this.browseblobtemplate,{...l[1],fragment:l[0],path:c})}docs(c){return this.#e(this.docstemplate,c)}bugs(c){return this.#e(this.bugstemplate,c)}https(c){return this.#e(this.httpstemplate,c)}git(c){return this.#e(this.gittemplate,c)}shortcut(c){return this.#e(this.shortcuttemplate,c)}path(c){return this.#e(this.pathtemplate,c)}tarball(c){return this.#e(this.tarballtemplate,{...c,noCommittish:!1})}file(c,l){return this.#e(this.filetemplate,{...l,path:c})}edit(c,l){return this.#e(this.edittemplate,{...l,path:c})}getDefaultRepresentation(){return this.default}toString(c){return this.default&&typeof this[this.default]=="function"?this[this.default](c):this.sshurl(c)}}for(let[o,c]of Object.entries(e))a.addHost(o,c);return _a=a,_a}var Sa,sf;function hw(){if(sf)return Sa;sf=1,Sa=t;function t(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
31
|
-
`);let r=0;for(;e[r]&&e[r].trim().match(/^(#|$)/);)r++;let i=e.length,s=r+1;for(;s<i&&e[s].trim();)s++;return e.slice(r,s).join(" ").trim()}return Sa}var pw={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},dw={web:"url",name:"url"},mw={server:"start",tests:"test"},gw={topLevel:pw,bugs:dw,script:mw},Ra,nf;function yw(){if(nf)return Ra;nf=1;var{URL:t}=Lb,e=$f(),r=Tf(),i=Ff(),s=fw(),{isBuiltin:n}=yf,a=["dependencies","devDependencies","optionalDependencies"],o=hw(),c=gw,l=h=>h.includes("@")&&h.indexOf("@")<h.lastIndexOf(".");Ra={warn:function(){},fixRepositoryField:function(h){if(h.repositories&&(this.warn("repositories"),h.repository=h.repositories[0]),!h.repository)return this.warn("missingRepository");typeof h.repository=="string"&&(h.repository={type:"git",url:h.repository});var v=h.repository.url||"";if(v){var x=s.fromUrl(v);x&&(v=h.repository.url=x.getDefaultRepresentation()==="shortcut"?x.https():x.toString())}v.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",v)},fixTypos:function(h){Object.keys(c.topLevel).forEach(function(v){Object.prototype.hasOwnProperty.call(h,v)&&this.warn("typo",v,c.topLevel[v])},this)},fixScriptsField:function(h){if(h.scripts){if(typeof h.scripts!="object"){this.warn("nonObjectScripts"),delete h.scripts;return}Object.keys(h.scripts).forEach(function(v){typeof h.scripts[v]!="string"?(this.warn("nonStringScript"),delete h.scripts[v]):c.script[v]&&!h.scripts[c.script[v]]&&this.warn("typo",v,c.script[v],"scripts")},this)}},fixFilesField:function(h){var v=h.files;v&&!Array.isArray(v)?(this.warn("nonArrayFiles"),delete h.files):h.files&&(h.files=h.files.filter(function(x){return!x||typeof x!="string"?(this.warn("invalidFilename",x),!1):!0},this))},fixBinField:function(h){if(h.bin&&typeof h.bin=="string"){var v={},x;(x=h.name.match(/^@[^/]+[/](.*)$/))?v[x[1]]=h.bin:v[h.name]=h.bin,h.bin=v}},fixManField:function(h){h.man&&typeof h.man=="string"&&(h.man=[h.man])},fixBundleDependenciesField:function(h){var v="bundledDependencies",x="bundleDependencies";h[v]&&!h[x]&&(h[x]=h[v],delete h[v]),h[x]&&!Array.isArray(h[x])?(this.warn("nonArrayBundleDependencies"),delete h[x]):h[x]&&(h[x]=h[x].filter(function(_){return!_||typeof _!="string"?(this.warn("nonStringBundleDependency",_),!1):(h.dependencies||(h.dependencies={}),Object.prototype.hasOwnProperty.call(h.dependencies,_)||(this.warn("nonDependencyBundleDependency",_),h.dependencies[_]="*"),!0)},this))},fixDependencies:function(h){w(h,this.warn),y(h,this.warn),this.fixBundleDependenciesField(h),["dependencies","devDependencies"].forEach(function(v){if(v in h){if(!h[v]||typeof h[v]!="object"){this.warn("nonObjectDependencies",v),delete h[v];return}Object.keys(h[v]).forEach(function(x){var _=h[v][x];typeof _!="string"&&(this.warn("nonStringDependency",x,JSON.stringify(_)),delete h[v][x]);var A=s.fromUrl(h[v][x]);A&&(h[v][x]=A.toString())},this)}},this)},fixModulesField:function(h){h.modules&&(this.warn("deprecatedModules"),delete h.modules)},fixKeywordsField:function(h){typeof h.keywords=="string"&&(h.keywords=h.keywords.split(/,\s+/)),h.keywords&&!Array.isArray(h.keywords)?(delete h.keywords,this.warn("nonArrayKeywords")):h.keywords&&(h.keywords=h.keywords.filter(function(v){return typeof v!="string"||!v?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(h,v){var x=!v;if(!h.version)return h.version="",!0;if(!e(h.version,x))throw new Error('Invalid version: "'+h.version+'"');return h.version=r(h.version,x),!0},fixPeople:function(h){f(h,p),f(h,m)},fixNameField:function(h,v){typeof v=="boolean"?v={strict:v}:typeof v>"u"&&(v={});var x=v.strict;if(!h.name&&!x){h.name="";return}if(typeof h.name!="string")throw new Error("name field must be a string.");x||(h.name=h.name.trim()),b(h.name,x,v.allowLegacyCase),n(h.name)&&this.warn("conflictingName",h.name)},fixDescriptionField:function(h){h.description&&typeof h.description!="string"&&(this.warn("nonStringDescription"),delete h.description),h.readme&&!h.description&&(h.description=o(h.readme)),h.description===void 0&&delete h.description,h.description||this.warn("missingDescription")},fixReadmeField:function(h){h.readme||(this.warn("missingReadme"),h.readme="ERROR: No README data found!")},fixBugsField:function(h){if(!h.bugs&&h.repository&&h.repository.url){var v=s.fromUrl(h.repository.url);v&&v.bugs()&&(h.bugs={url:v.bugs()})}else if(h.bugs){if(typeof h.bugs=="string")l(h.bugs)?h.bugs={email:h.bugs}:t.canParse(h.bugs)?h.bugs={url:h.bugs}:this.warn("nonEmailUrlBugsString");else{E(h.bugs,this.warn);var x=h.bugs;h.bugs={},x.url&&(t.canParse(x.url)?h.bugs.url=x.url:this.warn("nonUrlBugsUrlField")),x.email&&(typeof x.email=="string"&&l(x.email)?h.bugs.email=x.email:this.warn("nonEmailBugsEmailField"))}!h.bugs.email&&!h.bugs.url&&(delete h.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(h){if(!h.homepage&&h.repository&&h.repository.url){var v=s.fromUrl(h.repository.url);v&&v.docs()&&(h.homepage=v.docs())}if(h.homepage){if(typeof h.homepage!="string")return this.warn("nonUrlHomepage"),delete h.homepage;t.canParse(h.homepage)||(h.homepage="http://"+h.homepage)}},fixLicenseField:function(h){let v=h.license||h.licence;if(!v)return this.warn("missingLicense");if(typeof v!="string"||v.length<1||v.trim()==="")return this.warn("invalidLicense");if(!i(v).validForNewPackages)return this.warn("invalidLicense")}};function u(h){if(h.charAt(0)!=="@")return!1;var v=h.slice(1).split("/");return v.length!==2?!1:v[0]&&v[1]&&v[0]===encodeURIComponent(v[0])&&v[1]===encodeURIComponent(v[1])}function d(h){return!h.match(/[/@\s+%:]/)&&h===encodeURIComponent(h)}function b(h,v,x){if(h.charAt(0)==="."||!(u(h)||d(h))||v&&!x&&h!==h.toLowerCase()||h.toLowerCase()==="node_modules"||h.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(h))}function f(h,v){return h.author&&(h.author=v(h.author)),["maintainers","contributors"].forEach(function(x){Array.isArray(h[x])&&(h[x]=h[x].map(v))}),h}function p(h){if(typeof h=="string")return h;var v=h.name||"",x=h.url||h.web,_=x?" ("+x+")":"",A=h.email||h.mail,C=A?" <"+A+">":"";return v+C+_}function m(h){if(typeof h!="string")return h;var v=h.match(/^([^(<]+)/),x=h.match(/\(([^()]+)\)/),_=h.match(/<([^<>]+)>/),A={};return v&&v[0].trim()&&(A.name=v[0].trim()),_&&(A.email=_[1]),x&&(A.url=x[1]),A}function y(h){var v=h.optionalDependencies;if(v){var x=h.dependencies||{};Object.keys(v).forEach(function(_){x[_]=v[_]}),h.dependencies=x}}function g(h,v,x){if(!h)return{};if(typeof h=="string"&&(h=h.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(h))return h;x("deprecatedArrayDependencies",v);var _={};return h.filter(function(A){return typeof A=="string"}).forEach(function(A){A=A.trim().split(/(:?[@\s><=])/);var C=A.shift(),O=A.join("");O=O.trim(),O=O.replace(/^@/,""),_[C]=O}),_}function w(h,v){a.forEach(function(x){h[x]&&(h[x]=g(h[x],x,v))})}function E(h,v){h&&Object.keys(h).forEach(function(x){c.bugs[x]&&(v("typo",x,c.bugs[x],"bugs"),h[c.bugs[x]]=h[x],delete h[x])})}return Ra}var bw="'repositories' (plural) Not supported. Please pick one as the 'repository' field",vw="No repository field.",ww="Probably broken git url: %s",xw="scripts must be an object",Ew="script values must be string commands",_w="Invalid 'files' member",Sw="Invalid filename in 'files' list: %s",Rw="Invalid 'bundleDependencies' list. Must be array of package names",Cw="Invalid bundleDependencies member: %s",Aw="Non-dependency in bundleDependencies: %s",Lw="%s field must be an object",Ow="Invalid dependency: %s %s",$w="specifying %s as array is deprecated",Tw="modules field is deprecated",Pw="keywords should be an array of strings",Iw="keywords should be an array of strings",Fw="%s is also the name of a node core module.",Nw="'description' field should be a string",Dw="No description",Mw="No README data",kw="No license field.",jw="Bug string field must be url, email, or {email,url}",Bw="bugs.url field must be a string url. Deleted.",Uw="bugs.email field must be a string email. Deleted.",Gw="Normalized value of bugs field is an empty object. Deleted.",qw="homepage field must be a string url. Deleted.",zw="license should be a valid SPDX license expression",Ww="%s should probably be %s.",Vw={repositories:bw,missingRepository:vw,brokenGitUrl:ww,nonObjectScripts:xw,nonStringScript:Ew,nonArrayFiles:_w,invalidFilename:Sw,nonArrayBundleDependencies:Rw,nonStringBundleDependency:Cw,nonDependencyBundleDependency:Aw,nonObjectDependencies:Lw,nonStringDependency:Ow,deprecatedArrayDependencies:$w,deprecatedModules:Tw,nonArrayKeywords:Pw,nonStringKeyword:Iw,conflictingName:Fw,nonStringDescription:Nw,missingDescription:Dw,missingReadme:Mw,missingLicense:kw,nonEmailUrlBugsString:jw,nonUrlBugsUrlField:Bw,nonEmailBugsEmailField:Uw,emptyNormalizedBugs:Gw,nonUrlHomepage:qw,invalidLicense:zw,typo:Ww},Ca,of;function Hw(){if(of)return Ca;of=1;var t=gf,e=Vw;Ca=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return r.apply(null,i);var n=e[s]?e[s]:s+": '%s'";return i.unshift(n),t.format.apply(null,i)};function r(i,s,n){return n&&(i=n+"['"+i+"']",s=n+"['"+s+"']"),t.format(e.typo,i,s)}return Ca}var Aa,af;function Kw(){if(af)return Aa;af=1,Aa=n;var t=yw();n.fixer=t;var e=Hw(),r=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=r.map(function(o){return a(o)+"Field"});s=s.concat(i);function n(o,c,l){c===!0&&(c=null,l=!0),l||(l=!1),(!c||o.private)&&(c=function(){}),o.scripts&&o.scripts.install==="node-gyp rebuild"&&!o.scripts.preinstall&&(o.gypfile=!0),t.warn=function(){c(e.apply(null,arguments))},s.forEach(function(u){t["fix"+a(u)](o,l)}),o._id=o.name+"@"+o.version}function a(o){return o.charAt(0).toUpperCase()+o.slice(1)}return Aa}var Yw=Kw(),kf=Qs(Yw),Xw=(t,e)=>(t=t.replace(/((?<![\p{Uppercase_Letter}\d])[\p{Uppercase_Letter}\d](?![\p{Uppercase_Letter}\d]))/gu,r=>r.toLowerCase()),t.replace(new RegExp("(?<!\\p{Uppercase_Letter})(\\p{Uppercase_Letter}+)(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),(r,i,s)=>i+e+s.toLowerCase()));function ja(t,{separator:e="_",preserveConsecutiveUppercase:r=!1}={}){if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("The `text` and `separator` arguments should be of type `string`");if(t.length<2)return r?t:t.toLowerCase();let i=`$1${e}$2`,s=t.replace(new RegExp("([\\p{Lowercase_Letter}\\d])(\\p{Uppercase_Letter})","gu"),i);return r?Xw(s,e):s.replace(new RegExp("(\\p{Uppercase_Letter})(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),i).toLowerCase()}var Js={exports:{}},La,cf;function Jw(){if(cf)return La;cf=1;var t=Object.prototype.toString;return La=function(e){var r;return t.call(e)==="[object Object]"&&(r=Object.getPrototypeOf(e),r===null||r===Object.getPrototypeOf({}))},La}var Oa,lf;function Zw(){return lf||(lf=1,Oa=function(t){return t==null?[]:Array.isArray(t)?t:[t]}),Oa}var $a,uf;function Qw(){if(uf)return $a;uf=1;var t=Object.prototype.toString;$a=function(d){if(d===void 0)return"undefined";if(d===null)return"null";var b=typeof d;if(b==="boolean")return"boolean";if(b==="string")return"string";if(b==="number")return"number";if(b==="symbol")return"symbol";if(b==="function")return a(d)?"generatorfunction":"function";if(r(d))return"array";if(l(d))return"buffer";if(c(d))return"arguments";if(s(d))return"date";if(i(d))return"error";if(n(d))return"regexp";switch(e(d)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(o(d))return"generator";switch(b=t.call(d),b){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return b.slice(8,-1).toLowerCase().replace(/\s/g,"")};function e(u){return typeof u.constructor=="function"?u.constructor.name:null}function r(u){return Array.isArray?Array.isArray(u):u instanceof Array}function i(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function s(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function n(u){return u instanceof RegExp?!0:typeof u.flags=="string"&&typeof u.ignoreCase=="boolean"&&typeof u.multiline=="boolean"&&typeof u.global=="boolean"}function a(u,d){return e(u)==="GeneratorFunction"}function o(u){return typeof u.throw=="function"&&typeof u.return=="function"&&typeof u.next=="function"}function c(u){try{if(typeof u.length=="number"&&typeof u.callee=="function")return!0}catch(d){if(d.message.indexOf("callee")!==-1)return!0}return!1}function l(u){return u.constructor&&typeof u.constructor.isBuffer=="function"?u.constructor.isBuffer(u):!1}return $a}var ff;function e1(){if(ff)return Js.exports;ff=1;let t=Jw(),e=Zw(),r=Qw(),i=(f,p,m)=>{f[p]||(f[p]=[]),f[p].push(m)},s=(f,p,m,y)=>{f[p]||(f[p]={}),f[p][m]=y},n=f=>Array.isArray(f)?`[${f.map(n).join(", ")}]`:r(f)==="string"?JSON.stringify(f):f,a=f=>{if(Array.isArray(f)&&f.length>0){let[p]=f;return`${r(p)}-array`}return r(f)},o=(f,p)=>{let m=f==="array"?"string-array":f;return u.includes(m)&&Array.isArray(p)&&p.length===0?"array":m},c=["stopEarly","unknown","--"],l=["string","boolean","number"],u=l.map(f=>`${f}-array`),d=[...l,"array",...u],b=f=>{f=f||{};let p={};return c.forEach(m=>{f[m]&&(p[m]=f[m])}),Object.keys(f).forEach(m=>{let y=f[m];if(m==="arguments"&&(m="_"),typeof y=="string"&&(y={type:y}),t(y)){let g=y,{type:w}=g;if(w){if(!d.includes(w))throw new TypeError(`Expected type of "${m}" to be one of ${n(d)}, got ${n(w)}`);if(u.includes(w)){let[E]=w.split("-");i(p,"array",{key:m,[E]:!0})}else i(p,w,m)}if({}.hasOwnProperty.call(g,"default")){let{default:E}=g,h=a(E),v=o(w,E);if(v&&v!==h)throw new TypeError(`Expected "${m}" default value to be of type "${v}", got ${n(h)}`);s(p,"default",m,E)}e(g.alias).forEach(E=>{s(p,"alias",E,m)})}}),p};return Js.exports=b,Js.exports.default=b,Js.exports}var t1=e1(),jf=Qs(t1),Zs={exports:{}},hf;function r1(){if(hf)return Zs.exports;hf=1;let t=s=>typeof s=="object"&&s!==null,e=Symbol("skip"),r=s=>t(s)&&!(s instanceof RegExp)&&!(s instanceof Error)&&!(s instanceof Date),i=(s,n,a,o=new WeakMap)=>{if(a={deep:!1,target:{},...a},o.has(s))return o.get(s);o.set(s,a.target);let{target:c}=a;delete a.target;let l=u=>u.map(d=>r(d)?i(d,n,a,o):d);if(Array.isArray(s))return l(s);for(let[u,d]of Object.entries(s)){let b=n(u,d,s);if(b===e)continue;let[f,p,{shouldRecurse:m=!0}={}]=b;f!=="__proto__"&&(a.deep&&m&&r(p)&&(p=Array.isArray(p)?l(p):i(p,n,a,o)),c[f]=p)}return c};return Zs.exports=(s,n,a)=>{if(!t(s))throw new TypeError(`Expected an object, got \`${s}\` (${typeof s})`);return i(s,n,a)},Zs.exports.mapObjectSkip=e,Zs.exports}var i1=r1(),pf=Qs(i1),Na=class extends Map{constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=e.maxSize,this.maxAge=e.maxAge||Number.POSITIVE_INFINITY,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(e){if(typeof this.onEviction=="function")for(let[r,i]of e)this.onEviction(r,i.value)}_deleteIfExpired(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(e,r.value),this.delete(e)):!1}_getOrDeleteIfExpired(e,r){if(this._deleteIfExpired(e,r)===!1)return r.value}_getItemValue(e,r){return r.expiry?this._getOrDeleteIfExpired(e,r):r.value}_peek(e,r){let i=r.get(e);return this._getItemValue(e,i)}_set(e,r){this.cache.set(e,r),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(e,r){this.oldCache.delete(e),this._set(e,r)}*_entriesAscending(){for(let e of this.oldCache){let[r,i]=e;this.cache.has(r)||this._deleteIfExpired(r,i)===!1&&(yield e)}for(let e of this.cache){let[r,i]=e;this._deleteIfExpired(r,i)===!1&&(yield e)}}get(e){if(this.cache.has(e)){let r=this.cache.get(e);return this._getItemValue(e,r)}if(this.oldCache.has(e)){let r=this.oldCache.get(e);if(this._deleteIfExpired(e,r)===!1)return this._moveToRecent(e,r),r.value}}set(e,r,{maxAge:i=this.maxAge}={}){let s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.cache.has(e)?this.cache.set(e,{value:r,expiry:s}):this._set(e,{value:r,expiry:s}),this}has(e){return this.cache.has(e)?!this._deleteIfExpired(e,this.cache.get(e)):this.oldCache.has(e)?!this._deleteIfExpired(e,this.oldCache.get(e)):!1}peek(e){if(this.cache.has(e))return this._peek(e,this.cache);if(this.oldCache.has(e))return this._peek(e,this.oldCache)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this._entriesAscending()],i=r.length-e;i<0?(this.cache=new Map(r),this.oldCache=new Map,this._size=r.length):(i>0&&this._emitEvictions(r.slice(0,i)),this.oldCache=new Map(r.slice(i)),this.cache=new Map,this._size=0),this.maxSize=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache){let[r,i]=e;this._deleteIfExpired(r,i)===!1&&(yield[r,i.value])}for(let e of this.oldCache){let[r,i]=e;this.cache.has(r)||this._deleteIfExpired(r,i)===!1&&(yield[r,i.value])}}*entriesDescending(){let e=[...this.cache];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this._deleteIfExpired(s,n)===!1&&(yield[s,n.value])}e=[...this.oldCache];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this.cache.has(s)||this._deleteIfExpired(s,n)===!1&&(yield[s,n.value])}}*entriesAscending(){for(let[e,r]of this._entriesAscending())yield[e,r.value]}get size(){if(!this._size)return this.oldCache.size;let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[i,s]of this.entriesAscending())e.call(r,s,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}},s1=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),Ta=new Na({maxSize:1e5}),df=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),mf=(t,e={})=>{if(!df(t))return t;let{separator:r="_",exclude:i,deep:s=!1}=e,n=a=>(o,c)=>{if(s&&df(c)&&(c=pf(c,n())),!(i&&s1(i,o))){let l=`${r}${o}`;if(Ta.has(l))o=Ta.get(l);else{let u=ja(o,{separator:r});o.length<100&&Ta.set(l,u),o=u}}return[o,c]};return pf(t,n())};function Bf(t,e){return Array.isArray(t)?Object.keys(t).map(r=>mf(t[r],e)):mf(t,e)}import n1 from"node:process";import o1 from"node:path";import{fileURLToPath as a1}from"node:url";var or=t=>`--${ja(t,{separator:"-"})}`,zi=(t,e="--")=>`\`${e}${t.join(`\`, \`${e}`)}\``;var c1=t=>{let e={flags:{keyContainsDashes:{filter:([i])=>i.includes("-")&&i!=="--",message:i=>`Flag keys may not contain '-'. Invalid flags: ${zi(i,"")}`},aliasIsSet:{filter:([,i])=>Object.hasOwn(i,"alias"),message:i=>`The option \`alias\` has been renamed to \`shortFlag\`. The following flags need to be updated: ${zi(i)}`},choicesNotAnArray:{filter:([,i])=>Object.hasOwn(i,"choices")&&!Array.isArray(i.choices),message:i=>`The option \`choices\` must be an array. Invalid flags: ${zi(i)}`},choicesNotMatchFlagType:{filter:([,i])=>i.type&&Array.isArray(i.choices)&&i.choices.some(s=>typeof s!==i.type),message(i){return`Each value of the option \`choices\` must be of the same type as its flag. Invalid flags: ${i.map(n=>`(\`${or(n)}\`, type: '${t.flags[n].type}')`).join(", ")}`}},defaultNotInChoices:{filter:([,i])=>i.default&&Array.isArray(i.choices)&&![i.default].flat().every(s=>i.choices.includes(s)),message:i=>`Each value of the option \`default\` must exist within the option \`choices\`. Invalid flags: ${zi(i)}`}}},r=[];for(let[i,s]of Object.entries(e)){let n=Object.entries(t[i]);for(let{filter:a,message:o}of Object.values(s)){let c=n.filter(u=>a(u)),l=c.map(([u])=>u);c.length>0&&r.push(o(l))}}if(r.length>0)throw new Error(r.join(`
|
|
32
|
-
`))},
|
|
33
|
-
`)}`)},
|
|
34
|
-
`))},
|
|
29
|
+
`:""}`}set message(e){this.#e=e}#w(e){if(!this.#r)return;let r=this.#t,i=iv(r,this.#r.message);if(i)return Qb.codeFrameColumns(r,{start:i},{highlightCode:e})}get codeFrame(){return this.#n??=this.#w(!0),this.#n}get rawCodeFrame(){return this.#h??=this.#w(!1),this.#h}},iv=(t,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:i,line:s,column:n}=r.groups;return s&&n?{line:Number(s),column:Number(n)}:tv(t,Number(i),{oneBased:!0})},sv=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,i)=>`"${i}"(${rv(i)})`);function nv(t,e,r){try{return JSON.parse(t,e)}catch(i){throw new Fa({jsonParseError:i,fileName:r,input:t})}}var Qo,Ou;function Ch(){return Ou||(Ou=1,Qo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Qo}var ea,$u;function Ah(){if($u)return ea;$u=1;let t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,s=e-6;return ea={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ea}var Xs={exports:{}},Tu;function ov(){return Tu||(Tu=1,(function(t,e){let{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:s}=Ah(),n=Ch();e=t.exports={};let a=e.re=[],o=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,g="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[g,i]],p=y=>{for(let[b,w]of h)y=y.split(`${b}*`).join(`${b}{0,${w}}`).split(`${b}+`).join(`${b}{1,${w}}`);return y},m=(y,b,w)=>{let x=p(b),f=d++;n(y,f,b),u[y]=f,c[f]=b,l[f]=x,a[f]=new RegExp(b,w?"g":void 0),o[f]=new RegExp(x,w?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),m("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${g}+`),m("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),m("FULL",`^${c[u.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),m("LOOSE",`^${c[u.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),m("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",c[u.COERCE],!0),m("COERCERTLFULL",c[u.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",m("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",m("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Xs,Xs.exports)),Xs.exports}var ta,Pu;function av(){if(Pu)return ta;Pu=1;let t=Object.freeze({loose:!0}),e=Object.freeze({});return ta=i=>i?typeof i!="object"?t:i:e,ta}var ra,Iu;function cv(){if(Iu)return ra;Iu=1;let t=/^[0-9]+$/,e=(i,s)=>{let n=t.test(i),a=t.test(s);return n&&a&&(i=+i,s=+s),i===s?0:n&&!a?-1:a&&!n?1:i<s?-1:1};return ra={compareIdentifiers:e,rcompareIdentifiers:(i,s)=>e(s,i)},ra}var ia,Fu;function lv(){if(Fu)return ia;Fu=1;let t=Ch(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=Ah(),{safeRe:i,t:s}=ov(),n=av(),{compareIdentifiers:a}=cv();class o{constructor(l,u){if(u=n(u),l instanceof o){if(l.loose===!!u.loose&&l.includePrerelease===!!u.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",l,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;let d=l.trim().match(u.loose?i[s.LOOSE]:i[s.FULL]);if(!d)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){let h=+g;if(h>=0&&h<r)return h}return g}):this.prerelease=[],this.build=d[5]?d[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(l){if(t("SemVer.compare",this.version,this.options,l),!(l instanceof o)){if(typeof l=="string"&&l===this.version)return 0;l=new o(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof o||(l=new o(l,this.options)),a(this.major,l.major)||a(this.minor,l.minor)||a(this.patch,l.patch)}comparePre(l){if(l instanceof o||(l=new o(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let u=0;do{let d=this.prerelease[u],g=l.prerelease[u];if(t("prerelease compare",u,d,g),d===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(d===void 0)return-1;if(d===g)continue;return a(d,g)}while(++u)}compareBuild(l){l instanceof o||(l=new o(l,this.options));let u=0;do{let d=this.build[u],g=l.build[u];if(t("build compare",u,d,g),d===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(d===void 0)return-1;if(d===g)continue;return a(d,g)}while(++u)}inc(l,u,d){if(l.startsWith("pre")){if(!u&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(u){let g=`-${u}`.match(this.options.loose?i[s.PRERELEASELOOSE]:i[s.PRERELEASE]);if(!g||g[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,d),this.inc("pre",u,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,d),this.inc("pre",u,d);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 g=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(u===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(u){let h=[u,g];d===!1&&(h=[u]),a(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ia=o,ia}var sa,Nu;function Lh(){if(Nu)return sa;Nu=1;let t=lv();return sa=(r,i,s=!1)=>{if(r instanceof t)return r;try{return new t(r,i)}catch(n){if(!s)return null;throw n}},sa}var na,Du;function Oh(){if(Du)return na;Du=1;let t=Lh();return na=(r,i)=>{let s=t(r,i);return s?s.version:null},na}var oa,Mu;function $h(){if(Mu)return oa;Mu=1;let t=Lh();return oa=(r,i)=>{let s=t(r.trim().replace(/^[=v]+/,""),i);return s?s.version:null},oa}var Th=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"],uv=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"],hv=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"],aa,ku;function fv(){if(ku)return aa;ku=1;var t=[].concat(Th).concat(uv),e=hv;return aa=function(r){var i=0;function s(){return i<r.length}function n(y){if(y instanceof RegExp){var b=r.slice(i),w=b.match(y);if(w)return i+=w[0].length,w[0]}else if(r.indexOf(y,i)===i)return i+=y.length,y}function a(){n(/[ ]*/)}function o(){for(var y,b=["WITH","AND","OR","(",")",":","+"],w=0;w<b.length&&(y=n(b[w]),!y);w++);if(y==="+"&&i>1&&r[i-2]===" ")throw new Error("Space before `+`");return y&&{type:"OPERATOR",string:y}}function c(){return n(/[A-Za-z0-9-.]+/)}function l(){var y=c();if(!y)throw new Error("Expected idstring at offset "+i);return y}function u(){if(n("DocumentRef-")){var y=l();return{type:"DOCUMENTREF",string:y}}}function d(){if(n("LicenseRef-")){var y=l();return{type:"LICENSEREF",string:y}}}function g(){var y=i,b=c();if(t.indexOf(b)!==-1)return{type:"LICENSE",string:b};if(e.indexOf(b)!==-1)return{type:"EXCEPTION",string:b};i=y}function h(){return o()||u()||d()||g()}for(var p=[];s()&&(a(),!!s());){var m=h();if(!m)throw new Error("Unexpected `"+r[i]+"` at offset "+i);p.push(m)}return p},aa}var ca,ju;function pv(){return ju||(ju=1,ca=function(t){var e=0;function r(){return e<t.length}function i(){return r()?t[e]:null}function s(){if(!r())throw new Error;e++}function n(m){var y=i();if(y&&y.type==="OPERATOR"&&m===y.string)return s(),y.string}function a(){if(n("WITH")){var m=i();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function o(){var m=e,y="",b=i();if(b.type==="DOCUMENTREF"&&(s(),y+="DocumentRef-"+b.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(b=i(),b.type==="LICENSEREF")return s(),y+="LicenseRef-"+b.string,{license:y};e=m}function c(){var m=i();if(m&&m.type==="LICENSE"){s();var y={license:m.string};n("+")&&(y.plus=!0);var b=a();return b&&(y.exception=b),y}}function l(){var m=n("(");if(m){var y=h();if(!n(")"))throw new Error("Expected `)`");return y}}function u(){return l()||o()||c()}function d(m,y){return function b(){var w=y();if(w){if(!n(m))return w;var x=b();if(!x)throw new Error("Expected expression");return{left:w,conjunction:m.toLowerCase(),right:x}}}}var g=d("AND",u),h=d("OR",g),p=h();if(!p||r())throw new Error("Syntax error");return p}),ca}var la,Bu;function Ph(){if(Bu)return la;Bu=1;var t=fv(),e=pv();return la=function(r){return e(t(r))},la}var ua,Uu;function dv(){if(Uu)return ua;Uu=1;var t=Ph(),e=Th;function r(b){try{return t(b),!0}catch{return!1}}function i(b,w){var x=w[0].length-b[0].length;return x!==0?x:b[0].toUpperCase().localeCompare(w[0].toUpperCase())}var s=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(i),n=0,a=1,o=[function(b){return b.toUpperCase()},function(b){return b.trim()},function(b){return b.replace(/\./g,"")},function(b){return b.replace(/\s+/g,"")},function(b){return b.replace(/\s+/g,"-")},function(b){return b.replace("v","-")},function(b){return b.replace(/,?\s*(\d)/,"-$1")},function(b){return b.replace(/,?\s*(\d)/,"-$1.0")},function(b){return b.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(b){return b.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(b){return b[0].toUpperCase()+b.slice(1)},function(b){return b.replace("/","-")},function(b){return b.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(b){return b.indexOf("3.0")!==-1?b+"-or-later":b+"-only"},function(b){return b+"only"},function(b){return b.replace(/(\d)$/,"-$1.0")},function(b){return b.replace(/(-| )?(\d)$/,"-$2-Clause")},function(b){return b.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(b){return b.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(b){return b.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(b){return b.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(b){return b.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(b){return b.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(b){return"CC-"+b},function(b){return"CC-"+b+"-4.0"},function(b){return b.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(b){return"CC-"+b.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],c=e.map(function(b){var w=/^(.*)-\d+\.\d+$/.exec(b);return w?[w[0],w[1]]:[b,null]}).reduce(function(b,w){var x=w[1];return b[x]=b[x]||[],b[x].push(w[0]),b},{}),l=Object.keys(c).map(function(w){return[w,c[w]]}).filter(function(w){return w[1].length===1&&w[0]!==null&&w[0]!=="APL"}).map(function(w){return[w[0],w[1][0]]});c=void 0;var u=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(l).sort(i),d=0,g=1,h=function(b){for(var w=0;w<o.length;w++){var x=o[w](b).trim();if(x!==b&&r(x))return x}return null},p=function(b){for(var w=b.toUpperCase(),x=0;x<u.length;x++){var f=u[x];if(w.indexOf(f[d])>-1)return f[g]}return null},m=function(b,w){for(var x=0;x<s.length;x++){var f=s[x],v=f[n];if(b.indexOf(v)>-1){var E=b.replace(v,f[a]),_=w(E);if(_!==null)return _}}return null};ua=function(b,w){w=w||{};var x=w.upgrade===void 0?!0:!!w.upgrade;function f(O){return x?y(O):O}var v=typeof b=="string"&&b.trim().length!==0;if(!v)throw Error("Invalid argument. Expected non-empty string.");if(b=b.trim(),r(b))return f(b);var E=b.replace(/\+$/,"").trim();if(r(E))return f(E);var _=h(b);return _!==null||(_=m(b,function(O){return r(O)?O:h(O)}),_!==null)||(_=p(b),_!==null)||(_=m(b,p),_!==null)?f(_):null};function y(b){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(b)!==-1?b+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(b)!==-1?b.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(b)!==-1?b+"-or-later":b}return ua}var ha,Gu;function Ih(){if(Gu)return ha;Gu=1;var t=Ph(),e=dv(),r='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',i=/^SEE LICEN[CS]E IN (.+)$/;function s(a,o){return o.slice(0,a.length)===a}function n(a){if(a.hasOwnProperty("license")){var o=a.license;return s("LicenseRef",o)||s("DocumentRef",o)}else return n(a.left)||n(a.right)}return ha=function(a){var o;try{o=t(a)}catch{var c;if(a==="UNLICENSED"||a==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(c=i.exec(a))return{validForOldPackages:!0,validForNewPackages:!0,inFile:c[1]};var l={validForOldPackages:!1,validForNewPackages:!1,warnings:[r]};if(a.trim().length!==0){var u=e(a);u&&l.warnings.push('license is similar to the valid expression "'+u+'"')}return l}return n(o)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[r]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},ha}var Ui={},zu;function mv(){if(zu)return Ui;zu=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.LRUCache=void 0;let t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e=new Set,r=typeof process=="object"&&process?process:{},i=(g,h,p,m)=>{typeof r.emitWarning=="function"?r.emitWarning(g,h,p,m):console.error(`[${p}] ${h}: ${g}`)},s=globalThis.AbortController,n=globalThis.AbortSignal;if(typeof s>"u"){n=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(m,y){this._onabort.push(y)}},s=class{constructor(){h()}signal=new n;abort(m){if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let y of this.signal._onabort)y(m);this.signal.onabort?.(m)}}};let g=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",h=()=>{g&&(g=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",h))}}let a=g=>!e.has(g),o=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),c=g=>o(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?l:null:null;class l extends Array{constructor(h){super(h),this.fill(0)}}class u{heap;length;static#t=!1;static create(h){let p=c(h);if(!p)return[];u.#t=!0;let m=new u(h,p);return u.#t=!1,m}constructor(h,p){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new p(h),this.length=0}push(h){this.heap[this.length++]=h}pop(){return this.heap[--this.length]}}class d{#t;#r;#e;#n;#h;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#u;#s;#c;#i;#l;#o;#d;#g;#y;#p;#C;#x;#E;#_;#S;#v;static unsafeExposeInternals(h){return{starts:h.#x,ttls:h.#E,sizes:h.#C,keyMap:h.#s,keyList:h.#c,valList:h.#i,next:h.#l,prev:h.#o,get head(){return h.#d},get tail(){return h.#g},free:h.#y,isBackgroundFetch:p=>h.#m(p),backgroundFetch:(p,m,y,b)=>h.#F(p,m,y,b),moveToTail:p=>h.#D(p),indexes:p=>h.#L(p),rindexes:p=>h.#$(p),isStale:p=>h.#R(p)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#a}get fetchMethod(){return this.#h}get memoMethod(){return this.#w}get dispose(){return this.#e}get disposeAfter(){return this.#n}constructor(h){let{max:p=0,ttl:m,ttlResolution:y=1,ttlAutopurge:b,updateAgeOnGet:w,updateAgeOnHas:x,allowStale:f,dispose:v,disposeAfter:E,noDisposeOnSet:_,noUpdateTTL:O,maxSize:C=0,maxEntrySize:$=0,sizeCalculation:F,fetchMethod:M,memoMethod:I,noDeleteOnFetchRejection:Y,noDeleteOnStaleGet:Z,allowStaleOnFetchRejection:G,allowStaleOnFetchAbort:V,ignoreFetchAbort:se}=h;if(p!==0&&!o(p))throw new TypeError("max option must be a nonnegative integer");let ee=p?c(p):Array;if(!ee)throw new Error("invalid max value: "+p);if(this.#t=p,this.#r=C,this.maxEntrySize=$||this.#r,this.sizeCalculation=F,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(I!==void 0&&typeof I!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=I,M!==void 0&&typeof M!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#h=M,this.#S=!!M,this.#s=new Map,this.#c=new Array(p).fill(void 0),this.#i=new Array(p).fill(void 0),this.#l=new ee(p),this.#o=new ee(p),this.#d=0,this.#g=0,this.#y=u.create(p),this.#a=0,this.#u=0,typeof v=="function"&&(this.#e=v),typeof E=="function"?(this.#n=E,this.#p=[]):(this.#n=void 0,this.#p=void 0),this.#_=!!this.#e,this.#v=!!this.#n,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!Y,this.allowStaleOnFetchRejection=!!G,this.allowStaleOnFetchAbort=!!V,this.ignoreFetchAbort=!!se,this.maxEntrySize!==0){if(this.#r!==0&&!o(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!Z,this.updateAgeOnGet=!!w,this.updateAgeOnHas=!!x,this.ttlResolution=o(y)||y===0?y:1,this.ttlAutopurge=!!b,this.ttl=m||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let we="LRU_CACHE_UNBOUNDED";a(we)&&(e.add(we),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",we,d))}}getRemainingTTL(h){return this.#s.has(h)?1/0:0}#P(){let h=new l(this.#t),p=new l(this.#t);this.#E=h,this.#x=p,this.#M=(b,w,x=t.now())=>{if(p[b]=w!==0?x:0,h[b]=w,w!==0&&this.ttlAutopurge){let f=setTimeout(()=>{this.#R(b)&&this.#b(this.#c[b],"expire")},w+1);f.unref&&f.unref()}},this.#A=b=>{p[b]=h[b]!==0?t.now():0},this.#f=(b,w)=>{if(h[w]){let x=h[w],f=p[w];if(!x||!f)return;b.ttl=x,b.start=f,b.now=m||y();let v=b.now-f;b.remainingTTL=x-v}};let m=0,y=()=>{let b=t.now();if(this.ttlResolution>0){m=b;let w=setTimeout(()=>m=0,this.ttlResolution);w.unref&&w.unref()}return b};this.getRemainingTTL=b=>{let w=this.#s.get(b);if(w===void 0)return 0;let x=h[w],f=p[w];if(!x||!f)return 1/0;let v=(m||y())-f;return x-v},this.#R=b=>{let w=p[b],x=h[b];return!!x&&!!w&&(m||y())-w>x}}#A=()=>{};#f=()=>{};#M=()=>{};#R=()=>!1;#I(){let h=new l(this.#t);this.#u=0,this.#C=h,this.#N=p=>{this.#u-=h[p],h[p]=0},this.#B=(p,m,y,b)=>{if(this.#m(m))return 0;if(!o(y))if(b){if(typeof b!="function")throw new TypeError("sizeCalculation must be a function");if(y=b(m,p),!o(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return y},this.#O=(p,m,y)=>{if(h[p]=m,this.#r){let b=this.#r-h[p];for(;this.#u>b;)this.#T(!0)}this.#u+=h[p],y&&(y.entrySize=m,y.totalCalculatedSize=this.#u)}}#N=h=>{};#O=(h,p,m)=>{};#B=(h,p,m,y)=>{if(m||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#L({allowStale:h=this.allowStale}={}){if(this.#a)for(let p=this.#g;!(!this.#k(p)||((h||!this.#R(p))&&(yield p),p===this.#d));)p=this.#o[p]}*#$({allowStale:h=this.allowStale}={}){if(this.#a)for(let p=this.#d;!(!this.#k(p)||((h||!this.#R(p))&&(yield p),p===this.#g));)p=this.#l[p]}#k(h){return h!==void 0&&this.#s.get(this.#c[h])===h}*entries(){for(let h of this.#L())this.#i[h]!==void 0&&this.#c[h]!==void 0&&!this.#m(this.#i[h])&&(yield[this.#c[h],this.#i[h]])}*rentries(){for(let h of this.#$())this.#i[h]!==void 0&&this.#c[h]!==void 0&&!this.#m(this.#i[h])&&(yield[this.#c[h],this.#i[h]])}*keys(){for(let h of this.#L()){let p=this.#c[h];p!==void 0&&!this.#m(this.#i[h])&&(yield p)}}*rkeys(){for(let h of this.#$()){let p=this.#c[h];p!==void 0&&!this.#m(this.#i[h])&&(yield p)}}*values(){for(let h of this.#L())this.#i[h]!==void 0&&!this.#m(this.#i[h])&&(yield this.#i[h])}*rvalues(){for(let h of this.#$())this.#i[h]!==void 0&&!this.#m(this.#i[h])&&(yield this.#i[h])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(h,p={}){for(let m of this.#L()){let y=this.#i[m],b=this.#m(y)?y.__staleWhileFetching:y;if(b!==void 0&&h(b,this.#c[m],this))return this.get(this.#c[m],p)}}forEach(h,p=this){for(let m of this.#L()){let y=this.#i[m],b=this.#m(y)?y.__staleWhileFetching:y;b!==void 0&&h.call(p,b,this.#c[m],this)}}rforEach(h,p=this){for(let m of this.#$()){let y=this.#i[m],b=this.#m(y)?y.__staleWhileFetching:y;b!==void 0&&h.call(p,b,this.#c[m],this)}}purgeStale(){let h=!1;for(let p of this.#$({allowStale:!0}))this.#R(p)&&(this.#b(this.#c[p],"expire"),h=!0);return h}info(h){let p=this.#s.get(h);if(p===void 0)return;let m=this.#i[p],y=this.#m(m)?m.__staleWhileFetching:m;if(y===void 0)return;let b={value:y};if(this.#E&&this.#x){let w=this.#E[p],x=this.#x[p];if(w&&x){let f=w-(t.now()-x);b.ttl=f,b.start=Date.now()}}return this.#C&&(b.size=this.#C[p]),b}dump(){let h=[];for(let p of this.#L({allowStale:!0})){let m=this.#c[p],y=this.#i[p],b=this.#m(y)?y.__staleWhileFetching:y;if(b===void 0||m===void 0)continue;let w={value:b};if(this.#E&&this.#x){w.ttl=this.#E[p];let x=t.now()-this.#x[p];w.start=Math.floor(Date.now()-x)}this.#C&&(w.size=this.#C[p]),h.unshift([m,w])}return h}load(h){this.clear();for(let[p,m]of h){if(m.start){let y=Date.now()-m.start;m.start=t.now()-y}this.set(p,m.value,m)}}set(h,p,m={}){if(p===void 0)return this.delete(h),this;let{ttl:y=this.ttl,start:b,noDisposeOnSet:w=this.noDisposeOnSet,sizeCalculation:x=this.sizeCalculation,status:f}=m,{noUpdateTTL:v=this.noUpdateTTL}=m,E=this.#B(h,p,m.size||0,x);if(this.maxEntrySize&&E>this.maxEntrySize)return f&&(f.set="miss",f.maxEntrySizeExceeded=!0),this.#b(h,"set"),this;let _=this.#a===0?void 0:this.#s.get(h);if(_===void 0)_=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#t?this.#T(!1):this.#a,this.#c[_]=h,this.#i[_]=p,this.#s.set(h,_),this.#l[this.#g]=_,this.#o[_]=this.#g,this.#g=_,this.#a++,this.#O(_,E,f),f&&(f.set="add"),v=!1;else{this.#D(_);let O=this.#i[_];if(p!==O){if(this.#S&&this.#m(O)){O.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:C}=O;C!==void 0&&!w&&(this.#_&&this.#e?.(C,h,"set"),this.#v&&this.#p?.push([C,h,"set"]))}else w||(this.#_&&this.#e?.(O,h,"set"),this.#v&&this.#p?.push([O,h,"set"]));if(this.#N(_),this.#O(_,E,f),this.#i[_]=p,f){f.set="replace";let C=O&&this.#m(O)?O.__staleWhileFetching:O;C!==void 0&&(f.oldValue=C)}}else f&&(f.set="update")}if(y!==0&&!this.#E&&this.#P(),this.#E&&(v||this.#M(_,y,b),f&&this.#f(f,_)),!w&&this.#v&&this.#p){let O=this.#p,C;for(;C=O?.shift();)this.#n?.(...C)}return this}pop(){try{for(;this.#a;){let h=this.#i[this.#d];if(this.#T(!0),this.#m(h)){if(h.__staleWhileFetching)return h.__staleWhileFetching}else if(h!==void 0)return h}}finally{if(this.#v&&this.#p){let h=this.#p,p;for(;p=h?.shift();)this.#n?.(...p)}}}#T(h){let p=this.#d,m=this.#c[p],y=this.#i[p];return this.#S&&this.#m(y)?y.__abortController.abort(new Error("evicted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(y,m,"evict"),this.#v&&this.#p?.push([y,m,"evict"])),this.#N(p),h&&(this.#c[p]=void 0,this.#i[p]=void 0,this.#y.push(p)),this.#a===1?(this.#d=this.#g=0,this.#y.length=0):this.#d=this.#l[p],this.#s.delete(m),this.#a--,p}has(h,p={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=p,b=this.#s.get(h);if(b!==void 0){let w=this.#i[b];if(this.#m(w)&&w.__staleWhileFetching===void 0)return!1;if(this.#R(b))y&&(y.has="stale",this.#f(y,b));else return m&&this.#A(b),y&&(y.has="hit",this.#f(y,b)),!0}else y&&(y.has="miss");return!1}peek(h,p={}){let{allowStale:m=this.allowStale}=p,y=this.#s.get(h);if(y===void 0||!m&&this.#R(y))return;let b=this.#i[y];return this.#m(b)?b.__staleWhileFetching:b}#F(h,p,m,y){let b=p===void 0?void 0:this.#i[p];if(this.#m(b))return b;let w=new s,{signal:x}=m;x?.addEventListener("abort",()=>w.abort(x.reason),{signal:w.signal});let f={signal:w.signal,options:m,context:y},v=(F,M=!1)=>{let{aborted:I}=w.signal,Y=m.ignoreFetchAbort&&F!==void 0;if(m.status&&(I&&!M?(m.status.fetchAborted=!0,m.status.fetchError=w.signal.reason,Y&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),I&&!Y&&!M)return _(w.signal.reason);let Z=C;return this.#i[p]===C&&(F===void 0?Z.__staleWhileFetching?this.#i[p]=Z.__staleWhileFetching:this.#b(h,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(h,F,f.options))),F},E=F=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=F),_(F)),_=F=>{let{aborted:M}=w.signal,I=M&&m.allowStaleOnFetchAbort,Y=I||m.allowStaleOnFetchRejection,Z=Y||m.noDeleteOnFetchRejection,G=C;if(this.#i[p]===C&&(!Z||G.__staleWhileFetching===void 0?this.#b(h,"fetch"):I||(this.#i[p]=G.__staleWhileFetching)),Y)return m.status&&G.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw F},O=(F,M)=>{let I=this.#h?.(h,b,f);I&&I instanceof Promise&&I.then(Y=>F(Y===void 0?void 0:Y),M),w.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(F(void 0),m.allowStaleOnFetchAbort&&(F=Y=>v(Y,!0)))})};m.status&&(m.status.fetchDispatched=!0);let C=new Promise(O).then(v,E),$=Object.assign(C,{__abortController:w,__staleWhileFetching:b,__returned:void 0});return p===void 0?(this.set(h,$,{...f.options,status:void 0}),p=this.#s.get(h)):this.#i[p]=$,$}#m(h){if(!this.#S)return!1;let p=h;return!!p&&p instanceof Promise&&p.hasOwnProperty("__staleWhileFetching")&&p.__abortController instanceof s}async fetch(h,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,ttl:w=this.ttl,noDisposeOnSet:x=this.noDisposeOnSet,size:f=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:E=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:O=this.allowStaleOnFetchRejection,ignoreFetchAbort:C=this.ignoreFetchAbort,allowStaleOnFetchAbort:$=this.allowStaleOnFetchAbort,context:F,forceRefresh:M=!1,status:I,signal:Y}=p;if(!this.#S)return I&&(I.fetch="get"),this.get(h,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:b,status:I});let Z={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:b,ttl:w,noDisposeOnSet:x,size:f,sizeCalculation:v,noUpdateTTL:E,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:$,ignoreFetchAbort:C,status:I,signal:Y},G=this.#s.get(h);if(G===void 0){I&&(I.fetch="miss");let V=this.#F(h,G,Z,F);return V.__returned=V}else{let V=this.#i[G];if(this.#m(V)){let Oe=m&&V.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",Oe&&(I.returnedStale=!0)),Oe?V.__staleWhileFetching:V.__returned=V}let se=this.#R(G);if(!M&&!se)return I&&(I.fetch="hit"),this.#D(G),y&&this.#A(G),I&&this.#f(I,G),V;let ee=this.#F(h,G,Z,F),xe=ee.__staleWhileFetching!==void 0&&m;return I&&(I.fetch=se?"stale":"refresh",xe&&se&&(I.returnedStale=!0)),xe?ee.__staleWhileFetching:ee.__returned=ee}}async forceFetch(h,p={}){let m=await this.fetch(h,p);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(h,p={}){let m=this.#w;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:b,...w}=p,x=this.get(h,w);if(!b&&x!==void 0)return x;let f=m(h,x,{options:w,context:y});return this.set(h,f,w),f}get(h,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,status:w}=p,x=this.#s.get(h);if(x!==void 0){let f=this.#i[x],v=this.#m(f);return w&&this.#f(w,x),this.#R(x)?(w&&(w.get="stale"),v?(w&&m&&f.__staleWhileFetching!==void 0&&(w.returnedStale=!0),m?f.__staleWhileFetching:void 0):(b||this.#b(h,"expire"),w&&m&&(w.returnedStale=!0),m?f:void 0)):(w&&(w.get="hit"),v?f.__staleWhileFetching:(this.#D(x),y&&this.#A(x),f))}else w&&(w.get="miss")}#j(h,p){this.#o[p]=h,this.#l[h]=p}#D(h){h!==this.#g&&(h===this.#d?this.#d=this.#l[h]:this.#j(this.#o[h],this.#l[h]),this.#j(this.#g,h),this.#g=h)}delete(h){return this.#b(h,"delete")}#b(h,p){let m=!1;if(this.#a!==0){let y=this.#s.get(h);if(y!==void 0)if(m=!0,this.#a===1)this.#G(p);else{this.#N(y);let b=this.#i[y];if(this.#m(b)?b.__abortController.abort(new Error("deleted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(b,h,p),this.#v&&this.#p?.push([b,h,p])),this.#s.delete(h),this.#c[y]=void 0,this.#i[y]=void 0,y===this.#g)this.#g=this.#o[y];else if(y===this.#d)this.#d=this.#l[y];else{let w=this.#o[y];this.#l[w]=this.#l[y];let x=this.#l[y];this.#o[x]=this.#o[y]}this.#a--,this.#y.push(y)}}if(this.#v&&this.#p?.length){let y=this.#p,b;for(;b=y?.shift();)this.#n?.(...b)}return m}clear(){return this.#G("delete")}#G(h){for(let p of this.#$({allowStale:!0})){let m=this.#i[p];if(this.#m(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#c[p];this.#_&&this.#e?.(m,y,h),this.#v&&this.#p?.push([m,y,h])}}if(this.#s.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#E&&this.#x&&(this.#E.fill(0),this.#x.fill(0)),this.#C&&this.#C.fill(0),this.#d=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#v&&this.#p){let p=this.#p,m;for(;m=p?.shift();)this.#n?.(...m)}}}return Ui.LRUCache=d,Ui}var fa,qu;function gv(){if(qu)return fa;qu=1;let t=(...n)=>n.every(a=>a)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",r=n=>n.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:n,user:a,project:o,committish:c})=>`git@${n}:${a}/${o}.git${t("#",c)}`,sshurltemplate:({domain:n,user:a,project:o,committish:c})=>`git+ssh://git@${n}/${a}/${o}.git${t("#",c)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l,path:u})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u)}`,browsetemplate:({domain:n,user:a,project:o,committish:c,treepath:l})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c))}`,browsetreetemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,fragment:d,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(d||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:d,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(d||""))}`,docstemplate:({domain:n,user:a,project:o,treepath:c,committish:l})=>`https://${n}/${a}/${o}${t("/",c,"/",e(l))}#readme`,httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/raw/${e(c||"HEAD")}/${l}`,shortcuttemplate:({type:n,user:a,project:o,committish:c})=>`${n}:${a}/${o}${t("#",c)}`,pathtemplate:({user:n,project:a,committish:o})=>`${n}/${a}${t("#",o)}`,bugstemplate:({domain:n,user:a,project:o})=>`https://${n}/${a}/${o}/issues`,hashformat:r},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:a,project:o,committish:c,path:l})=>`https://${t(n,"@")}raw.githubusercontent.com/${a}/${o}/${e(c||"HEAD")}/${l}`,gittemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://codeload.${n}/${a}/${o}/tar.gz/${e(c||"HEAD")}`,extract:n=>{let[,a,o,c,l]=n.pathname.split("/",5);if(!(c&&c!=="tree")&&(c||(l=n.hash.slice(1)),o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:l}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,editpath:d})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,d)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/get/${e(c||"HEAD")}.tar.gz`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["get"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/repository/archive.tar.gz?ref=${e(c||"HEAD")}`,extract:n=>{let a=n.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;let o=a.split("/"),c=o.pop();c.endsWith(".git")&&(c=c.slice(0,-4));let l=o.join("/");if(!(!l||!c))return{user:l,project:c,committish:n.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:a,committish:o})=>`git@${n}:${a}.git${t("#",o)}`,sshurltemplate:({domain:n,project:a,committish:o})=>`git+ssh://git@${n}/${a}.git${t("#",o)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l})=>`https://${n}/${a}/${o}${t("/",e(c))}/${l}`,browsetemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,browsetreetemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,browseblobtemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,docstemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,httpstemplate:({domain:n,project:a,committish:o})=>`git+https://${n}/${a}.git${t("#",o)}`,filetemplate:({user:n,project:a,committish:o,path:c})=>`https://gist.githubusercontent.com/${n}/${a}/raw${t("/",e(o))}/${c}`,shortcuttemplate:({type:n,project:a,committish:o})=>`${n}:${a}${t("#",o)}`,pathtemplate:({project:n,committish:a})=>`${n}${t("#",a)}`,bugstemplate:({domain:n,project:a})=>`https://${n}/${a}`,gittemplate:({domain:n,project:a,committish:o})=>`git://${n}/${a}.git${t("#",o)}`,tarballtemplate:({project:n,committish:a})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(a||"HEAD")}`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(c!=="raw"){if(!o){if(!a)return;o=a,a=null}return o.endsWith(".git")&&(o=o.slice(0,-4)),{user:a,project:o,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+r(n)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/blob/${e(c)||"HEAD"}/${l}`,httpstemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}.git${t("#",c)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/archive/${e(c)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["archive"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}};for(let[n,a]of Object.entries(s))s[n]=Object.assign({},i,a);return fa=s,fa}var pa,Wu;function Fh(){if(Wu)return pa;Wu=1;let t=Da,e=(n,a,o)=>{let c=n.indexOf(o);return n.lastIndexOf(a,c>-1?c:1/0)},r=n=>{try{return new t.URL(n)}catch{}},i=(n,a)=>{let o=n.indexOf(":"),c=n.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(a,c))return n;let l=n.indexOf("@");return l>-1?l>o?`git+ssh://${n}`:n:n.indexOf("//")===o+1?n:`${n.slice(0,o+1)}//${n.slice(o+1)}`},s=n=>{let a=e(n,"@","#"),o=e(n,":","#");return o>a&&(n=n.slice(0,o)+"/"+n.slice(o+1)),e(n,":","#")===-1&&n.indexOf("//")===-1&&(n=`git+ssh://${n}`),n};return pa=(n,a)=>{let o=a?i(n,a):n;return r(o)||r(s(o))},pa}var da,Vu;function yv(){if(Vu)return da;Vu=1;let t=Fh(),e=r=>{let i=r.indexOf("#"),s=r.indexOf("/"),n=r.indexOf("/",s+1),a=r.indexOf(":"),o=/\s/.exec(r),c=r.indexOf("@"),l=!o||i>-1&&o.index>i,u=c===-1||i>-1&&c>i,d=a===-1||i>-1&&a>i,g=n===-1||i>-1&&n>i,h=s>0,p=i>-1?r[i-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&h&&p&&m&&u&&d&&g};return da=(r,i,{gitHosts:s,protocols:n})=>{if(!r)return;let a=e(r)?`github:${r}`:r,o=t(a,n);if(!o)return;let c=s.byShortcut[o.protocol],l=s.byDomain[o.hostname.startsWith("www.")?o.hostname.slice(4):o.hostname],u=c||l;if(!u)return;let d=s[c||l],g=null;n[o.protocol]?.auth&&(o.username||o.password)&&(g=`${o.username}${o.password?":"+o.password:""}`);let h=null,p=null,m=null,y=null;try{if(c){let b=o.pathname.startsWith("/")?o.pathname.slice(1):o.pathname,w=b.indexOf("@");w>-1&&(b=b.slice(w+1));let x=b.lastIndexOf("/");x>-1?(p=decodeURIComponent(b.slice(0,x)),p||(p=null),m=decodeURIComponent(b.slice(x+1))):m=decodeURIComponent(b),m.endsWith(".git")&&(m=m.slice(0,-4)),o.hash&&(h=decodeURIComponent(o.hash.slice(1))),y="shortcut"}else{if(!d.protocols.includes(o.protocol))return;let b=d.extract(o);if(!b)return;p=b.user&&decodeURIComponent(b.user),m=decodeURIComponent(b.project),h=decodeURIComponent(b.committish),y=n[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(b){if(b instanceof URIError)return;throw b}return[u,p,g,m,h,y,i]},da}var ma,Hu;function bv(){if(Hu)return ma;Hu=1;let{LRUCache:t}=mv(),e=gv(),r=yv(),i=Fh(),s=new t({max:1e3});class n{constructor(o,c,l,u,d,g,h={}){Object.assign(this,n.#t[o],{type:o,user:c,auth:l,project:u,committish:d,default:g,opts:h})}static#t={byShortcut:{},byDomain:{}};static#r={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(o,c){n.#t[o]=c,n.#t.byDomain[c.domain]=o,n.#t.byShortcut[`${o}:`]=o,n.#r[`${o}:`]={name:o}}static fromUrl(o,c){if(typeof o!="string")return;let l=o+JSON.stringify(c||{});if(!s.has(l)){let u=r(o,c,{gitHosts:n.#t,protocols:n.#r});s.set(l,u?new n(...u):void 0)}return s.get(l)}static parseUrl(o){return i(o)}#e(o,c){if(typeof o!="function")return null;let l={...this,...this.opts,...c};l.path||(l.path=""),l.path.startsWith("/")&&(l.path=l.path.slice(1)),l.noCommittish&&(l.committish=null);let u=o(l);return l.noGitPlus&&u.startsWith("git+")?u.slice(4):u}hash(){return this.committish?`#${this.committish}`:""}ssh(o){return this.#e(this.sshtemplate,o)}sshurl(o){return this.#e(this.sshurltemplate,o)}browse(o,...c){return typeof o!="string"?this.#e(this.browsetemplate,o):typeof c[0]!="string"?this.#e(this.browsetreetemplate,{...c[0],path:o}):this.#e(this.browsetreetemplate,{...c[1],fragment:c[0],path:o})}browseFile(o,...c){return typeof c[0]!="string"?this.#e(this.browseblobtemplate,{...c[0],path:o}):this.#e(this.browseblobtemplate,{...c[1],fragment:c[0],path:o})}docs(o){return this.#e(this.docstemplate,o)}bugs(o){return this.#e(this.bugstemplate,o)}https(o){return this.#e(this.httpstemplate,o)}git(o){return this.#e(this.gittemplate,o)}shortcut(o){return this.#e(this.shortcuttemplate,o)}path(o){return this.#e(this.pathtemplate,o)}tarball(o){return this.#e(this.tarballtemplate,{...o,noCommittish:!1})}file(o,c){return this.#e(this.filetemplate,{...c,path:o})}edit(o,c){return this.#e(this.edittemplate,{...c,path:o})}getDefaultRepresentation(){return this.default}toString(o){return this.default&&typeof this[this.default]=="function"?this[this.default](o):this.sshurl(o)}}for(let[a,o]of Object.entries(e))n.addHost(a,o);return ma=n,ma}var ga,Ku;function vv(){if(Ku)return ga;Ku=1,ga=t;function t(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
30
|
+
`);let r=0;for(;e[r]&&e[r].trim().match(/^(#|$)/);)r++;let i=e.length,s=r+1;for(;s<i&&e[s].trim();)s++;return e.slice(r,s).join(" ").trim()}return ga}var wv={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},xv={web:"url",name:"url"},Ev={server:"start",tests:"test"},_v={topLevel:wv,bugs:xv,script:Ev},ya,Yu;function Sv(){if(Yu)return ya;Yu=1;var t=Oh(),e=$h(),r=Ih(),i=bv(),s=gh,n=["dependencies","devDependencies","optionalDependencies"],a=vv(),o=Da,c=_v,l=f=>f.includes("@")&&f.indexOf("@")<f.lastIndexOf(".");ya={warn:function(){},fixRepositoryField:function(f){if(f.repositories&&(this.warn("repositories"),f.repository=f.repositories[0]),!f.repository)return this.warn("missingRepository");typeof f.repository=="string"&&(f.repository={type:"git",url:f.repository});var v=f.repository.url||"";if(v){var E=i.fromUrl(v);E&&(v=f.repository.url=E.getDefaultRepresentation()==="shortcut"?E.https():E.toString())}v.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",v)},fixTypos:function(f){Object.keys(c.topLevel).forEach(function(v){Object.prototype.hasOwnProperty.call(f,v)&&this.warn("typo",v,c.topLevel[v])},this)},fixScriptsField:function(f){if(f.scripts){if(typeof f.scripts!="object"){this.warn("nonObjectScripts"),delete f.scripts;return}Object.keys(f.scripts).forEach(function(v){typeof f.scripts[v]!="string"?(this.warn("nonStringScript"),delete f.scripts[v]):c.script[v]&&!f.scripts[c.script[v]]&&this.warn("typo",v,c.script[v],"scripts")},this)}},fixFilesField:function(f){var v=f.files;v&&!Array.isArray(v)?(this.warn("nonArrayFiles"),delete f.files):f.files&&(f.files=f.files.filter(function(E){return!E||typeof E!="string"?(this.warn("invalidFilename",E),!1):!0},this))},fixBinField:function(f){if(f.bin&&typeof f.bin=="string"){var v={},E;(E=f.name.match(/^@[^/]+[/](.*)$/))?v[E[1]]=f.bin:v[f.name]=f.bin,f.bin=v}},fixManField:function(f){f.man&&typeof f.man=="string"&&(f.man=[f.man])},fixBundleDependenciesField:function(f){var v="bundledDependencies",E="bundleDependencies";f[v]&&!f[E]&&(f[E]=f[v],delete f[v]),f[E]&&!Array.isArray(f[E])?(this.warn("nonArrayBundleDependencies"),delete f[E]):f[E]&&(f[E]=f[E].filter(function(_){return!_||typeof _!="string"?(this.warn("nonStringBundleDependency",_),!1):(f.dependencies||(f.dependencies={}),Object.prototype.hasOwnProperty.call(f.dependencies,_)||(this.warn("nonDependencyBundleDependency",_),f.dependencies[_]="*"),!0)},this))},fixDependencies:function(f){w(f,this.warn),y(f,this.warn),this.fixBundleDependenciesField(f),["dependencies","devDependencies"].forEach(function(v){if(v in f){if(!f[v]||typeof f[v]!="object"){this.warn("nonObjectDependencies",v),delete f[v];return}Object.keys(f[v]).forEach(function(E){var _=f[v][E];typeof _!="string"&&(this.warn("nonStringDependency",E,JSON.stringify(_)),delete f[v][E]);var O=i.fromUrl(f[v][E]);O&&(f[v][E]=O.toString())},this)}},this)},fixModulesField:function(f){f.modules&&(this.warn("deprecatedModules"),delete f.modules)},fixKeywordsField:function(f){typeof f.keywords=="string"&&(f.keywords=f.keywords.split(/,\s+/)),f.keywords&&!Array.isArray(f.keywords)?(delete f.keywords,this.warn("nonArrayKeywords")):f.keywords&&(f.keywords=f.keywords.filter(function(v){return typeof v!="string"||!v?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(f,v){var E=!v;if(!f.version)return f.version="",!0;if(!t(f.version,E))throw new Error('Invalid version: "'+f.version+'"');return f.version=e(f.version,E),!0},fixPeople:function(f){h(f,p),h(f,m)},fixNameField:function(f,v){typeof v=="boolean"?v={strict:v}:typeof v>"u"&&(v={});var E=v.strict;if(!f.name&&!E){f.name="";return}if(typeof f.name!="string")throw new Error("name field must be a string.");E||(f.name=f.name.trim()),g(f.name,E,v.allowLegacyCase),s.builtinModules.includes(f.name)&&this.warn("conflictingName",f.name)},fixDescriptionField:function(f){f.description&&typeof f.description!="string"&&(this.warn("nonStringDescription"),delete f.description),f.readme&&!f.description&&(f.description=a(f.readme)),f.description===void 0&&delete f.description,f.description||this.warn("missingDescription")},fixReadmeField:function(f){f.readme||(this.warn("missingReadme"),f.readme="ERROR: No README data found!")},fixBugsField:function(f){if(!f.bugs&&f.repository&&f.repository.url){var v=i.fromUrl(f.repository.url);v&&v.bugs()&&(f.bugs={url:v.bugs()})}else if(f.bugs){if(typeof f.bugs=="string")l(f.bugs)?f.bugs={email:f.bugs}:o.parse(f.bugs).protocol?f.bugs={url:f.bugs}:this.warn("nonEmailUrlBugsString");else{x(f.bugs,this.warn);var E=f.bugs;f.bugs={},E.url&&(typeof E.url=="string"&&o.parse(E.url).protocol?f.bugs.url=E.url:this.warn("nonUrlBugsUrlField")),E.email&&(typeof E.email=="string"&&l(E.email)?f.bugs.email=E.email:this.warn("nonEmailBugsEmailField"))}!f.bugs.email&&!f.bugs.url&&(delete f.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(f){if(!f.homepage&&f.repository&&f.repository.url){var v=i.fromUrl(f.repository.url);v&&v.docs()&&(f.homepage=v.docs())}if(f.homepage){if(typeof f.homepage!="string")return this.warn("nonUrlHomepage"),delete f.homepage;o.parse(f.homepage).protocol||(f.homepage="http://"+f.homepage)}},fixLicenseField:function(f){let v=f.license||f.licence;if(!v)return this.warn("missingLicense");if(typeof v!="string"||v.length<1||v.trim()==="")return this.warn("invalidLicense");if(!r(v).validForNewPackages)return this.warn("invalidLicense")}};function u(f){if(f.charAt(0)!=="@")return!1;var v=f.slice(1).split("/");return v.length!==2?!1:v[0]&&v[1]&&v[0]===encodeURIComponent(v[0])&&v[1]===encodeURIComponent(v[1])}function d(f){return!f.match(/[/@\s+%:]/)&&f===encodeURIComponent(f)}function g(f,v,E){if(f.charAt(0)==="."||!(u(f)||d(f))||v&&!E&&f!==f.toLowerCase()||f.toLowerCase()==="node_modules"||f.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(f))}function h(f,v){return f.author&&(f.author=v(f.author)),["maintainers","contributors"].forEach(function(E){Array.isArray(f[E])&&(f[E]=f[E].map(v))}),f}function p(f){if(typeof f=="string")return f;var v=f.name||"",E=f.url||f.web,_=E?" ("+E+")":"",O=f.email||f.mail,C=O?" <"+O+">":"";return v+C+_}function m(f){if(typeof f!="string")return f;var v=f.match(/^([^(<]+)/),E=f.match(/\(([^()]+)\)/),_=f.match(/<([^<>]+)>/),O={};return v&&v[0].trim()&&(O.name=v[0].trim()),_&&(O.email=_[1]),E&&(O.url=E[1]),O}function y(f){var v=f.optionalDependencies;if(v){var E=f.dependencies||{};Object.keys(v).forEach(function(_){E[_]=v[_]}),f.dependencies=E}}function b(f,v,E){if(!f)return{};if(typeof f=="string"&&(f=f.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(f))return f;E("deprecatedArrayDependencies",v);var _={};return f.filter(function(O){return typeof O=="string"}).forEach(function(O){O=O.trim().split(/(:?[@\s><=])/);var C=O.shift(),$=O.join("");$=$.trim(),$=$.replace(/^@/,""),_[C]=$}),_}function w(f,v){n.forEach(function(E){f[E]&&(f[E]=b(f[E],E,v))})}function x(f,v){f&&Object.keys(f).forEach(function(E){c.bugs[E]&&(v("typo",E,c.bugs[E],"bugs"),f[c.bugs[E]]=f[E],delete f[E])})}return ya}var Rv="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Cv="No repository field.",Av="Probably broken git url: %s",Lv="scripts must be an object",Ov="script values must be string commands",$v="Invalid 'files' member",Tv="Invalid filename in 'files' list: %s",Pv="Invalid 'bundleDependencies' list. Must be array of package names",Iv="Invalid bundleDependencies member: %s",Fv="Non-dependency in bundleDependencies: %s",Nv="%s field must be an object",Dv="Invalid dependency: %s %s",Mv="specifying %s as array is deprecated",kv="modules field is deprecated",jv="keywords should be an array of strings",Bv="keywords should be an array of strings",Uv="%s is also the name of a node core module.",Gv="'description' field should be a string",zv="No description",qv="No README data",Wv="No license field.",Vv="Bug string field must be url, email, or {email,url}",Hv="bugs.url field must be a string url. Deleted.",Kv="bugs.email field must be a string email. Deleted.",Yv="Normalized value of bugs field is an empty object. Deleted.",Xv="homepage field must be a string url. Deleted.",Jv="license should be a valid SPDX license expression",Zv="%s should probably be %s.",Qv={repositories:Rv,missingRepository:Cv,brokenGitUrl:Av,nonObjectScripts:Lv,nonStringScript:Ov,nonArrayFiles:$v,invalidFilename:Tv,nonArrayBundleDependencies:Pv,nonStringBundleDependency:Iv,nonDependencyBundleDependency:Fv,nonObjectDependencies:Nv,nonStringDependency:Dv,deprecatedArrayDependencies:Mv,deprecatedModules:kv,nonArrayKeywords:jv,nonStringKeyword:Bv,conflictingName:Uv,nonStringDescription:Gv,missingDescription:zv,missingReadme:qv,missingLicense:Wv,nonEmailUrlBugsString:Vv,nonUrlBugsUrlField:Hv,nonEmailBugsEmailField:Kv,emptyNormalizedBugs:Yv,nonUrlHomepage:Xv,invalidLicense:Jv,typo:Zv},ba,Xu;function ew(){if(Xu)return ba;Xu=1;var t=mh,e=Qv;ba=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return r.apply(null,i);var n=e[s]?e[s]:s+": '%s'";return i.unshift(n),t.format.apply(null,i)};function r(i,s,n){return n&&(i=n+"['"+i+"']",s=n+"['"+s+"']"),t.format(e.typo,i,s)}return ba}var va,Ju;function tw(){if(Ju)return va;Ju=1,va=n;var t=Sv();n.fixer=t;var e=ew(),r=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=r.map(function(o){return a(o)+"Field"});s=s.concat(i);function n(o,c,l){c===!0&&(c=null,l=!0),l||(l=!1),(!c||o.private)&&(c=function(){}),o.scripts&&o.scripts.install==="node-gyp rebuild"&&!o.scripts.preinstall&&(o.gypfile=!0),t.warn=function(){c(e.apply(null,arguments))},s.forEach(function(u){t["fix"+a(u)](o,l)}),o._id=o.name+"@"+o.version}function a(o){return o.charAt(0).toUpperCase()+o.slice(1)}return va}var rw=tw(),iw=Qs(rw);function sw(t){return t instanceof URL?yh(t):t}var nw=t=>Gt.resolve(sw(t)??".","package.json"),ow=(t,e)=>{let r=typeof t=="string"?nv(t):t;return e&&iw(r),r};function aw({cwd:t,normalize:e=!0}={}){let r=bh.readFileSync(nw(t),"utf8");return ow(r,e)}function Nh(t){let e=Vb("package.json",t);if(e)return{packageJson:aw({...t,cwd:Gt.dirname(e)}),path:e}}var Gi={},Zu;function cw(){if(Zu)return Gi;Zu=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.LRUCache=void 0;let t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e=new Set,r=typeof process=="object"&&process?process:{},i=(g,h,p,m)=>{typeof r.emitWarning=="function"?r.emitWarning(g,h,p,m):console.error(`[${p}] ${h}: ${g}`)},s=globalThis.AbortController,n=globalThis.AbortSignal;if(typeof s>"u"){n=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(m,y){this._onabort.push(y)}},s=class{constructor(){h()}signal=new n;abort(m){if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let y of this.signal._onabort)y(m);this.signal.onabort?.(m)}}};let g=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",h=()=>{g&&(g=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",h))}}let a=g=>!e.has(g),o=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),c=g=>o(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?l:null:null;class l extends Array{constructor(h){super(h),this.fill(0)}}class u{heap;length;static#t=!1;static create(h){let p=c(h);if(!p)return[];u.#t=!0;let m=new u(h,p);return u.#t=!1,m}constructor(h,p){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new p(h),this.length=0}push(h){this.heap[this.length++]=h}pop(){return this.heap[--this.length]}}class d{#t;#r;#e;#n;#h;#w;#a;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#c;#i;#l;#o;#d;#g;#y;#p;#C;#x;#E;#_;#S;#v;#P;#A;#f;static unsafeExposeInternals(h){return{starts:h.#_,ttls:h.#S,sizes:h.#E,keyMap:h.#i,keyList:h.#l,valList:h.#o,next:h.#d,prev:h.#g,get head(){return h.#y},get tail(){return h.#p},free:h.#C,isBackgroundFetch:p=>h.#b(p),backgroundFetch:(p,m,y,b)=>h.#D(p,m,y,b),moveToTail:p=>h.#z(p),indexes:p=>h.#T(p),rindexes:p=>h.#F(p),isStale:p=>h.#O(p)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#c}get size(){return this.#s}get fetchMethod(){return this.#w}get memoMethod(){return this.#a}get dispose(){return this.#e}get onInsert(){return this.#n}get disposeAfter(){return this.#h}constructor(h){let{max:p=0,ttl:m,ttlResolution:y=1,ttlAutopurge:b,updateAgeOnGet:w,updateAgeOnHas:x,allowStale:f,dispose:v,onInsert:E,disposeAfter:_,noDisposeOnSet:O,noUpdateTTL:C,maxSize:$=0,maxEntrySize:F=0,sizeCalculation:M,fetchMethod:I,memoMethod:Y,noDeleteOnFetchRejection:Z,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:V,allowStaleOnFetchAbort:se,ignoreFetchAbort:ee,perf:we}=h;if(we!==void 0&&typeof we?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=we??t,p!==0&&!o(p))throw new TypeError("max option must be a nonnegative integer");let xe=p?c(p):Array;if(!xe)throw new Error("invalid max value: "+p);if(this.#t=p,this.#r=$,this.maxEntrySize=F||this.#r,this.sizeCalculation=M,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Y!==void 0&&typeof Y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#a=Y,I!==void 0&&typeof I!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#w=I,this.#P=!!I,this.#i=new Map,this.#l=new Array(p).fill(void 0),this.#o=new Array(p).fill(void 0),this.#d=new xe(p),this.#g=new xe(p),this.#y=0,this.#p=0,this.#C=u.create(p),this.#s=0,this.#c=0,typeof v=="function"&&(this.#e=v),typeof E=="function"&&(this.#n=E),typeof _=="function"?(this.#h=_,this.#x=[]):(this.#h=void 0,this.#x=void 0),this.#v=!!this.#e,this.#f=!!this.#n,this.#A=!!this.#h,this.noDisposeOnSet=!!O,this.noUpdateTTL=!!C,this.noDeleteOnFetchRejection=!!Z,this.allowStaleOnFetchRejection=!!V,this.allowStaleOnFetchAbort=!!se,this.ignoreFetchAbort=!!ee,this.maxEntrySize!==0){if(this.#r!==0&&!o(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!w,this.updateAgeOnHas=!!x,this.ttlResolution=o(y)||y===0?y:1,this.ttlAutopurge=!!b,this.ttl=m||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let Oe="LRU_CACHE_UNBOUNDED";a(Oe)&&(e.add(Oe),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Oe,d))}}getRemainingTTL(h){return this.#i.has(h)?1/0:0}#M(){let h=new l(this.#t),p=new l(this.#t);this.#S=h,this.#_=p,this.#N=(b,w,x=this.#u.now())=>{if(p[b]=w!==0?x:0,h[b]=w,w!==0&&this.ttlAutopurge){let f=setTimeout(()=>{this.#O(b)&&this.#U(this.#l[b],"expire")},w+1);f.unref&&f.unref()}},this.#R=b=>{p[b]=h[b]!==0?this.#u.now():0},this.#I=(b,w)=>{if(h[w]){let x=h[w],f=p[w];if(!x||!f)return;b.ttl=x,b.start=f,b.now=m||y();let v=b.now-f;b.remainingTTL=x-v}};let m=0,y=()=>{let b=this.#u.now();if(this.ttlResolution>0){m=b;let w=setTimeout(()=>m=0,this.ttlResolution);w.unref&&w.unref()}return b};this.getRemainingTTL=b=>{let w=this.#i.get(b);if(w===void 0)return 0;let x=h[w],f=p[w];if(!x||!f)return 1/0;let v=(m||y())-f;return x-v},this.#O=b=>{let w=p[b],x=h[b];return!!x&&!!w&&(m||y())-w>x}}#R=()=>{};#I=()=>{};#N=()=>{};#O=()=>!1;#B(){let h=new l(this.#t);this.#c=0,this.#E=h,this.#L=p=>{this.#c-=h[p],h[p]=0},this.#k=(p,m,y,b)=>{if(this.#b(m))return 0;if(!o(y))if(b){if(typeof b!="function")throw new TypeError("sizeCalculation must be a function");if(y=b(m,p),!o(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return y},this.#$=(p,m,y)=>{if(h[p]=m,this.#r){let b=this.#r-h[p];for(;this.#c>b;)this.#j(!0)}this.#c+=h[p],y&&(y.entrySize=m,y.totalCalculatedSize=this.#c)}}#L=h=>{};#$=(h,p,m)=>{};#k=(h,p,m,y)=>{if(m||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:h=this.allowStale}={}){if(this.#s)for(let p=this.#p;!(!this.#m(p)||((h||!this.#O(p))&&(yield p),p===this.#y));)p=this.#g[p]}*#F({allowStale:h=this.allowStale}={}){if(this.#s)for(let p=this.#y;!(!this.#m(p)||((h||!this.#O(p))&&(yield p),p===this.#p));)p=this.#d[p]}#m(h){return h!==void 0&&this.#i.get(this.#l[h])===h}*entries(){for(let h of this.#T())this.#o[h]!==void 0&&this.#l[h]!==void 0&&!this.#b(this.#o[h])&&(yield[this.#l[h],this.#o[h]])}*rentries(){for(let h of this.#F())this.#o[h]!==void 0&&this.#l[h]!==void 0&&!this.#b(this.#o[h])&&(yield[this.#l[h],this.#o[h]])}*keys(){for(let h of this.#T()){let p=this.#l[h];p!==void 0&&!this.#b(this.#o[h])&&(yield p)}}*rkeys(){for(let h of this.#F()){let p=this.#l[h];p!==void 0&&!this.#b(this.#o[h])&&(yield p)}}*values(){for(let h of this.#T())this.#o[h]!==void 0&&!this.#b(this.#o[h])&&(yield this.#o[h])}*rvalues(){for(let h of this.#F())this.#o[h]!==void 0&&!this.#b(this.#o[h])&&(yield this.#o[h])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(h,p={}){for(let m of this.#T()){let y=this.#o[m],b=this.#b(y)?y.__staleWhileFetching:y;if(b!==void 0&&h(b,this.#l[m],this))return this.get(this.#l[m],p)}}forEach(h,p=this){for(let m of this.#T()){let y=this.#o[m],b=this.#b(y)?y.__staleWhileFetching:y;b!==void 0&&h.call(p,b,this.#l[m],this)}}rforEach(h,p=this){for(let m of this.#F()){let y=this.#o[m],b=this.#b(y)?y.__staleWhileFetching:y;b!==void 0&&h.call(p,b,this.#l[m],this)}}purgeStale(){let h=!1;for(let p of this.#F({allowStale:!0}))this.#O(p)&&(this.#U(this.#l[p],"expire"),h=!0);return h}info(h){let p=this.#i.get(h);if(p===void 0)return;let m=this.#o[p],y=this.#b(m)?m.__staleWhileFetching:m;if(y===void 0)return;let b={value:y};if(this.#S&&this.#_){let w=this.#S[p],x=this.#_[p];if(w&&x){let f=w-(this.#u.now()-x);b.ttl=f,b.start=Date.now()}}return this.#E&&(b.size=this.#E[p]),b}dump(){let h=[];for(let p of this.#T({allowStale:!0})){let m=this.#l[p],y=this.#o[p],b=this.#b(y)?y.__staleWhileFetching:y;if(b===void 0||m===void 0)continue;let w={value:b};if(this.#S&&this.#_){w.ttl=this.#S[p];let x=this.#u.now()-this.#_[p];w.start=Math.floor(Date.now()-x)}this.#E&&(w.size=this.#E[p]),h.unshift([m,w])}return h}load(h){this.clear();for(let[p,m]of h){if(m.start){let y=Date.now()-m.start;m.start=this.#u.now()-y}this.set(p,m.value,m)}}set(h,p,m={}){if(p===void 0)return this.delete(h),this;let{ttl:y=this.ttl,start:b,noDisposeOnSet:w=this.noDisposeOnSet,sizeCalculation:x=this.sizeCalculation,status:f}=m,{noUpdateTTL:v=this.noUpdateTTL}=m,E=this.#k(h,p,m.size||0,x);if(this.maxEntrySize&&E>this.maxEntrySize)return f&&(f.set="miss",f.maxEntrySizeExceeded=!0),this.#U(h,"set"),this;let _=this.#s===0?void 0:this.#i.get(h);if(_===void 0)_=this.#s===0?this.#p:this.#C.length!==0?this.#C.pop():this.#s===this.#t?this.#j(!1):this.#s,this.#l[_]=h,this.#o[_]=p,this.#i.set(h,_),this.#d[this.#p]=_,this.#g[_]=this.#p,this.#p=_,this.#s++,this.#$(_,E,f),f&&(f.set="add"),v=!1,this.#f&&this.#n?.(p,h,"add");else{this.#z(_);let O=this.#o[_];if(p!==O){if(this.#P&&this.#b(O)){O.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:C}=O;C!==void 0&&!w&&(this.#v&&this.#e?.(C,h,"set"),this.#A&&this.#x?.push([C,h,"set"]))}else w||(this.#v&&this.#e?.(O,h,"set"),this.#A&&this.#x?.push([O,h,"set"]));if(this.#L(_),this.#$(_,E,f),this.#o[_]=p,f){f.set="replace";let C=O&&this.#b(O)?O.__staleWhileFetching:O;C!==void 0&&(f.oldValue=C)}}else f&&(f.set="update");this.#f&&this.onInsert?.(p,h,p===O?"update":"replace")}if(y!==0&&!this.#S&&this.#M(),this.#S&&(v||this.#N(_,y,b),f&&this.#I(f,_)),!w&&this.#A&&this.#x){let O=this.#x,C;for(;C=O?.shift();)this.#h?.(...C)}return this}pop(){try{for(;this.#s;){let h=this.#o[this.#y];if(this.#j(!0),this.#b(h)){if(h.__staleWhileFetching)return h.__staleWhileFetching}else if(h!==void 0)return h}}finally{if(this.#A&&this.#x){let h=this.#x,p;for(;p=h?.shift();)this.#h?.(...p)}}}#j(h){let p=this.#y,m=this.#l[p],y=this.#o[p];return this.#P&&this.#b(y)?y.__abortController.abort(new Error("evicted")):(this.#v||this.#A)&&(this.#v&&this.#e?.(y,m,"evict"),this.#A&&this.#x?.push([y,m,"evict"])),this.#L(p),h&&(this.#l[p]=void 0,this.#o[p]=void 0,this.#C.push(p)),this.#s===1?(this.#y=this.#p=0,this.#C.length=0):this.#y=this.#d[p],this.#i.delete(m),this.#s--,p}has(h,p={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=p,b=this.#i.get(h);if(b!==void 0){let w=this.#o[b];if(this.#b(w)&&w.__staleWhileFetching===void 0)return!1;if(this.#O(b))y&&(y.has="stale",this.#I(y,b));else return m&&this.#R(b),y&&(y.has="hit",this.#I(y,b)),!0}else y&&(y.has="miss");return!1}peek(h,p={}){let{allowStale:m=this.allowStale}=p,y=this.#i.get(h);if(y===void 0||!m&&this.#O(y))return;let b=this.#o[y];return this.#b(b)?b.__staleWhileFetching:b}#D(h,p,m,y){let b=p===void 0?void 0:this.#o[p];if(this.#b(b))return b;let w=new s,{signal:x}=m;x?.addEventListener("abort",()=>w.abort(x.reason),{signal:w.signal});let f={signal:w.signal,options:m,context:y},v=(F,M=!1)=>{let{aborted:I}=w.signal,Y=m.ignoreFetchAbort&&F!==void 0;if(m.status&&(I&&!M?(m.status.fetchAborted=!0,m.status.fetchError=w.signal.reason,Y&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),I&&!Y&&!M)return _(w.signal.reason);let Z=C;return this.#o[p]===C&&(F===void 0?Z.__staleWhileFetching!==void 0?this.#o[p]=Z.__staleWhileFetching:this.#U(h,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(h,F,f.options))),F},E=F=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=F),_(F)),_=F=>{let{aborted:M}=w.signal,I=M&&m.allowStaleOnFetchAbort,Y=I||m.allowStaleOnFetchRejection,Z=Y||m.noDeleteOnFetchRejection,G=C;if(this.#o[p]===C&&(!Z||G.__staleWhileFetching===void 0?this.#U(h,"fetch"):I||(this.#o[p]=G.__staleWhileFetching)),Y)return m.status&&G.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw F},O=(F,M)=>{let I=this.#w?.(h,b,f);I&&I instanceof Promise&&I.then(Y=>F(Y===void 0?void 0:Y),M),w.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(F(void 0),m.allowStaleOnFetchAbort&&(F=Y=>v(Y,!0)))})};m.status&&(m.status.fetchDispatched=!0);let C=new Promise(O).then(v,E),$=Object.assign(C,{__abortController:w,__staleWhileFetching:b,__returned:void 0});return p===void 0?(this.set(h,$,{...f.options,status:void 0}),p=this.#i.get(h)):this.#o[p]=$,$}#b(h){if(!this.#P)return!1;let p=h;return!!p&&p instanceof Promise&&p.hasOwnProperty("__staleWhileFetching")&&p.__abortController instanceof s}async fetch(h,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,ttl:w=this.ttl,noDisposeOnSet:x=this.noDisposeOnSet,size:f=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:E=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:O=this.allowStaleOnFetchRejection,ignoreFetchAbort:C=this.ignoreFetchAbort,allowStaleOnFetchAbort:$=this.allowStaleOnFetchAbort,context:F,forceRefresh:M=!1,status:I,signal:Y}=p;if(!this.#P)return I&&(I.fetch="get"),this.get(h,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:b,status:I});let Z={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:b,ttl:w,noDisposeOnSet:x,size:f,sizeCalculation:v,noUpdateTTL:E,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:$,ignoreFetchAbort:C,status:I,signal:Y},G=this.#i.get(h);if(G===void 0){I&&(I.fetch="miss");let V=this.#D(h,G,Z,F);return V.__returned=V}else{let V=this.#o[G];if(this.#b(V)){let Oe=m&&V.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",Oe&&(I.returnedStale=!0)),Oe?V.__staleWhileFetching:V.__returned=V}let se=this.#O(G);if(!M&&!se)return I&&(I.fetch="hit"),this.#z(G),y&&this.#R(G),I&&this.#I(I,G),V;let ee=this.#D(h,G,Z,F),xe=ee.__staleWhileFetching!==void 0&&m;return I&&(I.fetch=se?"stale":"refresh",xe&&se&&(I.returnedStale=!0)),xe?ee.__staleWhileFetching:ee.__returned=ee}}async forceFetch(h,p={}){let m=await this.fetch(h,p);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(h,p={}){let m=this.#a;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:b,...w}=p,x=this.get(h,w);if(!b&&x!==void 0)return x;let f=m(h,x,{options:w,context:y});return this.set(h,f,w),f}get(h,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,status:w}=p,x=this.#i.get(h);if(x!==void 0){let f=this.#o[x],v=this.#b(f);return w&&this.#I(w,x),this.#O(x)?(w&&(w.get="stale"),v?(w&&m&&f.__staleWhileFetching!==void 0&&(w.returnedStale=!0),m?f.__staleWhileFetching:void 0):(b||this.#U(h,"expire"),w&&m&&(w.returnedStale=!0),m?f:void 0)):(w&&(w.get="hit"),v?f.__staleWhileFetching:(this.#z(x),y&&this.#R(x),f))}else w&&(w.get="miss")}#G(h,p){this.#g[p]=h,this.#d[h]=p}#z(h){h!==this.#p&&(h===this.#y?this.#y=this.#d[h]:this.#G(this.#g[h],this.#d[h]),this.#G(this.#p,h),this.#p=h)}delete(h){return this.#U(h,"delete")}#U(h,p){let m=!1;if(this.#s!==0){let y=this.#i.get(h);if(y!==void 0)if(m=!0,this.#s===1)this.#q(p);else{this.#L(y);let b=this.#o[y];if(this.#b(b)?b.__abortController.abort(new Error("deleted")):(this.#v||this.#A)&&(this.#v&&this.#e?.(b,h,p),this.#A&&this.#x?.push([b,h,p])),this.#i.delete(h),this.#l[y]=void 0,this.#o[y]=void 0,y===this.#p)this.#p=this.#g[y];else if(y===this.#y)this.#y=this.#d[y];else{let w=this.#g[y];this.#d[w]=this.#d[y];let x=this.#d[y];this.#g[x]=this.#g[y]}this.#s--,this.#C.push(y)}}if(this.#A&&this.#x?.length){let y=this.#x,b;for(;b=y?.shift();)this.#h?.(...b)}return m}clear(){return this.#q("delete")}#q(h){for(let p of this.#F({allowStale:!0})){let m=this.#o[p];if(this.#b(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#l[p];this.#v&&this.#e?.(m,y,h),this.#A&&this.#x?.push([m,y,h])}}if(this.#i.clear(),this.#o.fill(void 0),this.#l.fill(void 0),this.#S&&this.#_&&(this.#S.fill(0),this.#_.fill(0)),this.#E&&this.#E.fill(0),this.#y=0,this.#p=0,this.#C.length=0,this.#c=0,this.#s=0,this.#A&&this.#x){let p=this.#x,m;for(;m=p?.shift();)this.#h?.(...m)}}}return Gi.LRUCache=d,Gi}var wa,Qu;function lw(){if(Qu)return wa;Qu=1;let t=(...n)=>n.every(a=>a)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",r=n=>n.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:n,user:a,project:o,committish:c})=>`git@${n}:${a}/${o}.git${t("#",c)}`,sshurltemplate:({domain:n,user:a,project:o,committish:c})=>`git+ssh://git@${n}/${a}/${o}.git${t("#",c)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l,path:u})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u)}`,browsetemplate:({domain:n,user:a,project:o,committish:c,treepath:l})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c))}`,browsetreetemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,fragment:d,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(d||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:d,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(d||""))}`,docstemplate:({domain:n,user:a,project:o,treepath:c,committish:l})=>`https://${n}/${a}/${o}${t("/",c,"/",e(l))}#readme`,httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/raw/${e(c||"HEAD")}/${l}`,shortcuttemplate:({type:n,user:a,project:o,committish:c})=>`${n}:${a}/${o}${t("#",c)}`,pathtemplate:({user:n,project:a,committish:o})=>`${n}/${a}${t("#",o)}`,bugstemplate:({domain:n,user:a,project:o})=>`https://${n}/${a}/${o}/issues`,hashformat:r},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:a,project:o,committish:c,path:l})=>`https://${t(n,"@")}raw.githubusercontent.com/${a}/${o}/${e(c||"HEAD")}/${l}`,gittemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://codeload.${n}/${a}/${o}/tar.gz/${e(c||"HEAD")}`,extract:n=>{let[,a,o,c,l]=n.pathname.split("/",5);if(!(c&&c!=="tree")&&(c||(l=n.hash.slice(1)),o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:l}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,editpath:d})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,d)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/get/${e(c||"HEAD")}.tar.gz`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["get"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/repository/archive.tar.gz?ref=${e(c||"HEAD")}`,extract:n=>{let a=n.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;let o=a.split("/"),c=o.pop();c.endsWith(".git")&&(c=c.slice(0,-4));let l=o.join("/");if(!(!l||!c))return{user:l,project:c,committish:n.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:a,committish:o})=>`git@${n}:${a}.git${t("#",o)}`,sshurltemplate:({domain:n,project:a,committish:o})=>`git+ssh://git@${n}/${a}.git${t("#",o)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l})=>`https://${n}/${a}/${o}${t("/",e(c))}/${l}`,browsetemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,browsetreetemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,browseblobtemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,docstemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,httpstemplate:({domain:n,project:a,committish:o})=>`git+https://${n}/${a}.git${t("#",o)}`,filetemplate:({user:n,project:a,committish:o,path:c})=>`https://gist.githubusercontent.com/${n}/${a}/raw${t("/",e(o))}/${c}`,shortcuttemplate:({type:n,project:a,committish:o})=>`${n}:${a}${t("#",o)}`,pathtemplate:({project:n,committish:a})=>`${n}${t("#",a)}`,bugstemplate:({domain:n,project:a})=>`https://${n}/${a}`,gittemplate:({domain:n,project:a,committish:o})=>`git://${n}/${a}.git${t("#",o)}`,tarballtemplate:({project:n,committish:a})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(a||"HEAD")}`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(c!=="raw"){if(!o){if(!a)return;o=a,a=null}return o.endsWith(".git")&&(o=o.slice(0,-4)),{user:a,project:o,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+r(n)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/blob/${e(c)||"HEAD"}/${l}`,httpstemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}.git${t("#",c)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/archive/${e(c)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["archive"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}};for(let[n,a]of Object.entries(s))s[n]=Object.assign({},i,a);return wa=s,wa}var xa,eh;function Dh(){if(eh)return xa;eh=1;let t=Da,e=(n,a,o)=>{let c=n.indexOf(o);return n.lastIndexOf(a,c>-1?c:1/0)},r=n=>{try{return new t.URL(n)}catch{}},i=(n,a)=>{let o=n.indexOf(":"),c=n.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(a,c))return n;let l=n.indexOf("@");return l>-1?l>o?`git+ssh://${n}`:n:n.indexOf("//")===o+1?n:`${n.slice(0,o+1)}//${n.slice(o+1)}`},s=n=>{let a=e(n,"@","#"),o=e(n,":","#");return o>a&&(n=n.slice(0,o)+"/"+n.slice(o+1)),e(n,":","#")===-1&&n.indexOf("//")===-1&&(n=`git+ssh://${n}`),n};return xa=(n,a)=>{let o=a?i(n,a):n;return r(o)||r(s(o))},xa}var Ea,th;function uw(){if(th)return Ea;th=1;let t=Dh(),e=r=>{let i=r.indexOf("#"),s=r.indexOf("/"),n=r.indexOf("/",s+1),a=r.indexOf(":"),o=/\s/.exec(r),c=r.indexOf("@"),l=!o||i>-1&&o.index>i,u=c===-1||i>-1&&c>i,d=a===-1||i>-1&&a>i,g=n===-1||i>-1&&n>i,h=s>0,p=i>-1?r[i-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&h&&p&&m&&u&&d&&g};return Ea=(r,i,{gitHosts:s,protocols:n})=>{if(!r)return;let a=e(r)?`github:${r}`:r,o=t(a,n);if(!o)return;let c=s.byShortcut[o.protocol],l=s.byDomain[o.hostname.startsWith("www.")?o.hostname.slice(4):o.hostname],u=c||l;if(!u)return;let d=s[c||l],g=null;n[o.protocol]?.auth&&(o.username||o.password)&&(g=`${o.username}${o.password?":"+o.password:""}`);let h=null,p=null,m=null,y=null;try{if(c){let b=o.pathname.startsWith("/")?o.pathname.slice(1):o.pathname,w=b.indexOf("@");w>-1&&(b=b.slice(w+1));let x=b.lastIndexOf("/");x>-1?(p=decodeURIComponent(b.slice(0,x)),p||(p=null),m=decodeURIComponent(b.slice(x+1))):m=decodeURIComponent(b),m.endsWith(".git")&&(m=m.slice(0,-4)),o.hash&&(h=decodeURIComponent(o.hash.slice(1))),y="shortcut"}else{if(!d.protocols.includes(o.protocol))return;let b=d.extract(o);if(!b)return;p=b.user&&decodeURIComponent(b.user),m=decodeURIComponent(b.project),h=decodeURIComponent(b.committish),y=n[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(b){if(b instanceof URIError)return;throw b}return[u,p,g,m,h,y,i]},Ea}var _a,rh;function hw(){if(rh)return _a;rh=1;let{LRUCache:t}=cw(),e=lw(),r=uw(),i=Dh(),s=new t({max:1e3});function n(o){try{let{protocol:c,hostname:l,pathname:u}=new URL(o);if(!l)return null;let d=/(?:git\+)http:$/.test(c)?"http:":"https:",g=u.replace(/\.git$/,"");return`${d}//${l}${g}`}catch{return null}}class a{constructor(c,l,u,d,g,h,p={}){Object.assign(this,a.#t[c],{type:c,user:l,auth:u,project:d,committish:g,default:h,opts:p})}static#t={byShortcut:{},byDomain:{}};static#r={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(c,l){a.#t[c]=l,a.#t.byDomain[l.domain]=c,a.#t.byShortcut[`${c}:`]=c,a.#r[`${c}:`]={name:c}}static fromUrl(c,l){if(typeof c!="string")return;let u=c+JSON.stringify(l||{});if(!s.has(u)){let d=r(c,l,{gitHosts:a.#t,protocols:a.#r});s.set(u,d?new a(...d):void 0)}return s.get(u)}static fromManifest(c,l={}){if(!c||typeof c!="object")return;let u=c.repository,d=u&&(typeof u=="string"?u:typeof u=="object"&&typeof u.url=="string"?u.url:null);if(!d)throw new Error("no repository");let g=d&&a.fromUrl(d.replace(/^git\+/,""),l)||null;if(g)return g;let h=n(d);return a.fromUrl(h,l)||h}static parseUrl(c){return i(c)}#e(c,l){if(typeof c!="function")return null;let u={...this,...this.opts,...l};u.path||(u.path=""),u.path.startsWith("/")&&(u.path=u.path.slice(1)),u.noCommittish&&(u.committish=null);let d=c(u);return u.noGitPlus&&d.startsWith("git+")?d.slice(4):d}hash(){return this.committish?`#${this.committish}`:""}ssh(c){return this.#e(this.sshtemplate,c)}sshurl(c){return this.#e(this.sshurltemplate,c)}browse(c,...l){return typeof c!="string"?this.#e(this.browsetemplate,c):typeof l[0]!="string"?this.#e(this.browsetreetemplate,{...l[0],path:c}):this.#e(this.browsetreetemplate,{...l[1],fragment:l[0],path:c})}browseFile(c,...l){return typeof l[0]!="string"?this.#e(this.browseblobtemplate,{...l[0],path:c}):this.#e(this.browseblobtemplate,{...l[1],fragment:l[0],path:c})}docs(c){return this.#e(this.docstemplate,c)}bugs(c){return this.#e(this.bugstemplate,c)}https(c){return this.#e(this.httpstemplate,c)}git(c){return this.#e(this.gittemplate,c)}shortcut(c){return this.#e(this.shortcuttemplate,c)}path(c){return this.#e(this.pathtemplate,c)}tarball(c){return this.#e(this.tarballtemplate,{...c,noCommittish:!1})}file(c,l){return this.#e(this.filetemplate,{...l,path:c})}edit(c,l){return this.#e(this.edittemplate,{...l,path:c})}getDefaultRepresentation(){return this.default}toString(c){return this.default&&typeof this[this.default]=="function"?this[this.default](c):this.sshurl(c)}}for(let[o,c]of Object.entries(e))a.addHost(o,c);return _a=a,_a}var Sa,ih;function fw(){if(ih)return Sa;ih=1,Sa=t;function t(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
31
|
+
`);let r=0;for(;e[r]&&e[r].trim().match(/^(#|$)/);)r++;let i=e.length,s=r+1;for(;s<i&&e[s].trim();)s++;return e.slice(r,s).join(" ").trim()}return Sa}var pw={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},dw={web:"url",name:"url"},mw={server:"start",tests:"test"},gw={topLevel:pw,bugs:dw,script:mw},Ra,sh;function yw(){if(sh)return Ra;sh=1;var{URL:t}=Lb,e=Oh(),r=$h(),i=Ih(),s=hw(),{isBuiltin:n}=gh,a=["dependencies","devDependencies","optionalDependencies"],o=fw(),c=gw,l=f=>f.includes("@")&&f.indexOf("@")<f.lastIndexOf(".");Ra={warn:function(){},fixRepositoryField:function(f){if(f.repositories&&(this.warn("repositories"),f.repository=f.repositories[0]),!f.repository)return this.warn("missingRepository");typeof f.repository=="string"&&(f.repository={type:"git",url:f.repository});var v=f.repository.url||"";if(v){var E=s.fromUrl(v);E&&(v=f.repository.url=E.getDefaultRepresentation()==="shortcut"?E.https():E.toString())}v.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",v)},fixTypos:function(f){Object.keys(c.topLevel).forEach(function(v){Object.prototype.hasOwnProperty.call(f,v)&&this.warn("typo",v,c.topLevel[v])},this)},fixScriptsField:function(f){if(f.scripts){if(typeof f.scripts!="object"){this.warn("nonObjectScripts"),delete f.scripts;return}Object.keys(f.scripts).forEach(function(v){typeof f.scripts[v]!="string"?(this.warn("nonStringScript"),delete f.scripts[v]):c.script[v]&&!f.scripts[c.script[v]]&&this.warn("typo",v,c.script[v],"scripts")},this)}},fixFilesField:function(f){var v=f.files;v&&!Array.isArray(v)?(this.warn("nonArrayFiles"),delete f.files):f.files&&(f.files=f.files.filter(function(E){return!E||typeof E!="string"?(this.warn("invalidFilename",E),!1):!0},this))},fixBinField:function(f){if(f.bin&&typeof f.bin=="string"){var v={},E;(E=f.name.match(/^@[^/]+[/](.*)$/))?v[E[1]]=f.bin:v[f.name]=f.bin,f.bin=v}},fixManField:function(f){f.man&&typeof f.man=="string"&&(f.man=[f.man])},fixBundleDependenciesField:function(f){var v="bundledDependencies",E="bundleDependencies";f[v]&&!f[E]&&(f[E]=f[v],delete f[v]),f[E]&&!Array.isArray(f[E])?(this.warn("nonArrayBundleDependencies"),delete f[E]):f[E]&&(f[E]=f[E].filter(function(_){return!_||typeof _!="string"?(this.warn("nonStringBundleDependency",_),!1):(f.dependencies||(f.dependencies={}),Object.prototype.hasOwnProperty.call(f.dependencies,_)||(this.warn("nonDependencyBundleDependency",_),f.dependencies[_]="*"),!0)},this))},fixDependencies:function(f){w(f,this.warn),y(f,this.warn),this.fixBundleDependenciesField(f),["dependencies","devDependencies"].forEach(function(v){if(v in f){if(!f[v]||typeof f[v]!="object"){this.warn("nonObjectDependencies",v),delete f[v];return}Object.keys(f[v]).forEach(function(E){var _=f[v][E];typeof _!="string"&&(this.warn("nonStringDependency",E,JSON.stringify(_)),delete f[v][E]);var O=s.fromUrl(f[v][E]);O&&(f[v][E]=O.toString())},this)}},this)},fixModulesField:function(f){f.modules&&(this.warn("deprecatedModules"),delete f.modules)},fixKeywordsField:function(f){typeof f.keywords=="string"&&(f.keywords=f.keywords.split(/,\s+/)),f.keywords&&!Array.isArray(f.keywords)?(delete f.keywords,this.warn("nonArrayKeywords")):f.keywords&&(f.keywords=f.keywords.filter(function(v){return typeof v!="string"||!v?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(f,v){var E=!v;if(!f.version)return f.version="",!0;if(!e(f.version,E))throw new Error('Invalid version: "'+f.version+'"');return f.version=r(f.version,E),!0},fixPeople:function(f){h(f,p),h(f,m)},fixNameField:function(f,v){typeof v=="boolean"?v={strict:v}:typeof v>"u"&&(v={});var E=v.strict;if(!f.name&&!E){f.name="";return}if(typeof f.name!="string")throw new Error("name field must be a string.");E||(f.name=f.name.trim()),g(f.name,E,v.allowLegacyCase),n(f.name)&&this.warn("conflictingName",f.name)},fixDescriptionField:function(f){f.description&&typeof f.description!="string"&&(this.warn("nonStringDescription"),delete f.description),f.readme&&!f.description&&(f.description=o(f.readme)),f.description===void 0&&delete f.description,f.description||this.warn("missingDescription")},fixReadmeField:function(f){f.readme||(this.warn("missingReadme"),f.readme="ERROR: No README data found!")},fixBugsField:function(f){if(!f.bugs&&f.repository&&f.repository.url){var v=s.fromUrl(f.repository.url);v&&v.bugs()&&(f.bugs={url:v.bugs()})}else if(f.bugs){if(typeof f.bugs=="string")l(f.bugs)?f.bugs={email:f.bugs}:t.canParse(f.bugs)?f.bugs={url:f.bugs}:this.warn("nonEmailUrlBugsString");else{x(f.bugs,this.warn);var E=f.bugs;f.bugs={},E.url&&(t.canParse(E.url)?f.bugs.url=E.url:this.warn("nonUrlBugsUrlField")),E.email&&(typeof E.email=="string"&&l(E.email)?f.bugs.email=E.email:this.warn("nonEmailBugsEmailField"))}!f.bugs.email&&!f.bugs.url&&(delete f.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(f){if(!f.homepage&&f.repository&&f.repository.url){var v=s.fromUrl(f.repository.url);v&&v.docs()&&(f.homepage=v.docs())}if(f.homepage){if(typeof f.homepage!="string")return this.warn("nonUrlHomepage"),delete f.homepage;t.canParse(f.homepage)||(f.homepage="http://"+f.homepage)}},fixLicenseField:function(f){let v=f.license||f.licence;if(!v)return this.warn("missingLicense");if(typeof v!="string"||v.length<1||v.trim()==="")return this.warn("invalidLicense");if(!i(v).validForNewPackages)return this.warn("invalidLicense")}};function u(f){if(f.charAt(0)!=="@")return!1;var v=f.slice(1).split("/");return v.length!==2?!1:v[0]&&v[1]&&v[0]===encodeURIComponent(v[0])&&v[1]===encodeURIComponent(v[1])}function d(f){return!f.match(/[/@\s+%:]/)&&f===encodeURIComponent(f)}function g(f,v,E){if(f.charAt(0)==="."||!(u(f)||d(f))||v&&!E&&f!==f.toLowerCase()||f.toLowerCase()==="node_modules"||f.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(f))}function h(f,v){return f.author&&(f.author=v(f.author)),["maintainers","contributors"].forEach(function(E){Array.isArray(f[E])&&(f[E]=f[E].map(v))}),f}function p(f){if(typeof f=="string")return f;var v=f.name||"",E=f.url||f.web,_=E?" ("+E+")":"",O=f.email||f.mail,C=O?" <"+O+">":"";return v+C+_}function m(f){if(typeof f!="string")return f;var v=f.match(/^([^(<]+)/),E=f.match(/\(([^()]+)\)/),_=f.match(/<([^<>]+)>/),O={};return v&&v[0].trim()&&(O.name=v[0].trim()),_&&(O.email=_[1]),E&&(O.url=E[1]),O}function y(f){var v=f.optionalDependencies;if(v){var E=f.dependencies||{};Object.keys(v).forEach(function(_){E[_]=v[_]}),f.dependencies=E}}function b(f,v,E){if(!f)return{};if(typeof f=="string"&&(f=f.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(f))return f;E("deprecatedArrayDependencies",v);var _={};return f.filter(function(O){return typeof O=="string"}).forEach(function(O){O=O.trim().split(/(:?[@\s><=])/);var C=O.shift(),$=O.join("");$=$.trim(),$=$.replace(/^@/,""),_[C]=$}),_}function w(f,v){a.forEach(function(E){f[E]&&(f[E]=b(f[E],E,v))})}function x(f,v){f&&Object.keys(f).forEach(function(E){c.bugs[E]&&(v("typo",E,c.bugs[E],"bugs"),f[c.bugs[E]]=f[E],delete f[E])})}return Ra}var bw="'repositories' (plural) Not supported. Please pick one as the 'repository' field",vw="No repository field.",ww="Probably broken git url: %s",xw="scripts must be an object",Ew="script values must be string commands",_w="Invalid 'files' member",Sw="Invalid filename in 'files' list: %s",Rw="Invalid 'bundleDependencies' list. Must be array of package names",Cw="Invalid bundleDependencies member: %s",Aw="Non-dependency in bundleDependencies: %s",Lw="%s field must be an object",Ow="Invalid dependency: %s %s",$w="specifying %s as array is deprecated",Tw="modules field is deprecated",Pw="keywords should be an array of strings",Iw="keywords should be an array of strings",Fw="%s is also the name of a node core module.",Nw="'description' field should be a string",Dw="No description",Mw="No README data",kw="No license field.",jw="Bug string field must be url, email, or {email,url}",Bw="bugs.url field must be a string url. Deleted.",Uw="bugs.email field must be a string email. Deleted.",Gw="Normalized value of bugs field is an empty object. Deleted.",zw="homepage field must be a string url. Deleted.",qw="license should be a valid SPDX license expression",Ww="%s should probably be %s.",Vw={repositories:bw,missingRepository:vw,brokenGitUrl:ww,nonObjectScripts:xw,nonStringScript:Ew,nonArrayFiles:_w,invalidFilename:Sw,nonArrayBundleDependencies:Rw,nonStringBundleDependency:Cw,nonDependencyBundleDependency:Aw,nonObjectDependencies:Lw,nonStringDependency:Ow,deprecatedArrayDependencies:$w,deprecatedModules:Tw,nonArrayKeywords:Pw,nonStringKeyword:Iw,conflictingName:Fw,nonStringDescription:Nw,missingDescription:Dw,missingReadme:Mw,missingLicense:kw,nonEmailUrlBugsString:jw,nonUrlBugsUrlField:Bw,nonEmailBugsEmailField:Uw,emptyNormalizedBugs:Gw,nonUrlHomepage:zw,invalidLicense:qw,typo:Ww},Ca,nh;function Hw(){if(nh)return Ca;nh=1;var t=mh,e=Vw;Ca=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return r.apply(null,i);var n=e[s]?e[s]:s+": '%s'";return i.unshift(n),t.format.apply(null,i)};function r(i,s,n){return n&&(i=n+"['"+i+"']",s=n+"['"+s+"']"),t.format(e.typo,i,s)}return Ca}var Aa,oh;function Kw(){if(oh)return Aa;oh=1,Aa=n;var t=yw();n.fixer=t;var e=Hw(),r=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=r.map(function(o){return a(o)+"Field"});s=s.concat(i);function n(o,c,l){c===!0&&(c=null,l=!0),l||(l=!1),(!c||o.private)&&(c=function(){}),o.scripts&&o.scripts.install==="node-gyp rebuild"&&!o.scripts.preinstall&&(o.gypfile=!0),t.warn=function(){c(e.apply(null,arguments))},s.forEach(function(u){t["fix"+a(u)](o,l)}),o._id=o.name+"@"+o.version}function a(o){return o.charAt(0).toUpperCase()+o.slice(1)}return Aa}var Yw=Kw(),Mh=Qs(Yw),Xw=(t,e)=>(t=t.replace(/((?<![\p{Uppercase_Letter}\d])[\p{Uppercase_Letter}\d](?![\p{Uppercase_Letter}\d]))/gu,r=>r.toLowerCase()),t.replace(new RegExp("(?<!\\p{Uppercase_Letter})(\\p{Uppercase_Letter}+)(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),(r,i,s)=>i+e+s.toLowerCase()));function ja(t,{separator:e="_",preserveConsecutiveUppercase:r=!1}={}){if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("The `text` and `separator` arguments should be of type `string`");if(t.length<2)return r?t:t.toLowerCase();let i=`$1${e}$2`,s=t.replace(new RegExp("([\\p{Lowercase_Letter}\\d])(\\p{Uppercase_Letter})","gu"),i);return r?Xw(s,e):s.replace(new RegExp("(\\p{Uppercase_Letter})(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),i).toLowerCase()}var Js={exports:{}},La,ah;function Jw(){if(ah)return La;ah=1;var t=Object.prototype.toString;return La=function(e){var r;return t.call(e)==="[object Object]"&&(r=Object.getPrototypeOf(e),r===null||r===Object.getPrototypeOf({}))},La}var Oa,ch;function Zw(){return ch||(ch=1,Oa=function(t){return t==null?[]:Array.isArray(t)?t:[t]}),Oa}var $a,lh;function Qw(){if(lh)return $a;lh=1;var t=Object.prototype.toString;$a=function(d){if(d===void 0)return"undefined";if(d===null)return"null";var g=typeof d;if(g==="boolean")return"boolean";if(g==="string")return"string";if(g==="number")return"number";if(g==="symbol")return"symbol";if(g==="function")return a(d)?"generatorfunction":"function";if(r(d))return"array";if(l(d))return"buffer";if(c(d))return"arguments";if(s(d))return"date";if(i(d))return"error";if(n(d))return"regexp";switch(e(d)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(o(d))return"generator";switch(g=t.call(d),g){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return g.slice(8,-1).toLowerCase().replace(/\s/g,"")};function e(u){return typeof u.constructor=="function"?u.constructor.name:null}function r(u){return Array.isArray?Array.isArray(u):u instanceof Array}function i(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function s(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function n(u){return u instanceof RegExp?!0:typeof u.flags=="string"&&typeof u.ignoreCase=="boolean"&&typeof u.multiline=="boolean"&&typeof u.global=="boolean"}function a(u,d){return e(u)==="GeneratorFunction"}function o(u){return typeof u.throw=="function"&&typeof u.return=="function"&&typeof u.next=="function"}function c(u){try{if(typeof u.length=="number"&&typeof u.callee=="function")return!0}catch(d){if(d.message.indexOf("callee")!==-1)return!0}return!1}function l(u){return u.constructor&&typeof u.constructor.isBuffer=="function"?u.constructor.isBuffer(u):!1}return $a}var uh;function e1(){if(uh)return Js.exports;uh=1;let t=Jw(),e=Zw(),r=Qw(),i=(h,p,m)=>{h[p]||(h[p]=[]),h[p].push(m)},s=(h,p,m,y)=>{h[p]||(h[p]={}),h[p][m]=y},n=h=>Array.isArray(h)?`[${h.map(n).join(", ")}]`:r(h)==="string"?JSON.stringify(h):h,a=h=>{if(Array.isArray(h)&&h.length>0){let[p]=h;return`${r(p)}-array`}return r(h)},o=(h,p)=>{let m=h==="array"?"string-array":h;return u.includes(m)&&Array.isArray(p)&&p.length===0?"array":m},c=["stopEarly","unknown","--"],l=["string","boolean","number"],u=l.map(h=>`${h}-array`),d=[...l,"array",...u],g=h=>{h=h||{};let p={};return c.forEach(m=>{h[m]&&(p[m]=h[m])}),Object.keys(h).forEach(m=>{let y=h[m];if(m==="arguments"&&(m="_"),typeof y=="string"&&(y={type:y}),t(y)){let b=y,{type:w}=b;if(w){if(!d.includes(w))throw new TypeError(`Expected type of "${m}" to be one of ${n(d)}, got ${n(w)}`);if(u.includes(w)){let[x]=w.split("-");i(p,"array",{key:m,[x]:!0})}else i(p,w,m)}if({}.hasOwnProperty.call(b,"default")){let{default:x}=b,f=a(x),v=o(w,x);if(v&&v!==f)throw new TypeError(`Expected "${m}" default value to be of type "${v}", got ${n(f)}`);s(p,"default",m,x)}e(b.alias).forEach(x=>{s(p,"alias",x,m)})}}),p};return Js.exports=g,Js.exports.default=g,Js.exports}var t1=e1(),kh=Qs(t1),Zs={exports:{}},hh;function r1(){if(hh)return Zs.exports;hh=1;let t=s=>typeof s=="object"&&s!==null,e=Symbol("skip"),r=s=>t(s)&&!(s instanceof RegExp)&&!(s instanceof Error)&&!(s instanceof Date),i=(s,n,a,o=new WeakMap)=>{if(a={deep:!1,target:{},...a},o.has(s))return o.get(s);o.set(s,a.target);let{target:c}=a;delete a.target;let l=u=>u.map(d=>r(d)?i(d,n,a,o):d);if(Array.isArray(s))return l(s);for(let[u,d]of Object.entries(s)){let g=n(u,d,s);if(g===e)continue;let[h,p,{shouldRecurse:m=!0}={}]=g;h!=="__proto__"&&(a.deep&&m&&r(p)&&(p=Array.isArray(p)?l(p):i(p,n,a,o)),c[h]=p)}return c};return Zs.exports=(s,n,a)=>{if(!t(s))throw new TypeError(`Expected an object, got \`${s}\` (${typeof s})`);return i(s,n,a)},Zs.exports.mapObjectSkip=e,Zs.exports}var i1=r1(),fh=Qs(i1),Na=class extends Map{constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=e.maxSize,this.maxAge=e.maxAge||Number.POSITIVE_INFINITY,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(e){if(typeof this.onEviction=="function")for(let[r,i]of e)this.onEviction(r,i.value)}_deleteIfExpired(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(e,r.value),this.delete(e)):!1}_getOrDeleteIfExpired(e,r){if(this._deleteIfExpired(e,r)===!1)return r.value}_getItemValue(e,r){return r.expiry?this._getOrDeleteIfExpired(e,r):r.value}_peek(e,r){let i=r.get(e);return this._getItemValue(e,i)}_set(e,r){this.cache.set(e,r),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(e,r){this.oldCache.delete(e),this._set(e,r)}*_entriesAscending(){for(let e of this.oldCache){let[r,i]=e;this.cache.has(r)||this._deleteIfExpired(r,i)===!1&&(yield e)}for(let e of this.cache){let[r,i]=e;this._deleteIfExpired(r,i)===!1&&(yield e)}}get(e){if(this.cache.has(e)){let r=this.cache.get(e);return this._getItemValue(e,r)}if(this.oldCache.has(e)){let r=this.oldCache.get(e);if(this._deleteIfExpired(e,r)===!1)return this._moveToRecent(e,r),r.value}}set(e,r,{maxAge:i=this.maxAge}={}){let s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.cache.has(e)?this.cache.set(e,{value:r,expiry:s}):this._set(e,{value:r,expiry:s}),this}has(e){return this.cache.has(e)?!this._deleteIfExpired(e,this.cache.get(e)):this.oldCache.has(e)?!this._deleteIfExpired(e,this.oldCache.get(e)):!1}peek(e){if(this.cache.has(e))return this._peek(e,this.cache);if(this.oldCache.has(e))return this._peek(e,this.oldCache)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this._entriesAscending()],i=r.length-e;i<0?(this.cache=new Map(r),this.oldCache=new Map,this._size=r.length):(i>0&&this._emitEvictions(r.slice(0,i)),this.oldCache=new Map(r.slice(i)),this.cache=new Map,this._size=0),this.maxSize=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache){let[r,i]=e;this._deleteIfExpired(r,i)===!1&&(yield[r,i.value])}for(let e of this.oldCache){let[r,i]=e;this.cache.has(r)||this._deleteIfExpired(r,i)===!1&&(yield[r,i.value])}}*entriesDescending(){let e=[...this.cache];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this._deleteIfExpired(s,n)===!1&&(yield[s,n.value])}e=[...this.oldCache];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this.cache.has(s)||this._deleteIfExpired(s,n)===!1&&(yield[s,n.value])}}*entriesAscending(){for(let[e,r]of this._entriesAscending())yield[e,r.value]}get size(){if(!this._size)return this.oldCache.size;let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[i,s]of this.entriesAscending())e.call(r,s,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}},s1=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),Ta=new Na({maxSize:1e5}),ph=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),dh=(t,e={})=>{if(!ph(t))return t;let{separator:r="_",exclude:i,deep:s=!1}=e,n=a=>(o,c)=>{if(s&&ph(c)&&(c=fh(c,n())),!(i&&s1(i,o))){let l=`${r}${o}`;if(Ta.has(l))o=Ta.get(l);else{let u=ja(o,{separator:r});o.length<100&&Ta.set(l,u),o=u}}return[o,c]};return fh(t,n())};function jh(t,e){return Array.isArray(t)?Object.keys(t).map(r=>dh(t[r],e)):dh(t,e)}import n1 from"node:process";import o1 from"node:path";import{fileURLToPath as a1}from"node:url";var or=t=>`--${ja(t,{separator:"-"})}`,qi=(t,e="--")=>`\`${e}${t.join(`\`, \`${e}`)}\``;var c1=t=>{let e={flags:{keyContainsDashes:{filter:([i])=>i.includes("-")&&i!=="--",message:i=>`Flag keys may not contain '-'. Invalid flags: ${qi(i,"")}`},aliasIsSet:{filter:([,i])=>Object.hasOwn(i,"alias"),message:i=>`The option \`alias\` has been renamed to \`shortFlag\`. The following flags need to be updated: ${qi(i)}`},choicesNotAnArray:{filter:([,i])=>Object.hasOwn(i,"choices")&&!Array.isArray(i.choices),message:i=>`The option \`choices\` must be an array. Invalid flags: ${qi(i)}`},choicesNotMatchFlagType:{filter:([,i])=>i.type&&Array.isArray(i.choices)&&i.choices.some(s=>typeof s!==i.type),message(i){return`Each value of the option \`choices\` must be of the same type as its flag. Invalid flags: ${i.map(n=>`(\`${or(n)}\`, type: '${t.flags[n].type}')`).join(", ")}`}},defaultNotInChoices:{filter:([,i])=>i.default&&Array.isArray(i.choices)&&![i.default].flat().every(s=>i.choices.includes(s)),message:i=>`Each value of the option \`default\` must exist within the option \`choices\`. Invalid flags: ${qi(i)}`}}},r=[];for(let[i,s]of Object.entries(e)){let n=Object.entries(t[i]);for(let{filter:a,message:o}of Object.values(s)){let c=n.filter(u=>a(u)),l=c.map(([u])=>u);c.length>0&&r.push(o(l))}}if(r.length>0)throw new Error(r.join(`
|
|
32
|
+
`))},Bh=(t,e)=>{if(typeof t!="string"&&(e=t,t=""),!e.importMeta?.url)throw new TypeError("The `importMeta` option is required. Its value must be `import.meta`.");let i=e.pkg??Nh({cwd:o1.dirname(a1(e.importMeta.url)),normalize:!1})?.packageJson??{};Mh(i);let s={argv:n1.argv.slice(2),flags:{},inferType:!1,input:"string",description:i.description??!1,help:t,version:i.version||"No version found",autoHelp:!0,autoVersion:!0,booleanDefault:!1,allowUnknownFlags:!0,allowParentFlags:!0,helpIndent:2,...e,pkg:i};return c1(s),s};var l1=({flags:t,booleanDefault:e})=>{let r={};for(let[i,s]of Object.entries(t)){let n={...s};n.shortFlag&&(n.alias=n.shortFlag,delete n.shortFlag),e!==void 0&&n.type==="boolean"&&!Object.hasOwn(n,"default")&&(n.default=n.isMultiple?[e]:e),n.isMultiple&&(n.type=n.type?`${n.type}-array`:"array",n.default??=[],delete n.isMultiple),Array.isArray(n.aliases)&&(n.alias&&n.aliases.push(n.alias),n.alias=n.aliases,delete n.aliases),r[i]=n}return r},Uh=t=>{let e=l1(t);return e.arguments=t.input,e=jh(e,{separator:"-",exclude:["stopEarly","--"]}),t.inferType&&delete e.arguments,t.allowUnknownFlags||(t.autoHelp&&!e.help&&(e.help={type:"boolean"}),t.autoVersion&&!e.version&&(e.version={type:"boolean"})),e=kh(e),e.configuration={...e.configuration,"greedy-arrays":!1,"parse-numbers":t.inferType},e["--"]&&(e.configuration["populate--"]=!0),t.allowUnknownFlags||(e.configuration["unknown-options-as-args"]=!0),e};import Gh from"node:process";var u1=(t,e)=>{for(let[r,i]of Object.entries(e.flags))if(r!=="--"&&!i.isMultiple&&Array.isArray(t[r]))throw new Error(`The flag --${r} can only be set once.`)},h1=(t,e,r)=>{let{choices:i,isRequired:s}=e;if(!i)return;let n=`Value must be one of: [\`${i.join("`, `")}\`]`;if(!r)return s?`Flag \`${or(t)}\` has no value. ${n}`:void 0;if(Array.isArray(r)){let a=r.filter(o=>!i.includes(o));if(a.length>0)return`Unknown ${a.length>1?"values":"value"} for flag \`${or(t)}\`: \`${a.join("`, `")}\`. ${n}`}else if(!i.includes(r))return`Unknown value for flag \`${or(t)}\`: \`${r}\`. ${n}`},f1=(t,e)=>{let r=[];for(let[i,s]of Object.entries(t)){let n=e[i],a=h1(i,s,n);a&&r.push(a)}if(r.length>0)throw new Error(`${r.join(`
|
|
33
|
+
`)}`)},zh=(t,e)=>{u1(t,e),f1(e.flags,t)},p1=t=>{console.error([`Unknown flag${t.length>1?"s":""}`,...t].join(`
|
|
34
|
+
`))},qh=t=>{let e=t.filter(r=>typeof r=="string"&&r.startsWith("-"));e.length>0&&(p1(e),Gh.exit(2))},d1=(t,e,r,i)=>{let s=e[t],n=!0;if(typeof s.isRequired=="function"&&(n=s.isRequired(r,i),typeof n!="boolean"))throw new TypeError(`Return value for isRequired callback should be of type boolean, but ${typeof n} was returned.`);return(r[t]===void 0||s.isMultiple&&r[t].length===0)&&n},m1=t=>{console.error(`Missing required flag${t.length>1?"s":""}`);for(let e of t)console.error(` ${or(e.key)}${e.shortFlag?`, -${e.shortFlag}`:""}`)},Wh=(t,e,r)=>{let i=[];if(t===void 0)return[];for(let s of Object.keys(t))t[s].isRequired&&d1(s,t,e,r)&&i.push({key:s,...t[s]});i.length>0&&(m1(i),Gh.exit(2))};var g1=({pkg:t,...e},r)=>{let i=Yr(e.argv,r),s="";if(e.help&&(s=Rh((e.help||"").replace(/\t+\n*$/,"")),s.includes(`
|
|
35
35
|
`)&&(s=ka(s,e.helpIndent)),s=`
|
|
36
36
|
${s}`),e.description!==!1){let{description:u}=e;u&&(u=s?ka(`
|
|
37
37
|
${u}
|
|
38
38
|
`,e.helpIndent):`
|
|
39
39
|
${u}`,s=`${u}${s}`)}s+=`
|
|
40
|
-
`;let n=u=>{console.log(s),Ba.exit(typeof u=="number"?u:2)},a=()=>{console.log(e.version),Ba.exit(0)};i._.length===0&&e.argv.length===1&&(i.version===!0&&e.autoVersion?a():i.help===!0&&e.autoHelp&&n(0));let o=i._;delete i._,e.allowUnknownFlags||Wf(o);let c=Rf(i,{exclude:["--",/^\w$/]}),l={...c};zf(c,e);for(let u of Object.values(e.flags)){if(Array.isArray(u.aliases))for(let d of u.aliases)delete c[d];delete c[u.shortFlag]}return Vf(e.flags,c,o),{input:o,flags:c,unnormalizedFlags:l,pkg:t,help:s,showHelp:n,showVersion:a}},Hf=(t,e={})=>{let r=Uf(t,e),i=Gf(r),s=g1(r,i);return Ba.title=s.pkg.bin?Object.keys(s.pkg.bin).at(0):s.pkg.name,s};var Ey=We(oc(),1);var Gp=We(Bp(),1);var p_=Object.prototype.toString,d_=t=>p_.call(t)==="[object Error]",m_=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function ac(t){return t&&d_(t)&&t.name==="TypeError"&&typeof t.message=="string"?t.message==="Load failed"?t.stack===void 0:m_.has(t.message):!1}var cc=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},Up=(t,e,r)=>{let i=r.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=i,t};async function lc(t,e){return new Promise((r,i)=>{e={...e},e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>!0,e.retries??=10;let s=Gp.default.operation(e),n=()=>{s.stop(),i(e.signal?.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",n,{once:!0});let a=()=>{e.signal?.removeEventListener("abort",n),s.stop()};s.attempt(async o=>{try{let c=await t(o);a(),r(c)}catch(c){try{if(!(c instanceof Error))throw new TypeError(`Non-error was thrown: "${c}". You should only throw errors.`);if(c instanceof cc)throw c.originalError;if(c instanceof TypeError&&!ac(c))throw c;if(Up(c,o,e),await e.shouldRetry(c)||(s.stop(),i(c)),await e.onFailedAttempt(c),!s.retry(c))throw s.mainError()}catch(l){Up(l,o,e),a(),i(l)}}})})}var P={};jo(P,{BRAND:()=>U_,DIRTY:()=>lr,EMPTY_PATH:()=>v_,INVALID:()=>Q,NEVER:()=>RS,OK:()=>Ne,ParseStatus:()=>$e,Schema:()=>ae,ZodAny:()=>Wt,ZodArray:()=>Pt,ZodBigInt:()=>fr,ZodBoolean:()=>hr,ZodBranded:()=>Qi,ZodCatch:()=>_r,ZodDate:()=>pr,ZodDefault:()=>Er,ZodDiscriminatedUnion:()=>mn,ZodEffects:()=>it,ZodEnum:()=>wr,ZodError:()=>Ve,ZodFirstPartyTypeKind:()=>te,ZodFunction:()=>yn,ZodIntersection:()=>yr,ZodIssueCode:()=>N,ZodLazy:()=>br,ZodLiteral:()=>vr,ZodMap:()=>ri,ZodNaN:()=>si,ZodNativeEnum:()=>xr,ZodNever:()=>pt,ZodNull:()=>mr,ZodNullable:()=>Et,ZodNumber:()=>ur,ZodObject:()=>He,ZodOptional:()=>tt,ZodParsedType:()=>U,ZodPipeline:()=>es,ZodPromise:()=>Vt,ZodReadonly:()=>Sr,ZodRecord:()=>gn,ZodSchema:()=>ae,ZodSet:()=>ii,ZodString:()=>zt,ZodSymbol:()=>ei,ZodTransformer:()=>it,ZodTuple:()=>xt,ZodType:()=>ae,ZodUndefined:()=>dr,ZodUnion:()=>gr,ZodUnknown:()=>Tt,ZodVoid:()=>ti,addIssueToContext:()=>B,any:()=>X_,array:()=>eS,bigint:()=>W_,boolean:()=>Qp,coerce:()=>SS,custom:()=>Xp,date:()=>V_,datetimeRegex:()=>Kp,defaultErrorMap:()=>Ot,discriminatedUnion:()=>sS,effect:()=>gS,enum:()=>pS,function:()=>uS,getErrorMap:()=>Jr,getParsedType:()=>wt,instanceof:()=>q_,intersection:()=>nS,isAborted:()=>pn,isAsync:()=>Zr,isDirty:()=>dn,isValid:()=>qt,late:()=>G_,lazy:()=>fS,literal:()=>hS,makeIssue:()=>Zi,map:()=>cS,nan:()=>z_,nativeEnum:()=>dS,never:()=>Z_,null:()=>Y_,nullable:()=>bS,number:()=>Zp,object:()=>tS,objectUtil:()=>uc,oboolean:()=>_S,onumber:()=>ES,optional:()=>yS,ostring:()=>xS,pipeline:()=>wS,preprocess:()=>vS,promise:()=>mS,quotelessJson:()=>g_,record:()=>aS,set:()=>lS,setErrorMap:()=>b_,strictObject:()=>rS,string:()=>Jp,symbol:()=>H_,transformer:()=>gS,tuple:()=>oS,undefined:()=>K_,union:()=>iS,unknown:()=>J_,util:()=>ce,void:()=>Q_});var ce;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let n={};for(let a of s)n[a]=a;return n},t.getValidEnumValues=s=>{let n=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(let o of n)a[o]=s[o];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let n=[];for(let a in s)Object.prototype.hasOwnProperty.call(s,a)&&n.push(a);return n},t.find=(s,n)=>{for(let a of s)if(n(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function i(s,n=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}t.joinValues=i,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(ce||(ce={}));var uc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(uc||(uc={}));var U=ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wt=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}};var N=ce.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"]),g_=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ve=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(n){return n.message},i={_errors:[]},s=n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let o=i,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(a))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return s(this),i}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,ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let s of this.issues)if(s.path.length>0){let n=s.path[0];r[n]=r[n]||[],r[n].push(e(s))}else i.push(e(s));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Ve.create=t=>new Ve(t);var y_=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===U.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ce.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${ce.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ce.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${ce.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ce.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,ce.assertNever(t)}return{message:r}},Ot=y_;var qp=Ot;function b_(t){qp=t}function Jr(){return qp}var Zi=t=>{let{data:e,path:r,errorMaps:i,issueData:s}=t,n=[...r,...s.path||[]],a={...s,path:n};if(s.message!==void 0)return{...s,path:n,message:s.message};let o="",c=i.filter(l=>!!l).slice().reverse();for(let l of c)o=l(a,{data:e,defaultError:o}).message;return{...s,path:n,message:o}},v_=[];function B(t,e){let r=Jr(),i=Zi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Ot?void 0:Ot].filter(s=>!!s)});t.common.issues.push(i)}var $e=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let s of r){if(s.status==="aborted")return Q;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let s of r){let n=await s.key,a=await s.value;i.push({key:n,value:a})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let s of r){let{key:n,value:a}=s;if(n.status==="aborted"||a.status==="aborted")return Q;n.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(i[n.value]=a.value)}return{status:e.value,value:i}}},Q=Object.freeze({status:"aborted"}),lr=t=>({status:"dirty",value:t}),Ne=t=>({status:"valid",value:t}),pn=t=>t.status==="aborted",dn=t=>t.status==="dirty",qt=t=>t.status==="valid",Zr=t=>typeof Promise<"u"&&t instanceof Promise;var K;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(K||(K={}));var rt=class{constructor(e,r,i,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=s}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}},zp=(t,e)=>{if(qt(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 r=new Ve(t.common.issues);return this._error=r,this._error}}};function ne(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:s}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,o)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??i??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:s}}var ae=class{get description(){return this._def.description}_getType(e){return wt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:wt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $e,ctx:{common:e.parent.common,data:e.data,parsedType:wt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Zr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wt(e)},s=this._parseSync({data:e,path:i.path,parent:i});return zp(i,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wt(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return qt(i)?{value:i.value}:{issues:r.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>qt(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wt(e)},s=this._parse({data:e,path:i.path,parent:i}),n=await(Zr(s)?s:Promise.resolve(s));return zp(i,n)}refine(e,r){let i=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,n)=>{let a=e(s),o=()=>n.addIssue({code:N.custom,...i(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof r=="function"?r(i,s):r),!1))}_refinement(e){return new it({schema:this,typeName:te.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:r=>this["~validate"](r)}}optional(){return tt.create(this,this._def)}nullable(){return Et.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pt.create(this)}promise(){return Vt.create(this,this._def)}or(e){return gr.create([this,e],this._def)}and(e){return yr.create(this,e,this._def)}transform(e){return new it({...ne(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Er({...ne(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new Qi({typeName:te.ZodBranded,type:this,...ne(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new _r({...ne(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return es.create(this,e)}readonly(){return Sr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},w_=/^c[^\s-]{8,}$/i,x_=/^[0-9a-z]+$/,E_=/^[0-9A-HJKMNP-TV-Z]{26}$/i,__=/^[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,S_=/^[a-z0-9_-]{21}$/i,R_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,C_=/^[-+]?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)?)??$/,A_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,L_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",fc,O_=/^(?:(?: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])$/,$_=/^(?:(?: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])$/,T_=/^(([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]))$/,P_=/^(([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])$/,I_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,F_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vp="((\\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])))",N_=new RegExp(`^${Vp}$`);function Hp(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function D_(t){return new RegExp(`^${Hp(t)}$`)}function Kp(t){let e=`${Vp}T${Hp(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function M_(t,e){return!!((e==="v4"||!e)&&O_.test(t)||(e==="v6"||!e)&&T_.test(t))}function k_(t,e){if(!R_.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(i));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function j_(t,e){return!!((e==="v4"||!e)&&$_.test(t)||(e==="v6"||!e)&&P_.test(t))}var zt=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_type,expected:U.string,received:n.parsedType}),Q}let i=new $e,s;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="max")e.data.length>n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="length"){let a=e.data.length>n.value,o=e.data.length<n.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?B(s,{code:N.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&B(s,{code:N.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),i.dirty())}else if(n.kind==="email")A_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"email",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="emoji")fc||(fc=new RegExp(L_,"u")),fc.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"emoji",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="uuid")__.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"uuid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="nanoid")S_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"nanoid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid")w_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"cuid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid2")x_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"cuid2",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="ulid")E_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"ulid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),B(s,{validation:"url",code:N.invalid_string,message:n.message}),i.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"regex",code:N.invalid_string,message:n.message}),i.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),i.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:{startsWith:n.value},message:n.message}),i.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:{endsWith:n.value},message:n.message}),i.dirty()):n.kind==="datetime"?Kp(n).test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"datetime",message:n.message}),i.dirty()):n.kind==="date"?N_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"date",message:n.message}),i.dirty()):n.kind==="time"?D_(n).test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"time",message:n.message}),i.dirty()):n.kind==="duration"?C_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"duration",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="ip"?M_(e.data,n.version)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"ip",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="jwt"?k_(e.data,n.alg)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"jwt",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="cidr"?j_(e.data,n.version)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"cidr",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="base64"?I_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"base64",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="base64url"?F_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"base64url",code:N.invalid_string,message:n.message}),i.dirty()):ce.assertNever(n);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(s=>e.test(s),{validation:r,code:N.invalid_string,...K.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...K.errToObj(e)})}url(e){return this._addCheck({kind:"url",...K.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...K.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...K.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...K.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...K.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...K.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...K.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...K.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...K.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...K.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...K.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...K.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,...K.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,...K.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...K.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...K.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...K.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...K.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...K.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...K.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...K.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...K.errToObj(r)})}nonempty(e){return this.min(1,K.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 r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};zt.create=t=>new zt({checks:[],typeName:te.ZodString,coerce:t?.coerce??!1,...ne(t)});function B_(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=r>i?r:i,n=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return n%a/10**s}var ur=class t extends ae{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)!==U.number){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_type,expected:U.number,received:n.parsedType}),Q}let i,s=new $e;for(let n of this._def.checks)n.kind==="int"?ce.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:N.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="multipleOf"?B_(e.data,n.value)!==0&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:N.not_finite,message:n.message}),s.dirty()):ce.assertNever(n);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,K.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.toString(r))}setLimit(e,r,i,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:K.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:K.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:K.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ce.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};ur.create=t=>new ur({checks:[],typeName:te.ZodNumber,coerce:t?.coerce||!1,...ne(t)});var fr=class t extends ae{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)!==U.bigint)return this._getInvalidInput(e);let i,s=new $e;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):ce.assertNever(n);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return B(r,{code:N.invalid_type,expected:U.bigint,received:r.parsedType}),Q}gte(e,r){return this.setLimit("min",e,!0,K.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.toString(r))}setLimit(e,r,i,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:K.toString(s)}]})}_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:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};fr.create=t=>new fr({checks:[],typeName:te.ZodBigInt,coerce:t?.coerce??!1,...ne(t)});var hr=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.boolean,received:i.parsedType}),Q}return Ne(e.data)}};hr.create=t=>new hr({typeName:te.ZodBoolean,coerce:t?.coerce||!1,...ne(t)});var pr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_type,expected:U.date,received:n.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_date}),Q}let i=new $e,s;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),i.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),i.dirty()):ce.assertNever(n);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:K.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:K.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};pr.create=t=>new pr({checks:[],coerce:t?.coerce||!1,typeName:te.ZodDate,...ne(t)});var ei=class extends ae{_parse(e){if(this._getType(e)!==U.symbol){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.symbol,received:i.parsedType}),Q}return Ne(e.data)}};ei.create=t=>new ei({typeName:te.ZodSymbol,...ne(t)});var dr=class extends ae{_parse(e){if(this._getType(e)!==U.undefined){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.undefined,received:i.parsedType}),Q}return Ne(e.data)}};dr.create=t=>new dr({typeName:te.ZodUndefined,...ne(t)});var mr=class extends ae{_parse(e){if(this._getType(e)!==U.null){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.null,received:i.parsedType}),Q}return Ne(e.data)}};mr.create=t=>new mr({typeName:te.ZodNull,...ne(t)});var Wt=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Ne(e.data)}};Wt.create=t=>new Wt({typeName:te.ZodAny,...ne(t)});var Tt=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ne(e.data)}};Tt.create=t=>new Tt({typeName:te.ZodUnknown,...ne(t)});var pt=class extends ae{_parse(e){let r=this._getOrReturnCtx(e);return B(r,{code:N.invalid_type,expected:U.never,received:r.parsedType}),Q}};pt.create=t=>new pt({typeName:te.ZodNever,...ne(t)});var ti=class extends ae{_parse(e){if(this._getType(e)!==U.undefined){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.void,received:i.parsedType}),Q}return Ne(e.data)}};ti.create=t=>new ti({typeName:te.ZodVoid,...ne(t)});var Pt=class t extends ae{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),s=this._def;if(r.parsedType!==U.array)return B(r,{code:N.invalid_type,expected:U.array,received:r.parsedType}),Q;if(s.exactLength!==null){let a=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(a||o)&&(B(r,{code:a?N.too_big:N.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(B(r,{code:N.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(B(r,{code:N.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>s.type._parseAsync(new rt(r,a,r.path,o)))).then(a=>$e.mergeArray(i,a));let n=[...r.data].map((a,o)=>s.type._parseSync(new rt(r,a,r.path,o)));return $e.mergeArray(i,n)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:K.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:K.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:K.toString(r)}})}nonempty(e){return this.min(1,e)}};Pt.create=(t,e)=>new Pt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ne(e)});function Qr(t){if(t instanceof He){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=tt.create(Qr(i))}return new He({...t._def,shape:()=>e})}else return t instanceof Pt?new Pt({...t._def,type:Qr(t.element)}):t instanceof tt?tt.create(Qr(t.unwrap())):t instanceof Et?Et.create(Qr(t.unwrap())):t instanceof xt?xt.create(t.items.map(e=>Qr(e))):t}var He=class t extends ae{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(),r=ce.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==U.object){let l=this._getOrReturnCtx(e);return B(l,{code:N.invalid_type,expected:U.object,received:l.parsedType}),Q}let{status:i,ctx:s}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof pt&&this._def.unknownKeys==="strip"))for(let l in s.data)a.includes(l)||o.push(l);let c=[];for(let l of a){let u=n[l],d=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new rt(s,d,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof pt){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of o)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(l==="strict")o.length>0&&(B(s,{code:N.unrecognized_keys,keys:o}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of o){let d=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new rt(s,d,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,b=await u.value;l.push({key:d,value:b,alwaysSet:u.alwaysSet})}return l}).then(l=>$e.mergeObjectSync(i,l)):$e.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return K.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{let s=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:K.errToObj(e).message??s}:{message:s}}}:{}})}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:te.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let i of ce.objectKeys(e))e[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let i of ce.objectKeys(this.shape))e[i]||(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}deepPartial(){return Qr(this)}partial(e){let r={};for(let i of ce.objectKeys(this.shape)){let s=this.shape[i];e&&!e[i]?r[i]=s:r[i]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let i of ce.objectKeys(this.shape))if(e&&!e[i])r[i]=this.shape[i];else{let n=this.shape[i];for(;n instanceof tt;)n=n._def.innerType;r[i]=n}return new t({...this._def,shape:()=>r})}keyof(){return Yp(ce.objectKeys(this.shape))}};He.create=(t,e)=>new He({shape:()=>t,unknownKeys:"strip",catchall:pt.create(),typeName:te.ZodObject,...ne(e)});He.strictCreate=(t,e)=>new He({shape:()=>t,unknownKeys:"strict",catchall:pt.create(),typeName:te.ZodObject,...ne(e)});He.lazycreate=(t,e)=>new He({shape:t,unknownKeys:"strip",catchall:pt.create(),typeName:te.ZodObject,...ne(e)});var gr=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function s(n){for(let o of n)if(o.result.status==="valid")return o.result;for(let o of n)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=n.map(o=>new Ve(o.ctx.common.issues));return B(r,{code:N.invalid_union,unionErrors:a}),Q}if(r.common.async)return Promise.all(i.map(async n=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let n,a=[];for(let c of i){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;let o=a.map(c=>new Ve(c));return B(r,{code:N.invalid_union,unionErrors:o}),Q}}get options(){return this._def.options}};gr.create=(t,e)=>new gr({options:t,typeName:te.ZodUnion,...ne(e)});var $t=t=>t instanceof br?$t(t.schema):t instanceof it?$t(t.innerType()):t instanceof vr?[t.value]:t instanceof wr?t.options:t instanceof xr?ce.objectValues(t.enum):t instanceof Er?$t(t._def.innerType):t instanceof dr?[void 0]:t instanceof mr?[null]:t instanceof tt?[void 0,...$t(t.unwrap())]:t instanceof Et?[null,...$t(t.unwrap())]:t instanceof Qi||t instanceof Sr?$t(t.unwrap()):t instanceof _r?$t(t._def.innerType):[],mn=class t extends ae{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return B(r,{code:N.invalid_type,expected:U.object,received:r.parsedType}),Q;let i=this.discriminator,s=r.data[i],n=this.optionsMap.get(s);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(B(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let s=new Map;for(let n of r){let a=$t(n.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,n)}}return new t({typeName:te.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...ne(i)})}};function hc(t,e){let r=wt(t),i=wt(e);if(t===e)return{valid:!0,data:t};if(r===U.object&&i===U.object){let s=ce.objectKeys(e),n=ce.objectKeys(t).filter(o=>s.indexOf(o)!==-1),a={...t,...e};for(let o of n){let c=hc(t[o],e[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(r===U.array&&i===U.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let n=0;n<t.length;n++){let a=t[n],o=e[n],c=hc(a,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===U.date&&i===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var yr=class extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),s=(n,a)=>{if(pn(n)||pn(a))return Q;let o=hc(n.value,a.value);return o.valid?((dn(n)||dn(a))&&r.dirty(),{status:r.value,value:o.data}):(B(i,{code:N.invalid_intersection_types}),Q)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([n,a])=>s(n,a)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};yr.create=(t,e,r)=>new yr({left:t,right:e,typeName:te.ZodIntersection,...ne(r)});var xt=class t extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.array)return B(i,{code:N.invalid_type,expected:U.array,received:i.parsedType}),Q;if(i.data.length<this._def.items.length)return B(i,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&i.data.length>this._def.items.length&&(B(i,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let n=[...i.data].map((a,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new rt(i,a,i.path,o)):null}).filter(a=>!!a);return i.common.async?Promise.all(n).then(a=>$e.mergeArray(r,a)):$e.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};xt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xt({items:t,typeName:te.ZodTuple,rest:null,...ne(e)})};var gn=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.object)return B(i,{code:N.invalid_type,expected:U.object,received:i.parsedType}),Q;let s=[],n=this._def.keyType,a=this._def.valueType;for(let o in i.data)s.push({key:n._parse(new rt(i,o,i.path,o)),value:a._parse(new rt(i,i.data[o],i.path,o)),alwaysSet:o in i.data});return i.common.async?$e.mergeObjectAsync(r,s):$e.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof ae?new t({keyType:e,valueType:r,typeName:te.ZodRecord,...ne(i)}):new t({keyType:zt.create(),valueType:e,typeName:te.ZodRecord,...ne(r)})}},ri=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.map)return B(i,{code:N.invalid_type,expected:U.map,received:i.parsedType}),Q;let s=this._def.keyType,n=this._def.valueType,a=[...i.data.entries()].map(([o,c],l)=>({key:s._parse(new rt(i,o,i.path,[l,"key"])),value:n._parse(new rt(i,c,i.path,[l,"value"]))}));if(i.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Q;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of a){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Q;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}}}};ri.create=(t,e,r)=>new ri({valueType:e,keyType:t,typeName:te.ZodMap,...ne(r)});var ii=class t extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.set)return B(i,{code:N.invalid_type,expected:U.set,received:i.parsedType}),Q;let s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(B(i,{code:N.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(B(i,{code:N.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let n=this._def.valueType;function a(c){let l=new Set;for(let u of c){if(u.status==="aborted")return Q;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let o=[...i.data.values()].map((c,l)=>n._parse(new rt(i,c,i.path,l)));return i.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:K.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:K.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};ii.create=(t,e)=>new ii({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ne(e)});var yn=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.function)return B(r,{code:N.invalid_type,expected:U.function,received:r.parsedType}),Q;function i(o,c){return Zi({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jr(),Ot].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:c}})}function s(o,c){return Zi({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jr(),Ot].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:c}})}let n={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Vt){let o=this;return Ne(async function(...c){let l=new Ve([]),u=await o._def.args.parseAsync(c,n).catch(f=>{throw l.addIssue(i(c,f)),l}),d=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(d,n).catch(f=>{throw l.addIssue(s(d,f)),l})})}else{let o=this;return Ne(function(...c){let l=o._def.args.safeParse(c,n);if(!l.success)throw new Ve([i(c,l.error)]);let u=Reflect.apply(a,this,l.data),d=o._def.returns.safeParse(u,n);if(!d.success)throw new Ve([s(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:xt.create(e).rest(Tt.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,r,i){return new t({args:e||xt.create([]).rest(Tt.create()),returns:r||Tt.create(),typeName:te.ZodFunction,...ne(i)})}},br=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};br.create=(t,e)=>new br({getter:t,typeName:te.ZodLazy,...ne(e)});var vr=class extends ae{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return B(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};vr.create=(t,e)=>new vr({value:t,typeName:te.ZodLiteral,...ne(e)});function Yp(t,e){return new wr({values:t,typeName:te.ZodEnum,...ne(e)})}var wr=class t extends ae{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return B(r,{expected:ce.joinValues(i),received:r.parsedType,code:N.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),i=this._def.values;return B(r,{received:r.data,code:N.invalid_enum_value,options:i}),Q}return Ne(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...r})}};wr.create=Yp;var xr=class extends ae{_parse(e){let r=ce.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==U.string&&i.parsedType!==U.number){let s=ce.objectValues(r);return B(i,{expected:ce.joinValues(s),received:i.parsedType,code:N.invalid_type}),Q}if(this._cache||(this._cache=new Set(ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=ce.objectValues(r);return B(i,{received:i.data,code:N.invalid_enum_value,options:s}),Q}return Ne(e.data)}get enum(){return this._def.values}};xr.create=(t,e)=>new xr({values:t,typeName:te.ZodNativeEnum,...ne(e)});var Vt=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.promise&&r.common.async===!1)return B(r,{code:N.invalid_type,expected:U.promise,received:r.parsedType}),Q;let i=r.parsedType===U.promise?r.data:Promise.resolve(r.data);return Ne(i.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Vt.create=(t,e)=>new Vt({type:t,typeName:te.ZodPromise,...ne(e)});var it=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),s=this._def.effect||null,n={addIssue:a=>{B(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(n.addIssue=n.addIssue.bind(n),s.type==="preprocess"){let a=s.transform(i.data,n);if(i.common.async)return Promise.resolve(a).then(async o=>{if(r.value==="aborted")return Q;let c=await this._def.schema._parseAsync({data:o,path:i.path,parent:i});return c.status==="aborted"?Q:c.status==="dirty"?lr(c.value):r.value==="dirty"?lr(c.value):c});{if(r.value==="aborted")return Q;let o=this._def.schema._parseSync({data:a,path:i.path,parent:i});return o.status==="aborted"?Q:o.status==="dirty"?lr(o.value):r.value==="dirty"?lr(o.value):o}}if(s.type==="refinement"){let a=o=>{let c=s.refinement(o,n);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?Q:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?Q:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!qt(a))return Q;let o=s.transform(a.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>qt(a)?Promise.resolve(s.transform(a.value,n)).then(o=>({status:r.value,value:o})):Q);ce.assertNever(s)}};it.create=(t,e,r)=>new it({schema:t,typeName:te.ZodEffects,effect:e,...ne(r)});it.createWithPreprocess=(t,e,r)=>new it({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ne(r)});var tt=class extends ae{_parse(e){return this._getType(e)===U.undefined?Ne(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tt.create=(t,e)=>new tt({innerType:t,typeName:te.ZodOptional,...ne(e)});var Et=class extends ae{_parse(e){return this._getType(e)===U.null?Ne(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Et.create=(t,e)=>new Et({innerType:t,typeName:te.ZodNullable,...ne(e)});var Er=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===U.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Er.create=(t,e)=>new Er({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ne(e)});var _r=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Zr(s)?s.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ve(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ve(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};_r.create=(t,e)=>new _r({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ne(e)});var si=class extends ae{_parse(e){if(this._getType(e)!==U.nan){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.nan,received:i.parsedType}),Q}return{status:"valid",value:e.data}}};si.create=t=>new si({typeName:te.ZodNaN,...ne(t)});var U_=Symbol("zod_brand"),Qi=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},es=class t extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?Q:n.status==="dirty"?(r.dirty(),lr(n.value)):this._def.out._parseAsync({data:n.value,path:i.path,parent:i})})();{let s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Q:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:te.ZodPipeline})}},Sr=class extends ae{_parse(e){let r=this._def.innerType._parse(e),i=s=>(qt(s)&&(s.value=Object.freeze(s.value)),s);return Zr(r)?r.then(s=>i(s)):i(r)}unwrap(){return this._def.innerType}};Sr.create=(t,e)=>new Sr({innerType:t,typeName:te.ZodReadonly,...ne(e)});function Wp(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Xp(t,e={},r){return t?Wt.create().superRefine((i,s)=>{let n=t(i);if(n instanceof Promise)return n.then(a=>{if(!a){let o=Wp(e,i),c=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:c})}});if(!n){let a=Wp(e,i),o=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:o})}}):Wt.create()}var G_={object:He.lazycreate},te;(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"})(te||(te={}));var q_=(t,e={message:`Input not instance of ${t.name}`})=>Xp(r=>r instanceof t,e),Jp=zt.create,Zp=ur.create,z_=si.create,W_=fr.create,Qp=hr.create,V_=pr.create,H_=ei.create,K_=dr.create,Y_=mr.create,X_=Wt.create,J_=Tt.create,Z_=pt.create,Q_=ti.create,eS=Pt.create,tS=He.create,rS=He.strictCreate,iS=gr.create,sS=mn.create,nS=yr.create,oS=xt.create,aS=gn.create,cS=ri.create,lS=ii.create,uS=yn.create,fS=br.create,hS=vr.create,pS=wr.create,dS=xr.create,mS=Vt.create,gS=it.create,yS=tt.create,bS=Et.create,vS=it.createWithPreprocess,wS=es.create,xS=()=>Jp().optional(),ES=()=>Zp().optional(),_S=()=>Qp().optional(),SS={string:(t=>zt.create({...t,coerce:!0})),number:(t=>ur.create({...t,coerce:!0})),boolean:(t=>hr.create({...t,coerce:!0})),bigint:(t=>fr.create({...t,coerce:!0})),date:(t=>pr.create({...t,coerce:!0}))};var RS=Q;var CS=P.object({repository_url:P.string(),powerlint_version:P.string(),schema_version:P.string()}),AS=P.object({configured:P.boolean(),invalid_api_key:P.boolean().optional(),is_valid_repository:P.boolean().optional(),config:P.object({ignored_globs:P.array(P.string())}).optional()}),LS=P.object({repository_url:P.string(),rule_ids:P.array(P.string()).optional(),schema_version:P.string(),powerlint_version:P.string()}),OS=P.object({rules:P.array(P.object({id:P.string(),internalId:P.string(),internalVersionId:P.string(),message:P.string(),prompt:P.string(),severity:P.enum(["suggestion","violation"]),schema:P.any(),execution:P.enum(["llm","deterministic"]).optional()}))}),$S=P.object({rule:P.object({id:P.string(),versionId:P.string(),contents:P.string(),message:P.string()}),matches:P.array(P.any()),messages:P.array(P.any()),tools:P.array(P.enum(["read","grep","glob"])),files:P.array(P.object({path:P.string(),sha:P.string()})).optional(),schema_version:P.string(),powerlint_version:P.string(),repository_url:P.string(),commit:P.object({sha:P.string(),branch:P.string(),message:P.string(),timestamp:P.string()})}),TS=P.discriminatedUnion("type",[P.object({type:P.literal("tool_request"),tool_calls:P.array(P.any()),usage:P.object({cost:P.string(),inputTokens:P.string(),outputTokens:P.string()})}),P.object({type:P.literal("matches"),matches:P.array(P.any()),usage:P.object({cost:P.string(),inputTokens:P.string(),outputTokens:P.string()}),files:P.array(P.object({path:P.string(),sha:P.string()})).optional()}),P.object({type:P.literal("request_files"),files:P.array(P.object({path:P.string(),sha:P.string()})),usage:P.object({cost:P.string(),inputTokens:P.string(),outputTokens:P.string()})})]),PS=P.object({rule:P.object({id:P.string(),versionId:P.string(),contents:P.string(),message:P.string()}),matches:P.array(P.any()),files:P.array(P.object({path:P.string(),sha:P.string()})).optional(),schema_version:P.string(),powerlint_version:P.string(),repository_url:P.string(),commit:P.object({sha:P.string(),branch:P.string(),message:P.string(),timestamp:P.string()})}),IS=P.object({type:P.literal("matches"),matches:P.array(P.any()),usage:P.object({cost:P.string(),inputTokens:P.string(),outputTokens:P.string()})}),ts=class{baseUrl;apiKey;constructor(e){this.baseUrl=e.baseUrl,this.apiKey=e.apiKey}async request(e,r,i){let s=`${this.baseUrl}${e}`,a=await(await lc(async()=>{let o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(r)});if(!o.ok){let c=await o.text();throw new Error(`Wispbit API request failed: ${o.status} ${o.statusText} - ${c}`)}return o},{retries:3,minTimeout:1e3,maxTimeout:5e3,onFailedAttempt:o=>{console.warn(`API request to ${e} failed (attempt ${o.attemptNumber}/4): ${o.message}`)}})).json();return i?i.parse(a):a}async initialize(e){let r=CS.parse(e);return await this.request("/plv1/initialize",r,AS)}async getRules(e){let r=LS.parse(e);return await this.request("/plv1/get-rules",r,OS)}async matchLLMSearch(e){let r=$S.parse(e);return await this.request("/plv1/llm-search",r,TS)}async matchLLMValidate(e){let r=PS.parse(e);return await this.request("/plv1/llm-validate",r,IS)}};var bn=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async search(e){let r=this.config.getApiClient(),i=await this.environment.getRepositoryUrl(),s=await this.environment.getCurrentCommit(),n={id:e.rule.internalId,versionId:e.rule.internalVersionId,contents:e.rule.prompt,message:e.rule.config.message};return await r.matchLLMSearch({rule:n,matches:e.matches,messages:e.messages,tools:e.tools,files:e.files,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion(),repository_url:i,commit:s})}async validate(e){let r=this.config.getApiClient(),i=await this.environment.getRepositoryUrl(),s=await this.environment.getCurrentCommit(),n={id:e.rule.internalId,versionId:e.rule.internalVersionId,contents:e.rule.prompt,message:e.rule.config.message};return await r.matchLLMValidate({rule:n,matches:e.matches,files:e.files,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion(),repository_url:i,commit:s})}};import{readFileSync as WR}from"fs";import{dirname as VR,join as HR}from"path";import{fileURLToPath as KR}from"url";var rs=class extends Error{response;request;options;constructor(e,r,i){let s=e.status||e.status===0?e.status:"",n=e.statusText||"",a=`${s} ${n}`.trim(),o=a?`status code ${a}`:"an unknown error";super(`Request failed with ${o}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=i}};var ni=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var pc=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",i=typeof globalThis.Request=="function";if(r&&i)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(s){if(s instanceof Error&&s.message==="unsupported BodyInit type")return!1;throw s}return t&&!e})(),ed=typeof globalThis.AbortController=="function",td=typeof globalThis.ReadableStream=="function",rd=typeof globalThis.FormData=="function",vn=["get","post","put","patch","head","delete"],FS=()=>{};FS();var id={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},wn=2147483647,sd=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,xn=Symbol("stop"),nd={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},od={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,dispatcher:!0,duplex:!0,priority:!0};var NS=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[r,i]of t)e+=sd,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,e+=typeof i=="string"?new TextEncoder().encode(i).length:i.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},ad=(t,e)=>{let r=Number(t.headers.get("content-length"))||0,i=0;return t.status===204?(e&&e({percent:1,totalBytes:r,transferredBytes:i},new Uint8Array),new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new Response(new ReadableStream({async start(s){let n=t.body.getReader();e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function a(){let{done:o,value:c}=await n.read();if(o){s.close();return}if(e){i+=c.byteLength;let l=r===0?0:i/r;e({percent:l,transferredBytes:i,totalBytes:r},c)}s.enqueue(c),await a()}await a()}}),{status:t.status,statusText:t.statusText,headers:t.headers})},cd=(t,e)=>{let r=NS(t.body),i=0;return new Request(t,{duplex:"half",body:new ReadableStream({async start(s){let n=t.body instanceof ReadableStream?t.body.getReader():new Response("").body.getReader();async function a(){let{done:o,value:c}=await n.read();if(o){e&&e({percent:1,transferredBytes:i,totalBytes:Math.max(r,i)},new Uint8Array),s.close();return}i+=c.byteLength;let l=r===0?0:i/r;(r<i||l===1)&&(l=.99),e&&e({percent:Number(l.toFixed(2)),transferredBytes:i,totalBytes:r},c),s.enqueue(c),await a()}await a()}})})};var oi=t=>t!==null&&typeof t=="object";var is=(...t)=>{for(let e of t)if((!oi(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return gc({},...t)},dc=(t={},e={})=>{let r=new globalThis.Headers(t),i=e instanceof globalThis.Headers,s=new globalThis.Headers(e);for(let[n,a]of s.entries())i&&a==="undefined"||a===void 0?r.delete(n):r.set(n,a);return r};function En(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:gc(t[r]??[],e[r]??[])}var mc=(t={},e={})=>({beforeRequest:En(t,e,"beforeRequest"),beforeRetry:En(t,e,"beforeRetry"),afterResponse:En(t,e,"afterResponse"),beforeError:En(t,e,"beforeError")}),gc=(...t)=>{let e={},r={},i={};for(let s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(oi(s)){for(let[n,a]of Object.entries(s))oi(a)&&n in e&&(a=gc(e[n],a)),e={...e,[n]:a};oi(s.hooks)&&(i=mc(i,s.hooks),e.hooks=i),oi(s.headers)&&(r=dc(r,s.headers),e.headers=r)}return e};var ud=t=>vn.includes(t)?t.toUpperCase():t,DS=["get","put","head","delete","options","trace"],MS=[408,413,429,500,502,503,504],kS=[413,429,503],ld={limit:2,methods:DS,statusCodes:MS,afterStatusCodes:kS,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},fd=(t={})=>{if(typeof t=="number")return{...ld,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...ld,...t}};async function yc(t,e,r,i){return new Promise((s,n)=>{let a=setTimeout(()=>{r&&r.abort(),n(new ni(t))},i.timeout);i.fetch(t,e).then(s).catch(n).then(()=>{clearTimeout(a)})})}async function bc(t,{signal:e}){return new Promise((r,i)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",s,{once:!0}));function s(){clearTimeout(n),i(e.reason)}let n=setTimeout(()=>{e?.removeEventListener("abort",s),r()},t)})}var hd=(t,e)=>{let r={};for(let i in e)!(i in od)&&!(i in nd)&&!(i in t)&&(r[i]=e[i]);return r};var ss=class t{static create(e,r){let i=new t(e,r),s=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>wn)throw new RangeError(`The \`timeout\` option cannot be greater than ${wn}`);await Promise.resolve();let o=await i._fetch();for(let c of i._options.hooks.afterResponse){let l=await c(i.request,i._options,i._decorateResponse(o.clone()));l instanceof globalThis.Response&&(o=l)}if(i._decorateResponse(o),!o.ok&&i._options.throwHttpErrors){let c=new rs(o,i.request,i._options);for(let l of i._options.hooks.beforeError)c=await l(c);throw c}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!td)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return ad(o.clone(),i._options.onDownloadProgress)}return o},a=(i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(s):s()).finally(async()=>{i.request.bodyUsed||await i.request.body?.cancel()});for(let[o,c]of Object.entries(id))a[o]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||c);let l=await a;if(o==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[o]()};return a}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:dc(this._input.headers,r.headers),hooks:mc({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:ud(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:fd(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(ed){let i=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=i?AbortSignal.any([i,this.abortController.signal]):this.abortController.signal}if(pc&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let s="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),n=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);(rd&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(n,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!pc)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=cd(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof ni)throw e;if(e instanceof rs){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let i=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(i&&this._options.retry.afterStatusCodes.includes(e.response.status)){let s=Number(i)*1e3;Number.isNaN(s)?s=Date.parse(i)-Date.now():s>=Date.parse("2024-01-01")&&(s-=Date.now());let n=this._options.retry.maxRetryAfter??s;return s<n?s:n}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let i=Math.min(this._calculateRetryDelay(r),wn);if(this._retryCount<1)throw r;await bc(i,{signal:this._options.signal});for(let s of this._options.hooks.beforeRetry)if(await s({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===xn)return;return this._retry(e)}}async _fetch(){for(let i of this._options.hooks.beforeRequest){let s=await i(this.request,this._options);if(s instanceof Request){this.request=s;break}if(s instanceof Response)return s}let e=hd(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):yc(r,e,this.abortController,this._options)}};var vc=t=>{let e=(r,i)=>ss.create(r,is(t,i));for(let r of vn)e[r]=(i,s)=>ss.create(i,is(t,s,{method:r}));return e.create=r=>vc(is(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),vc(is(t,r))),e.stop=xn,e},jS=vc(),pd=jS;var Dd=We(Nd(),1);function Sc(t){let e=(0,Dd.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var $m=We(Om(),1),Tm=We(oc(),1),Mc=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},kc=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function jc(t,e={}){let{version:r="latest"}=e,{omitDeprecated:i=!0}=e,s=t.split("/")[0],n=e.registryUrl??Sc(s),a=new URL(encodeURIComponent(t).replace(/^%40/,"@"),n),o=(0,$m.default)(n.toString(),{recursive:!0}),c={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete c.accept,o&&(c.authorization=`${o.type} ${o.token}`);let l;try{l=await pd(a,{headers:c,keepalive:!0}).json()}catch(d){throw d?.response?.status===404?new Mc(t):d}if(e.allVersions)return l;let u=new kc(t,r);if(l["dist-tags"][r]){let{time:d}=l;l=l.versions[l["dist-tags"][r]],l.time=d}else if(r){let d=!!l.versions[r];if(i&&!d)for(let[f,p]of Object.entries(l.versions))p.deprecated&&delete l.versions[f];if(!d){let f=Object.keys(l.versions);if(r=Tm.default.maxSatisfying(f,r),!r)throw u}let{time:b}=l;if(l=l.versions[r],l.time=b,!l)throw u}return l}async function Bc(t,e){let{version:r}=await jc(t.toLowerCase(),e);return r}function Ir(){let t=KR(import.meta.url?import.meta.url:__filename),e=VR(t),r=HR(e,"./package.json");try{let i=WR(r,"utf8");return JSON.parse(i).version}catch{return"0.0.0"}}async function Pm(){try{return await Bc("@wispbit/local")}catch{return Ir()}}var us=class t{config;apiKey=null;baseUrl=null;apiClient=null;llmProvider=null;constructor(e,r){this.config={...e,ignoredGlobs:e.ignoredGlobs||[]},this.apiKey=e.apiKey||null,this.baseUrl=e.baseUrl||null,this.apiKey&&this.baseUrl&&(this.apiClient=new ts({baseUrl:this.baseUrl,apiKey:this.apiKey})),r?.llmProvider&&(this.llmProvider=r.llmProvider)}getIgnoredGlobs(){return this.config.ignoredGlobs||[]}getApiKey(){return this.apiKey}getBaseUrl(){return this.baseUrl}getApiClient(){if(!this.apiClient)throw new Error("API client not initialized. Config must have both apiKey and baseUrl.");return this.apiClient}getLLMProvider(){if(!this.llmProvider)throw new Error("LLM provider not initialized. Use Config.initialize() instead of initializeLocal().");return this.llmProvider}getLocalVersion(){return Ir()}getSchemaVersion(){return"v1"}static initializeLocal(e={}){let r=e.ignoredGlobs||[];return new t({ignoredGlobs:r},{llmProvider:e.llmProvider})}static async initialize(e,{apiKey:r,baseUrl:i}){let s=i||process.env.WISPBIT_API_BASE_URL||"https://api.wispbit.com",n=r||process.env.WISPBIT_API_KEY||null;if(!n)return console.log("No API key found"),{failed:!0,error:"INVALID_API_KEY"};let a=await e.getRepositoryUrl(),c=await new ts({baseUrl:s,apiKey:n}).initialize({repository_url:a,powerlint_version:Ir(),schema_version:"v1"});if(c.invalid_api_key)return{failed:!0,error:"INVALID_API_KEY"};if(!c.is_valid_repository)return{failed:!0,error:"INVALID_REPOSITORY"};let l=c.config?.ignored_globs||[],u=new t({ignoredGlobs:l,apiKey:n,baseUrl:s},{});return u.llmProvider=new bn(u,e),u}isConfigured(){return this.getApiKey()!==null}};import{exec as XR,execSync as JR}from"child_process";import{existsSync as ZR,readFileSync as QR}from"fs";import{promisify as eC}from"util";import{createHash as YR}from"crypto";function fs(t){return YR("sha256").update(t).digest("hex")}var he=eC(XR);function Fm(){return JR("git rev-parse --show-toplevel",{encoding:"utf-8"}).trim()}async function Nm(t){let{stdout:e}=await he("git ls-files --ignored --exclude-standard --others",{cwd:t,maxBuffer:52428800});return e.split(`
|
|
41
|
-
`).filter(Boolean).map(r=>r.trim())}async function Dm(t,e="origin"){let{stdout:r}=await
|
|
42
|
-
`)[0].match(/a\/(.+?) b\//);if(a){let o=a[1];e.set(o,"diff --git "+i)}}return e}function sC(t){return t.status==="U"||t.status==="A"?"added":t.status==="D"?"removed":"modified"}function
|
|
40
|
+
`;let n=u=>{console.log(s),Ba.exit(typeof u=="number"?u:2)},a=()=>{console.log(e.version),Ba.exit(0)};i._.length===0&&e.argv.length===1&&(i.version===!0&&e.autoVersion?a():i.help===!0&&e.autoHelp&&n(0));let o=i._;delete i._,e.allowUnknownFlags||qh(o);let c=Sh(i,{exclude:["--",/^\w$/]}),l={...c};zh(c,e);for(let u of Object.values(e.flags)){if(Array.isArray(u.aliases))for(let d of u.aliases)delete c[d];delete c[u.shortFlag]}return Wh(e.flags,c,o),{input:o,flags:c,unnormalizedFlags:l,pkg:t,help:s,showHelp:n,showVersion:a}},Vh=(t,e={})=>{let r=Bh(t,e),i=Uh(r),s=g1(r,i);return Ba.title=s.pkg.bin?Object.keys(s.pkg.bin).at(0):s.pkg.name,s};var Ey=We(oc(),1);var Gp=We(Bp(),1);var p_=Object.prototype.toString,d_=t=>p_.call(t)==="[object Error]",m_=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function ac(t){return t&&d_(t)&&t.name==="TypeError"&&typeof t.message=="string"?t.message==="Load failed"?t.stack===void 0:m_.has(t.message):!1}var cc=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},Up=(t,e,r)=>{let i=r.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=i,t};async function lc(t,e){return new Promise((r,i)=>{e={...e},e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>!0,e.retries??=10;let s=Gp.default.operation(e),n=()=>{s.stop(),i(e.signal?.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",n,{once:!0});let a=()=>{e.signal?.removeEventListener("abort",n),s.stop()};s.attempt(async o=>{try{let c=await t(o);a(),r(c)}catch(c){try{if(!(c instanceof Error))throw new TypeError(`Non-error was thrown: "${c}". You should only throw errors.`);if(c instanceof cc)throw c.originalError;if(c instanceof TypeError&&!ac(c))throw c;if(Up(c,o,e),await e.shouldRetry(c)||(s.stop(),i(c)),await e.onFailedAttempt(c),!s.retry(c))throw s.mainError()}catch(l){Up(l,o,e),a(),i(l)}}})})}var T={};jo(T,{BRAND:()=>U_,DIRTY:()=>lr,EMPTY_PATH:()=>v_,INVALID:()=>Q,NEVER:()=>RS,OK:()=>Ne,ParseStatus:()=>$e,Schema:()=>ae,ZodAny:()=>Wt,ZodArray:()=>Pt,ZodBigInt:()=>hr,ZodBoolean:()=>fr,ZodBranded:()=>Qi,ZodCatch:()=>_r,ZodDate:()=>pr,ZodDefault:()=>Er,ZodDiscriminatedUnion:()=>mn,ZodEffects:()=>it,ZodEnum:()=>wr,ZodError:()=>Ve,ZodFirstPartyTypeKind:()=>te,ZodFunction:()=>yn,ZodIntersection:()=>yr,ZodIssueCode:()=>N,ZodLazy:()=>br,ZodLiteral:()=>vr,ZodMap:()=>ri,ZodNaN:()=>si,ZodNativeEnum:()=>xr,ZodNever:()=>pt,ZodNull:()=>mr,ZodNullable:()=>Et,ZodNumber:()=>ur,ZodObject:()=>He,ZodOptional:()=>tt,ZodParsedType:()=>U,ZodPipeline:()=>es,ZodPromise:()=>Vt,ZodReadonly:()=>Sr,ZodRecord:()=>gn,ZodSchema:()=>ae,ZodSet:()=>ii,ZodString:()=>qt,ZodSymbol:()=>ei,ZodTransformer:()=>it,ZodTuple:()=>xt,ZodType:()=>ae,ZodUndefined:()=>dr,ZodUnion:()=>gr,ZodUnknown:()=>Tt,ZodVoid:()=>ti,addIssueToContext:()=>B,any:()=>X_,array:()=>eS,bigint:()=>W_,boolean:()=>Qp,coerce:()=>SS,custom:()=>Xp,date:()=>V_,datetimeRegex:()=>Kp,defaultErrorMap:()=>Ot,discriminatedUnion:()=>sS,effect:()=>gS,enum:()=>pS,function:()=>uS,getErrorMap:()=>Jr,getParsedType:()=>wt,instanceof:()=>z_,intersection:()=>nS,isAborted:()=>pn,isAsync:()=>Zr,isDirty:()=>dn,isValid:()=>zt,late:()=>G_,lazy:()=>hS,literal:()=>fS,makeIssue:()=>Zi,map:()=>cS,nan:()=>q_,nativeEnum:()=>dS,never:()=>Z_,null:()=>Y_,nullable:()=>bS,number:()=>Zp,object:()=>tS,objectUtil:()=>uc,oboolean:()=>_S,onumber:()=>ES,optional:()=>yS,ostring:()=>xS,pipeline:()=>wS,preprocess:()=>vS,promise:()=>mS,quotelessJson:()=>g_,record:()=>aS,set:()=>lS,setErrorMap:()=>b_,strictObject:()=>rS,string:()=>Jp,symbol:()=>H_,transformer:()=>gS,tuple:()=>oS,undefined:()=>K_,union:()=>iS,unknown:()=>J_,util:()=>ce,void:()=>Q_});var ce;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let n={};for(let a of s)n[a]=a;return n},t.getValidEnumValues=s=>{let n=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(let o of n)a[o]=s[o];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let n=[];for(let a in s)Object.prototype.hasOwnProperty.call(s,a)&&n.push(a);return n},t.find=(s,n)=>{for(let a of s)if(n(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function i(s,n=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}t.joinValues=i,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(ce||(ce={}));var uc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(uc||(uc={}));var U=ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wt=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}};var N=ce.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"]),g_=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ve=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(n){return n.message},i={_errors:[]},s=n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let o=i,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(a))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return s(this),i}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,ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let s of this.issues)if(s.path.length>0){let n=s.path[0];r[n]=r[n]||[],r[n].push(e(s))}else i.push(e(s));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Ve.create=t=>new Ve(t);var y_=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===U.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ce.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${ce.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ce.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${ce.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ce.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,ce.assertNever(t)}return{message:r}},Ot=y_;var zp=Ot;function b_(t){zp=t}function Jr(){return zp}var Zi=t=>{let{data:e,path:r,errorMaps:i,issueData:s}=t,n=[...r,...s.path||[]],a={...s,path:n};if(s.message!==void 0)return{...s,path:n,message:s.message};let o="",c=i.filter(l=>!!l).slice().reverse();for(let l of c)o=l(a,{data:e,defaultError:o}).message;return{...s,path:n,message:o}},v_=[];function B(t,e){let r=Jr(),i=Zi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Ot?void 0:Ot].filter(s=>!!s)});t.common.issues.push(i)}var $e=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let s of r){if(s.status==="aborted")return Q;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let s of r){let n=await s.key,a=await s.value;i.push({key:n,value:a})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let s of r){let{key:n,value:a}=s;if(n.status==="aborted"||a.status==="aborted")return Q;n.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(i[n.value]=a.value)}return{status:e.value,value:i}}},Q=Object.freeze({status:"aborted"}),lr=t=>({status:"dirty",value:t}),Ne=t=>({status:"valid",value:t}),pn=t=>t.status==="aborted",dn=t=>t.status==="dirty",zt=t=>t.status==="valid",Zr=t=>typeof Promise<"u"&&t instanceof Promise;var K;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(K||(K={}));var rt=class{constructor(e,r,i,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=s}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}},qp=(t,e)=>{if(zt(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 r=new Ve(t.common.issues);return this._error=r,this._error}}};function ne(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:s}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,o)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??i??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:s}}var ae=class{get description(){return this._def.description}_getType(e){return wt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:wt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $e,ctx:{common:e.parent.common,data:e.data,parsedType:wt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Zr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wt(e)},s=this._parseSync({data:e,path:i.path,parent:i});return qp(i,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wt(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return zt(i)?{value:i.value}:{issues:r.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>zt(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wt(e)},s=this._parse({data:e,path:i.path,parent:i}),n=await(Zr(s)?s:Promise.resolve(s));return qp(i,n)}refine(e,r){let i=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,n)=>{let a=e(s),o=()=>n.addIssue({code:N.custom,...i(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof r=="function"?r(i,s):r),!1))}_refinement(e){return new it({schema:this,typeName:te.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:r=>this["~validate"](r)}}optional(){return tt.create(this,this._def)}nullable(){return Et.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pt.create(this)}promise(){return Vt.create(this,this._def)}or(e){return gr.create([this,e],this._def)}and(e){return yr.create(this,e,this._def)}transform(e){return new it({...ne(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Er({...ne(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new Qi({typeName:te.ZodBranded,type:this,...ne(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new _r({...ne(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return es.create(this,e)}readonly(){return Sr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},w_=/^c[^\s-]{8,}$/i,x_=/^[0-9a-z]+$/,E_=/^[0-9A-HJKMNP-TV-Z]{26}$/i,__=/^[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,S_=/^[a-z0-9_-]{21}$/i,R_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,C_=/^[-+]?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)?)??$/,A_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,L_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",hc,O_=/^(?:(?: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])$/,$_=/^(?:(?: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])$/,T_=/^(([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]))$/,P_=/^(([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])$/,I_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,F_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vp="((\\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])))",N_=new RegExp(`^${Vp}$`);function Hp(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function D_(t){return new RegExp(`^${Hp(t)}$`)}function Kp(t){let e=`${Vp}T${Hp(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function M_(t,e){return!!((e==="v4"||!e)&&O_.test(t)||(e==="v6"||!e)&&T_.test(t))}function k_(t,e){if(!R_.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(i));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function j_(t,e){return!!((e==="v4"||!e)&&$_.test(t)||(e==="v6"||!e)&&P_.test(t))}var qt=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_type,expected:U.string,received:n.parsedType}),Q}let i=new $e,s;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="max")e.data.length>n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="length"){let a=e.data.length>n.value,o=e.data.length<n.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?B(s,{code:N.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&B(s,{code:N.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),i.dirty())}else if(n.kind==="email")A_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"email",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="emoji")hc||(hc=new RegExp(L_,"u")),hc.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"emoji",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="uuid")__.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"uuid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="nanoid")S_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"nanoid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid")w_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"cuid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid2")x_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"cuid2",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="ulid")E_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"ulid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),B(s,{validation:"url",code:N.invalid_string,message:n.message}),i.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"regex",code:N.invalid_string,message:n.message}),i.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),i.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:{startsWith:n.value},message:n.message}),i.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:{endsWith:n.value},message:n.message}),i.dirty()):n.kind==="datetime"?Kp(n).test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"datetime",message:n.message}),i.dirty()):n.kind==="date"?N_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"date",message:n.message}),i.dirty()):n.kind==="time"?D_(n).test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"time",message:n.message}),i.dirty()):n.kind==="duration"?C_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"duration",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="ip"?M_(e.data,n.version)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"ip",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="jwt"?k_(e.data,n.alg)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"jwt",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="cidr"?j_(e.data,n.version)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"cidr",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="base64"?I_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"base64",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="base64url"?F_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"base64url",code:N.invalid_string,message:n.message}),i.dirty()):ce.assertNever(n);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(s=>e.test(s),{validation:r,code:N.invalid_string,...K.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...K.errToObj(e)})}url(e){return this._addCheck({kind:"url",...K.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...K.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...K.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...K.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...K.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...K.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...K.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...K.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...K.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...K.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...K.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...K.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,...K.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,...K.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...K.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...K.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...K.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...K.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...K.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...K.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...K.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...K.errToObj(r)})}nonempty(e){return this.min(1,K.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 r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};qt.create=t=>new qt({checks:[],typeName:te.ZodString,coerce:t?.coerce??!1,...ne(t)});function B_(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=r>i?r:i,n=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return n%a/10**s}var ur=class t extends ae{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)!==U.number){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_type,expected:U.number,received:n.parsedType}),Q}let i,s=new $e;for(let n of this._def.checks)n.kind==="int"?ce.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:N.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="multipleOf"?B_(e.data,n.value)!==0&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:N.not_finite,message:n.message}),s.dirty()):ce.assertNever(n);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,K.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.toString(r))}setLimit(e,r,i,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:K.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:K.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:K.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ce.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};ur.create=t=>new ur({checks:[],typeName:te.ZodNumber,coerce:t?.coerce||!1,...ne(t)});var hr=class t extends ae{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)!==U.bigint)return this._getInvalidInput(e);let i,s=new $e;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):ce.assertNever(n);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return B(r,{code:N.invalid_type,expected:U.bigint,received:r.parsedType}),Q}gte(e,r){return this.setLimit("min",e,!0,K.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.toString(r))}setLimit(e,r,i,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:K.toString(s)}]})}_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:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};hr.create=t=>new hr({checks:[],typeName:te.ZodBigInt,coerce:t?.coerce??!1,...ne(t)});var fr=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.boolean,received:i.parsedType}),Q}return Ne(e.data)}};fr.create=t=>new fr({typeName:te.ZodBoolean,coerce:t?.coerce||!1,...ne(t)});var pr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_type,expected:U.date,received:n.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_date}),Q}let i=new $e,s;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),i.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),i.dirty()):ce.assertNever(n);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:K.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:K.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};pr.create=t=>new pr({checks:[],coerce:t?.coerce||!1,typeName:te.ZodDate,...ne(t)});var ei=class extends ae{_parse(e){if(this._getType(e)!==U.symbol){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.symbol,received:i.parsedType}),Q}return Ne(e.data)}};ei.create=t=>new ei({typeName:te.ZodSymbol,...ne(t)});var dr=class extends ae{_parse(e){if(this._getType(e)!==U.undefined){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.undefined,received:i.parsedType}),Q}return Ne(e.data)}};dr.create=t=>new dr({typeName:te.ZodUndefined,...ne(t)});var mr=class extends ae{_parse(e){if(this._getType(e)!==U.null){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.null,received:i.parsedType}),Q}return Ne(e.data)}};mr.create=t=>new mr({typeName:te.ZodNull,...ne(t)});var Wt=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Ne(e.data)}};Wt.create=t=>new Wt({typeName:te.ZodAny,...ne(t)});var Tt=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ne(e.data)}};Tt.create=t=>new Tt({typeName:te.ZodUnknown,...ne(t)});var pt=class extends ae{_parse(e){let r=this._getOrReturnCtx(e);return B(r,{code:N.invalid_type,expected:U.never,received:r.parsedType}),Q}};pt.create=t=>new pt({typeName:te.ZodNever,...ne(t)});var ti=class extends ae{_parse(e){if(this._getType(e)!==U.undefined){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.void,received:i.parsedType}),Q}return Ne(e.data)}};ti.create=t=>new ti({typeName:te.ZodVoid,...ne(t)});var Pt=class t extends ae{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),s=this._def;if(r.parsedType!==U.array)return B(r,{code:N.invalid_type,expected:U.array,received:r.parsedType}),Q;if(s.exactLength!==null){let a=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(a||o)&&(B(r,{code:a?N.too_big:N.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(B(r,{code:N.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(B(r,{code:N.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>s.type._parseAsync(new rt(r,a,r.path,o)))).then(a=>$e.mergeArray(i,a));let n=[...r.data].map((a,o)=>s.type._parseSync(new rt(r,a,r.path,o)));return $e.mergeArray(i,n)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:K.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:K.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:K.toString(r)}})}nonempty(e){return this.min(1,e)}};Pt.create=(t,e)=>new Pt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ne(e)});function Qr(t){if(t instanceof He){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=tt.create(Qr(i))}return new He({...t._def,shape:()=>e})}else return t instanceof Pt?new Pt({...t._def,type:Qr(t.element)}):t instanceof tt?tt.create(Qr(t.unwrap())):t instanceof Et?Et.create(Qr(t.unwrap())):t instanceof xt?xt.create(t.items.map(e=>Qr(e))):t}var He=class t extends ae{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(),r=ce.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==U.object){let l=this._getOrReturnCtx(e);return B(l,{code:N.invalid_type,expected:U.object,received:l.parsedType}),Q}let{status:i,ctx:s}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof pt&&this._def.unknownKeys==="strip"))for(let l in s.data)a.includes(l)||o.push(l);let c=[];for(let l of a){let u=n[l],d=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new rt(s,d,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof pt){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of o)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(l==="strict")o.length>0&&(B(s,{code:N.unrecognized_keys,keys:o}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of o){let d=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new rt(s,d,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,g=await u.value;l.push({key:d,value:g,alwaysSet:u.alwaysSet})}return l}).then(l=>$e.mergeObjectSync(i,l)):$e.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return K.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{let s=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:K.errToObj(e).message??s}:{message:s}}}:{}})}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:te.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let i of ce.objectKeys(e))e[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let i of ce.objectKeys(this.shape))e[i]||(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}deepPartial(){return Qr(this)}partial(e){let r={};for(let i of ce.objectKeys(this.shape)){let s=this.shape[i];e&&!e[i]?r[i]=s:r[i]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let i of ce.objectKeys(this.shape))if(e&&!e[i])r[i]=this.shape[i];else{let n=this.shape[i];for(;n instanceof tt;)n=n._def.innerType;r[i]=n}return new t({...this._def,shape:()=>r})}keyof(){return Yp(ce.objectKeys(this.shape))}};He.create=(t,e)=>new He({shape:()=>t,unknownKeys:"strip",catchall:pt.create(),typeName:te.ZodObject,...ne(e)});He.strictCreate=(t,e)=>new He({shape:()=>t,unknownKeys:"strict",catchall:pt.create(),typeName:te.ZodObject,...ne(e)});He.lazycreate=(t,e)=>new He({shape:t,unknownKeys:"strip",catchall:pt.create(),typeName:te.ZodObject,...ne(e)});var gr=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function s(n){for(let o of n)if(o.result.status==="valid")return o.result;for(let o of n)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=n.map(o=>new Ve(o.ctx.common.issues));return B(r,{code:N.invalid_union,unionErrors:a}),Q}if(r.common.async)return Promise.all(i.map(async n=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let n,a=[];for(let c of i){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;let o=a.map(c=>new Ve(c));return B(r,{code:N.invalid_union,unionErrors:o}),Q}}get options(){return this._def.options}};gr.create=(t,e)=>new gr({options:t,typeName:te.ZodUnion,...ne(e)});var $t=t=>t instanceof br?$t(t.schema):t instanceof it?$t(t.innerType()):t instanceof vr?[t.value]:t instanceof wr?t.options:t instanceof xr?ce.objectValues(t.enum):t instanceof Er?$t(t._def.innerType):t instanceof dr?[void 0]:t instanceof mr?[null]:t instanceof tt?[void 0,...$t(t.unwrap())]:t instanceof Et?[null,...$t(t.unwrap())]:t instanceof Qi||t instanceof Sr?$t(t.unwrap()):t instanceof _r?$t(t._def.innerType):[],mn=class t extends ae{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return B(r,{code:N.invalid_type,expected:U.object,received:r.parsedType}),Q;let i=this.discriminator,s=r.data[i],n=this.optionsMap.get(s);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(B(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let s=new Map;for(let n of r){let a=$t(n.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,n)}}return new t({typeName:te.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...ne(i)})}};function fc(t,e){let r=wt(t),i=wt(e);if(t===e)return{valid:!0,data:t};if(r===U.object&&i===U.object){let s=ce.objectKeys(e),n=ce.objectKeys(t).filter(o=>s.indexOf(o)!==-1),a={...t,...e};for(let o of n){let c=fc(t[o],e[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(r===U.array&&i===U.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let n=0;n<t.length;n++){let a=t[n],o=e[n],c=fc(a,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===U.date&&i===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var yr=class extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),s=(n,a)=>{if(pn(n)||pn(a))return Q;let o=fc(n.value,a.value);return o.valid?((dn(n)||dn(a))&&r.dirty(),{status:r.value,value:o.data}):(B(i,{code:N.invalid_intersection_types}),Q)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([n,a])=>s(n,a)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};yr.create=(t,e,r)=>new yr({left:t,right:e,typeName:te.ZodIntersection,...ne(r)});var xt=class t extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.array)return B(i,{code:N.invalid_type,expected:U.array,received:i.parsedType}),Q;if(i.data.length<this._def.items.length)return B(i,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&i.data.length>this._def.items.length&&(B(i,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let n=[...i.data].map((a,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new rt(i,a,i.path,o)):null}).filter(a=>!!a);return i.common.async?Promise.all(n).then(a=>$e.mergeArray(r,a)):$e.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};xt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xt({items:t,typeName:te.ZodTuple,rest:null,...ne(e)})};var gn=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.object)return B(i,{code:N.invalid_type,expected:U.object,received:i.parsedType}),Q;let s=[],n=this._def.keyType,a=this._def.valueType;for(let o in i.data)s.push({key:n._parse(new rt(i,o,i.path,o)),value:a._parse(new rt(i,i.data[o],i.path,o)),alwaysSet:o in i.data});return i.common.async?$e.mergeObjectAsync(r,s):$e.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof ae?new t({keyType:e,valueType:r,typeName:te.ZodRecord,...ne(i)}):new t({keyType:qt.create(),valueType:e,typeName:te.ZodRecord,...ne(r)})}},ri=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.map)return B(i,{code:N.invalid_type,expected:U.map,received:i.parsedType}),Q;let s=this._def.keyType,n=this._def.valueType,a=[...i.data.entries()].map(([o,c],l)=>({key:s._parse(new rt(i,o,i.path,[l,"key"])),value:n._parse(new rt(i,c,i.path,[l,"value"]))}));if(i.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Q;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of a){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Q;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}}}};ri.create=(t,e,r)=>new ri({valueType:e,keyType:t,typeName:te.ZodMap,...ne(r)});var ii=class t extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.set)return B(i,{code:N.invalid_type,expected:U.set,received:i.parsedType}),Q;let s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(B(i,{code:N.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(B(i,{code:N.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let n=this._def.valueType;function a(c){let l=new Set;for(let u of c){if(u.status==="aborted")return Q;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let o=[...i.data.values()].map((c,l)=>n._parse(new rt(i,c,i.path,l)));return i.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:K.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:K.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};ii.create=(t,e)=>new ii({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ne(e)});var yn=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.function)return B(r,{code:N.invalid_type,expected:U.function,received:r.parsedType}),Q;function i(o,c){return Zi({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jr(),Ot].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:c}})}function s(o,c){return Zi({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jr(),Ot].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:c}})}let n={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Vt){let o=this;return Ne(async function(...c){let l=new Ve([]),u=await o._def.args.parseAsync(c,n).catch(h=>{throw l.addIssue(i(c,h)),l}),d=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(d,n).catch(h=>{throw l.addIssue(s(d,h)),l})})}else{let o=this;return Ne(function(...c){let l=o._def.args.safeParse(c,n);if(!l.success)throw new Ve([i(c,l.error)]);let u=Reflect.apply(a,this,l.data),d=o._def.returns.safeParse(u,n);if(!d.success)throw new Ve([s(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:xt.create(e).rest(Tt.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,r,i){return new t({args:e||xt.create([]).rest(Tt.create()),returns:r||Tt.create(),typeName:te.ZodFunction,...ne(i)})}},br=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};br.create=(t,e)=>new br({getter:t,typeName:te.ZodLazy,...ne(e)});var vr=class extends ae{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return B(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};vr.create=(t,e)=>new vr({value:t,typeName:te.ZodLiteral,...ne(e)});function Yp(t,e){return new wr({values:t,typeName:te.ZodEnum,...ne(e)})}var wr=class t extends ae{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return B(r,{expected:ce.joinValues(i),received:r.parsedType,code:N.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),i=this._def.values;return B(r,{received:r.data,code:N.invalid_enum_value,options:i}),Q}return Ne(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...r})}};wr.create=Yp;var xr=class extends ae{_parse(e){let r=ce.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==U.string&&i.parsedType!==U.number){let s=ce.objectValues(r);return B(i,{expected:ce.joinValues(s),received:i.parsedType,code:N.invalid_type}),Q}if(this._cache||(this._cache=new Set(ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=ce.objectValues(r);return B(i,{received:i.data,code:N.invalid_enum_value,options:s}),Q}return Ne(e.data)}get enum(){return this._def.values}};xr.create=(t,e)=>new xr({values:t,typeName:te.ZodNativeEnum,...ne(e)});var Vt=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.promise&&r.common.async===!1)return B(r,{code:N.invalid_type,expected:U.promise,received:r.parsedType}),Q;let i=r.parsedType===U.promise?r.data:Promise.resolve(r.data);return Ne(i.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Vt.create=(t,e)=>new Vt({type:t,typeName:te.ZodPromise,...ne(e)});var it=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),s=this._def.effect||null,n={addIssue:a=>{B(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(n.addIssue=n.addIssue.bind(n),s.type==="preprocess"){let a=s.transform(i.data,n);if(i.common.async)return Promise.resolve(a).then(async o=>{if(r.value==="aborted")return Q;let c=await this._def.schema._parseAsync({data:o,path:i.path,parent:i});return c.status==="aborted"?Q:c.status==="dirty"?lr(c.value):r.value==="dirty"?lr(c.value):c});{if(r.value==="aborted")return Q;let o=this._def.schema._parseSync({data:a,path:i.path,parent:i});return o.status==="aborted"?Q:o.status==="dirty"?lr(o.value):r.value==="dirty"?lr(o.value):o}}if(s.type==="refinement"){let a=o=>{let c=s.refinement(o,n);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?Q:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?Q:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!zt(a))return Q;let o=s.transform(a.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>zt(a)?Promise.resolve(s.transform(a.value,n)).then(o=>({status:r.value,value:o})):Q);ce.assertNever(s)}};it.create=(t,e,r)=>new it({schema:t,typeName:te.ZodEffects,effect:e,...ne(r)});it.createWithPreprocess=(t,e,r)=>new it({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ne(r)});var tt=class extends ae{_parse(e){return this._getType(e)===U.undefined?Ne(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tt.create=(t,e)=>new tt({innerType:t,typeName:te.ZodOptional,...ne(e)});var Et=class extends ae{_parse(e){return this._getType(e)===U.null?Ne(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Et.create=(t,e)=>new Et({innerType:t,typeName:te.ZodNullable,...ne(e)});var Er=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===U.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Er.create=(t,e)=>new Er({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ne(e)});var _r=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Zr(s)?s.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ve(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ve(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};_r.create=(t,e)=>new _r({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ne(e)});var si=class extends ae{_parse(e){if(this._getType(e)!==U.nan){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.nan,received:i.parsedType}),Q}return{status:"valid",value:e.data}}};si.create=t=>new si({typeName:te.ZodNaN,...ne(t)});var U_=Symbol("zod_brand"),Qi=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},es=class t extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?Q:n.status==="dirty"?(r.dirty(),lr(n.value)):this._def.out._parseAsync({data:n.value,path:i.path,parent:i})})();{let s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Q:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:te.ZodPipeline})}},Sr=class extends ae{_parse(e){let r=this._def.innerType._parse(e),i=s=>(zt(s)&&(s.value=Object.freeze(s.value)),s);return Zr(r)?r.then(s=>i(s)):i(r)}unwrap(){return this._def.innerType}};Sr.create=(t,e)=>new Sr({innerType:t,typeName:te.ZodReadonly,...ne(e)});function Wp(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Xp(t,e={},r){return t?Wt.create().superRefine((i,s)=>{let n=t(i);if(n instanceof Promise)return n.then(a=>{if(!a){let o=Wp(e,i),c=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:c})}});if(!n){let a=Wp(e,i),o=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:o})}}):Wt.create()}var G_={object:He.lazycreate},te;(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"})(te||(te={}));var z_=(t,e={message:`Input not instance of ${t.name}`})=>Xp(r=>r instanceof t,e),Jp=qt.create,Zp=ur.create,q_=si.create,W_=hr.create,Qp=fr.create,V_=pr.create,H_=ei.create,K_=dr.create,Y_=mr.create,X_=Wt.create,J_=Tt.create,Z_=pt.create,Q_=ti.create,eS=Pt.create,tS=He.create,rS=He.strictCreate,iS=gr.create,sS=mn.create,nS=yr.create,oS=xt.create,aS=gn.create,cS=ri.create,lS=ii.create,uS=yn.create,hS=br.create,fS=vr.create,pS=wr.create,dS=xr.create,mS=Vt.create,gS=it.create,yS=tt.create,bS=Et.create,vS=it.createWithPreprocess,wS=es.create,xS=()=>Jp().optional(),ES=()=>Zp().optional(),_S=()=>Qp().optional(),SS={string:(t=>qt.create({...t,coerce:!0})),number:(t=>ur.create({...t,coerce:!0})),boolean:(t=>fr.create({...t,coerce:!0})),bigint:(t=>hr.create({...t,coerce:!0})),date:(t=>pr.create({...t,coerce:!0}))};var RS=Q;var CS=T.object({repository_url:T.string(),powerlint_version:T.string(),schema_version:T.string()}),AS=T.object({configured:T.boolean(),invalid_api_key:T.boolean().optional(),is_valid_repository:T.boolean().optional(),config:T.object({ignored_globs:T.array(T.string())}).optional()}),LS=T.object({repository_url:T.string(),rule_ids:T.array(T.string()).optional(),schema_version:T.string(),powerlint_version:T.string()}),OS=T.object({rules:T.array(T.object({id:T.string(),internalId:T.string(),internalVersionId:T.string(),message:T.string(),prompt:T.string(),severity:T.enum(["suggestion","violation"]),schema:T.any(),execution:T.enum(["llm","deterministic"]).optional()}))}),$S=T.object({rule:T.object({id:T.string(),versionId:T.string(),contents:T.string(),message:T.string()}),matches:T.array(T.any()),messages:T.array(T.any()),tools:T.array(T.enum(["read","grep","glob"])),files:T.array(T.object({path:T.string(),sha:T.string()})).optional(),schema_version:T.string(),powerlint_version:T.string(),repository_url:T.string(),commit:T.object({sha:T.string(),branch:T.string(),message:T.string(),timestamp:T.string()})}),TS=T.discriminatedUnion("type",[T.object({type:T.literal("tool_request"),tool_calls:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})}),T.object({type:T.literal("matches"),matches:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()}),files:T.array(T.object({path:T.string(),sha:T.string()})).optional()}),T.object({type:T.literal("request_files"),files:T.array(T.object({path:T.string(),sha:T.string()})),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})}),T.object({type:T.literal("partial_matches"),matches:T.array(T.any()),unresolved:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})})]),PS=T.object({rule:T.object({id:T.string(),versionId:T.string(),contents:T.string(),message:T.string()}),matches:T.array(T.any()),files:T.array(T.object({path:T.string(),sha:T.string()})).optional(),schema_version:T.string(),powerlint_version:T.string(),repository_url:T.string(),commit:T.object({sha:T.string(),branch:T.string(),message:T.string(),timestamp:T.string()})}),IS=T.discriminatedUnion("type",[T.object({type:T.literal("matches"),matches:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})}),T.object({type:T.literal("partial_matches"),matches:T.array(T.any()),unresolved:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})})]),ts=class{baseUrl;apiKey;constructor(e){this.baseUrl=e.baseUrl,this.apiKey=e.apiKey}async request(e,r,i){let s=`${this.baseUrl}${e}`,a=await(await lc(async()=>{let o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(r)});if(!o.ok){let c=await o.text();throw new Error(`Wispbit API request failed: ${o.status} ${o.statusText} - ${c}`)}return o},{retries:5,factor:2,minTimeout:1e3,maxTimeout:1e4,randomize:!0})).json();return i?i.parse(a):a}async initialize(e){let r=CS.parse(e);return await this.request("/plv1/initialize",r,AS)}async getRules(e){let r=LS.parse(e);return await this.request("/plv1/get-rules",r,OS)}async matchLLMSearch(e){let r=$S.parse(e);return await this.request("/plv1/llm-search",r,TS)}async matchLLMValidate(e){let r=PS.parse(e);return await this.request("/plv1/llm-validate",r,IS)}};var bn=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async search(e){let r=this.config.getApiClient(),i=await this.environment.getRepositoryUrl(),s=await this.environment.getCurrentCommit(),n={id:e.rule.internalId,versionId:e.rule.internalVersionId,contents:e.rule.prompt,message:e.rule.config.message};return await r.matchLLMSearch({rule:n,matches:e.matches,messages:e.messages,tools:e.tools,files:e.files,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion(),repository_url:i,commit:s})}async validate(e){let r=this.config.getApiClient(),i=await this.environment.getRepositoryUrl(),s=await this.environment.getCurrentCommit(),n={id:e.rule.internalId,versionId:e.rule.internalVersionId,contents:e.rule.prompt,message:e.rule.config.message};return await r.matchLLMValidate({rule:n,matches:e.matches,files:e.files,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion(),repository_url:i,commit:s})}};import{readFileSync as WR}from"fs";import{dirname as VR,join as HR}from"path";import{fileURLToPath as KR}from"url";var rs=class extends Error{response;request;options;constructor(e,r,i){let s=e.status||e.status===0?e.status:"",n=e.statusText||"",a=`${s} ${n}`.trim(),o=a?`status code ${a}`:"an unknown error";super(`Request failed with ${o}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=i}};var ni=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var pc=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",i=typeof globalThis.Request=="function";if(r&&i)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(s){if(s instanceof Error&&s.message==="unsupported BodyInit type")return!1;throw s}return t&&!e})(),ed=typeof globalThis.AbortController=="function",td=typeof globalThis.ReadableStream=="function",rd=typeof globalThis.FormData=="function",vn=["get","post","put","patch","head","delete"],FS=()=>{};FS();var id={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},wn=2147483647,sd=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,xn=Symbol("stop"),nd={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},od={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,dispatcher:!0,duplex:!0,priority:!0};var NS=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[r,i]of t)e+=sd,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,e+=typeof i=="string"?new TextEncoder().encode(i).length:i.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},ad=(t,e)=>{let r=Number(t.headers.get("content-length"))||0,i=0;return t.status===204?(e&&e({percent:1,totalBytes:r,transferredBytes:i},new Uint8Array),new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new Response(new ReadableStream({async start(s){let n=t.body.getReader();e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function a(){let{done:o,value:c}=await n.read();if(o){s.close();return}if(e){i+=c.byteLength;let l=r===0?0:i/r;e({percent:l,transferredBytes:i,totalBytes:r},c)}s.enqueue(c),await a()}await a()}}),{status:t.status,statusText:t.statusText,headers:t.headers})},cd=(t,e)=>{let r=NS(t.body),i=0;return new Request(t,{duplex:"half",body:new ReadableStream({async start(s){let n=t.body instanceof ReadableStream?t.body.getReader():new Response("").body.getReader();async function a(){let{done:o,value:c}=await n.read();if(o){e&&e({percent:1,transferredBytes:i,totalBytes:Math.max(r,i)},new Uint8Array),s.close();return}i+=c.byteLength;let l=r===0?0:i/r;(r<i||l===1)&&(l=.99),e&&e({percent:Number(l.toFixed(2)),transferredBytes:i,totalBytes:r},c),s.enqueue(c),await a()}await a()}})})};var oi=t=>t!==null&&typeof t=="object";var is=(...t)=>{for(let e of t)if((!oi(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return gc({},...t)},dc=(t={},e={})=>{let r=new globalThis.Headers(t),i=e instanceof globalThis.Headers,s=new globalThis.Headers(e);for(let[n,a]of s.entries())i&&a==="undefined"||a===void 0?r.delete(n):r.set(n,a);return r};function En(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:gc(t[r]??[],e[r]??[])}var mc=(t={},e={})=>({beforeRequest:En(t,e,"beforeRequest"),beforeRetry:En(t,e,"beforeRetry"),afterResponse:En(t,e,"afterResponse"),beforeError:En(t,e,"beforeError")}),gc=(...t)=>{let e={},r={},i={};for(let s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(oi(s)){for(let[n,a]of Object.entries(s))oi(a)&&n in e&&(a=gc(e[n],a)),e={...e,[n]:a};oi(s.hooks)&&(i=mc(i,s.hooks),e.hooks=i),oi(s.headers)&&(r=dc(r,s.headers),e.headers=r)}return e};var ud=t=>vn.includes(t)?t.toUpperCase():t,DS=["get","put","head","delete","options","trace"],MS=[408,413,429,500,502,503,504],kS=[413,429,503],ld={limit:2,methods:DS,statusCodes:MS,afterStatusCodes:kS,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},hd=(t={})=>{if(typeof t=="number")return{...ld,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...ld,...t}};async function yc(t,e,r,i){return new Promise((s,n)=>{let a=setTimeout(()=>{r&&r.abort(),n(new ni(t))},i.timeout);i.fetch(t,e).then(s).catch(n).then(()=>{clearTimeout(a)})})}async function bc(t,{signal:e}){return new Promise((r,i)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",s,{once:!0}));function s(){clearTimeout(n),i(e.reason)}let n=setTimeout(()=>{e?.removeEventListener("abort",s),r()},t)})}var fd=(t,e)=>{let r={};for(let i in e)!(i in od)&&!(i in nd)&&!(i in t)&&(r[i]=e[i]);return r};var ss=class t{static create(e,r){let i=new t(e,r),s=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>wn)throw new RangeError(`The \`timeout\` option cannot be greater than ${wn}`);await Promise.resolve();let o=await i._fetch();for(let c of i._options.hooks.afterResponse){let l=await c(i.request,i._options,i._decorateResponse(o.clone()));l instanceof globalThis.Response&&(o=l)}if(i._decorateResponse(o),!o.ok&&i._options.throwHttpErrors){let c=new rs(o,i.request,i._options);for(let l of i._options.hooks.beforeError)c=await l(c);throw c}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!td)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return ad(o.clone(),i._options.onDownloadProgress)}return o},a=(i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(s):s()).finally(async()=>{i.request.bodyUsed||await i.request.body?.cancel()});for(let[o,c]of Object.entries(id))a[o]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||c);let l=await a;if(o==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[o]()};return a}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:dc(this._input.headers,r.headers),hooks:mc({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:ud(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:hd(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(ed){let i=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=i?AbortSignal.any([i,this.abortController.signal]):this.abortController.signal}if(pc&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let s="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),n=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);(rd&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(n,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!pc)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=cd(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof ni)throw e;if(e instanceof rs){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let i=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(i&&this._options.retry.afterStatusCodes.includes(e.response.status)){let s=Number(i)*1e3;Number.isNaN(s)?s=Date.parse(i)-Date.now():s>=Date.parse("2024-01-01")&&(s-=Date.now());let n=this._options.retry.maxRetryAfter??s;return s<n?s:n}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let i=Math.min(this._calculateRetryDelay(r),wn);if(this._retryCount<1)throw r;await bc(i,{signal:this._options.signal});for(let s of this._options.hooks.beforeRetry)if(await s({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===xn)return;return this._retry(e)}}async _fetch(){for(let i of this._options.hooks.beforeRequest){let s=await i(this.request,this._options);if(s instanceof Request){this.request=s;break}if(s instanceof Response)return s}let e=fd(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):yc(r,e,this.abortController,this._options)}};var vc=t=>{let e=(r,i)=>ss.create(r,is(t,i));for(let r of vn)e[r]=(i,s)=>ss.create(i,is(t,s,{method:r}));return e.create=r=>vc(is(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),vc(is(t,r))),e.stop=xn,e},jS=vc(),pd=jS;var Dd=We(Nd(),1);function Sc(t){let e=(0,Dd.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var $m=We(Om(),1),Tm=We(oc(),1),Mc=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},kc=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function jc(t,e={}){let{version:r="latest"}=e,{omitDeprecated:i=!0}=e,s=t.split("/")[0],n=e.registryUrl??Sc(s),a=new URL(encodeURIComponent(t).replace(/^%40/,"@"),n),o=(0,$m.default)(n.toString(),{recursive:!0}),c={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete c.accept,o&&(c.authorization=`${o.type} ${o.token}`);let l;try{l=await pd(a,{headers:c,keepalive:!0}).json()}catch(d){throw d?.response?.status===404?new Mc(t):d}if(e.allVersions)return l;let u=new kc(t,r);if(l["dist-tags"][r]){let{time:d}=l;l=l.versions[l["dist-tags"][r]],l.time=d}else if(r){let d=!!l.versions[r];if(i&&!d)for(let[h,p]of Object.entries(l.versions))p.deprecated&&delete l.versions[h];if(!d){let h=Object.keys(l.versions);if(r=Tm.default.maxSatisfying(h,r),!r)throw u}let{time:g}=l;if(l=l.versions[r],l.time=g,!l)throw u}return l}async function Bc(t,e){let{version:r}=await jc(t.toLowerCase(),e);return r}function Ir(){let t=KR(import.meta.url?import.meta.url:__filename),e=VR(t),r=HR(e,"./package.json");try{let i=WR(r,"utf8");return JSON.parse(i).version}catch{return"0.0.0"}}async function Pm(){try{return await Bc("@wispbit/local")}catch{return Ir()}}var us=class t{config;apiKey=null;baseUrl=null;apiClient=null;llmProvider=null;constructor(e,r){this.config={...e,ignoredGlobs:e.ignoredGlobs||[]},this.apiKey=e.apiKey||null,this.baseUrl=e.baseUrl||null,this.apiKey&&this.baseUrl&&(this.apiClient=new ts({baseUrl:this.baseUrl,apiKey:this.apiKey})),r?.llmProvider&&(this.llmProvider=r.llmProvider)}getIgnoredGlobs(){return this.config.ignoredGlobs||[]}getApiKey(){return this.apiKey}getBaseUrl(){return this.baseUrl}getApiClient(){if(!this.apiClient)throw new Error("API client not initialized. Config must have both apiKey and baseUrl.");return this.apiClient}getLLMProvider(){if(!this.llmProvider)throw new Error("LLM provider not initialized. Use Config.initialize() instead of initializeLocal().");return this.llmProvider}getLocalVersion(){return Ir()}getSchemaVersion(){return"v1"}static initializeLocal(e={}){let r=e.ignoredGlobs||[];return new t({ignoredGlobs:r},{llmProvider:e.llmProvider})}static async initialize(e,{apiKey:r,baseUrl:i}){let s=i||process.env.WISPBIT_API_BASE_URL||"https://api.wispbit.com",n=r||process.env.WISPBIT_API_KEY||null;if(!n)return console.log("No API key found"),{failed:!0,error:"INVALID_API_KEY"};let a=await e.getRepositoryUrl(),c=await new ts({baseUrl:s,apiKey:n}).initialize({repository_url:a,powerlint_version:Ir(),schema_version:"v1"});if(c.invalid_api_key)return{failed:!0,error:"INVALID_API_KEY"};if(!c.is_valid_repository)return{failed:!0,error:"INVALID_REPOSITORY"};let l=c.config?.ignored_globs||[],u=new t({ignoredGlobs:l,apiKey:n,baseUrl:s},{});return u.llmProvider=new bn(u,e),u}isConfigured(){return this.getApiKey()!==null}};import{exec as XR,execSync as JR}from"child_process";import{existsSync as ZR,readFileSync as QR}from"fs";import{promisify as eC}from"util";import{createHash as YR}from"crypto";function hs(t){return YR("sha256").update(t).digest("hex")}var fe=eC(XR);function Fm(){return JR("git rev-parse --show-toplevel",{encoding:"utf-8"}).trim()}async function Nm(t){let{stdout:e}=await fe("git ls-files --ignored --exclude-standard --others",{cwd:t,maxBuffer:52428800});return e.split(`
|
|
41
|
+
`).filter(Boolean).map(r=>r.trim())}async function Dm(t,e="origin"){let{stdout:r}=await fe(`git config --get remote.${e}.url`,{cwd:t});return r.trim()||null}async function Mm(t,e="origin"){try{let{stdout:r}=await fe(`git rev-parse --abbrev-ref ${e}/HEAD`,{cwd:t});return r.trim().split("/").pop()||null}catch{let i=["main","master"];for(let s of i)try{return await fe(`git rev-parse --verify ${s}`,{cwd:t}),s}catch{}return null}}async function km(t){let{stdout:e}=await fe("git rev-parse --abbrev-ref --symbolic-full-name @{u}",{cwd:t});return e.trim()||void 0}function jm(t,e){let r=`.git/refs/branch-metadata/${e}`,i=`${t}/${r}`;return ZR(i)?QR(i,"utf-8").match(/"parent"\s*:\s*"([^"]+)"/)?.[1]:void 0}function st(t){return`'${t.replace(/'/g,"'\\''")}'`}function Kt(t){return t.map(st).join(" ")}function tC(t){let e={committed:!0,staged:!0,unstaged:!0,untracked:!0};if(!t||t.length===0)return e;let r=new Set(t);return{committed:r.has("committed"),staged:r.has("staged"),unstaged:r.has("unstaged"),untracked:r.has("untracked")}}function Fn(t,e){if(!t)return[];let r=[],i=t.split("\0").filter(Boolean);for(let s=0;s<i.length;){let n=i[s];if(!n)break;if(n.startsWith("R")){let a=i[s+1],o=i[s+2];a&&o?(r.push({status:n,path:o,oldPath:a,source:e}),s+=3):s++}else{let a=i[s+1];a?(r.push({status:n,path:a,source:e}),s+=2):s++}}return r}function rC(t){return t?t.split("\0").filter(Boolean).map(e=>({status:"U",path:e,source:"untracked"})):[]}function iC(t){let e=new Map;for(let r of t){let i=e.get(r.path);if(!i)e.set(r.path,r);else{let s=Im(i.source),n=Im(r.source);n>s?e.set(r.path,r):n===s&&r.oldPath&&(i.oldPath=i.oldPath||r.oldPath)}}return Array.from(e.values())}function Im(t){switch(t){case"untracked":return 4;case"unstaged":return 3;case"staged":return 2;case"committed":return 1}}function Uc(t){let e=new Map;if(!t)return e;let r=t.split(/^diff --git /m).filter(Boolean);for(let i of r){let a=i.split(`
|
|
42
|
+
`)[0].match(/a\/(.+?) b\//);if(a){let o=a[1];e.set(o,"diff --git "+i)}}return e}function sC(t){return t.status==="U"||t.status==="A"?"added":t.status==="D"?"removed":"modified"}function fs(t){if(!t)return"";let e=t.split(`
|
|
43
43
|
`),r=[],i=!1;for(let s of e)s.startsWith("diff --git")||s.startsWith("index ")||s.startsWith("--- ")||s.startsWith("+++ ")||s.startsWith("new file mode")||s.startsWith("deleted file mode")||s.startsWith("old mode")||s.startsWith("new mode")||s.startsWith("similarity index")||s.startsWith("rename from")||s.startsWith("rename to")||s.startsWith("copy from")||s.startsWith("copy to")||s==="\"||(s.startsWith("@@")&&(i=!0),i&&r.push(s));return r.join(`
|
|
44
|
-
`).trimEnd()}function Nn(t){let e=t.match(/^(.+)\.\.\.(.+)$/);if(e)return[e[1],e[2],!0];let r=t.match(/^(.+)\.\.([^.].*)$/);return r?[r[1],r[2],!1]:[t,t,!1]}function nC(t){let[,e]=Nn(t);return e}async function Gc(t){let{stdout:e}=await
|
|
45
|
-
`).filter(Boolean);for(let C of
|
|
46
|
-
`).filter(Boolean);for(let C of
|
|
47
|
-
`).filter(Boolean);for(let C of
|
|
48
|
-
`),A=0,C=0;for(let O of _)O.startsWith("+")&&!O.startsWith("+++")?A++:O.startsWith("-")&&!O.startsWith("---")&&C++;E.set(v.path,{additions:A,deletions:C})}let h=[];for(let v of f){let x=w.get(v.path)||"",_=E.get(v.path)||{additions:0,deletions:0},A=sC(v),C={filename:v.path,status:A,patch:x,additions:_.additions,deletions:_.deletions,sha:fs(x)};v.oldPath&&(C.oldFilename=v.oldPath),h.push(C)}return{files:h,currentBranch:n,currentCommit:o,diffBranch:l,diffCommit:c}}var pi=class{workspaceRoot;repositoryUrl;constructor(e){this.repositoryUrl=e?.repositoryUrl||null,this.workspaceRoot=e?.workspaceRoot||Fm()}getWorkspaceRoot(){return this.workspaceRoot}async getRepositoryUrl(e="origin"){if(this.repositoryUrl)return this.repositoryUrl;let r=await Dm(this.workspaceRoot,e);if(!r)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return r}async getCurrentCommit(){return await Bm(this.workspaceRoot)}};import*as Me from"fs/promises";import HC from"os";import gi from"path";import{Buffer as Gm}from"buffer";var Dn=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(Gm.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",i=Array.isArray(t);r=i?"[":"{";let s=!0;for(let n in t){let a=typeof t[n]=="function"||!i&&t[n]===void 0;!Object.hasOwn(t,n)||a||(s||(r+=","),s=!1,i?r+=Dn(t[n],e):t[n]!==void 0&&(r+=`${Dn(n,!1)}:${Dn(t[n],e)}`))}return r+=i?"]":"}",r}return JSON.stringify(t)},Wc=t=>Dn(t,!0),Vc=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?Gm.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r);var oC=class{_eventListeners;_maxListeners;constructor(){this._eventListeners=new Map,this._maxListeners=100}maxListeners(){return this._maxListeners}addListener(t,e){this.on(t,e)}on(t,e){this._eventListeners.has(t)||this._eventListeners.set(t,[]);let r=this._eventListeners.get(t);return r&&(r.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${r.length+1} ${t} listeners added. Use setMaxListeners() to increase limit.`),r.push(e)),this}removeListener(t,e){this.off(t,e)}off(t,e){let r=this._eventListeners.get(t)??[],i=r.indexOf(e);i!==-1&&r.splice(i,1),r.length===0&&this._eventListeners.delete(t)}once(t,e){let r=(...i)=>{e(...i),this.off(t,r)};this.on(t,r)}emit(t,...e){let r=this._eventListeners.get(t);if(r&&r.length>0)for(let i of r)i(...e)}listeners(t){return this._eventListeners.get(t)??[]}removeAllListeners(t){t?this._eventListeners.delete(t):this._eventListeners.clear()}setMaxListeners(t){this._maxListeners=t}},Hc=oC,aC=class extends Hc{_hookHandlers;constructor(){super(),this._hookHandlers=new Map}addHandler(t,e){let r=this._hookHandlers.get(t);r?r.push(e):this._hookHandlers.set(t,[e])}removeHandler(t,e){let r=this._hookHandlers.get(t);if(r){let i=r.indexOf(e);i!==-1&&r.splice(i,1)}}trigger(t,e){let r=this._hookHandlers.get(t);if(r)for(let i of r)try{i(e)}catch(s){this.emit("error",new Error(`Error in hook handler for event "${t}": ${s.message}`))}}get handlers(){return new Map(this._hookHandlers)}},cC=aC,lC=class extends Hc{enabled=!0;hits=0;misses=0;sets=0;deletes=0;errors=0;constructor(t){super(),t!==void 0&&(this.enabled=t),this.reset()}hit(){this.enabled&&this.hits++}miss(){this.enabled&&this.misses++}set(){this.enabled&&this.sets++}delete(){this.enabled&&this.deletes++}hitsOrMisses(t){for(let e of t)e===void 0?this.miss():this.hit()}reset(){this.hits=0,this.misses=0,this.sets=0,this.deletes=0,this.errors=0}},uC=lC;var qm=["sqlite","postgres","mysql","mongo","redis","valkey","etcd"],fC=class extends Hc{opts;iterator;hooks=new cC;stats=new uC(!1);_ttl;_namespace;_store=new Map;_serialize=Wc;_deserialize=Vc;_compression;_useKeyPrefix=!0;_throwOnErrors=!1;constructor(t,e){if(super(),e??={},t??={},this.opts={namespace:"keyv",serialize:Wc,deserialize:Vc,emitErrors:!0,store:new Map,...e},t&&t.get?this.opts.store=t:this.opts={...this.opts,...t},this._store=this.opts.store??new Map,this._compression=this.opts.compression,this._serialize=this.opts.serialize,this._deserialize=this.opts.deserialize,this.opts.namespace&&(this._namespace=this.opts.namespace),this._store){if(!this._isValidStorageAdapter(this._store))throw new Error("Invalid storage adapter");typeof this._store.on=="function"&&this._store.on("error",r=>this.emit("error",r)),this._store.namespace=this._namespace,typeof this._store[Symbol.iterator]=="function"&&this._store instanceof Map?this.iterator=this.generateIterator(this._store):"iterator"in this._store&&this._store.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(this._store.iterator.bind(this._store)))}this.opts.stats&&(this.stats.enabled=this.opts.stats),this.opts.ttl&&(this._ttl=this.opts.ttl),this.opts.useKeyPrefix!==void 0&&(this._useKeyPrefix=this.opts.useKeyPrefix),this.opts.throwOnErrors!==void 0&&(this._throwOnErrors=this.opts.throwOnErrors)}get store(){return this._store}set store(t){if(this._isValidStorageAdapter(t))this._store=t,this.opts.store=t,typeof t.on=="function"&&t.on("error",e=>this.emit("error",e)),this._namespace&&(this._store.namespace=this._namespace),typeof t[Symbol.iterator]=="function"&&t instanceof Map?this.iterator=this.generateIterator(t):"iterator"in t&&t.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(t.iterator?.bind(t)));else throw new Error("Invalid storage adapter")}get compression(){return this._compression}set compression(t){this._compression=t}get namespace(){return this._namespace}set namespace(t){this._namespace=t,this.opts.namespace=t,this._store.namespace=t,this.opts.store&&(this.opts.store.namespace=t)}get ttl(){return this._ttl}set ttl(t){this.opts.ttl=t,this._ttl=t}get serialize(){return this._serialize}set serialize(t){this.opts.serialize=t,this._serialize=t}get deserialize(){return this._deserialize}set deserialize(t){this.opts.deserialize=t,this._deserialize=t}get useKeyPrefix(){return this._useKeyPrefix}set useKeyPrefix(t){this._useKeyPrefix=t,this.opts.useKeyPrefix=t}get throwOnErrors(){return this._throwOnErrors}set throwOnErrors(t){this._throwOnErrors=t,this.opts.throwOnErrors=t}generateIterator(t){return async function*(){for await(let[r,i]of typeof t=="function"?t(this._store.namespace):t){let s=await this.deserializeData(i);if(!(this._useKeyPrefix&&this._store.namespace&&!r.includes(this._store.namespace))){if(typeof s.expires=="number"&&Date.now()>s.expires){this.delete(r);continue}yield[this._getKeyUnprefix(r),s.value]}}}.bind(this)}_checkIterableAdapter(){return qm.includes(this._store.opts.dialect)||qm.some(t=>this._store.opts.url.includes(t))}_getKeyPrefix(t){return!this._useKeyPrefix||!this._namespace?t:`${this._namespace}:${t}`}_getKeyPrefixArray(t){return!this._useKeyPrefix||!this._namespace?t:t.map(e=>`${this._namespace}:${e}`)}_getKeyUnprefix(t){return this._useKeyPrefix?t.split(":").splice(1).join(":"):t}_isValidStorageAdapter(t){return t instanceof Map||typeof t.get=="function"&&typeof t.set=="function"&&typeof t.delete=="function"&&typeof t.clear=="function"}async get(t,e){let{store:r}=this.opts,i=Array.isArray(t),s=i?this._getKeyPrefixArray(t):this._getKeyPrefix(t),n=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(i)return e?.raw===!0?this.getMany(t,{raw:!0}):this.getMany(t,{raw:!1});this.hooks.trigger("preGet",{key:s});let a;try{a=await r.get(s)}catch(c){if(this.throwOnErrors)throw c}let o=typeof a=="string"||this.opts.compression?await this.deserializeData(a):a;if(o==null){this.stats.miss();return}if(n(o)){await this.delete(t),this.stats.miss();return}return this.hooks.trigger("postGet",{key:s,value:o}),this.stats.hit(),e?.raw?o:o.value}async getMany(t,e){let{store:r}=this.opts,i=this._getKeyPrefixArray(t),s=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(this.hooks.trigger("preGetMany",{keys:i}),r.getMany===void 0){let c=i.map(async d=>{let b=await r.get(d),f=typeof b=="string"||this.opts.compression?await this.deserializeData(b):b;if(f!=null){if(s(f)){await this.delete(d);return}return e?.raw?f:f.value}}),u=(await Promise.allSettled(c)).map(d=>d.value);return this.hooks.trigger("postGetMany",u),u.length>0&&this.stats.hit(),u}let n=await r.getMany(i),a=[],o=[];for(let c in n){let l=n[c];if(typeof l=="string"&&(l=await this.deserializeData(l)),l==null){a.push(void 0);continue}if(s(l)){o.push(t[c]),a.push(void 0);continue}let u=e?.raw?l:l.value;a.push(u)}return o.length>0&&await this.deleteMany(o),this.hooks.trigger("postGetMany",a),a.length>0&&this.stats.hit(),a}async getRaw(t){let{store:e}=this.opts,r=this._getKeyPrefix(t);this.hooks.trigger("preGetRaw",{key:r});let i=await e.get(r);if(i==null){this.stats.miss();return}let s=typeof i=="string"||this.opts.compression?await this.deserializeData(i):i;if(s!==void 0&&s.expires!==void 0&&s.expires!==null&&s.expires<Date.now()){this.stats.miss(),await this.delete(t);return}return this.stats.hit(),this.hooks.trigger("postGetRaw",{key:r,value:s}),s}async getManyRaw(t){let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(t.length===0){let a=Array.from({length:t.length}).fill(void 0);return this.stats.misses+=t.length,this.hooks.trigger("postGetManyRaw",{keys:r,values:a}),a}let i=[];if(e.getMany===void 0){let a=r.map(async c=>{let l=await e.get(c);if(l!=null)return this.deserializeData(l)});i=(await Promise.allSettled(a)).map(c=>c.value)}else{let a=await e.getMany(r);for(let o of a)o!=null?i.push(await this.deserializeData(o)):i.push(void 0)}let s=[],n=a=>typeof a.expires=="number"&&Date.now()>a.expires;for(let[a,o]of i.entries())o!==void 0&&n(o)&&(s.push(r[a]),i[a]=void 0);return s.length>0&&await this.deleteMany(s),this.stats.hitsOrMisses(i),this.hooks.trigger("postGetManyRaw",{keys:r,values:i}),i}async set(t,e,r){let i={key:t,value:e,ttl:r};this.hooks.trigger("preSet",i);let s=this._getKeyPrefix(i.key);i.ttl??=this._ttl,i.ttl===0&&(i.ttl=void 0);let{store:n}=this.opts,a=typeof i.ttl=="number"?Date.now()+i.ttl:void 0;if(typeof i.value=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let o={value:i.value,expires:a},c=await this.serializeData(o),l=!0;try{let u=await n.set(s,c,i.ttl);typeof u=="boolean"&&(l=u)}catch(u){if(l=!1,this.emit("error",u),this._throwOnErrors)throw u}return this.hooks.trigger("postSet",{key:s,value:c,ttl:r}),this.stats.set(),l}async setMany(t){let e=[];try{if(this._store.setMany===void 0){let r=[];for(let s of t)r.push(this.set(s.key,s.value,s.ttl));e=await Promise.all(r)}else{let r=await Promise.all(t.map(async({key:i,value:s,ttl:n})=>{n??=this._ttl,n===0&&(n=void 0);let a=typeof n=="number"?Date.now()+n:void 0;if(typeof s=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let o={value:s,expires:a},c=await this.serializeData(o);return{key:this._getKeyPrefix(i),value:c,ttl:n}}));e=await this._store.setMany(r)}}catch(r){if(this.emit("error",r),this._throwOnErrors)throw r;e=t.map(()=>!1)}return e}async delete(t){let{store:e}=this.opts;if(Array.isArray(t))return this.deleteMany(t);let r=this._getKeyPrefix(t);this.hooks.trigger("preDelete",{key:r});let i=!0;try{let s=await e.delete(r);typeof s=="boolean"&&(i=s)}catch(s){if(i=!1,this.emit("error",s),this._throwOnErrors)throw s}return this.hooks.trigger("postDelete",{key:r,value:i}),this.stats.delete(),i}async deleteMany(t){try{let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(this.hooks.trigger("preDelete",{key:r}),e.deleteMany!==void 0)return await e.deleteMany(r);let i=r.map(async a=>e.delete(a)),n=(await Promise.all(i)).every(Boolean);return this.hooks.trigger("postDelete",{key:r,value:n}),n}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e;return!1}}async clear(){this.emit("clear");let{store:t}=this.opts;try{await t.clear()}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e}}async has(t){if(Array.isArray(t))return this.hasMany(t);let e=this._getKeyPrefix(t),{store:r}=this.opts;if(r.has!==void 0&&!(r instanceof Map))return r.has(e);let i;try{i=await r.get(e)}catch(s){if(this.emit("error",s),this._throwOnErrors)throw s;return!1}if(i){let s=await this.deserializeData(i);if(s)return s.expires===void 0||s.expires===null?!0:s.expires>Date.now()}return!1}async hasMany(t){let e=this._getKeyPrefixArray(t),{store:r}=this.opts;if(r.hasMany!==void 0)return r.hasMany(e);let i=[];for(let s of t)i.push(await this.has(s));return i}async disconnect(){let{store:t}=this.opts;if(this.emit("disconnect"),typeof t.disconnect=="function")return t.disconnect()}emit(t,...e){t==="error"&&!this.opts.emitErrors||super.emit(t,...e)}async serializeData(t){return this._serialize?this._compression?.compress?this._serialize({value:await this._compression.compress(t.value),expires:t.expires}):this._serialize(t):t}async deserializeData(t){if(!this._deserialize)return t;if(this._compression?.decompress&&typeof t=="string"){let e=await this._deserialize(t);return{value:await this._compression.decompress(e?.value),expires:e?.expires}}if(typeof t=="string")return this._deserialize(t)}},zm=fC;var Sg=We(_g(),1);var qn=class{environment;cacheStore;constructor(e){this.environment=e}getStorageDirectory(){return gi.join(HC.homedir(),".powerlint")}getIndexDirectory(){return gi.join(this.getStorageDirectory(),"indexes",fs(this.environment.getWorkspaceRoot()))}getCacheDirectory(){return gi.join(this.getStorageDirectory(),"cache",fs(this.environment.getWorkspaceRoot()))}async ensureDirectory(e){await Me.mkdir(e,{recursive:!0})}async getIndexFilePath(e,r){let i=this.getIndexDirectory();await this.ensureDirectory(i);let s=r||`${e.toLowerCase()}-index.scip`;return gi.join(i,`${e.toLowerCase()}-${s}`)}async indexExists(e,r){let i=await this.getIndexFilePath(e,r);try{return await Me.access(i),!0}catch{return!1}}async readIndex(e,r){let i=await this.getIndexFilePath(e,r);try{return await Me.access(i),await Me.readFile(i)}catch{return null}}async saveIndex(e,r,i){let s=await this.getIndexFilePath(e,i);await Me.writeFile(s,r)}getCacheFilePath(){return gi.join(this.getCacheDirectory(),"cache.json")}async purgeStorage(){let e=0,r=this.getStorageDirectory();try{await Me.access(r),await Me.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}async purgeCache(){let e=0,r=this.getCacheDirectory();try{await Me.access(r),await Me.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}getCacheStore(){if(!this.cacheStore){let e=this.getCacheDirectory();this.cacheStore=new zm({store:new Sg.KeyvFile({filename:gi.join(e,"cache.json")})})}return this.cacheStore}async saveCache(e,r,i){let s=this.getCacheStore(),n=`${e}:${r}`;await s.set(n,i)}async readCache(e,r){let i=this.getCacheStore(),s=`${e}:${r}`;return await i.get(s)||null}async purgeIndexes(){let e=0,r=this.getIndexDirectory();try{await Me.access(r),await Me.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}};var ds=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async getRepositoryUrl(){let e=await this.environment.getRepositoryUrl();if(!e)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return e}async loadRuleById(e){let r=await this.fetchRules([e]);if(r.length===0)throw new Error(`Rule with ID '${e}' not found`);return r[0]}async loadAllRules(){return await this.fetchRules()}async fetchRules(e){let r=await this.getRepositoryUrl();return(await this.config.getApiClient().getRules({repository_url:r,rule_ids:e,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion()})).rules.map(n=>({id:n.id,internalId:n.internalId,internalVersionId:n.internalVersionId,config:{message:n.message,severity:n.severity,execution:n.execution||"llm",steps:n.schema},prompt:n.prompt,testCases:[]}))}};import{EventEmitter as KC}from"events";var nt=class extends KC{rulesStartTime=0;indexingStartTimes=new Map;fileDiscoveryStartTime=0;constructor(){super(),this.setMaxListeners(20)}emit(e,r){return super.emit(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}off(e,r){return super.off(e,r)}setExecutionMode(e,r){this.emit("execution:mode",{mode:e,...r})}startRules(e){this.rulesStartTime=Date.now(),this.emit("rules:start",{totalRules:e})}progressRule(e,r,i,s){let n=Math.round(e/r*100);this.emit("rules:progress",{currentRule:e,totalRules:r,ruleId:i,percentage:n,isLlm:s})}completeRules(e,r){let i=Date.now()-this.rulesStartTime;this.emit("rules:complete",{totalRules:e,totalMatches:r,executionTime:i})}startFileDiscovery(e){this.fileDiscoveryStartTime=Date.now(),this.emit("files:discovery:start",{mode:e})}fileDiscoveryProgress(e,r){this.emit("files:discovery:progress",{message:e,currentCount:r})}completeFileDiscovery(e,r){let i=Date.now()-this.fileDiscoveryStartTime;this.emit("files:discovery:complete",{totalFiles:e,mode:r,executionTime:i})}fileFilter(e,r,i){this.emit("files:filter",{originalCount:e,filteredCount:r,filterType:i})}startScipMatchLookup(e,r){this.emit("scip:match-lookup:start",{language:e,match:r})}scipMatchLookupProgress(e,r){this.emit("scip:match-lookup:progress",{language:e,document:r})}scipMatchLookupComplete(e,r){this.emit("scip:match-lookup:complete",{language:e,document:r})}startIndexing(e){this.indexingStartTimes.set(e,Date.now()),this.emit("indexing:start",{language:e})}indexingProgress(e,r,i,s){this.emit("indexing:progress",{language:e,message:r,packageName:i,timeMs:s})}completeIndexing(e){let r=this.indexingStartTimes.get(e)||Date.now(),i=Date.now()-r;this.indexingStartTimes.delete(e),this.emit("indexing:complete",{language:e,executionTime:i})}startStep(e,r,i,s,n){this.emit("step:start",{ruleId:e,stepName:r,stepType:i,inputs:s,parentStepName:n})}completeStep(e,r,i,s,n=0,a){this.emit("step:complete",{ruleId:e,stepName:r,stepType:i,outputs:s,executionTime:n,parentStepName:a})}startTest(e,r){this.emit("test:start",{ruleId:e,testName:r})}testMatches(e,r,i){this.emit("test:matches",{ruleId:e,testName:r,matches:i})}completeTest(e,r,i,s){this.emit("test:complete",{ruleId:e,testName:r,matches:i,stepExecutions:s})}startLLMValidation(e,r,i){this.emit("llm:validation:start",{ruleId:e,matchCount:r,estimatedCost:i})}llmValidationProgress(e,r,i,s){this.emit("llm:validation:progress",{ruleId:e,tokenCount:r,elapsedTime:i,streamedText:s})}completeLLMValidation(e,r,i,s,n,a,o,c){this.emit("llm:validation:complete",{ruleId:e,tokenCount:r,inputTokens:i,outputTokens:s,cost:n,executionTime:a,violationCount:o,fromCache:c})}llmToolExecution(e,r,i){this.emit("llm:tool-execution",{ruleId:e,toolName:r,...i})}startLLMValidationPhase(e,r){this.emit("llm:validation-phase:start",{ruleId:e,matchCount:r})}};import{cpus as KO}from"os";var Cg=We(Xc(),1);import{existsSync as rA}from"fs";import Fr from"path";import{fileURLToPath as iA}from"url";console.debug=()=>{};var sA=iA(import.meta.url),Jc=Fr.dirname(sA),nA={darwin:"macOS",linux:"Linux",win32:"Windows"},oA={x64:"X64",arm64:"ARM64"};function fe(t){let e=nA[process.platform],r=oA[process.arch];if(!e||!r)return;let i=[Fr.join(Jc,"powerlint/dist/vendor"),Fr.join(Jc,"../dist/vendor"),Fr.join(Jc,"./vendor")];for(let s of i){let n=Fr.join(s,`ast-grep-lang-${t}`),a=Fr.join(n,"prebuilds",`prebuild-${e}-${r}`,"parser.so");if(rA(a))return a}throw new Error(`Prebuild not found for ${t} on ${e} ${r}. Paths tried: ${i.join(", ")}`)}var aA={libraryPath:fe("angular"),extensions:["html"],languageSymbol:"tree_sitter_angular",expandoChar:"z"},cA={libraryPath:fe("bash"),extensions:["bash","bats","cgi","command","env","fcgi","ksh","sh","tmux","tool","zsh"],languageSymbol:"tree_sitter_bash",expandoChar:"$"},lA={libraryPath:fe("c"),extensions:["c","h"],languageSymbol:"tree_sitter_c",expandoChar:"_"},uA={libraryPath:fe("cpp"),extensions:["cc","hpp","cpp","hh","cxx","cu","ino"],languageSymbol:"tree_sitter_cpp",expandoChar:"_"},fA={libraryPath:fe("csharp"),extensions:["cs"],languageSymbol:"tree_sitter_c_sharp",expandoChar:"\xB5"},hA={libraryPath:fe("css"),extensions:["css","scss"],languageSymbol:"tree_sitter_css",expandoChar:"$"},pA={libraryPath:fe("dart"),extensions:["dart"],languageSymbol:"tree_sitter_dart",expandoChar:"$"},dA={libraryPath:fe("elixir"),extensions:["ex","exs"],languageSymbol:"tree_sitter_elixir",expandoChar:"\xB5"},mA={libraryPath:fe("go"),extensions:["go"],languageSymbol:"tree_sitter_go",expandoChar:"\xB5"},gA={libraryPath:fe("haskell"),extensions:["hs"],languageSymbol:"tree_sitter_haskell",expandoChar:"\xB5"},yA={libraryPath:fe("html"),extensions:["html","htm","xhtml"],languageSymbol:"tree_sitter_html",expandoChar:"z"},bA={libraryPath:fe("java"),extensions:["java"],languageSymbol:"tree_sitter_java",expandoChar:"$"},vA={libraryPath:fe("javascript"),extensions:["cjs","js","mjs","jsx"],languageSymbol:"tree_sitter_javascript",expandoChar:"$"},wA={libraryPath:fe("json"),extensions:["json"],languageSymbol:"tree_sitter_json",expandoChar:"$"},xA={libraryPath:fe("kotlin"),extensions:["kt","ktm","kts"],languageSymbol:"tree_sitter_kotlin",expandoChar:"\xB5"},EA={libraryPath:fe("lua"),extensions:["lua"],languageSymbol:"tree_sitter_lua",expandoChar:"$"},_A={libraryPath:fe("markdown"),extensions:["md"],languageSymbol:"tree_sitter_markdown",expandoChar:"$"},SA={libraryPath:fe("php"),extensions:["php"],languageSymbol:"tree_sitter_php",expandoChar:"$"},RA={libraryPath:fe("python"),extensions:["py"],languageSymbol:"tree_sitter_python",expandoChar:"\xB5"},CA={libraryPath:fe("ruby"),extensions:["rb","rbw","gemspec"],languageSymbol:"tree_sitter_ruby",expandoChar:"\xB5"},AA={libraryPath:fe("rust"),extensions:["rs"],languageSymbol:"tree_sitter_rust",expandoChar:"\xB5"},LA={libraryPath:fe("scala"),extensions:["scala","sc","sbt"],languageSymbol:"tree_sitter_scala",expandoChar:"$"},OA={libraryPath:fe("sql"),extensions:["sql"],languageSymbol:"tree_sitter_sql",expandoChar:"_"},$A={libraryPath:fe("swift"),extensions:["swift"],languageSymbol:"tree_sitter_swift",expandoChar:"\xB5"},TA={libraryPath:fe("toml"),extensions:["toml"],languageSymbol:"tree_sitter_toml",expandoChar:"_"},PA={libraryPath:fe("tsx"),extensions:["tsx"],languageSymbol:"tree_sitter_tsx",expandoChar:"$"},IA={libraryPath:fe("typescript"),extensions:["ts","cts","mts"],languageSymbol:"tree_sitter_typescript",expandoChar:"$"},FA={libraryPath:fe("yaml"),extensions:["yaml","yml"],languageSymbol:"tree_sitter_yaml",expandoChar:"$"},Ag={Angular:aA,Bash:cA,C:lA,Cpp:uA,Csharp:fA,Css:hA,Dart:pA,Elixir:dA,Go:mA,Haskell:gA,Html:yA,Java:bA,JavaScript:vA,Json:wA,Kotlin:xA,Lua:EA,Markdown:_A,Php:SA,Python:RA,Ruby:CA,Rust:AA,Scala:LA,Sql:OA,Swift:$A,Toml:TA,Tsx:PA,TypeScript:IA,Yaml:FA};(0,Cg.registerDynamicLanguage)(Ag);var Rg=Object.entries(Ag).reduce((t,[e,r])=>(t[e]=r.extensions??[],t),{});function Wn(t){let e=Fr.extname(t).slice(1);return NA(e)??"Unknown"}function NA(t){return Object.keys(Rg).find(e=>Rg[e].includes(t))}import*as Oi from"fs";import*as jt from"path";var Kg=We(Bg(),1);var gs=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var qA={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},ys=t=>t.replace(/[[\]\\-]/g,"\\$&"),zA=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ug=t=>t.join(""),Gg=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let i=[],s=[],n=r+1,a=!1,o=!1,c=!1,l=!1,u=r,d="";e:for(;n<t.length;){let m=t.charAt(n);if((m==="!"||m==="^")&&n===r+1){l=!0,n++;continue}if(m==="]"&&a&&!c){u=n+1;break}if(a=!0,m==="\\"&&!c){c=!0,n++;continue}if(m==="["&&!c){for(let[y,[g,w,E]]of Object.entries(qA))if(t.startsWith(y,n)){if(d)return["$.",!1,t.length-r,!0];n+=y.length,E?s.push(g):i.push(g),o=o||w;continue e}}if(c=!1,d){m>d?i.push(ys(d)+"-"+ys(m)):m===d&&i.push(ys(m)),d="",n++;continue}if(t.startsWith("-]",n+1)){i.push(ys(m+"-")),n+=2;continue}if(t.startsWith("-",n+1)){d=m,n+=2;continue}i.push(ys(m)),n++}if(u<n)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,t.length-r,!0];if(s.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let m=i[0].length===2?i[0].slice(-1):i[0];return[zA(m),!1,u-r,!1]}let b="["+(l?"^":"")+Ug(i)+"]",f="["+(l?"":"^")+Ug(s)+"]";return[i.length&&s.length?"("+b+"|"+f+")":i.length?b:f,o,u-r,!0]};var dt=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var WA=new Set(["!","?","+","*","@"]),qg=t=>WA.has(t),VA="(?!(?:^|/)\\.\\.?(?:$|/))",Vn="(?!\\.)",HA=new Set(["[","."]),KA=new Set(["..","."]),YA=new Set("().*{}+?[]^$\\!"),XA=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),el="[^/]",zg=el+"*?",Wg=el+"+?",yi=class t{type;#t;#r;#e=!1;#n=[];#f;#w;#a;#u=!1;#s;#c;#i=!1;constructor(e,r,i={}){this.type=e,e&&(this.#r=!0),this.#f=r,this.#t=this.#f?this.#f.#t:this,this.#s=this.#t===this?i:this.#t.#s,this.#a=this.#t===this?[]:this.#t.#a,e==="!"&&!this.#t.#u&&this.#a.push(this),this.#w=this.#f?this.#f.#n.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.map(e=>String(e)).join("")}#l(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#a.pop();){if(e.type!=="!")continue;let r=e,i=r.#f;for(;i;){for(let s=r.#w+1;!i.type&&s<i.#n.length;s++)for(let n of e.#n){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(i.#n[s])}r=i,i=r.#f}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#f===this))throw new Error("invalid part: "+r);this.#n.push(r)}}toJSON(){let e=this.type===null?this.#n.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#f?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#f?.isStart())return!1;if(this.#w===0)return!0;let e=this.#f;for(let r=0;r<this.#w;r++){let i=e.#n[r];if(!(i instanceof t&&i.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#f?.type==="!")return!0;if(!this.#f?.isEnd())return!1;if(!this.type)return this.#f?.isEnd();let e=this.#f?this.#f.#n.length:0;return this.#w===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let i of this.#n)r.copyIn(i);return r}static#o(e,r,i,s){let n=!1,a=!1,o=-1,c=!1;if(r.type===null){let f=i,p="";for(;f<e.length;){let m=e.charAt(f++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){f===o+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(f===o+2&&c)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,o=f,c=!1,p+=m;continue}if(!s.noext&&qg(m)&&e.charAt(f)==="("){r.push(p),p="";let y=new t(m,r);f=t.#o(e,y,f,s),r.push(y);continue}p+=m}return r.push(p),f}let l=i+1,u=new t(null,r),d=[],b="";for(;l<e.length;){let f=e.charAt(l++);if(n||f==="\\"){n=!n,b+=f;continue}if(a){l===o+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(l===o+2&&c)&&(a=!1),b+=f;continue}else if(f==="["){a=!0,o=l,c=!1,b+=f;continue}if(qg(f)&&e.charAt(l)==="("){u.push(b),b="";let p=new t(f,u);u.push(p),l=t.#o(e,p,l,s);continue}if(f==="|"){u.push(b),b="",d.push(u),u=new t(null,r);continue}if(f===")")return b===""&&r.#n.length===0&&(r.#i=!0),u.push(b),b="",r.push(...d,u),l;b+=f}return r.type=null,r.#r=void 0,r.#n=[e.substring(i-1)],l}static fromGlob(e,r={}){let i=new t(null,void 0,r);return t.#o(e,i,0,r),i}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,i,s,n]=this.toRegExpSource();if(!(s||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let o=(this.#s.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${r}$`,o),{_src:r,_glob:e})}get options(){return this.#s}toRegExpSource(e){let r=e??!!this.#s.dot;if(this.#t===this&&this.#l(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(f=>{let[p,m,y,g]=typeof f=="string"?t.#g(f,this.#r,c):f.toRegExpSource(e);return this.#r=this.#r||y,this.#e=this.#e||g,p}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&KA.has(this.#n[0]))){let p=HA,m=r&&p.has(l.charAt(0))||l.startsWith("\\.")&&p.has(l.charAt(2))||l.startsWith("\\.\\.")&&p.has(l.charAt(4)),y=!r&&!e&&p.has(l.charAt(0));u=m?VA:y?Vn:""}let d="";return this.isEnd()&&this.#t.#u&&this.#f?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,dt(l),this.#r=!!this.#r,this.#e]}let i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#d(r);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#r=void 0,[c,dt(this.toString()),!1,!1]}let a=!i||e||r||!Vn?"":this.#d(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let o="";if(this.type==="!"&&this.#i)o=(this.isStart()&&!r?Vn:"")+Wg;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Vn:"")+zg+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=s+n+c}return[o,dt(n),this.#r=!!this.#r,this.#e]}#d(e){return this.#n.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[i,s,n,a]=r.toRegExpSource(e);return this.#e=this.#e||a,i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#g(e,r,i=!1){let s=!1,n="",a=!1;for(let o=0;o<e.length;o++){let c=e.charAt(o);if(s){s=!1,n+=(YA.has(c)?"\\":"")+c;continue}if(c==="\\"){o===e.length-1?n+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,b]=Gg(e,o);if(d){n+=l,a=a||u,o+=d-1,r=r||b;continue}}if(c==="*"){i&&e==="*"?n+=Wg:n+=zg,r=!0;continue}if(c==="?"){n+=el,r=!0;continue}n+=XA(c)}return[n,dt(e),!!r,a]}};var bi=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var qe=(t,e,r={})=>(gs(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Ye(e,r).match(t)),JA=/^\*+([^+@!?\*\[\(]*)$/,ZA=t=>e=>!e.startsWith(".")&&e.endsWith(t),QA=t=>e=>e.endsWith(t),eL=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),tL=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),rL=/^\*+\.\*+$/,iL=t=>!t.startsWith(".")&&t.includes("."),sL=t=>t!=="."&&t!==".."&&t.includes("."),nL=/^\.\*+$/,oL=t=>t!=="."&&t!==".."&&t.startsWith("."),aL=/^\*+$/,cL=t=>t.length!==0&&!t.startsWith("."),lL=t=>t.length!==0&&t!=="."&&t!=="..",uL=/^\?+([^+@!?\*\[\(]*)?$/,fL=([t,e=""])=>{let r=Yg([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},hL=([t,e=""])=>{let r=Xg([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},pL=([t,e=""])=>{let r=Xg([t]);return e?i=>r(i)&&i.endsWith(e):r},dL=([t,e=""])=>{let r=Yg([t]);return e?i=>r(i)&&i.endsWith(e):r},Yg=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},Xg=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},Jg=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vg={win32:{sep:"\\"},posix:{sep:"/"}},mL=Jg==="win32"?Vg.win32.sep:Vg.posix.sep;qe.sep=mL;var Pe=Symbol("globstar **");qe.GLOBSTAR=Pe;var gL="[^/]",yL=gL+"*?",bL="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",vL="(?:(?!(?:\\/|^)\\.).)*?",wL=(t,e={})=>r=>qe(r,t,e);qe.filter=wL;var ot=(t,e={})=>Object.assign({},t,e),xL=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return qe;let e=qe;return Object.assign((i,s,n={})=>e(i,s,ot(t,n)),{Minimatch:class extends e.Minimatch{constructor(s,n={}){super(s,ot(t,n))}static defaults(s){return e.defaults(ot(t,s)).Minimatch}},AST:class extends e.AST{constructor(s,n,a={}){super(s,n,ot(t,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,ot(t,n))}},unescape:(i,s={})=>e.unescape(i,ot(t,s)),escape:(i,s={})=>e.escape(i,ot(t,s)),filter:(i,s={})=>e.filter(i,ot(t,s)),defaults:i=>e.defaults(ot(t,i)),makeRe:(i,s={})=>e.makeRe(i,ot(t,s)),braceExpand:(i,s={})=>e.braceExpand(i,ot(t,s)),match:(i,s,n={})=>e.match(i,s,ot(t,n)),sep:e.sep,GLOBSTAR:Pe})};qe.defaults=xL;var Zg=(t,e={})=>(gs(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,Kg.default)(t));qe.braceExpand=Zg;var EL=(t,e={})=>new Ye(t,e).makeRe();qe.makeRe=EL;var _L=(t,e,r={})=>{let i=new Ye(e,r);return t=t.filter(s=>i.match(s)),i.options.nonull&&!t.length&&t.push(e),t};qe.match=_L;var Hg=/[?*]|[+@!]\(.*?\)|\[|\]/,SL=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ye=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){gs(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||Jg,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=n[0]===""&&n[1]===""&&(n[2]==="?"||!Hg.test(n[2]))&&!Hg.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,4),...n.slice(4).map(u=>this.parse(u))];if(l)return[n[0],...n.slice(1).map(u=>this.parse(u))]}return n.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let s=0;s<e[i].length;s++)e[i][s]==="**"&&(e[i][s]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let s=i;for(;r[s+1]==="**";)s++;s!==i&&r.splice(i,s-i)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((i,s)=>{let n=i[i.length-1];return s==="**"&&n==="**"?i:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(i.pop(),i):(i.push(s),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let n=e[s];s===1&&n===""&&e[0]===""||(n==="."||n==="")&&(r=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(r=!0,e.splice(i-1,2),i-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let i of e){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let a=s;for(;i[a+1]==="**";)a++;a>s&&i.splice(s+1,a-s);let o=i[s+1],c=i[s+2],l=i[s+3];if(o!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,i.splice(s,1);let u=i.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let o=i[a];a===1&&o===""&&i[0]===""||(o==="."||o==="")&&(r=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let n=0;for(;(n=i.indexOf("..",n+1))!==-1;){let a=i[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){r=!0;let c=n===1&&i[n+1]==="**"?["."]:[];i.splice(n-1,2,...c),i.length===0&&i.push(""),n-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let i=r+1;i<e.length;i++){let s=this.partsMatch(e[r],e[i],!this.preserveMultipleSlashes);if(s){e[r]=[],e[i]=s;break}}return e.filter(r=>r.length)}partsMatch(e,r,i=!1){let s=0,n=0,a=[],o="";for(;s<e.length&&n<r.length;)if(e[s]===r[n])a.push(o==="b"?r[n]:e[s]),s++,n++;else if(i&&e[s]==="**"&&r[n]===e[s+1])a.push(e[s]),s++;else if(i&&r[n]==="**"&&e[s]===r[n+1])a.push(r[n]),n++;else if(e[s]==="*"&&r[n]&&(this.options.dot||!r[n].startsWith("."))&&r[n]!=="**"){if(o==="b")return!1;o="a",a.push(e[s]),s++,n++}else if(r[n]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(o==="a")return!1;o="b",a.push(r[n]),s++,n++}else return!1;return e.length===r.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,i=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)r=!r,i++;i&&(this.pattern=e.slice(i)),this.negate=r}matchOne(e,r,i=!1){let s=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),y=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),g=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),w=!g&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),E=y?3:m?0:void 0,h=w?3:g?0:void 0;if(typeof E=="number"&&typeof h=="number"){let[v,x]=[e[E],r[h]];v.toLowerCase()===x.toLowerCase()&&(r[h]=v,h>E?r=r.slice(h):E>h&&(e=e.slice(E)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var a=0,o=0,c=e.length,l=r.length;a<c&&o<l;a++,o++){this.debug("matchOne loop");var u=r[o],d=e[a];if(this.debug(r,u,d),u===!1)return!1;if(u===Pe){this.debug("GLOBSTAR",[r,u,d]);var b=a,f=o+1;if(f===l){for(this.debug("** at the end");a<c;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;b<c;){var p=e[b];if(this.debug(`
|
|
49
|
-
globstar while`,e,
|
|
50
|
-
>>> no match, partial?`,e,b,r,f),b===c))}let m;if(typeof u=="string"?(m=d===u,this.debug("string match",u,d,m)):(m=u.test(d),this.debug("pattern match",u,d,m)),!m)return!1}if(a===c&&o===l)return!0;if(a===c)return i;if(o===l)return a===c-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return Zg(this.pattern,this.options)}parse(e){gs(e);let r=this.options;if(e==="**")return Pe;if(e==="")return"";let i,s=null;(i=e.match(aL))?s=r.dot?lL:cL:(i=e.match(JA))?s=(r.nocase?r.dot?tL:eL:r.dot?QA:ZA)(i[1]):(i=e.match(uL))?s=(r.nocase?r.dot?hL:fL:r.dot?pL:dL)(i):(i=e.match(rL))?s=r.dot?sL:iL:(i=e.match(nL))&&(s=oL);let n=yi.fromGlob(e,this.options).toMMPattern();return s&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:s}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,i=r.noglobstar?yL:r.dot?bL:vL,s=new Set(r.nocase?["i"]:[]),n=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))s.add(d);return typeof u=="string"?SL(u):u===Pe?Pe:u._src});return l.forEach((u,d)=>{let b=l[d+1],f=l[d-1];u!==Pe||f===Pe||(f===void 0?b!==void 0&&b!==Pe?l[d+1]="(?:\\/|"+i+"\\/)?"+b:l[d]=i:b===void 0?l[d-1]=f+"(?:\\/|"+i+")?":b!==Pe&&(l[d-1]=f+"(?:\\/|\\/"+i+"\\/)"+b,l[d+1]=Pe))}),l.filter(u=>u!==Pe).join("/")}).join("|"),[a,o]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+o+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...s].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,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let n=this.set;this.debug(this.pattern,"set",n);let a=s[s.length-1];if(!a)for(let o=s.length-2;!a&&o>=0;o--)a=s[o];for(let o=0;o<n.length;o++){let c=n[o],l=s;if(i.matchBase&&c.length===1&&(l=[a]),this.matchOne(l,c,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return qe.defaults(e).Minimatch}};qe.AST=yi;qe.Minimatch=Ye;qe.escape=bi;qe.unescape=dt;import{fileURLToPath as rO}from"node:url";var vi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e0=new Set,tl=typeof process=="object"&&process?process:{},t0=(t,e,r,i)=>{typeof tl.emitWarning=="function"?tl.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},Hn=globalThis.AbortController,Qg=globalThis.AbortSignal;if(typeof Hn>"u"){Qg=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},Hn=class{constructor(){e()}signal=new Qg;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let t=tl.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,t0("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var RL=t=>!e0.has(t),CF=Symbol("type"),Yt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),r0=t=>Yt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?wi:null:null,wi=class extends Array{constructor(e){super(e),this.fill(0)}},rl=class t{heap;length;static#t=!1;static create(e){let r=r0(e);if(!r)return[];t.#t=!0;let i=new t(e,r);return t.#t=!1,i}constructor(e,r){if(!t.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},bs=class t{#t;#r;#e;#n;#f;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#u;#s;#c;#i;#l;#o;#d;#g;#y;#p;#C;#x;#E;#_;#S;#v;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#E,sizes:e.#C,keyMap:e.#s,keyList:e.#c,valList:e.#i,next:e.#l,prev:e.#o,get head(){return e.#d},get tail(){return e.#g},free:e.#y,isBackgroundFetch:r=>e.#m(r),backgroundFetch:(r,i,s,n)=>e.#F(r,i,s,n),moveToTail:r=>e.#D(r),indexes:r=>e.#L(r),rindexes:r=>e.#$(r),isStale:r=>e.#R(r)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#a}get fetchMethod(){return this.#f}get memoMethod(){return this.#w}get dispose(){return this.#e}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:b,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:m,fetchMethod:y,memoMethod:g,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:v,ignoreFetchAbort:x}=e;if(r!==0&&!Yt(r))throw new TypeError("max option must be a nonnegative integer");let _=r?r0(r):Array;if(!_)throw new Error("invalid max value: "+r);if(this.#t=r,this.#r=f,this.maxEntrySize=p||this.#r,this.sizeCalculation=m,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(g!==void 0&&typeof g!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=g,y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#f=y,this.#S=!!y,this.#s=new Map,this.#c=new Array(r).fill(void 0),this.#i=new Array(r).fill(void 0),this.#l=new _(r),this.#o=new _(r),this.#d=0,this.#g=0,this.#y=rl.create(r),this.#a=0,this.#u=0,typeof l=="function"&&(this.#e=l),typeof u=="function"?(this.#n=u,this.#p=[]):(this.#n=void 0,this.#p=void 0),this.#_=!!this.#e,this.#v=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!h,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#r!==0&&!Yt(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Yt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=Yt(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!Yt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let A="LRU_CACHE_UNBOUNDED";RL(A)&&(e0.add(A),t0("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,t))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#P(){let e=new wi(this.#t),r=new wi(this.#t);this.#E=e,this.#x=r,this.#M=(n,a,o=vi.now())=>{if(r[n]=a!==0?o:0,e[n]=a,a!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#R(n)&&this.#b(this.#c[n],"expire")},a+1);c.unref&&c.unref()}},this.#A=n=>{r[n]=e[n]!==0?vi.now():0},this.#h=(n,a)=>{if(e[a]){let o=e[a],c=r[a];if(!o||!c)return;n.ttl=o,n.start=c,n.now=i||s();let l=n.now-c;n.remainingTTL=o-l}};let i=0,s=()=>{let n=vi.now();if(this.ttlResolution>0){i=n;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return n};this.getRemainingTTL=n=>{let a=this.#s.get(n);if(a===void 0)return 0;let o=e[a],c=r[a];if(!o||!c)return 1/0;let l=(i||s())-c;return o-l},this.#R=n=>{let a=r[n],o=e[n];return!!o&&!!a&&(i||s())-a>o}}#A=()=>{};#h=()=>{};#M=()=>{};#R=()=>!1;#I(){let e=new wi(this.#t);this.#u=0,this.#C=e,this.#N=r=>{this.#u-=e[r],e[r]=0},this.#B=(r,i,s,n)=>{if(this.#m(i))return 0;if(!Yt(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,r),!Yt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#O=(r,i,s)=>{if(e[r]=i,this.#r){let n=this.#r-e[r];for(;this.#u>n;)this.#T(!0)}this.#u+=e[r],s&&(s.entrySize=i,s.totalCalculatedSize=this.#u)}}#N=e=>{};#O=(e,r,i)=>{};#B=(e,r,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#L({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#g;!(!this.#k(r)||((e||!this.#R(r))&&(yield r),r===this.#d));)r=this.#o[r]}*#$({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#d;!(!this.#k(r)||((e||!this.#R(r))&&(yield r),r===this.#g));)r=this.#l[r]}#k(e){return e!==void 0&&this.#s.get(this.#c[e])===e}*entries(){for(let e of this.#L())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#m(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*rentries(){for(let e of this.#$())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#m(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*keys(){for(let e of this.#L()){let r=this.#c[e];r!==void 0&&!this.#m(this.#i[e])&&(yield r)}}*rkeys(){for(let e of this.#$()){let r=this.#c[e];r!==void 0&&!this.#m(this.#i[e])&&(yield r)}}*values(){for(let e of this.#L())this.#i[e]!==void 0&&!this.#m(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#$())this.#i[e]!==void 0&&!this.#m(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let i of this.#L()){let s=this.#i[i],n=this.#m(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#c[i],this))return this.get(this.#c[i],r)}}forEach(e,r=this){for(let i of this.#L()){let s=this.#i[i],n=this.#m(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(r,n,this.#c[i],this)}}rforEach(e,r=this){for(let i of this.#$()){let s=this.#i[i],n=this.#m(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(r,n,this.#c[i],this)}}purgeStale(){let e=!1;for(let r of this.#$({allowStale:!0}))this.#R(r)&&(this.#b(this.#c[r],"expire"),e=!0);return e}info(e){let r=this.#s.get(e);if(r===void 0)return;let i=this.#i[r],s=this.#m(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#E&&this.#x){let a=this.#E[r],o=this.#x[r];if(a&&o){let c=a-(vi.now()-o);n.ttl=c,n.start=Date.now()}}return this.#C&&(n.size=this.#C[r]),n}dump(){let e=[];for(let r of this.#L({allowStale:!0})){let i=this.#c[r],s=this.#i[r],n=this.#m(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let a={value:n};if(this.#E&&this.#x){a.ttl=this.#E[r];let o=vi.now()-this.#x[r];a.start=Math.floor(Date.now()-o)}this.#C&&(a.size=this.#C[r]),e.unshift([i,a])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let s=Date.now()-i.start;i.start=vi.now()-s}this.set(r,i.value,i)}}set(e,r,i={}){if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#B(e,r,i.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#b(e,"set"),this;let d=this.#a===0?void 0:this.#s.get(e);if(d===void 0)d=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#t?this.#T(!1):this.#a,this.#c[d]=e,this.#i[d]=r,this.#s.set(e,d),this.#l[this.#g]=d,this.#o[d]=this.#g,this.#g=d,this.#a++,this.#O(d,u,c),c&&(c.set="add"),l=!1;else{this.#D(d);let b=this.#i[d];if(r!==b){if(this.#S&&this.#m(b)){b.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=b;f!==void 0&&!a&&(this.#_&&this.#e?.(f,e,"set"),this.#v&&this.#p?.push([f,e,"set"]))}else a||(this.#_&&this.#e?.(b,e,"set"),this.#v&&this.#p?.push([b,e,"set"]));if(this.#N(d),this.#O(d,u,c),this.#i[d]=r,c){c.set="replace";let f=b&&this.#m(b)?b.__staleWhileFetching:b;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update")}if(s!==0&&!this.#E&&this.#P(),this.#E&&(l||this.#M(d,s,n),c&&this.#h(c,d)),!a&&this.#v&&this.#p){let b=this.#p,f;for(;f=b?.shift();)this.#n?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#i[this.#d];if(this.#T(!0),this.#m(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#v&&this.#p){let e=this.#p,r;for(;r=e?.shift();)this.#n?.(...r)}}}#T(e){let r=this.#d,i=this.#c[r],s=this.#i[r];return this.#S&&this.#m(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(s,i,"evict"),this.#v&&this.#p?.push([s,i,"evict"])),this.#N(r),e&&(this.#c[r]=void 0,this.#i[r]=void 0,this.#y.push(r)),this.#a===1?(this.#d=this.#g=0,this.#y.length=0):this.#d=this.#l[r],this.#s.delete(i),this.#a--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=r,n=this.#s.get(e);if(n!==void 0){let a=this.#i[n];if(this.#m(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#R(n))s&&(s.has="stale",this.#h(s,n));else return i&&this.#A(n),s&&(s.has="hit",this.#h(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,s=this.#s.get(e);if(s===void 0||!i&&this.#R(s))return;let n=this.#i[s];return this.#m(n)?n.__staleWhileFetching:n}#F(e,r,i,s){let n=r===void 0?void 0:this.#i[r];if(this.#m(n))return n;let a=new Hn,{signal:o}=i;o?.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let c={signal:a.signal,options:i,context:s},l=(m,y=!1)=>{let{aborted:g}=a.signal,w=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(g&&!y?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),g&&!w&&!y)return d(a.signal.reason);let E=f;return this.#i[r]===f&&(m===void 0?E.__staleWhileFetching?this.#i[r]=E.__staleWhileFetching:this.#b(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,m,c.options))),m},u=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),d(m)),d=m=>{let{aborted:y}=a.signal,g=y&&i.allowStaleOnFetchAbort,w=g||i.allowStaleOnFetchRejection,E=w||i.noDeleteOnFetchRejection,h=f;if(this.#i[r]===f&&(!E||h.__staleWhileFetching===void 0?this.#b(e,"fetch"):g||(this.#i[r]=h.__staleWhileFetching)),w)return i.status&&h.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw m},b=(m,y)=>{let g=this.#f?.(e,n,c);g&&g instanceof Promise&&g.then(w=>m(w===void 0?void 0:w),y),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=w=>l(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let f=new Promise(b).then(l,u),p=Object.assign(f,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return r===void 0?(this.set(e,p,{...c.options,status:void 0}),r=this.#s.get(e)):this.#i[r]=p,p}#m(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Hn}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:y=!1,status:g,signal:w}=r;if(!this.#S)return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let E={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:o,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:w},h=this.#s.get(e);if(h===void 0){g&&(g.fetch="miss");let v=this.#F(e,h,E,m);return v.__returned=v}else{let v=this.#i[h];if(this.#m(v)){let O=i&&v.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",O&&(g.returnedStale=!0)),O?v.__staleWhileFetching:v.__returned=v}let x=this.#R(h);if(!y&&!x)return g&&(g.fetch="hit"),this.#D(h),s&&this.#A(h),g&&this.#h(g,h),v;let _=this.#F(e,h,E,m),C=_.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=x?"stale":"refresh",C&&x&&(g.returnedStale=!0)),C?_.__staleWhileFetching:_.__returned=_}}async forceFetch(e,r={}){let i=await this.fetch(e,r);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,r={}){let i=this.#w;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=r,o=this.get(e,a);if(!n&&o!==void 0)return o;let c=i(e,o,{options:a,context:s});return this.set(e,c,a),c}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=r,o=this.#s.get(e);if(o!==void 0){let c=this.#i[o],l=this.#m(c);return a&&this.#h(a,o),this.#R(o)?(a&&(a.get="stale"),l?(a&&i&&c.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?c.__staleWhileFetching:void 0):(n||this.#b(e,"expire"),a&&i&&(a.returnedStale=!0),i?c:void 0)):(a&&(a.get="hit"),l?c.__staleWhileFetching:(this.#D(o),s&&this.#A(o),c))}else a&&(a.get="miss")}#j(e,r){this.#o[r]=e,this.#l[e]=r}#D(e){e!==this.#g&&(e===this.#d?this.#d=this.#l[e]:this.#j(this.#o[e],this.#l[e]),this.#j(this.#g,e),this.#g=e)}delete(e){return this.#b(e,"delete")}#b(e,r){let i=!1;if(this.#a!==0){let s=this.#s.get(e);if(s!==void 0)if(i=!0,this.#a===1)this.#G(r);else{this.#N(s);let n=this.#i[s];if(this.#m(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(n,e,r),this.#v&&this.#p?.push([n,e,r])),this.#s.delete(e),this.#c[s]=void 0,this.#i[s]=void 0,s===this.#g)this.#g=this.#o[s];else if(s===this.#d)this.#d=this.#l[s];else{let a=this.#o[s];this.#l[a]=this.#l[s];let o=this.#l[s];this.#o[o]=this.#o[s]}this.#a--,this.#y.push(s)}}if(this.#v&&this.#p?.length){let s=this.#p,n;for(;n=s?.shift();)this.#n?.(...n)}return i}clear(){return this.#G("delete")}#G(e){for(let r of this.#$({allowStale:!0})){let i=this.#i[r];if(this.#m(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#c[r];this.#_&&this.#e?.(i,s,e),this.#v&&this.#p?.push([i,s,e])}}if(this.#s.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#E&&this.#x&&(this.#E.fill(0),this.#x.fill(0)),this.#C&&this.#C.fill(0),this.#d=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#v&&this.#p){let r=this.#p,i;for(;i=r?.shift();)this.#n?.(...i)}}};import{posix as DL,win32 as hl}from"node:path";import{fileURLToPath as ML}from"node:url";import{lstatSync as kL,readdir as jL,readdirSync as BL,readlinkSync as UL,realpathSync as GL}from"fs";import*as qL from"node:fs";import{lstat as WL,readdir as VL,readlink as HL,realpath as KL}from"node:fs/promises";import{EventEmitter as ll}from"node:events";import a0 from"node:stream";import{StringDecoder as CL}from"node:string_decoder";var i0=typeof process=="object"&&process?process:{stdout:null,stderr:null},AL=t=>!!t&&typeof t=="object"&&(t instanceof Jt||t instanceof a0||LL(t)||OL(t)),LL=t=>!!t&&typeof t=="object"&&t instanceof ll&&typeof t.pipe=="function"&&t.pipe!==a0.Writable.prototype.pipe,OL=t=>!!t&&typeof t=="object"&&t instanceof ll&&typeof t.write=="function"&&typeof t.end=="function",Dt=Symbol("EOF"),Mt=Symbol("maybeEmitEnd"),Xt=Symbol("emittedEnd"),Kn=Symbol("emittingEnd"),vs=Symbol("emittedError"),Yn=Symbol("closed"),s0=Symbol("read"),Xn=Symbol("flush"),n0=Symbol("flushChunk"),mt=Symbol("encoding"),xi=Symbol("decoder"),Ce=Symbol("flowing"),ws=Symbol("paused"),Ei=Symbol("resume"),Ae=Symbol("buffer"),ze=Symbol("pipes"),Le=Symbol("bufferLength"),il=Symbol("bufferPush"),Jn=Symbol("bufferShift"),ke=Symbol("objectMode"),Ee=Symbol("destroyed"),sl=Symbol("error"),nl=Symbol("emitData"),o0=Symbol("emitEnd"),ol=Symbol("emitEnd2"),_t=Symbol("async"),al=Symbol("abort"),Zn=Symbol("aborted"),xs=Symbol("signal"),Nr=Symbol("dataListeners"),Xe=Symbol("discarded"),Es=t=>Promise.resolve().then(t),$L=t=>t(),TL=t=>t==="end"||t==="finish"||t==="prefinish",PL=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,IL=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Qn=class{src;dest;opts;ondrain;constructor(e,r,i){this.src=e,this.dest=r,this.opts=i,this.ondrain=()=>e[Ei](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},cl=class extends Qn{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,i){super(e,r,i),this.proxyErrors=s=>r.emit("error",s),e.on("error",this.proxyErrors)}},FL=t=>!!t.objectMode,NL=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Jt=class extends ll{[Ce]=!1;[ws]=!1;[ze]=[];[Ae]=[];[ke];[mt];[_t];[xi];[Dt]=!1;[Xt]=!1;[Kn]=!1;[Yn]=!1;[vs]=null;[Le]=0;[Ee]=!1;[xs];[Zn]=!1;[Nr]=0;[Xe]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");FL(r)?(this[ke]=!0,this[mt]=null):NL(r)?(this[mt]=r.encoding,this[ke]=!1):(this[ke]=!1,this[mt]=null),this[_t]=!!r.async,this[xi]=this[mt]?new CL(this[mt]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Ae]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[ze]});let{signal:i}=r;i&&(this[xs]=i,i.aborted?this[al]():i.addEventListener("abort",()=>this[al]()))}get bufferLength(){return this[Le]}get encoding(){return this[mt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ke]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[_t]}set async(e){this[_t]=this[_t]||!!e}[al](){this[Zn]=!0,this.emit("abort",this[xs]?.reason),this.destroy(this[xs]?.reason)}get aborted(){return this[Zn]}set aborted(e){}write(e,r,i){if(this[Zn])return!1;if(this[Dt])throw new Error("write after end");if(this[Ee])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(i=r,r="utf8"),r||(r="utf8");let s=this[_t]?Es:$L;if(!this[ke]&&!Buffer.isBuffer(e)){if(IL(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(PL(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ke]?(this[Ce]&&this[Le]!==0&&this[Xn](!0),this[Ce]?this.emit("data",e):this[il](e),this[Le]!==0&&this.emit("readable"),i&&s(i),this[Ce]):e.length?(typeof e=="string"&&!(r===this[mt]&&!this[xi]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[mt]&&(e=this[xi].write(e)),this[Ce]&&this[Le]!==0&&this[Xn](!0),this[Ce]?this.emit("data",e):this[il](e),this[Le]!==0&&this.emit("readable"),i&&s(i),this[Ce]):(this[Le]!==0&&this.emit("readable"),i&&s(i),this[Ce])}read(e){if(this[Ee])return null;if(this[Xe]=!1,this[Le]===0||e===0||e&&e>this[Le])return this[Mt](),null;this[ke]&&(e=null),this[Ae].length>1&&!this[ke]&&(this[Ae]=[this[mt]?this[Ae].join(""):Buffer.concat(this[Ae],this[Le])]);let r=this[s0](e||null,this[Ae][0]);return this[Mt](),r}[s0](e,r){if(this[ke])this[Jn]();else{let i=r;e===i.length||e===null?this[Jn]():typeof i=="string"?(this[Ae][0]=i.slice(e),r=i.slice(0,e),this[Le]-=e):(this[Ae][0]=i.subarray(e),r=i.subarray(0,e),this[Le]-=e)}return this.emit("data",r),!this[Ae].length&&!this[Dt]&&this.emit("drain"),r}end(e,r,i){return typeof e=="function"&&(i=e,e=void 0),typeof r=="function"&&(i=r,r="utf8"),e!==void 0&&this.write(e,r),i&&this.once("end",i),this[Dt]=!0,this.writable=!1,(this[Ce]||!this[ws])&&this[Mt](),this}[Ei](){this[Ee]||(!this[Nr]&&!this[ze].length&&(this[Xe]=!0),this[ws]=!1,this[Ce]=!0,this.emit("resume"),this[Ae].length?this[Xn]():this[Dt]?this[Mt]():this.emit("drain"))}resume(){return this[Ei]()}pause(){this[Ce]=!1,this[ws]=!0,this[Xe]=!1}get destroyed(){return this[Ee]}get flowing(){return this[Ce]}get paused(){return this[ws]}[il](e){this[ke]?this[Le]+=1:this[Le]+=e.length,this[Ae].push(e)}[Jn](){return this[ke]?this[Le]-=1:this[Le]-=this[Ae][0].length,this[Ae].shift()}[Xn](e=!1){do;while(this[n0](this[Jn]())&&this[Ae].length);!e&&!this[Ae].length&&!this[Dt]&&this.emit("drain")}[n0](e){return this.emit("data",e),this[Ce]}pipe(e,r){if(this[Ee])return e;this[Xe]=!1;let i=this[Xt];return r=r||{},e===i0.stdout||e===i0.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,i?r.end&&e.end():(this[ze].push(r.proxyErrors?new cl(this,e,r):new Qn(this,e,r)),this[_t]?Es(()=>this[Ei]()):this[Ei]()),e}unpipe(e){let r=this[ze].find(i=>i.dest===e);r&&(this[ze].length===1?(this[Ce]&&this[Nr]===0&&(this[Ce]=!1),this[ze]=[]):this[ze].splice(this[ze].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let i=super.on(e,r);if(e==="data")this[Xe]=!1,this[Nr]++,!this[ze].length&&!this[Ce]&&this[Ei]();else if(e==="readable"&&this[Le]!==0)super.emit("readable");else if(TL(e)&&this[Xt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[vs]){let s=r;this[_t]?Es(()=>s.call(this,this[vs])):s.call(this,this[vs])}return i}removeListener(e,r){return this.off(e,r)}off(e,r){let i=super.off(e,r);return e==="data"&&(this[Nr]=this.listeners("data").length,this[Nr]===0&&!this[Xe]&&!this[ze].length&&(this[Ce]=!1)),i}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Nr]=0,!this[Xe]&&!this[ze].length&&(this[Ce]=!1)),r}get emittedEnd(){return this[Xt]}[Mt](){!this[Kn]&&!this[Xt]&&!this[Ee]&&this[Ae].length===0&&this[Dt]&&(this[Kn]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Yn]&&this.emit("close"),this[Kn]=!1)}emit(e,...r){let i=r[0];if(e!=="error"&&e!=="close"&&e!==Ee&&this[Ee])return!1;if(e==="data")return!this[ke]&&!i?!1:this[_t]?(Es(()=>this[nl](i)),!0):this[nl](i);if(e==="end")return this[o0]();if(e==="close"){if(this[Yn]=!0,!this[Xt]&&!this[Ee])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[vs]=i,super.emit(sl,i);let n=!this[xs]||this.listeners("error").length?super.emit("error",i):!1;return this[Mt](),n}else if(e==="resume"){let n=super.emit("resume");return this[Mt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,...r);return this[Mt](),s}[nl](e){for(let i of this[ze])i.dest.write(e)===!1&&this.pause();let r=this[Xe]?!1:super.emit("data",e);return this[Mt](),r}[o0](){return this[Xt]?!1:(this[Xt]=!0,this.readable=!1,this[_t]?(Es(()=>this[ol]()),!0):this[ol]())}[ol](){if(this[xi]){let r=this[xi].end();if(r){for(let i of this[ze])i.dest.write(r);this[Xe]||super.emit("data",r)}}for(let r of this[ze])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ke]||(e.dataLength=0);let r=this.promise();return this.on("data",i=>{e.push(i),this[ke]||(e.dataLength+=i.length)}),await r,e}async concat(){if(this[ke])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[mt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Ee,()=>r(new Error("stream destroyed"))),this.on("error",i=>r(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Xe]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[Dt])return r();let n,a,o=d=>{this.off("data",c),this.off("end",l),this.off(Ee,u),r(),a(d)},c=d=>{this.off("error",o),this.off("end",l),this.off(Ee,u),this.pause(),n({value:d,done:!!this[Dt]})},l=()=>{this.off("error",o),this.off("data",c),this.off(Ee,u),r(),n({done:!0,value:void 0})},u=()=>o(new Error("stream destroyed"));return new Promise((d,b)=>{a=b,n=d,this.once(Ee,u),this.once("error",o),this.once("end",l),this.once("data",c)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Xe]=!1;let e=!1,r=()=>(this.pause(),this.off(sl,r),this.off(Ee,r),this.off("end",r),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return r();let s=this.read();return s===null?r():{done:!1,value:s}};return this.once("end",r),this.once(sl,r),this.once(Ee,r),{next:i,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Ee])return e?this.emit("error",e):this.emit(Ee),this;this[Ee]=!0,this[Xe]=!0,this[Ae].length=0,this[Le]=0;let r=this;return typeof r.close=="function"&&!this[Yn]&&r.close(),e?this.emit("error",e):this.emit(Ee),this}static get isStream(){return AL}};var zL=GL.native,Ss={lstatSync:kL,readdir:jL,readdirSync:BL,readlinkSync:UL,realpathSync:zL,promises:{lstat:WL,readdir:VL,readlink:HL,realpath:KL}},h0=t=>!t||t===Ss||t===qL?Ss:{...Ss,...t,promises:{...Ss.promises,...t.promises||{}}},p0=/^\\\\\?\\([a-z]:)\\?$/i,YL=t=>t.replace(/\//g,"\\").replace(p0,"$1\\"),XL=/[\\\/]/,ct=0,d0=1,m0=2,St=4,g0=6,y0=8,Dr=10,b0=12,at=15,_s=~at,ul=16,c0=32,Rs=64,gt=128,eo=256,ro=512,l0=Rs|gt|ro,JL=1023,fl=t=>t.isFile()?y0:t.isDirectory()?St:t.isSymbolicLink()?Dr:t.isCharacterDevice()?m0:t.isBlockDevice()?g0:t.isSocket()?b0:t.isFIFO()?d0:ct,u0=new Map,Cs=t=>{let e=u0.get(t);if(e)return e;let r=t.normalize("NFKD");return u0.set(t,r),r},f0=new Map,to=t=>{let e=f0.get(t);if(e)return e;let r=Cs(t.toLowerCase());return f0.set(t,r),r},io=class extends bs{constructor(){super({max:256})}},pl=class extends bs{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},v0=Symbol("PathScurry setAsCwd"),je=class{name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#e;get mode(){return this.#e}#n;get nlink(){return this.#n}#f;get uid(){return this.#f}#w;get gid(){return this.#w}#a;get rdev(){return this.#a}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#c;get size(){return this.#c}#i;get blocks(){return this.#i}#l;get atimeMs(){return this.#l}#o;get mtimeMs(){return this.#o}#d;get ctimeMs(){return this.#d}#g;get birthtimeMs(){return this.#g}#y;get atime(){return this.#y}#p;get mtime(){return this.#p}#C;get ctime(){return this.#C}#x;get birthtime(){return this.#x}#E;#_;#S;#v;#P;#A;#h;#M;#R;#I;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=ct,i,s,n,a,o){this.name=e,this.#E=n?to(e):Cs(e),this.#h=r&JL,this.nocase=n,this.roots=s,this.root=i||this,this.#M=a,this.#S=o.fullpath,this.#P=o.relative,this.#A=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=h0(o.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#M}resolve(e){if(!e)return this;let r=this.getRootString(e),s=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#N(s):this.#N(s)}#N(e){let r=this;for(let i of e)r=r.child(i);return r}children(){let e=this.#M.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#M.set(this,r),this.#h&=~ul,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),s=this.nocase?to(e):Cs(e);for(let c of i)if(c.#E===s)return c;let n=this.parent?this.sep:"",a=this.#S?this.#S+n+e:void 0,o=this.newChild(e,ct,{...r,parent:this,fullpath:a});return this.canReaddir()||(o.#h|=gt),i.push(o),o}relative(){if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let e=this.name,r=this.parent;if(!r)return this.#P=this.name;let i=r.relative();return i+(!i||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,r=this.parent;if(!r)return this.#A=this.fullpathPosix();let i=r.relativePosix();return i+(!i||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let s=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=s}fullpathPosix(){if(this.#v!==void 0)return this.#v;if(this.sep==="/")return this.#v=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#v=`//?/${s}`:this.#v=s}let e=this.parent,r=e.fullpathPosix(),i=r+(!r||!e.parent?"":"/")+this.name;return this.#v=i}isUnknown(){return(this.#h&at)===ct}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#h&at)===y0}isDirectory(){return(this.#h&at)===St}isCharacterDevice(){return(this.#h&at)===m0}isBlockDevice(){return(this.#h&at)===g0}isFIFO(){return(this.#h&at)===d0}isSocket(){return(this.#h&at)===b0}isSymbolicLink(){return(this.#h&Dr)===Dr}lstatCached(){return this.#h&c0?this:void 0}readlinkCached(){return this.#R}realpathCached(){return this.#I}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#R)return!0;if(!this.parent)return!1;let e=this.#h&at;return!(e!==ct&&e!==Dr||this.#h&eo||this.#h>)}calledReaddir(){return!!(this.#h&ul)}isENOENT(){return!!(this.#h>)}isNamed(e){return this.nocase?this.#E===to(e):this.#E===Cs(e)}async readlink(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#t.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(r);if(i)return this.#R=i}catch(r){this.#m(r.code);return}}readlinkSync(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#t.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(r);if(i)return this.#R=i}catch(r){this.#m(r.code);return}}#O(e){this.#h|=ul;for(let r=e.provisional;r<e.length;r++){let i=e[r];i&&i.#B()}}#B(){this.#h>||(this.#h=(this.#h|gt)&_s,this.#L())}#L(){let e=this.children();e.provisional=0;for(let r of e)r.#B()}#$(){this.#h|=ro,this.#k()}#k(){if(this.#h&Rs)return;let e=this.#h;(e&at)===St&&(e&=_s),this.#h=e|Rs,this.#L()}#T(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#B():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#B()}#m(e=""){let r=this.#h;r|=eo,e==="ENOENT"&&(r|=gt),(e==="EINVAL"||e==="UNKNOWN")&&(r&=_s),this.#h=r,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#j(e,r){return this.#b(e,r)||this.#D(e,r)}#D(e,r){let i=fl(e),s=this.newChild(e.name,i,{parent:this}),n=s.#h&at;return n!==St&&n!==Dr&&n!==ct&&(s.#h|=Rs),r.unshift(s),r.provisional++,s}#b(e,r){for(let i=r.provisional;i<r.length;i++){let s=r[i];if((this.nocase?to(e.name):Cs(e.name))===s.#E)return this.#G(e,s,i,r)}}#G(e,r,i,s){let n=r.name;return r.#h=r.#h&_s|fl(e),n!==e.name&&(r.name=e.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(r)),s.provisional++,r}async lstat(){if((this.#h>)===0)try{return this.#q(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if((this.#h>)===0)try{return this.#q(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#q(e){let{atime:r,atimeMs:i,birthtime:s,birthtimeMs:n,blksize:a,blocks:o,ctime:c,ctimeMs:l,dev:u,gid:d,ino:b,mode:f,mtime:p,mtimeMs:m,nlink:y,rdev:g,size:w,uid:E}=e;this.#y=r,this.#l=i,this.#x=s,this.#g=n,this.#u=a,this.#i=o,this.#C=c,this.#d=l,this.#r=u,this.#w=d,this.#s=b,this.#e=f,this.#p=p,this.#o=m,this.#n=y,this.#a=g,this.#c=w,this.#f=E;let h=fl(e);this.#h=this.#h&_s|h|c0,h!==ct&&h!==St&&h!==Dr&&(this.#h|=Rs)}#U=[];#z=!1;#V(e){this.#z=!1;let r=this.#U.slice();this.#U.length=0,r.forEach(i=>i(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let n=i.slice(0,i.provisional);r?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#U.push(e),this.#z)return;this.#z=!0;let s=this.fullpath();this.#t.readdir(s,{withFileTypes:!0},(n,a)=>{if(n)this.#T(n.code),i.provisional=0;else{for(let o of a)this.#j(o,i);this.#O(i)}this.#V(i.slice(0,i.provisional))})}#W;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#W)await this.#W;else{let i=()=>{};this.#W=new Promise(s=>i=s);try{for(let s of await this.#t.promises.readdir(r,{withFileTypes:!0}))this.#j(s,e);this.#O(e)}catch(s){this.#T(s.code),e.provisional=0}this.#W=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let i of this.#t.readdirSync(r,{withFileTypes:!0}))this.#j(i,e);this.#O(e)}catch(i){this.#T(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#h&l0)return!1;let e=at&this.#h;return e===ct||e===St||e===Dr}shouldWalk(e,r){return(this.#h&St)===St&&!(this.#h&l0)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#I)return this.#I;if(!((ro|eo|gt)&this.#h))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#I=this.resolve(e)}catch{this.#$()}}realpathSync(){if(this.#I)return this.#I;if(!((ro|eo|gt)&this.#h))try{let e=this.#t.realpathSync(this.fullpath());return this.#I=this.resolve(e)}catch{this.#$()}}[v0](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),i=[],s=this;for(;s&&s.parent;)r.add(s),s.#P=i.join(this.sep),s.#A=i.join("/"),s=s.parent,i.push("..");for(s=e;s&&s.parent&&!r.has(s);)s.#P=void 0,s.#A=void 0,s=s.parent}},so=class t extends je{sep="\\";splitSep=XL;constructor(e,r=ct,i,s,n,a,o){super(e,r,i,s,n,a,o)}newChild(e,r=ct,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return hl.parse(e).root}getRoot(e){if(e=YL(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,i]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=i;return this.roots[e]=new _i(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(p0,"$1\\"),e===r}},no=class t extends je{splitSep="/";sep="/";constructor(e,r=ct,i,s,n,a,o){super(e,r,i,s,n,a,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=ct,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}},oo=class{root;rootPath;roots;cwd;#t;#r;#e;nocase;#n;constructor(e=process.cwd(),r,i,{nocase:s,childrenCacheSize:n=16*1024,fs:a=Ss}={}){this.#n=h0(a),(e instanceof URL||e.startsWith("file://"))&&(e=ML(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new io,this.#r=new io,this.#e=new pl(n);let c=o.substring(this.rootPath.length).split(i);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=r.sep,b=this.rootPath,f=!1;for(let p of c){let m=u--;l=l.child(p,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:b+=(f?"":d)+p}),f=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#e}resolve(...e){let r="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#t.get(r);if(i!==void 0)return i;let s=this.cwd.resolve(r).fullpath();return this.#t.set(r,s),s}resolvePosix(...e){let r="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#r.get(r);if(i!==void 0)return i;let s=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i}=r;if(e.canReaddir()){let s=await e.readdir();return i?s:s.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0}=r;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=await e.readlink();return r?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return r?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=await e.realpath();return r?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return r?i:i?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=[];(!n||n(e))&&o.push(i?e:e.fullpath());let c=new Set,l=(d,b)=>{c.add(d),d.readdirCB((f,p)=>{if(f)return b(f);let m=p.length;if(!m)return b();let y=()=>{--m===0&&b()};for(let g of p)(!n||n(g))&&o.push(i?g:g.fullpath()),s&&g.isSymbolicLink()?g.realpath().then(w=>w?.isUnknown()?w.lstat():w).then(w=>w?.shouldWalk(c,a)?l(w,y):y()):g.shouldWalk(c,a)?l(g,y):y()},!0)},u=e;return new Promise((d,b)=>{l(u,f=>{if(f)return b(f);d(o)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=[];(!n||n(e))&&o.push(i?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!n||n(d))&&o.push(i?d:d.fullpath());let b=d;if(d.isSymbolicLink()){if(!(s&&(b=d.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(c,a)&&c.add(b)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r;(!n||n(e))&&(yield i?e:e.fullpath());let o=new Set([e]);for(let c of o){let l=c.readdirSync();for(let u of l){(!n||n(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(o,a)&&o.add(d)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=new Jt({objectMode:!0});(!n||n(e))&&o.write(i?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let b=!1;for(;!b;){let f=l.shift();if(!f){u===0&&o.end();return}u++,c.add(f);let p=(y,g,w=!1)=>{if(y)return o.emit("error",y);if(s&&!w){let E=[];for(let h of g)h.isSymbolicLink()&&E.push(h.realpath().then(v=>v?.isUnknown()?v.lstat():v));if(E.length){Promise.all(E).then(()=>p(null,g,!0));return}}for(let E of g)E&&(!n||n(E))&&(o.write(i?E:E.fullpath())||(b=!0));u--;for(let E of g){let h=E.realpathCached()||E;h.shouldWalk(c,a)&&l.push(h)}b&&!o.flowing?o.once("drain",d):m||d()},m=!0;f.readdirCB(p,!0),m=!1}};return d(),o}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=new Jt({objectMode:!0}),c=new Set;(!n||n(e))&&o.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let b=!1;for(;!b;){let f=l.shift();if(!f){u===0&&o.end();return}u++,c.add(f);let p=f.readdirSync();for(let m of p)(!n||n(m))&&(o.write(i?m:m.fullpath())||(b=!0));u--;for(let m of p){let y=m;if(m.isSymbolicLink()){if(!(s&&(y=m.realpathSync())))continue;y.isUnknown()&&y.lstatSync()}y.shouldWalk(c,a)&&l.push(y)}}b&&!o.flowing&&o.once("drain",d)};return d(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[v0](r)}},_i=class extends oo{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,hl,"\\",{...r,nocase:i}),this.nocase=i;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return hl.parse(e).root.toUpperCase()}newRoot(e){return new so(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Si=class extends oo{sep="/";constructor(e=process.cwd(),r={}){let{nocase:i=!1}=r;super(e,DL,"/",{...r,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new no(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},As=class extends Si{constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,{...r,nocase:i})}},kF=process.platform==="win32"?so:no,w0=process.platform==="win32"?_i:process.platform==="darwin"?As:Si;var ZL=t=>t.length>=1,QL=t=>t.length>=1,Ri=class t{#t;#r;#e;length;#n;#f;#w;#a;#u;#s;#c=!0;constructor(e,r,i,s){if(!ZL(e))throw new TypeError("empty pattern list");if(!QL(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=r,this.#e=i,this.#n=s,this.#e===0){if(this.isUNC()){let[n,a,o,c,...l]=this.#t,[u,d,b,f,...p]=this.#r;l[0]===""&&(l.shift(),p.shift());let m=[n,a,o,c,""].join("/"),y=[u,d,b,f,""].join("/");this.#t=[m,...l],this.#r=[y,...p],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#t,[o,...c]=this.#r;a[0]===""&&(a.shift(),c.shift());let l=n+"/",u=o+"/";this.#t=[l,...a],this.#r=[u,...c],this.length=this.#t.length}}}pattern(){return this.#t[this.#e]}isString(){return typeof this.#t[this.#e]=="string"}isGlobstar(){return this.#t[this.#e]===Pe}isRegExp(){return this.#t[this.#e]instanceof RegExp}globString(){return this.#w=this.#w||(this.#e===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#e).join("/"))}hasMore(){return this.length>this.#e+1}rest(){return this.#f!==void 0?this.#f:this.hasMore()?(this.#f=new t(this.#t,this.#r,this.#e+1,this.#n),this.#f.#s=this.#s,this.#f.#u=this.#u,this.#f.#a=this.#a,this.#f):this.#f=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#n==="win32"&&this.#e===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#e===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#s!==void 0?this.#s:this.#s=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#e===0?e:""}checkFollowGlobstar(){return!(this.#e===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#e===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var eO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ci=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:i,noext:s,noglobstar:n,platform:a=eO}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:r,nocase:i,noext:s,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let o of e)this.add(o)}add(e){let r=new Ye(e,this.mmopts);for(let i=0;i<r.set.length;i++){let s=r.set[i],n=r.globParts[i];if(!s||!n)throw new Error("invalid pattern object");for(;s[0]==="."&&n[0]===".";)s.shift(),n.shift();let a=new Ri(s,n,0,this.platform),o=new Ye(a.globString(),this.mmopts),c=n[n.length-1]==="**",l=a.isAbsolute();l?this.absolute.push(o):this.relative.push(o),c&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(e){let r=e.fullpath(),i=`${r}/`,s=e.relative()||".",n=`${s}/`;for(let a of this.relative)if(a.match(s)||a.match(n))return!0;for(let a of this.absolute)if(a.match(r)||a.match(i))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return!0;for(let s of this.absoluteChildren)if(s.match(r))return!0;return!1}};var dl=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let i=e.fullpath(),s=this.store.get(i);s?s.add(r.globString()):this.store.set(i,new Set([r.globString()]))}},ml=class{store=new Map;add(e,r,i){let s=(r?2:0)|(i?1:0),n=this.store.get(e);this.store.set(e,n===void 0?s:s&n)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},gl=class{store=new Map;add(e,r){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(s=>s.globString()===r.globString())||i.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Ls=class t{hasWalkedCache;matches=new ml;subwalks=new gl;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new dl}processPatterns(e,r){this.patterns=r;let i=r.map(s=>[e,s]);for(let[s,n]of i){this.hasWalkedCache.storeWalked(s,n);let a=n.root(),o=n.isAbsolute()&&this.opts.absolute!==!1;if(a){s=s.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let d=n.rest();if(d)n=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=n.pattern())=="string"&&(l=n.rest());)s=s.resolve(c),n=l,u=!0;if(c=n.pattern(),l=n.rest(),u){if(this.hasWalkedCache.hasWalked(s,n))continue;this.hasWalkedCache.storeWalked(s,n)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),o,d);continue}else if(c===Pe){(!s.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(s,n);let d=l?.pattern(),b=l?.rest();if(!l||(d===""||d===".")&&!b)this.matches.add(s,o,d===""||d===".");else if(d===".."){let f=s.parent||s;b?this.hasWalkedCache.hasWalked(f,b)||this.subwalks.add(f,b):this.matches.add(f,o,!0)}}else c instanceof RegExp&&this.subwalks.add(s,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let i=this.subwalks.get(e),s=this.child();for(let n of r)for(let a of i){let o=a.isAbsolute(),c=a.pattern(),l=a.rest();c===Pe?s.testGlobstar(n,a,l,o):c instanceof RegExp?s.testRegExp(n,c,l,o):s.testString(n,c,l,o)}return s}testGlobstar(e,r,i,s){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(i&&r.checkFollowGlobstar()?this.subwalks.add(e,i):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),i){let n=i.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,i.rest(),s);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,i)}else n instanceof RegExp&&this.testRegExp(e,n,i.rest(),s)}}testRegExp(e,r,i,s){r.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,s,!1))}testString(e,r,i,s){e.isNamed(r)&&(i?this.subwalks.add(e,i):this.matches.add(e,s,!1))}};var tO=(t,e)=>typeof t=="string"?new Ci([t],e):Array.isArray(t)?new Ci(t,e):t,ao=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#e;signal;maxDepth;includeChildMatches;constructor(e,r,i){if(this.patterns=e,this.path=r,this.opts=i,this.#e=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#r=tO(i.ignore??[],i),!this.includeChildMatches&&typeof this.#r.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#n(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#f(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#r?.add){let n=`${e.relativePosix()}/**`;this.#r.add(n)}let i=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#e:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+s)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#e)?"."+this.#e:"";this.matchEmit(n?a+n+s:"."+s)}}async match(e,r,i){let s=await this.matchCheck(e,i);s&&this.matchFinish(s,r)}matchSync(e,r,i){let s=this.matchCheckSync(e,i);s&&this.matchFinish(s,r)}walkCB(e,r,i){this.signal?.aborted&&i(),this.walkCB2(e,r,new Ls(this.opts),i)}walkCB2(e,r,i,s){if(this.#f(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,r,i,s));return}i.processPatterns(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||(n++,this.match(o,c,l).then(()=>a()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let c=o.readdirCached();o.calledReaddir()?this.walkCB3(o,c,i,a):o.readdirCB((l,u)=>this.walkCB3(o,u,i,a),!0)}a()}walkCB3(e,r,i,s){i=i.filterEntries(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||(n++,this.match(o,c,l).then(()=>a()));for(let[o,c]of i.subwalks.entries())n++,this.walkCB2(o,c,i.child(),a);a()}walkCBSync(e,r,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,r,new Ls(this.opts),i)}walkCB2Sync(e,r,i,s){if(this.#f(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,i,s));return}i.processPatterns(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||this.matchSync(o,c,l);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let c=o.readdirSync();this.walkCB3Sync(o,c,i,a)}a()}walkCB3Sync(e,r,i,s){i=i.filterEntries(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||this.matchSync(o,c,l);for(let[o,c]of i.subwalks.entries())n++,this.walkCB2Sync(o,c,i.child(),a);a()}},Os=class extends ao{matches=new Set;constructor(e,r,i){super(e,r,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},$s=class extends ao{results;constructor(e,r,i){super(e,r,i),this.results=new Jt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var iO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",yt=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=rO(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=r.platform||iO,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=r.platform==="win32"?_i:r.platform==="darwin"?As:r.platform?Si:w0;this.scurry=new c(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(c=>new Ye(c,s)),[a,o]=n.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=a.map((c,l)=>{let u=o[l];if(!u)throw new Error("invalid pattern object");return new Ri(c,u,0,this.platform)})}async walk(){return[...await new Os(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Os(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new $s(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new $s(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var yl=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Ye(r,e).hasMagic())return!0;return!1};function co(t,e={}){return new yt(t,e).streamSync()}function E0(t,e={}){return new yt(t,e).stream()}function _0(t,e={}){return new yt(t,e).walkSync()}async function x0(t,e={}){return new yt(t,e).walk()}function lo(t,e={}){return new yt(t,e).iterateSync()}function S0(t,e={}){return new yt(t,e).iterate()}var sO=co,nO=Object.assign(E0,{sync:co}),oO=lo,aO=Object.assign(S0,{sync:lo}),cO=Object.assign(_0,{stream:co,iterate:lo}),Zt=Object.assign(x0,{glob:x0,globSync:_0,sync:cO,globStream:E0,stream:nO,globStreamSync:co,streamSync:sO,globIterate:S0,iterate:aO,globIterateSync:lo,iterateSync:oO,Glob:yt,hasMagic:yl,escape:bi,unescape:dt});Zt.glob=Zt;function bl(t,e){let{changedFiles:r}=e;return r.some(i=>t===i||t.endsWith(i)||i.endsWith(t))}function lO(t,e,r,i){let{fileChangeMap:s}=i,n=s.get(t);return n?n.status==="added"?!0:n.status==="removed"?!1:uO(n.patch,e,r):!1}function R0(t,e){return bl(t.file.path,e)&&lO(t.file.path,t.range.start.line,t.range.end.line,e)}function uO(t,e,r){let i=t.split(`
|
|
51
|
-
`),s=0,n=!1;for(let a of i){let o=a.match(/^@@\s+-\d+(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);if(o){s=parseInt(o[1],10),n=!0;continue}if(n)if(a.startsWith("+")){if(s>=e&&s<=r)return!0;s++}else{if(a.startsWith("-"))continue;if(!a.startsWith("\\")){if(s>=e&&s<=r)return!0;s++}}}return!1}var F0=We(po(),1);function Qt(t,e){return e.length===0?!1:(0,F0.default)().add(e).ignores(t)}var mo=class t{environment;_filePaths=[];mode;eventEmitter;config;diffMode;constructor(e,r,i,s){this.environment=r,this.mode=i,this.eventEmitter=s||new nt,this.config=e}static async initialize(e,r,i,s,n,a){let o=new t(e,r,i,s);if(i==="diff"&&!n){let u=o.environment.getWorkspaceRoot(),d=a?.include,
|
|
44
|
+
`).trimEnd()}function Nn(t){let e=t.match(/^(.+)\.\.\.(.+)$/);if(e)return[e[1],e[2],!0];let r=t.match(/^(.+)\.\.([^.].*)$/);return r?[r[1],r[2],!1]:[t,t,!1]}function nC(t){let[,e]=Nn(t);return e}async function Gc(t){let{stdout:e}=await fe("git rev-parse --abbrev-ref HEAD",{cwd:t});return e.trim()}async function Bm(t){let e=await Gc(t),{stdout:r}=await fe("git rev-parse HEAD",{cwd:t}),i=r.trim(),{stdout:s}=await fe('git log -1 --pretty=format:"%s"',{cwd:t}),n=s.trim(),{stdout:a}=await fe('git log -1 --pretty=format:"%cI"',{cwd:t}),o=a.trim();return{sha:i,branch:e,message:n,timestamp:o}}function zc(t,e,r){if(!t.includes("..")||!(e.includes("staged")||e.includes("unstaged")||e.includes("untracked")))return null;let n=nC(t);return n==="HEAD"||n===r?null:`Worktree includes (staged, unstaged, untracked) require range to end at HEAD or current branch (${r}). Got: ${t}`}async function qc(t){let{stdout:e}=await fe("git rev-parse --abbrev-ref HEAD",{cwd:t}),r=e.trim(),i=["committed","staged","unstaged","untracked"],s=jm(t,r);if(s)return{commitSelector:`${s}...${r}`,include:i};let n=await Mm(t);if(n){if(r===n){let l=await km(t).catch(()=>{});return l?{commitSelector:`${l}...HEAD`,include:i}:{commitSelector:"HEAD~1...HEAD",include:i}}let a=`origin/${n}`,{stdout:o}=await fe(`git rev-parse --verify ${a}`,{cwd:t});return{commitSelector:`${o.trim()?a:n}...${r}`,include:i}}return{commitSelector:"HEAD...HEAD",include:i}}async function Um(t,e){let r=e.commitSelector.trim(),i=r.includes(".."),{stdout:s}=await fe("git rev-parse --abbrev-ref HEAD",{cwd:t}),n=s.trim(),{stdout:a}=await fe("git rev-parse HEAD",{cwd:t}),o=a.trim(),c="",l="";if(i)c=r,l=r;else{let v=jm(t,n),E=await Mm(t),_=r||v||`origin/${E||"main"}`;l=_;let O=`git merge-base --fork-point ${st(_)} HEAD || git merge-base ${st(_)} HEAD`,{stdout:C}=await fe(O,{cwd:t});if(c=C.trim(),!r&&n===(E||"main")){let $=await km(t).catch(()=>{});if($){l=$;let{stdout:F}=await fe(`git merge-base --fork-point ${st($)} HEAD || git merge-base ${st($)} HEAD`,{cwd:t});c=F.trim()}else l="HEAD~1",c="HEAD~1"}}let u=tC(e.include),d=zc(r,e.include,n);if(d)throw new Error(d);let g=[];if(u.committed)if(i){let[v,E]=Nn(r),{stdout:_}=await fe(`git diff --name-status -M -z ${st(v)}..${st(E)}`,{cwd:t,maxBuffer:50*1024*1024});g.push(...Fn(_,"committed"))}else{let{stdout:v}=await fe(`git diff --name-status -M -z ${c}..HEAD`,{cwd:t,maxBuffer:52428800});g.push(...Fn(v,"committed"))}if(u.staged){let{stdout:v}=await fe("git diff --name-status -M -z --cached",{cwd:t,maxBuffer:52428800});g.push(...Fn(v,"staged"))}if(u.unstaged){let{stdout:v}=await fe("git diff --name-status -M -z",{cwd:t,maxBuffer:52428800});g.push(...Fn(v,"unstaged"))}if(u.untracked){let{stdout:v}=await fe("git ls-files --others --exclude-standard -z",{cwd:t,maxBuffer:52428800});g.push(...rC(v))}let h=iC(g),p=h.filter(v=>v.source==="committed"),m=h.filter(v=>v.source==="staged"),y=h.filter(v=>v.source==="unstaged"),b=h.filter(v=>v.source==="untracked"),w=new Map;if(p.length>0){let v=p.map(C=>C.path),E="";if(i){let[C,$]=Nn(r);E=`git diff -U0 -M ${st(C)}..${st($)} -- ${Kt(v)}`}else E=`git diff -U0 -M ${c}..HEAD -- ${Kt(v)}`;let{stdout:_}=await fe(E,{cwd:t,maxBuffer:50*1024*1024});Uc(_).forEach((C,$)=>w.set($,fs(C)))}if(m.length>0){let v=m.map(C=>C.path),E=`git diff -U0 -M --cached -- ${Kt(v)}`,{stdout:_}=await fe(E,{cwd:t,maxBuffer:50*1024*1024});Uc(_).forEach((C,$)=>w.set($,fs(C)))}if(y.length>0){let v=y.map(C=>C.path),E=`git diff -U0 -M -- ${Kt(v)}`,{stdout:_}=await fe(E,{cwd:t,maxBuffer:50*1024*1024});Uc(_).forEach((C,$)=>w.set($,fs(C)))}for(let v of b)try{let{stdout:E}=await fe(`git diff -U0 --no-index /dev/null ${st(v.path)}`,{cwd:t,maxBuffer:52428800});w.set(v.path,fs(E))}catch(E){if(E.stdout)w.set(v.path,fs(E.stdout));else throw E}let x=new Map;if(p.length>0){let v=p.map(C=>C.path),E="";if(i){let[C,$]=Nn(r);E=`git diff --numstat ${st(C)}..${st($)} -- ${Kt(v)}`}else E=`git diff --numstat ${c}..HEAD -- ${Kt(v)}`;let{stdout:_}=await fe(E,{cwd:t,maxBuffer:50*1024*1024}),O=_.split(`
|
|
45
|
+
`).filter(Boolean);for(let C of O){let $=C.split(" ");if($.length>=3){let[F,M,I]=$;x.set(I,{additions:parseInt(F)||0,deletions:parseInt(M)||0})}}}if(m.length>0){let v=m.map(C=>C.path),E=`git diff --numstat --cached -- ${Kt(v)}`,{stdout:_}=await fe(E,{cwd:t,maxBuffer:50*1024*1024}),O=_.split(`
|
|
46
|
+
`).filter(Boolean);for(let C of O){let $=C.split(" ");if($.length>=3){let[F,M,I]=$;x.set(I,{additions:parseInt(F)||0,deletions:parseInt(M)||0})}}}if(y.length>0){let v=y.map(C=>C.path),E=`git diff --numstat -- ${Kt(v)}`,{stdout:_}=await fe(E,{cwd:t,maxBuffer:50*1024*1024}),O=_.split(`
|
|
47
|
+
`).filter(Boolean);for(let C of O){let $=C.split(" ");if($.length>=3){let[F,M,I]=$;x.set(I,{additions:parseInt(F)||0,deletions:parseInt(M)||0})}}}for(let v of b){let _=(w.get(v.path)||"").split(`
|
|
48
|
+
`),O=0,C=0;for(let $ of _)$.startsWith("+")&&!$.startsWith("+++")?O++:$.startsWith("-")&&!$.startsWith("---")&&C++;x.set(v.path,{additions:O,deletions:C})}let f=[];for(let v of h){let E=w.get(v.path)||"",_=x.get(v.path)||{additions:0,deletions:0},O=sC(v),C={filename:v.path,status:O,patch:E,additions:_.additions,deletions:_.deletions,sha:hs(E)};v.oldPath&&(C.oldFilename=v.oldPath),f.push(C)}return{files:f,currentBranch:n,currentCommit:o,diffBranch:l,diffCommit:c}}var pi=class{workspaceRoot;repositoryUrl;constructor(e){this.repositoryUrl=e?.repositoryUrl||null,this.workspaceRoot=e?.workspaceRoot||Fm()}getWorkspaceRoot(){return this.workspaceRoot}async getRepositoryUrl(e="origin"){if(this.repositoryUrl)return this.repositoryUrl;let r=await Dm(this.workspaceRoot,e);if(!r)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return r}async getCurrentCommit(){return await Bm(this.workspaceRoot)}};import*as Me from"fs/promises";import HC from"os";import gi from"path";import{Buffer as Gm}from"buffer";var Dn=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(Gm.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",i=Array.isArray(t);r=i?"[":"{";let s=!0;for(let n in t){let a=typeof t[n]=="function"||!i&&t[n]===void 0;!Object.hasOwn(t,n)||a||(s||(r+=","),s=!1,i?r+=Dn(t[n],e):t[n]!==void 0&&(r+=`${Dn(n,!1)}:${Dn(t[n],e)}`))}return r+=i?"]":"}",r}return JSON.stringify(t)},Wc=t=>Dn(t,!0),Vc=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?Gm.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r);var oC=class{_eventListeners;_maxListeners;constructor(){this._eventListeners=new Map,this._maxListeners=100}maxListeners(){return this._maxListeners}addListener(t,e){this.on(t,e)}on(t,e){this._eventListeners.has(t)||this._eventListeners.set(t,[]);let r=this._eventListeners.get(t);return r&&(r.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${r.length+1} ${t} listeners added. Use setMaxListeners() to increase limit.`),r.push(e)),this}removeListener(t,e){this.off(t,e)}off(t,e){let r=this._eventListeners.get(t)??[],i=r.indexOf(e);i!==-1&&r.splice(i,1),r.length===0&&this._eventListeners.delete(t)}once(t,e){let r=(...i)=>{e(...i),this.off(t,r)};this.on(t,r)}emit(t,...e){let r=this._eventListeners.get(t);if(r&&r.length>0)for(let i of r)i(...e)}listeners(t){return this._eventListeners.get(t)??[]}removeAllListeners(t){t?this._eventListeners.delete(t):this._eventListeners.clear()}setMaxListeners(t){this._maxListeners=t}},Hc=oC,aC=class extends Hc{_hookHandlers;constructor(){super(),this._hookHandlers=new Map}addHandler(t,e){let r=this._hookHandlers.get(t);r?r.push(e):this._hookHandlers.set(t,[e])}removeHandler(t,e){let r=this._hookHandlers.get(t);if(r){let i=r.indexOf(e);i!==-1&&r.splice(i,1)}}trigger(t,e){let r=this._hookHandlers.get(t);if(r)for(let i of r)try{i(e)}catch(s){this.emit("error",new Error(`Error in hook handler for event "${t}": ${s.message}`))}}get handlers(){return new Map(this._hookHandlers)}},cC=aC,lC=class extends Hc{enabled=!0;hits=0;misses=0;sets=0;deletes=0;errors=0;constructor(t){super(),t!==void 0&&(this.enabled=t),this.reset()}hit(){this.enabled&&this.hits++}miss(){this.enabled&&this.misses++}set(){this.enabled&&this.sets++}delete(){this.enabled&&this.deletes++}hitsOrMisses(t){for(let e of t)e===void 0?this.miss():this.hit()}reset(){this.hits=0,this.misses=0,this.sets=0,this.deletes=0,this.errors=0}},uC=lC;var zm=["sqlite","postgres","mysql","mongo","redis","valkey","etcd"],hC=class extends Hc{opts;iterator;hooks=new cC;stats=new uC(!1);_ttl;_namespace;_store=new Map;_serialize=Wc;_deserialize=Vc;_compression;_useKeyPrefix=!0;_throwOnErrors=!1;constructor(t,e){if(super(),e??={},t??={},this.opts={namespace:"keyv",serialize:Wc,deserialize:Vc,emitErrors:!0,store:new Map,...e},t&&t.get?this.opts.store=t:this.opts={...this.opts,...t},this._store=this.opts.store??new Map,this._compression=this.opts.compression,this._serialize=this.opts.serialize,this._deserialize=this.opts.deserialize,this.opts.namespace&&(this._namespace=this.opts.namespace),this._store){if(!this._isValidStorageAdapter(this._store))throw new Error("Invalid storage adapter");typeof this._store.on=="function"&&this._store.on("error",r=>this.emit("error",r)),this._store.namespace=this._namespace,typeof this._store[Symbol.iterator]=="function"&&this._store instanceof Map?this.iterator=this.generateIterator(this._store):"iterator"in this._store&&this._store.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(this._store.iterator.bind(this._store)))}this.opts.stats&&(this.stats.enabled=this.opts.stats),this.opts.ttl&&(this._ttl=this.opts.ttl),this.opts.useKeyPrefix!==void 0&&(this._useKeyPrefix=this.opts.useKeyPrefix),this.opts.throwOnErrors!==void 0&&(this._throwOnErrors=this.opts.throwOnErrors)}get store(){return this._store}set store(t){if(this._isValidStorageAdapter(t))this._store=t,this.opts.store=t,typeof t.on=="function"&&t.on("error",e=>this.emit("error",e)),this._namespace&&(this._store.namespace=this._namespace),typeof t[Symbol.iterator]=="function"&&t instanceof Map?this.iterator=this.generateIterator(t):"iterator"in t&&t.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(t.iterator?.bind(t)));else throw new Error("Invalid storage adapter")}get compression(){return this._compression}set compression(t){this._compression=t}get namespace(){return this._namespace}set namespace(t){this._namespace=t,this.opts.namespace=t,this._store.namespace=t,this.opts.store&&(this.opts.store.namespace=t)}get ttl(){return this._ttl}set ttl(t){this.opts.ttl=t,this._ttl=t}get serialize(){return this._serialize}set serialize(t){this.opts.serialize=t,this._serialize=t}get deserialize(){return this._deserialize}set deserialize(t){this.opts.deserialize=t,this._deserialize=t}get useKeyPrefix(){return this._useKeyPrefix}set useKeyPrefix(t){this._useKeyPrefix=t,this.opts.useKeyPrefix=t}get throwOnErrors(){return this._throwOnErrors}set throwOnErrors(t){this._throwOnErrors=t,this.opts.throwOnErrors=t}generateIterator(t){return async function*(){for await(let[r,i]of typeof t=="function"?t(this._store.namespace):t){let s=await this.deserializeData(i);if(!(this._useKeyPrefix&&this._store.namespace&&!r.includes(this._store.namespace))){if(typeof s.expires=="number"&&Date.now()>s.expires){this.delete(r);continue}yield[this._getKeyUnprefix(r),s.value]}}}.bind(this)}_checkIterableAdapter(){return zm.includes(this._store.opts.dialect)||zm.some(t=>this._store.opts.url.includes(t))}_getKeyPrefix(t){return!this._useKeyPrefix||!this._namespace?t:`${this._namespace}:${t}`}_getKeyPrefixArray(t){return!this._useKeyPrefix||!this._namespace?t:t.map(e=>`${this._namespace}:${e}`)}_getKeyUnprefix(t){return this._useKeyPrefix?t.split(":").splice(1).join(":"):t}_isValidStorageAdapter(t){return t instanceof Map||typeof t.get=="function"&&typeof t.set=="function"&&typeof t.delete=="function"&&typeof t.clear=="function"}async get(t,e){let{store:r}=this.opts,i=Array.isArray(t),s=i?this._getKeyPrefixArray(t):this._getKeyPrefix(t),n=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(i)return e?.raw===!0?this.getMany(t,{raw:!0}):this.getMany(t,{raw:!1});this.hooks.trigger("preGet",{key:s});let a;try{a=await r.get(s)}catch(c){if(this.throwOnErrors)throw c}let o=typeof a=="string"||this.opts.compression?await this.deserializeData(a):a;if(o==null){this.stats.miss();return}if(n(o)){await this.delete(t),this.stats.miss();return}return this.hooks.trigger("postGet",{key:s,value:o}),this.stats.hit(),e?.raw?o:o.value}async getMany(t,e){let{store:r}=this.opts,i=this._getKeyPrefixArray(t),s=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(this.hooks.trigger("preGetMany",{keys:i}),r.getMany===void 0){let c=i.map(async d=>{let g=await r.get(d),h=typeof g=="string"||this.opts.compression?await this.deserializeData(g):g;if(h!=null){if(s(h)){await this.delete(d);return}return e?.raw?h:h.value}}),u=(await Promise.allSettled(c)).map(d=>d.value);return this.hooks.trigger("postGetMany",u),u.length>0&&this.stats.hit(),u}let n=await r.getMany(i),a=[],o=[];for(let c in n){let l=n[c];if(typeof l=="string"&&(l=await this.deserializeData(l)),l==null){a.push(void 0);continue}if(s(l)){o.push(t[c]),a.push(void 0);continue}let u=e?.raw?l:l.value;a.push(u)}return o.length>0&&await this.deleteMany(o),this.hooks.trigger("postGetMany",a),a.length>0&&this.stats.hit(),a}async getRaw(t){let{store:e}=this.opts,r=this._getKeyPrefix(t);this.hooks.trigger("preGetRaw",{key:r});let i=await e.get(r);if(i==null){this.stats.miss();return}let s=typeof i=="string"||this.opts.compression?await this.deserializeData(i):i;if(s!==void 0&&s.expires!==void 0&&s.expires!==null&&s.expires<Date.now()){this.stats.miss(),await this.delete(t);return}return this.stats.hit(),this.hooks.trigger("postGetRaw",{key:r,value:s}),s}async getManyRaw(t){let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(t.length===0){let a=Array.from({length:t.length}).fill(void 0);return this.stats.misses+=t.length,this.hooks.trigger("postGetManyRaw",{keys:r,values:a}),a}let i=[];if(e.getMany===void 0){let a=r.map(async c=>{let l=await e.get(c);if(l!=null)return this.deserializeData(l)});i=(await Promise.allSettled(a)).map(c=>c.value)}else{let a=await e.getMany(r);for(let o of a)o!=null?i.push(await this.deserializeData(o)):i.push(void 0)}let s=[],n=a=>typeof a.expires=="number"&&Date.now()>a.expires;for(let[a,o]of i.entries())o!==void 0&&n(o)&&(s.push(r[a]),i[a]=void 0);return s.length>0&&await this.deleteMany(s),this.stats.hitsOrMisses(i),this.hooks.trigger("postGetManyRaw",{keys:r,values:i}),i}async set(t,e,r){let i={key:t,value:e,ttl:r};this.hooks.trigger("preSet",i);let s=this._getKeyPrefix(i.key);i.ttl??=this._ttl,i.ttl===0&&(i.ttl=void 0);let{store:n}=this.opts,a=typeof i.ttl=="number"?Date.now()+i.ttl:void 0;if(typeof i.value=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let o={value:i.value,expires:a},c=await this.serializeData(o),l=!0;try{let u=await n.set(s,c,i.ttl);typeof u=="boolean"&&(l=u)}catch(u){if(l=!1,this.emit("error",u),this._throwOnErrors)throw u}return this.hooks.trigger("postSet",{key:s,value:c,ttl:r}),this.stats.set(),l}async setMany(t){let e=[];try{if(this._store.setMany===void 0){let r=[];for(let s of t)r.push(this.set(s.key,s.value,s.ttl));e=await Promise.all(r)}else{let r=await Promise.all(t.map(async({key:i,value:s,ttl:n})=>{n??=this._ttl,n===0&&(n=void 0);let a=typeof n=="number"?Date.now()+n:void 0;if(typeof s=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let o={value:s,expires:a},c=await this.serializeData(o);return{key:this._getKeyPrefix(i),value:c,ttl:n}}));e=await this._store.setMany(r)}}catch(r){if(this.emit("error",r),this._throwOnErrors)throw r;e=t.map(()=>!1)}return e}async delete(t){let{store:e}=this.opts;if(Array.isArray(t))return this.deleteMany(t);let r=this._getKeyPrefix(t);this.hooks.trigger("preDelete",{key:r});let i=!0;try{let s=await e.delete(r);typeof s=="boolean"&&(i=s)}catch(s){if(i=!1,this.emit("error",s),this._throwOnErrors)throw s}return this.hooks.trigger("postDelete",{key:r,value:i}),this.stats.delete(),i}async deleteMany(t){try{let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(this.hooks.trigger("preDelete",{key:r}),e.deleteMany!==void 0)return await e.deleteMany(r);let i=r.map(async a=>e.delete(a)),n=(await Promise.all(i)).every(Boolean);return this.hooks.trigger("postDelete",{key:r,value:n}),n}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e;return!1}}async clear(){this.emit("clear");let{store:t}=this.opts;try{await t.clear()}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e}}async has(t){if(Array.isArray(t))return this.hasMany(t);let e=this._getKeyPrefix(t),{store:r}=this.opts;if(r.has!==void 0&&!(r instanceof Map))return r.has(e);let i;try{i=await r.get(e)}catch(s){if(this.emit("error",s),this._throwOnErrors)throw s;return!1}if(i){let s=await this.deserializeData(i);if(s)return s.expires===void 0||s.expires===null?!0:s.expires>Date.now()}return!1}async hasMany(t){let e=this._getKeyPrefixArray(t),{store:r}=this.opts;if(r.hasMany!==void 0)return r.hasMany(e);let i=[];for(let s of t)i.push(await this.has(s));return i}async disconnect(){let{store:t}=this.opts;if(this.emit("disconnect"),typeof t.disconnect=="function")return t.disconnect()}emit(t,...e){t==="error"&&!this.opts.emitErrors||super.emit(t,...e)}async serializeData(t){return this._serialize?this._compression?.compress?this._serialize({value:await this._compression.compress(t.value),expires:t.expires}):this._serialize(t):t}async deserializeData(t){if(!this._deserialize)return t;if(this._compression?.decompress&&typeof t=="string"){let e=await this._deserialize(t);return{value:await this._compression.decompress(e?.value),expires:e?.expires}}if(typeof t=="string")return this._deserialize(t)}},qm=hC;var Sg=We(_g(),1);var zn=class{environment;cacheStore;constructor(e){this.environment=e}getStorageDirectory(){return gi.join(HC.homedir(),".powerlint")}getIndexDirectory(){return gi.join(this.getStorageDirectory(),"indexes",hs(this.environment.getWorkspaceRoot()))}getCacheDirectory(){return gi.join(this.getStorageDirectory(),"cache",hs(this.environment.getWorkspaceRoot()))}async ensureDirectory(e){await Me.mkdir(e,{recursive:!0})}async getIndexFilePath(e,r){let i=this.getIndexDirectory();await this.ensureDirectory(i);let s=r||`${e.toLowerCase()}-index.scip`;return gi.join(i,`${e.toLowerCase()}-${s}`)}async indexExists(e,r){let i=await this.getIndexFilePath(e,r);try{return await Me.access(i),!0}catch{return!1}}async readIndex(e,r){let i=await this.getIndexFilePath(e,r);try{return await Me.access(i),await Me.readFile(i)}catch{return null}}async saveIndex(e,r,i){let s=await this.getIndexFilePath(e,i);await Me.writeFile(s,r)}getCacheFilePath(){return gi.join(this.getCacheDirectory(),"cache.json")}async purgeStorage(){let e=0,r=this.getStorageDirectory();try{await Me.access(r),await Me.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}async purgeCache(){let e=0,r=this.getCacheDirectory();try{await Me.access(r),await Me.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}getCacheStore(){if(!this.cacheStore){let e=this.getCacheDirectory();this.cacheStore=new qm({store:new Sg.KeyvFile({filename:gi.join(e,"cache.json")})})}return this.cacheStore}async saveCache(e,r,i){let s=this.getCacheStore(),n=`${e}:${r}`;await s.set(n,i)}async readCache(e,r){let i=this.getCacheStore(),s=`${e}:${r}`;return await i.get(s)||null}async purgeIndexes(){let e=0,r=this.getIndexDirectory();try{await Me.access(r),await Me.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}};var ds=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async getRepositoryUrl(){let e=await this.environment.getRepositoryUrl();if(!e)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return e}async loadRuleById(e){let r=await this.fetchRules([e]);if(r.length===0)throw new Error(`Rule with ID '${e}' not found`);return r[0]}async loadAllRules(){return await this.fetchRules()}async fetchRules(e){let r=await this.getRepositoryUrl();return(await this.config.getApiClient().getRules({repository_url:r,rule_ids:e,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion()})).rules.map(n=>({id:n.id,internalId:n.internalId,internalVersionId:n.internalVersionId,config:{message:n.message,severity:n.severity,execution:n.execution||"llm",steps:n.schema},prompt:n.prompt,testCases:[]}))}};import{EventEmitter as KC}from"events";var nt=class extends KC{rulesStartTime=0;indexingStartTimes=new Map;fileDiscoveryStartTime=0;constructor(){super(),this.setMaxListeners(20)}emit(e,r){return super.emit(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}off(e,r){return super.off(e,r)}setExecutionMode(e,r){this.emit("execution:mode",{mode:e,...r})}startRules(e){this.rulesStartTime=Date.now(),this.emit("rules:start",{totalRules:e})}progressRule(e,r,i,s){let n=Math.round(e/r*100);this.emit("rules:progress",{currentRule:e,totalRules:r,ruleId:i,percentage:n,isLlm:s})}completeRules(e,r){let i=Date.now()-this.rulesStartTime;this.emit("rules:complete",{totalRules:e,totalMatches:r,executionTime:i})}startFileDiscovery(e){this.fileDiscoveryStartTime=Date.now(),this.emit("files:discovery:start",{mode:e})}fileDiscoveryProgress(e,r){this.emit("files:discovery:progress",{message:e,currentCount:r})}completeFileDiscovery(e,r){let i=Date.now()-this.fileDiscoveryStartTime;this.emit("files:discovery:complete",{totalFiles:e,mode:r,executionTime:i})}fileFilter(e,r,i){this.emit("files:filter",{originalCount:e,filteredCount:r,filterType:i})}startScipMatchLookup(e,r){this.emit("scip:match-lookup:start",{language:e,match:r})}scipMatchLookupProgress(e,r){this.emit("scip:match-lookup:progress",{language:e,document:r})}scipMatchLookupComplete(e,r){this.emit("scip:match-lookup:complete",{language:e,document:r})}startIndexing(e){this.indexingStartTimes.set(e,Date.now()),this.emit("indexing:start",{language:e})}indexingProgress(e,r,i,s){this.emit("indexing:progress",{language:e,message:r,packageName:i,timeMs:s})}completeIndexing(e){let r=this.indexingStartTimes.get(e)||Date.now(),i=Date.now()-r;this.indexingStartTimes.delete(e),this.emit("indexing:complete",{language:e,executionTime:i})}startStep(e,r,i,s,n){this.emit("step:start",{ruleId:e,stepName:r,stepType:i,inputs:s,parentStepName:n})}completeStep(e,r,i,s,n=0,a){this.emit("step:complete",{ruleId:e,stepName:r,stepType:i,outputs:s,executionTime:n,parentStepName:a})}startTest(e,r){this.emit("test:start",{ruleId:e,testName:r})}testMatches(e,r,i){this.emit("test:matches",{ruleId:e,testName:r,matches:i})}completeTest(e,r,i,s){this.emit("test:complete",{ruleId:e,testName:r,matches:i,stepExecutions:s})}startLLMValidation(e,r,i){this.emit("llm:validation:start",{ruleId:e,matchCount:r,estimatedCost:i})}llmValidationProgress(e,r,i,s){this.emit("llm:validation:progress",{ruleId:e,tokenCount:r,elapsedTime:i,streamedText:s})}completeLLMValidation(e,r,i,s,n,a,o,c){this.emit("llm:validation:complete",{ruleId:e,tokenCount:r,inputTokens:i,outputTokens:s,cost:n,executionTime:a,violationCount:o,fromCache:c})}llmToolExecution(e,r,i){this.emit("llm:tool-execution",{ruleId:e,toolName:r,...i})}startLLMValidationPhase(e,r){this.emit("llm:validation-phase:start",{ruleId:e,matchCount:r})}};import{cpus as KO}from"os";var Cg=We(Xc(),1);import{existsSync as rA}from"fs";import Fr from"path";import{fileURLToPath as iA}from"url";console.debug=()=>{};var sA=iA(import.meta.url),Jc=Fr.dirname(sA),nA={darwin:"macOS",linux:"Linux",win32:"Windows"},oA={x64:"X64",arm64:"ARM64"};function he(t){let e=nA[process.platform],r=oA[process.arch];if(!e||!r)return;let i=[Fr.join(Jc,"powerlint/dist/vendor"),Fr.join(Jc,"../dist/vendor"),Fr.join(Jc,"./vendor")];for(let s of i){let n=Fr.join(s,`ast-grep-lang-${t}`),a=Fr.join(n,"prebuilds",`prebuild-${e}-${r}`,"parser.so");if(rA(a))return a}throw new Error(`Prebuild not found for ${t} on ${e} ${r}. Paths tried: ${i.join(", ")}`)}var aA={libraryPath:he("angular"),extensions:["html"],languageSymbol:"tree_sitter_angular",expandoChar:"z"},cA={libraryPath:he("bash"),extensions:["bash","bats","cgi","command","env","fcgi","ksh","sh","tmux","tool","zsh"],languageSymbol:"tree_sitter_bash",expandoChar:"$"},lA={libraryPath:he("c"),extensions:["c","h"],languageSymbol:"tree_sitter_c",expandoChar:"_"},uA={libraryPath:he("cpp"),extensions:["cc","hpp","cpp","hh","cxx","cu","ino"],languageSymbol:"tree_sitter_cpp",expandoChar:"_"},hA={libraryPath:he("csharp"),extensions:["cs"],languageSymbol:"tree_sitter_c_sharp",expandoChar:"\xB5"},fA={libraryPath:he("css"),extensions:["css","scss"],languageSymbol:"tree_sitter_css",expandoChar:"$"},pA={libraryPath:he("dart"),extensions:["dart"],languageSymbol:"tree_sitter_dart",expandoChar:"$"},dA={libraryPath:he("elixir"),extensions:["ex","exs"],languageSymbol:"tree_sitter_elixir",expandoChar:"\xB5"},mA={libraryPath:he("go"),extensions:["go"],languageSymbol:"tree_sitter_go",expandoChar:"\xB5"},gA={libraryPath:he("haskell"),extensions:["hs"],languageSymbol:"tree_sitter_haskell",expandoChar:"\xB5"},yA={libraryPath:he("html"),extensions:["html","htm","xhtml"],languageSymbol:"tree_sitter_html",expandoChar:"z"},bA={libraryPath:he("java"),extensions:["java"],languageSymbol:"tree_sitter_java",expandoChar:"$"},vA={libraryPath:he("javascript"),extensions:["cjs","js","mjs","jsx"],languageSymbol:"tree_sitter_javascript",expandoChar:"$"},wA={libraryPath:he("json"),extensions:["json"],languageSymbol:"tree_sitter_json",expandoChar:"$"},xA={libraryPath:he("kotlin"),extensions:["kt","ktm","kts"],languageSymbol:"tree_sitter_kotlin",expandoChar:"\xB5"},EA={libraryPath:he("lua"),extensions:["lua"],languageSymbol:"tree_sitter_lua",expandoChar:"$"},_A={libraryPath:he("markdown"),extensions:["md"],languageSymbol:"tree_sitter_markdown",expandoChar:"$"},SA={libraryPath:he("php"),extensions:["php"],languageSymbol:"tree_sitter_php",expandoChar:"$"},RA={libraryPath:he("python"),extensions:["py"],languageSymbol:"tree_sitter_python",expandoChar:"\xB5"},CA={libraryPath:he("ruby"),extensions:["rb","rbw","gemspec"],languageSymbol:"tree_sitter_ruby",expandoChar:"\xB5"},AA={libraryPath:he("rust"),extensions:["rs"],languageSymbol:"tree_sitter_rust",expandoChar:"\xB5"},LA={libraryPath:he("scala"),extensions:["scala","sc","sbt"],languageSymbol:"tree_sitter_scala",expandoChar:"$"},OA={libraryPath:he("sql"),extensions:["sql"],languageSymbol:"tree_sitter_sql",expandoChar:"_"},$A={libraryPath:he("swift"),extensions:["swift"],languageSymbol:"tree_sitter_swift",expandoChar:"\xB5"},TA={libraryPath:he("toml"),extensions:["toml"],languageSymbol:"tree_sitter_toml",expandoChar:"_"},PA={libraryPath:he("tsx"),extensions:["tsx"],languageSymbol:"tree_sitter_tsx",expandoChar:"$"},IA={libraryPath:he("typescript"),extensions:["ts","cts","mts"],languageSymbol:"tree_sitter_typescript",expandoChar:"$"},FA={libraryPath:he("yaml"),extensions:["yaml","yml"],languageSymbol:"tree_sitter_yaml",expandoChar:"$"},Ag={Angular:aA,Bash:cA,C:lA,Cpp:uA,Csharp:hA,Css:fA,Dart:pA,Elixir:dA,Go:mA,Haskell:gA,Html:yA,Java:bA,JavaScript:vA,Json:wA,Kotlin:xA,Lua:EA,Markdown:_A,Php:SA,Python:RA,Ruby:CA,Rust:AA,Scala:LA,Sql:OA,Swift:$A,Toml:TA,Tsx:PA,TypeScript:IA,Yaml:FA};(0,Cg.registerDynamicLanguage)(Ag);var Rg=Object.entries(Ag).reduce((t,[e,r])=>(t[e]=r.extensions??[],t),{});function Wn(t){let e=Fr.extname(t).slice(1);return NA(e)??"Unknown"}function NA(t){return Object.keys(Rg).find(e=>Rg[e].includes(t))}import*as Oi from"fs";import*as jt from"path";var Kg=We(Bg(),1);var gs=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var zA={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},ys=t=>t.replace(/[[\]\\-]/g,"\\$&"),qA=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ug=t=>t.join(""),Gg=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let i=[],s=[],n=r+1,a=!1,o=!1,c=!1,l=!1,u=r,d="";e:for(;n<t.length;){let m=t.charAt(n);if((m==="!"||m==="^")&&n===r+1){l=!0,n++;continue}if(m==="]"&&a&&!c){u=n+1;break}if(a=!0,m==="\\"&&!c){c=!0,n++;continue}if(m==="["&&!c){for(let[y,[b,w,x]]of Object.entries(zA))if(t.startsWith(y,n)){if(d)return["$.",!1,t.length-r,!0];n+=y.length,x?s.push(b):i.push(b),o=o||w;continue e}}if(c=!1,d){m>d?i.push(ys(d)+"-"+ys(m)):m===d&&i.push(ys(m)),d="",n++;continue}if(t.startsWith("-]",n+1)){i.push(ys(m+"-")),n+=2;continue}if(t.startsWith("-",n+1)){d=m,n+=2;continue}i.push(ys(m)),n++}if(u<n)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,t.length-r,!0];if(s.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let m=i[0].length===2?i[0].slice(-1):i[0];return[qA(m),!1,u-r,!1]}let g="["+(l?"^":"")+Ug(i)+"]",h="["+(l?"":"^")+Ug(s)+"]";return[i.length&&s.length?"("+g+"|"+h+")":i.length?g:h,o,u-r,!0]};var dt=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var WA=new Set(["!","?","+","*","@"]),zg=t=>WA.has(t),VA="(?!(?:^|/)\\.\\.?(?:$|/))",Vn="(?!\\.)",HA=new Set(["[","."]),KA=new Set(["..","."]),YA=new Set("().*{}+?[]^$\\!"),XA=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),el="[^/]",qg=el+"*?",Wg=el+"+?",yi=class t{type;#t;#r;#e=!1;#n=[];#h;#w;#a;#u=!1;#s;#c;#i=!1;constructor(e,r,i={}){this.type=e,e&&(this.#r=!0),this.#h=r,this.#t=this.#h?this.#h.#t:this,this.#s=this.#t===this?i:this.#t.#s,this.#a=this.#t===this?[]:this.#t.#a,e==="!"&&!this.#t.#u&&this.#a.push(this),this.#w=this.#h?this.#h.#n.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.map(e=>String(e)).join("")}#l(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#a.pop();){if(e.type!=="!")continue;let r=e,i=r.#h;for(;i;){for(let s=r.#w+1;!i.type&&s<i.#n.length;s++)for(let n of e.#n){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(i.#n[s])}r=i,i=r.#h}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#h===this))throw new Error("invalid part: "+r);this.#n.push(r)}}toJSON(){let e=this.type===null?this.#n.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#h?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#h?.isStart())return!1;if(this.#w===0)return!0;let e=this.#h;for(let r=0;r<this.#w;r++){let i=e.#n[r];if(!(i instanceof t&&i.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#h?.type==="!")return!0;if(!this.#h?.isEnd())return!1;if(!this.type)return this.#h?.isEnd();let e=this.#h?this.#h.#n.length:0;return this.#w===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let i of this.#n)r.copyIn(i);return r}static#o(e,r,i,s){let n=!1,a=!1,o=-1,c=!1;if(r.type===null){let h=i,p="";for(;h<e.length;){let m=e.charAt(h++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){h===o+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(h===o+2&&c)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,o=h,c=!1,p+=m;continue}if(!s.noext&&zg(m)&&e.charAt(h)==="("){r.push(p),p="";let y=new t(m,r);h=t.#o(e,y,h,s),r.push(y);continue}p+=m}return r.push(p),h}let l=i+1,u=new t(null,r),d=[],g="";for(;l<e.length;){let h=e.charAt(l++);if(n||h==="\\"){n=!n,g+=h;continue}if(a){l===o+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(l===o+2&&c)&&(a=!1),g+=h;continue}else if(h==="["){a=!0,o=l,c=!1,g+=h;continue}if(zg(h)&&e.charAt(l)==="("){u.push(g),g="";let p=new t(h,u);u.push(p),l=t.#o(e,p,l,s);continue}if(h==="|"){u.push(g),g="",d.push(u),u=new t(null,r);continue}if(h===")")return g===""&&r.#n.length===0&&(r.#i=!0),u.push(g),g="",r.push(...d,u),l;g+=h}return r.type=null,r.#r=void 0,r.#n=[e.substring(i-1)],l}static fromGlob(e,r={}){let i=new t(null,void 0,r);return t.#o(e,i,0,r),i}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,i,s,n]=this.toRegExpSource();if(!(s||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let o=(this.#s.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${r}$`,o),{_src:r,_glob:e})}get options(){return this.#s}toRegExpSource(e){let r=e??!!this.#s.dot;if(this.#t===this&&this.#l(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(h=>{let[p,m,y,b]=typeof h=="string"?t.#g(h,this.#r,c):h.toRegExpSource(e);return this.#r=this.#r||y,this.#e=this.#e||b,p}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&KA.has(this.#n[0]))){let p=HA,m=r&&p.has(l.charAt(0))||l.startsWith("\\.")&&p.has(l.charAt(2))||l.startsWith("\\.\\.")&&p.has(l.charAt(4)),y=!r&&!e&&p.has(l.charAt(0));u=m?VA:y?Vn:""}let d="";return this.isEnd()&&this.#t.#u&&this.#h?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,dt(l),this.#r=!!this.#r,this.#e]}let i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#d(r);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#r=void 0,[c,dt(this.toString()),!1,!1]}let a=!i||e||r||!Vn?"":this.#d(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let o="";if(this.type==="!"&&this.#i)o=(this.isStart()&&!r?Vn:"")+Wg;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Vn:"")+qg+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=s+n+c}return[o,dt(n),this.#r=!!this.#r,this.#e]}#d(e){return this.#n.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[i,s,n,a]=r.toRegExpSource(e);return this.#e=this.#e||a,i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#g(e,r,i=!1){let s=!1,n="",a=!1;for(let o=0;o<e.length;o++){let c=e.charAt(o);if(s){s=!1,n+=(YA.has(c)?"\\":"")+c;continue}if(c==="\\"){o===e.length-1?n+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,g]=Gg(e,o);if(d){n+=l,a=a||u,o+=d-1,r=r||g;continue}}if(c==="*"){i&&e==="*"?n+=Wg:n+=qg,r=!0;continue}if(c==="?"){n+=el,r=!0;continue}n+=XA(c)}return[n,dt(e),!!r,a]}};var bi=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var ze=(t,e,r={})=>(gs(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Ye(e,r).match(t)),JA=/^\*+([^+@!?\*\[\(]*)$/,ZA=t=>e=>!e.startsWith(".")&&e.endsWith(t),QA=t=>e=>e.endsWith(t),eL=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),tL=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),rL=/^\*+\.\*+$/,iL=t=>!t.startsWith(".")&&t.includes("."),sL=t=>t!=="."&&t!==".."&&t.includes("."),nL=/^\.\*+$/,oL=t=>t!=="."&&t!==".."&&t.startsWith("."),aL=/^\*+$/,cL=t=>t.length!==0&&!t.startsWith("."),lL=t=>t.length!==0&&t!=="."&&t!=="..",uL=/^\?+([^+@!?\*\[\(]*)?$/,hL=([t,e=""])=>{let r=Yg([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},fL=([t,e=""])=>{let r=Xg([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},pL=([t,e=""])=>{let r=Xg([t]);return e?i=>r(i)&&i.endsWith(e):r},dL=([t,e=""])=>{let r=Yg([t]);return e?i=>r(i)&&i.endsWith(e):r},Yg=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},Xg=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},Jg=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vg={win32:{sep:"\\"},posix:{sep:"/"}},mL=Jg==="win32"?Vg.win32.sep:Vg.posix.sep;ze.sep=mL;var Pe=Symbol("globstar **");ze.GLOBSTAR=Pe;var gL="[^/]",yL=gL+"*?",bL="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",vL="(?:(?!(?:\\/|^)\\.).)*?",wL=(t,e={})=>r=>ze(r,t,e);ze.filter=wL;var ot=(t,e={})=>Object.assign({},t,e),xL=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return ze;let e=ze;return Object.assign((i,s,n={})=>e(i,s,ot(t,n)),{Minimatch:class extends e.Minimatch{constructor(s,n={}){super(s,ot(t,n))}static defaults(s){return e.defaults(ot(t,s)).Minimatch}},AST:class extends e.AST{constructor(s,n,a={}){super(s,n,ot(t,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,ot(t,n))}},unescape:(i,s={})=>e.unescape(i,ot(t,s)),escape:(i,s={})=>e.escape(i,ot(t,s)),filter:(i,s={})=>e.filter(i,ot(t,s)),defaults:i=>e.defaults(ot(t,i)),makeRe:(i,s={})=>e.makeRe(i,ot(t,s)),braceExpand:(i,s={})=>e.braceExpand(i,ot(t,s)),match:(i,s,n={})=>e.match(i,s,ot(t,n)),sep:e.sep,GLOBSTAR:Pe})};ze.defaults=xL;var Zg=(t,e={})=>(gs(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,Kg.default)(t));ze.braceExpand=Zg;var EL=(t,e={})=>new Ye(t,e).makeRe();ze.makeRe=EL;var _L=(t,e,r={})=>{let i=new Ye(e,r);return t=t.filter(s=>i.match(s)),i.options.nonull&&!t.length&&t.push(e),t};ze.match=_L;var Hg=/[?*]|[+@!]\(.*?\)|\[|\]/,SL=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ye=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){gs(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||Jg,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=n[0]===""&&n[1]===""&&(n[2]==="?"||!Hg.test(n[2]))&&!Hg.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,4),...n.slice(4).map(u=>this.parse(u))];if(l)return[n[0],...n.slice(1).map(u=>this.parse(u))]}return n.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let s=0;s<e[i].length;s++)e[i][s]==="**"&&(e[i][s]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let s=i;for(;r[s+1]==="**";)s++;s!==i&&r.splice(i,s-i)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((i,s)=>{let n=i[i.length-1];return s==="**"&&n==="**"?i:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(i.pop(),i):(i.push(s),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let n=e[s];s===1&&n===""&&e[0]===""||(n==="."||n==="")&&(r=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(r=!0,e.splice(i-1,2),i-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let i of e){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let a=s;for(;i[a+1]==="**";)a++;a>s&&i.splice(s+1,a-s);let o=i[s+1],c=i[s+2],l=i[s+3];if(o!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,i.splice(s,1);let u=i.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let o=i[a];a===1&&o===""&&i[0]===""||(o==="."||o==="")&&(r=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let n=0;for(;(n=i.indexOf("..",n+1))!==-1;){let a=i[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){r=!0;let c=n===1&&i[n+1]==="**"?["."]:[];i.splice(n-1,2,...c),i.length===0&&i.push(""),n-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let i=r+1;i<e.length;i++){let s=this.partsMatch(e[r],e[i],!this.preserveMultipleSlashes);if(s){e[r]=[],e[i]=s;break}}return e.filter(r=>r.length)}partsMatch(e,r,i=!1){let s=0,n=0,a=[],o="";for(;s<e.length&&n<r.length;)if(e[s]===r[n])a.push(o==="b"?r[n]:e[s]),s++,n++;else if(i&&e[s]==="**"&&r[n]===e[s+1])a.push(e[s]),s++;else if(i&&r[n]==="**"&&e[s]===r[n+1])a.push(r[n]),n++;else if(e[s]==="*"&&r[n]&&(this.options.dot||!r[n].startsWith("."))&&r[n]!=="**"){if(o==="b")return!1;o="a",a.push(e[s]),s++,n++}else if(r[n]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(o==="a")return!1;o="b",a.push(r[n]),s++,n++}else return!1;return e.length===r.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,i=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)r=!r,i++;i&&(this.pattern=e.slice(i)),this.negate=r}matchOne(e,r,i=!1){let s=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),y=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),b=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),w=!b&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),x=y?3:m?0:void 0,f=w?3:b?0:void 0;if(typeof x=="number"&&typeof f=="number"){let[v,E]=[e[x],r[f]];v.toLowerCase()===E.toLowerCase()&&(r[f]=v,f>x?r=r.slice(f):x>f&&(e=e.slice(x)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var a=0,o=0,c=e.length,l=r.length;a<c&&o<l;a++,o++){this.debug("matchOne loop");var u=r[o],d=e[a];if(this.debug(r,u,d),u===!1)return!1;if(u===Pe){this.debug("GLOBSTAR",[r,u,d]);var g=a,h=o+1;if(h===l){for(this.debug("** at the end");a<c;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;g<c;){var p=e[g];if(this.debug(`
|
|
49
|
+
globstar while`,e,g,r,h,p),this.matchOne(e.slice(g),r.slice(h),i))return this.debug("globstar found match!",g,c,p),!0;if(p==="."||p===".."||!s.dot&&p.charAt(0)==="."){this.debug("dot detected!",e,g,r,h);break}this.debug("globstar swallow a segment, and continue"),g++}return!!(i&&(this.debug(`
|
|
50
|
+
>>> no match, partial?`,e,g,r,h),g===c))}let m;if(typeof u=="string"?(m=d===u,this.debug("string match",u,d,m)):(m=u.test(d),this.debug("pattern match",u,d,m)),!m)return!1}if(a===c&&o===l)return!0;if(a===c)return i;if(o===l)return a===c-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return Zg(this.pattern,this.options)}parse(e){gs(e);let r=this.options;if(e==="**")return Pe;if(e==="")return"";let i,s=null;(i=e.match(aL))?s=r.dot?lL:cL:(i=e.match(JA))?s=(r.nocase?r.dot?tL:eL:r.dot?QA:ZA)(i[1]):(i=e.match(uL))?s=(r.nocase?r.dot?fL:hL:r.dot?pL:dL)(i):(i=e.match(rL))?s=r.dot?sL:iL:(i=e.match(nL))&&(s=oL);let n=yi.fromGlob(e,this.options).toMMPattern();return s&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:s}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,i=r.noglobstar?yL:r.dot?bL:vL,s=new Set(r.nocase?["i"]:[]),n=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))s.add(d);return typeof u=="string"?SL(u):u===Pe?Pe:u._src});return l.forEach((u,d)=>{let g=l[d+1],h=l[d-1];u!==Pe||h===Pe||(h===void 0?g!==void 0&&g!==Pe?l[d+1]="(?:\\/|"+i+"\\/)?"+g:l[d]=i:g===void 0?l[d-1]=h+"(?:\\/|"+i+")?":g!==Pe&&(l[d-1]=h+"(?:\\/|\\/"+i+"\\/)"+g,l[d+1]=Pe))}),l.filter(u=>u!==Pe).join("/")}).join("|"),[a,o]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+o+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...s].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,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let n=this.set;this.debug(this.pattern,"set",n);let a=s[s.length-1];if(!a)for(let o=s.length-2;!a&&o>=0;o--)a=s[o];for(let o=0;o<n.length;o++){let c=n[o],l=s;if(i.matchBase&&c.length===1&&(l=[a]),this.matchOne(l,c,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return ze.defaults(e).Minimatch}};ze.AST=yi;ze.Minimatch=Ye;ze.escape=bi;ze.unescape=dt;import{fileURLToPath as rO}from"node:url";var vi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e0=new Set,tl=typeof process=="object"&&process?process:{},t0=(t,e,r,i)=>{typeof tl.emitWarning=="function"?tl.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},Hn=globalThis.AbortController,Qg=globalThis.AbortSignal;if(typeof Hn>"u"){Qg=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},Hn=class{constructor(){e()}signal=new Qg;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let t=tl.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,t0("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var RL=t=>!e0.has(t),CF=Symbol("type"),Yt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),r0=t=>Yt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?wi:null:null,wi=class extends Array{constructor(e){super(e),this.fill(0)}},rl=class t{heap;length;static#t=!1;static create(e){let r=r0(e);if(!r)return[];t.#t=!0;let i=new t(e,r);return t.#t=!1,i}constructor(e,r){if(!t.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},bs=class t{#t;#r;#e;#n;#h;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#u;#s;#c;#i;#l;#o;#d;#g;#y;#p;#C;#x;#E;#_;#S;#v;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#E,sizes:e.#C,keyMap:e.#s,keyList:e.#c,valList:e.#i,next:e.#l,prev:e.#o,get head(){return e.#d},get tail(){return e.#g},free:e.#y,isBackgroundFetch:r=>e.#m(r),backgroundFetch:(r,i,s,n)=>e.#F(r,i,s,n),moveToTail:r=>e.#D(r),indexes:r=>e.#L(r),rindexes:r=>e.#$(r),isStale:r=>e.#R(r)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#a}get fetchMethod(){return this.#h}get memoMethod(){return this.#w}get dispose(){return this.#e}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:g,maxSize:h=0,maxEntrySize:p=0,sizeCalculation:m,fetchMethod:y,memoMethod:b,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:v,ignoreFetchAbort:E}=e;if(r!==0&&!Yt(r))throw new TypeError("max option must be a nonnegative integer");let _=r?r0(r):Array;if(!_)throw new Error("invalid max value: "+r);if(this.#t=r,this.#r=h,this.maxEntrySize=p||this.#r,this.sizeCalculation=m,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=b,y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#h=y,this.#S=!!y,this.#s=new Map,this.#c=new Array(r).fill(void 0),this.#i=new Array(r).fill(void 0),this.#l=new _(r),this.#o=new _(r),this.#d=0,this.#g=0,this.#y=rl.create(r),this.#a=0,this.#u=0,typeof l=="function"&&(this.#e=l),typeof u=="function"?(this.#n=u,this.#p=[]):(this.#n=void 0,this.#p=void 0),this.#_=!!this.#e,this.#v=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!f,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#r!==0&&!Yt(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Yt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=Yt(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!Yt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let O="LRU_CACHE_UNBOUNDED";RL(O)&&(e0.add(O),t0("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,t))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#P(){let e=new wi(this.#t),r=new wi(this.#t);this.#E=e,this.#x=r,this.#M=(n,a,o=vi.now())=>{if(r[n]=a!==0?o:0,e[n]=a,a!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#R(n)&&this.#b(this.#c[n],"expire")},a+1);c.unref&&c.unref()}},this.#A=n=>{r[n]=e[n]!==0?vi.now():0},this.#f=(n,a)=>{if(e[a]){let o=e[a],c=r[a];if(!o||!c)return;n.ttl=o,n.start=c,n.now=i||s();let l=n.now-c;n.remainingTTL=o-l}};let i=0,s=()=>{let n=vi.now();if(this.ttlResolution>0){i=n;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return n};this.getRemainingTTL=n=>{let a=this.#s.get(n);if(a===void 0)return 0;let o=e[a],c=r[a];if(!o||!c)return 1/0;let l=(i||s())-c;return o-l},this.#R=n=>{let a=r[n],o=e[n];return!!o&&!!a&&(i||s())-a>o}}#A=()=>{};#f=()=>{};#M=()=>{};#R=()=>!1;#I(){let e=new wi(this.#t);this.#u=0,this.#C=e,this.#N=r=>{this.#u-=e[r],e[r]=0},this.#B=(r,i,s,n)=>{if(this.#m(i))return 0;if(!Yt(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,r),!Yt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#O=(r,i,s)=>{if(e[r]=i,this.#r){let n=this.#r-e[r];for(;this.#u>n;)this.#T(!0)}this.#u+=e[r],s&&(s.entrySize=i,s.totalCalculatedSize=this.#u)}}#N=e=>{};#O=(e,r,i)=>{};#B=(e,r,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#L({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#g;!(!this.#k(r)||((e||!this.#R(r))&&(yield r),r===this.#d));)r=this.#o[r]}*#$({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#d;!(!this.#k(r)||((e||!this.#R(r))&&(yield r),r===this.#g));)r=this.#l[r]}#k(e){return e!==void 0&&this.#s.get(this.#c[e])===e}*entries(){for(let e of this.#L())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#m(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*rentries(){for(let e of this.#$())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#m(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*keys(){for(let e of this.#L()){let r=this.#c[e];r!==void 0&&!this.#m(this.#i[e])&&(yield r)}}*rkeys(){for(let e of this.#$()){let r=this.#c[e];r!==void 0&&!this.#m(this.#i[e])&&(yield r)}}*values(){for(let e of this.#L())this.#i[e]!==void 0&&!this.#m(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#$())this.#i[e]!==void 0&&!this.#m(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let i of this.#L()){let s=this.#i[i],n=this.#m(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#c[i],this))return this.get(this.#c[i],r)}}forEach(e,r=this){for(let i of this.#L()){let s=this.#i[i],n=this.#m(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(r,n,this.#c[i],this)}}rforEach(e,r=this){for(let i of this.#$()){let s=this.#i[i],n=this.#m(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(r,n,this.#c[i],this)}}purgeStale(){let e=!1;for(let r of this.#$({allowStale:!0}))this.#R(r)&&(this.#b(this.#c[r],"expire"),e=!0);return e}info(e){let r=this.#s.get(e);if(r===void 0)return;let i=this.#i[r],s=this.#m(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#E&&this.#x){let a=this.#E[r],o=this.#x[r];if(a&&o){let c=a-(vi.now()-o);n.ttl=c,n.start=Date.now()}}return this.#C&&(n.size=this.#C[r]),n}dump(){let e=[];for(let r of this.#L({allowStale:!0})){let i=this.#c[r],s=this.#i[r],n=this.#m(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let a={value:n};if(this.#E&&this.#x){a.ttl=this.#E[r];let o=vi.now()-this.#x[r];a.start=Math.floor(Date.now()-o)}this.#C&&(a.size=this.#C[r]),e.unshift([i,a])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let s=Date.now()-i.start;i.start=vi.now()-s}this.set(r,i.value,i)}}set(e,r,i={}){if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#B(e,r,i.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#b(e,"set"),this;let d=this.#a===0?void 0:this.#s.get(e);if(d===void 0)d=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#t?this.#T(!1):this.#a,this.#c[d]=e,this.#i[d]=r,this.#s.set(e,d),this.#l[this.#g]=d,this.#o[d]=this.#g,this.#g=d,this.#a++,this.#O(d,u,c),c&&(c.set="add"),l=!1;else{this.#D(d);let g=this.#i[d];if(r!==g){if(this.#S&&this.#m(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=g;h!==void 0&&!a&&(this.#_&&this.#e?.(h,e,"set"),this.#v&&this.#p?.push([h,e,"set"]))}else a||(this.#_&&this.#e?.(g,e,"set"),this.#v&&this.#p?.push([g,e,"set"]));if(this.#N(d),this.#O(d,u,c),this.#i[d]=r,c){c.set="replace";let h=g&&this.#m(g)?g.__staleWhileFetching:g;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update")}if(s!==0&&!this.#E&&this.#P(),this.#E&&(l||this.#M(d,s,n),c&&this.#f(c,d)),!a&&this.#v&&this.#p){let g=this.#p,h;for(;h=g?.shift();)this.#n?.(...h)}return this}pop(){try{for(;this.#a;){let e=this.#i[this.#d];if(this.#T(!0),this.#m(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#v&&this.#p){let e=this.#p,r;for(;r=e?.shift();)this.#n?.(...r)}}}#T(e){let r=this.#d,i=this.#c[r],s=this.#i[r];return this.#S&&this.#m(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(s,i,"evict"),this.#v&&this.#p?.push([s,i,"evict"])),this.#N(r),e&&(this.#c[r]=void 0,this.#i[r]=void 0,this.#y.push(r)),this.#a===1?(this.#d=this.#g=0,this.#y.length=0):this.#d=this.#l[r],this.#s.delete(i),this.#a--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=r,n=this.#s.get(e);if(n!==void 0){let a=this.#i[n];if(this.#m(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#R(n))s&&(s.has="stale",this.#f(s,n));else return i&&this.#A(n),s&&(s.has="hit",this.#f(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,s=this.#s.get(e);if(s===void 0||!i&&this.#R(s))return;let n=this.#i[s];return this.#m(n)?n.__staleWhileFetching:n}#F(e,r,i,s){let n=r===void 0?void 0:this.#i[r];if(this.#m(n))return n;let a=new Hn,{signal:o}=i;o?.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let c={signal:a.signal,options:i,context:s},l=(m,y=!1)=>{let{aborted:b}=a.signal,w=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(b&&!y?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),b&&!w&&!y)return d(a.signal.reason);let x=h;return this.#i[r]===h&&(m===void 0?x.__staleWhileFetching?this.#i[r]=x.__staleWhileFetching:this.#b(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,m,c.options))),m},u=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),d(m)),d=m=>{let{aborted:y}=a.signal,b=y&&i.allowStaleOnFetchAbort,w=b||i.allowStaleOnFetchRejection,x=w||i.noDeleteOnFetchRejection,f=h;if(this.#i[r]===h&&(!x||f.__staleWhileFetching===void 0?this.#b(e,"fetch"):b||(this.#i[r]=f.__staleWhileFetching)),w)return i.status&&f.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw m},g=(m,y)=>{let b=this.#h?.(e,n,c);b&&b instanceof Promise&&b.then(w=>m(w===void 0?void 0:w),y),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=w=>l(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let h=new Promise(g).then(l,u),p=Object.assign(h,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return r===void 0?(this.set(e,p,{...c.options,status:void 0}),r=this.#s.get(e)):this.#i[r]=p,p}#m(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Hn}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:y=!1,status:b,signal:w}=r;if(!this.#S)return b&&(b.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:b});let x={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:o,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:p,ignoreFetchAbort:h,status:b,signal:w},f=this.#s.get(e);if(f===void 0){b&&(b.fetch="miss");let v=this.#F(e,f,x,m);return v.__returned=v}else{let v=this.#i[f];if(this.#m(v)){let $=i&&v.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",$&&(b.returnedStale=!0)),$?v.__staleWhileFetching:v.__returned=v}let E=this.#R(f);if(!y&&!E)return b&&(b.fetch="hit"),this.#D(f),s&&this.#A(f),b&&this.#f(b,f),v;let _=this.#F(e,f,x,m),C=_.__staleWhileFetching!==void 0&&i;return b&&(b.fetch=E?"stale":"refresh",C&&E&&(b.returnedStale=!0)),C?_.__staleWhileFetching:_.__returned=_}}async forceFetch(e,r={}){let i=await this.fetch(e,r);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,r={}){let i=this.#w;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=r,o=this.get(e,a);if(!n&&o!==void 0)return o;let c=i(e,o,{options:a,context:s});return this.set(e,c,a),c}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=r,o=this.#s.get(e);if(o!==void 0){let c=this.#i[o],l=this.#m(c);return a&&this.#f(a,o),this.#R(o)?(a&&(a.get="stale"),l?(a&&i&&c.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?c.__staleWhileFetching:void 0):(n||this.#b(e,"expire"),a&&i&&(a.returnedStale=!0),i?c:void 0)):(a&&(a.get="hit"),l?c.__staleWhileFetching:(this.#D(o),s&&this.#A(o),c))}else a&&(a.get="miss")}#j(e,r){this.#o[r]=e,this.#l[e]=r}#D(e){e!==this.#g&&(e===this.#d?this.#d=this.#l[e]:this.#j(this.#o[e],this.#l[e]),this.#j(this.#g,e),this.#g=e)}delete(e){return this.#b(e,"delete")}#b(e,r){let i=!1;if(this.#a!==0){let s=this.#s.get(e);if(s!==void 0)if(i=!0,this.#a===1)this.#G(r);else{this.#N(s);let n=this.#i[s];if(this.#m(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(n,e,r),this.#v&&this.#p?.push([n,e,r])),this.#s.delete(e),this.#c[s]=void 0,this.#i[s]=void 0,s===this.#g)this.#g=this.#o[s];else if(s===this.#d)this.#d=this.#l[s];else{let a=this.#o[s];this.#l[a]=this.#l[s];let o=this.#l[s];this.#o[o]=this.#o[s]}this.#a--,this.#y.push(s)}}if(this.#v&&this.#p?.length){let s=this.#p,n;for(;n=s?.shift();)this.#n?.(...n)}return i}clear(){return this.#G("delete")}#G(e){for(let r of this.#$({allowStale:!0})){let i=this.#i[r];if(this.#m(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#c[r];this.#_&&this.#e?.(i,s,e),this.#v&&this.#p?.push([i,s,e])}}if(this.#s.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#E&&this.#x&&(this.#E.fill(0),this.#x.fill(0)),this.#C&&this.#C.fill(0),this.#d=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#v&&this.#p){let r=this.#p,i;for(;i=r?.shift();)this.#n?.(...i)}}};import{posix as DL,win32 as fl}from"node:path";import{fileURLToPath as ML}from"node:url";import{lstatSync as kL,readdir as jL,readdirSync as BL,readlinkSync as UL,realpathSync as GL}from"fs";import*as zL from"node:fs";import{lstat as WL,readdir as VL,readlink as HL,realpath as KL}from"node:fs/promises";import{EventEmitter as ll}from"node:events";import a0 from"node:stream";import{StringDecoder as CL}from"node:string_decoder";var i0=typeof process=="object"&&process?process:{stdout:null,stderr:null},AL=t=>!!t&&typeof t=="object"&&(t instanceof Jt||t instanceof a0||LL(t)||OL(t)),LL=t=>!!t&&typeof t=="object"&&t instanceof ll&&typeof t.pipe=="function"&&t.pipe!==a0.Writable.prototype.pipe,OL=t=>!!t&&typeof t=="object"&&t instanceof ll&&typeof t.write=="function"&&typeof t.end=="function",Dt=Symbol("EOF"),Mt=Symbol("maybeEmitEnd"),Xt=Symbol("emittedEnd"),Kn=Symbol("emittingEnd"),vs=Symbol("emittedError"),Yn=Symbol("closed"),s0=Symbol("read"),Xn=Symbol("flush"),n0=Symbol("flushChunk"),mt=Symbol("encoding"),xi=Symbol("decoder"),Ce=Symbol("flowing"),ws=Symbol("paused"),Ei=Symbol("resume"),Ae=Symbol("buffer"),qe=Symbol("pipes"),Le=Symbol("bufferLength"),il=Symbol("bufferPush"),Jn=Symbol("bufferShift"),ke=Symbol("objectMode"),Ee=Symbol("destroyed"),sl=Symbol("error"),nl=Symbol("emitData"),o0=Symbol("emitEnd"),ol=Symbol("emitEnd2"),_t=Symbol("async"),al=Symbol("abort"),Zn=Symbol("aborted"),xs=Symbol("signal"),Nr=Symbol("dataListeners"),Xe=Symbol("discarded"),Es=t=>Promise.resolve().then(t),$L=t=>t(),TL=t=>t==="end"||t==="finish"||t==="prefinish",PL=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,IL=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Qn=class{src;dest;opts;ondrain;constructor(e,r,i){this.src=e,this.dest=r,this.opts=i,this.ondrain=()=>e[Ei](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},cl=class extends Qn{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,i){super(e,r,i),this.proxyErrors=s=>r.emit("error",s),e.on("error",this.proxyErrors)}},FL=t=>!!t.objectMode,NL=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Jt=class extends ll{[Ce]=!1;[ws]=!1;[qe]=[];[Ae]=[];[ke];[mt];[_t];[xi];[Dt]=!1;[Xt]=!1;[Kn]=!1;[Yn]=!1;[vs]=null;[Le]=0;[Ee]=!1;[xs];[Zn]=!1;[Nr]=0;[Xe]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");FL(r)?(this[ke]=!0,this[mt]=null):NL(r)?(this[mt]=r.encoding,this[ke]=!1):(this[ke]=!1,this[mt]=null),this[_t]=!!r.async,this[xi]=this[mt]?new CL(this[mt]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Ae]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[qe]});let{signal:i}=r;i&&(this[xs]=i,i.aborted?this[al]():i.addEventListener("abort",()=>this[al]()))}get bufferLength(){return this[Le]}get encoding(){return this[mt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ke]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[_t]}set async(e){this[_t]=this[_t]||!!e}[al](){this[Zn]=!0,this.emit("abort",this[xs]?.reason),this.destroy(this[xs]?.reason)}get aborted(){return this[Zn]}set aborted(e){}write(e,r,i){if(this[Zn])return!1;if(this[Dt])throw new Error("write after end");if(this[Ee])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(i=r,r="utf8"),r||(r="utf8");let s=this[_t]?Es:$L;if(!this[ke]&&!Buffer.isBuffer(e)){if(IL(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(PL(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ke]?(this[Ce]&&this[Le]!==0&&this[Xn](!0),this[Ce]?this.emit("data",e):this[il](e),this[Le]!==0&&this.emit("readable"),i&&s(i),this[Ce]):e.length?(typeof e=="string"&&!(r===this[mt]&&!this[xi]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[mt]&&(e=this[xi].write(e)),this[Ce]&&this[Le]!==0&&this[Xn](!0),this[Ce]?this.emit("data",e):this[il](e),this[Le]!==0&&this.emit("readable"),i&&s(i),this[Ce]):(this[Le]!==0&&this.emit("readable"),i&&s(i),this[Ce])}read(e){if(this[Ee])return null;if(this[Xe]=!1,this[Le]===0||e===0||e&&e>this[Le])return this[Mt](),null;this[ke]&&(e=null),this[Ae].length>1&&!this[ke]&&(this[Ae]=[this[mt]?this[Ae].join(""):Buffer.concat(this[Ae],this[Le])]);let r=this[s0](e||null,this[Ae][0]);return this[Mt](),r}[s0](e,r){if(this[ke])this[Jn]();else{let i=r;e===i.length||e===null?this[Jn]():typeof i=="string"?(this[Ae][0]=i.slice(e),r=i.slice(0,e),this[Le]-=e):(this[Ae][0]=i.subarray(e),r=i.subarray(0,e),this[Le]-=e)}return this.emit("data",r),!this[Ae].length&&!this[Dt]&&this.emit("drain"),r}end(e,r,i){return typeof e=="function"&&(i=e,e=void 0),typeof r=="function"&&(i=r,r="utf8"),e!==void 0&&this.write(e,r),i&&this.once("end",i),this[Dt]=!0,this.writable=!1,(this[Ce]||!this[ws])&&this[Mt](),this}[Ei](){this[Ee]||(!this[Nr]&&!this[qe].length&&(this[Xe]=!0),this[ws]=!1,this[Ce]=!0,this.emit("resume"),this[Ae].length?this[Xn]():this[Dt]?this[Mt]():this.emit("drain"))}resume(){return this[Ei]()}pause(){this[Ce]=!1,this[ws]=!0,this[Xe]=!1}get destroyed(){return this[Ee]}get flowing(){return this[Ce]}get paused(){return this[ws]}[il](e){this[ke]?this[Le]+=1:this[Le]+=e.length,this[Ae].push(e)}[Jn](){return this[ke]?this[Le]-=1:this[Le]-=this[Ae][0].length,this[Ae].shift()}[Xn](e=!1){do;while(this[n0](this[Jn]())&&this[Ae].length);!e&&!this[Ae].length&&!this[Dt]&&this.emit("drain")}[n0](e){return this.emit("data",e),this[Ce]}pipe(e,r){if(this[Ee])return e;this[Xe]=!1;let i=this[Xt];return r=r||{},e===i0.stdout||e===i0.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,i?r.end&&e.end():(this[qe].push(r.proxyErrors?new cl(this,e,r):new Qn(this,e,r)),this[_t]?Es(()=>this[Ei]()):this[Ei]()),e}unpipe(e){let r=this[qe].find(i=>i.dest===e);r&&(this[qe].length===1?(this[Ce]&&this[Nr]===0&&(this[Ce]=!1),this[qe]=[]):this[qe].splice(this[qe].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let i=super.on(e,r);if(e==="data")this[Xe]=!1,this[Nr]++,!this[qe].length&&!this[Ce]&&this[Ei]();else if(e==="readable"&&this[Le]!==0)super.emit("readable");else if(TL(e)&&this[Xt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[vs]){let s=r;this[_t]?Es(()=>s.call(this,this[vs])):s.call(this,this[vs])}return i}removeListener(e,r){return this.off(e,r)}off(e,r){let i=super.off(e,r);return e==="data"&&(this[Nr]=this.listeners("data").length,this[Nr]===0&&!this[Xe]&&!this[qe].length&&(this[Ce]=!1)),i}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Nr]=0,!this[Xe]&&!this[qe].length&&(this[Ce]=!1)),r}get emittedEnd(){return this[Xt]}[Mt](){!this[Kn]&&!this[Xt]&&!this[Ee]&&this[Ae].length===0&&this[Dt]&&(this[Kn]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Yn]&&this.emit("close"),this[Kn]=!1)}emit(e,...r){let i=r[0];if(e!=="error"&&e!=="close"&&e!==Ee&&this[Ee])return!1;if(e==="data")return!this[ke]&&!i?!1:this[_t]?(Es(()=>this[nl](i)),!0):this[nl](i);if(e==="end")return this[o0]();if(e==="close"){if(this[Yn]=!0,!this[Xt]&&!this[Ee])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[vs]=i,super.emit(sl,i);let n=!this[xs]||this.listeners("error").length?super.emit("error",i):!1;return this[Mt](),n}else if(e==="resume"){let n=super.emit("resume");return this[Mt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,...r);return this[Mt](),s}[nl](e){for(let i of this[qe])i.dest.write(e)===!1&&this.pause();let r=this[Xe]?!1:super.emit("data",e);return this[Mt](),r}[o0](){return this[Xt]?!1:(this[Xt]=!0,this.readable=!1,this[_t]?(Es(()=>this[ol]()),!0):this[ol]())}[ol](){if(this[xi]){let r=this[xi].end();if(r){for(let i of this[qe])i.dest.write(r);this[Xe]||super.emit("data",r)}}for(let r of this[qe])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ke]||(e.dataLength=0);let r=this.promise();return this.on("data",i=>{e.push(i),this[ke]||(e.dataLength+=i.length)}),await r,e}async concat(){if(this[ke])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[mt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Ee,()=>r(new Error("stream destroyed"))),this.on("error",i=>r(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Xe]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[Dt])return r();let n,a,o=d=>{this.off("data",c),this.off("end",l),this.off(Ee,u),r(),a(d)},c=d=>{this.off("error",o),this.off("end",l),this.off(Ee,u),this.pause(),n({value:d,done:!!this[Dt]})},l=()=>{this.off("error",o),this.off("data",c),this.off(Ee,u),r(),n({done:!0,value:void 0})},u=()=>o(new Error("stream destroyed"));return new Promise((d,g)=>{a=g,n=d,this.once(Ee,u),this.once("error",o),this.once("end",l),this.once("data",c)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Xe]=!1;let e=!1,r=()=>(this.pause(),this.off(sl,r),this.off(Ee,r),this.off("end",r),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return r();let s=this.read();return s===null?r():{done:!1,value:s}};return this.once("end",r),this.once(sl,r),this.once(Ee,r),{next:i,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Ee])return e?this.emit("error",e):this.emit(Ee),this;this[Ee]=!0,this[Xe]=!0,this[Ae].length=0,this[Le]=0;let r=this;return typeof r.close=="function"&&!this[Yn]&&r.close(),e?this.emit("error",e):this.emit(Ee),this}static get isStream(){return AL}};var qL=GL.native,Ss={lstatSync:kL,readdir:jL,readdirSync:BL,readlinkSync:UL,realpathSync:qL,promises:{lstat:WL,readdir:VL,readlink:HL,realpath:KL}},f0=t=>!t||t===Ss||t===zL?Ss:{...Ss,...t,promises:{...Ss.promises,...t.promises||{}}},p0=/^\\\\\?\\([a-z]:)\\?$/i,YL=t=>t.replace(/\//g,"\\").replace(p0,"$1\\"),XL=/[\\\/]/,ct=0,d0=1,m0=2,St=4,g0=6,y0=8,Dr=10,b0=12,at=15,_s=~at,ul=16,c0=32,Rs=64,gt=128,eo=256,ro=512,l0=Rs|gt|ro,JL=1023,hl=t=>t.isFile()?y0:t.isDirectory()?St:t.isSymbolicLink()?Dr:t.isCharacterDevice()?m0:t.isBlockDevice()?g0:t.isSocket()?b0:t.isFIFO()?d0:ct,u0=new Map,Cs=t=>{let e=u0.get(t);if(e)return e;let r=t.normalize("NFKD");return u0.set(t,r),r},h0=new Map,to=t=>{let e=h0.get(t);if(e)return e;let r=Cs(t.toLowerCase());return h0.set(t,r),r},io=class extends bs{constructor(){super({max:256})}},pl=class extends bs{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},v0=Symbol("PathScurry setAsCwd"),je=class{name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#e;get mode(){return this.#e}#n;get nlink(){return this.#n}#h;get uid(){return this.#h}#w;get gid(){return this.#w}#a;get rdev(){return this.#a}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#c;get size(){return this.#c}#i;get blocks(){return this.#i}#l;get atimeMs(){return this.#l}#o;get mtimeMs(){return this.#o}#d;get ctimeMs(){return this.#d}#g;get birthtimeMs(){return this.#g}#y;get atime(){return this.#y}#p;get mtime(){return this.#p}#C;get ctime(){return this.#C}#x;get birthtime(){return this.#x}#E;#_;#S;#v;#P;#A;#f;#M;#R;#I;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=ct,i,s,n,a,o){this.name=e,this.#E=n?to(e):Cs(e),this.#f=r&JL,this.nocase=n,this.roots=s,this.root=i||this,this.#M=a,this.#S=o.fullpath,this.#P=o.relative,this.#A=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=f0(o.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#M}resolve(e){if(!e)return this;let r=this.getRootString(e),s=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#N(s):this.#N(s)}#N(e){let r=this;for(let i of e)r=r.child(i);return r}children(){let e=this.#M.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#M.set(this,r),this.#f&=~ul,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),s=this.nocase?to(e):Cs(e);for(let c of i)if(c.#E===s)return c;let n=this.parent?this.sep:"",a=this.#S?this.#S+n+e:void 0,o=this.newChild(e,ct,{...r,parent:this,fullpath:a});return this.canReaddir()||(o.#f|=gt),i.push(o),o}relative(){if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let e=this.name,r=this.parent;if(!r)return this.#P=this.name;let i=r.relative();return i+(!i||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,r=this.parent;if(!r)return this.#A=this.fullpathPosix();let i=r.relativePosix();return i+(!i||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let s=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=s}fullpathPosix(){if(this.#v!==void 0)return this.#v;if(this.sep==="/")return this.#v=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#v=`//?/${s}`:this.#v=s}let e=this.parent,r=e.fullpathPosix(),i=r+(!r||!e.parent?"":"/")+this.name;return this.#v=i}isUnknown(){return(this.#f&at)===ct}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#f&at)===y0}isDirectory(){return(this.#f&at)===St}isCharacterDevice(){return(this.#f&at)===m0}isBlockDevice(){return(this.#f&at)===g0}isFIFO(){return(this.#f&at)===d0}isSocket(){return(this.#f&at)===b0}isSymbolicLink(){return(this.#f&Dr)===Dr}lstatCached(){return this.#f&c0?this:void 0}readlinkCached(){return this.#R}realpathCached(){return this.#I}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#R)return!0;if(!this.parent)return!1;let e=this.#f&at;return!(e!==ct&&e!==Dr||this.#f&eo||this.#f>)}calledReaddir(){return!!(this.#f&ul)}isENOENT(){return!!(this.#f>)}isNamed(e){return this.nocase?this.#E===to(e):this.#E===Cs(e)}async readlink(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#t.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(r);if(i)return this.#R=i}catch(r){this.#m(r.code);return}}readlinkSync(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#t.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(r);if(i)return this.#R=i}catch(r){this.#m(r.code);return}}#O(e){this.#f|=ul;for(let r=e.provisional;r<e.length;r++){let i=e[r];i&&i.#B()}}#B(){this.#f>||(this.#f=(this.#f|gt)&_s,this.#L())}#L(){let e=this.children();e.provisional=0;for(let r of e)r.#B()}#$(){this.#f|=ro,this.#k()}#k(){if(this.#f&Rs)return;let e=this.#f;(e&at)===St&&(e&=_s),this.#f=e|Rs,this.#L()}#T(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#B():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#B()}#m(e=""){let r=this.#f;r|=eo,e==="ENOENT"&&(r|=gt),(e==="EINVAL"||e==="UNKNOWN")&&(r&=_s),this.#f=r,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#j(e,r){return this.#b(e,r)||this.#D(e,r)}#D(e,r){let i=hl(e),s=this.newChild(e.name,i,{parent:this}),n=s.#f&at;return n!==St&&n!==Dr&&n!==ct&&(s.#f|=Rs),r.unshift(s),r.provisional++,s}#b(e,r){for(let i=r.provisional;i<r.length;i++){let s=r[i];if((this.nocase?to(e.name):Cs(e.name))===s.#E)return this.#G(e,s,i,r)}}#G(e,r,i,s){let n=r.name;return r.#f=r.#f&_s|hl(e),n!==e.name&&(r.name=e.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(r)),s.provisional++,r}async lstat(){if((this.#f>)===0)try{return this.#z(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if((this.#f>)===0)try{return this.#z(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#z(e){let{atime:r,atimeMs:i,birthtime:s,birthtimeMs:n,blksize:a,blocks:o,ctime:c,ctimeMs:l,dev:u,gid:d,ino:g,mode:h,mtime:p,mtimeMs:m,nlink:y,rdev:b,size:w,uid:x}=e;this.#y=r,this.#l=i,this.#x=s,this.#g=n,this.#u=a,this.#i=o,this.#C=c,this.#d=l,this.#r=u,this.#w=d,this.#s=g,this.#e=h,this.#p=p,this.#o=m,this.#n=y,this.#a=b,this.#c=w,this.#h=x;let f=hl(e);this.#f=this.#f&_s|f|c0,f!==ct&&f!==St&&f!==Dr&&(this.#f|=Rs)}#U=[];#q=!1;#V(e){this.#q=!1;let r=this.#U.slice();this.#U.length=0,r.forEach(i=>i(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let n=i.slice(0,i.provisional);r?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#U.push(e),this.#q)return;this.#q=!0;let s=this.fullpath();this.#t.readdir(s,{withFileTypes:!0},(n,a)=>{if(n)this.#T(n.code),i.provisional=0;else{for(let o of a)this.#j(o,i);this.#O(i)}this.#V(i.slice(0,i.provisional))})}#W;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#W)await this.#W;else{let i=()=>{};this.#W=new Promise(s=>i=s);try{for(let s of await this.#t.promises.readdir(r,{withFileTypes:!0}))this.#j(s,e);this.#O(e)}catch(s){this.#T(s.code),e.provisional=0}this.#W=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let i of this.#t.readdirSync(r,{withFileTypes:!0}))this.#j(i,e);this.#O(e)}catch(i){this.#T(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#f&l0)return!1;let e=at&this.#f;return e===ct||e===St||e===Dr}shouldWalk(e,r){return(this.#f&St)===St&&!(this.#f&l0)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#I)return this.#I;if(!((ro|eo|gt)&this.#f))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#I=this.resolve(e)}catch{this.#$()}}realpathSync(){if(this.#I)return this.#I;if(!((ro|eo|gt)&this.#f))try{let e=this.#t.realpathSync(this.fullpath());return this.#I=this.resolve(e)}catch{this.#$()}}[v0](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),i=[],s=this;for(;s&&s.parent;)r.add(s),s.#P=i.join(this.sep),s.#A=i.join("/"),s=s.parent,i.push("..");for(s=e;s&&s.parent&&!r.has(s);)s.#P=void 0,s.#A=void 0,s=s.parent}},so=class t extends je{sep="\\";splitSep=XL;constructor(e,r=ct,i,s,n,a,o){super(e,r,i,s,n,a,o)}newChild(e,r=ct,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return fl.parse(e).root}getRoot(e){if(e=YL(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,i]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=i;return this.roots[e]=new _i(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(p0,"$1\\"),e===r}},no=class t extends je{splitSep="/";sep="/";constructor(e,r=ct,i,s,n,a,o){super(e,r,i,s,n,a,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=ct,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}},oo=class{root;rootPath;roots;cwd;#t;#r;#e;nocase;#n;constructor(e=process.cwd(),r,i,{nocase:s,childrenCacheSize:n=16*1024,fs:a=Ss}={}){this.#n=f0(a),(e instanceof URL||e.startsWith("file://"))&&(e=ML(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new io,this.#r=new io,this.#e=new pl(n);let c=o.substring(this.rootPath.length).split(i);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=r.sep,g=this.rootPath,h=!1;for(let p of c){let m=u--;l=l.child(p,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:g+=(h?"":d)+p}),h=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#e}resolve(...e){let r="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#t.get(r);if(i!==void 0)return i;let s=this.cwd.resolve(r).fullpath();return this.#t.set(r,s),s}resolvePosix(...e){let r="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#r.get(r);if(i!==void 0)return i;let s=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i}=r;if(e.canReaddir()){let s=await e.readdir();return i?s:s.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0}=r;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=await e.readlink();return r?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return r?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=await e.realpath();return r?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return r?i:i?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=[];(!n||n(e))&&o.push(i?e:e.fullpath());let c=new Set,l=(d,g)=>{c.add(d),d.readdirCB((h,p)=>{if(h)return g(h);let m=p.length;if(!m)return g();let y=()=>{--m===0&&g()};for(let b of p)(!n||n(b))&&o.push(i?b:b.fullpath()),s&&b.isSymbolicLink()?b.realpath().then(w=>w?.isUnknown()?w.lstat():w).then(w=>w?.shouldWalk(c,a)?l(w,y):y()):b.shouldWalk(c,a)?l(b,y):y()},!0)},u=e;return new Promise((d,g)=>{l(u,h=>{if(h)return g(h);d(o)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=[];(!n||n(e))&&o.push(i?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!n||n(d))&&o.push(i?d:d.fullpath());let g=d;if(d.isSymbolicLink()){if(!(s&&(g=d.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(c,a)&&c.add(g)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r;(!n||n(e))&&(yield i?e:e.fullpath());let o=new Set([e]);for(let c of o){let l=c.readdirSync();for(let u of l){(!n||n(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(o,a)&&o.add(d)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=new Jt({objectMode:!0});(!n||n(e))&&o.write(i?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let g=!1;for(;!g;){let h=l.shift();if(!h){u===0&&o.end();return}u++,c.add(h);let p=(y,b,w=!1)=>{if(y)return o.emit("error",y);if(s&&!w){let x=[];for(let f of b)f.isSymbolicLink()&&x.push(f.realpath().then(v=>v?.isUnknown()?v.lstat():v));if(x.length){Promise.all(x).then(()=>p(null,b,!0));return}}for(let x of b)x&&(!n||n(x))&&(o.write(i?x:x.fullpath())||(g=!0));u--;for(let x of b){let f=x.realpathCached()||x;f.shouldWalk(c,a)&&l.push(f)}g&&!o.flowing?o.once("drain",d):m||d()},m=!0;h.readdirCB(p,!0),m=!1}};return d(),o}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=new Jt({objectMode:!0}),c=new Set;(!n||n(e))&&o.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let g=!1;for(;!g;){let h=l.shift();if(!h){u===0&&o.end();return}u++,c.add(h);let p=h.readdirSync();for(let m of p)(!n||n(m))&&(o.write(i?m:m.fullpath())||(g=!0));u--;for(let m of p){let y=m;if(m.isSymbolicLink()){if(!(s&&(y=m.realpathSync())))continue;y.isUnknown()&&y.lstatSync()}y.shouldWalk(c,a)&&l.push(y)}}g&&!o.flowing&&o.once("drain",d)};return d(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[v0](r)}},_i=class extends oo{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,fl,"\\",{...r,nocase:i}),this.nocase=i;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return fl.parse(e).root.toUpperCase()}newRoot(e){return new so(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Si=class extends oo{sep="/";constructor(e=process.cwd(),r={}){let{nocase:i=!1}=r;super(e,DL,"/",{...r,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new no(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},As=class extends Si{constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,{...r,nocase:i})}},kF=process.platform==="win32"?so:no,w0=process.platform==="win32"?_i:process.platform==="darwin"?As:Si;var ZL=t=>t.length>=1,QL=t=>t.length>=1,Ri=class t{#t;#r;#e;length;#n;#h;#w;#a;#u;#s;#c=!0;constructor(e,r,i,s){if(!ZL(e))throw new TypeError("empty pattern list");if(!QL(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=r,this.#e=i,this.#n=s,this.#e===0){if(this.isUNC()){let[n,a,o,c,...l]=this.#t,[u,d,g,h,...p]=this.#r;l[0]===""&&(l.shift(),p.shift());let m=[n,a,o,c,""].join("/"),y=[u,d,g,h,""].join("/");this.#t=[m,...l],this.#r=[y,...p],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#t,[o,...c]=this.#r;a[0]===""&&(a.shift(),c.shift());let l=n+"/",u=o+"/";this.#t=[l,...a],this.#r=[u,...c],this.length=this.#t.length}}}pattern(){return this.#t[this.#e]}isString(){return typeof this.#t[this.#e]=="string"}isGlobstar(){return this.#t[this.#e]===Pe}isRegExp(){return this.#t[this.#e]instanceof RegExp}globString(){return this.#w=this.#w||(this.#e===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#e).join("/"))}hasMore(){return this.length>this.#e+1}rest(){return this.#h!==void 0?this.#h:this.hasMore()?(this.#h=new t(this.#t,this.#r,this.#e+1,this.#n),this.#h.#s=this.#s,this.#h.#u=this.#u,this.#h.#a=this.#a,this.#h):this.#h=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#n==="win32"&&this.#e===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#e===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#s!==void 0?this.#s:this.#s=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#e===0?e:""}checkFollowGlobstar(){return!(this.#e===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#e===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var eO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ci=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:i,noext:s,noglobstar:n,platform:a=eO}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:r,nocase:i,noext:s,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let o of e)this.add(o)}add(e){let r=new Ye(e,this.mmopts);for(let i=0;i<r.set.length;i++){let s=r.set[i],n=r.globParts[i];if(!s||!n)throw new Error("invalid pattern object");for(;s[0]==="."&&n[0]===".";)s.shift(),n.shift();let a=new Ri(s,n,0,this.platform),o=new Ye(a.globString(),this.mmopts),c=n[n.length-1]==="**",l=a.isAbsolute();l?this.absolute.push(o):this.relative.push(o),c&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(e){let r=e.fullpath(),i=`${r}/`,s=e.relative()||".",n=`${s}/`;for(let a of this.relative)if(a.match(s)||a.match(n))return!0;for(let a of this.absolute)if(a.match(r)||a.match(i))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return!0;for(let s of this.absoluteChildren)if(s.match(r))return!0;return!1}};var dl=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let i=e.fullpath(),s=this.store.get(i);s?s.add(r.globString()):this.store.set(i,new Set([r.globString()]))}},ml=class{store=new Map;add(e,r,i){let s=(r?2:0)|(i?1:0),n=this.store.get(e);this.store.set(e,n===void 0?s:s&n)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},gl=class{store=new Map;add(e,r){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(s=>s.globString()===r.globString())||i.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Ls=class t{hasWalkedCache;matches=new ml;subwalks=new gl;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new dl}processPatterns(e,r){this.patterns=r;let i=r.map(s=>[e,s]);for(let[s,n]of i){this.hasWalkedCache.storeWalked(s,n);let a=n.root(),o=n.isAbsolute()&&this.opts.absolute!==!1;if(a){s=s.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let d=n.rest();if(d)n=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=n.pattern())=="string"&&(l=n.rest());)s=s.resolve(c),n=l,u=!0;if(c=n.pattern(),l=n.rest(),u){if(this.hasWalkedCache.hasWalked(s,n))continue;this.hasWalkedCache.storeWalked(s,n)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),o,d);continue}else if(c===Pe){(!s.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(s,n);let d=l?.pattern(),g=l?.rest();if(!l||(d===""||d===".")&&!g)this.matches.add(s,o,d===""||d===".");else if(d===".."){let h=s.parent||s;g?this.hasWalkedCache.hasWalked(h,g)||this.subwalks.add(h,g):this.matches.add(h,o,!0)}}else c instanceof RegExp&&this.subwalks.add(s,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let i=this.subwalks.get(e),s=this.child();for(let n of r)for(let a of i){let o=a.isAbsolute(),c=a.pattern(),l=a.rest();c===Pe?s.testGlobstar(n,a,l,o):c instanceof RegExp?s.testRegExp(n,c,l,o):s.testString(n,c,l,o)}return s}testGlobstar(e,r,i,s){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(i&&r.checkFollowGlobstar()?this.subwalks.add(e,i):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),i){let n=i.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,i.rest(),s);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,i)}else n instanceof RegExp&&this.testRegExp(e,n,i.rest(),s)}}testRegExp(e,r,i,s){r.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,s,!1))}testString(e,r,i,s){e.isNamed(r)&&(i?this.subwalks.add(e,i):this.matches.add(e,s,!1))}};var tO=(t,e)=>typeof t=="string"?new Ci([t],e):Array.isArray(t)?new Ci(t,e):t,ao=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#e;signal;maxDepth;includeChildMatches;constructor(e,r,i){if(this.patterns=e,this.path=r,this.opts=i,this.#e=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#r=tO(i.ignore??[],i),!this.includeChildMatches&&typeof this.#r.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#n(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#h(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#r?.add){let n=`${e.relativePosix()}/**`;this.#r.add(n)}let i=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#e:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+s)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#e)?"."+this.#e:"";this.matchEmit(n?a+n+s:"."+s)}}async match(e,r,i){let s=await this.matchCheck(e,i);s&&this.matchFinish(s,r)}matchSync(e,r,i){let s=this.matchCheckSync(e,i);s&&this.matchFinish(s,r)}walkCB(e,r,i){this.signal?.aborted&&i(),this.walkCB2(e,r,new Ls(this.opts),i)}walkCB2(e,r,i,s){if(this.#h(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,r,i,s));return}i.processPatterns(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||(n++,this.match(o,c,l).then(()=>a()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let c=o.readdirCached();o.calledReaddir()?this.walkCB3(o,c,i,a):o.readdirCB((l,u)=>this.walkCB3(o,u,i,a),!0)}a()}walkCB3(e,r,i,s){i=i.filterEntries(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||(n++,this.match(o,c,l).then(()=>a()));for(let[o,c]of i.subwalks.entries())n++,this.walkCB2(o,c,i.child(),a);a()}walkCBSync(e,r,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,r,new Ls(this.opts),i)}walkCB2Sync(e,r,i,s){if(this.#h(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,i,s));return}i.processPatterns(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||this.matchSync(o,c,l);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let c=o.readdirSync();this.walkCB3Sync(o,c,i,a)}a()}walkCB3Sync(e,r,i,s){i=i.filterEntries(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||this.matchSync(o,c,l);for(let[o,c]of i.subwalks.entries())n++,this.walkCB2Sync(o,c,i.child(),a);a()}},Os=class extends ao{matches=new Set;constructor(e,r,i){super(e,r,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},$s=class extends ao{results;constructor(e,r,i){super(e,r,i),this.results=new Jt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var iO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",yt=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=rO(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=r.platform||iO,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=r.platform==="win32"?_i:r.platform==="darwin"?As:r.platform?Si:w0;this.scurry=new c(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(c=>new Ye(c,s)),[a,o]=n.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=a.map((c,l)=>{let u=o[l];if(!u)throw new Error("invalid pattern object");return new Ri(c,u,0,this.platform)})}async walk(){return[...await new Os(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Os(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new $s(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new $s(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var yl=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Ye(r,e).hasMagic())return!0;return!1};function co(t,e={}){return new yt(t,e).streamSync()}function E0(t,e={}){return new yt(t,e).stream()}function _0(t,e={}){return new yt(t,e).walkSync()}async function x0(t,e={}){return new yt(t,e).walk()}function lo(t,e={}){return new yt(t,e).iterateSync()}function S0(t,e={}){return new yt(t,e).iterate()}var sO=co,nO=Object.assign(E0,{sync:co}),oO=lo,aO=Object.assign(S0,{sync:lo}),cO=Object.assign(_0,{stream:co,iterate:lo}),Zt=Object.assign(x0,{glob:x0,globSync:_0,sync:cO,globStream:E0,stream:nO,globStreamSync:co,streamSync:sO,globIterate:S0,iterate:aO,globIterateSync:lo,iterateSync:oO,Glob:yt,hasMagic:yl,escape:bi,unescape:dt});Zt.glob=Zt;function bl(t,e){let{changedFiles:r}=e;return r.some(i=>t===i||t.endsWith(i)||i.endsWith(t))}function lO(t,e,r,i){let{fileChangeMap:s}=i,n=s.get(t);return n?n.status==="added"?!0:n.status==="removed"?!1:uO(n.patch,e,r):!1}function R0(t,e){return bl(t.file.path,e)&&lO(t.file.path,t.range.start.line,t.range.end.line,e)}function uO(t,e,r){let i=t.split(`
|
|
51
|
+
`),s=0,n=!1;for(let a of i){let o=a.match(/^@@\s+-\d+(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);if(o){s=parseInt(o[1],10),n=!0;continue}if(n)if(a.startsWith("+")){if(s>=e&&s<=r)return!0;s++}else{if(a.startsWith("-"))continue;if(!a.startsWith("\\")){if(s>=e&&s<=r)return!0;s++}}}return!1}var F0=We(po(),1);function Qt(t,e){return e.length===0?!1:(0,F0.default)().add(e).ignores(t)}var mo=class t{environment;_filePaths=[];mode;eventEmitter;config;diffMode;constructor(e,r,i,s){this.environment=r,this.mode=i,this.eventEmitter=s||new nt,this.config=e}static async initialize(e,r,i,s,n,a){let o=new t(e,r,i,s);if(i==="diff"&&!n){let u=o.environment.getWorkspaceRoot(),d=a?.include,g=a?.commitSelector;if(!g||!d)throw new Error("Commit selector and include are required in diff mode");let h=await Um(u,{include:d,commitSelector:g}).catch(p=>{throw new Error(`Error running wispbit in diff mode:
|
|
52
|
+
${p.message}`)});o.diffMode={gitChanges:h,changedFiles:h.files.map(p=>p.filename),fileChangeMap:new Map(h.files.map(p=>[p.filename,p]))},o.eventEmitter.fileDiscoveryProgress(`Found ${o.diffMode.changedFiles.length} changed files`)}let c=i==="check"?await o.loadGitIgnoredFiles():new Set,l=await o.discoverFiles(n,c);return o._filePaths=l,o}get filePaths(){return this._filePaths}filterFiles(e){let r=e.length,i;return this.mode==="check"?i=e:i=e.filter(s=>this.isFileValid({filePath:s})),r!==i.length&&this.eventEmitter.fileFilter(r,i.length,`${this.mode}-mode-files`),i}filterMatches(e){let r=e.length,i=e.filter(s=>this.isMatchValid({match:s}));return r!==i.length&&this.eventEmitter.fileFilter(r,i.length,`${this.mode}-mode-matches`),i}filterMatchesByFilePaths(e,r){if(e.length===0)return e;let i=new Set(r);return e.filter(s=>i.has(s.file.path))}get executionMode(){return this.mode}async loadGitIgnoredFiles(){let e=this.environment.getWorkspaceRoot(),r=await Nm(e).catch(()=>(this.eventEmitter.fileDiscoveryProgress("Not in a git repository, skipping git-ignored files"),[])),i=new Set(r);return r.length>0&&this.eventEmitter.fileDiscoveryProgress(`Found ${r.length} git-ignored files`),i}async discoverFiles(e,r){this.eventEmitter.startFileDiscovery(this.mode);let i;if(e)i=await this.discoverFilesFromPath(e,r);else if(this.mode==="diff"){let s=this.environment.getWorkspaceRoot();i=this.diffMode.changedFiles.filter(a=>Oi.existsSync(jt.resolve(s,a))).map(a=>a);let n=this.config.getIgnoredGlobs();if(n.length>0){this.eventEmitter.fileDiscoveryProgress("Applying ignore patterns...");let a=i.length;i=i.filter(o=>!Qt(o,n)),a!==i.length&&this.eventEmitter.fileDiscoveryProgress(`Filtered out ${a-i.length} ignored files`)}}else{this.eventEmitter.fileDiscoveryProgress("Scanning workspace for files...");let s=this.environment.getWorkspaceRoot(),n=this.config.getIgnoredGlobs();i=await this.discoverAllFiles([s],n,r)}return this.eventEmitter.completeFileDiscovery(i.length,this.mode),i}async discoverFilesFromPath(e,r){let i=this.environment.getWorkspaceRoot(),s=jt.resolve(i,e),n=this.config.getIgnoredGlobs();if(this.isGlobPattern(e))return this.eventEmitter.fileDiscoveryProgress(`Discovering files matching glob pattern: ${e}`),await this.discoverFilesFromGlob(e,n,r);if(!Oi.existsSync(s))throw new Error(`Path not found: ${e}`);let a=Oi.statSync(s);if(a.isFile())return this.eventEmitter.fileDiscoveryProgress(`Checking specific file: ${e}`),r.has(e)?(this.eventEmitter.fileDiscoveryProgress(`File ${e} is ignored by git`),[]):Qt(e,n)?(this.eventEmitter.fileDiscoveryProgress(`File ${e} is ignored by patterns`),[]):[e];if(a.isDirectory())return this.eventEmitter.fileDiscoveryProgress(`Discovering files in directory: ${e}`),await this.discoverFilesFromDirectory(e,n,r);throw new Error(`Path is neither a file nor directory: ${e}`)}isGlobPattern(e){return/[*?[\]{}]/.test(e)}async discoverFilesFromGlob(e,r,i){let s=this.environment.getWorkspaceRoot(),n=["**/node_modules/**","**/.git/**",...r],o=(await Zt(e,{cwd:s,nodir:!0,absolute:!1,ignore:n})).filter(c=>!i.has(c));return this.eventEmitter.fileDiscoveryProgress(`Found ${o.length} files matching pattern`),o}async discoverFilesFromDirectory(e,r,i){let s=this.environment.getWorkspaceRoot(),n=jt.join(e,"**/*").replace(/\\/g,"/"),a=["**/node_modules/**","**/.git/**",...r],c=(await Zt(n,{cwd:s,nodir:!0,absolute:!1,ignore:a})).filter(l=>!i.has(l));return this.eventEmitter.fileDiscoveryProgress(`Found ${c.length} files in directory`),c}async discoverAllFiles(e,r,i){let s=[],n=this.environment.getWorkspaceRoot(),a=["**/node_modules/**","**/.git/**",...r];for(let o of e){if(!Oi.statSync(o).isDirectory()){let d=jt.relative(n,o),g=i.has(d),h=Qt(d,r);!g&&!h&&s.push(d);continue}let u=(await Zt("**/*",{cwd:o,nodir:!0,absolute:!1,ignore:a})).map(d=>{let g=jt.resolve(o,d);return jt.relative(n,g)}).filter(d=>!i.has(d));s.push(...u)}return[...new Set(s)]}isFileValid(e){if(this.mode==="check")return!0;let{filePath:r}=e;return bl(r,{changedFiles:this.diffMode.changedFiles,fileChangeMap:this.diffMode.fileChangeMap})}isMatchValid(e){if(this.mode==="check")return!0;let{match:r}=e;return R0(r,{changedFiles:this.diffMode.changedFiles,fileChangeMap:this.diffMode.fileChangeMap})}};import*as $i from"fs";import*as lt from"path";var go=class{environment;constructor(e){this.environment=e}evaluateCondition(e,r){let i=this.environment.getWorkspaceRoot(),s=lt.resolve(i,r);if("fs.siblingExists"in e){let{filename:n}=e["fs.siblingExists"],a=lt.dirname(s),o=lt.join(a,n);return $i.existsSync(o)}if("fs.ancestorHas"in e){let{filename:n}=e["fs.ancestorHas"],a=lt.dirname(s),o=lt.parse(a).root;for(;a!==o;){let c=lt.join(a,n);if($i.existsSync(c))return!0;let l=lt.dirname(a);if(l===a)break;a=l}return!1}if("fs.siblingAny"in e){let{pattern:n}=e["fs.siblingAny"],a=lt.dirname(s);return $i.existsSync(a)?$i.readdirSync(a).some(c=>Qt(c,[n])):!1}return!1}evaluateConditions(e,r){let i=[];return e.all&&e.all.length>0&&i.push(e.all.every(s=>this.evaluateCondition(s,r))),e.any&&e.any.length>0&&i.push(e.any.some(s=>this.evaluateCondition(s,r))),e.not&&e.not.length>0&&i.push(!e.not.some(s=>this.evaluateCondition(s,r))),i.length===0?!0:i.every(s=>s===!0)}async execute(e,r){let i=Date.now(),s=e;r.include?.length&&(s=s.filter(a=>Qt(a,r.include))),r.ignore?.length&&(s=s.filter(a=>!Qt(a,r.ignore))),Object.keys(r.conditions||{}).length>0&&s.length>0&&(s=s.filter(a=>this.evaluateConditions(r.conditions,a)));let n=Date.now()-i;return await Promise.resolve({filteredPaths:s,executionTime:n})}};import jO from"path";var Fs=We(Xc(),1);import{readFile as q0}from"fs/promises";import W0 from"path";import{spawn as FO}from"child_process";import NO from"crypto";import Ti from"fs";import Bt,{dirname as k0,join as j0}from"path";import{promises as TO}from"fs";import ON from"path";async function yo(t){try{return await TO.access(t),!0}catch{return!1}}import{execSync as PO}from"child_process";function Ps(){return PO("which rg").toString().trim()}import bo from"fs";import IO from"path";async function N0(t){try{if(t.includes("/")||t.includes("\\"))return await bo.promises.access(t,bo.constants.X_OK),!0;let e=process.env.PATH||"",r=process.platform==="win32"?";":":",i=e.split(r),s=process.platform==="win32"?(process.env.PATHEXT||".exe;.cmd;.bat").split(";"):[""];for(let n of i)for(let a of s){let o=IO.join(n,t+a);try{return await bo.promises.access(o,bo.constants.X_OK),!0}catch{}}return!1}catch{return!1}}var D0=We(po(),1);function M0(t){let e=t.match(/\{([^}]+)\}/);if(!e)return[t];let r=e[1].split(","),i=t.slice(0,e.index),s=t.slice(e.index+e[0].length),n=[];for(let a of r){let o=i+a+s;n.push(...M0(o))}return n}function Is(t,e){if(e.length===0)return!1;let r=[];for(let s of e)r.push(...M0(s));return(0,D0.default)().add(r).ignores(t)}function vo(t,e){let r=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return t.replace(r,"").replace(/\/\//g,"/")}async function Mr(t){return await new Promise((e,r)=>{let i=NO.createHash("sha256"),s=Ti.createReadStream(t);s.on("error",n=>r(n)),s.on("data",n=>i.update(n)),s.on("end",()=>e(i.digest("hex")))})}function wo(t,e){try{let r=Bt.resolve(t),i=Bt.resolve(t,e),s=Bt.normalize(r),n=Bt.normalize(i);return n===s||n.startsWith(s+Bt.sep)?n:null}catch{return null}}function DO(t,e,r){try{let s=Ti.readFileSync(t,"utf8").split(`
|
|
52
53
|
`),n=Math.max(0,e-1),a=Math.min(s.length,r);if(n===0&&a>=s.length)return s.map((u,d)=>`L${d+1} ${u}`).join(`
|
|
53
54
|
`);let o=s.slice(n,a),c="";n>0&&(c+=`[Lines 1-${n} omitted]
|
|
54
55
|
`);let l=o.map((u,d)=>`L${n+d+1} ${u}`);return c+=l.join(`
|
|
55
56
|
`),a<s.length&&(c+=`
|
|
56
|
-
[Lines ${a+1}-${s.length} omitted]`),c}catch(i){let s=i instanceof Error?i.message:String(i);throw new Error(`Failed to read file ${t}: ${s}`)}}async function B0(t,e,r=[]){let{target_file:i}=t,s=t.offset?parseInt(t.offset?.toString(),10):void 0,n=t.limit?parseInt(t.limit?.toString(),10):void 0,a=i.startsWith("/")?i.slice(1):i;if(Is(a,r))return{error:`File not found or not accessible: ${i}. Please provide the correct path.`};let o=wo(e,a);if(!o)return{error:`Invalid file path: '${i}'`};if(!await yo(o))return{error:`File not found or not accessible: ${i}. Please provide the correct path. It could also have been deleted as part of the PR.`};try{if(s!==void 0&&(Number.isNaN(Number(s))||s<0))return{error:`Invalid offset: ${s}. Offset must be a non-negative number starting from 0.`};if(n!==void 0&&(Number.isNaN(Number(n))||n<1))return{error:`Invalid limit: ${n}. Limit must be a positive number.`};let c=s??1,u=Math.min(n??200,500),d=c+u-1,
|
|
57
|
-
`),o=[];for(let c of a){let l=c.match(/^([^:]+):(\d+):(.*)$/);if(l){let[,u,d,
|
|
58
|
-
`),p=u.line+
|
|
59
|
-
`);for(let n of s){let a=JSON.parse(n);if(a.type!=="match")continue;let o=a.data,c=o.path.text||Buffer.from(o.path.bytes||"","base64").toString("utf-8"),l=Cl.relative(r,c),u=o.lines.text;for(let d of o.submatches){let
|
|
57
|
+
[Lines ${a+1}-${s.length} omitted]`),c}catch(i){let s=i instanceof Error?i.message:String(i);throw new Error(`Failed to read file ${t}: ${s}`)}}async function B0(t,e,r=[]){let{target_file:i}=t,s=t.offset?parseInt(t.offset?.toString(),10):void 0,n=t.limit?parseInt(t.limit?.toString(),10):void 0,a=i.startsWith("/")?i.slice(1):i;if(Is(a,r))return{error:`File not found or not accessible: ${i}. Please provide the correct path.`};let o=wo(e,a);if(!o)return{error:`Invalid file path: '${i}'`};if(!await yo(o))return{error:`File not found or not accessible: ${i}. Please provide the correct path. It could also have been deleted as part of the PR.`};try{if(s!==void 0&&(Number.isNaN(Number(s))||s<0))return{error:`Invalid offset: ${s}. Offset must be a non-negative number starting from 0.`};if(n!==void 0&&(Number.isNaN(Number(n))||n<1))return{error:`Invalid limit: ${n}. Limit must be a positive number.`};let c=s??1,u=Math.min(n??200,500),d=c+u-1,g=DO(o,c,d),h=await Mr(o);return{content:g,sha:h}}catch(c){let l=c.message||String(c);return{error:vo(`Error reading file: ${l}`,e)}}}async function MO(t,e,r,i="."){let s=["--no-config","--line-number","--color=never","--max-columns=300","--max-filesize=1M","--max-count=50","-i"];r&&s.push("-g",r),s.push(e),s.push(i);try{let n=await new Promise((c,l)=>{let u=FO(t,s,{cwd:i,shell:!1,stdio:["ignore","pipe","pipe"],env:{LANG:"C",RIPGREP_CONFIG_PATH:""}}),d="",g="";u.stdout?.on("data",p=>{d+=p.toString()}),u.stderr?.on("data",p=>{g+=p.toString()});let h=setTimeout(()=>{u.kill("SIGTERM"),l(new Error("rg search operation timed out"))},3e4);u.on("close",p=>{clearTimeout(h),p===1&&!g?c({stdout:"",stderr:""}):p===0||p===1&&!g?c({stdout:d,stderr:g}):l(new Error(`ripgrep exited with code ${p}: ${g}`))}),u.on("error",p=>{clearTimeout(h),l(p)})});if(!n.stdout.trim())return[];let a=n.stdout.trim().split(`
|
|
58
|
+
`),o=[];for(let c of a){let l=c.match(/^([^:]+):(\d+):(.*)$/);if(l){let[,u,d,g]=l,h=u;h=Bt.relative(i,u);let p=Bt.join(i,h);try{if(Ti.existsSync(p)){let m=await Mr(p);o.push({file:h,line_number:parseInt(d,10),content:g,sha:m})}}catch{}}}return o}catch(n){let a=n;if(a.code===1&&!a.stderr)return[];throw a.signal==="SIGTERM"?new Error("rg search operation timed out"):n}}async function U0(t,e,r=[],i=Ps()){let{pattern:s,include:n}=t,a=t.path?.startsWith("/")?t.path.slice(1):t.path;try{if(!await N0(i))throw new Error(`ripgrep is not found or not executable: ${i}`);let c=null;if(a){let d=wo(e,a);if(!d)return{error:`Invalid path: '${a}'. Please provide the correct path.`};if(!await yo(d))return{error:`Path not found or not accessible: ${a}. Please provide the correct path.`};let g=await Ti.promises.stat(d);if(g.isFile())c=k0(d),a=k0(a);else if(g.isDirectory())c=d;else return{error:`Path is neither a file nor a directory: ${a}`}}return{matches:(await MO(i,s,n,c||e)).filter(d=>{let g=a?j0(a,d.file):d.file;return!Is(g,r)}).slice(0,50).map(d=>({...d,file:a?j0(a,d.file):d.file}))}}catch(o){let c=typeof o=="object"&&o!==null&&"message"in o&&typeof o.message=="string"?o.message:String(o);return{error:vo(c,e)}}}async function G0(t,e,r=[]){let i=t.pattern,s=t.path;s&&i.startsWith(s)&&(i=i.replace(s,"")),i=i.startsWith("/")?i.slice(1):i;let n;if(s){if(s=s.startsWith("/")?s.slice(1):s,s!=="."&&Is(s,r))return{files:[]};let a=wo(e,s);if(!a)return{error:`Path not found or not accessible: '${s}'. Please provide the correct path.`};n=a}else n=e;if(!await yo(n))return{error:`Directory not found or not accessible: ${s||"."}. Please provide the correct path.`};try{if(!(await Ti.promises.stat(n)).isDirectory())return{error:`Not a directory: ${s||"."}. Please provide the correct path.`}}catch{return{error:`Directory not found or not accessible: ${s||"."}. Please provide the correct path.`}}try{return{files:(await kO(i,s,e)).filter(c=>!Is(c,r)).slice(0,50)}}catch(a){let o=typeof a=="object"&&a!==null&&"message"in a&&typeof a.message=="string"?a.message:String(a);return{error:vo(o,e)}}}async function kO(t,e,r){try{let i;if(e){let a=e.startsWith("/")?e.slice(1):e,o=wo(r,a);if(!o)throw new Error(`Invalid directory path: potential directory traversal detected in '${a}'`);i=o}else i=r;let s=await Zt(t,{cwd:i,nodir:!0,ignore:["node_modules/**",".git/**","**/__pycache__/**"],absolute:!1}),n=[];for(let a of s)try{let o=Bt.join(i,a),c=await Ti.promises.stat(o);c.isFile()&&n.push({path:e?Bt.join(e,a):a,mtime:c.mtime})}catch{}return n.sort((a,o)=>o.mtime.getTime()-a.mtime.getTime()),n.map(a=>a.path)}catch(i){let s=i instanceof Error?i.message:String(i);throw new Error(vo(`Glob search failed: ${s}`,r))}}function z0(t){return{...t,range:{start:{line:t.range.start.line-1,column:t.range.start.column-1},end:{line:t.range.end.line-1,column:t.range.end.column-1}}}}function Rl(t){return{...t,range:{start:{line:t.range.start.line+1,column:t.range.start.column+1},end:{line:t.range.end.line+1,column:t.range.end.column+1}}}}var xo=class{environment;language;constructor(e,r){this.environment=e,this.language=r}async findMatches(e,r){if(e.length===0)return[];let{rule:i,constraints:s}=r,n=this.getBatchSize(),a=[];for(let o=0;o<e.length;o+=n){let c=e.slice(o,o+n),l=await this.processBatch(c,i,s);a.push(...l)}return a}getBatchSize(){let e=parseInt(process.env.UV_THREADPOOL_SIZE||"4",10);return Math.max(2,Math.floor(e/2))}async processBatch(e,r,i){let s=e.map(async c=>{let l=W0.resolve(this.environment.getWorkspaceRoot(),c),u=await q0(l,"utf-8"),g=(await(0,Fs.parseAsync)(this.language,u)).root().findAll({rule:r,language:this.language,constraints:i});if(g.length===0)return[];let h=await Mr(l);return g.map(p=>({filePath:c,sgNode:p,sha:h}))}),a=(await Promise.all(s)).flat(),o=[];for(let{filePath:c,sgNode:l,sha:u}of a){let d=l.range(),g={file:{path:c,sha:u},text:l.text(),range:{start:{line:d.start.line,column:d.start.column},end:{line:d.end.line,column:d.end.column}},language:this.language};o.push(Rl(g))}return o}extractSymbol(e){let r=e.kind();if(r==="call_expression"){let i=e.field("function");if(i)return this.extractSymbol(i)}else if(r==="member_expression"){let i=e.field("property");if(i)return i.text()}else if(r==="identifier")return e.text()}static async validateSchema(e,r,i){let{rule:s,constraints:n}=r;if(!s)return{isValid:!1,error:"Schema must include a 'rule' field"};if(i)try{(await(0,Fs.parseAsync)(e,i)).root().findAll({rule:s,constraints:n})}catch(a){return{isValid:!1,error:`Failed to parse ast-grep schema: ${a instanceof Error?a.message:"Unknown error"}`}}return{isValid:!0}}async expandMatch(e){let r=new Set(["method_definition","function_declaration","function_expression","arrow_function","class_declaration","export_statement","lexical_declaration"]),i=W0.resolve(this.environment.getWorkspaceRoot(),e.file.path),[s,n]=await Promise.all([q0(i,"utf-8"),Mr(i)]),a=(0,Fs.parse)(this.language,s).root(),o=z0(e),c=this.findNodeAtPosition(a,o.range.start.line,o.range.start.column);if(!c)return null;let l=c;for(;l;){let u=l.kind(),d=typeof u=="string"?u:String(u);if(r.has(d)){let g=l.range(),h={file:{path:e.file.path,sha:n},text:l.text(),range:{start:{line:g.start.line,column:g.start.column},end:{line:g.end.line,column:g.end.column}},language:this.language};return Rl(h)}l=l.parent()}return null}findNodeAtPosition(e,r,i){let s=e.range(),n=r>s.start.line||r===s.start.line&&i>=s.start.column,a=r<s.end.line||r===s.end.line&&i<=s.end.column;if(!n||!a)return null;let o=e.children();for(let c of o){let l=this.findNodeAtPosition(c,r,i);if(l)return l}return e}};import{spawn as V0}from"child_process";import Cl from"path";var Eo=class{environment;ripgrepPath;constructor(e){this.environment=e,this.ripgrepPath=Ps()}async findMatches(e,r){if(e.length===0)return[];let i=e.filter(u=>Wn(u)==="Unknown");if(i.length===0)return[];let{rule:s,context:n}=r,{pattern:a}=s,o=await this.executePattern(a,i,n),c=[],l=new Map;for(let u of o){let d=Cl.resolve(this.environment.getWorkspaceRoot(),u.file),g=l.get(u.file);g||(g=await Mr(d),l.set(u.file,g));let h=u.text.split(`
|
|
59
|
+
`),p=u.line+h.length-1,m=h.length===1?u.column+u.text.length:h[h.length-1].length+1;c.push({file:{path:u.file,sha:g},text:u.text,range:{start:{line:u.line,column:u.column},end:{line:p,column:m}},language:"Unknown"})}return c}static async validateSchema(e){let{rule:r}=e;if(!r||!r.pattern)return{isValid:!1,error:"Schema must include a 'rule' object with a 'pattern' field"};let{pattern:i}=r,s=Ps();return await new Promise(n=>{let a=V0(s,["--json","--no-config","--pcre2","-U","--multiline-dotall",i,"/dev/null"],{stdio:["ignore","pipe","pipe"]}),o="";a.stderr?.on("data",c=>{o+=c.toString()}),a.on("close",c=>{n(c===0||c===1?{isValid:!0}:{isValid:!1,error:o.trim()})}),a.on("error",c=>{n({isValid:!1,error:c.message})})})}async expandMatch(e){return await Promise.resolve(null)}async executePattern(e,r,i){let s=this.environment.getWorkspaceRoot(),n=["--no-config","--json","--pcre2","-U","--multiline-dotall"];i!==void 0&&i>0&&n.push("-C",i.toString()),n.push(e);let a=r.map(o=>Cl.resolve(s,o));return n.push(...a),await new Promise((o,c)=>{let l=V0(this.ripgrepPath,n,{cwd:s,shell:!1,stdio:["ignore","pipe","pipe"],env:{LANG:"C",RIPGREP_CONFIG_PATH:""}}),u="",d="";l.stdout?.on("data",h=>{u+=h.toString()}),l.stderr?.on("data",h=>{d+=h.toString()});let g=setTimeout(()=>{l.kill("SIGTERM"),c(new Error("Ripgrep search operation timed out"))},3e4);l.on("close",h=>{if(clearTimeout(g),h===0||h===1){let p=this.parseRipgrepOutput(u,s);o(p)}else c(new Error(`Ripgrep exited with code ${h}: ${d}`))}),l.on("error",h=>{clearTimeout(g),c(h)})})}parseRipgrepOutput(e,r){if(!e.trim())return[];let i=[],s=e.trim().split(`
|
|
60
|
+
`);for(let n of s){let a=JSON.parse(n);if(a.type!=="match")continue;let o=a.data,c=o.path.text||Buffer.from(o.path.bytes||"","base64").toString("utf-8"),l=Cl.relative(r,c),u=o.lines.text;for(let d of o.submatches){let g=d.start,h=d.end,p=g+1,m=u.substring(g,h);i.push({file:l,line:o.line_number,column:p,text:m})}}return i}};var Pi=class extends Error{constructor(e,r){super(`${e} is not supported: ${r}`),this.name="LanguageBackendNotSupportedError"}},Ii=class{matchProvider;intelligenceProvider;language;constructor(e,r){this.language=r,r==="Unknown"?this.matchProvider=new Eo(e):this.matchProvider=new xo(e,r)}async findMatches(e,r){if(!this.matchProvider)throw new Pi("findMatches","no match provider configured for this language");return await this.matchProvider.findMatches(e,r)}async findDefinitions(e){if(!this.intelligenceProvider)throw new Pi("findDefinitions","no intelligence provider configured for this language");return await this.intelligenceProvider.findDefinitions(e)}async findReferences(e){if(!this.intelligenceProvider)throw new Pi("findReferences","no intelligence provider configured for this language");return await this.intelligenceProvider.findReferences(e)}async expandMatch(e){if(!this.matchProvider)throw new Pi("expandMatch","no match provider configured for this language");return await this.matchProvider.expandMatch(e)}};var _o=class{environment;eventEmitter;constructor(e,r){this.environment=e,this.eventEmitter=r}async execute(e,r,i){let s=Date.now(),n=i.filePaths.filter(d=>Wn(d)===r),c=(await new Ii(this.environment,r).findMatches(n,e)).map(d=>{if(jO.isAbsolute(d.file.path))throw new Error(`Match provider returned absolute path: ${d.file.path}. All file paths must be relative to workspace root.`);return{...d,language:r}}),l=i.previousMatches&&i.previousMatches.length>0?this.filterMatchesByRanges(c,i.previousMatches,r):c;l=this.deduplicateMatches(l);let u=Date.now()-s;return{matches:l,totalMatches:l.length,executionTime:u}}filterMatchesByRanges(e,r,i){let s=[];for(let n of e){let a=r.find(c=>this.isMatchInRange(n,c));if(!a)continue;let o=[...a.evidence||[],{file:a.file,text:a.text,range:a.range,language:a.language}];s.push({...n,evidence:o})}return s}isMatchInRange(e,r){if(e.file.path!==r.file.path)return!1;let i=e.range.start,s=e.range.end,n=r.range.start,a=r.range.end,o=i.line>n.line||i.line===n.line&&i.column>=n.column,c=s.line<a.line||s.line===a.line&&s.column<=a.column;return o&&c}deduplicateMatches(e){if(e.length<=1)return e;let r=[];for(let i of e)e.some(n=>i===n?!1:this.isMatchInRange(i,n))||r.push(i);return r}};var K0=We(po(),1);import BO from"path";var So=class{maxDepth=1;environment;eventEmitter;constructor(e,r){this.environment=e,this.eventEmitter=r||new nt}async execute(e,r,i={}){let s=Date.now(),n=new Ii(this.environment,r),a=await this.followDefinitions(e,n,this.maxDepth,i.where,r),o=Date.now()-s,c=a.map(l=>{let{depth:u,sourceMatch:d,...g}=l,h=d?[{file:d.file,text:d.text,range:d.range,language:d.language},...d.evidence||[]]:[];return{...g,source:h}});return{definitions:c,totalDefinitions:c.length,executionTime:o}}async followDefinitions(e,r,i,s,n){let a=[],o=new Set;for(let c of e)await this.followDefinitionsRecursive(c,r,0,i,s,a,o,c,n);return a}async followDefinitionsRecursive(e,r,i,s,n,a,o,c,l){if(i>=s)return;let u=`${e.file.path}:${e.range.start.line}:${e.range.start.column}`;if(o.has(u))return;o.add(u);let d=await r.findDefinitions(e);for(let g of d){let p={...await r.expandMatch(g)??g,language:l,depth:i,sourceMatch:c||e};n&&!this.matchesDefinitionFilter(p,n)||(a.push(p),i+1<s&&await this.followDefinitionsRecursive(g,r,i+1,s,n,a,o,c||e,l))}}matchesDefinitionFilter(e,r){return r.all?r.all.every(i=>this.matchesDefinitionFilter(e,i)):r.any?r.any.some(i=>this.matchesDefinitionFilter(e,i)):r.not?!this.matchesDefinitionFilter(e,r.not):!(r.file&&!this.matchesFileSpec(e.file.path,r.file)||r.function?.name)}matchesNameSpec(e,r){return r.equals?e===r.equals:r.anyOf?r.anyOf.includes(e):r.regex?new RegExp(r.regex).test(e):!0}matchesFileSpec(e,r){let i=BO.relative(this.environment.getWorkspaceRoot(),e);return r.path?i===r.path:r.glob?(0,K0.default)().add(r.glob).ignores(i):r.regex?new RegExp(r.regex).test(i):!0}};import{existsSync as UO}from"fs";import{dirname as GO,join as Ro}from"path";import{fileURLToPath as zO}from"url";var qO=zO(import.meta.url),Co=GO(qO);function Y0(){let t=process.platform,e=process.arch,r;if(t==="linux"&&e==="x64")r="x64-linux";else if(t==="linux"&&e==="arm64")r="arm64-linux";else if(t==="darwin"&&e==="x64")r="x64-darwin";else if(t==="darwin"&&e==="arm64")r="arm64-darwin";else if(t==="win32"&&e==="x64")r="x64-win32";else throw new Error(`Unsupported platform: ${t}-${e}. Supported platforms: x64-linux, arm64-linux, x64-darwin, arm64-darwin, x64-win32`);let i=t==="win32"?"rg.exe":"rg",s=[Ro(Co,"powerlint/dist/vendor/ripgrep",r,i),Ro(Co,"../../dist/vendor/ripgrep",r,i),Ro(Co,"../vendor/ripgrep",r,i),Ro(Co,"./vendor/ripgrep",r,i)];for(let n of s)if(UO(n))return n;throw new Error(`Bundled ripgrep binary not found for platform ${r}. Tried paths:
|
|
60
61
|
${s.join(`
|
|
61
62
|
`)}`)}import{readFile as WO}from"fs/promises";import VO from"path";async function Al(t,e,r,i=!1){let s=VO.resolve(t,e),a=(await WO(s,"utf-8")).split(`
|
|
62
|
-
`),{start:o,end:c}=r,l=o.line-1,u=c.line-1;if(o.line===c.line){let
|
|
63
|
-
`)}var HO=Y0(),Ao=class{environment;eventEmitter;config;maxIterations;constructor(e,r,i,s){this.environment=r,this.eventEmitter=i||new nt,this.config=e,this.maxIterations=s||20}async executeTool(e,r,i,s){switch(r){case"read":{this.eventEmitter.llmToolExecution(e,"read",{file:i.target_file,offset:i.offset,limit:i.limit});let n=await B0(i,this.environment.getWorkspaceRoot());if(!("error"in n)){let a=i.target_file;s.some(o=>o.path===a)||s.push({path:a,sha:n.sha})}return"error"in n?n:n.content}case"grep":{this.eventEmitter.llmToolExecution(e,"grep",{path:i.path,pattern:i.pattern});let n=await U0(i,this.environment.getWorkspaceRoot(),[],HO);if(!("error"in n))for(let a of n.matches)s.some(o=>o.path===a.file)||s.push({path:a.file,sha:a.sha});return"error"in n?n:JSON.stringify(n.matches)}case"glob":{this.eventEmitter.llmToolExecution(e,"glob",{path:i.path,pattern:i.pattern});let n=await G0(i,this.environment.getWorkspaceRoot());return"error"in n?n:JSON.stringify(n.files)}default:return{error:`Unknown tool: ${r}`}}}async hydrateMatchesWithFileContent(e){let r=[];for(let i of e){let s=await Al(this.environment.getWorkspaceRoot(),i.file.path,i.range),n=i.evidence;if(i.evidence&&i.evidence.length>0){n=[];for(let a of i.evidence){let o=await Al(this.environment.getWorkspaceRoot(),a.file.path,a.range);n.push({...a,text:o})}}r.push({...i,text:s,evidence:n})}return r}async executeLLMValidation(e,r,i){let s=Date.now(),n=this.config.getLLMProvider();this.eventEmitter.startLLMValidation(e.id,r.length);let a=[],o=[],c=new Ke(0),l=new Ke(0),u=new Ke(0),d;for(let
|
|
64
|
-
${e}`,QO=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),e$=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),t$=(t,e,r)=>{let i=r===""?"":`with ${r.trim()}() `,s=ZO.bind(null,i,e.toString());Object.defineProperty(s,"name",e$);let{writable:n,enumerable:a,configurable:o}=QO;Object.defineProperty(t,"toString",{value:s,writable:n,enumerable:a,configurable:o})};function Ll(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:i}=t;for(let s of Reflect.ownKeys(e))YO(t,e,s,r);return JO(t,e),t$(t,e,i),t}var $o=new WeakMap,X0=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,i=0,s=t.displayName||t.name||"<anonymous>",n=function(...a){if($o.set(n,++i),i===1)r=t.apply(this,a),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return Ll(n,t),$o.set(n,i),n};X0.callCount=t=>{if(!$o.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return $o.get(t)};var J0=X0;var kr=[];kr.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&kr.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&kr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var To=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Ol=Symbol.for("signal-exit emitter"),$l=globalThis,r$=Object.defineProperty.bind(Object),Tl=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if($l[Ol])return $l[Ol];r$($l,Ol,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let i=this.listeners[e],s=i.indexOf(r);s!==-1&&(s===0&&i.length===1?i.length=0:i.splice(s,1))}emit(e,r,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let n of this.listeners[e])s=n(r,i)===!0||s;return e==="exit"&&(s=this.emit("afterExit",r,i)||s),s}},Po=class{},i$=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Pl=class extends Po{onExit(){return()=>{}}load(){}unload(){}},Il=class extends Po{#t=Fl.platform==="win32"?"SIGINT":"SIGHUP";#r=new Tl;#e;#n;#f;#w={};#a=!1;constructor(e){super(),this.#e=e,this.#w={};for(let r of kr)this.#w[r]=()=>{let i=this.#e.listeners(r),{count:s}=this.#r,n=e;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(s+=n.__signal_exit_emitter__.count),i.length===s){this.unload();let a=this.#r.emit("exit",null,r),o=r==="SIGHUP"?this.#t:r;a||e.kill(e.pid,o)}};this.#f=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!To(this.#e))return()=>{};this.#a===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,e),()=>{this.#r.removeListener(i,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#r.count+=1;for(let e of kr)try{let r=this.#w[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#s(e,...r),this.#e.reallyExit=e=>this.#u(e)}}unload(){this.#a&&(this.#a=!1,kr.forEach(e=>{let r=this.#w[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#f,this.#r.count-=1)}#u(e){return To(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#f.call(this.#e,this.#e.exitCode)):0}#s(e,...r){let i=this.#n;if(e==="exit"&&To(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=i.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return i.call(this.#e,e,...r)}},Fl=globalThis.process,{onExit:Z0,load:VD,unload:HD}=i$(To(Fl)?new Il(Fl):new Pl);var Q0=Io.stderr.isTTY?Io.stderr:Io.stdout.isTTY?Io.stdout:void 0,s$=Q0?J0(()=>{Z0(()=>{Q0.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},ey=s$;var Fo=!1,Fi={};Fi.show=(t=ty.stderr)=>{t.isTTY&&(Fo=!1,t.write("\x1B[?25h"))};Fi.hide=(t=ty.stderr)=>{t.isTTY&&(ey(),Fo=!0,t.write("\x1B[?25l"))};Fi.toggle=(t,e)=>{t!==void 0&&(Fo=t),Fo?Fi.show(e):Fi.hide(e)};var Nl=Fi;var Dl={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var Ns=Dl,sM=Object.keys(Dl);var jr={};jo(jr,{error:()=>f$,info:()=>c$,success:()=>l$,warning:()=>u$});import o$ from"node:tty";var a$=o$?.WriteStream?.prototype?.hasColors?.()??!1,oe=(t,e)=>{if(!a$)return s=>s;let r=`\x1B[${t}m`,i=`\x1B[${e}m`;return s=>{let n=s+"",a=n.indexOf(i);if(a===-1)return r+n+i;let o=r,c=0;for(;a!==-1;)o+=n.slice(c,a)+r,c=a+i.length,a=n.indexOf(i,c);return o+=n.slice(c)+i,o}},aM=oe(0,0),cM=oe(1,22),lM=oe(2,22),uM=oe(3,23),fM=oe(4,24),hM=oe(53,55),pM=oe(7,27),dM=oe(8,28),mM=oe(9,29),gM=oe(30,39),ry=oe(31,39),iy=oe(32,39),sy=oe(33,39),ny=oe(34,39),yM=oe(35,39),bM=oe(36,39),vM=oe(37,39),wM=oe(90,39),xM=oe(40,49),EM=oe(41,49),_M=oe(42,49),SM=oe(43,49),RM=oe(44,49),CM=oe(45,49),AM=oe(46,49),LM=oe(47,49),OM=oe(100,49),$M=oe(91,39),TM=oe(92,39),PM=oe(93,39),IM=oe(94,39),FM=oe(95,39),NM=oe(96,39),DM=oe(97,39),MM=oe(101,49),kM=oe(102,49),jM=oe(103,49),BM=oe(104,49),UM=oe(105,49),GM=oe(106,49),qM=oe(107,49);import oy from"node:process";function Ds(){let{env:t}=oy,{TERM:e,TERM_PROGRAM:r}=t;return oy.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var No=Ds(),c$=ny(No?"\u2139":"i"),l$=iy(No?"\u2714":"\u221A"),u$=sy(No?"\u26A0":"\u203C"),f$=ry(No?"\u2716":"\xD7");function Ml({onlyFirst:t=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var h$=Ml();function Ms(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(h$,"")}function ay(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function cy(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function ly(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function p$(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function kl(t,{ambiguousAsWide:e=!1}={}){return p$(t),cy(t)||ly(t)||e&&ay(t)?2:1}var d$=new Intl.Segmenter,m$=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),g$=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),y$=new RegExp("^\\p{RGI_Emoji}$","v");function b$(t){return t.replace(g$,"")}function v$(t){return m$.test(t)}function w$(t,e){let r=0;if(t.length>1)for(let i of t.slice(1))i>="\uFF00"&&i<="\uFFEF"&&(r+=kl(i.codePointAt(0),e));return r}function jl(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=e,s=t;if(i||(s=Ms(s)),s.length===0)return 0;let n=0,a={ambiguousAsWide:!r};for(let{segment:o}of d$.segment(s)){if(v$(o))continue;if(y$.test(o)){n+=2;continue}let c=b$(o).codePointAt(0);n+=kl(c,a),n+=w$(o,a)}return n}function Bl({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import Rt from"node:process";var x$=3,Ul=class{#t=0;start(){this.#t++,this.#t===1&&this.#r()}stop(){if(this.#t<=0)throw new Error("`stop` called more times than `start`");this.#t--,this.#t===0&&this.#e()}#r(){Rt.platform==="win32"||!Rt.stdin.isTTY||(Rt.stdin.setRawMode(!0),Rt.stdin.on("data",this.#n),Rt.stdin.resume())}#e(){Rt.stdin.isTTY&&(Rt.stdin.off("data",this.#n),Rt.stdin.pause(),Rt.stdin.setRawMode(!1))}#n(e){e[0]===x$&&Rt.emit("SIGINT")}},E$=new Ul,Gl=E$;var ql=class{#t=0;#r=!1;#e=0;#n=-1;#f=0;#w=0;#a;#u;#s;#c;#i;#l;#o;#d;#g;#y;#p;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#a={color:"cyan",stream:Do.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#a.color,this.spinner=this.#a.spinner,this.#i=this.#a.interval,this.#s=this.#a.stream,this.#l=typeof this.#a.isEnabled=="boolean"?this.#a.isEnabled:Bl({stream:this.#s}),this.#o=typeof this.#a.isSilent=="boolean"?this.#a.isSilent:!1,this.text=this.#a.text,this.prefixText=this.#a.prefixText,this.suffixText=this.#a.suffixText,this.indent=this.#a.indent,Do.env.NODE_ENV==="test"&&(this._stream=this.#s,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#t},set(r){this.#t=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#n}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#S()}get interval(){return this.#i??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#n=-1,this.#i=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(r=>typeof r!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!Ds())this.#u=Ns.line;else if(e===void 0)this.#u=Ns.dots;else if(e!=="default"&&Ns[e])this.#u=Ns[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#S()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#S()}get suffixText(){return this.#p}set suffixText(e=""){this.#p=e,this.#S()}get isSpinning(){return this.#c!==void 0}#C(e,r,i=!1){let s=typeof e=="function"?e():e;return typeof s=="string"&&s!==""?i?r+s:s+r:""}#x(e=this.#y,r=" "){return this.#C(e,r,!1)}#E(e=this.#p,r=" "){return this.#C(e,r,!0)}#_(e,r){let i=0;for(let s of Ms(e).split(`
|
|
65
|
-
`))i+=Math.max(1,Math.ceil(jl(s)/r));return i}#S(){let e=this.#s.columns??80,r=typeof this.#y=="function"?"":this.#y,i=typeof this.#p=="function"?"":this.#p,s=typeof r=="string"&&r!==""?r+" ":"",n=typeof i=="string"&&i!==""?" "+i:"",o=" ".repeat(this.#d)+s+"-"+(typeof this.#g=="string"?" "+this.#g:"")+n;this.#e=this.#_(o,e)}get isEnabled(){return this.#l&&!this.#o}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#l=e}get isSilent(){return this.#o}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#o=e}frame(){let e=Date.now();(this.#n===-1||e-this.#
|
|
63
|
+
`),{start:o,end:c}=r,l=o.line-1,u=c.line-1;if(o.line===c.line){let g=a[l]||"";return i?g.substring(o.column-1,c.column-1):g}let d=[];for(let g=l;g<=u&&g<a.length;g++){let h=a[g];g===l?d.push(i?h.substring(o.column-1):h):g===u?d.push(i?h.substring(0,c.column-1):h):d.push(h)}return d.join(`
|
|
64
|
+
`)}var HO=Y0(),Ao=class{environment;eventEmitter;config;maxIterations;constructor(e,r,i,s){this.environment=r,this.eventEmitter=i||new nt,this.config=e,this.maxIterations=s||20}async executeTool(e,r,i,s){switch(r){case"read":{this.eventEmitter.llmToolExecution(e,"read",{file:i.target_file,offset:i.offset,limit:i.limit});let n=await B0(i,this.environment.getWorkspaceRoot());if(!("error"in n)){let a=i.target_file;s.some(o=>o.path===a)||s.push({path:a,sha:n.sha})}return"error"in n?n:n.content}case"grep":{this.eventEmitter.llmToolExecution(e,"grep",{path:i.path,pattern:i.pattern});let n=await U0(i,this.environment.getWorkspaceRoot(),[],HO);if(!("error"in n))for(let a of n.matches)s.some(o=>o.path===a.file)||s.push({path:a.file,sha:a.sha});return"error"in n?n:JSON.stringify(n.matches)}case"glob":{this.eventEmitter.llmToolExecution(e,"glob",{path:i.path,pattern:i.pattern});let n=await G0(i,this.environment.getWorkspaceRoot());return"error"in n?n:JSON.stringify(n.files)}default:return{error:`Unknown tool: ${r}`}}}async hydrateMatchesWithFileContent(e){let r=[];for(let i of e){let s=await Al(this.environment.getWorkspaceRoot(),i.file.path,i.range),n=i.evidence;if(i.evidence&&i.evidence.length>0){n=[];for(let a of i.evidence){let o=await Al(this.environment.getWorkspaceRoot(),a.file.path,a.range);n.push({...a,text:o})}}r.push({...i,text:s,evidence:n})}return r}async executeLLMValidation(e,r,i){let s=Date.now(),n=this.config.getLLMProvider();this.eventEmitter.startLLMValidation(e.id,r.length);let a=[],o=[],c=new Ke(0),l=new Ke(0),u=new Ke(0),d,g=[];for(let w=0;w<this.maxIterations;w++){let x=await n.search({rule:e,matches:r,tools:i,messages:a,files:o});if(x.usage&&(c=c.plus(new Ke(x.usage.inputTokens)),l=l.plus(new Ke(x.usage.outputTokens)),u=u.plus(new Ke(x.usage.cost))),x.type==="partial_matches"){let f=await this.hydrateMatchesWithFileContent(x.matches);g=[...g,...f],r=x.unresolved;continue}if(x.type==="matches"){let f=await this.hydrateMatchesWithFileContent(x.matches);d={...x,matches:[...g,...f]};break}if(x.type==="request_files"){for(let f of x.files)o.some(v=>v.path===f.path)||o.push({path:f.path,sha:f.sha});continue}if(x.type==="tool_request"){a.push({type:"tool_request",tool_calls:x.tool_calls});let f=await Promise.all(x.tool_calls.map(async v=>{let E=JSON.parse(v.function.arguments),_=await this.executeTool(e.id,v.function.name,E,o),O=typeof _=="string"?_:JSON.stringify(_);return{tool_call_id:v.id,content:O}}));for(let v of f)a.push({type:"tool_response",tool_call_id:v.tool_call_id,content:v.content});continue}}if(!d)throw new Error(`Max iterations (${this.maxIterations}) reached without getting matches`);let h=d.matches;if(h.length===0){let w=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,w,c.toNumber(),l.toNumber(),u.toString(),Date.now()-s,0,!1),{matches:[],executionTime:Date.now()-s}}this.eventEmitter.startLLMValidationPhase(e.id,h.length);let p=[],m=h;for(;m.length>0;){let w=await n.validate({rule:e,matches:m,files:o});if(w.usage&&(c=c.plus(new Ke(w.usage.inputTokens)),l=l.plus(new Ke(w.usage.outputTokens)),u=u.plus(new Ke(w.usage.cost))),w.type==="partial_matches"){let x=await this.hydrateMatchesWithFileContent(w.matches);p=[...p,...x],console.log("partial matches",JSON.stringify(w,null,2)),m=w.unresolved;continue}if(w.type==="matches"){let x=await this.hydrateMatchesWithFileContent(w.matches);p=[...p,...x];break}}let y=p,b=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,b,c.toNumber(),l.toNumber(),u.toString(),Date.now()-s,y.length,!1),{matches:y,executionTime:Date.now()-s}}async execute(e,r,i){return r.length===0?{matches:[],executionTime:0}:await this.executeLLMValidation(e,r,i)}};var Lo=class{fileFilterStep;findMatchesStep;gotoDefinitionStep;llmStep;environment;executionContext;currentMode;eventEmitter;config;constructor(e,r,i){this.environment=r,this.eventEmitter=i||new nt,this.config=e,this.fileFilterStep=new go(this.environment),this.findMatchesStep=new _o(this.environment,this.eventEmitter),this.gotoDefinitionStep=new So(this.environment,this.eventEmitter),this.llmStep=new Ao(this.config,this.environment,this.eventEmitter)}async executeStep(e,r,i,s,n,a,o){let c=i.type;if(c==="ast-grep"){let{type:l,language:u,...d}=i;return{matches:(await this.findMatchesStep.execute(d,u,{filePaths:s,previousMatches:n})).matches}}if(c==="ripgrep"){let{type:l,...u}=i;return{matches:(await this.findMatchesStep.execute(u,"Unknown",{filePaths:s,previousMatches:n})).matches}}if(c==="step-group"){let l=[];for(let u=0;u<i.steps.length;u++){let d=i.steps[u],g=`${r}[${u}]`;this.eventEmitter.startStep(e.id,g,d.type,{filePaths:s,matches:n},r);let h=Date.now(),p=await this.executeStep(e,g,d,s,n,a,r),m=Date.now()-h;this.eventEmitter.completeStep(e.id,g,d.type,p,m,r),p.matches&&(l=l.concat(p.matches))}return{matches:l}}if(c==="file-filter")return{filePaths:(await this.fileFilterStep.execute(s,{include:i.include,ignore:i.ignore,conditions:i.conditions})).filteredPaths};if(c==="goto-definition")throw new Error("goto-definition step is disabled");if(c==="llm")return n.length===0?{matches:[]}:{matches:(await this.llmStep.execute(e,n,i.tools??[])).matches};throw new Error(`Unknown step type: ${c}`)}async executeRule(e,r){let i=e.id,s=e.config,n=[...this.executionContext.filePaths],a=[];for(let c of s.steps){let l=c.id,u=c.step;this.eventEmitter.startStep(i,l,u.type,{filePaths:n,matches:a});let d=Date.now(),g=await this.executeStep(e,l,u,n,a,r),h=Date.now()-d;if(this.eventEmitter.completeStep(i,l,u.type,g,h),g.filePaths!==void 0&&(n=this.executionContext.filterFiles(g.filePaths),a=this.executionContext.filterMatchesByFilePaths(a,n)),g.matches!==void 0&&(a=this.executionContext.filterMatches(g.matches)),n.length===0)break}let o=a.sort((c,l)=>c.file.path.localeCompare(l.file.path));return{ruleId:i,matches:o}}getPoolSize(){let e=KO().length;return Math.max(2,Math.min(8,e))}async execute(e,r){if(this.currentMode&&this.currentMode!==r.mode)throw new Error(`Execution mode mismatch: expected ${this.currentMode}, got ${r.mode}`);(!this.executionContext||this.currentMode!==r.mode)&&(this.executionContext=await mo.initialize(this.config,this.environment,r.mode,this.eventEmitter,r.filePath,r.diffOptions),this.currentMode=r.mode),this.eventEmitter.startRules(e.length);let i=this.getPoolSize(),s=[],n=[...e],a=async u=>{let d=u.id,g=!1;for(let p of u.config.steps)if(p.step.type==="llm"){g=!0;break}this.eventEmitter.emit("rules:rule-start",{ruleId:d,isLlm:g,message:u.config.message,severity:u.config.severity});let h=await this.executeRule(u,r);return this.eventEmitter.emit("rules:rule-complete",{ruleId:d}),h};await(async()=>{let u=async()=>{if(n.length===0)return;let g=n.shift(),h=await a(g);s.push(h),await u()},d=[];for(let g=0;g<Math.min(i,e.length);g++)d.push(u());await Promise.all(d)})();let c=new Map(e.map((u,d)=>[u.id,d]));s.sort((u,d)=>{let g=c.get(u.ruleId)??0,h=c.get(d.ruleId)??0;return g-h});let l=s.reduce((u,d)=>u+d.matches.length,0);return this.eventEmitter.completeRules(e.length,l),s}};var Oo=class extends Error{constructor(r,i,s){super(`Invalid rule format in '${r}': ${i}`);this.validationErrors=s;this.name="InvalidRuleFormatError"}};import{stripVTControlCharacters as py}from"node:util";import Do from"node:process";import ty from"node:process";import Io from"node:process";var YO=(t,e,r,i)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(t,r),n=Object.getOwnPropertyDescriptor(e,r);!XO(s,n)&&i||Object.defineProperty(t,r,n)},XO=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},JO=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},ZO=(t,e)=>`/* Wrapped ${t}*/
|
|
65
|
+
${e}`,QO=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),e$=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),t$=(t,e,r)=>{let i=r===""?"":`with ${r.trim()}() `,s=ZO.bind(null,i,e.toString());Object.defineProperty(s,"name",e$);let{writable:n,enumerable:a,configurable:o}=QO;Object.defineProperty(t,"toString",{value:s,writable:n,enumerable:a,configurable:o})};function Ll(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:i}=t;for(let s of Reflect.ownKeys(e))YO(t,e,s,r);return JO(t,e),t$(t,e,i),t}var $o=new WeakMap,X0=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,i=0,s=t.displayName||t.name||"<anonymous>",n=function(...a){if($o.set(n,++i),i===1)r=t.apply(this,a),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return Ll(n,t),$o.set(n,i),n};X0.callCount=t=>{if(!$o.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return $o.get(t)};var J0=X0;var kr=[];kr.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&kr.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&kr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var To=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Ol=Symbol.for("signal-exit emitter"),$l=globalThis,r$=Object.defineProperty.bind(Object),Tl=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if($l[Ol])return $l[Ol];r$($l,Ol,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let i=this.listeners[e],s=i.indexOf(r);s!==-1&&(s===0&&i.length===1?i.length=0:i.splice(s,1))}emit(e,r,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let n of this.listeners[e])s=n(r,i)===!0||s;return e==="exit"&&(s=this.emit("afterExit",r,i)||s),s}},Po=class{},i$=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Pl=class extends Po{onExit(){return()=>{}}load(){}unload(){}},Il=class extends Po{#t=Fl.platform==="win32"?"SIGINT":"SIGHUP";#r=new Tl;#e;#n;#h;#w={};#a=!1;constructor(e){super(),this.#e=e,this.#w={};for(let r of kr)this.#w[r]=()=>{let i=this.#e.listeners(r),{count:s}=this.#r,n=e;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(s+=n.__signal_exit_emitter__.count),i.length===s){this.unload();let a=this.#r.emit("exit",null,r),o=r==="SIGHUP"?this.#t:r;a||e.kill(e.pid,o)}};this.#h=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!To(this.#e))return()=>{};this.#a===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,e),()=>{this.#r.removeListener(i,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#r.count+=1;for(let e of kr)try{let r=this.#w[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#s(e,...r),this.#e.reallyExit=e=>this.#u(e)}}unload(){this.#a&&(this.#a=!1,kr.forEach(e=>{let r=this.#w[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#h,this.#r.count-=1)}#u(e){return To(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#h.call(this.#e,this.#e.exitCode)):0}#s(e,...r){let i=this.#n;if(e==="exit"&&To(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=i.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return i.call(this.#e,e,...r)}},Fl=globalThis.process,{onExit:Z0,load:VD,unload:HD}=i$(To(Fl)?new Il(Fl):new Pl);var Q0=Io.stderr.isTTY?Io.stderr:Io.stdout.isTTY?Io.stdout:void 0,s$=Q0?J0(()=>{Z0(()=>{Q0.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},ey=s$;var Fo=!1,Fi={};Fi.show=(t=ty.stderr)=>{t.isTTY&&(Fo=!1,t.write("\x1B[?25h"))};Fi.hide=(t=ty.stderr)=>{t.isTTY&&(ey(),Fo=!0,t.write("\x1B[?25l"))};Fi.toggle=(t,e)=>{t!==void 0&&(Fo=t),Fo?Fi.show(e):Fi.hide(e)};var Nl=Fi;var Dl={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var Ns=Dl,sM=Object.keys(Dl);var jr={};jo(jr,{error:()=>h$,info:()=>c$,success:()=>l$,warning:()=>u$});import o$ from"node:tty";var a$=o$?.WriteStream?.prototype?.hasColors?.()??!1,oe=(t,e)=>{if(!a$)return s=>s;let r=`\x1B[${t}m`,i=`\x1B[${e}m`;return s=>{let n=s+"",a=n.indexOf(i);if(a===-1)return r+n+i;let o=r,c=0;for(;a!==-1;)o+=n.slice(c,a)+r,c=a+i.length,a=n.indexOf(i,c);return o+=n.slice(c)+i,o}},aM=oe(0,0),cM=oe(1,22),lM=oe(2,22),uM=oe(3,23),hM=oe(4,24),fM=oe(53,55),pM=oe(7,27),dM=oe(8,28),mM=oe(9,29),gM=oe(30,39),ry=oe(31,39),iy=oe(32,39),sy=oe(33,39),ny=oe(34,39),yM=oe(35,39),bM=oe(36,39),vM=oe(37,39),wM=oe(90,39),xM=oe(40,49),EM=oe(41,49),_M=oe(42,49),SM=oe(43,49),RM=oe(44,49),CM=oe(45,49),AM=oe(46,49),LM=oe(47,49),OM=oe(100,49),$M=oe(91,39),TM=oe(92,39),PM=oe(93,39),IM=oe(94,39),FM=oe(95,39),NM=oe(96,39),DM=oe(97,39),MM=oe(101,49),kM=oe(102,49),jM=oe(103,49),BM=oe(104,49),UM=oe(105,49),GM=oe(106,49),zM=oe(107,49);import oy from"node:process";function Ds(){let{env:t}=oy,{TERM:e,TERM_PROGRAM:r}=t;return oy.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var No=Ds(),c$=ny(No?"\u2139":"i"),l$=iy(No?"\u2714":"\u221A"),u$=sy(No?"\u26A0":"\u203C"),h$=ry(No?"\u2716":"\xD7");function Ml({onlyFirst:t=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var f$=Ml();function Ms(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(f$,"")}function ay(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function cy(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function ly(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function p$(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function kl(t,{ambiguousAsWide:e=!1}={}){return p$(t),cy(t)||ly(t)||e&&ay(t)?2:1}var d$=new Intl.Segmenter,m$=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),g$=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),y$=new RegExp("^\\p{RGI_Emoji}$","v");function b$(t){return t.replace(g$,"")}function v$(t){return m$.test(t)}function w$(t,e){let r=0;if(t.length>1)for(let i of t.slice(1))i>="\uFF00"&&i<="\uFFEF"&&(r+=kl(i.codePointAt(0),e));return r}function jl(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=e,s=t;if(i||(s=Ms(s)),s.length===0)return 0;let n=0,a={ambiguousAsWide:!r};for(let{segment:o}of d$.segment(s)){if(v$(o))continue;if(y$.test(o)){n+=2;continue}let c=b$(o).codePointAt(0);n+=kl(c,a),n+=w$(o,a)}return n}function Bl({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import Rt from"node:process";var x$=3,Ul=class{#t=0;start(){this.#t++,this.#t===1&&this.#r()}stop(){if(this.#t<=0)throw new Error("`stop` called more times than `start`");this.#t--,this.#t===0&&this.#e()}#r(){Rt.platform==="win32"||!Rt.stdin.isTTY||(Rt.stdin.setRawMode(!0),Rt.stdin.on("data",this.#n),Rt.stdin.resume())}#e(){Rt.stdin.isTTY&&(Rt.stdin.off("data",this.#n),Rt.stdin.pause(),Rt.stdin.setRawMode(!1))}#n(e){e[0]===x$&&Rt.emit("SIGINT")}},E$=new Ul,Gl=E$;var zl=class{#t=0;#r=!1;#e=0;#n=-1;#h=0;#w=0;#a;#u;#s;#c;#i;#l;#o;#d;#g;#y;#p;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#a={color:"cyan",stream:Do.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#a.color,this.spinner=this.#a.spinner,this.#i=this.#a.interval,this.#s=this.#a.stream,this.#l=typeof this.#a.isEnabled=="boolean"?this.#a.isEnabled:Bl({stream:this.#s}),this.#o=typeof this.#a.isSilent=="boolean"?this.#a.isSilent:!1,this.text=this.#a.text,this.prefixText=this.#a.prefixText,this.suffixText=this.#a.suffixText,this.indent=this.#a.indent,Do.env.NODE_ENV==="test"&&(this._stream=this.#s,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#t},set(r){this.#t=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#n}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#S()}get interval(){return this.#i??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#n=-1,this.#i=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(r=>typeof r!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!Ds())this.#u=Ns.line;else if(e===void 0)this.#u=Ns.dots;else if(e!=="default"&&Ns[e])this.#u=Ns[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#S()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#S()}get suffixText(){return this.#p}set suffixText(e=""){this.#p=e,this.#S()}get isSpinning(){return this.#c!==void 0}#C(e,r,i=!1){let s=typeof e=="function"?e():e;return typeof s=="string"&&s!==""?i?r+s:s+r:""}#x(e=this.#y,r=" "){return this.#C(e,r,!1)}#E(e=this.#p,r=" "){return this.#C(e,r,!0)}#_(e,r){let i=0;for(let s of Ms(e).split(`
|
|
66
|
+
`))i+=Math.max(1,Math.ceil(jl(s)/r));return i}#S(){let e=this.#s.columns??80,r=typeof this.#y=="function"?"":this.#y,i=typeof this.#p=="function"?"":this.#p,s=typeof r=="string"&&r!==""?r+" ":"",n=typeof i=="string"&&i!==""?" "+i:"",o=" ".repeat(this.#d)+s+"-"+(typeof this.#g=="string"?" "+this.#g:"")+n;this.#e=this.#_(o,e)}get isEnabled(){return this.#l&&!this.#o}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#l=e}get isSilent(){return this.#o}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#o=e}frame(){let e=Date.now();(this.#n===-1||e-this.#h>=this.interval)&&(this.#n=++this.#n%this.#u.frames.length,this.#h=e);let{frames:r}=this.#u,i=r[this.#n];this.color&&(i=S[this.color](i));let s=this.#x(this.#y," "),n=typeof this.text=="string"?" "+this.text:"",a=this.#E(this.#p," ");return s+i+n+a}clear(){if(!this.#l||!this.#s.isTTY)return this;this.#s.cursorTo(0);for(let e=0;e<this.#t;e++)e>0&&this.#s.moveCursor(0,-1),this.#s.clearLine(1);return(this.#d||this.#w!==this.#d)&&this.#s.cursorTo(this.#d),this.#w=this.#d,this.#t=0,this}render(){if(!this.#l||this.#o)return this;this.clear();let e=this.frame(),r=this.#s.columns??80,i=this.#_(e,r),s=this.#s.rows;if(s&&s>1&&i>s){let n=e.split(`
|
|
66
67
|
`),a=s-1;e=[...n.slice(0,a),"... (content truncated to fit terminal)"].join(`
|
|
67
68
|
`)}return this.#s.write(e),this.#t=this.#_(e,r),this}start(e){if(e&&(this.text=e),this.#o)return this;if(!this.#l){let r=" ".repeat(this.#d)+this.#x(this.#y," ")+(this.text?`- ${this.text}`:"")+this.#E(this.#p," ");return r.trim()!==""&&this.#s.write(r+`
|
|
68
69
|
`),this}return this.isSpinning?this:(this.#a.hideCursor&&Nl.hide(this.#s),this.#a.discardStdin&&Do.stdin.isTTY&&(this.#r=!0,Gl.start()),this.render(),this.#c=setInterval(this.render.bind(this),this.interval),this)}stop(){return clearInterval(this.#c),this.#c=void 0,this.#n=0,this.#l&&(this.clear(),this.#a.hideCursor&&Nl.show(this.#s)),this.#a.discardStdin&&Do.stdin.isTTY&&this.#r&&(Gl.stop(),this.#r=!1),this}succeed(e){return this.stopAndPersist({symbol:jr.success,text:e})}fail(e){return this.stopAndPersist({symbol:jr.error,text:e})}warn(e){return this.stopAndPersist({symbol:jr.warning,text:e})}info(e){return this.stopAndPersist({symbol:jr.info,text:e})}stopAndPersist(e={}){if(this.#o)return this;let r=e.prefixText??this.#y,i=this.#x(r," "),s=e.symbol??" ",n=e.text??this.text,o=typeof n=="string"?(s?" ":"")+n:"",c=e.suffixText??this.#p,l=this.#E(c," "),u=i+s+o+l+`
|
|
69
|
-
`;return this.stop(),this.#s.write(u),this}};function ks(t){return new
|
|
70
|
+
`;return this.stop(),this.#s.write(u),this}};function ks(t){return new zl(t)}var er="#f87171",tr="#60a5fa",_$="#9b59b6",be="#fbbf24",ql="#9ca3af",Bs="#9b59b6",Mo="\u25A0",js="\u25CF",Us="\u2B25";function S$(t,e){if(e){let r=`https://app.wispbit.com/rules/${e}`;return S.dim(`\x1B]8;;${r}\x1B\\${t}\x1B]8;;\x1B\\`)}return S.dim(t)}function dy(t,e){return t.length<=e?t:t.substring(0,e-3)+"..."}var uy="#f8f8f8",hy="#888888",R$=[S.hex(be)("~(oo)~"),S.hex(be)("~(oO)~"),S.hex(be)("~(Oo)~"),S.hex(be)("~(OO)~"),S.hex(be)("~(\u25CFo)~"),S.hex(be)("~(o\u25CF)~"),S.hex(be)("~(\u25C9o)~"),S.hex(be)("~(o\u25C9)~"),S.hex(be)("\\(oo)/"),S.hex(be)("\\(oO)/"),S.hex(be)("\\(Oo)/"),S.hex(be)("\\(OO)/"),S.hex(be)("~(Oo)~"),S.hex(be)("~(oO)~"),S.hex(be)("~(\u25CEo)~"),S.hex(be)("~(o\u25CE)~"),S.hex(be)("~(oo)~"),S.hex(be)("~(OO)~"),S.hex(be)("~(Oo)~"),S.hex(be)("\\(oo)/"),S.hex(be)("\\(oO)/"),S.hex(be)("\\(Oo)/"),S.hex(be)("\\(OO)/")];function fy(t,e){return e===1?t:`${t}s`}function C$(t,e={}){let i=e.align||[],s=e.stringLength||(a=>py(a).length),n=t.reduce((a,o)=>(o.forEach((c,l)=>{let u=s(c);(!a[l]||u>a[l])&&(a[l]=u)}),a),[]);return t.map(a=>a.map((o,c)=>{let l=n[c]-s(o)||0,u=Array(Math.max(l+1,1)).join(" ");return i[c]==="r"?u+o:o+u}).join(" ").trimEnd()).join(`
|
|
70
71
|
`)}function my(t,e){let r=`
|
|
71
|
-
`,i=0,s=0,n=new Map;t.forEach(p=>{if(p.matches.length===0)return;let m=p.ruleId||"unknown";n.has(m)||n.set(m,{message:p.message,severity:p.severity,internalId:p.internalId,execution:p.execution,matches:[]});let y=n.get(m);p.matches.forEach(
|
|
72
|
+
`,i=0,s=0,n=new Map;t.forEach(p=>{if(p.matches.length===0)return;let m=p.ruleId||"unknown";n.has(m)||n.set(m,{message:p.message,severity:p.severity,internalId:p.internalId,execution:p.execution,matches:[]});let y=n.get(m);p.matches.forEach(b=>{y.matches.push({file:{path:b.file.path,sha:b.file.sha},line:b.range.start.line,column:b.range.start.column,endLine:b.range.end.line!==b.range.start.line?b.range.end.line:void 0,text:b.text,description:b.description,evidence:b.evidence?.map(w=>({file:{path:w.file.path,sha:w.file.sha},text:w.text,range:w.range,description:w.description}))}),p.severity==="violation"?i++:s++})}),n.forEach((p,m)=>{if(p.matches.length===0&&p.severity!=="skipped")return;let y;p.severity==="violation"?y=S.hex(er)(Mo):p.severity==="suggestion"?y=S.hex(tr)(js):y=S.hex(_$)(js);let b=p.execution==="llm"?`${S.hex(Bs)(Us)} `:"",w;if(p.internalId){let f=`https://app.wispbit.com/rules/${p.internalId}`;w=S.bold(`\x1B]8;;${f}\x1B\\${m}\x1B]8;;\x1B\\`)}else w=S.bold(m);let x=`${y} ${b}${w} ${p.message.replace(/([^ ])\.$/u,"$1")}`;if(r+=`${x}
|
|
72
73
|
`,r+=`${S.dim("\u2500".repeat(80))}
|
|
73
74
|
`,p.severity==="skipped")r+=`
|
|
74
|
-
`;else{let
|
|
75
|
-
|
|
76
|
-
`).
|
|
77
|
-
`,
|
|
78
|
-
`
|
|
79
|
-
|
|
80
|
-
`
|
|
81
|
-
`)
|
|
82
|
-
|
|
83
|
-
`)
|
|
84
|
-
`})}else{let C=`${A.range.start.line}:${A.range.end.line}`,O=A.description?` - ${S.dim(A.description)}`:"";r+=` ${A.file.path} ${S.dim(`(${C})`)}${O}
|
|
85
|
-
`}}),_<h.length-1&&(r+=`
|
|
86
|
-
`)}):h.forEach(x=>{let _=x.endLine?`(${x.line}:${x.endLine})`:`(${x.line})`,A=x.description?` - ${S.dim(x.description)}`:"";r+=` ${x.file.path} ${S.dim(_)}${A}
|
|
87
|
-
`,x.evidence&&x.evidence.length>0&&x.evidence.forEach(C=>{let O=`${C.range.start.line}:${C.range.end.line}`,F=C.description?` - ${S.dim(C.description)}`:"";r+=` ${C.file.path} ${S.dim(`(${O})`)}${F}
|
|
88
|
-
`})}),r+=`
|
|
75
|
+
`;else{let f=p.matches.sort((v,E)=>v.file.path.localeCompare(E.file.path));f.forEach((v,E)=>{if(v.text){let _=v.description?` - ${S.dim(v.description)}`:"";r+=` ${v.file.path}${_}
|
|
76
|
+
`,v.text.split(`
|
|
77
|
+
`).forEach((C,$)=>{let F=v.line+$,M=S.bgHex(uy).hex(hy)(` ${String(F)} `);r+=` ${M} ${S.dim(C)}
|
|
78
|
+
`})}else{let _=v.endLine?`(${v.line}:${v.endLine})`:`(${v.line})`,O=v.description?` - ${S.dim(v.description)}`:"";r+=` ${v.file.path} ${S.dim(_)}${O}
|
|
79
|
+
`}v.evidence&&v.evidence.length>0&&v.evidence.forEach(_=>{if(_.text){let O=_.description?` - ${S.dim(_.description)}`:"";r+=` ${_.file.path}${O}
|
|
80
|
+
`,_.text.split(`
|
|
81
|
+
`).forEach(($,F)=>{let M=_.range.start.line+F,I=S.bgHex(uy).hex(hy)(` ${String(M)} `);r+=` ${I} ${S.dim($)}
|
|
82
|
+
`})}else{let O=`${_.range.start.line}:${_.range.end.line}`,C=_.description?` - ${S.dim(_.description)}`:"";r+=` ${_.file.path} ${S.dim(`(${O})`)}${C}
|
|
83
|
+
`}}),E<f.length-1&&(r+=`
|
|
84
|
+
`)}),r+=`
|
|
89
85
|
|
|
90
|
-
`}}),console.log(r);let a=i+s,o=i>0?`${S.dim("violations".padStart(12))} ${S.hex(er)(Mo)} ${S.hex(er).bold(i)}`:`${S.dim("violations".padStart(12))} ${S.dim(i)}`,c=s>0?`${S.dim("suggestions".padStart(12))} ${S.hex(tr)(js)} ${S.hex(tr).bold(s)}`:`${S.dim("suggestions".padStart(12))} ${S.dim(s)}`,l=e.totalFiles?`${e.totalFiles} ${
|
|
91
|
-
`,
|
|
92
|
-
`,
|
|
93
|
-
`,console.log(a>0?S.reset(
|
|
86
|
+
`}}),console.log(r);let a=i+s,o=i>0?`${S.dim("violations".padStart(12))} ${S.hex(er)(Mo)} ${S.hex(er).bold(i)}`:`${S.dim("violations".padStart(12))} ${S.dim(i)}`,c=s>0?`${S.dim("suggestions".padStart(12))} ${S.hex(tr)(js)} ${S.hex(tr).bold(s)}`:`${S.dim("suggestions".padStart(12))} ${S.dim(s)}`,l=e.totalFiles?`${e.totalFiles} ${fy("file",e.totalFiles)}`:"0 files",u=`${e.totalRules} ${fy("rule",e.totalRules)}`,d=e.executionTime?`${Math.round(e.executionTime)}ms`:"",g=[l,u,d].filter(Boolean).join(", "),h="";h+=`${o}
|
|
87
|
+
`,h+=`${c}
|
|
88
|
+
`,h+=`${S.dim("summary".padStart(12))} ${g}
|
|
89
|
+
`,console.log(a>0?S.reset(h):h),i>0&&process.exit(1)}function gy(t){if(t.length===0){console.log(S.yellow("No rules found.")),console.log(S.dim("Go to https://app.wispbit.com/rules to create a rule."));return}let e=[];e.push(["",`${"id".padEnd(12)} ${S.dim("\u2502")} ${"severity".padEnd(16)} ${S.dim("\u2502")} ${"execution".padEnd(18)} ${S.dim("\u2502")} message`]);let r=process.stdout.columns||120,s=Math.max(20,r-55-10);e.push(["",`${S.dim("\u2500".repeat(12))} ${S.dim("\u253C")} ${S.dim("\u2500".repeat(16))} ${S.dim("\u253C")} ${S.dim("\u2500".repeat(18))} ${S.dim("\u253C")} ${S.dim("\u2500".repeat(s))}`]);for(let a of t){let o=a.config.severity==="violation"?Mo:js,c=a.config.severity==="violation"?S.hex(er).bold:S.hex(tr).bold,u=(a.config.severity==="violation"?S.hex(er):S.hex(tr))(o)+" "+c(a.config.severity),d=S$(a.id,a.internalId),g=a.config.execution==="llm"?S.hex(Bs)(Us)+" "+S.hex(Bs)("llm"):S.hex(ql)(Us)+" "+S.hex(ql)("deterministic"),h=dy(a.config.message,s),p=Math.max(0,12-a.id.length),m=Math.max(0,16-(a.config.severity.length+2)),y=Math.max(0,18-(a.config.execution.length+2));e.push(["",`${d}${" ".repeat(p)} ${S.dim("\u2502")} ${u}${" ".repeat(m)} ${S.dim("\u2502")} ${g}${" ".repeat(y)} ${S.dim("\u2502")} ${h}`])}let n=C$(e,{align:["","l"],stringLength(a){return py(a).length}});console.log(`
|
|
94
90
|
`+n),console.log(S.dim(`
|
|
95
|
-
Use 'wispbit check --rule <rule-id>' to run a specific rule.`))}function yy(t,e="pretty"){let r=[];for(let i of t)for(let s of i.matches){let n={file:s.file,range:s.range,language:s.language,text:s.text,evidence:s.evidence,ruleId:i.ruleId,internalId:i.internalId,severity:i.severity,message:i.message};r.push(n)}if(e==="stream")for(let i of r)console.log(JSON.stringify(i));else console.log(e==="compact"?JSON.stringify(r):JSON.stringify(r,null,2))}function by(t,e=!1){let r=null,i=null,s=null,n=new Map,a=()=>{if(!r)return;let o=[],c=process.stdout.columns||120;for(let[u,{isLlm:d,message:
|
|
96
|
-
${
|
|
97
|
-
${C}`)}else if(m.toolName==="grep"){let
|
|
98
|
-
${
|
|
99
|
-
${
|
|
91
|
+
Use 'wispbit check --rule <rule-id>' to run a specific rule.`))}function yy(t,e="pretty"){let r=[];for(let i of t)for(let s of i.matches){let n={file:s.file,range:s.range,language:s.language,text:s.text,evidence:s.evidence,ruleId:i.ruleId,internalId:i.internalId,severity:i.severity,message:i.message};r.push(n)}if(e==="stream")for(let i of r)console.log(JSON.stringify(i));else console.log(e==="compact"?JSON.stringify(r):JSON.stringify(r,null,2))}function by(t,e=!1){let r=null,i=null,s=null,n=new Map,a=()=>{if(!r)return;let o=[],c=process.stdout.columns||120;for(let[u,{isLlm:d,message:g,severity:h,dotAnimationFrame:p,toolInfo:m,validationPhase:y}]of n){if(m||y){let O=n.get(u);O.dotAnimationFrame=(O.dotAnimationFrame+1)%3}let b=p+1,w=S.hex(be)(".".repeat(b).padEnd(3," ")),x=h==="violation"?S.hex(er)(Mo):S.hex(tr)(js),f=d?`${S.hex(Bs)(Us)} ${S.hex(Bs)("llm")}`:S.hex(ql)(Us),v=Math.max(40,c-50),E=dy(g,v),_=`${x} ${f} ${S.dim(u)} ${E}`;if(y){let O=` ${w} ${S.dim(`validating ${y.matchCount} ${y.matchCount===1?"match":"matches"}`)}`;o.push(`${_}
|
|
92
|
+
${O}`)}else if(m)if(m.toolName==="read"&&m.file){let O="";if(m.offset||m.limit){let $=m.offset?parseInt(m.offset,10):1,F=m.limit?parseInt(m.limit,10):200,M=$+F-1;O=` ${S.dim(`(lines ${$}-${M})`)}`}let C=` ${w} ${S.dim("tool: read")} ${m.file}${O}`;o.push(`${_}
|
|
93
|
+
${C}`)}else if(m.toolName==="grep"){let O=m.path||".",C=m.pattern||"",$=` ${w} ${S.dim("tool: grep")} ${O} ${S.dim(`for "${C}"`)}`;o.push(`${_}
|
|
94
|
+
${$}`)}else if(m.toolName==="glob"){let O=m.path||".",C=m.pattern||"",$=` ${w} ${S.dim("tool: glob")} ${O} ${S.dim(`for "${C}"`)}`;o.push(`${_}
|
|
95
|
+
${$}`)}else o.push(_);else o.push(_)}let l="";if(s&&(s.mode==="check"?l=s.filePath?` ${S.dim(`(${s.filePath})`)}`:"":s.mode==="diff"&&(l=` ${S.dim(`(${s.baseCommit} \u2192 ${s.headCommit})`)}`)),o.length>0){let u=o.map((d,g)=>g===0?d:d.split(`
|
|
100
96
|
`).map((p,m)=>m===0?` ${p}`:p).join(`
|
|
101
97
|
`));r.text=`${u.join(`
|
|
102
98
|
`)}${l}`}else r.text=`${l}`};return t.on("execution:mode",o=>{s=o}),t.on("rules:start",o=>{r=ks({spinner:{interval:120,frames:R$},color:!1}).start();let c=()=>{r&&r.stopAndPersist(),process.exit(130)};process.on("SIGINT",c),process.on("SIGTERM",c);let l=setInterval(()=>{a()},200);r._updateInterval=l}),t.on("rules:rule-start",o=>{n.set(o.ruleId,{isLlm:o.isLlm,message:o.message,severity:o.severity,dotAnimationFrame:0}),a()}),t.on("rules:rule-complete",o=>{n.delete(o.ruleId),a()}),t.on("llm:tool-execution",o=>{let c=n.get(o.ruleId);c&&(c.toolInfo={toolName:o.toolName,file:o.file,path:o.path,pattern:o.pattern,offset:o.offset,limit:o.limit},a())}),t.on("llm:validation-phase:start",o=>{let c=n.get(o.ruleId);c&&(c.toolInfo=void 0,c.validationPhase={matchCount:o.matchCount},a())}),t.on("rules:progress",o=>{a()}),t.on("rules:complete",()=>{r&&(r._updateInterval&&clearInterval(r._updateInterval),r.stopAndPersist(),r=null),n.clear()}),t.on("files:discovery:start",o=>{e&&console.log(`
|
|
@@ -144,7 +140,7 @@ ${S.hex(le)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\
|
|
|
144
140
|
`)),console.log(S.dim(" To use wispbit, you need an API key.")),console.log(S.dim(` You can get one at: https://app.wispbit.com/api-keys
|
|
145
141
|
`));let t=await T$(S.bold.hex(tr)(" Enter your Wispbit API key (or press Enter to exit): "));return t||(console.log(S.dim(`
|
|
146
142
|
Setup cancelled.`)),null)}xy.default.config();function _y(){return ko.join(wy.homedir(),".powerlint","config.json")}async function P$(t){let e=_y(),r=ko.dirname(e);await Br.mkdir(r,{recursive:!0});let i={};try{let n=await Br.readFile(e,"utf-8");i=JSON.parse(n)}catch{}let s={...i,apiKey:t};await Br.writeFile(e,JSON.stringify(s,null,2))}async function I$(){if(process.env.WISPBIT_API_KEY)return process.env.WISPBIT_API_KEY;let t=_y();try{let e=await Br.readFile(t,"utf-8");return JSON.parse(e).apiKey||null}catch{return null}}async function Sy(t){let e=process.env.WISPBIT_API_KEY||null;e||(e=await I$());let r=await us.initialize(t,{apiKey:e||void 0});if("failed"in r){if(r.error==="INVALID_API_KEY"){let i=await vy();if(i||process.exit(0),await t.getRepositoryUrl()||(console.log(S.red("Repository URL not found. Make sure you're in a git repository.")),process.exit(1)),console.log(S.dim("Validating API key...")),await P$(i),r=await us.initialize(t,{apiKey:i}),"failed"in r)console.log(S.red("Invalid API key. Please check your API key and try again.")),process.exit(1);else return console.log(S.green("Setup complete! powerlint has been configured.")),r}else if(r.error==="INVALID_REPOSITORY"){let i=await t.getRepositoryUrl();console.log(S.red(`No repository in wispbit found for url: ${i}. If you are passing the repository URL as a flag, make sure it is correct. If your git remote URL was recently modified, use "git remote set-url origin <new-url>" to update the remote URL.`)),process.exit(1)}}return r}async function F$(){let t=Ir(),e=await Pm();Ey.default.gt(e,t)&&(console.log(S.bgHex("#b2f5ea").black.bold(` NEW VERSION AVAILABLE: ${e} (current: ${t}) `)),console.log(S.bgHex("#b2f5ea").black.bold(` Run 'pnpm install -g @wispbit/local' to update
|
|
147
|
-
`)))}var
|
|
143
|
+
`)))}var pe=Vh(`
|
|
148
144
|
wispbit - the linter for AI
|
|
149
145
|
https://wispbit.com/
|
|
150
146
|
|
|
@@ -189,8 +185,8 @@ Global options:
|
|
|
189
185
|
--repo-url <url> Override repository URL (default: from git remote)
|
|
190
186
|
-v, --version Show version number
|
|
191
187
|
-h, --help Show help
|
|
192
|
-
`,{importMeta:import.meta,flags:{rule:{type:"string"},json:{type:"string"},include:{type:"string"},repoUrl:{type:"string"},debug:{type:"boolean",shortFlag:"d",default:!1},version:{type:"boolean",shortFlag:"v"},help:{type:"boolean",shortFlag:"h"}},version:Ir()});async function Vl(t){let e=new pi({repositoryUrl:t.repoUrl}),r=await Sy(e),{ruleId:i,json:s,mode:n,filePath:a}=t,{commitSelector:o,diffInclude:c}=t;if(n==="diff"){let
|
|
193
|
-
${S.green("Cache purged successfully.")} Removed ${
|
|
188
|
+
`,{importMeta:import.meta,flags:{rule:{type:"string"},json:{type:"string"},include:{type:"string"},repoUrl:{type:"string"},debug:{type:"boolean",shortFlag:"d",default:!1},version:{type:"boolean",shortFlag:"v"},help:{type:"boolean",shortFlag:"h"}},version:Ir()});async function Vl(t){let e=new pi({repositoryUrl:t.repoUrl}),r=await Sy(e),{ruleId:i,json:s,mode:n,filePath:a}=t,{commitSelector:o,diffInclude:c}=t;if(n==="diff"){let x=e.getWorkspaceRoot();if(o)c||(c=(await qc(x)).include);else{let f=await qc(x);o=f.commitSelector,c||(c=f.include)}}if(n==="diff"&&o&&c){let x=e.getWorkspaceRoot(),f=await Gc(x),v=zc(o,c,f);v&&(console.error(S.red(v)),process.exit(1))}let l=!1,u="pretty";s!==void 0?(l=!0,typeof s=="string"?s==="stream"?u="stream":s==="compact"?u="compact":u="pretty":u="pretty"):await F$();let d;try{let x=new ds(r,e);i?d=[await x.loadRuleById(i)]:d=await x.loadAllRules()}catch(x){throw x instanceof Oo&&(console.error(S.red("Rule Validation Error:"),x.message),x.validationErrors&&x.validationErrors.length>0&&(console.error(S.red("Validation errors:")),x.validationErrors.forEach(f=>{console.error(S.red(" \u2022"),f)})),process.exit(1)),x}if(!l)if(n==="check"){let x=S.bgHex("#eab308").black(" CHECK "),f=S.dim(` (${a||"all files"})`);console.log(`${x}${f}`)}else{let x=S.bgHex("#4a90e2").black(" DIFF "),f=(o||"").replace(/\b[0-9a-f]{30,}\b/gi,E=>E.substring(0,7)),v=c?` ${f} ${S.dim(`[${c.join("/")}]`)}`:` ${f}`;console.log(`${x}${v}`)}let g=new nt;if(n==="check")g.setExecutionMode("check",{filePath:a});else{let x=c?c.join(", "):"all";g.setExecutionMode("diff",{baseCommit:o||"",headCommit:x})}let h=t.json?void 0:by(g,t.debug||!1),p=Date.now(),m=new Lo(r,e,g),y=0;g.on("files:discovery:complete",x=>{y=x.totalFiles});let b=await m.execute(d,{mode:n,filePath:a,diffOptions:n==="diff"?{include:c,commitSelector:o}:void 0}),w=[];for(let x of b){let f=d.find(v=>v.id===x.ruleId);if(f){let _={ruleId:x.ruleId,internalId:f.internalId,message:f.config.message,severity:f.config.severity,execution:f.config.execution,matches:x.matches,llmCost:void 0,llmTokens:void 0};w.push(_)}}if(h?.(),l)yy(w,u);else{let x=w.filter(M=>M.severity==="violation"),f=w.filter(M=>M.severity==="suggestion"),v=x.reduce((M,I)=>M+I.matches.length,0),E=f.reduce((M,I)=>M+I.matches.length,0),_=v+E,O=w.filter(M=>M.llmCost).reduce((M,I)=>M.plus(new Ke(I.llmCost||0)),new Ke(0)),C=w.filter(M=>M.llmTokens).reduce((M,I)=>M+(I.llmTokens||0),0),$;if(n==="check")$={mode:"check",filePath:a};else{let M=(o||"").replace(/\b[0-9a-f]{30,}\b/gi,Y=>Y.substring(0,7)),I=c?c.join(", "):"all";$={mode:"diff",baseCommit:M,headCommit:I}}let F=Date.now()-p;my(w,{totalRules:d.length,violationCount:v,suggestionCount:E,totalMatches:_,totalLLMCost:O.toString(),totalLLMTokens:C,executionMode:$,executionTime:F,totalFiles:y})}return w}async function N$(t){let e=new pi({repositoryUrl:t}),r=await Sy(e),s=await new ds(r,e).loadAllRules();gy(s)}async function D$(){let t=pe.input[0],e=pe.input[1],r=pe.flags.debug;switch(t){case"check":{let i=pe.input[1];await Vl({ruleId:pe.flags.rule,json:pe.flags.json,debug:pe.flags.debug,mode:"check",filePath:i,repoUrl:pe.flags.repoUrl});break}case"diff":{let i;if(pe.flags.include){let a=pe.flags.include.split(",").map(l=>l.trim()),o=["committed","staged","unstaged","untracked"],c=a.filter(l=>!o.includes(l));c.length>0&&(console.error(S.red(`Invalid include(s): ${c.join(", ")}. Valid includes: ${o.join(", ")}`)),process.exit(1)),i=a}let s=pe.input[1];await Vl({ruleId:pe.flags.rule,json:pe.flags.json,debug:pe.flags.debug,mode:"diff",diffInclude:i,commitSelector:s,repoUrl:pe.flags.repoUrl});break}case"list":{await N$(pe.flags.repoUrl);break}case"cache":{if(e==="purge"){let i=new pi({repositoryUrl:pe.flags.repoUrl}),n=await new zn(i).purgeCache();console.log(`
|
|
189
|
+
${S.green("Cache purged successfully.")} Removed ${n.deletedCount} item(s).`)}else console.error(S.red("Unknown cache subcommand:"),e),pe.showHelp(),process.exit(1);break}default:{let i;if(pe.flags.include){let a=pe.flags.include.split(",").map(l=>l.trim()),o=["committed","staged","unstaged","untracked"],c=a.filter(l=>!o.includes(l));c.length>0&&(console.error(S.red(`Invalid include(s): ${c.join(", ")}. Valid includes: ${o.join(", ")}`)),process.exit(1)),i=a}let s=pe.input[0];await Vl({ruleId:pe.flags.rule,json:pe.flags.json,debug:pe.flags.debug,mode:"diff",diffInclude:i,commitSelector:s,repoUrl:pe.flags.repoUrl});break}}return r}D$().catch(t=>{pe.flags.debug?console.error(t):console.error(S.red("Error:"),t.message||String(t)),process.exit(1)});export{F$ as checkForUpdates};
|
|
194
190
|
/*! Bundled license information:
|
|
195
191
|
|
|
196
192
|
deep-extend/lib/deep-extend.js:
|