@wispbit/local 1.0.36 → 1.0.37

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.
Files changed (2) hide show
  1. package/cli-bundle.js +93 -91
  2. package/package.json +1 -1
package/cli-bundle.js CHANGED
@@ -1,108 +1,110 @@
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 Cy=Object.create;var Gs=Object.defineProperty;var Ly=Object.getOwnPropertyDescriptor;var Oy=Object.getOwnPropertyNames;var $y=Object.getPrototypeOf,Ty=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 Py=(t,e)=>()=>(t&&(e=t(t=0)),e);var j=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Do=(t,e)=>{for(var r in e)Gs(t,r,{get:e[r],enumerable:!0})},ql=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Oy(e))!Ty.call(t,s)&&s!==r&&Gs(t,s,{get:()=>e[s],enumerable:!(i=Ly(e,s))||i.enumerable});return t};var We=(t,e,r)=>(r=t!=null?Cy($y(t)):{},ql(e||!t||!t.__esModule?Gs(r,"default",{value:t,enumerable:!0}):r,t)),Iy=t=>ql(Gs({},"__esModule",{value:!0}),t);var su=j((K$,sb)=>{sb.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 cu=j((Y$,Ct)=>{var Uo=D("fs"),Go=D("path"),nb=D("os"),ob=D("crypto"),ab=su(),qo=ab.version,cb=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function lb(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
4
- `);let i;for(;(i=cb.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 ub(t){let e=au(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=ou(t).split(","),s=i.length,n;for(let a=0;a<s;a++)try{let o=i[a].trim(),c=db(r,o);n=_e.decrypt(c.ciphertext,c.key);break}catch(o){if(a+1>=s)throw o}return _e.parse(n)}function fb(t){console.log(`[dotenv@${qo}][INFO] ${t}`)}function hb(t){console.log(`[dotenv@${qo}][WARN] ${t}`)}function Vs(t){console.log(`[dotenv@${qo}][DEBUG] ${t}`)}function ou(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 db(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 au(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)Uo.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=Go.resolve(process.cwd(),".env.vault");return Uo.existsSync(e)?e:null}function nu(t){return t[0]==="~"?Go.join(nb.homedir(),t.slice(1)):t}function pb(t){fb("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 mb(t){let e=Go.resolve(process.cwd(),".env"),r="utf8",i=!!(t&&t.debug);t&&t.encoding?r=t.encoding:i&&Vs("No encoding is specified. UTF-8 is used by default");let s=[e];if(t&&t.path)if(!Array.isArray(t.path))s=[nu(t.path)];else{s=[];for(let c of t.path)s.push(nu(c))}let n,a={};for(let c of s)try{let l=_e.parse(Uo.readFileSync(c,{encoding:r}));_e.populate(a,l,t)}catch(l){i&&Vs(`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 gb(t){if(ou(t).length===0)return _e.configDotenv(t);let e=au(t);return e?_e._configVault(t):(hb(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),_e.configDotenv(t))}function yb(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=ob.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 bb(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&&Vs(s===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):t[n]=e[n]}var _e={configDotenv:mb,_configVault:pb,_parseVault:ub,config:gb,decrypt:yb,parse:lb,populate:bb};Ct.exports.configDotenv=_e.configDotenv;Ct.exports._configVault=_e._configVault;Ct.exports._parseVault=_e._parseVault;Ct.exports.config=_e.config;Ct.exports.decrypt=_e.decrypt;Ct.exports.parse=_e.parse;Ct.exports.populate=_e.populate;Ct.exports=_e});var zi=j(($T,zf)=>{"use strict";var d1="2.0.0",p1=Number.MAX_SAFE_INTEGER||9007199254740991,m1=16,g1=250,y1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];zf.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:m1,MAX_SAFE_BUILD_LENGTH:g1,MAX_SAFE_INTEGER:p1,RELEASE_TYPES:y1,SEMVER_SPEC_VERSION:d1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Wi=j((TT,Wf)=>{"use strict";var b1=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Wf.exports=b1});var Yr=j((vt,Vf)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ka,MAX_SAFE_BUILD_LENGTH:v1,MAX_LENGTH:w1}=zi(),x1=Wi();vt=Vf.exports={};var E1=vt.re=[],_1=vt.safeRe=[],z=vt.src=[],S1=vt.safeSrc=[],W=vt.t={},R1=0,ja="[a-zA-Z0-9-]",A1=[["\\s",1],["\\d",w1],[ja,v1]],C1=t=>{for(let[e,r]of A1)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ie=(t,e,r)=>{let i=C1(e),s=R1++;x1(t,s,e),W[t]=s,z[s]=e,S1[s]=i,E1[s]=new RegExp(e,r?"g":void 0),_1[s]=new RegExp(i,r?"g":void 0)};ie("NUMERICIDENTIFIER","0|[1-9]\\d*");ie("NUMERICIDENTIFIERLOOSE","\\d+");ie("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ja}*`);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",`${ja}+`);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,${ka}})(?:\\.(\\d{1,${ka}}))?(?:\\.(\\d{1,${ka}}))?`);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 Js=j((PT,Hf)=>{"use strict";var L1=Object.freeze({loose:!0}),O1=Object.freeze({}),$1=t=>t?typeof t!="object"?L1:t:O1;Hf.exports=$1});var Ba=j((IT,Xf)=>{"use strict";var Kf=/^[0-9]+$/,Yf=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Kf.test(t),i=Kf.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:t<e?-1:1},T1=(t,e)=>Yf(e,t);Xf.exports={compareIdentifiers:Yf,rcompareIdentifiers:T1}});var Ie=j((FT,Jf)=>{"use strict";var Qs=Wi(),{MAX_LENGTH:Zf,MAX_SAFE_INTEGER:en}=zi(),{safeRe:tn,t:rn}=Yr(),P1=Js(),{compareIdentifiers:Ua}=Ba(),Ga=class t{constructor(e,r){if(r=P1(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>Zf)throw new TypeError(`version is longer than ${Zf} characters`);Qs("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=e.trim().match(r.loose?tn[rn.LOOSE]:tn[rn.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>en||this.major<0)throw new TypeError("Invalid major version");if(this.minor>en||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>en||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<en)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(Qs("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(Qs("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 Ua(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(Qs("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 Ua(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?tn[rn.PRERELEASELOOSE]:tn[rn.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]),Ua(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}};Jf.exports=Ga});var ar=j((NT,eh)=>{"use strict";var Qf=Ie(),I1=(t,e,r=!1)=>{if(t instanceof Qf)return t;try{return new Qf(t,e)}catch(i){if(!r)return null;throw i}};eh.exports=I1});var rh=j((DT,th)=>{"use strict";var F1=ar(),N1=(t,e)=>{let r=F1(t,e);return r?r.version:null};th.exports=N1});var sh=j((MT,ih)=>{"use strict";var D1=ar(),M1=(t,e)=>{let r=D1(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};ih.exports=M1});var ah=j((kT,oh)=>{"use strict";var nh=Ie(),k1=(t,e,r,i,s)=>{typeof r=="string"&&(s=i,i=r,r=void 0);try{return new nh(t instanceof nh?t.version:t,r).inc(e,i,s).version}catch{return null}};oh.exports=k1});var uh=j((jT,lh)=>{"use strict";var ch=ar(),j1=(t,e)=>{let r=ch(t,null,!0),i=ch(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"};lh.exports=j1});var hh=j((BT,fh)=>{"use strict";var B1=Ie(),U1=(t,e)=>new B1(t,e).major;fh.exports=U1});var ph=j((UT,dh)=>{"use strict";var G1=Ie(),q1=(t,e)=>new G1(t,e).minor;dh.exports=q1});var gh=j((GT,mh)=>{"use strict";var z1=Ie(),W1=(t,e)=>new z1(t,e).patch;mh.exports=W1});var bh=j((qT,yh)=>{"use strict";var V1=ar(),H1=(t,e)=>{let r=V1(t,e);return r&&r.prerelease.length?r.prerelease:null};yh.exports=H1});var Je=j((zT,wh)=>{"use strict";var vh=Ie(),K1=(t,e,r)=>new vh(t,r).compare(new vh(e,r));wh.exports=K1});var Eh=j((WT,xh)=>{"use strict";var Y1=Je(),X1=(t,e,r)=>Y1(e,t,r);xh.exports=X1});var Sh=j((VT,_h)=>{"use strict";var Z1=Je(),J1=(t,e)=>Z1(t,e,!0);_h.exports=J1});var sn=j((HT,Ah)=>{"use strict";var Rh=Ie(),Q1=(t,e,r)=>{let i=new Rh(t,r),s=new Rh(e,r);return i.compare(s)||i.compareBuild(s)};Ah.exports=Q1});var Lh=j((KT,Ch)=>{"use strict";var ex=sn(),tx=(t,e)=>t.sort((r,i)=>ex(r,i,e));Ch.exports=tx});var $h=j((YT,Oh)=>{"use strict";var rx=sn(),ix=(t,e)=>t.sort((r,i)=>rx(i,r,e));Oh.exports=ix});var Vi=j((XT,Th)=>{"use strict";var sx=Je(),nx=(t,e,r)=>sx(t,e,r)>0;Th.exports=nx});var nn=j((ZT,Ph)=>{"use strict";var ox=Je(),ax=(t,e,r)=>ox(t,e,r)<0;Ph.exports=ax});var qa=j((JT,Ih)=>{"use strict";var cx=Je(),lx=(t,e,r)=>cx(t,e,r)===0;Ih.exports=lx});var za=j((QT,Fh)=>{"use strict";var ux=Je(),fx=(t,e,r)=>ux(t,e,r)!==0;Fh.exports=fx});var on=j((eP,Nh)=>{"use strict";var hx=Je(),dx=(t,e,r)=>hx(t,e,r)>=0;Nh.exports=dx});var an=j((tP,Dh)=>{"use strict";var px=Je(),mx=(t,e,r)=>px(t,e,r)<=0;Dh.exports=mx});var Wa=j((rP,Mh)=>{"use strict";var gx=qa(),yx=za(),bx=Vi(),vx=on(),wx=nn(),xx=an(),Ex=(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 gx(t,r,i);case"!=":return yx(t,r,i);case">":return bx(t,r,i);case">=":return vx(t,r,i);case"<":return wx(t,r,i);case"<=":return xx(t,r,i);default:throw new TypeError(`Invalid operator: ${e}`)}};Mh.exports=Ex});var jh=j((iP,kh)=>{"use strict";var _x=Ie(),Sx=ar(),{safeRe:cn,t:ln}=Yr(),Rx=(t,e)=>{if(t instanceof _x)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?cn[ln.COERCEFULL]:cn[ln.COERCE]);else{let c=e.includePrerelease?cn[ln.COERCERTLFULL]:cn[ln.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 Sx(`${i}.${s}.${n}${a}${o}`,e)};kh.exports=Rx});var Uh=j((sP,Bh)=>{"use strict";var Va=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}};Bh.exports=Va});var Qe=j((nP,Wh)=>{"use strict";var Ax=/\s+/g,Ha=class t{constructor(e,r){if(r=Lx(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ka)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(Ax," "),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=>!qh(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&&Nx(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&&Ix)|(this.options.loose&&Fx))+":"+e,s=Gh.get(i);if(s)return s;let n=this.options.loose,a=n?Ue[Fe.HYPHENRANGELOOSE]:Ue[Fe.HYPHENRANGE];e=e.replace(a,Wx(this.options.includePrerelease)),de("hyphen replace",e),e=e.replace(Ue[Fe.COMPARATORTRIM],$x),de("comparator trim",e),e=e.replace(Ue[Fe.TILDETRIM],Tx),de("tilde trim",e),e=e.replace(Ue[Fe.CARETTRIM],Px),de("caret trim",e);let o=e.split(" ").map(p=>Dx(p,this.options)).join(" ").split(/\s+/).map(p=>zx(p,this.options));n&&(o=o.filter(p=>(de("loose invalid filter",p,this.options),!!p.match(Ue[Fe.COMPARATORLOOSE])))),de("range list",o);let c=new Map,l=o.map(p=>new Ka(p,this.options));for(let p of l){if(qh(p))return[p];c.set(p.value,p)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Gh.set(i,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>zh(i,r)&&e.set.some(s=>zh(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 Ox(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Vx(this.set[r],e,this.options))return!0;return!1}};Wh.exports=Ha;var Cx=Uh(),Gh=new Cx,Lx=Js(),Ka=Hi(),de=Wi(),Ox=Ie(),{safeRe:Ue,t:Fe,comparatorTrimReplace:$x,tildeTrimReplace:Tx,caretTrimReplace:Px}=Yr(),{FLAG_INCLUDE_PRERELEASE:Ix,FLAG_LOOSE:Fx}=zi(),qh=t=>t.value==="<0.0.0-0",Nx=t=>t.value==="",zh=(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},Dx=(t,e)=>(t=t.replace(Ue[Fe.BUILD],""),de("comp",t,e),t=jx(t,e),de("caret",t),t=Mx(t,e),de("tildes",t),t=Ux(t,e),de("xrange",t),t=qx(t,e),de("stars",t),t),Ge=t=>!t||t.toLowerCase()==="x"||t==="*",Mx=(t,e)=>t.trim().split(/\s+/).map(r=>kx(r,e)).join(" "),kx=(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})},jx=(t,e)=>t.trim().split(/\s+/).map(r=>Bx(r,e)).join(" "),Bx=(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})},Ux=(t,e)=>(de("replaceXRanges",t,e),t.split(/\s+/).map(r=>Gx(r,e)).join(" ")),Gx=(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),p=u||Ge(o),b=p;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`:p&&(i=`>=${n}.${a}.0${c} <${n}.${+a+1}.0-0`),de("xRange return",i),i})},qx=(t,e)=>(de("replaceStars",t,e),t.trim().replace(Ue[Fe.STAR],"")),zx=(t,e)=>(de("replaceGTE0",t,e),t.trim().replace(Ue[e.includePrerelease?Fe.GTE0PRE:Fe.GTE0],"")),Wx=t=>(e,r,i,s,n,a,o,c,l,u,p,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(p)?c=`<${l}.${+u+1}.0-0`:b?c=`<=${l}.${u}.${p}-${b}`:t?c=`<${l}.${u}.${+p+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Vx=(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!==Ka.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 Hi=j((oP,Zh)=>{"use strict";var Ki=Symbol("SemVer ANY"),Za=class t{static get ANY(){return Ki}constructor(e,r){if(r=Vh(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Xa("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Ki?this.value="":this.value=this.operator+this.semver.version,Xa("comp",this)}parse(e){let r=this.options.loose?Hh[Kh.COMPARATORLOOSE]:Hh[Kh.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 Yh(i[2],this.options.loose):this.semver=Ki}toString(){return this.value}test(e){if(Xa("Comparator.test",e,this.options.loose),this.semver===Ki||e===Ki)return!0;if(typeof e=="string")try{e=new Yh(e,this.options)}catch{return!1}return Ya(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 Xh(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Xh(this.value,r).test(e.semver):(r=Vh(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("=")||Ya(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ya(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Zh.exports=Za;var Vh=Js(),{safeRe:Hh,t:Kh}=Yr(),Ya=Wa(),Xa=Wi(),Yh=Ie(),Xh=Qe()});var Yi=j((aP,Jh)=>{"use strict";var Hx=Qe(),Kx=(t,e,r)=>{try{e=new Hx(e,r)}catch{return!1}return e.test(t)};Jh.exports=Kx});var ed=j((cP,Qh)=>{"use strict";var Yx=Qe(),Xx=(t,e)=>new Yx(t,e).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));Qh.exports=Xx});var rd=j((lP,td)=>{"use strict";var Zx=Ie(),Jx=Qe(),Qx=(t,e,r)=>{let i=null,s=null,n=null;try{n=new Jx(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!i||s.compare(a)===-1)&&(i=a,s=new Zx(i,r))}),i};td.exports=Qx});var sd=j((uP,id)=>{"use strict";var eE=Ie(),tE=Qe(),rE=(t,e,r)=>{let i=null,s=null,n=null;try{n=new tE(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!i||s.compare(a)===1)&&(i=a,s=new eE(i,r))}),i};id.exports=rE});var ad=j((fP,od)=>{"use strict";var Ja=Ie(),iE=Qe(),nd=Vi(),sE=(t,e)=>{t=new iE(t,e);let r=new Ja("0.0.0");if(t.test(r)||(r=new Ja("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 Ja(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||nd(o,n))&&(n=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!r||nd(r,n))&&(r=n)}return r&&t.test(r)?r:null};od.exports=sE});var ld=j((hP,cd)=>{"use strict";var nE=Qe(),oE=(t,e)=>{try{return new nE(t,e).range||"*"}catch{return null}};cd.exports=oE});var un=j((dP,dd)=>{"use strict";var aE=Ie(),hd=Hi(),{ANY:cE}=hd,lE=Qe(),uE=Yi(),ud=Vi(),fd=nn(),fE=an(),hE=on(),dE=(t,e,r,i)=>{t=new aE(t,i),e=new lE(e,i);let s,n,a,o,c;switch(r){case">":s=ud,n=fE,a=fd,o=">",c=">=";break;case"<":s=fd,n=hE,a=ud,o="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(uE(t,e,i))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],p=null,b=null;if(u.forEach(f=>{f.semver===cE&&(f=new hd(">=0.0.0")),p=p||f,b=b||f,s(f.semver,p.semver,i)?p=f:a(f.semver,b.semver,i)&&(b=f)}),p.operator===o||p.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};dd.exports=dE});var md=j((pP,pd)=>{"use strict";var pE=un(),mE=(t,e,r)=>pE(t,e,">",r);pd.exports=mE});var yd=j((mP,gd)=>{"use strict";var gE=un(),yE=(t,e,r)=>gE(t,e,"<",r);gd.exports=yE});var wd=j((gP,vd)=>{"use strict";var bd=Qe(),bE=(t,e,r)=>(t=new bd(t,r),e=new bd(e,r),t.intersects(e,r));vd.exports=bE});var Ed=j((yP,xd)=>{"use strict";var vE=Yi(),wE=Je();xd.exports=(t,e,r)=>{let i=[],s=null,n=null,a=t.sort((u,p)=>wE(u,p,r));for(let u of a)vE(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,p]of i)u===p?o.push(u):!p&&u===a[0]?o.push("*"):p?u===a[0]?o.push(`<=${p}`):o.push(`${u} - ${p}`):o.push(`>=${u}`);let c=o.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Ld=j((bP,Cd)=>{"use strict";var _d=Qe(),ec=Hi(),{ANY:Qa}=ec,Xi=Yi(),tc=Je(),xE=(t,e,r={})=>{if(t===e)return!0;t=new _d(t,r),e=new _d(e,r);let i=!1;e:for(let s of t.set){for(let n of e.set){let a=_E(s,n,r);if(i=i||a!==null,a)continue e}if(i)return!1}return!0},EE=[new ec(">=0.0.0-0")],Sd=[new ec(">=0.0.0")],_E=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Qa){if(e.length===1&&e[0].semver===Qa)return!0;r.includePrerelease?t=EE:t=Sd}if(e.length===1&&e[0].semver===Qa){if(r.includePrerelease)return!0;e=Sd}let i=new Set,s,n;for(let f of t)f.operator===">"||f.operator===">="?s=Rd(s,f,r):f.operator==="<"||f.operator==="<="?n=Ad(n,f,r):i.add(f.semver);if(i.size>1)return null;let a;if(s&&n){if(a=tc(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&&!Xi(f,String(s),r)||n&&!Xi(f,String(n),r))return null;for(let d of e)if(!Xi(f,String(d),r))return!1;return!0}let o,c,l,u,p=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1,b=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;p&&p.prerelease.length===1&&n.operator==="<"&&p.prerelease[0]===0&&(p=!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=Rd(s,f,r),o===f&&o!==s)return!1}else if(s.operator===">="&&!Xi(s.semver,String(f),r))return!1}if(n){if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),f.operator==="<"||f.operator==="<="){if(c=Ad(n,f,r),c===f&&c!==n)return!1}else if(n.operator==="<="&&!Xi(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||p)},Rd=(t,e,r)=>{if(!t)return e;let i=tc(t.semver,e.semver,r);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},Ad=(t,e,r)=>{if(!t)return e;let i=tc(t.semver,e.semver,r);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};Cd.exports=xE});var ic=j((vP,Td)=>{"use strict";var rc=Yr(),Od=zi(),SE=Ie(),$d=Ba(),RE=ar(),AE=rh(),CE=sh(),LE=ah(),OE=uh(),$E=hh(),TE=ph(),PE=gh(),IE=bh(),FE=Je(),NE=Eh(),DE=Sh(),ME=sn(),kE=Lh(),jE=$h(),BE=Vi(),UE=nn(),GE=qa(),qE=za(),zE=on(),WE=an(),VE=Wa(),HE=jh(),KE=Hi(),YE=Qe(),XE=Yi(),ZE=ed(),JE=rd(),QE=sd(),e_=ad(),t_=ld(),r_=un(),i_=md(),s_=yd(),n_=wd(),o_=Ed(),a_=Ld();Td.exports={parse:RE,valid:AE,clean:CE,inc:LE,diff:OE,major:$E,minor:TE,patch:PE,prerelease:IE,compare:FE,rcompare:NE,compareLoose:DE,compareBuild:ME,sort:kE,rsort:jE,gt:BE,lt:UE,eq:GE,neq:qE,gte:zE,lte:WE,cmp:VE,coerce:HE,Comparator:KE,Range:YE,satisfies:XE,toComparators:ZE,maxSatisfying:JE,minSatisfying:QE,minVersion:e_,validRange:t_,outside:r_,gtr:i_,ltr:s_,intersects:n_,simplifyRange:o_,subset:a_,SemVer:SE,re:rc.re,src:rc.src,tokens:rc.t,SEMVER_SPEC_VERSION:Od.SEMVER_SPEC_VERSION,RELEASE_TYPES:Od.RELEASE_TYPES,compareIdentifiers:$d.compareIdentifiers,rcompareIdentifiers:$d.rcompareIdentifiers}});var Id=j((wP,Pd)=>{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))}Pd.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 Fd=j(cr=>{var c_=Id();cr.operation=function(t){var e=cr.timeouts(t);return new c_(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),p=u.pop();u.push(function(b){l.retry(b)||(b&&(arguments[0]=l.mainError()),p.apply(this,arguments))}),l.attempt(function(){c.apply(t,u)})}.bind(t,a),t[n].options=e}}});var Dd=j((EP,Nd)=>{Nd.exports=Fd()});var bc=j(Rr=>{Rr.parse=Rr.decode=DS;Rr.stringify=Rr.encode=up;Rr.safe=oi;Rr.unsafe=xn;var yc=typeof process<"u"&&process.platform==="win32"?`\r
3
+ var Ty=Object.create;var zs=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)zs(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&&zs(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?zs(r,"default",{value:t,enumerable:!0}):r,t)),My=t=>Hl(zs({},"__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 hu=j((Q$,At)=>{var zo=D("fs"),Wo=D("path"),lb=D("os"),ub=D("crypto"),fb=cu(),Vo=fb.version,hb=/(?:^|^)\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=hb.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=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
6
6
  `:`
7
- `;function up(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+=oi(n+"[]")+s+oi(l)+`
8
- `}):c&&typeof c=="object"?r.push(n):i+=oi(n)+s+oi(c)+yc}),e.section&&i.length&&(i="["+oi(e.section)+"]"+yc+i),r.forEach(function(n,a,o){var c=fp(n).join("\\."),l=(e.section?e.section+".":"")+c,u=up(t[n],{section:l,whitespace:e.whitespace});i.length&&u.length&&(i+=yc),i+=u}),i}function fp(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 DS(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=xn(l[1]),i==="__proto__"){r={};return}r=e[i]=e[i]||{};return}var u=xn(l[2]);if(u!=="__proto__"){var p=l[3]?xn(l[4]):!0;switch(p){case"true":case"false":case"null":p=JSON.parse(p)}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(p):r[u]=p}}}}),Object.keys(e).filter(function(a,o,c){if(!e[a]||typeof e[a]!="object"||Array.isArray(e[a]))return!1;var l=fp(a),u=e,p=l.pop(),b=p.replace(/\\\./g,".");return l.forEach(function(f,d,m){f!=="__proto__"&&((!u[f]||typeof u[f]!="object")&&(u[f]={}),u=u[f])}),u===e&&b===p?!1:(u[b]=e[a],!0)}).forEach(function(a,o,c){delete e[a]}),e}function hp(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function oi(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&hp(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function xn(t,e){if(t=(t||"").trim(),hp(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 mp=j((PI,pp)=>{"use strict";var vc=1,dp=2;function MS(){return""}function kS(t,e,r){return t.slice(e,r).replace(/\S/g," ")}pp.exports=function(t,e){e=e||{};for(var r,i,s=!1,n=!1,a=0,o="",c=e.whitespace===!1?MS:kS,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=vc,l++;else if(n===vc&&r+i===`\r
9
- `){l++,n=!1,o+=c(t,a,l),a=l;continue}else if(n===vc&&r===`
10
- `)n=!1,o+=c(t,a,l),a=l;else if(!n&&r+i==="/*"){o+=t.slice(a,l),a=l,n=dp,l++;continue}else if(n===dp&&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 yp=j(ai=>{"use strict";var gp=D("fs"),jS=bc(),ss=D("path"),BS=mp(),US=ai.parse=function(t){return/^\s*{/.test(t)?JSON.parse(BS(t)):jS.parse(t)},GS=ai.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=ss.join.apply(null,t),i;try{return gp.readFileSync(r,"utf-8")}catch{return}},II=ai.json=function(){var t=GS.apply(null,arguments);return t?US(t):null},FI=ai.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},NI=ai.find=function(){var t=ss.join.apply(null,[].slice.call(arguments));function e(r,i){var s=ss.join(r,i);try{return gp.statSync(s),s}catch{if(ss.dirname(r)!==r)return e(ss.dirname(r),i)}}return e(process.cwd(),t)}});var _p=j((MI,Ep)=>{"use strict";function vp(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function wp(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 xp(t){var e=[];return t.forEach(function(r,i){typeof r=="object"&&r!==null?Array.isArray(r)?e[i]=xp(r):vp(r)?e[i]=wp(r):e[i]=wc({},r):e[i]=r}),e}function bp(t,e){return e==="__proto__"?void 0:t[e]}var wc=Ep.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=bp(t,a),r=bp(n,a),r!==t)if(typeof r!="object"||r===null){t[a]=r;return}else if(Array.isArray(r)){t[a]=xp(r);return}else if(vp(r)){t[a]=wp(r);return}else if(typeof i!="object"||i===null||Array.isArray(i)){t[a]=wc({},r);return}else{t[a]=wc(i,r);return}})}),t}});var Cp=j((kI,Ap)=>{"use strict";function qS(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 Sp(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Rp(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}Ap.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,C=0;C<v.length-1;C++){var A=v[C];if(Rp(_,A))return;_[A]===void 0&&(_[A]={}),(_[A]===Object.prototype||_[A]===Number.prototype||_[A]===String.prototype)&&(_[A]={}),_[A]===Array.prototype&&(_[A]=[]),_=_[A]}var O=v[v.length-1];Rp(_,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]&&Sp(v)?Number(v):v;c(a,h.split("."),_),(i[h]||[]).forEach(function(C){c(a,C.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 p=0;p<t.length;p++){var b=t[p],f,d;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],d=t[p+1],d!==void 0&&!/^(-|--)[^-]/.test(d)&&!r.bools[f]&&!r.allBools&&(!i[f]||!s(f))?(l(f,d,b),p+=1):/^(true|false)$/.test(d)?(l(f,d==="true",b),p+=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(d=b.slice(E+2),d==="-"){l(g[E],d,b);continue}if(/[A-Za-z]/.test(g[E])&&d[0]==="="){l(g[E],d.slice(1),b),w=!0;break}if(/[A-Za-z]/.test(g[E])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){l(g[E],d,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[p+1]&&!/^(-|--)[^-]/.test(t[p+1])&&!r.bools[f]&&(!i[f]||!s(f))?(l(f,t[p+1],b),p+=1):t[p+1]&&/^(true|false)$/.test(t[p+1])?(l(f,t[p+1]==="true",b),p+=1):l(f,r.strings[f]?"":!0,b))}else if((!r.unknownFn||r.unknownFn(b)!==!1)&&a._.push(r.strings._||!Sp(b)?b:Number(b)),e.stopEarly){a._.push.apply(a._,t.slice(p+1));break}}return Object.keys(n).forEach(function(h){qS(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 Tp=j((jI,$p)=>{var ns=yp(),ci=D("path").join,zS=_p(),Lp="/etc",Op=process.platform==="win32",os=Op?process.env.USERPROFILE:process.env.HOME;$p.exports=function(t,e,r,i){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=Cp()(process.argv.slice(2))),e=(typeof e=="string"?ns.json(e):e)||{},i=i||ns.parse;var s=ns.env(t+"_"),n=[e],a=[];function o(c){if(!(a.indexOf(c)>=0)){var l=ns.file(c);l&&(n.push(i(l)),a.push(c))}}return Op||[ci(Lp,t,"config"),ci(Lp,t+"rc")].forEach(o),os&&[ci(os,".config",t,"config"),ci(os,".config",t),ci(os,"."+t,"config"),ci(os,"."+t+"rc")].forEach(o),o(ns.find("."+t+"rc")),s.config&&o(s.config),r.config&&o(r.config),zS.apply(null,n.concat([s,r,a.length?{configs:a,config:a[a.length-1]}:void 0]))}});var Fp=j((UI,Ip)=>{var Ht=D("constants"),WS=process.cwd,En=null,VS=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return En||(En=WS.call(process)),En};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Ec=process.chdir,process.chdir=function(t){En=null,Ec.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ec));var Ec;Ip.exports=HS;function HS(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,p,b){b&&process.nextTick(b)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,p,b,f){f&&process.nextTick(f)},t.lchownSync=function(){}),VS==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function p(b,f,d){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):d(w)})},y),y<100&&(y+=10);return}d&&d(w)})}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function p(b,f,d,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,d,m,y,w);g.apply(this,arguments)}}return u.call(t,b,f,d,m,y,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(p,b,f,d,m){for(var y=0;;)try{return u.call(t,p,b,f,d,m)}catch(g){if(g.code==="EAGAIN"&&y<10){y++;continue}throw g}}})(t.readSync);function e(u){u.lchmod=function(p,b,f){u.open(p,Ht.O_WRONLY|Ht.O_SYMLINK,b,function(d,m){if(d){f&&f(d);return}u.fchmod(m,b,function(y){u.close(m,function(g){f&&f(y||g)})})})},u.lchmodSync=function(p,b){var f=u.openSync(p,Ht.O_WRONLY|Ht.O_SYMLINK,b),d=!0,m;try{m=u.fchmodSync(f,b),d=!1}finally{if(d)try{u.closeSync(f)}catch{}else u.closeSync(f)}return m}}function r(u){Ht.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(p,b,f,d){u.open(p,Ht.O_SYMLINK,function(m,y){if(m){d&&d(m);return}u.futimes(y,b,f,function(g){u.close(y,function(w){d&&d(g||w)})})})},u.lutimesSync=function(p,b,f){var d=u.openSync(p,Ht.O_SYMLINK),m,y=!0;try{m=u.futimesSync(d,b,f),y=!1}finally{if(y)try{u.closeSync(d)}catch{}else u.closeSync(d)}return m}):u.futimes&&(u.lutimes=function(p,b,f,d){d&&process.nextTick(d)},u.lutimesSync=function(){})}function i(u){return u&&function(p,b,f){return u.call(t,p,b,function(d){l(d)&&(d=null),f&&f.apply(this,arguments)})}}function s(u){return u&&function(p,b){try{return u.call(t,p,b)}catch(f){if(!l(f))throw f}}}function n(u){return u&&function(p,b,f,d){return u.call(t,p,b,f,function(m){l(m)&&(m=null),d&&d.apply(this,arguments)})}}function a(u){return u&&function(p,b,f){try{return u.call(t,p,b,f)}catch(d){if(!l(d))throw d}}}function o(u){return u&&function(p,b,f){typeof b=="function"&&(f=b,b=null);function d(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,p,b,d):u.call(t,p,d)}}function c(u){return u&&function(p,b){var f=b?u.call(t,p,b):u.call(t,p);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 p=!process.getuid||process.getuid()!==0;return!!(p&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Mp=j((GI,Dp)=>{var Np=D("stream").Stream;Dp.exports=KS;function KS(t){return{ReadStream:e,WriteStream:r};function e(i,s){if(!(this instanceof e))return new e(i,s);Np.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,p){if(u){n.emit("error",u),n.readable=!1;return}n.fd=p,n.emit("open",p),n._read()})}function r(i,s){if(!(this instanceof r))return new r(i,s);Np.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 jp=j((qI,kp)=>{"use strict";kp.exports=XS;var YS=Object.getPrototypeOf||function(t){return t.__proto__};function XS(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:YS(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var qp=j((zI,Rc)=>{var ve=D("fs"),ZS=Fp(),JS=Mp(),QS=jp(),_n=D("util"),Te,Rn;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Te=Symbol.for("graceful-fs.queue"),Rn=Symbol.for("graceful-fs.previous")):(Te="___graceful-fs.queue",Rn="___graceful-fs.previous");function eR(){}function Gp(t,e){Object.defineProperty(t,Te,{get:function(){return e}})}var Ar=eR;_n.debuglog?Ar=_n.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ar=function(){var t=_n.format.apply(_n,arguments);t="GFS4: "+t.split(/\n/).join(`
11
- GFS4: `),console.error(t)});ve[Te]||(Bp=global[Te]||[],Gp(ve,Bp),ve.close=(function(t){function e(r,i){return t.call(ve,r,function(s){s||Up(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(e,Rn,{value:t}),e})(ve.close),ve.closeSync=(function(t){function e(r){t.apply(ve,arguments),Up()}return Object.defineProperty(e,Rn,{value:t}),e})(ve.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ar(ve[Te]),D("assert").equal(ve[Te].length,0)}));var Bp;global[Te]||Gp(global,ve[Te]);Rc.exports=_c(QS(ve));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ve.__patched&&(Rc.exports=_c(ve),ve.__patched=!0);function _c(t){ZS(t),t.gracefulify=_c,t.createReadStream=v,t.createWriteStream=x;var e=t.readFile;t.readFile=r;function r(A,O,F){return typeof O=="function"&&(F=O,O=null),M(A,O,F);function M(I,Y,J,G){return e(I,Y,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?li([M,[I,Y,J],V,G||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments)})}}var i=t.writeFile;t.writeFile=s;function s(A,O,F,M){return typeof F=="function"&&(M=F,F=null),I(A,O,F,M);function I(Y,J,G,V,se){return i(Y,J,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?li([I,[Y,J,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(A,O,F,M){return typeof F=="function"&&(M=F,F=null),I(A,O,F,M);function I(Y,J,G,V,se){return n(Y,J,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?li([I,[Y,J,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(A,O,F,M){return typeof F=="function"&&(M=F,F=0),I(A,O,F,M);function I(Y,J,G,V,se){return o(Y,J,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?li([I,[Y,J,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var l=t.readdir;t.readdir=p;var u=/^v[0-5]\./;function p(A,O,F){typeof O=="function"&&(F=O,O=null);var M=u.test(process.version)?function(J,G,V,se){return l(J,I(J,G,V,se))}:function(J,G,V,se){return l(J,G,I(J,G,V,se))};return M(A,O,F);function I(Y,J,G,V){return function(se,ee){se&&(se.code==="EMFILE"||se.code==="ENFILE")?li([M,[Y,J,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=JS(t);g=b.ReadStream,E=b.WriteStream}var f=t.ReadStream;f&&(g.prototype=Object.create(f.prototype),g.prototype.open=w);var d=t.WriteStream;d&&(E.prototype=Object.create(d.prototype),E.prototype.open=h),Object.defineProperty(t,"ReadStream",{get:function(){return g},set:function(A){g=A},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return E},set:function(A){E=A},enumerable:!0,configurable:!0});var m=g;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});var y=E;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(A){y=A},enumerable:!0,configurable:!0});function g(A,O){return this instanceof g?(f.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function w(){var A=this;C(A.path,A.flags,A.mode,function(O,F){O?(A.autoClose&&A.destroy(),A.emit("error",O)):(A.fd=F,A.emit("open",F),A.read())})}function E(A,O){return this instanceof E?(d.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function h(){var A=this;C(A.path,A.flags,A.mode,function(O,F){O?(A.destroy(),A.emit("error",O)):(A.fd=F,A.emit("open",F))})}function v(A,O){return new t.ReadStream(A,O)}function x(A,O){return new t.WriteStream(A,O)}var _=t.open;t.open=C;function C(A,O,F,M){return typeof F=="function"&&(M=F,F=null),I(A,O,F,M);function I(Y,J,G,V,se){return _(Y,J,G,function(ee,we){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?li([I,[Y,J,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}return t}function li(t){Ar("ENQUEUE",t[0].name,t[1]),ve[Te].push(t),Sc()}var Sn;function Up(){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);Sc()}function Sc(){if(clearTimeout(Sn),Sn=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)Ar("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Ar("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?(Ar("RETRY",e.name,r),e.apply(null,r.concat([s]))):ve[Te].push(t)}Sn===void 0&&(Sn=setTimeout(Sc,0))}}});var zp=j(ui=>{"use strict";var tR=ui&&ui.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ui,"__esModule",{value:!0});ui.readCAFileSync=void 0;var rR=tR(qp());function iR(t){try{let e=rR.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}}ui.readCAFileSync=iR});var Wp=j(Cr=>{"use strict";var sR=Cr&&Cr.__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]})),nR=Cr&&Cr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sR(e,t,r)};Object.defineProperty(Cr,"__esModule",{value:!0});nR(zp(),Cr)});var Kp=j((HI,Hp)=>{Hp.exports=Vp;function Lr(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Vp(){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})}Vp.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 Jp=j((It,Zp)=>{var Yp=Kp(),as=D("path"),An=D("fs"),Ac=bc(),Cc=D("events").EventEmitter,oR=D("url"),aR=D("http"),It=Zp.exports=function(){for(var t=[].slice.call(arguments),e=new De;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?lR(r):r)}return e},KI=It.find=function(){var t=as.join.apply(null,[].slice.call(arguments));function e(r,i){var s=as.join(r,i);try{return An.statSync(s),s}catch{if(as.dirname(r)!==r)return e(as.dirname(r),i)}}return e(__dirname,t)},cR=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 Ac.parse(t);else try{return JSON.parse(t)}catch{return Ac.parse(t)}},lR=It.json=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null}),e=as.join.apply(null,t),r;try{r=An.readFileSync(e,"utf-8")}catch{return}return cR(r,e,"json")},YI=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(){Cc.apply(this),Yp.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var Xp={constructor:{value:De}};Object.keys(Cc.prototype).forEach(function(t){Xp[t]=Object.getOwnPropertyDescriptor(Cc.prototype,t)});De.prototype=Object.create(Yp.prototype,Xp);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=Ac.stringify(a),this._saving++,An.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(),An.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=oR.format(t);r=r||i;var s={__source__:r};return this.sources[r]={href:i,type:e},this.push(s),aR.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 em=j((XI,Qp)=>{Qp.exports=function(t){let e=t.indexOf(":");if(e===-1)return Lc(t);let r=t.substr(0,e),i=t.substr(e+1);return`${Lc(r)}:${Lc(i)}`};function Lc(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 tm=j(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.envReplace=void 0;var uR=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function fR(t,e){return t.replace(uR,hR.bind(null,e))}Cn.envReplace=fR;function hR(t,e,r,i){if(r.length%2)return e.slice((r.length+1)/2);let s=pR(t,i);if(s===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${s}`}var dR=/([^:-]+)(:?)-(.+)/;function pR(t,e){let r=e.match(dR);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 rm=j(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.envReplace=void 0;var mR=tm();Object.defineProperty(Ln,"envReplace",{enumerable:!0,get:function(){return mR.envReplace}})});var im=j(cs=>{"use strict";var gR=D("fs"),Or=D("path"),{envReplace:Oc}=rm(),yR=t=>typeof t!="string"?t:Oc(t,process.env),bR=(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=Oc(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},vR=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=gR.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)};cs.envReplace=Oc;cs.findPrefix=vR;cs.parseField=bR;cs.parseKey=yR});var om=j(nm=>{"use strict";var $r=D("path"),wR=D("stream").Stream,On=D("url"),xR=()=>{},ER=()=>[],sm=()=>{};nm.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,On],"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":["",On],"init-license":String,"init-version":sm,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":ER(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:wR,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,sm],"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,On],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,On],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:xR,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var lm=j((t2,cm)=>{"use strict";var{readCAFileSync:_R}=Wp(),am=D("fs"),$c=D("path"),{ConfigChain:SR}=Jp(),RR=em(),Tc=im(),Pc=class extends SR{constructor(e,r){super(e),this.root=e,this._parseField=Tc.parseField.bind(null,r||om())}add(e,r){try{for(let[i,s]of Object.entries(e)){let n=Tc.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=am.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=RR(i.substr(11)),n=e[i];r[s]=AR(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:()=>$c.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=$c.resolve(e.prefix);else try{r=Tc.findPrefix(process.cwd())}catch(i){throw i}return r}loadCAFile(e){if(!e)return;let r=_R(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=$c.resolve(this.get("prefix"));try{let i=am.statSync(r);e.user=i.uid}catch(i){if(i.code==="ENOENT")return;throw i}}};function AR(t,e){function r(i){return i.indexOf(`
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(),b=d.replace(/\\\./g,".");return l.forEach(function(f,p,m){f!=="__proto__"&&((!u[f]||typeof u[f]!="object")&&(u[f]={}),u=u[f])}),u===e&&b===d?!1:(u[b]=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
+ `){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(`
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}cm.exports=Pc});var mm=j(pm=>{"use strict";var hm=D("os"),Ft=D("path"),dm=hm.tmpdir(),CR=process.getuid?process.getuid():process.pid,LR=()=>!0,um=process.platform==="win32",fm={editor:()=>process.env.EDITOR||process.env.VISUAL||(um?"notepad.exe":"vi"),shell:()=>um?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},OR={fromString:()=>process.umask()},fi=hm.homedir();fi?process.env.HOME=fi:fi=Ft.resolve(dm,"npm-"+CR);var $R=process.platform==="win32"?"npm-cache":".npm",TR=process.platform==="win32"&&process.env.APPDATA||fi,PR=Ft.resolve(TR,$R),$n,Tr;Object.defineProperty(pm,"defaults",{get:function(){return $n||(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))),$n={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:PR,"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:fm.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:fm.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:dm,unicode:LR(),"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():OR.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},$n)}})});var ym=j((i2,Ic)=>{"use strict";var Pr=D("path"),IR=lm(),gm=mm();Ic.exports=(t,e,r)=>{let i=new IR(Object.assign({},gm.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(Ic.exports,"defaults",{get(){return gm.defaults},enumerable:!0})});var Rm=j((n2,Sm)=>{var bm=ym(),vm=":_authToken",wm=":_auth",xm=":username",Em=":_password";Sm.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]}}:bm()).config,e=e||r.npmrc.get("registry")||bm.defaults.registry,_m(e,r)||NR(r.npmrc)};function FR(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 _m(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=MR(s,e.npmrc);if(n)return n;if(!e.recursive)return/\/$/.test(t)?void 0:_m(new URL("./",r),e);r.pathname=FR(DR(i),"..")||"/"}}function NR(t){return t.get("_auth")?{token:Tn(t.get("_auth")),type:"Basic"}:void 0}function DR(t){return t[t.length-1]==="/"?t:t+"/"}function MR(t,e){let r=kR(e.get(t+vm)||e.get(t+"/"+vm));if(r)return r;let i=e.get(t+xm)||e.get(t+"/"+xm),s=e.get(t+Em)||e.get(t+"/"+Em),n=jR(i,s);if(n)return n;let a=BR(e.get(t+wm)||e.get(t+"/"+wm));if(a)return a}function Tn(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function kR(t){return t?{token:Tn(t),type:"Bearer"}:void 0}function jR(t,e){if(!t||!e)return;let r=Buffer.from(Tn(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function BR(t){return t?{token:Tn(t),type:"Basic"}:void 0}});var ag=j((M2,Dn)=>{var Um,Gm,qm,zm,Wm,Vm,Hm,Km,Ym,Nn,Wc,Xm,Zm,di,Jm,Qm,eg,tg,rg,ig,sg,ng,og;(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 Dn=="object"&&typeof Dn.exports=="object"?t(r(e,r(Dn.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])};Um=function(r,i){e(r,i);function s(){this.constructor=r}r.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},Gm=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},qm=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},zm=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},Wm=function(r,i){return function(s,n){i(s,n,r)}},Vm=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},Hm=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{p(n.next(b))}catch(f){c(f)}}function u(b){try{p(n.throw(b))}catch(f){c(f)}}function p(b){b.done?o(b.value):a(b.value).then(l,u)}p((n=n.apply(r,i||[])).next())})},Km=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(p){return function(b){return u([p,b])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,a&&(o=p[0]&2?a.return:p[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,p[1])).done)return o;switch(a=0,o&&(p=[p[0]&2,o.value]),p[0]){case 0:case 1:o=p;break;case 4:return s.label++,{value:p[1],done:!1};case 5:s.label++,a=p[1],p=[0];continue;case 7:p=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(p[0]===6||p[0]===2)){s=0;continue}if(p[0]===3&&(!o||p[1]>o[0]&&p[1]<o[3])){s.label=p[1];break}if(p[0]===6&&s.label<o[1]){s.label=o[1],o=p;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(p);break}o[2]&&s.ops.pop(),s.trys.pop();continue}p=i.call(r,s)}catch(b){p=[6,b],a=0}finally{n=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},og=function(r,i,s,n){n===void 0&&(n=s),r[n]=i[s]},Ym=function(r,i){for(var s in r)s!=="default"&&!i.hasOwnProperty(s)&&(i[s]=r[s])},Nn=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.")},Wc=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},Xm=function(){for(var r=[],i=0;i<arguments.length;i++)r=r.concat(Wc(arguments[i]));return r},Zm=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)},Jm=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(d){n[d]&&(a[d]=function(m){return new Promise(function(y,g){o.push([d,m,y,g])>1||l(d,m)})})}function l(d,m){try{u(n[d](m))}catch(y){f(o[0][3],y)}}function u(d){d.value instanceof di?Promise.resolve(d.value.v).then(p,b):f(o[0][2],d)}function p(d){l("next",d)}function b(d){l("throw",d)}function f(d,m){d(m),o.shift(),o.length&&l(o[0][0],o[0][1])}},Qm=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}},eg=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 Nn=="function"?Nn(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(p){o({value:p,done:l})},c)}},tg=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},rg=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},ig=function(r){return r&&r.__esModule?r:{default:r}},sg=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},ng=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",Um),t("__assign",Gm),t("__rest",qm),t("__decorate",zm),t("__param",Wm),t("__metadata",Vm),t("__awaiter",Hm),t("__generator",Km),t("__exportStar",Ym),t("__createBinding",og),t("__values",Nn),t("__read",Wc),t("__spread",Xm),t("__spreadArrays",Zm),t("__await",di),t("__asyncGenerator",Jm),t("__asyncDelegator",Qm),t("__asyncValues",eg),t("__makeTemplateObject",tg),t("__importStar",rg),t("__importDefault",ig),t("__classPrivateFieldGet",sg),t("__classPrivateFieldSet",ng)})});var lg={};Do(lg,{__assign:()=>lA,__asyncDelegator:()=>SA,__asyncGenerator:()=>_A,__asyncValues:()=>RA,__await:()=>EA,__awaiter:()=>pA,__classPrivateFieldGet:()=>OA,__classPrivateFieldSet:()=>$A,__createBinding:()=>yA,__decorate:()=>fA,__exportStar:()=>gA,__extends:()=>cA,__generator:()=>mA,__importDefault:()=>LA,__importStar:()=>CA,__makeTemplateObject:()=>AA,__metadata:()=>dA,__param:()=>hA,__read:()=>vA,__rest:()=>uA,__spread:()=>wA,__spreadArrays:()=>xA,__values:()=>bA});var cg,cA,lA,uA,fA,hA,dA,pA,mA,gA,yA,bA,vA,wA,xA,EA,_A,SA,RA,AA,CA,LA,OA,$A,ug=Py(()=>{cg=We(ag(),1),{__extends:cA,__assign:lA,__rest:uA,__decorate:fA,__param:hA,__metadata:dA,__awaiter:pA,__generator:mA,__exportStar:gA,__createBinding:yA,__values:bA,__read:vA,__spread:wA,__spreadArrays:xA,__await:EA,__asyncGenerator:_A,__asyncDelegator:SA,__asyncValues:RA,__makeTemplateObject:AA,__importStar:CA,__importDefault:LA,__classPrivateFieldGet:OA,__classPrivateFieldSet:$A}=cg.default});var pg=j((k2,dg)=>{"use strict";var Vc=Object.defineProperty,TA=Object.getOwnPropertyDescriptor,PA=Object.getOwnPropertyNames,IA=Object.prototype.hasOwnProperty,FA=(t,e)=>{for(var r in e)Vc(t,r,{get:e[r],enumerable:!0})},NA=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of PA(e))!IA.call(t,s)&&s!==r&&Vc(t,s,{get:()=>e[s],enumerable:!(i=TA(e,s))||i.enumerable});return t},DA=t=>NA(Vc({},"__esModule",{value:!0}),t),fg={};FA(fg,{defaultDeserialize:()=>kA,defaultSerialize:()=>MA});dg.exports=DA(fg);var hg=D("buffer"),Mn=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(hg.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+=Mn(t[n],e):t[n]!==void 0&&(r+=`${Mn(n,!1)}:${Mn(t[n],e)}`))}return r+=i?"]":"}",r}return JSON.stringify(t)},MA=t=>Mn(t,!0),kA=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?hg.Buffer.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r)});var mg=j(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.Field=void 0;hs.makeField=jA;var kn=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)}};hs.Field=kn;function jA(t,e,r){return new kn(t,e,r)}});var vg=j(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.KeyvFile=Nt.defaultOpts=void 0;var pi=(ug(),Iy(lg)),BA=pi.__importStar(D("os")),jn=pi.__importStar(D("fs")),gg=pi.__importStar(D("fs/promises")),UA=pi.__importDefault(D("events")),yg=pg(),GA=pi.__importDefault(D("path"));pi.__exportStar(mg(),Nt);Nt.defaultOpts={deserialize:yg.defaultDeserialize,dialect:"redis",expiredCheckDelay:24*3600*1e3,filename:`${BA.tmpdir()}/keyv-file/default.json`,serialize:yg.defaultSerialize,writeDelay:100,checkFileLock:!1};function bg(t){return typeof t=="number"}var Bn=class extends UA.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(jn.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=jn.openSync(this._lockFile,"wx");jn.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{jn.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:bg(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 bg(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 gg.mkdir(GA.default.dirname(this.opts.filename),{recursive:!0}),gg.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=Bn;Nt.default=Bn});var Rg=j((Y2,Sg)=>{"use strict";Sg.exports=Eg;function Eg(t,e,r){t instanceof RegExp&&(t=xg(t,r)),e instanceof RegExp&&(e=xg(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 xg(t,e){var r=e.match(t);return r?r[0]:null}Eg.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 Ig=j((X2,Pg)=>{var Ag=Rg();Pg.exports=HA;var Cg="\0SLASH"+Math.random()+"\0",Lg="\0OPEN"+Math.random()+"\0",Kc="\0CLOSE"+Math.random()+"\0",Og="\0COMMA"+Math.random()+"\0",$g="\0PERIOD"+Math.random()+"\0";function Hc(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function WA(t){return t.split("\\\\").join(Cg).split("\\{").join(Lg).split("\\}").join(Kc).split("\\,").join(Og).split("\\.").join($g)}function VA(t){return t.split(Cg).join("\\").split(Lg).join("{").split(Kc).join("}").split(Og).join(",").split($g).join(".")}function Tg(t){if(!t)return[""];var e=[],r=Ag("{","}",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=Tg(n);return n.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function HA(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),ps(WA(t),!0).map(VA)):[]}function KA(t){return"{"+t+"}"}function YA(t){return/^-?0\d/.test(t)}function XA(t,e){return t<=e}function ZA(t,e){return t>=e}function ps(t,e){var r=[],i=Ag("{","}",t);if(!i)return[t];var s=i.pre,n=i.post.length?ps(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,p=i.body.indexOf(",")>=0;if(!u&&!p)return i.post.match(/,.*\}/)?(t=i.pre+"{"+i.body+Kc+i.post,ps(t)):[t];var b;if(u)b=i.body.split(/\.\./);else if(b=Tg(i.body),b.length===1&&(b=ps(b[0],!1).map(KA),b.length===1))return n.map(function(O){return i.pre+b[0]+O});var f;if(u){var d=Hc(b[0]),m=Hc(b[1]),y=Math.max(b[0].length,b[1].length),g=b.length==3?Math.abs(Hc(b[2])):1,w=XA,E=m<d;E&&(g*=-1,w=ZA);var h=b.some(YA);f=[];for(var v=d;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 C=new Array(_+1).join("0");v<0?x="-"+C+x.slice(1):x=C+x}}f.push(x)}}else{f=[];for(var A=0;A<b.length;A++)f.push.apply(f,ps(b[A],!1))}for(var A=0;A<f.length;A++)for(var a=0;a<n.length;a++){var o=s+f[A]+n[a];(!e||u||o)&&r.push(o)}}return r}});var lo=j((sN,co)=>{function x0(t){return Array.isArray(t)?t:[t]}var wL=void 0,ml="",v0=" ",pl="\\",xL=/^\s+$/,EL=/(?:[^\\]|^)\\$/,_L=/^\\!/,SL=/^\\#/,RL=/\r?\n/g,AL=/^\.{0,2}\/|^\.{1,2}$/,CL=/\/$/,Ai="/",E0="node-ignore";typeof Symbol<"u"&&(E0=Symbol.for("node-ignore"));var _0=E0,Ci=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),LL=/([0-z])-([0-z])/g,S0=()=>!1,OL=t=>t.replace(LL,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:ml),$L=t=>{let{length:e}=t;return t.slice(0,e-e%2)},TL=[[/^\uFEFF/,()=>ml],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?v0:ml)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+v0}],[/[\\$.|*+(){^]/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,()=>pl],[/\\\\/g,()=>pl],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,s)=>e===pl?`\\[${r}${$L(i)}${s}`:s==="]"&&i.length%2===0?`[${OL(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],PL=/(^|\\\/)?\\\*$/,$s="regex",oo="checkRegex",w0="_",IL={[$s](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[oo](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},FL=t=>TL.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),ao=t=>typeof t=="string",NL=t=>t&&ao(t)&&!xL.test(t)&&!EL.test(t)&&t.indexOf("#")!==0,DL=t=>t.split(RL).filter(Boolean),gl=class{constructor(e,r,i,s,n,a){this.pattern=e,this.mark=r,this.negative=n,Ci(this,"body",i),Ci(this,"ignoreCase",s),Ci(this,"regexPrefix",a)}get regex(){let e=w0+$s;return this[e]?this[e]:this._make($s,e)}get checkRegex(){let e=w0+oo;return this[e]?this[e]:this._make(oo,e)}_make(e,r){let i=this.regexPrefix.replace(PL,IL[e]),s=this.ignoreCase?new RegExp(i,"i"):new RegExp(i);return Ci(this,r,s)}},ML=({pattern:t,mark:e},r)=>{let i=!1,s=t;s.indexOf("!")===0&&(i=!0,s=s.substr(1)),s=s.replace(_L,"!").replace(SL,"#");let n=FL(s);return new gl(t,e,s,r,i,n)},yl=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(ao(e)&&(e={pattern:e}),NL(e.pattern)){let r=ML(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,x0(ao(e)?DL(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?wL:c)});let o={ignored:s,unignored:n};return a&&(o.rule=a),o}},kL=(t,e)=>{throw new e(t)},kt=(t,e,r)=>ao(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),R0=t=>AL.test(t);kt.isNotRelative=R0;kt.convert=t=>t;var bl=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){Ci(this,_0,!0),this._rules=new yl(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?kL:S0),this._t(n,r,i,s)}checkIgnore(e){if(!CL.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,oo)}_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,$s);let n=this._t(s.join(Ai)+Ai,r,i,s);return r[e]=n.ignored?n:this._rules.test(e,i,$s)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return x0(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},vl=t=>new bl(t),jL=t=>kt(t&&kt.convert(t),t,S0),A0=()=>{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)||R0(r)};typeof process<"u"&&process.platform==="win32"&&A0();co.exports=vl;vl.default=vl;co.exports.isPathValid=jL;Ci(co.exports,Symbol.for("setupWindows"),A0)});var wl=j((yN,Le)=>{var{createRequire:BL}=D("node:module");D=BL(__filename);var{readFileSync:UL}=D("node:fs"),ge=null,X=[],ho=()=>{let t=!1;return process.platform==="linux"&&(t=qL(),t===null&&(t=zL()),t===null&&(t=WL())),t},GL=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),qL=()=>{try{return UL("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},zL=()=>{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(GL)):null},WL=()=>{try{return D("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}};function VL(){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(ho()){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(ho()){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(ho()){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(ho()){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=VL();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");Le.exports=ge;Le.exports.SgNode=ge.SgNode;Le.exports.SgRoot=ge.SgRoot;Le.exports.findInFiles=ge.findInFiles;Le.exports.kind=ge.kind;Le.exports.Lang=ge.Lang;Le.exports.parse=ge.parse;Le.exports.parseAsync=ge.parseAsync;Le.exports.parseFiles=ge.parseFiles;Le.exports.pattern=ge.pattern;Le.exports.registerDynamicLanguage=ge.registerDynamicLanguage;Le.exports.css=ge.css;Le.exports.html=ge.html;Le.exports.js=ge.js;Le.exports.jsx=ge.jsx;Le.exports.ts=ge.ts;Le.exports.tsx=ge.tsx});import*as jr from"fs/promises";import*as gy from"os";import*as No from"path";var Fy=20,Ny=1,rr=1e6,zl=1e6,Dy=-7,My=21,ky=!1,Di="[big.js] ",ir=Di+"Invalid ",qs=ir+"decimal places",jy=ir+"rounding mode",Wl=Di+"Division by zero",ue={},bt=void 0,By=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Vl(){function t(e){var r=this;if(!(r instanceof t))return e===bt&&arguments.length===0?Vl():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)}Uy(r,e)}r.constructor=t}return t.prototype=ue,t.DP=Fy,t.RM=Ny,t.NE=Dy,t.PE=My,t.strict=ky,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function Uy(t,e){var r,i,s;if(!By.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(jy);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(qs);if(!s[0])throw Error(Wl);if(!i[0])return t.s=n,t.c=[t.e=0],t;var o,c,l,u,p,b=s.slice(),f=o=s.length,d=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(p=-1,u=0;++p<o;)if(s[p]!=m[p]){u=s[p]>m[p]?1:-1;break}if(u<0){for(c=y==o?s:b;y;){if(m[--y]<c[y]){for(p=y;p&&!m[--p];)m[p]=9;--m[p],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++<d||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,p=t.c,b=t.e;if(!l[0]||!p[0])return p[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=p),i.reverse(),c=o;c--;)i.push(0);i.reverse()}else for(r=((s=l.length<p.length)?l:p).length,o=c=0;c<r;c++)if(l[c]!=p[c]){s=l[c]<p[c];break}if(s&&(i=l,l=p,p=i,t.s=-t.s),(c=(r=p.length)-(e=l.length))>0)for(;c--;)l[e++]=0;for(c=e;r>o;){if(l[--r]<p[r]){for(e=r;e&&!l[--e];)l[e]=9;--l[e],l[r]+=10}l[r]-=p[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(Wl);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<-zl||t>zl)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(qs);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(Di+"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(qs);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(qs);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(Di+"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(Di+"valueOf disallowed");return nr(t,t.e<=e.NE||t.e>=e.PE,!0)};var Gy=Vl(),Ke=Gy;var Hl=(t=0)=>e=>`\x1B[${e+t}m`,Kl=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Yl=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,pe={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]}},N$=Object.keys(pe.modifier),qy=Object.keys(pe.color),zy=Object.keys(pe.bgColor),D$=[...qy,...zy];function Wy(){let t=new Map;for(let[e,r]of Object.entries(pe)){for(let[i,s]of Object.entries(r))pe[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=pe[i],t.set(s[0],s[1]);Object.defineProperty(pe,e,{value:r,enumerable:!1})}return Object.defineProperty(pe,"codes",{value:t,enumerable:!1}),pe.color.close="\x1B[39m",pe.bgColor.close="\x1B[49m",pe.color.ansi=Hl(),pe.color.ansi256=Kl(),pe.color.ansi16m=Yl(),pe.bgColor.ansi=Hl(10),pe.bgColor.ansi256=Kl(10),pe.bgColor.ansi16m=Yl(10),Object.defineProperties(pe,{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=>pe.rgbToAnsi256(...pe.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)=>pe.ansi256ToAnsi(pe.rgbToAnsi256(e,r,i)),enumerable:!1},hexToAnsi:{value:e=>pe.ansi256ToAnsi(pe.hexToAnsi256(e)),enumerable:!1}}),pe}var Vy=Wy(),ft=Vy;import Mo from"node:process";import Hy from"node:os";import Xl from"node:tty";function Ze(t,e=globalThis.Deno?globalThis.Deno.args:Mo.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}=Mo,zs;Ze("no-color")||Ze("no-colors")||Ze("color=false")||Ze("color=never")?zs=0:(Ze("color")||Ze("colors")||Ze("color=true")||Ze("color=always"))&&(zs=1);function Ky(){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 Yy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Xy(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let i=Ky();i!==void 0&&(zs=i);let s=r?zs:i;if(s===0)return 0;if(r){if(Ze("color=16m")||Ze("color=full")||Ze("color=truecolor"))return 3;if(Ze("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(Mo.platform==="win32"){let a=Hy.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 Zl(t,e={}){let r=Xy(t,{streamIsTTY:t&&t.isTTY,...e});return Yy(r)}var Zy={stdout:Zl({isTTY:Xl.isatty(1)}),stderr:Zl({isTTY:Xl.isatty(2)})},Jl=Zy;function Ql(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 eu(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}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
16
16
  `:`
17
17
  `)+r,s=i+1,i=t.indexOf(`
18
- `,s)}while(i!==-1);return n+=t.slice(s),n}var{stdout:tu,stderr:ru}=Jl,ko=Symbol("GENERATOR"),Gr=Symbol("STYLER"),Mi=Symbol("IS_EMPTY"),iu=["ansi","ansi","ansi256","ansi16m"],qr=Object.create(null),Jy=(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=tu?tu.level:0;t.level=e.level===void 0?r:e.level};var Qy=t=>{let e=(...r)=>r.join(" ");return Jy(e,t),Object.setPrototypeOf(e,ki.prototype),e};function ki(t){return Qy(t)}Object.setPrototypeOf(ki.prototype,Function.prototype);for(let[t,e]of Object.entries(ft))qr[t]={get(){let r=Ws(this,Bo(e.open,e.close,this[Gr]),this[Mi]);return Object.defineProperty(this,t,{value:r}),r}};qr.visible={get(){let t=Ws(this,this[Gr],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var jo=(t,e,r,...i)=>t==="rgb"?e==="ansi16m"?ft[r].ansi16m(...i):e==="ansi256"?ft[r].ansi256(ft.rgbToAnsi256(...i)):ft[r].ansi(ft.rgbToAnsi(...i)):t==="hex"?jo("rgb",e,r,...ft.hexToRgb(...i)):ft[r][t](...i),eb=["rgb","hex","ansi256"];for(let t of eb){qr[t]={get(){let{level:r}=this;return function(...i){let s=Bo(jo(t,iu[r],"color",...i),ft.color.close,this[Gr]);return Ws(this,s,this[Mi])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);qr[e]={get(){let{level:r}=this;return function(...i){let s=Bo(jo(t,iu[r],"bgColor",...i),ft.bgColor.close,this[Gr]);return Ws(this,s,this[Mi])}}}}var tb=Object.defineProperties(()=>{},{...qr,level:{enumerable:!0,get(){return this[ko].level},set(t){this[ko].level=t}}}),Bo=(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}},Ws=(t,e,r)=>{let i=(...s)=>rb(i,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(i,tb),i[ko]=t,i[Gr]=e,i[Mi]=r,i},rb=(t,e)=>{if(t.level<=0||!e)return t[Mi]?"":e;let r=t[Gr];if(r===void 0)return e;let{openAll:i,closeAll:s}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=Ql(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
19
- `);return n!==-1&&(e=eu(e,s,i,n)),i+e+s};Object.defineProperties(ki.prototype,qr);var ib=ki(),V$=ki({level:ru?ru.level:0});var S=ib;var yy=We(cu(),1);import Ma from"node:process";import hf,{format as vb}from"util";import{resolve as wb,normalize as xb}from"path";import{readFileSync as Eb}from"fs";import df,{createRequire as lu}from"node:module";import Gt from"node:path";import _b from"node:process";import Sb,{fileURLToPath as pf}from"node:url";import mf from"node:fs";import Ia from"url";function Gi(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 gf(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 yf(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 Rb(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,Oa=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=Rb(e),n=typeof e=="string",a=Ab(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,p=o["populate--"],b=p?"--":"_",f=Object.create(null),d=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]=$)})),Br(i.key,a,i.default,y.arrays),Object.keys(c).forEach(function(R){(y.aliases[R]||[]).forEach(function($){c[$]=c[R]})});let E=null;Ay();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,Z,Se;if($!=="--"&&/^-/.test($)&&Us($))_($);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=A(R,q[1],s,q[2]):re(q[1],y.nargs)!==!1?R=C(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=A(R,L,s):re(L,y.nargs)!==!1?R=C(R,L,s):(Z=s[R+1],Z!==void 0&&(!Z.match(/^-/)||Z.match(g))&&!re(L,y.bools)&&!re(L,y.counts)||/^(true|false)$/.test(Z)?(O(L,Z),R++):O(L,Ur(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))Z=s[R+1],q=$.match(/^-(.\..+)/),q!==null&&Array.isArray(q)&&q.length>=2&&(L=q[1],Z!==void 0&&!Z.match(/^-/)&&!re(L,y.bools)&&!re(L,y.counts)?(O(L,Z),R++):O(L,Ur(L)));else if($.match(/^-[^-]+/)&&!$.match(g)){H=$.slice(1,-1).split(""),T=!1;for(let Be=0;Be<H.length;Be++){if(Z=$.slice(Be+2),H[Be+1]&&H[Be+1]==="="){Se=$.slice(Be+3),L=H[Be],re(L,y.arrays)?R=A(R,L,s,Se):re(L,y.nargs)!==!1?R=C(R,L,s,Se):O(L,Se),T=!0;break}if(Z==="-"){O(H[Be],Z);continue}if(/[A-Za-z]/.test(H[Be])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(Z)&&re(Z,y.bools)===!1){O(H[Be],Z),T=!0;break}if(H[Be+1]&&H[Be+1].match(/\W/)){O(H[Be],Z),T=!0;break}else O(H[Be],Ur(H[Be]))}L=$.slice(-1)[0],!T&&L!=="-"&&(re(L,y.arrays)?R=A(R,L,s):re(L,y.nargs)!==!1?R=C(R,L,s):(Z=s[R+1],Z!==void 0&&(!/^(-|--)[^-]/.test(Z)||Z.match(g))&&!re(L,y.bools)&&!re(L,y.counts)||/^(true|false)$/.test(Z)?(O(L,Z),R++):O(L,Ur(L))))}else if($.match(/^-[0-9]$/)&&$.match(g)&&re($.slice(1),y.bools))L=$.slice(1),O(L,Ur(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)}),p&&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($=>Gi($)).join(".")],delete v[R]});function _(R){let $=I("_",R);(typeof $=="string"||typeof $=="number")&&v._.push($)}function C(R,$,k,T){let L,H=re($,y.nargs);if(H=typeof H!="number"||isNaN(H)?1:H,H===0)return At(T)||(E=Error(m("Argument unexpected for: %s",$))),O($,Ur($)),R;let q=At(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)||Us(k[L]));L++)q++;q<H&&(E=Error(m("Not enough arguments following: %s",$)))}let Z=Math.min(q,H);for(!At(T)&&Z>0&&(O($,T),Z--),L=R+1;L<Z+R+1;L++)O($,k[L]);return R+Z}function A(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(At(H)||At(T)&&/^-/.test(H)&&!g.test(H)&&!Us(H)){if(c[$]!==void 0){let Z=c[$];L=Array.isArray(Z)?Z:[Z]}}else{At(T)||L.push(M($,T,!0));for(let Z=R+1;Z<k.length&&!(!o["greedy-arrays"]&&L.length>0||q&&typeof q=="number"&&L.length>=q||(H=k[Z],/^-/.test(H)&&!g.test(H)&&!Us(H)));Z++)R=Z,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 Gi(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("."),Z=[].concat(L);Z.shift(),q=q.concat(Z),(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(Z){$=typeof Z=="string"?Lt.normalize(Z):Z}})})}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&&($=Cb($)),(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)&&(At(T)||typeof T=="boolean")&&(T=zo()),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($)&&(yf($)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${$}`)))||!At($)&&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(Z){L=Z}if(L instanceof Error){E=L;return}}else L=Lt.require(H);J(L)}catch(L){L.name==="PermissionDenied"?E=L:R[k]&&(E=Error(m("Invalid JSON config file: %s",T)))}})}function J(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"]?J(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){J(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,Z){return Z===0&&(q=q.substring(k.length)),Gi(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&&(d[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=uu(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=uu($[$.length-1]),H=re($.join("."),y.arrays),q=Array.isArray(k),Z=o["duplicate-arguments-array"];!Z&&re(L,y.nargs)&&(Z=!0,(!At(T[L])&&y.nargs[L]===1||Array.isArray(T[L])&&T[L].length===y.nargs[L])&&(T[L]=void 0)),k===zo()?T[L]=zo(T[L]):Array.isArray(T[L])?Z&&H&&q?T[L]=o["flatten-duplicate-arrays"]?T[L].concat(k):(Array.isArray(T[L][0])?T[L]:[T[L]]).concat([k]):!Z&&!!H==!!q?T[L]=k:T[L]=T[L].concat([k]):T[L]===void 0&&H?T[L]=q?k:[k]:Z&&!(T[L]===void 0||re(L,y.counts)||re(L,y.bools))?T[L]=[T[L],k]:T[L]=k}function Br(...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=Gi(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=gf(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 Bs(R){let $=Object.keys(y);return[].concat($.map(T=>y[T])).some(function(T){return Array.isArray(T)?T.includes(R):T[R]})}function xy(R,...$){return[].concat(...$).some(function(T){let L=R.match(T);return L&&Bs(L[1])})}function Ey(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),!Bs(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 Us(R){return o["unknown-options-as-args"]&&_y(R)}function _y(R){return R=R.replace(/^-{3,}/,"--"),R.match(g)||Ey(R)?!1:!xy(R,/^-+([^=]+?)=[\s\S]*$/,w,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function Ur(R){return!re(R,y.bools)&&!re(R,y.counts)&&`${R}`in c?c[R]:Sy(Ry(R))}function Sy(R){return{[ht.BOOLEAN]:!0,[ht.STRING]:"",[ht.NUMBER]:void 0,[ht.ARRAY]:[]}[R]}function Ry(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 At(R){return R===void 0}function Ay(){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({},d),error:E,newAliases:Object.assign({},f)}}};function Ab(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 zo(t){return t!==void 0?t+1:1}function uu(t){return t==="__proto__"?"___proto___":t}function Cb(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var Wo,Vo,Ho,fu=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,hu=(Vo=(Wo=process==null?void 0:process.versions)===null||Wo===void 0?void 0:Wo.node)!==null&&Vo!==void 0?Vo:(Ho=process==null?void 0:process.version)===null||Ho===void 0?void 0:Ho.slice(1);if(hu&&Number(hu.match(/^([^.]+)/)[1])<fu)throw Error(`yargs parser supports a minimum Node.js version of ${fu}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Lb=process?process.env:{},du=lu?lu(import.meta.url):void 0,bf=new Oa({cwd:process.cwd,env:()=>Lb,format:vb,normalize:xb,resolve:wb,require:t=>{if(typeof du<"u")return du(t);if(t.match(/\.json$/))return JSON.parse(Eb(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),Kr=function(e,r){return bf.parse(e.slice(),r).argv};Kr.detailed=function(t,e){return bf.parse(t.slice(),e)};Kr.camelCase=Gi;Kr.decamelize=gf;Kr.looksLikeNumber=yf;var vf=t=>typeof t=="object"&&t!==null,pu=t=>vf(t)&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date)&&!(globalThis.Blob&&t instanceof globalThis.Blob),Ob=Symbol("mapObjectSkip"),$a=(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=>pu(o)?$a(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===Ob)continue;let[l,u,{shouldRecurse:p=!0}={}]=c;l!=="__proto__"&&(r.deep&&p&&pu(u)&&(u=Array.isArray(u)?n(u):$a(u,e,r,i)),s[l]=u)}return s};function $b(t,e,r){if(!vf(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 $a(t,e,r)}var Tb=/[\p{Lu}]/u,Pb=/[\p{Ll}]/u,mu=/^[\p{Lu}](?![\p{Lu}])/gu,wf=/([\p{Alpha}\p{N}_]|$)/u,Fa=/[_.\- ]+/,Ib=new RegExp("^"+Fa.source),gu=new RegExp(Fa.source+wf.source,"gu"),yu=new RegExp("\\d+"+wf.source,"gu"),Fb=(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&&Tb.test(l)?(t=t.slice(0,c)+"-"+t.slice(c),s=!1,a=n,n=!0,c++):n&&a&&Pb.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},Nb=(t,e)=>(mu.lastIndex=0,t.replaceAll(mu,r=>e(r))),Db=(t,e)=>(gu.lastIndex=0,yu.lastIndex=0,t.replaceAll(yu,(r,i,s)=>["_","-"].includes(t.charAt(s+r.length))?r:e(r)).replaceAll(gu,(r,i)=>e(i)));function Mb(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?Fa.test(t)?"":e.pascalCase?i(t):r(t):(t!==r(t)&&(t=Fb(t,r,i,e.preserveConsecutiveUppercase)),t=t.replace(Ib,""),t=e.preserveConsecutiveUppercase?Nb(t,r):r(t),e.pascalCase&&(t=i(t.charAt(0))+t.slice(1)),Db(t,i))}var kb=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)}*#p(){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.#p()],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.#p())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()}},jb=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),Ko=new kb({maxSize:1e5}),Vr=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),Hr=(t,e={},r=new WeakMap,i)=>{if(!Vr(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 d=[];r.set(t,d);for(let m of t)d.push(Vr(m)?Hr(m,e,r,i):m);return d}let u={};r.set(t,u);let b=$b(t,(d=>(m,y)=>{if(o&&Vr(y)){let g=d===void 0?m:`${d}.${m}`;l.has(g)||(y=Array.isArray(y)?y.map(w=>Vr(w)?Hr(w,e,r,g):w):Hr(y,e,r,g))}if(typeof m=="string"&&!(s&&jb(s,m))){let g=n?`${m}_`:m;if(Ko.has(g))m=Ko.get(g);else{let w=Mb(m,{pascalCase:n,locale:!1,preserveConsecutiveUppercase:c});m.length<100&&Ko.set(g,w),m=w}}return[m,y]})(i),{deep:!1});Object.assign(u,b);let f=Object.getOwnPropertySymbols(t);for(let d of f)u[d]=o&&Vr(t[d])?Hr(t[d],e,r,i):t[d];return u};function xf(t,e){let r=new WeakMap;return Array.isArray(t)?t.map((i,s)=>Vr(i)?Hr(i,e,r,String(s)):i):Hr(t,e,r)}function Ef(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"),qr=Symbol("STYLER"),ki=Symbol("IS_EMPTY"),au=["ansi","ansi","ansi256","ansi16m"],zr=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(ft))zr[t]={get(){let r=Hs(this,qo(e.open,e.close,this[qr]),this[ki]);return Object.defineProperty(this,t,{value:r}),r}};zr.visible={get(){let t=Hs(this,this[qr],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var Go=(t,e,r,...i)=>t==="rgb"?e==="ansi16m"?ft[r].ansi16m(...i):e==="ansi256"?ft[r].ansi256(ft.rgbToAnsi256(...i)):ft[r].ansi(ft.rgbToAnsi(...i)):t==="hex"?Go("rgb",e,r,...ft.hexToRgb(...i)):ft[r][t](...i),sb=["rgb","hex","ansi256"];for(let t of sb){zr[t]={get(){let{level:r}=this;return function(...i){let s=qo(Go(t,au[r],"color",...i),ft.color.close,this[qr]);return Hs(this,s,this[ki])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);zr[e]={get(){let{level:r}=this;return function(...i){let s=qo(Go(t,au[r],"bgColor",...i),ft.bgColor.close,this[qr]);return Hs(this,s,this[ki])}}}}var nb=Object.defineProperties(()=>{},{...zr,level:{enumerable:!0,get(){return this[Uo].level},set(t){this[Uo].level=t}}}),qo=(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[qr]=e,i[ki]=r,i},ob=(t,e)=>{if(t.level<=0||!e)return t[ki]?"":e;let r=t[qr];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,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]===`
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 Bb(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 Ub(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 Na(t,e=0,r={}){return Ub(Bb(t),e,r)}var bu=t=>t instanceof URL?pf(t):t;function Gb(t,{cwd:e=_b.cwd(),type:r="file",stopAt:i}={}){let s=Gt.resolve(bu(e)??""),{root:n}=Gt.parse(s);i=Gt.resolve(s,bu(i)??n);let a=Gt.isAbsolute(t);for(;s;){let o=a?t:Gt.join(s,t);try{let c=mf.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 Zs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var zr={},Hs={exports:{}},vu;function qb(){if(vu)return Hs.exports;vu=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 p=""+u,b=p.indexOf(c,o.length);return~b?o+n(p,c,l,b)+c:o+p+c},n=(o,c,l,u)=>{let p="",b=0;do p+=o.substring(b,u)+l,b=u+c.length,u=o.indexOf(c,b);while(~u);return p+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 Hs.exports=a(),Hs.exports.createColors=a,Hs.exports}var ji={},wu;function zb(){return wu||(wu=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.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,ji.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}),ji}var Yo={},Wr={},xu;function Wb(){if(xu)return Wr;xu=1,Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.isIdentifierChar=c,Wr.isIdentifierName=l,Wr.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,p){let b=65536;for(let f=0,d=p.length;f<d;f+=2){if(b+=p[f],b>u)return!1;if(b+=p[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 p=!0;for(let b=0;b<u.length;b++){let f=u.charCodeAt(b);if((f&64512)===55296&&b+1<u.length){let d=u.charCodeAt(++b);(d&64512)===56320&&(f=65536+((f&1023)<<10)+(d&1023))}if(p){if(p=!1,!o(f))return!1}else if(!c(f))return!1}return!p}return Wr}var Ut={},Eu;function Vb(){if(Eu)return Ut;Eu=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 _u;function Hb(){return _u||(_u=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=Wb(),r=Vb()})(Yo)),Yo}var Su;function Kb(){if(Su)return zr;Su=1,Object.defineProperty(zr,"__esModule",{value:!0});var t=qb(),e=zb(),r=Hb();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]/,p=/^[()[\]{}]$/,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"&&p.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(C=>h[x](C)).join(`
22
- `):v+=_;return v}let d=!1,m=/\r\n|[\n\r\u2028\u2029]/;function y(E,h,v){let x=Object.assign({column:0,line:-1},E.start),_=Object.assign({},x,E.end),{linesAbove:C=2,linesBelow:A=3}=v||{},O=x.line,F=x.column,M=_.line,I=_.column,Y=Math.max(O-(C+1),0),J=Math.min(h.length,M+A);O===-1&&(Y=0),M===-1&&(J=h.length);let G=M-O,V={};if(G)for(let se=0;se<=G;se++){let ee=se+O;if(!F)V[ee]=!0;else if(se===0){let we=h[ee-1].length;V[ee]=[F,we-F+1]}else if(se===G)V[ee]=[0,I];else{let we=h[ee-se].length;V[ee]=[0,we]}}else F===I?F?V[O]=[F,0]:V[O]=!0:V[O]=[F,I-F];return{start:Y,end:J,markerLines:V}}function g(E,h,v={}){let x=v.forceColor||i()&&v.highlightCode,_=c(x),C=E.split(m),{start:A,end:O,markerLines:F}=y(h,C,v),M=h.start&&typeof h.start.column=="number",I=String(O).length,J=(x?f(E):E).split(m,O).slice(A,O).map((G,V)=>{let se=A+1+V,we=` ${` ${se}`.slice(-I)} |`,xe=F[se],Oe=!F[se+1];if(xe){let Br="";if(Array.isArray(xe)){let re=G.slice(0,Math.max(xe[0]-1,0)).replace(/[^\t]/g," "),Bs=xe[1]||1;Br=[`
23
- `,_.gutter(we.replace(/\d/g," "))," ",re,_.marker("^").repeat(Bs)].join(""),Oe&&v.message&&(Br+=" "+_.message(v.message))}return[_.marker(">"),_.gutter(we),G.length>0?` ${G}`:"",Br].join("")}else return` ${_.gutter(we)}${G.length>0?` ${G}`:""}`}).join(`
24
- `);return v.message&&!M&&(J=`${" ".repeat(I+1)}${v.message}
25
- ${J}`),x?_.reset(J):J}function w(E,h,v,x={}){if(!d){d=!0;let C="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(C,"DeprecationWarning");else{let A=new Error(C);A.name="DeprecationWarning",console.warn(new Error(C))}}return v=Math.max(v,0),g(E,{start:{column:v,line:h}},x)}return zr.codeFrameColumns=g,zr.default=w,zr.highlight=f,zr}var Yb=Kb();function Xb(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 Zb(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=Xb(t,e);return r?{line:i.line+1,column:i.column+1}:i}var Jb=t=>`\\u{${t.codePointAt(0).toString(16)}}`,Ta=class t extends Error{name="JSONError";fileName;#t;#r;#e;#n;#f;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??=`${ev(this.#r.message)}${this.#t===""?" while parsing empty string":""}`;let{codeFrame:e}=this;return`${this.#e}${this.fileName?` in ${this.fileName}`:""}${e?`
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(E,h,v){let x=Object.assign({column:0,line:-1},E.start),_=Object.assign({},x,E.end),{linesAbove:A=2,linesBelow:C=3}=v||{},O=x.line,F=x.column,M=_.line,I=_.column,Y=Math.max(O-(A+1),0),Z=Math.min(h.length,M+C);O===-1&&(Y=0),M===-1&&(Z=h.length);let G=M-O,V={};if(G)for(let se=0;se<=G;se++){let ee=se+O;if(!F)V[ee]=!0;else if(se===0){let we=h[ee-1].length;V[ee]=[F,we-F+1]}else if(se===G)V[ee]=[0,I];else{let we=h[ee-se].length;V[ee]=[0,we]}}else F===I?F?V[O]=[F,0]:V[O]=!0:V[O]=[F,I-F];return{start:Y,end:Z,markerLines:V}}function g(E,h,v={}){let x=v.forceColor||i()&&v.highlightCode,_=c(x),A=E.split(m),{start:C,end:O,markerLines:F}=y(h,A,v),M=h.start&&typeof h.start.column=="number",I=String(O).length,Z=(x?f(E):E).split(m,O).slice(C,O).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
+ `,_.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
+ `);return v.message&&!M&&(Z=`${" ".repeat(I+1)}${v.message}
25
+ ${Z}`),x?_.reset(Z):Z}function w(E,h,v,x={}){if(!p){p=!0;let A="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(A,"DeprecationWarning");else{let C=new Error(A);C.name="DeprecationWarning",console.warn(new Error(A))}}return v=Math.max(v,0),g(E,{start:{column:v,line:h}},x)}return Wr.codeFrameColumns=g,Wr.default=w,Wr.highlight=f,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;#f;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=Qb(r,this.#r.message);if(i)return Yb.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}},Qb=(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)}:Zb(t,Number(i),{oneBased:!0})},ev=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,i)=>`"${i}"(${Jb(i)})`);function tv(t,e,r){try{return JSON.parse(t,e)}catch(i){throw new Ta({jsonParseError:i,fileName:r,input:t})}}var Xo,Ru;function _f(){return Ru||(Ru=1,Xo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Xo}var Zo,Au;function Sf(){if(Au)return Zo;Au=1;let t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,s=e-6;return Zo={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},Zo}var Ks={exports:{}},Cu;function rv(){return Cu||(Cu=1,(function(t,e){let{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:s}=Sf(),n=_f();e=t.exports={};let a=e.re=[],o=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},p=0,b="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",s],[b,i]],d=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=d(g),h=p++;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*$")})(Ks,Ks.exports)),Ks.exports}var Jo,Lu;function iv(){if(Lu)return Jo;Lu=1;let t=Object.freeze({loose:!0}),e=Object.freeze({});return Jo=i=>i?typeof i!="object"?t:i:e,Jo}var Qo,Ou;function sv(){if(Ou)return Qo;Ou=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 Qo={compareIdentifiers:e,rcompareIdentifiers:(i,s)=>e(s,i)},Qo}var ea,$u;function nv(){if($u)return ea;$u=1;let t=_f(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=Sf(),{safeRe:i,t:s}=rv(),n=iv(),{compareIdentifiers:a}=sv();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 p=l.trim().match(u.loose?i[s.LOOSE]:i[s.FULL]);if(!p)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+p[1],this.minor=+p[2],this.patch=+p[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");p[4]?this.prerelease=p[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=p[5]?p[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 p=this.prerelease[u],b=l.prerelease[u];if(t("prerelease compare",u,p,b),p===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(p===void 0)return-1;if(p===b)continue;return a(p,b)}while(++u)}compareBuild(l){l instanceof o||(l=new o(l,this.options));let u=0;do{let p=this.build[u],b=l.build[u];if(t("build compare",u,p,b),p===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(p===void 0)return-1;if(p===b)continue;return a(p,b)}while(++u)}inc(l,u,p){if(l.startsWith("pre")){if(!u&&p===!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,p);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,p);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,p),this.inc("pre",u,p);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,p),this.inc("pre",u,p);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(p)?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(".")&&p===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(b)}}if(u){let f=[u,b];p===!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 ea=o,ea}var ta,Tu;function Rf(){if(Tu)return ta;Tu=1;let t=nv();return ta=(r,i,s=!1)=>{if(r instanceof t)return r;try{return new t(r,i)}catch(n){if(!s)return null;throw n}},ta}var ra,Pu;function Af(){if(Pu)return ra;Pu=1;let t=Rf();return ra=(r,i)=>{let s=t(r,i);return s?s.version:null},ra}var ia,Iu;function Cf(){if(Iu)return ia;Iu=1;let t=Rf();return ia=(r,i)=>{let s=t(r.trim().replace(/^[=v]+/,""),i);return s?s.version:null},ia}var Lf=["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"],ov=["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"],av=["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"],sa,Fu;function cv(){if(Fu)return sa;Fu=1;var t=[].concat(Lf).concat(ov),e=av;return sa=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 p(){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()||p()||b()}for(var d=[];s()&&(a(),!!s());){var m=f();if(!m)throw new Error("Unexpected `"+r[i]+"` at offset "+i);d.push(m)}return d},sa}var na,Nu;function lv(){return Nu||(Nu=1,na=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 p(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=p("AND",u),f=p("OR",b),d=f();if(!d||r())throw new Error("Syntax error");return d}),na}var oa,Du;function Of(){if(Du)return oa;Du=1;var t=cv(),e=lv();return oa=function(r){return e(t(r))},oa}var aa,Mu;function uv(){if(Mu)return aa;Mu=1;var t=Of(),e=Lf;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),p=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},d=function(g){for(var w=g.toUpperCase(),E=0;E<u.length;E++){var h=u[E];if(w.indexOf(h[p])>-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};aa=function(g,w){w=w||{};var E=w.upgrade===void 0?!0:!!w.upgrade;function h(C){return E?y(C):C}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(C){return r(C)?C:f(C)}),_!==null)||(_=d(g),_!==null)||(_=m(g,d),_!==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 aa}var ca,ku;function $f(){if(ku)return ca;ku=1;var t=Of(),e=uv(),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 ca=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}},ca}var Bi={},ju;function fv(){if(ju)return Bi;ju=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.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,d,m)=>{typeof r.emitWarning=="function"?r.emitWarning(b,f,d,m):console.error(`[${d}] ${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 d=c(f);if(!d)return[];u.#t=!0;let m=new u(f,d);return u.#t=!1,m}constructor(f,d){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new d(f),this.length=0}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}}class p{#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;#p;#g;#y;#d;#A;#x;#E;#_;#S;#v;static unsafeExposeInternals(f){return{starts:f.#x,ttls:f.#E,sizes:f.#A,keyMap:f.#s,keyList:f.#c,valList:f.#i,next:f.#l,prev:f.#o,get head(){return f.#p},get tail(){return f.#g},free:f.#y,isBackgroundFetch:d=>f.#m(d),backgroundFetch:(d,m,y,g)=>f.#F(d,m,y,g),moveToTail:d=>f.#D(d),indexes:d=>f.#L(d),rindexes:d=>f.#$(d),isStale:d=>f.#R(d)}}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:d=0,ttl:m,ttlResolution:y=1,ttlAutopurge:g,updateAgeOnGet:w,updateAgeOnHas:E,allowStale:h,dispose:v,disposeAfter:x,noDisposeOnSet:_,noUpdateTTL:C,maxSize:A=0,maxEntrySize:O=0,sizeCalculation:F,fetchMethod:M,memoMethod:I,noDeleteOnFetchRejection:Y,noDeleteOnStaleGet:J,allowStaleOnFetchRejection:G,allowStaleOnFetchAbort:V,ignoreFetchAbort:se}=f;if(d!==0&&!o(d))throw new TypeError("max option must be a nonnegative integer");let ee=d?c(d):Array;if(!ee)throw new Error("invalid max value: "+d);if(this.#t=d,this.#r=A,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(d).fill(void 0),this.#i=new Array(d).fill(void 0),this.#l=new ee(d),this.#o=new ee(d),this.#p=0,this.#g=0,this.#y=u.create(d),this.#a=0,this.#u=0,typeof v=="function"&&(this.#e=v),typeof x=="function"?(this.#n=x,this.#d=[]):(this.#n=void 0,this.#d=void 0),this.#_=!!this.#e,this.#v=!!this.#n,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!C,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=!!J,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,p))}}getRemainingTTL(f){return this.#s.has(f)?1/0:0}#P(){let f=new l(this.#t),d=new l(this.#t);this.#E=f,this.#x=d,this.#M=(g,w,E=t.now())=>{if(d[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.#C=g=>{d[g]=f[g]!==0?t.now():0},this.#h=(g,w)=>{if(f[w]){let E=f[w],h=d[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=d[w];if(!E||!h)return 1/0;let v=(m||y())-h;return E-v},this.#R=g=>{let w=d[g],E=f[g];return!!E&&!!w&&(m||y())-w>E}}#C=()=>{};#h=()=>{};#M=()=>{};#R=()=>!1;#I(){let f=new l(this.#t);this.#u=0,this.#A=f,this.#N=d=>{this.#u-=f[d],f[d]=0},this.#B=(d,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,d),!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=(d,m,y)=>{if(f[d]=m,this.#r){let g=this.#r-f[d];for(;this.#u>g;)this.#T(!0)}this.#u+=f[d],y&&(y.entrySize=m,y.totalCalculatedSize=this.#u)}}#N=f=>{};#O=(f,d,m)=>{};#B=(f,d,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 d=this.#g;!(!this.#k(d)||((f||!this.#R(d))&&(yield d),d===this.#p));)d=this.#o[d]}*#$({allowStale:f=this.allowStale}={}){if(this.#a)for(let d=this.#p;!(!this.#k(d)||((f||!this.#R(d))&&(yield d),d===this.#g));)d=this.#l[d]}#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 d=this.#c[f];d!==void 0&&!this.#m(this.#i[f])&&(yield d)}}*rkeys(){for(let f of this.#$()){let d=this.#c[f];d!==void 0&&!this.#m(this.#i[f])&&(yield d)}}*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,d={}){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],d)}}forEach(f,d=this){for(let m of this.#L()){let y=this.#i[m],g=this.#m(y)?y.__staleWhileFetching:y;g!==void 0&&f.call(d,g,this.#c[m],this)}}rforEach(f,d=this){for(let m of this.#$()){let y=this.#i[m],g=this.#m(y)?y.__staleWhileFetching:y;g!==void 0&&f.call(d,g,this.#c[m],this)}}purgeStale(){let f=!1;for(let d of this.#$({allowStale:!0}))this.#R(d)&&(this.#b(this.#c[d],"expire"),f=!0);return f}info(f){let d=this.#s.get(f);if(d===void 0)return;let m=this.#i[d],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[d],E=this.#x[d];if(w&&E){let h=w-(t.now()-E);g.ttl=h,g.start=Date.now()}}return this.#A&&(g.size=this.#A[d]),g}dump(){let f=[];for(let d of this.#L({allowStale:!0})){let m=this.#c[d],y=this.#i[d],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[d];let E=t.now()-this.#x[d];w.start=Math.floor(Date.now()-E)}this.#A&&(w.size=this.#A[d]),f.unshift([m,w])}return f}load(f){this.clear();for(let[d,m]of f){if(m.start){let y=Date.now()-m.start;m.start=t.now()-y}this.set(d,m.value,m)}}set(f,d,m={}){if(d===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,d,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[_]=d,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 C=this.#i[_];if(d!==C){if(this.#S&&this.#m(C)){C.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:A}=C;A!==void 0&&!w&&(this.#_&&this.#e?.(A,f,"set"),this.#v&&this.#d?.push([A,f,"set"]))}else w||(this.#_&&this.#e?.(C,f,"set"),this.#v&&this.#d?.push([C,f,"set"]));if(this.#N(_),this.#O(_,x,h),this.#i[_]=d,h){h.set="replace";let A=C&&this.#m(C)?C.__staleWhileFetching:C;A!==void 0&&(h.oldValue=A)}}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.#d){let C=this.#d,A;for(;A=C?.shift();)this.#n?.(...A)}return this}pop(){try{for(;this.#a;){let f=this.#i[this.#p];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.#d){let f=this.#d,d;for(;d=f?.shift();)this.#n?.(...d)}}}#T(f){let d=this.#p,m=this.#c[d],y=this.#i[d];return this.#S&&this.#m(y)?y.__abortController.abort(new Error("evicted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(y,m,"evict"),this.#v&&this.#d?.push([y,m,"evict"])),this.#N(d),f&&(this.#c[d]=void 0,this.#i[d]=void 0,this.#y.push(d)),this.#a===1?(this.#p=this.#g=0,this.#y.length=0):this.#p=this.#l[d],this.#s.delete(m),this.#a--,d}has(f,d={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=d,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.#C(g),y&&(y.has="hit",this.#h(y,g)),!0}else y&&(y.has="miss");return!1}peek(f,d={}){let{allowStale:m=this.allowStale}=d,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,d,m,y){let g=d===void 0?void 0:this.#i[d];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 J=A;return this.#i[d]===A&&(F===void 0?J.__staleWhileFetching?this.#i[d]=J.__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,J=Y||m.noDeleteOnFetchRejection,G=A;if(this.#i[d]===A&&(!J||G.__staleWhileFetching===void 0?this.#b(f,"fetch"):I||(this.#i[d]=G.__staleWhileFetching)),Y)return m.status&&G.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw F},C=(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 A=new Promise(C).then(v,x),O=Object.assign(A,{__abortController:w,__staleWhileFetching:g,__returned:void 0});return d===void 0?(this.set(f,O,{...h.options,status:void 0}),d=this.#s.get(f)):this.#i[d]=O,O}#m(f){if(!this.#S)return!1;let d=f;return!!d&&d instanceof Promise&&d.hasOwnProperty("__staleWhileFetching")&&d.__abortController instanceof s}async fetch(f,d={}){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:C=this.allowStaleOnFetchRejection,ignoreFetchAbort:A=this.ignoreFetchAbort,allowStaleOnFetchAbort:O=this.allowStaleOnFetchAbort,context:F,forceRefresh:M=!1,status:I,signal:Y}=d;if(!this.#S)return I&&(I.fetch="get"),this.get(f,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:g,status:I});let J={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:g,ttl:w,noDisposeOnSet:E,size:h,sizeCalculation:v,noUpdateTTL:x,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:O,ignoreFetchAbort:A,status:I,signal:Y},G=this.#s.get(f);if(G===void 0){I&&(I.fetch="miss");let V=this.#F(f,G,J,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.#C(G),I&&this.#h(I,G),V;let ee=this.#F(f,G,J,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,d={}){let m=await this.fetch(f,d);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(f,d={}){let m=this.#w;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:g,...w}=d,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,d={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:g=this.noDeleteOnStaleGet,status:w}=d,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.#C(E),h))}else w&&(w.get="miss")}#j(f,d){this.#o[d]=f,this.#l[f]=d}#D(f){f!==this.#g&&(f===this.#p?this.#p=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,d){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(d);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,d),this.#v&&this.#d?.push([g,f,d])),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.#p)this.#p=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.#d?.length){let y=this.#d,g;for(;g=y?.shift();)this.#n?.(...g)}return m}clear(){return this.#G("delete")}#G(f){for(let d of this.#$({allowStale:!0})){let m=this.#i[d];if(this.#m(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#c[d];this.#_&&this.#e?.(m,y,f),this.#v&&this.#d?.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.#A&&this.#A.fill(0),this.#p=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#v&&this.#d){let d=this.#d,m;for(;m=d?.shift();)this.#n?.(...m)}}}return Bi.LRUCache=p,Bi}var la,Bu;function hv(){if(Bu)return la;Bu=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:p,hashformat:b})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",b(p||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:p,hashformat:b})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",b(p||""))}`,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:p})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,p)}`,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 la=s,la}var ua,Uu;function Tf(){if(Uu)return ua;Uu=1;let t=Ia,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 ua=(n,a)=>{let o=a?i(n,a):n;return r(o)||r(s(o))},ua}var fa,Gu;function dv(){if(Gu)return fa;Gu=1;let t=Tf(),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,p=a===-1||i>-1&&a>i,b=n===-1||i>-1&&n>i,f=s>0,d=i>-1?r[i-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&f&&d&&m&&u&&p&&b};return fa=(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 p=s[c||l],b=null;n[o.protocol]?.auth&&(o.username||o.password)&&(b=`${o.username}${o.password?":"+o.password:""}`);let f=null,d=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?(d=decodeURIComponent(g.slice(0,E)),d||(d=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(!p.protocols.includes(o.protocol))return;let g=p.extract(o);if(!g)return;d=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,d,b,m,f,y,i]},fa}var ha,qu;function pv(){if(qu)return ha;qu=1;let{LRUCache:t}=fv(),e=hv(),r=dv(),i=Tf(),s=new t({max:1e3});class n{constructor(o,c,l,u,p,b,f={}){Object.assign(this,n.#t[o],{type:o,user:c,auth:l,project:u,committish:p,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 ha=n,ha}var da,zu;function mv(){if(zu)return da;zu=1,da=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 da}var gv={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"},yv={web:"url",name:"url"},bv={server:"start",tests:"test"},vv={topLevel:gv,bugs:yv,script:bv},pa,Wu;function wv(){if(Wu)return pa;Wu=1;var t=Af(),e=Cf(),r=$f(),i=pv(),s=df,n=["dependencies","devDependencies","optionalDependencies"],a=mv(),o=Ia,c=vv,l=h=>h.includes("@")&&h.indexOf("@")<h.lastIndexOf(".");pa={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 C=i.fromUrl(h[v][x]);C&&(h[v][x]=C.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,d),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 p(h){return!h.match(/[/@\s+%:]/)&&h===encodeURIComponent(h)}function b(h,v,x){if(h.charAt(0)==="."||!(u(h)||p(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 d(h){if(typeof h=="string")return h;var v=h.name||"",x=h.url||h.web,_=x?" ("+x+")":"",C=h.email||h.mail,A=C?" <"+C+">":"";return v+A+_}function m(h){if(typeof h!="string")return h;var v=h.match(/^([^(<]+)/),x=h.match(/\(([^()]+)\)/),_=h.match(/<([^<>]+)>/),C={};return v&&v[0].trim()&&(C.name=v[0].trim()),_&&(C.email=_[1]),x&&(C.url=x[1]),C}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(C){return typeof C=="string"}).forEach(function(C){C=C.trim().split(/(:?[@\s><=])/);var A=C.shift(),O=C.join("");O=O.trim(),O=O.replace(/^@/,""),_[A]=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 pa}var xv="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Ev="No repository field.",_v="Probably broken git url: %s",Sv="scripts must be an object",Rv="script values must be string commands",Av="Invalid 'files' member",Cv="Invalid filename in 'files' list: %s",Lv="Invalid 'bundleDependencies' list. Must be array of package names",Ov="Invalid bundleDependencies member: %s",$v="Non-dependency in bundleDependencies: %s",Tv="%s field must be an object",Pv="Invalid dependency: %s %s",Iv="specifying %s as array is deprecated",Fv="modules field is deprecated",Nv="keywords should be an array of strings",Dv="keywords should be an array of strings",Mv="%s is also the name of a node core module.",kv="'description' field should be a string",jv="No description",Bv="No README data",Uv="No license field.",Gv="Bug string field must be url, email, or {email,url}",qv="bugs.url field must be a string url. Deleted.",zv="bugs.email field must be a string email. Deleted.",Wv="Normalized value of bugs field is an empty object. Deleted.",Vv="homepage field must be a string url. Deleted.",Hv="license should be a valid SPDX license expression",Kv="%s should probably be %s.",Yv={repositories:xv,missingRepository:Ev,brokenGitUrl:_v,nonObjectScripts:Sv,nonStringScript:Rv,nonArrayFiles:Av,invalidFilename:Cv,nonArrayBundleDependencies:Lv,nonStringBundleDependency:Ov,nonDependencyBundleDependency:$v,nonObjectDependencies:Tv,nonStringDependency:Pv,deprecatedArrayDependencies:Iv,deprecatedModules:Fv,nonArrayKeywords:Nv,nonStringKeyword:Dv,conflictingName:Mv,nonStringDescription:kv,missingDescription:jv,missingReadme:Bv,missingLicense:Uv,nonEmailUrlBugsString:Gv,nonUrlBugsUrlField:qv,nonEmailBugsEmailField:zv,emptyNormalizedBugs:Wv,nonUrlHomepage:Vv,invalidLicense:Hv,typo:Kv},ma,Vu;function Xv(){if(Vu)return ma;Vu=1;var t=hf,e=Yv;ma=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 ma}var ga,Hu;function Zv(){if(Hu)return ga;Hu=1,ga=n;var t=wv();n.fixer=t;var e=Xv(),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 ga}var Jv=Zv(),Qv=Zs(Jv);function ew(t){return t instanceof URL?pf(t):t}var tw=t=>Gt.resolve(ew(t)??".","package.json"),rw=(t,e)=>{let r=typeof t=="string"?tv(t):t;return e&&Qv(r),r};function iw({cwd:t,normalize:e=!0}={}){let r=mf.readFileSync(tw(t),"utf8");return rw(r,e)}function Pf(t){let e=Gb("package.json",t);if(e)return{packageJson:iw({...t,cwd:Gt.dirname(e)}),path:e}}var Ui={},Ku;function sw(){if(Ku)return Ui;Ku=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,d,m)=>{typeof r.emitWarning=="function"?r.emitWarning(b,f,d,m):console.error(`[${d}] ${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 d=c(f);if(!d)return[];u.#t=!0;let m=new u(f,d);return u.#t=!1,m}constructor(f,d){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new d(f),this.length=0}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}}class p{#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;#p;#g;#y;#d;#A;#x;#E;#_;#S;#v;#P;#C;#h;static unsafeExposeInternals(f){return{starts:f.#_,ttls:f.#S,sizes:f.#E,keyMap:f.#i,keyList:f.#l,valList:f.#o,next:f.#p,prev:f.#g,get head(){return f.#y},get tail(){return f.#d},free:f.#A,isBackgroundFetch:d=>f.#b(d),backgroundFetch:(d,m,y,g)=>f.#D(d,m,y,g),moveToTail:d=>f.#q(d),indexes:d=>f.#T(d),rindexes:d=>f.#F(d),isStale:d=>f.#O(d)}}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:d=0,ttl:m,ttlResolution:y=1,ttlAutopurge:g,updateAgeOnGet:w,updateAgeOnHas:E,allowStale:h,dispose:v,onInsert:x,disposeAfter:_,noDisposeOnSet:C,noUpdateTTL:A,maxSize:O=0,maxEntrySize:F=0,sizeCalculation:M,fetchMethod:I,memoMethod:Y,noDeleteOnFetchRejection:J,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,d!==0&&!o(d))throw new TypeError("max option must be a nonnegative integer");let xe=d?c(d):Array;if(!xe)throw new Error("invalid max value: "+d);if(this.#t=d,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(d).fill(void 0),this.#o=new Array(d).fill(void 0),this.#p=new xe(d),this.#g=new xe(d),this.#y=0,this.#d=0,this.#A=u.create(d),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.#C=!!this.#f,this.noDisposeOnSet=!!C,this.noUpdateTTL=!!A,this.noDeleteOnFetchRejection=!!J,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,p))}}getRemainingTTL(f){return this.#i.has(f)?1/0:0}#M(){let f=new l(this.#t),d=new l(this.#t);this.#S=f,this.#_=d,this.#N=(g,w,E=this.#u.now())=>{if(d[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=>{d[g]=f[g]!==0?this.#u.now():0},this.#I=(g,w)=>{if(f[w]){let E=f[w],h=d[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=d[w];if(!E||!h)return 1/0;let v=(m||y())-h;return E-v},this.#O=g=>{let w=d[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=d=>{this.#c-=f[d],f[d]=0},this.#k=(d,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,d),!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.#$=(d,m,y)=>{if(f[d]=m,this.#r){let g=this.#r-f[d];for(;this.#c>g;)this.#j(!0)}this.#c+=f[d],y&&(y.entrySize=m,y.totalCalculatedSize=this.#c)}}#L=f=>{};#$=(f,d,m)=>{};#k=(f,d,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 d=this.#d;!(!this.#m(d)||((f||!this.#O(d))&&(yield d),d===this.#y));)d=this.#g[d]}*#F({allowStale:f=this.allowStale}={}){if(this.#s)for(let d=this.#y;!(!this.#m(d)||((f||!this.#O(d))&&(yield d),d===this.#d));)d=this.#p[d]}#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 d=this.#l[f];d!==void 0&&!this.#b(this.#o[f])&&(yield d)}}*rkeys(){for(let f of this.#F()){let d=this.#l[f];d!==void 0&&!this.#b(this.#o[f])&&(yield d)}}*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,d={}){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],d)}}forEach(f,d=this){for(let m of this.#T()){let y=this.#o[m],g=this.#b(y)?y.__staleWhileFetching:y;g!==void 0&&f.call(d,g,this.#l[m],this)}}rforEach(f,d=this){for(let m of this.#F()){let y=this.#o[m],g=this.#b(y)?y.__staleWhileFetching:y;g!==void 0&&f.call(d,g,this.#l[m],this)}}purgeStale(){let f=!1;for(let d of this.#F({allowStale:!0}))this.#O(d)&&(this.#U(this.#l[d],"expire"),f=!0);return f}info(f){let d=this.#i.get(f);if(d===void 0)return;let m=this.#o[d],y=this.#b(m)?m.__staleWhileFetching:m;if(y===void 0)return;let g={value:y};if(this.#S&&this.#_){let w=this.#S[d],E=this.#_[d];if(w&&E){let h=w-(this.#u.now()-E);g.ttl=h,g.start=Date.now()}}return this.#E&&(g.size=this.#E[d]),g}dump(){let f=[];for(let d of this.#T({allowStale:!0})){let m=this.#l[d],y=this.#o[d],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[d];let E=this.#u.now()-this.#_[d];w.start=Math.floor(Date.now()-E)}this.#E&&(w.size=this.#E[d]),f.unshift([m,w])}return f}load(f){this.clear();for(let[d,m]of f){if(m.start){let y=Date.now()-m.start;m.start=this.#u.now()-y}this.set(d,m.value,m)}}set(f,d,m={}){if(d===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,d,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.#d:this.#A.length!==0?this.#A.pop():this.#s===this.#t?this.#j(!1):this.#s,this.#l[_]=f,this.#o[_]=d,this.#i.set(f,_),this.#p[this.#d]=_,this.#g[_]=this.#d,this.#d=_,this.#s++,this.#$(_,x,h),h&&(h.set="add"),v=!1,this.#h&&this.#n?.(d,f,"add");else{this.#q(_);let C=this.#o[_];if(d!==C){if(this.#P&&this.#b(C)){C.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:A}=C;A!==void 0&&!w&&(this.#v&&this.#e?.(A,f,"set"),this.#C&&this.#x?.push([A,f,"set"]))}else w||(this.#v&&this.#e?.(C,f,"set"),this.#C&&this.#x?.push([C,f,"set"]));if(this.#L(_),this.#$(_,x,h),this.#o[_]=d,h){h.set="replace";let A=C&&this.#b(C)?C.__staleWhileFetching:C;A!==void 0&&(h.oldValue=A)}}else h&&(h.set="update");this.#h&&this.onInsert?.(d,f,d===C?"update":"replace")}if(y!==0&&!this.#S&&this.#M(),this.#S&&(v||this.#N(_,y,g),h&&this.#I(h,_)),!w&&this.#C&&this.#x){let C=this.#x,A;for(;A=C?.shift();)this.#f?.(...A)}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.#C&&this.#x){let f=this.#x,d;for(;d=f?.shift();)this.#f?.(...d)}}}#j(f){let d=this.#y,m=this.#l[d],y=this.#o[d];return this.#P&&this.#b(y)?y.__abortController.abort(new Error("evicted")):(this.#v||this.#C)&&(this.#v&&this.#e?.(y,m,"evict"),this.#C&&this.#x?.push([y,m,"evict"])),this.#L(d),f&&(this.#l[d]=void 0,this.#o[d]=void 0,this.#A.push(d)),this.#s===1?(this.#y=this.#d=0,this.#A.length=0):this.#y=this.#p[d],this.#i.delete(m),this.#s--,d}has(f,d={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=d,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,d={}){let{allowStale:m=this.allowStale}=d,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,d,m,y){let g=d===void 0?void 0:this.#o[d];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 J=A;return this.#o[d]===A&&(F===void 0?J.__staleWhileFetching!==void 0?this.#o[d]=J.__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,J=Y||m.noDeleteOnFetchRejection,G=A;if(this.#o[d]===A&&(!J||G.__staleWhileFetching===void 0?this.#U(f,"fetch"):I||(this.#o[d]=G.__staleWhileFetching)),Y)return m.status&&G.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw F},C=(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 A=new Promise(C).then(v,x),O=Object.assign(A,{__abortController:w,__staleWhileFetching:g,__returned:void 0});return d===void 0?(this.set(f,O,{...h.options,status:void 0}),d=this.#i.get(f)):this.#o[d]=O,O}#b(f){if(!this.#P)return!1;let d=f;return!!d&&d instanceof Promise&&d.hasOwnProperty("__staleWhileFetching")&&d.__abortController instanceof s}async fetch(f,d={}){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:C=this.allowStaleOnFetchRejection,ignoreFetchAbort:A=this.ignoreFetchAbort,allowStaleOnFetchAbort:O=this.allowStaleOnFetchAbort,context:F,forceRefresh:M=!1,status:I,signal:Y}=d;if(!this.#P)return I&&(I.fetch="get"),this.get(f,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:g,status:I});let J={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:g,ttl:w,noDisposeOnSet:E,size:h,sizeCalculation:v,noUpdateTTL:x,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:O,ignoreFetchAbort:A,status:I,signal:Y},G=this.#i.get(f);if(G===void 0){I&&(I.fetch="miss");let V=this.#D(f,G,J,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,J,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,d={}){let m=await this.fetch(f,d);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(f,d={}){let m=this.#a;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:g,...w}=d,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,d={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:g=this.noDeleteOnStaleGet,status:w}=d,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,d){this.#g[d]=f,this.#p[f]=d}#q(f){f!==this.#d&&(f===this.#y?this.#y=this.#p[f]:this.#G(this.#g[f],this.#p[f]),this.#G(this.#d,f),this.#d=f)}delete(f){return this.#U(f,"delete")}#U(f,d){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(d);else{this.#L(y);let g=this.#o[y];if(this.#b(g)?g.__abortController.abort(new Error("deleted")):(this.#v||this.#C)&&(this.#v&&this.#e?.(g,f,d),this.#C&&this.#x?.push([g,f,d])),this.#i.delete(f),this.#l[y]=void 0,this.#o[y]=void 0,y===this.#d)this.#d=this.#g[y];else if(y===this.#y)this.#y=this.#p[y];else{let w=this.#g[y];this.#p[w]=this.#p[y];let E=this.#p[y];this.#g[E]=this.#g[y]}this.#s--,this.#A.push(y)}}if(this.#C&&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 d of this.#F({allowStale:!0})){let m=this.#o[d];if(this.#b(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#l[d];this.#v&&this.#e?.(m,y,f),this.#C&&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.#d=0,this.#A.length=0,this.#c=0,this.#s=0,this.#C&&this.#x){let d=this.#x,m;for(;m=d?.shift();)this.#f?.(...m)}}}return Ui.LRUCache=p,Ui}var ya,Yu;function nw(){if(Yu)return ya;Yu=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:p,hashformat:b})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",b(p||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:p,hashformat:b})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",b(p||""))}`,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:p})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,p)}`,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 ya=s,ya}var ba,Xu;function If(){if(Xu)return ba;Xu=1;let t=Ia,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 ba=(n,a)=>{let o=a?i(n,a):n;return r(o)||r(s(o))},ba}var va,Zu;function ow(){if(Zu)return va;Zu=1;let t=If(),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,p=a===-1||i>-1&&a>i,b=n===-1||i>-1&&n>i,f=s>0,d=i>-1?r[i-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&f&&d&&m&&u&&p&&b};return va=(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 p=s[c||l],b=null;n[o.protocol]?.auth&&(o.username||o.password)&&(b=`${o.username}${o.password?":"+o.password:""}`);let f=null,d=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?(d=decodeURIComponent(g.slice(0,E)),d||(d=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(!p.protocols.includes(o.protocol))return;let g=p.extract(o);if(!g)return;d=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,d,b,m,f,y,i]},va}var wa,Ju;function aw(){if(Ju)return wa;Ju=1;let{LRUCache:t}=sw(),e=nw(),r=ow(),i=If(),s=new t({max:1e3});function n(o){try{let{protocol:c,hostname:l,pathname:u}=new URL(o);if(!l)return null;let p=/(?:git\+)http:$/.test(c)?"http:":"https:",b=u.replace(/\.git$/,"");return`${p}//${l}${b}`}catch{return null}}class a{constructor(c,l,u,p,b,f,d={}){Object.assign(this,a.#t[c],{type:c,user:l,auth:u,project:p,committish:b,default:f,opts:d})}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 p=r(c,l,{gitHosts:a.#t,protocols:a.#r});s.set(u,p?new a(...p):void 0)}return s.get(u)}static fromManifest(c,l={}){if(!c||typeof c!="object")return;let u=c.repository,p=u&&(typeof u=="string"?u:typeof u=="object"&&typeof u.url=="string"?u.url:null);if(!p)throw new Error("no repository");let b=p&&a.fromUrl(p.replace(/^git\+/,""),l)||null;if(b)return b;let f=n(p);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 p=c(u);return u.noGitPlus&&p.startsWith("git+")?p.slice(4):p}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 wa=a,wa}var xa,Qu;function cw(){if(Qu)return xa;Qu=1,xa=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 xa}var lw={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"},uw={web:"url",name:"url"},fw={server:"start",tests:"test"},hw={topLevel:lw,bugs:uw,script:fw},Ea,ef;function dw(){if(ef)return Ea;ef=1;var{URL:t}=Sb,e=Af(),r=Cf(),i=$f(),s=aw(),{isBuiltin:n}=df,a=["dependencies","devDependencies","optionalDependencies"],o=cw(),c=hw,l=h=>h.includes("@")&&h.indexOf("@")<h.lastIndexOf(".");Ea={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 C=s.fromUrl(h[v][x]);C&&(h[v][x]=C.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,d),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 p(h){return!h.match(/[/@\s+%:]/)&&h===encodeURIComponent(h)}function b(h,v,x){if(h.charAt(0)==="."||!(u(h)||p(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 d(h){if(typeof h=="string")return h;var v=h.name||"",x=h.url||h.web,_=x?" ("+x+")":"",C=h.email||h.mail,A=C?" <"+C+">":"";return v+A+_}function m(h){if(typeof h!="string")return h;var v=h.match(/^([^(<]+)/),x=h.match(/\(([^()]+)\)/),_=h.match(/<([^<>]+)>/),C={};return v&&v[0].trim()&&(C.name=v[0].trim()),_&&(C.email=_[1]),x&&(C.url=x[1]),C}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(C){return typeof C=="string"}).forEach(function(C){C=C.trim().split(/(:?[@\s><=])/);var A=C.shift(),O=C.join("");O=O.trim(),O=O.replace(/^@/,""),_[A]=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 Ea}var pw="'repositories' (plural) Not supported. Please pick one as the 'repository' field",mw="No repository field.",gw="Probably broken git url: %s",yw="scripts must be an object",bw="script values must be string commands",vw="Invalid 'files' member",ww="Invalid filename in 'files' list: %s",xw="Invalid 'bundleDependencies' list. Must be array of package names",Ew="Invalid bundleDependencies member: %s",_w="Non-dependency in bundleDependencies: %s",Sw="%s field must be an object",Rw="Invalid dependency: %s %s",Aw="specifying %s as array is deprecated",Cw="modules field is deprecated",Lw="keywords should be an array of strings",Ow="keywords should be an array of strings",$w="%s is also the name of a node core module.",Tw="'description' field should be a string",Pw="No description",Iw="No README data",Fw="No license field.",Nw="Bug string field must be url, email, or {email,url}",Dw="bugs.url field must be a string url. Deleted.",Mw="bugs.email field must be a string email. Deleted.",kw="Normalized value of bugs field is an empty object. Deleted.",jw="homepage field must be a string url. Deleted.",Bw="license should be a valid SPDX license expression",Uw="%s should probably be %s.",Gw={repositories:pw,missingRepository:mw,brokenGitUrl:gw,nonObjectScripts:yw,nonStringScript:bw,nonArrayFiles:vw,invalidFilename:ww,nonArrayBundleDependencies:xw,nonStringBundleDependency:Ew,nonDependencyBundleDependency:_w,nonObjectDependencies:Sw,nonStringDependency:Rw,deprecatedArrayDependencies:Aw,deprecatedModules:Cw,nonArrayKeywords:Lw,nonStringKeyword:Ow,conflictingName:$w,nonStringDescription:Tw,missingDescription:Pw,missingReadme:Iw,missingLicense:Fw,nonEmailUrlBugsString:Nw,nonUrlBugsUrlField:Dw,nonEmailBugsEmailField:Mw,emptyNormalizedBugs:kw,nonUrlHomepage:jw,invalidLicense:Bw,typo:Uw},_a,tf;function qw(){if(tf)return _a;tf=1;var t=hf,e=Gw;_a=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 _a}var Sa,rf;function zw(){if(rf)return Sa;rf=1,Sa=n;var t=dw();n.fixer=t;var e=qw(),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 Sa}var Ww=zw(),Ff=Zs(Ww),Vw=(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 Da(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?Vw(s,e):s.replace(new RegExp("(\\p{Uppercase_Letter})(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),i).toLowerCase()}var Ys={exports:{}},Ra,sf;function Hw(){if(sf)return Ra;sf=1;var t=Object.prototype.toString;return Ra=function(e){var r;return t.call(e)==="[object Object]"&&(r=Object.getPrototypeOf(e),r===null||r===Object.getPrototypeOf({}))},Ra}var Aa,nf;function Kw(){return nf||(nf=1,Aa=function(t){return t==null?[]:Array.isArray(t)?t:[t]}),Aa}var Ca,of;function Yw(){if(of)return Ca;of=1;var t=Object.prototype.toString;Ca=function(p){if(p===void 0)return"undefined";if(p===null)return"null";var b=typeof p;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(p)?"generatorfunction":"function";if(r(p))return"array";if(l(p))return"buffer";if(c(p))return"arguments";if(s(p))return"date";if(i(p))return"error";if(n(p))return"regexp";switch(e(p)){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(p))return"generator";switch(b=t.call(p),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,p){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(p){if(p.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 Ca}var af;function Xw(){if(af)return Ys.exports;af=1;let t=Hw(),e=Kw(),r=Yw(),i=(f,d,m)=>{f[d]||(f[d]=[]),f[d].push(m)},s=(f,d,m,y)=>{f[d]||(f[d]={}),f[d][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[d]=f;return`${r(d)}-array`}return r(f)},o=(f,d)=>{let m=f==="array"?"string-array":f;return u.includes(m)&&Array.isArray(d)&&d.length===0?"array":m},c=["stopEarly","unknown","--"],l=["string","boolean","number"],u=l.map(f=>`${f}-array`),p=[...l,"array",...u],b=f=>{f=f||{};let d={};return c.forEach(m=>{f[m]&&(d[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(!p.includes(w))throw new TypeError(`Expected type of "${m}" to be one of ${n(p)}, got ${n(w)}`);if(u.includes(w)){let[E]=w.split("-");i(d,"array",{key:m,[E]:!0})}else i(d,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(d,"default",m,E)}e(g.alias).forEach(E=>{s(d,"alias",E,m)})}}),d};return Ys.exports=b,Ys.exports.default=b,Ys.exports}var Zw=Xw(),Nf=Zs(Zw),Xs={exports:{}},cf;function Jw(){if(cf)return Xs.exports;cf=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(p=>r(p)?i(p,n,a,o):p);if(Array.isArray(s))return l(s);for(let[u,p]of Object.entries(s)){let b=n(u,p,s);if(b===e)continue;let[f,d,{shouldRecurse:m=!0}={}]=b;f!=="__proto__"&&(a.deep&&m&&r(d)&&(d=Array.isArray(d)?l(d):i(d,n,a,o)),c[f]=d)}return c};return Xs.exports=(s,n,a)=>{if(!t(s))throw new TypeError(`Expected an object, got \`${s}\` (${typeof s})`);return i(s,n,a)},Xs.exports.mapObjectSkip=e,Xs.exports}var Qw=Jw(),lf=Zs(Qw),Pa=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()])}},e1=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),La=new Pa({maxSize:1e5}),uf=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),ff=(t,e={})=>{if(!uf(t))return t;let{separator:r="_",exclude:i,deep:s=!1}=e,n=a=>(o,c)=>{if(s&&uf(c)&&(c=lf(c,n())),!(i&&e1(i,o))){let l=`${r}${o}`;if(La.has(l))o=La.get(l);else{let u=Da(o,{separator:r});o.length<100&&La.set(l,u),o=u}}return[o,c]};return lf(t,n())};function Df(t,e){return Array.isArray(t)?Object.keys(t).map(r=>ff(t[r],e)):ff(t,e)}import t1 from"node:process";import r1 from"node:path";import{fileURLToPath as i1}from"node:url";var or=t=>`--${Da(t,{separator:"-"})}`,qi=(t,e="--")=>`\`${e}${t.join(`\`, \`${e}`)}\``;var s1=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
- `))},Mf=(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??Pf({cwd:r1.dirname(i1(e.importMeta.url)),normalize:!1})?.packageJson??{};Ff(i);let s={argv:t1.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 s1(s),s};var n1=({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},kf=t=>{let e=n1(t);return e.arguments=t.input,e=Df(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=Nf(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 jf from"node:process";var o1=(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.`)},a1=(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}`},c1=(t,e)=>{let r=[];for(let[i,s]of Object.entries(t)){let n=e[i],a=a1(i,s,n);a&&r.push(a)}if(r.length>0)throw new Error(`${r.join(`
33
- `)}`)},Bf=(t,e)=>{o1(t,e),c1(e.flags,t)},l1=t=>{console.error([`Unknown flag${t.length>1?"s":""}`,...t].join(`
34
- `))},Uf=t=>{let e=t.filter(r=>typeof r=="string"&&r.startsWith("-"));e.length>0&&(l1(e),jf.exit(2))},u1=(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},f1=t=>{console.error(`Missing required flag${t.length>1?"s":""}`);for(let e of t)console.error(` ${or(e.key)}${e.shortFlag?`, -${e.shortFlag}`:""}`)},Gf=(t,e,r)=>{let i=[];if(t===void 0)return[];for(let s of Object.keys(t))t[s].isRequired&&u1(s,t,e,r)&&i.push({key:s,...t[s]});i.length>0&&(f1(i),jf.exit(2))};var h1=({pkg:t,...e},r)=>{let i=Kr(e.argv,r),s="";if(e.help&&(s=Ef((e.help||"").replace(/\t+\n*$/,"")),s.includes(`
35
- `)&&(s=Na(s,e.helpIndent)),s=`
36
- ${s}`),e.description!==!1){let{description:u}=e;u&&(u=s?Na(`
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
+ `))},Uf=(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??Df({cwd:o1.dirname(a1(e.importMeta.url)),normalize:!1})?.packageJson??{};kf(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},Gf=t=>{let e=l1(t);return e.arguments=t.input,e=Bf(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=jf(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 qf 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.`)},f1=(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}`},h1=(t,e)=>{let r=[];for(let[i,s]of Object.entries(t)){let n=e[i],a=f1(i,s,n);a&&r.push(a)}if(r.length>0)throw new Error(`${r.join(`
33
+ `)}`)},zf=(t,e)=>{u1(t,e),h1(e.flags,t)},p1=t=>{console.error([`Unknown flag${t.length>1?"s":""}`,...t].join(`
34
+ `))},Wf=t=>{let e=t.filter(r=>typeof r=="string"&&r.startsWith("-"));e.length>0&&(p1(e),qf.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}`:""}`)},Vf=(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),qf.exit(2))};var g1=({pkg:t,...e},r)=>{let i=Yr(e.argv,r),s="";if(e.help&&(s=Cf((e.help||"").replace(/\t+\n*$/,"")),s.includes(`
35
+ `)&&(s=ka(s,e.helpIndent)),s=`
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),Ma.exit(typeof u=="number"?u:2)},a=()=>{console.log(e.version),Ma.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||Uf(o);let c=xf(i,{exclude:["--",/^\w$/]}),l={...c};Bf(c,e);for(let u of Object.values(e.flags)){if(Array.isArray(u.aliases))for(let p of u.aliases)delete c[p];delete c[u.shortFlag]}return Gf(e.flags,c,o),{input:o,flags:c,unnormalizedFlags:l,pkg:t,help:s,showHelp:n,showVersion:a}},qf=(t,e={})=>{let r=Mf(t,e),i=kf(r),s=h1(r,i);return Ma.title=s.pkg.bin?Object.keys(s.pkg.bin).at(0):s.pkg.name,s};var by=We(ic(),1);var kd=We(Dd(),1);var l_=Object.prototype.toString,u_=t=>l_.call(t)==="[object Error]",f_=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 sc(t){return t&&u_(t)&&t.name==="TypeError"&&typeof t.message=="string"?t.message==="Load failed"?t.stack===void 0:f_.has(t.message):!1}var nc=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}},Md=(t,e,r)=>{let i=r.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=i,t};async function oc(t,e){return new Promise((r,i)=>{e={...e},e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>!0,e.retries??=10;let s=kd.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 nc)throw c.originalError;if(c instanceof TypeError&&!sc(c))throw c;if(Md(c,o,e),await e.shouldRetry(c)||(s.stop(),i(c)),await e.onFailedAttempt(c),!s.retry(c))throw s.mainError()}catch(l){Md(l,o,e),a(),i(l)}}})})}var P={};Do(P,{BRAND:()=>M_,DIRTY:()=>lr,EMPTY_PATH:()=>m_,INVALID:()=>Q,NEVER:()=>xS,OK:()=>Ne,ParseStatus:()=>$e,Schema:()=>ae,ZodAny:()=>Wt,ZodArray:()=>Pt,ZodBigInt:()=>fr,ZodBoolean:()=>hr,ZodBranded:()=>Ji,ZodCatch:()=>_r,ZodDate:()=>dr,ZodDefault:()=>Er,ZodDiscriminatedUnion:()=>dn,ZodEffects:()=>it,ZodEnum:()=>wr,ZodError:()=>Ve,ZodFirstPartyTypeKind:()=>te,ZodFunction:()=>mn,ZodIntersection:()=>yr,ZodIssueCode:()=>N,ZodLazy:()=>br,ZodLiteral:()=>vr,ZodMap:()=>ti,ZodNaN:()=>ii,ZodNativeEnum:()=>xr,ZodNever:()=>dt,ZodNull:()=>mr,ZodNullable:()=>Et,ZodNumber:()=>ur,ZodObject:()=>He,ZodOptional:()=>tt,ZodParsedType:()=>U,ZodPipeline:()=>Qi,ZodPromise:()=>Vt,ZodReadonly:()=>Sr,ZodRecord:()=>pn,ZodSchema:()=>ae,ZodSet:()=>ri,ZodString:()=>zt,ZodSymbol:()=>Qr,ZodTransformer:()=>it,ZodTuple:()=>xt,ZodType:()=>ae,ZodUndefined:()=>pr,ZodUnion:()=>gr,ZodUnknown:()=>Tt,ZodVoid:()=>ei,addIssueToContext:()=>B,any:()=>V_,array:()=>X_,bigint:()=>U_,boolean:()=>Yd,coerce:()=>wS,custom:()=>Vd,date:()=>G_,datetimeRegex:()=>zd,defaultErrorMap:()=>Ot,discriminatedUnion:()=>eS,effect:()=>hS,enum:()=>lS,function:()=>oS,getErrorMap:()=>Xr,getParsedType:()=>wt,instanceof:()=>j_,intersection:()=>tS,isAborted:()=>fn,isAsync:()=>Zr,isDirty:()=>hn,isValid:()=>qt,late:()=>k_,lazy:()=>aS,literal:()=>cS,makeIssue:()=>Zi,map:()=>sS,nan:()=>B_,nativeEnum:()=>uS,never:()=>K_,null:()=>W_,nullable:()=>pS,number:()=>Kd,object:()=>Z_,objectUtil:()=>ac,oboolean:()=>vS,onumber:()=>bS,optional:()=>dS,ostring:()=>yS,pipeline:()=>gS,preprocess:()=>mS,promise:()=>fS,quotelessJson:()=>h_,record:()=>iS,set:()=>nS,setErrorMap:()=>p_,strictObject:()=>J_,string:()=>Hd,symbol:()=>q_,transformer:()=>hS,tuple:()=>rS,undefined:()=>z_,union:()=>Q_,unknown:()=>H_,util:()=>ce,void:()=>Y_});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 ac;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ac||(ac={}));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"]),h_=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 d_=(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=d_;var jd=Ot;function p_(t){jd=t}function Xr(){return jd}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}},m_=[];function B(t,e){let r=Xr(),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}),fn=t=>t.status==="aborted",hn=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}},Bd=(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 Bd(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 Bd(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 Ji({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 Qi.create(this,e)}readonly(){return Sr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},g_=/^c[^\s-]{8,}$/i,y_=/^[0-9a-z]+$/,b_=/^[0-9A-HJKMNP-TV-Z]{26}$/i,v_=/^[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,w_=/^[a-z0-9_-]{21}$/i,x_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,E_=/^[-+]?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-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,S_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",cc,R_=/^(?:(?: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])$/,A_=/^(?:(?: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])$/,C_=/^(([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]))$/,L_=/^(([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])$/,O_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Gd="((\\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])))",T_=new RegExp(`^${Gd}$`);function qd(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 P_(t){return new RegExp(`^${qd(t)}$`)}function zd(t){let e=`${Gd}T${qd(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 I_(t,e){return!!((e==="v4"||!e)&&R_.test(t)||(e==="v6"||!e)&&C_.test(t))}function F_(t,e){if(!x_.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 N_(t,e){return!!((e==="v4"||!e)&&A_.test(t)||(e==="v6"||!e)&&L_.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")__.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")cc||(cc=new RegExp(S_,"u")),cc.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")v_.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")w_.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")g_.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")y_.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")b_.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"?zd(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"?T_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"date",message:n.message}),i.dirty()):n.kind==="time"?P_(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"?E_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"duration",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="ip"?I_(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"?F_(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"?N_(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"?O_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"base64",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="base64url"?$_.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 D_(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"?D_(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 dr=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}};dr.create=t=>new dr({checks:[],coerce:t?.coerce||!1,typeName:te.ZodDate,...ne(t)});var Qr=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)}};Qr.create=t=>new Qr({typeName:te.ZodSymbol,...ne(t)});var pr=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)}};pr.create=t=>new pr({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 dt=class extends ae{_parse(e){let r=this._getOrReturnCtx(e);return B(r,{code:N.invalid_type,expected:U.never,received:r.parsedType}),Q}};dt.create=t=>new dt({typeName:te.ZodNever,...ne(t)});var ei=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)}};ei.create=t=>new ei({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 Jr(t){if(t instanceof He){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=tt.create(Jr(i))}return new He({...t._def,shape:()=>e})}else return t instanceof Pt?new Pt({...t._def,type:Jr(t.element)}):t instanceof tt?tt.create(Jr(t.unwrap())):t instanceof Et?Et.create(Jr(t.unwrap())):t instanceof xt?xt.create(t.items.map(e=>Jr(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 dt&&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],p=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new rt(s,p,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof dt){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 p=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new rt(s,p,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let p=await u.key,b=await u.value;l.push({key:p,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 Jr(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 Wd(ce.objectKeys(this.shape))}};He.create=(t,e)=>new He({shape:()=>t,unknownKeys:"strip",catchall:dt.create(),typeName:te.ZodObject,...ne(e)});He.strictCreate=(t,e)=>new He({shape:()=>t,unknownKeys:"strict",catchall:dt.create(),typeName:te.ZodObject,...ne(e)});He.lazycreate=(t,e)=>new He({shape:t,unknownKeys:"strip",catchall:dt.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 pr?[void 0]:t instanceof mr?[null]:t instanceof tt?[void 0,...$t(t.unwrap())]:t instanceof Et?[null,...$t(t.unwrap())]:t instanceof Ji||t instanceof Sr?$t(t.unwrap()):t instanceof _r?$t(t._def.innerType):[],dn=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 lc(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=lc(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=lc(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(fn(n)||fn(a))return Q;let o=lc(n.value,a.value);return o.valid?((hn(n)||hn(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 pn=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)})}},ti=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}}}};ti.create=(t,e,r)=>new ti({valueType:e,keyType:t,typeName:te.ZodMap,...ne(r)});var ri=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)}};ri.create=(t,e)=>new ri({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ne(e)});var mn=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,Xr(),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,Xr(),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}),p=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(p,n).catch(f=>{throw l.addIssue(s(p,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),p=o._def.returns.safeParse(u,n);if(!p.success)throw new Ve([s(u,p.error)]);return p.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 Wd(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=Wd;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 ii=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}}};ii.create=t=>new ii({typeName:te.ZodNaN,...ne(t)});var M_=Symbol("zod_brand"),Ji=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}},Qi=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 Ud(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Vd(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=Ud(e,i),c=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:c})}});if(!n){let a=Ud(e,i),o=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:o})}}):Wt.create()}var k_={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 j_=(t,e={message:`Input not instance of ${t.name}`})=>Vd(r=>r instanceof t,e),Hd=zt.create,Kd=ur.create,B_=ii.create,U_=fr.create,Yd=hr.create,G_=dr.create,q_=Qr.create,z_=pr.create,W_=mr.create,V_=Wt.create,H_=Tt.create,K_=dt.create,Y_=ei.create,X_=Pt.create,Z_=He.create,J_=He.strictCreate,Q_=gr.create,eS=dn.create,tS=yr.create,rS=xt.create,iS=pn.create,sS=ti.create,nS=ri.create,oS=mn.create,aS=br.create,cS=vr.create,lS=wr.create,uS=xr.create,fS=Vt.create,hS=it.create,dS=tt.create,pS=Et.create,mS=it.createWithPreprocess,gS=Qi.create,yS=()=>Hd().optional(),bS=()=>Kd().optional(),vS=()=>Yd().optional(),wS={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=>dr.create({...t,coerce:!0}))};var xS=Q;var ES=P.object({repository_url:P.string(),powerlint_version:P.string(),schema_version:P.string()}),_S=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()}),SS=P.object({repository_url:P.string(),rule_ids:P.array(P.string()).optional(),schema_version:P.string(),powerlint_version:P.string()}),RS=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()}))}),AS=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()})}),CS=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()})})]),LS=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()})}),OS=P.object({type:P.literal("matches"),matches:P.array(P.any()),usage:P.object({cost:P.string(),inputTokens:P.string(),outputTokens:P.string()})}),es=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 oc(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=ES.parse(e);return await this.request("/plv1/initialize",r,_S)}async getRules(e){let r=SS.parse(e);return await this.request("/plv1/get-rules",r,RS)}async matchLLMSearch(e){let r=AS.parse(e);return await this.request("/plv1/llm-search",r,CS)}async matchLLMValidate(e){let r=LS.parse(e);return await this.request("/plv1/llm-validate",r,OS)}};var gn=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 UR}from"fs";import{dirname as GR,join as qR}from"path";import{fileURLToPath as zR}from"url";var ts=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 si=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var uc=(()=>{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})(),Xd=typeof globalThis.AbortController=="function",Zd=typeof globalThis.ReadableStream=="function",Jd=typeof globalThis.FormData=="function",yn=["get","post","put","patch","head","delete"],$S=()=>{};$S();var Qd={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},bn=2147483647,ep=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,vn=Symbol("stop"),tp={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},rp={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 TS=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[r,i]of t)e+=ep,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},ip=(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})},sp=(t,e)=>{let r=TS(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 ni=t=>t!==null&&typeof t=="object";var rs=(...t)=>{for(let e of t)if((!ni(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return dc({},...t)},fc=(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 wn(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:dc(t[r]??[],e[r]??[])}var hc=(t={},e={})=>({beforeRequest:wn(t,e,"beforeRequest"),beforeRetry:wn(t,e,"beforeRetry"),afterResponse:wn(t,e,"afterResponse"),beforeError:wn(t,e,"beforeError")}),dc=(...t)=>{let e={},r={},i={};for(let s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(ni(s)){for(let[n,a]of Object.entries(s))ni(a)&&n in e&&(a=dc(e[n],a)),e={...e,[n]:a};ni(s.hooks)&&(i=hc(i,s.hooks),e.hooks=i),ni(s.headers)&&(r=fc(r,s.headers),e.headers=r)}return e};var op=t=>yn.includes(t)?t.toUpperCase():t,PS=["get","put","head","delete","options","trace"],IS=[408,413,429,500,502,503,504],FS=[413,429,503],np={limit:2,methods:PS,statusCodes:IS,afterStatusCodes:FS,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},ap=(t={})=>{if(typeof t=="number")return{...np,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{...np,...t}};async function pc(t,e,r,i){return new Promise((s,n)=>{let a=setTimeout(()=>{r&&r.abort(),n(new si(t))},i.timeout);i.fetch(t,e).then(s).catch(n).then(()=>{clearTimeout(a)})})}async function mc(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 cp=(t,e)=>{let r={};for(let i in e)!(i in rp)&&!(i in tp)&&!(i in t)&&(r[i]=e[i]);return r};var is=class t{static create(e,r){let i=new t(e,r),s=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>bn)throw new RangeError(`The \`timeout\` option cannot be greater than ${bn}`);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 ts(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(!Zd)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return ip(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(Qd))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:fc(this._input.headers,r.headers),hooks:hc({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:op(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:ap(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(Xd){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(uc&&(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);(Jd&&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(!uc)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=sp(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof si)throw e;if(e instanceof ts){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),bn);if(this._retryCount<1)throw r;await mc(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})===vn)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=cp(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):pc(r,e,this.abortController,this._options)}};var gc=t=>{let e=(r,i)=>is.create(r,rs(t,i));for(let r of yn)e[r]=(i,s)=>is.create(i,rs(t,s,{method:r}));return e.create=r=>gc(rs(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),gc(rs(t,r))),e.stop=vn,e},NS=gc(),lp=NS;var Pp=We(Tp(),1);function xc(t){let e=(0,Pp.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var Am=We(Rm(),1),Cm=We(ic(),1),Fc=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},Nc=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function Dc(t,e={}){let{version:r="latest"}=e,{omitDeprecated:i=!0}=e,s=t.split("/")[0],n=e.registryUrl??xc(s),a=new URL(encodeURIComponent(t).replace(/^%40/,"@"),n),o=(0,Am.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 lp(a,{headers:c,keepalive:!0}).json()}catch(p){throw p?.response?.status===404?new Fc(t):p}if(e.allVersions)return l;let u=new Nc(t,r);if(l["dist-tags"][r]){let{time:p}=l;l=l.versions[l["dist-tags"][r]],l.time=p}else if(r){let p=!!l.versions[r];if(i&&!p)for(let[f,d]of Object.entries(l.versions))d.deprecated&&delete l.versions[f];if(!p){let f=Object.keys(l.versions);if(r=Cm.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 Mc(t,e){let{version:r}=await Dc(t.toLowerCase(),e);return r}function Ir(){let t=zR(import.meta.url?import.meta.url:__filename),e=GR(t),r=qR(e,"./package.json");try{let i=UR(r,"utf8");return JSON.parse(i).version}catch{return"0.0.0"}}async function Lm(){try{return await Mc("@wispbit/local")}catch{return Ir()}}var ls=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 es({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 es({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 gn(u,e),u}isConfigured(){return this.getApiKey()!==null}};import{exec as VR,execSync as HR}from"child_process";import{existsSync as KR,readFileSync as YR}from"fs";import{promisify as XR}from"util";import{createHash as WR}from"crypto";function us(t){return WR("sha256").update(t).digest("hex")}var he=XR(VR);function $m(){return HR("git rev-parse --show-toplevel",{encoding:"utf-8"}).trim()}async function Tm(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 Pm(t,e="origin"){let{stdout:r}=await he(`git config --get remote.${e}.url`,{cwd:t});return r.trim()||null}async function Im(t,e="origin"){try{let{stdout:r}=await he(`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 he(`git rev-parse --verify ${s}`,{cwd:t}),s}catch{}return null}}async function Fm(t){let{stdout:e}=await he("git rev-parse --abbrev-ref --symbolic-full-name @{u}",{cwd:t});return e.trim()||void 0}function Nm(t,e){let r=`.git/refs/branch-metadata/${e}`,i=`${t}/${r}`;return KR(i)?YR(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 ZR(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 Pn(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 JR(t){return t?t.split("\0").filter(Boolean).map(e=>({status:"U",path:e,source:"untracked"})):[]}function QR(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=Om(i.source),n=Om(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 Om(t){switch(t){case"untracked":return 4;case"unstaged":return 3;case"staged":return 2;case"committed":return 1}}function kc(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 eA(t){return t.status==="U"||t.status==="A"?"added":t.status==="D"?"removed":"modified"}function fs(t){if(!t)return"";let e=t.split(`
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 he(`git config --get remote.${e}.url`,{cwd:t});return r.trim()||null}async function Mm(t,e="origin"){try{let{stdout:r}=await he(`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 he(`git rev-parse --verify ${s}`,{cwd:t}),s}catch{}return null}}async function km(t){let{stdout:e}=await he("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 hs(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 In(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 tA(t){let[,e]=In(t);return e}async function jc(t){let{stdout:e}=await he("git rev-parse --abbrev-ref HEAD",{cwd:t});return e.trim()}async function Dm(t){let e=await jc(t),{stdout:r}=await he("git rev-parse HEAD",{cwd:t}),i=r.trim(),{stdout:s}=await he('git log -1 --pretty=format:"%s"',{cwd:t}),n=s.trim(),{stdout:a}=await he('git log -1 --pretty=format:"%cI"',{cwd:t}),o=a.trim();return{sha:i,branch:e,message:n,timestamp:o}}function Bc(t,e,r){if(!t.includes("..")||!(e.includes("staged")||e.includes("unstaged")||e.includes("untracked")))return null;let n=tA(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 Uc(t){let{stdout:e}=await he("git rev-parse --abbrev-ref HEAD",{cwd:t}),r=e.trim(),i=["committed","staged","unstaged","untracked"],s=Nm(t,r);if(s)return{commitSelector:`${s}...${r}`,include:i};let n=await Im(t);if(n){if(r===n){let l=await Fm(t).catch(()=>{});return l?{commitSelector:`${l}...HEAD`,include:i}:{commitSelector:"HEAD~1...HEAD",include:i}}let a=`origin/${n}`,{stdout:o}=await he(`git rev-parse --verify ${a}`,{cwd:t});return{commitSelector:`${o.trim()?a:n}...${r}`,include:i}}return{commitSelector:"HEAD...HEAD",include:i}}async function Mm(t,e){let r=e.commitSelector.trim(),i=r.includes(".."),{stdout:s}=await he("git rev-parse --abbrev-ref HEAD",{cwd:t}),n=s.trim(),{stdout:a}=await he("git rev-parse HEAD",{cwd:t}),o=a.trim(),c="",l="";if(i)c=r,l=r;else{let v=Nm(t,n),x=await Im(t),_=r||v||`origin/${x||"main"}`;l=_;let C=`git merge-base --fork-point ${st(_)} HEAD || git merge-base ${st(_)} HEAD`,{stdout:A}=await he(C,{cwd:t});if(c=A.trim(),!r&&n===(x||"main")){let O=await Fm(t).catch(()=>{});if(O){l=O;let{stdout:F}=await he(`git merge-base --fork-point ${st(O)} HEAD || git merge-base ${st(O)} HEAD`,{cwd:t});c=F.trim()}else l="HEAD~1",c="HEAD~1"}}let u=ZR(e.include),p=Bc(r,e.include,n);if(p)throw new Error(p);let b=[];if(u.committed)if(i){let[v,x]=In(r),{stdout:_}=await he(`git diff --name-status -M -z ${st(v)}..${st(x)}`,{cwd:t,maxBuffer:50*1024*1024});b.push(...Pn(_,"committed"))}else{let{stdout:v}=await he(`git diff --name-status -M -z ${c}..HEAD`,{cwd:t,maxBuffer:52428800});b.push(...Pn(v,"committed"))}if(u.staged){let{stdout:v}=await he("git diff --name-status -M -z --cached",{cwd:t,maxBuffer:52428800});b.push(...Pn(v,"staged"))}if(u.unstaged){let{stdout:v}=await he("git diff --name-status -M -z",{cwd:t,maxBuffer:52428800});b.push(...Pn(v,"unstaged"))}if(u.untracked){let{stdout:v}=await he("git ls-files --others --exclude-standard -z",{cwd:t,maxBuffer:52428800});b.push(...JR(v))}let f=QR(b),d=f.filter(v=>v.source==="committed"),m=f.filter(v=>v.source==="staged"),y=f.filter(v=>v.source==="unstaged"),g=f.filter(v=>v.source==="untracked"),w=new Map;if(d.length>0){let v=d.map(A=>A.path),x="";if(i){let[A,O]=In(r);x=`git diff -U0 -M ${st(A)}..${st(O)} -- ${Kt(v)}`}else x=`git diff -U0 -M ${c}..HEAD -- ${Kt(v)}`;let{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024});kc(_).forEach((A,O)=>w.set(O,fs(A)))}if(m.length>0){let v=m.map(A=>A.path),x=`git diff -U0 -M --cached -- ${Kt(v)}`,{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024});kc(_).forEach((A,O)=>w.set(O,fs(A)))}if(y.length>0){let v=y.map(A=>A.path),x=`git diff -U0 -M -- ${Kt(v)}`,{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024});kc(_).forEach((A,O)=>w.set(O,fs(A)))}for(let v of g)try{let{stdout:x}=await he(`git diff -U0 --no-index /dev/null ${st(v.path)}`,{cwd:t,maxBuffer:52428800});w.set(v.path,fs(x))}catch(x){if(x.stdout)w.set(v.path,fs(x.stdout));else throw x}let E=new Map;if(d.length>0){let v=d.map(A=>A.path),x="";if(i){let[A,O]=In(r);x=`git diff --numstat ${st(A)}..${st(O)} -- ${Kt(v)}`}else x=`git diff --numstat ${c}..HEAD -- ${Kt(v)}`;let{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024}),C=_.split(`
45
- `).filter(Boolean);for(let A of C){let O=A.split(" ");if(O.length>=3){let[F,M,I]=O;E.set(I,{additions:parseInt(F)||0,deletions:parseInt(M)||0})}}}if(m.length>0){let v=m.map(A=>A.path),x=`git diff --numstat --cached -- ${Kt(v)}`,{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024}),C=_.split(`
46
- `).filter(Boolean);for(let A of C){let O=A.split(" ");if(O.length>=3){let[F,M,I]=O;E.set(I,{additions:parseInt(F)||0,deletions:parseInt(M)||0})}}}if(y.length>0){let v=y.map(A=>A.path),x=`git diff --numstat -- ${Kt(v)}`,{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024}),C=_.split(`
47
- `).filter(Boolean);for(let A of C){let O=A.split(" ");if(O.length>=3){let[F,M,I]=O;E.set(I,{additions:parseInt(F)||0,deletions:parseInt(M)||0})}}}for(let v of g){let _=(w.get(v.path)||"").split(`
48
- `),C=0,A=0;for(let O of _)O.startsWith("+")&&!O.startsWith("+++")?C++:O.startsWith("-")&&!O.startsWith("---")&&A++;E.set(v.path,{additions:C,deletions:A})}let h=[];for(let v of f){let x=w.get(v.path)||"",_=E.get(v.path)||{additions:0,deletions:0},C=eA(v),A={filename:v.path,status:C,patch:x,additions:_.additions,deletions:_.deletions,sha:us(x)};v.oldPath&&(A.oldFilename=v.oldPath),h.push(A)}return{files:h,currentBranch:n,currentCommit:o,diffBranch:l,diffCommit:c}}var hi=class{workspaceRoot;repositoryUrl;constructor(e){this.repositoryUrl=e?.repositoryUrl||null,this.workspaceRoot=e?.workspaceRoot||$m()}getWorkspaceRoot(){return this.workspaceRoot}async getRepositoryUrl(e="origin"){if(this.repositoryUrl)return this.repositoryUrl;let r=await Pm(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 Dm(this.workspaceRoot)}};import*as Me from"fs/promises";import qA from"os";import mi from"path";import{Buffer as km}from"buffer";var Fn=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(km.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+=Fn(t[n],e):t[n]!==void 0&&(r+=`${Fn(n,!1)}:${Fn(t[n],e)}`))}return r+=i?"]":"}",r}return JSON.stringify(t)},Gc=t=>Fn(t,!0),qc=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?km.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r);var rA=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}},zc=rA,iA=class extends zc{_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)}},sA=iA,nA=class extends zc{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}},oA=nA;var jm=["sqlite","postgres","mysql","mongo","redis","valkey","etcd"],aA=class extends zc{opts;iterator;hooks=new sA;stats=new oA(!1);_ttl;_namespace;_store=new Map;_serialize=Gc;_deserialize=qc;_compression;_useKeyPrefix=!0;_throwOnErrors=!1;constructor(t,e){if(super(),e??={},t??={},this.opts={namespace:"keyv",serialize:Gc,deserialize:qc,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 jm.includes(this._store.opts.dialect)||jm.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 p=>{let b=await r.get(p),f=typeof b=="string"||this.opts.compression?await this.deserializeData(b):b;if(f!=null){if(s(f)){await this.delete(p);return}return e?.raw?f:f.value}}),u=(await Promise.allSettled(c)).map(p=>p.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)}},Bm=aA;var wg=We(vg(),1);var Un=class{environment;cacheStore;constructor(e){this.environment=e}getStorageDirectory(){return mi.join(qA.homedir(),".powerlint")}getIndexDirectory(){return mi.join(this.getStorageDirectory(),"indexes",us(this.environment.getWorkspaceRoot()))}getCacheDirectory(){return mi.join(this.getStorageDirectory(),"cache",us(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 mi.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 mi.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 Bm({store:new wg.KeyvFile({filename:mi.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 zA}from"events";var nt=class extends zA{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 zO}from"os";import*as Li from"fs";import*as jt from"path";var Ug=We(Ig(),1);var ms=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var JA={"[: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]},gs=t=>t.replace(/[[\]\\-]/g,"\\$&"),QA=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Fg=t=>t.join(""),Ng=(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,p="";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(JA))if(t.startsWith(y,n)){if(p)return["$.",!1,t.length-r,!0];n+=y.length,E?s.push(g):i.push(g),o=o||w;continue e}}if(c=!1,p){m>p?i.push(gs(p)+"-"+gs(m)):m===p&&i.push(gs(m)),p="",n++;continue}if(t.startsWith("-]",n+1)){i.push(gs(m+"-")),n+=2;continue}if(t.startsWith("-",n+1)){p=m,n+=2;continue}i.push(gs(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 b="["+(l?"^":"")+Fg(i)+"]",f="["+(l?"":"^")+Fg(s)+"]";return[i.length&&s.length?"("+b+"|"+f+")":i.length?b:f,o,u-r,!0]};var pt=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var eC=new Set(["!","?","+","*","@"]),Dg=t=>eC.has(t),tC="(?!(?:^|/)\\.\\.?(?:$|/))",Gn="(?!\\.)",rC=new Set(["[","."]),iC=new Set(["..","."]),sC=new Set("().*{}+?[]^$\\!"),nC=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Yc="[^/]",Mg=Yc+"*?",kg=Yc+"+?",gi=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,d="";for(;f<e.length;){let m=e.charAt(f++);if(n||m==="\\"){n=!n,d+=m;continue}if(a){f===o+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(f===o+2&&c)&&(a=!1),d+=m;continue}else if(m==="["){a=!0,o=f,c=!1,d+=m;continue}if(!s.noext&&Dg(m)&&e.charAt(f)==="("){r.push(d),d="";let y=new t(m,r);f=t.#o(e,y,f,s),r.push(y);continue}d+=m}return r.push(d),f}let l=i+1,u=new t(null,r),p=[],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(Dg(f)&&e.charAt(l)==="("){u.push(b),b="";let d=new t(f,u);u.push(d),l=t.#o(e,d,l,s);continue}if(f==="|"){u.push(b),b="",p.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(...p,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[d,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,d}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&iC.has(this.#n[0]))){let d=rC,m=r&&d.has(l.charAt(0))||l.startsWith("\\.")&&d.has(l.charAt(2))||l.startsWith("\\.\\.")&&d.has(l.charAt(4)),y=!r&&!e&&d.has(l.charAt(0));u=m?tC:y?Gn:""}let p="";return this.isEnd()&&this.#t.#u&&this.#f?.type==="!"&&(p="(?:$|\\/)"),[u+l+p,pt(l),this.#r=!!this.#r,this.#e]}let i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(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,pt(this.toString()),!1,!1]}let a=!i||e||r||!Gn?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let o="";if(this.type==="!"&&this.#i)o=(this.isStart()&&!r?Gn:"")+kg;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Gn:"")+Mg+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=s+n+c}return[o,pt(n),this.#r=!!this.#r,this.#e]}#p(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+=(sC.has(c)?"\\":"")+c;continue}if(c==="\\"){o===e.length-1?n+="\\\\":s=!0;continue}if(c==="["){let[l,u,p,b]=Ng(e,o);if(p){n+=l,a=a||u,o+=p-1,r=r||b;continue}}if(c==="*"){i&&e==="*"?n+=kg:n+=Mg,r=!0;continue}if(c==="?"){n+=Yc,r=!0;continue}n+=nC(c)}return[n,pt(e),!!r,a]}};var yi=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var qe=(t,e,r={})=>(ms(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Ye(e,r).match(t)),oC=/^\*+([^+@!?\*\[\(]*)$/,aC=t=>e=>!e.startsWith(".")&&e.endsWith(t),cC=t=>e=>e.endsWith(t),lC=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),uC=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),fC=/^\*+\.\*+$/,hC=t=>!t.startsWith(".")&&t.includes("."),dC=t=>t!=="."&&t!==".."&&t.includes("."),pC=/^\.\*+$/,mC=t=>t!=="."&&t!==".."&&t.startsWith("."),gC=/^\*+$/,yC=t=>t.length!==0&&!t.startsWith("."),bC=t=>t.length!==0&&t!=="."&&t!=="..",vC=/^\?+([^+@!?\*\[\(]*)?$/,wC=([t,e=""])=>{let r=Gg([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},xC=([t,e=""])=>{let r=qg([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},EC=([t,e=""])=>{let r=qg([t]);return e?i=>r(i)&&i.endsWith(e):r},_C=([t,e=""])=>{let r=Gg([t]);return e?i=>r(i)&&i.endsWith(e):r},Gg=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},qg=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},zg=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",jg={win32:{sep:"\\"},posix:{sep:"/"}},SC=zg==="win32"?jg.win32.sep:jg.posix.sep;qe.sep=SC;var Pe=Symbol("globstar **");qe.GLOBSTAR=Pe;var RC="[^/]",AC=RC+"*?",CC="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",LC="(?:(?!(?:\\/|^)\\.).)*?",OC=(t,e={})=>r=>qe(r,t,e);qe.filter=OC;var ot=(t,e={})=>Object.assign({},t,e),$C=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=$C;var Wg=(t,e={})=>(ms(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,Ug.default)(t));qe.braceExpand=Wg;var TC=(t,e={})=>new Ye(t,e).makeRe();qe.makeRe=TC;var PC=(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=PC;var Bg=/[?*]|[+@!]\(.*?\)|\[|\]/,IC=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={}){ms(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||zg,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]==="?"||!Bg.test(n[2]))&&!Bg.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],p=e[a];if(this.debug(r,u,p),u===!1)return!1;if(u===Pe){this.debug("GLOBSTAR",[r,u,p]);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 d=e[b];if(this.debug(`
49
- globstar while`,e,b,r,f,d),this.matchOne(e.slice(b),r.slice(f),i))return this.debug("globstar found match!",b,c,d),!0;if(d==="."||d===".."||!s.dot&&d.charAt(0)==="."){this.debug("dot detected!",e,b,r,f);break}this.debug("globstar swallow a segment, and continue"),b++}return!!(i&&(this.debug(`
50
- >>> no match, partial?`,e,b,r,f),b===c))}let m;if(typeof u=="string"?(m=p===u,this.debug("string match",u,p,m)):(m=u.test(p),this.debug("pattern match",u,p,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 Wg(this.pattern,this.options)}parse(e){ms(e);let r=this.options;if(e==="**")return Pe;if(e==="")return"";let i,s=null;(i=e.match(gC))?s=r.dot?bC:yC:(i=e.match(oC))?s=(r.nocase?r.dot?uC:lC:r.dot?cC:aC)(i[1]):(i=e.match(vC))?s=(r.nocase?r.dot?xC:wC:r.dot?EC:_C)(i):(i=e.match(fC))?s=r.dot?dC:hC:(i=e.match(pC))&&(s=mC);let n=gi.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?AC:r.dot?CC:LC,s=new Set(r.nocase?["i"]:[]),n=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let p of u.flags.split(""))s.add(p);return typeof u=="string"?IC(u):u===Pe?Pe:u._src});return l.forEach((u,p)=>{let b=l[p+1],f=l[p-1];u!==Pe||f===Pe||(f===void 0?b!==void 0&&b!==Pe?l[p+1]="(?:\\/|"+i+"\\/)?"+b:l[p]=i:b===void 0?l[p-1]=f+"(?:\\/|"+i+")?":b!==Pe&&(l[p-1]=f+"(?:\\/|\\/"+i+"\\/)"+b,l[p+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=gi;qe.Minimatch=Ye;qe.escape=yi;qe.unescape=pt;import{fileURLToPath as fL}from"node:url";var bi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Hg=new Set,Xc=typeof process=="object"&&process?process:{},Kg=(t,e,r,i)=>{typeof Xc.emitWarning=="function"?Xc.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},qn=globalThis.AbortController,Vg=globalThis.AbortSignal;if(typeof qn>"u"){Vg=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},qn=class{constructor(){e()}signal=new Vg;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=Xc.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Kg("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 FC=t=>!Hg.has(t),gF=Symbol("type"),Yt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Yg=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?vi:null:null,vi=class extends Array{constructor(e){super(e),this.fill(0)}},Zc=class t{heap;length;static#t=!1;static create(e){let r=Yg(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]}},ys=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;#p;#g;#y;#d;#A;#x;#E;#_;#S;#v;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#E,sizes:e.#A,keyMap:e.#s,keyList:e.#c,valList:e.#i,next:e.#l,prev:e.#o,get head(){return e.#p},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:p,noUpdateTTL:b,maxSize:f=0,maxEntrySize:d=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?Yg(r):Array;if(!_)throw new Error("invalid max value: "+r);if(this.#t=r,this.#r=f,this.maxEntrySize=d||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.#p=0,this.#g=0,this.#y=Zc.create(r),this.#a=0,this.#u=0,typeof l=="function"&&(this.#e=l),typeof u=="function"?(this.#n=u,this.#d=[]):(this.#n=void 0,this.#d=void 0),this.#_=!!this.#e,this.#v=!!this.#n,this.noDisposeOnSet=!!p,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 C="LRU_CACHE_UNBOUNDED";FC(C)&&(Hg.add(C),Kg("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",C,t))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#P(){let e=new vi(this.#t),r=new vi(this.#t);this.#E=e,this.#x=r,this.#M=(n,a,o=bi.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.#C=n=>{r[n]=e[n]!==0?bi.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=bi.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}}#C=()=>{};#h=()=>{};#M=()=>{};#R=()=>!1;#I(){let e=new vi(this.#t);this.#u=0,this.#A=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.#p));)r=this.#o[r]}*#$({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#p;!(!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-(bi.now()-o);n.ttl=c,n.start=Date.now()}}return this.#A&&(n.size=this.#A[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=bi.now()-this.#x[r];a.start=Math.floor(Date.now()-o)}this.#A&&(a.size=this.#A[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=bi.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 p=this.#a===0?void 0:this.#s.get(e);if(p===void 0)p=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#t?this.#T(!1):this.#a,this.#c[p]=e,this.#i[p]=r,this.#s.set(e,p),this.#l[this.#g]=p,this.#o[p]=this.#g,this.#g=p,this.#a++,this.#O(p,u,c),c&&(c.set="add"),l=!1;else{this.#D(p);let b=this.#i[p];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.#d?.push([f,e,"set"]))}else a||(this.#_&&this.#e?.(b,e,"set"),this.#v&&this.#d?.push([b,e,"set"]));if(this.#N(p),this.#O(p,u,c),this.#i[p]=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(p,s,n),c&&this.#h(c,p)),!a&&this.#v&&this.#d){let b=this.#d,f;for(;f=b?.shift();)this.#n?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#i[this.#p];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.#d){let e=this.#d,r;for(;r=e?.shift();)this.#n?.(...r)}}}#T(e){let r=this.#p,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.#d?.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.#p=this.#g=0,this.#y.length=0):this.#p=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.#C(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 qn,{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 p(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),p(m)),p=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),d=Object.assign(f,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return r===void 0?(this.set(e,d,{...c.options,status:void 0}),r=this.#s.get(e)):this.#i[r]=d,d}#m(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof qn}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:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=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:p,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:d,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.#C(h),g&&this.#h(g,h),v;let _=this.#F(e,h,E,m),A=_.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=x?"stale":"refresh",A&&x&&(g.returnedStale=!0)),A?_.__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.#C(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.#p?this.#p=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.#d?.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.#p)this.#p=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.#d?.length){let s=this.#d,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.#d?.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.#A&&this.#A.fill(0),this.#p=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#v&&this.#d){let r=this.#d,i;for(;i=r?.shift();)this.#n?.(...i)}}};import{posix as WC,win32 as al}from"node:path";import{fileURLToPath as VC}from"node:url";import{lstatSync as HC,readdir as KC,readdirSync as YC,readlinkSync as XC,realpathSync as ZC}from"fs";import*as JC from"node:fs";import{lstat as eL,readdir as tL,readlink as rL,realpath as iL}from"node:fs/promises";import{EventEmitter as sl}from"node:events";import e0 from"node:stream";import{StringDecoder as NC}from"node:string_decoder";var Xg=typeof process=="object"&&process?process:{stdout:null,stderr:null},DC=t=>!!t&&typeof t=="object"&&(t instanceof Zt||t instanceof e0||MC(t)||kC(t)),MC=t=>!!t&&typeof t=="object"&&t instanceof sl&&typeof t.pipe=="function"&&t.pipe!==e0.Writable.prototype.pipe,kC=t=>!!t&&typeof t=="object"&&t instanceof sl&&typeof t.write=="function"&&typeof t.end=="function",Dt=Symbol("EOF"),Mt=Symbol("maybeEmitEnd"),Xt=Symbol("emittedEnd"),zn=Symbol("emittingEnd"),bs=Symbol("emittedError"),Wn=Symbol("closed"),Zg=Symbol("read"),Vn=Symbol("flush"),Jg=Symbol("flushChunk"),mt=Symbol("encoding"),wi=Symbol("decoder"),Re=Symbol("flowing"),vs=Symbol("paused"),xi=Symbol("resume"),Ae=Symbol("buffer"),ze=Symbol("pipes"),Ce=Symbol("bufferLength"),Jc=Symbol("bufferPush"),Hn=Symbol("bufferShift"),ke=Symbol("objectMode"),Ee=Symbol("destroyed"),Qc=Symbol("error"),el=Symbol("emitData"),Qg=Symbol("emitEnd"),tl=Symbol("emitEnd2"),_t=Symbol("async"),rl=Symbol("abort"),Kn=Symbol("aborted"),ws=Symbol("signal"),Fr=Symbol("dataListeners"),Xe=Symbol("discarded"),xs=t=>Promise.resolve().then(t),jC=t=>t(),BC=t=>t==="end"||t==="finish"||t==="prefinish",UC=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,GC=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Yn=class{src;dest;opts;ondrain;constructor(e,r,i){this.src=e,this.dest=r,this.opts=i,this.ondrain=()=>e[xi](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},il=class extends Yn{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)}},qC=t=>!!t.objectMode,zC=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Zt=class extends sl{[Re]=!1;[vs]=!1;[ze]=[];[Ae]=[];[ke];[mt];[_t];[wi];[Dt]=!1;[Xt]=!1;[zn]=!1;[Wn]=!1;[bs]=null;[Ce]=0;[Ee]=!1;[ws];[Kn]=!1;[Fr]=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");qC(r)?(this[ke]=!0,this[mt]=null):zC(r)?(this[mt]=r.encoding,this[ke]=!1):(this[ke]=!1,this[mt]=null),this[_t]=!!r.async,this[wi]=this[mt]?new NC(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[ws]=i,i.aborted?this[rl]():i.addEventListener("abort",()=>this[rl]()))}get bufferLength(){return this[Ce]}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}[rl](){this[Kn]=!0,this.emit("abort",this[ws]?.reason),this.destroy(this[ws]?.reason)}get aborted(){return this[Kn]}set aborted(e){}write(e,r,i){if(this[Kn])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]?xs:jC;if(!this[ke]&&!Buffer.isBuffer(e)){if(GC(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(UC(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[Re]&&this[Ce]!==0&&this[Vn](!0),this[Re]?this.emit("data",e):this[Jc](e),this[Ce]!==0&&this.emit("readable"),i&&s(i),this[Re]):e.length?(typeof e=="string"&&!(r===this[mt]&&!this[wi]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[mt]&&(e=this[wi].write(e)),this[Re]&&this[Ce]!==0&&this[Vn](!0),this[Re]?this.emit("data",e):this[Jc](e),this[Ce]!==0&&this.emit("readable"),i&&s(i),this[Re]):(this[Ce]!==0&&this.emit("readable"),i&&s(i),this[Re])}read(e){if(this[Ee])return null;if(this[Xe]=!1,this[Ce]===0||e===0||e&&e>this[Ce])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[Ce])]);let r=this[Zg](e||null,this[Ae][0]);return this[Mt](),r}[Zg](e,r){if(this[ke])this[Hn]();else{let i=r;e===i.length||e===null?this[Hn]():typeof i=="string"?(this[Ae][0]=i.slice(e),r=i.slice(0,e),this[Ce]-=e):(this[Ae][0]=i.subarray(e),r=i.subarray(0,e),this[Ce]-=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[Re]||!this[vs])&&this[Mt](),this}[xi](){this[Ee]||(!this[Fr]&&!this[ze].length&&(this[Xe]=!0),this[vs]=!1,this[Re]=!0,this.emit("resume"),this[Ae].length?this[Vn]():this[Dt]?this[Mt]():this.emit("drain"))}resume(){return this[xi]()}pause(){this[Re]=!1,this[vs]=!0,this[Xe]=!1}get destroyed(){return this[Ee]}get flowing(){return this[Re]}get paused(){return this[vs]}[Jc](e){this[ke]?this[Ce]+=1:this[Ce]+=e.length,this[Ae].push(e)}[Hn](){return this[ke]?this[Ce]-=1:this[Ce]-=this[Ae][0].length,this[Ae].shift()}[Vn](e=!1){do;while(this[Jg](this[Hn]())&&this[Ae].length);!e&&!this[Ae].length&&!this[Dt]&&this.emit("drain")}[Jg](e){return this.emit("data",e),this[Re]}pipe(e,r){if(this[Ee])return e;this[Xe]=!1;let i=this[Xt];return r=r||{},e===Xg.stdout||e===Xg.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,i?r.end&&e.end():(this[ze].push(r.proxyErrors?new il(this,e,r):new Yn(this,e,r)),this[_t]?xs(()=>this[xi]()):this[xi]()),e}unpipe(e){let r=this[ze].find(i=>i.dest===e);r&&(this[ze].length===1?(this[Re]&&this[Fr]===0&&(this[Re]=!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[Fr]++,!this[ze].length&&!this[Re]&&this[xi]();else if(e==="readable"&&this[Ce]!==0)super.emit("readable");else if(BC(e)&&this[Xt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[bs]){let s=r;this[_t]?xs(()=>s.call(this,this[bs])):s.call(this,this[bs])}return i}removeListener(e,r){return this.off(e,r)}off(e,r){let i=super.off(e,r);return e==="data"&&(this[Fr]=this.listeners("data").length,this[Fr]===0&&!this[Xe]&&!this[ze].length&&(this[Re]=!1)),i}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Fr]=0,!this[Xe]&&!this[ze].length&&(this[Re]=!1)),r}get emittedEnd(){return this[Xt]}[Mt](){!this[zn]&&!this[Xt]&&!this[Ee]&&this[Ae].length===0&&this[Dt]&&(this[zn]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Wn]&&this.emit("close"),this[zn]=!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]?(xs(()=>this[el](i)),!0):this[el](i);if(e==="end")return this[Qg]();if(e==="close"){if(this[Wn]=!0,!this[Xt]&&!this[Ee])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[bs]=i,super.emit(Qc,i);let n=!this[ws]||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}[el](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}[Qg](){return this[Xt]?!1:(this[Xt]=!0,this.readable=!1,this[_t]?(xs(()=>this[tl]()),!0):this[tl]())}[tl](){if(this[wi]){let r=this[wi].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=p=>{this.off("data",c),this.off("end",l),this.off(Ee,u),r(),a(p)},c=p=>{this.off("error",o),this.off("end",l),this.off(Ee,u),this.pause(),n({value:p,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((p,b)=>{a=b,n=p,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(Qc,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(Qc,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[Ce]=0;let r=this;return typeof r.close=="function"&&!this[Wn]&&r.close(),e?this.emit("error",e):this.emit(Ee),this}static get isStream(){return DC}};var QC=ZC.native,_s={lstatSync:HC,readdir:KC,readdirSync:YC,readlinkSync:XC,realpathSync:QC,promises:{lstat:eL,readdir:tL,readlink:rL,realpath:iL}},n0=t=>!t||t===_s||t===JC?_s:{..._s,...t,promises:{..._s.promises,...t.promises||{}}},o0=/^\\\\\?\\([a-z]:)\\?$/i,sL=t=>t.replace(/\//g,"\\").replace(o0,"$1\\"),nL=/[\\\/]/,ct=0,a0=1,c0=2,St=4,l0=6,u0=8,Nr=10,f0=12,at=15,Es=~at,nl=16,t0=32,Ss=64,gt=128,Xn=256,Jn=512,r0=Ss|gt|Jn,oL=1023,ol=t=>t.isFile()?u0:t.isDirectory()?St:t.isSymbolicLink()?Nr:t.isCharacterDevice()?c0:t.isBlockDevice()?l0:t.isSocket()?f0:t.isFIFO()?a0:ct,i0=new Map,Rs=t=>{let e=i0.get(t);if(e)return e;let r=t.normalize("NFKD");return i0.set(t,r),r},s0=new Map,Zn=t=>{let e=s0.get(t);if(e)return e;let r=Rs(t.toLowerCase());return s0.set(t,r),r},Qn=class extends ys{constructor(){super({max:256})}},cl=class extends ys{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},h0=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}#p;get ctimeMs(){return this.#p}#g;get birthtimeMs(){return this.#g}#y;get atime(){return this.#y}#d;get mtime(){return this.#d}#A;get ctime(){return this.#A}#x;get birthtime(){return this.#x}#E;#_;#S;#v;#P;#C;#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?Zn(e):Rs(e),this.#h=r&oL,this.nocase=n,this.roots=s,this.root=i||this,this.#M=a,this.#S=o.fullpath,this.#P=o.relative,this.#C=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=n0(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&=~nl,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),s=this.nocase?Zn(e):Rs(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.#C!==void 0)return this.#C;let e=this.name,r=this.parent;if(!r)return this.#C=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)===u0}isDirectory(){return(this.#h&at)===St}isCharacterDevice(){return(this.#h&at)===c0}isBlockDevice(){return(this.#h&at)===l0}isFIFO(){return(this.#h&at)===a0}isSocket(){return(this.#h&at)===f0}isSymbolicLink(){return(this.#h&Nr)===Nr}lstatCached(){return this.#h&t0?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!==Nr||this.#h&Xn||this.#h&gt)}calledReaddir(){return!!(this.#h&nl)}isENOENT(){return!!(this.#h&gt)}isNamed(e){return this.nocase?this.#E===Zn(e):this.#E===Rs(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|=nl;for(let r=e.provisional;r<e.length;r++){let i=e[r];i&&i.#B()}}#B(){this.#h&gt||(this.#h=(this.#h|gt)&Es,this.#L())}#L(){let e=this.children();e.provisional=0;for(let r of e)r.#B()}#$(){this.#h|=Jn,this.#k()}#k(){if(this.#h&Ss)return;let e=this.#h;(e&at)===St&&(e&=Es),this.#h=e|Ss,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|=Xn,e==="ENOENT"&&(r|=gt),(e==="EINVAL"||e==="UNKNOWN")&&(r&=Es),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=ol(e),s=this.newChild(e.name,i,{parent:this}),n=s.#h&at;return n!==St&&n!==Nr&&n!==ct&&(s.#h|=Ss),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?Zn(e.name):Rs(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&Es|ol(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&gt)===0)try{return this.#q(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if((this.#h&gt)===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:p,ino:b,mode:f,mtime:d,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.#A=c,this.#p=l,this.#r=u,this.#w=p,this.#s=b,this.#e=f,this.#d=d,this.#o=m,this.#n=y,this.#a=g,this.#c=w,this.#f=E;let h=ol(e);this.#h=this.#h&Es|h|t0,h!==ct&&h!==St&&h!==Nr&&(this.#h|=Ss)}#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&r0)return!1;let e=at&this.#h;return e===ct||e===St||e===Nr}shouldWalk(e,r){return(this.#h&St)===St&&!(this.#h&r0)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#I)return this.#I;if(!((Jn|Xn|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(!((Jn|Xn|gt)&this.#h))try{let e=this.#t.realpathSync(this.fullpath());return this.#I=this.resolve(e)}catch{this.#$()}}[h0](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.#C=i.join("/"),s=s.parent,i.push("..");for(s=e;s&&s.parent&&!r.has(s);)s.#P=void 0,s.#C=void 0,s=s.parent}},eo=class t extends je{sep="\\";splitSep=nL;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 al.parse(e).root}getRoot(e){if(e=sL(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 Ei(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(o0,"$1\\"),e===r}},to=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)}},ro=class{root;rootPath;roots;cwd;#t;#r;#e;nocase;#n;constructor(e=process.cwd(),r,i,{nocase:s,childrenCacheSize:n=16*1024,fs:a=_s}={}){this.#n=n0(a),(e instanceof URL||e.startsWith("file://"))&&(e=VC(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new Qn,this.#r=new Qn,this.#e=new cl(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,p=r.sep,b=this.rootPath,f=!1;for(let d of c){let m=u--;l=l.child(d,{relative:new Array(m).fill("..").join(p),relativePosix:new Array(m).fill("..").join("/"),fullpath:b+=(f?"":p)+d}),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=(p,b)=>{c.add(p),p.readdirCB((f,d)=>{if(f)return b(f);let m=d.length;if(!m)return b();let y=()=>{--m===0&&b()};for(let g of d)(!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((p,b)=>{l(u,f=>{if(f)return b(f);p(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 p of u){(!n||n(p))&&o.push(i?p:p.fullpath());let b=p;if(p.isSymbolicLink()){if(!(s&&(b=p.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 p=u;if(u.isSymbolicLink()){if(!(s&&(p=u.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(o,a)&&o.add(p)}}}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 Zt({objectMode:!0});(!n||n(e))&&o.write(i?e:e.fullpath());let c=new Set,l=[e],u=0,p=()=>{let b=!1;for(;!b;){let f=l.shift();if(!f){u===0&&o.end();return}u++,c.add(f);let d=(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(()=>d(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",p):m||p()},m=!0;f.readdirCB(d,!0),m=!1}};return p(),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 Zt({objectMode:!0}),c=new Set;(!n||n(e))&&o.write(i?e:e.fullpath());let l=[e],u=0,p=()=>{let b=!1;for(;!b;){let f=l.shift();if(!f){u===0&&o.end();return}u++,c.add(f);let d=f.readdirSync();for(let m of d)(!n||n(m))&&(o.write(i?m:m.fullpath())||(b=!0));u--;for(let m of d){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",p)};return p(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[h0](r)}},Ei=class extends ro{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,al,"\\",{...r,nocase:i}),this.nocase=i;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return al.parse(e).root.toUpperCase()}newRoot(e){return new eo(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)}},_i=class extends ro{sep="/";constructor(e=process.cwd(),r={}){let{nocase:i=!1}=r;super(e,WC,"/",{...r,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new to(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},As=class extends _i{constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,{...r,nocase:i})}},LF=process.platform==="win32"?eo:to,d0=process.platform==="win32"?Ei:process.platform==="darwin"?As:_i;var aL=t=>t.length>=1,cL=t=>t.length>=1,Si=class t{#t;#r;#e;length;#n;#f;#w;#a;#u;#s;#c=!0;constructor(e,r,i,s){if(!aL(e))throw new TypeError("empty pattern list");if(!cL(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,p,b,f,...d]=this.#r;l[0]===""&&(l.shift(),d.shift());let m=[n,a,o,c,""].join("/"),y=[u,p,b,f,""].join("/");this.#t=[m,...l],this.#r=[y,...d],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 lL=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ri=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:i,noext:s,noglobstar:n,platform:a=lL}){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 Si(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 ll=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()]))}},ul=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)])}},fl=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())}},Cs=class t{hasWalkedCache;matches=new ul;subwalks=new fl;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new ll}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 p=n.rest();if(p)n=p;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 p=c===".."||c===""||c===".";this.matches.add(s.resolve(c),o,p);continue}else if(c===Pe){(!s.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(s,n);let p=l?.pattern(),b=l?.rest();if(!l||(p===""||p===".")&&!b)this.matches.add(s,o,p===""||p===".");else if(p===".."){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 uL=(t,e)=>typeof t=="string"?new Ri([t],e):Array.isArray(t)?new Ri(t,e):t,io=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=uL(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 Cs(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 Cs(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()}},Ls=class extends io{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}},Os=class extends io{results;constructor(e,r,i){super(e,r,i),this.results=new Zt({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 hL=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=fL(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||hL,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"?Ei:r.platform==="darwin"?As:r.platform?_i:d0;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 Si(c,u,0,this.platform)})}async walk(){return[...await new Ls(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 Ls(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 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}).stream()}streamSync(){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}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var hl=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Ye(r,e).hasMagic())return!0;return!1};function so(t,e={}){return new yt(t,e).streamSync()}function m0(t,e={}){return new yt(t,e).stream()}function g0(t,e={}){return new yt(t,e).walkSync()}async function p0(t,e={}){return new yt(t,e).walk()}function no(t,e={}){return new yt(t,e).iterateSync()}function y0(t,e={}){return new yt(t,e).iterate()}var dL=so,pL=Object.assign(m0,{sync:so}),mL=no,gL=Object.assign(y0,{sync:no}),yL=Object.assign(g0,{stream:so,iterate:no}),Jt=Object.assign(p0,{glob:p0,globSync:g0,sync:yL,globStream:m0,stream:pL,globStreamSync:so,streamSync:dL,globIterate:y0,iterate:gL,globIterateSync:no,iterateSync:mL,Glob:yt,hasMagic:hl,escape:yi,unescape:pt});Jt.glob=Jt;function dl(t,e){let{changedFiles:r}=e;return r.some(i=>t===i||t.endsWith(i)||i.endsWith(t))}function bL(t,e,r,i){let{fileChangeMap:s}=i,n=s.get(t);return n?n.status==="added"?!0:n.status==="removed"?!1:vL(n.patch,e,r):!1}function b0(t,e){return dl(t.file.path,e)&&bL(t.file.path,t.range.start.line,t.range.end.line,e)}function vL(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 C0=We(lo(),1);function Qt(t,e){return e.length===0?!1:(0,C0.default)().add(e).ignores(t)}var uo=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(),p=a?.include,b=a?.commitSelector;if(!b||!p)throw new Error("Commit selector and include are required in diff mode");let f=await Mm(u,{include:p,commitSelector:b}).catch(()=>{throw new Error("Diff mode requires a git repository. Please run this command from within a git repository.")});o.diffMode={gitChanges:f,changedFiles:f.files.map(d=>d.filename),fileChangeMap:new Map(f.files.map(d=>[d.filename,d]))},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 Tm(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=>Li.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(!Li.existsSync(s))throw new Error(`Path not found: ${e}`);let a=Li.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 Jt(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 Jt(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(!Li.statSync(o).isDirectory()){let p=jt.relative(n,o),b=i.has(p),f=Qt(p,r);!b&&!f&&s.push(p);continue}let u=(await Jt("**/*",{cwd:o,nodir:!0,absolute:!1,ignore:a})).map(p=>{let b=jt.resolve(o,p);return jt.relative(n,b)}).filter(p=>!i.has(p));s.push(...u)}return[...new Set(s)]}isFileValid(e){if(this.mode==="check")return!0;let{filePath:r}=e;return dl(r,{changedFiles:this.diffMode.changedFiles,fileChangeMap:this.diffMode.fileChangeMap})}isMatchValid(e){if(this.mode==="check")return!0;let{match:r}=e;return b0(r,{changedFiles:this.diffMode.changedFiles,fileChangeMap:this.diffMode.fileChangeMap})}};import*as Oi from"fs";import*as lt from"path";var fo=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 Oi.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(Oi.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 Oi.existsSync(a)?Oi.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 NO from"path";var O0=We(wl(),1);import{existsSync as HL}from"fs";import Dr from"path";import{fileURLToPath as KL}from"url";console.debug=()=>{};var YL=KL(import.meta.url),xl=Dr.dirname(YL),XL={darwin:"macOS",linux:"Linux",win32:"Windows"},ZL={x64:"X64",arm64:"ARM64"};function fe(t){let e=XL[process.platform],r=ZL[process.arch];if(!e||!r)return;let i=[Dr.join(xl,"powerlint/dist/vendor"),Dr.join(xl,"../dist/vendor"),Dr.join(xl,"./vendor")];for(let s of i){let n=Dr.join(s,`ast-grep-lang-${t}`),a=Dr.join(n,"prebuilds",`prebuild-${e}-${r}`,"parser.so");if(HL(a))return a}throw new Error(`Prebuild not found for ${t} on ${e} ${r}. Paths tried: ${i.join(", ")}`)}var JL={libraryPath:fe("angular"),extensions:["html"],languageSymbol:"tree_sitter_angular",expandoChar:"z"},QL={libraryPath:fe("bash"),extensions:["bash","bats","cgi","command","env","fcgi","ksh","sh","tmux","tool","zsh"],languageSymbol:"tree_sitter_bash",expandoChar:"$"},eO={libraryPath:fe("c"),extensions:["c","h"],languageSymbol:"tree_sitter_c",expandoChar:"_"},tO={libraryPath:fe("cpp"),extensions:["cc","hpp","cpp","hh","cxx","cu","ino"],languageSymbol:"tree_sitter_cpp",expandoChar:"_"},rO={libraryPath:fe("csharp"),extensions:["cs"],languageSymbol:"tree_sitter_c_sharp",expandoChar:"\xB5"},iO={libraryPath:fe("css"),extensions:["css","scss"],languageSymbol:"tree_sitter_css",expandoChar:"$"},sO={libraryPath:fe("dart"),extensions:["dart"],languageSymbol:"tree_sitter_dart",expandoChar:"$"},nO={libraryPath:fe("elixir"),extensions:["ex","exs"],languageSymbol:"tree_sitter_elixir",expandoChar:"\xB5"},oO={libraryPath:fe("go"),extensions:["go"],languageSymbol:"tree_sitter_go",expandoChar:"\xB5"},aO={libraryPath:fe("haskell"),extensions:["hs"],languageSymbol:"tree_sitter_haskell",expandoChar:"\xB5"},cO={libraryPath:fe("html"),extensions:["html","htm","xhtml"],languageSymbol:"tree_sitter_html",expandoChar:"z"},lO={libraryPath:fe("java"),extensions:["java"],languageSymbol:"tree_sitter_java",expandoChar:"$"},uO={libraryPath:fe("javascript"),extensions:["cjs","js","mjs","jsx"],languageSymbol:"tree_sitter_javascript",expandoChar:"$"},fO={libraryPath:fe("json"),extensions:["json"],languageSymbol:"tree_sitter_json",expandoChar:"$"},hO={libraryPath:fe("kotlin"),extensions:["kt","ktm","kts"],languageSymbol:"tree_sitter_kotlin",expandoChar:"\xB5"},dO={libraryPath:fe("lua"),extensions:["lua"],languageSymbol:"tree_sitter_lua",expandoChar:"$"},pO={libraryPath:fe("markdown"),extensions:["md"],languageSymbol:"tree_sitter_markdown",expandoChar:"$"},mO={libraryPath:fe("php"),extensions:["php"],languageSymbol:"tree_sitter_php",expandoChar:"$"},gO={libraryPath:fe("python"),extensions:["py"],languageSymbol:"tree_sitter_python",expandoChar:"\xB5"},yO={libraryPath:fe("ruby"),extensions:["rb","rbw","gemspec"],languageSymbol:"tree_sitter_ruby",expandoChar:"\xB5"},bO={libraryPath:fe("rust"),extensions:["rs"],languageSymbol:"tree_sitter_rust",expandoChar:"\xB5"},vO={libraryPath:fe("scala"),extensions:["scala","sc","sbt"],languageSymbol:"tree_sitter_scala",expandoChar:"$"},wO={libraryPath:fe("sql"),extensions:["sql"],languageSymbol:"tree_sitter_sql",expandoChar:"_"},xO={libraryPath:fe("swift"),extensions:["swift"],languageSymbol:"tree_sitter_swift",expandoChar:"\xB5"},EO={libraryPath:fe("toml"),extensions:["toml"],languageSymbol:"tree_sitter_toml",expandoChar:"_"},_O={libraryPath:fe("tsx"),extensions:["tsx"],languageSymbol:"tree_sitter_tsx",expandoChar:"$"},SO={libraryPath:fe("typescript"),extensions:["ts","cts","mts"],languageSymbol:"tree_sitter_typescript",expandoChar:"$"},RO={libraryPath:fe("yaml"),extensions:["yaml","yml"],languageSymbol:"tree_sitter_yaml",expandoChar:"$"},$0={Angular:JL,Bash:QL,C:eO,Cpp:tO,Csharp:rO,Css:iO,Dart:sO,Elixir:nO,Go:oO,Haskell:aO,Html:cO,Java:lO,JavaScript:uO,Json:fO,Kotlin:hO,Lua:dO,Markdown:pO,Php:mO,Python:gO,Ruby:yO,Rust:bO,Scala:vO,Sql:wO,Swift:xO,Toml:EO,Tsx:_O,TypeScript:SO,Yaml:RO};(0,O0.registerDynamicLanguage)($0);var L0=Object.entries($0).reduce((t,[e,r])=>(t[e]=r.extensions??[],t),{});function T0(t){let e=Dr.extname(t).slice(1);return AO(e)??"Unknown"}function AO(t){return Object.keys(L0).find(e=>L0[e].includes(t))}var vo=We(wl(),1);import{readFile as G0}from"fs/promises";import q0 from"path";import{spawn as $O}from"child_process";import TO from"crypto";import $i from"fs";import Bt,{dirname as D0,join as M0}from"path";import{promises as CO}from"fs";import RN from"path";async function po(t){try{return await CO.access(t),!0}catch{return!1}}import{execSync as LO}from"child_process";function P0(){return LO("which rg").toString().trim()}import mo from"fs";import OO from"path";async function I0(t){try{if(t.includes("/")||t.includes("\\"))return await mo.promises.access(t,mo.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=OO.join(n,t+a);try{return await mo.promises.access(o,mo.constants.X_OK),!0}catch{}}return!1}catch{return!1}}var F0=We(lo(),1);function N0(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(...N0(o))}return n}function Ts(t,e){if(e.length===0)return!1;let r=[];for(let s of e)r.push(...N0(s));return(0,F0.default)().add(r).ignores(t)}function go(t,e){let r=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return t.replace(r,"").replace(/\/\//g,"/")}async function Ps(t){return await new Promise((e,r)=>{let i=TO.createHash("sha256"),s=$i.createReadStream(t);s.on("error",n=>r(n)),s.on("data",n=>i.update(n)),s.on("end",()=>e(i.digest("hex")))})}function yo(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 PO(t,e,r){try{let s=$i.readFileSync(t,"utf8").split(`
52
- `),n=Math.max(0,e-1),a=Math.min(s.length,r);if(n===0&&a>=s.length)return s.map((u,p)=>`L${p+1} ${u}`).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 he("git rev-parse --abbrev-ref HEAD",{cwd:t});return e.trim()}async function Bm(t){let e=await Gc(t),{stdout:r}=await he("git rev-parse HEAD",{cwd:t}),i=r.trim(),{stdout:s}=await he('git log -1 --pretty=format:"%s"',{cwd:t}),n=s.trim(),{stdout:a}=await he('git log -1 --pretty=format:"%cI"',{cwd:t}),o=a.trim();return{sha:i,branch:e,message:n,timestamp:o}}function qc(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 zc(t){let{stdout:e}=await he("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 he(`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 he("git rev-parse --abbrev-ref HEAD",{cwd:t}),n=s.trim(),{stdout:a}=await he("git rev-parse HEAD",{cwd:t}),o=a.trim(),c="",l="";if(i)c=r,l=r;else{let v=jm(t,n),x=await Mm(t),_=r||v||`origin/${x||"main"}`;l=_;let A=`git merge-base --fork-point ${st(_)} HEAD || git merge-base ${st(_)} HEAD`,{stdout:C}=await he(A,{cwd:t});if(c=C.trim(),!r&&n===(x||"main")){let O=await km(t).catch(()=>{});if(O){l=O;let{stdout:F}=await he(`git merge-base --fork-point ${st(O)} HEAD || git merge-base ${st(O)} HEAD`,{cwd:t});c=F.trim()}else l="HEAD~1",c="HEAD~1"}}let u=tC(e.include),d=qc(r,e.include,n);if(d)throw new Error(d);let b=[];if(u.committed)if(i){let[v,x]=Nn(r),{stdout:_}=await he(`git diff --name-status -M -z ${st(v)}..${st(x)}`,{cwd:t,maxBuffer:50*1024*1024});b.push(...Fn(_,"committed"))}else{let{stdout:v}=await he(`git diff --name-status -M -z ${c}..HEAD`,{cwd:t,maxBuffer:52428800});b.push(...Fn(v,"committed"))}if(u.staged){let{stdout:v}=await he("git diff --name-status -M -z --cached",{cwd:t,maxBuffer:52428800});b.push(...Fn(v,"staged"))}if(u.unstaged){let{stdout:v}=await he("git diff --name-status -M -z",{cwd:t,maxBuffer:52428800});b.push(...Fn(v,"unstaged"))}if(u.untracked){let{stdout:v}=await he("git ls-files --others --exclude-standard -z",{cwd:t,maxBuffer:52428800});b.push(...rC(v))}let f=iC(b),p=f.filter(v=>v.source==="committed"),m=f.filter(v=>v.source==="staged"),y=f.filter(v=>v.source==="unstaged"),g=f.filter(v=>v.source==="untracked"),w=new Map;if(p.length>0){let v=p.map(C=>C.path),x="";if(i){let[C,O]=Nn(r);x=`git diff -U0 -M ${st(C)}..${st(O)} -- ${Kt(v)}`}else x=`git diff -U0 -M ${c}..HEAD -- ${Kt(v)}`;let{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024});Uc(_).forEach((C,O)=>w.set(O,hs(C)))}if(m.length>0){let v=m.map(C=>C.path),x=`git diff -U0 -M --cached -- ${Kt(v)}`,{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024});Uc(_).forEach((C,O)=>w.set(O,hs(C)))}if(y.length>0){let v=y.map(C=>C.path),x=`git diff -U0 -M -- ${Kt(v)}`,{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024});Uc(_).forEach((C,O)=>w.set(O,hs(C)))}for(let v of g)try{let{stdout:x}=await he(`git diff -U0 --no-index /dev/null ${st(v.path)}`,{cwd:t,maxBuffer:52428800});w.set(v.path,hs(x))}catch(x){if(x.stdout)w.set(v.path,hs(x.stdout));else throw x}let E=new Map;if(p.length>0){let v=p.map(C=>C.path),x="";if(i){let[C,O]=Nn(r);x=`git diff --numstat ${st(C)}..${st(O)} -- ${Kt(v)}`}else x=`git diff --numstat ${c}..HEAD -- ${Kt(v)}`;let{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024}),A=_.split(`
45
+ `).filter(Boolean);for(let C of A){let O=C.split(" ");if(O.length>=3){let[F,M,I]=O;E.set(I,{additions:parseInt(F)||0,deletions:parseInt(M)||0})}}}if(m.length>0){let v=m.map(C=>C.path),x=`git diff --numstat --cached -- ${Kt(v)}`,{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024}),A=_.split(`
46
+ `).filter(Boolean);for(let C of A){let O=C.split(" ");if(O.length>=3){let[F,M,I]=O;E.set(I,{additions:parseInt(F)||0,deletions:parseInt(M)||0})}}}if(y.length>0){let v=y.map(C=>C.path),x=`git diff --numstat -- ${Kt(v)}`,{stdout:_}=await he(x,{cwd:t,maxBuffer:50*1024*1024}),A=_.split(`
47
+ `).filter(Boolean);for(let C of A){let O=C.split(" ");if(O.length>=3){let[F,M,I]=O;E.set(I,{additions:parseInt(F)||0,deletions:parseInt(M)||0})}}}for(let v of g){let _=(w.get(v.path)||"").split(`
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,b,r,f,p),this.matchOne(e.slice(b),r.slice(f),i))return this.debug("globstar found match!",b,c,p),!0;if(p==="."||p===".."||!s.dot&&p.charAt(0)==="."){this.debug("dot detected!",e,b,r,f);break}this.debug("globstar swallow a segment, and continue"),b++}return!!(i&&(this.debug(`
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&gt)}calledReaddir(){return!!(this.#h&ul)}isENOENT(){return!!(this.#h&gt)}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&gt||(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&gt)===0)try{return this.#q(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if((this.#h&gt)===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,b=a?.commitSelector;if(!b||!d)throw new Error("Commit selector and include are required in diff mode");let f=await Um(u,{include:d,commitSelector:b}).catch(()=>{throw new Error("Diff mode requires a git repository. Please run this command from within a git repository.")});o.diffMode={gitChanges:f,changedFiles:f.files.map(p=>p.filename),fileChangeMap:new Map(f.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),b=i.has(d),f=Qt(d,r);!b&&!f&&s.push(d);continue}let u=(await Zt("**/*",{cwd:o,nodir:!0,absolute:!1,ignore:a})).map(d=>{let b=jt.resolve(o,d);return jt.relative(n,b)}).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 z0}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
+ `),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
53
  `);let o=s.slice(n,a),c="";n>0&&(c+=`[Lines 1-${n} omitted]
54
- `);let l=o.map((u,p)=>`L${n+p+1} ${u}`);return c+=l.join(`
54
+ `);let l=o.map((u,d)=>`L${n+d+1} ${u}`);return c+=l.join(`
55
55
  `),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 k0(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(Ts(a,r))return{error:`File not found or not accessible: ${i}. Please provide the correct path.`};let o=yo(e,a);if(!o)return{error:`Invalid file path: '${i}'`};if(!await po(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),p=c+u-1,b=PO(o,c,p),f=await Ps(o);return{content:b,sha:f}}catch(c){let l=c.message||String(c);return{error:go(`Error reading file: ${l}`,e)}}}async function IO(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=$O(t,s,{cwd:i,shell:!1,stdio:["ignore","pipe","pipe"],env:{LANG:"C",RIPGREP_CONFIG_PATH:""}}),p="",b="";u.stdout?.on("data",d=>{p+=d.toString()}),u.stderr?.on("data",d=>{b+=d.toString()});let f=setTimeout(()=>{u.kill("SIGTERM"),l(new Error("rg search operation timed out"))},3e4);u.on("close",d=>{clearTimeout(f),d===1&&!b?c({stdout:"",stderr:""}):d===0||d===1&&!b?c({stdout:p,stderr:b}):l(new Error(`ripgrep exited with code ${d}: ${b}`))}),u.on("error",d=>{clearTimeout(f),l(d)})});if(!n.stdout.trim())return[];let a=n.stdout.trim().split(`
57
- `),o=[];for(let c of a){let l=c.match(/^([^:]+):(\d+):(.*)$/);if(l){let[,u,p,b]=l,f=u;f=Bt.relative(i,u);let d=Bt.join(i,f);try{if($i.existsSync(d)){let m=await Ps(d);o.push({file:f,line_number:parseInt(p,10),content:b,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 j0(t,e,r=[],i=P0()){let{pattern:s,include:n}=t,a=t.path?.startsWith("/")?t.path.slice(1):t.path;try{if(!await I0(i))throw new Error(`ripgrep is not found or not executable: ${i}`);let c=null;if(a){let p=yo(e,a);if(!p)return{error:`Invalid path: '${a}'. Please provide the correct path.`};if(!await po(p))return{error:`Path not found or not accessible: ${a}. Please provide the correct path.`};let b=await $i.promises.stat(p);if(b.isFile())c=D0(p),a=D0(a);else if(b.isDirectory())c=p;else return{error:`Path is neither a file nor a directory: ${a}`}}return{matches:(await IO(i,s,n,c||e)).filter(p=>{let b=a?M0(a,p.file):p.file;return!Ts(b,r)}).slice(0,50).map(p=>({...p,file:a?M0(a,p.file):p.file}))}}catch(o){let c=typeof o=="object"&&o!==null&&"message"in o&&typeof o.message=="string"?o.message:String(o);return{error:go(c,e)}}}async function B0(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!=="."&&Ts(s,r))return{files:[]};let a=yo(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 po(n))return{error:`Directory not found or not accessible: ${s||"."}. Please provide the correct path.`};try{if(!(await $i.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 FO(i,s,e)).filter(c=>!Ts(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:go(o,e)}}}async function FO(t,e,r){try{let i;if(e){let a=e.startsWith("/")?e.slice(1):e,o=yo(r,a);if(!o)throw new Error(`Invalid directory path: potential directory traversal detected in '${a}'`);i=o}else i=r;let s=await Jt(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 $i.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(go(`Glob search failed: ${s}`,r))}}function U0(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 El(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 bo=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=q0.resolve(this.environment.getWorkspaceRoot(),c),u=await G0(l,"utf-8"),b=(await(0,vo.parseAsync)(this.language,u)).root().findAll({rule:r,language:this.language,constraints:i});if(b.length===0)return[];let f=await Ps(l);return b.map(d=>({filePath:c,sgNode:d,sha:f}))}),a=(await Promise.all(s)).flat(),o=[];for(let{filePath:c,sgNode:l,sha:u}of a){let p=l.range(),b={file:{path:c,sha:u},text:l.text(),range:{start:{line:p.start.line,column:p.start.column},end:{line:p.end.line,column:p.end.column}},language:this.language};o.push(El(b))}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()}async expandMatch(e){let r=new Set(["method_definition","function_declaration","function_expression","arrow_function","class_declaration","export_statement","lexical_declaration"]),i=q0.resolve(this.environment.getWorkspaceRoot(),e.file.path),[s,n]=await Promise.all([G0(i,"utf-8"),Ps(i)]),a=(0,vo.parse)(this.language,s).root(),o=U0(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(),p=typeof u=="string"?u:String(u);if(r.has(p)){let b=l.range(),f={file:{path:e.file.path,sha:n},text:l.text(),range:{start:{line:b.start.line,column:b.start.column},end:{line:b.end.line,column:b.end.column}},language:this.language};return El(f)}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}};var Ti=class extends Error{constructor(e,r){super(`${e} is not supported: ${r}`),this.name="LanguageBackendNotSupportedError"}},Pi=class{astProvider;intelligenceProvider;language;constructor(e,r){this.language=r,this.astProvider=new bo(e,r)}async findMatches(e,r){if(!this.astProvider)throw new Ti("findMatches","no AST provider configured for this language");return await this.astProvider.findMatches(e,r)}async findDefinitions(e){if(!this.intelligenceProvider)throw new Ti("findDefinitions","no intelligence provider configured for this language");return await this.intelligenceProvider.findDefinitions(e)}async findReferences(e){if(!this.intelligenceProvider)throw new Ti("findReferences","no intelligence provider configured for this language");return await this.intelligenceProvider.findReferences(e)}async expandMatch(e){if(!this.astProvider)throw new Ti("expandMatch","no AST provider configured for this language");return await this.astProvider.expandMatch(e)}};var wo=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(p=>T0(p)===r),c=(await new Pi(this.environment,r).findMatches(n,e)).map(p=>{if(NO.isAbsolute(p.file.path))throw new Error(`Match provider returned absolute path: ${p.file.path}. All file paths must be relative to workspace root.`);return{...p,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 z0=We(lo(),1);import DO from"path";var xo=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 Pi(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:p,...b}=l,f=p?[{file:p.file,text:p.text,range:p.range,language:p.language},...p.evidence||[]]:[];return{...b,source:f}});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 p=await r.findDefinitions(e);for(let b of p){let d={...await r.expandMatch(b)??b,language:l,depth:i,sourceMatch:c||e};n&&!this.matchesDefinitionFilter(d,n)||(a.push(d),i+1<s&&await this.followDefinitionsRecursive(b,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=DO.relative(this.environment.getWorkspaceRoot(),e);return r.path?i===r.path:r.glob?(0,z0.default)().add(r.glob).ignores(i):r.regex?new RegExp(r.regex).test(i):!0}};import{existsSync as MO}from"fs";import{dirname as kO,join as Eo}from"path";import{fileURLToPath as jO}from"url";var BO=jO(import.meta.url),_o=kO(BO);function W0(){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=[Eo(_o,"powerlint/dist/vendor/ripgrep",r,i),Eo(_o,"../../dist/vendor/ripgrep",r,i),Eo(_o,"../vendor/ripgrep",r,i),Eo(_o,"./vendor/ripgrep",r,i)];for(let n of s)if(MO(n))return n;throw new Error(`Bundled ripgrep binary not found for platform ${r}. Tried paths:
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,b=DO(o,c,d),f=await Mr(o);return{content:b,sha:f}}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="",b="";u.stdout?.on("data",p=>{d+=p.toString()}),u.stderr?.on("data",p=>{b+=p.toString()});let f=setTimeout(()=>{u.kill("SIGTERM"),l(new Error("rg search operation timed out"))},3e4);u.on("close",p=>{clearTimeout(f),p===1&&!b?c({stdout:"",stderr:""}):p===0||p===1&&!b?c({stdout:d,stderr:b}):l(new Error(`ripgrep exited with code ${p}: ${b}`))}),u.on("error",p=>{clearTimeout(f),l(p)})});if(!n.stdout.trim())return[];let a=n.stdout.trim().split(`
57
+ `),o=[];for(let c of a){let l=c.match(/^([^:]+):(\d+):(.*)$/);if(l){let[,u,d,b]=l,f=u;f=Bt.relative(i,u);let p=Bt.join(i,f);try{if(Ti.existsSync(p)){let m=await Mr(p);o.push({file:f,line_number:parseInt(d,10),content:b,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 b=await Ti.promises.stat(d);if(b.isFile())c=k0(d),a=k0(a);else if(b.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 b=a?j0(a,d.file):d.file;return!Is(b,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 q0(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 z0(l,"utf-8"),b=(await(0,Fs.parseAsync)(this.language,u)).root().findAll({rule:r,language:this.language,constraints:i});if(b.length===0)return[];let f=await Mr(l);return b.map(p=>({filePath:c,sgNode:p,sha:f}))}),a=(await Promise.all(s)).flat(),o=[];for(let{filePath:c,sgNode:l,sha:u}of a){let d=l.range(),b={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(b))}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;return s?(i&&(await(0,Fs.parseAsync)(e,i)).root().findAll({rule:s,constraints:n}),{isValid:!0}):{isValid:!1,error:"Schema must include a 'rule' field"}}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([z0(i,"utf-8"),Mr(i)]),a=(0,Fs.parse)(this.language,s).root(),o=q0(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 b=l.range(),f={file:{path:e.file.path,sha:n},text:l.text(),range:{start:{line:b.start.line,column:b.start.column},end:{line:b.end.line,column:b.end.column}},language:this.language};return Rl(f)}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),b=l.get(u.file);b||(b=await Mr(d),l.set(u.file,b));let f=u.text.split(`
58
+ `),p=u.line+f.length-1,m=f.length===1?u.column+u.text.length:f[f.length-1].length+1;c.push({file:{path:u.file,sha:b},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",f=>{u+=f.toString()}),l.stderr?.on("data",f=>{d+=f.toString()});let b=setTimeout(()=>{l.kill("SIGTERM"),c(new Error("Ripgrep search operation timed out"))},3e4);l.on("close",f=>{if(clearTimeout(b),f===0||f===1){let p=this.parseRipgrepOutput(u,s);o(p)}else c(new Error(`Ripgrep exited with code ${f}: ${d}`))}),l.on("error",f=>{clearTimeout(b),c(f)})})}parseRipgrepOutput(e,r){if(!e.trim())return[];let i=[],s=e.trim().split(`
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 b=d.start,f=d.end,p=b+1,m=u.substring(b,f);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,...b}=l,f=d?[{file:d.file,text:d.text,range:d.range,language:d.language},...d.evidence||[]]:[];return{...b,source:f}});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 b of d){let p={...await r.expandMatch(b)??b,language:l,depth:i,sourceMatch:c||e};n&&!this.matchesDefinitionFilter(p,n)||(a.push(p),i+1<s&&await this.followDefinitionsRecursive(b,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 qO}from"url";var zO=qO(import.meta.url),Co=GO(zO);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:
58
60
  ${s.join(`
59
- `)}`)}import{readFile as UO}from"fs/promises";import GO from"path";async function _l(t,e,r,i=!1){let s=GO.resolve(t,e),a=(await UO(s,"utf-8")).split(`
60
- `),{start:o,end:c}=r,l=o.line-1,u=c.line-1;if(o.line===c.line){let b=a[l]||"";return i?b.substring(o.column-1,c.column-1):b}let p=[];for(let b=l;b<=u&&b<a.length;b++){let f=a[b];b===l?p.push(i?f.substring(o.column-1):f):b===u?p.push(i?f.substring(0,c.column-1):f):p.push(f)}return p.join(`
61
- `)}var qO=W0(),So=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 k0(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 j0(i,this.environment.getWorkspaceRoot(),[],qO);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 B0(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 _l(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 _l(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),p;for(let y=0;y<this.maxIterations;y++){let g=await n.search({rule:e,matches:r,tools:i,messages:a,files:o});if(g.usage&&(c=c.plus(new Ke(g.usage.inputTokens)),l=l.plus(new Ke(g.usage.outputTokens)),u=u.plus(new Ke(g.usage.cost))),g.type==="matches"){let w=await this.hydrateMatchesWithFileContent(g.matches);p={...g,matches:w};break}if(g.type==="request_files"){for(let w of g.files)o.some(E=>E.path===w.path)||o.push({path:w.path,sha:w.sha});continue}if(g.type==="tool_request"){a.push({type:"tool_request",tool_calls:g.tool_calls});let w=await Promise.all(g.tool_calls.map(async E=>{let h=JSON.parse(E.function.arguments),v=await this.executeTool(e.id,E.function.name,h,o),x=typeof v=="string"?v:JSON.stringify(v);return{tool_call_id:E.id,content:x}}));for(let E of w)a.push({type:"tool_response",tool_call_id:E.tool_call_id,content:E.content});continue}}if(!p)throw new Error(`Max iterations (${this.maxIterations}) reached without getting matches`);let b=p.matches;if(b.length===0){let y=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,y,c.toNumber(),l.toNumber(),u.toString(),Date.now()-s,0,!1),{matches:[],executionTime:Date.now()-s}}this.eventEmitter.startLLMValidationPhase(e.id,b.length);let f=await n.validate({rule:e,matches:b,files:o});f.usage&&(c=c.plus(new Ke(f.usage.inputTokens)),l=l.plus(new Ke(f.usage.outputTokens)),u=u.plus(new Ke(f.usage.cost)));let d=await this.hydrateMatchesWithFileContent(f.matches),m=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,m,c.toNumber(),l.toNumber(),u.toString(),Date.now()-s,d.length,!1),{matches:d,executionTime:Date.now()-s}}async execute(e,r,i){return r.length===0?{matches:[],executionTime:0}:await this.executeLLMValidation(e,r,i)}};var Ro=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 fo(this.environment),this.findMatchesStep=new wo(this.environment,this.eventEmitter),this.gotoDefinitionStep=new xo(this.environment,this.eventEmitter),this.llmStep=new So(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,...p}=i;return{matches:(await this.findMatchesStep.execute(p,u,{filePaths:s,previousMatches:n})).matches}}if(c==="step-group")throw new Error("step-group step is disabled");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 p=Date.now(),b=await this.executeStep(e,l,u,n,a,r),f=Date.now()-p;if(this.eventEmitter.completeStep(i,l,u.type,b,f),b.filePaths!==void 0&&(n=this.executionContext.filterFiles(b.filePaths),a=this.executionContext.filterMatchesByFilePaths(a,n)),b.matches!==void 0&&(a=this.executionContext.filterMatches(b.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=zO().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 uo.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 p=u.id,b=!1;for(let d of u.config.steps)if(d.step.type==="llm"){b=!0;break}this.eventEmitter.emit("rules:rule-start",{ruleId:p,isLlm:b,message:u.config.message,severity:u.config.severity});let f=await this.executeRule(u,r);return this.eventEmitter.emit("rules:rule-complete",{ruleId:p}),f};await(async()=>{let u=async()=>{if(n.length===0)return;let b=n.shift(),f=await a(b);s.push(f),await u()},p=[];for(let b=0;b<Math.min(i,e.length);b++)p.push(u());await Promise.all(p)})();let c=new Map(e.map((u,p)=>[u.id,p]));s.sort((u,p)=>{let b=c.get(u.ruleId)??0,f=c.get(p.ruleId)??0;return b-f});let l=s.reduce((u,p)=>u+p.matches.length,0);return this.eventEmitter.completeRules(e.length,l),s}};var Ao=class extends Error{constructor(r,i,s){super(`Invalid rule format in '${r}': ${i}`);this.validationErrors=s;this.name="InvalidRuleFormatError"}};import{stripVTControlCharacters as ly}from"node:util";import Io from"node:process";import Z0 from"node:process";import $o from"node:process";var WO=(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);!VO(s,n)&&i||Object.defineProperty(t,r,n)},VO=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)},HO=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},KO=(t,e)=>`/* Wrapped ${t}*/
62
- ${e}`,YO=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),XO=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ZO=(t,e,r)=>{let i=r===""?"":`with ${r.trim()}() `,s=KO.bind(null,i,e.toString());Object.defineProperty(s,"name",XO);let{writable:n,enumerable:a,configurable:o}=YO;Object.defineProperty(t,"toString",{value:s,writable:n,enumerable:a,configurable:o})};function Sl(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:i}=t;for(let s of Reflect.ownKeys(e))WO(t,e,s,r);return HO(t,e),ZO(t,e,i),t}var Co=new WeakMap,V0=(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(Co.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 Sl(n,t),Co.set(n,i),n};V0.callCount=t=>{if(!Co.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return Co.get(t)};var H0=V0;var Mr=[];Mr.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Mr.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Mr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Lo=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",Rl=Symbol.for("signal-exit emitter"),Al=globalThis,JO=Object.defineProperty.bind(Object),Cl=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Al[Rl])return Al[Rl];JO(Al,Rl,{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}},Oo=class{},QO=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Ll=class extends Oo{onExit(){return()=>{}}load(){}unload(){}},Ol=class extends Oo{#t=$l.platform==="win32"?"SIGINT":"SIGHUP";#r=new Cl;#e;#n;#f;#w={};#a=!1;constructor(e){super(),this.#e=e,this.#w={};for(let r of Mr)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(!Lo(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 Mr)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,Mr.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 Lo(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"&&Lo(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)}},$l=globalThis.process,{onExit:K0,load:ID,unload:FD}=QO(Lo($l)?new Ol($l):new Ll);var Y0=$o.stderr.isTTY?$o.stderr:$o.stdout.isTTY?$o.stdout:void 0,e$=Y0?H0(()=>{K0(()=>{Y0.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},X0=e$;var To=!1,Ii={};Ii.show=(t=Z0.stderr)=>{t.isTTY&&(To=!1,t.write("\x1B[?25h"))};Ii.hide=(t=Z0.stderr)=>{t.isTTY&&(X0(),To=!0,t.write("\x1B[?25l"))};Ii.toggle=(t,e)=>{t!==void 0&&(To=t),To?Ii.show(e):Ii.hide(e)};var Tl=Ii;var Pl={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 Is=Pl,WD=Object.keys(Pl);var kr={};Do(kr,{error:()=>a$,info:()=>s$,success:()=>n$,warning:()=>o$});import r$ from"node:tty";var i$=r$?.WriteStream?.prototype?.hasColors?.()??!1,oe=(t,e)=>{if(!i$)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}},KD=oe(0,0),YD=oe(1,22),XD=oe(2,22),ZD=oe(3,23),JD=oe(4,24),QD=oe(53,55),eM=oe(7,27),tM=oe(8,28),rM=oe(9,29),iM=oe(30,39),J0=oe(31,39),Q0=oe(32,39),ey=oe(33,39),ty=oe(34,39),sM=oe(35,39),nM=oe(36,39),oM=oe(37,39),aM=oe(90,39),cM=oe(40,49),lM=oe(41,49),uM=oe(42,49),fM=oe(43,49),hM=oe(44,49),dM=oe(45,49),pM=oe(46,49),mM=oe(47,49),gM=oe(100,49),yM=oe(91,39),bM=oe(92,39),vM=oe(93,39),wM=oe(94,39),xM=oe(95,39),EM=oe(96,39),_M=oe(97,39),SM=oe(101,49),RM=oe(102,49),AM=oe(103,49),CM=oe(104,49),LM=oe(105,49),OM=oe(106,49),$M=oe(107,49);import ry from"node:process";function Fs(){let{env:t}=ry,{TERM:e,TERM_PROGRAM:r}=t;return ry.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 Po=Fs(),s$=ty(Po?"\u2139":"i"),n$=Q0(Po?"\u2714":"\u221A"),o$=ey(Po?"\u26A0":"\u203C"),a$=J0(Po?"\u2716":"\xD7");function Il({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 c$=Il();function Ns(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(c$,"")}function iy(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 sy(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function ny(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 l$(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Fl(t,{ambiguousAsWide:e=!1}={}){return l$(t),sy(t)||ny(t)||e&&iy(t)?2:1}var u$=new Intl.Segmenter,f$=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),h$=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),d$=new RegExp("^\\p{RGI_Emoji}$","v");function p$(t){return t.replace(h$,"")}function m$(t){return f$.test(t)}function g$(t,e){let r=0;if(t.length>1)for(let i of t.slice(1))i>="\uFF00"&&i<="\uFFEF"&&(r+=Fl(i.codePointAt(0),e));return r}function Nl(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=e,s=t;if(i||(s=Ns(s)),s.length===0)return 0;let n=0,a={ambiguousAsWide:!r};for(let{segment:o}of u$.segment(s)){if(m$(o))continue;if(d$.test(o)){n+=2;continue}let c=p$(o).codePointAt(0);n+=Fl(c,a),n+=g$(o,a)}return n}function Dl({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import Rt from"node:process";var y$=3,Ml=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]===y$&&Rt.emit("SIGINT")}},b$=new Ml,kl=b$;var jl=class{#t=0;#r=!1;#e=0;#n=-1;#f=0;#w=0;#a;#u;#s;#c;#i;#l;#o;#p;#g;#y;#d;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#a={color:"cyan",stream:Io.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:Dl({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,Io.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.#p}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.#p=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(!Fs())this.#u=Is.line;else if(e===void 0)this.#u=Is.dots;else if(e!=="default"&&Is[e])this.#u=Is[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.#d}set suffixText(e=""){this.#d=e,this.#S()}get isSpinning(){return this.#c!==void 0}#A(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.#A(e,r,!1)}#E(e=this.#d,r=" "){return this.#A(e,r,!0)}#_(e,r){let i=0;for(let s of Ns(e).split(`
63
- `))i+=Math.max(1,Math.ceil(Nl(s)/r));return i}#S(){let e=this.#s.columns??80,r=typeof this.#y=="function"?"":this.#y,i=typeof this.#d=="function"?"":this.#d,s=typeof r=="string"&&r!==""?r+" ":"",n=typeof i=="string"&&i!==""?" "+i:"",o=" ".repeat(this.#p)+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.#f>=this.interval)&&(this.#n=++this.#n%this.#u.frames.length,this.#f=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.#d," ");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.#p||this.#w!==this.#p)&&this.#s.cursorTo(this.#p),this.#w=this.#p,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(`
61
+ `)}`)}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 b=a[l]||"";return i?b.substring(o.column-1,c.column-1):b}let d=[];for(let b=l;b<=u&&b<a.length;b++){let f=a[b];b===l?d.push(i?f.substring(o.column-1):f):b===u?d.push(i?f.substring(0,c.column-1):f):d.push(f)}return d.join(`
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 y=0;y<this.maxIterations;y++){let g=await n.search({rule:e,matches:r,tools:i,messages:a,files:o});if(g.usage&&(c=c.plus(new Ke(g.usage.inputTokens)),l=l.plus(new Ke(g.usage.outputTokens)),u=u.plus(new Ke(g.usage.cost))),g.type==="matches"){let w=await this.hydrateMatchesWithFileContent(g.matches);d={...g,matches:w};break}if(g.type==="request_files"){for(let w of g.files)o.some(E=>E.path===w.path)||o.push({path:w.path,sha:w.sha});continue}if(g.type==="tool_request"){a.push({type:"tool_request",tool_calls:g.tool_calls});let w=await Promise.all(g.tool_calls.map(async E=>{let h=JSON.parse(E.function.arguments),v=await this.executeTool(e.id,E.function.name,h,o),x=typeof v=="string"?v:JSON.stringify(v);return{tool_call_id:E.id,content:x}}));for(let E of w)a.push({type:"tool_response",tool_call_id:E.tool_call_id,content:E.content});continue}}if(!d)throw new Error(`Max iterations (${this.maxIterations}) reached without getting matches`);let b=d.matches;if(b.length===0){let y=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,y,c.toNumber(),l.toNumber(),u.toString(),Date.now()-s,0,!1),{matches:[],executionTime:Date.now()-s}}this.eventEmitter.startLLMValidationPhase(e.id,b.length);let f=await n.validate({rule:e,matches:b,files:o});f.usage&&(c=c.plus(new Ke(f.usage.inputTokens)),l=l.plus(new Ke(f.usage.outputTokens)),u=u.plus(new Ke(f.usage.cost)));let p=await this.hydrateMatchesWithFileContent(f.matches),m=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,m,c.toNumber(),l.toNumber(),u.toString(),Date.now()-s,p.length,!1),{matches:p,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")throw new Error("step-group step is disabled");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(),b=await this.executeStep(e,l,u,n,a,r),f=Date.now()-d;if(this.eventEmitter.completeStep(i,l,u.type,b,f),b.filePaths!==void 0&&(n=this.executionContext.filterFiles(b.filePaths),a=this.executionContext.filterMatchesByFilePaths(a,n)),b.matches!==void 0&&(a=this.executionContext.filterMatches(b.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,b=!1;for(let p of u.config.steps)if(p.step.type==="llm"){b=!0;break}this.eventEmitter.emit("rules:rule-start",{ruleId:d,isLlm:b,message:u.config.message,severity:u.config.severity});let f=await this.executeRule(u,r);return this.eventEmitter.emit("rules:rule-complete",{ruleId:d}),f};await(async()=>{let u=async()=>{if(n.length===0)return;let b=n.shift(),f=await a(b);s.push(f),await u()},d=[];for(let b=0;b<Math.min(i,e.length);b++)d.push(u());await Promise.all(d)})();let c=new Map(e.map((u,d)=>[u.id,d]));s.sort((u,d)=>{let b=c.get(u.ruleId)??0,f=c.get(d.ruleId)??0;return b-f});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}*/
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.#f>=this.interval)&&(this.#n=++this.#n%this.#u.frames.length,this.#f=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(`
64
66
  `),a=s-1;e=[...n.slice(0,a),"... (content truncated to fit terminal)"].join(`
65
- `)}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.#p)+this.#x(this.#y," ")+(this.text?`- ${this.text}`:"")+this.#E(this.#d," ");return r.trim()!==""&&this.#s.write(r+`
66
- `),this}return this.isSpinning?this:(this.#a.hideCursor&&Tl.hide(this.#s),this.#a.discardStdin&&Io.stdin.isTTY&&(this.#r=!0,kl.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&&Tl.show(this.#s)),this.#a.discardStdin&&Io.stdin.isTTY&&this.#r&&(kl.stop(),this.#r=!1),this}succeed(e){return this.stopAndPersist({symbol:kr.success,text:e})}fail(e){return this.stopAndPersist({symbol:kr.error,text:e})}warn(e){return this.stopAndPersist({symbol:kr.warning,text:e})}info(e){return this.stopAndPersist({symbol:kr.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.#d,l=this.#E(c," "),u=i+s+o+l+`
67
- `;return this.stop(),this.#s.write(u),this}};function Ds(t){return new jl(t)}var er="#f87171",tr="#60a5fa",v$="#9b59b6",ye="#fbbf24",Bl="#9ca3af",ks="#9b59b6",Fo="\u25A0",Ms="\u25CF",js="\u2B25";function w$(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 uy(t,e){return t.length<=e?t:t.substring(0,e-3)+"..."}var oy="#f8f8f8",ay="#888888",x$=[S.hex(ye)("~(oo)~"),S.hex(ye)("~(oO)~"),S.hex(ye)("~(Oo)~"),S.hex(ye)("~(OO)~"),S.hex(ye)("~(\u25CFo)~"),S.hex(ye)("~(o\u25CF)~"),S.hex(ye)("~(\u25C9o)~"),S.hex(ye)("~(o\u25C9)~"),S.hex(ye)("\\(oo)/"),S.hex(ye)("\\(oO)/"),S.hex(ye)("\\(Oo)/"),S.hex(ye)("\\(OO)/"),S.hex(ye)("~(Oo)~"),S.hex(ye)("~(oO)~"),S.hex(ye)("~(\u25CEo)~"),S.hex(ye)("~(o\u25CE)~"),S.hex(ye)("~(oo)~"),S.hex(ye)("~(OO)~"),S.hex(ye)("~(Oo)~"),S.hex(ye)("\\(oo)/"),S.hex(ye)("\\(oO)/"),S.hex(ye)("\\(Oo)/"),S.hex(ye)("\\(OO)/")];function cy(t,e){return e===1?t:`${t}s`}function E$(t,e={}){let i=e.align||[],s=e.stringLength||(a=>ly(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(`
68
- `)}function fy(t,e){let r=`
69
- `,i=0,s=0,n=new Map;t.forEach(d=>{if(d.matches.length===0)return;let m=d.ruleId||"unknown";n.has(m)||n.set(m,{message:d.message,severity:d.severity,internalId:d.internalId,execution:d.execution,matches:[]});let y=n.get(m);d.matches.forEach(g=>{y.matches.push({file:{path:g.file.path,sha:g.file.sha},line:g.range.start.line,column:g.range.start.column,endLine:g.range.end.line!==g.range.start.line?g.range.end.line:void 0,text:g.text,description:g.description,evidence:g.evidence?.map(w=>({file:{path:w.file.path,sha:w.file.sha},text:w.text,range:w.range,description:w.description}))}),d.severity==="violation"?i++:s++})}),n.forEach((d,m)=>{if(d.matches.length===0&&d.severity!=="skipped")return;let y;d.severity==="violation"?y=S.hex(er)(Fo):d.severity==="suggestion"?y=S.hex(tr)(Ms):y=S.hex(v$)(Ms);let g=d.execution==="llm"?`${S.hex(ks)(js)} `:"",w;if(d.internalId){let h=`https://app.wispbit.com/rules/${d.internalId}`;w=S.bold(`\x1B]8;;${h}\x1B\\${m}\x1B]8;;\x1B\\`)}else w=S.bold(m);let E=`${y} ${g}${w} ${d.message.replace(/([^ ])\.$/u,"$1")}`;if(r+=`${E}
67
+ `)}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
+ `),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 ql(t)}var er="#f87171",tr="#60a5fa",_$="#9b59b6",ye="#fbbf24",zl="#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",fy="#888888",R$=[S.hex(ye)("~(oo)~"),S.hex(ye)("~(oO)~"),S.hex(ye)("~(Oo)~"),S.hex(ye)("~(OO)~"),S.hex(ye)("~(\u25CFo)~"),S.hex(ye)("~(o\u25CF)~"),S.hex(ye)("~(\u25C9o)~"),S.hex(ye)("~(o\u25C9)~"),S.hex(ye)("\\(oo)/"),S.hex(ye)("\\(oO)/"),S.hex(ye)("\\(Oo)/"),S.hex(ye)("\\(OO)/"),S.hex(ye)("~(Oo)~"),S.hex(ye)("~(oO)~"),S.hex(ye)("~(\u25CEo)~"),S.hex(ye)("~(o\u25CE)~"),S.hex(ye)("~(oo)~"),S.hex(ye)("~(OO)~"),S.hex(ye)("~(Oo)~"),S.hex(ye)("\\(oo)/"),S.hex(ye)("\\(oO)/"),S.hex(ye)("\\(Oo)/"),S.hex(ye)("\\(OO)/")];function hy(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
+ `)}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(g=>{y.matches.push({file:{path:g.file.path,sha:g.file.sha},line:g.range.start.line,column:g.range.start.column,endLine:g.range.end.line!==g.range.start.line?g.range.end.line:void 0,text:g.text,description:g.description,evidence:g.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 g=p.execution==="llm"?`${S.hex(Bs)(Us)} `:"",w;if(p.internalId){let h=`https://app.wispbit.com/rules/${p.internalId}`;w=S.bold(`\x1B]8;;${h}\x1B\\${m}\x1B]8;;\x1B\\`)}else w=S.bold(m);let E=`${y} ${g}${w} ${p.message.replace(/([^ ])\.$/u,"$1")}`;if(r+=`${E}
70
72
  `,r+=`${S.dim("\u2500".repeat(80))}
71
- `,d.severity==="skipped")r+=`
72
- `;else{let h=d.matches.sort((x,_)=>x.file.path.localeCompare(_.file.path));h.length<10&&h.some(x=>x.text&&x.text.split(`
73
+ `,p.severity==="skipped")r+=`
74
+ `;else{let h=p.matches.sort((x,_)=>x.file.path.localeCompare(_.file.path));h.length<10&&h.some(x=>x.text&&x.text.split(`
73
75
  `).length<=30)?h.forEach((x,_)=>{if(x.text&&x.text.split(`
74
- `).length<=30){let C=x.description?` - ${S.dim(x.description)}`:"";r+=` ${x.file.path}${C}
76
+ `).length<=30){let A=x.description?` - ${S.dim(x.description)}`:"";r+=` ${x.file.path}${A}
75
77
  `,x.text.split(`
76
- `).forEach((O,F)=>{let M=x.line+F,I=S.bgHex(oy).hex(ay)(` ${String(M)} `);r+=` ${I} ${S.dim(O)}
77
- `})}else{let C=x.endLine?`(${x.line}:${x.endLine})`:`(${x.line})`,A=x.description?` - ${S.dim(x.description)}`:"";r+=` ${x.file.path} ${S.dim(C)}${A}
78
- `}x.evidence&&x.evidence.length>0&&x.evidence.forEach(C=>{if(C.text&&C.text.split(`
79
- `).length<=30){let A=C.description?` - ${S.dim(C.description)}`:"";r+=` ${C.file.path}${A}
80
- `,C.text.split(`
81
- `).forEach((F,M)=>{let I=C.range.start.line+M,Y=S.bgHex(oy).hex(ay)(` ${String(I)} `);r+=` ${Y} ${S.dim(F)}
82
- `})}else{let A=`${C.range.start.line}:${C.range.end.line}`,O=C.description?` - ${S.dim(C.description)}`:"";r+=` ${C.file.path} ${S.dim(`(${A})`)}${O}
78
+ `).forEach((O,F)=>{let M=x.line+F,I=S.bgHex(uy).hex(fy)(` ${String(M)} `);r+=` ${I} ${S.dim(O)}
79
+ `})}else{let A=x.endLine?`(${x.line}:${x.endLine})`:`(${x.line})`,C=x.description?` - ${S.dim(x.description)}`:"";r+=` ${x.file.path} ${S.dim(A)}${C}
80
+ `}x.evidence&&x.evidence.length>0&&x.evidence.forEach(A=>{if(A.text&&A.text.split(`
81
+ `).length<=30){let C=A.description?` - ${S.dim(A.description)}`:"";r+=` ${A.file.path}${C}
82
+ `,A.text.split(`
83
+ `).forEach((F,M)=>{let I=A.range.start.line+M,Y=S.bgHex(uy).hex(fy)(` ${String(I)} `);r+=` ${Y} ${S.dim(F)}
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}
83
85
  `}}),_<h.length-1&&(r+=`
84
- `)}):h.forEach(x=>{let _=x.endLine?`(${x.line}:${x.endLine})`:`(${x.line})`,C=x.description?` - ${S.dim(x.description)}`:"";r+=` ${x.file.path} ${S.dim(_)}${C}
85
- `,x.evidence&&x.evidence.length>0&&x.evidence.forEach(A=>{let O=`${A.range.start.line}:${A.range.end.line}`,F=A.description?` - ${S.dim(A.description)}`:"";r+=` ${A.file.path} ${S.dim(`(${O})`)}${F}
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}
86
88
  `})}),r+=`
87
89
 
88
- `}}),console.log(r);let a=i+s,o=i>0?`${S.dim("violations".padStart(12))} ${S.hex(er)(Fo)} ${S.hex(er).bold(i)}`:`${S.dim("violations".padStart(12))} ${S.dim(i)}`,c=s>0?`${S.dim("suggestions".padStart(12))} ${S.hex(tr)(Ms)} ${S.hex(tr).bold(s)}`:`${S.dim("suggestions".padStart(12))} ${S.dim(s)}`,l=e.totalFiles?`${e.totalFiles} ${cy("file",e.totalFiles)}`:"0 files",u=`${e.totalRules} ${cy("rule",e.totalRules)}`,p=e.executionTime?`${Math.round(e.executionTime)}ms`:"",b=[l,u,p].filter(Boolean).join(", "),f="";f+=`${o}
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} ${hy("file",e.totalFiles)}`:"0 files",u=`${e.totalRules} ${hy("rule",e.totalRules)}`,d=e.executionTime?`${Math.round(e.executionTime)}ms`:"",b=[l,u,d].filter(Boolean).join(", "),f="";f+=`${o}
89
91
  `,f+=`${c}
90
92
  `,f+=`${S.dim("summary".padStart(12))} ${b}
91
- `,console.log(a>0?S.reset(f):f),i>0&&process.exit(1)}function hy(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"?Fo:Ms,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),p=w$(a.id,a.internalId),b=a.config.execution==="llm"?S.hex(ks)(js)+" "+S.hex(ks)("llm"):S.hex(Bl)(js)+" "+S.hex(Bl)("deterministic"),f=uy(a.config.message,s),d=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(["",`${p}${" ".repeat(d)} ${S.dim("\u2502")} ${u}${" ".repeat(m)} ${S.dim("\u2502")} ${b}${" ".repeat(y)} ${S.dim("\u2502")} ${f}`])}let n=E$(e,{align:["","l"],stringLength(a){return ly(a).length}});console.log(`
93
+ `,console.log(a>0?S.reset(f):f),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),b=a.config.execution==="llm"?S.hex(Bs)(Us)+" "+S.hex(Bs)("llm"):S.hex(zl)(Us)+" "+S.hex(zl)("deterministic"),f=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")} ${b}${" ".repeat(y)} ${S.dim("\u2502")} ${f}`])}let n=C$(e,{align:["","l"],stringLength(a){return py(a).length}});console.log(`
92
94
  `+n),console.log(S.dim(`
93
- Use 'wispbit check --rule <rule-id>' to run a specific rule.`))}function dy(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 py(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:p,message:b,severity:f,dotAnimationFrame:d,toolInfo:m,validationPhase:y}]of n){if(m||y){let C=n.get(u);C.dotAnimationFrame=(C.dotAnimationFrame+1)%3}let g=d+1,w=S.hex(ye)(".".repeat(g).padEnd(3," ")),E=f==="violation"?S.hex(er)(Fo):S.hex(tr)(Ms),h=p?`${S.hex(ks)(js)} ${S.hex(ks)("llm")}`:S.hex(Bl)(js),v=Math.max(40,c-50),x=uy(b,v),_=`${E} ${h} ${S.dim(u)} ${x}`;if(y){let C=` ${w} ${S.dim(`validating ${y.matchCount} ${y.matchCount===1?"match":"matches"}`)}`;o.push(`${_}
94
- ${C}`)}else if(m)if(m.toolName==="read"&&m.file){let C="";if(m.offset||m.limit){let O=m.offset?parseInt(m.offset,10):1,F=m.limit?parseInt(m.limit,10):200,M=O+F-1;C=` ${S.dim(`(lines ${O}-${M})`)}`}let A=` ${w} ${S.dim("tool: read")} ${m.file}${C}`;o.push(`${_}
95
- ${A}`)}else if(m.toolName==="grep"){let C=m.path||".",A=m.pattern||"",O=` ${w} ${S.dim("tool: grep")} ${C} ${S.dim(`for "${A}"`)}`;o.push(`${_}
96
- ${O}`)}else if(m.toolName==="glob"){let C=m.path||".",A=m.pattern||"",O=` ${w} ${S.dim("tool: glob")} ${C} ${S.dim(`for "${A}"`)}`;o.push(`${_}
97
- ${O}`)}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((p,b)=>b===0?p:p.split(`
98
- `).map((d,m)=>m===0?` ${d}`:d).join(`
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:b,severity:f,dotAnimationFrame:p,toolInfo:m,validationPhase:y}]of n){if(m||y){let A=n.get(u);A.dotAnimationFrame=(A.dotAnimationFrame+1)%3}let g=p+1,w=S.hex(ye)(".".repeat(g).padEnd(3," ")),E=f==="violation"?S.hex(er)(Mo):S.hex(tr)(js),h=d?`${S.hex(Bs)(Us)} ${S.hex(Bs)("llm")}`:S.hex(zl)(Us),v=Math.max(40,c-50),x=dy(b,v),_=`${E} ${h} ${S.dim(u)} ${x}`;if(y){let A=` ${w} ${S.dim(`validating ${y.matchCount} ${y.matchCount===1?"match":"matches"}`)}`;o.push(`${_}
96
+ ${A}`)}else if(m)if(m.toolName==="read"&&m.file){let A="";if(m.offset||m.limit){let O=m.offset?parseInt(m.offset,10):1,F=m.limit?parseInt(m.limit,10):200,M=O+F-1;A=` ${S.dim(`(lines ${O}-${M})`)}`}let C=` ${w} ${S.dim("tool: read")} ${m.file}${A}`;o.push(`${_}
97
+ ${C}`)}else if(m.toolName==="grep"){let A=m.path||".",C=m.pattern||"",O=` ${w} ${S.dim("tool: grep")} ${A} ${S.dim(`for "${C}"`)}`;o.push(`${_}
98
+ ${O}`)}else if(m.toolName==="glob"){let A=m.path||".",C=m.pattern||"",O=` ${w} ${S.dim("tool: glob")} ${A} ${S.dim(`for "${C}"`)}`;o.push(`${_}
99
+ ${O}`)}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,b)=>b===0?d:d.split(`
100
+ `).map((p,m)=>m===0?` ${p}`:p).join(`
99
101
  `));r.text=`${u.join(`
100
- `)}${l}`}else r.text=`${l}`};return t.on("execution:mode",o=>{s=o}),t.on("rules:start",o=>{r=Ds({spinner:{interval:120,frames:x$},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(`
102
+ `)}${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(`
101
103
  ${S.blue("Discovering files")} in ${S.bold(o.mode)} mode...`)}),t.on("files:discovery:progress",o=>{e&&console.log(` ${o.message}`)}),t.on("files:discovery:complete",o=>{e&&console.log(S.green("File discovery complete:"),`${o.totalFiles} files found (${o.executionTime}ms)`)}),t.on("files:filter",o=>{e&&o.originalCount!==o.filteredCount&&console.log(S.yellow("Filtered:"),`${o.originalCount} \u2192 ${o.filteredCount} ${o.filterType}`)}),t.on("indexing:start",o=>{i=Date.now()}),t.on("indexing:progress",o=>{r&&(r.color="yellow"),i&&Date.now()-i>1e3&&r&&(r.text=`Indexing ${o.language}...`),r&&(o.packageName&&o.timeMs?r.text=`Indexing ${o.language}: ${o.packageName}`:o.message!=="Indexing files..."&&(r.text=`Indexing ${o.language}: ${o.message}`)),e&&(o.packageName&&o.timeMs?console.log(` + ${o.packageName} (${o.timeMs}ms)`):o.message==="Indexing files..."?process.stdout.write("."):o.message!=="Indexing files..."&&console.log(` ${o.message}`))}),t.on("indexing:complete",o=>{i=null,r&&(r.color="blue"),e&&(process.stdout.write(`
102
104
  `),console.log(S.green("Indexing complete for"),`${o.language} (${o.executionTime}ms)`))}),e&&(t.on("scip:match-lookup:start",o=>{console.log(S.cyan(`
103
105
  \u{1F50D} [${o.language}] Starting SCIP match lookup for: ${JSON.stringify(o.match)}`))}),t.on("scip:match-lookup:progress",o=>{console.log(`${JSON.stringify(o.document)}`)}),t.on("scip:match-lookup:complete",o=>{console.log(S.green(`SCIP match lookup complete for: ${o.language}`))}),t.on("step:start",o=>{console.log(S.cyan(`
104
- \u{1F527} [${o.ruleId}] Starting step: ${o.stepName} (${o.stepType})`)),console.log(` Input files: ${o.inputs.filePaths.length}`),console.log(` Input matches: ${o.inputs.matches.length}`),o.inputs.matches.length>0&&(console.log(" Match details:"),o.inputs.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,p)=>{console.log(` ${p+1}. ${u.filePath} @ ${u.range.start.line} \u2192 ${u.range.end.line}`)})),console.log(` Text preview: ${c.text?.substring(0,120)}...`)}))}),t.on("step:complete",o=>{console.log(S.cyan(`\u2705 [${o.ruleId}] Completed step: ${o.stepName} (${o.stepType}) (${o.executionTime}ms)`)),o.outputs.filePaths!==void 0&&console.log(` Output files: ${o.outputs.filePaths.length}`),o.outputs.matches!==void 0&&(console.log(` Output matches: ${o.outputs.matches.length}`),o.outputs.matches.length>0&&(console.log(" Output match details:"),o.outputs.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,p)=>{console.log(` ${p+1}. ${u.filePath} @ ${u.range.start.line} \u2192 ${u.range.end.line}`)})),console.log(` Text preview: ${c.text?.substring(0,120)}...`)})))}),t.on("test:start",o=>{console.log(S.magenta(`
105
- \u{1F9EA} [${o.ruleId}] Running test: "${o.testName}"`))}),t.on("test:matches",o=>{console.log(S.magenta(` Found ${o.matches.length} match(es):`)),o.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,p)=>{console.log(` ${p+1}. ${u.filePath} @ ${u.range.start.line} \u2192 ${u.range.end.line}`)})),console.log(` Text preview: ${c.text?.substring(0,120)}...`)})})),()=>{r&&(r._updateInterval&&clearInterval(r._updateInterval),r.stopAndPersist(),r=null),n.clear()}}import _$ from"readline";var le="#fbbf24",Fi="#ff6b35",ut="#4a90e2",Ni="#9b59b6",Ul=[`
106
+ \u{1F527} [${o.ruleId}] Starting step: ${o.stepName} (${o.stepType})`)),console.log(` Input files: ${o.inputs.filePaths.length}`),console.log(` Input matches: ${o.inputs.matches.length}`),o.inputs.matches.length>0&&(console.log(" Match details:"),o.inputs.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,d)=>{console.log(` ${d+1}. ${u.filePath} @ ${u.range.start.line} \u2192 ${u.range.end.line}`)})),console.log(` Text preview: ${c.text?.substring(0,120)}...`)}))}),t.on("step:complete",o=>{console.log(S.cyan(`\u2705 [${o.ruleId}] Completed step: ${o.stepName} (${o.stepType}) (${o.executionTime}ms)`)),o.outputs.filePaths!==void 0&&console.log(` Output files: ${o.outputs.filePaths.length}`),o.outputs.matches!==void 0&&(console.log(` Output matches: ${o.outputs.matches.length}`),o.outputs.matches.length>0&&(console.log(" Output match details:"),o.outputs.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,d)=>{console.log(` ${d+1}. ${u.filePath} @ ${u.range.start.line} \u2192 ${u.range.end.line}`)})),console.log(` Text preview: ${c.text?.substring(0,120)}...`)})))}),t.on("test:start",o=>{console.log(S.magenta(`
107
+ \u{1F9EA} [${o.ruleId}] Running test: "${o.testName}"`))}),t.on("test:matches",o=>{console.log(S.magenta(` Found ${o.matches.length} match(es):`)),o.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,d)=>{console.log(` ${d+1}. ${u.filePath} @ ${u.range.start.line} \u2192 ${u.range.end.line}`)})),console.log(` Text preview: ${c.text?.substring(0,120)}...`)})})),()=>{r&&(r._updateInterval&&clearInterval(r._updateInterval),r.stopAndPersist(),r=null),n.clear()}}import A$ from"readline";var le="#fbbf24",Ni="#ff6b35",ut="#4a90e2",Di="#9b59b6",Wl=[`
106
108
  ${S.hex(le)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
107
109
  ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
108
110
  ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
@@ -117,19 +119,19 @@ ${S.hex(ut)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557")}${S.hex(le)("\u258
117
119
  ${S.hex(ut)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588")}${S.hex(le)("\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
118
120
  ${S.hex(ut)(" \u255A\u2550\u2550\u255D\u255A\u2550")}${S.hex(le)("\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D ")}
119
121
  `,`
120
- ${S.hex(le)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557")}${S.hex(Ni)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}${S.hex(le)("\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
121
- ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551")}${S.hex(Ni)("\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}${S.hex(le)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
122
- ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551")}${S.hex(Ni)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}${S.hex(le)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
123
- ${S.hex(le)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551")}${S.hex(Ni)("\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D ")}${S.hex(le)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
124
- ${S.hex(le)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551")}${S.hex(Ni)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 ")}${S.hex(le)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
125
- ${S.hex(le)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D")}${S.hex(Ni)("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D ")}${S.hex(le)("\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D ")}
122
+ ${S.hex(le)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557")}${S.hex(Di)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}${S.hex(le)("\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
123
+ ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551")}${S.hex(Di)("\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}${S.hex(le)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
124
+ ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551")}${S.hex(Di)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}${S.hex(le)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
125
+ ${S.hex(le)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551")}${S.hex(Di)("\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D ")}${S.hex(le)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
126
+ ${S.hex(le)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551")}${S.hex(Di)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 ")}${S.hex(le)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
127
+ ${S.hex(le)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D")}${S.hex(Di)("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D ")}${S.hex(le)("\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D ")}
126
128
  `,`
127
- ${S.hex(le)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}${S.hex(Fi)("\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
128
- ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}${S.hex(Fi)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
129
- ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}${S.hex(Fi)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
130
- ${S.hex(le)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D ")}${S.hex(Fi)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
131
- ${S.hex(le)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 ")}${S.hex(Fi)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
132
- ${S.hex(le)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D ")}${S.hex(Fi)("\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D ")}
129
+ ${S.hex(le)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}${S.hex(Ni)("\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
130
+ ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}${S.hex(Ni)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
131
+ ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}${S.hex(Ni)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
132
+ ${S.hex(le)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D ")}${S.hex(Ni)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
133
+ ${S.hex(le)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 ")}${S.hex(Ni)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
134
+ ${S.hex(le)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D ")}${S.hex(Ni)("\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D ")}
133
135
  `,`
134
136
  ${S.hex(le)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557")}${S.hex(ut)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
135
137
  ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551")}${S.hex(ut)("\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
@@ -137,12 +139,12 @@ ${S.hex(le)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\
137
139
  ${S.hex(le)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551")}${S.hex(ut)(" \u2588\u2588\u2551 ")}
138
140
  ${S.hex(le)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551")}${S.hex(ut)(" \u2588\u2588\u2551 ")}
139
141
  ${S.hex(le)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D")}${S.hex(ut)(" \u255A\u2550\u255D ")}
140
- `];function S$(){process.stdout.write("\x1B[2J\x1B[H")}function R$(t){return new Promise(e=>setTimeout(e,t))}async function A$(t=3e3){let e=Ds({text:"",spinner:{interval:100,frames:Ul}}).start();await R$(t),e.stop()}async function C$(t){let e=_$.createInterface({input:process.stdin,output:process.stdout});return await new Promise(r=>{e.question(t,i=>{e.close(),r(i.trim())})})}async function my(){S$(),await A$(1500),console.log(Ul[0]),console.log(S.hex(er)(`
142
+ `];function L$(){process.stdout.write("\x1B[2J\x1B[H")}function O$(t){return new Promise(e=>setTimeout(e,t))}async function $$(t=3e3){let e=ks({text:"",spinner:{interval:100,frames:Wl}}).start();await O$(t),e.stop()}async function T$(t){let e=A$.createInterface({input:process.stdin,output:process.stdout});return await new Promise(r=>{e.question(t,i=>{e.close(),r(i.trim())})})}async function vy(){L$(),await $$(1500),console.log(Wl[0]),console.log(S.hex(er)(`
141
143
  Welcome to wispbit`)),console.log(S(` The linter for AI
142
144
  `)),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
143
- `));let t=await C$(S.bold.hex(tr)(" Enter your Wispbit API key (or press Enter to exit): "));return t||(console.log(S.dim(`
144
- Setup cancelled.`)),null)}yy.default.config();function vy(){return No.join(gy.homedir(),".powerlint","config.json")}async function L$(t){let e=vy(),r=No.dirname(e);await jr.mkdir(r,{recursive:!0});let i={};try{let n=await jr.readFile(e,"utf-8");i=JSON.parse(n)}catch{}let s={...i,apiKey:t};await jr.writeFile(e,JSON.stringify(s,null,2))}async function O$(){if(process.env.WISPBIT_API_KEY)return process.env.WISPBIT_API_KEY;let t=vy();try{let e=await jr.readFile(t,"utf-8");return JSON.parse(e).apiKey||null}catch{return null}}async function wy(t){let e=process.env.WISPBIT_API_KEY||null;e||(e=await O$());let r=await ls.initialize(t,{apiKey:e||void 0});if("failed"in r){if(r.error==="INVALID_API_KEY"){let i=await my();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 L$(i),r=await ls.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 $$(){let t=Ir(),e=await Lm();by.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
145
- `)))}var be=qf(`
145
+ `));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
+ 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 be=Hf(`
146
148
  wispbit - the linter for AI
147
149
  https://wispbit.com/
148
150
 
@@ -187,8 +189,8 @@ Global options:
187
189
  --repo-url <url> Override repository URL (default: from git remote)
188
190
  -v, --version Show version number
189
191
  -h, --help Show help
190
- `,{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 Gl(t){let e=new hi({repositoryUrl:t.repoUrl}),r=await wy(e),{ruleId:i,json:s,mode:n,filePath:a}=t,{commitSelector:o,diffInclude:c}=t;if(n==="diff"){let E=e.getWorkspaceRoot();if(o)c||(c=(await Uc(E)).include);else{let h=await Uc(E);o=h.commitSelector,c||(c=h.include)}}if(n==="diff"&&o&&c){let E=e.getWorkspaceRoot(),h=await jc(E),v=Bc(o,c,h);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 $$();let p;try{let E=new ds(r,e);i?p=[await E.loadRuleById(i)]:p=await E.loadAllRules()}catch(E){throw E instanceof Ao&&(console.error(S.red("Rule Validation Error:"),E.message),E.validationErrors&&E.validationErrors.length>0&&(console.error(S.red("Validation errors:")),E.validationErrors.forEach(h=>{console.error(S.red(" \u2022"),h)})),process.exit(1)),E}if(!l)if(n==="check"){let E=S.bgHex("#eab308").black(" CHECK "),h=S.dim(` (${a||"all files"})`);console.log(`${E}${h}`)}else{let E=S.bgHex("#4a90e2").black(" DIFF "),h=(o||"").replace(/\b[0-9a-f]{30,}\b/gi,x=>x.substring(0,7)),v=c?` ${h} ${S.dim(`[${c.join("/")}]`)}`:` ${h}`;console.log(`${E}${v}`)}let b=new nt;if(n==="check")b.setExecutionMode("check",{filePath:a});else{let E=c?c.join(", "):"all";b.setExecutionMode("diff",{baseCommit:o||"",headCommit:E})}let f=t.json?void 0:py(b,t.debug||!1),d=Date.now(),m=new Ro(r,e,b),y=0;b.on("files:discovery:complete",E=>{y=E.totalFiles});let g=await m.execute(p,{mode:n,filePath:a,diffOptions:n==="diff"?{include:c,commitSelector:o}:void 0}),w=[];for(let E of g){let h=p.find(v=>v.id===E.ruleId);if(h){let _={ruleId:E.ruleId,internalId:h.internalId,message:h.config.message,severity:h.config.severity,execution:h.config.execution,matches:E.matches,llmCost:void 0,llmTokens:void 0};w.push(_)}}if(f?.(),l)dy(w,u);else{let E=w.filter(M=>M.severity==="violation"),h=w.filter(M=>M.severity==="suggestion"),v=E.reduce((M,I)=>M+I.matches.length,0),x=h.reduce((M,I)=>M+I.matches.length,0),_=v+x,C=w.filter(M=>M.llmCost).reduce((M,I)=>M.plus(new Ke(I.llmCost||0)),new Ke(0)),A=w.filter(M=>M.llmTokens).reduce((M,I)=>M+(I.llmTokens||0),0),O;if(n==="check")O={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";O={mode:"diff",baseCommit:M,headCommit:I}}let F=Date.now()-d;fy(w,{totalRules:p.length,violationCount:v,suggestionCount:x,totalMatches:_,totalLLMCost:C.toString(),totalLLMTokens:A,executionMode:O,executionTime:F,totalFiles:y})}return w}async function T$(t){let e=new hi({repositoryUrl:t}),r=await wy(e),s=await new ds(r,e).loadAllRules();hy(s)}async function P$(){let t=be.input[0],e=be.input[1];switch(t){case"check":{let r=be.input[1];await Gl({ruleId:be.flags.rule,json:be.flags.json,debug:be.flags.debug,mode:"check",filePath:r,repoUrl:be.flags.repoUrl});break}case"diff":{let r;if(be.flags.include){let n=be.flags.include.split(",").map(c=>c.trim()),a=["committed","staged","unstaged","untracked"],o=n.filter(c=>!a.includes(c));o.length>0&&(console.error(S.red(`Invalid include(s): ${o.join(", ")}. Valid includes: ${a.join(", ")}`)),process.exit(1)),r=n}let i=be.input[1];await Gl({ruleId:be.flags.rule,json:be.flags.json,debug:be.flags.debug,mode:"diff",diffInclude:r,commitSelector:i,repoUrl:be.flags.repoUrl});break}case"list":{await T$(be.flags.repoUrl);break}case"cache":{if(e==="purge"){let r=new hi({repositoryUrl:be.flags.repoUrl}),s=await new Un(r).purgeCache();console.log(`
191
- ${S.green("Cache purged successfully.")} Removed ${s.deletedCount} item(s).`)}else console.error(S.red("Unknown cache subcommand:"),e),be.showHelp(),process.exit(1);break}default:{let r;if(be.flags.include){let n=be.flags.include.split(",").map(c=>c.trim()),a=["committed","staged","unstaged","untracked"],o=n.filter(c=>!a.includes(c));o.length>0&&(console.error(S.red(`Invalid include(s): ${o.join(", ")}. Valid includes: ${a.join(", ")}`)),process.exit(1)),r=n}let i=be.input[0];await Gl({ruleId:be.flags.rule,json:be.flags.json,debug:be.flags.debug,mode:"diff",diffInclude:r,commitSelector:i,repoUrl:be.flags.repoUrl});break}}}P$();export{$$ as checkForUpdates};
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 E=e.getWorkspaceRoot();if(o)c||(c=(await zc(E)).include);else{let h=await zc(E);o=h.commitSelector,c||(c=h.include)}}if(n==="diff"&&o&&c){let E=e.getWorkspaceRoot(),h=await Gc(E),v=qc(o,c,h);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 E=new ds(r,e);i?d=[await E.loadRuleById(i)]:d=await E.loadAllRules()}catch(E){throw E instanceof Oo&&(console.error(S.red("Rule Validation Error:"),E.message),E.validationErrors&&E.validationErrors.length>0&&(console.error(S.red("Validation errors:")),E.validationErrors.forEach(h=>{console.error(S.red(" \u2022"),h)})),process.exit(1)),E}if(!l)if(n==="check"){let E=S.bgHex("#eab308").black(" CHECK "),h=S.dim(` (${a||"all files"})`);console.log(`${E}${h}`)}else{let E=S.bgHex("#4a90e2").black(" DIFF "),h=(o||"").replace(/\b[0-9a-f]{30,}\b/gi,x=>x.substring(0,7)),v=c?` ${h} ${S.dim(`[${c.join("/")}]`)}`:` ${h}`;console.log(`${E}${v}`)}let b=new nt;if(n==="check")b.setExecutionMode("check",{filePath:a});else{let E=c?c.join(", "):"all";b.setExecutionMode("diff",{baseCommit:o||"",headCommit:E})}let f=t.json?void 0:by(b,t.debug||!1),p=Date.now(),m=new Lo(r,e,b),y=0;b.on("files:discovery:complete",E=>{y=E.totalFiles});let g=await m.execute(d,{mode:n,filePath:a,diffOptions:n==="diff"?{include:c,commitSelector:o}:void 0}),w=[];for(let E of g){let h=d.find(v=>v.id===E.ruleId);if(h){let _={ruleId:E.ruleId,internalId:h.internalId,message:h.config.message,severity:h.config.severity,execution:h.config.execution,matches:E.matches,llmCost:void 0,llmTokens:void 0};w.push(_)}}if(f?.(),l)yy(w,u);else{let E=w.filter(M=>M.severity==="violation"),h=w.filter(M=>M.severity==="suggestion"),v=E.reduce((M,I)=>M+I.matches.length,0),x=h.reduce((M,I)=>M+I.matches.length,0),_=v+x,A=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),O;if(n==="check")O={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";O={mode:"diff",baseCommit:M,headCommit:I}}let F=Date.now()-p;my(w,{totalRules:d.length,violationCount:v,suggestionCount:x,totalMatches:_,totalLLMCost:A.toString(),totalLLMTokens:C,executionMode:O,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=be.input[0],e=be.input[1];switch(t){case"check":{let r=be.input[1];await Vl({ruleId:be.flags.rule,json:be.flags.json,debug:be.flags.debug,mode:"check",filePath:r,repoUrl:be.flags.repoUrl});break}case"diff":{let r;if(be.flags.include){let n=be.flags.include.split(",").map(c=>c.trim()),a=["committed","staged","unstaged","untracked"],o=n.filter(c=>!a.includes(c));o.length>0&&(console.error(S.red(`Invalid include(s): ${o.join(", ")}. Valid includes: ${a.join(", ")}`)),process.exit(1)),r=n}let i=be.input[1];await Vl({ruleId:be.flags.rule,json:be.flags.json,debug:be.flags.debug,mode:"diff",diffInclude:r,commitSelector:i,repoUrl:be.flags.repoUrl});break}case"list":{await N$(be.flags.repoUrl);break}case"cache":{if(e==="purge"){let r=new pi({repositoryUrl:be.flags.repoUrl}),s=await new qn(r).purgeCache();console.log(`
193
+ ${S.green("Cache purged successfully.")} Removed ${s.deletedCount} item(s).`)}else console.error(S.red("Unknown cache subcommand:"),e),be.showHelp(),process.exit(1);break}default:{let r;if(be.flags.include){let n=be.flags.include.split(",").map(c=>c.trim()),a=["committed","staged","unstaged","untracked"],o=n.filter(c=>!a.includes(c));o.length>0&&(console.error(S.red(`Invalid include(s): ${o.join(", ")}. Valid includes: ${a.join(", ")}`)),process.exit(1)),r=n}let i=be.input[0];await Vl({ruleId:be.flags.rule,json:be.flags.json,debug:be.flags.debug,mode:"diff",diffInclude:r,commitSelector:i,repoUrl:be.flags.repoUrl});break}}}D$();export{F$ as checkForUpdates};
192
194
  /*! Bundled license information:
193
195
 
194
196
  deep-extend/lib/deep-extend.js: