@visulima/vis 1.0.0-alpha.2 → 1.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +830 -14
- package/LICENSE.md +7667 -0
- package/README.md +322 -19
- package/dist/bin.js +1 -146
- package/dist/config/index.d.ts +2795 -0
- package/dist/config/index.js +1 -0
- package/dist/generate/index.d.ts +157 -0
- package/dist/generate/index.js +1 -0
- package/dist/packem_chunks/bin.js +1295 -0
- package/dist/packem_chunks/config.js +19 -0
- package/dist/packem_chunks/doctor-probe.js +2 -0
- package/dist/packem_chunks/fix.js +11 -0
- package/dist/packem_chunks/handler.js +1 -0
- package/dist/packem_chunks/handler10.js +1 -0
- package/dist/packem_chunks/handler11.js +5 -0
- package/dist/packem_chunks/handler12.js +1 -0
- package/dist/packem_chunks/handler13.js +27 -0
- package/dist/packem_chunks/handler14.js +5 -0
- package/dist/packem_chunks/handler15.js +1 -0
- package/dist/packem_chunks/handler16.js +1 -0
- package/dist/packem_chunks/handler17.js +1 -0
- package/dist/packem_chunks/handler18.js +1 -0
- package/dist/packem_chunks/handler19.js +1 -0
- package/dist/packem_chunks/handler2.js +2 -0
- package/dist/packem_chunks/handler20.js +5 -0
- package/dist/packem_chunks/handler21.js +2 -0
- package/dist/packem_chunks/handler22.js +2 -0
- package/dist/packem_chunks/handler23.js +18 -0
- package/dist/packem_chunks/handler24.js +1 -0
- package/dist/packem_chunks/handler25.js +1 -0
- package/dist/packem_chunks/handler26.js +5 -0
- package/dist/packem_chunks/handler27.js +1 -0
- package/dist/packem_chunks/handler28.js +3 -0
- package/dist/packem_chunks/handler29.js +1 -0
- package/dist/packem_chunks/handler3.js +4 -0
- package/dist/packem_chunks/handler30.js +7 -0
- package/dist/packem_chunks/handler31.js +33 -0
- package/dist/packem_chunks/handler32.js +3 -0
- package/dist/packem_chunks/handler33.js +1 -0
- package/dist/packem_chunks/handler34.js +26 -0
- package/dist/packem_chunks/handler35.js +3 -0
- package/dist/packem_chunks/handler36.js +7 -0
- package/dist/packem_chunks/handler37.js +22 -0
- package/dist/packem_chunks/handler38.js +428 -0
- package/dist/packem_chunks/handler39.js +6 -0
- package/dist/packem_chunks/handler4.js +8 -0
- package/dist/packem_chunks/handler40.js +24 -0
- package/dist/packem_chunks/handler41.js +10 -0
- package/dist/packem_chunks/handler42.js +153 -0
- package/dist/packem_chunks/handler43.js +25 -0
- package/dist/packem_chunks/handler44.js +24 -0
- package/dist/packem_chunks/handler45.js +213 -0
- package/dist/packem_chunks/handler46.js +3 -0
- package/dist/packem_chunks/handler47.js +27 -0
- package/dist/packem_chunks/handler48.js +167 -0
- package/dist/packem_chunks/handler49.js +34 -0
- package/dist/packem_chunks/handler5.js +1 -0
- package/dist/packem_chunks/handler6.js +1 -0
- package/dist/packem_chunks/handler7.js +1 -0
- package/dist/packem_chunks/handler8.js +1 -0
- package/dist/packem_chunks/handler9.js +2 -0
- package/dist/packem_chunks/heal-accept.js +10 -0
- package/dist/packem_chunks/heal.js +14 -0
- package/dist/packem_chunks/help-command.js +18 -0
- package/dist/packem_chunks/index.js +7 -0
- package/dist/packem_chunks/keys-refresh.js +4 -0
- package/dist/packem_chunks/list.js +3 -0
- package/dist/packem_chunks/loader.js +1 -0
- package/dist/packem_chunks/prune.js +3 -0
- package/dist/packem_chunks/run.js +1 -0
- package/dist/packem_chunks/status.js +2 -0
- package/dist/packem_chunks/sync.js +2 -0
- package/dist/packem_chunks/sync2.js +2 -0
- package/dist/packem_chunks/tar.js +3 -0
- package/dist/packem_chunks/tripwire.js +2 -0
- package/dist/packem_shared/advisories-DsynpacV.js +1 -0
- package/dist/packem_shared/ai-analysis-uYuTIIXi.js +68 -0
- package/dist/packem_shared/ai-cache-DuwHYx2O.js +1 -0
- package/dist/packem_shared/ai-fix-DzrA-dVz.js +43 -0
- package/dist/packem_shared/applyDefaults-BOVDw1jD.js +1 -0
- package/dist/packem_shared/build-scripts-DsWMSWDs.js +1 -0
- package/dist/packem_shared/cache-directory-DQak1Vjc.js +1 -0
- package/dist/packem_shared/cyclonedx-CiHXuG8M.js +4 -0
- package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
- package/dist/packem_shared/dependency-scan-DC3nAFHS.js +1 -0
- package/dist/packem_shared/docker-B-CIN_nj.js +60 -0
- package/dist/packem_shared/failure-log-C3LEMmkq.js +2 -0
- package/dist/packem_shared/flakiness-Dq6K4ymq.js +1 -0
- package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
- package/dist/packem_shared/glob-MHJQjR39-CQ2GC0b_.js +1 -0
- package/dist/packem_shared/index-DH-5hsrC.js +1 -0
- package/dist/packem_shared/lifecycle-Dv3nAtoD.js +2 -0
- package/dist/packem_shared/lockfile-C5DYMHVq.js +1 -0
- package/dist/packem_shared/manifests-B0fMp872.js +1 -0
- package/dist/packem_shared/min-release-age-BFozFonQ.js +34 -0
- package/dist/packem_shared/native-config-sync-Dvi1g2nQ.js +21 -0
- package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
- package/dist/packem_shared/registry-keys-CewRFW0e.js +1 -0
- package/dist/packem_shared/resolve-explicit-CC4Kifk5.js +5 -0
- package/dist/packem_shared/run-summary-utils-BaBGP3bo.js +1 -0
- package/dist/packem_shared/runtime-check-BusAwPb2.js +1 -0
- package/dist/packem_shared/scan-progress-CMynp3eA.js +2 -0
- package/dist/packem_shared/selectors-B2ISH581.js +3 -0
- package/dist/packem_shared/signatures-5ZdjJ2Pu.js +2 -0
- package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
- package/dist/packem_shared/toolchain-Cc3cwyLP.js +5 -0
- package/dist/packem_shared/typosquats-BCeR-sLf.js +1 -0
- package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
- package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
- package/dist/packem_shared/verify-07kUNTuP.js +1 -0
- package/dist/packem_shared/vis-update-app-CFrlJ3mW.js +1 -0
- package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
- package/index.d.ts +358 -0
- package/index.js +609 -0
- package/package.json +57 -22
- package/schemas/project.schema.json +872 -0
- package/schemas/vis-config.schema.json +4306 -0
- package/skills/vis/SKILL.md +96 -0
- package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
- package/templates/buildkite-ci/template.yml +20 -0
- package/dist/ai-analysis.d.ts +0 -40
- package/dist/ai-cache.d.ts +0 -21
- package/dist/bin.d.ts +0 -1
- package/dist/catalog.d.ts +0 -110
- package/dist/commands/affected.d.ts +0 -3
- package/dist/commands/ai.d.ts +0 -3
- package/dist/commands/analyze.d.ts +0 -3
- package/dist/commands/check.d.ts +0 -3
- package/dist/commands/graph.d.ts +0 -3
- package/dist/commands/hook/constants.d.ts +0 -8
- package/dist/commands/hook/index.d.ts +0 -3
- package/dist/commands/hook/install.d.ts +0 -7
- package/dist/commands/hook/migrate.d.ts +0 -27
- package/dist/commands/hook/uninstall.d.ts +0 -3
- package/dist/commands/migrate/constants.d.ts +0 -12
- package/dist/commands/migrate/deps.d.ts +0 -32
- package/dist/commands/migrate/index.d.ts +0 -3
- package/dist/commands/migrate/json.d.ts +0 -20
- package/dist/commands/migrate/lint-staged.d.ts +0 -62
- package/dist/commands/migrate/types.d.ts +0 -20
- package/dist/commands/run.d.ts +0 -3
- package/dist/commands/staged.d.ts +0 -3
- package/dist/commands/update.d.ts +0 -3
- package/dist/config.d.ts +0 -40
- package/dist/config.js +0 -1
- package/dist/package-manager.d.ts +0 -23
- package/dist/workspace.d.ts +0 -58
|
@@ -0,0 +1,1295 @@
|
|
|
1
|
+
var _E=Object.defineProperty;var f=(e,t)=>_E(e,"name",{value:t,configurable:!0});import{createRequire as ME}from"node:module";import{m as fo,C as ht,U as Bt,M as C,L as Dp,Q as cb,k as mo,q as lb,O as ja,g as Ge,_ as Cp,s as UE,t as ub,u as Cd,v as GE,x as qE,A as zE,$ as J,B as ze,z as ho,n as ke,w as go,i as x,b as Jt,D as xa,j as zn,f as HE,K as pb,e as gh}from"./config.js";import{x as mb}from"tinyexec";import{renderToString as hb,render as tD}from"@visulima/tui";import Si,{useState as Is,useRef as Js,useEffect as gb,useCallback as yb,useSyncExternalStore as rD}from"react";import{jsx as z,jsxs as pe}from"react/jsx-runtime";import{Box as he}from"@visulima/tui/components/box";import{Dialog as Ap}from"@visulima/tui/components/dialog";import{Text as H}from"@visulima/tui/components/text";import{useApp as vb}from"@visulima/tui/hooks/use-app";import{useInput as bb}from"@visulima/tui/hooks/use-input";import{useWindowSize as nD}from"@visulima/tui/hooks/use-window-size";import{ScrollView as iD}from"@visulima/tui/components/scroll-view";import{ScrollBar as sD}from"@visulima/tui/components/scroll-bar";import{resolveEditorconfigDefaults as oD,resolveInstall as aD,resolveAdd as cD,whichBin as lD,execPmCommandInteractive as uD,resolveDedupe as pD,resolveDlx as dD,resolveExec as fD,resolveLink as mD,resolvePmCommand as hD,resolveRemove as gD,resolveUnlink as yD,resolveWhy as vD,detectPackageManager as bD,resolveOutdated as $D}from"#native";import{looksLikeInputUri as wD,parseInputUri as kD}from"@visulima/task-runner";import{Table as SD}from"@visulima/tui/components/table";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
2
|
+
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
3
|
+
const VE=ME(import.meta.url),hi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vt=f(e=>{if(typeof hi<"u"&&hi.versions&&hi.versions.node){const[t,r]=hi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return hi.getBuiltinModule(e)}return VE(e)},"__cjs_getBuiltinModule"),ab=Vt("node:module"),{createRequire:Ze}=ab,WE=Vt("node:assert"),Mi=hi,{env:xl}=Mi,db=Vt("node:fs/promises"),Pr=Vt("node:path"),{resolve:fb,delimiter:yh}=Pr,{existsSync:rc,writeFileSync:Ve,statSync:Pi,readdirSync:Kt,rmSync:Ad,readFileSync:JE,copyFileSync:KE,unlinkSync:Vi,mkdirSync:YE,cpSync:XE}=Vt("node:fs"),QE=Vt("node:url"),ZE=Vt("url"),eD=Vt("util"),{spawnSync:An,spawn:vh,execSync:$b}=Vt("node:child_process"),{platform:Od,homedir:wb}=Vt("node:os"),{createInterface:kb}=Vt("node:readline"),{createHash:ED}=Vt("node:crypto");var DD=Object.defineProperty,Sb=f((e,t)=>DD(e,"name",{value:t,configurable:!0}),"t$X"),CD=Object.defineProperty,Eb=Sb((e,t)=>CD(e,"name",{value:t,configurable:!0}),"t"),AD=Object.defineProperty,OD=Eb((e,t)=>AD(e,"name",{value:t,configurable:!0}),"t");let bh=class extends Error{static{f(this,"l")}static{Sb(this,"c")}static{Eb(this,"i")}static{OD(this,"WalkError")}root;constructor(t,r){super(`${t instanceof Error?t.message:String(t)} for path "${r}"`),this.cause=t,this.root=r}get name(){return"WalkError"}set name(t){throw new Error("Cannot overwrite name of WalkError")}};var jD=Object.defineProperty,xD=f((e,t)=>jD(e,"name",{value:t,configurable:!0}),"n$$"),PD=Object.defineProperty,Db=xD((e,t)=>PD(e,"name",{value:t,configurable:!0}),"t"),ND=Object.defineProperty,RD=Db((e,t)=>ND(e,"name",{value:t,configurable:!0}),"g");const $h=RD(e=>{const t=e.replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`).replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");return new RegExp(`^${t}$`)},"globToRegExp");var FD=Object.defineProperty,LD=Db((e,t)=>FD(e,"name",{value:t,configurable:!0}),"n");const Jo=LD((e,t,r,n)=>Array.isArray(t)&&t.length>0&&!t.some(i=>e.endsWith(i))||r&&!r.some(i=>i.test(e))?!1:!n?.some(i=>i.test(e)),"walkInclude");var ID=Object.defineProperty,Cb=f((e,t)=>ID(e,"name",{value:t,configurable:!0}),"p$T"),TD=Object.defineProperty,jd=Cb((e,t)=>TD(e,"name",{value:t,configurable:!0}),"m");const BD=Ze(import.meta.url),hs=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_D=jd(e=>{if(typeof hs<"u"&&hs.versions&&hs.versions.node){const[t,r]=hs.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return hs.getBuiltinModule(e)}return BD(e)},"__cjs_getBuiltinModule"),{readdirSync:MD,realpathSync:VD,statSync:WD}=_D("node:fs");var UD=Object.defineProperty,zt=jd((e,t)=>UD(e,"name",{value:t,configurable:!0}),"t");const GD=zt(e=>{const t=Dp(e),r=WD(t);return{isDirectory:zt(()=>r.isDirectory(),"isDirectory"),isFile:zt(()=>r.isFile(),"isFile"),isSymbolicLink:zt(()=>r.isSymbolicLink(),"isSymbolicLink"),name:cb(t),path:t}},"_createWalkEntry");function*an(e,{extensions:t,followSymlinks:r=!1,includeDirs:n=!0,includeFiles:i=!0,includeSymlinks:s=!0,match:o,maxDepth:a=Number.POSITIVE_INFINITY,skip:l}={}){if(fo(e),a<0)return;const c=o?o.map(d=>typeof d=="string"?$h(d):d):void 0,u=l?l.map(d=>typeof d=="string"?$h(d):d):void 0;if(e=ht(Bt(e)),n&&Jo(e,t,c,u)&&(yield GD(e)),!(a<1||!Jo(e,void 0,void 0,u)))try{const d=MD(e,{withFileTypes:!0});for(const p of d){let m=C(e,p.name);if(p.isSymbolicLink())if(r)m=VD(m);else if(s&&Jo(m,t,c,u)){yield{isDirectory:zt(()=>p.isDirectory(),"isDirectory"),isFile:zt(()=>p.isFile(),"isFile"),isSymbolicLink:zt(()=>p.isSymbolicLink(),"isSymbolicLink"),name:p.name,path:Dp(m)};continue}else continue;p.isDirectory()?yield*an(m,{extensions:t,followSymlinks:r,includeDirs:n,includeFiles:i,includeSymlinks:s,match:c,maxDepth:a-1,skip:u}):p.isFile()&&i&&Jo(m,t,c,u)&&(yield{isDirectory:zt(()=>p.isDirectory(),"isDirectory"),isFile:zt(()=>p.isFile(),"isFile"),isSymbolicLink:zt(()=>p.isSymbolicLink(),"isSymbolicLink"),name:p.name,path:Dp(m)})}}catch(d){throw d instanceof bh?d:new bh(d,e)}}f(an,"y$G");Cb(an,"F");jd(an,"b");zt(an,"walkSync");var qD=Object.defineProperty,zD=f((e,t)=>qD(e,"name",{value:t,configurable:!0}),"p$S"),HD=Object.defineProperty,Ab=zD((e,t)=>HD(e,"name",{value:t,configurable:!0}),"a");const JD=Ze(import.meta.url),gs=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ob=Ab(e=>{if(typeof gs<"u"&&gs.versions&&gs.versions.node){const[t,r]=gs.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return gs.getBuiltinModule(e)}return JD(e)},"__cjs_getBuiltinModule"),{stat:KD,lstat:YD}=Ob("node:fs/promises"),{fileURLToPath:XD}=Ob("node:url");var QD=Object.defineProperty,wh=Ab((e,t)=>QD(e,"name",{value:t,configurable:!0}),"n");const yo=wh(async(e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=t.cwd?Bt(t.cwd):process.cwd();let n=ht(r);const{root:i}=mo(n),s=Bt(t.stopAt??i),o=ht(n,s),a=t.type??"file",l=wh(async function(u){return typeof e=="function"?[await e(u)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?KD:YD;for(;n&&n!==o&&n!==i;){const u=await l(n);for(let d of u){if(d===lb)return;if(d===void 0)continue;Buffer.isBuffer(d)?d=d.toString():d instanceof URL&&(d=XD(d));const p=ja(d)?d:ht(n,d);try{const m=await c(p);if(a==="file"&&m.isFile()||a==="directory"&&m.isDirectory())return p}catch{}}n=Ge(n)}},"findUp");var ZD=Object.defineProperty,eC=f((e,t)=>ZD(e,"name",{value:t,configurable:!0}),"u$12"),tC=Object.defineProperty,jb=eC((e,t)=>tC(e,"name",{value:t,configurable:!0}),"i");const rC=Ze(import.meta.url),ys=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xb=jb(e=>{if(typeof ys<"u"&&ys.versions&&ys.versions.node){const[t,r]=ys.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ys.getBuiltinModule(e)}return rC(e)},"__cjs_getBuiltinModule"),{statSync:nC,lstatSync:iC}=xb("node:fs"),{fileURLToPath:sC}=xb("node:url");var oC=Object.defineProperty,kh=jb((e,t)=>oC(e,"name",{value:t,configurable:!0}),"o");const vo=kh((e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=t.cwd?Bt(t.cwd):process.cwd();let n=ht(r);const{root:i}=mo(n),s=Bt(t.stopAt??i),o=ht(n,s),a=t.type??"file",l=kh(function(u){return typeof e=="function"?[e(u)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?nC:iC;for(;n&&n!==o&&n!==i;){for(let u of l(n)){if(u===lb)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=sC(u));const d=ja(u)?u:ht(n,u);try{const p=c(d);if(a==="file"&&p.isFile()||a==="directory"&&p.isDirectory())return d}catch{}}n=Ge(n)}},"findUpSync");var aC=Object.defineProperty,Pb=f((e,t)=>aC(e,"name",{value:t,configurable:!0}),"t$V"),cC=Object.defineProperty,xd=Pb((e,t)=>cC(e,"name",{value:t,configurable:!0}),"s");const lC=Ze(import.meta.url),vs=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,uC=xd(e=>{if(typeof vs<"u"&&vs.versions&&vs.versions.node){const[t,r]=vs.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return vs.getBuiltinModule(e)}return lC(e)},"__cjs_getBuiltinModule"),{access:pC}=uC("node:fs/promises");var dC=Object.defineProperty,fC=xd((e,t)=>dC(e,"name",{value:t,configurable:!0}),"o");async function Rr(e,t=Cp){fo(e),e=Bt(e);try{return await pC(e,t),!0}catch{return!1}}f(Rr,"i$13");Pb(Rr,"d");xd(Rr,"m");fC(Rr,"isAccessible");var mC=Object.defineProperty,hC=f((e,t)=>mC(e,"name",{value:t,configurable:!0}),"f$J"),gC=Object.defineProperty,Nb=hC((e,t)=>gC(e,"name",{value:t,configurable:!0}),"i");const yC=Ze(import.meta.url),bs=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rb=Nb(e=>{if(typeof bs<"u"&&bs.versions&&bs.versions.node){const[t,r]=bs.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return bs.getBuiltinModule(e)}return yC(e)},"__cjs_getBuiltinModule"),{readFile:vC}=Rb("node:fs/promises"),{unzip:bC,brotliDecompress:$C}=Rb("node:zlib");var wC=Object.defineProperty,Fb=Nb((e,t)=>wC(e,"name",{value:t,configurable:!0}),"n");const kC={brotli:$C,gzip:bC,none:Fb((e,t)=>{t(null,e)},"none")},Pd=Fb(async(e,t)=>{if(fo(e),e=Bt(e),!await Rr(e))throw new UE(`unable to read the non-accessible file: ${e}`);if(!await Rr(e,ub))throw new Error(`Unable to read the non-readable file: ${e}`);const{buffer:r,compression:n,encoding:i,flag:s}=t??{};return await vC(e,s?{encoding:i,flag:s}:{encoding:i}).then(async o=>await new Promise((a,l)=>{kC[n??"none"](o,(c,u)=>{c?l(c):a(r?u:u.toString())})})).catch(o=>{throw o})},"readFile");var SC=Object.defineProperty,Lb=f((e,t)=>SC(e,"name",{value:t,configurable:!0}),"t$U"),EC=Object.defineProperty,Ib=Lb((e,t)=>EC(e,"name",{value:t,configurable:!0}),"t"),DC=Object.defineProperty,CC=Ib((e,t)=>DC(e,"name",{value:t,configurable:!0}),"i");async function bo(e,t,r){typeof t=="object"&&(r=t,t=void 0);const n=await Pd(e,{buffer:!0,encoding:void 0});let i=new TextDecoder().decode(n);const{beforeParse:s,color:o}=r??{};return typeof s=="function"&&(i=s(i)),Cd(i,t,Bt(e),{color:o})}f(bo,"a$14");Lb(bo,"l");Ib(bo,"c");CC(bo,"readJson");var AC=Object.defineProperty,OC=f((e,t)=>AC(e,"name",{value:t,configurable:!0}),"a$13"),jC=Object.defineProperty,xC=OC((e,t)=>jC(e,"name",{value:t,configurable:!0}),"t"),PC=Object.defineProperty,NC=xC((e,t)=>PC(e,"name",{value:t,configurable:!0}),"t");const RC=NC(e=>{const t={force:!0,recursive:!0};return e?.maxRetries!==void 0&&(t.maxRetries=e.maxRetries),e?.retryDelay!==void 0&&(t.retryDelay=e.retryDelay),t},"buildRmOptions");var FC=Object.defineProperty,LC=f((e,t)=>FC(e,"name",{value:t,configurable:!0}),"i$11"),IC=Object.defineProperty,Tb=LC((e,t)=>IC(e,"name",{value:t,configurable:!0}),"s");const TC=Ze(import.meta.url),$s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,BC=Tb(e=>{if(typeof $s<"u"&&$s.versions&&$s.versions.node){const[t,r]=$s.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return $s.getBuiltinModule(e)}return TC(e)},"__cjs_getBuiltinModule"),{unlinkSync:_C,rmSync:MC}=BC("node:fs");var VC=Object.defineProperty,WC=Tb((e,t)=>VC(e,"name",{value:t,configurable:!0}),"o");const UC=WC((e,t={})=>{fo(e);try{_C(e)}catch{}try{MC(e,RC(t))}catch{}},"removeSync");var GC=Object.defineProperty,qC=f((e,t)=>GC(e,"name",{value:t,configurable:!0}),"m$K"),zC=Object.defineProperty,Bb=qC((e,t)=>zC(e,"name",{value:t,configurable:!0}),"s");const HC=Ze(import.meta.url),ws=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,JC=Bb(e=>{if(typeof ws<"u"&&ws.versions&&ws.versions.node){const[t,r]=ws.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ws.getBuiltinModule(e)}return HC(e)},"__cjs_getBuiltinModule"),{mkdir:KC,writeFile:YC,stat:XC,rename:Sh,chown:QC,chmod:ZC,unlink:eA}=JC("node:fs/promises");var tA=Object.defineProperty,rA=Bb((e,t)=>tA(e,"name",{value:t,configurable:!0}),"d");const nA=rA(async(e,t,r)=>{r={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},fo(e),GE(t),e=Bt(e);const n=`${e}.tmp`;try{const i=await Rr(e,Cp);if(!i&&r.recursive){const o=Ge(e);await Rr(o,Cp)||await KC(o,{recursive:!0})}let s;if(await YC(n,qE(t),{encoding:r.encoding,flag:r.flag}),i&&!r.overwrite&&(s=await XC(e),r.chown??={gid:s.gid,uid:s.uid},await Sh(e,`${e}.bak`)),r.chown)try{await QC(n,r.chown.uid,r.chown.gid)}catch{}await ZC(n,s&&!r.mode?s.mode:r.mode??438),await Sh(n,e)}catch(i){throw new Error(`Failed to write file at: ${e} - ${i.message}`,{cause:i})}finally{await Rr(n)&&await eA(`${e}.tmp`)}},"writeFile");var iA=Object.defineProperty,sA=f((e,t)=>iA(e,"name",{value:t,configurable:!0}),"a$11"),oA=Object.defineProperty,_b=sA((e,t)=>oA(e,"name",{value:t,configurable:!0}),"n");const aA=Ze(import.meta.url),ks=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cA=_b(e=>{if(typeof ks<"u"&&ks.versions&&ks.versions.node){const[t,r]=ks.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ks.getBuiltinModule(e)}return aA(e)},"__cjs_getBuiltinModule"),{readFile:lA}=cA("node:fs/promises");var uA=Object.defineProperty,pA=_b((e,t)=>uA(e,"name",{value:t,configurable:!0}),"r");const dA=pA(async(e,t,r={})=>{const{detectIndent:n,indent:i,replacer:s,stringify:o=JSON.stringify,...a}={indent:" ",...r};let l=i,c=`
|
|
4
|
+
`;if(await Rr(e,ub))try{const d=await lA(e,"utf8");if(n){const{indent:p}=zE(d);l=p}c=d.endsWith(`
|
|
5
|
+
`)?`
|
|
6
|
+
`:""}catch(d){if(d.code!=="ENOENT")throw d}const u=o(t,s,l);await nA(e,`${u}${c}`,a)},"writeJson"),fA=16,Eh=32,mA=64,gi=128,pa="positionals";var hA=Object.defineProperty,Mb=f((e,t)=>hA(e,"name",{value:t,configurable:!0}),"i$10"),gA=Object.defineProperty,Vb=Mb((e,t)=>gA(e,"name",{value:t,configurable:!0}),"s"),yA=Object.defineProperty,Wb=Vb((e,t)=>yA(e,"name",{value:t,configurable:!0}),"s"),vA=Object.defineProperty,Ub=Wb((e,t)=>vA(e,"name",{value:t,configurable:!0}),"i"),bA=Object.defineProperty,Gb=Ub((e,t)=>bA(e,"name",{value:t,configurable:!0}),"t");Gb(e=>e instanceof Error&&e.type==="VisulimaError","isVisulimaError");let $A=class extends Error{static{f(this,"V")}static{Mb(this,"g")}static{Vb(this,"p")}static{Wb(this,"V")}static{Ub(this,"VisulimaError")}static{Gb(this,"VisulimaError")}loc;title;hint;type="VisulimaError";constructor({cause:t,hint:r,location:n,message:i,name:s,stack:o,title:a}){super(i,{cause:t}),this.title=a,this.name=s,this.stack=o??this.stack,this.loc=n,this.hint=r}setLocation(t){this.loc=t}setName(t){this.name=t}setMessage(t){this.message=t}setHint(t){this.hint=t}};var wA=Object.defineProperty,qb=f((e,t)=>wA(e,"name",{value:t,configurable:!0}),"t$S"),kA=Object.defineProperty,zb=qb((e,t)=>kA(e,"name",{value:t,configurable:!0}),"t"),SA=Object.defineProperty,EA=zb((e,t)=>SA(e,"name",{value:t,configurable:!0}),"e");let ge=class extends $A{static{f(this,"m")}static{qb(this,"u")}static{zb(this,"c")}static{EA(this,"CerebroError")}code;context;constructor(t,r,n){super({message:t,name:"CerebroError"}),this.code=r,this.context=n}};var DA=Object.defineProperty,CA=f((e,t)=>DA(e,"name",{value:t,configurable:!0}),"a$Z"),AA=Object.defineProperty,OA=CA((e,t)=>AA(e,"name",{value:t,configurable:!0}),"l"),jA=Object.defineProperty,mt=OA((e,t)=>jA(e,"name",{value:t,configurable:!0}),"r");const hr=mt(e=>"Deno"in e,"hasDeno"),gr=mt(e=>"Bun"in e,"hasBun"),Pa=mt(()=>{if(hr(globalThis)){const e=globalThis.Deno,t=e.execPath();let r=t;try{const{importMeta:n}=globalThis;n?.url&&(r=n.url)}catch{}return[t,r,...e.args]}return gr(globalThis)?globalThis.Bun.process.argv:process.argv},"getArgv"),xA=mt(()=>hr(globalThis)?globalThis.Deno.cwd():gr(globalThis)?globalThis.Bun.process.cwd():process.cwd(),"getCwd"),$n=mt(()=>{if(hr(globalThis)){const e=globalThis.Deno;return new Proxy(e.env.toObject(),{get:mt((t,r)=>typeof r=="string"?e.env.get(r):t[r],"get"),has:mt((t,r)=>typeof r=="string"?e.env.has(r):r in t,"has"),set:mt((t,r,n)=>typeof r=="string"?(n===void 0||e.env.set(r,n),!0):!1,"set")})}return gr(globalThis)?globalThis.Bun.process.env:process.env},"getEnv"),Hb=mt(()=>hr(globalThis)?[]:gr(globalThis)?globalThis.Bun.process.execArgv:process.execArgv,"getExecArgv"),Jb=mt(()=>hr(globalThis)?globalThis.Deno.execPath():gr(globalThis)?globalThis.Bun.process.execPath:process.execPath,"getExecPath");mt(()=>{if(hr(globalThis)){const e=globalThis.Deno.build?.os??"unknown";return e==="windows"?"win32":e}return gr(globalThis)?globalThis.Bun.platform??"unknown":process.platform},"getPlatform");mt(()=>{if(hr(globalThis)){const e=globalThis.Deno.build?.arch??"unknown";return e==="x86_64"?"x64":e==="aarch64"?"arm64":e}return gr(globalThis)?globalThis.Bun.process.arch:process.arch},"getArch");mt(()=>{if(hr(globalThis)){const e=globalThis.Deno,t={};return e.version?.deno&&(t.deno=e.version.deno),e.version?.v8&&(t.v8=e.version.v8),e.version?.typescript&&(t.typescript=e.version.typescript),t}if(gr(globalThis)){const e=globalThis.Bun,t={...e.process.versions};return e.version&&(t.bun=e.version),t}return process.versions},"getVersions");const Qr=mt((e=0)=>{if(hr(globalThis))throw globalThis.Deno.exit(e),new Error("Deno exit failed");if(gr(globalThis))throw globalThis.Bun.process.exit(e),new Error("Bun exit failed");process.exit(e)},"exitProcess"),Dh=mt((e,t)=>{if(hr(globalThis))return()=>{};if(gr(globalThis)){try{const n=globalThis.Bun;if(n.process?.on)return n.process.on(e,t),()=>{n.process?.removeListener&&n.process.removeListener(e,t)}}catch{}return()=>{}}const r=process;return r.on(e,t),()=>{r.removeListener(e,t)}},"onProcessEvent");var PA=Object.defineProperty,nc=f((e,t)=>PA(e,"name",{value:t,configurable:!0}),"k$v");const jr=new Uint32Array(65536),NA=nc((e,t)=>{const r=e.length,n=t.length,i=1<<r-1;let s=-1,o=0,a=r,l=r;for(;l--;)jr[e.charCodeAt(l)]|=1<<l;for(l=0;l<n;l++){let c=jr[t.charCodeAt(l)];const u=c|o;c|=(c&s)+s^s,o|=~(c|s),s&=c,o&i&&a++,s&i&&a--,o=o<<1|1,s=s<<1|~(u|o),o&=u}for(l=r;l--;)jr[e.charCodeAt(l)]=0;return a},"myers_32"),RA=nc((e,t)=>{const r=t.length,n=e.length,i=[],s=[],o=Math.ceil(r/32),a=Math.ceil(n/32);for(let g=0;g<o;g++)s[g]=-1,i[g]=0;let l=0;for(;l<a-1;l++){let g=0,$=-1;const S=l*32,k=Math.min(32,n)+S;for(let v=S;v<k;v++)jr[e.charCodeAt(v)]|=1<<v;for(let v=0;v<r;v++){const h=jr[t.charCodeAt(v)],b=s[v/32|0]>>>v&1,w=i[v/32|0]>>>v&1,y=h|g,D=((h|w)&$)+$^$|h|w;let E=g|~(D|$),A=$&D;E>>>31^b&&(s[v/32|0]^=1<<v),A>>>31^w&&(i[v/32|0]^=1<<v),E=E<<1|b,A=A<<1|w,$=A|~(y|E),g=E&y}for(let v=S;v<k;v++)jr[e.charCodeAt(v)]=0}let c=0,u=-1;const d=l*32,p=Math.min(32,n-d)+d;for(let g=d;g<p;g++)jr[e.charCodeAt(g)]|=1<<g;let m=n;for(let g=0;g<r;g++){const $=jr[t.charCodeAt(g)],S=s[g/32|0]>>>g&1,k=i[g/32|0]>>>g&1,v=$|c,h=(($|k)&u)+u^u|$|k;let b=c|~(h|u),w=u&h;m+=b>>>n-1&1,m-=w>>>n-1&1,b>>>31^S&&(s[g/32|0]^=1<<g),w>>>31^k&&(i[g/32|0]^=1<<g),b=b<<1|S,w=w<<1|k,u=w|~(v|b),c=b&v}for(let g=d;g<p;g++)jr[e.charCodeAt(g)]=0;return m},"myers_x"),Kb=nc((e,t)=>{if(e.length<t.length){const r=t;t=e,e=r}return t.length===0?e.length:e.length<=32?NA(e,t):RA(e,t)},"distance");nc((e,t)=>{let r=1/0,n=0;for(let i=0;i<t.length;i++){const s=Kb(e,t[i]);s<r&&(r=s,n=i)}return t[n]},"closest");var FA=Object.defineProperty,LA=f((e,t)=>FA(e,"name",{value:t,configurable:!0}),"p$O"),IA=Object.defineProperty,Yb=LA((e,t)=>IA(e,"name",{value:t,configurable:!0}),"e"),TA=Object.defineProperty,BA=Yb((e,t)=>TA(e,"name",{value:t,configurable:!0}),"E");const Xb=String.raw,Ch=Xb`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,_A=BA(()=>new RegExp(Xb`\p{RI}{2}|(?)${Ch}(?:\u200D${Ch})*`,"gu"),"default");var MA=Object.defineProperty,VA=Yb((e,t)=>MA(e,"name",{value:t,configurable:!0}),"p");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const TQ=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,BQ=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ci=_A(),WA=/[-_./\s]+/g,Ks=/(\u001B\[[0-9;]*[a-z])/i,Ah=new RegExp("\\p{Script=Arabic}","u"),UA=new RegExp("\\p{Script=Bengali}","u"),pi=new RegExp("\\p{Script=Cyrillic}","u"),GA=new RegExp("\\p{Script=Devanagari}","u"),qA=new RegExp("\\p{Script=Ethiopic}","u"),Pl=new RegExp("\\p{Script=Greek}","u"),Oh=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),zA=new RegExp("\\p{Script=Gujarati}","u"),HA=new RegExp("\\p{Script=Gurmukhi}","u"),jh=new RegExp("\\p{Script=Hangul}","u"),xh=new RegExp("\\p{Script=Hebrew}","u"),JA=new RegExp("\\p{Script=Hiragana}","u"),Ph=new RegExp("\\p{Script=Han}","u"),KA=new RegExp("\\p{Script=Kannada}","u"),YA=new RegExp("\\p{Script=Katakana}","u"),XA=new RegExp("\\p{Script=Khmer}","u"),QA=new RegExp("\\p{Script=Lao}","u"),yt=new RegExp("\\p{Script=Latin}","u"),ZA=new RegExp("\\p{Script=Malayalam}","u"),e2=new RegExp("\\p{Script=Myanmar}","u"),t2=new RegExp("\\p{Script=Oriya}","u"),r2=new RegExp("\\p{Script=Sinhala}","u"),n2=new RegExp("\\p{Script=Tamil}","u"),i2=new RegExp("\\p{Script=Telugu}","u"),s2=new RegExp("\\p{Script=Thai}","u"),o2=new RegExp("\\p{Script=Tibetan}","u"),Nh=/[\u02BB\u02BC\u0027]/u,a2=VA(e=>e.replace(Ci,""),"stripEmoji");var c2=Object.defineProperty,Qb=f((e,t)=>c2(e,"name",{value:t,configurable:!0}),"i$Z"),l2=Object.defineProperty,Zb=Qb((e,t)=>l2(e,"name",{value:t,configurable:!0}),"r"),u2=Object.defineProperty,p2=Zb((e,t)=>u2(e,"name",{value:t,configurable:!0}),"c");let e0=class{static{f(this,"l")}static{Qb(this,"y")}static{Zb(this,"s")}static{p2(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(r=>r!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,r){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(n=>n!==t);else if(this.cache.size>=this.capacity){const n=this.keyOrder.shift();n!==void 0&&this.cache.delete(n)}this.cache.set(t,r),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(r=>r!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var d2=Object.defineProperty,f2=f((e,t)=>d2(e,"name",{value:t,configurable:!0}),"r$Y"),m2=Object.defineProperty,h2=f2((e,t)=>m2(e,"name",{value:t,configurable:!0}),"a"),g2=Object.defineProperty,y2=h2((e,t)=>g2(e,"name",{value:t,configurable:!0}),"s");const v2=y2((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleLowerCase(t.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");var b2=Object.defineProperty,$2=f((e,t)=>b2(e,"name",{value:t,configurable:!0}),"I$q"),w2=Object.defineProperty,ic=$2((e,t)=>w2(e,"name",{value:t,configurable:!0}),"W");const k2=Ze(import.meta.url),Ss=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S2=ic(e=>{if(typeof Ss<"u"&&Ss.versions&&Ss.versions.node){const[t,r]=Ss.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ss.getBuiltinModule(e)}return k2(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:E2}=S2("node:util");var D2=Object.defineProperty,C2=ic((e,t)=>D2(e,"name",{value:t,configurable:!0}),"g");const Nl=new e0(1e3),A2=/[.*+?^${}()|[\]\\]/g,O2=C2(e=>{const t=e.join("");if(Nl.has(t))return Nl.get(t);const r=e.map(i=>i.replaceAll(A2,String.raw`\$&`)).join("|"),n=new RegExp(r,"g");return Nl.set(t,n),n},"getSeparatorsRegex");var j2=Object.defineProperty,x2=ic((e,t)=>j2(e,"name",{value:t,configurable:!0}),"t");const P2=x2(e=>{const t=[];let r=0,n;for(Ci.lastIndex=0;(n=Ci.exec(e))!==null;)n.index>r&&t.push(e.slice(r,n.index)),t.push(n[0]),r=Ci.lastIndex;return r<e.length&&t.push(e.slice(r)),t.filter(Boolean)},"splitByEmoji");var N2=Object.defineProperty,Se=ic((e,t)=>N2(e,"name",{value:t,configurable:!0}),"u");const R2=/[ČŠŽĐ]/i,t0=new Uint8Array(128),r0=new Uint8Array(128),n0=new Uint8Array(128);for(let e=0;e<128;e++)t0[e]=e>=65&&e<=90?1:0,r0[e]=e>=97&&e<=122?1:0,n0[e]=e>=48&&e<=57?1:0;const Rl=Se(e=>t0[e],"isUpper"),Rh=Se(e=>r0[e],"isLower"),Fl=Se(e=>n0[e],"isDigit"),qr=Se((e,t,r,n,i)=>{if(e.length===0)return[];let s=!1;const o=Object.values(t);for(const m of o)if(m(e[0])){s=!0;break}if(!s&&!r)return[e];const a=[...e],l=[];let c=a[0],u="other";const d=Object.entries(t);for(const m of d){const[g,$]=m;if($(a[0])){u=g;break}}let p=r&&n?a[0]===a[0].toLocaleUpperCase(n):!1;for(let m=1;m<a.length;m++){const g=a[m];let $="other";for(const v of d){const[h,b]=v;if(b(g)){$=h;break}}const S=r&&n?g===g.toLocaleUpperCase(n):!1;let k=!1;i?k=i(u,$,p,S,g,m,a):(u!==$&&u!=="other"&&$!=="other"&&(k=!0),r&&$!=="other"&&!p&&S&&(k=!0)),k?(l.push(c),c=g):c+=g,u=$,r&&(p=S)}return c&&c.length>0&&l.push(c),l.length>0?l:[e]},"handleScriptTransitions"),F2=Se((e,t,r,n)=>{if(r.size===0)return t;for(const i of r)if(e.startsWith(i,t))return n.push(i),t+i.length;return t},"detectAndProcessAcronym"),i0=Se((e,t=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let r=0;const n=[],i=e.length;for(let s=1;s<i;s++){const o=F2(e,r,t,n);if(o!==r){r=o,s=r-1;continue}const a=e.codePointAt(s-1),l=e.codePointAt(s),c=a&&a<128&&Rl(a),u=l&&l<128&&Rl(l),d=a&&a<128&&Rh(a),p=a&&a<128&&Fl(a),m=l&&l<128&&Fl(l);if(d&&u){n.push(e.slice(r,s)),r=s;continue}if(p&&!m||!p&&m){n.push(e.slice(r,s)),r=s;continue}if(m&&!p){let g=!1,$=!1;if(s+1<i){const S=e.codePointAt(s+1);g=S&&S<128&&Rl(S),$=S&&S<128&&Fl(S)}if(!$&&g){n.push(e.slice(r,s),e.slice(s,s+1)),r=s+1;continue}}if(s+1<i){const g=e.codePointAt(s+1),$=g&&g<128&&Rh(g);if(c&&u&&$){const S=e.slice(r,s+1);t.has(S)||(n.push(e.slice(r,s)),r=s)}}}return r<i&&n.push(e.slice(r)),n.filter(s=>s!=="")},"splitCamelCaseFast"),s0=Se((e,t,r)=>{if(e.length===0)return[];const n=e===e.toLocaleUpperCase(t);if(t.startsWith("de")){if(!n&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(t))return[e];const c=[...e],u=c.length,d=[];let p=c[0],m=c[0]===c[0].toLocaleUpperCase(t),g=m,$=m?0:-1;for(let S=1;S<u;S++){const k=c[S],v=k===k.toLocaleUpperCase(t);if(v===m)p+=k;else if(v)p&&p.length>0&&(d.push(p),p=k),g=!0,$=S;else{if(g&&S-$>1){const h=c[S-1],b=p.slice(0,-1);b&&b.length>0&&d.push(b),p=h+k}else p+=k;g=!1,$=-1}m=v}return p&&p.length>0&&d.push(p),d}if(t.startsWith("uk")||t.startsWith("ru")||t.startsWith("bg")||t.startsWith("sr")||t.startsWith("mk")||t.startsWith("be")){if(!pi.test(e)&&!yt.test(e))return[e];const c=[...e],u=c.length,d=[];let p=c[0];const m=c[0];let g;pi.test(m)?g=1:yt.test(m)?g=2:g=0;let $=m===m.toLocaleUpperCase(t);for(let k=1;k<u;k++){const v=c[k];let h;pi.test(v)?h=1:yt.test(v)?h=2:h=0;const b=v===v.toLocaleUpperCase(t);g!==h&&(g===1||g===2)&&(h===1||h===2)||h===g&&!$&&b?(d.push(p),p=v):p+=v,g=h,$=b}p&&p.length>0&&d.push(p);const S=[];for(let k=0;k<d.length;k++)k<d.length-1&&d[k].length===1&&yt.test(d[k])&&pi.test(d[k+1][0])?(S.push(d[k]+d[k+1]),k+=1):S.push(d[k]);return S}if(t.startsWith("el")){if(!Pl.test(e)&&!yt.test(e))return[e];const c=[];Oh.lastIndex=0;let u;for(;(u=Oh.exec(e))!==null;)c.push(u[0]);c.length===0&&c.push(e);const d=[];if(c.length===1){const p=c[0];if(!p||!Pl.test(p[0])||p.length===1)return[p??e]}for(const p of c){if(!p)continue;if(!Pl.test(p[0])||p.length===1){d.push(p);continue}const m=p.length;let g=p[0],$=p[0]===p[0].toLocaleUpperCase(t);for(let S=1;S<m;S++){const k=p[S],v=k===k.toLocaleUpperCase(t);!$&&v?(d.push(g),g=k):g+=k,$=v}g&&d.push(g)}return d}if(t.startsWith("ja")||t.startsWith("ko")){const c=t.startsWith("ja"),u=c?{hiragana:Se(p=>JA.test(p),"hiragana"),kanji:Se(p=>Ph.test(p),"kanji"),katakana:Se(p=>YA.test(p),"katakana"),latin:Se(p=>yt.test(p),"latin")}:{hangul:Se(p=>jh.test(p),"hangul"),latin:Se(p=>yt.test(p),"latin")},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(c){const p=qr(e,u,!1,t,(g,$)=>g==="hiragana"&&$==="katakana"||g==="katakana"&&$==="hiragana"||g==="hiragana"&&$==="latin"||g==="katakana"&&$==="latin"||g==="kanji"&&$==="latin"||g==="latin"&&($==="hiragana"||$==="katakana"||$==="kanji")),m=[];for(const g of p){const $=g;$.length===1&&d.has($)&&m.length>0?m[m.length-1]=m.at(-1)+$:m.push($)}return m.length>0?m:[e]}return qr(e,u,!1,t,(p,m)=>p==="hangul"&&m==="latin"||p==="latin"&&m==="hangul")}if(t.startsWith("sl")){const c=[...e],u=c.length,d=[];let p=c[0],m=c[0]===c[0].toLocaleUpperCase(t);for(let g=1;g<u;g++){const $=c[g],S=$===$.toLocaleUpperCase(t),k=R2.test($),v=g<u-1&&c[g+1]===c[g+1].toLocaleUpperCase(t);!m&&S||k&&v?(d.push(p),p=$,k&&v&&(d.push(p),p="")):p+=$,m=S}return p&&p.length>0&&d.push(p),d}if(t.startsWith("zh"))return qr(e,{han:Se(c=>Ph.test(c),"han"),latin:Se(c=>yt.test(c),"latin")},!1,t);if(["ar","fa","he","ur"].includes(t.split("-")[0])){const c=Se(u=>xh.test(u)||Ah.test(u),"isRtlChar");return qr(e,{latin:Se(u=>yt.test(u),"latin"),rtl:Se(u=>c(u),"rtl")},!1,t)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(t.split("-")[0])){const c=Se(u=>GA.test(u)||UA.test(u)||zA.test(u)||HA.test(u)||KA.test(u)||n2.test(u)||i2.test(u)||ZA.test(u)||r2.test(u)||s2.test(u)||QA.test(u)||o2.test(u)||e2.test(u)||qA.test(u)||XA.test(u)||t2.test(u),"isIndicChar");return qr(e,{indic:Se(u=>c(u),"indic"),latin:Se(u=>yt.test(u),"latin")},!1,t)}if(["be","bg","ru","sr","uk"].includes(t))return qr(e,{cyrillic:Se(c=>pi.test(c),"cyrillic"),latin:Se(c=>yt.test(c),"latin")},!0,t);if(["ar","fa","he"].includes(t))return qr(e,{latin:Se(c=>yt.test(c),"latin"),rtl:Se(c=>xh.test(c)||Ah.test(c),"rtl")},!1,t);if(t.startsWith("ko"))return qr(e,{hangul:Se(c=>jh.test(c),"hangul"),latin:Se(c=>yt.test(c),"latin")},!1,t);if(t.startsWith("uz")){if(!pi.test(e)&&!yt.test(e))return[e];const c=[...e],u=c.length,d=[];let p=c[0],m=c[0]===c[0].toLocaleUpperCase(t);for(let g=1;g<u;g++){const $=c[g],S=$===$.toLocaleUpperCase(t);if(Nh.test($)||Nh.test(c[g-1])){p+=$;continue}!m&&S?(d.push(p),p=$):p+=$,m=S}return p&&p.length>0&&d.push(p),d}const i=[...e],s=i.length,o=[];let a=i[0],l=i[0]===i[0].toLocaleUpperCase(t);for(const c of r)if(e.startsWith(c)){o.push(c),a=i[c.length],l=a===a.toLocaleUpperCase(t);break}for(let c=1;c<s;c++){const u=i[c],d=u===u.toLocaleUpperCase(t);let p=0;for(const m of r)if(e.startsWith(m,c)){o.push(a,m),p=m.length,a="";const g=m.at(-1);g&&(l=g===g.toLocaleUpperCase(t));break}if(p>0){c+=p-1;continue}!l&&d?(o.push(a),a=u):a+=u,l=d}return a&&o.push(a),o},"splitCamelCaseLocale"),L2=Se((e,t,r)=>{const n=[],i=Ks.test(e)?e.split(Ks).filter(Boolean):[e];for(const s of i){const o=s;if(Ks.test(o))n.push(o);else{const a=Ci.test(o)?P2(o).filter(Boolean):[o];for(const l of a)if(Ci.test(l))n.push(l);else if(t){const c=t.toLowerCase().split("-")[0];n.push(...s0(l,c,r))}else n.push(...i0(l,r))}}return n},"processTextWithAnsiEmoji"),I2=Se((e,t={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:r=!1,handleEmoji:n=!1,knownAcronyms:i=[],locale:s,normalize:o=!1,separators:a,stripAnsi:l=!1,stripEmoji:c=!1}=t,u=new Set([...i].toSorted((k,v)=>v.length-k.length));let d=e;l&&(d=E2(d)),c&&(d=a2(d));let p;Array.isArray(a)?p=O2(a):a instanceof RegExp?p=a:p=WA;const m=[];let g=d;const $=p.flags.includes("g")?p:new RegExp(p.source,`${p.flags}g`);for(;g.length>0;){const k=$.exec(g);if(!k){g===".."?m.push(".."):g==="."?m.push("."):g.length>0&&m.push(g);break}const v=k.index,h=k[0],b=h.length,w=g.slice(0,v),y=g.slice(v+b);if(h.startsWith("../"))m.push(".."),g=g.slice(v+3);else if(h.startsWith("./"))m.push("."),g=g.slice(v+2);else if(v===0&&h==="..")m.push(".."),g=g.slice(2);else if(v===0&&h===".")m.push("."),g=g.slice(1);else{w.length>0&&m.push(w);let D=0;for(;(D=h.indexOf("../",D))!==-1;)m.push(".."),D+=3;for(D=0;(D=h.indexOf("./",D))!==-1;)(D===0||h[D-1]!==".")&&m.push("."),D+=2;let E=y;for(;E.startsWith("../");)m.push(".."),E=E.slice(3);for(;E.startsWith("./");)m.push("."),E=E.slice(2);if(E===".."){m.push("..");break}else if(E==="."){m.push(".");break}else g=E}$.lastIndex=0}if(m.length===0){const k=d.split(p).filter(Boolean);m.push(...k)}let S=[];for(const k of m)r||n?S.push(...L2(k,s,u)):s?S.push(...s0(k,s,u)):S.push(...i0(k,u));return o&&(S=S.map(k=>u.has(k)?k:s&&k===k.toLocaleUpperCase(s)?k[0]+k.slice(1).toLocaleLowerCase(s):k.toUpperCase()===k&&!u.has(k)?k.slice(0,1)+k.slice(1).toLowerCase():k)),S},"splitByCase");var T2=Object.defineProperty,B2=f((e,t)=>T2(e,"name",{value:t,configurable:!0}),"r$X"),_2=Object.defineProperty,M2=B2((e,t)=>_2(e,"name",{value:t,configurable:!0}),"o"),V2=Object.defineProperty,W2=M2((e,t)=>V2(e,"name",{value:t,configurable:!0}),"s");const U2=W2((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");var G2=Object.defineProperty,q2=f((e,t)=>G2(e,"name",{value:t,configurable:!0}),"r$W"),z2=Object.defineProperty,H2=q2((e,t)=>z2(e,"name",{value:t,configurable:!0}),"r"),J2=Object.defineProperty,K2=H2((e,t)=>J2(e,"name",{value:t,configurable:!0}),"n");const Y2=K2((e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,"generateCacheKey");var X2=Object.defineProperty,Q2=f((e,t)=>X2(e,"name",{value:t,configurable:!0}),"i$X"),Z2=Object.defineProperty,eO=Q2((e,t)=>Z2(e,"name",{value:t,configurable:!0}),"f"),tO=Object.defineProperty,rO=eO((e,t)=>tO(e,"name",{value:t,configurable:!0}),"l");const nO=rO((e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let i="",s="";for(let o=0;o<r;o++){const a=e[o];if(Ks.test(a)){i?(n.push(i+s+a),i="",s=""):(n.length>0&&n.push(t),i=a);continue}i?(s&&(s+=t),s+=a):(n.length>0&&n.push(t),n.push(a))}return n.join("")},"joinSegments");var iO=Object.defineProperty,sO=f((e,t)=>iO(e,"name",{value:t,configurable:!0}),"r$V"),oO=Object.defineProperty,aO=sO((e,t)=>oO(e,"name",{value:t,configurable:!0}),"a"),cO=Object.defineProperty,lO=aO((e,t)=>cO(e,"name",{value:t,configurable:!0}),"e");const uO=/(?<![a-zß])SS(?![a-z])/g,pO=lO(e=>e.replaceAll(uO,"ß"),"normalizeGermanEszett");var dO=Object.defineProperty,fO=f((e,t)=>dO(e,"name",{value:t,configurable:!0}),"c$Q"),mO=Object.defineProperty,hO=fO((e,t)=>mO(e,"name",{value:t,configurable:!0}),"c"),gO=Object.defineProperty,yO=hO((e,t)=>gO(e,"name",{value:t,configurable:!0}),"o");const vO=new e0(1e3),o0=yO((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??vO;let i;if(r&&(i=Y2(e,t)),r&&i&&n.has(i))return n.get(i);let s=!0;const o=nO(I2(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(a=>{if(t?.handleAnsi&&Ks.test(a))return a;const l=t?.locale?.startsWith("de")?pO(a):a,c=t?.locale?l.toLocaleLowerCase(t.locale):l.toLowerCase();return s?(s=!1,v2(c,t)):U2(c,t)}),"");return r&&i&&n.set(i,o),o},"camelCase");var bO=Object.defineProperty,gt=f((e,t)=>bO(e,"name",{value:t,configurable:!0}),"_$o"),$O=Object.defineProperty,re=gt((e,t)=>$O(e,"name",{value:t,configurable:!0}),"h");const Ko=[{description:"Turn on verbose output",group:"global",name:"verbose",type:Boolean},{description:"Turn on debugging output",group:"global",name:"debug",type:Boolean},{alias:"h",description:"Print out helpful usage information",group:"global",name:"help",type:Boolean},{alias:"q",description:"Silence output",group:"global",name:"quiet",type:Boolean},{alias:"V",description:"Print version info",group:"global",name:"version",type:Boolean},{description:"Turn off colored output",group:"global",name:"no-color",type:Boolean},{description:"Force colored output",group:"global",name:"color",type:Boolean}];var wO=Object.defineProperty,kO=re((e,t)=>wO(e,"name",{value:t,configurable:!0}),"t$5");let di=class extends ge{static{f(this,"S")}static{gt(this,"T")}static{re(this,"a")}static{kO(this,"CommandNotFoundError")}commandName;constructor(t,r=[]){const n=`Command "${t}" not found${r.length>0?`. Did you mean: ${r.join(", ")}?`:""}`;super(n,"COMMAND_NOT_FOUND",{commandName:t,suggestions:r}),this.name="CommandNotFoundError",this.commandName=t,r.length>0&&(this.hint=`Try one of these commands: ${r.join(", ")}`)}};var SO=Object.defineProperty,EO=re((e,t)=>SO(e,"name",{value:t,configurable:!0}),"e$7");let a0=class extends ge{static{f(this,"De")}static{gt(this,"Te")}static{re(this,"o")}static{EO(this,"ConflictingOptionsError")}option1;option2;constructor(t,r){super(`Options "${t}" and "${r}" cannot be used together`,"CONFLICTING_OPTIONS",{option1:t,option2:r}),this.name="ConflictingOptionsError",this.option1=t,this.option2=r,this.hint=`Remove either --${t} or --${r}`}};var DO=Object.defineProperty,CO=re((e,t)=>DO(e,"name",{value:t,configurable:!0}),"e$6");let AO=class extends ge{static{f(this,"At")}static{gt(this,"Ot")}static{re(this,"o")}static{CO(this,"PluginError")}pluginName;constructor(t,r,n){super(`Plugin "${t}" error: ${r}`,"PLUGIN_ERROR",{originalError:n,pluginName:t}),this.name="PluginError",this.pluginName=t,n&&(this.cause=n)}};var OO=Object.defineProperty,Fh=re((e,t)=>OO(e,"name",{value:t,configurable:!0}),"d$4");let jO=class{static{f(this,"$t")}static{gt(this,"At")}static{re(this,"p")}static{Fh(this,"PluginManager")}logger;plugins=new Map;initialized=!1;cachedDependencyOrder=void 0;constructor(t){this.logger=t}hasPlugins(){return this.plugins.size>0}register(t){if(this.initialized)throw new Error(`Cannot register plugin "${t.name}" after initialization`);if(this.plugins.has(t.name))throw new Error(`Plugin "${t.name}" is already registered`);$n().CEREBRO_OUTPUT_LEVEL===String(gi)&&this.logger.debug(`registering plugin: ${t.name}`),this.plugins.set(t.name,t),this.cachedDependencyOrder=void 0}async init(t){if(this.initialized)throw new Error("PluginManager already initialized");if(this.plugins.size===0){this.logger.debug("no plugins registered, skipping initialization"),this.initialized=!0;return}this.validateDependencies();const r=this.getDependencyOrder();this.logger.debug(`initializing ${String(r.length)} plugin(s)...`);for(const n of r)if(typeof n.init=="function"){this.logger.debug(`initializing plugin: ${n.name}`);try{await n.init(t)}catch(i){const s=new AO(n.name,`Failed to initialize: ${i instanceof Error?i.message:String(i)}`,i instanceof Error?i:void 0);throw this.logger.error(s.message),s}}this.initialized=!0}async executeLifecycle(t,r,n){if(!this.initialized)throw new Error("PluginManager not initialized");if(this.plugins.size===0)return;const i=this.getDependencyOrder();for(const s of i){const o=s[t];if(typeof o=="function"){this.logger.debug(`executing ${t} hook for plugin: ${s.name}`);try{await(t==="afterCommand"?o(r,n):o(r))}catch(a){throw this.logger.error(`Error in ${t} hook for plugin "${s.name}":`,a),a}}}}async executeErrorHandlers(t,r){if(!this.initialized||this.plugins.size===0)return;const n=this.getDependencyOrder();for(const i of n)if(typeof i.onError=="function"){this.logger.debug(`executing error handler for plugin: ${i.name}`);try{await i.onError(t,r)}catch(s){this.logger.error(`Error in error handler for plugin "${i.name}":`,s)}}}getDependencyOrder(){if(this.cachedDependencyOrder!==void 0)return this.cachedDependencyOrder;const t=[],r=new Set,n=new Set,i=Fh(s=>{if(r.has(s))return;if(n.has(s))throw new Error(`Circular dependency detected involving plugin "${s}"`);const o=this.plugins.get(s);if(!o)throw new Error(`Plugin "${s}" not found`);if(n.add(s),o.dependencies)for(const a of o.dependencies)i(a);n.delete(s),r.add(s),t.push(o)},"visit");for(const s of this.plugins.keys())i(s);return this.cachedDependencyOrder=t,t}validateDependencies(){for(const t of this.plugins.values())if(t.dependencies){for(const r of t.dependencies)if(!this.plugins.has(r))throw new Error(`Plugin "${t.name}" depends on "${r}" which is not registered`)}}};var xO=Object.defineProperty,PO=re((e,t)=>xO(e,"name",{value:t,configurable:!0}),"n$8");const to=PO(e=>e.type?.name==="Boolean","optionIsBoolean");var NO=Object.defineProperty,c0=re((e,t)=>NO(e,"name",{value:t,configurable:!0}),"p$6");const RO=c0(e=>{let t=e.type?e.type.name.toLowerCase():"string";const r=e.multiple??e.lazyMultiple?"[]":"";return t&&(t=t==="boolean"?"":`{underline ${t}${r}}`),t},"getTypeLabel"),Lh=c0(e=>(to(e)||(e.typeLabel=e.typeLabel??RO(e),e.defaultOption&&(e.typeLabel=`${e.typeLabel} (D)`),e.required&&(e.typeLabel=`${e.typeLabel} (R)`)),e),"mapOptionTypeLabel");var FO=Object.defineProperty,l0=re((e,t)=>FO(e,"name",{value:t,configurable:!0}),"e$4");const LO=new RegExp(/^-([^\d-])$/),IO=new RegExp(/^--(\S+)/),TO=new RegExp(/^-([^\d-]{2,})$/),BO=l0(e=>LO.test(e)||IO.test(e)||TO.test(e),"isOption"),_O=l0((e,t)=>{const r=t[0]&&BO(t[0])||t.length===0?null:t.shift()??null;if(!e.includes(r)){const n=new Error(`Command not recognised: ${String(r)}`);throw n.command=r,n.name="INVALID_COMMAND",n}return{argv:t,command:r}},"commandLineCommands");var MO=Object.defineProperty,u0=re((e,t)=>MO(e,"name",{value:t,configurable:!0}),"i$7"),VO=Object.defineProperty,p0=u0((e,t)=>VO(e,"name",{value:t,configurable:!0}),"i"),WO=Object.defineProperty,d0=p0((e,t)=>WO(e,"name",{value:t,configurable:!0}),"s"),UO=Object.defineProperty,f0=d0((e,t)=>UO(e,"name",{value:t,configurable:!0}),"i"),GO=Object.defineProperty,m0=f0((e,t)=>GO(e,"name",{value:t,configurable:!0}),"t");m0(e=>e instanceof Error&&e.type==="VisulimaError","isVisulimaError");let sc=class extends Error{static{f(this,"te")}static{gt(this,"ee")}static{re(this,"v")}static{u0(this,"g")}static{p0(this,"p")}static{d0(this,"V")}static{f0(this,"VisulimaError")}static{m0(this,"VisulimaError")}loc;title;hint;type="VisulimaError";constructor({cause:t,hint:r,location:n,message:i,name:s,stack:o,title:a}){super(i,{cause:t}),this.title=a,this.name=s,this.stack=o??this.stack,this.loc=n,this.hint=r}setLocation(t){this.loc=t}setName(t){this.name=t}setMessage(t){this.message=t}setHint(t){this.hint=t}};var qO=Object.defineProperty,h0=re((e,t)=>qO(e,"name",{value:t,configurable:!0}),"o$7"),zO=Object.defineProperty,g0=h0((e,t)=>zO(e,"name",{value:t,configurable:!0}),"o"),HO=Object.defineProperty,JO=g0((e,t)=>HO(e,"name",{value:t,configurable:!0}),"i");let KO=class y0 extends sc{static{f(this,"He")}static{gt(this,"He")}static{re(this,"a")}static{h0(this,"a")}static{g0(this,"t")}static{JO(this,"AlreadySetError")}optionName;constructor(t){super({cause:void 0,hint:`Remove the duplicate option '${t}' from your command line arguments.`,location:void 0,message:`Option '${t}' is already set`,name:"ALREADY_SET",stack:void 0,title:"Option Already Set"}),this.optionName=t,Object.setPrototypeOf(this,y0.prototype)}};var YO=Object.defineProperty,v0=re((e,t)=>YO(e,"name",{value:t,configurable:!0}),"t$3"),XO=Object.defineProperty,b0=v0((e,t)=>XO(e,"name",{value:t,configurable:!0}),"e"),QO=Object.defineProperty,ZO=b0((e,t)=>QO(e,"name",{value:t,configurable:!0}),"e");let Ih=class $0 extends sc{static{f(this,"Je")}static{gt(this,"Je")}static{re(this,"n")}static{v0(this,"n")}static{b0(this,"o")}static{ZO(this,"UnknownOptionError")}optionName;constructor(t){super({cause:void 0,hint:`Check your option definitions or remove the unknown option '${t}' from your command line arguments.`,location:void 0,message:`Unknown option: --${t}`,name:"UNKNOWN_OPTION",stack:void 0,title:"Unknown Option"}),this.optionName=`--${t}`,Object.setPrototypeOf(this,$0.prototype)}};var ej=Object.defineProperty,w0=re((e,t)=>ej(e,"name",{value:t,configurable:!0}),"a$9"),tj=Object.defineProperty,k0=w0((e,t)=>tj(e,"name",{value:t,configurable:!0}),"a"),rj=Object.defineProperty,nj=k0((e,t)=>rj(e,"name",{value:t,configurable:!0}),"o");let ij=class S0 extends sc{static{f(this,"Xe")}static{gt(this,"Xe")}static{re(this,"n")}static{w0(this,"o")}static{k0(this,"e")}static{nj(this,"UnknownValueError")}value;constructor(t){super({hint:"Use a defined option or add a defaultOption to capture this value.",message:`Unknown value: ${t}`,name:"UNKNOWN_VALUE",title:"Unknown Value"}),this.value=t,Object.setPrototypeOf(this,S0.prototype)}};var sj=Object.defineProperty,E0=re((e,t)=>sj(e,"name",{value:t,configurable:!0}),"i$4"),oj=Object.defineProperty,D0=E0((e,t)=>oj(e,"name",{value:t,configurable:!0}),"i"),aj=Object.defineProperty,cj=D0((e,t)=>aj(e,"name",{value:t,configurable:!0}),"i");let vt=class C0 extends sc{static{f(this,"nt")}static{gt(this,"nt")}static{re(this,"a")}static{E0(this,"o")}static{D0(this,"e")}static{cj(this,"InvalidDefinitionsError")}constructor(t,r){super({cause:void 0,hint:r,location:void 0,message:t,name:"INVALID_DEFINITIONS",stack:void 0,title:"Invalid Option Definition"}),Object.setPrototypeOf(this,C0.prototype)}};var lj=Object.defineProperty,uj=re((e,t)=>lj(e,"name",{value:t,configurable:!0}),"z"),pj=Object.defineProperty,Wi=uj((e,t)=>pj(e,"name",{value:t,configurable:!0}),"S"),dj=Object.defineProperty,oc=Wi((e,t)=>dj(e,"name",{value:t,configurable:!0}),"o");const Th=oc(e=>e===Boolean||typeof e=="function"&&e.name.startsWith("Boolean"),"isBooleanType"),Bh=oc(e=>e===Number||typeof e=="function"&&e.name==="Number","isNumberType"),_h=oc(e=>e===String||typeof e=="function"&&e.name==="String","isStringType"),fj=oc((e,t)=>Array.isArray(e)?Th(t)?e.map(Boolean):Bh(t)?e.map(Number):_h(t)?e.map(String):e.map(r=>t(String(r))):e===null?null:Th(t)?!!e:Bh(t)?Number(e):_h(t)?typeof e=="string"?e:String(e):t(typeof e=="string"?e:String(e)),"convertValue");var mj=Object.defineProperty,hj=Wi((e,t)=>mj(e,"name",{value:t,configurable:!0}),"e");const Qe=hj((e,t,r,...n)=>{e&&console.debug(`[command-line-args:${r}] ${t}`,...n)},"debug");var gj=Object.defineProperty,Hn=Wi((e,t)=>gj(e,"name",{value:t,configurable:!0}),"h$1");const yj=/-([a-z])/g,vj=/^\d+$/,Ll=Hn(e=>e===Boolean||typeof e=="function"&&e.name.startsWith("Boolean"),"isBooleanType"),bj=Hn(e=>e.codePointAt(0)===95,"isSpecialKey"),Mh=Hn((e,t)=>Array.isArray(e)?[...e,...t]:[e,...t],"appendToArrayMultiple"),Vh=Hn(e=>e==="__proto__"||e==="constructor"||e==="prototype","isUnsafeKey"),Wh=Hn((e,t,r,n=!1)=>{e[t]===void 0?e[t]=n?[r]:r:n&&Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]},"createOrAppendArray"),$j=Hn((e,t,r,n,i)=>{let s=t.get(e)??r.get(e);if(!s&&n){const o=e.toLowerCase();s=n.get(o)??i?.get(o)}return s},"getDefinition"),wj=Hn((e,t,r,n)=>{const i=r.debug??!1;Qe(i,"resolveArgs called with options:","resolver",{partial:r.partial,stopAtFirstUnknown:r.stopAtFirstUnknown}),Qe(i,"Starting argument resolution","resolver"),Qe(i,"Tokens:","resolver",e),Qe(i,"Definitions:","resolver",t),Qe(i,"Processing tokens...","resolver");const s=new Map,o=new Map,a=r.caseInsensitive?new Map:void 0,l=r.caseInsensitive?new Map:void 0,c=r.camelCase?new Map:void 0,u=r.camelCase?new Map:void 0;for(const b of t)if(s.set(b.name,b),b.alias&&o.set(b.alias,b),r.caseInsensitive&&a&&(a.set(b.name.toLowerCase(),b),b.alias&&l&&l.set(b.alias.toLowerCase(),b)),r.camelCase&&c&&u){const w=b.name.replaceAll(yj,(y,D)=>D.toUpperCase());c.set(b.name,w),u.set(w,b.name)}const d={},p={},m=[],g=new Set;let $=!1;const S=t.find(b=>b.defaultOption),k=t.some(b=>b.group),v=t.some(b=>b.type===Number);for(let b=0;b<e.length;b++){const w=e[b];if(w.kind==="option-terminator"){d._unknown=n.slice(w.index),$=!0;break}if(w.kind==="option"&&w.name){let y=$j(w.name,s,o,a,l);if(!y&&w.value===void 0&&v&&vj.test(w.name)){const j=t.find(G=>G.type===Number);j&&(y=j,w.value=w.name,w.name=j.name)}const D=y?y.name:w.name,E=y?.multiple,A=y?.lazyMultiple;if(p[D]!==void 0&&!E&&!A&&!r.partial)throw new KO(D);if(!y&&r.partial){const j=w.rawName??`--${w.name}${w.value!==void 0&&w.inlineValue?`=${w.value}`:""}`;m.push({index:w.index,value:j});continue}if(!y&&r.stopAtFirstUnknown){d._unknown=n.slice(w.index);break}if(!y&&!r.partial)throw new Ih(w.name);if(w.value===void 0){const j=e[b+1],G=j?.kind==="option"&&!("name"in j)&&j.value!==void 0,W=j&&y&&!(y.type&&Ll(y.type))&&(j.kind==="positional"||G),ce=y&&y.defaultOption&&!y.multiple&&!y.lazyMultiple;if(W&&(!y?.defaultOption||ce))if(E){let te=b+1;const Y=[];for(;te<e.length&&(e[te].kind==="positional"||e[te].kind==="option"&&!("name"in e[te])&&e[te].value!==void 0);)Y.push(e[te].value),g.add(e[te].index),te++;p[D]=p[D]===void 0?Y:Mh(p[D],Y),b=te-1}else A?(Wh(p,D,j.value,!0),g.add(j.index),b++):(p[D]=j.value,g.add(j.index),b++);else y?.type&&Ll(y.type)?Wh(p,D,!0,E):p[D]=E?[]:null}else{let{value:j}=w;if(y?.type&&Ll(y.type))switch(j){case"":{if(r.partial)p._unknown??=[],p._unknown.push(`${w.rawName??`--${w.name}`}${w.value?`=${w.value}`:""}`),j=!0;else throw new Ih(w.name);break}case"false":{j=!1;break}case"true":{j=!0;break}default:j=!0}const G=[j];if(E){let W=b+1;for(;W<e.length&&e[W].kind==="positional";)G.push(e[W].value),g.add(e[W].index),W++;b=W-1}p[D]===void 0?p[D]=E||A?G:j:E||A?p[D]=Mh(p[D],G):p[D]=j}}else if(w.kind==="positional"&&r.stopAtFirstUnknown&&!g.has(w.index)&&!S){Qe(i,`Found unconsumed positional token at index ${String(w.index)}, stopping processing`,"resolver"),d._unknown=n.slice(w.index);break}}for(const[b,w]of Object.entries(p)){const y=s.get(b);y&&(y.multiple||y.lazyMultiple)&&!Array.isArray(w)&&(p[b]=[w])}let h=Number.POSITIVE_INFINITY;if(r.stopAtFirstUnknown&&!$){for(const b of e)if(b.kind==="option"&&!s.has(b.name??"")&&!o.has(b.name??"")&&(!r.caseInsensitive||!a?.has(b.name?.toLowerCase()??"")&&!l?.has(b.name?.toLowerCase()??""))){h=b.index;break}}if(S){const b=[],w=[];for(const y of e)y.kind==="positional"&&!g.has(y.index)&&y.index<h&&(b.push(y.value),w.push(y));if(b.length>0){const y=p[S.name],D=S.multiple??S.lazyMultiple;y===void 0?D?(w.forEach(E=>g.add(E.index)),p[S.name]=b):(g.add(w[0].index),p[S.name]=b[0]):D&&(w.forEach(E=>g.add(E.index)),p[S.name]=Array.isArray(y)?[...b,...y]:[...b,y])}}if(!r.partial){for(const b of e)if(b.kind==="positional"&&!g.has(b.index))throw new ij(n[b.index])}if(r.partial&&!r.stopAtFirstUnknown){const b=[...m];if(p._unknown){const w=new Map;for(const[y,D]of n.entries())w.set(D,y);for(const y of p._unknown){const D=w.get(y);D!==void 0&&b.push({index:D,value:y})}}for(const w of e)w.kind==="positional"&&!g.has(w.index)&&b.push({index:w.index,value:n[w.index]});b.length>0&&(b.sort((w,y)=>w.index-y.index),d._unknown=b.map(w=>w.value))}if(r.stopAtFirstUnknown&&!$){const b=e.findIndex(D=>D.kind==="option"&&!s.has(D.name??"")&&!o.has(D.name??"")&&(!r.caseInsensitive||!a?.has(D.name?.toLowerCase()??"")&&!l?.has(D.name?.toLowerCase()??""))),w=e.findIndex(D=>D.kind==="positional"&&!g.has(D.index));let y=-1;if(b!==-1&&w!==-1?y=Math.min(b,w):b!==-1?y=b:w!==-1&&(y=w),y>=0){const D=e[y].index;d._unknown=n.slice(D)}}else m.length>0&&!r.partial&&(d._unknown=m.map(b=>b.value));for(const[b,w]of Object.entries(p)){const y=r.camelCase?c?.get(b)??b:b,D=s.get(b);d[y]=D?.type?fj(w,D.type):w===void 0?null:w}for(const b of t){const w=r.camelCase?c?.get(b.name)??b.name:b.name;!(w in d)&&b.defaultValue!==void 0&&(b.multiple??b.lazyMultiple?d[w]=Array.isArray(b.defaultValue)?[...b.defaultValue]:[b.defaultValue]:d[w]=b.defaultValue)}if(k){const b={},w={},y={};for(const E of t)if(E.group){const A=Array.isArray(E.group)?E.group:[E.group];for(const j of A)Vh(j)||(b[j]??={})}for(const E of Object.keys(d))if(!bj(E)){w[E]=d[E];let A=E;r.camelCase&&(A=u?.get(E)??E);const j=s.get(A);if(j?.group){const G=Array.isArray(j.group)?j.group:[j.group];for(const W of G)Vh(W)||b[W]&&(b[W][E]=d[E])}else y[E]=d[E]}const D={_all:w};for(const[E,A]of Object.entries(b))D[E]=A;Object.keys(y).length>0&&(D._none=y),d._unknown&&(D._unknown=d._unknown),Object.keys(d).forEach(E=>delete d[E]),Object.assign(d,D)}return Qe(i,"Final parsed result:","resolver",d),d},"resolveArgs");var kj=Object.defineProperty,Jn=Wi((e,t)=>kj(e,"name",{value:t,configurable:!0}),"l");const Ln="-".codePointAt(0),wn="=",Sj=wn.codePointAt(0),Ej="--",Dj="-",Cj="--",A0=Jn(e=>e.length>2&&e.startsWith(Cj),"hasLongOptionPrefix"),Aj=Jn(e=>A0(e)&&!e.includes(wn,3),"isLongOption"),Oj=Jn(e=>A0(e)&&e.includes(wn,3),"isLongOptionAndValue"),jj=Jn(e=>e!==void 0&&e.length>0&&e.codePointAt(0)!==Ln,"hasOptionValue"),xj=Jn(e=>{if(e.length!==2||e.codePointAt(0)!==Ln||e.codePointAt(1)===Ln)return!1;const t=e.codePointAt(1);return t!==void 0&&(t<48||t>57)},"isShortOption"),Pj=Jn(e=>!(e.length<=2||e.codePointAt(0)!==Ln||e.codePointAt(1)===Ln),"isShortOptionGroup"),Nj=Jn(e=>{const t=[],r=[...e];let n=-1,i=0;for(;r.length>0;){const s=r.shift();if(s===void 0)break;const o=r[0];if(i>0?i--:n++,s===Ej){t.push({index:n,kind:"option-terminator"});const a=r.map((l,c)=>({index:n+c+1,kind:"positional",value:l}));t.push(...a),n+=r.length;break}if(xj(s)){const a=s.charAt(1);let l;i?(t.push({index:n,kind:"option",name:a,rawName:s,value:l}),i===1&&jj(o)&&(l=r.shift(),t.push({index:n,kind:"option",value:l}))):t.push({index:n,kind:"option",name:a,rawName:s,value:l}),l!==void 0&&++n;continue}if(Pj(s)&&!s.includes(wn)){const a=[];let l="",c=!1;for(let u=1;u<s.length;u++){const d=s.charAt(u);c?l+=d:d.codePointAt(0)===Sj?c=!0:a.push(`${Dj}${d}`)}if(c)if(a.length>0){const u=a.pop();a.push(`${u}=${l}`)}else a.push(l);r.unshift(...a),i=a.length;continue}if(Aj(s)){const a=s.slice(2);t.push({index:n,kind:"option",name:a,rawName:s});continue}if(Oj(s)){const a=s.indexOf(wn),l=s.slice(2,a),c=s.slice(a+1);t.push({index:n,inlineValue:!0,kind:"option",name:l,rawName:s,value:c});continue}if(s.length>2&&s.codePointAt(0)===Ln&&s.codePointAt(1)!==Ln&&s.includes(wn)){const a=s.indexOf(wn),l=s.charAt(1),c=s.slice(a+1);t.push({index:n,inlineValue:!0,kind:"option",name:l,rawName:s,value:c});continue}t.push({index:n,kind:"positional",value:s})}return t},"parseArgsTokens");var Rj=Object.defineProperty,Nd=Wi((e,t)=>Rj(e,"name",{value:t,configurable:!0}),"d");const Fj=/\d/,Lj=Nd(e=>e!=null&&(e===Boolean||typeof e=="function"&&e.name.startsWith("Boolean")),"isBooleanType"),Ij=Nd(e=>typeof e=="function","isValidCustomTypeFunction"),Tj=Nd((e,t,r)=>{const n=r?.debug??!1;Qe(n,"Validating definitions:","validation",e,"caseInsensitive:",t);const i=new Set,s=new Set,o=new Set,a=new Set;let l=0;for(const c of e){if(Qe(n,"Checking definition:","validation",c),!c.name)throw Qe(n,"Validation failed: name is required","validation"),new vt("Invalid option definition: name is required");if(typeof c.name!="string")throw new vt("Invalid option definition: name must be a string");if(c.name.trim()==="")throw new vt("Invalid option definition: name cannot be empty");const u=t?c.name.toLowerCase():"";if(i.has(c.name)||t&&o.has(u))throw new vt(`Invalid option definition: duplicate name '${c.name}'`);if(s.has(c.name)||t&&a.has(u))throw new vt(`Invalid option definition: name '${c.name}' conflicts with an existing alias`);if(i.add(c.name),t&&o.add(u),c.alias!==void 0){if(typeof c.alias!="string")throw new vt("Invalid option definition: alias must be a string");if(c.alias.length!==1)throw new vt("Invalid option definition: alias must be a single character");if(Fj.test(c.alias))throw new vt("Invalid option definition: alias cannot be numeric");if(c.alias==="-")throw new vt('Invalid option definition: alias cannot be "-"');const d=t?c.alias.toLowerCase():"";if(s.has(c.alias)||t&&a.has(d))throw new vt(`Invalid option definition: duplicate alias '${c.alias}'`);if(i.has(c.alias)||t&&o.has(d))throw new vt(`Invalid option definition: alias '${c.alias}' conflicts with an existing option name`);s.add(c.alias),t&&a.add(d)}if(c.defaultOption&&(l++,c.type!==void 0&&Lj(c.type)))throw new vt("Invalid option definition: defaultOption cannot be Boolean type");if(c.type!==void 0&&!(c.type===Boolean||c.type===Number||c.type===String||typeof c.type=="function"&&Ij(c.type)))throw new vt("Invalid option definition: invalid type")}if(l>1)throw Qe(n,"Validation failed: multiple defaultOptions not allowed","validation"),new vt("Invalid option definition: multiple defaultOptions not allowed");Qe(n,"Validation completed successfully","validation")},"validateDefinitions");var Bj=Object.defineProperty,_j=Wi((e,t)=>Bj(e,"name",{value:t,configurable:!0}),"O");const Mj=_j((e,t={})=>{const r=t.debug??!1;Qe(r,"Starting command-line-args parsing","index"),Qe(r,"Options:","index",t);const n={...t};n.stopAtFirstUnknown&&(n.partial=!0);const i=Array.isArray(e)?e:[e];Qe(r,"Normalized definitions:","index",i),Tj(i,n.caseInsensitive,r?n:void 0);let{argv:s}=n;if(!s&&(s=process.argv.slice(2),process.execArgv.length>0)){const c=new Set(process.execArgv);s=s.filter(u=>!c.has(u))}Qe(r,"Using argv:","index",s);let o=s;n.caseInsensitive&&(o=s.map(c=>{if(c.startsWith("--")){const u=c.indexOf("="),d=(u===-1?c.slice(2):c.slice(2,u)).toLowerCase();return u===-1?`--${d}`:`--${d}${c.slice(u)}`}if(c.startsWith("-")&&!c.startsWith("--")&&c.length>1){const u=c.slice(1).split("=",2),d=u[0],p=u[1];if(!d)return c;const m=d.toLowerCase();return p===void 0?`-${m}`:`-${m}=${p}`}return c}));const a=Nj(o.map(String));Qe(r,"Tokenized arguments:","index",a);const l=wj(a,i,n,s);return Qe(r,"Command-line-args parsing completed","index"),l},"commandLineArgs");var Vj=Object.defineProperty,Wj=re((e,t)=>Vj(e,"name",{value:t,configurable:!0}),"n$4");let Uj=class{static{f(this,"Bn")}static{gt(this,"Un")}static{re(this,"a")}static{Wj(this,"EmptyToolbox")}result;argv;options;argument;command;commandName;env;logger;runtime;rawUnknown;constructor(t,r){this.commandName=t,this.command=r}};var Gj=Object.defineProperty,qj=re((e,t)=>Gj(e,"name",{value:t,configurable:!0}),"n$3");let Il=class extends ge{static{f(this,"ue")}static{gt(this,"ce")}static{re(this,"i")}static{qj(this,"CommandLoaderError")}commandName;constructor(t,r,n){super(`Failed to load command "${t}": ${r}`,"COMMAND_LOADER_ERROR",{commandName:t,reason:r}),this.name="CommandLoaderError",this.commandName=t,this.hint="Ensure the loader resolves to a module with a default export that is the command handler function.",n!==void 0&&(this.cause=n)}};var zj=Object.defineProperty,Hj=re((e,t)=>zj(e,"name",{value:t,configurable:!0}),"f$3");const Jj=/^-{1,2}(\w+)(=(.+))?$/,O0=Hj((e,t,r,n)=>{const i=Jj.exec(e);if(i===null)return{};const s=i[1];if(!s)return{};const o=r&&n?r.get(s)??n.get(s):t.find(a=>a.name===s||a.alias===s);return o!==void 0?{argName:o.name,argValue:i[3],option:o}:{}},"getParameterOption");var Kj=Object.defineProperty,Op=re((e,t)=>Kj(e,"name",{value:t,configurable:!0}),"e$3");const Uh=Op((e,t)=>{if(t.type===void 0)return e;if(t.type.name==="Boolean"){if(e==="true"||e==="1")return t.type(!0);if(e==="false"||e==="0")return t.type(!1)}return t.type(e)},"convertType"),Yj=new Set(["0","1","false","true"]),Xj=Op((e,t,r,n)=>{if(t.length===0||e.length===0)return{};const i=Op((s,o)=>{const{argName:a,argValue:l,option:c}=O0(o,t,r,n),{lastOption:u}=s;return c&&to(c)&&l&&a?s.partial[a]=Uh(l,c):s.lastName&&u&&to(u)&&Yj.has(o)&&(s.partial[s.lastName]=Uh(o,u)),{lastName:a,lastOption:c,partial:s.partial}},"getBooleanValue");return e.reduce(i,{partial:{}}).partial},"getBooleanValues");var Qj=Object.defineProperty,Gh=re((e,t)=>Qj(e,"name",{value:t,configurable:!0}),"s$6");const Zj=new Set(["0","1","false","true"]),ex=Gh((e,t,r,n)=>{if(t.length===0||e.length===0)return e;const i=Gh((s,o)=>{const{argValue:a,option:l}=O0(o,t,r,n),{lastOption:c}=s;if(c&&to(c)&&Zj.has(o)){const{args:u}=s;return{args:u.slice(0,-1)}}return l&&to(l)&&a?{args:s.args}:{args:[...s.args,o],lastOption:l}},"removeBooleanArguments");return e.reduce(i,{args:[]}).args},"removeBooleanValues");var tx=Object.defineProperty,rx=re((e,t)=>tx(e,"name",{value:t,configurable:!0}),"o$4");const nx=rx(e=>{const t=new Map;for(const r of e){const n=t.get(r.name);n?t.set(r.name,{...n,...r}):t.set(r.name,r)}return[...t.values()]},"mergeArguments");var ix=Object.defineProperty,ac=re((e,t)=>ix(e,"name",{value:t,configurable:!0}),"o$3");const sx=ac(e=>{if(e===void 0)return;const t=e.toLowerCase().trim();return t==="true"||t==="1"||t==="yes"||t==="on"},"transformBooleanEnv"),ox=ac((e,t)=>{if(!e.type)return t;if(t!==void 0){if(e.type===Boolean||typeof e.type=="function"&&e.type.name==="Boolean")return sx(t);if(e.type===Number||typeof e.type=="function"&&e.type.name==="Number"){const r=Number.parseFloat(t);return Number.isNaN(r)?void 0:r}return e.type===String||typeof e.type=="function"&&e.type.name==="String"?t:e.type(t)}},"transformEnvValue"),ax=/_./g,cx=/^[A-Z]/,lx=ac(e=>e.toLowerCase().replaceAll(ax,t=>t[1]?.toUpperCase()??t).replace(cx,t=>t.toLowerCase()),"toCamelCase"),ux=ac(e=>{if(!e||e.length===0)return{};const t={},r=$n();for(const n of e){const i=r[n.name],s=ox(n,i),o=s===void 0?n.defaultValue:s,a=lx(n.name);t[a]=o}return t},"processEnvVariables");var px=Object.defineProperty,$o=re((e,t)=>px(e,"name",{value:t,configurable:!0}),"a$4");const dx=$o(e=>{const t=new Map,r=new Map;for(const n of e)if(t.set(n.name,n),n.alias){const i=Array.isArray(n.alias)?n.alias:[n.alias];for(const s of i)r.set(s,n)}return{optionMapByAlias:r,optionMapByName:t}},"buildOptionMaps"),fx=$o(async e=>{if(typeof e.__resolvedExecute__=="function")return e.__resolvedExecute__;if(typeof e.loader!="function")throw new Il(e.name,"no execute or loader defined");let t;try{t=await e.loader()}catch(n){throw new Il(e.name,n instanceof Error?n.message:String(n),n)}const r=t.default;if(typeof r!="function")throw new Il(e.name,"loader did not return a module with a default-exported handler function");return e.__resolvedExecute__=r,r},"loadLazyHandler"),mx=$o((e,t,r,n)=>{const i=new Uj(e.name,e),{_all:s,_unknown:o,positionals:a}=t,l=Object.keys(r).length>0?{...s,...r}:s;pa in l&&delete l[pa],i.argument=a?.[pa]??[],i.rawUnknown=[...o??[]];const c=Object.keys(n).length>0;return i.options=c?{...l,...n}:l,i.env=ux(e.env),i},"prepareToolbox"),hx=$o((e,t,r)=>{const n=e.options??[],i=n.length>0;let s=nx(i?[...n,...r]:r);if(s.length>0){for(const c of s)if(c.multiple&&c.lazyMultiple)throw new Error(`Argument "${c.name}" cannot have both multiple and lazyMultiple options, please choose one.`)}e.argument&&(s=[{defaultOption:!0,description:e.argument.description,group:"positionals",multiple:!0,name:pa,type:e.argument.type,typeLabel:e.argument.typeLabel},...s]);let o,a;if(i){const{optionMapByAlias:c,optionMapByName:u}=dx(n);o=ex(t,n,u,c),a=Xj(t,n,u,c)}else o=t,a={};const l=Mj(s,{argv:o,camelCase:!0,partial:!0,stopAtFirstUnknown:!0});return{arguments_:s,booleanValues:a,parsedArgs:l}},"processCommandArgs"),fi=$o(async(e,t,r)=>typeof e.execute=="function"?e.execute(t):(await fx(e))(t),"executeCommand");var gx=Object.defineProperty,yx=re((e,t)=>gx(e,"name",{value:t,configurable:!0}),"n$2");let vx=class extends ge{static{f(this,"fi")}static{gt(this,"pi")}static{re(this,"s")}static{yx(this,"CommandValidationError")}commandName;missingOptions;constructor(t,r){super(`Command "${t}" is missing required options: ${r.join(", ")}`,"COMMAND_VALIDATION_ERROR",{commandName:t,missingOptions:r}),this.name="CommandValidationError",this.commandName=t,this.missingOptions=r,this.hint=`Provide the following required options: ${r.join(", ")}`}};var bx=Object.defineProperty,$x=re((e,t)=>bx(e,"name",{value:t,configurable:!0}),"t$1");const qh=$x((e,t,r=!1)=>{const n=[];for(const i of e)if(!(!r&&!i.required)&&t[i.name]===void 0){if(i.type?.name==="Boolean"){t[i.name]=!1;continue}n.push(i)}return n},"listMissingArguments");var wx=Object.defineProperty,j0=re((e,t)=>wx(e,"name",{value:t,configurable:!0}),"n$1");const kx=j0((e,t)=>t.includes(e)?!0:Math.abs(e.length-t.length)>e.length/2?!1:Kb(e,t)<=e.length/3,"isSimilar"),yi=j0((e,t)=>{const r=e.toLowerCase();return t.filter(n=>kx(n.toLowerCase(),r))},"findAlternatives");var Sx=Object.defineProperty,cc=re((e,t)=>Sx(e,"name",{value:t,configurable:!0}),"a$3");const Ex=cc((e,t)=>{const r=[];if(e._unknown&&e._unknown.forEach(n=>{const i=n.startsWith("--");let s=`Found unknown ${i?"option":"argument"} "${n}"`;if(i){const o=yi(n.replace("--",""),(t.options??[]).map(a=>a.name));if(o.length>0){const[a,...l]=o.map(c=>`--${c}`);s+=l.length>0?`, did you mean ${a??""} or ${l.join(", ")}?`:`, did you mean ${a??""}?`}}r.push(s)}),r.length>0)throw new Error(r.join(`
|
|
7
|
+
`))},"validateUnknownOptions"),Dx=cc((e,t,r)=>{const n=r.__requiredOptions__,i=n?qh(n,t,!0):qh(e,t,!1);if(i.length>0)throw new vx(r.name,i.map(s=>s.name));t._unknown&&t._unknown.length>0&&!r.argument&&Ex(t,r)},"validateRequiredOptions"),Cx=cc((e,t,r)=>{const n=r.__conflictingOptions__??e.filter(i=>i.conflicts!==void 0);if(n.length>0){const i=n.find(s=>Array.isArray(s.conflicts)?s.conflicts.some(o=>t[o]!==void 0)&&t[s.name]!==void 0:t[s.conflicts]!==void 0&&t[s.name]!==void 0);if(i)throw new a0(i.name,typeof i.conflicts=="string"?i.conflicts:i.conflicts?.[0]??"unknown")}},"validateConflictingOptions"),Ax=cc(e=>{if(!Array.isArray(e.options))return;const t=new Map,r=new Map;for(const i of e.options){if(i.name){const s=t.get(i.name)??[];s.push(i),t.set(i.name,s)}if(typeof i.alias=="string"&&i.alias.length>0){const s=r.get(i.alias)??[];s.push(i),r.set(i.alias,s)}else if(Array.isArray(i.alias)){for(const s of i.alias)if(s.length>0){const o=r.get(s)??[];o.push(i),r.set(s,o)}}}const n=[];for(const[i,s]of t)s.length>1&&n.push(`Duplicate option name "${i}" in command "${e.name}": ${JSON.stringify(s)}`);for(const[i,s]of r)s.length>1&&n.push(`Duplicate option alias "-${i}" used by options ${s.map(o=>`"${o.name}"`).join(", ")} in command "${e.name}"`);if(n.length>0)throw new Error(n.join(`
|
|
8
|
+
`))},"validateDuplicateOptions");var Ox=Object.defineProperty,Rd=re((e,t)=>Ox(e,"name",{value:t,configurable:!0}),"s$2");const jx=Rd((e,t)=>{if(t.length===0)return{argv:[],commandPath:void 0};const r=[];let n;for(let i=1;i<=t.length;i+=1){const s=t[i-1];if(s===void 0||s.startsWith("-"))break;r.push(s);const o=r.join(" ");e.has(o)&&(n={commandPath:[...r],depth:i})}return n?{argv:t.slice(n.depth),commandPath:n.commandPath}:{argv:t,commandPath:void 0}},"parseNestedCommand"),mi=Rd(e=>e.join(" "),"getCommandPathKey"),zh=Rd((e,t)=>t&&t.length>0?[...t,e]:[e],"getFullCommandPath");var xx=Object.defineProperty,lc=re((e,t)=>xx(e,"name",{value:t,configurable:!0}),"a$2");const Px=lc(e=>{e.options?.forEach(t=>{t.__camelCaseName__=o0(t.name)})},"processOptionNames"),Nx=lc(e=>{if(!Array.isArray(e.options)||e.options.length===0)return;const t=new Set;for(const n of e.options)t.add(n.name);const r=[];for(const n of e.options)if(n.name.startsWith("no-")){const i=n.name.replace("no-","");if(!t.has(i)){if(n.type!==Boolean)throw new Error(`Cannot add negated option "${n.name}" to command "${e.name}" because it is not a boolean.`);const s={...n,defaultValue:n.defaultValue===void 0?!0:!n.defaultValue,name:i};r.push(s),t.add(i)}}r.length>0&&e.options.push(...r)},"addNegatableOptions"),Rx=lc((e,t)=>{if(!t.options||t.options.length===0)return;const{options:r}=e,n=new Map;for(const s of t.options)if(s.name.startsWith("no-")){const o=o0(s.name);n.set(o,s)}const i=Object.keys(r).filter(s=>n.has(s));if(i.length!==0)for(const s of i){const o=s.charAt(2);if(!o)continue;const a=o.toLowerCase()+s.slice(3),l=n.get(s);l&&(l.__negated__=!0),r[a]=!r[s],Reflect.deleteProperty(r,s)}},"mapNegatableOptions"),Fx=lc((e,t)=>{if(!t.options||t.options.length===0)return;const r=new Map;for(const i of t.options)i.__camelCaseName__&&i.__negated__===void 0&&i.implies!==void 0&&r.set(i.__camelCaseName__,i);if(r.size===0)return;const{options:n}=e;for(const i of Object.keys(n)){const s=r.get(i);if(s?.implies){const{implies:o}=s;for(const[a,l]of Object.entries(o))n[a]===void 0&&(n[a]=l)}}},"mapImpliedOptions");var Lx=Object.defineProperty,uc=re((e,t)=>Lx(e,"name",{value:t,configurable:!0}),"e$2");const Ix=uc(()=>!!process.versions.electron,"isElectronApp"),Tx=uc(()=>Ix()&&!process.defaultApp,"isBundledElectronApp"),Bx=uc(()=>Tx()?0:1,"getProcessArgvBinIndex"),_x=uc(e=>e.slice(Bx()+1),"hideBin");var Mx=Object.defineProperty,x0=re((e,t)=>Mx(e,"name",{value:t,configurable:!0}),"e$1");const Vx=" ",Wx=x0((e,t)=>e===t?!0:e.length!==t.length?!1:e.every((r,n)=>r===t[n]),"equals"),Ux=x0(e=>{if(typeof e=="string")return e.split(Vx);const t=Pa();return Wx(e,t)?_x(e):e},"parseRawCommand");var Gx=Object.defineProperty,Tl=re((e,t)=>Gx(e,"name",{value:t,configurable:!0}),"r");const qx=Tl(e=>{const t=Tl(s=>{e.error(`Uncaught exception: ${s.message||s}`),s.stack&&e.error(s.stack),Qr(1)},"uncaughtExceptionHandler"),r=Tl((s,o)=>{if(s instanceof Error)e.error(`Promise rejection: ${s.message||s}`),s.stack&&e.error(s.stack);else{let a;if(typeof s=="string")a=s;else try{a=JSON.stringify(s)}catch{a=String(s)}e.error(`Promise rejection: ${a}`)}Qr(1)},"unhandledRejectionHandler"),n=Dh("uncaughtException",t),i=Dh("unhandledRejection",r);return()=>{n(),i()}},"registerExceptionHandler");var zx=Object.defineProperty,Ui=re((e,t)=>zx(e,"name",{value:t,configurable:!0}),"e");const Na=100,P0=/^[a-z][\w-]*$/i,Fd=Ui((e,t)=>{if(typeof e!="string"||e.trim().length===0)throw new ge(`${t} must be a non-empty string`,"INVALID_INPUT",{fieldName:t,value:e});return e.trim()},"validateNonEmptyString"),Hh=Ui((e,t)=>{if(!Array.isArray(e)||!e.every(r=>typeof r=="string"))throw new ge(`${t} must be an array of strings`,"INVALID_INPUT",{fieldName:t,value:e});return e},"validateStringArray");Ui((e,t)=>{if(typeof e!="function")throw new ge(`${t} must be a function`,"INVALID_INPUT",{fieldName:t,value:e});return e},"validateFunction");const Bl=Ui((e,t)=>{if(typeof e!="object"||e===null)throw new ge(`${t} must be an object`,"INVALID_INPUT",{fieldName:t,value:e});return e},"validateObject"),Yo=Ui(e=>{const t=Fd(e,"Command name");if(t.length>Na)throw new ge(`Command name is too long (maximum ${String(Na)} characters)`,"INVALID_COMMAND_NAME",{commandName:t,length:t.length});if(t.includes("..")||t.includes("/")||t.includes("\\")||t.includes(";")||t.includes("|")||t.includes("&"))throw new ge(`Command name "${t}" contains invalid characters`,"INVALID_COMMAND_NAME",{commandName:t});if(!P0.test(t))throw new ge(`Command name "${t}" must start with a letter and contain only letters, numbers, hyphens, and underscores`,"INVALID_COMMAND_NAME",{commandName:t});return t},"validateCommandName");Ui(e=>{const t=Fd(e,"Plugin name");if(t.length>Na)throw new ge(`Plugin name is too long (maximum ${String(Na)} characters)`,"INVALID_PLUGIN_NAME",{length:t.length,pluginName:t});if(t.includes("..")||t.includes("/")||t.includes("\\")||t.includes(";")||t.includes("|")||t.includes("&"))throw new ge(`Plugin name "${t}" contains invalid characters`,"INVALID_PLUGIN_NAME",{pluginName:t});if(!P0.test(t))throw new ge(`Plugin name "${t}" must start with a letter and contain only letters, numbers, hyphens, and underscores`,"INVALID_PLUGIN_NAME",{pluginName:t});return t},"validatePluginName");var Hx=Object.defineProperty,pc=re((e,t)=>Hx(e,"name",{value:t,configurable:!0}),"s");const Jx=new Set([`
|
|
9
|
+
`,"\r"," ","\0",'"',"$","&","'","(",")",";","<",">","[","\\","]","`","{","|","}"]),Kx=/^[A-Z]:/i,Yx=pc(e=>{if(typeof e!="string")throw new TypeError("Argument must be a string");if(e.length>1e4)throw new Error(`Argument is too long (maximum ${String(1e4)} characters)`);for(const t of e)if(Jx.has(t))throw new Error(`Argument contains dangerous character: ${t}`);return e.trim()},"sanitizeArgument"),Jh=pc(e=>{if(!Array.isArray(e))throw new TypeError("Arguments must be an array");if(e.length>100)throw new Error(`Too many arguments (maximum ${String(100)})`);return e.map(t=>Yx(t))},"sanitizeArguments");pc(e=>{if(typeof e!="string")throw new TypeError("Path must be a string");const t=e.trim();if(t.includes("..")||t.includes("../")||t.includes("..\\"))throw new Error("Path contains directory traversal sequences");if(t.startsWith("/")||Kx.test(t))throw new Error("Absolute paths are not allowed");if(t.length>1e3)throw new Error("Path is too long");return t},"validateSafePath");class JQ{static{f(this,"ao")}static{gt(this,"co")}static{re(this,"RateLimiter")}static{pc(this,"RateLimiter")}attempts=new Map;maxAttempts;windowMs;constructor(t=5,r=6e4){if(t<=0||r<=0)throw new Error("maxAttempts and windowMs must be positive numbers");this.maxAttempts=t,this.windowMs=r}checkLimit(t){const r=Date.now(),n=this.attempts.get(t);return!n||r>n.resetTime?(this.attempts.set(t,{count:1,resetTime:r+this.windowMs}),this.cleanup(r),!0):n.count>=this.maxAttempts?!1:(n.count+=1,!0)}reset(t){this.attempts.delete(t)}cleanup(t){for(const[r,n]of this.attempts.entries())t>n.resetTime&&this.attempts.delete(r)}}var Xx=Object.defineProperty,da=re((e,t)=>Xx(e,"name",{value:t,configurable:!0}),"A");const Qx=/^-([^\d-])$/,Zx=/^--(\S+)/,eP=/^-([^\d-]{2,})$/,_l=da(e=>Qx.test(e)||Zx.test(e)||eP.test(e),"isOption");let tP=class{static{f(this,"Qi")}static{gt(this,"uo")}static{re(this,"Cli")}static{da(this,"Cli")}#e;#r;#t;#s;#c;#m;#P;#v;#i;#h;#l;#o;#n;#d=!1;#b;#g=!1;#u;#$;#p;#w=[];#E(){return this.#u===void 0&&(this.#u=[...this.#h.keys()]),this.#u}#k(){return this.#$===void 0&&(this.#$=[...this.#i.keys()]),this.#$}#f(){return this.#p===void 0&&(this.#p=[...this.#E(),...this.#k()]),this.#p}#S(){return this.#w.length===0?Ko:[...Ko,...this.#w]}#C(){this.#u=void 0,this.#$=void 0,this.#p=void 0}#y(){if(this.#t===void 0){const t=Ux(this.#r.argv);this.#t=Jh(t),this.#R()}return this.#t}#R(){if(!this.#t)return;const t=$n();let r=!1;for(const n of this.#t){if(n==="--quiet"||n==="-q"){t.CEREBRO_OUTPUT_LEVEL=String(fA),r=!0;break}if(n==="--verbose"||n==="-v"){t.CEREBRO_OUTPUT_LEVEL=String(mA),r=!0;break}if(n==="--debug"||n==="-vvv"){t.CEREBRO_OUTPUT_LEVEL=String(gi),r=!0;break}}r||(t.CEREBRO_OUTPUT_LEVEL=Object.hasOwn(t,"DEBUG")?String(gi):String(Eh))}#L(){this.#g||(this.#b=qx(this.#e),this.#g=!0)}#A(t,r,n,i){this.#e.debug(`command '${i}' found, parsing command args: ${r.join(", ")}`);const{arguments_:s,booleanValues:o,parsedArgs:a}=hx(t,r,this.#S()),l=Object.keys(o).length>0;let c=a;l&&(c={...a,_all:{...a._all,...o}}),Dx(s,c,t);const u=mx(t,a,o,n);u.runtime=this,u.argv=this.#y();const d=t.options&&t.options.length>0;if(d&&t.options){const p=t.options.filter(m=>m.name.startsWith("no-"));for(const m of p){const g=m.name.replace("no-",""),$=`--${m.name}`,S=`--${g}`,k=r.includes($),v=r.includes(S);if(k&&v)throw new a0(g,m.name)}}return d&&(Rx(u,t),Fx(u,t)),Cx(s,u.options,t),$n().CEREBRO_OUTPUT_LEVEL===String(gi)&&(this.#e.debug("command options parsed from options:"),this.#e.debug(JSON.stringify(u.options,null,2)),this.#e.debug("command argument parsed from argument:"),this.#e.debug(JSON.stringify(u.argument,null,2))),{arguments_:s,booleanValues:o,commandArgs:c,parsedArgs:a,toolbox:u}}constructor(t,r={}){if(typeof t!="string"||t.trim().length===0)throw new ge("CLI name must be a non-empty string","INVALID_INPUT",{cliName:t});this.#c=t.trim();const n=r.argv??Pa(),i=r.cwd??xA();if(this.#r={...r,argv:n,cwd:i},this.#r.argv&&!Array.isArray(this.#r.argv))throw new ge("CLI argv option must be an array of strings","INVALID_INPUT",{argv:this.#r.argv});if(this.#r.cwd&&typeof this.#r.cwd!="string")throw new ge("CLI cwd option must be a string","INVALID_INPUT",{cwd:this.#r.cwd});if(this.#r.packageName&&typeof this.#r.packageName!="string")throw new ge("CLI packageName option must be a string","INVALID_INPUT",{packageName:this.#r.packageName});if(this.#r.packageVersion&&typeof this.#r.packageVersion!="string")throw new ge("CLI packageVersion option must be a string","INVALID_INPUT",{packageVersion:this.#r.packageVersion});const s=$n();if(s.CEREBRO_OUTPUT_LEVEL=String(Eh),typeof this.#r.logger=="object"){const o=["debug","error","info","log","warn"],a=[],l=this.#r.logger;for(const c of o)typeof l[c]!="function"&&a.push(c);if(a.length>0)throw new ge(`Logger object is missing required methods: ${a.join(", ")}`,"INVALID_INPUT",{logger:this.#r.logger,missingMethods:a});this.#e=this.#r.logger}else this.#e={...console,debug:da((...o)=>{s.CEREBRO_OUTPUT_LEVEL===String(gi)&&console.debug(...o)},"debug")};this.#m=this.#r.packageVersion,this.#P=this.#r.packageName,this.#s=this.#r.cwd,this.#o="help",this.#n={},this.#i=new Map,this.#h=new Map,this.#l=new Map}setCommandSection(t){return this.#n=t,this}getCommandSection(){return this.#n.header||(this.#n.header=`${this.#c}${this.#m?` v${this.#m}`:""}`),this.#n}setDefaultCommand(t){return this.#o=t,this}get defaultCommand(){return this.#o}addCommand(t){Bl(t,"Command"),Yo(t.name);const r=typeof t.execute=="function",n=typeof t.loader=="function";if(r&&n)throw new ge(`Command "${t.name}" cannot define both "execute" and "loader" — choose one`,"INVALID_COMMAND",{commandName:t.name});if(!r&&!n)throw new ge(`Command "${t.name}" must define either "execute" or "loader"`,"INVALID_COMMAND",{commandName:t.name});t.alias&&(typeof t.alias=="string"?Yo(t.alias):Hh(t.alias,"Command alias").forEach(c=>Yo(c))),t.argument&&Bl(t.argument,"Command argument"),t.options&&Bl(t.options,"Command options"),t.commandPath&&(Hh(t.commandPath,"Command commandPath"),t.commandPath.forEach(c=>{Yo(c)}));const i=zh(t.name,t.commandPath),s=mi(i);if(this.#h.has(s))throw new ge(`Command with path "${s}" already exists`,"DUPLICATE_COMMAND",{commandName:t.name,commandPath:t.commandPath});const o=Array.isArray(t.commandPath)&&t.commandPath.length>0,a=this.#i.get(t.name),l=a!==void 0&&(a.commandPath===void 0||a.commandPath.length===0);if(!o&&l)throw new ge(`Command with name "${t.name}" already exists`,"DUPLICATE_COMMAND",{commandName:t.name});if(t.options)for(const c of t.options)Lh(c);if(Ax(t),Nx(t),Px(t),t.options&&(t.__conflictingOptions__=t.options.filter(c=>c.conflicts!==void 0),t.__requiredOptions__=t.options.filter(c=>c.required===!0)),o&&a!==void 0)this.#i.set(s,t);else{if(!o&&a!==void 0&&!l){const c=zh(a.name,a.commandPath);this.#i.set(mi(c),a)}this.#i.set(t.name,t)}if(this.#h.set(s,i),this.#l.set(s,t),this.#C(),t.alias!==void 0){const c=typeof t.alias=="string"?[t.alias]:t.alias;for(const u of c){if($n().CEREBRO_OUTPUT_LEVEL===String(gi)&&this.#e.debug("adding alias",u),this.#i.has(u))throw new ge(`Command alias "${u}" conflicts with existing command`,"DUPLICATE_COMMAND",{alias:u,commandName:t.name});this.#i.set(u,t)}}return this}addGlobalOption(t){const r=t,n=new Set(Ko.map(s=>s.name)),i=new Set(Ko.map(s=>s.alias).filter(Boolean));if(n.has(r.name))throw new ge(`Cannot add global option "--${r.name}": it conflicts with a built-in global option`,"DUPLICATE_OPTION",{optionName:r.name});if(r.alias&&i.has(r.alias))throw new ge(`Cannot add global option with alias "-${r.alias}": it conflicts with a built-in global option alias`,"DUPLICATE_OPTION",{alias:r.alias,optionName:r.name});if(new Set(this.#w.map(s=>s.name)).has(r.name))throw new ge(`Global option "--${r.name}" has already been added`,"DUPLICATE_OPTION",{optionName:r.name});return r.group="global",Lh(r),this.#w.push(r),this}getGlobalOptions(){return this.#S()}addPlugin(t){return this.getPluginManager().register(t),this}getPluginManager(){return this.#v?this.#v:(this.#v=new jO(this.#e),this.#v.register({description:"Attaches the logger to the toolbox",execute:da(t=>{t.logger=this.#e},"execute"),name:"logger"}),this.#v)}getCliName(){return this.#c}getPackageVersion(){return this.#m}getPackageName(){return this.#P}getCommands(){return this.#i}getCwd(){return this.#s}dispose(){this.#b?.()}async run(t={}){const{autoDispose:r=!0,shouldExitProcess:n=!0,...i}=t;if(!this.#i.has("help")){const{default:w}=await import("./help-command.js");this.addCommand(new w(this.#i))}const s=this.#k(),o=this.#h;this.#L();const a=this.#y();let l,c=[...a];const u=Jb(),d=Hb(),p=Pa();this.#e.debug(`process.execPath: ${u}`),this.#e.debug(`process.execArgv: ${d.join(" ")}`),this.#e.debug(`process.argv: ${p.join(" ")}`);const m=jx(o,[...a]);if(m.commandPath)l=m.commandPath,c=m.argv;else{if(a.length>1&&a[0]&&a[1]&&!_l(a[0])&&!_l(a[1])){const y=[];let D=0;for(;D<a.length;){const A=a[D];if(!A||_l(A))break;y.push(A),D+=1}const E=mi(y);if(y[0]&&!s.includes(y[0])){const A=this.#f(),j=yi(E,A);throw new di(E,j)}}let w;try{w=_O([null,...s],[...a])}catch(y){if(y instanceof Error&&y.name==="INVALID_COMMAND"&&"command"in y){const D=y.command,E=this.#f(),A=yi(D,E);throw new di(D,A)}throw y}w.command&&(l=[w.command],c=w.argv)}if(!l)if(this.#o)l=[this.#o];else{const w=this.#f();throw new di("",w)}const g=mi(l),$=this.#h.get(g);let S;if($){if(S=this.#l.get(g),!S||mi($)!==g){const w=this.#f(),y=yi(g,w);throw new di(g,y)}}else{const w=l.at(-1);if(S=w?this.#i.get(w):void 0,!S){const y=this.#f(),D=yi(g,y);throw new di(g,D)}}if(typeof S.execute!="function"&&typeof S.loader!="function")return this.#e.error(`Command "${S.name}" has no function to execute.`),n?Qr(1):void 0;const k=c;let v,h;try{({commandArgs:v,toolbox:h}=this.#A(S,k,i,g))}catch(w){if(this.#e.error(w),n)return Qr(1);throw w}const b=this.getPluginManager();try{!this.#d&&b.hasPlugins()&&(await b.init({cli:this,cwd:this.#s,logger:this.#e}),this.#d=!0),await b.executeLifecycle("execute",h),await b.executeLifecycle("beforeCommand",h);let w;const y=v.global;if(y?.help){const D=this.#i.get("help");if(!D)throw new ge("Help command not found","COMMAND_NOT_FOUND");w=await fi(D,h,v)}else if(y?.version??y?.V){const D=this.#i.get("version");if(!D)throw new ge("Version command not found","COMMAND_NOT_FOUND");w=await fi(D,h,v)}else w=await fi(S,h,v);return await b.executeLifecycle("afterCommand",h,w),n?Qr(0):void 0}catch(w){throw await b.executeErrorHandlers(w,h),w}finally{r&&this.dispose()}}async runCommand(t,r={}){const{argv:n=[],...i}=r;Fd(t,"Command name");const s=t.split(" ").filter(Boolean),o=mi(s),a=this.#h.get(o)?this.#l.get(o):this.#i.get(t);if(!a){const p=this.#f(),m=yi(o||t,p);throw new di(t,m)}if(typeof a.execute!="function"&&typeof a.loader!="function")throw new ge(`Command "${a.name}" has no function to execute`,"INVALID_COMMAND",{commandName:a.name});const l=[...Jh(n)];this.#e.debug(`running command '${t}' programmatically with args: ${l.join(", ")}`);const{commandArgs:c,toolbox:u}=this.#A(a,l,i,o||t),d=this.getPluginManager();try{!this.#d&&d.hasPlugins()&&(await d.init({cli:this,cwd:this.#s,logger:this.#e}),this.#d=!0),await d.executeLifecycle("execute",u),await d.executeLifecycle("beforeCommand",u);let p;const m=c.global;if(m?.help){const g=this.#i.get("help");if(!g)throw new ge("Help command not found","COMMAND_NOT_FOUND");p=await fi(g,u,c)}else if(m?.version??m?.V){const g=this.#i.get("version");if(!g)throw new ge("Version command not found","COMMAND_NOT_FOUND");p=await fi(g,u,c)}else p=await fi(a,u,c);return await d.executeLifecycle("afterCommand",u,p),p}catch(p){throw await d.executeErrorHandlers(p,u),p}}};var rP=Object.defineProperty,nP=f((e,t)=>rP(e,"name",{value:t,configurable:!0}),"r$U"),iP=Object.defineProperty,sP=nP((e,t)=>iP(e,"name",{value:t,configurable:!0}),"t"),oP=Object.defineProperty,aP=sP((e,t)=>oP(e,"name",{value:t,configurable:!0}),"t");const Pe=aP((e,t)=>async()=>({default:(await e())[t]}),"lazyNamed");var cP=Object.defineProperty,lP=f((e,t)=>cP(e,"name",{value:t,configurable:!0}),"e$15"),uP=Object.defineProperty,pP=lP((e,t)=>uP(e,"name",{value:t,configurable:!0}),"o"),dP=Object.defineProperty,fP=pP((e,t)=>dP(e,"name",{value:t,configurable:!0}),"t");const mP=fP((e,t)=>new tP(e,t),"createCerebro");var hP=Object.defineProperty,dc=f((e,t)=>hP(e,"name",{value:t,configurable:!0}),"r$T");function N0(e,t){return`#compdef ${e}
|
|
10
|
+
compdef _${e} ${e}
|
|
11
|
+
|
|
12
|
+
# zsh completion for ${e} -*- shell-script -*-
|
|
13
|
+
|
|
14
|
+
__${e}_debug() {
|
|
15
|
+
local file="$BASH_COMP_DEBUG_FILE"
|
|
16
|
+
if [[ -n \${file} ]]; then
|
|
17
|
+
echo "$*" >> "\${file}"
|
|
18
|
+
fi
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
_${e}() {
|
|
22
|
+
local shellCompDirectiveError=${Ae.ShellCompDirectiveError}
|
|
23
|
+
local shellCompDirectiveNoSpace=${Ae.ShellCompDirectiveNoSpace}
|
|
24
|
+
local shellCompDirectiveNoFileComp=${Ae.ShellCompDirectiveNoFileComp}
|
|
25
|
+
local shellCompDirectiveFilterFileExt=${Ae.ShellCompDirectiveFilterFileExt}
|
|
26
|
+
local shellCompDirectiveFilterDirs=${Ae.ShellCompDirectiveFilterDirs}
|
|
27
|
+
local shellCompDirectiveKeepOrder=${Ae.ShellCompDirectiveKeepOrder}
|
|
28
|
+
|
|
29
|
+
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder
|
|
30
|
+
local -a completions
|
|
31
|
+
|
|
32
|
+
__${e}_debug "\\n========= starting completion logic =========="
|
|
33
|
+
__${e}_debug "CURRENT: \${CURRENT}, words[*]: \${words[*]}"
|
|
34
|
+
|
|
35
|
+
# The user could have moved the cursor backwards on the command-line.
|
|
36
|
+
# We need to trigger completion from the $CURRENT location, so we need
|
|
37
|
+
# to truncate the command-line ($words) up to the $CURRENT location.
|
|
38
|
+
# (We cannot use $CURSOR as its value does not work when a command is an alias.)
|
|
39
|
+
words=( "\${=words[1,CURRENT]}" )
|
|
40
|
+
__${e}_debug "Truncated words[*]: \${words[*]},"
|
|
41
|
+
|
|
42
|
+
lastParam=\${words[-1]}
|
|
43
|
+
lastChar=\${lastParam[-1]}
|
|
44
|
+
__${e}_debug "lastParam: \${lastParam}, lastChar: \${lastChar}"
|
|
45
|
+
|
|
46
|
+
# For zsh, when completing a flag with an = (e.g., ${e} -n=<TAB>)
|
|
47
|
+
# completions must be prefixed with the flag
|
|
48
|
+
setopt local_options BASH_REMATCH
|
|
49
|
+
if [[ "\${lastParam}" =~ '-.*=' ]]; then
|
|
50
|
+
# We are dealing with a flag with an =
|
|
51
|
+
flagPrefix="-P \${BASH_REMATCH}"
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
# Prepare the command to obtain completions, ensuring arguments are quoted for eval
|
|
55
|
+
local -a args_to_quote=("\${(@)words[2,-1]}")
|
|
56
|
+
if [ "\${lastChar}" = "" ]; then
|
|
57
|
+
# If the last parameter is complete (there is a space following it)
|
|
58
|
+
# We add an extra empty parameter so we can indicate this to the go completion code.
|
|
59
|
+
__${e}_debug "Adding extra empty parameter"
|
|
60
|
+
args_to_quote+=("")
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# Use Zsh's (q) flag to quote each argument safely for eval
|
|
64
|
+
local quoted_args=("\${(@q)args_to_quote}")
|
|
65
|
+
|
|
66
|
+
# Join the main command and the quoted arguments into a single string for eval
|
|
67
|
+
requestComp="${t} complete -- \${quoted_args[*]}"
|
|
68
|
+
|
|
69
|
+
__${e}_debug "About to call: eval \${requestComp}"
|
|
70
|
+
|
|
71
|
+
# Use eval to handle any environment variables and such
|
|
72
|
+
out=$(eval \${requestComp} 2>/dev/null)
|
|
73
|
+
__${e}_debug "completion output: \${out}"
|
|
74
|
+
|
|
75
|
+
# Extract the directive integer following a : from the last line
|
|
76
|
+
local lastLine
|
|
77
|
+
while IFS='
|
|
78
|
+
' read -r line; do
|
|
79
|
+
lastLine=\${line}
|
|
80
|
+
done < <(printf "%s
|
|
81
|
+
" "\${out[@]}")
|
|
82
|
+
__${e}_debug "last line: \${lastLine}"
|
|
83
|
+
|
|
84
|
+
if [ "\${lastLine[1]}" = : ]; then
|
|
85
|
+
directive=\${lastLine[2,-1]}
|
|
86
|
+
# Remove the directive including the : and the newline
|
|
87
|
+
local suffix
|
|
88
|
+
(( suffix=\${#lastLine}+2))
|
|
89
|
+
out=\${out[1,-$suffix]}
|
|
90
|
+
else
|
|
91
|
+
# There is no directive specified. Leave $out as is.
|
|
92
|
+
__${e}_debug "No directive found. Setting to default"
|
|
93
|
+
directive=0
|
|
94
|
+
fi
|
|
95
|
+
|
|
96
|
+
__${e}_debug "directive: \${directive}"
|
|
97
|
+
__${e}_debug "completions: \${out}"
|
|
98
|
+
__${e}_debug "flagPrefix: \${flagPrefix}"
|
|
99
|
+
|
|
100
|
+
if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
|
|
101
|
+
__${e}_debug "Completion received error. Ignoring completions."
|
|
102
|
+
return
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
local activeHelpMarker="%"
|
|
106
|
+
local endIndex=\${#activeHelpMarker}
|
|
107
|
+
local startIndex=$((\${#activeHelpMarker}+1))
|
|
108
|
+
local hasActiveHelp=0
|
|
109
|
+
while IFS='
|
|
110
|
+
' read -r comp; do
|
|
111
|
+
# Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)
|
|
112
|
+
if [ "\${comp[1,$endIndex]}" = "$activeHelpMarker" ];then
|
|
113
|
+
__${e}_debug "ActiveHelp found: $comp"
|
|
114
|
+
comp="\${comp[$startIndex,-1]}"
|
|
115
|
+
if [ -n "$comp" ]; then
|
|
116
|
+
compadd -x "\${comp}"
|
|
117
|
+
__${e}_debug "ActiveHelp will need delimiter"
|
|
118
|
+
hasActiveHelp=1
|
|
119
|
+
fi
|
|
120
|
+
continue
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
if [ -n "$comp" ]; then
|
|
124
|
+
# If requested, completions are returned with a description.
|
|
125
|
+
# The description is preceded by a TAB character.
|
|
126
|
+
# For zsh's _describe, we need to use a : instead of a TAB.
|
|
127
|
+
# We first need to escape any : as part of the completion itself.
|
|
128
|
+
comp=\${comp//:/\\:}
|
|
129
|
+
|
|
130
|
+
local tab="$(printf '\\t')"
|
|
131
|
+
comp=\${comp//$tab/:}
|
|
132
|
+
|
|
133
|
+
__${e}_debug "Adding completion: \${comp}"
|
|
134
|
+
completions+=\${comp}
|
|
135
|
+
lastComp=$comp
|
|
136
|
+
fi
|
|
137
|
+
done < <(printf "%s
|
|
138
|
+
" "\${out[@]}")
|
|
139
|
+
|
|
140
|
+
# Add a delimiter after the activeHelp statements, but only if:
|
|
141
|
+
# - there are completions following the activeHelp statements, or
|
|
142
|
+
# - file completion will be performed (so there will be choices after the activeHelp)
|
|
143
|
+
if [ $hasActiveHelp -eq 1 ]; then
|
|
144
|
+
if [ \${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then
|
|
145
|
+
__${e}_debug "Adding activeHelp delimiter"
|
|
146
|
+
compadd -x "--"
|
|
147
|
+
hasActiveHelp=0
|
|
148
|
+
fi
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
|
|
152
|
+
__${e}_debug "Activating nospace."
|
|
153
|
+
noSpace="-S ''"
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
|
|
157
|
+
__${e}_debug "Activating keep order."
|
|
158
|
+
keepOrder="-V"
|
|
159
|
+
fi
|
|
160
|
+
|
|
161
|
+
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
|
|
162
|
+
# File extension filtering
|
|
163
|
+
local filteringCmd
|
|
164
|
+
filteringCmd='_files'
|
|
165
|
+
for filter in \${completions[@]}; do
|
|
166
|
+
if [ \${filter[1]} != '*' ]; then
|
|
167
|
+
# zsh requires a glob pattern to do file filtering
|
|
168
|
+
filter="\\*.$filter"
|
|
169
|
+
fi
|
|
170
|
+
filteringCmd+=" -g $filter"
|
|
171
|
+
done
|
|
172
|
+
filteringCmd+=" \${flagPrefix}"
|
|
173
|
+
|
|
174
|
+
__${e}_debug "File filtering command: $filteringCmd"
|
|
175
|
+
_arguments '*:filename:'"$filteringCmd"
|
|
176
|
+
elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
|
|
177
|
+
# File completion for directories only
|
|
178
|
+
local subdir
|
|
179
|
+
subdir="\${completions[1]}"
|
|
180
|
+
if [ -n "$subdir" ]; then
|
|
181
|
+
__${e}_debug "Listing directories in $subdir"
|
|
182
|
+
pushd "\${subdir}" >/dev/null 2>&1
|
|
183
|
+
else
|
|
184
|
+
__${e}_debug "Listing directories in ."
|
|
185
|
+
fi
|
|
186
|
+
|
|
187
|
+
local result
|
|
188
|
+
_arguments '*:dirname:_files -/'" \${flagPrefix}"
|
|
189
|
+
result=$?
|
|
190
|
+
if [ -n "$subdir" ]; then
|
|
191
|
+
popd >/dev/null 2>&1
|
|
192
|
+
fi
|
|
193
|
+
return $result
|
|
194
|
+
else
|
|
195
|
+
__${e}_debug "Calling _describe"
|
|
196
|
+
if eval _describe $keepOrder "completions" completions -Q \${flagPrefix} \${noSpace}; then
|
|
197
|
+
__${e}_debug "_describe found some completions"
|
|
198
|
+
|
|
199
|
+
# Return the success of having called _describe
|
|
200
|
+
return 0
|
|
201
|
+
else
|
|
202
|
+
__${e}_debug "_describe did not find completions."
|
|
203
|
+
__${e}_debug "Checking if we should do file completion."
|
|
204
|
+
if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
|
|
205
|
+
__${e}_debug "deactivating file completion"
|
|
206
|
+
|
|
207
|
+
# Return 0 to indicate completion is finished and prevent zsh from
|
|
208
|
+
# trying other completion algorithms (which could cause hanging).
|
|
209
|
+
# We use NoFileComp directive to explicitly disable file completion.
|
|
210
|
+
return 0
|
|
211
|
+
else
|
|
212
|
+
# Perform file completion
|
|
213
|
+
__${e}_debug "Activating file completion"
|
|
214
|
+
|
|
215
|
+
# We must return the result of this command, so it must be the
|
|
216
|
+
# last command, or else we must store its result to return it.
|
|
217
|
+
_arguments '*:filename:_files'" \${flagPrefix}"
|
|
218
|
+
fi
|
|
219
|
+
fi
|
|
220
|
+
fi
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
# don't run the completion function when being sourced or eval-ed
|
|
224
|
+
if [ "\${funcstack[1]}" = "_${e}" ]; then
|
|
225
|
+
_${e}
|
|
226
|
+
fi
|
|
227
|
+
`}f(N0,"m$G");dc(N0,"t");function R0(e,t){let r=e.replace(/[-:]/g,"_");return`# bash completion for ${e}
|
|
228
|
+
|
|
229
|
+
# Define shell completion directives
|
|
230
|
+
readonly ShellCompDirectiveError=${Ae.ShellCompDirectiveError}
|
|
231
|
+
readonly ShellCompDirectiveNoSpace=${Ae.ShellCompDirectiveNoSpace}
|
|
232
|
+
readonly ShellCompDirectiveNoFileComp=${Ae.ShellCompDirectiveNoFileComp}
|
|
233
|
+
readonly ShellCompDirectiveFilterFileExt=${Ae.ShellCompDirectiveFilterFileExt}
|
|
234
|
+
readonly ShellCompDirectiveFilterDirs=${Ae.ShellCompDirectiveFilterDirs}
|
|
235
|
+
readonly ShellCompDirectiveKeepOrder=${Ae.ShellCompDirectiveKeepOrder}
|
|
236
|
+
|
|
237
|
+
# Function to debug completion
|
|
238
|
+
__${r}_debug() {
|
|
239
|
+
if [[ -n \${BASH_COMP_DEBUG_FILE:-} ]]; then
|
|
240
|
+
echo "$*" >> "\${BASH_COMP_DEBUG_FILE}"
|
|
241
|
+
fi
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
# Function to handle completions
|
|
245
|
+
__${r}_complete() {
|
|
246
|
+
local cur prev words cword
|
|
247
|
+
_get_comp_words_by_ref -n "=:" cur prev words cword
|
|
248
|
+
|
|
249
|
+
local requestComp out directive
|
|
250
|
+
|
|
251
|
+
# Build the command to get completions
|
|
252
|
+
requestComp="${t} complete -- \${words[@]:1}"
|
|
253
|
+
|
|
254
|
+
# Add an empty parameter if the last parameter is complete
|
|
255
|
+
if [[ -z "$cur" ]]; then
|
|
256
|
+
requestComp="$requestComp ''"
|
|
257
|
+
fi
|
|
258
|
+
|
|
259
|
+
# Get completions from the program
|
|
260
|
+
out=$(eval "$requestComp" 2>/dev/null)
|
|
261
|
+
|
|
262
|
+
# Extract directive if present
|
|
263
|
+
directive=0
|
|
264
|
+
if [[ "$out" == *:* ]]; then
|
|
265
|
+
directive=\${out##*:}
|
|
266
|
+
out=\${out%:*}
|
|
267
|
+
fi
|
|
268
|
+
|
|
269
|
+
# Process completions based on directive
|
|
270
|
+
if [[ $((directive & $ShellCompDirectiveError)) -ne 0 ]]; then
|
|
271
|
+
# Error, no completion
|
|
272
|
+
return
|
|
273
|
+
fi
|
|
274
|
+
|
|
275
|
+
# Apply directives
|
|
276
|
+
if [[ $((directive & $ShellCompDirectiveNoSpace)) -ne 0 ]]; then
|
|
277
|
+
compopt -o nospace
|
|
278
|
+
fi
|
|
279
|
+
if [[ $((directive & $ShellCompDirectiveKeepOrder)) -ne 0 ]]; then
|
|
280
|
+
compopt -o nosort
|
|
281
|
+
fi
|
|
282
|
+
if [[ $((directive & $ShellCompDirectiveNoFileComp)) -ne 0 ]]; then
|
|
283
|
+
compopt +o default
|
|
284
|
+
fi
|
|
285
|
+
|
|
286
|
+
# Handle file extension filtering
|
|
287
|
+
if [[ $((directive & $ShellCompDirectiveFilterFileExt)) -ne 0 ]]; then
|
|
288
|
+
local filter=""
|
|
289
|
+
for ext in $out; do
|
|
290
|
+
filter="$filter|$ext"
|
|
291
|
+
done
|
|
292
|
+
filter="\\.($filter)"
|
|
293
|
+
compopt -o filenames
|
|
294
|
+
COMPREPLY=( $(compgen -f -X "!$filter" -- "$cur") )
|
|
295
|
+
return
|
|
296
|
+
fi
|
|
297
|
+
|
|
298
|
+
# Handle directory filtering
|
|
299
|
+
if [[ $((directive & $ShellCompDirectiveFilterDirs)) -ne 0 ]]; then
|
|
300
|
+
compopt -o dirnames
|
|
301
|
+
COMPREPLY=( $(compgen -d -- "$cur") )
|
|
302
|
+
return
|
|
303
|
+
fi
|
|
304
|
+
|
|
305
|
+
# Process completions
|
|
306
|
+
local IFS=$'\\n'
|
|
307
|
+
local tab=$(printf '\\t')
|
|
308
|
+
|
|
309
|
+
# Parse completions with descriptions
|
|
310
|
+
local completions=()
|
|
311
|
+
while read -r comp; do
|
|
312
|
+
if [[ "$comp" == *$tab* ]]; then
|
|
313
|
+
# Split completion and description
|
|
314
|
+
local value=\${comp%%$tab*}
|
|
315
|
+
local desc=\${comp#*$tab}
|
|
316
|
+
completions+=("$value")
|
|
317
|
+
else
|
|
318
|
+
completions+=("$comp")
|
|
319
|
+
fi
|
|
320
|
+
done <<< "$out"
|
|
321
|
+
|
|
322
|
+
# Return completions
|
|
323
|
+
COMPREPLY=( $(compgen -W "\${completions[*]}" -- "$cur") )
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
# Register completion function
|
|
327
|
+
complete -F __${r}_complete ${e}
|
|
328
|
+
`}f(R0,"d$I");dc(R0,"n");function F0(e,t){let r=e.replace(/[-:]/g,"_"),n=Ae.ShellCompDirectiveError,i=Ae.ShellCompDirectiveNoSpace,s=Ae.ShellCompDirectiveNoFileComp,o=Ae.ShellCompDirectiveFilterFileExt,a=Ae.ShellCompDirectiveFilterDirs;return`# fish completion for ${e} -*- shell-script -*-
|
|
329
|
+
|
|
330
|
+
function __${r}_debug
|
|
331
|
+
set -l file "$BASH_COMP_DEBUG_FILE"
|
|
332
|
+
if test -n "$file"
|
|
333
|
+
echo "$argv" >> $file
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
function __${r}_perform_completion
|
|
338
|
+
__${r}_debug "Starting __${r}_perform_completion"
|
|
339
|
+
|
|
340
|
+
# Extract all args except the last one
|
|
341
|
+
set -l args (commandline -opc)
|
|
342
|
+
# Extract the last arg and escape it in case it is a space or wildcard
|
|
343
|
+
set -l lastArg (string escape -- (commandline -ct))
|
|
344
|
+
|
|
345
|
+
__${r}_debug "args: $args"
|
|
346
|
+
__${r}_debug "last arg: $lastArg"
|
|
347
|
+
|
|
348
|
+
# Build the completion request command
|
|
349
|
+
set -l requestComp "${t} complete -- (string join ' ' -- (string escape -- $args[2..-1])) $lastArg"
|
|
350
|
+
|
|
351
|
+
__${r}_debug "Calling $requestComp"
|
|
352
|
+
set -l results (eval $requestComp 2> /dev/null)
|
|
353
|
+
|
|
354
|
+
# Some programs may output extra empty lines after the directive.
|
|
355
|
+
# Let's ignore them or else it will break completion.
|
|
356
|
+
# Ref: https://github.com/spf13/cobra/issues/1279
|
|
357
|
+
for line in $results[-1..1]
|
|
358
|
+
if test (string trim -- $line) = ""
|
|
359
|
+
# Found an empty line, remove it
|
|
360
|
+
set results $results[1..-2]
|
|
361
|
+
else
|
|
362
|
+
# Found non-empty line, we have our proper output
|
|
363
|
+
break
|
|
364
|
+
end
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
set -l comps $results[1..-2]
|
|
368
|
+
set -l directiveLine $results[-1]
|
|
369
|
+
|
|
370
|
+
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
|
|
371
|
+
# completions must be prefixed with the flag
|
|
372
|
+
set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
|
|
373
|
+
|
|
374
|
+
__${r}_debug "Comps: $comps"
|
|
375
|
+
__${r}_debug "DirectiveLine: $directiveLine"
|
|
376
|
+
__${r}_debug "flagPrefix: $flagPrefix"
|
|
377
|
+
|
|
378
|
+
for comp in $comps
|
|
379
|
+
printf "%s%s\\n" "$flagPrefix" "$comp"
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
printf "%s\\n" "$directiveLine"
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
# This function limits calls to __${r}_perform_completion, by caching the result
|
|
386
|
+
function __${r}_perform_completion_once
|
|
387
|
+
__${r}_debug "Starting __${r}_perform_completion_once"
|
|
388
|
+
|
|
389
|
+
if test -n "$__${r}_perform_completion_once_result"
|
|
390
|
+
__${r}_debug "Seems like a valid result already exists, skipping __${r}_perform_completion"
|
|
391
|
+
return 0
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
set --global __${r}_perform_completion_once_result (__${r}_perform_completion)
|
|
395
|
+
if test -z "$__${r}_perform_completion_once_result"
|
|
396
|
+
__${r}_debug "No completions, probably due to a failure"
|
|
397
|
+
return 1
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
__${r}_debug "Performed completions and set __${r}_perform_completion_once_result"
|
|
401
|
+
return 0
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
# This function is used to clear the cached result after completions are run
|
|
405
|
+
function __${r}_clear_perform_completion_once_result
|
|
406
|
+
__${r}_debug ""
|
|
407
|
+
__${r}_debug "========= clearing previously set __${r}_perform_completion_once_result variable =========="
|
|
408
|
+
set --erase __${r}_perform_completion_once_result
|
|
409
|
+
__${r}_debug "Successfully erased the variable __${r}_perform_completion_once_result"
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
function __${r}_requires_order_preservation
|
|
413
|
+
__${r}_debug ""
|
|
414
|
+
__${r}_debug "========= checking if order preservation is required =========="
|
|
415
|
+
|
|
416
|
+
__${r}_perform_completion_once
|
|
417
|
+
if test -z "$__${r}_perform_completion_once_result"
|
|
418
|
+
__${r}_debug "Error determining if order preservation is required"
|
|
419
|
+
return 1
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
set -l directive (string sub --start 2 $__${r}_perform_completion_once_result[-1])
|
|
423
|
+
__${r}_debug "Directive is: $directive"
|
|
424
|
+
|
|
425
|
+
set -l shellCompDirectiveKeepOrder ${Ae.ShellCompDirectiveKeepOrder}
|
|
426
|
+
set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2)
|
|
427
|
+
__${r}_debug "Keeporder is: $keeporder"
|
|
428
|
+
|
|
429
|
+
if test $keeporder -ne 0
|
|
430
|
+
__${r}_debug "This does require order preservation"
|
|
431
|
+
return 0
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
__${r}_debug "This doesn't require order preservation"
|
|
435
|
+
return 1
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# This function does two things:
|
|
439
|
+
# - Obtain the completions and store them in the global __${r}_comp_results
|
|
440
|
+
# - Return false if file completion should be performed
|
|
441
|
+
function __${r}_prepare_completions
|
|
442
|
+
__${r}_debug ""
|
|
443
|
+
__${r}_debug "========= starting completion logic =========="
|
|
444
|
+
|
|
445
|
+
# Start fresh
|
|
446
|
+
set --erase __${r}_comp_results
|
|
447
|
+
|
|
448
|
+
__${r}_perform_completion_once
|
|
449
|
+
__${r}_debug "Completion results: $__${r}_perform_completion_once_result"
|
|
450
|
+
|
|
451
|
+
if test -z "$__${r}_perform_completion_once_result"
|
|
452
|
+
__${r}_debug "No completion, probably due to a failure"
|
|
453
|
+
# Might as well do file completion, in case it helps
|
|
454
|
+
return 1
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
set -l directive (string sub --start 2 $__${r}_perform_completion_once_result[-1])
|
|
458
|
+
set --global __${r}_comp_results $__${r}_perform_completion_once_result[1..-2]
|
|
459
|
+
|
|
460
|
+
__${r}_debug "Completions are: $__${r}_comp_results"
|
|
461
|
+
__${r}_debug "Directive is: $directive"
|
|
462
|
+
|
|
463
|
+
set -l shellCompDirectiveError ${n}
|
|
464
|
+
set -l shellCompDirectiveNoSpace ${i}
|
|
465
|
+
set -l shellCompDirectiveNoFileComp ${s}
|
|
466
|
+
set -l shellCompDirectiveFilterFileExt ${o}
|
|
467
|
+
set -l shellCompDirectiveFilterDirs ${a}
|
|
468
|
+
|
|
469
|
+
if test -z "$directive"
|
|
470
|
+
set directive 0
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
|
|
474
|
+
if test $compErr -eq 1
|
|
475
|
+
__${r}_debug "Received error directive: aborting."
|
|
476
|
+
# Might as well do file completion, in case it helps
|
|
477
|
+
return 1
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
|
|
481
|
+
set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
|
|
482
|
+
if test $filefilter -eq 1; or test $dirfilter -eq 1
|
|
483
|
+
__${r}_debug "File extension filtering or directory filtering not supported"
|
|
484
|
+
# Do full file completion instead
|
|
485
|
+
return 1
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
|
|
489
|
+
set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
|
|
490
|
+
|
|
491
|
+
__${r}_debug "nospace: $nospace, nofiles: $nofiles"
|
|
492
|
+
|
|
493
|
+
# If we want to prevent a space, or if file completion is NOT disabled,
|
|
494
|
+
# we need to count the number of valid completions.
|
|
495
|
+
# To do so, we will filter on prefix as the completions we have received
|
|
496
|
+
# may not already be filtered so as to allow fish to match on different
|
|
497
|
+
# criteria than the prefix.
|
|
498
|
+
if test $nospace -ne 0; or test $nofiles -eq 0
|
|
499
|
+
set -l prefix (commandline -t | string escape --style=regex)
|
|
500
|
+
__${r}_debug "prefix: $prefix"
|
|
501
|
+
|
|
502
|
+
set -l completions (string match -r -- "^$prefix.*" $__${r}_comp_results)
|
|
503
|
+
set --global __${r}_comp_results $completions
|
|
504
|
+
__${r}_debug "Filtered completions are: $__${r}_comp_results"
|
|
505
|
+
|
|
506
|
+
# Important not to quote the variable for count to work
|
|
507
|
+
set -l numComps (count $__${r}_comp_results)
|
|
508
|
+
__${r}_debug "numComps: $numComps"
|
|
509
|
+
|
|
510
|
+
if test $numComps -eq 1; and test $nospace -ne 0
|
|
511
|
+
# We must first split on \\t to get rid of the descriptions to be
|
|
512
|
+
# able to check what the actual completion will be.
|
|
513
|
+
# We don't need descriptions anyway since there is only a single
|
|
514
|
+
# real completion which the shell will expand immediately.
|
|
515
|
+
set -l split (string split --max 1 "\\t" $__${r}_comp_results[1])
|
|
516
|
+
|
|
517
|
+
# Fish won't add a space if the completion ends with any
|
|
518
|
+
# of the following characters: @=/:.,
|
|
519
|
+
set -l lastChar (string sub -s -1 -- $split)
|
|
520
|
+
if not string match -r -q "[@=/:.,]" -- "$lastChar"
|
|
521
|
+
# In other cases, to support the "nospace" directive we trick the shell
|
|
522
|
+
# by outputting an extra, longer completion.
|
|
523
|
+
__${r}_debug "Adding second completion to perform nospace directive"
|
|
524
|
+
set --global __${r}_comp_results $split[1] $split[1].
|
|
525
|
+
__${r}_debug "Completions are now: $__${r}_comp_results"
|
|
526
|
+
end
|
|
527
|
+
end
|
|
528
|
+
|
|
529
|
+
if test $numComps -eq 0; and test $nofiles -eq 0
|
|
530
|
+
# To be consistent with bash and zsh, we only trigger file
|
|
531
|
+
# completion when there are no other completions
|
|
532
|
+
__${r}_debug "Requesting file completion"
|
|
533
|
+
return 1
|
|
534
|
+
end
|
|
535
|
+
end
|
|
536
|
+
|
|
537
|
+
return 0
|
|
538
|
+
end
|
|
539
|
+
|
|
540
|
+
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
|
|
541
|
+
# so we can properly delete any completions provided by another script.
|
|
542
|
+
# Only do this if the program can be found, or else fish may print some errors; besides,
|
|
543
|
+
# the existing completions will only be loaded if the program can be found.
|
|
544
|
+
if type -q "${e}"
|
|
545
|
+
# The space after the program name is essential to trigger completion for the program
|
|
546
|
+
# and not completion of the program name itself.
|
|
547
|
+
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
|
|
548
|
+
complete --do-complete "${e} " > /dev/null 2>&1
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
# Remove any pre-existing completions for the program since we will be handling all of them.
|
|
552
|
+
complete -c ${e} -e
|
|
553
|
+
|
|
554
|
+
# This will get called after the two calls below and clear the cached result
|
|
555
|
+
complete -c ${e} -n '__${r}_clear_perform_completion_once_result'
|
|
556
|
+
# The call to __${r}_prepare_completions will setup __${r}_comp_results
|
|
557
|
+
# which provides the program's completion choices.
|
|
558
|
+
# If this doesn't require order preservation, we don't use the -k flag
|
|
559
|
+
complete -c ${e} -n 'not __${r}_requires_order_preservation && __${r}_prepare_completions' -f -a '$__${r}_comp_results'
|
|
560
|
+
# Otherwise we use the -k flag
|
|
561
|
+
complete -k -c ${e} -n '__${r}_requires_order_preservation && __${r}_prepare_completions' -f -a '$__${r}_comp_results'
|
|
562
|
+
`}f(F0,"_$n");dc(F0,"r");function L0(e,t){let r=e.replace(/[-:]/g,"_");return`# powershell completion for ${e} -*- shell-script -*-
|
|
563
|
+
|
|
564
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
565
|
+
function __${e}_debug {
|
|
566
|
+
if ($env:BASH_COMP_DEBUG_FILE) {
|
|
567
|
+
"$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE"
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
filter __${e}_escapeStringWithSpecialChars {
|
|
572
|
+
$_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|"|\\||<|>|&','\`$&'
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
[scriptblock]$__${r}CompleterBlock = {
|
|
576
|
+
param(
|
|
577
|
+
$WordToComplete,
|
|
578
|
+
$CommandAst,
|
|
579
|
+
$CursorPosition
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
# Get the current command line and convert into a string
|
|
583
|
+
$Command = $CommandAst.CommandElements
|
|
584
|
+
$Command = "$Command"
|
|
585
|
+
|
|
586
|
+
__${e}_debug ""
|
|
587
|
+
__${e}_debug "========= starting completion logic =========="
|
|
588
|
+
__${e}_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition"
|
|
589
|
+
|
|
590
|
+
# The user could have moved the cursor backwards on the command-line.
|
|
591
|
+
# We need to trigger completion from the $CursorPosition location, so we need
|
|
592
|
+
# to truncate the command-line ($Command) up to the $CursorPosition location.
|
|
593
|
+
# Make sure the $Command is longer then the $CursorPosition before we truncate.
|
|
594
|
+
# This happens because the $Command does not include the last space.
|
|
595
|
+
if ($Command.Length -gt $CursorPosition) {
|
|
596
|
+
$Command = $Command.Substring(0, $CursorPosition)
|
|
597
|
+
}
|
|
598
|
+
__${e}_debug "Truncated command: $Command"
|
|
599
|
+
|
|
600
|
+
$ShellCompDirectiveError=${Ae.ShellCompDirectiveError}
|
|
601
|
+
$ShellCompDirectiveNoSpace=${Ae.ShellCompDirectiveNoSpace}
|
|
602
|
+
$ShellCompDirectiveNoFileComp=${Ae.ShellCompDirectiveNoFileComp}
|
|
603
|
+
$ShellCompDirectiveFilterFileExt=${Ae.ShellCompDirectiveFilterFileExt}
|
|
604
|
+
$ShellCompDirectiveFilterDirs=${Ae.ShellCompDirectiveFilterDirs}
|
|
605
|
+
$ShellCompDirectiveKeepOrder=${Ae.ShellCompDirectiveKeepOrder}
|
|
606
|
+
|
|
607
|
+
# Prepare the command to request completions for the program.
|
|
608
|
+
# Split the command at the first space to separate the program and arguments.
|
|
609
|
+
$Program, $Arguments = $Command.Split(" ", 2)
|
|
610
|
+
|
|
611
|
+
$QuotedArgs = ($Arguments -split ' ' | ForEach-Object { "'" + ($_ -replace "'", "''") + "'" }) -join ' '
|
|
612
|
+
__${e}_debug "QuotedArgs: $QuotedArgs"
|
|
613
|
+
|
|
614
|
+
$RequestComp = "& ${t} complete '--' $QuotedArgs"
|
|
615
|
+
__${e}_debug "RequestComp: $RequestComp"
|
|
616
|
+
|
|
617
|
+
# we cannot use $WordToComplete because it
|
|
618
|
+
# has the wrong values if the cursor was moved
|
|
619
|
+
# so use the last argument
|
|
620
|
+
if ($WordToComplete -ne "" ) {
|
|
621
|
+
$WordToComplete = $Arguments.Split(" ")[-1]
|
|
622
|
+
}
|
|
623
|
+
__${e}_debug "New WordToComplete: $WordToComplete"
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
# Check for flag with equal sign
|
|
627
|
+
$IsEqualFlag = ($WordToComplete -Like "--*=*" )
|
|
628
|
+
if ( $IsEqualFlag ) {
|
|
629
|
+
__${e}_debug "Completing equal sign flag"
|
|
630
|
+
# Remove the flag part
|
|
631
|
+
$Flag, $WordToComplete = $WordToComplete.Split("=", 2)
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) {
|
|
635
|
+
# If the last parameter is complete (there is a space following it)
|
|
636
|
+
# We add an extra empty parameter so we can indicate this to the go method.
|
|
637
|
+
__${e}_debug "Adding extra empty parameter"
|
|
638
|
+
# PowerShell 7.2+ changed the way how the arguments are passed to executables,
|
|
639
|
+
# so for pre-7.2 or when Legacy argument passing is enabled we need to use
|
|
640
|
+
if ($PSVersionTable.PsVersion -lt [version]'7.2.0' -or
|
|
641
|
+
($PSVersionTable.PsVersion -lt [version]'7.3.0' -and -not [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -or
|
|
642
|
+
(($PSVersionTable.PsVersion -ge [version]'7.3.0' -or [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -and
|
|
643
|
+
$PSNativeCommandArgumentPassing -eq 'Legacy')) {
|
|
644
|
+
$RequestComp="$RequestComp" + ' \`"\`"'
|
|
645
|
+
} else {
|
|
646
|
+
$RequestComp = "$RequestComp" + ' ""'
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
__${e}_debug "Calling $RequestComp"
|
|
651
|
+
# First disable ActiveHelp which is not supported for Powershell
|
|
652
|
+
$env:ActiveHelp = 0
|
|
653
|
+
|
|
654
|
+
# call the command store the output in $out and redirect stderr and stdout to null
|
|
655
|
+
# $Out is an array contains each line per element
|
|
656
|
+
Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null
|
|
657
|
+
|
|
658
|
+
# get directive from last line
|
|
659
|
+
[int]$Directive = $Out[-1].TrimStart(':')
|
|
660
|
+
if ($Directive -eq "") {
|
|
661
|
+
# There is no directive specified
|
|
662
|
+
$Directive = 0
|
|
663
|
+
}
|
|
664
|
+
__${e}_debug "The completion directive is: $Directive"
|
|
665
|
+
|
|
666
|
+
# remove directive (last element) from out
|
|
667
|
+
$Out = $Out | Where-Object { $_ -ne $Out[-1] }
|
|
668
|
+
__${e}_debug "The completions are: $Out"
|
|
669
|
+
|
|
670
|
+
if (($Directive -band $ShellCompDirectiveError) -ne 0 ) {
|
|
671
|
+
# Error code. No completion.
|
|
672
|
+
__${e}_debug "Received error from custom completion go code"
|
|
673
|
+
return
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
$Longest = 0
|
|
677
|
+
[Array]$Values = $Out | ForEach-Object {
|
|
678
|
+
# Split the output in name and description
|
|
679
|
+
$Name, $Description = $_.Split("\`t", 2)
|
|
680
|
+
__${e}_debug "Name: $Name Description: $Description"
|
|
681
|
+
|
|
682
|
+
# Look for the longest completion so that we can format things nicely
|
|
683
|
+
if ($Longest -lt $Name.Length) {
|
|
684
|
+
$Longest = $Name.Length
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
# Set the description to a one space string if there is none set.
|
|
688
|
+
# This is needed because the CompletionResult does not accept an empty string as argument
|
|
689
|
+
if (-Not $Description) {
|
|
690
|
+
$Description = " "
|
|
691
|
+
}
|
|
692
|
+
@{ Name = "$Name"; Description = "$Description" }
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
$Space = " "
|
|
697
|
+
if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) {
|
|
698
|
+
# remove the space here
|
|
699
|
+
__${e}_debug "ShellCompDirectiveNoSpace is called"
|
|
700
|
+
$Space = ""
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or
|
|
704
|
+
(($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) {
|
|
705
|
+
__${e}_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported"
|
|
706
|
+
|
|
707
|
+
# return here to prevent the completion of the extensions
|
|
708
|
+
return
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
$Values = $Values | Where-Object {
|
|
712
|
+
# filter the result
|
|
713
|
+
$_.Name -like "$WordToComplete*"
|
|
714
|
+
|
|
715
|
+
# Join the flag back if we have an equal sign flag
|
|
716
|
+
if ( $IsEqualFlag ) {
|
|
717
|
+
__${e}_debug "Join the equal sign flag back to the completion value"
|
|
718
|
+
$_.Name = $Flag + "=" + $_.Name
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
# we sort the values in ascending order by name if keep order isn't passed
|
|
723
|
+
if (($Directive -band $ShellCompDirectiveKeepOrder) -eq 0 ) {
|
|
724
|
+
$Values = $Values | Sort-Object -Property Name
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) {
|
|
728
|
+
__${e}_debug "ShellCompDirectiveNoFileComp is called"
|
|
729
|
+
|
|
730
|
+
if ($Values.Length -eq 0) {
|
|
731
|
+
# Just print an empty string here so the
|
|
732
|
+
# shell does not start to complete paths.
|
|
733
|
+
# We cannot use CompletionResult here because
|
|
734
|
+
# it does not accept an empty string as argument.
|
|
735
|
+
""
|
|
736
|
+
return
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
# Get the current mode
|
|
741
|
+
$Mode = (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq "Tab" }).Function
|
|
742
|
+
__${e}_debug "Mode: $Mode"
|
|
743
|
+
|
|
744
|
+
$Values | ForEach-Object {
|
|
745
|
+
|
|
746
|
+
# store temporary because switch will overwrite $_
|
|
747
|
+
$comp = $_
|
|
748
|
+
|
|
749
|
+
# PowerShell supports three different completion modes
|
|
750
|
+
# - TabCompleteNext (default windows style - on each key press the next option is displayed)
|
|
751
|
+
# - Complete (works like bash)
|
|
752
|
+
# - MenuComplete (works like zsh)
|
|
753
|
+
# You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function <mode>
|
|
754
|
+
|
|
755
|
+
# CompletionResult Arguments:
|
|
756
|
+
# 1) CompletionText text to be used as the auto completion result
|
|
757
|
+
# 2) ListItemText text to be displayed in the suggestion list
|
|
758
|
+
# 3) ResultType type of completion result
|
|
759
|
+
# 4) ToolTip text for the tooltip with details about the object
|
|
760
|
+
|
|
761
|
+
switch ($Mode) {
|
|
762
|
+
|
|
763
|
+
# bash like
|
|
764
|
+
"Complete" {
|
|
765
|
+
|
|
766
|
+
if ($Values.Length -eq 1) {
|
|
767
|
+
__${e}_debug "Only one completion left"
|
|
768
|
+
|
|
769
|
+
# insert space after value
|
|
770
|
+
[System.Management.Automation.CompletionResult]::new($($comp.Name | __${e}_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
|
|
771
|
+
|
|
772
|
+
} else {
|
|
773
|
+
# Add the proper number of spaces to align the descriptions
|
|
774
|
+
while($comp.Name.Length -lt $Longest) {
|
|
775
|
+
$comp.Name = $comp.Name + " "
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
# Check for empty description and only add parentheses if needed
|
|
779
|
+
if ($($comp.Description) -eq " " ) {
|
|
780
|
+
$Description = ""
|
|
781
|
+
} else {
|
|
782
|
+
$Description = " ($($comp.Description))"
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
[System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)")
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
# zsh like
|
|
790
|
+
"MenuComplete" {
|
|
791
|
+
# insert space after value
|
|
792
|
+
# MenuComplete will automatically show the ToolTip of
|
|
793
|
+
# the highlighted value at the bottom of the suggestions.
|
|
794
|
+
[System.Management.Automation.CompletionResult]::new($($comp.Name | __${e}_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
# TabCompleteNext and in case we get something unknown
|
|
798
|
+
Default {
|
|
799
|
+
# Like MenuComplete but we don't want to add a space here because
|
|
800
|
+
# the user need to press space anyway to get the completion.
|
|
801
|
+
# Description will not be shown because that's not possible with TabCompleteNext
|
|
802
|
+
[System.Management.Automation.CompletionResult]::new($($comp.Name | __${e}_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
Register-ArgumentCompleter -CommandName '${e}' -ScriptBlock $__${r}CompleterBlock
|
|
810
|
+
`}f(L0,"$$k");dc(L0,"i");var gP=Object.defineProperty,wo=f((e,t)=>gP(e,"name",{value:t,configurable:!0}),"h$G");const Ae={ShellCompDirectiveError:1,ShellCompDirectiveNoSpace:2,ShellCompDirectiveNoFileComp:4,ShellCompDirectiveFilterFileExt:8,ShellCompDirectiveFilterDirs:16,ShellCompDirectiveKeepOrder:32,ShellCompDirectiveDefault:0};var yP=class{static{f(this,"m")}static{wo(this,"o")}name;variadic;command;handler;constructor(t,r,n,i=!1){this.command=t,this.name=r,this.handler=n,this.variadic=i}},vP=class{static{f(this,"d")}static{wo(this,"s")}value;description;command;handler;alias;isBoolean;constructor(t,r,n,i,s,o){this.command=t,this.value=r,this.description=n,this.handler=i,this.alias=s,this.isBoolean=o}},Kh=class{static{f(this,"c")}static{wo(this,"c")}value;description;options=new Map;arguments=new Map;parent;constructor(t,r){this.value=t,this.description=r}option(t,r,n,i){let s,o,a;typeof n=="function"?(s=n,o=i,a=!1):typeof n=="string"?(s=void 0,o=n,a=!0):(s=void 0,o=void 0,a=!0);let l=new vP(this,t,r,s,o,a);return this.options.set(t,l),this}argument(t,r,n=!1){let i=new yP(this,t,r,n);return this.arguments.set(t,i),this}},bP=class extends Kh{static{f(this,"u")}static{wo(this,"l")}commands=new Map;completions=[];directive=Ae.ShellCompDirectiveDefault;constructor(){super("","")}command(t,r){let n=new Kh(t,r);return this.commands.set(t,n),n}stripOptions(t){let r=[],n=0;for(;n<t.length;){let i=t[n];if(i.startsWith("-")){n++;let s=!1,o=this.findOption(this,i);if(o)s=o.isBoolean??!1;else for(let[,a]of this.commands){let l=this.findOption(a,i);if(l){s=l.isBoolean??!1;break}}!s&&n<t.length&&!t[n].startsWith("-")&&n++}else r.push(i),n++}return r}matchCommand(t){t=this.stripOptions(t);let r=[],n=[],i=null;for(let s=0;s<t.length;s++){let o=t[s];r.push(o);let a=this.commands.get(r.join(" "));if(a)i=a;else{n=t.slice(s,t.length);break}}return[i||this,n]}shouldCompleteFlags(t,r){if(r.startsWith("-"))return!0;if(t?.startsWith("-")){let n=this.findOption(this,t);if(!n){for(let[,i]of this.commands)if(n=this.findOption(i,t),n)break}return!(n&&n.isBoolean)}return!1}shouldCompleteCommands(t){return!t.startsWith("-")}handleFlagCompletion(t,r,n,i){let s;if(n.includes("=")){let[o]=n.split("=");s=o}else if(i?.startsWith("-")){let o=this.findOption(t,i);o&&!o.isBoolean&&(s=i)}if(s){let o=this.findOption(t,s);if(o?.handler){let a=[];o.handler.call(o,(l,c)=>a.push({value:l,description:c}),t.options),this.completions=a}return}if(n.startsWith("-")){let o=n.startsWith("-")&&!n.startsWith("--"),a=n.replace(/^-+/,"");for(let[l,c]of t.options)o&&c.alias&&`-${c.alias}`.startsWith(n)?this.completions.push({value:`-${c.alias}`,description:c.description}):!o&&l.startsWith(a)&&this.completions.push({value:`--${l}`,description:c.description})}}findOption(t,r){let n=t.options.get(r);if(n||(n=t.options.get(r.replace(/^-+/,"")),n))return n;for(let[i,s]of t.options)if(s.alias&&`-${s.alias}`===r)return s}handleCommandCompletion(t,r){let n=this.stripOptions(t);for(let[i,s]of this.commands){if(i==="")continue;let o=i.split(" ");o.slice(0,n.length).every((a,l)=>a===n[l])&&o[n.length]?.startsWith(r)&&this.completions.push({value:o[n.length],description:s.description})}}handlePositionalCompletion(t,r){let n=this.stripOptions(r),i=t.value.split(" ").length,s=Math.max(0,n.length-i),o=Array.from(t.arguments.entries());if(o.length>0){let a;if(s<o.length){let[l,c]=o[s];a=c}else{let l=o[o.length-1][1];l.variadic&&(a=l)}if(a&&a.handler&&typeof a.handler=="function"){let l=[];a.handler.call(a,(c,u)=>l.push({value:c,description:u}),t.options),this.completions.push(...l)}}}complete(t){this.directive=Ae.ShellCompDirectiveNoFileComp;let r=new Set;this.completions.filter(n=>r.has(n.value)?!1:(r.add(n.value),!0)).filter(n=>{if(t.includes("=")){let[,i]=t.split("=");return n.value.startsWith(i)}return n.value.startsWith(t)}).forEach(n=>console.log(`${n.value} ${n.description??""}`)),console.log(`:${this.directive}`)}parse(t){this.completions=[];let r=t[t.length-1]==="";r&&t.pop();let n=t[t.length-1]||"",i=t.slice(0,-1);r&&(n!==""&&i.push(n),n="");let[s]=this.matchCommand(i),o=i[i.length-1];this.shouldCompleteFlags(o,n)?this.handleFlagCompletion(s,i,n,o):(this.shouldCompleteCommands(n)&&this.handleCommandCompletion(i,n),s&&s.arguments.size>0&&this.handlePositionalCompletion(s,i)),this.complete(n)}setup(t,r,n){switch(WE(n==="zsh"||n==="bash"||n==="fish"||n==="powershell","Unsupported shell"),n){case"zsh":{let i=N0(t,r);console.log(i);break}case"bash":{let i=R0(t,r);console.log(i);break}case"fish":{let i=F0(t,r);console.log(i);break}case"powershell":{let i=L0(t,r);console.log(i);break}}}};const I0=new bP;function $P(e,t,r){I0.setup(t,r,e)}f($P,"w$t");wo($P,"d");var wP=Object.defineProperty,T0=f((e,t)=>wP(e,"name",{value:t,configurable:!0}),"c$N"),kP=Object.defineProperty,Ld=T0((e,t)=>kP(e,"name",{value:t,configurable:!0}),"a"),SP=Object.defineProperty,EP=Ld((e,t)=>SP(e,"name",{value:t,configurable:!0}),"n");let Id=class extends ge{static{f(this,"m")}static{T0(this,"p")}static{Ld(this,"l")}static{EP(this,"CompletionError")}troubleshooting;constructor(t,r,n=[]){super(t,r,{troubleshooting:n}),this.name="CompletionError",this.troubleshooting=n,n.length>0&&(this.hint=n.join(`
|
|
811
|
+
`))}};var DP=Object.defineProperty,yr=Ld((e,t)=>DP(e,"name",{value:t,configurable:!0}),"s");const jp=["bash","zsh","fish","powershell"],xp=["node","bun","deno"],CP=yr(e=>"Deno"in e,"hasDeno"),AP=yr(e=>"Bun"in e,"hasBun"),Yh=yr(()=>CP(globalThis)?"deno":AP(globalThis)?"bun":"node","detectRuntime"),Xh=yr(e=>{const t=e?.starshipShell??e?.shell;if(t){const i=t.toLowerCase();if(i.includes("zsh"))return"zsh";if(i.includes("bash"))return"bash";if(i.includes("fish"))return"fish"}const r=e?.psModulePath,n=e?.prompt;if(r||n?.includes("PS"))return"powershell";if(e?.comSpec?.toLowerCase().includes("cmd.exe"))return"bash"},"detectShell"),Qh=I0,OP=yr((e,t)=>{for(const r of t)r.hidden||(r.name&&e.option(r.name,r.description??""),r.alias&&e.option(r.alias,r.description??""))},"registerCommandOptions"),jP=yr((e,t)=>{for(const[r,n]of t){if(n.name!==r||n.hidden)continue;const i=e.command(n.name,n.description??"");n.options&&OP(i,n.options)}},"registerCommands"),xP=yr(e=>{if(!jp.includes(e))throw new Id(`Invalid shell type: ${e}`,"INVALID_SHELL",[`Valid shells are: ${jp.join(", ")}`,"Shell will be auto-detected if not specified"])},"validateShell"),PP=yr(e=>{if(e&&!xp.includes(e))throw new Id(`Invalid runtime: ${e}`,"INVALID_RUNTIME",[`Valid runtimes are: ${xp.join(", ")}`,"Runtime will be auto-detected if not specified"])},"validateRuntime"),NP=yr((e,t)=>{e.error("Could not detect current shell");const r=[`Usage: ${t} completion --shell=<bash|zsh|fish|powershell> [--runtime=<node|bun|deno>]`,"","Examples:"," # Install completions for zsh:",` ${t} completion --shell=zsh > ~/.${t}-completion.zsh`,` echo 'source ~/.${t}-completion.zsh' >> ~/.zshrc`,""," # Install completions for bash with custom runtime:",` ${t} completion --shell=bash --runtime=bun > ~/.${t}-completion.bash`,` echo 'source ~/.${t}-completion.bash' >> ~/.bashrc`,""," # Install completions for fish:",` ${t} completion --shell=fish > ~/.config/fish/completions/${t}.fish`].join(`
|
|
812
|
+
`);e.info(r)},"printUsageInstructions"),RP={description:"Generate shell completion scripts",env:[{description:"Shell path (Unix-like systems). Used for shell detection.",name:"SHELL",type:String},{description:"Starship shell configuration. Takes precedence over SHELL for detection.",name:"STARSHIP_SHELL",type:String},{description:"PowerShell module path (Windows). Used for PowerShell detection.",name:"PSModulePath",type:String},{description:"Command prompt variable (Windows). Used for PowerShell detection.",name:"PROMPT",type:String},{description:"Command processor (Windows). Used for Windows Command Prompt detection.",name:"ComSpec",type:String}],execute:yr(async({env:e,logger:t,options:r,runtime:n})=>{const i=n.getCliName(),s=r.shell??Xh(e);if(!s){NP(t,i);return}try{xP(s),PP(r.runtime),jP(Qh,n.getCommands());const o=`${r.runtime??Yh()} ${i}`;Qh.setup(i,o,s)}catch(o){if(o instanceof Id){const a=[`Failed to generate completion script: ${o.message}`,`Error code: ${o.code}`];throw o.troubleshooting.length>0&&a.push("","Troubleshooting:",...o.troubleshooting.map(l=>` • ${l}`)),t.error(a.join(`
|
|
813
|
+
`)),o}else{const a=["Failed to generate completion script",`Error: ${o instanceof Error?o.message:String(o)}`,"","Troubleshooting:"," • Ensure @bomb.sh/tab is installed: pnpm add @bomb.sh/tab",` • Verify shell is supported: ${jp.join(", ")}`,` • Verify runtime is supported: ${xp.join(", ")}`," • Check that your CLI name is correct"];t.error(a.join(`
|
|
814
|
+
`))}}},"execute"),name:"completion",options:[{defaultOption:!0,defaultValue:Xh(),description:"Shell type (bash, zsh, fish, powershell). Defaults to current shell if detected.",name:"shell",type:String,typeLabel:"{underline shell}"},{defaultOption:!0,defaultValue:Yh(),description:"JavaScript runtime (node, bun, deno). Defaults to current runtime if detected.",name:"runtime",type:String,typeLabel:"{underline runtime}"}]};var FP=Object.defineProperty,Ni=f((e,t)=>FP(e,"name",{value:t,configurable:!0}),"t$L");function fc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}f(fc,"getDefaultExportFromCjs");Ni(fc,"getDefaultExportFromCjs");function LP(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}f(LP,"getDefaultExportFromNamespaceIfPresent");Ni(LP,"getDefaultExportFromNamespaceIfPresent");function IP(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}f(IP,"getDefaultExportFromNamespaceIfNotNamed");Ni(IP,"getDefaultExportFromNamespaceIfNotNamed");function Td(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=Ni(f(function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:Ni(function(){return e[n]},"get")})}),r}f(Td,"getAugmentedNamespace");Ni(Td,"getAugmentedNamespace");var TP=Object.defineProperty,BP=f((e,t)=>TP(e,"name",{value:t,configurable:!0}),"r$S"),_P=Object.defineProperty,MP=BP((e,t)=>_P(e,"name",{value:t,configurable:!0}),"r"),VP=Object.defineProperty,WP=MP((e,t)=>VP(e,"name",{value:t,configurable:!0}),"o");const UP=WP(()=>{try{const e=require("node:module");if(typeof e.enableCompileCache=="function"){e.enableCompileCache();return}}catch{}try{require("v8-compile-cache")}catch{}},"enableCompileCache");var GP=Object.defineProperty,qP=f((e,t)=>GP(e,"name",{value:t,configurable:!0}),"u$T"),zP=Object.defineProperty,B0=qP((e,t)=>zP(e,"name",{value:t,configurable:!0}),"p");const HP=Ze(import.meta.url),Es=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_0=B0(e=>{if(typeof Es<"u"&&Es.versions&&Es.versions.node){const[t,r]=Es.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Es.getBuiltinModule(e)}return HP(e)},"__cjs_getBuiltinModule"),{execFileSync:JP}=_0("node:child_process"),{totalmem:KP}=_0("node:os");var YP=Object.defineProperty,mc=B0((e,t)=>YP(e,"name",{value:t,configurable:!0}),"r");const XP=/--max-old-space-size=(\d+)/,QP=/--max-semi-space-size=(\d+)/,ZP=mc(e=>Math.floor(KP()/1024/1024*e),"getDefaultMaxOldSpaceSize"),eN=mc(e=>e<=512?4:e<=1024?8:e<=2048?16:e<=4096?32:e<=8192?64:Math.floor(Math.log2(e))*8,"getSemiSpaceSize"),Zh=mc((e,t)=>{for(const r of t){const n=e.exec(r);if(n)return Number.parseInt(n[1],10)}},"extractFlag"),tN=mc(e=>{const t=e?.maxOldSpacePercent??.75,r=[...Hb()],n=[...Pa()],i=Zh(XP,r),s=Zh(QP,r);if(i!==void 0&&s!==void 0)return;const o=i??ZP(t),a=s??eN(o),l=[];if(i===void 0&&l.push(`--max-old-space-size=${String(o)}`),s===void 0&&l.push(`--max-semi-space-size=${String(a)}`),l.length!==0)try{JP(Jb(),[...l,...r,...n.slice(1)],{env:$n(),stdio:"inherit"}),Qr(0)}catch(c){const u=c.status;Qr(typeof u=="number"?u:1)}},"applyHeapTuning");var rN=Object.defineProperty,nN=f((e,t)=>rN(e,"name",{value:t,configurable:!0}),"T$p"),iN=Object.defineProperty,hc=nN((e,t)=>iN(e,"name",{value:t,configurable:!0}),"N");const sN=Ze(import.meta.url),Ds=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,oN=hc(e=>{if(typeof Ds<"u"&&Ds.versions&&Ds.versions.node){const[t,r]=Ds.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ds.getBuiltinModule(e)}return sN(e)},"__cjs_getBuiltinModule"),{createRequire:aN}=oN("node:module");var cN=Object.defineProperty,lN=hc((e,t)=>cN(e,"name",{value:t,configurable:!0}),"A$2"),uN=Object.defineProperty,Bd=lN((e,t)=>uN(e,"name",{value:t,configurable:!0}),"$"),pN=Object.defineProperty,dN=Bd((e,t)=>pN(e,"name",{value:t,configurable:!0}),"r$1");const fN=dN(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
815
|
+
`),"normalizeLF"),mN=globalThis.process??Object.create(null),eg={versions:{}},tg=new Proxy(mN,{get(e,t){if(t in e)return e[t];if(t in eg)return eg[t]}});var hN=Object.defineProperty,gN=Bd((e,t)=>hN(e,"name",{value:t,configurable:!0}),"b");const yN=gN((e,t,r,n)=>{const i={column:0,line:-1,...e.start},s={...i,...e.end},o=i.line,a=i.column,l=s.line,c=s.column;let u=Math.max(o-(r+1),0),d=Math.min(t.length,l+n);o===-1&&(u=0),l===-1&&(d=t.length);const p=l-o,m={};if(p)for(let g=0;g<=p;g++){const $=g+o;if(!a)m[$]=!0;else if(g===0){const S=t[$-1]?.length;m[$]=[a,(S??0)-a+1]}else if(g===p)m[$]=[0,c];else{const S=t[$-g]?.length;m[$]=[0,S]}}else a===c?m[o]=a?[a,0]:!0:m[o]=[a,(c??0)-(a??0)];return{end:d,markerLines:m,start:u}},"getMarkerLines");var vN=Object.defineProperty,Xo=Bd((e,t)=>vN(e,"name",{value:t,configurable:!0}),"t");const bN=tg.platform==="win32"&&!tg.env?.WT_SESSION?">":"❯",$N=Xo((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:Xo(g=>g,"gutter"),marker:Xo(g=>g,"marker"),message:Xo(g=>g,"message"),...r?.color}},i=typeof t.start.column=="number";let s=fN(e).split(`
|
|
816
|
+
`);typeof n.tabWidth=="number"&&(s=s.map(g=>g.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:a,start:l}=yN(t,s,n.linesAbove,n.linesBelow),c=String(o).length,{gutter:u,marker:d,message:p}=n.color;let m=s.slice(l,o).map((g,$)=>{const S=l+1+$,k=a[S],v=` ${String(S)}`.slice(-c),h=!a[S+1],b=` ${v}${n.showGutter?" |":""}`;if(k){let w="";if(Array.isArray(k)){const y=g.replaceAll(/[^\t]/g," ").slice(0,Math.max(k[0]-1,0)),D=k[1]||1;w=[`
|
|
817
|
+
`,n.prefix+u(b.replaceAll(/\d/g," "))," ",y,d("^").repeat(D)].join(""),h&&n.message&&(w+=` ${p(n.message)}`)}return[n.prefix+d(bN),u(b),g.length>0?` ${g}`:"",w].join("")}return`${n.prefix} ${u(b)}${g.length>0?` ${g}`:""}`}).join(`
|
|
818
|
+
`);return n.message&&!i&&(m=`${n.prefix+" ".repeat(c+1)+n.message}
|
|
819
|
+
${m}`),m},"codeFrame");var wN=Object.defineProperty,kN=hc((e,t)=>wN(e,"name",{value:t,configurable:!0}),"x$1"),SN=Object.defineProperty,EN=kN((e,t)=>SN(e,"name",{value:t,configurable:!0}),"x"),DN=Object.defineProperty,Br=EN((e,t)=>DN(e,"name",{value:t,configurable:!0}),"u");const In=Br((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),Tn="<unknown>",CN=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,AN=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,ON=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,jN=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,xN=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,PN=/in\s(.*)\s\(at\s(.+)\)\sat/,NN=/^(?:.*@)?(.*):(\d+):(\d+)$/,RN=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,FN=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,LN=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,rg=/\(error: (.*)\)/,IN=/at\s/,TN=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,BN=/^\s+|\s+$/g,_N=/\S*(?:Error: |AggregateError:)/,M0=/^Anonymous function$/,MN=/^\s*in\s.*/,VN=/^.*?\s*at\s.*/,WN=/^.*?\s*@.*|\[native code\]/,V0=Br((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:Tn,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),W0=Br((e,t)=>{const r=ON.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),UN=Br(e=>{const t=PN.exec(e);if(t){In(`parse nested node error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const n=t[2].split(":");return{column:n[2]?+n[2]:void 0,file:n[0],line:n[1]?+n[1]:void 0,methodName:t[1]??Tn,raw:e,type:void 0}}const r=xN.exec(e);if(r){In(`parse node error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n={column:r[4]?+r[4]:void 0,file:r[2]?r[2].replace(IN,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??Tn,raw:e,type:e.startsWith("internal")?"internal":void 0};return W0(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),GN=Br(e=>{const t=CN.exec(e);if(t){In(`parse chrome error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const r=t[2]?.startsWith("native"),n=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,s;if(n){const c=AN.exec(e);if(c){const u=TN.exec(c[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):c[2]&&(t[2]=c[1]),c[2]&&(i={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=jN.exec(e);u&&(s={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},i={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[o,a]=V0(t[1]?t[1].replace(M0,"<anonymous>"):Tn,t[2]),l={column:t[4]?+t[4]:void 0,evalOrigin:i,file:a,line:t[3]?+t[3]:void 0,methodName:o,raw:e,type:n?"eval":r?"native":void 0};return s?(l.column=s.column,l.file=s.file,l.line=s.line):W0(l,`${a}:${t[3]}:${t[4]}`),l}},"parseChromium"),qN=Br((e,t)=>{const r=RN.exec(e);if(r){In(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&FN.exec(r[3]);let s;n&&i&&(r[3]=i[1],s={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0,methodName:"eval",raw:e,type:"eval"},r[4]=i[2]);const[o,a]=V0(r[1]?r[1].replace(M0,"<anonymous>"):Tn,r[3]);let l;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?l=t.column:!n&&r[5]&&(l=+r[5]);let c;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?c=t.line:r[4]&&(c=+r[4]),{column:l,evalOrigin:s,file:a,line:c,methodName:o,raw:e,type:n?"eval":a.includes("[native code]")?"native":void 0}}},"parseGecko"),zN=Br((e,t)=>{const r=LN.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return In(`parse firefox error stack line: "${e}"`,`found: ${JSON.stringify(r)}`),{column:r[4]?+r[4]:t?.column??void 0,file:r[2],line:r[3]?+r[3]:t?.line??void 0,methodName:r[1]||Tn,raw:e,type:void 0}},"parseFirefox"),HN=Br(e=>{const t=NN.exec(e);if(t)return In(`parse react android native error stack line: "${e}"`,`found: ${JSON.stringify(t)}`),{column:t[3]?+t[3]:void 0,file:t[1],line:t[2]?+t[2]:void 0,methodName:Tn,raw:e,type:void 0}},"parseReactAndroidNative"),U0=Br((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
|
|
820
|
+
`).map(s=>(rg.test(s)?s.replace(rg,"$1"):s).replaceAll(BN,"")).filter(s=>!_N.test(s)&&s!=="eval code");return t&&(i=i.filter(s=>t(s))),i=i.slice(0,r),i.reduce((s,o,a)=>{if(!o||o.length>1024)return s;let l;if(MN.test(o))l=UN(o);else if(VN.test(o))l=GN(o);else if(WN.test(o)){let c;if(a===0){const u=e,d=u.columnNumber,p=u.lineNumber,m=u.line,g=u.column;d||p?c={column:d,line:p,type:"firefox"}:(m||g)&&(c={column:g,line:m,type:"safari"})}l=zN(o,c)??qN(o,c)}else l=HN(o);return l?s.push(l):In(`parse error stack line: "${o}"`,"not parser found"),s},[])},"parseStacktrace");var JN=Object.defineProperty,KN=hc((e,t)=>JN(e,"name",{value:t,configurable:!0}),"p"),YN=Object.defineProperty,G0=KN((e,t)=>YN(e,"name",{value:t,configurable:!0}),"m");const XN=aN(import.meta.url),vi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_d=G0(e=>{if(typeof vi<"u"&&vi.versions&&vi.versions.node){const[t,r]=vi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return vi.getBuiltinModule(e)}return XN(e)},"__cjs_getBuiltinModule"),{existsSync:QN,readFileSync:ZN}=_d("node:fs"),{relative:eR}=_d("node:path"),{cwd:tR}=vi,{fileURLToPath:rR}=_d("node:url");var nR=Object.defineProperty,He=G0((e,t)=>nR(e,"name",{value:t,configurable:!0}),"o");const Gi=He((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),iR=He((e,t)=>{const r=e.replace("async file:","file:");return eR(t,r.startsWith("file:")?rR(r):r)},"getRelativePath"),sR=He((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),q0=He((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},s)=>`${Gi(i,n,s)}${sR(e,r,t)}
|
|
821
|
+
`,"getMessage"),z0=He((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const s=Gi(n,r,i);let o="";if(Array.isArray(e.hint))for(const a of e.hint)o+=`${s+a}
|
|
822
|
+
`;else o+=s+e.hint;return t.hint(o)},"getHint"),Md=He((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:s},o=0)=>{const a=n?iR(e.file,r):e.file,{fileLine:l,method:c}=t;return`${Gi(s,i,o)}at ${e.methodName?`${c(e.methodName)} `:""}${l(a)}:${l(e.line?.toString()??"")}`},"getMainFrame"),H0=He((e,{color:t,indentation:r,linesAbove:n,linesBelow:i,prefix:s,showGutter:o,showLineNumbers:a,tabWidth:l},c)=>{if(e.file===void 0)return;const u=e.file.replace("file://","");if(!QN(u))return;const d=ZN(u,"utf8");return $N(d,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:Gi(s,r,c),showGutter:o,showLineNumbers:a,tabWidth:l})},"getCode"),J0=He((e,t,r)=>{if(e.errors.length===0)return;let n=`${Gi(t.prefix,t.indentation,r)}Errors:
|
|
823
|
+
|
|
824
|
+
`,i=!0;for(const s of e.errors)i?i=!1:n+=`
|
|
825
|
+
|
|
826
|
+
`,n+=Y0(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
|
|
827
|
+
${n}`},"getErrors"),K0=He((e,t,r)=>{let n=`${Gi(t.prefix,t.indentation,r)}Caused by:
|
|
828
|
+
|
|
829
|
+
`;const i=e.cause;n+=q0(i,t,r);const s=U0(i).shift(),o=z0(i,t,r);if(o&&(n+=`${o}
|
|
830
|
+
`),s&&(n+=Md(s,t,r),!t.hideErrorCauseCodeView)){const a=H0(s,t,r);a!==void 0&&(n+=`
|
|
831
|
+
${a}`)}if(i.cause)n+=`
|
|
832
|
+
${K0(i,t,r+1)}`;else if(i instanceof AggregateError){const a=J0(i,t,r);a!==void 0&&(n+=`
|
|
833
|
+
${a}`)}return`
|
|
834
|
+
${n}`},"getCause"),oR=He((e,t)=>(e.length>0?`
|
|
835
|
+
`:"")+e.map(r=>Md(r,t)).join(`
|
|
836
|
+
`),"getStacktrace"),Y0=He((e,t,r)=>{const n={cwd:tR(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...t,color:{fileLine:He(o=>o,"fileLine"),gutter:He(o=>o,"gutter"),hint:He(o=>o,"hint"),marker:He(o=>o,"marker"),message:He(o=>o,"message"),method:He(o=>o,"method"),title:He(o=>o,"title"),...t.color}},i=U0(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),s=i.shift();return[t.hideMessage?void 0:q0(e,n,r),z0(e,n,r),s?Md(s,n,r):void 0,s&&!n.hideErrorCodeView?H0(s,n,r):void 0,e instanceof AggregateError?J0(e,n,r):void 0,e.cause===void 0?void 0:K0(e,n,r),i.length>0?oR(i,n):void 0].filter(Boolean).join(`
|
|
837
|
+
`).replaceAll("\\","/")},"internalRenderError"),aR=He((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Y0(e,t,0)},"renderError");var cR=Object.defineProperty,lR=f((e,t)=>cR(e,"name",{value:t,configurable:!0}),"i$U"),uR=Object.defineProperty,pR=lR((e,t)=>uR(e,"name",{value:t,configurable:!0}),"n"),dR=Object.defineProperty,ng=pR((e,t)=>dR(e,"name",{value:t,configurable:!0}),"n");const fR=ng((e={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:ng((t,r)=>{const{logger:n,runtime:i}=r,{detailed:s=!1,exitOnError:o=!0,formatter:a,logErrors:l=!0,renderOptions:c={}}=e;if(l)if(a)n.error(a(t));else if(s){const u=i.getCwd(),d=aR(t,{cwd:u,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...c});n.error(d)}else n.error(t);o&&Qr(1)},"handleError"),version:"1.0.0"}),"errorHandlerPlugin");var mR=Object.defineProperty,X0=f((e,t)=>mR(e,"name",{value:t,configurable:!0}),"o$V"),hR=Object.defineProperty,Q0=X0((e,t)=>hR(e,"name",{value:t,configurable:!0}),"o"),gR=Object.defineProperty,yR=Q0((e,t)=>gR(e,"name",{value:t,configurable:!0}),"o");let Ri=class extends Error{static{f(this,"s")}static{X0(this,"u")}static{Q0(this,"n")}static{yR(this,"NotFoundError")}constructor(t){super(`ENOENT: ${t}`)}get code(){return"ENOENT"}set code(t){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(t){throw new Error("Cannot overwrite name of NotFoundError")}};const Z0=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],ig={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},sg={"node_modules/.deno/":"deno","node_modules/.pnpm/":"pnpm","node_modules/.yarn-state.yml":"yarn","node_modules/.yarn_integrity":"yarn","node_modules/.package-lock.json":"npm",".pnp.cjs":"yarn",".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};var vR=Object.defineProperty,vr=f((e,t)=>vR(e,"name",{value:t,configurable:!0}),"i$T");async function Ra(e,t){try{const r=await db.stat(e);return t==="file"?r.isFile():r.isDirectory()}catch{return!1}}f(Ra,"u$P");vr(Ra,"pathExists");function bR(){const e=Mi.env.npm_config_user_agent;if(!e)return null;const t=e.split("/")[0];return Z0.includes(t)?t:null}f(bR,"b$G");vr(bR,"getUserAgent");function*e$(e=Mi.cwd()){let t=Pr.resolve(e);const{root:r}=Pr.parse(t);for(;t&&t!==r;)yield t,t=Pr.dirname(t)}f(e$,"M$k");vr(e$,"lookup");async function Pp(e,t){return!e||!await Ra(e,"file")?null:await n$(e,t)}f(Pp,"m$D");vr(Pp,"parsePackageJson");async function t$(e={}){const{cwd:t,strategies:r=["lockfile","packageManager-field","devEngines-field"]}=e;let n;if(typeof e.stopDir=="string"){const i=Pr.resolve(e.stopDir);n=vr(s=>s===i,"stopDir")}else n=e.stopDir;for(const i of e$(t)){for(const s of r)switch(s){case"lockfile":{for(const o of Object.keys(ig))if(await Ra(Pr.join(i,o),"file")){const a=ig[o];return await Pp(Pr.join(i,"package.json"),e)||{name:a,agent:a}}break}case"packageManager-field":case"devEngines-field":{const o=await Pp(Pr.join(i,"package.json"),e);if(o)return o;break}case"install-metadata":{for(const o of Object.keys(sg)){const a=o.endsWith("/")?"dir":"file";if(await Ra(Pr.join(i,o),a)){const l=sg[o],c=l==="yarn"?i$(o)?"yarn":"yarn@berry":l;return{name:l,agent:c}}}break}}if(n?.(i))break}return null}f(t$,"A$q");vr(t$,"detect");function r$(e){const t=vr(r=>r?.match(/\d+(\.\d+){0,2}/)?.[0]??r,"handelVer");if(typeof e.packageManager=="string"){const[r,n]=e.packageManager.replace(/^\^/,"").split("@");return{name:r,ver:t(n)}}if(typeof e.devEngines?.packageManager?.name=="string")return{name:e.devEngines.packageManager.name,ver:t(e.devEngines.packageManager.version)}}f(r$,"h$D");vr(r$,"getNameAndVer");async function n$(e,t){try{const r=await db.readFile(e,"utf8"),n=t.packageJsonParser?await t.packageJsonParser(r,e):JSON.parse(r);let i;const s=r$(n);if(s){const o=s.name,a=s.ver;let l=a;return o==="yarn"&&a&&Number.parseInt(a)>1?(i="yarn@berry",l="berry",{name:o,agent:i,version:l}):o==="pnpm"&&a&&Number.parseInt(a)<7?(i="pnpm@6",{name:o,agent:i,version:l}):Z0.includes(o)?(i=o,{name:o,agent:i,version:l}):t.onUnknown?.(n.packageManager)??null}}catch{}return null}f(n$,"j$n");vr(n$,"handlePackageManager");function i$(e){return e.endsWith(".yarn_integrity")}f(i$,"E$n");vr(i$,"isMetadataYarnClassic");var $R=Object.defineProperty,Vd=f((e,t)=>$R(e,"name",{value:t,configurable:!0}),"i$S");async function Wd(e=Mi.cwd()){return(await t$({cwd:e,onUnknown(t){console.warn("[@antfu/install-pkg] Unknown packageManager:",t)}}))?.agent||null}f(Wd,"c$K");Vd(Wd,"detectPackageManager");async function s$(e,t={}){const r=t.packageManager||await Wd(t.cwd)||"npm",[n]=r.split("@");Array.isArray(e)||(e=[e]);const i=(typeof t.additionalArgs=="function"?t.additionalArgs(n,r):t.additionalArgs)||[];return t.preferOffline&&(r==="yarn@berry"?i.unshift("--cached"):i.unshift("--prefer-offline")),n==="pnpm"&&(i.unshift("--prod=false"),rc(fb(t.cwd??Mi.cwd(),"pnpm-workspace.yaml"))&&i.unshift("-w")),mb(n,[n==="yarn"?"add":"install",t.dev?"-D":"",...i,...e].filter(Boolean),{nodeOptions:{stdio:t.silent?"ignore":"inherit",cwd:t.cwd},throwOnError:!0})}f(s$,"p$F");Vd(s$,"installPackage");async function wR(e,t={}){const r=t.packageManager||await Wd(t.cwd)||"npm",[n]=r.split("@");Array.isArray(e)||(e=[e]);const i=t.additionalArgs||[];return n==="pnpm"&&rc(fb(t.cwd??Mi.cwd(),"pnpm-workspace.yaml"))&&i.unshift("-w"),mb(n,[n==="yarn"?"remove":"uninstall",t.dev?"-D":"",...i,...e].filter(Boolean),{nodeOptions:{stdio:t.silent?"ignore":"inherit",cwd:t.cwd},throwOnError:!0})}f(wR,"h$C");Vd(wR,"uninstallPackage");var kR=Object.defineProperty,_r=f((e,t)=>kR(e,"name",{value:t,configurable:!0}),"c$J");const Ud=Symbol.for("yaml.alias"),Np=Symbol.for("yaml.document"),Zr=Symbol.for("yaml.map"),o$=Symbol.for("yaml.pair"),pr=Symbol.for("yaml.scalar"),qi=Symbol.for("yaml.seq"),_t=Symbol.for("yaml.node.type"),zi=_r(e=>!!e&&typeof e=="object"&&e[_t]===Ud,"isAlias"),Hi=_r(e=>!!e&&typeof e=="object"&&e[_t]===Np,"isDocument"),ko=_r(e=>!!e&&typeof e=="object"&&e[_t]===Zr,"isMap"),Be=_r(e=>!!e&&typeof e=="object"&&e[_t]===o$,"isPair"),je=_r(e=>!!e&&typeof e=="object"&&e[_t]===pr,"isScalar"),So=_r(e=>!!e&&typeof e=="object"&&e[_t]===qi,"isSeq");function Le(e){if(e&&typeof e=="object")switch(e[_t]){case Zr:case qi:return!0}return!1}f(Le,"i$R");_r(Le,"isCollection");function Ie(e){if(e&&typeof e=="object")switch(e[_t]){case Ud:case Zr:case pr:case qi:return!0}return!1}f(Ie,"A$p");_r(Ie,"isNode");const a$=_r(e=>(je(e)||Le(e))&&!!e.anchor,"hasAnchor");var SR=Object.defineProperty,Kn=f((e,t)=>SR(e,"name",{value:t,configurable:!0}),"r$P");const bt=Symbol("break visit"),c$=Symbol("skip children"),or=Symbol("remove node");function Yn(e,t){const r=Gd(t);Hi(e)?kn(null,e.contents,r,Object.freeze([e]))===or&&(e.contents=null):kn(null,e,r,Object.freeze([]))}f(Yn,"S$p");Kn(Yn,"visit");Yn.BREAK=bt;Yn.SKIP=c$;Yn.REMOVE=or;function kn(e,t,r,n){const i=qd(e,t,r,n);if(Ie(i)||Be(i))return zd(e,n,i),kn(e,i,r,n);if(typeof i!="symbol"){if(Le(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){const o=kn(s,t.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===bt)return bt;o===or&&(t.items.splice(s,1),s-=1)}}}else if(Be(t)){n=Object.freeze(n.concat(t));const s=kn("key",t.key,r,n);if(s===bt)return bt;s===or&&(t.key=null);const o=kn("value",t.value,r,n);if(o===bt)return bt;o===or&&(t.value=null)}}return i}f(kn,"a$U");Kn(kn,"visit_");async function gc(e,t){const r=Gd(t);Hi(e)?await Sn(null,e.contents,r,Object.freeze([e]))===or&&(e.contents=null):await Sn(null,e,r,Object.freeze([]))}f(gc,"y$z");Kn(gc,"visitAsync");gc.BREAK=bt;gc.SKIP=c$;gc.REMOVE=or;async function Sn(e,t,r,n){const i=await qd(e,t,r,n);if(Ie(i)||Be(i))return zd(e,n,i),Sn(e,i,r,n);if(typeof i!="symbol"){if(Le(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){const o=await Sn(s,t.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===bt)return bt;o===or&&(t.items.splice(s,1),s-=1)}}}else if(Be(t)){n=Object.freeze(n.concat(t));const s=await Sn("key",t.key,r,n);if(s===bt)return bt;s===or&&(t.key=null);const o=await Sn("value",t.value,r,n);if(o===bt)return bt;o===or&&(t.value=null)}}return i}f(Sn,"b$E");Kn(Sn,"visitAsync_");function Gd(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}f(Gd,"z$a");Kn(Gd,"initVisitor");function qd(e,t,r,n){if(typeof r=="function")return r(e,t,n);if(ko(t))return r.Map?.(e,t,n);if(So(t))return r.Seq?.(e,t,n);if(Be(t))return r.Pair?.(e,t,n);if(je(t))return r.Scalar?.(e,t,n);if(zi(t))return r.Alias?.(e,t,n)}f(qd,"A$o");Kn(qd,"callVisitor");function zd(e,t,r){const n=t[t.length-1];if(Le(n))n.items[e]=r;else if(Be(n))e==="key"?n.key=r:n.value=r;else if(Hi(n))n.contents=r;else{const i=zi(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}f(zd,"M$j");Kn(zd,"replaceNode");var ER=Object.defineProperty,l$=f((e,t)=>ER(e,"name",{value:t,configurable:!0}),"h$A");const DR={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},CR=l$(e=>e.replace(/[!,[\]{}]/g,t=>DR[t]),"escapeTagName");let Ai=class Ar{static{f(this,"n")}static{l$(this,"Directives")}constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ar.defaultYaml,t),this.tags=Object.assign({},Ar.defaultTags,r)}clone(){const t=new Ar(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Ar(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ar.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ar.defaultTags);break}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:Ar.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ar.defaultTags),this.atNextDocument=!1);const n=t.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[s,o]=n;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;const[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}const[,n,i]=t.match(/^(.*!)([^!]*)$/s);i||r(`The ${t} tag has no suffix`);const s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[r,n]of Object.entries(this.tags))if(t.startsWith(n))return r+CR(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(t&&n.length>0&&Ie(t.contents)){const s={};Yn(t.contents,(o,a)=>{Ie(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
|
|
838
|
+
`)}};Ai.defaultYaml={explicit:!1,version:"1.2"};Ai.defaultTags={"!!":"tag:yaml.org,2002:"};var AR=Object.defineProperty,Fi=f((e,t)=>AR(e,"name",{value:t,configurable:!0}),"c$I");function Hd(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(t)}return!0}f(Hd,"m$B");Fi(Hd,"anchorIsValid");function Jd(e){const t=new Set;return Yn(e,{Value(r,n){n.anchor&&t.add(n.anchor)}}),t}f(Jd,"h$z");Fi(Jd,"anchorNames");function Kd(e,t){for(let r=1;;++r){const n=`${e}${r}`;if(!t.has(n))return n}}f(Kd,"u$M");Fi(Kd,"findNewAnchor");function u$(e,t){const r=[],n=new Map;let i=null;return{onAnchor:Fi(s=>{r.push(s),i??(i=Jd(e));const o=Kd(t,i);return i.add(o),o},"onAnchor"),setAnchors:Fi(()=>{for(const s of r){const o=n.get(s);if(typeof o=="object"&&o.anchor&&(je(o.node)||Le(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},"setAnchors"),sourceObjects:n}}f(u$,"w$n");Fi(u$,"createNodeAnchors");var OR=Object.defineProperty,jR=f((e,t)=>OR(e,"name",{value:t,configurable:!0}),"d$E");function En(e,t,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){const o=n[i],a=En(e,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const s=n.get(i),o=En(e,n,i,s);o===void 0?n.delete(i):o!==s&&n.set(i,o)}else if(n instanceof Set)for(const i of Array.from(n)){const s=En(e,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(const[i,s]of Object.entries(n)){const o=En(e,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return e.call(t,r,n)}f(En,"s$M");jR(En,"applyReviver");var xR=Object.defineProperty,PR=f((e,t)=>xR(e,"name",{value:t,configurable:!0}),"i$P");function Ot(e,t,r){if(Array.isArray(e))return e.map((n,i)=>Ot(n,String(i),r));if(e&&typeof e.toJSON=="function"){if(!r||!a$(e))return e.toJSON(t,r);const n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=s=>{n.res=s,delete r.onCreate};const i=e.toJSON(t,r);return r.onCreate&&r.onCreate(i),i}return typeof e=="bigint"&&!r?.keep?Number(e):e}f(Ot,"f$x");PR(Ot,"toJS");var NR=Object.defineProperty,RR=f((e,t)=>NR(e,"name",{value:t,configurable:!0}),"i$O");let Yd=class{static{f(this,"O")}static{RR(this,"NodeBase")}constructor(t){Object.defineProperty(this,_t,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!Hi(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=Ot(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof s=="function"?En(s,{"":a},"",a):a}};var FR=Object.defineProperty,Rp=f((e,t)=>FR(e,"name",{value:t,configurable:!0}),"u$K");let Xd=class extends Yd{static{f(this,"b")}static{Rp(this,"Alias")}constructor(t){super(Ud),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Yn(t,{Node:Rp((s,o)=>{(zi(o)||a$(o))&&n.push(o)},"Node")}),r&&(r.aliasResolveCache=n));let i;for(const s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,r){if(!r)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:s}=r,o=this.resolve(i,r);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(a||(Ot(o,null,r),a=n.get(o)),a?.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ys(i,o,n)),a.count*a.aliasCount>s)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,r,n){const i=`*${this.source}`;if(t){if(Hd(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}};function Ys(e,t,r){if(zi(t)){const n=t.resolve(e),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Le(t)){let n=0;for(const i of t.items){const s=Ys(e,i,r);s>n&&(n=s)}return n}else if(Be(t)){const n=Ys(e,t.key,r),i=Ys(e,t.value,r);return Math.max(n,i)}return 1}f(Ys,"c$H");Rp(Ys,"getAliasCount");var LR=Object.defineProperty,p$=f((e,t)=>LR(e,"name",{value:t,configurable:!0}),"L$l");const d$=p$(e=>!e||typeof e!="function"&&typeof e!="object","isScalarValue");let ae=class extends Yd{static{f(this,"o")}static{p$(this,"Scalar")}constructor(t){super(pr),this.value=t}toJSON(t,r){return r?.keep?this.value:Ot(this.value,t,r)}toString(){return String(this.value)}};ae.BLOCK_FOLDED="BLOCK_FOLDED";ae.BLOCK_LITERAL="BLOCK_LITERAL";ae.PLAIN="PLAIN";ae.QUOTE_DOUBLE="QUOTE_DOUBLE";ae.QUOTE_SINGLE="QUOTE_SINGLE";var IR=Object.defineProperty,f$=f((e,t)=>IR(e,"name",{value:t,configurable:!0}),"h$x");const TR="tag:yaml.org,2002:";function m$(e,t,r){if(t){const n=r.filter(s=>s.tag===t),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return r.find(n=>n.identify?.(e)&&!n.format)}f(m$,"A$n");f$(m$,"findTagObject");function Li(e,t,r){if(Hi(e)&&(e=e.contents),Ie(e))return e;if(Be(e)){const d=r.schema[Zr].createNode?.(r.schema,null,r);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=r;let l;if(n&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=i(e)),new Xd(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=TR+t.slice(2));let c=m$(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const d=new ae(e);return l&&(l.node=d),d}c=e instanceof Map?o[Zr]:Symbol.iterator in Object(e)?o[qi]:o[Zr]}s&&(s(c),delete r.onTagObj);const u=c?.createNode?c.createNode(r.schema,e,r):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(r.schema,e,r):new ae(e);return t?u.tag=t:c.default||(u.tag=c.tag),l&&(l.node=u),u}f(Li,"B$j");f$(Li,"createNode");var BR=Object.defineProperty,yc=f((e,t)=>BR(e,"name",{value:t,configurable:!0}),"i$N");function ro(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){const s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return Li(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:yc(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:e,sourceObjects:new Map})}f(ro,"c$G");yc(ro,"collectionFromPath");const Ts=yc(e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,"isEmptyPath");let h$=class extends Yd{static{f(this,"b")}static{yc(this,"Collection")}constructor(t,r){super(t),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(t){const r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(r.schema=t),r.items=r.items.map(n=>Ie(n)||Be(n)?n.clone(t):n),this.range&&(r.range=this.range.slice()),r}addIn(t,r){if(Ts(t))this.add(r);else{const[n,...i]=t,s=this.get(n,!0);if(Le(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,ro(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(t){const[r,...n]=t;if(n.length===0)return this.delete(r);const i=this.get(r,!0);if(Le(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(t,r){const[n,...i]=t,s=this.get(n,!0);return i.length===0?!r&&je(s)?s.value:s:Le(s)?s.getIn(i,r):void 0}hasAllNullValues(t){return this.items.every(r=>{if(!Be(r))return!1;const n=r.value;return n==null||t&&je(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(t){const[r,...n]=t;if(n.length===0)return this.has(r);const i=this.get(r,!0);return Le(i)?i.hasIn(n):!1}setIn(t,r){const[n,...i]=t;if(i.length===0)this.set(n,r);else{const s=this.get(n,!0);if(Le(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,ro(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};var _R=Object.defineProperty,Qd=f((e,t)=>_R(e,"name",{value:t,configurable:!0}),"r$O");const MR=Qd(e=>e.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function sr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}f(sr,"s$L");Qd(sr,"indentComment");const Dn=Qd((e,t,r)=>e.endsWith(`
|
|
839
|
+
`)?sr(r,t):r.includes(`
|
|
840
|
+
`)?`
|
|
841
|
+
`+sr(r,t):(e.endsWith(" ")?"":" ")+r,"lineComment");var VR=Object.defineProperty,g$=f((e,t)=>VR(e,"name",{value:t,configurable:!0}),"O$l");const y$="flow",Fp="block",fa="quoted";function Eo(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;i<s&&(s=0);const l=Math.max(1+s,1+i-t.length);if(e.length<=l)return e;const c=[],u={};let d=i-t.length;typeof n=="number"&&(n>i-Math.max(2,s)?c.push(0):d=i-n);let p,m,g=!1,$=-1,S=-1,k=-1;r===Fp&&($=Lp(e,$,t.length),$!==-1&&(d=$+l));for(let h;h=e[$+=1];){if(r===fa&&h==="\\"){switch(S=$,e[$+1]){case"x":$+=3;break;case"u":$+=5;break;case"U":$+=9;break;default:$+=1}k=$}if(h===`
|
|
842
|
+
`)r===Fp&&($=Lp(e,$,t.length)),d=$+t.length+l,p=void 0;else{if(h===" "&&m&&m!==" "&&m!==`
|
|
843
|
+
`&&m!==" "){const b=e[$+1];b&&b!==" "&&b!==`
|
|
844
|
+
`&&b!==" "&&(p=$)}if($>=d)if(p)c.push(p),d=p+l,p=void 0;else if(r===fa){for(;m===" "||m===" ";)m=h,h=e[$+=1],g=!0;const b=$>k+1?$-2:S-1;if(u[b])return e;c.push(b),u[b]=!0,d=b+l,p=void 0}else g=!0}m=h}if(g&&a&&a(),c.length===0)return e;o&&o();let v=e.slice(0,c[0]);for(let h=0;h<c.length;++h){const b=c[h],w=c[h+1]||e.length;b===0?v=`
|
|
845
|
+
${t}${e.slice(0,w)}`:(r===fa&&u[b]&&(v+=`${e[b]}\\`),v+=`
|
|
846
|
+
${t}${e.slice(b+1,w)}`)}return v}f(Eo,"q$c");g$(Eo,"foldFlowLines");function Lp(e,t,r){let n=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+r)s=e[++t];else{do s=e[++t];while(s&&s!==`
|
|
847
|
+
`);n=t,i=t+1,s=e[i]}return n}f(Lp,"E$m");g$(Lp,"consumeMoreIndentedLines");var WR=Object.defineProperty,er=f((e,t)=>WR(e,"name",{value:t,configurable:!0}),"d$C");const vc=er((e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),"getFoldOptions"),bc=er(e=>/^(%|---|\.\.\.)/m.test(e),"containsDocumentMarker");function v$(e,t,r){if(!t||t<0)return!1;const n=t-r,i=e.length;if(i<=n)return!1;for(let s=0,o=0;s<i;++s)if(e[s]===`
|
|
848
|
+
`){if(s-o>n)return!0;if(o=s+1,i-o<=n)return!1}return!0}f(v$,"M$i");er(v$,"lineLengthOverLimit");function Oi(e,t){const r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;const{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(bc(e)?" ":"");let o="",a=0;for(let l=0,c=r[l];c;c=r[++l])if(c===" "&&r[l+1]==="\\"&&r[l+2]==="n"&&(o+=r.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(r[l+1]){case"u":{o+=r.slice(a,l);const u=r.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=r.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||r[l+2]==='"'||r.length<i)l+=1;else{for(o+=r.slice(a,l)+`
|
|
849
|
+
|
|
850
|
+
`;r[l+2]==="\\"&&r[l+3]==="n"&&r[l+4]!=='"';)o+=`
|
|
851
|
+
`,l+=2;o+=s,r[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+r.slice(a):r,n?o:Eo(o,s,fa,vc(t,!1))}f(Oi,"k$t");er(Oi,"doubleQuotedString");function Fa(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
852
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Oi(e,t);const r=t.indent||(bc(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
853
|
+
${r}`)+"'";return t.implicitKey?n:Eo(n,r,y$,vc(t,!1))}f(Fa,"B$i");er(Fa,"singleQuotedString");function Cn(e,t){const{singleQuote:r}=t.options;let n;if(r===!1)n=Oi;else{const i=e.includes('"'),s=e.includes("'");i&&!s?n=Fa:s&&!i?n=Oi:n=r?Fa:Oi}return n(e,t)}f(Cn,"S$o");er(Cn,"quotedString");let Ip;try{Ip=new RegExp(`(^|(?<!
|
|
854
|
+
))
|
|
855
|
+
+(?!
|
|
856
|
+
|$)`,"g")}catch{Ip=/\n+(?!\n|$)/g}function Xs({comment:e,type:t,value:r},n,i,s){const{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(r))return Cn(r,n);const c=n.indent||(n.forceBlockIndent||bc(r)?" ":""),u=o==="literal"?!0:o==="folded"||t===ae.BLOCK_FOLDED?!1:t===ae.BLOCK_LITERAL?!0:!v$(r,l,c.length);if(!r)return u?`|
|
|
857
|
+
`:`>
|
|
858
|
+
`;let d,p;for(p=r.length;p>0;--p){const b=r[p-1];if(b!==`
|
|
859
|
+
`&&b!==" "&&b!==" ")break}let m=r.substring(p);const g=m.indexOf(`
|
|
860
|
+
`);g===-1?d="-":r===m||g!==m.length-1?(d="+",s&&s()):d="",m&&(r=r.slice(0,-m.length),m[m.length-1]===`
|
|
861
|
+
`&&(m=m.slice(0,-1)),m=m.replace(Ip,`$&${c}`));let $=!1,S,k=-1;for(S=0;S<r.length;++S){const b=r[S];if(b===" ")$=!0;else if(b===`
|
|
862
|
+
`)k=S;else break}let v=r.substring(0,k<S?k+1:S);v&&(r=r.substring(v.length),v=v.replace(/\n+/g,`$&${c}`));let h=($?c?"2":"1":"")+d;if(e&&(h+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){const b=r.replace(/\n+/g,`
|
|
863
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let w=!1;const y=vc(n,!0);o!=="folded"&&t!==ae.BLOCK_FOLDED&&(y.onOverflow=()=>{w=!0});const D=Eo(`${v}${b}${m}`,c,Fp,y);if(!w)return`>${h}
|
|
864
|
+
${c}${D}`}return r=r.replace(/\n+/g,`$&${c}`),`|${h}
|
|
865
|
+
${c}${v}${r}${m}`}f(Xs,"D$m");er(Xs,"blockString");function b$(e,t,r,n){const{type:i,value:s}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=t;if(a&&s.includes(`
|
|
866
|
+
`)||u&&/[[\]{},]/.test(s))return Cn(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
|
|
867
|
+
`)?Cn(s,t):Xs(e,t,r,n);if(!a&&!u&&i!==ae.PLAIN&&s.includes(`
|
|
868
|
+
`))return Xs(e,t,r,n);if(bc(s)){if(l==="")return t.forceBlockIndent=!0,Xs(e,t,r,n);if(a&&l===c)return Cn(s,t)}const d=s.replace(/\n+/g,`$&
|
|
869
|
+
${l}`);if(o){const p=er($=>$.default&&$.tag!=="tag:yaml.org,2002:str"&&$.test?.test(d),"test"),{compat:m,tags:g}=t.doc.schema;if(g.some(p)||m?.some(p))return Cn(s,t)}return a?d:Eo(d,l,y$,vc(t,!1))}f(b$,"m$A");er(b$,"plainString");function Ji(e,t,r,n){const{implicitKey:i,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ae.QUOTE_DOUBLE);const l=er(u=>{switch(u){case ae.BLOCK_FOLDED:case ae.BLOCK_LITERAL:return i||s?Cn(o.value,t):Xs(o,t,r,n);case ae.QUOTE_DOUBLE:return Oi(o.value,t);case ae.QUOTE_SINGLE:return Fa(o.value,t);case ae.PLAIN:return b$(o,t,r,n);default:return null}},"_stringify");let c=l(a);if(c===null){const{defaultKeyType:u,defaultStringType:d}=t.options,p=i&&u||d;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}f(Ji,"R$h");er(Ji,"stringifyString");var UR=Object.defineProperty,Do=f((e,t)=>UR(e,"name",{value:t,configurable:!0}),"s$K");function Zd(e,t){const r=Object.assign({blockQuote:!0,commentString:MR,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}f(Zd,"w$m");Do(Zd,"createStringifyContext");function $$(e,t){if(t.tag){const i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let r,n;if(je(t)){n=t.value;let i=e.filter(s=>s.identify?.(n));if(i.length>1){const s=i.filter(o=>o.test);s.length>0&&(i=s)}r=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else n=t,r=e.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){const i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}f($$,"b$B");Do($$,"getTagObject");function w$(e,t,{anchors:r,doc:n}){if(!n.directives)return"";const i=[],s=(je(e)||Le(e))&&e.anchor;s&&Hd(s)&&(r.add(s),i.push(`&${s}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}f(w$,"A$m");Do(w$,"stringifyProps");function Bn(e,t,r,n){if(Be(e))return e.toString(t,r,n);if(zi(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const s=Ie(e)?e:t.doc.createNode(e,{onTagObj:Do(l=>i=l,"onTagObj")});i??(i=$$(t.doc.schema.tags,s));const o=w$(s,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(s,t,r,n):je(s)?Ji(s,t,r,n):s.toString(t,r,n);return o?je(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
870
|
+
${t.indent}${a}`:a}f(Bn,"O$k");Do(Bn,"stringify");var GR=Object.defineProperty,qR=f((e,t)=>GR(e,"name",{value:t,configurable:!0}),"D$l");function k$({key:e,value:t},r,n,i){const{allNullValues:s,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:d}}=r;let p=Ie(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(Le(e)||!Ie(e)&&typeof e=="object"){const D="With simple keys, collection cannot be used as a key value";throw new Error(D)}}let m=!d&&(!e||p&&t==null&&!r.inFlow||Le(e)||(je(e)?e.type===ae.BLOCK_FOLDED||e.type===ae.BLOCK_LITERAL:typeof e=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(d||!s),indent:a+l});let g=!1,$=!1,S=Bn(e,r,()=>g=!0,()=>$=!0);if(!m&&!r.inFlow&&S.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.inFlow){if(s||t==null)return g&&n&&n(),S===""?"?":m?`? ${S}`:S}else if(s&&!d||t==null&&m)return S=`? ${S}`,p&&!g?S+=Dn(S,r.indent,c(p)):$&&i&&i(),S;g&&(p=null),m?(p&&(S+=Dn(S,r.indent,c(p))),S=`? ${S}
|
|
871
|
+
${a}:`):(S=`${S}:`,p&&(S+=Dn(S,r.indent,c(p))));let k,v,h;Ie(t)?(k=!!t.spaceBefore,v=t.commentBefore,h=t.comment):(k=!1,v=null,h=null,t&&typeof t=="object"&&(t=o.createNode(t))),r.implicitKey=!1,!m&&!p&&je(t)&&(r.indentAtStart=S.length+1),$=!1,!u&&l.length>=2&&!r.inFlow&&!m&&So(t)&&!t.flow&&!t.tag&&!t.anchor&&(r.indent=r.indent.substring(2));let b=!1;const w=Bn(t,r,()=>b=!0,()=>$=!0);let y=" ";if(p||k||v){if(y=k?`
|
|
872
|
+
`:"",v){const D=c(v);y+=`
|
|
873
|
+
${sr(D,r.indent)}`}w===""&&!r.inFlow?y===`
|
|
874
|
+
`&&h&&(y=`
|
|
875
|
+
|
|
876
|
+
`):y+=`
|
|
877
|
+
${r.indent}`}else if(!m&&Le(t)){const D=w[0],E=w.indexOf(`
|
|
878
|
+
`),A=E!==-1,j=r.inFlow??t.flow??t.items.length===0;if(A||!j){let G=!1;if(A&&(D==="&"||D==="!")){let W=w.indexOf(" ");D==="&"&&W!==-1&&W<E&&w[W+1]==="!"&&(W=w.indexOf(" ",W+1)),(W===-1||E<W)&&(G=!0)}G||(y=`
|
|
879
|
+
${r.indent}`)}}else(w===""||w[0]===`
|
|
880
|
+
`)&&(y="");return S+=y+w,r.inFlow?b&&n&&n():h&&!b?S+=Dn(S,r.indent,c(h)):$&&i&&i(),S}f(k$,"R$g");qR(k$,"stringifyPair");var zR=Object.defineProperty,S$=f((e,t)=>zR(e,"name",{value:t,configurable:!0}),"u$H");function HR(e,...t){e==="debug"&&console.log(...t)}f(HR,"e$13");S$(HR,"debug");function ef(e,t){(e==="debug"||e==="warn")&&console.warn(t)}f(ef,"f$v");S$(ef,"warn");var JR=Object.defineProperty,On=f((e,t)=>JR(e,"name",{value:t,configurable:!0}),"s$J");const Qo="<<",Fr={identify:On(e=>e===Qo||typeof e=="symbol"&&e.description===Qo,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:On(()=>Object.assign(new ae(Symbol(Qo)),{addToJSMap:tf}),"resolve"),stringify:On(()=>Qo,"stringify")},KR=On((e,t)=>(Fr.identify(t)||je(t)&&(!t.type||t.type===ae.PLAIN)&&Fr.identify(t.value))&&e?.doc.schema.tags.some(r=>r.tag===Fr.tag&&r.default),"isMergeKey");function tf(e,t,r){const n=rf(e,r);if(So(n))for(const i of n.items)ma(e,t,i);else if(Array.isArray(n))for(const i of n)ma(e,t,i);else ma(e,t,n)}f(tf,"d$B");On(tf,"addMergeToJSMap");function ma(e,t,r){const n=rf(e,r);if(!ko(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,e,Map);for(const[s,o]of i)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}f(ma,"l$E");On(ma,"mergeValue");function rf(e,t){return e&&zi(t)?t.resolve(e.doc,e):t}f(rf,"g$q");On(rf,"resolveAliasValue");var YR=Object.defineProperty,E$=f((e,t)=>YR(e,"name",{value:t,configurable:!0}),"s$I");function nf(e,t,{key:r,value:n}){if(Ie(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(KR(e,r))tf(e,t,n);else{const i=Ot(r,"",e);if(t instanceof Map)t.set(i,Ot(n,i,e));else if(t instanceof Set)t.add(i);else{const s=D$(r,i,e),o=Ot(n,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}f(nf,"b$A");E$(nf,"addPairToJSMap");function D$(e,t,r){if(t===null)return"";if(typeof t!="object")return String(t);if(Ie(e)&&r?.doc){const n=Zd(r.doc,{});n.anchors=new Set;for(const s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=e.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),ef(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(t)}f(D$,"p$C");E$(D$,"stringifyKey");var XR=Object.defineProperty,C$=f((e,t)=>XR(e,"name",{value:t,configurable:!0}),"o$Q");function $c(e,t,r){const n=Li(e,void 0,r),i=Li(t,void 0,r);return new jt(n,i)}f($c,"m$z");C$($c,"createPair");let jt=class A${static{f(this,"i")}static{C$(this,"Pair")}constructor(t,r=null){Object.defineProperty(this,_t,{value:o$}),this.key=t,this.value=r}clone(t){let{key:r,value:n}=this;return Ie(r)&&(r=r.clone(t)),Ie(n)&&(n=n.clone(t)),new A$(r,n)}toJSON(t,r){const n=r?.mapAsMap?new Map:{};return nf(r,n,this)}toString(t,r,n){return t?.doc?k$(this,t,r,n):JSON.stringify(this)}};var QR=Object.defineProperty,wc=f((e,t)=>QR(e,"name",{value:t,configurable:!0}),"$$h");function sf(e,t,r){return(t.inFlow??e.flow?j$:O$)(e,t,r)}f(sf,"P$j");wc(sf,"stringifyCollection");function O$({comment:e,items:t},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=r,u=Object.assign({},r,{indent:s,type:null});let d=!1;const p=[];for(let g=0;g<t.length;++g){const $=t[g];let S=null;if(Ie($))!d&&$.spaceBefore&&p.push(""),no(r,p,$.commentBefore,d),$.comment&&(S=$.comment);else if(Be($)){const v=Ie($.key)?$.key:null;v&&(!d&&v.spaceBefore&&p.push(""),no(r,p,v.commentBefore,d))}d=!1;let k=Bn($,u,()=>S=null,()=>d=!0);S&&(k+=Dn(k,s,c(S))),d&&S&&(d=!1),p.push(n+k)}let m;if(p.length===0)m=i.start+i.end;else{m=p[0];for(let g=1;g<p.length;++g){const $=p[g];m+=$?`
|
|
881
|
+
${l}${$}`:`
|
|
882
|
+
`}}return e?(m+=`
|
|
883
|
+
`+sr(c(e),l),a&&a()):d&&o&&o(),m}f(O$,"b$z");wc(O$,"stringifyBlockCollection");function j$({items:e},t,{flowChars:r,itemIndent:n}){const{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=t;n+=s;const l=Object.assign({},t,{indent:n,inFlow:!0,type:null});let c=!1,u=0;const d=[];for(let g=0;g<e.length;++g){const $=e[g];let S=null;if(Ie($))$.spaceBefore&&d.push(""),no(t,d,$.commentBefore,!1),$.comment&&(S=$.comment);else if(Be($)){const v=Ie($.key)?$.key:null;v&&(v.spaceBefore&&d.push(""),no(t,d,v.commentBefore,!1),v.comment&&(c=!0));const h=Ie($.value)?$.value:null;h?(h.comment&&(S=h.comment),h.commentBefore&&(c=!0)):$.value==null&&v?.comment&&(S=v.comment)}S&&(c=!0);let k=Bn($,l,()=>S=null);c||(c=d.length>u||k.includes(`
|
|
884
|
+
`)),g<e.length-1?k+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=d.reduce((v,h)=>v+h.length+2,2)+(k.length+2)>t.options.lineWidth)),c&&(k+=",")),S&&(k+=Dn(k,n,a(S))),d.push(k),u=d.length}const{start:p,end:m}=r;if(d.length===0)return p+m;if(!c){const g=d.reduce(($,S)=>$+S.length+2,2);c=t.options.lineWidth>0&&g>t.options.lineWidth}if(c){let g=p;for(const $ of d)g+=$?`
|
|
885
|
+
${s}${i}${$}`:`
|
|
886
|
+
`;return`${g}
|
|
887
|
+
${i}${m}`}else return`${p}${o}${d.join(" ")}${o}${m}`}f(j$,"N$l");wc(j$,"stringifyFlowCollection");function no({indent:e,options:{commentString:t}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const s=sr(t(n),e);r.push(s.trimStart())}}f(no,"C$j");wc(no,"addCommentBefore");var ZR=Object.defineProperty,Tp=f((e,t)=>ZR(e,"name",{value:t,configurable:!0}),"m$y");function Xr(e,t){const r=je(t)?t.value:t;for(const n of e)if(Be(n)&&(n.key===t||n.key===r||je(n.key)&&n.key.value===r))return n}f(Xr,"f$t");Tp(Xr,"findPair");let It=class extends h${static{f(this,"N")}static{Tp(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Zr,t),this.items=[]}static from(t,r,n){const{keepUndefined:i,replacer:s}=n,o=new this(t),a=Tp((l,c)=>{if(typeof s=="function")c=s.call(r,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||i)&&o.items.push($c(l,c,n))},"add");if(r instanceof Map)for(const[l,c]of r)a(l,c);else if(r&&typeof r=="object")for(const l of Object.keys(r))a(l,r[l]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,r){let n;Be(t)?n=t:!t||typeof t!="object"||!("key"in t)?n=new jt(t,t?.value):n=new jt(t.key,t.value);const i=Xr(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);je(i.value)&&d$(n.value)?i.value.value=n.value:i.value=n.value}else if(s){const o=this.items.findIndex(a=>s(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(t){const r=Xr(this.items,t);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(t,r){const n=Xr(this.items,t)?.value;return(!r&&je(n)?n.value:n)??void 0}has(t){return!!Xr(this.items,t)}set(t,r){this.add(new jt(t,r),!0)}toJSON(t,r,n){const i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(const s of this.items)nf(r,i,s);return i}toString(t,r,n){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Be(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),sf(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:r})}};var eF=Object.defineProperty,tF=f((e,t)=>eF(e,"name",{value:t,configurable:!0}),"a$R");const Ki={collection:"map",default:!0,nodeClass:It,tag:"tag:yaml.org,2002:map",resolve(e,t){return ko(e)||t("Expected a mapping for this tag"),e},createNode:tF((e,t,r)=>It.from(e,t,r),"createNode")};var rF=Object.defineProperty,x$=f((e,t)=>rF(e,"name",{value:t,configurable:!0}),"m$x");let _n=class extends h${static{f(this,"b")}static{x$(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(qi,t),this.items=[]}add(t){this.items.push(t)}delete(t){const r=Bs(t);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(t,r){const n=Bs(t);if(typeof n!="number")return;const i=this.items[n];return!r&&je(i)?i.value:i}has(t){const r=Bs(t);return typeof r=="number"&&r<this.items.length}set(t,r){const n=Bs(t);if(typeof n!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[n];je(i)&&d$(r)?i.value=r:this.items[n]=r}toJSON(t,r){const n=[];r?.onCreate&&r.onCreate(n);let i=0;for(const s of this.items)n.push(Ot(s,String(i++),r));return n}toString(t,r,n){return t?sf(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(t,r,n){const{replacer:i}=n,s=new this(t);if(r&&Symbol.iterator in Object(r)){let o=0;for(let a of r){if(typeof i=="function"){const l=r instanceof Set?a:String(o++);a=i.call(r,l,a)}s.items.push(Li(a,void 0,n))}}return s}};function Bs(e){let t=je(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}f(Bs,"f$s");x$(Bs,"asItemIndex");var nF=Object.defineProperty,iF=f((e,t)=>nF(e,"name",{value:t,configurable:!0}),"t$H");const Yi={collection:"seq",default:!0,nodeClass:_n,tag:"tag:yaml.org,2002:seq",resolve(e,t){return So(e)||t("Expected a sequence for this tag"),e},createNode:iF((e,t,r)=>_n.from(e,t,r),"createNode")};var sF=Object.defineProperty,og=f((e,t)=>sF(e,"name",{value:t,configurable:!0}),"i$K");const kc={identify:og(e=>typeof e=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:og(e=>e,"resolve"),stringify(e,t,r,n){return t=Object.assign({actualString:!0},t),Ji(e,t,r,n)}};var oF=Object.defineProperty,Zo=f((e,t)=>oF(e,"name",{value:t,configurable:!0}),"l$D");const Sc={identify:Zo(e=>e==null,"identify"),createNode:Zo(()=>new ae(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:Zo(()=>new ae(null),"resolve"),stringify:Zo(({source:e},t)=>typeof e=="string"&&Sc.test.test(e)?e:t.options.nullStr,"stringify")};var aF=Object.defineProperty,ag=f((e,t)=>aF(e,"name",{value:t,configurable:!0}),"e$12");const of={identify:ag(e=>typeof e=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:ag(e=>new ae(e[0]==="t"||e[0]==="T"),"resolve"),stringify({source:e,value:t},r){if(e&&of.test.test(e)){const n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};var cF=Object.defineProperty,lF=f((e,t)=>cF(e,"name",{value:t,configurable:!0}),"g$p");function Wt({format:e,minFractionDigits:t,tag:r,value:n}){if(typeof n=="bigint")return String(n);const i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=t-(s.length-o-1);for(;a-- >0;)s+="0"}return s}f(Wt,"y$w");lF(Wt,"stringifyNumber");var uF=Object.defineProperty,io=f((e,t)=>uF(e,"name",{value:t,configurable:!0}),"o$P");const P$={identify:io(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:io(e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Wt},N$={identify:io(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:io(e=>parseFloat(e),"resolve"),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Wt(e)}},R$={identify:io(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new ae(parseFloat(e)),r=e.indexOf(".");return r!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-r-1),t},stringify:Wt};var pF=Object.defineProperty,ar=f((e,t)=>pF(e,"name",{value:t,configurable:!0}),"r$L");const Ec=ar(e=>typeof e=="bigint"||Number.isInteger(e),"intIdentify"),af=ar((e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r),"intResolve");function cf(e,t,r){const{value:n}=e;return Ec(n)&&n>=0?r+n.toString(t):Wt(e)}f(cf,"g$o");ar(cf,"intStringify");const F$={identify:ar(e=>Ec(e)&&e>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:ar((e,t,r)=>af(e,2,8,r),"resolve"),stringify:ar(e=>cf(e,8,"0o"),"stringify")},L$={identify:Ec,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:ar((e,t,r)=>af(e,0,10,r),"resolve"),stringify:Wt},I$={identify:ar(e=>Ec(e)&&e>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:ar((e,t,r)=>af(e,2,16,r),"resolve"),stringify:ar(e=>cf(e,16,"0x"),"stringify")},dF=[Ki,Yi,kc,Sc,of,F$,L$,I$,P$,N$,R$];var fF=Object.defineProperty,At=f((e,t)=>fF(e,"name",{value:t,configurable:!0}),"e$11");function Bp(e){return typeof e=="bigint"||Number.isInteger(e)}f(Bp,"i$J");At(Bp,"intIdentify");const ea=At(({value:e})=>JSON.stringify(e),"stringifyJSON"),mF=[{identify:At(e=>typeof e=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:At(e=>e,"resolve"),stringify:ea},{identify:At(e=>e==null,"identify"),createNode:At(()=>new ae(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:At(()=>null,"resolve"),stringify:ea},{identify:At(e=>typeof e=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:At(e=>e==="true","resolve"),stringify:ea},{identify:Bp,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:At((e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),"resolve"),stringify:At(({value:e})=>Bp(e)?e.toString():JSON.stringify(e),"stringify")},{identify:At(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:At(e=>parseFloat(e),"resolve"),stringify:ea}],hF={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},gF=[Ki,Yi].concat(mF,hF);var yF=Object.defineProperty,vF=f((e,t)=>yF(e,"name",{value:t,configurable:!0}),"b$w");const lf={identify:vF(e=>e instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const r=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},n,i,s){if(!r)return"";const o=r;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ae.BLOCK_LITERAL),t!==ae.QUOTE_DOUBLE){const l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let d=0,p=0;d<c;++d,p+=l)u[d]=a.substr(p,l);a=u.join(t===ae.BLOCK_LITERAL?`
|
|
888
|
+
`:" ")}return Ji({comment:e,type:t,value:a},n,i,s)}};var bF=Object.defineProperty,T$=f((e,t)=>bF(e,"name",{value:t,configurable:!0}),"f$o");function uf(e,t){if(So(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(!Be(n)){if(ko(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");const i=n.items[0]||new jt(new ae(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
889
|
+
${i.key.commentBefore}`:n.commentBefore),n.comment){const s=i.value??i.key;s.comment=s.comment?`${n.comment}
|
|
890
|
+
${s.comment}`:n.comment}n=i}e.items[r]=Be(n)?n:new jt(n)}}else t("Expected a sequence for this tag");return e}f(uf,"y$s");T$(uf,"resolvePairs");function pf(e,t,r){const{replacer:n}=r,i=new _n(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof n=="function"&&(o=n.call(t,String(s++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push($c(a,l,r))}return i}f(pf,"u$C");T$(pf,"createPairs");const df={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:uf,createNode:pf};var $F=Object.defineProperty,_p=f((e,t)=>$F(e,"name",{value:t,configurable:!0}),"p$z");let ha=class B$ extends _n{static{f(this,"a")}static{_p(this,"YAMLOMap")}constructor(){super(),this.add=It.prototype.add.bind(this),this.delete=It.prototype.delete.bind(this),this.get=It.prototype.get.bind(this),this.has=It.prototype.has.bind(this),this.set=It.prototype.set.bind(this),this.tag=B$.tag}toJSON(t,r){if(!r)return super.toJSON(t);const n=new Map;r?.onCreate&&r.onCreate(n);for(const i of this.items){let s,o;if(Be(i)?(s=Ot(i.key,"",r),o=Ot(i.value,s,r)):s=Ot(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(t,r,n){const i=pf(t,r,n),s=new this;return s.items=i.items,s}};ha.tag="tag:yaml.org,2002:omap";const ff={collection:"seq",identify:_p(e=>e instanceof Map,"identify"),nodeClass:ha,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const r=uf(e,t),n=[];for(const{key:i}of r.items)je(i)&&(n.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ha,r)},createNode:_p((e,t,r)=>ha.from(e,t,r),"createNode")};var wF=Object.defineProperty,so=f((e,t)=>wF(e,"name",{value:t,configurable:!0}),"e$10");function mf({value:e,source:t},r){return t&&(e?_$:M$).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}f(mf,"f$n");so(mf,"boolStringify");const _$={identify:so(e=>e===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:so(()=>new ae(!0),"resolve"),stringify:mf},M$={identify:so(e=>e===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:so(()=>new ae(!1),"resolve"),stringify:mf};var kF=Object.defineProperty,oo=f((e,t)=>kF(e,"name",{value:t,configurable:!0}),"a$J");const SF={identify:oo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:oo(e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Wt},EF={identify:oo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:oo(e=>parseFloat(e.replace(/_/g,"")),"resolve"),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Wt(e)}},DF={identify:oo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new ae(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){const n=e.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(t.minFractionDigits=n.length)}return t},stringify:Wt};var CF=Object.defineProperty,dr=f((e,t)=>CF(e,"name",{value:t,configurable:!0}),"i$H");const Co=dr(e=>typeof e=="bigint"||Number.isInteger(e),"intIdentify");function Ao(e,t,r,{intAsBigInt:n}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const s=parseInt(e,r);return i==="-"?-1*s:s}f(Ao,"g$j");dr(Ao,"intResolve");function Dc(e,t,r){const{value:n}=e;if(Co(n)){const i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return Wt(e)}f(Dc,"s$D");dr(Dc,"intStringify");const AF={identify:Co,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:dr((e,t,r)=>Ao(e,2,2,r),"resolve"),stringify:dr(e=>Dc(e,2,"0b"),"stringify")},OF={identify:Co,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:dr((e,t,r)=>Ao(e,1,8,r),"resolve"),stringify:dr(e=>Dc(e,8,"0"),"stringify")},jF={identify:Co,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:dr((e,t,r)=>Ao(e,0,10,r),"resolve"),stringify:Wt},xF={identify:Co,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:dr((e,t,r)=>Ao(e,2,16,r),"resolve"),stringify:dr(e=>Dc(e,16,"0x"),"stringify")};var PF=Object.defineProperty,Mp=f((e,t)=>PF(e,"name",{value:t,configurable:!0}),"n$J");let ga=class V$ extends It{static{f(this,"l")}static{Mp(this,"YAMLSet")}constructor(t){super(t),this.tag=V$.tag}add(t){let r;Be(t)?r=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?r=new jt(t.key,null):r=new jt(t,null),Xr(this.items,r.key)||this.items.push(r)}get(t,r){const n=Xr(this.items,t);return!r&&Be(n)?je(n.key)?n.key.value:n.key:n}set(t,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);const n=Xr(this.items,t);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new jt(t))}toJSON(t,r){return super.toJSON(t,r,Set)}toString(t,r,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(t,r,n){const{replacer:i}=n,s=new this(t);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push($c(o,null,n));return s}};ga.tag="tag:yaml.org,2002:set";const hf={collection:"map",identify:Mp(e=>e instanceof Set,"identify"),nodeClass:ga,default:!1,tag:"tag:yaml.org,2002:set",createNode:Mp((e,t,r)=>ga.from(e,t,r),"createNode"),resolve(e,t){if(ko(e)){if(e.hasAllNullValues(!0))return Object.assign(new ga,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};var NF=Object.defineProperty,Yt=f((e,t)=>NF(e,"name",{value:t,configurable:!0}),"n$I");function Cc(e,t){const r=e[0],n=r==="-"||r==="+"?e.substring(1):e,i=Yt(o=>t?BigInt(o):Number(o),"num"),s=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return r==="-"?i(-1)*s:s}f(Cc,"l$x");Yt(Cc,"parseSexagesimal");function gf(e){let{value:t}=e,r=Yt(o=>o,"num");if(typeof t=="bigint")r=Yt(o=>BigInt(o),"num");else if(isNaN(t)||!isFinite(t))return Wt(e);let n="";t<0&&(n="-",t*=r(-1));const i=r(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),n+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}f(gf,"c$B");Yt(gf,"stringifySexagesimal");const W$={identify:Yt(e=>typeof e=="bigint"||Number.isInteger(e),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:Yt((e,t,{intAsBigInt:r})=>Cc(e,r),"resolve"),stringify:gf},U$={identify:Yt(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:Yt(e=>Cc(e,!1),"resolve"),stringify:gf},Ac={identify:Yt(e=>e instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Ac.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,n,i,s,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(r,n-1,i,s||0,o||0,a||0,l);const u=t[8];if(u&&u!=="Z"){let d=Cc(u,!1);Math.abs(d)<30&&(d*=60),c-=6e4*d}return new Date(c)},stringify:Yt(({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")},cg=[Ki,Yi,kc,Sc,_$,M$,AF,OF,jF,xF,SF,EF,DF,lf,Fr,ff,df,hf,W$,U$,Ac];var RF=Object.defineProperty,FF=f((e,t)=>RF(e,"name",{value:t,configurable:!0}),"s$C");const lg=new Map([["core",dF],["failsafe",[Ki,Yi,kc]],["json",gF],["yaml11",cg],["yaml-1.1",cg]]),ug={binary:lf,bool:of,float:R$,floatExp:N$,floatNaN:P$,floatTime:U$,int:L$,intHex:I$,intOct:F$,intTime:W$,map:Ki,merge:Fr,null:Sc,omap:ff,pairs:df,seq:Yi,set:hf,timestamp:Ac},LF={"tag:yaml.org,2002:binary":lf,"tag:yaml.org,2002:merge":Fr,"tag:yaml.org,2002:omap":ff,"tag:yaml.org,2002:pairs":df,"tag:yaml.org,2002:set":hf,"tag:yaml.org,2002:timestamp":Ac};function ya(e,t,r){const n=lg.get(t);if(n&&!e)return r&&!n.includes(Fr)?n.concat(Fr):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{const s=Array.from(lg.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return r&&(i=i.concat(Fr)),i.reduce((s,o)=>{const a=typeof o=="string"?ug[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(ug).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return s.includes(a)||s.push(a),s},[])}f(ya,"C$i");FF(ya,"getTags");var IF=Object.defineProperty,G$=f((e,t)=>IF(e,"name",{value:t,configurable:!0}),"o$N");const TF=G$((e,t)=>e.key<t.key?-1:e.key>t.key?1:0,"sortMapEntriesByKey");let BF=class q${static{f(this,"i")}static{G$(this,"Schema")}constructor({compat:t,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?ya(t,"compat"):t?ya(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?LF:{},this.tags=ya(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,Zr,{value:Ki}),Object.defineProperty(this,pr,{value:kc}),Object.defineProperty(this,qi,{value:Yi}),this.sortMapEntries=typeof o=="function"?o:o===!0?TF:null}clone(){const t=Object.create(q$.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};var _F=Object.defineProperty,MF=f((e,t)=>_F(e,"name",{value:t,configurable:!0}),"u$B");function z$(e,t){const r=[];let n=t.directives===!0;if(t.directives!==!1&&e.directives){const l=e.directives.toString(e);l?(r.push(l),n=!0):e.directives.docStart&&(n=!0)}n&&r.push("---");const i=Zd(e,t),{commentString:s}=i.options;if(e.commentBefore){r.length!==1&&r.unshift("");const l=s(e.commentBefore);r.unshift(sr(l,""))}let o=!1,a=null;if(e.contents){if(Ie(e.contents)){if(e.contents.spaceBefore&&n&&r.push(""),e.contents.commentBefore){const u=s(e.contents.commentBefore);r.push(sr(u,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}const l=a?void 0:()=>o=!0;let c=Bn(e.contents,i,()=>a=null,l);a&&(c+=Dn(c,"",s(a))),(c[0]==="|"||c[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${c}`:r.push(c)}else r.push(Bn(e.contents,i));if(e.directives?.docEnd)if(e.comment){const l=s(e.comment);l.includes(`
|
|
891
|
+
`)?(r.push("..."),r.push(sr(l,""))):r.push(`... ${l}`)}else r.push("...");else{let l=e.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&r[r.length-1]!==""&&r.push(""),r.push(sr(s(l),"")))}return r.join(`
|
|
892
|
+
`)+`
|
|
893
|
+
`}f(z$,"C$h");MF(z$,"stringifyDocument");var VF=Object.defineProperty,Vp=f((e,t)=>VF(e,"name",{value:t,configurable:!0}),"f$m");let yf=class H${static{f(this,"b")}static{Vp(this,"Document")}constructor(t,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_t,{value:Np});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ai({version:o}),this.setSchema(o,n),this.contents=t===void 0?null:this.createNode(t,i,n)}clone(){const t=Object.create(H$.prototype,{[_t]:{value:Np}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ie(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){vn(this.contents)&&this.contents.add(t)}addIn(t,r){vn(this.contents)&&this.contents.addIn(t,r)}createAlias(t,r){if(!t.anchor){const n=Jd(this);t.anchor=!r||n.has(r)?Kd(r||"a",n):r}return new Xd(t.anchor)}createNode(t,r,n){let i;if(typeof r=="function")t=r.call({"":t},"",t),i=r;else if(Array.isArray(r)){const S=Vp(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),k=r.filter(S).map(String);k.length>0&&(r=r.concat(k)),i=r}else n===void 0&&r&&(n=r,r=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=n??{},{onAnchor:d,setAnchors:p,sourceObjects:m}=u$(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},$=Li(t,u,g);return a&&Le($)&&($.flow=!0),p(),$}createPair(t,r,n={}){const i=this.createNode(t,null,n),s=this.createNode(r,null,n);return new jt(i,s)}delete(t){return vn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ts(t)?this.contents==null?!1:(this.contents=null,!0):vn(this.contents)?this.contents.deleteIn(t):!1}get(t,r){return Le(this.contents)?this.contents.get(t,r):void 0}getIn(t,r){return Ts(t)?!r&&je(this.contents)?this.contents.value:this.contents:Le(this.contents)?this.contents.getIn(t,r):void 0}has(t){return Le(this.contents)?this.contents.has(t):!1}hasIn(t){return Ts(t)?this.contents!==void 0:Le(this.contents)?this.contents.hasIn(t):!1}set(t,r){this.contents==null?this.contents=ro(this.schema,[t],r):vn(this.contents)&&this.contents.set(t,r)}setIn(t,r){Ts(t)?this.contents=r:this.contents==null?this.contents=ro(this.schema,Array.from(t),r):vn(this.contents)&&this.contents.setIn(t,r)}setSchema(t,r={}){typeof t=="number"&&(t=String(t));let n;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ai({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Ai({version:t}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new BF(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Ot(this.contents,r??"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof o=="function"?En(o,{"":l},"",l):l}toJSON(t,r){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:r})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const r=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return z$(this,t)}};function vn(e){if(Le(e))return!0;throw new Error("Expected a YAML collection as document contents")}f(vn,"o$M");Vp(vn,"assertCollection");var WF=Object.defineProperty,Oc=f((e,t)=>WF(e,"name",{value:t,configurable:!0}),"l$v");let J$=class extends Error{static{f(this,"g")}static{Oc(this,"YAMLError")}constructor(t,r,n,i){super(),this.name=t,this.code=n,this.message=i,this.pos=r}},Ei=class extends J${static{f(this,"h")}static{Oc(this,"YAMLParseError")}constructor(t,r,n){super("YAMLParseError",t,r,n)}},UF=class extends J${static{f(this,"m")}static{Oc(this,"YAMLWarning")}constructor(t,r,n){super("YAMLWarning",t,r,n)}};const La=Oc((e,t)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>t.linePos(a));const{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,o=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const a=Math.min(s-39,o.length-79);o="…"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,s))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
894
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=r.linePos[1];l?.line===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-s)));const c=" ".repeat(s)+"^".repeat(a);r.message+=`:
|
|
895
|
+
|
|
896
|
+
${o}
|
|
897
|
+
${c}
|
|
898
|
+
`}},"prettifyError");var GF=Object.defineProperty,qF=f((e,t)=>GF(e,"name",{value:t,configurable:!0}),"g$g");function Mn(e,{flow:t,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,d="",p="",m=!1,g=!1,$=null,S=null,k=null,v=null,h=null,b=null,w=null;for(const E of e)switch(g&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&s(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),$&&(c&&E.type!=="comment"&&E.type!=="newline"&&s($,"TAB_AS_INDENT","Tabs are not allowed as indentation"),$=null),E.type){case"space":!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&E.source.includes(" ")&&($=E),u=!0;break;case"comment":{u||s(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const A=E.source.substring(1)||" ";d?d+=p+A:d=A,p="",c=!1;break}case"newline":c?d?d+=E.source:(!b||r!=="seq-item-ind")&&(l=!0):p+=E.source,c=!0,m=!0,(S||k)&&(v=E),u=!0;break;case"anchor":S&&s(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&s(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=E,w??(w=E.offset),c=!1,u=!1,g=!0;break;case"tag":{k&&s(E,"MULTIPLE_TAGS","A node can have at most one tag"),k=E,w??(w=E.offset),c=!1,u=!1,g=!0;break}case r:(S||k)&&s(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),b&&s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),b=E,c=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(t){h&&s(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),h=E,c=!1,u=!1;break}default:s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),c=!1,u=!1}const y=e[e.length-1],D=y?y.offset+y.source.length:i;return g&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),$&&(c&&$.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s($,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:h,found:b,spaceBefore:l,comment:d,hasNewline:m,anchor:S,tag:k,newlineAfterProp:v,end:D,start:w??D}}f(Mn,"C$g");qF(Mn,"resolveProps");var zF=Object.defineProperty,HF=f((e,t)=>zF(e,"name",{value:t,configurable:!0}),"s$B");function Ii(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
899
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const r of t.start)if(r.type==="newline")return!0;if(t.sep){for(const r of t.sep)if(r.type==="newline")return!0}if(Ii(t.key)||Ii(t.value))return!0}return!1;default:return!0}}f(Ii,"n$H");HF(Ii,"containsNewline");var JF=Object.defineProperty,KF=f((e,t)=>JF(e,"name",{value:t,configurable:!0}),"t$G");function Ia(e,t,r){if(t?.type==="flow-collection"){const n=t.end[0];n.indent===e&&(n.source==="]"||n.source==="}")&&Ii(t)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}f(Ia,"c$z");KF(Ia,"flowIndentCheck");var YF=Object.defineProperty,XF=f((e,t)=>YF(e,"name",{value:t,configurable:!0}),"u$z");function vf(e,t,r){const{uniqueKeys:n}=e.options;if(n===!1)return!1;const i=typeof n=="function"?n:(s,o)=>s===o||je(s)&&je(o)&&s.value===o.value;return t.some(s=>i(s.key,r))}f(vf,"a$G");XF(vf,"mapIncludes");var QF=Object.defineProperty,ZF=f((e,t)=>QF(e,"name",{value:t,configurable:!0}),"w$l");const pg="All mapping items must start at the same column";function K$({composeNode:e,composeEmptyNode:t},r,n,i,s){const o=s?.nodeClass??It,a=new o(r.schema);r.atRoot&&(r.atRoot=!1);let l=n.offset,c=null;for(const u of n.items){const{start:d,key:p,sep:m,value:g}=u,$=Mn(d,{indicator:"explicit-key-ind",next:p??m?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),S=!$.found;if(S){if(p&&(p.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==n.indent&&i(l,"BAD_INDENT",pg)),!$.anchor&&!$.tag&&!m){c=$.end,$.comment&&(a.comment?a.comment+=`
|
|
900
|
+
`+$.comment:a.comment=$.comment);continue}($.newlineAfterProp||Ii(p))&&i(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else $.found?.indent!==n.indent&&i(l,"BAD_INDENT",pg);r.atKey=!0;const k=$.end,v=p?e(r,p,$,i):t(r,k,d,null,$,i);r.schema.compat&&Ia(n.indent,p,i),r.atKey=!1,vf(r,a.items,v)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const h=Mn(m??[],{indicator:"map-value-ind",next:g,offset:v.range[2],onError:i,parentIndent:n.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=h.end,h.found){S&&(g?.type==="block-map"&&!h.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&$.start<h.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const b=g?e(r,g,h,i):t(r,l,m,null,h,i);r.schema.compat&&Ia(n.indent,g,i),l=b.range[2];const w=new jt(v,b);r.options.keepSourceTokens&&(w.srcToken=u),a.items.push(w)}else{S&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),h.comment&&(v.comment?v.comment+=`
|
|
901
|
+
`+h.comment:v.comment=h.comment);const b=new jt(v);r.options.keepSourceTokens&&(b.srcToken=u),a.items.push(b)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}f(K$,"v$m");ZF(K$,"resolveBlockMap");var eL=Object.defineProperty,tL=f((e,t)=>eL(e,"name",{value:t,configurable:!0}),"u$y");function Y$({composeNode:e,composeEmptyNode:t},r,n,i,s){const o=s?.nodeClass??_n,a=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let l=n.offset,c=null;for(const{start:u,value:d}of n.items){const p=Mn(u,{indicator:"seq-item-ind",next:d,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=p.end,p.comment&&(a.comment=p.comment);continue}const m=d?e(r,d,p,i):t(r,p.end,u,null,p,i);r.schema.compat&&Ia(n.indent,d,i),l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c??l],a}f(Y$,"S$m");tL(Y$,"resolveBlockSeq");var rL=Object.defineProperty,nL=f((e,t)=>rL(e,"name",{value:t,configurable:!0}),"f$k");function Xi(e,t,r,n){let i="";if(e){let s=!1,o="";for(const a of e){const{source:l,type:c}=a;switch(c){case"space":s=!0;break;case"comment":{r&&!s&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const u=l.substring(1)||" ";i?i+=o+u:i=u,o="";break}case"newline":i&&(o+=l),s=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:i,offset:t}}f(Xi,"u$x");nL(Xi,"resolveEnd");var iL=Object.defineProperty,X$=f((e,t)=>iL(e,"name",{value:t,configurable:!0}),"T$m");const Ml="Block collections are not allowed within flow collections",Vl=X$(e=>e&&(e.type==="block-map"||e.type==="block-seq"),"isBlock");function Q$({composeNode:e,composeEmptyNode:t},r,n,i,s){const o=n.start.source==="{",a=o?"flow map":"flow sequence",l=s?.nodeClass??(o?It:_n),c=new l(r.schema);c.flow=!0;const u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let S=0;S<n.items.length;++S){const k=n.items[S],{start:v,key:h,sep:b,value:w}=k,y=Mn(v,{flow:a,indicator:"explicit-key-ind",next:h??b?.[0],offset:d,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!y.found){if(!y.anchor&&!y.tag&&!b&&!w){S===0&&y.comma?i(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):S<n.items.length-1&&i(y.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),y.comment&&(c.comment?c.comment+=`
|
|
902
|
+
`+y.comment:c.comment=y.comment),d=y.end;continue}!o&&r.options.strict&&Ii(h)&&i(h,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)y.comma&&i(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(y.comma||i(y.start,"MISSING_CHAR",`Missing , between ${a} items`),y.comment){let D="";e:for(const E of v)switch(E.type){case"comma":case"space":break;case"comment":D=E.source.substring(1);break e;default:break e}if(D){let E=c.items[c.items.length-1];Be(E)&&(E=E.value??E.key),E.comment?E.comment+=`
|
|
903
|
+
`+D:E.comment=D,y.comment=y.comment.substring(D.length+1)}}if(!o&&!b&&!y.found){const D=w?e(r,w,y,i):t(r,y.end,b,null,y,i);c.items.push(D),d=D.range[2],Vl(w)&&i(D.range,"BLOCK_IN_FLOW",Ml)}else{r.atKey=!0;const D=y.end,E=h?e(r,h,y,i):t(r,D,v,null,y,i);Vl(h)&&i(E.range,"BLOCK_IN_FLOW",Ml),r.atKey=!1;const A=Mn(b??[],{flow:a,indicator:"map-value-ind",next:w,offset:E.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!y.found&&r.options.strict){if(b)for(const W of b){if(W===A.found)break;if(W.type==="newline"){i(W,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}y.start<A.found.offset-1024&&i(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else w&&("source"in w&&w.source?.[0]===":"?i(w,"MISSING_CHAR",`Missing space after : in ${a}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const j=w?e(r,w,A,i):A.found?t(r,A.end,b,null,A,i):null;j?Vl(w)&&i(j.range,"BLOCK_IN_FLOW",Ml):A.comment&&(E.comment?E.comment+=`
|
|
904
|
+
`+A.comment:E.comment=A.comment);const G=new jt(E,j);if(r.options.keepSourceTokens&&(G.srcToken=k),o){const W=c;vf(r,W.items,E)&&i(D,"DUPLICATE_KEY","Map keys must be unique"),W.items.push(G)}else{const W=new It(r.schema);W.flow=!0,W.items.push(G);const ce=(j??E).range;W.range=[E.range[0],ce[1],ce[2]],c.items.push(W)}d=j?j.range[2]:A.end}}const p=o?"}":"]",[m,...g]=n.end;let $=d;if(m?.source===p)$=m.offset+m.source.length;else{const S=a[0].toUpperCase()+a.substring(1),k=u?`${S} must end with a ${p}`:`${S} in block collection must be sufficiently indented and end with a ${p}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",k),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){const S=Xi(g,$,r.options.strict,i);S.comment&&(c.comment?c.comment+=`
|
|
905
|
+
`+S.comment:c.comment=S.comment),c.range=[n.offset,$,S.offset]}else c.range=[n.offset,$,$];return c}f(Q$,"F$g");X$(Q$,"resolveFlowCollection");var sL=Object.defineProperty,Z$=f((e,t)=>sL(e,"name",{value:t,configurable:!0}),"u$w");function va(e,t,r,n,i,s){const o=r.type==="block-map"?K$(e,t,r,n,s):r.type==="block-seq"?Y$(e,t,r,n,s):Q$(e,t,r,n,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}f(va,"A$l");Z$(va,"resolveCollection");function ew(e,t,r,n,i){const s=n.tag,o=s?t.directives.tagName(s.source,p=>i(s,"TAG_RESOLVE_FAILED",p)):null;if(r.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=n,g=p&&s?p.offset>s.offset?p:s:p??s;g&&(!m||m.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}const a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===It.tagName&&a==="map"||o===_n.tagName&&a==="seq")return va(e,t,r,i,o);let l=t.schema.tags.find(p=>p.tag===o&&p.collection===a);if(!l){const p=t.schema.knownTags[o];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?i(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),va(e,t,r,i,o)}const c=va(e,t,r,i,o,l),u=l.resolve?.(c,p=>i(s,"TAG_RESOLVE_FAILED",p),t.options)??c,d=Ie(u)?u:new ae(u);return d.range=c.range,d.tag=o,l?.format&&(d.format=l.format),d}f(ew,"I$l");Z$(ew,"composeCollection");var oL=Object.defineProperty,bf=f((e,t)=>oL(e,"name",{value:t,configurable:!0}),"B$g");function $f(e,t,r){const n=t.offset,i=tw(t,e.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const s=i.mode===">"?ae.BLOCK_FOLDED:ae.BLOCK_LITERAL,o=t.source?rw(t.source):[];let a=o.length;for(let $=o.length-1;$>=0;--$){const S=o[$][1];if(S===""||S==="\r")a=$;else break}if(a===0){const $=i.chomp==="+"&&o.length>0?`
|
|
906
|
+
`.repeat(Math.max(1,o.length-1)):"";let S=n+i.length;return t.source&&(S+=t.source.length),{value:$,type:s,comment:i.comment,range:[n,S,S]}}let l=t.indent+i.indent,c=t.offset+i.length,u=0;for(let $=0;$<a;++$){const[S,k]=o[$];if(k===""||k==="\r")i.indent===0&&S.length>l&&(l=S.length);else{S.length<l&&r(c+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=S.length),u=$,l===0&&!e.atRoot&&r(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=S.length+k.length+1}for(let $=o.length-1;$>=a;--$)o[$][0].length>l&&(a=$+1);let d="",p="",m=!1;for(let $=0;$<u;++$)d+=o[$][0].slice(l)+`
|
|
907
|
+
`;for(let $=u;$<a;++$){let[S,k]=o[$];c+=S.length+k.length+1;const v=k[k.length-1]==="\r";if(v&&(k=k.slice(0,-1)),k&&S.length<l){const h=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(c-k.length-(v?2:1),"BAD_INDENT",h),S=""}s===ae.BLOCK_LITERAL?(d+=p+S.slice(l)+k,p=`
|
|
908
|
+
`):S.length>l||k[0]===" "?(p===" "?p=`
|
|
909
|
+
`:!m&&p===`
|
|
910
|
+
`&&(p=`
|
|
911
|
+
|
|
912
|
+
`),d+=p+S.slice(l)+k,p=`
|
|
913
|
+
`,m=!0):k===""?p===`
|
|
914
|
+
`?d+=`
|
|
915
|
+
`:p=`
|
|
916
|
+
`:(d+=p+k,p=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let $=a;$<o.length;++$)d+=`
|
|
917
|
+
`+o[$][0].slice(l);d[d.length-1]!==`
|
|
918
|
+
`&&(d+=`
|
|
919
|
+
`);break;default:d+=`
|
|
920
|
+
`}const g=n+i.length+t.source.length;return{value:d,type:s,comment:i.comment,range:[n,g,g]}}f($f,"E$l");bf($f,"resolveBlockScalar");function tw({offset:e,props:t},r,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],s=i[0];let o=0,a="",l=-1;for(let p=1;p<i.length;++p){const m=i[p];if(!a&&(m==="-"||m==="+"))a=m;else{const g=Number(m);!o&&g?o=g:l===-1&&(l=e+p)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,u="",d=i.length;for(let p=1;p<t.length;++p){const m=t[p];switch(m.type){case"space":c=!0;case"newline":d+=m.source.length;break;case"comment":r&&!c&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=m.source.length,u=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),d+=m.source.length;break;default:{const g=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",g);const $=m.source;$&&typeof $=="string"&&(d+=$.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:d}}f(tw,"L$i");bf(tw,"parseBlockScalarHeader");function rw(e){const t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),i=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let s=1;s<t.length;s+=2)i.push([t[s],t[s+1]]);return i}f(rw,"T$l");bf(rw,"splitLines");var aL=Object.defineProperty,cn=f((e,t)=>aL(e,"name",{value:t,configurable:!0}),"r$K");function wf(e,t,r){const{offset:n,type:i,source:s,end:o}=e;let a,l;const c=cn((p,m,g)=>r(n+p,m,g),"_onError");switch(i){case"scalar":a=ae.PLAIN,l=nw(s,c);break;case"single-quoted-scalar":a=ae.QUOTE_SINGLE,l=iw(s,c);break;case"double-quoted-scalar":a=ae.QUOTE_DOUBLE,l=sw(s,c);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}const u=n+s.length,d=Xi(o,u,t,r);return{value:l,type:a,comment:d.comment,range:[n,u,d.offset]}}f(wf,"_$i");cn(wf,"resolveFlowScalar");function nw(e,t){let r="";switch(e[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}return r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),kf(e)}f(nw,"v$l");cn(nw,"plainValue");function iw(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),kf(e.slice(1,-1)).replace(/''/g,"'")}f(iw,"I$k");cn(iw,"singleQuotedValue");function kf(e){let t,r;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
921
|
+
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
922
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let i=n[1],s=" ",o=t.lastIndex;for(r.lastIndex=o;n=r.exec(e);)n[1]===""?s===`
|
|
923
|
+
`?i+=s:s=`
|
|
924
|
+
`:(i+=s+n[1],s=" "),o=r.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(e),i+s+(n?.[1]??"")}f(kf,"b$t");cn(kf,"foldLines");function sw(e,t){let r="";for(let n=1;n<e.length-1;++n){const i=e[n];if(!(i==="\r"&&e[n+1]===`
|
|
925
|
+
`))if(i===`
|
|
926
|
+
`){const{fold:s,offset:o}=ow(e,n);r+=s,n=o}else if(i==="\\"){let s=e[++n];const o=cL[s];if(o)r+=o;else if(s===`
|
|
927
|
+
`)for(s=e[n+1];s===" "||s===" ";)s=e[++n+1];else if(s==="\r"&&e[n+1]===`
|
|
928
|
+
`)for(s=e[++n+1];s===" "||s===" ";)s=e[++n+1];else if(s==="x"||s==="u"||s==="U"){const a=s==="x"?2:s==="u"?4:8;r+=aw(e,n+1,a,t),n+=a}else{const a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i===" "){const s=n;let o=e[n+1];for(;o===" "||o===" ";)o=e[++n+1];o!==`
|
|
929
|
+
`&&!(o==="\r"&&e[n+2]===`
|
|
930
|
+
`)&&(r+=n>s?e.slice(s,n+1):i)}else r+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),r}f(sw,"S$k");cn(sw,"doubleQuotedValue");function ow(e,t){let r="",n=e[t+1];for(;(n===" "||n===" "||n===`
|
|
931
|
+
`||n==="\r")&&!(n==="\r"&&e[t+2]!==`
|
|
932
|
+
`);)n===`
|
|
933
|
+
`&&(r+=`
|
|
934
|
+
`),t+=1,n=e[t+1];return r||(r=" "),{fold:r,offset:t}}f(ow,"k$q");cn(ow,"foldNewline");const cL={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
935
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function aw(e,t,r,n){const i=e.substr(t,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{const o=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}f(aw,"A$k");cn(aw,"parseCharCode");var lL=Object.defineProperty,Sf=f((e,t)=>lL(e,"name",{value:t,configurable:!0}),"m$s");function Ef(e,t,r,n){const{value:i,type:s,comment:o,range:a}=t.type==="block-scalar"?$f(e,t,n):wf(t,e.options.strict,n),l=r?e.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null;let c;e.options.stringKeys&&e.atKey?c=e.schema[pr]:l?c=cw(e.schema,i,l,r,n):t.type==="scalar"?c=lw(e,i,t,n):c=e.schema[pr];let u;try{const d=c.resolve(i,p=>n(r??t,"TAG_RESOLVE_FAILED",p),e.options);u=je(d)?d:new ae(d)}catch(d){const p=d instanceof Error?d.message:String(d);n(r??t,"TAG_RESOLVE_FAILED",p),u=new ae(i)}return u.range=a,u.source=i,s&&(u.type=s),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}f(Ef,"E$k");Sf(Ef,"composeScalar");function cw(e,t,r,n,i){if(r==="!")return e[pr];const s=[];for(const a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)s.push(a);else return a;for(const a of s)if(a.test?.test(t))return a;const o=e.knownTags[r];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[pr])}f(cw,"_$h");Sf(cw,"findScalarTagByName");function lw({atKey:e,directives:t,schema:r},n,i,s){const o=r.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||r[pr];if(r.compat){const a=r.compat.find(l=>l.default&&l.test?.test(n))??r[pr];if(o.tag!==a.tag){const l=t.tagString(o.tag),c=t.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;s(i,"TAG_RESOLVE_FAILED",u,!0)}}return o}f(lw,"F$f");Sf(lw,"findScalarTagByTest");var uL=Object.defineProperty,pL=f((e,t)=>uL(e,"name",{value:t,configurable:!0}),"a$F");function uw(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++n];i?.type==="space";)e+=i.source.length,i=t[++n];break}}return e}f(uw,"s$A");pL(uw,"emptyScalarPosition");var dL=Object.defineProperty,Df=f((e,t)=>dL(e,"name",{value:t,configurable:!0}),"u$v");const fL={composeNode:Cf,composeEmptyNode:jc};function Cf(e,t,r,n){const i=e.atKey,{spaceBefore:s,comment:o,anchor:a,tag:l}=r;let c,u=!0;switch(t.type){case"alias":c=pw(e,t,n),(a||l)&&n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Ef(e,t,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=ew(fL,e,t,r,n),a&&(c.anchor=a.source.substring(1))}catch(d){const p=d instanceof Error?d.message:String(d);n(t,"RESOURCE_EXHAUSTION",p)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",d),u=!1}}return c??(c=jc(e,t.offset,void 0,null,r,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!je(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?c.comment=o:c.commentBefore=o),e.options.keepSourceTokens&&u&&(c.srcToken=t),c}f(Cf,"A$j");Df(Cf,"composeNode");function jc(e,t,r,n,{spaceBefore:i,comment:s,anchor:o,tag:a,end:l},c){const u={type:"scalar",offset:uw(t,r,n),indent:-1,source:""},d=Ef(e,u,a,c);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=l),d}f(jc,"p$v");Df(jc,"composeEmptyNode");function pw({options:e},{offset:t,source:r,end:n},i){const s=new Xd(r.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+r.length,a=Xi(n,o,e.strict,i);return s.range=[t,o,a.offset],a.comment&&(s.comment=a.comment),s}f(pw,"I$j");Df(pw,"composeAlias");var mL=Object.defineProperty,hL=f((e,t)=>mL(e,"name",{value:t,configurable:!0}),"f$j");function dw(e,t,{offset:r,start:n,value:i,end:s},o){const a=Object.assign({_directives:t},e),l=new yf(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=Mn(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Cf(c,i,u,o):jc(c,u.end,n,null,u,o);const d=l.contents.range[2],p=Xi(s,d,!1,o);return p.comment&&(l.comment=p.comment),l.range=[r,d,p.offset],l}f(dw,"b$s");hL(dw,"composeDoc");var gL=Object.defineProperty,Af=f((e,t)=>gL(e,"name",{value:t,configurable:!0}),"h$t");function bi(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:r}=e;return[t,t+(typeof r=="string"?r.length:1)]}f(bi,"c$y");Af(bi,"getErrorPos");function Wp(e){let t="",r=!1,n=!1;for(let i=0;i<e.length;++i){const s=e[i];switch(s[0]){case"#":t+=(t===""?"":n?`
|
|
936
|
+
|
|
937
|
+
`:`
|
|
938
|
+
`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:t,afterEmptyLine:n}}f(Wp,"m$r");Af(Wp,"parsePrelude");let fw=class{static{f(this,"w")}static{Af(this,"Composer")}constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{const o=bi(r);s?this.warnings.push(new UF(o,n,i)):this.errors.push(new Ei(o,n,i))},this.directives=new Ai({version:t.version||"1.2"}),this.options=t}decorate(t,r){const{comment:n,afterEmptyLine:i}=Wp(this.prelude);if(n){const s=t.contents;if(r)t.comment=t.comment?`${t.comment}
|
|
939
|
+
${n}`:n;else if(i||t.directives.docStart||!s)t.commentBefore=n;else if(Le(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Be(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${n}
|
|
940
|
+
${a}`:n}else{const o=s.commentBefore;s.commentBefore=o?`${n}
|
|
941
|
+
${o}`:n}}r?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Wp(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,r=!1,n=-1){for(const i of t)yield*this.next(i);yield*this.end(r,n)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(r,n,i)=>{const s=bi(t);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const r=dw(this.options,this.directives,t,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const r=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new Ei(bi(t),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new Ei(bi(t),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const r=Xi(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
|
|
942
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Ei(bi(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const n=Object.assign({_directives:this.directives},this.options),i=new yf(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};var yL=Object.defineProperty,Xn=f((e,t)=>yL(e,"name",{value:t,configurable:!0}),"i$F");function vL(e,t=!0,r){if(e){const n=Xn((i,s,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,s,o);else throw new Ei([a,a+1],s,o)},"_onError");switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return wf(e,t,n);case"block-scalar":return $f({options:{strict:t}},e,n)}}return null}f(vL,"q$a");Xn(vL,"resolveAsScalar");function bL(e,t){const{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=t,a=Ji({type:o,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
943
|
+
`}];switch(a[0]){case"|":case">":{const c=a.indexOf(`
|
|
944
|
+
`),u=a.substring(0,c),d=a.substring(c+1)+`
|
|
945
|
+
`,p=[{type:"block-scalar-header",offset:s,indent:n,source:u}];return Of(p,l)||p.push({type:"newline",offset:-1,indent:n,source:`
|
|
946
|
+
`}),{type:"block-scalar",offset:s,indent:n,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:a,end:l};default:return{type:"scalar",offset:s,indent:n,source:a,end:l}}}f(bL,"E$j");Xn(bL,"createScalarToken");function $L(e,t,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=r,a="indent"in e?e.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=e.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Ji({type:o,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":mw(e,l);break;case'"':ba(e,l,"double-quoted-scalar");break;case"'":ba(e,l,"single-quoted-scalar");break;default:ba(e,l,"scalar")}}f($L,"L$h");Xn($L,"setScalarValue");function mw(e,t){const r=t.indexOf(`
|
|
947
|
+
`),n=t.substring(0,r),i=t.substring(r+1)+`
|
|
948
|
+
`;if(e.type==="block-scalar"){const s=e.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,e.source=i}else{const{offset:s}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:n}];Of(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
949
|
+
`});for(const l of Object.keys(e))l!=="type"&&l!=="offset"&&delete e[l];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}f(mw,"A$i");Xn(mw,"setBlockScalarValue");function Of(e,t){if(t)for(const r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}f(Of,"b$r");Xn(Of,"addEndtoBlockProps");function ba(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{const n=e.props.slice(1);let i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(const s of n)s.offset+=i;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{const n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
950
|
+
`};delete e.items,Object.assign(e,{type:r,source:t,end:[n]});break}default:{const n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(const s of Object.keys(e))s!=="type"&&s!=="offset"&&delete e[s];Object.assign(e,{type:r,indent:n,source:t,end:i})}}}f(ba,"u$u");Xn(ba,"setFlowScalarValue");var wL=Object.defineProperty,jf=f((e,t)=>wL(e,"name",{value:t,configurable:!0}),"t$F");jf(e=>"type"in e?ao(e):Qs(e),"stringify");function ao(e){switch(e.type){case"block-scalar":{let t="";for(const r of e.props)t+=ao(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(const r of e.items)t+=Qs(r);return t}case"flow-collection":{let t=e.start.source;for(const r of e.items)t+=Qs(r);for(const r of e.end)t+=r.source;return t}case"document":{let t=Qs(e);if(e.end)for(const r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const r of e.end)t+=r.source;return t}}}f(ao,"f$h");jf(ao,"stringifyToken");function Qs({start:e,key:t,sep:r,value:n}){let i="";for(const s of e)i+=s.source;if(t&&(i+=ao(t)),r)for(const s of r)i+=s.source;return n&&(i+=ao(n)),i}f(Qs,"c$x");jf(Qs,"stringifyItem");var kL=Object.defineProperty,hw=f((e,t)=>kL(e,"name",{value:t,configurable:!0}),"s$z");const Up=Symbol("break visit"),SL=Symbol("skip children"),gw=Symbol("remove item");function Vn(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),xf(Object.freeze([]),e,t)}f(Vn,"l$s");hw(Vn,"visit");Vn.BREAK=Up;Vn.SKIP=SL;Vn.REMOVE=gw;Vn.itemAtPath=(e,t)=>{let r=e;for(const[n,i]of t){const s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};Vn.parentCollection=(e,t)=>{const r=Vn.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function xf(e,t,r){let n=r(t,e);if(typeof n=="symbol")return n;for(const i of["key","value"]){const s=t[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){const a=xf(Object.freeze(e.concat([[i,o]])),s.items[o],r);if(typeof a=="number")o=a-1;else{if(a===Up)return Up;a===gw&&(s.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(t,e))}}return typeof n=="function"?n(t,e):n}f(xf,"y$p");hw(xf,"_visit");var EL=Object.defineProperty,xc=f((e,t)=>EL(e,"name",{value:t,configurable:!0}),"r$J");const Pf="\uFEFF",Nf="",Rf="",Ta="";xc(e=>!!e&&"items"in e,"isCollection");xc(e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar"),"isScalar");function DL(e){switch(e){case Pf:return"<BOM>";case Nf:return"<DOC>";case Rf:return"<FLOW_END>";case Ta:return"<SCALAR>";default:return JSON.stringify(e)}}f(DL,"i$E");xc(DL,"prettyToken");function yw(e){switch(e){case Pf:return"byte-order-mark";case Nf:return"doc-mode";case Rf:return"flow-error-end";case Ta:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
951
|
+
`:case`\r
|
|
952
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}f(yw,"d$u");xc(yw,"tokenType");var CL=Object.defineProperty,Ff=f((e,t)=>CL(e,"name",{value:t,configurable:!0}),"a$D");function Ft(e){switch(e){case void 0:case" ":case`
|
|
953
|
+
`:case"\r":case" ":return!0;default:return!1}}f(Ft,"n$G");Ff(Ft,"isEmpty");const dg=new Set("0123456789ABCDEFabcdef"),AL=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ta=new Set(",[]{}"),OL=new Set(` ,[]{}
|
|
954
|
+
\r `),Wl=Ff(e=>!e||OL.has(e),"isNotAnchorChar");let jL=class{static{f(this,"k")}static{Ff(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,r=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,r=this.buffer[t];for(;r===" "||r===" ";)r=this.buffer[++t];return!r||r==="#"||r===`
|
|
955
|
+
`?!0:r==="\r"?this.buffer[t+1]===`
|
|
956
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let r=this.buffer[t];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+t];if(r==="\r"){const i=this.buffer[n+t+1];if(i===`
|
|
957
|
+
`||!i&&!this.atEnd)return t+n+1}return r===`
|
|
958
|
+
`||n>=this.indentNext||!r&&!this.atEnd?t+n:-1}if(r==="-"||r==="."){const n=this.buffer.substr(t,3);if((n==="---"||n==="...")&&Ft(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
959
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===Pf&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let r=t.length,n=t.indexOf("#");for(;n!==-1;){const s=t[n-1];if(s===" "||s===" "){r=n-1;break}else n=t.indexOf("#",n+1)}for(;;){const s=t[r-1];if(s===" "||s===" ")r-=1;else break}const i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const r=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-r),yield*this.pushNewline(),"stream"}return yield Nf,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const r=this.peek(3);if((r==="---"||r==="...")&&Ft(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Ft(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Ft(r)){const n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(t[r]){case"#":yield*this.pushCount(t.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Wl),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,r,n=-1;do t=yield*this.pushNewline(),t>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(t+r>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Ft(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Rf,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Wl),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Ft(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let r=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let s=0;for(;this.buffer[r-1-s]==="\\";)s+=1;if(s%2===0)break;r=this.buffer.indexOf('"',r+1)}const n=this.buffer.substring(0,r);let i=n.indexOf(`
|
|
960
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){const s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
|
|
961
|
+
`,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const r=this.buffer[++t];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Ft(r)||r==="#")}*parseBlockScalar(){let t=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case`
|
|
962
|
+
`:t=s,r=0;break;case"\r":{const o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
963
|
+
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(`
|
|
964
|
+
`,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
965
|
+
`;)n=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);const a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
|
|
966
|
+
`&&s>=this.pos&&s+1+r>a)t=s;else break}while(!0);return yield Ta,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){const s=this.buffer[n+1];if(Ft(s)||t&&ta.has(s))break;r=n}else if(Ft(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
|
|
967
|
+
`?(n+=1,i=`
|
|
968
|
+
`,s=this.buffer[n+1]):r=n),s==="#"||t&&ta.has(s))break;if(i===`
|
|
969
|
+
`){const o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(t&&ta.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ta,yield*this.pushToIndex(r+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,r){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Wl))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,r=this.charAt(1);if(Ft(r)||t&&ta.has(r))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,r=this.buffer[t];for(;!Ft(r)&&r!==">";)r=this.buffer[++t];return yield*this.pushToIndex(r===">"?t+1:t,!1)}else{let t=this.pos+1,r=this.buffer[t];for(;r;)if(AL.has(r))r=this.buffer[++t];else if(r==="%"&&dg.has(this.buffer[t+1])&&dg.has(this.buffer[t+2]))r=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
970
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
971
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||t&&n===" ");const i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(t){let r=this.pos,n=this.buffer[r];for(;!t(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};var xL=Object.defineProperty,PL=f((e,t)=>xL(e,"name",{value:t,configurable:!0}),"s$x");let NL=class{static{f(this,"a")}static{PL(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let r=0,n=this.lineStarts.length;for(;r<n;){const s=r+n>>1;this.lineStarts[s]<t?r=s+1:n=s}if(this.lineStarts[r]===t)return{line:r+1,col:1};if(r===0)return{line:0,col:t};const i=this.lineStarts[r-1];return{line:r,col:t-i+1}}}};var RL=Object.defineProperty,Qn=f((e,t)=>RL(e,"name",{value:t,configurable:!0}),"c$v");function xr(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}f(xr,"r$I");Qn(xr,"includesToken");function Gp(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}f(Gp,"f$f");Qn(Gp,"findNonEmptyIndex");function Lf(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}f(Lf,"y$o");Qn(Lf,"isFlowToken");function _s(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}f(_s,"u$p");Qn(_s,"getPrevProps");function bn(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}f(bn,"h$r");Qn(bn,"getFirstKeyStartProps");function qp(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!xr(t.start,"explicit-key-ind")&&!xr(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Lf(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}f(qp,"d$t");Qn(qp,"fixFlowSeqItems");let vw=class{static{f(this,"b")}static{Qn(this,"Parser")}constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new jL,this.onNewLine=t}*parse(t,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(t,r))yield*this.next(n);r||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const r=yw(t);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const n=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const r=t??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{const n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&qp(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{const i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{const i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){const i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Gp(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Gp(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const r=_s(this.peek(2)),n=bn(r);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
|
|
972
|
+
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
973
|
+
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const r=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){const n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)t.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,t.indent)){const n=t.items[t.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,r.start),n.push(this.sourceToken),t.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const n=!this.onKeyLine&&this.indent===t.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(i&&r.sep&&!r.value){const o=[];for(let a=0;a<r.sep.length;++a){const l=r.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(xr(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Lf(r.key)&&!xr(r.sep,"newline")){const o=bn(r.start),a=r.key,l=r.sep;l.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(xr(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{const o=bn(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?t.items.push({start:s,key:null,sep:[this.sourceToken]}):xr(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||r.value?(t.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!xr(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&t.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const r=t.items[t.items.length-1];switch(this.type){case"newline":if(r.value){const n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,t.indent)){const n=t.items[t.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,r.start),n.push(this.sourceToken),t.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=t.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;r.value||xr(r.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>t.indent){const n=this.startBlockValue(t);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const r=t.items[t.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?t.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?t.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!r||r.value?t.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===t.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const i=_s(n),s=bn(i);qp(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let r=this.source.indexOf(`
|
|
974
|
+
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
975
|
+
`,r)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const r=_s(t),n=bn(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const r=_s(t),n=bn(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,r){return this.type!=="comment"||this.indent<=r?!1:t.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};var FL=Object.defineProperty,Oo=f((e,t)=>FL(e,"name",{value:t,configurable:!0}),"s$w");function If(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new NL||null,prettyErrors:t}}f(If,"a$B");Oo(If,"parseOptions");function LL(e,t={}){const{lineCounter:r,prettyErrors:n}=If(t),i=new vw(r?.addNewLine),s=new fw(t),o=Array.from(s.compose(i.parse(e)));if(n&&r)for(const a of o)a.errors.forEach(La(e,r)),a.warnings.forEach(La(e,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}f(LL,"L$g");Oo(LL,"parseAllDocuments");function bw(e,t={}){const{lineCounter:r,prettyErrors:n}=If(t),i=new vw(r?.addNewLine),s=new fw(t);let o=null;for(const a of s.compose(i.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Ei(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(La(e,r)),o.warnings.forEach(La(e,r))),o}f(bw,"d$s");Oo(bw,"parseDocument");function Ti(e,t,r){let n;typeof t=="function"?n=t:r===void 0&&t&&typeof t=="object"&&(r=t);const i=bw(e,r);if(!i)return null;if(i.warnings.forEach(s=>ef(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}f(Ti,"C$f");Oo(Ti,"parse");function $w(e,t,r){let n=null;if(typeof t=="function"||Array.isArray(t)?n=t:r===void 0&&t&&(r=t),typeof r=="string"&&(r=r.length),typeof r=="number"){const i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){const{keepUndefined:i}=r??t??{};if(!i)return}return Hi(e)&&!n?e.toString(r):new yf(e,n,r).toString(r)}f($w,"A$h");Oo($w,"stringify");var IL=Object.defineProperty,ww=f((e,t)=>IL(e,"name",{value:t,configurable:!0}),"a$A"),TL=Object.defineProperty,kw=ww((e,t)=>TL(e,"name",{value:t,configurable:!0}),"o"),BL=Object.defineProperty,_L=kw((e,t)=>BL(e,"name",{value:t,configurable:!0}),"r");async function jo(e,t,r){const{buffer:n,compression:i,encoding:s="utf8",flag:o,...a}=r??{},l=await Pd(e,{buffer:n,compression:i,encoding:s,flag:o});return typeof t=="function"?Ti(l,t,a):Ti(l,a)}f(jo,"n$F");ww(jo,"g");kw(jo,"l");_L(jo,"readYaml");var ML=Object.defineProperty,Sw=f((e,t)=>ML(e,"name",{value:t,configurable:!0}),"n$E"),VL=Object.defineProperty,Ew=Sw((e,t)=>VL(e,"name",{value:t,configurable:!0}),"o"),WL=Object.defineProperty,UL=Ew((e,t)=>WL(e,"name",{value:t,configurable:!0}),"t");function Mt(e,t,r){const{buffer:n,compression:i,encoding:s="utf8",flag:o,...a}=r??{},l=J(e,{buffer:n,compression:i,encoding:s,flag:o});return typeof t=="function"?Ti(l,t,a):Ti(l,a)}f(Mt,"o$K");Sw(Mt,"g");Ew(Mt,"l");UL(Mt,"readYamlSync");var GL=Object.defineProperty,Dw=f((e,t)=>GL(e,"name",{value:t,configurable:!0}),"i$C"),qL=Object.defineProperty,Cw=Dw((e,t)=>qL(e,"name",{value:t,configurable:!0}),"t"),zL=Object.defineProperty,HL=Cw((e,t)=>zL(e,"name",{value:t,configurable:!0}),"a");function xo(e,t,r,n){let i,s,o;typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof r!="function"?(i=r,s=i.replacer,o=i.space):typeof n=="object"?(i=n,s=r,o=i.space):(s=r,o=n);const a=$w(t,s,o??i);ze(e,a,i)}f(xo,"n$D");Dw(xo,"b");Cw(xo,"c");HL(xo,"writeYamlSync");var JL=Object.defineProperty,Ke=f((e,t)=>JL(e,"name",{value:t,configurable:!0}),"n$C"),KL=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,YL=/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,XL=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Ul={Space_Separator:KL,ID_Start:YL,ID_Continue:XL},Ue={isSpaceSeparator(e){return typeof e=="string"&&Ul.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Ul.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e===""||e===""||Ul.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let zp,ft,Nr,Ba,nn,Ht,Xe,Tf,Zs;var QL=Ke(function(e,t){zp=String(e),ft="start",Nr=[],Ba=0,nn=1,Ht=0,Xe=void 0,Tf=void 0,Zs=void 0;do Xe=Aw(),ZL[ft]();while(Xe.type!=="eof");return typeof t=="function"?_a({"":Zs},"",t):Zs},"parse");function _a(e,t,r){const n=e[t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){const s=String(i),o=_a(n,s,r);o===void 0?delete n[s]:Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(const i in n){const s=_a(n,i,r);s===void 0?delete n[i]:Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return r.call(e,t,n)}f(_a,"T$k");Ke(_a,"internalize");let ue,se,Ms,Or,me;function Aw(){for(ue="default",se="",Ms=!1,Or=1;;){me=cr();const e=Ow[ue]();if(e)return e}}f(Aw,"tu");Ke(Aw,"lex");function cr(){if(zp[Ba])return String.fromCodePoint(zp.codePointAt(Ba))}f(cr,"S$i");Ke(cr,"peek");function I(){const e=cr();return e===`
|
|
976
|
+
`?(nn++,Ht=0):e?Ht+=e.length:Ht++,e&&(Ba+=e.length),e}f(I,"u$n");Ke(I,"read");const Ow={default(){switch(me){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
|
977
|
+
`:case"\r":case"\u2028":case"\u2029":I();return;case"/":I(),ue="comment";return;case void 0:return I(),Ce("eof")}if(Ue.isSpaceSeparator(me)){I();return}return Ow[ft]()},comment(){switch(me){case"*":I(),ue="multiLineComment";return;case"/":I(),ue="singleLineComment";return}throw xe(I())},multiLineComment(){switch(me){case"*":I(),ue="multiLineCommentAsterisk";return;case void 0:throw xe(I())}I()},multiLineCommentAsterisk(){switch(me){case"*":I();return;case"/":I(),ue="default";return;case void 0:throw xe(I())}I(),ue="multiLineComment"},singleLineComment(){switch(me){case`
|
|
978
|
+
`:case"\r":case"\u2028":case"\u2029":I(),ue="default";return;case void 0:return I(),Ce("eof")}I()},value(){switch(me){case"{":case"[":return Ce("punctuator",I());case"n":return I(),Hr("ull"),Ce("null",null);case"t":return I(),Hr("rue"),Ce("boolean",!0);case"f":return I(),Hr("alse"),Ce("boolean",!1);case"-":case"+":I()==="-"&&(Or=-1),ue="sign";return;case".":se=I(),ue="decimalPointLeading";return;case"0":se=I(),ue="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":se=I(),ue="decimalInteger";return;case"I":return I(),Hr("nfinity"),Ce("numeric",1/0);case"N":return I(),Hr("aN"),Ce("numeric",NaN);case'"':case"'":Ms=I()==='"',se="",ue="string";return}throw xe(I())},identifierNameStartEscape(){if(me!=="u")throw xe(I());I();const e=Ma();switch(e){case"$":case"_":break;default:if(!Ue.isIdStartChar(e))throw Hp();break}se+=e,ue="identifierName"},identifierName(){switch(me){case"$":case"_":case"":case"":se+=I();return;case"\\":I(),ue="identifierNameEscape";return}if(Ue.isIdContinueChar(me)){se+=I();return}return Ce("identifier",se)},identifierNameEscape(){if(me!=="u")throw xe(I());I();const e=Ma();switch(e){case"$":case"_":case"":case"":break;default:if(!Ue.isIdContinueChar(e))throw Hp();break}se+=e,ue="identifierName"},sign(){switch(me){case".":se=I(),ue="decimalPointLeading";return;case"0":se=I(),ue="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":se=I(),ue="decimalInteger";return;case"I":return I(),Hr("nfinity"),Ce("numeric",Or*(1/0));case"N":return I(),Hr("aN"),Ce("numeric",NaN)}throw xe(I())},zero(){switch(me){case".":se+=I(),ue="decimalPoint";return;case"e":case"E":se+=I(),ue="decimalExponent";return;case"x":case"X":se+=I(),ue="hexadecimal";return}return Ce("numeric",Or*0)},decimalInteger(){switch(me){case".":se+=I(),ue="decimalPoint";return;case"e":case"E":se+=I(),ue="decimalExponent";return}if(Ue.isDigit(me)){se+=I();return}return Ce("numeric",Or*Number(se))},decimalPointLeading(){if(Ue.isDigit(me)){se+=I(),ue="decimalFraction";return}throw xe(I())},decimalPoint(){switch(me){case"e":case"E":se+=I(),ue="decimalExponent";return}if(Ue.isDigit(me)){se+=I(),ue="decimalFraction";return}return Ce("numeric",Or*Number(se))},decimalFraction(){switch(me){case"e":case"E":se+=I(),ue="decimalExponent";return}if(Ue.isDigit(me)){se+=I();return}return Ce("numeric",Or*Number(se))},decimalExponent(){switch(me){case"+":case"-":se+=I(),ue="decimalExponentSign";return}if(Ue.isDigit(me)){se+=I(),ue="decimalExponentInteger";return}throw xe(I())},decimalExponentSign(){if(Ue.isDigit(me)){se+=I(),ue="decimalExponentInteger";return}throw xe(I())},decimalExponentInteger(){if(Ue.isDigit(me)){se+=I();return}return Ce("numeric",Or*Number(se))},hexadecimal(){if(Ue.isHexDigit(me)){se+=I(),ue="hexadecimalInteger";return}throw xe(I())},hexadecimalInteger(){if(Ue.isHexDigit(me)){se+=I();return}return Ce("numeric",Or*Number(se))},string(){switch(me){case"\\":I(),se+=jw();return;case'"':if(Ms)return I(),Ce("string",se);se+=I();return;case"'":if(!Ms)return I(),Ce("string",se);se+=I();return;case`
|
|
979
|
+
`:case"\r":throw xe(I());case"\u2028":case"\u2029":Pw(me);break;case void 0:throw xe(I())}se+=I()},start(){switch(me){case"{":case"[":return Ce("punctuator",I())}ue="value"},beforePropertyName(){switch(me){case"$":case"_":se=I(),ue="identifierName";return;case"\\":I(),ue="identifierNameStartEscape";return;case"}":return Ce("punctuator",I());case'"':case"'":Ms=I()==='"',ue="string";return}if(Ue.isIdStartChar(me)){se+=I(),ue="identifierName";return}throw xe(I())},afterPropertyName(){if(me===":")return Ce("punctuator",I());throw xe(I())},beforePropertyValue(){ue="value"},afterPropertyValue(){switch(me){case",":case"}":return Ce("punctuator",I())}throw xe(I())},beforeArrayValue(){if(me==="]")return Ce("punctuator",I());ue="value"},afterArrayValue(){switch(me){case",":case"]":return Ce("punctuator",I())}throw xe(I())},end(){throw xe(I())}};function Ce(e,t){return{type:e,value:t,line:nn,column:Ht}}f(Ce,"i$B");Ke(Ce,"newToken");function Hr(e){for(const t of e){if(cr()!==t)throw xe(I());I()}}f(Hr,"I$i");Ke(Hr,"literal");function jw(){switch(cr()){case"b":return I(),"\b";case"f":return I(),"\f";case"n":return I(),`
|
|
980
|
+
`;case"r":return I(),"\r";case"t":return I()," ";case"v":return I(),"\v";case"0":if(I(),Ue.isDigit(cr()))throw xe(I());return"\0";case"x":return I(),xw();case"u":return I(),Ma();case`
|
|
981
|
+
`:case"\u2028":case"\u2029":return I(),"";case"\r":return I(),cr()===`
|
|
982
|
+
`&&I(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw xe(I());case void 0:throw xe(I())}return I()}f(jw,"Au");Ke(jw,"escape");function xw(){let e="",t=cr();if(!Ue.isHexDigit(t)||(e+=I(),t=cr(),!Ue.isHexDigit(t)))throw xe(I());return e+=I(),String.fromCodePoint(parseInt(e,16))}f(xw,"ru");Ke(xw,"hexEscape");function Ma(){let e="",t=4;for(;t-- >0;){const r=cr();if(!Ue.isHexDigit(r))throw xe(I());e+=I()}return String.fromCodePoint(parseInt(e,16))}f(Ma,"Z$6");Ke(Ma,"unicodeEscape");const ZL={start(){if(Xe.type==="eof")throw Jr();$a()},beforePropertyName(){switch(Xe.type){case"identifier":case"string":Tf=Xe.value,ft="afterPropertyName";return;case"punctuator":Vs();return;case"eof":throw Jr()}},afterPropertyName(){if(Xe.type==="eof")throw Jr();ft="beforePropertyValue"},beforePropertyValue(){if(Xe.type==="eof")throw Jr();$a()},beforeArrayValue(){if(Xe.type==="eof")throw Jr();if(Xe.type==="punctuator"&&Xe.value==="]"){Vs();return}$a()},afterPropertyValue(){if(Xe.type==="eof")throw Jr();switch(Xe.value){case",":ft="beforePropertyName";return;case"}":Vs()}},afterArrayValue(){if(Xe.type==="eof")throw Jr();switch(Xe.value){case",":ft="beforeArrayValue";return;case"]":Vs()}},end(){}};function $a(){let e;switch(Xe.type){case"punctuator":switch(Xe.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=Xe.value;break}if(Zs===void 0)Zs=e;else{const t=Nr[Nr.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,Tf,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Nr.push(e),Array.isArray(e)?ft="beforeArrayValue":ft="beforePropertyName";else{const t=Nr[Nr.length-1];t==null?ft="end":Array.isArray(t)?ft="afterArrayValue":ft="afterPropertyValue"}}f($a,"q$9");Ke($a,"push");function Vs(){Nr.pop();const e=Nr[Nr.length-1];e==null?ft="end":Array.isArray(e)?ft="afterArrayValue":ft="afterPropertyValue"}f(Vs,"_$g");Ke(Vs,"pop");function xe(e){return Pc(e===void 0?`JSON5: invalid end of input at ${nn}:${Ht}`:`JSON5: invalid character '${Bf(e)}' at ${nn}:${Ht}`)}f(xe,"a$z");Ke(xe,"invalidChar");function Jr(){return Pc(`JSON5: invalid end of input at ${nn}:${Ht}`)}f(Jr,"v$h");Ke(Jr,"invalidEOF");function Hp(){return Ht-=5,Pc(`JSON5: invalid identifier character at ${nn}:${Ht}`)}f(Hp,"R$f");Ke(Hp,"invalidIdentifier");function Pw(e){console.warn(`JSON5: '${Bf(e)}' in strings is not valid ECMAScript; consider escaping`)}f(Pw,"nu");Ke(Pw,"separatorChar");function Bf(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const r=e.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return e}f(Bf,"G$7");Ke(Bf,"formatChar");function Pc(e){const t=new SyntaxError(e);return t.lineNumber=nn,t.columnNumber=Ht,t}f(Pc,"J$f");Ke(Pc,"syntaxError");var eI=Ke(function(e,t,r){const n=[];let i="",s,o,a="",l;if(t!=null&&typeof t=="object"&&!Array.isArray(t)&&(r=t.space,l=t.quote,t=t.replacer),typeof t=="function")o=t;else if(Array.isArray(t)){s=[];for(const g of t){let $;typeof g=="string"?$=g:(typeof g=="number"||g instanceof String||g instanceof Number)&&($=String(g)),$!==void 0&&s.indexOf($)<0&&s.push($)}}return r instanceof Number?r=Number(r):r instanceof String&&(r=String(r)),typeof r=="number"?r>0&&(r=Math.min(10,Math.floor(r)),a=" ".substr(0,r)):typeof r=="string"&&(a=r.substr(0,10)),c("",{"":e});function c(g,$){let S=$[g];switch(S!=null&&(typeof S.toJSON5=="function"?S=S.toJSON5(g):typeof S.toJSON=="function"&&(S=S.toJSON(g))),o&&(S=o.call($,g,S)),S instanceof Number?S=Number(S):S instanceof String?S=String(S):S instanceof Boolean&&(S=S.valueOf()),S){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof S=="string")return u(S);if(typeof S=="number")return String(S);if(typeof S=="object")return Array.isArray(S)?m(S):d(S)}function u(g){const $={"'":.1,'"':.2},S={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let k="";for(let h=0;h<g.length;h++){const b=g[h];switch(b){case"'":case'"':$[b]++,k+=b;continue;case"\0":if(Ue.isDigit(g[h+1])){k+="\\x00";continue}}if(S[b]){k+=S[b];continue}if(b<" "){let w=b.charCodeAt(0).toString(16);k+="\\x"+("00"+w).substring(w.length);continue}k+=b}const v=l||Object.keys($).reduce((h,b)=>$[h]<$[b]?h:b);return k=k.replace(new RegExp(v,"g"),S[v]),v+k+v}function d(g){if(n.indexOf(g)>=0)throw TypeError("Converting circular structure to JSON5");n.push(g);let $=i;i=i+a;let S=s||Object.keys(g),k=[];for(const h of S){const b=c(h,g);if(b!==void 0){let w=p(h)+":";a!==""&&(w+=" "),w+=b,k.push(w)}}let v;if(k.length===0)v="{}";else{let h;if(a==="")h=k.join(","),v="{"+h+"}";else{let b=`,
|
|
983
|
+
`+i;h=k.join(b),v=`{
|
|
984
|
+
`+i+h+`,
|
|
985
|
+
`+$+"}"}}return n.pop(),i=$,v}function p(g){if(g.length===0)return u(g);const $=String.fromCodePoint(g.codePointAt(0));if(!Ue.isIdStartChar($))return u(g);for(let S=$.length;S<g.length;S++)if(!Ue.isIdContinueChar(String.fromCodePoint(g.codePointAt(S))))return u(g);return g}function m(g){if(n.indexOf(g)>=0)throw TypeError("Converting circular structure to JSON5");n.push(g);let $=i;i=i+a;let S=[];for(let v=0;v<g.length;v++){const h=c(String(v),g);S.push(h!==void 0?h:"null")}let k;if(S.length===0)k="[]";else if(a==="")k="["+S.join(",")+"]";else{let v=`,
|
|
986
|
+
`+i,h=S.join(v);k=`[
|
|
987
|
+
`+i+h+`,
|
|
988
|
+
`+$+"]"}return n.pop(),i=$,k}},"stringify");const tI={parse:QL,stringify:eI};var Nw=tI,Gl,fg;function Rw(){return fg||(fg=1,Gl=process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Gl}f(Rw,"requireDebug$1");var ql,mg;function Fw(){return mg||(mg=1,ql={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}),ql}f(Fw,"requireConstants$1");var ra={exports:{}},hg;function rI(){return hg||(hg=1,(function(e,t){var r=Object.defineProperty,n=f((v,h)=>r(v,"name",{value:h,configurable:!0}),"O");const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:o}=Fw(),a=Rw();t=e.exports={};const l=t.re=[],c=t.safeRe=[],u=t.src=[],d=t.safeSrc=[],p=t.t={};let m=0;const g="[a-zA-Z0-9-]",$=[["\\s",1],["\\d",o],[g,s]],S=n(v=>{for(const[h,b]of $)v=v.split(`${h}*`).join(`${h}{0,${b}}`).split(`${h}+`).join(`${h}{1,${b}}`);return v},"makeSafeRegex"),k=n((v,h,b)=>{const w=S(h),y=m++;a(v,y,h),p[v]=y,u[y]=h,d[y]=w,l[y]=new RegExp(h,b?"g":void 0),c[y]=new RegExp(w,b?"g":void 0)},"createToken");k("NUMERICIDENTIFIER","0|[1-9]\\d*"),k("NUMERICIDENTIFIERLOOSE","\\d+"),k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),k("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),k("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),k("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),k("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),k("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),k("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),k("BUILDIDENTIFIER",`${g}+`),k("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),k("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),k("FULL",`^${u[p.FULLPLAIN]}$`),k("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),k("LOOSE",`^${u[p.LOOSEPLAIN]}$`),k("GTLT","((?:<|>)?=?)"),k("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),k("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),k("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),k("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),k("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),k("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),k("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),k("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?(?:${u[p.BUILD]})?(?:$|[^\\d])`),k("COERCERTL",u[p.COERCE],!0),k("COERCERTLFULL",u[p.COERCEFULL],!0),k("LONETILDE","(?:~>?)"),k("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",k("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),k("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),k("LONECARET","(?:\\^)"),k("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",k("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),k("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),k("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),k("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),k("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",k("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),k("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),k("STAR","(<|>)?=?\\s*\\*"),k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ra,ra.exports)),ra.exports}f(rI,"requireRe$1");var zl,gg;function nI(){if(gg)return zl;gg=1;var e=Object.defineProperty,t=f((s,o)=>e(s,"name",{value:o,configurable:!0}),"t");const r=Object.freeze({loose:!0}),n=Object.freeze({});return zl=t(s=>s?typeof s!="object"?r:s:n,"parseOptions"),zl}f(nI,"requireParseOptions$1");var Hl,yg;function iI(){if(yg)return Hl;yg=1;var e=Object.defineProperty,t=f((s,o)=>e(s,"name",{value:o,configurable:!0}),"s");const r=/^[0-9]+$/,n=t((s,o)=>{if(typeof s=="number"&&typeof o=="number")return s===o?0:s<o?-1:1;const a=r.test(s),l=r.test(o);return a&&l&&(s=+s,o=+o),s===o?0:a&&!l?-1:l&&!a?1:s<o?-1:1},"compareIdentifiers"),i=t((s,o)=>n(o,s),"rcompareIdentifiers");return Hl={compareIdentifiers:n,rcompareIdentifiers:i},Hl}f(iI,"requireIdentifiers$1");var Jl,vg;function sI(){if(vg)return Jl;vg=1;var e=Object.defineProperty,t=f((u,d)=>e(u,"name",{value:d,configurable:!0}),"a");const r=Rw(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:i}=Fw(),{safeRe:s,t:o}=rI(),a=nI(),{compareIdentifiers:l}=iI();class c{static{f(this,"SemVer")}static{t(this,"SemVer")}constructor(d,p){if(p=a(p),d instanceof c){if(d.loose===!!p.loose&&d.includePrerelease===!!p.includePrerelease)return d;d=d.version}else if(typeof d!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof d}".`);if(d.length>n)throw new TypeError(`version is longer than ${n} characters`);r("SemVer",d,p),this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease;const m=d.trim().match(p.loose?s[o.LOOSE]:s[o.FULL]);if(!m)throw new TypeError(`Invalid Version: ${d}`);if(this.raw=d,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){const $=+g;if($>=0&&$<i)return $}return g}):this.prerelease=[],this.build=m[5]?m[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(d){if(r("SemVer.compare",this.version,this.options,d),!(d instanceof c)){if(typeof d=="string"&&d===this.version)return 0;d=new c(d,this.options)}return d.version===this.version?0:this.compareMain(d)||this.comparePre(d)}compareMain(d){return d instanceof c||(d=new c(d,this.options)),this.major<d.major?-1:this.major>d.major?1:this.minor<d.minor?-1:this.minor>d.minor?1:this.patch<d.patch?-1:this.patch>d.patch?1:0}comparePre(d){if(d instanceof c||(d=new c(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;let p=0;do{const m=this.prerelease[p],g=d.prerelease[p];if(r("prerelease compare",p,m,g),m===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(m===void 0)return-1;if(m!==g)return l(m,g)}while(++p)}compareBuild(d){d instanceof c||(d=new c(d,this.options));let p=0;do{const m=this.build[p],g=d.build[p];if(r("build compare",p,m,g),m===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(m===void 0)return-1;if(m!==g)return l(m,g)}while(++p)}inc(d,p,m){if(d.startsWith("pre")){if(!p&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(p){const g=`-${p}`.match(this.options.loose?s[o.PRERELEASELOOSE]:s[o.PRERELEASE]);if(!g||g[1]!==p)throw new Error(`invalid identifier: ${p}`)}}switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",p,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",p,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",p,m),this.inc("pre",p,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",p,m),this.inc("pre",p,m);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":{const g=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let $=this.prerelease.length;for(;--$>=0;)typeof this.prerelease[$]=="number"&&(this.prerelease[$]++,$=-2);if($===-1){if(p===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(p){let $=[p,g];m===!1&&($=[p]),l(this.prerelease[0],p)===0?isNaN(this.prerelease[1])&&(this.prerelease=$):this.prerelease=$}break}default:throw new Error(`invalid increment argument: ${d}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Jl=c,Jl}f(sI,"requireSemver$2");var Kl,bg;function Lw(){if(bg)return Kl;bg=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=sI();return Kl=t((i,s,o=!1)=>{if(i instanceof r)return i;try{return new r(i,s)}catch(a){if(!o)return null;throw a}},"parse"),Kl}f(Lw,"requireParse$2");var Yl,$g;function oI(){if($g)return Yl;$g=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=Lw();return Yl=t((i,s)=>{const o=r(i,s);return o?o.version:null},"valid"),Yl}f(oI,"requireValid$2");var Xl,wg;function aI(){if(wg)return Xl;wg=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=Lw();return Xl=t((i,s)=>{const o=r(i.trim().replace(/^[=v]+/,""),s);return o?o.version:null},"clean"),Xl}f(aI,"requireClean$1");var Ql,kg;function Iw(){return kg||(kg=1,Ql=["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","ALGLIB-Documentation","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","Advanced-Cryptics-Dictionary","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","BOLA-1.1","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-Tso","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-Mark-Modifications","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","Buddy","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CAPEC-tou","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","ESA-PL-permissive-2.4","ESA-PL-strong-copyleft-2.4","ESA-PL-weak-copyleft-2.4","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-SMC","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","HPND-sell-variant-critical-systems","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ISO-permission","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-STK","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MMPL-1.0.1","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-TNT","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","OSC-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OSSP","OpenMDW-1.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","ParaType-Free-Font-1.3","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","SGMLUG-PM","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","TekHVC","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","UnRAR","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","Vixie-Cron","W3C","W3C-19980720","W3C-20150513","WTFNMFPL","WTFPL","Watcom-1.0","Widget-Workshop","WordNet","Wsuipa","X11","X11-distribute-modifications-variant","X11-no-permit-persons","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","hyphen-bulgarian","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"]),Ql}f(Iw,"requireSpdxLicenseIds");var Zl,Sg;function cI(){return Sg||(Sg=1,Zl=["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"]),Zl}f(cI,"requireDeprecated");var eu,Eg;function lI(){return Eg||(Eg=1,eu=["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"]),eu}f(lI,"requireSpdxExceptions");var tu,Dg;function uI(){if(Dg)return tu;Dg=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"n"),r=[].concat(Iw()).concat(cI()),n=lI();return tu=f(function(i){var s=0;function o(){return s<i.length}f(o,"o"),t(o,"hasMore");function a(v){if(v instanceof RegExp){var h=i.slice(s),b=h.match(v);if(b)return s+=b[0].length,b[0]}else if(i.indexOf(v,s)===s)return s+=v.length,v}f(a,"s"),t(a,"read");function l(){a(/[ ]*/)}f(l,"d"),t(l,"skipWhitespace");function c(){for(var v,h=["WITH","AND","OR","(",")",":","+"],b=0;b<h.length&&(v=a(h[b]),!v);b++);if(v==="+"&&s>1&&i[s-2]===" ")throw new Error("Space before `+`");return v&&{type:"OPERATOR",string:v}}f(c,"g"),t(c,"operator");function u(){return a(/[A-Za-z0-9-.]+/)}f(u,"c"),t(u,"idstring");function d(){var v=u();if(!v)throw new Error("Expected idstring at offset "+s);return v}f(d,"a"),t(d,"expectIdstring");function p(){if(a("DocumentRef-")){var v=d();return{type:"DOCUMENTREF",string:v}}}f(p,"E"),t(p,"documentRef");function m(){if(a("LicenseRef-")){var v=d();return{type:"LICENSEREF",string:v}}}f(m,"x"),t(m,"licenseRef");function g(){var v=s,h=u();if(r.indexOf(h)!==-1)return{type:"LICENSE",string:h};if(n.indexOf(h)!==-1)return{type:"EXCEPTION",string:h};s=v}f(g,"v"),t(g,"identifier");function $(){return c()||p()||m()||g()}f($,"h"),t($,"parseToken");for(var S=[];o()&&(l(),!!o());){var k=$();if(!k)throw new Error("Unexpected `"+i[s]+"` at offset "+s);S.push(k)}return S},"scan"),tu}f(uI,"requireScan");var ru,Cg;function pI(){if(Cg)return ru;Cg=1;var e=Object.defineProperty,t=f((r,n)=>e(r,"name",{value:n,configurable:!0}),"n");return ru=f(function(r){var n=0;function i(){return n<r.length}f(i,"u"),t(i,"hasMore");function s(){return i()?r[n]:null}f(s,"o"),t(s,"token");function o(){if(!i())throw new Error;n++}f(o,"a"),t(o,"next");function a(k){var v=s();if(v&&v.type==="OPERATOR"&&k===v.string)return o(),v.string}f(a,"f"),t(a,"parseOperator");function l(){if(a("WITH")){var k=s();if(k&&k.type==="EXCEPTION")return o(),k.string;throw new Error("Expected exception after `WITH`")}}f(l,"x"),t(l,"parseWith");function c(){var k=n,v="",h=s();if(h.type==="DOCUMENTREF"&&(o(),v+="DocumentRef-"+h.string+":",!a(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(h=s(),h.type==="LICENSEREF")return o(),v+="LicenseRef-"+h.string,{license:v};n=k}f(c,"h"),t(c,"parseLicenseRef");function u(){var k=s();if(k&&k.type==="LICENSE"){o();var v={license:k.string};a("+")&&(v.plus=!0);var h=l();return h&&(v.exception=h),v}}f(u,"g"),t(u,"parseLicense");function d(){var k=a("(");if(k){var v=$();if(!a(")"))throw new Error("Expected `)`");return v}}f(d,"l"),t(d,"parseParenthesizedExpression");function p(){return d()||c()||u()}f(p,"R"),t(p,"parseAtom");function m(k,v){return t(f(function h(){var b=v();if(b){if(!a(k))return b;var w=h();if(!w)throw new Error("Expected expression");return{left:b,conjunction:k.toLowerCase(),right:w}}},"t"),"parseBinaryOp")}f(m,"p"),t(m,"makeBinaryOpParser");var g=m("AND",p),$=m("OR",g),S=$();if(!S||i())throw new Error("Syntax error");return S},"parse$1"),ru}f(pI,"requireParse$1");var nu,Ag;function Tw(){if(Ag)return nu;Ag=1;var e=uI(),t=pI();return nu=f(function(r){return t(e(r))},"spdxExpressionParse"),nu}f(Tw,"requireSpdxExpressionParse");var iu,Og;function dI(){if(Og)return iu;Og=1;var e=Object.defineProperty,t=f((h,b)=>e(h,"name",{value:b,configurable:!0}),"u"),r=Tw(),n=Iw();function i(h){try{return r(h),!0}catch{return!1}}f(i,"valid"),t(i,"valid");function s(h,b){var w=b[0].length-h[0].length;return w!==0?w:h[0].toUpperCase().localeCompare(b[0].toUpperCase())}f(s,"sortTranspositions"),t(s,"sortTranspositions");var o=[["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(s),a=0,l=1,c=[function(h){return h.toUpperCase()},function(h){return h.trim()},function(h){return h.replace(/\./g,"")},function(h){return h.replace(/\s+/g,"")},function(h){return h.replace(/\s+/g,"-")},function(h){return h.replace("v","-")},function(h){return h.replace(/,?\s*(\d)/,"-$1")},function(h){return h.replace(/,?\s*(\d)/,"-$1.0")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(h){return h[0].toUpperCase()+h.slice(1)},function(h){return h.replace("/","-")},function(h){return h.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(h){return h.indexOf("3.0")!==-1?h+"-or-later":h+"-only"},function(h){return h+"only"},function(h){return h.replace(/(\d)$/,"-$1.0")},function(h){return h.replace(/(-| )?(\d)$/,"-$2-Clause")},function(h){return h.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(h){return h.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(h){return h.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(h){return h.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(h){return h.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(h){return h.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(h){return"CC-"+h},function(h){return"CC-"+h+"-4.0"},function(h){return h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(h){return"CC-"+h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],u=n.map(function(h){var b=/^(.*)-\d+\.\d+$/.exec(h);return b?[b[0],b[1]]:[h,null]}).reduce(function(h,b){var w=b[1];return h[w]=h[w]||[],h[w].push(b[0]),h},{}),d=Object.keys(u).map(t(function(h){return[h,u[h]]},"makeEntries")).filter(t(function(h){return h[1].length===1&&h[0]!==null&&h[0]!=="APL"},"identifySoleVersions")).map(t(function(h){return[h[0],h[1][0]]},"createLastResorts"));u=void 0;var p=[["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(d).sort(s),m=0,g=1,$=t(function(h){for(var b=0;b<c.length;b++){var w=c[b](h).trim();if(w!==h&&i(w))return w}return null},"validTransformation"),S=t(function(h){for(var b=h.toUpperCase(),w=0;w<p.length;w++){var y=p[w];if(b.indexOf(y[m])>-1)return y[g]}return null},"validLastResort"),k=t(function(h,b){for(var w=0;w<o.length;w++){var y=o[w],D=y[a];if(h.indexOf(D)>-1){var E=h.replace(D,y[l]),A=b(E);if(A!==null)return A}}return null},"anyCorrection");iu=f(function(h,b){b=b||{};var w=b.upgrade===void 0?!0:!!b.upgrade;function y(j){return w?v(j):j}f(y,"L"),t(y,"postprocess");var D=typeof h=="string"&&h.trim().length!==0;if(!D)throw Error("Invalid argument. Expected non-empty string.");if(h=h.trim(),i(h))return y(h);var E=h.replace(/\+$/,"").trim();if(i(E))return y(E);var A=$(h);return A!==null||(A=k(h,function(j){return i(j)?j:$(j)}),A!==null)||(A=S(h),A!==null)||(A=k(h,S),A!==null)?y(A):null},"spdxCorrect");function v(h){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(h)!==-1?h+"-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(h)!==-1?h.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(h)!==-1?h+"-or-later":h}return f(v,"upgradeGPLs"),t(v,"upgradeGPLs"),iu}f(dI,"requireSpdxCorrect");var su,jg;function fI(){if(jg)return su;jg=1;var e=Object.defineProperty,t=f((l,c)=>e(l,"name",{value:c,configurable:!0}),"i"),r=Tw(),n=dI(),i='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',s=/^SEE LICEN[CS]E IN (.+)$/;function o(l,c){return c.slice(0,l.length)===l}f(o,"startsWith"),t(o,"startsWith");function a(l){if(l.hasOwnProperty("license")){var c=l.license;return o("LicenseRef",c)||o("DocumentRef",c)}else return a(l.left)||a(l.right)}return f(a,"usesLicenseRef"),t(a,"usesLicenseRef"),su=f(function(l){var c;try{c=r(l)}catch{var u;if(l==="UNLICENSED"||l==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(u=s.exec(l))return{validForOldPackages:!0,validForNewPackages:!0,inFile:u[1]};var d={validForOldPackages:!1,validForNewPackages:!1,warnings:[i]};if(l.trim().length!==0){var p=n(l);p&&d.warnings.push('license is similar to the valid expression "'+p+'"')}return d}return a(c)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[i]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},"validateNpmPackageLicense"),su}f(fI,"requireValidateNpmPackageLicense");var Cs={},xg;function mI(){if(xg)return Cs;xg=1;var e=Object.defineProperty,t=f((k,v)=>e(k,"name",{value:v,configurable:!0}),"f"),r=t((k,v)=>()=>(v||k((v={exports:{}}).exports,v),v.exports),"M"),n=r(k=>{Object.defineProperty(k,"__esModule",{value:!0}),k.tracing=k.metrics=void 0;var v={hasSubscribers:!1};k.metrics=v,k.tracing=v}),i=r(k=>{Object.defineProperty(k,"__esModule",{value:!0}),k.defaultPerf=void 0,k.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.LRUCache=void 0;var s=n(),o=i(),a=t(()=>s.metrics.hasSubscribers||s.tracing.hasSubscribers,"x"),l=new Set,c=process||{},u=t((k,v,h,b)=>{typeof c.emitWarning=="function"?c.emitWarning(k,v,h,b):console.error(`[${h}] ${v}: ${k}`)},"k"),d=t(k=>!l.has(k),"V"),p=t(k=>!!k&&k===Math.floor(k)&&k>0&&isFinite(k),"F"),m=t(k=>p(k)?k<=Math.pow(2,8)?Uint8Array:k<=Math.pow(2,16)?Uint16Array:k<=Math.pow(2,32)?Uint32Array:k<=Number.MAX_SAFE_INTEGER?g:null:null,"H"),g=class extends Array{static{f(this,"W")}static{t(this,"W")}constructor(k){super(k),this.fill(0)}},$=class Ws{static{f(this,"D")}static{t(this,"c")}heap;length;static#e=!1;static create(v){let h=m(v);if(!h)return[];Ws.#e=!0;let b=new Ws(v,h);return Ws.#e=!1,b}constructor(v,h){if(!Ws.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new h(v),this.length=0}push(v){this.heap[this.length++]=v}pop(){return this.heap[--this.length]}},S=class Bw{static{f(this,"j")}static{t(this,"c")}#e;#r;#t;#s;#c;#m;#P;#v;get perf(){return this.#v}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#h;#l;#o;#n;#d;#b;#g;#u;#$;#p;#w;#E;#k;#f;#S;#C;#y;#R;static unsafeExposeInternals(v){return{starts:v.#E,ttls:v.#k,autopurgeTimers:v.#f,sizes:v.#w,keyMap:v.#l,keyList:v.#o,valList:v.#n,next:v.#d,prev:v.#b,get head(){return v.#g},get tail(){return v.#u},free:v.#$,isBackgroundFetch:t(h=>v.#a(h),"isBackgroundFetch"),backgroundFetch:t((h,b,w,y)=>v.#V(h,b,w,y),"backgroundFetch"),moveToTail:t(h=>v.#B(h),"moveToTail"),indexes:t(h=>v.#O(h),"indexes"),rindexes:t(h=>v.#j(h),"rindexes"),isStale:t(h=>v.#D(h),"isStale")}}get max(){return this.#e}get maxSize(){return this.#r}get calculatedSize(){return this.#h}get size(){return this.#i}get fetchMethod(){return this.#m}get memoMethod(){return this.#P}get dispose(){return this.#t}get onInsert(){return this.#s}get disposeAfter(){return this.#c}constructor(v){let{max:h=0,ttl:b,ttlResolution:w=1,ttlAutopurge:y,updateAgeOnGet:D,updateAgeOnHas:E,allowStale:A,dispose:j,onInsert:G,disposeAfter:W,noDisposeOnSet:ce,noUpdateTTL:te,maxSize:Y=0,maxEntrySize:P=0,sizeCalculation:N,fetchMethod:O,memoMethod:R,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:L,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:U,ignoreFetchAbort:q,perf:X}=v;if(X!==void 0&&typeof X?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#v=X??o.defaultPerf,h!==0&&!p(h))throw new TypeError("max option must be a nonnegative integer");let Q=h?m(h):Array;if(!Q)throw new Error("invalid max value: "+h);if(this.#e=h,this.#r=Y,this.maxEntrySize=P||this.#r,this.sizeCalculation=N,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(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#P=R,O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#m=O,this.#C=!!O,this.#l=new Map,this.#o=Array.from({length:h}).fill(void 0),this.#n=Array.from({length:h}).fill(void 0),this.#d=new Q(h),this.#b=new Q(h),this.#g=0,this.#u=0,this.#$=$.create(h),this.#i=0,this.#h=0,typeof j=="function"&&(this.#t=j),typeof G=="function"&&(this.#s=G),typeof W=="function"?(this.#c=W,this.#p=[]):(this.#c=void 0,this.#p=void 0),this.#S=!!this.#t,this.#R=!!this.#s,this.#y=!!this.#c,this.noDisposeOnSet=!!ce,this.noUpdateTTL=!!te,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!U,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(this.#r!==0&&!p(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!p(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#J()}if(this.allowStale=!!A,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!D,this.updateAgeOnHas=!!E,this.ttlResolution=p(w)||w===0?w:1,this.ttlAutopurge=!!y,this.ttl=b||0,this.ttl){if(!p(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#L()}if(this.#e===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#r){let B="LRU_CACHE_UNBOUNDED";d(B)&&(l.add(B),u("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,Bw))}}getRemainingTTL(v){return this.#l.has(v)?1/0:0}#L(){let v=new g(this.#e),h=new g(this.#e);this.#k=v,this.#E=h;let b=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#f=b,this.#W=(E,A,j=this.#v.now())=>{h[E]=A!==0?j:0,v[E]=A,w(E,A)},this.#A=E=>{h[E]=v[E]!==0?this.#v.now():0,w(E,v[E])};let w=this.ttlAutopurge?(E,A)=>{if(b?.[E]&&(clearTimeout(b[E]),b[E]=void 0),A&&A!==0&&b){let j=setTimeout(()=>{this.#D(E)&&this.#x(this.#o[E],"expire")},A+1);j.unref&&j.unref(),b[E]=j}}:()=>{};this.#N=(E,A)=>{if(v[A]){let j=v[A],G=h[A];if(!j||!G)return;E.ttl=j,E.start=G,E.now=y||D();let W=E.now-G;E.remainingTTL=j-W}};let y=0,D=t(()=>{let E=this.#v.now();if(this.ttlResolution>0){y=E;let A=setTimeout(()=>y=0,this.ttlResolution);A.unref&&A.unref()}return E},"o");this.getRemainingTTL=E=>{let A=this.#l.get(E);if(A===void 0)return 0;let j=v[A],G=h[A];if(!j||!G)return 1/0;let W=(y||D())-G;return j-W},this.#D=E=>{let A=h[E],j=v[E];return!!j&&!!A&&(y||D())-A>j}}#A=t(()=>{},"#R");#N=t(()=>{},"#E");#W=t(()=>{},"#N");#D=t(()=>!1,"#p");#J(){let v=new g(this.#e);this.#h=0,this.#w=v,this.#I=h=>{this.#h-=v[h],v[h]=0},this.#U=(h,b,w,y)=>{if(this.#a(b))return 0;if(!p(w))if(y){if(typeof y!="function")throw new TypeError("sizeCalculation must be a function");if(w=y(b,h),!p(w))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 w},this.#_=(h,b,w)=>{if(v[h]=b,this.#r){let y=this.#r-v[h];for(;this.#h>y;)this.#M(!0)}this.#h+=v[h],w&&(w.entrySize=b,w.totalCalculatedSize=this.#h)}}#I=t(v=>{},"#x");#_=t((v,h,b)=>{},"#I");#U=t((v,h,b,w)=>{if(b||w)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#k");*#O({allowStale:v=this.allowStale}={}){if(this.#i)for(let h=this.#u;this.#G(h)&&((v||!this.#D(h))&&(yield h),h!==this.#g);)h=this.#b[h]}*#j({allowStale:v=this.allowStale}={}){if(this.#i)for(let h=this.#g;this.#G(h)&&((v||!this.#D(h))&&(yield h),h!==this.#u);)h=this.#d[h]}#G(v){return v!==void 0&&this.#l.get(this.#o[v])===v}*entries(){for(let v of this.#O())this.#n[v]!==void 0&&this.#o[v]!==void 0&&!this.#a(this.#n[v])&&(yield[this.#o[v],this.#n[v]])}*rentries(){for(let v of this.#j())this.#n[v]!==void 0&&this.#o[v]!==void 0&&!this.#a(this.#n[v])&&(yield[this.#o[v],this.#n[v]])}*keys(){for(let v of this.#O()){let h=this.#o[v];h!==void 0&&!this.#a(this.#n[v])&&(yield h)}}*rkeys(){for(let v of this.#j()){let h=this.#o[v];h!==void 0&&!this.#a(this.#n[v])&&(yield h)}}*values(){for(let v of this.#O())this.#n[v]!==void 0&&!this.#a(this.#n[v])&&(yield this.#n[v])}*rvalues(){for(let v of this.#j())this.#n[v]!==void 0&&!this.#a(this.#n[v])&&(yield this.#n[v])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(v,h={}){for(let b of this.#O()){let w=this.#n[b],y=this.#a(w)?w.__staleWhileFetching:w;if(y!==void 0&&v(y,this.#o[b],this))return this.#T(this.#o[b],h)}}forEach(v,h=this){for(let b of this.#O()){let w=this.#n[b],y=this.#a(w)?w.__staleWhileFetching:w;y!==void 0&&v.call(h,y,this.#o[b],this)}}rforEach(v,h=this){for(let b of this.#j()){let w=this.#n[b],y=this.#a(w)?w.__staleWhileFetching:w;y!==void 0&&v.call(h,y,this.#o[b],this)}}purgeStale(){let v=!1;for(let h of this.#j({allowStale:!0}))this.#D(h)&&(this.#x(this.#o[h],"expire"),v=!0);return v}info(v){let h=this.#l.get(v);if(h===void 0)return;let b=this.#n[h],w=this.#a(b)?b.__staleWhileFetching:b;if(w===void 0)return;let y={value:w};if(this.#k&&this.#E){let D=this.#k[h],E=this.#E[h];if(D&&E){let A=D-(this.#v.now()-E);y.ttl=A,y.start=Date.now()}}return this.#w&&(y.size=this.#w[h]),y}dump(){let v=[];for(let h of this.#O({allowStale:!0})){let b=this.#o[h],w=this.#n[h],y=this.#a(w)?w.__staleWhileFetching:w;if(y===void 0||b===void 0)continue;let D={value:y};if(this.#k&&this.#E){D.ttl=this.#k[h];let E=this.#v.now()-this.#E[h];D.start=Math.floor(Date.now()-E)}this.#w&&(D.size=this.#w[h]),v.unshift([b,D])}return v}load(v){this.clear();for(let[h,b]of v){if(b.start){let w=Date.now()-b.start;b.start=this.#v.now()-w}this.#F(h,b.value,b)}}set(v,h,b={}){let{status:w=s.metrics.hasSubscribers?{}:void 0}=b;b.status=w,w&&(w.op="set",w.key=v,h!==void 0&&(w.value=h));let y=this.#F(v,h,b);return w&&s.metrics.hasSubscribers&&s.metrics.publish(w),y}#F(v,h,b={}){let{ttl:w=this.ttl,start:y,noDisposeOnSet:D=this.noDisposeOnSet,sizeCalculation:E=this.sizeCalculation,status:A}=b;if(h===void 0)return A&&(A.set="deleted"),this.delete(v),this;let{noUpdateTTL:j=this.noUpdateTTL}=b;A&&!this.#a(h)&&(A.value=h);let G=this.#U(v,h,b.size||0,E,A);if(this.maxEntrySize&&G>this.maxEntrySize)return this.#x(v,"set"),A&&(A.set="miss",A.maxEntrySizeExceeded=!0),this;let W=this.#i===0?void 0:this.#l.get(v);if(W===void 0)W=this.#i===0?this.#u:this.#$.length!==0?this.#$.pop():this.#i===this.#e?this.#M(!1):this.#i,this.#o[W]=v,this.#n[W]=h,this.#l.set(v,W),this.#d[this.#u]=W,this.#b[W]=this.#u,this.#u=W,this.#i++,this.#_(W,G,A),A&&(A.set="add"),j=!1,this.#R&&this.#s?.(h,v,"add");else{this.#B(W);let ce=this.#n[W];if(h!==ce){if(this.#C&&this.#a(ce)){ce.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:te}=ce;te!==void 0&&!D&&(this.#S&&this.#t?.(te,v,"set"),this.#y&&this.#p?.push([te,v,"set"]))}else D||(this.#S&&this.#t?.(ce,v,"set"),this.#y&&this.#p?.push([ce,v,"set"]));if(this.#I(W),this.#_(W,G,A),this.#n[W]=h,A){A.set="replace";let te=ce&&this.#a(ce)?ce.__staleWhileFetching:ce;te!==void 0&&(A.oldValue=te)}}else A&&(A.set="update");this.#R&&this.onInsert?.(h,v,h===ce?"update":"replace")}if(w!==0&&!this.#k&&this.#L(),this.#k&&(j||this.#W(W,w,y),A&&this.#N(A,W)),!D&&this.#y&&this.#p){let ce=this.#p,te;for(;te=ce?.shift();)this.#c?.(...te)}return this}pop(){try{for(;this.#i;){let v=this.#n[this.#g];if(this.#M(!0),this.#a(v)){if(v.__staleWhileFetching)return v.__staleWhileFetching}else if(v!==void 0)return v}}finally{if(this.#y&&this.#p){let v=this.#p,h;for(;h=v?.shift();)this.#c?.(...h)}}}#M(v){let h=this.#g,b=this.#o[h],w=this.#n[h];return this.#C&&this.#a(w)?w.__abortController.abort(new Error("evicted")):(this.#S||this.#y)&&(this.#S&&this.#t?.(w,b,"evict"),this.#y&&this.#p?.push([w,b,"evict"])),this.#I(h),this.#f?.[h]&&(clearTimeout(this.#f[h]),this.#f[h]=void 0),v&&(this.#o[h]=void 0,this.#n[h]=void 0,this.#$.push(h)),this.#i===1?(this.#g=this.#u=0,this.#$.length=0):this.#g=this.#d[h],this.#l.delete(b),this.#i--,h}has(v,h={}){let{status:b=s.metrics.hasSubscribers?{}:void 0}=h;h.status=b,b&&(b.op="has",b.key=v);let w=this.#K(v,h);return s.metrics.hasSubscribers&&s.metrics.publish(b),w}#K(v,h={}){let{updateAgeOnHas:b=this.updateAgeOnHas,status:w}=h,y=this.#l.get(v);if(y!==void 0){let D=this.#n[y];if(this.#a(D)&&D.__staleWhileFetching===void 0)return!1;if(this.#D(y))w&&(w.has="stale",this.#N(w,y));else return b&&this.#A(y),w&&(w.has="hit",this.#N(w,y)),!0}else w&&(w.has="miss");return!1}peek(v,h={}){let{status:b=a()?{}:void 0}=h;b&&(b.op="peek",b.key=v),h.status=b;let w=this.#Y(v,h);return s.metrics.hasSubscribers&&s.metrics.publish(b),w}#Y(v,h){let{status:b,allowStale:w=this.allowStale}=h,y=this.#l.get(v);if(y===void 0||!w&&this.#D(y)){b&&(b.peek=y===void 0?"miss":"stale");return}let D=this.#n[y],E=this.#a(D)?D.__staleWhileFetching:D;return b&&(E!==void 0?(b.peek="hit",b.value=E):b.peek="miss"),E}#V(v,h,b,w){let y=h===void 0?void 0:this.#n[h];if(this.#a(y))return y;let D=new AbortController,{signal:E}=b;E?.addEventListener("abort",()=>D.abort(E.reason),{signal:D.signal});let A={signal:D.signal,options:b,context:w},j=t((P,N=!1)=>{let{aborted:O}=D.signal,R=b.ignoreFetchAbort&&P!==void 0,_=b.ignoreFetchAbort||!!(b.allowStaleOnFetchAbort&&P!==void 0);if(b.status&&(O&&!N?(b.status.fetchAborted=!0,b.status.fetchError=D.signal.reason,R&&(b.status.fetchAbortIgnored=!0)):b.status.fetchResolved=!0),O&&!R&&!N)return W(D.signal.reason,_);let L=te,T=this.#n[h];return(T===te||T===void 0&&R&&N)&&(P===void 0?L.__staleWhileFetching!==void 0?this.#n[h]=L.__staleWhileFetching:this.#x(v,"fetch"):(b.status&&(b.status.fetchUpdated=!0),this.#F(v,P,A.options))),P},"a"),G=t(P=>(b.status&&(b.status.fetchRejected=!0,b.status.fetchError=P),W(P,!1)),"d"),W=t((P,N)=>{let{aborted:O}=D.signal,R=O&&b.allowStaleOnFetchAbort,_=R||b.allowStaleOnFetchRejection,L=_||b.noDeleteOnFetchRejection,T=te;if(this.#n[h]===te&&(!L||!N&&T.__staleWhileFetching===void 0?this.#x(v,"fetch"):R||(this.#n[h]=T.__staleWhileFetching)),_)return b.status&&T.__staleWhileFetching!==void 0&&(b.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw P},"f"),ce=t((P,N)=>{let O=this.#m?.(v,y,A);O&&O instanceof Promise&&O.then(R=>P(R===void 0?void 0:R),N),D.signal.addEventListener("abort",()=>{(!b.ignoreFetchAbort||b.allowStaleOnFetchAbort)&&(P(void 0),b.allowStaleOnFetchAbort&&(P=t(R=>j(R,!0),"w")))})},"p");b.status&&(b.status.fetchDispatched=!0);let te=new Promise(ce).then(j,G),Y=Object.assign(te,{__abortController:D,__staleWhileFetching:y,__returned:void 0});return h===void 0?(this.#F(v,Y,{...A.options,status:void 0}),h=this.#l.get(v)):this.#n[h]=Y,Y}#a(v){if(!this.#C)return!1;let h=v;return!!h&&h instanceof Promise&&h.hasOwnProperty("__staleWhileFetching")&&h.__abortController instanceof AbortController}fetch(v,h={}){let b=s.tracing.hasSubscribers,{status:w=a()?{}:void 0}=h;h.status=w,w&&h.context&&(w.context=h.context);let y=this.#q(v,h);return w&&b&&(w.trace=!0,s.tracing.tracePromise(()=>y,w).catch(()=>{})),y}async#q(v,h={}){let{allowStale:b=this.allowStale,updateAgeOnGet:w=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,ttl:D=this.ttl,noDisposeOnSet:E=this.noDisposeOnSet,size:A=0,sizeCalculation:j=this.sizeCalculation,noUpdateTTL:G=this.noUpdateTTL,noDeleteOnFetchRejection:W=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:ce=this.allowStaleOnFetchRejection,ignoreFetchAbort:te=this.ignoreFetchAbort,allowStaleOnFetchAbort:Y=this.allowStaleOnFetchAbort,context:P,forceRefresh:N=!1,status:O,signal:R}=h;if(O&&(O.op="fetch",O.key=v,N&&(O.forceRefresh=!0)),!this.#C)return O&&(O.fetch="get"),this.#T(v,{allowStale:b,updateAgeOnGet:w,noDeleteOnStaleGet:y,status:O});let _={allowStale:b,updateAgeOnGet:w,noDeleteOnStaleGet:y,ttl:D,noDisposeOnSet:E,size:A,sizeCalculation:j,noUpdateTTL:G,noDeleteOnFetchRejection:W,allowStaleOnFetchRejection:ce,allowStaleOnFetchAbort:Y,ignoreFetchAbort:te,status:O,signal:R},L=this.#l.get(v);if(L===void 0){O&&(O.fetch="miss");let T=this.#V(v,L,_,P);return T.__returned=T}else{let T=this.#n[L];if(this.#a(T)){let Q=b&&T.__staleWhileFetching!==void 0;return O&&(O.fetch="inflight",Q&&(O.returnedStale=!0)),Q?T.__staleWhileFetching:T.__returned=T}let U=this.#D(L);if(!N&&!U)return O&&(O.fetch="hit"),this.#B(L),w&&this.#A(L),O&&this.#N(O,L),T;let q=this.#V(v,L,_,P),X=q.__staleWhileFetching!==void 0&&b;return O&&(O.fetch=U?"stale":"refresh",X&&U&&(O.returnedStale=!0)),X?q.__staleWhileFetching:q.__returned=q}}forceFetch(v,h={}){let b=s.tracing.hasSubscribers,{status:w=a()?{}:void 0}=h;h.status=w,w&&h.context&&(w.context=h.context);let y=this.#X(v,h);return w&&b&&(w.trace=!0,s.tracing.tracePromise(()=>y,w).catch(()=>{})),y}async#X(v,h={}){let b=await this.#q(v,h);if(b===void 0)throw new Error("fetch() returned undefined");return b}memo(v,h={}){let{status:b=s.metrics.hasSubscribers?{}:void 0}=h;h.status=b,b&&(b.op="memo",b.key=v,h.context&&(b.context=h.context));let w=this.#Q(v,h);return b&&(b.value=w),s.metrics.hasSubscribers&&s.metrics.publish(b),w}#Q(v,h={}){let b=this.#P;if(!b)throw new Error("no memoMethod provided to constructor");let{context:w,status:y,forceRefresh:D,...E}=h;y&&D&&(y.forceRefresh=!0);let A=this.#T(v,E),j=D||A===void 0;if(y&&(y.memo=j?"miss":"hit",j||(y.value=A)),!j)return A;let G=b(v,A,{options:E,context:w});return y&&(y.value=G),this.#F(v,G,E),G}get(v,h={}){let{status:b=s.metrics.hasSubscribers?{}:void 0}=h;h.status=b,b&&(b.op="get",b.key=v);let w=this.#T(v,h);return b&&(w!==void 0&&(b.value=w),s.metrics.hasSubscribers&&s.metrics.publish(b)),w}#T(v,h={}){let{allowStale:b=this.allowStale,updateAgeOnGet:w=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,status:D}=h,E=this.#l.get(v);if(E===void 0){D&&(D.get="miss");return}let A=this.#n[E],j=this.#a(A);return D&&this.#N(D,E),this.#D(E)?j?(D&&(D.get="stale-fetching"),b&&A.__staleWhileFetching!==void 0?(D&&(D.returnedStale=!0),A.__staleWhileFetching):void 0):(y||this.#x(v,"expire"),D&&(D.get="stale"),b?(D&&(D.returnedStale=!0),A):void 0):(D&&(D.get=j?"fetching":"hit"),this.#B(E),w&&this.#A(E),j?A.__staleWhileFetching:A)}#z(v,h){this.#b[h]=v,this.#d[v]=h}#B(v){v!==this.#u&&(v===this.#g?this.#g=this.#d[v]:this.#z(this.#b[v],this.#d[v]),this.#z(this.#u,v),this.#u=v)}delete(v){return this.#x(v,"delete")}#x(v,h){s.metrics.hasSubscribers&&s.metrics.publish({op:"delete",delete:h,key:v});let b=!1;if(this.#i!==0){let w=this.#l.get(v);if(w!==void 0)if(this.#f?.[w]&&(clearTimeout(this.#f?.[w]),this.#f[w]=void 0),b=!0,this.#i===1)this.#H(h);else{this.#I(w);let y=this.#n[w];if(this.#a(y)?y.__abortController.abort(new Error("deleted")):(this.#S||this.#y)&&(this.#S&&this.#t?.(y,v,h),this.#y&&this.#p?.push([y,v,h])),this.#l.delete(v),this.#o[w]=void 0,this.#n[w]=void 0,w===this.#u)this.#u=this.#b[w];else if(w===this.#g)this.#g=this.#d[w];else{let D=this.#b[w];this.#d[D]=this.#d[w];let E=this.#d[w];this.#b[E]=this.#b[w]}this.#i--,this.#$.push(w)}}if(this.#y&&this.#p?.length){let w=this.#p,y;for(;y=w?.shift();)this.#c?.(...y)}return b}clear(){return this.#H("delete")}#H(v){for(let h of this.#j({allowStale:!0})){let b=this.#n[h];if(this.#a(b))b.__abortController.abort(new Error("deleted"));else{let w=this.#o[h];this.#S&&this.#t?.(b,w,v),this.#y&&this.#p?.push([b,w,v])}}if(this.#l.clear(),this.#n.fill(void 0),this.#o.fill(void 0),this.#k&&this.#E){this.#k.fill(0),this.#E.fill(0);for(let h of this.#f??[])h!==void 0&&clearTimeout(h);this.#f?.fill(void 0)}if(this.#w&&this.#w.fill(0),this.#g=0,this.#u=0,this.#$.length=0,this.#h=0,this.#i=0,this.#y&&this.#p){let h=this.#p,b;for(;b=h?.shift();)this.#c?.(...b)}}};return Cs.LRUCache=S,Cs}f(mI,"requireIndex_min");var ou,Pg;function hI(){if(Pg)return ou;Pg=1;var e=Object.defineProperty,t=f((a,l)=>e(a,"name",{value:l,configurable:!0}),"$");const r=t((...a)=>a.every(l=>l)?a.join(""):"","maybeJoin"),n=t(a=>a?encodeURIComponent(a):"","maybeEncode"),i=t(a=>a.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),s={sshtemplate:t(({domain:a,user:l,project:c,committish:u})=>`git@${a}:${l}/${c}.git${r("#",u)}`,"sshtemplate"),sshurltemplate:t(({domain:a,user:l,project:c,committish:u})=>`git+ssh://git@${a}/${l}/${c}.git${r("#",u)}`,"sshurltemplate"),edittemplate:t(({domain:a,user:l,project:c,committish:u,editpath:d,path:p})=>`https://${a}/${l}/${c}${r("/",d,"/",n(u||"HEAD"),"/",p)}`,"edittemplate"),browsetemplate:t(({domain:a,user:l,project:c,committish:u,treepath:d})=>`https://${a}/${l}/${c}${r("/",d,"/",n(u))}`,"browsetemplate"),browsetreetemplate:t(({domain:a,user:l,project:c,committish:u,treepath:d,path:p,fragment:m,hashformat:g})=>`https://${a}/${l}/${c}/${d}/${n(u||"HEAD")}/${p}${r("#",g(m||""))}`,"browsetreetemplate"),browseblobtemplate:t(({domain:a,user:l,project:c,committish:u,blobpath:d,path:p,fragment:m,hashformat:g})=>`https://${a}/${l}/${c}/${d}/${n(u||"HEAD")}/${p}${r("#",g(m||""))}`,"browseblobtemplate"),docstemplate:t(({domain:a,user:l,project:c,treepath:u,committish:d})=>`https://${a}/${l}/${c}${r("/",u,"/",n(d))}#readme`,"docstemplate"),httpstemplate:t(({auth:a,domain:l,user:c,project:u,committish:d})=>`git+https://${r(a,"@")}${l}/${c}/${u}.git${r("#",d)}`,"httpstemplate"),filetemplate:t(({domain:a,user:l,project:c,committish:u,path:d})=>`https://${a}/${l}/${c}/raw/${n(u||"HEAD")}/${d}`,"filetemplate"),shortcuttemplate:t(({type:a,user:l,project:c,committish:u})=>`${a}:${l}/${c}${r("#",u)}`,"shortcuttemplate"),pathtemplate:t(({user:a,project:l,committish:c})=>`${a}/${l}${r("#",c)}`,"pathtemplate"),bugstemplate:t(({domain:a,user:l,project:c})=>`https://${a}/${l}/${c}/issues`,"bugstemplate"),hashformat:i},o={};o.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:t(({auth:a,user:l,project:c,committish:u,path:d})=>`https://${r(a,"@")}raw.githubusercontent.com/${l}/${c}/${n(u||"HEAD")}/${d}`,"filetemplate"),gittemplate:t(({auth:a,domain:l,user:c,project:u,committish:d})=>`git://${r(a,"@")}${l}/${c}/${u}.git${r("#",d)}`,"gittemplate"),tarballtemplate:t(({domain:a,user:l,project:c,committish:u})=>`https://codeload.${a}/${l}/${c}/tar.gz/${n(u||"HEAD")}`,"tarballtemplate"),extract:t(a=>{let[,l,c,u,d]=a.pathname.split("/",5);if(!(u&&u!=="tree")&&(u||(d=a.hash.slice(1)),c&&c.endsWith(".git")&&(c=c.slice(0,-4)),!(!l||!c)))return{user:l,project:c,committish:d}},"extract")},o.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:t(({domain:a,user:l,project:c,committish:u,treepath:d,path:p,editpath:m})=>`https://${a}/${l}/${c}${r("/",d,"/",n(u||"HEAD"),"/",p,m)}`,"edittemplate"),tarballtemplate:t(({domain:a,user:l,project:c,committish:u})=>`https://${a}/${l}/${c}/get/${n(u||"HEAD")}.tar.gz`,"tarballtemplate"),extract:t(a=>{let[,l,c,u]=a.pathname.split("/",4);if(!["get"].includes(u)&&(c&&c.endsWith(".git")&&(c=c.slice(0,-4)),!(!l||!c)))return{user:l,project:c,committish:a.hash.slice(1)}},"extract")},o.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:t(({domain:a,user:l,project:c,committish:u})=>`https://${a}/${l}/${c}/repository/archive.tar.gz?ref=${n(u||"HEAD")}`,"tarballtemplate"),extract:t(a=>{const l=a.pathname.slice(1);if(l.includes("/-/")||l.includes("/archive.tar.gz"))return;const c=l.split("/");let u=c.pop();u.endsWith(".git")&&(u=u.slice(0,-4));const d=c.join("/");if(!(!d||!u))return{user:d,project:u,committish:a.hash.slice(1)}},"extract")},o.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:t(({domain:a,project:l,committish:c})=>`git@${a}:${l}.git${r("#",c)}`,"sshtemplate"),sshurltemplate:t(({domain:a,project:l,committish:c})=>`git+ssh://git@${a}/${l}.git${r("#",c)}`,"sshurltemplate"),edittemplate:t(({domain:a,user:l,project:c,committish:u,editpath:d})=>`https://${a}/${l}/${c}${r("/",n(u))}/${d}`,"edittemplate"),browsetemplate:t(({domain:a,project:l,committish:c})=>`https://${a}/${l}${r("/",n(c))}`,"browsetemplate"),browsetreetemplate:t(({domain:a,project:l,committish:c,path:u,hashformat:d})=>`https://${a}/${l}${r("/",n(c))}${r("#",d(u))}`,"browsetreetemplate"),browseblobtemplate:t(({domain:a,project:l,committish:c,path:u,hashformat:d})=>`https://${a}/${l}${r("/",n(c))}${r("#",d(u))}`,"browseblobtemplate"),docstemplate:t(({domain:a,project:l,committish:c})=>`https://${a}/${l}${r("/",n(c))}`,"docstemplate"),httpstemplate:t(({domain:a,project:l,committish:c})=>`git+https://${a}/${l}.git${r("#",c)}`,"httpstemplate"),filetemplate:t(({user:a,project:l,committish:c,path:u})=>`https://gist.githubusercontent.com/${a}/${l}/raw${r("/",n(c))}/${u}`,"filetemplate"),shortcuttemplate:t(({type:a,project:l,committish:c})=>`${a}:${l}${r("#",c)}`,"shortcuttemplate"),pathtemplate:t(({project:a,committish:l})=>`${a}${r("#",l)}`,"pathtemplate"),bugstemplate:t(({domain:a,project:l})=>`https://${a}/${l}`,"bugstemplate"),gittemplate:t(({domain:a,project:l,committish:c})=>`git://${a}/${l}.git${r("#",c)}`,"gittemplate"),tarballtemplate:t(({project:a,committish:l})=>`https://codeload.github.com/gist/${a}/tar.gz/${n(l||"HEAD")}`,"tarballtemplate"),extract:t(a=>{let[,l,c,u]=a.pathname.split("/",4);if(u!=="raw"){if(!c){if(!l)return;c=l,l=null}return c.endsWith(".git")&&(c=c.slice(0,-4)),{user:l,project:c,committish:a.hash.slice(1)}}},"extract"),hashformat:t(function(a){return a&&"file-"+i(a)},"hashformat")},o.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:t(({domain:a,user:l,project:c,committish:u,path:d})=>`https://${a}/${l}/${c}/blob/${n(u)||"HEAD"}/${d}`,"filetemplate"),httpstemplate:t(({domain:a,user:l,project:c,committish:u})=>`https://${a}/${l}/${c}.git${r("#",u)}`,"httpstemplate"),tarballtemplate:t(({domain:a,user:l,project:c,committish:u})=>`https://${a}/${l}/${c}/archive/${n(u)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:t(()=>null,"bugstemplate"),extract:t(a=>{let[,l,c,u]=a.pathname.split("/",4);if(!["archive"].includes(u)&&(c&&c.endsWith(".git")&&(c=c.slice(0,-4)),!(!l||!c)))return{user:l,project:c,committish:a.hash.slice(1)}},"extract")};for(const[a,l]of Object.entries(o))o[a]=Object.assign({},s,l);return ou=o,ou}f(hI,"requireHosts");var au,Ng;function _w(){if(Ng)return au;Ng=1;var e=Object.defineProperty,t=f((a,l)=>e(a,"name",{value:l,configurable:!0}),"s");const r=ZE,n=t((a,l,c)=>{const u=a.indexOf(c);return a.lastIndexOf(l,u>-1?u:1/0)},"lastIndexOfBefore"),i=t(a=>{try{return new r.URL(a)}catch{}},"safeUrl"),s=t((a,l)=>{const c=a.indexOf(":"),u=a.slice(0,c+1);if(Object.prototype.hasOwnProperty.call(l,u)||a.substr(c,3)==="://")return a;const d=a.indexOf("@");return d>-1?d>c?`git+ssh://${a}`:a:`${a.slice(0,c+1)}//${a.slice(c+1)}`},"correctProtocol"),o=t(a=>{const l=n(a,"@","#"),c=n(a,":","#");return c>l&&(a=a.slice(0,c)+"/"+a.slice(c+1)),n(a,":","#")===-1&&a.indexOf("//")===-1&&(a=`git+ssh://${a}`),a},"correctUrl");return au=f((a,l)=>{const c=l?s(a,l):a;return i(c)||i(o(c))},"parseUrl"),au}f(_w,"requireParseUrl");var cu,Rg;function gI(){if(Rg)return cu;Rg=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"S");const r=_w(),n=t(i=>{const s=i.indexOf("#"),o=i.indexOf("/"),a=i.indexOf("/",o+1),l=i.indexOf(":"),c=/\s/.exec(i),u=i.indexOf("@"),d=!c||s>-1&&c.index>s,p=u===-1||s>-1&&u>s,m=l===-1||s>-1&&l>s,g=a===-1||s>-1&&a>s,$=o>0,S=s>-1?i[s-1]!=="/":!i.endsWith("/"),k=!i.startsWith(".");return d&&$&&S&&k&&p&&m&&g},"isGitHubShorthand");return cu=f((i,s,{gitHosts:o,protocols:a})=>{if(!i)return;const l=n(i)?`github:${i}`:i,c=r(l,a);if(!c)return;const u=o.byShortcut[c.protocol],d=o.byDomain[c.hostname.startsWith("www.")?c.hostname.slice(4):c.hostname],p=u||d;if(!p)return;const m=o[u||d];let g=null;a[c.protocol]?.auth&&(c.username||c.password)&&(g=`${c.username}${c.password?":"+c.password:""}`);let $=null,S=null,k=null,v=null;try{if(u){let h=c.pathname.startsWith("/")?c.pathname.slice(1):c.pathname;const b=h.indexOf("@");b>-1&&(h=h.slice(b+1));const w=h.lastIndexOf("/");w>-1?(S=decodeURIComponent(h.slice(0,w)),S||(S=null),k=decodeURIComponent(h.slice(w+1))):k=decodeURIComponent(h),k.endsWith(".git")&&(k=k.slice(0,-4)),c.hash&&($=decodeURIComponent(c.hash.slice(1))),v="shortcut"}else{if(!m.protocols.includes(c.protocol))return;const h=m.extract(c);if(!h)return;S=h.user&&decodeURIComponent(h.user),k=decodeURIComponent(h.project),$=decodeURIComponent(h.committish),v=a[c.protocol]?.name||c.protocol.slice(0,-1)}}catch(h){if(h instanceof URIError)return;throw h}return[p,S,g,k,$,v,s]},"fromUrl"),cu}f(gI,"requireFromUrl");var lu,Fg;function yI(){if(Fg)return lu;Fg=1;var e=Object.defineProperty,t=f((c,u)=>e(c,"name",{value:u,configurable:!0}),"o");const{LRUCache:r}=mI(),n=hI(),i=gI(),s=_w(),o=new r({max:1e3});function a(c){try{const{protocol:u,hostname:d,pathname:p}=new URL(c);if(!d)return null;const m=/(?:git\+)http:$/.test(u)?"http:":"https:",g=p.replace(/\.git$/,"");return`${m}//${d}${g}`}catch{return null}}f(a,"unknownHostedUrl"),t(a,"unknownHostedUrl");class l{static{f(this,"GitHost")}static{t(this,"GitHost")}constructor(u,d,p,m,g,$,S={}){Object.assign(this,l.#e[u],{type:u,user:d,auth:p,project:m,committish:g,default:$,opts:S})}static#e={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(u,d){l.#e[u]=d,l.#e.byDomain[d.domain]=u,l.#e.byShortcut[`${u}:`]=u,l.#r[`${u}:`]={name:u}}static fromUrl(u,d){if(typeof u!="string")return;const p=u+JSON.stringify(d||{});if(!o.has(p)){const m=i(u,d,{gitHosts:l.#e,protocols:l.#r});o.set(p,m?new l(...m):void 0)}return o.get(p)}static fromManifest(u,d={}){if(!u||typeof u!="object")return;const p=u.repository,m=p&&(typeof p=="string"?p:typeof p=="object"&&typeof p.url=="string"?p.url:null);if(!m)throw new Error("no repository");const g=m&&l.fromUrl(m.replace(/^git\+/,""),d)||null;if(g)return g;const $=a(m);return l.fromUrl($,d)||$}static parseUrl(u){return s(u)}#t(u,d){if(typeof u!="function")return null;const p={...this,...this.opts,...d};p.path||(p.path=""),p.path.startsWith("/")&&(p.path=p.path.slice(1)),p.noCommittish&&(p.committish=null);const m=u(p);return p.noGitPlus&&m.startsWith("git+")?m.slice(4):m}hash(){return this.committish?`#${this.committish}`:""}ssh(u){return this.#t(this.sshtemplate,u)}sshurl(u){return this.#t(this.sshurltemplate,u)}browse(u,...d){return typeof u!="string"?this.#t(this.browsetemplate,u):typeof d[0]!="string"?this.#t(this.browsetreetemplate,{...d[0],path:u}):this.#t(this.browsetreetemplate,{...d[1],fragment:d[0],path:u})}browseFile(u,...d){return typeof d[0]!="string"?this.#t(this.browseblobtemplate,{...d[0],path:u}):this.#t(this.browseblobtemplate,{...d[1],fragment:d[0],path:u})}docs(u){return this.#t(this.docstemplate,u)}bugs(u){return this.#t(this.bugstemplate,u)}https(u){return this.#t(this.httpstemplate,u)}git(u){return this.#t(this.gittemplate,u)}shortcut(u){return this.#t(this.shortcuttemplate,u)}path(u){return this.#t(this.pathtemplate,u)}tarball(u){return this.#t(this.tarballtemplate,{...u,noCommittish:!1})}file(u,d){return this.#t(this.filetemplate,{...d,path:u})}edit(u,d){return this.#t(this.edittemplate,{...d,path:u})}getDefaultRepresentation(){return this.default}toString(u){return this.default&&typeof this[this.default]=="function"?this[this.default](u):this.sshurl(u)}}for(const[c,u]of Object.entries(n))l.addHost(c,u);return lu=l,lu}f(yI,"requireLib");var uu,Lg;function vI(){if(Lg)return uu;Lg=1;var e=Object.defineProperty,t=f((n,i)=>e(n,"name",{value:i,configurable:!0}),"r");uu=r;function r(n){if(!n||n==="ERROR: No README data found!")return;n=n.trim().split(`
|
|
989
|
+
`);let i=0;for(;n[i]&&n[i].trim().match(/^(#|$)/);)i++;const s=n.length;let o=i+1;for(;o<s&&n[o].trim();)o++;return n.slice(i,o).join(" ").trim()}return f(r,"extractDescription"),t(r,"extractDescription"),uu}f(vI,"requireExtract_description");var Mw={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"},Vw={web:"url",name:"url"},Ww={server:"start",tests:"test"};const bI={topLevel:Mw,bugs:Vw,script:Ww},$I=Object.defineProperty({__proto__:null,bugs:Vw,default:bI,script:Ww,topLevel:Mw},Symbol.toStringTag,{value:"Module"}),wI=Td($I);var pu,Ig;function kI(){if(Ig)return pu;Ig=1;var e=Object.defineProperty,t=f((y,D)=>e(y,"name",{value:D,configurable:!0}),"n"),{URL:r}=QE,n=oI(),i=aI(),s=fI(),o=yI(),{isBuiltin:a}=ab,l=["dependencies","devDependencies","optionalDependencies"],c=vI(),u=wI,d=t(y=>y.includes("@")&&y.indexOf("@")<y.lastIndexOf("."),"isEmail");pu={warn:t(function(){},"warn"),fixRepositoryField:t(function(y){if(y.repositories&&(this.warn("repositories"),y.repository=y.repositories[0]),!y.repository)return this.warn("missingRepository");typeof y.repository=="string"&&(y.repository={type:"git",url:y.repository});var D=y.repository.url||"";if(D){var E=o.fromUrl(D);E&&(D=y.repository.url=E.getDefaultRepresentation()==="shortcut"?E.https():E.toString())}D.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",D)},"fixRepositoryField"),fixTypos:t(function(y){Object.keys(u.topLevel).forEach(function(D){Object.prototype.hasOwnProperty.call(y,D)&&this.warn("typo",D,u.topLevel[D])},this)},"fixTypos"),fixScriptsField:t(function(y){if(y.scripts){if(typeof y.scripts!="object"){this.warn("nonObjectScripts"),delete y.scripts;return}Object.keys(y.scripts).forEach(function(D){typeof y.scripts[D]!="string"?(this.warn("nonStringScript"),delete y.scripts[D]):u.script[D]&&!y.scripts[u.script[D]]&&this.warn("typo",D,u.script[D],"scripts")},this)}},"fixScriptsField"),fixFilesField:t(function(y){var D=y.files;D&&!Array.isArray(D)?(this.warn("nonArrayFiles"),delete y.files):y.files&&(y.files=y.files.filter(function(E){return!E||typeof E!="string"?(this.warn("invalidFilename",E),!1):!0},this))},"fixFilesField"),fixBinField:t(function(y){if(y.bin&&typeof y.bin=="string"){var D={},E;(E=y.name.match(/^@[^/]+[/](.*)$/))?D[E[1]]=y.bin:D[y.name]=y.bin,y.bin=D}},"fixBinField"),fixManField:t(function(y){y.man&&typeof y.man=="string"&&(y.man=[y.man])},"fixManField"),fixBundleDependenciesField:t(function(y){var D="bundledDependencies",E="bundleDependencies";y[D]&&!y[E]&&(y[E]=y[D],delete y[D]),y[E]&&!Array.isArray(y[E])?(this.warn("nonArrayBundleDependencies"),delete y[E]):y[E]&&(y[E]=y[E].filter(function(A){return!A||typeof A!="string"?(this.warn("nonStringBundleDependency",A),!1):(y.dependencies||(y.dependencies={}),Object.prototype.hasOwnProperty.call(y.dependencies,A)||(this.warn("nonDependencyBundleDependency",A),y.dependencies[A]="*"),!0)},this))},"fixBundleDependenciesField"),fixDependencies:t(function(y){b(y,this.warn),v(y),this.fixBundleDependenciesField(y),["dependencies","devDependencies"].forEach(function(D){if(D in y){if(!y[D]||typeof y[D]!="object"){this.warn("nonObjectDependencies",D),delete y[D];return}Object.keys(y[D]).forEach(function(E){var A=y[D][E];typeof A!="string"&&(this.warn("nonStringDependency",E,JSON.stringify(A)),delete y[D][E]);var j=o.fromUrl(y[D][E]);j&&(y[D][E]=j.toString())},this)}},this)},"fixDependencies"),fixModulesField:t(function(y){y.modules&&(this.warn("deprecatedModules"),delete y.modules)},"fixModulesField"),fixKeywordsField:t(function(y){typeof y.keywords=="string"&&(y.keywords=y.keywords.split(/,\s+/)),y.keywords&&!Array.isArray(y.keywords)?(delete y.keywords,this.warn("nonArrayKeywords")):y.keywords&&(y.keywords=y.keywords.filter(function(D){return typeof D!="string"||!D?(this.warn("nonStringKeyword"),!1):!0},this))},"fixKeywordsField"),fixVersionField:t(function(y,D){var E=!D;if(!y.version)return y.version="",!0;if(!n(y.version,E))throw new Error('Invalid version: "'+y.version+'"');return y.version=i(y.version,E),!0},"fixVersionField"),fixPeople:t(function(y){$(y,S),$(y,k)},"fixPeople"),fixNameField:t(function(y,D){typeof D=="boolean"?D={strict:D}:typeof D>"u"&&(D={});var E=D.strict;if(!y.name&&!E){y.name="";return}if(typeof y.name!="string")throw new Error("name field must be a string.");E||(y.name=y.name.trim()),g(y.name,E,D.allowLegacyCase),a(y.name)&&this.warn("conflictingName",y.name)},"fixNameField"),fixDescriptionField:t(function(y){y.description&&typeof y.description!="string"&&(this.warn("nonStringDescription"),delete y.description),y.readme&&!y.description&&(y.description=c(y.readme)),y.description===void 0&&delete y.description,y.description||this.warn("missingDescription")},"fixDescriptionField"),fixReadmeField:t(function(y){y.readme||(this.warn("missingReadme"),y.readme="ERROR: No README data found!")},"fixReadmeField"),fixBugsField:t(function(y){if(!y.bugs&&y.repository&&y.repository.url){var D=o.fromUrl(y.repository.url);D&&D.bugs()&&(y.bugs={url:D.bugs()})}else if(y.bugs){if(typeof y.bugs=="string")d(y.bugs)?y.bugs={email:y.bugs}:r.canParse(y.bugs)?y.bugs={url:y.bugs}:this.warn("nonEmailUrlBugsString");else{w(y.bugs,this.warn);var E=y.bugs;y.bugs={},E.url&&(r.canParse(E.url)?y.bugs.url=E.url:this.warn("nonUrlBugsUrlField")),E.email&&(typeof E.email=="string"&&d(E.email)?y.bugs.email=E.email:this.warn("nonEmailBugsEmailField"))}!y.bugs.email&&!y.bugs.url&&(delete y.bugs,this.warn("emptyNormalizedBugs"))}},"fixBugsField"),fixHomepageField:t(function(y){if(!y.homepage&&y.repository&&y.repository.url){var D=o.fromUrl(y.repository.url);D&&D.docs()&&(y.homepage=D.docs())}if(y.homepage){if(typeof y.homepage!="string")return this.warn("nonUrlHomepage"),delete y.homepage;r.canParse(y.homepage)||(y.homepage="http://"+y.homepage)}},"fixHomepageField"),fixLicenseField:t(function(y){const D=y.license||y.licence;if(!D)return this.warn("missingLicense");if(typeof D!="string"||D.length<1||D.trim()==="")return this.warn("invalidLicense");if(!s(D).validForNewPackages)return this.warn("invalidLicense")},"fixLicenseField")};function p(y){if(y.charAt(0)!=="@")return!1;var D=y.slice(1).split("/");return D.length!==2?!1:D[0]&&D[1]&&D[0]===encodeURIComponent(D[0])&&D[1]===encodeURIComponent(D[1])}f(p,"isValidScopedPackageName"),t(p,"isValidScopedPackageName");function m(y){return!y.match(/[/@\s+%:]/)&&y===encodeURIComponent(y)}f(m,"isCorrectlyEncodedName"),t(m,"isCorrectlyEncodedName");function g(y,D,E){if(y.charAt(0)==="."||!(p(y)||m(y))||D&&!E&&y!==y.toLowerCase()||y.toLowerCase()==="node_modules"||y.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(y))}f(g,"ensureValidName"),t(g,"ensureValidName");function $(y,D){return y.author&&(y.author=D(y.author)),["maintainers","contributors"].forEach(function(E){Array.isArray(y[E])&&(y[E]=y[E].map(D))}),y}f($,"modifyPeople"),t($,"modifyPeople");function S(y){if(typeof y=="string")return y;var D=y.name||"",E=y.url||y.web,A=E?" ("+E+")":"",j=y.email||y.mail,G=j?" <"+j+">":"";return D+G+A}f(S,"unParsePerson"),t(S,"unParsePerson");function k(y){if(typeof y!="string")return y;var D=y.match(/^([^(<]+)/),E=y.match(/\(([^()]+)\)/),A=y.match(/<([^<>]+)>/),j={};return D&&D[0].trim()&&(j.name=D[0].trim()),A&&(j.email=A[1]),E&&(j.url=E[1]),j}f(k,"parsePerson"),t(k,"parsePerson");function v(y){var D=y.optionalDependencies;if(D){var E=y.dependencies||{};Object.keys(D).forEach(function(A){E[A]=D[A]}),y.dependencies=E}}f(v,"addOptionalDepsToDeps"),t(v,"addOptionalDepsToDeps");function h(y,D,E){if(!y)return{};if(typeof y=="string"&&(y=y.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(y))return y;E("deprecatedArrayDependencies",D);var A={};return y.filter(function(j){return typeof j=="string"}).forEach(function(j){j=j.trim().split(/(:?[@\s><=])/);var G=j.shift(),W=j.join("");W=W.trim(),W=W.replace(/^@/,""),A[G]=W}),A}f(h,"depObjectify"),t(h,"depObjectify");function b(y,D){l.forEach(function(E){y[E]&&(y[E]=h(y[E],E,D))})}f(b,"objectifyDeps"),t(b,"objectifyDeps");function w(y,D){y&&Object.keys(y).forEach(function(E){u.bugs[E]&&(D("typo",E,u.bugs[E],"bugs"),y[u.bugs[E]]=y[E],delete y[E])})}return f(w,"bugsTypos"),t(w,"bugsTypos"),pu}f(kI,"requireFixer");var Uw="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Gw="No repository field.",qw="Probably broken git url: %s",zw="scripts must be an object",Hw="script values must be string commands",Jw="Invalid 'files' member",Kw="Invalid filename in 'files' list: %s",Yw="Invalid 'bundleDependencies' list. Must be array of package names",Xw="Invalid bundleDependencies member: %s",Qw="Non-dependency in bundleDependencies: %s",Zw="%s field must be an object",e1="Invalid dependency: %s %s",t1="specifying %s as array is deprecated",r1="modules field is deprecated",n1="keywords should be an array of strings",i1="keywords should be an array of strings",s1="%s is also the name of a node core module.",o1="'description' field should be a string",a1="No description",c1="No README data",l1="No license field.",u1="Bug string field must be url, email, or {email,url}",p1="bugs.url field must be a string url. Deleted.",d1="bugs.email field must be a string email. Deleted.",f1="Normalized value of bugs field is an empty object. Deleted.",m1="homepage field must be a string url. Deleted.",h1="license should be a valid SPDX license expression",g1="%s should probably be %s.";const SI={repositories:Uw,missingRepository:Gw,brokenGitUrl:qw,nonObjectScripts:zw,nonStringScript:Hw,nonArrayFiles:Jw,invalidFilename:Kw,nonArrayBundleDependencies:Yw,nonStringBundleDependency:Xw,nonDependencyBundleDependency:Qw,nonObjectDependencies:Zw,nonStringDependency:e1,deprecatedArrayDependencies:t1,deprecatedModules:r1,nonArrayKeywords:n1,nonStringKeyword:i1,conflictingName:s1,nonStringDescription:o1,missingDescription:a1,missingReadme:c1,missingLicense:l1,nonEmailUrlBugsString:u1,nonUrlBugsUrlField:p1,nonEmailBugsEmailField:d1,emptyNormalizedBugs:f1,nonUrlHomepage:m1,invalidLicense:h1,typo:g1},EI=Object.defineProperty({__proto__:null,brokenGitUrl:qw,conflictingName:s1,default:SI,deprecatedArrayDependencies:t1,deprecatedModules:r1,emptyNormalizedBugs:f1,invalidFilename:Kw,invalidLicense:h1,missingDescription:a1,missingLicense:l1,missingReadme:c1,missingRepository:Gw,nonArrayBundleDependencies:Yw,nonArrayFiles:Jw,nonArrayKeywords:n1,nonDependencyBundleDependency:Qw,nonEmailBugsEmailField:d1,nonEmailUrlBugsString:u1,nonObjectDependencies:Zw,nonObjectScripts:zw,nonStringBundleDependency:Xw,nonStringDependency:e1,nonStringDescription:o1,nonStringKeyword:i1,nonStringScript:Hw,nonUrlBugsUrlField:p1,nonUrlHomepage:m1,repositories:Uw,typo:g1},Symbol.toStringTag,{value:"Module"}),DI=Td(EI);var du,Tg;function CI(){if(Tg)return du;Tg=1;var e=Object.defineProperty,t=f((s,o)=>e(s,"name",{value:o,configurable:!0}),"s"),r=eD,n=DI;du=f(function(){var s=Array.prototype.slice.call(arguments,0),o=s.shift();if(o==="typo")return i.apply(null,s);var a=n[o]?n[o]:o+": '%s'";return s.unshift(a),r.format.apply(null,s)},"make_warning");function i(s,o,a){return a&&(s=a+"['"+s+"']",o=a+"['"+o+"']"),r.format(n.typo,s,o)}return f(i,"makeTypoWarning"),t(i,"makeTypoWarning"),du}f(CI,"requireMake_warning");var fu,Bg;function AI(){if(Bg)return fu;Bg=1;var e=Object.defineProperty,t=f((c,u)=>e(c,"name",{value:u,configurable:!0}),"n");fu=a;var r=kI();a.fixer=r;var n=CI(),i=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],s=["dependencies","people","typos"],o=i.map(function(c){return l(c)+"Field"});o=o.concat(s);function a(c,u,d){u===!0&&(u=null,d=!0),d||(d=!1),(!u||c.private)&&(u=t(function(){},"warn")),c.scripts&&c.scripts.install==="node-gyp rebuild"&&!c.scripts.preinstall&&(c.gypfile=!0),r.warn=function(){u(n.apply(null,arguments))},o.forEach(function(p){r["fix"+l(p)](c,d)}),c._id=c.name+"@"+c.version}f(a,"normalize"),t(a,"normalize");function l(c){return c.charAt(0).toUpperCase()+c.slice(1)}return f(l,"ucFirst"),t(l,"ucFirst"),fu}f(AI,"requireNormalize");var OI=AI();const jI=fc(OI);var xI=Object.defineProperty,PI=f((e,t)=>xI(e,"name",{value:t,configurable:!0}),"d$o"),NI=Object.defineProperty,RI=PI((e,t)=>NI(e,"name",{value:t,configurable:!0}),"f"),FI=Object.defineProperty,Qi=RI((e,t)=>FI(e,"name",{value:t,configurable:!0}),"c");const y1=Qi((e,t,r)=>{const n=Ge(e),i=Ge(t),s=i===n?".":ho(n,i);return r.some(o=>{const a=o.startsWith("./")?o.slice(2):o,l=s.startsWith("./")?s.slice(2):s;if(a==="."&&l===".")return!0;if(a.endsWith("/**")){const c=a.slice(0,-3);return l===c||l.startsWith(`${c}/`)}if(a.endsWith("/*")){const c=a.slice(0,-2);return c===""?l!=="."&&!l.includes("/"):l.startsWith(`${c}/`)||l===c}return l===a||l.startsWith(`${a}/`)})},"isPackageInWorkspace"),v1=Qi(async e=>{const t=await yo("pnpm-workspace.yaml",{cwd:Ge(e),type:"file"});if(!t)return;const r=await jo(t),n=Array.isArray(r.packages)?r.packages:[];if(!y1(t,e,n))return;const i={};return r.catalog&&typeof r.catalog=="object"&&(i.catalog=r.catalog),r.catalogs&&typeof r.catalogs=="object"&&(i.catalogs=r.catalogs),Object.keys(i).length>0?i:void 0},"readPnpmCatalogs"),b1=Qi(e=>{const t=vo("pnpm-workspace.yaml",{cwd:Ge(e),type:"file"});if(!t)return;const r=Mt(t),n=Array.isArray(r.packages)?r.packages:[];if(!y1(t,e,n))return;const i={};return r.catalog&&typeof r.catalog=="object"&&(i.catalog=r.catalog),r.catalogs&&typeof r.catalogs=="object"&&(i.catalogs=r.catalogs),Object.keys(i).length>0?i:void 0},"readPnpmCatalogsSync"),LI=Qi((e,t,r)=>{if(t==="catalog:")return r.catalog?.[e];if(t.startsWith("catalog:")){const n=t.slice(8);return r.catalogs?.[n]?.[e]}},"resolveCatalogReference"),II=Qi((e,t)=>{for(const[r,n]of Object.entries(e)){if(typeof n!="string")continue;const i=LI(r,n,t);i&&(e[r]=i)}},"resolveDependenciesCatalogReferences"),Nc=Qi((e,t)=>{const r=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const n of r){if(!e[n]||typeof e[n]!="object")continue;const i=e[n];II(i,t)}},"resolveCatalogReferences");var TI=Object.defineProperty,at=f((e,t)=>TI(e,"name",{value:t,configurable:!0}),"l$r"),BI=Object.defineProperty,Ye=at((e,t)=>BI(e,"name",{value:t,configurable:!0}),"f");const _I=Ze(import.meta.url),As=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_f=Ye(e=>{if(typeof As<"u"&&As.versions&&As.versions.node){const[t,r]=As.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return As.getBuiltinModule(e)}return _I(e)},"__cjs_getBuiltinModule"),{existsSync:$1}=_f("node:fs"),{createInterface:MI}=_f("node:readline"),{styleText:Rt}=_f("node:util");var VI=Object.defineProperty,rt=Ye((e,t)=>VI(e,"name",{value:t,configurable:!0}),"f");const fr=rt(e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")},"isObject"),WI=rt(e=>{if(!fr(e))return!1;for(const t in e)if(Object.hasOwn(e,t))return!1;return!0},"isEmptyObject"),w1=new Set(["__proto__","prototype","constructor"]),k1=1e6,UI=rt(e=>e>="0"&&e<="9","isDigit");function Zn(e){if(e==="0")return!0;if(/^[1-9]\d*$/.test(e)){const t=Number.parseInt(e,10);return t<=Number.MAX_SAFE_INTEGER&&t<=k1}return!1}f(Zn,"w$g");at(Zn,"b");Ye(Zn,"p$1");rt(Zn,"shouldCoerceToNumber");function ji(e,t){return w1.has(e)?!1:(e&&Zn(e)?t.push(Number.parseInt(e,10)):t.push(e),!0)}f(ji,"P$g");at(ji,"P");Ye(ji,"y");rt(ji,"processSegment");function Rc(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);const t=[];let r="",n="start",i=!1,s=0;for(const o of e){if(s++,i){r+=o,i=!1;continue}if(o==="\\"){if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${s}`);if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${s}`);i=!0,n=n==="start"?"property":n;continue}switch(o){case".":{if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${s}`);if(n==="indexEnd"){n="property";break}if(!ji(r,t))return[];r="",n="property";break}case"[":{if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${s}`);if(n==="indexEnd"){n="index";break}if(n==="property"||n==="start"){if((r||n==="property")&&!ji(r,t))return[];r=""}n="index";break}case"]":{if(n==="index"){if(r==="")r=(t.pop()||"")+"[]",n="property";else{const a=Number.parseInt(r,10);!Number.isNaN(a)&&Number.isFinite(a)&&a>=0&&a<=Number.MAX_SAFE_INTEGER&&a<=k1&&r===String(a)?t.push(a):t.push(r),r="",n="indexEnd"}break}if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${s}`);r+=o;break}default:{if(n==="index"&&!UI(o))throw new Error(`Invalid character '${o}' in an index at position ${s}`);if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${s}`);n==="start"&&(n="property"),r+=o}}}switch(i&&(r+="\\"),n){case"property":{if(!ji(r,t))return[];break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}f(Rc,"N$g");at(Rc,"B");Ye(Rc,"parsePath");rt(Rc,"parsePath");function ei(e){if(typeof e=="string")return Rc(e);if(Array.isArray(e)){const t=[];for(const[r,n]of e.entries()){if(typeof n!="string"&&typeof n!="number")throw new TypeError(`Expected a string or number for path segment at index ${r}, got ${typeof n}`);if(typeof n=="number"&&!Number.isFinite(n))throw new TypeError(`Path segment at index ${r} must be a finite number, got ${n}`);if(w1.has(n))return[];typeof n=="string"&&Zn(n)?t.push(Number.parseInt(n,10)):t.push(n)}return t}return[]}f(ei,"b$k");at(ei,"k");Ye(ei,"d");rt(ei,"normalizePath");function lr(e,t,r){if(!fr(e)||typeof t!="string"&&!Array.isArray(t))return r===void 0?e:r;const n=ei(t);if(n.length===0)return r;for(let i=0;i<n.length;i++){const s=n[i];if(e=e[s],e==null){if(i!==n.length-1)return r;break}}return e===void 0?r:e}f(lr,"d$n");at(lr,"h");Ye(lr,"getProperty");rt(lr,"getProperty");function Fc(e,t,r){if(!fr(e)||typeof t!="string"&&!Array.isArray(t))return e;const n=e,i=ei(t);if(i.length===0)return e;for(let s=0;s<i.length;s++){const o=i[s];if(s===i.length-1)e[o]=r;else if(!fr(e[o])){const a=typeof i[s+1]=="number";e[o]=a?[]:{}}e=e[o]}return n}f(Fc,"T$j");at(Fc,"M");Ye(Fc,"setProperty");rt(Fc,"setProperty");function Mf(e,t){if(!fr(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=ei(t);if(r.length===0)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(n===r.length-1)return Object.hasOwn(e,i)?(delete e[i],!0):!1;if(e=e[i],!fr(e))return!1}}f(Mf,"q$8");at(Mf,"ue");Ye(Mf,"deleteProperty");rt(Mf,"deleteProperty");function en(e,t){if(!fr(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=ei(t);if(r.length===0)return!1;for(const n of r){if(!fr(e)||!(n in e))return!1;e=e[n]}return!0}f(en,"m$n");at(en,"y");Ye(en,"hasProperty");rt(en,"hasProperty");function co(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}f(co,"E$i");at(co,"x");Ye(co,"escapePath");rt(co,"escapePath");function Lc(e){const t=Object.entries(e);return Array.isArray(e)?t.map(([r,n])=>[Zn(r)?Number.parseInt(r,10):r,n]):t}f(Lc,"D$j");at(Lc,"R");Ye(Lc,"m$2");rt(Lc,"normalizeEntries");function Ic(e,t={}){if(!Array.isArray(e))throw new TypeError(`Expected an array, got ${typeof e}`);const{preferDotForIndices:r=!1}=t,n=[];for(const[i,s]of e.entries()){if(typeof s!="string"&&typeof s!="number")throw new TypeError(`Expected a string or number for path segment at index ${i}, got ${typeof s}`);if(typeof s=="number")if(!Number.isInteger(s)||s<0){const o=co(String(s));n.push(i===0?o:`.${o}`)}else r&&i>0?n.push(`.${s}`):n.push(`[${s}]`);else if(typeof s=="string")if(s==="")i===0||n.push(".");else if(Zn(s)){const o=Number.parseInt(s,10);r&&i>0?n.push(`.${o}`):n.push(`[${o}]`)}else{const o=co(s);n.push(i===0?o:`.${o}`)}}return n.join("")}f(Ic,"F$e");at(Ic,"Y");Ye(Ic,"stringifyPath");rt(Ic,"stringifyPath");function*Po(e,t=[],r=new Set){if(!fr(e)||WI(e)){t.length>0&&(yield Ic(t));return}if(!r.has(e)){r.add(e);for(const[n,i]of Lc(e))t.push(n),yield*Po(i,t,r),t.pop();r.delete(e)}}f(Po,"j$i");at(Po,"S");Ye(Po,"x");rt(Po,"deepKeysIterator");function Vf(e){return[...Po(e)]}f(Vf,"G$6");at(Vf,"ge");Ye(Vf,"deepKeys");rt(Vf,"deepKeys");function Wf(e){const t={};if(!fr(e))return t;for(const[r,n]of Object.entries(e))Fc(t,r,n);return t}f(Wf,"K$7");at(Wf,"de");Ye(Wf,"unflatten");rt(Wf,"unflatten");var GI=Object.defineProperty,mu=Ye((e,t)=>GI(e,"name",{value:t,configurable:!0}),"i");const qI=mu(async e=>{const{default:t=!1,message:r,transformer:n}=e,i=mu(o=>{const a=Rt(["cyan","bold"],"?"),l=Rt(["bold"],o),c=t?`${Rt(["greenBright"],"Y")}${Rt(["gray"],"/n")}`:`y/${Rt(["yellowBright"],"N")}`;return`${a} ${l} ${Rt(["gray"],`(${c})`)}`},"formatMessage"),s=mu(o=>n?n(o):o?Rt(["greenBright"],"Yes"):Rt(["yellowBright"],"No"),"formatAnswer");return new Promise(o=>{const a=MI({input:process.stdin,output:process.stdout}),l=i(r);a.question(l,c=>{a.close();const u=c.trim().toLowerCase();if(u===""){o(t);return}if(u==="y"||u==="yes"){console.log(`${Rt(["greenBright"],"✓")} ${s(!0)}`),o(!0);return}if(u==="n"||u==="no"){console.log(`${Rt(["yellowBright"],"✗")} ${s(!1)}`),o(!1);return}console.log(`${Rt(["gray"],"→")} ${s(t)}`),o(t)}),a.on("SIGINT",()=>{a.close(),console.log(`
|
|
990
|
+
${Rt(["gray"],"→")} ${s(t)}`),o(t)})})},"confirm"),zI=typeof process.stdout<"u"&&!process.versions.deno&&!globalThis.window;var HI=Object.defineProperty,et=Ye((e,t)=>HI(e,"name",{value:t,configurable:!0}),"l");const S1=/, ([^,]*)$/,Va=new Map,E1=new Map;let JI=class extends Error{static{f(this,"ke")}static{at(this,"be")}static{Ye(this,"M")}static{et(this,"PackageJsonValidationError")}constructor(t){super(`The following warnings were encountered while normalizing package data:
|
|
991
|
+
- ${t.join(`
|
|
992
|
+
- `)}`),this.name="PackageJsonValidationError"}};const Tc=et((e,t,r=[])=>{const n=[];if(jI(e,i=>{n.push(i)},t),t&&n.length>0){const i=n.filter(s=>!r.some(o=>o instanceof RegExp?o.test(s):o===s));if(i.length>0)throw new JI(i)}return e},"normalizeInput"),KI=et(async e=>await jo(e),"parseYamlFile"),YI=et(e=>Mt(e),"parseYamlFileSync"),XI=et(async e=>{const t=await Pd(e);return Nw.parse(t)},"parseJson5File"),QI=et(e=>{const t=J(e);return Nw.parse(t)},"parseJson5FileSync"),D1=et(async(e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?KI(e):t?.json5!==!1&&e.endsWith(".json5")?XI(e):bo(e),"parsePackageFile"),C1=et((e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?YI(e):t?.json5!==!1&&e.endsWith(".json5")?QI(e):ke(e),"parsePackageFileSync");et(async(e,t={})=>{const r={type:"file"};e&&(r.cwd=e);const n=["package.json"];t.yaml!==!1&&n.push("package.yaml","package.yml"),t.json5!==!1&&n.push("package.json5");let i;for(const l of n)if(i=await yo(l,r),i)break;if(!i)throw new Ri(`No such file or directory, for ${n.join(", ").replace(S1," or $1")} found.`);const s=t.cache&&typeof t.cache!="boolean"?t.cache:E1;if(t.cache&&s.has(i))return s.get(i);const o=await D1(i,t);if(t.resolveCatalogs){const l=await v1(i);l&&Nc(o,l)}Tc(o,t.strict??!1,t.ignoreWarnings);const a={packageJson:o,path:i};return t.cache&&s.set(i,a),a},"findPackageJson");et((e,t={})=>{const r={type:"file"};e&&(r.cwd=e);const n=["package.json"];t.yaml!==!1&&n.push("package.yaml","package.yml"),t.json5!==!1&&n.push("package.json5");let i;for(const l of n)if(i=vo(l,r),i)break;if(!i)throw new Ri(`No such file or directory, for ${n.join(", ").replace(S1," or $1")} found.`);const s=t.cache&&typeof t.cache!="boolean"?t.cache:E1;if(t.cache&&s.has(i))return s.get(i);const o=C1(i,t);if(t.resolveCatalogs){const l=b1(i);l&&Nc(o,l)}Tc(o,t.strict??!1,t.ignoreWarnings);const a={packageJson:o,path:i};return t.cache&&s.set(i,a),a},"findPackageJsonSync");et(async(e,t={})=>{const{cwd:r,...n}=t,i=Bt(r??process.cwd());await dA(C(i,"package.json"),e,n)},"writePackageJson");et((e,t={})=>{const{cwd:r,...n}=t,i=Bt(r??process.cwd());go(C(i,"package.json"),e,n)},"writePackageJsonSync");const A1=et((e,t)=>{const r=typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,i=!1,s;if(r)n=structuredClone(e);else if($1(e)){s=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:Va;if(t?.cache&&a.has(s))return a.get(s);n=C1(s,t),i=!0}else n=Cd(e);if(t?.resolveCatalogs)if(i){const a=b1(e);a&&Nc(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Tc(n,t?.strict??!1,t?.ignoreWarnings);const o=n;return i&&t?.cache&&(typeof t.cache=="boolean"?Va:t.cache).set(s,o),o},"parsePackageJsonSync");et(async(e,t)=>{const r=typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,i=!1,s;if(r)n=structuredClone(e);else if($1(e)){s=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:Va;if(t?.cache&&a.has(s))return a.get(s);n=await D1(s,t),i=!0}else n=Cd(e);if(t?.resolveCatalogs)if(i){const a=await v1(e);a&&Nc(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Tc(n,t?.strict??!1,t?.ignoreWarnings);const o=n;return i&&t?.cache&&(typeof t.cache=="boolean"?Va:t.cache).set(s,o),o},"parsePackageJson");et((e,t,r)=>lr(e,t,r),"getPackageJsonProperty");et((e,t)=>en(e,t),"hasPackageJsonProperty");et((e,t,r)=>{const n=lr(e,"dependencies",{}),i=lr(e,"devDependencies",{}),s=lr(e,"peerDependencies",{}),o={...n,...i,...r?.peerDeps===!1?{}:s};for(const a of t)if(en(o,a))return!0;return!1},"hasPackageJsonAnyDependency");et(async(e,t,r="dependencies",n={})=>{const i=lr(e,"dependencies",{}),s=lr(e,"devDependencies",{}),o=lr(e,"peerDependencies",{}),a=[],l={deps:!0,devDeps:!0,peerDeps:!1,...n};for(const c of t)l.deps&&en(i,c)||l.devDeps&&en(s,c)||l.peerDeps&&en(o,c)||a.push(c);if(a.length!==0){if(process.env.CI||zI&&!process.stdout.isTTY){const c=`Skipping package installation for [${t.join(", ")}] because the process is not interactive.`;if(n.throwOnWarn)throw new Error(c);n.logger?.warn?n.logger.warn(c):console.warn(c);return}if(typeof l.confirm?.message=="function"&&(l.confirm.message=l.confirm.message(a)),l.confirm?.message===void 0){const c=`${a.length===1?"Package is":"Packages are"} required for this config: ${a.join(", ")}. Do you want to install them?`;l.confirm===void 0?l.confirm={message:c}:l.confirm.message=c}await qI(l.confirm)&&await s$(a,{...l.installPackage,cwd:l.cwd?Bt(l.cwd):void 0,dev:r==="devDependencies"})}},"ensurePackages");var ZI=Object.defineProperty,eT=f((e,t)=>ZI(e,"name",{value:t,configurable:!0}),"d$m"),tT=Object.defineProperty,O1=eT((e,t)=>tT(e,"name",{value:t,configurable:!0}),"g");const rT=Ze(import.meta.url),Os=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j1=O1(e=>{if(typeof Os<"u"&&Os.versions&&Os.versions.node){const[t,r]=Os.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Os.getBuiltinModule(e)}return rT(e)},"__cjs_getBuiltinModule"),{execSync:nT}=j1("node:child_process"),{existsSync:_g,readFileSync:iT}=j1("node:fs");var sT=Object.defineProperty,mr=O1((e,t)=>sT(e,"name",{value:t,configurable:!0}),"r");const Uf=["yarn.lock","package-lock.json","pnpm-lock.yaml","npm-shrinkwrap.json","bun.lockb"],x1=mr(e=>{let t;if(Uf.forEach(n=>{!t&&_g(C(e,n))&&(t=C(e,n))}),t)return t;const r=C(e,"package.json");if(_g(r)&&A1(iT(r,"utf8")).packageManager!==void 0)return r},"packageMangerFindUpMatcher"),P1=mr(e=>{if(!e)throw new Ri("Could not find a package manager");if(e.endsWith("package.json")){const t=A1(e);if(t.packageManager){const r=["npm","yarn","pnpm","bun"].find(n=>t.packageManager.startsWith(n));if(r)return{packageManager:r,path:Ge(e)}}}if(e.endsWith("yarn.lock"))return{packageManager:"yarn",path:Ge(e)};if(e.endsWith("package-lock.json")||e.endsWith("npm-shrinkwrap.json"))return{packageManager:"npm",path:Ge(e)};if(e.endsWith("pnpm-lock.yaml"))return{packageManager:"pnpm",path:Ge(e)};if(e.endsWith("bun.lockb"))return{packageManager:"bun",path:Ge(e)};throw new Ri("Could not find a package manager")},"resolvePackageManagerFromFile");mr(async e=>{const t=await yo(Uf,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find lock file");return t},"findLockFile");mr(e=>{const t=vo(Uf,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find lock file");return t},"findLockFileSync");const oT=mr(async e=>{const t=await yo(x1,{...e&&{cwd:e}});return P1(t)},"findPackageManager"),aT=mr(e=>{const t=vo(x1,{...e&&{cwd:e}});return P1(t)},"findPackageManagerSync"),gZ=mr(e=>nT(`${e} --version`).toString("utf8").trim(),"getPackageManagerVersion");mr(()=>{if(!process.env.npm_config_user_agent)return;const e=process.env.npm_config_user_agent.split(" ")[0],t=e.lastIndexOf("/"),r=e.slice(0,Math.max(0,t));return{name:r==="npminstall"?"cnpm":r,version:e.slice(Math.max(0,t+1))}},"identifyInitiatingPackageManager");mr((e,t,r)=>{const n=t.length===1?"":"s";if(r.packageManagers??=["npm","pnpm","yarn"],r.packageManagers.length===0)throw new Error("No package managers provided, please provide at least one package manager");if(t.length===0)throw new Error("No missing packages provided, please provide at least one missing package");let i=`
|
|
993
|
+
${r.preMessage??""}
|
|
994
|
+
${e} could not find the following package${n}
|
|
995
|
+
|
|
996
|
+
${t.join(`
|
|
997
|
+
`)}
|
|
998
|
+
|
|
999
|
+
To install the missing package${n}, please run the following command:
|
|
1000
|
+
`;const s=mr(a=>a.split("@").includes("@")?a:`${a}@latest`,"atLatest"),o=r.packageManagers.map(a=>{const l=t.map(c=>s(c)).join(" ");switch(a){case"bun":return` bun add ${l} -D`;case"npm":return` npm install ${l} --save-dev`;case"pnpm":return` pnpm add ${l} -D`;case"yarn":return` yarn add ${l} --dev`;default:throw new Error("Unknown package manager")}});return i+=o.join(`
|
|
1001
|
+
|
|
1002
|
+
or
|
|
1003
|
+
|
|
1004
|
+
`),r.postMessage&&(i+=r.postMessage),i},"generateMissingPackagesInstallMessage");var cT=Object.defineProperty,lT=f((e,t)=>cT(e,"name",{value:t,configurable:!0}),"c$t"),uT=Object.defineProperty,N1=lT((e,t)=>uT(e,"name",{value:t,configurable:!0}),"p");const pT=Ze(import.meta.url),js=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dT=N1(e=>{if(typeof js<"u"&&js.versions&&js.versions.node){const[t,r]=js.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return js.getBuiltinModule(e)}return pT(e)},"__cjs_getBuiltinModule"),{existsSync:Wa,readFileSync:R1}=dT("node:fs");var fT=Object.defineProperty,F1=N1((e,t)=>fT(e,"name",{value:t,configurable:!0}),"i");F1(async e=>{const t=await yo(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(t?.endsWith("lerna.json")){const n=await bo(t);if(n&&typeof n=="object"&&!Array.isArray(n)){const i=n;if(i.useWorkspaces||i.packages)return{path:Ge(t),strategy:"lerna"}}}const r=t?.endsWith("turbo.json");try{const{packageManager:n,path:i}=await oT(e);if(["npm","yarn"].includes(n)){const s=C(i,"package.json");if(Wa(s)&&R1(C(i,"package.json"),"utf8").includes("workspaces"))return{path:i,strategy:r?"turbo":n}}else if(n==="pnpm"){const s=C(i,"pnpm-workspace.yaml");if(Wa(s))return{path:i,strategy:r?"turbo":"pnpm"}}}catch(n){if(!(n instanceof Ri))throw n}throw new Error(`No monorepo root could be found upwards from the directory ${e} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRoot");const L1=F1(e=>{const t=vo(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(t?.endsWith("lerna.json")){const n=ke(t);if(n.useWorkspaces||n.packages)return{path:Ge(t),strategy:"lerna"}}const r=t?.endsWith("turbo.json");try{const{packageManager:n,path:i}=aT(e);if(["npm","yarn"].includes(n)){const s=C(i,"package.json");if(Wa(s)&&R1(C(i,"package.json"),"utf8").includes("workspaces"))return{path:i,strategy:r?"turbo":n}}else if(n==="pnpm"){const s=C(i,"pnpm-workspace.yaml");if(Wa(s))return{path:i,strategy:r?"turbo":"pnpm"}}}catch(n){if(!(n instanceof Ri))throw n}throw new Error(`No monorepo root could be found upwards from the directory ${e} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRootSync");var mT="1.0.0-alpha.19";const Ua={version:mT};var hT=Object.defineProperty,gT=f((e,t)=>hT(e,"name",{value:t,configurable:!0}),"e$_");const yT={argument:{description:"Target selector (same syntax as `vis run`): `build`, `:build`, `~:test`, `#tag:lint`, …",name:"selector",type:String},description:"Show the execution plan for a target without running it",examples:[["vis action-graph build","Print the task plan for `build` on every project"],["vis action-graph :test","Moon-style selector"],["vis action-graph build --json","Emit a JSON description of the plan"],['vis action-graph lint --query "tag=frontend"',"Filter projects by query"]],group:"Workspace",loader:gT(()=>import("./handler.js"),"loader"),name:"action-graph",options:[{defaultValue:!1,description:"Emit JSON instead of ASCII",name:"json",type:Boolean},{description:"Filter matched projects by a query",name:"query",type:String}]};var vT=Object.defineProperty,bT=f((e,t)=>vT(e,"name",{value:t,configurable:!0}),"e$Z");const $T={argument:{description:"Packages to add (e.g., react react-dom)",name:"packages",type:String},description:"Add packages using the detected package manager",examples:[["vis add react react-dom","Add packages"],["vis add -D typescript @types/react","Add as dev dependencies"],["vis add react --filter app","Add to specific workspace package"],["vis add react --to web","Add to one package, auto-conforming the version to existing catalogs / sibling deps"],["vis add -g typescript","Add globally (uses npm)"],["vis add lodash -w","Add to workspace root"],["vis add lodash --no-socket-check","Add without Socket.dev check"],["vis add lodash --no-typosquat-check","Skip typosquat name check"],["vis add lodash --no-marshall-check","Skip the offline marshall pipeline (author, downloads, etc.)"],["vis add lodash --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy)"]],group:"Dependencies",loader:bT(()=>import("./handler16.js"),"loader"),name:"add",options:[{alias:"D",defaultValue:!1,description:"Add as dev dependency",name:"save-dev",type:Boolean},{alias:"E",defaultValue:!1,description:"Save exact version",name:"exact",type:Boolean},{alias:"P",defaultValue:!1,description:"Add as peer dependency",name:"save-peer",type:Boolean},{alias:"O",defaultValue:!1,description:"Add as optional dependency",name:"save-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Install globally (uses npm)",name:"global",type:Boolean},{alias:"w",defaultValue:!1,description:"Add to workspace root",name:"workspace-root",type:Boolean},{defaultValue:!1,description:"Use workspace protocol (pnpm)",name:"workspace",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{description:"Target a single workspace package and auto-conform the version to existing catalogs / sibling deps (syncpack#285)",name:"to",type:String},{defaultValue:!1,description:"Skip typosquat name check before adding",name:"no-typosquat-check",type:Boolean},{defaultValue:!1,description:"Skip Socket.dev security check before adding",name:"no-socket-check",type:Boolean},{defaultValue:!1,description:"Skip the offline marshall pipeline (author, provenance, metadata, downloads, expired-domains, new-bin, signatures, archived-repo)",name:"no-marshall-check",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts during add (opts out of vis's default block-by-default policy; allowlisted packages run via security.policies.installScripts.allow)",name:"run-scripts",type:Boolean},{defaultValue:!1,description:"After adding, recursively install non-optional peer dependencies that aren't already in the workspace (matches nypm's installPeerDependencies)",name:"auto-install-peers",type:Boolean}]},Gf={description:"Override the cache DB path (defaults to <cache>/vis/advisories/db.sqlite via @visulima/find-cache-dir).",name:"db",type:String},qf={description:"Output format: table (default) or json.",name:"format",type:String},wT={commandPath:["advisories"],description:"Download and ingest one or more OSV ecosystem dumps into the local cache",examples:[["vis advisories sync","Sync the npm ecosystem (default)"],["vis advisories sync --ecosystem npm","Sync a single explicit ecosystem"],["vis advisories sync --ecosystem npm,PyPI","Sync several ecosystems in one pass"],["vis advisories sync --force","Re-download even when the ETag matches"],["vis advisories sync --source https://mirror.example.com","Use a corporate OSV mirror (must be in allowedHosts)"]],group:"Security & Health",loader:Pe(()=>import("./sync.js"),"advisoriesSyncExecute"),name:"sync",options:[{description:"Comma-separated list of ecosystems to sync (default: npm).",name:"ecosystem",type:String},{defaultValue:!1,description:"Re-download and re-ingest even if the upstream ETag is unchanged.",name:"force",type:Boolean},{description:"Override the advisory source URL. Must be https and resolve to an allowed host.",name:"source",type:String},Gf,qf]},kT={commandPath:["advisories"],description:"Print the local advisory DB summary: path, schema version, ecosystems, row counts, last sync, ETag",examples:[["vis advisories status","Human-readable summary"],["vis advisories status --format json","Machine-readable for CI freshness checks"]],group:"Security & Health",loader:Pe(()=>import("./status.js"),"advisoriesStatusExecute"),name:"status",options:[Gf,qf]},ST={commandPath:["advisories"],description:"Delete the local advisory DB. The next `vis audit --offline` will fail until you re-sync",examples:[["vis advisories prune","Confirm and delete the local DB"],["vis advisories prune --force","Delete without confirmation"]],group:"Security & Health",loader:Pe(()=>import("./prune.js"),"advisoriesPruneExecute"),name:"prune",options:[Gf,{defaultValue:!1,description:"Skip the confirmation prompt.",name:"force",type:Boolean},qf]},ET=[wT,kT,ST];var DT=Object.defineProperty,CT=f((e,t)=>DT(e,"name",{value:t,configurable:!0}),"e$Y");const AT={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target only on projects affected by recent changes",examples:[["vis affected build","Run build on affected projects"],["vis affected test --base=main","Run tests on projects changed since main"],["vis affected destroy --reverse","Tear down affected projects leaves-first"]],group:"Run & Execute",loader:CT(()=>import("./handler2.js"),"loader"),name:"affected",options:[{defaultValue:"HEAD~1",description:"Git base ref for comparison",name:"base",type:String},{defaultValue:"HEAD",description:"Git head ref for comparison",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep" — controls how far to include dependents of changed projects',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep" — controls how far to include dependencies of changed projects',name:"upstream",type:String},{defaultValue:3,description:"Maximum number of parallel tasks",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String},{defaultValue:!1,description:"Run the dependency graph in reverse (leaves first, then their dependents). Useful for teardown targets like `destroy`/`undeploy` where dependents must run before the things they depend on.",name:"reverse",type:Boolean},{description:"Comma-separated tags this runner advertises (e.g. 'gpu,slow'). Forwarded verbatim to the downstream `vis run` so capability-gated tasks resolve identically. Falls back to VIS_RUNNER_TAGS env var.",name:"runner-tags",type:String}]},I1={description:"Output format: table or json (default: table)",name:"format",type:String},OT={commandPath:["ai"],description:"List detected AI providers and show which one is selected",examples:[["vis ai providers","List all AI providers and their status"],["vis ai providers --format json","Output as JSON"]],group:"System",loader:Pe(()=>import("./handler30.js"),"aiProvidersExecute"),name:"providers",options:[I1]},jT={commandPath:["ai"],description:"Test the best available AI provider with a quick prompt",examples:[["vis ai test","Test the selected provider"]],group:"System",loader:Pe(()=>import("./handler30.js"),"aiTestExecute"),name:"test",options:[]},xT={argument:{description:"Task ID to propose a fix for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["ai"],description:"Read a failed task's logs and propose a structured patch (Phase 1: local-only, no git)",examples:[["vis ai fix @myorg/app:build","Print proposed patch for the failed task"],["vis ai fix @myorg/app:build --apply","Apply the patch to disk after confirming"],["vis ai fix @myorg/app:build --format json","Machine-readable patch output"],["vis ai fix @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"System",loader:Pe(()=>import("./handler30.js"),"aiFixExecute"),name:"fix",options:[I1,{description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},{defaultValue:!1,description:"Apply the proposed patch to disk after printing it",name:"apply",type:Boolean},{defaultValue:!1,description:"Bypass the AI response cache",name:"no-cache",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt before applying",name:"yes",type:Boolean}]},PT={description:"AI-assisted commands: provider detection and failure-fix proposals (cache management lives under `vis cache`)",examples:[["vis ai","List all AI subcommands"],["vis ai discover-help","Machine-readable subcommand catalogue (for AI agents)"]],group:"System",loader:Pe(()=>import("./handler30.js"),"aiRootExecute"),name:"ai",options:[]},NT={commandPath:["ai"],description:"Print the machine-readable AI subcommand catalogue (JSON to stdout, designed for AI agents)",examples:[["vis ai discover-help","Emit the discovery payload as JSON"],["vis ai discover-help | jq '.subcommands[].path'","List all available paths"]],group:"System",loader:Pe(()=>import("./handler30.js"),"aiDiscoverHelpExecute"),name:"discover-help",options:[]},RT={commandPath:["ai"],description:"Diagnose the most recent failed task and post a structured patch as a PR/MR comment (or Buildkite annotation)",examples:[["vis ai heal","Heal the most recent failure"],["vis ai heal --dry-run","Propose a patch but skip apply / validate / post"],["vis ai heal --run 2026-04-28T...","Heal a specific historical run"]],group:"System",loader:Pe(()=>import("./heal.js").then(e=>e.h),"aiHeal"),name:"heal",options:[{defaultValue:!1,description:"Show the proposal and exit without applying or posting it",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Bypass the AI response cache",name:"no-cache",type:Boolean},{description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},{description:"Per-task validation timeout in seconds (default: 1800)",name:"validation-timeout",type:Number}]},FT={commandPath:["ai","heal"],description:"Re-run the proposed fix and commit it to the PR/MR branch when validation passes",examples:[["vis ai heal accept","Triggered automatically by a `/vis heal accept` PR comment (GitHub/GitLab) or a Buildkite block-step unblock"]],group:"System",loader:Pe(()=>import("./heal-accept.js"),"aiHealAccept"),name:"accept",options:[{description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},{description:"Per-task validation timeout in seconds (default: 1800)",name:"validation-timeout",type:Number}]},T1=[PT,NT,OT,jT,xT,RT,FT],yZ=Object.defineProperty({__proto__:null,default:T1},Symbol.toStringTag,{value:"Module"});var LT=Object.defineProperty,IT=f((e,t)=>LT(e,"name",{value:t,configurable:!0}),"e$X");const TT={argument:{description:"Package name to analyze (e.g., react)",name:"package",required:!0,type:String},description:"Analyze a single package update with AI",examples:[["vis analyze react","Analyze updating react to latest"],["vis analyze react 19.0.0","Analyze updating react to specific version"],["vis analyze react --ai-type security","Run security-focused analysis"],["vis analyze react --format json","Output as JSON"]],group:"System",loader:IT(()=>import("./handler3.js"),"loader"),name:"analyze",options:[{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Check for known security vulnerabilities",name:"security",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var BT=Object.defineProperty,_T=f((e,t)=>BT(e,"name",{value:t,configurable:!0}),"e$W");const MT={description:"Review and approve dependencies with build scripts",examples:[["vis approve-builds","Scan and list unapproved build scripts"],["vis approve-builds --all","Approve all pending builds (pnpm)"],["vis approve-builds --write","Write unapproved entries into vis.config.ts security.policies.installScripts.allow"],["vis approve-builds --sync-native","Sync allowBuilds to native PM config"]],group:"Security & Health",loader:_T(()=>import("./handler31.js"),"loader"),name:"approve-builds",options:[{defaultValue:!1,description:"Approve all pending builds without prompting (pnpm only)",name:"all",type:Boolean},{defaultValue:!1,description:"Force vis scanning even for pnpm (instead of delegating)",name:"scan",type:Boolean},{defaultValue:!1,description:"Sync allowBuilds to native PM config (bun: trustedDependencies, npm: .npmrc, yarn: .yarnrc.yml)",name:"sync-native",type:Boolean},{defaultValue:!1,description:"Write unapproved entries directly into vis.config.ts security.policies.installScripts.allow (LavaMoat 'auto' parity)",name:"write",type:Boolean}]};var VT=Object.defineProperty,WT=f((e,t)=>VT(e,"name",{value:t,configurable:!0}),"e$V");const UT={description:"Audit installed packages for vulnerabilities and supply chain risks",examples:[["vis audit","Full audit of all installed packages"],["vis audit --severity high","Show only high/critical issues"],["vis audit --format json","Output as JSON for CI integration"],["vis audit --format sarif","Output SARIF 2.1.0 for code-scanning uploads"],["vis audit --format csaf","Output CSAF 2.0 csaf_vex for enterprise vuln pipelines"],["vis audit --format cyclonedx-vex","Output a CycloneDX 1.7 BOM with vulnerabilities[] (SBOM + VEX)"],["vis audit --report report.html","Write a self-contained HTML report to ./report.html"],["vis audit --usage","Only report vulnerabilities in statically-imported packages"],["vis audit --offline","Query the local OSV cache only (no network)"],["vis audit --offline --db ./vendor.sqlite","Use a specific advisory DB"],["vis audit --ecosystem npm,pypi","Scan multiple OSV ecosystems (npm, pypi, crates.io, maven, go, rubygems)"],["vis audit --prod-only","Skip devDependencies"],["vis audit --fail-on high","Exit non-zero on any high or critical finding"],["vis audit --show-fixes","Print fix-suggestion lines (no apply, no rescan)"],["vis audit --fix","Apply direct-dep upgrades for vulnerable packages, then rescan (dry-run preview by default)"],["vis audit --fix --yes","Skip the confirmation prompt and run the upgrades immediately"],["vis audit --fix --allow-major","Permit major-version bumps when the lowest fix is outside the existing range"],["vis audit --fix-transitive","Write PM-specific overrides for vulnerable transitives (dry-run preview by default)"],["vis audit --exit-code","Exit with code 1 if issues found (for CI)"],["vis audit --show-accepted","Include acknowledged risks in output"],["vis audit --sync","Sync accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)"],["vis audit --policies license,vulnerability","Run only the named policies (default: every configured policy)"],["vis audit --policies none","Skip the policy engine entirely"]],group:"Security & Health",loader:WT(()=>import("./handler45.js"),"loader"),name:"audit",options:[{description:"Minimum severity to report: low, medium, high, critical (default: low)",name:"severity",type:String},{description:"Output format: table, json, sarif, csaf, or cyclonedx-vex (default: table)",name:"format",type:String},{description:"Write a self-contained HTML report to this path. Auto-opens in a TTY when not in CI.",name:"report",type:String},{defaultValue:!1,description:"Only report vulnerabilities in statically-imported packages (reachability filter).",name:"usage",type:Boolean},{defaultValue:!1,description:"Disable the reachability filter even if enabled in config.",name:"no-usage",type:Boolean},{defaultValue:!1,description:"Query the local OSV advisory cache only — no network calls. Errors if the cache is missing.",name:"offline",type:Boolean},{description:"Override the offline advisory DB path (default: <cache>/vis/advisories/db.sqlite).",name:"db",type:String},{description:"Comma-separated list of OSV ecosystems to scan (default: npm). Supported: npm, pypi, crates.io (or 'cargo'), maven, go, rubygems. Non-npm ecosystems require --offline (online OSV path is npm-only).",name:"ecosystem",type:String},{defaultValue:!1,description:"Skip devDependencies — scan production graph only.",name:"prod-only",type:Boolean},{description:"Exit non-zero when any finding is at this severity or higher. One of: low, medium, high, critical.",name:"fail-on",type:String},{defaultValue:!1,description:"Print fix-suggestion lines for each finding (no apply, no rescan)",name:"show-fixes",type:Boolean},{defaultValue:!1,description:"Apply direct-dep fixes for vulnerable packages by running the active PM update command, then rescan",name:"fix",type:Boolean},{defaultValue:!1,description:"Apply transitive fixes by writing PM-specific overrides (pnpm-workspace.yaml / package.json overrides / resolutions)",name:"fix-transitive",type:Boolean},{defaultValue:!1,description:"Skip confirmation prompt for --fix / --fix-transitive (required in CI)",name:"yes",type:Boolean},{defaultValue:!1,description:"Allow --fix to bump a direct dep across a major version when the lowest fix is outside the existing range",name:"allow-major",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if any issues found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Include acknowledged (accepted risk) issues in output",name:"show-accepted",type:Boolean},{defaultValue:!1,description:"Sync vis accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)",name:"sync",type:Boolean},{description:"Comma-separated list of supply-chain policies to evaluate (default: every configured policy). Use 'none' to skip the engine entirely, 'all' to force the full set. Known: malware, firstSeen, unexpectedDeps, publisherChange, installScripts, score, vulnerability, license.",name:"policies",type:String}]},No={description:"Cache directory (overrides config and default). Relative paths are resolved against the workspace root.",name:"cache-dir",type:String},Bc={description:"Cache scope: 'shared' (default — main worktree's cache), 'worktree' (this checkout's local cache), or 'all' (both)",name:"scope",type:String},B1={description:"Cache type: 'task' (workspace task cache), 'ai' (AI response cache), 'socket' (Socket.dev report cache), or 'all' (default)",name:"type",type:String},GT={commandPath:["cache"],description:"List all cache entries",examples:[["vis cache list","List all cache entries"]],group:"Workspace",loader:Pe(()=>import("./handler23.js"),"cacheListExecute"),name:"list",options:[No,Bc,{description:"Output format: table or json (default: table)",name:"format",type:String}]},qT={commandPath:["cache"],description:"Remove cache entries (defaults to all stores: workspace task cache, AI responses, Socket.dev reports)",examples:[["vis cache clean","Remove all cache entries from every store"],["vis cache clean --type=ai","Clear only the AI response cache"],["vis cache clean --type=task","Clear only the workspace task cache"],["vis cache clean --dry-run","Preview what clean would remove"]],group:"Workspace",loader:Pe(()=>import("./handler23.js"),"cacheCleanExecute"),name:"clean",options:[No,B1,{defaultValue:!1,description:"Preview without deleting",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt for out-of-workspace cache directories",name:"force",type:Boolean}]},zT={commandPath:["cache"],description:"Remove old and oversized cache entries",examples:[["vis cache prune","Remove old and oversized entries"],["vis cache prune --max-age-days=3 --max-size=500MB","Prune with custom limits"],["vis cache prune --keep-last=30","Keep only the 30 most recent entries"]],group:"Workspace",loader:Pe(()=>import("./handler23.js"),"cachePruneExecute"),name:"prune",options:[No,Bc,{description:"Remove entries older than N days",name:"max-age-days",type:Number},{description:"Evict oldest entries until cache is under this size (e.g. 500MB)",name:"max-size",type:String},{description:"Keep only the N most recent entries (sorted newest-first by mtime)",name:"keep-last",type:Number}]},HT={commandPath:["cache"],description:"Print on-disk footprint and stats for one or more cache stores (task / ai / socket)",examples:[["vis cache size","Show stats for every cache store"],["vis cache size --type=ai","Show only the AI response cache (entries, size, oldest, newest)"],["vis cache size --type=task --format=json","Machine-readable task cache size"]],group:"Workspace",loader:Pe(()=>import("./handler23.js"),"cacheSizeExecute"),name:"size",options:[No,Bc,B1,{description:"Output format: table or json (default: table)",name:"format",type:String}]},zf={description:"Output format: table or json (default: table)",name:"format",type:String},_1={description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},JT={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Explain why a task missed the cache by diffing hash inputs against the previous run",examples:[["vis cache why @myorg/app:build","Show which inputs changed since the last run"],["vis cache why @myorg/app:build --json","Machine-readable output for CI"],["vis cache why @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"Workspace",loader:Pe(()=>import("./handler23.js"),"cacheWhyExecute"),name:"why",options:[zf,_1]},KT={argument:{description:"Task ID to print the hash for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Print the recorded hash and per-input hash details for a task",examples:[["vis cache hash @myorg/app:build","Show the resolved hash + contributing inputs"],["vis cache hash @myorg/app:build --json","Machine-readable output"]],group:"Workspace",loader:Pe(()=>import("./handler23.js"),"cacheHashExecute"),name:"hash",options:[zf,_1]},YT={argument:{description:"Task ID to verify (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Verify cache restore fidelity: extract the cached entry into a tmp directory and diff each file's content, mode, and mtime against the live workspace. Exits 1 on any drift (changed content, mode, mtime) or if a cached output is missing from the workspace. With --scope=all, the first cache directory containing the task is used.",examples:[["vis cache verify @myorg/app:build","Diff cached outputs vs live workspace files"],["vis cache verify @myorg/app:build --format=json","Machine-readable diff (status: ok | drift)"],["vis cache verify @myorg/app:build --cache-dir=.alt-cache","Verify against a non-default cache directory"],["vis cache verify @myorg/app:build --scope=all","Search shared and worktree caches for the task"]],group:"Workspace",loader:Pe(()=>import("./handler23.js"),"cacheVerifyExecute"),name:"verify",options:[No,Bc,zf]},XT={commandPath:["cache"],description:"Probe the configured remote cache (HTTP HEAD or REAPI Capabilities) and report reachability, latency, and negotiated capabilities",examples:[["vis cache doctor","Probe the remoteCache configured in vis.config.ts"],["vis cache doctor --url=grpcs://cache.example.com:443 --backend=reapi","Override URL/backend ad-hoc"],["vis cache doctor --json","Machine-readable output"]],group:"Workspace",loader:Pe(()=>import("./doctor-probe.js"),"cacheDoctorExecute"),name:"doctor",options:[{description:"Override remote cache URL (otherwise read from vis.config.ts remoteCache.url, or TURBO_API env var)",name:"url",type:String},{description:"Override backend selector: 'http' or 'reapi'",name:"backend",type:String},{description:"Output format: table or json (default: table)",name:"format",type:String},{defaultValue:5e3,description:"Probe timeout in milliseconds (default: 5000)",name:"timeout",type:Number}]},QT=[GT,qT,zT,HT,JT,KT,YT,XT];var ZT=Object.defineProperty,eB=f((e,t)=>ZT(e,"name",{value:t,configurable:!0}),"e$U");const tB={alias:["c","outdated"],argument:{description:"Specific packages to check (checks all if omitted)",name:"packages",type:String},description:"Check for outdated dependencies, security vulnerabilities, and supply chain settings",examples:[["vis check","Check all catalog dependencies"],["vis check react","Check specific packages"],["vis check --target minor","Only show minor/patch updates"],["vis check --exclude '@types/*'","Exclude packages by pattern"],["vis check --no-security","Skip vulnerability scanning"],["vis check --security-config","Audit supply chain security settings"],["vis check --security-config --sync","Sync security config to pnpm-workspace.yaml"]],group:"Security & Health",loader:eB(()=>import("./handler4.js"),"loader"),name:"check",options:[{alias:"t",description:"Update target: latest, minor, or patch (default: latest)",name:"target",type:String},{description:"Glob pattern to include packages (repeatable)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions",name:"prerelease",type:Boolean},{defaultValue:!1,description:"Skip security vulnerability scanning",name:"no-security",type:Boolean},{defaultValue:!1,description:"Audit supply chain security settings",name:"security-config",type:Boolean},{defaultValue:!1,description:"Sync security settings to pnpm-workspace.yaml (pnpm only, requires --security-config)",name:"sync",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Exit with code 1 if outdated dependencies found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend",name:"ai-type",type:String},{alias:"D",conflicts:"prod",description:"Check only devDependencies (npm/yarn mode)",name:"dev",type:Boolean},{alias:"P",conflicts:"dev",description:"Check only dependencies (npm/yarn mode)",name:"prod",type:Boolean},{defaultValue:!1,description:"Include peerDependencies in outdated checks",name:"peer",type:Boolean},{defaultValue:!1,description:"Also check workspace-owned package names against the registry",name:"include-internal",type:Boolean}]};var rB=Object.defineProperty,nB=f((e,t)=>rB(e,"name",{value:t,configurable:!0}),"e$T");const iB={argument:{description:"Comma-separated list of targets to run (e.g., lint,test,build)",name:"targets",type:String},description:"Run affected targets in a CI-optimized pipeline",examples:[["vis ci lint,test,build","Run lint, test, and build on affected projects"],["vis ci test --base=origin/main","Override the base ref"],["vis ci build --no-install","Skip the install step (assume deps already present)"],["vis ci build --parallel=6","Increase concurrency"]],group:"Run & Execute",loader:nB(()=>import("./handler5.js"),"loader"),name:"ci",options:[{defaultValue:!0,description:"Install dependencies before running targets (use --no-install to skip)",name:"install",type:Boolean},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{description:"Git base ref for affected detection (default: auto-detected from CI env)",name:"base",type:String},{description:"Git head ref for affected detection (default: HEAD)",name:"head",type:String},{defaultValue:"none",description:"Upstream scope: none | direct | deep",name:"upstream",type:String},{defaultValue:"deep",description:"Downstream scope: none | direct | deep",name:"downstream",type:String},{defaultValue:4,description:"Maximum number of parallel tasks per target",name:"parallel",type:Number},{description:'Partition tasks for distributed CI (e.g., "1/4")',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String}]};var sB=Object.defineProperty,oB=f((e,t)=>sB(e,"name",{value:t,configurable:!0}),"e$S");const aB={description:"Remove node_modules from all workspace projects",examples:[["vis clean","Remove all node_modules directories"],["vis clean --lockfile","Also remove lockfiles"],["vis clean --dry-run","Preview what would be removed"]],group:"Workspace",loader:oB(()=>import("./handler6.js"),"loader"),name:"clean",options:[{alias:"l",defaultValue:!1,description:"Also remove lockfiles (pnpm-lock.yaml, package-lock.json, etc.)",name:"lockfile",type:Boolean},{defaultValue:!1,description:"Preview what would be removed without deleting",name:"dry-run",type:Boolean}]};var cB=Object.defineProperty,lB=f((e,t)=>cB(e,"name",{value:t,configurable:!0}),"e$R");const uB={argument:{description:"Template to use (e.g., vis:app, create-vite, user/repo) — omit for interactive mode",name:"template",type:String},description:"Create a new project from a template",examples:[["vis create","Interactive project scaffolding"],["vis create vis:monorepo my-workspace","Create a monorepo workspace"],["vis create vis:app my-app","Scaffold a Vite application"],["vis create vis:library my-lib","Create a TypeScript library"],["vis create vite my-app -- --template react-ts","Use create-vite with React TypeScript"],["vis create user/repo my-project","Clone a GitHub template"],["vis create --list","Show available templates"]],group:"Scaffold & Config",loader:lB(()=>import("./handler42.js"),"loader"),name:"create",options:[{defaultValue:!1,description:"Show available templates",name:"list",type:Boolean},{description:"Generate editor configs (vscode)",name:"editor",type:String},{defaultValue:!1,description:"Initialize a git repository",name:"git-init",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean}]};var pB=Object.defineProperty,dB=f((e,t)=>pB(e,"name",{value:t,configurable:!0}),"e$Q");const fB={description:"Deduplicate dependencies using the detected package manager",examples:[["vis dedupe","Run deduplication"],["vis dedupe --check","Preview changes without modifying (CI-friendly)"]],group:"Dependencies",loader:dB(()=>import("./handler7.js"),"loader"),name:"dedupe",options:[{defaultValue:!1,description:"Preview changes without modifying files (dry-run)",name:"check",type:Boolean}]};var mB=Object.defineProperty,hB=f((e,t)=>mB(e,"name",{value:t,configurable:!0}),"e$P");const gB={alias:"dc",description:"Create or update .devcontainer/devcontainer.json interactively",examples:[["vis devcontainer","Launch interactive devcontainer config editor"],["vis dc","Alias for devcontainer"],["vis devcontainer --template node-pnpm","Start from Node.js + pnpm template"]],group:"Scaffold & Config",loader:hB(()=>import("./handler46.js"),"loader"),name:"devcontainer",options:[{alias:"t",description:"Start from a template: node, node-pnpm, node-postgres, node-dind, fullstack, python, go, rust, java, devops, minimal, custom",name:"template",type:String},{alias:"o",description:"Output path (default: .devcontainer/devcontainer.json)",name:"output",type:String}]};var yB=Object.defineProperty,vB=f((e,t)=>yB(e,"name",{value:t,configurable:!0}),"e$O");const bB={argument:{description:"Package to execute (optionally with @version)",name:"package",type:String},description:"Execute a remote package without permanent installation",examples:[["vis dlx create-vite my-app","Scaffold a new project"],["vis dlx typescript@5.5.4 tsc --version","Run specific version"],["vis dlx -p cowsay -p lolcatjs -c 'echo hi | cowsay | lolcatjs'","Multiple packages with shell"],["vis install && vis dlx --offline typescript tsc --version","Hardened: pre-install + offline (no registry fetch on dlx)"]],group:"Run & Execute",loader:vB(()=>import("./handler8.js"),"loader"),name:"dlx",options:[{alias:"p",description:"Additional packages to install (repeatable)",multiple:!0,name:"package",type:String},{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output except command results",name:"silent",type:Boolean},{defaultValue:!1,description:"Resolve from local store only — fail rather than fetch from the registry. Pair with `vis install` for hardened npx-style workflows.",name:"offline",type:Boolean}]};var $B=Object.defineProperty,wB=f((e,t)=>$B(e,"name",{value:t,configurable:!0}),"e$N");const kB={argument:{description:"Docker subcommand: scaffold | prune",name:"subcommand",type:String},description:"Docker integration — scaffold a minimal context or prune unfocused deps",examples:[["vis docker scaffold --focus=my-app","Generate .vis/docker/workspace for my-app + its deps"],["vis docker scaffold --focus=my-app --include-sources","Also copy focus source trees"],["vis docker scaffold --focus=my-app,other --out=.vis/docker","Focus multiple projects"],["vis docker prune --context=.vis/docker","Strip unfocused projects inside a build stage"]],group:"Workspace",loader:wB(()=>import("./handler9.js"),"loader"),name:"docker",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{description:"Output directory for the scaffold (default: .vis/docker)",name:"out",type:String},{defaultValue:!1,description:"Also copy focus project source trees to <out>/sources",name:"include-sources",type:Boolean},{description:"Scaffold root for `vis docker prune` (default: .vis/docker)",name:"context",type:String},{defaultValue:!0,description:"Rewrite the workspace lockfile to drop unfocused projects (use --no-prune-lockfile to copy verbatim)",name:"prune-lockfile",type:Boolean}]};var SB=Object.defineProperty,EB=f((e,t)=>SB(e,"name",{value:t,configurable:!0}),"e$M");const DB={description:"Run a full project health check (outdated, security, duplicates, optimizations)",examples:[["vis doctor","Full project health check"],["vis doctor --fix","Check and auto-apply safe fixes"],["vis doctor --format json","Machine-readable output for CI"],["vis doctor --only security","Only run the security scans"],["vis doctor --skip optimization,runtime","Skip the listed sections"],["vis doctor --quiet","Summary only, no per-section breakdown"],["vis doctor --no-progress","Disable live progress UI (sequential logs)"],["vis doctor --exit-code","Exit with code 1 if security issues found"],["vis doctor --exit-code --strict","Fail on any issue (outdated, duplicates, security)"]],group:"Security & Health",loader:EB(()=>import("./handler41.js"),"loader"),name:"doctor",options:[{description:"Output format: table or json (default: table). Alias: --json",name:"format",type:String},{defaultValue:!1,description:"Shorthand for --format json",name:"json",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if issues found",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Auto-apply safe fixes (security overrides + codemods, SIGTERM orphans)",name:"fix",type:Boolean},{defaultValue:!1,description:"With --fix: escalate orphan cleanup to SIGKILL / taskkill /F (use when SIGTERM is ignored)",name:"fix-force",type:Boolean},{defaultValue:!1,description:"With --exit-code: also fail on outdated and duplicate deps",name:"strict",type:Boolean},{description:"Comma-separated sections to run: dependencies,security,optimization,runtime",name:"only",type:String},{description:"Comma-separated sections to skip",name:"skip",type:String},{defaultValue:!1,description:"Suppress per-section detail; print summary only",name:"quiet",type:Boolean},{defaultValue:!1,description:"Disable live progress UI (forces sequential logs)",name:"no-progress",type:Boolean},{defaultValue:!1,description:"Bypass the doctor result cache (~/.vis/cache/doctor)",name:"no-cache",type:Boolean},{description:"Comma-separated package name patterns to scope findings (supports * globs, e.g. '@types/*,react')",name:"filter",type:String}]};var CB=Object.defineProperty,AB=f((e,t)=>CB(e,"name",{value:t,configurable:!0}),"e$L");const OB={argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:AB(()=>import("./handler10.js"),"loader"),name:"exec",options:[{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"r",defaultValue:!1,description:"Run in every workspace package",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Run on workspace root only",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter packages by name pattern",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Run concurrently without topological ordering",name:"parallel",type:Boolean},{defaultValue:!1,description:"Reverse topological execution order",name:"reverse",type:Boolean}]};var jB=Object.defineProperty,xB=f((e,t)=>jB(e,"name",{value:t,configurable:!0}),"e$K");const PB={argument:{description:"Template name (or remote source like git://… or npm://…) — omit for interactive picker",name:"template",type:String},description:"Scaffold files from an in-repo template",examples:[["vis generate","Pick a template interactively"],["vis generate package","Run the 'package' template"],["vis generate component -- --name=Button --style=primary","Pre-fill option values"],["vis generate package --to=./packages/new --force","Custom destination + overwrite"],["vis generate package --dry-run","Print planned writes without touching disk"],["vis generate git://github.com/org/template#main","Fetch and run a remote template"],["vis generate --list","Show discovered templates"],["vis generate --list --json","Machine-readable template list"],["vis generate package --describe --json","Print template metadata (variables, destination) as JSON"]],group:"Scaffold & Config",loader:xB(()=>import("./handler37.js"),"loader"),name:"generate",options:[{defaultValue:!1,description:"List discovered templates",name:"list",type:Boolean},{defaultValue:!1,description:"Print template metadata (about, destination, variables) without running produce",name:"describe",type:Boolean},{defaultValue:!1,description:"Emit JSON output (with --list or --describe)",name:"json",type:Boolean},{description:"Destination directory",name:"to",type:String},{defaultValue:!1,description:"Print planned writes without touching disk",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Overwrite existing files without prompting",name:"force",type:Boolean},{defaultValue:!1,description:"Skip prompts; use template defaults",name:"defaults",type:Boolean},{defaultValue:!1,description:"Skip running post-generation scripts",name:"skip-scripts",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts (errors on missing required values)",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Prefer locally cached remote templates over re-downloading",name:"prefer-offline",type:Boolean}]};var NB=Object.defineProperty,RB=f((e,t)=>NB(e,"name",{value:t,configurable:!0}),"t$w");const FB={description:"Visualize the project dependency graph",examples:[["vis graph","Show colored dependency graph (TUI in TTY, ASCII otherwise)"],["vis graph --format=ascii","Force ASCII tree output"],["vis graph --format=dot","Output in Graphviz DOT format"],["vis graph --format=html --output=graph.html","Generate interactive HTML graph"],["vis graph --format=json --output=graph.json","Save JSON graph to file"]],group:"Workspace",loader:RB(()=>import("./handler38.js"),"loader"),name:"graph",options:[{alias:"f",defaultValue:void 0,description:"Output format: tui, ascii, dot, json, html (default: tui in TTY, ascii otherwise)",name:"format",type:String},{alias:"o",description:"Write output to file instead of stdout",name:"output",type:String},{alias:"d",description:"Maximum dependency tree depth for ASCII output (default: unlimited)",name:"depth",type:Number}]},M1=["pre-commit","pre-merge-commit","prepare-commit-msg","commit-msg","post-commit","applypatch-msg","pre-applypatch","post-applypatch","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"],V1=".vis-hooks",vZ=[".pre-commit-config.yaml",".pre-commit-config.yml","prek.toml"],bZ={commit:"pre-commit","merge-commit":"pre-merge-commit",push:"pre-push"},$Z=new Set(["commit-msg","post-checkout","post-commit","post-merge","post-rewrite","pre-commit","pre-merge-commit","pre-push","pre-rebase","prepare-commit-msg"]),wZ=new Set(["commit-msg","post-checkout","post-merge","post-rewrite","pre-rebase","prepare-commit-msg"]),kZ=new Set(["fail","script","system"]);var LB=Object.defineProperty,ti=f((e,t)=>LB(e,"name",{value:t,configurable:!0}),"e$I");const ri={defaultValue:V1,description:"Custom hooks directory",name:"hooks-dir",type:String},ni=[{defaultValue:void 0,description:"Set to 0 to disable git hooks, set to 2 for debug output",name:"VIS_GIT_HOOKS",type:String}],IB={commandPath:["hook"],description:"Install git hooks for the workspace (migrates husky / prek on prompt)",env:[...ni],examples:[["vis hook install","Install git hooks in .vis-hooks/"],["vis hook install --hooks-dir=.githooks","Install hooks in a custom directory"]],group:"Git Hooks",loader:ti(()=>import("./handler44.js").then(e=>({default:e.hookInstallExecute})),"loader"),name:"install",options:[ri]},TB={commandPath:["hook"],description:"Remove git hooks and reset core.hooksPath",env:[...ni],examples:[["vis hook uninstall","Remove git hooks and reset core.hooksPath"]],group:"Git Hooks",loader:ti(()=>import("./handler44.js").then(e=>({default:e.hookUninstallExecute})),"loader"),name:"uninstall",options:[ri]},BB={commandPath:["hook"],description:"Migrate from husky or prek to vis hooks (auto-detected)",env:[...ni],examples:[["vis hook migrate","Migrate from husky or prek to vis hooks (auto-detected)"],["vis hook migrate --dry-run","Preview what a migration would write without touching disk"]],group:"Git Hooks",loader:ti(()=>import("./handler44.js").then(e=>({default:e.hookMigrateExecute})),"loader"),name:"migrate",options:[ri,{defaultValue:!1,description:"Preview migrate without writing files",name:"dry-run",type:Boolean}]},_B={commandPath:["hook"],description:"Show configured hooks grouped by stage",env:[...ni],examples:[["vis hook list","Show configured hooks grouped by stage"]],group:"Git Hooks",loader:ti(()=>import("./handler44.js").then(e=>({default:e.hookListExecute})),"loader"),name:"list",options:[ri]},MB={commandPath:["hook"],description:"Sanity-check installed hooks and the bundled runner",env:[...ni],examples:[["vis hook validate","Sanity-check installed hooks and the bundled runner"]],group:"Git Hooks",loader:ti(()=>import("./handler44.js").then(e=>({default:e.hookValidateExecute})),"loader"),name:"validate",options:[ri]},VB={argument:{description:"Hook stage to run (e.g. pre-commit, commit-msg). Defaults to pre-commit.",name:"stage",type:String},commandPath:["hook"],description:"Run a specific hook stage against tracked files",env:[...ni],examples:[["vis hook run pre-commit --all-files","Run the pre-commit hooks against every tracked file"],["vis hook run pre-commit --from-ref=main --to-ref=HEAD","Run pre-commit hooks on files changed between two refs"],["vis hook run pre-commit --last-commit","Shortcut for --from-ref HEAD~1 --to-ref HEAD"]],group:"Git Hooks",loader:ti(()=>import("./handler44.js").then(e=>({default:e.hookRunExecute})),"loader"),name:"run",options:[ri,{defaultValue:!1,description:"Run against every tracked file",name:"all-files",type:Boolean},{defaultValue:void 0,description:"Include files changed since this ref",name:"from-ref",type:String},{defaultValue:void 0,description:"Include files changed up to this ref",name:"to-ref",type:String},{defaultValue:!1,description:"Shortcut for --from-ref HEAD~1 --to-ref HEAD",name:"last-commit",type:Boolean}]},WB={argument:{description:"Target to add (currently: `secrets`)",name:"target",type:String},commandPath:["hook"],description:"Add a managed hook snippet (e.g. `vis secrets --staged`)",env:[...ni],examples:[["vis hook add secrets","Add a pre-commit hook that runs `vis secrets --staged`"]],group:"Git Hooks",loader:ti(()=>import("./handler44.js").then(e=>({default:e.hookAddExecute})),"loader"),name:"add",options:[ri]},UB=[IB,TB,BB,_B,MB,VB,WB];var GB=Object.defineProperty,qB=f((e,t)=>GB(e,"name",{value:t,configurable:!0}),"e$H");const zB={argument:{description:"Project name to check (required)",name:"project",type:String},description:'Exit with inverted codes for CI "Ignored Build Step" gating (Vercel/Netlify)',examples:[["vis ignore my-app","Check if my-app is affected and decide whether to build"],["vis ignore my-app --base $VERCEL_GIT_PREVIOUS_SHA","Explicit base ref"],["vis ignore my-app --json","Emit the decision as JSON instead of text"],["vis ignore my-app --verbose","Print debug info about the decision path"],["vis ignore my-app --exit-zero-on-build","Normal exit semantics (0=build, 0=skip)"]],group:"Run & Execute",loader:qB(()=>import("./handler32.js"),"loader"),name:"ignore",options:[{description:"Git base ref for comparison. Defaults to CI provider env vars, then HEAD~1.",name:"base",type:String},{defaultValue:"HEAD",description:"Git head ref for comparison",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep"',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep"',name:"upstream",type:String},{defaultValue:!1,description:"Emit the decision as JSON on stdout instead of human text",name:"json",type:Boolean},{defaultValue:!1,description:"Exit 0 on build (normal semantics) instead of 1 (inverted Vercel/Netlify semantics)",name:"exit-zero-on-build",type:Boolean},{defaultValue:!1,description:"Enable verbose debug output",name:"verbose",type:Boolean}]};var HB=Object.defineProperty,JB=f((e,t)=>HB(e,"name",{value:t,configurable:!0}),"e$G");const KB={description:"Remove vis from the system (self-uninstall)",examples:[["vis implode","Interactive uninstall"],["vis implode --yes","Non-interactive uninstall (CI)"]],group:"System",loader:JB(()=>import("./handler11.js"),"loader"),name:"implode",options:[{alias:"y",defaultValue:!1,description:"Skip confirmation prompt",name:"yes",type:Boolean}]};var YB=Object.defineProperty,XB=f((e,t)=>YB(e,"name",{value:t,configurable:!0}),"e$F");const QB={alias:"view",argument:{description:"Package name followed by optional metadata fields (e.g. 'react version dependencies')",name:"args",type:String},description:"Show npm registry metadata for a package (alias of `npm view` / `pnpm view` / `yarn info` / `bun pm view`)",examples:[["vis info react","Full registry metadata for react"],["vis info react version","Latest version only"],["vis info react versions","All published versions"],["vis info react@18 dependencies","Dependencies of react@18"],["vis info react --json","Emit JSON"],["vis view react","Alias matching npm/pnpm"]],group:"Dependencies",loader:XB(()=>import("./handler12.js"),"loader"),name:"info",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean}]};var ZB=Object.defineProperty,e_=f((e,t)=>ZB(e,"name",{value:t,configurable:!0}),"e$E");const t_={description:"Initialize vis.config.ts with best-practice security defaults",examples:[["vis init","Interactive setup wizard"],["vis init --no-interactive","Create minimal config without prompts"],["vis init --force","Overwrite existing config"],["vis init --sync-native","Also sync to native PM config files"]],group:"Scaffold & Config",loader:e_(()=>import("./handler13.js"),"loader"),name:"init",options:[{defaultValue:!1,description:"Overwrite existing config file",name:"force",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Sync settings to native PM config files",name:"sync-native",type:Boolean}]};var r_=Object.defineProperty,n_=f((e,t)=>r_(e,"name",{value:t,configurable:!0}),"e$D");const i_={argument:{description:"Package to inspect, optionally pinned: `<name>` or `<name>@<spec>`. `<spec>` may be a version, range, or dist-tag.",name:"package"},description:"Run all marshalls against a package without installing it",examples:[["vis inspect express","Run every marshall against express@latest"],["vis inspect lodash@4.17.21","Pin to an exact version"],["vis inspect react@^18","Resolve a semver range, then inspect the best match"],["vis inspect express --json","Emit findings as JSON for CI integration"],["vis inspect express --strict","Exit non-zero on any warning, not just errors"],["vis inspect express --only author,downloads","Run a subset of marshalls"],["vis inspect express --only signatures","Signatures are off by default; opt in with --only"]],group:"Security & Health",loader:n_(()=>import("./handler14.js"),"loader"),name:"inspect",options:[{defaultValue:!1,description:"Emit findings as a JSON document instead of the human-readable table.",name:"json",type:Boolean},{defaultValue:!1,description:"Exit non-zero on any finding (warnings included). Default exits non-zero only on errors.",name:"strict",type:Boolean},{description:"Comma-separated subset of marshalls to run. Known: author, archivedRepo, downloads, expiredDomains, metadata, newBin, provenance, signatures. Signatures only runs when explicitly requested here.",name:"only",type:String}]};var s_=Object.defineProperty,o_=f((e,t)=>s_(e,"name",{value:t,configurable:!0}),"e$C");const a_={alias:"i",argument:{description:"Optional package names. When provided, delegates to `vis add` (enables npm-style `alias npm='vis install'` wrappers).",name:"packages",type:String},description:"Install dependencies using the detected package manager",examples:[["vis install","Install all dependencies (frozen-lockfile by default when a lockfile is present)"],["vis install react react-dom","Delegates to `vis add` — enables shell aliases like `alias npm='vis install'`"],["vis i --no-frozen-lockfile","Allow lockfile updates (escape hatch for the default)"],["vis install --ci","Clean install: wipe node_modules + frozen lockfile (mirrors npm ci / pnpm ci)"],["vis install --prefer-offline","Use cached packages when available, fall back to network"],["vis install --prod","Install production dependencies only"],["vis install --filter app","Install for specific workspace package"],["vis install --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.policies.installScripts.allow)"],["vis install --no-typosquat-check","Skip typosquat name check"],["vis install --installer aube","Force aube as the installer (errors if not on PATH)"],["vis install --no-aube","Bypass aube; use the lockfile-detected PM"]],group:"Dependencies",loader:o_(()=>import("./handler15.js"),"loader"),name:"install",options:[{alias:"P",conflicts:"dev",description:"Skip devDependencies (no positional args) / add as peer (with positional args, npm-style)",name:"prod",type:Boolean},{alias:"D",conflicts:"prod",description:"Install devDependencies only (no positional args) / add as dev (with positional args, npm-style)",name:"dev",type:Boolean},{defaultValue:!1,description:"Add as optional dependency (only with positional args; mirrors `npm install -O`)",name:"save-optional",type:Boolean},{alias:"E",defaultValue:!1,description:"Save exact version (only with positional args; mirrors `npm install -E`)",name:"exact",type:Boolean},{defaultValue:!1,description:"Skip Socket.dev security check (only with positional args; mirrors `vis add --no-socket-check`)",name:"no-socket-check",type:Boolean},{defaultValue:!1,description:"Skip the offline marshall pipeline (only with positional args; mirrors `vis add --no-marshall-check`)",name:"no-marshall-check",type:Boolean},{defaultValue:!1,description:"Use frozen lockfile (CI mode, maps to npm ci)",name:"frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Opt out of vis's default frozen-lockfile behavior and allow lockfile updates",name:"no-frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Clean install: wipe node_modules then install with frozen lockfile",name:"ci",type:Boolean},{alias:"f",defaultValue:!1,description:"Force reinstall all dependencies",name:"force",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.policies.installScripts.allow)",name:"run-scripts",type:Boolean},{defaultValue:!1,description:"Update lockfile without installing",name:"lockfile-only",type:Boolean},{defaultValue:!1,description:"Skip optional dependencies",name:"no-optional",type:Boolean},{defaultValue:!1,description:"Use only cached packages",name:"offline",type:Boolean},{defaultValue:!1,description:"Prefer cached packages, fall back to network when missing",name:"prefer-offline",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output",name:"silent",type:Boolean},{alias:"r",defaultValue:!1,description:"Install in all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Target workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Skip typosquat name check",name:"no-typosquat-check",type:Boolean},{description:"Pick the installer explicitly. One of: auto, aube, pnpm, npm, yarn, bun. Overrides VIS_INSTALLER and install.backend in vis.config.",name:"installer",type:String},{defaultValue:!1,description:"Skip aube and use the lockfile-detected PM. Wins over --installer / VIS_INSTALLER / install.backend.",name:"no-aube",type:Boolean}]};var c_=Object.defineProperty,l_=f((e,t)=>c_(e,"name",{value:t,configurable:!0}),"e$B");const u_={alias:"ln",argument:{description:"Package name or directory path to link (omit to register current package)",name:"target",type:String},description:"Link a local package for development",examples:[["vis link ./packages/utils","Link local directory package (works on all PMs)"],["vis link","Register current package globally (pnpm <=10, yarn, npm, bun)"],["vis link react","Link global package into current project (pnpm <=10, yarn, npm, bun)"]],group:"Dependencies",loader:l_(()=>import("./handler17.js"),"loader"),name:"link"};var p_=Object.defineProperty,d_=f((e,t)=>p_(e,"name",{value:t,configurable:!0}),"e$A");const f_={description:"Lint workspace dependency policies (workspace-protocol, banned-deps, redefine-root, workspace-versions, custom-types, empty-deps, root-private, root-package-manager, root-deps, missing-package-json, dead-workspace-patterns, types-in-deps, similar-deps)",examples:[["vis lint","Run every enabled lint and exit non-zero on failures"],["vis lint --workspace-protocol","Only check that internal deps use workspace:*"],["vis lint --workspace-protocol --fix","Auto-rewrite internal deps to use workspace:*"],["vis lint --redefine-root","Flag deps duplicated between root and child packages"],["vis lint --banned-deps","Flag deps matching policy.bannedDeps in vis config"],["vis lint --workspace-versions","Flag external deps declared at different versions across packages"],["vis lint --workspace-versions --fix","Rewrite drifting deps to the highest sibling version"],["vis lint --workspace-versions --dep react","Limit version-drift check to a single dep"],["vis lint --workspace-versions --resolve catalog --fix","Rewrite drifting deps to catalog: when a catalog already pins them"],["vis lint --workspace-versions --resolve catalog --propose-min 3","Suggest new catalog entries for deps ≥3 packages already agree on"],["vis lint --custom-types","Flag drift in engines.{node,pnpm}, packageManager, volta.{node,pnpm,yarn}, devEngines"],["vis lint --custom-types --fix","Align all engines/packageManager/volta versions to the highest sibling"],["vis lint --empty-deps --fix","Drop empty `dependencies` / `devDependencies` / etc. blocks across the workspace"],["vis lint --root-private --fix",'Ensure the workspace root package.json has "private": true'],["vis lint --root-package-manager","Ensure the root package.json declares a `packageManager` field"],["vis lint --root-deps --fix","Move runtime deps off the private workspace root into devDependencies"],["vis lint --missing-package-json","Flag workspace dirs that don't contain a package.json"],["vis lint --dead-workspace-patterns --fix","Drop workspace patterns that match zero packages"],["vis lint --types-in-deps --fix","Move @types/* out of dependencies on private packages"],["vis lint --similar-deps","Flag drift across related dep families (react+react-dom, @babel/*, …)"],["vis lint --ban left-pad --ban request","One-off ban: flag any package declaring left-pad or request"],["vis lint --pin react@18.2.0","One-off pin: flag any package declaring react at a different version"],["vis lint --format json","Emit findings as JSON for CI / editor integrations"]],group:"Security & Health",loader:d_(()=>import("./handler43.js"),"loader"),name:"lint",options:[{defaultValue:!1,description:"Lint that internal deps use the workspace: protocol",name:"workspace-protocol",type:Boolean},{defaultValue:!1,description:"Lint that no child re-declares a dep already pinned in the workspace root",name:"redefine-root",type:Boolean},{defaultValue:!1,description:"Lint deps against policy.bannedDeps in vis config",name:"banned-deps",type:Boolean},{defaultValue:!1,description:"Lint that all packages declare external deps at the same version",name:"workspace-versions",type:Boolean},{defaultValue:!1,description:"Lint engines.{node,pnpm}, packageManager, volta.*, devEngines.* for drift across packages",name:"custom-types",type:Boolean},{defaultValue:!1,description:"Flag empty dependency blocks (`dependencies: {}`, `devDependencies: {}`, …) across the workspace",name:"empty-deps",type:Boolean},{defaultValue:!1,description:'Ensure the workspace root package.json sets `"private": true`',name:"root-private",type:Boolean},{defaultValue:!1,description:"Ensure the workspace root package.json declares a `packageManager` field",name:"root-package-manager",type:Boolean},{defaultValue:!1,description:"Flag runtime dependencies on the private workspace root (move them to devDependencies)",name:"root-deps",type:Boolean},{defaultValue:!1,description:"Flag workspace directories that lack a package.json",name:"missing-package-json",type:Boolean},{defaultValue:!1,description:"Flag workspace patterns (in `pnpm-workspace.yaml` / `package.json#workspaces`) that match zero packages",name:"dead-workspace-patterns",type:Boolean},{defaultValue:!1,description:"Flag `@types/*` declared in `dependencies` on a private package (should be in devDependencies)",name:"types-in-deps",type:Boolean},{defaultValue:!1,description:"Flag version drift across related dep families (react+react-dom, @babel/*, @storybook/*, …)",name:"similar-deps",type:Boolean},{description:"Restrict --workspace-versions to a single dep",name:"dep",type:String},{description:"Ban a dep name or glob for this run (repeatable). Auto-enables --banned-deps.",multiple:!0,name:"ban",type:String},{description:"Pin a dep to an exact specifier for this run, e.g. react@^18.2.0 (repeatable). Auto-enables --workspace-versions.",multiple:!0,name:"pin",type:String},{description:"Conflict resolution for --workspace-versions: highest, lowest, or catalog (default: highest)",name:"resolve",type:String},{description:"Propose catalog entries for deps ≥N packages already agree on. Activates with --resolve catalog.",name:"propose-min",type:Number},{defaultValue:!1,description:"Auto-fix violations in place (writes package.json files)",name:"fix",type:Boolean},{description:"Specifier used by --fix for workspace-protocol (default: workspace:*)",name:"fix-specifier",type:String},{description:"Output format: human, json, or minimal (default: human)",name:"format",type:String},{defaultValue:!1,description:"Suppress all output except errors",name:"quiet",type:Boolean}]};var m_=Object.defineProperty,h_=f((e,t)=>m_(e,"name",{value:t,configurable:!0}),"e$z");const g_={description:"List all workspace projects with metadata",examples:[["vis list","Show all projects"],["vis list --targets","Per-target rows with type, cache status and description"],["vis list --targets --inferred","Only show targets synthesized by Project Crystal-style inference"],["vis list --deps","Human-readable table of every dep-instance across the workspace"],["vis list --deps --internal-only","Only workspace deps in human form"],["vis list --deps --format=ndjson","Stream every dep-instance as NDJSON for jq pipelines"],["vis list --deps --format=json --pretty","Single pretty-printed JSON array of dep-instances"],["vis list --format=json","Machine-readable project listing"],['vis list --query "tag=frontend"',"Filter by query"]],group:"Workspace",loader:h_(()=>import("./handler33.js"),"loader"),name:"list",options:[{defaultValue:!1,description:"Filter target rows to only inferred targets (implies --targets)",name:"inferred",type:Boolean},{description:"Output format: table (default), json (single document), or ndjson (one record per line; --deps only)",name:"format",type:String},{defaultValue:!1,description:"Pretty-print with 2-space indent (only meaningful with --format=json)",name:"pretty",type:Boolean},{description:"Filter projects by query",name:"query",type:String},{defaultValue:!1,description:"Show per-target rows (type, cache, description)",name:"targets",type:Boolean},{defaultValue:!1,description:"Render a dep-instance view (table by default; use --format=ndjson|json for jq-friendly streams)",name:"deps",type:Boolean},{description:"Restrict --deps to specific dep blocks (repeatable)",multiple:!0,name:"dep-type",type:String},{defaultValue:!1,description:"With --deps: only show internal/workspace deps",name:"internal-only",type:Boolean},{defaultValue:!1,description:"With --deps: only show external/registry deps",name:"external-only",type:Boolean},{description:"With --deps: glob of declaring package names to keep (repeatable)",multiple:!0,name:"include",type:String},{description:"With --deps: glob of declaring package names to drop (repeatable)",multiple:!0,name:"exclude",type:String}]};var y_=Object.defineProperty,St=f((e,t)=>y_(e,"name",{value:t,configurable:!0}),"t$p");const Pt=[{defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"y",defaultValue:!1,description:"Skip the confirmation prompt",name:"yes",type:Boolean}],v_={commandPath:["migrate"],description:"Migrate dependencies and scripts to vis",group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateDepsExecute})),"loader"),name:"deps",options:[...Pt]},b_={commandPath:["migrate"],description:"Inline lint-staged configuration into vis",group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateLintStagedExecute})),"loader"),name:"lint-staged",options:[...Pt]},$_={commandPath:["migrate"],description:"Inline nano-staged configuration into vis",group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateNanoStagedExecute})),"loader"),name:"nano-staged",options:[...Pt]},w_={commandPath:["migrate"],description:"Migrate turborepo tasks/config to vis",group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateTurborepoExecute})),"loader"),name:"turborepo",options:[...Pt]},k_={commandPath:["migrate"],description:"Migrate nx targets/config to vis",group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateNxExecute})),"loader"),name:"nx",options:[...Pt,{defaultValue:!1,description:"Overwrite an existing vis.config.ts (a .bak is taken first)",name:"force",type:Boolean}]},S_={commandPath:["migrate"],description:"Migrate moon tasks/templates to vis",group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateMoonExecute})),"loader"),name:"moon",options:[...Pt,{defaultValue:!1,description:"Copy .moon/templates/* into .vis/templates/* so `vis generate` works without .moon/",name:"copy-templates",type:Boolean}]},E_={commandPath:["migrate"],description:"Migrate gitleaks config/baseline/hooks to `vis secrets`",examples:[["vis migrate gitleaks","Migrate gitleaks config/baseline/hooks to `vis secrets`"]],group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateGitleaksExecute})),"loader"),name:"gitleaks",options:[...Pt]},D_={commandPath:["migrate"],description:"Migrate Kingfisher baseline/hooks/scripts to `vis secrets`",examples:[["vis migrate kingfisher","Migrate Kingfisher baseline/hooks/scripts to `vis secrets`"]],group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateKingfisherExecute})),"loader"),name:"kingfisher",options:[...Pt]},C_={commandPath:["migrate"],description:"Replace secretlint with `vis secrets`",examples:[["vis migrate secretlint","Replace secretlint with `vis secrets`"]],group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateSecretlintExecute})),"loader"),name:"secretlint",options:[...Pt]},A_={commandPath:["migrate"],description:"Translate syncpack customTypes into vis policy and strip the syncpack dep/scripts",examples:[["vis migrate syncpack","Translate syncpack customTypes into vis policy and strip the syncpack dep/scripts"]],group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateSyncpackExecute})),"loader"),name:"syncpack",options:[...Pt]},O_={commandPath:["migrate"],description:"Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command",examples:[["vis migrate sherif","Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command"]],group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateSherifExecute})),"loader"),name:"sherif",options:[...Pt]},j_={commandPath:["migrate"],description:"Auto-rewrite vis.config.ts to use renamed fields (targetDefaults → tasks, taskDefaults → scopedTasks, taskRunnerOptions → taskRunner)",examples:[["vis migrate self","Rewrite vis.config.ts in-place (a .bak is taken first)"],["vis migrate self --dry-run","Preview the rewrite without writing"]],group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateSelfExecute})),"loader"),name:"self",options:[...Pt]},x_={commandPath:["migrate"],description:"Audit the workspace for stray gitleaks/secretlint/sherif/syncpack references (exit 1 on issues)",examples:[["vis migrate verify","Audit the workspace for stray gitleaks/secretlint/sherif/syncpack references (exit 1 on issues)"]],group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateVerifyExecute})),"loader"),name:"verify",options:[]},P_={commandPath:["migrate"],description:"Run every applicable migration non-interactively (autodetected)",examples:[["vis migrate all --yes","Run every detected migration without prompting (CI-friendly)"],["vis migrate all --dry-run","Preview every detected migration without writing files"]],group:"Migrate",loader:St(()=>import("./handler35.js").then(e=>({default:e.migrateAllExecute})),"loader"),name:"all",options:[...Pt]},N_=[P_,v_,b_,$_,w_,k_,S_,j_,E_,D_,C_,A_,O_,x_];var R_=Object.defineProperty,F_=f((e,t)=>R_(e,"name",{value:t,configurable:!0}),"r$x");const L_=new Set(["--cwd"]),I_=new Set(["--help","--version","-h","-V"]),T_=F_(e=>{const t=[];for(let r=0;r<e.length;r+=1){const n=e[r];if(n!==void 0){if(I_.has(n))return!1;if(n.startsWith("-")){const i=n.indexOf("="),s=i===-1?n:n.slice(0,i);if(L_.has(s)&&i===-1){const o=e[r+1];o!==void 0&&!o.startsWith("-")&&(r+=1)}continue}t.push(n)}}return t.length===1&&t[0]==="migrate"},"isBareMigrateInvocation");var B_=Object.defineProperty,__=f((e,t)=>B_(e,"name",{value:t,configurable:!0}),"t$o");const Mg=__(e=>e in xl&&xl[e]!=="0"&&xl[e]!=="false","check"),Ir=Mg("CI")||Mg("CONTINUOUS_INTEGRATION");var M_=Object.defineProperty,hu=f((e,t)=>M_(e,"name",{value:t,configurable:!0}),"i$j");class V_{static{f(this,"MigrateStore")}static{hu(this,"MigrateStore")}#e;#r=new Set;constructor(t){this.#e={applyProgress:null,checkedItems:new Set(t.map(r=>r.entry.id)),error:null,focusedPanel:"list",items:t,phase:"browsing",selectedIndex:0}}getSnapshot=hu(()=>this.#e,"getSnapshot");subscribe=hu(t=>(this.#r.add(t),()=>{this.#r.delete(t)}),"subscribe");getCheckedItems(){return this.#e.items.filter(t=>this.#e.checkedItems.has(t.entry.id))}getSelectedItem(){return this.#e.items[this.#e.selectedIndex]??null}setSelectedIndex(t){const r=Math.max(0,Math.min(t,this.#e.items.length-1));r!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:r})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:t})}toggleCheck(t){const r=new Set(this.#e.checkedItems);r.has(t)?r.delete(t):r.add(t),this.#t({...this.#e,checkedItems:r})}checkAll(){this.#t({...this.#e,checkedItems:new Set(this.#e.items.map(t=>t.entry.id))})}uncheckAll(){this.#t({...this.#e,checkedItems:new Set})}toggleAll(){this.#e.checkedItems.size===this.#e.items.length?this.uncheckAll():this.checkAll()}startApply(){const t=this.getCheckedItems().length;this.#t({...this.#e,applyProgress:{current:0,total:t},phase:"applying"})}updateApplyProgress(t){this.#e.applyProgress&&this.#t({...this.#e,applyProgress:{...this.#e.applyProgress,current:t}})}markDone(){this.#t({...this.#e,phase:"done"})}setError(t){this.#t({...this.#e,error:t,phase:"error"})}#t(t){this.#e=t;for(const r of this.#r)try{r()}catch{}}}var W_=Object.defineProperty,U_=f((e,t)=>W_(e,"name",{value:t,configurable:!0}),"f$a");const Vg=U_(({autoExitSeconds:e,onCancel:t,visible:r})=>{const{exit:n}=vb(),[i,s]=Is(e||3),o=Js(null),a=Js(0);gb(()=>{if(!r)return;const c=e||3;s(c),a.current=Date.now();let u=c;return o.current=setInterval(()=>{u-=1,u<=0?(o.current&&(clearInterval(o.current),o.current=null),s(0),n()):s(u)},1e3),()=>{o.current&&(clearInterval(o.current),o.current=null)}},[r,e,n]);const l=yb(()=>{o.current&&(clearInterval(o.current),o.current=null),t()},[t]);return bb((c,u)=>{Date.now()-a.current<200||(c==="q"?n():l())},{isActive:r}),z(Ap,{backgroundColor:"#1e1e1e",footer:pe(H,{dimColor:!0,children:["Press"," ",z(H,{bold:!0,color:"white",children:"q"})," ","to exit,"," ",z(H,{bold:!0,color:"white",children:"any key"})," ","to stay"]}),title:`Exiting in ${i}…`,visible:r,width:50,children:z(H,{dimColor:!0,children:"Stay to explore the results interactively."})})},"QuitDialog");var G_=Object.defineProperty,W1=f((e,t)=>G_(e,"name",{value:t,configurable:!0}),"n$n");const q_=W1(e=>{if(e.startsWith("⚠"))return"yellow";e.startsWith("── ")||e.startsWith("[dry-run]")},"colorForPreviewLine"),z_=W1(({focused:e,item:t,scrollRef:r})=>t?pe(he,{borderColor:e?"white":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,children:[z(he,{flexShrink:0,paddingTop:1,paddingX:2,children:z(H,{bold:!0,color:"white",children:t.entry.title})}),z(he,{flexShrink:0,paddingBottom:1,paddingX:2,children:z(H,{dimColor:!0,children:t.entry.description})}),z(iD,{flexGrow:1,flexShrink:1,paddingX:2,ref:r,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:pe(he,{flexDirection:"column",children:[z(H,{dimColor:!0,children:"── What will change ──"}),z(H,{}),t.preview.length===0&&z(H,{dimColor:!0,children:"(no preview available)"}),t.preview.map((i,s)=>{const o=q_(i);return i===""?z(H,{},`blank-${String(s)}`):z(H,{color:o,children:i},`${String(s)}-${i.slice(0,20)}`)})]})})]}):z(he,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:z(H,{dimColor:!0,children:"No migration selected"})}),"MigrateDetailPanel");var H_=Object.defineProperty,U1=f((e,t)=>H_(e,"name",{value:t,configurable:!0}),"g$d");const J_=U1(({checked:e,isSelected:t,item:r})=>{const n=e?"☑":"☐",i=r.preview.length;return pe(he,{flexShrink:0,height:1,children:[z(H,{children:t?">":" "}),pe(H,{color:e?"white":"gray",children:[" ",n," "]}),z(he,{flexGrow:1,children:z(H,{bold:t,inverse:t,wrap:"truncate",children:r.entry.title})}),pe(H,{dimColor:!0,children:[" ",i," ","change",i===1?"":"s"," "]})]})},"MigrationRow"),K_=U1(({checkedItems:e,focused:t,isDryRun:r,items:n,scrollOffset:i,selectedIndex:s,viewportHeight:o})=>{const a=t?"white":"gray",l=n.filter(p=>e.has(p.entry.id)).length,c=n.map((p,m)=>z(J_,{checked:e.has(p.entry.id),isSelected:m===s,item:p},p.entry.id)),u=n.length,d=u>o&&o>0;return pe(he,{borderColor:a,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[pe(he,{flexShrink:0,gap:1,paddingX:1,children:[z(H,{bold:!0,inverse:!0,children:" MIGRATE "}),pe(H,{wrap:"truncate",children:[n.length," ","applicable"]}),l>0&&pe(H,{dimColor:!0,children:[" — ",l," selected"]}),r&&z(H,{color:"yellow",children:" (dry-run)"})]}),pe(he,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[z(he,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:z(he,{flexDirection:"column",marginTop:-i,children:c})}),d&&z(he,{flexShrink:0,marginLeft:1,marginRight:1,children:z(sD,{contentHeight:u,placement:"inset",scrollOffset:i,style:"block",viewportHeight:o})})]})]})},"MigrateListPanel");var Y_=Object.defineProperty,X_=f((e,t)=>Y_(e,"name",{value:t,configurable:!0}),"N$e");const Q_=100,Z_=40,e3=10,t3=X_(({autoExitSeconds:e=0,isDryRun:t,store:r})=>{const{exit:n}=vb(),{columns:i,rows:s}=nD(),o=rD(r.subscribe,r.getSnapshot),[a,l]=Is(!1),[c,u]=Is(!1),[d,p]=Is(!1),[m,g]=Is(0),$=Js(null),S=Js(null),k=Js(null),v=o.items[o.selectedIndex]??null,h=Math.max(1,s-6),b=yb(Y=>{g(P=>Y>=P+h?Math.max(0,Y-h+1):Y<P?Math.max(0,Y):P)},[h]);if(gb(()=>{S.current?.scrollToTop()},[v?.entry.id]),bb((Y,P)=>{if(Y==="c"&&P.ctrl){n();return}if(!d){if(c){Y==="u"||P.return?(u(!1),r.startApply(),n(r.getCheckedItems())):P.escape||Y==="q"?u(!1):P.downArrow||Y==="j"?k.current?.scrollBy(1):(P.upArrow||Y==="k")&&k.current?.scrollBy(-1);return}if(a){P.escape||Y==="?"?l(!1):Y==="q"?(l(!1),p(!0)):P.downArrow||Y==="j"?$.current?.scrollBy(1):(P.upArrow||Y==="k")&&$.current?.scrollBy(-1);return}if(Y==="?"){l(!0);return}if(Y==="q"){p(!0);return}if(P.tab){r.setFocusedPanel(o.focusedPanel==="list"?"detail":"list");return}if(o.focusedPanel==="list"){if(P.downArrow||Y==="j"){const N=Math.min(o.selectedIndex+1,o.items.length-1);r.setSelectedIndex(N),b(N);return}if(P.upArrow||Y==="k"){const N=Math.max(o.selectedIndex-1,0);r.setSelectedIndex(N),b(N);return}if(P.pageDown){const N=Math.min(o.selectedIndex+10,o.items.length-1);r.setSelectedIndex(N),b(N);return}if(P.pageUp){const N=Math.max(o.selectedIndex-10,0);r.setSelectedIndex(N),b(N);return}if(P.home){r.setSelectedIndex(0),g(0);return}if(P.end){const N=o.items.length-1;r.setSelectedIndex(N),b(N);return}if(Y===" "||P.return){v&&r.toggleCheck(v.entry.id);return}if(Y==="a"){r.toggleAll();return}if(Y==="u"&&!t&&o.checkedItems.size>0){u(!0);return}P.rightArrow&&r.setFocusedPanel("detail");return}if(o.focusedPanel==="detail"){if(P.escape||P.leftArrow){r.setFocusedPanel("list");return}if(P.downArrow||Y==="j"){S.current?.scrollBy(1);return}if(P.upArrow||Y==="k"){S.current?.scrollBy(-1);return}if(P.pageDown){S.current?.scrollBy(10);return}if(P.pageUp){S.current?.scrollBy(-10);return}if(P.home){S.current?.scrollToTop();return}P.end&&S.current?.scrollToBottom()}}},{isActive:!0}),i<Z_||s<e3)return z(he,{alignItems:"center",height:s,justifyContent:"center",width:i,children:pe(H,{color:"yellow",children:["Terminal too small (",i,"x",s,")"]})});const w=i>=Q_,y=[pe(he,{gap:1,children:[z(H,{bold:!0,color:"white",children:"q"}),z(H,{dimColor:!0,children:"QUIT"})]},"q"),pe(he,{gap:1,children:[z(H,{bold:!0,color:"white",children:"?"}),z(H,{dimColor:!0,children:"HELP"})]},"?"),pe(he,{gap:1,children:[z(H,{bold:!0,color:"white",children:"↑↓"}),z(H,{dimColor:!0,children:"NAV"})]},"nav"),pe(he,{gap:1,children:[z(H,{bold:!0,color:"white",children:"Space"}),z(H,{dimColor:!0,children:"CHECK"})]},"sp"),pe(he,{gap:1,children:[z(H,{bold:!0,color:"white",children:"a"}),z(H,{dimColor:!0,children:"ALL"})]},"a")];!t&&o.checkedItems.size>0&&y.push(pe(he,{gap:1,children:[z(H,{bold:!0,color:"green",children:"u"}),z(H,{dimColor:!0,children:"APPLY"})]},"u")),y.push(pe(he,{gap:1,children:[z(H,{bold:!0,color:"white",children:"Tab"}),z(H,{dimColor:!0,children:"PANEL"})]},"tab"));const D=z(he,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:z(he,{flexWrap:"wrap",gap:2,paddingX:1,children:y})}),E=pe(Ap,{footer:pe(H,{dimColor:!0,children:[z(H,{bold:!0,color:"white",children:"↑↓"})," scroll ",z(H,{bold:!0,color:"white",children:"?"}),"/",z(H,{bold:!0,color:"white",children:"Esc"})," close"]}),scrollRef:$,title:"KEYBOARD SHORTCUTS",visible:a,width:52,children:[pe(he,{flexDirection:"column",marginBottom:1,children:[z(H,{bold:!0,color:"white",children:"NAVIGATION"}),pe(H,{children:[z(H,{bold:!0,color:"white",children:" ↑/k"}),z(H,{dimColor:!0,children:" Move up"})]}),pe(H,{children:[z(H,{bold:!0,color:"white",children:" ↓/j"}),z(H,{dimColor:!0,children:" Move down"})]}),pe(H,{children:[z(H,{bold:!0,color:"white",children:" Tab"}),z(H,{dimColor:!0,children:" Switch panel"})]}),pe(H,{children:[z(H,{bold:!0,color:"white",children:" →/←"}),z(H,{dimColor:!0,children:" Focus detail/list"})]})]}),pe(he,{flexDirection:"column",marginBottom:1,children:[z(H,{bold:!0,color:"white",children:"SELECTION"}),pe(H,{children:[z(H,{bold:!0,color:"white",children:" Space"}),z(H,{dimColor:!0,children:" Toggle migration"})]}),pe(H,{children:[z(H,{bold:!0,color:"white",children:" a"}),z(H,{dimColor:!0,children:" Toggle all"})]})]}),pe(he,{flexDirection:"column",children:[z(H,{bold:!0,color:"white",children:"ACTIONS"}),!t&&pe(H,{children:[z(H,{bold:!0,color:"white",children:" u"}),z(H,{dimColor:!0,children:" Apply selected migrations"})]}),pe(H,{children:[z(H,{bold:!0,color:"white",children:" q"}),z(H,{dimColor:!0,children:" Quit"})]}),pe(H,{children:[z(H,{bold:!0,color:"white",children:" ?"}),z(H,{dimColor:!0,children:" Toggle help"})]})]})]}),A=r.getCheckedItems(),j=z(he,{alignItems:"center",flexDirection:"column",children:pe(H,{dimColor:!0,children:["Press ",z(H,{bold:!0,color:"white",children:"u"})," or ",z(H,{bold:!0,color:"white",children:"Enter"})," to confirm, ",z(H,{bold:!0,color:"white",children:"Esc"})," to cancel"]})}),G=z(Ap,{footer:j,scrollRef:k,title:`Apply ${String(A.length)} migration${A.length===1?"":"s"}?`,visible:c,width:70,children:A.map(Y=>pe(he,{gap:1,children:[pe(H,{children:[" ",Y.entry.title]}),pe(H,{dimColor:!0,children:["(",Y.preview.length," ","change",Y.preview.length===1?"":"s",")"]})]},Y.entry.id))}),W=z(K_,{checkedItems:o.checkedItems,focused:o.focusedPanel==="list",isDryRun:t,items:o.items,scrollOffset:m,selectedIndex:o.selectedIndex,viewportHeight:h}),ce=z(z_,{focused:o.focusedPanel==="detail",item:v,scrollRef:S});if(w){const Y=Math.floor(i*.55);return pe(he,{flexDirection:"column",height:s,width:i,children:[pe(he,{flexDirection:"row",flexGrow:1,children:[z(he,{flexGrow:1,children:W}),z(he,{width:Y,children:ce})]}),D,G,z(Vg,{autoExitSeconds:e||3,onCancel:f(()=>{p(!1)},"onCancel"),visible:d}),E]})}const te=Math.floor(s*.45);return pe(he,{flexDirection:"column",height:s,width:i,children:[z(he,{height:te,children:W}),z(he,{flexGrow:1,children:ce}),D,G,z(Vg,{autoExitSeconds:e||3,onCancel:f(()=>{p(!1)},"onCancel"),visible:d}),E]})},"VisMigrateApp");var r3=Object.defineProperty,Hf=f((e,t)=>r3(e,"name",{value:t,configurable:!0}),"r$v");const n3=/\n([ \t]+)/,i3=Hf(e=>{const{indent:t,lineEnding:r}=oD(e),n={};return t!==void 0&&(n.indent=t),(r==="lf"||r==="crlf")&&(n.lineEnding=r),n},"resolveEditorConfigDefaults"),br=Hf((e,t,r={})=>{const{defaultIndent:n=" ",useEditorconfig:i=!0}=r;if(i){const{indent:s}=i3(e);if(s!==void 0)return s}if(t!==void 0){const s=n3.exec(t);if(s?.[1]!==void 0)return s[1]}return n},"resolveIndentForFile"),Jf=Hf((e,t={})=>{const r=x(e)?J(e):void 0;return br(e,r,t)},"resolveIndentForExistingFile");var s3=Object.defineProperty,o3=f((e,t)=>s3(e,"name",{value:t,configurable:!0}),"t$n");const G1=[".lintstagedrc.json",".lintstagedrc"],q1=[".lintstagedrc.yaml",".lintstagedrc.yml",".lintstagedrc.mjs","lint-staged.config.mjs",".lintstagedrc.cjs","lint-staged.config.cjs",".lintstagedrc.js","lint-staged.config.js",".lintstagedrc.ts","lint-staged.config.ts",".lintstagedrc.mts","lint-staged.config.mts",".lintstagedrc.cts","lint-staged.config.cts"],Kf=[...G1,...q1],a3=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+lint-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)lint-staged\b/],z1=[".nano-staged.json",".nanostagedrc"],H1=[".nano-staged.mjs",".nano-staged.cjs",".nano-staged.js","nano-staged.config.mjs","nano-staged.config.cjs","nano-staged.config.js","nano-staged.config.mts","nano-staged.config.cts","nano-staged.config.ts"],Yf=[...z1,...H1],c3=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+nano-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)nano-staged\b/],J1=["husky","lint-staged","nano-staged"],l3=/\(is-ci \|\| husky \|\| exit 0\)\s*&&\s*/g,u3=/\bhusky(?:\s+install)?\s*&&\s*/g,p3=/\s*&&\s*husky(?:\s+install)?/g,d3=/\s*\|\|\s*husky(?:\s+install)?/g,f3=[l3,u3,p3,d3],K1=o3(e=>{if(e==="husky"||e==="husky install")return;let t=e;for(const r of f3)t=t.replace(r,"");return t=t.trim(),t===e?e:t||void 0},"cleanHuskyFromScript");var m3=Object.defineProperty,Ga=f((e,t)=>m3(e,"name",{value:t,configurable:!0}),"o$r");const h3=/\/$/,g3=Ga(e=>{let t='"$0"';for(let r=0;r<e;r+=1)t=`"$(dirname ${t})"`;return t},"nestedDirname"),y3=Ga(e=>{const t=e.split("/").filter(r=>r!==""&&r!==".").length+2;return`#!/usr/bin/env sh
|
|
1005
|
+
{ [ "$VIS_GIT_HOOKS" = "2" ]; } && set -x
|
|
1006
|
+
n=$(basename "$0")
|
|
1007
|
+
s=$(dirname "$(dirname "$0")")/$n
|
|
1008
|
+
|
|
1009
|
+
[ ! -f "$s" ] && exit 0
|
|
1010
|
+
|
|
1011
|
+
{ [ "\${VIS_GIT_HOOKS-}" = "0" ]; } && exit 0
|
|
1012
|
+
|
|
1013
|
+
d=${g3(t)}
|
|
1014
|
+
export PATH="$d/node_modules/.bin:$PATH"
|
|
1015
|
+
sh -e "$s" "$@"
|
|
1016
|
+
c=$?
|
|
1017
|
+
|
|
1018
|
+
[ $c != 0 ] && echo "vis - $n script failed (code $c)"
|
|
1019
|
+
[ $c = 127 ] && echo "vis - command not found in PATH=$PATH"
|
|
1020
|
+
exit $c`},"hookScript"),v3=Ga((e=V1)=>{if(process.env.VIS_GIT_HOOKS==="0")return{isError:!1,message:"skip install (git hooks disabled via VIS_GIT_HOOKS=0)"};if(e.includes(".."))return{isError:!0,message:'".." is not allowed in hooks directory path'};const t=An("git",["rev-parse","--show-prefix"]);if(t.status===null)return{isError:!0,message:"git command not found"};if(t.status!==0)return{isError:!1,message:".git directory not found (not a git repository)"};const r=Ga((c="")=>C(e,"_",c),"internal"),n=t.stdout.toString().trim().replace(h3,""),i=n?`${n}/${e}/_`:`${e}/_`,s=An("git",["config","--local","core.hooksPath"]),o=s.status===0?s.stdout?.toString().trim():"";if(o&&o!==i)return{isError:!1,message:`core.hooksPath is already set to "${o}", skipping`};const{status:a,stderr:l}=An("git",["config","core.hooksPath",i]);if(a===null)return{isError:!0,message:"git command not found"};if(a)return{isError:!0,message:String(l)};Jt(r()),Ve(r(".gitignore"),"*"),Ve(r("h"),y3(e),{mode:493});for(const c of M1)Ve(r(c),`#!/usr/bin/env sh
|
|
1021
|
+
. "$(dirname "$0")/h"`,{mode:493});return{isError:!1,message:""}},"installHooks");var b3=Object.defineProperty,ln=f((e,t)=>b3(e,"name",{value:t,configurable:!0}),"f$9");const $3=[".husky",".config/husky"],w3=/^\. "\$\(dirname "\$0"\)\/common\.sh"\s*/m,k3=ln(e=>{for(const t of $3)if(x(C(e,t))&&Pi(C(e,t)).isDirectory())return t},"detectHuskyDirectory"),S3=ln((e,t)=>{const r=new Map,n=C(e,t),i=new Set(M1);for(const s of Kt(n)){if(s==="_"||s===".gitignore"||s.startsWith("."))continue;const o=C(n,s);Pi(o).isFile()&&(!i.has(s)&&s!=="common.sh"||r.set(s,J(o)))}return r},"readHuskyHooks"),E3=ln(e=>e.replace(w3,""),"transformHookScript"),Y1=ln(e=>x(C(e,"pnpm-lock.yaml"))||x(C(e,"pnpm-workspace.yaml"))?"pnpm":x(C(e,"yarn.lock"))?"yarn":x(C(e,"bun.lockb"))||x(C(e,"bun.lock"))?"bun":"npm","detectPackageManager"),D3=ln((e,t)=>{const r=Y1(e),n={bun:["bun","remove","husky"],npm:["npm","uninstall","husky"],pnpm:["pnpm","remove","husky"],yarn:["yarn","remove","husky"]},[i,...s]=n[r];t.info(`Removing husky package via ${r}...`);const o=An(i,s,{cwd:e,encoding:"utf8",stdio:"pipe"});return o.status!==0?(t.info(`Warning: failed to remove husky via ${r} (${o.stderr?.trim()??"unknown error"})`),!1):!0},"uninstallHuskyPackage"),C3=ln((e,t,r)=>{const n=K1(r);if(n!==r)return n?(e[t]=n,`updated "${t}" script`):(delete e[t],`removed "${t}" script (was: "${r}")`)},"processScript"),A3=ln((e,t)=>{const r=C(e,"package.json");if(!x(r))return{modified:!1,removedScriptReferences:[]};const n=J(r),i=JSON.parse(n),s=[],o=i.scripts;if(o)for(const[a,l]of Object.entries(o)){if(typeof l!="string")continue;const c=C3(o,a,l);c&&s.push(c)}if(s.length>0){const a=br(r,n,{defaultIndent:" ",useEditorconfig:t});Ve(r,`${JSON.stringify(i,void 0,a)}
|
|
1022
|
+
`,"utf8")}return{modified:s.length>0,removedScriptReferences:s}},"cleanPackageJsonScripts"),SZ=ln((e,t,r,n={})=>{const i=k3(e),s=n.dryRun===!0;if(!i)return{isError:!0,message:"No husky installation found (.husky/ or .config/husky/)"};r.info(`Found husky at ${i}/`);const o=S3(e,i);if(o.size===0&&r.info("No user-defined hooks found in husky directory."),!s){const c=An("git",["config","--local","core.hooksPath"]),u=c.status===0?c.stdout?.toString().trim():"";u&&(u===".husky/_"||u.startsWith(".husky"))&&An("git",["config","--local","--unset","core.hooksPath"]);const d=v3(t);if(d.isError)return d;d.message&&r.info(d.message)}const a=C(e,t);s||Jt(a);let l=0;for(const[c,u]of o){if(c==="common.sh"){s?r.info(" (would copy) common.sh"):(Ve(C(a,c),u,{mode:493}),r.info(" Copied common.sh"));continue}if(s)r.info(` (would migrate) ${c}`);else{const d=E3(u);Ve(C(a,c),d,{mode:493}),r.info(` Migrated ${c}`)}l+=1}if(s)r.info(" (would remove) husky npm package and clean package.json scripts"),r.info(` (would remove) ${i}/ directory`);else{D3(e,r);const c=A3(e,n.useEditorconfig);if(c.modified){r.info("Updated package.json scripts:");for(const d of c.removedScriptReferences)r.info(` ${d}`)}const u=C(e,i);Ad(u,{force:!0,recursive:!0}),r.info(`Removed ${i}/`)}return{isError:!1,message:`${s?"would migrate":"Migration complete:"} ${l} hook${l===1?"":"s"} ${s?"from":"migrated from"} ${i}/ to ${t}/`}},"migrateFromHusky");var O3=Object.defineProperty,j3=f((e,t)=>O3(e,"name",{value:t,configurable:!0}),"e$x");const x3={configFiles:["api-extractor.json"],detect:j3(({matchedConfigs:e})=>({targets:{"api-extract":{command:"api-extractor run --local",description:"api-extractor (inferred)",inputs:["{projectRoot}/dist/**/*.d.ts","{projectRoot}/lib/**/*.d.ts",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist/*.api.json","{projectRoot}/etc/*.api.md","{projectRoot}/temp"],type:"build"}}}),"detect"),fallbackDependency:"@microsoft/api-extractor",name:"api-extractor"};var P3=Object.defineProperty,N3=f((e,t)=>P3(e,"name",{value:t,configurable:!0}),"s$l");const R3={configFiles:["astro.config.ts","astro.config.js","astro.config.mjs","astro.config.mts","astro.config.cjs"],detect:N3(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"astro build",description:"astro build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/dist"],type:"build"}};return e&&(n.dev={command:"astro dev",description:"astro dev (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"astro",name:"astro"};var F3=Object.defineProperty,L3=f((e,t)=>F3(e,"name",{value:t,configurable:!0}),"o$q");const I3={configFiles:["biome.json","biome.jsonc"],detect:L3(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"biome format --write .",description:"biome format (inferred)"},lint:{command:"biome check .",description:"biome check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"@biomejs/biome",name:"biome"};var T3=Object.defineProperty,B3=f((e,t)=>T3(e,"name",{value:t,configurable:!0}),"o$p");const _3={configFiles:["bunfig.toml"],detect:B3(({matchedConfigs:e})=>({targets:{test:{command:"bun test",description:"bun test (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"test"}}}),"detect"),name:"bun"};var M3=Object.defineProperty,V3=f((e,t)=>M3(e,"name",{value:t,configurable:!0}),"e$w");const W3={configFiles:[".changeset/config.json"],detect:V3(()=>({targets:{"changeset:publish":{command:"changeset publish",description:"changeset publish (inferred)"},"changeset:status":{command:"changeset status",description:"changeset status (inferred)"},"changeset:version":{command:"changeset version",description:"changeset version (inferred)"}}}),"detect"),name:"changeset"};var U3=Object.defineProperty,G3=f((e,t)=>U3(e,"name",{value:t,configurable:!0}),"r$r");const q3={configFiles:["cypress.config.ts","cypress.config.js","cypress.config.mjs","cypress.config.mts","cypress.config.cjs"],detect:G3(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={"test:e2e":{command:"cypress run",description:"cypress run (inferred)",inputs:["{projectRoot}/cypress/**/*","{projectRoot}/e2e/**/*","{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/cypress/screenshots","{projectRoot}/cypress/videos"],type:"test"}};return e&&(n["cypress:open"]={command:"cypress open",description:"cypress open (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"cypress",name:"cypress"};var z3=Object.defineProperty,H3=f((e,t)=>z3(e,"name",{value:t,configurable:!0}),"n$l");const J3={configFiles:["deno.json","deno.jsonc"],detect:H3(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0,r=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...t?[t]:[]];return{targets:{check:{command:"deno check **/*.ts",description:"deno check (inferred)",inputs:r,outputs:[],type:"build"},fmt:{command:"deno fmt",description:"deno fmt (inferred)"},lint:{command:"deno lint",description:"deno lint (inferred)",inputs:r,outputs:[],type:"build"},test:{command:"deno test",description:"deno test (inferred)",inputs:r,outputs:[],type:"test"}}}},"detect"),name:"deno"};var K3=Object.defineProperty,Y3=f((e,t)=>K3(e,"name",{value:t,configurable:!0}),"r$q");const X3={configFiles:["docusaurus.config.ts","docusaurus.config.js","docusaurus.config.mjs","docusaurus.config.mts","docusaurus.config.cjs"],detect:Y3(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"docusaurus build",description:"docusaurus build (inferred)",inputs:["{projectRoot}/blog/**/*","{projectRoot}/docs/**/*","{projectRoot}/src/**/*","{projectRoot}/static/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/build"],type:"build"}};return e&&(n.start={command:"docusaurus start",description:"docusaurus start (inferred)",preset:"server"},n.serve={command:"docusaurus serve",description:"docusaurus serve (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"@docusaurus/core",name:"docusaurus"};var Q3=Object.defineProperty,Z3=f((e,t)=>Q3(e,"name",{value:t,configurable:!0}),"r$p");const e8={configFiles:["drizzle.config.ts","drizzle.config.js","drizzle.config.mjs","drizzle.config.mts","drizzle.config.cjs"],detect:Z3(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"db:generate":{command:"drizzle-kit generate",description:"drizzle-kit generate (inferred)",inputs:["{projectRoot}/src/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/drizzle"],type:"build"},"db:migrate":{command:"drizzle-kit migrate",description:"drizzle-kit migrate (inferred)"},"db:push":{command:"drizzle-kit push",description:"drizzle-kit push (inferred)"},"db:studio":{command:"drizzle-kit studio",description:"drizzle-kit studio (inferred)",preset:"server"}}}},"detect"),fallbackDependency:"drizzle-kit",name:"drizzle"};var t8=Object.defineProperty,r8=f((e,t)=>t8(e,"name",{value:t,configurable:!0}),"o$n");const n8={configFiles:["eslint.config.ts","eslint.config.js","eslint.config.mjs","eslint.config.mts","eslint.config.cjs",".eslintrc.json",".eslintrc.js",".eslintrc.cjs",".eslintrc"],detect:r8(({matchedConfigs:e})=>({targets:{lint:{command:"eslint .",description:"eslint . (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"eslint",name:"eslint"};var i8=Object.defineProperty,s8=f((e,t)=>i8(e,"name",{value:t,configurable:!0}),"r$o");const o8={configFiles:["gatsby-config.ts","gatsby-config.js","gatsby-config.mjs","gatsby-config.mts","gatsby-config.cjs"],detect:s8(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"gatsby build",description:"gatsby build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/static/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/gatsby-node.js","{projectRoot}/gatsby-node.ts","{projectRoot}/gatsby-browser.js","{projectRoot}/gatsby-ssr.js"],outputs:["{projectRoot}/public","{projectRoot}/.cache"],type:"build"}};return e&&(n.develop={command:"gatsby develop",description:"gatsby develop (inferred)",preset:"server"},n.serve={command:"gatsby serve",description:"gatsby serve (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"gatsby",name:"gatsby"};var a8=Object.defineProperty,c8=f((e,t)=>a8(e,"name",{value:t,configurable:!0}),"c$l");const l8={configFiles:["codegen.ts","codegen.js","codegen.mjs","codegen.mts","codegen.cjs","codegen.yml","codegen.yaml","codegen.json",".graphqlrc",".graphqlrc.json",".graphqlrc.yml",".graphqlrc.yaml",".graphqlrc.ts",".graphqlrc.js"],detect:c8(({matchedConfigs:e})=>({targets:{codegen:{command:"graphql-codegen",description:"graphql-codegen (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/schema/**/*","{projectRoot}/**/*.graphql","{projectRoot}/**/*.gql",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:["{projectRoot}/src/generated","{projectRoot}/src/__generated__","{projectRoot}/src/gql"],type:"build"}}}),"detect"),fallbackDependency:"@graphql-codegen/cli",name:"graphql-codegen"};var u8=Object.defineProperty,p8=f((e,t)=>u8(e,"name",{value:t,configurable:!0}),"c$k");const d8={configFiles:["jest.config.ts","jest.config.js","jest.config.mjs","jest.config.mts","jest.config.cjs","jest.config.json"],detect:p8(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={test:{command:"jest",description:"jest (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/coverage"],type:"test"}};return e&&(n["test:watch"]={command:"jest --watch",description:"jest watch mode (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"jest",name:"jest"};var f8=Object.defineProperty,m8=f((e,t)=>f8(e,"name",{value:t,configurable:!0}),"n$k");const h8={configFiles:["knip.config.ts","knip.config.js","knip.config.mjs","knip.config.mts","knip.config.cjs","knip.json","knip.jsonc",".knip.json",".knip.jsonc"],detect:m8(({matchedConfigs:e})=>({targets:{knip:{command:"knip",description:"knip (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"knip",name:"knip"};var g8=Object.defineProperty,y8=f((e,t)=>g8(e,"name",{value:t,configurable:!0}),"s$i");const v8={configFiles:["nest-cli.json"],detect:y8(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"nest build",description:"nest build (inferred)",inputs:["{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json","{projectRoot}/tsconfig.build.json"],outputs:["{projectRoot}/dist"],type:"build"}};return e&&(n.start={command:"nest start",description:"nest start (inferred)",preset:"server"},n["start:dev"]={command:"nest start --watch",description:"nest start --watch (inferred)",preset:"server"}),{targets:n}},"detect"),name:"nest"};var b8=Object.defineProperty,$8=f((e,t)=>b8(e,"name",{value:t,configurable:!0}),"r$l");const w8={configFiles:["next.config.ts","next.config.js","next.config.mjs","next.config.mts","next.config.cjs"],detect:$8(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"next build",description:"next build (inferred)",inputs:["{projectRoot}/app/**/*","{projectRoot}/pages/**/*","{projectRoot}/src/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/.next","!{projectRoot}/.next/cache"],type:"build"}};return e&&(n.dev={command:"next dev",description:"next dev (inferred)",preset:"server"},n.start={command:"next start",description:"next start (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"next",name:"next"};var k8=Object.defineProperty,S8=f((e,t)=>k8(e,"name",{value:t,configurable:!0}),"c$i");const E8={configFiles:["nuxt.config.ts","nuxt.config.js","nuxt.config.mjs","nuxt.config.mts","nuxt.config.cjs"],detect:S8(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n=["{projectRoot}/app/**/*","{projectRoot}/components/**/*","{projectRoot}/composables/**/*","{projectRoot}/layouts/**/*","{projectRoot}/pages/**/*","{projectRoot}/plugins/**/*","{projectRoot}/public/**/*","{projectRoot}/server/**/*","{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],i={build:{command:"nuxt build",description:"nuxt build (inferred)",inputs:n,outputs:["{projectRoot}/.output","{projectRoot}/.nuxt"],type:"build"},generate:{command:"nuxt generate",description:"nuxt generate static site (inferred)",inputs:n,outputs:["{projectRoot}/.output","{projectRoot}/dist"],type:"build"}};return e&&(i.dev={command:"nuxt dev",description:"nuxt dev (inferred)",preset:"server"},i.preview={command:"nuxt preview",description:"nuxt preview (inferred)",preset:"server"}),{targets:i}},"detect"),fallbackDependency:"nuxt",name:"nuxt"};var D8=Object.defineProperty,C8=f((e,t)=>D8(e,"name",{value:t,configurable:!0}),"e$u");const A8={configFiles:[".oxfmtrc.json",".oxfmtrc.jsonc","oxfmt.config.ts","oxfmt.config.js","oxfmt.config.mjs","oxfmt.config.mts","oxfmt.config.cjs"],detect:C8(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"oxfmt",description:"oxfmt (inferred)"},"format:check":{command:"oxfmt --check",description:"oxfmt --check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"oxfmt",name:"oxfmt"};var O8=Object.defineProperty,j8=f((e,t)=>O8(e,"name",{value:t,configurable:!0}),"e$t");const x8={configFiles:[".oxlintrc.json","oxlint.json"],detect:j8(({matchedConfigs:e})=>({targets:{lint:{command:"oxlint",description:"oxlint (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"oxlint",name:"oxlint"};var P8=Object.defineProperty,N8=f((e,t)=>P8(e,"name",{value:t,configurable:!0}),"c$h");const R8={configFiles:["packem.config.ts","packem.config.js","packem.config.mjs","packem.config.mts","packem.config.cjs"],detect:N8(({matchedConfigs:e})=>({targets:{build:{command:"packem build",description:"@visulima/packem build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"packem.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"@visulima/packem",name:"packem"};var F8=Object.defineProperty,L8=f((e,t)=>F8(e,"name",{value:t,configurable:!0}),"o$l");const I8={configFiles:["playwright.config.ts","playwright.config.js","playwright.config.mjs","playwright.config.mts","playwright.config.cjs"],detect:L8(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"test:e2e":{command:"playwright test",description:"playwright test (inferred)",inputs:["{projectRoot}/e2e/**/*","{projectRoot}/tests/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/src/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/playwright-report","{projectRoot}/test-results"],type:"test"}}}},"detect"),fallbackDependency:"@playwright/test",name:"playwright"};var T8=Object.defineProperty,B8=f((e,t)=>T8(e,"name",{value:t,configurable:!0}),"r$i");const _8={configFiles:["prettier.config.ts","prettier.config.js","prettier.config.mjs","prettier.config.mts","prettier.config.cjs",".prettierrc",".prettierrc.json",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.yml",".prettierrc.yaml"],detect:B8(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"prettier --write .",description:"prettier --write (inferred)"},"format:check":{command:"prettier --check .",description:"prettier --check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"prettier",name:"prettier"};var M8=Object.defineProperty,V8=f((e,t)=>M8(e,"name",{value:t,configurable:!0}),"t$m");const W8={configFiles:["prisma/schema.prisma","schema.prisma"],detect:V8(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"db:generate":{command:"prisma generate",description:"prisma generate (inferred)",inputs:[...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/node_modules/.prisma","{projectRoot}/node_modules/@prisma/client"],type:"build"},"db:migrate":{command:"prisma migrate dev",description:"prisma migrate dev (inferred)"},"db:push":{command:"prisma db push",description:"prisma db push (inferred)"},"db:studio":{command:"prisma studio",description:"prisma studio (inferred)",preset:"server"}}}},"detect"),fallbackDependency:"prisma",name:"prisma"};var U8=Object.defineProperty,G8=f((e,t)=>U8(e,"name",{value:t,configurable:!0}),"o$k");const q8={configFiles:["remix.config.ts","remix.config.js","remix.config.mjs","remix.config.cjs"],detect:G8(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"remix vite:build",description:"remix build (inferred)",inputs:["{projectRoot}/app/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/build"],type:"build"}};return e&&(n.dev={command:"remix vite:dev",description:"remix dev (inferred)",preset:"server"},n.start={command:"remix-serve ./build/server/index.js",description:"remix-serve (inferred)",preset:"server"}),{targets:n}},"detect"),name:"remix"};var z8=Object.defineProperty,H8=f((e,t)=>z8(e,"name",{value:t,configurable:!0}),"t$l");const J8={configFiles:["rolldown.config.ts","rolldown.config.js","rolldown.config.mjs","rolldown.config.mts","rolldown.config.cjs"],detect:H8(({matchedConfigs:e})=>({targets:{build:{command:"rolldown -c",description:"rolldown build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"rolldown"};var K8=Object.defineProperty,Y8=f((e,t)=>K8(e,"name",{value:t,configurable:!0}),"t$k");const X8={configFiles:["rollup.config.ts","rollup.config.js","rollup.config.mjs","rollup.config.mts","rollup.config.cjs"],detect:Y8(({matchedConfigs:e})=>({targets:{build:{command:"rollup -c",description:"rollup build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"rollup"};var Q8=Object.defineProperty,Z8=f((e,t)=>Q8(e,"name",{value:t,configurable:!0}),"r$h");const e9={configFiles:[".storybook/main.ts",".storybook/main.js",".storybook/main.mjs",".storybook/main.mts",".storybook/main.cjs"],detect:Z8(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"build-storybook":{command:"storybook build",description:"storybook build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/.storybook/**/*","{projectRoot}/stories/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/storybook-static"],type:"build"},storybook:{command:"storybook dev -p 6006",description:"storybook dev (inferred)",preset:"server"}}}},"detect"),name:"storybook"};var t9=Object.defineProperty,r9=f((e,t)=>t9(e,"name",{value:t,configurable:!0}),"e$p");const n9={configFiles:["stylelint.config.ts","stylelint.config.js","stylelint.config.mjs","stylelint.config.cjs",".stylelintrc",".stylelintrc.json",".stylelintrc.js",".stylelintrc.cjs",".stylelintrc.yml",".stylelintrc.yaml"],detect:r9(({matchedConfigs:e})=>({targets:{"lint:css":{command:'stylelint "**/*.{css,scss,sass,less,vue,svelte,astro}"',description:"stylelint (inferred)",inputs:["{projectRoot}/src/**/*.css","{projectRoot}/src/**/*.scss","{projectRoot}/src/**/*.sass","{projectRoot}/src/**/*.less","{projectRoot}/src/**/*.vue","{projectRoot}/src/**/*.svelte","{projectRoot}/src/**/*.astro",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"stylelint",name:"stylelint"};var i9=Object.defineProperty,s9=f((e,t)=>i9(e,"name",{value:t,configurable:!0}),"o$i");const o9={configFiles:["tsdown.config.ts","tsdown.config.js","tsdown.config.mjs","tsdown.config.mts","tsdown.config.cjs"],detect:s9(({matchedConfigs:e})=>({targets:{build:{command:"tsdown",description:"tsdown build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"tsdown.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"tsdown",name:"tsdown"};var a9=Object.defineProperty,c9=f((e,t)=>a9(e,"name",{value:t,configurable:!0}),"o$h");const l9={configFiles:["tsup.config.ts","tsup.config.js","tsup.config.mjs","tsup.config.mts","tsup.config.cjs"],detect:c9(({matchedConfigs:e})=>({targets:{build:{command:"tsup",description:"tsup build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"tsup.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"tsup",name:"tsup"};var u9=Object.defineProperty,p9=f((e,t)=>u9(e,"name",{value:t,configurable:!0}),"e$n");const d9={configFiles:["typedoc.json","typedoc.jsonc","typedoc.config.ts","typedoc.config.js","typedoc.config.mjs","typedoc.config.mts","typedoc.config.cjs"],detect:p9(({matchedConfigs:e})=>({targets:{docs:{command:"typedoc",description:"typedoc (inferred)",inputs:["{projectRoot}/src/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/docs"],type:"build"}}}),"detect"),fallbackDependency:"typedoc",name:"typedoc"};var f9=Object.defineProperty,m9=f((e,t)=>f9(e,"name",{value:t,configurable:!0}),"e$m");const h9={configFiles:["tsconfig.json","tsconfig.build.json"],detect:m9(({matchedConfigs:e})=>({targets:{typecheck:{command:"tsc --noEmit",description:"tsc --noEmit (inferred)",inputs:["{projectRoot}/src/**/*.ts","{projectRoot}/src/**/*.tsx","{projectRoot}/__tests__/**/*.ts","{projectRoot}/__tests__/**/*.tsx","{projectRoot}/test/**/*.ts","{projectRoot}/tests/**/*.ts",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"typescript",name:"typescript"};var g9=Object.defineProperty,y9=f((e,t)=>g9(e,"name",{value:t,configurable:!0}),"t$j");const v9={configFiles:["vite.config.ts","vite.config.js","vite.config.mjs","vite.config.mts","vite.config.cjs"],detect:y9(({matchedConfigs:e})=>({targets:{build:{command:"vite build",description:"vite production build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json"],outputs:["{projectRoot}/dist"],type:"build"},dev:{command:"vite",description:"vite dev server (inferred)",preset:"server"},preview:{command:"vite preview",description:"vite preview server (inferred)",preset:"server"}}}),"detect"),name:"vite"};var b9=Object.defineProperty,$9=f((e,t)=>b9(e,"name",{value:t,configurable:!0}),"r$f");const w9={configFiles:[".vitepress/config.ts",".vitepress/config.js",".vitepress/config.mjs",".vitepress/config.mts",".vitepress/config.cjs","docs/.vitepress/config.ts","docs/.vitepress/config.js","docs/.vitepress/config.mjs","docs/.vitepress/config.mts","docs/.vitepress/config.cjs"],detect:$9(({matchedConfigs:e})=>{const t=e[0]?.startsWith("docs/"),r=t?"docs":".",n=e[0]?`{projectRoot}/${e[0]}`:void 0,i=["{projectRoot}/.vitepress/**/*","{projectRoot}/docs/**/*",...n?[n]:[],"{projectRoot}/package.json"];return{targets:{"docs:build":{command:`vitepress build ${r}`,description:"vitepress build (inferred)",inputs:i,outputs:[`{projectRoot}/${t?"docs/":""}.vitepress/dist`],type:"build"},"docs:dev":{command:`vitepress dev ${r}`,description:"vitepress dev (inferred)",preset:"server"},"docs:preview":{command:`vitepress preview ${r}`,description:"vitepress preview (inferred)",preset:"server"}}}},"detect"),name:"vitepress"};var k9=Object.defineProperty,S9=f((e,t)=>k9(e,"name",{value:t,configurable:!0}),"c$d");const E9={configFiles:["vitest.config.ts","vitest.config.js","vitest.config.mjs","vitest.config.mts","vitest.config.cjs"],detect:S9(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={test:{command:"vitest run",description:"vitest run (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/coverage"],type:"test"}};return e&&(n["test:watch"]={command:"vitest",description:"vitest watch mode (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"vitest",name:"vitest"};var D9=Object.defineProperty,C9=f((e,t)=>D9(e,"name",{value:t,configurable:!0}),"t$i");const A9={configFiles:["webpack.config.ts","webpack.config.js","webpack.config.mjs","webpack.config.mts","webpack.config.cjs"],detect:C9(({matchedConfigs:e})=>({targets:{build:{command:"webpack --mode=production",description:"webpack production build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"webpack"};var O9=Object.defineProperty,Xf=f((e,t)=>O9(e,"name",{value:t,configurable:!0}),"n$h");const Qf=[E8,w8,q8,R3,o8,X3,v9,w9,v8,J8,o9,l9,R8,X8,A9,E9,d8,_3,I8,q3,e9,h9,d9,n8,_8,I3,x8,A8,n9,h8,J3,W8,e8,l8,x3,W3],j9=Xf((e,t)=>e.dependencies!==void 0&&Object.hasOwn(e.dependencies,t)||e.devDependencies!==void 0&&Object.hasOwn(e.devDependencies,t)||e.peerDependencies!==void 0&&Object.hasOwn(e.peerDependencies,t)||e.optionalDependencies!==void 0&&Object.hasOwn(e.optionalDependencies,t),"hasDependency"),x9=Xf((e,t)=>{const r=[];for(const n of t)rc(C(e,n))&&r.push(n);return r},"matchConfigFiles"),P9=Xf((e,t=Qf)=>{const r={},n=[];for(const i of t){const s=x9(e.projectRoot,i.configFiles),o=i.fallbackDependency!==void 0&&j9(e.pkg,i.fallbackDependency);if(s.length===0&&!o)continue;const a=i.detect({...e,hasConfigFile:s.length>0,matchedConfigs:s});let l=!1;for(const[c,u]of Object.entries(a.targets))r[c]===void 0&&(r[c]=u,l=!0);l&&n.push(i.name)}return{sources:n,targets:r}},"inferProjectTargets");var N9=Object.defineProperty,$r=f((e,t)=>N9(e,"name",{value:t,configurable:!0}),"s$e");const R9={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},F9=$r(e=>{const t=e.preset??e.options?.preset;if(!t)return e;const r=R9[t];if(!r)return e;const{cache:n,...i}=r;return{...e,cache:e.cache??n,options:{...i,...e.options}}},"applyPreset"),L9=$r(()=>{const e=Od();return e==="darwin"?"macos":e==="win32"?"windows":"linux"},"detectCurrentOs"),EZ=$r((e,t)=>{if(!t||t.size===0)return!0;const r=e?.runnerTags;return!r||r.length===0?!0:r.some(n=>t.has(n))},"matchesRunnerTags"),DZ=$r((e,t,r=!0)=>{const n=e?.runInCI??!0;return n===!0||n==="always"?!0:n===!1?!t:n==="affected"?!t||r:!0},"shouldRunInCI"),CZ=$r((e,t,r)=>r||!t?e:t.startsWith("/")?t:`${e}/${t}`,"resolveTaskCwd"),AZ=$r((e,t)=>{if(t===!1)return{};const r=t===!0?I9("production"):Array.isArray(t)?t:[t],n={};for(const i of r)Object.assign(n,T9(e,i));return n},"loadEnvFile"),I9=$r(e=>{const t=[".env"];return e&&t.push(`.env.${e}`),e!=="test"&&t.push(".env.local"),e&&e!=="test"&&t.push(`.env.${e}.local`),t},"resolveEnvCascade"),T9=$r((e,t)=>{const r=t.startsWith("/")?t:C(e,t);if(!x(r))return{};let n;try{n=J(r)}catch{return{}}const i={};for(const s of n.split(/\r?\n/)){const o=s.trim();if(o===""||o.startsWith("#"))continue;const a=o.indexOf("=");if(a===-1)continue;const l=o.slice(0,a).trim();if(l==="")continue;let c=o.slice(a+1).trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),i[l]=c}return i},"loadSingleEnvFile"),OZ=$r((e,t=L9())=>{if(e)return t==="windows"&&e.windowsShell?e.windowsShell:(t==="linux"||t==="macos")&&e.unixShell?e.unixShell:e.shell},"resolveTargetShell"),B9=$r(e=>{if(e==="run")return!1;if(e==="build"||e==="test")return!0},"defaultCacheForType");var gu={exports:{}},Wg;function _9(){return Wg||(Wg=1,(function(e){var t=Object.defineProperty,r=f((B,F)=>t(B,"name",{value:F,configurable:!0}),"i");function n(B){return Array.isArray(B)?B:[B]}f(n,"makeArray"),r(n,"makeArray");const i=void 0,s="",o=" ",a="\\",l=/^\s+$/,c=/(?:[^\\]|^)\\$/,u=/^\\!/,d=/^\\#/,p=/\r?\n/g,m=/^\.{0,2}\/|^\.{1,2}$/,g=/\/$/,$="/";let S="node-ignore";typeof Symbol<"u"&&(S=Symbol.for("node-ignore"));const k=S,v=r((B,F,V)=>(Object.defineProperty(B,F,{value:V}),V),"define"),h=/([0-z])-([0-z])/g,b=r(()=>!1,"RETURN_FALSE"),w=r(B=>B.replace(h,(F,V,ne)=>V.charCodeAt(0)<=ne.charCodeAt(0)?F:s),"sanitizeRange"),y=r(B=>{const{length:F}=B;return B.slice(0,F-F%2)},"cleanRangeBackSlash"),D=[[/^\uFEFF/,()=>s],[/((?:\\\\)*?)(\\?\s+)$/,(B,F,V)=>F+(V.indexOf("\\")===0?o:s)],[/(\\+?)\s/g,(B,F)=>{const{length:V}=F;return F.slice(0,V-V%2)+o}],[/[\\$.|*+(){^]/g,B=>`\\${B}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,r(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(B,F,V)=>F+6<V.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(B,F,V)=>{const ne=V.replace(/\\\*/g,"[^\\/]*");return F+ne}],[/\\\\\\(?=[$.|*+(){^])/g,()=>a],[/\\\\/g,()=>a],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(B,F,V,ne,le)=>F===a?`\\[${V}${y(ne)}${le}`:le==="]"&&ne.length%2===0?`[${w(V)}${ne}]`:"[]"],[/(?:[^*])$/,B=>/\/$/.test(B)?`${B}$`:`${B}(?=$|\\/$)`]],E=/(^|\\\/)?\\\*$/,A="regex",j="checkRegex",G="_",W={[A](B,F){return`${F?`${F}[^/]+`:"[^/]*"}(?=$|\\/$)`},[j](B,F){return`${F?`${F}[^/]*`:"[^/]*"}(?=$|\\/$)`}},ce=r(B=>D.reduce((F,[V,ne])=>F.replace(V,ne.bind(B)),B),"makeRegexPrefix"),te=r(B=>typeof B=="string","isString"),Y=r(B=>B&&te(B)&&!l.test(B)&&!c.test(B)&&B.indexOf("#")!==0,"checkPattern"),P=r(B=>B.split(p).filter(Boolean),"splitPattern");class N{static{f(this,"IgnoreRule")}static{r(this,"IgnoreRule")}constructor(F,V,ne,le,$e,it){this.pattern=F,this.mark=V,this.negative=$e,v(this,"body",ne),v(this,"ignoreCase",le),v(this,"regexPrefix",it)}get regex(){const F=G+A;return this[F]?this[F]:this._make(A,F)}get checkRegex(){const F=G+j;return this[F]?this[F]:this._make(j,F)}_make(F,V){const ne=this.regexPrefix.replace(E,W[F]),le=this.ignoreCase?new RegExp(ne,"i"):new RegExp(ne);return v(this,V,le)}}const O=r(({pattern:B,mark:F},V)=>{let ne=!1,le=B;le.indexOf("!")===0&&(ne=!0,le=le.substr(1)),le=le.replace(u,"!").replace(d,"#");const $e=ce(le);return new N(B,F,le,V,ne,$e)},"createRule");class R{static{f(this,"RuleManager")}static{r(this,"RuleManager")}constructor(F){this._ignoreCase=F,this._rules=[]}_add(F){if(F&&F[k]){this._rules=this._rules.concat(F._rules._rules),this._added=!0;return}if(te(F)&&(F={pattern:F}),Y(F.pattern)){const V=O(F,this._ignoreCase);this._added=!0,this._rules.push(V)}}add(F){return this._added=!1,n(te(F)?P(F):F).forEach(this._add,this),this._added}test(F,V,ne){let le=!1,$e=!1,it;this._rules.forEach(Gr=>{const{negative:ms}=Gr;$e===ms&&le!==$e||ms&&!le&&!$e&&!V||!Gr[ne].test(F)||(le=!ms,$e=ms,it=ms?i:Gr)});const Ct={ignored:le,unignored:$e};return it&&(Ct.rule=it),Ct}}const _=r((B,F)=>{throw new F(B)},"throwError"),L=r((B,F,V)=>te(B)?B?L.isNotRelative(B)?V(`path should be a \`path.relative()\`d string, but got "${F}"`,RangeError):!0:V("path must not be empty",TypeError):V(`path must be a string, but got \`${F}\``,TypeError),"checkPath"),T=r(B=>m.test(B),"isNotRelative");L.isNotRelative=T,L.convert=B=>B;class U{static{f(this,"Ignore")}static{r(this,"Ignore")}constructor({ignorecase:F=!0,ignoreCase:V=F,allowRelativePaths:ne=!1}={}){v(this,k,!0),this._rules=new R(V),this._strictPathCheck=!ne,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(F){return this._rules.add(F)&&this._initCache(),this}addPattern(F){return this.add(F)}_test(F,V,ne,le){const $e=F&&L.convert(F);return L($e,F,this._strictPathCheck?_:b),this._t($e,V,ne,le)}checkIgnore(F){if(!g.test(F))return this.test(F);const V=F.split($).filter(Boolean);if(V.pop(),V.length){const ne=this._t(V.join($)+$,this._testCache,!0,V);if(ne.ignored)return ne}return this._rules.test(F,!1,j)}_t(F,V,ne,le){if(F in V)return V[F];if(le||(le=F.split($).filter(Boolean)),le.pop(),!le.length)return V[F]=this._rules.test(F,ne,A);const $e=this._t(le.join($)+$,V,ne,le);return V[F]=$e.ignored?$e:this._rules.test(F,ne,A)}ignores(F){return this._test(F,this._ignoreCache,!1).ignored}createFilter(){return F=>!this.ignores(F)}filter(F){return n(F).filter(this.createFilter())}test(F){return this._test(F,this._testCache,!0)}}const q=r(B=>new U(B),"factory"),X=r(B=>L(B&&L.convert(B),B,b),"isPathValid"),Q=r(()=>{const B=r(V=>/^\\\\\?\\/.test(V)||/["<>|\u0000-\u001F]+/u.test(V)?V:V.replace(/\\/g,"/"),"makePosix");L.convert=B;const F=/^[a-z]:\//i;L.isNotRelative=V=>F.test(V)||T(V)},"setupWindows");process.platform==="win32"&&Q(),e.exports=q,q.default=q,e.exports.isPathValid=X,v(e.exports,Symbol.for("setupWindows"),Q)})(gu)),gu.exports}f(_9,"requireIgnore");var M9=_9();const Ug=fc(M9);var V9=Object.defineProperty,Yr=f((e,t)=>V9(e,"name",{value:t,configurable:!0}),"i$f");const W9=Ug.default??Ug,U9=[".git/","node_modules/"],G9=/\/+$/,Gg=Yr(e=>{try{return JE(e,"utf8")}catch{return}},"safeRead"),q9=Yr(e=>e.replaceAll("\\","/"),"toForwardSlashes"),jZ=Yr(e=>{if(!e||e.length===0)return[];const t=[];for(const r of e){const n=r.replace(G9,"");if(n.startsWith("!")){const i=n.slice(1);i.length>0&&t.push(i)}}return t},"extractWorkspaceExcludePatterns"),z9=Yr(e=>{const{cwd:t}=e,r=W9();if(e.builtinExcludes!==!1&&r.add(U9),e.rootGitignore!==!1){const s=Gg(ht(t,".gitignore"));s!==void 0&&r.add(s)}for(const s of e.extraIgnoreFiles??[]){const o=ja(s)?s:ht(t,s),a=Gg(o);a!==void 0&&r.add(a)}e.extraPatterns&&e.extraPatterns.length>0&&r.add(e.extraPatterns);const n=Yr(s=>{const o=s.endsWith("/")||s.endsWith("\\"),a=ja(s)?s:ht(t,s),l=q9(ho(t,a));return l===""||l.startsWith("../")||l===".."?!1:r.ignores(o?`${l}/`:l)},"ignores"),i={add:Yr(s=>(r.add(s),i),"add"),filter:Yr(s=>s.filter(o=>!n(o)),"filter"),filterDirectories:Yr(s=>s.filter(o=>!n(o.endsWith("/")||o.endsWith("\\")?o:`${o}/`)),"filterDirectories"),ignores:n};return i},"buildGitignoreMatcher"),na=0,Sr=1,xs=2,Er=3;var H9=Object.defineProperty,J9=f((e,t)=>H9(e,"name",{value:t,configurable:!0}),"p$g"),K9=Object.defineProperty,Y9=J9((e,t)=>K9(e,"name",{value:t,configurable:!0}),"C"),X9=Object.defineProperty,qa=Y9((e,t)=>X9(e,"name",{value:t,configurable:!0}),"u");const Q9=/^-{1,2}(no-color|no-colors|color=false|color=never)$/,Z9=/^-{1,2}(color=256)$/,eM=/^-{1,2}(color=16m|color=full|color=truecolor)$/,tM=/^-{1,2}(color|colors|color=true|color=always)$/,rM=/-mono|dumb/i,nM=/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/,iM=/-256(color)?$/i,sM=/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i,X1=qa(e=>{const t=globalThis,r=t.Deno!=null,n=t.process??t.Deno??{},i=n.argv??n.args??[],s=qa($=>{const S=i.indexOf("--"),k=i.findIndex(v=>$.test(v));return k!==-1&&(S===-1||k<S)},"oneOfFlags");let o={};try{o=r?n.env.toObject():n.env??{}}catch{}const a="FORCE_COLOR",l=a in o,c=o[a]??void 0,u=Object.prototype.toString.call(c).slice(8,-1)==="String",d=typeof c=="number";let p;if(c==="true"?p=Sr:c==="false"?p=na:u&&c.length===0?p=Sr:u&&c.length>0?p=Math.min(Number.parseInt(c,10),3):d&&(p=Math.min(c,3)),c!=="true"&&c!=="false"&&p!==void 0&&p<4)return p;if("NO_COLOR"in o||l&&p===0||s(Q9))return na;if(s(Z9))return xs;if(s(eM))return Er;if(s(tM))return Sr;const m=p??na;if("TF_BUILD"in o&&"AGENT_NAME"in o)return Sr;if(o.TERM&&rM.test(o.TERM))return m;if((r?t.Deno.build.os:n.platform)==="win32")try{const $=(r?t.Deno.osRelease():n.os.release()).split(".");return Number($[0])>=10&&Number($[2])>=10586?Number($[2])>=14931?Er:xs:Sr}catch{}if("CI"in o)return["GITEA_ACTIONS","CIRCLECI","GITHUB_WORKFLOW","GITHUB_ACTIONS"].some($=>$ in o)?Er:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some($=>$ in o)||o.CI_NAME==="codeship"?Sr:m;if(o.TERMINAL_EMULATOR?.includes("JediTerm"))return Er;if("TEAMCITY_VERSION"in o)return nM.test(o.TEAMCITY_VERSION)?Sr:na;if(o.COLORTERM==="truecolor"||o.TERM==="xterm-kitty"||o.TERM==="xterm-ghostty"||o.TERM==="wezterm")return Er;if("TERM_PROGRAM"in o){const $=Number.parseInt((o.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(o.TERM_PROGRAM==="iTerm.app")return $>=3?Er:xs;if(o.TERM_PROGRAM==="Apple_Terminal")return xs}if(iM.test(o.TERM))return xs;let g;return r?g=e==="out"?t.Deno.stdout.isTerminal():t.Deno.stderr.isTerminal():"PM2_HOME"in o&&"pm_id"in o?g=!0:g=n[`std${e}`]&&"isTTY"in n[`std${e}`],g&&sM.test(o.TERM)||"COLORTERM"in o?Sr:m},"isColorSupportedFactory"),oM=qa(()=>X1("out"),"isStdoutColorSupported");qa(()=>X1("err"),"isStderrColorSupported");var aM=Object.defineProperty,Q1=f((e,t)=>aM(e,"name",{value:t,configurable:!0}),"B$c"),cM=Object.defineProperty,un=Q1((e,t)=>cM(e,"name",{value:t,configurable:!0}),"u"),lM=Object.defineProperty,uM=un((e,t)=>lM(e,"name",{value:t,configurable:!0}),"e$1");function _c({onlyFirst:e=!1}={}){const t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,e?void 0:"g")}f(_c,"x$k");Q1(_c,"N");un(_c,"t$1");uM(_c,"ansiRegex");var pM=Object.defineProperty,dM=un((e,t)=>pM(e,"name",{value:t,configurable:!0}),"n$1");const zr=dM((e,t,r)=>t>e?t:Math.min(e,r),"clamp");var fM=Object.defineProperty,mM=un((e,t)=>fM(e,"name",{value:t,configurable:!0}),"a$1");const hM=/([a-f\d]{3,6})/i,gM=mM(e=>{let[,t]=hM.exec(e)??[];const r=t?t.length:0;if(r===3){const i=t.charAt(0),s=t.charAt(1),o=t.charAt(2);t=i+i+s+s+o+o}else if(r!==6)return[0,0,0];const n=Number.parseInt(t,16);return[n>>16&255,n>>8&255,n&255]},"convertHexToRgb");var yM=Object.defineProperty,Zf=un((e,t)=>yM(e,"name",{value:t,configurable:!0}),"e");const Z1=Zf((e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/51)+6*Math.round(t/51)+Math.round(r/51),"rgbToAnsi256"),Jp=Zf(e=>{let t,r,n;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)t=r=n=((e-232)*10+8)/255;else{e-=16;const o=e%36;t=Math.floor(e/36)/5,r=Math.floor(o/6)/5,n=o%6/5}const i=Math.max(t,r,n)*2;if(i===0)return 30;const s=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return i===2?s+60:s},"ansi256To16"),qg=Zf((e,t,r)=>Jp(Z1(e,t,r)),"rgbToAnsi16");var vM=Object.defineProperty,$t=un((e,t)=>vM(e,"name",{value:t,configurable:!0}),"b");const _e=39,Me=49,zg=10,Kp=oM(),ek={close:"",open:""},Z=Kp>0?(e,t)=>({close:`\x1B[${String(t)}m`,open:`\x1B[${String(e)}m`}):()=>ek,Hg=$t(e=>(t,r,n)=>e(Z1(Number(t),Number(r),Number(n))),"createRgbFunction"),Jg=$t(e=>t=>{const[r,n,i]=gM(t);return e(r,n,i)},"createHexFunction");let Yp=$t(e=>Z(`38;5;${String(e)}`,_e),"createAnsi256"),Xp=$t(e=>Z(`48;5;${String(e)}`,Me),"createBgAnsi256"),za=$t((e,t,r)=>Z(`38;2;${String(e)};${String(t)};${String(r)}`,_e),"createRgb"),Ha=$t((e,t,r)=>Z(`48;2;${String(e)};${String(t)};${String(r)}`,Me),"createBgRgb");Kp===1?(Yp=$t(e=>Z(Jp(Number(e)),_e),"createAnsi256"),Xp=$t(e=>Z(Jp(Number(e))+zg,Me),"createBgAnsi256"),za=$t((e,t,r)=>Z(qg(Number(e),Number(t),Number(r)),_e),"createRgb"),Ha=$t((e,t,r)=>Z(qg(Number(e),Number(t),Number(r))+zg,Me),"createBgRgb")):Kp===2&&(za=Hg(Yp),Ha=Hg(Xp));const Kg={bold:Z(1,22),dim:Z(2,22),hidden:Z(8,28),inverse:Z(7,27),italic:Z(3,23),overline:Z(53,55),reset:Z(0,0),strike:Z(9,29),strikethrough:Z(9,29),underline:Z(4,24),visible:ek},Yg={bgBlack:Z(40,Me),bgBlackBright:Z(100,Me),bgBlue:Z(44,Me),bgBlueBright:Z(104,Me),bgCyan:Z(46,Me),bgCyanBright:Z(106,Me),bgGray:Z(100,Me),bgGreen:Z(42,Me),bgGreenBright:Z(102,Me),bgGrey:Z(100,Me),bgMagenta:Z(45,Me),bgMagentaBright:Z(105,Me),bgRed:Z(41,Me),bgRedBright:Z(101,Me),bgWhite:Z(47,Me),bgWhiteBright:Z(107,Me),bgYellow:Z(43,Me),bgYellowBright:Z(103,Me),black:Z(30,_e),blackBright:Z(90,_e),blue:Z(34,_e),blueBright:Z(94,_e),cyan:Z(36,_e),cyanBright:Z(96,_e),gray:Z(90,_e),green:Z(32,_e),greenBright:Z(92,_e),grey:Z(90,_e),magenta:Z(35,_e),magentaBright:Z(95,_e),red:Z(31,_e),redBright:Z(91,_e),white:Z(37,_e),whiteBright:Z(97,_e),yellow:Z(33,_e),yellowBright:Z(93,_e)},Xg={bg:$t(e=>Xp(zr(e,0,255)),"bg"),bgHex:Jg(Ha),bgRgb:$t((e,t,r)=>Ha(zr(e,0,255),zr(t,0,255),zr(r,0,255)),"bgRgb"),fg:$t(e=>Yp(zr(e,0,255)),"fg"),hex:Jg(za),rgb:$t((e,t,r)=>za(zr(e,0,255),zr(t,0,255),zr(r,0,255)),"rgb")};var bM=Object.defineProperty,$M=un((e,t)=>bM(e,"name",{value:t,configurable:!0}),"s");const wM=$M((e,t,r)=>{if(t==="")return e;let n=e.indexOf(t);if(n<0)return e;const i=t.length;let s=0,o="";for(;~n;)o+=e.slice(s,n)+r,s=n+i,n=e.indexOf(t,s);return o+e.slice(s)},"stringReplaceAll");var kM=Object.defineProperty,lo=un((e,t)=>kM(e,"name",{value:t,configurable:!0}),"a");const tn={};let Qp=null;const SM=lo((e,t,r)=>{if(!e)return"";let n;if(e.raw===void 0?n=String(e):n=String.raw(e,...t),n.includes("\x1B"))for(let i=r;i;i=i.props)n=wM(n,i.close,i.open);return n.includes(`
|
|
1023
|
+
`)&&(n=n.replace(/(\r*\n)/g,`${r.closeStack}$1${r.openStack}`)),r.openStack+n+r.closeStack},"wrapText"),Zp=lo(({props:e},{close:t,open:r})=>{const n=(e?.openStack??"")+r,i=t+(e?.closeStack??""),s=lo((o,...a)=>SM(o,a,s.props),"style");return Object.setPrototypeOf(s,Qp),s.props={close:t,closeStack:i,open:r,openStack:n,props:e},s.open=n,s.close=i,s},"createStyle"),EM=lo(function(){const e=lo(t=>String(t),"self");e.strip=t=>t.replaceAll(_c(),"");for(const t in Yg)tn[t]={get(){const r=Zp(this,Yg[t]);return Object.defineProperty(this,t,{value:r}),r}};for(const t in Kg)tn[t]={get(){const r=Zp(this,Kg[t]);return Object.defineProperty(this,t,{value:r}),r}};return Qp=Object.defineProperties({},tn),Object.setPrototypeOf(e,Qp),e},"Colorize");for(const e in Xg)tn[e]={get(){return(...t)=>Zp(this,Xg[e](...t))}};tn.ansi256=tn.fg;tn.bgAnsi256=tn.bg;const Ut=new EM,ir=Ut.bold,Kr=Ut.cyan,jn=Ut.dim,DM=Ut.green,xZ=Ut.inverse,CM=Ut.magenta,yu=Ut.red,Us=Ut.yellow;var AM=Object.defineProperty,We=f((e,t)=>AM(e,"name",{value:t,configurable:!0}),"c$b");const OM=/\/+$/,jM=/\/\*\*$/,xM=/\/\*\/\*$/,PM=/^['"]|['"]$/g,em=/node_modules/,tm=/\.git/,xn=We(e=>{try{return ke(e)}catch{return}},"readJsonFileSafe"),NM=We((e,t,r)=>{for(const n of an(e,{includeFiles:!1,includeSymlinks:!1,skip:[em,tm]}))if(n.path!==e&&x(C(n.path,"package.json"))){const i=n.path.slice(e.length+1);r.push(`${t}/${i}`)}},"scanDirectoryRecursive"),RM=We((e,t,r)=>{const n=t.slice(0,-2),i=ht(e,n);if(x(i))for(const s of an(i,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[em,tm]}))s.path!==i&&x(C(s.path,"package.json"))&&r.push(C(n,s.name))},"resolveSimpleGlob"),FM=We((e,t,r)=>{const n=t.replace(jM,"").replace(xM,""),i=ht(e,n);x(i)&&NM(i,n,r)},"resolveDoubleGlob"),LM=We((e,t,r)=>{const n=ht(e,t);x(n)&&x(C(n,"package.json"))&&r.push(t)},"resolveExactDirectory"),IM=/[$()+.?[\\\]^{|}]/g,TM=We((e,t,r)=>{const n=t.replaceAll(IM,String.raw`\$&`).replaceAll("*",".*"),i=new RegExp(`^${n}$`);for(const s of an(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[em,tm]}))s.path!==e&&i.test(s.name)&&x(C(s.path,"package.json"))&&r.push(s.name)},"resolveBareGlob"),sn=We((e,t)=>{const r=[],n=[];for(const s of t){const o=s.replace(OM,"");if(o.startsWith("!")){const a=o.slice(1);a.length>0&&(n.push(a),a.endsWith("/**")&&n.push(`${a.slice(0,-3)}/`));continue}r.push(o)}const i=[];for(const s of r)s.endsWith("/**")||s.endsWith("/*/*")?FM(e,s,i):s.endsWith("/*")?RM(e,s,i):!s.includes("/")&&s.includes("*")?TM(e,s,i):LM(e,s,i);return i.length===0?i:z9({cwd:e,extraPatterns:n}).filterDirectories(i)},"resolveWorkspacePatterns"),tk=We((e,t,r=new Set)=>{if(!e)return[];const n=[];for(const i of e){if(typeof i=="object"&&i&&"group"in i){const s=i.group;if(r.has(s))throw new Error(`Cycle detected in vis.config taskGroups: ${[...r,s].join(" → ")}`);const o=t?.[s];if(!o)throw new Error(`Unknown taskGroup "${s}" referenced in dependsOn. Declare it under \`taskGroups\` in vis.config.ts.`);n.push(...tk(o,t,new Set([...r,s])));continue}n.push(i)}return n},"expandTaskGroups"),Mc=We(e=>{if(Array.isArray(e)){if(e.length===0)throw new Error('Invalid package.json `workspaces`: empty array. Add at least one pattern like "packages/*" or remove the field.');for(const t of e)if(typeof t!="string"||t.trim().length===0)throw new TypeError(`Invalid package.json \`workspaces\` entry: expected a non-empty glob string, got ${JSON.stringify(t)}.`);return e}if(e&&typeof e=="object"){const{packages:t}=e;if(t===void 0)throw new Error('Invalid package.json `workspaces`: object form requires a `packages` array (e.g. `{ "packages": ["packages/*"] }`).');if(!Array.isArray(t))throw new TypeError(`Invalid package.json \`workspaces.packages\`: expected an array of glob strings, got ${typeof t}.`);return Mc(t)}throw new TypeError(`Invalid package.json \`workspaces\`: expected an array or { packages: string[] } object, got ${typeof e}.`)},"validateWorkspacesField"),BM=We(e=>{const t=C(e,"pnpm-workspace.yaml");if(!x(t))return;let r;try{r=Ti(J(t))}catch{return}if(typeof r!="object"||r===null)return;const{overrides:n}=r;if(typeof n!="object"||n===null||Array.isArray(n))return;const i={};for(const[s,o]of Object.entries(n))typeof o=="string"&&(i[s]=o);return Object.keys(i).length>0?i:void 0},"readPnpmWorkspaceOverrides"),Zi=We(e=>{const t=C(e,"pnpm-workspace.yaml");if(!x(t))return;const r=J(t),n=[];let i=!1;for(const s of r.split(`
|
|
1024
|
+
`)){const o=s.trim();if(o==="packages:"){i=!0;continue}if(i){if(o.startsWith("- ")){const a=o.slice(2).replaceAll(PM,"");n.push(a)}else if(o&&!o.startsWith("#"))break}}return n.length>0?n:void 0},"readPnpmWorkspacePatterns"),PZ=We(e=>{const t=Zi(e);if(t)return t;const r=xn(C(e,"package.json"));if(r?.workspaces!==void 0)try{return Mc(r.workspaces)}catch{return}},"readWorkspacePatterns"),Qg="@filegroup:",_M=We((e,t,r)=>{if(!e)return!0;if(e.projectType&&e.projectType!==r)return!1;if(e.tags&&e.tags.length>0){const n=new Set(t?.tags);if(!e.tags.some(i=>n.has(i)))return!1}if(e.layer){const n=Array.isArray(e.layer)?e.layer:[e.layer];if(t?.layer===void 0||!n.includes(t.layer))return!1}if(e.stack){const n=Array.isArray(e.stack)?e.stack:[e.stack];if(t?.stack===void 0||!n.includes(t.stack))return!1}if(e.language){const n=Array.isArray(e.language)?e.language:[e.language];if(t?.language===void 0||!n.includes(t.language))return!1}return!0},"scopeMatches"),MM=We((e,t,r)=>{const n={};for(const[i,s]of Object.entries(e.tasks??{}))n[i]=xa(void 0,s);for(const i of e.scopedTasks??[])if(_M(i.match,t,r))for(const[s,o]of Object.entries(i.tasks))n[s]=xa(n[s],o);return n},"collectTargetDefaults"),VM=We((e,t)=>{if(!e)return e;const r=[];for(const n of e){if(typeof n=="string"&&n.startsWith(Qg)){const i=n.slice(Qg.length),s=t?.[i];s&&r.push(...s);continue}r.push(n)}for(const n of r)typeof n=="string"&&wD(n)&&kD(n);return r},"resolveFileGroupInputs"),Zg=new Set,WM=We(e=>{if(e===!0)return()=>!0;if(e===void 0||e===!1)return;const t=new Set(Qf.map(n=>n.name)),r=Object.keys(e).filter(n=>!t.has(n));if(r.length>0){const n=[...r].sort().join(",");Zg.has(n)||(Zg.add(n),process.emitWarning(`vis: inferTargets references unknown detector(s): ${r.join(", ")}. Known detectors: ${[...t].join(", ")}.`,"VisConfigWarning"))}return n=>e[n]!==!1},"resolveInferTargetOption"),ed=We((e,t,r,n,i)=>{const s={...xa(n,r),options:{...n?.options,...r?.options}};t&&s.command===void 0&&s.executor===void 0&&(s.command=t),s.inputs&&(s.inputs=VM(s.inputs,i));const o=F9(s);return o.cache===void 0&&(o.cache=B9(o.type)),o},"mergeTarget"),UM=We((e,t,r,n)=>{const i={},s=new Set;for(const[o,a]of Object.entries(e??{}))s.add(o),i[o]=ed(o,a,t?.[o],r[o],n);for(const[o,a]of Object.entries(t??{}))s.has(o)||(i[o]=ed(o,void 0,a,r[o],n));return i},"createTargetsFromScripts"),GM=We((e,t)=>{if(e===void 0&&t===void 0)return;const r=new Set([...Object.keys(e??{}),...Object.keys(t??{})]),n={};for(const i of r)n[i]=xa(e?.[i],t?.[i]);return n},"mergeProjectTargets"),qM=We((e,t={},r)=>{const n={},i=new Map,s=new Map,o=Zi(e),a=xn(C(e,"package.json"));let l;if(o?l=o:a?.workspaces!==void 0&&(l=Mc(a.workspaces)),!l)throw new Error("No workspace configuration found. Expected pnpm-workspace.yaml or package.json workspaces field.");const c=sn(e,l);for(const u of c){const d=C(e,u,"package.json"),p=xn(d);if(!p?.name)continue;s.set(p.name,p);const m=C(e,u,"project.json"),g=xn(m);let $="library";g?.projectType?$=g.projectType:p.bin!==void 0&&($="application");const S=MM(t,g,$),k=GM(g?.targets,r?.get(u)?.tasks),v=UM(p.scripts,k,S,t.fileGroups),h=WM(t.inferTargets);if(h!==void 0){const w=C(e,u),y=Qf.filter(E=>h(E.name)),D=P9({pkg:p,projectDirectory:u,projectRoot:w},y);for(const[E,A]of Object.entries(D.targets))v[E]===void 0&&(v[E]={...ed(E,A.command,A,S[E],t.fileGroups),inferred:!0})}i.set(p.name,v);const b={};for(const[w,y]of Object.entries(v)){const{options:D}=y,E={...y};delete E.inferred,delete E.options,delete E.preset,delete E.type;const A=y.dependsOn?tk(y.dependsOn,t.taskGroups):void 0;b[w]={...E,...A?{dependsOn:A}:{},...D?{options:D}:{}}}n[p.name]={implicitDependencies:g?.implicitDependencies,language:g?.language,layer:g?.layer,owners:g?.owners,project:g?.project,projectType:$,root:u,sourceRoot:g?.sourceRoot??`${u}/src`,stack:g?.stack,tags:g?.tags,targets:b}}return{config:t,packageJsons:s,projectOptions:i,workspace:{projects:n}}},"discoverWorkspace"),NZ=We((e,t,r)=>{const n={},i={},s=new Set(Object.keys(t.projects));for(const[o,a]of Object.entries(t.projects)){n[o]={data:a,name:o,type:a.projectType??"library"},i[o]=[];const l=r?.get(o)??xn(C(e,a.root,"package.json"));if(!l)continue;const c=[[l.dependencies,"static"],[l.devDependencies,"devDependency"],[l.peerDependencies,"peerDependency"]],u=new Set;for(const[d,p]of c)if(d)for(const m of Object.keys(d))s.has(m)&&!u.has(m)&&(u.add(m),i[o]?.push({source:o,target:m,type:p}))}return{dependencies:i,nodes:n}},"buildProjectGraph"),RZ=We(async e=>{const{loadVisTaskConfig:t}=await import("../packem_shared/applyDefaults-BOVDw1jD.js"),r=Zi(e),n=xn(C(e,"package.json"));let i;if(r?i=r:n?.workspaces!==void 0&&(i=Mc(n.workspaces)),!i)return new Map;const s=sn(e,i),o=new Map;return await Promise.all(s.map(async a=>{const l=xn(C(e,a,"package.json"));if(!l?.name)return;const c=await t(e,C(e,a),l.name);c!==void 0&&o.set(a,c)})),o},"loadVisTaskConfigsForWorkspace");var zM=Object.defineProperty,HM=f((e,t)=>zM(e,"name",{value:t,configurable:!0}),"t$g");const Ee=HM((e,t)=>{if(!x(e))return;const r=`${e}.bak`;x(r)||(t?.backupsCreated.includes(r)??!1)||(KE(e,r),t&&t.backupsCreated.push(r))},"backupFile");var JM=Object.defineProperty,Vc=f((e,t)=>JM(e,"name",{value:t,configurable:!0}),"e$l");const tt=Vc(e=>{try{const t=J(e);return JSON.parse(t)}catch{return}},"readJsonFile"),es=Vc(e=>{if(!x(e))return!1;try{return JSON.parse(J(e)),!0}catch{return!1}},"isJsonFile"),Ro=Vc((e,t,r={})=>br(e,t,{defaultIndent:" ",useEditorconfig:r.useEditorconfig}),"detectJsonIndent"),Wc=Vc((e,t,r,n={})=>{if(!x(e))return!1;const i=J(e);let s;try{s=JSON.parse(i)}catch{return!1}const o=t(s);if(o===void 0)return!1;const a=Ro(e,i,n);return r&&Ee(e,r),Ve(e,`${JSON.stringify(o,void 0,a)}
|
|
1025
|
+
`,"utf8"),!0},"editJsonFile");var KM=Object.defineProperty,pn=f((e,t)=>KM(e,"name",{value:t,configurable:!0}),"f$6");const YM=/\blint-staged\b/g,XM=pn((e,t)=>{let r=!1;const n={...e};for(const[i,s]of Object.entries(n)){if(typeof s!="string")continue;let o=K1(s);o&&(o=o.replaceAll(YM,"vis staged").trim()||void 0),o!==s&&(o?n[i]=o:delete n[i],r=!0,t.rewrittenScriptCount+=1)}return{modified:r,scripts:n}},"rewriteScripts"),rk=pn((e,t,r,n)=>{const i=C(e,"package.json");x(i)&&Wc(i,s=>{let o=!1;for(const l of J1){const c=s.dependencies,u=s.devDependencies;c?.[l]&&(delete c[l],o=!0,n.removedPackageCount+=1),u?.[l]&&(delete u[l],o=!0,n.removedPackageCount+=1)}if(Object.keys(r).length>0)switch(t){case"bun":{const l=s.workspaces,c=l&&!Array.isArray(l)?l:void 0,u={...c?.catalog??s.catalog};for(const[p,m]of Object.entries(r))u[p]=m;c?.catalog===void 0?s.catalog=u:c.catalog=u;const d=s.overrides??{};for(const p of Object.keys(r))d[p]="catalog:";s.overrides=d,o=!0;break}case"npm":{const l=s.overrides??{};s.overrides={...l,...r},o=!0;break}case"pnpm":{const l=s.pnpm??{},c=l.overrides??{};l.overrides={...c,...r},s.pnpm=l,o=!0;break}case"yarn":{const l=s.resolutions??{};s.resolutions={...l,...r},o=!0;break}}const a=s.scripts;if(a){const l=XM(a,n);l.modified&&(s.scripts=l.scripts,o=!0)}return o?s:void 0})},"rewritePackageJson"),QM=pn((e,t,r,n)=>{try{const{workspace:i}=qM(e);for(const s of Object.values(i.projects)){const o=C(e,s.root);rk(o,t,r,n)}}catch{}},"migrateMonorepoPackages"),ZM=pn(e=>e.startsWith("- ")||e!==""&&!e.includes(":")&&!e.startsWith("#"),"isCatalogSectionEnd"),e4=pn(e=>{let t=!1,r="";const n=new Set;for(const i of e){const s=i.trim();if(s==="catalog:"){t=!0;continue}if(!t)continue;if(ZM(s))break;const o=s.includes(":")?s.split(":")[0]?.trim():void 0;o&&(n.add(o),r=r||i.slice(0,i.indexOf(s)))}return{entries:n,indent:r||" "}},"parseCatalogEntries"),t4=pn((e,t,r)=>{const n=[];let i=!1,s=!1;for(let o=0;o<e.length;o+=1){const a=e[o],l=a.trim();if(n.push(a),l==="catalog:"){s=!0;continue}if(s&&!i){const c=e[o+1]?.trim()??"";(!c.includes(":")||c.startsWith("- ")||!c||c==="catalog:")&&(n.push(...t),i=!0,s=!1)}}return i||(r.includes("catalog:")||n.push("catalog:"),n.push(...t)),n},"insertCatalogEntries"),r4=pn((e,t)=>{const r=C(e,"pnpm-workspace.yaml");if(!x(r)||Object.keys(t).length===0)return;const n=J(r),i=n.split(`
|
|
1026
|
+
`),{entries:s,indent:o}=e4(i),a=[];for(const[c,u]of Object.entries(t))s.has(c)||a.push(`${o}${c}: "${u}"`);if(a.length===0)return;const l=t4(i,a,n);Ee(r),Ve(r,l.join(`
|
|
1027
|
+
`),"utf8")},"updatePnpmWorkspaceCatalog"),ey=pn((e,t,r,n,i,s)=>{const o=r.overrides??{};if(n.dryRun){i.info("[dry-run] Would rewrite package.json files (remove husky/lint-staged, rewrite scripts)"),Object.keys(o).length>0&&i.info(`[dry-run] Would add overrides: ${JSON.stringify(o)}`);return}rk(e,t,o,s),i.info("Rewritten root package.json"),QM(e,t,o,s),t==="pnpm"&&r4(e,o)},"migrateDeps");var n4=Object.defineProperty,Uc=f((e,t)=>n4(e,"name",{value:t,configurable:!0}),"t$f");const Lt=Uc(()=>({backupsCreated:[],gitHooksConfigured:!1,inlinedLintStagedConfigCount:0,manualSteps:[],mergedStagedConfigCount:0,perMigration:{},removedConfigCount:0,removedPackageCount:0,rewrittenScriptCount:0,warnings:[]}),"createMigrationReport"),de=Uc((e,t)=>{!e||e.warnings.includes(t)||e.warnings.push(t)},"addMigrationWarning"),be=Uc((e,t)=>{!e||e.manualSteps.includes(t)||e.manualSteps.push(t)},"addManualStep"),ot=Uc((e,t,r,n=1)=>{const i=e.perMigration[t]??{removedConfigCount:0,removedPackageCount:0,rewrittenScriptCount:0};i[r]+=n,e.perMigration[t]=i,e[r]+=n},"bumpPerMigration");var i4=Object.defineProperty,wr=f((e,t)=>i4(e,"name",{value:t,configurable:!0}),"d$d");const s4=["gitleaks.toml",".gitleaks.toml"],o4=["gitleaks-report.json",".gitleaks-report.json","baseline.json"],Gc=wr(e=>s4.find(t=>x(C(e,t))),"detectGitleaksConfig"),rm=wr(e=>{const t=C(e,".gitleaksignore");return x(t)?t:void 0},"detectGitleaksIgnore"),nm=wr(e=>{for(const t of o4){const r=C(e,t);if(x(r))try{const n=JSON.parse(J(r));if(Array.isArray(n)&&n.length>0&&typeof n[0]=="object"&&n[0]!==null&&"RuleID"in n[0])return r}catch{}}},"detectGitleaksBaseline"),a4=wr(e=>e.map(t=>({description:t.Description??"",endColumn:t.EndColumn??0,endLine:t.EndLine??t.StartLine??0,entropy:t.Entropy??0,file:t.File??"",match:t.Match??"",ruleId:t.RuleID??"",secret:t.Secret??"",startColumn:t.StartColumn??0,startLine:t.StartLine??0,tags:t.Tags??[]})),"convertBaseline"),c4=wr((e,t,r,n,i)=>{const s=nm(e);if(!s)return;const o=C(e,".secrets-baseline.json");if(x(o)&&s!==o){de(n,`.secrets-baseline.json already exists — leaving ${s} in place`);return}const a=tt(s);if(!Array.isArray(a)){de(n,`Could not parse ${s} as a gitleaks baseline`);return}const l=a4(a);if(t){r.info(`[dry-run] Would convert ${s} -> ${o} (${String(l.length)} findings)`);return}Ee(s,n),ze(o,`${JSON.stringify(l,null,br(o,void 0,{defaultIndent:" ",useEditorconfig:i}))}
|
|
1028
|
+
`),r.info(`Converted ${s} -> ${o} (${String(l.length)} findings)`),ot(n,"gitleaks","rewrittenScriptCount")},"migrateBaseline"),l4=wr((e,t,r,n,i)=>{const s=C(e,"package.json");if(!x(s))return;const o=tt(s);if(!o)return;const a=Gc(e),l=a?`vis secrets --config ${a}`:"vis secrets";let c=!1;if(o.scripts){for(const[d,p]of Object.entries(o.scripts))if(typeof p=="string"&&/\bgitleaks\b/.test(p)){const m=p.replaceAll(/\bgitleaks(?:\s+(?:detect|protect))?\b[^\n&|;]*/g,l).trim();m!==p&&(o.scripts[d]=m,c=!0,r.info(` scripts.${d}: "${p}" -> "${m}"`),ot(n,"gitleaks","rewrittenScriptCount"))}}if(o.devDependencies){const d=o.devDependencies;for(const p of["gitleaks","@gitleaks/cli"])p in d&&(delete d[p],c=!0,ot(n,"gitleaks","removedPackageCount"),r.info(` removed devDependency: ${p}`))}if(!c)return;if(t){r.info(`[dry-run] Would update ${s}`);return}const u=br(s,J(s),{defaultIndent:" ",useEditorconfig:i});Ee(s,n),ze(s,`${JSON.stringify(o,null,u)}
|
|
1029
|
+
`)},"rewriteScripts"),u4=wr((e,t,r,n)=>{const i=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],s=Gc(e),o=s?`vis secrets --staged --config ${s}`:"vis secrets --staged";for(const a of i){const l=C(e,a);if(!x(l))continue;const c=J(l);if(!/\bgitleaks\b/.test(c))continue;const u=c.replaceAll(/\bgitleaks(?:\s+(?:detect|protect))?\b[^\n&|;]*/g,o);if(t){r.info(`[dry-run] Would rewrite ${l}`);continue}Ee(l,n),ze(l,u),n.gitHooksConfigured=!0,r.info(`Rewrote gitleaks invocation in ${a}`)}},"rewriteHooks"),p4=/^([^:#][^:]*):([^:]+):(\d+)$/,d4=wr(e=>{const t=p4.exec(e.trim());if(!t)return;const[,r,n,i]=t,s=Number.parseInt(i??"0",10);return{description:"",endColumn:0,endLine:s,entropy:0,file:r??"",match:"",ruleId:n??"",secret:"",startColumn:0,startLine:s,tags:[]}},"fingerprintToBaselineEntry"),f4=wr((e,t,r,n,i)=>{const s=rm(e);if(!s)return;const o=J(s).split(/\r?\n/).map(m=>m.trim()).filter(m=>m.length>0&&!m.startsWith("#")).map(m=>d4(m)).filter(m=>m!==void 0);o.length===0&&de(n,`${s} contained no recognisable fingerprint lines — deleting it.`);const a=C(e,".secrets-baseline.json"),l=x(a)?tt(a)??[]:[],c=new Set(l.map(m=>`${m.file}:${m.ruleId}:${String(m.startLine)}`)),u=[...l];for(const m of o){const g=`${m.file}:${m.ruleId}:${String(m.startLine)}`;c.has(g)||(c.add(g),u.push(m))}if(t){r.info(`[dry-run] Would merge ${String(o.length)} .gitleaksignore fingerprint(s) into ${a}, then delete ${s}.`);return}Ee(s,n);const d=x(a)?J(a):void 0;d!==void 0&&Ee(a,n);const p=br(a,d,{defaultIndent:" ",useEditorconfig:i});ze(a,`${JSON.stringify(u,null,p)}
|
|
1030
|
+
`),Vi(s),r.info(`Merged ${String(o.length)} fingerprint(s) from ${s} into ${a}; removed .gitleaksignore.`),ot(n,"gitleaks","rewrittenScriptCount",o.length)},"migrateIgnoreFile"),ty=wr((e,t,r,n)=>{const i=Gc(e),s=rm(e);return i??s??nm(e)?(i&&(r.info(`Keeping ${i} as-is (compatible with vis secrets --config).`),be(n,`Run \`vis secrets --config ${i}\` or rename to .gitleaksignore-compatible defaults.`)),s&&f4(e,t.dryRun,r,n,t.useEditorconfig),c4(e,t.dryRun,r,n,t.useEditorconfig),l4(e,t.dryRun,r,n,t.useEditorconfig),u4(e,t.dryRun,r,n),be(n,"Review CI workflows (.github/workflows/*.yml) for gitleaks-action calls — replace with `vis secrets`."),!0):(t.silent||r.info("No gitleaks artifacts found — nothing to migrate."),!1)},"migrateGitleaks");var m4=Object.defineProperty,Mr=f((e,t)=>m4(e,"name",{value:t,configurable:!0}),"f$5");const h4=["kingfisher-baseline.yaml",".kingfisher-baseline.yaml","kingfisher-baseline.yml",".kingfisher-baseline.yml"],g4=["kingfisher-rules.yml","kingfisher-rules.yaml",".kingfisher-rules.yml",".kingfisher-rules.yaml"],im=Mr(e=>h4.find(t=>x(C(e,t))),"detectKingfisherBaseline"),qc=Mr(e=>g4.find(t=>x(C(e,t))),"detectKingfisherRules"),y4=Mr(e=>{const t=[];let r={};for(const n of e.split(/\r?\n/)){const i=n.replace(/#.*$/,"");(/^\s*-\s*filepath\s*:/.test(i)||/^\s*-\s*$/.test(i))&&(r.filepath&&typeof r.linenum=="number"&&r.fingerprint&&t.push(r),r={});const s=/filepath\s*:\s*(.+?)\s*$/.exec(i);if(s?.[1]){r.filepath=s[1].replaceAll(/^["']|["']$/g,"");continue}const o=/fingerprint\s*:\s*(.+?)\s*$/.exec(i);if(o?.[1]){r.fingerprint=o[1].replaceAll(/^["']|["']$/g,"");continue}const a=/linenum\s*:\s*(\d+)/.exec(i);a?.[1]&&(r.linenum=Number.parseInt(a[1],10))}return r.filepath&&typeof r.linenum=="number"&&r.fingerprint&&t.push(r),t},"parseKingfisherBaseline"),v4=Mr(e=>({_kingfisherMigration:{legacyFingerprint:e.fingerprint,note:"Kingfisher xxhash — regenerate by running `vis secrets --update-baseline`."},description:"",endColumn:0,endLine:e.linenum,entropy:0,file:e.filepath,match:"",ruleId:"",secret:"",startColumn:0,startLine:e.linenum,tags:[]}),"toPlaceholderEntry"),b4=Mr((e,t,r,n,i)=>{const s=im(e);if(!s)return;const o=C(e,s);let a;try{a=y4(J(o))}catch(u){const d=u instanceof Error?u.message:String(u);de(n,`Could not parse ${s} as a Kingfisher baseline: ${d}`);return}if(a.length===0){de(n,`${s} contained no recognisable records — leaving it in place for manual review.`);return}const l=C(e,".secrets-baseline.json");if(x(l)){de(n,`.secrets-baseline.json already exists — leaving Kingfisher baseline at ${s} for manual merge.`);return}const c=a.map(u=>v4(u));if(t){r.info(`[dry-run] Would convert ${s} -> .secrets-baseline.json (${String(c.length)} placeholder finding(s))`),be(n,"Run `vis secrets --update-baseline` after migration — Kingfisher xxhash fingerprints aren't interchangeable with our content-hash.");return}Ee(o,n),ze(l,`${JSON.stringify(c,null,br(l,void 0,{defaultIndent:" ",useEditorconfig:i}))}
|
|
1031
|
+
`),r.info(`Converted ${s} -> .secrets-baseline.json (${String(c.length)} placeholder finding(s))`),be(n,"Run `vis secrets --update-baseline` — the converted entries are placeholders until the scanner computes real fingerprints."),ot(n,"kingfisher","rewrittenScriptCount")},"migrateBaseline"),nk=/\bkingfisher(?:\s+(?:scan|validate|rules|update|manage-baseline|report|github|gitlab|bitbucket))?\b[^\n&|;]*/g,$4=Mr((e,t,r,n,i)=>{const s=C(e,"package.json");if(!x(s))return;const o=tt(s);if(!o)return;const a=qc(e),l=a?`vis secrets --config ${a}`:"vis secrets";let c=!1;if(o.scripts)for(const[d,p]of Object.entries(o.scripts)){if(typeof p!="string"||!/\bkingfisher\b/.test(p))continue;const m=p.replaceAll(nk,g=>g.includes("validate")?`${l} --validate`:l).trim();m!==p&&(o.scripts[d]=m,c=!0,r.info(` scripts.${d}: "${p}" -> "${m}"`),ot(n,"kingfisher","rewrittenScriptCount"))}if(o.devDependencies){const d=o.devDependencies;for(const p of["kingfisher","@mongodb/kingfisher","kingfisher-scanner"])p in d&&(delete d[p],c=!0,ot(n,"kingfisher","removedPackageCount"),r.info(` removed devDependency: ${p}`))}if(!c)return;if(t){r.info(`[dry-run] Would update ${s}`);return}const u=br(s,J(s),{defaultIndent:" ",useEditorconfig:i});Ee(s,n),ze(s,`${JSON.stringify(o,null,u)}
|
|
1032
|
+
`)},"rewriteScripts"),w4=Mr((e,t,r,n)=>{const i=qc(e),s=i?`vis secrets --staged --config ${i}`:"vis secrets --staged";for(const o of ik){const a=C(e,o);if(!x(a))continue;const l=J(a);if(!/\bkingfisher\b/.test(l))continue;const c=l.replaceAll(nk,s);if(t){r.info(`[dry-run] Would rewrite ${a}`);continue}Ee(a,n),ze(a,c),n.gitHooksConfigured=!0,r.info(`Rewrote kingfisher invocation in ${o}`)}},"rewriteHooks"),ik=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],ry=Mr(e=>{if(!x(e))return!1;try{return/\bkingfisher\b/.test(J(e))}catch{return!1}},"hasKingfisherRef"),ny=Mr((e,t,r,n)=>{const i=im(e),s=qc(e),o=ry(C(e,"package.json")),a=ik.some(l=>ry(C(e,l)));return(i??s)||o||a?(s&&(r.info(`Found custom Kingfisher ruleset at ${s} — keeping it for now.`),be(n,`Convert ${s} to gitleaks-shaped JSON using \`packages/tooling/secret-scanner/scripts/kingfisher-converter.mjs\`, then point \`vis secrets --config\` at the result.`)),i&&b4(e,t.dryRun,r,n,t.useEditorconfig),$4(e,t.dryRun,r,n,t.useEditorconfig),w4(e,t.dryRun,r,n),be(n,"Replace `# kingfisher:ignore` markers with `# secret-scanner:allow` (or keep `# gitleaks:allow` — the scanner accepts both)."),be(n,"Review CI workflows (.github/workflows/*.yml) for Kingfisher action/docker invocations — replace with `vis secrets`."),!0):(t.silent||r.info("No Kingfisher artifacts found — nothing to migrate."),!1)},"migrateKingfisher");var k4=Object.defineProperty,ct=f((e,t)=>k4(e,"name",{value:t,configurable:!0}),"r$d");const S4=/\bstaged\s*:/,iy=/(defineConfig\(\{)/,sy=/(export\s+default\s+\{)/;ct(e=>Kf.some(t=>x(C(e,t))),"hasStandaloneLintStagedConfig");const E4=ct(e=>{for(const r of q1)if(x(C(e,r)))return!0;const t=C(e,".lintstagedrc");return x(t)&&!es(t)},"hasUnsupportedLintStagedConfig"),D4=ct(e=>{const t=zn(e);if(!t)return!1;const r=J(t);return S4.test(r)},"hasStagedConfigInVisConfig"),sk=ct(e=>{const t=C(e,"package.json");if(x(t)&&tt(t)?.["lint-staged"])return"package.json";for(const r of Kf)if(x(C(e,r)))return r},"detectLintStagedConfig"),C4=ct(e=>tt(C(e,"package.json"))?.["lint-staged"],"extractLintStagedFromPackageJson"),A4=ct(e=>tt(e),"parseLintStagedJsonFile"),td=ct(e=>` staged: {
|
|
1033
|
+
${Object.entries(e).map(([t,r])=>{const n=Array.isArray(r)?`[${r.map(i=>JSON.stringify(i)).join(", ")}]`:JSON.stringify(r);return` ${JSON.stringify(t)}: ${n}`}).join(`,
|
|
1034
|
+
`)},
|
|
1035
|
+
}`,"generateStagedConfigSnippet"),O4=ct((e,t,r)=>{const n=zn(e);if(n){const o=J(n),a=td(t);let l;return iy.test(o)?l=o.replace(iy,`$1
|
|
1036
|
+
${a},`):sy.test(o)&&(l=o.replace(sy,`$1
|
|
1037
|
+
${a},`)),l?(Ee(n),Ve(n,l,"utf8"),r.info(`Merged staged config into ${n}`),!0):(r.warn(`Could not auto-insert staged config into ${n} — please add manually`),!1)}const i=C(e,"vis.config.ts"),s=`import { defineConfig } from "@visulima/vis/config";
|
|
1038
|
+
|
|
1039
|
+
export default defineConfig({
|
|
1040
|
+
${td(t)},
|
|
1041
|
+
});
|
|
1042
|
+
`;return Ve(i,s,"utf8"),r.info(`Created ${i} with staged config`),!0},"insertStagedIntoVisConfig"),j4=ct((e,t)=>{const r=C(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1};if(!x(r))return n;const i=J(r),s=JSON.parse(i);let o=!1;s["lint-staged"]&&(delete s["lint-staged"],o=!0,n.configRemoved=!0);const a=s.devDependencies,l=s.dependencies;if(a?.["lint-staged"]&&(delete a["lint-staged"],o=!0,n.dependencyRemoved=!0),l?.["lint-staged"]&&(delete l["lint-staged"],o=!0,n.dependencyRemoved=!0),o){const c=Ro(r,i,{useEditorconfig:t});Ee(r),Ve(r,`${JSON.stringify(s,void 0,c)}
|
|
1043
|
+
`,"utf8")}return n},"removeLintStagedFromPackageJson"),x4=ct((e,t)=>{for(const r of Kf){const n=C(e,r);x(n)&&(Ee(n,t),Vi(n),t.removedConfigCount+=1)}},"removeLintStagedConfigFiles"),P4=ct((e,t)=>{const r=C(e,t,"pre-commit");if(!x(r))return!1;const n=J(r);if(n.includes("vis staged"))return!1;const i=n.split(`
|
|
1044
|
+
`);let s=!1;const o=[];for(const a of i){const l=a.trim();if(!s){let c=!1;for(const u of a3){const d=u.exec(l);if(d){const p=a.slice(0,a.length-a.trimStart().length),m=d[1]?.trim()??"",g=l.slice(d[0].length).trim(),$=[m,"vis staged",g].filter(Boolean);o.push(`${p}${$.join(" ")}`),s=!0,c=!0;break}}if(c)continue}o.push(a)}return s?(Ee(r),Ve(r,o.join(`
|
|
1045
|
+
`)),!0):!1},"rewritePreCommitHook"),N4=ct((e,t,r)=>{if(t==="package.json")return C4(e);const n=C(e,t);if(!G1.includes(t)){de(r,`${t} cannot be auto-migrated — please add "staged" config to vis.config.ts manually`),be(r,`Manually convert ${t} to staged config in vis.config.ts`);return}if(t===".lintstagedrc"&&!es(n)){de(r,".lintstagedrc is not JSON format — please migrate manually");return}return A4(n)},"extractConfig"),ok=ct((e,t,r)=>{const{configRemoved:n,dependencyRemoved:i}=j4(e,r);n&&(t.inlinedLintStagedConfigCount+=1),i&&(t.removedPackageCount+=1),x4(e,t)},"cleanupLintStagedArtifacts"),R4=ct((e,t,r,n)=>{const i=[".vis-hooks",".husky"];for(const s of i)x(C(e,s))&&P4(e,s)&&(n.gitHooksConfigured=!0,t.silent||r.info(`Rewrote pre-commit hook in ${s}/ to use "vis staged"`))},"rewriteHooks"),F4=ct((e,t,r,n,i)=>{O4(e,t,n)&&(i.mergedStagedConfigCount+=1),ok(e,i,r.useEditorconfig),R4(e,r,n,i)},"applyMigration"),oy=ct((e,t,r,n)=>{const i=sk(e);if(!i)return t.silent||r.info("No lint-staged configuration found — nothing to migrate."),!1;if(E4(e)&&(de(n,'Non-JSON lint-staged config found — please migrate to "staged" in vis.config.ts manually'),be(n,"Convert your lint-staged config file to JSON format or add staged config to vis.config.ts manually")),D4(e))return de(n,'vis.config.ts already has a "staged" config — skipping lint-staged merge'),t.silent||r.warn('vis.config.ts already has a "staged" config — skipping'),t.dryRun||ok(e,n,t.useEditorconfig),!0;const s=N4(e,i,n);return!s||Object.keys(s).length===0?(t.silent||r.warn("lint-staged config is empty — skipping"),!1):t.dryRun?(t.silent||(r.info("[dry-run] Would insert staged config into vis.config.ts:"),r.info(td(s))),!0):(F4(e,s,t,r,n),!0)},"migrateLintStaged");var L4=Object.defineProperty,sm=f((e,t)=>L4(e,"name",{value:t,configurable:!0}),"o$g");const om=sm((e,t,r)=>{const n=t?br(t,void 0,{defaultIndent:" ",useEditorconfig:r}):" ";return JSON.stringify(e,null,n).replaceAll(/"(\w+)":/g,"$1:")},"serializeConfigObject"),am=sm((e,t,r,n,i)=>{const s=C(e,"vis.config.ts"),o=x(s);return o&&!r.dryRun&&!r.force?(n.warn("vis.config.ts already exists — refusing to overwrite. Re-run with --force to replace it (a .bak is taken first), or run with --dry-run to preview."),i.warnings.push("vis.config.ts already exists; migration skipped writing the file. Re-run with --force to overwrite."),!1):(r.dryRun?(n.info("── vis.config.ts (preview) ──"),n.info(t),n.info("── end preview ──")):(o&&r.force&&(Ee(s,i),n.info(`Replacing ${s} (backup at ${s}.bak)`)),ze(s,t),n.info(`Wrote ${s}`)),!0)},"writeVisConfig"),ak=sm((e,t)=>{const r=C(e,t);if(x(r))try{return JSON.parse(J(r))}catch(n){throw new Error(`Failed to parse ${r}: ${n.message}`,{cause:n})}},"readJsonConfig");var I4=Object.defineProperty,ts=f((e,t)=>I4(e,"name",{value:t,configurable:!0}),"l$e");const T4=ts(e=>{const t={};return e.command&&(t.command=Array.isArray(e.args)?`${e.command} ${e.args.join(" ")}`:e.args?`${e.command} ${e.args}`:e.command),e.deps&&e.deps.length>0&&(t.dependsOn=e.deps),e.inputs&&e.inputs.length>0&&(t.inputs=e.inputs),e.outputs&&e.outputs.length>0&&(t.outputs=e.outputs),e.type&&(t.type=e.type),e.preset&&(t.preset=e.preset),e.options&&(t.options=e.options),t},"taskToVisTarget"),B4=ts((e,t,r)=>{const n={};e.fileGroups&&(n.fileGroups=e.fileGroups);const i={};for(const[s,o]of Object.entries(e.tasks??{}))i[s]=T4(o);return Object.keys(i).length>0&&(n.tasks=i),e.implicitInputs&&e.implicitInputs.length>0&&(n.namedInputs={default:e.implicitInputs}),["// Migrated from moon's .moon/tasks.yml by `vis migrate moon`.","// Per-project moon.yml files can be converted to project.json —","// review the generated file and move project-specific tasks there.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${om(n,C(t,"vis.config.ts"),r)});`,""].join(`
|
|
1046
|
+
`)},"renderVisConfig"),_4=ts(e=>{const t=C(e,".moon");if(!x(t))return;for(const n of["tasks.yml","tasks.yaml"]){const i=C(t,n);if(x(i))return i}const r=C(t,"tasks");if(x(r)){const n=Kt(r).filter(i=>i.endsWith(".yml")||i.endsWith(".yaml")).sort();if(n.length>0)return C(r,n[0])}},"findMoonTasksFile"),M4=ts(e=>{const t=C(e,".moon","templates");if(!x(t))return[];const r=[];try{for(const n of Kt(t,{withFileTypes:!0}))n.isDirectory()&&x(C(t,n.name,"template.yml"))&&r.push(n.name)}catch{}return r.sort()},"findMoonTemplates"),V4=ts((e,t,r,n,i)=>{const s=C(e,".moon","templates"),o=C(e,".vis","templates");r||YE(o,{recursive:!0});for(const a of t){const l=C(s,a),c=C(o,a);if(x(c)){i.warnings.push(`Template "${a}" already exists at .vis/templates/${a} — left untouched. Remove or rename either copy to resolve.`);continue}if(r){n.info(`Would copy .moon/templates/${a} → .vis/templates/${a}`);continue}try{XE(l,c,{recursive:!0}),n.info(`Copied .moon/templates/${a} → .vis/templates/${a}`)}catch(u){const d=u instanceof Error?u.message:String(u);i.warnings.push(`Failed to copy template "${a}": ${d}`)}}!r&&t.length>0&&i.manualSteps.push(`Copied ${String(t.length)} template${t.length===1?"":"s"} from .moon/templates/ to .vis/templates/. Remove the .moon/templates/ directory when ready.`)},"copyMoonTemplatesToVis"),ay=ts((e,t,r,n)=>{const i=_4(e);if(!i){r.warn("No .moon/tasks.yml (or .moon/tasks/<scope>.yml) found — nothing to migrate."),n.warnings.push("No moon tasks file at workspace root.");return}let s;try{s=Mt(i)}catch(c){throw new Error(`Failed to parse ${i}: ${c.message}`,{cause:c})}for(const[c,u]of Object.entries(s.tasks??{}))u.env&&Object.keys(u.env).length>0&&n.warnings.push(`Task "${c}" has an \`env\` block which vis does not support — set environment variables in the command or a wrapper script.`),u.platform&&n.warnings.push(`Task "${c}" has a \`platform\` field ("${u.platform}") which vis does not support — review and remove.`),u.toolchain&&n.warnings.push(`Task "${c}" has a \`toolchain\` field ("${u.toolchain}") which vis does not support — review and remove.`),Array.isArray(u.args)&&u.args.some(d=>d.includes(" "))&&n.warnings.push(`Task "${c}" has \`args\` entries containing spaces — vis flattens args into the command string so quoting may need manual adjustment.`);s.extends&&s.extends.length>0&&n.warnings.push("`extends` was found in the moon config but has no direct vis equivalent — inline the referenced files or use vis's `scopedTasks` blocks."),s.implicitDeps&&s.implicitDeps.length>0&&n.warnings.push("`implicitDeps` was found in the moon config but has no direct vis equivalent — add explicit `dependsOn` entries in project.json instead."),s.taskOptions&&Object.keys(s.taskOptions).length>0&&n.warnings.push("`taskOptions` was found in the moon config but has no direct vis equivalent — review and apply settings per-target in vis.config.ts.");const o=B4(s,e,t.useEditorconfig);if(!am(e,o,t,r,n))return;n.manualSteps.push("moon's per-project `moon.yml` files should be converted to `project.json`. vis reads targets, tags, layer, stack, language, and owners from project.json — the field names match."),n.manualSteps.push("Scoped `.moon/tasks/<scope>.yml` files map to vis's `scopedTasks` with a `match` block. Only the first scope file was parsed — review the generated file."),n.manualSteps.push("vis tasks support `when: { os, env, branch, ci, not.* }` for conditional execution and `always: true` for cleanup tasks that fire even when upstream fails. Review tasks that used moon's `local: true`, `options.runInCI`, or shell-based platform gating — the new surface is more expressive and may simplify them. See docs/guides/conditional-and-finally-tasks.mdx.");const a=M4(e);if(a.length===0)return;const l=a.map(c=>`"${c}"`).join(", ");t.copyTemplates?V4(e,a,!!t.dryRun,r,n):n.manualSteps.push(`Detected ${String(a.length)} template${a.length===1?"":"s"} under .moon/templates/ (${l}). They are already usable via \`vis generate <name>\` — vis auto-discovers moon-format template directories at runtime. To decouple from moon entirely, re-run \`vis migrate moon --copy-templates\` to physically move them to .vis/templates/.`)},"migrateMoon");var W4=Object.defineProperty,lt=f((e,t)=>W4(e,"name",{value:t,configurable:!0}),"r$c");const U4=/\bstaged\s*:/,cy=/(defineConfig\(\{)/,ly=/(export\s+default\s+\{)/;lt(e=>Yf.some(t=>x(C(e,t))),"hasStandaloneNanoStagedConfig");const G4=lt(e=>{for(const r of H1)if(x(C(e,r)))return!0;const t=C(e,".nanostagedrc");return x(t)&&!es(t)},"hasUnsupportedNanoStagedConfig"),q4=lt(e=>{const t=zn(e);return t?U4.test(J(t)):!1},"hasStagedConfigInVisConfig"),ck=lt(e=>{const t=C(e,"package.json");if(x(t)&&tt(t)?.["nano-staged"])return"package.json";for(const r of Yf)if(x(C(e,r)))return r},"detectNanoStagedConfig"),z4=lt(e=>tt(C(e,"package.json"))?.["nano-staged"],"extractNanoStagedFromPackageJson"),H4=lt(e=>tt(e),"parseNanoStagedJsonFile"),rd=lt(e=>` staged: {
|
|
1047
|
+
${Object.entries(e).map(([t,r])=>{const n=Array.isArray(r)?`[${r.map(i=>JSON.stringify(i)).join(", ")}]`:JSON.stringify(r);return` ${JSON.stringify(t)}: ${n}`}).join(`,
|
|
1048
|
+
`)},
|
|
1049
|
+
}`,"generateStagedConfigSnippet"),J4=lt((e,t,r)=>{const n=zn(e);if(n){const o=J(n),a=rd(t);let l;return cy.test(o)?l=o.replace(cy,`$1
|
|
1050
|
+
${a},`):ly.test(o)&&(l=o.replace(ly,`$1
|
|
1051
|
+
${a},`)),l?(Ee(n),Ve(n,l,"utf8"),r.info(`Merged staged config into ${n}`),!0):(r.warn(`Could not auto-insert staged config into ${n} — please add manually`),!1)}const i=C(e,"vis.config.ts"),s=`import { defineConfig } from "@visulima/vis/config";
|
|
1052
|
+
|
|
1053
|
+
export default defineConfig({
|
|
1054
|
+
${rd(t)},
|
|
1055
|
+
});
|
|
1056
|
+
`;return Ve(i,s,"utf8"),r.info(`Created ${i} with staged config`),!0},"insertStagedIntoVisConfig"),K4=lt((e,t)=>{const r=C(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1};if(!x(r))return n;const i=J(r),s=JSON.parse(i);let o=!1;s["nano-staged"]&&(delete s["nano-staged"],o=!0,n.configRemoved=!0);const a=s.devDependencies,l=s.dependencies;if(a?.["nano-staged"]&&(delete a["nano-staged"],o=!0,n.dependencyRemoved=!0),l?.["nano-staged"]&&(delete l["nano-staged"],o=!0,n.dependencyRemoved=!0),o){const c=Ro(r,i,{useEditorconfig:t});Ee(r),Ve(r,`${JSON.stringify(s,void 0,c)}
|
|
1057
|
+
`,"utf8")}return n},"removeNanoStagedFromPackageJson"),Y4=lt((e,t)=>{for(const r of Yf){const n=C(e,r);x(n)&&(Ee(n,t),Vi(n),t.removedConfigCount+=1)}},"removeNanoStagedConfigFiles"),X4=lt((e,t)=>{const r=C(e,t,"pre-commit");if(!x(r))return!1;const n=J(r);if(n.includes("vis staged"))return!1;const i=n.split(`
|
|
1058
|
+
`);let s=!1;const o=[];for(const a of i){const l=a.trim();if(!s){let c=!1;for(const u of c3){const d=u.exec(l);if(d){const p=a.slice(0,a.length-a.trimStart().length),m=d[1]?.trim()??"",g=l.slice(d[0].length).trim(),$=[m,"vis staged",g].filter(Boolean);o.push(`${p}${$.join(" ")}`),s=!0,c=!0;break}}if(c)continue}o.push(a)}return s?(Ee(r),Ve(r,o.join(`
|
|
1059
|
+
`)),!0):!1},"rewritePreCommitHook"),Q4=lt((e,t,r)=>{if(t==="package.json")return z4(e);const n=C(e,t);if(!z1.includes(t)){de(r,`${t} cannot be auto-migrated — please add "staged" config to vis.config.ts manually`),be(r,`Manually convert ${t} to staged config in vis.config.ts`);return}if(t===".nanostagedrc"&&!es(n)){de(r,".nanostagedrc is not JSON format — please migrate manually");return}return H4(n)},"extractConfig"),lk=lt((e,t,r)=>{const{configRemoved:n,dependencyRemoved:i}=K4(e,r);n&&(t.inlinedLintStagedConfigCount+=1),i&&(t.removedPackageCount+=1),Y4(e,t)},"cleanupNanoStagedArtifacts"),Z4=lt((e,t,r,n)=>{const i=[".vis-hooks",".husky"];for(const s of i)x(C(e,s))&&X4(e,s)&&(n.gitHooksConfigured=!0,t.silent||r.info(`Rewrote pre-commit hook in ${s}/ to use "vis staged"`))},"rewriteHooks"),e7=lt((e,t,r,n,i)=>{J4(e,t,n)&&(i.mergedStagedConfigCount+=1),lk(e,i,r.useEditorconfig),Z4(e,r,n,i)},"applyMigration"),uy=lt((e,t,r,n)=>{const i=ck(e);if(!i)return t.silent||r.info("No nano-staged configuration found — nothing to migrate."),!1;if(G4(e)&&(de(n,'Non-JSON nano-staged config found — please migrate to "staged" in vis.config.ts manually'),be(n,"Convert your nano-staged config file to JSON format or add staged config to vis.config.ts manually")),q4(e))return de(n,'vis.config.ts already has a "staged" config — skipping nano-staged merge'),t.silent||r.warn('vis.config.ts already has a "staged" config — skipping'),t.dryRun||lk(e,n,t.useEditorconfig),!0;const s=Q4(e,i,n);return!s||Object.keys(s).length===0?(t.silent||r.warn("nano-staged config is empty — skipping"),!1):t.dryRun?(t.silent||(r.info("[dry-run] Would insert staged config into vis.config.ts:"),r.info(rd(s))),!0):(e7(e,s,t,r,n),!0)},"migrateNanoStaged");var t7=Object.defineProperty,Te=f((e,t)=>t7(e,"name",{value:t,configurable:!0}),"g$7");const r7=new Set([".cache",".git",".next",".nx",".output",".svelte-kit",".turbo",".vercel",".vis","build","coverage","dist","node_modules"]),n7=Te((e,t=8)=>{const r=[],n=Te((i,s)=>{if(s>t)return;let o;try{o=Kt(i)}catch{return}for(const a of o){if(r7.has(a)||a.startsWith("."))continue;const l=C(i,a);let c;try{c=Pi(l)}catch{continue}c.isDirectory()?n(l,s+1):a==="project.json"&&r.push(l)}},"walk");return n(e,0),r},"findProjectJsonFiles"),i7={"@nx/eslint:lint":"lint:eslint","@nx/jest:jest":"test","@nx/js:tsc":"build","@nx/next:build":"build","@nx/playwright:playwright":"test:e2e","@nx/storybook:build":"build-storybook","@nx/vite:build":"build","@nx/vite:test":"test","@nx/webpack:webpack":"build"},s7=Te((e,t)=>{const r={};for(const[n,i]of Object.entries(e)){if(!n.includes(":")){r[n]=i;continue}const s=i7[n],o=s?`Dropped \`${n}\` from tasks — vis uses package.json scripts as targets. Move its settings to \`${s}\` if appropriate.`:`Dropped \`${n}\` from tasks — vis only supports script-name targets, not nx-namespaced executors.`;t.warnings.push(o)}return r},"stripNamespacedTargetDefaults"),o7=Te((e,t,r)=>{const n={};return e.namedInputs&&Object.keys(e.namedInputs).length>0&&(n.namedInputs=e.namedInputs),e.targetDefaults&&Object.keys(e.targetDefaults).length>0&&(n.tasks=e.targetDefaults),["// Migrated from nx.json by `vis migrate nx`.","// Per-project project.json files are compatible with vis and do not need to be rewritten —","// vis already reads targets, tags, implicitDependencies, and sourceRoot.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${om(n,C(t,"vis.config.ts"),r)});`,""].join(`
|
|
1060
|
+
`)},"renderVisConfig"),vu=/node_modules\/nx\/schemas\/project-schema\.json$/u,a7=Te((e,t,r,n)=>{let i=0;for(const s of e){if(t.dryRun){const o=cm(s);o?.$schema&&vu.test(o.$schema)&&(r.info(`Would rewrite $schema in ${s}`),i+=1);continue}Wc(s,o=>{if(!(!o.$schema||!vu.test(o.$schema)))return o.$schema=o.$schema.replace(vu,"node_modules/@visulima/vis/schemas/project.schema.json"),o},n,{useEditorconfig:t.useEditorconfig})&&(i+=1)}return i>0&&r.info(`Rewrote $schema in ${String(i)} project.json file(s).`),i},"rewriteProjectJsonSchemas"),cm=Te(e=>{if(x(e))try{return JSON.parse(J(e))}catch{return}},"readProjectJsonSafe"),c7=Te(e=>{const t=new Map,r=new Set;for(const n of e){const i=cm(n);if(!i?.name)continue;r.add(i.name);const s=C(Ge(n),"package.json");if(x(s))try{const o=JSON.parse(J(s));o.name&&o.name!==i.name&&t.set(o.name,i.name)}catch{}}return{knownProjects:r,pkgToProject:t}},"discoverPackageToProjectMap"),l7=/&&|\|\||[;|><`]|\$\(/u,u7=/[*[\]^.]/u,bu=Te((e,t)=>{if(t===""){e.complex=!0;return}if(t.startsWith("!")){e.hasExclusion=!0;return}if(u7.test(t)||t.includes("...")){e.hasGlob=!0;return}e.filters.push(t)},"collectFilterValue"),p7=Te(e=>{if(typeof e!="string"||e.trim()===""||l7.test(e)||/['"]/u.test(e))return null;const t=e.trim().split(/\s+/u);if(t[0]!=="pnpm"&&t[0]!=="pnpm.cmd")return null;const r={complex:!1,filters:[],hasExclusion:!1,hasGlob:!1,parallel:!1,recursive:!1,target:""};let n=1;for(;n<t.length;){const i=t[n];if(i==="--filter"||i==="-F"){const s=t[n+1];if(s===void 0)return r.complex=!0,r;bu(r,s),n+=2;continue}if(i.startsWith("--filter=")){bu(r,i.slice(9)),n+=1;continue}if(i.startsWith("-F=")){bu(r,i.slice(3)),n+=1;continue}if(i==="--parallel"){r.parallel=!0,n+=1;continue}if(i==="-r"||i==="--recursive"){r.recursive=!0,n+=1;continue}if(i==="--workspace-root"||i==="-w")return r.complex=!0,r;if(i==="run"||i==="exec"){if(i==="exec")return r.complex=!0,r;n+=1;continue}return i.startsWith("-")?(r.complex=!0,r):(r.target=i,n+=1,n<t.length&&(r.complex=!0),r)}return r.complex=!0,r},"parsePnpmFilterCommand"),d7=Te((e,t)=>{const r=[],n=[];for(const i of e){const s=t.pkgToProject.get(i);if(s!==void 0){r.push(s);continue}if(t.knownProjects.has(i)){r.push(i);continue}n.push(i)}return{mapped:r,unmapped:n}},"mapFiltersToProjects"),f7=Te((e,t)=>{const r=["vis","run",e.target];if(t.length>0){const n=[...t].sort((i,s)=>i.localeCompare(s)).join(",");r.push(`--projects=${n}`)}return r.join(" ")},"renderVisRunScript"),m7=new Set(["dev","dev:server","dev:watch","serve","start:dev","storybook","watch"]),h7=Te((e,t,r,n,i)=>{const s={rewrittenTargets:new Set,unmappedHits:[]},o=C(e,"package.json");if(!x(o))return s;let a;try{a=JSON.parse(J(o))}catch{return s}if(!a.scripts)return s;const l=new Map;for(const[c,u]of Object.entries(a.scripts)){const d=p7(u);if(!d||d.target===""||d.complex)continue;if(d.hasExclusion||d.hasGlob){i.warnings.push(`pnpm filter in scripts.${c} uses ${d.hasExclusion?"an exclusion (!)":"a glob/dependency selector"} — left untouched. Translate by hand to \`vis run ${d.target} --projects=...\` once you decide which projects should be selected.`);continue}if(d.filters.length===0&&!d.recursive)continue;const p=d7(d.filters,t);if(p.unmapped.length>0){s.unmappedHits.push({filters:p.unmapped,script:c});continue}const m=f7(d,p.mapped);m!==u&&(l.set(c,m),s.rewrittenTargets.add(d.target))}if(l.size===0)return s;if(r.dryRun){for(const[c,u]of l){const d=a.scripts[c];n.info(`Would rewrite scripts.${c}: \`${d??""}\` → \`${u}\``)}return s}return Wc(o,c=>{if(!c.scripts)return;const u={...c.scripts};let d=!1;for(const[p,m]of l)u[p]!==void 0&&u[p]!==m&&(u[p]=m,d=!0);if(d)return c.scripts=u,c},i,{useEditorconfig:r.useEditorconfig}),n.info(`Rewrote ${String(l.size)} pnpm-filter script(s) in package.json to use \`vis run\`.`),s},"applyPnpmFilterScriptRewrites"),g7=Te((e,t,r)=>{let n=e.targetDefaults??{},i=!1;for(const s of t){if(!m7.has(s))continue;const o={...n[s]??{}};let a=!1;o.persistent!==!0&&(o.persistent=!0,a=!0),o.cache!==!1&&(o.cache=!1,a=!0),a&&(n={...n,[s]:o},i=!0,r.manualSteps.push(`tasks.${s} set to { persistent: true, cache: false } — long-running task auto-detected from rewritten pnpm filter scripts. Adjust if your ${s} is actually short-lived.`))}i&&(e.targetDefaults=n)},"ensurePersistentTargetDefaults"),y7=Te(e=>{if(e.executor!=="nx:run-script")return!1;const t=Object.keys(e.options??{});return t.length===0||t.length===1&&t[0]==="script"},"isNxRunScriptShim"),v7=Te((e,t,r,n)=>{let i=0;const s=[];for(const o of e){const a=cm(o);if(!a?.targets||Object.keys(a.targets).length===0)continue;const l=a.name??"<unnamed>",c=[],u=[];for(const[p,m]of Object.entries(a.targets))m.syncGenerators&&m.syncGenerators.length>0&&u.push({sync:[...m.syncGenerators],target:p}),y7(m)||c.push(p);const d=c.length===0;d?t.dryRun?(r.info(`Would remove targets block from ${o} (all entries are nx:run-script shims).`),i+=1):(Wc(o,p=>{if(p.targets)return delete p.targets,p},n,{useEditorconfig:t.useEditorconfig}),i+=1):s.push({file:o,name:l,nonShimTargets:c,syncGenerators:u}),d&&u.length>0&&s.push({file:o,name:l,nonShimTargets:[],syncGenerators:u})}return i>0&&r.info(`Removed targets block from ${String(i)} project.json file(s) (entries were nx:run-script shims).`),{droppedTargetBlocks:i,punchList:s}},"translateProjectJsonTargets"),b7=Te((e,t,r,n)=>{const i=C(e,"pnpm-workspace.yaml");if(!x(i))return{catalogEntriesRemoved:0,onlyBuiltRemoved:!1};let s;try{s=Mt(i)}catch{return{catalogEntriesRemoved:0,onlyBuiltRemoved:!1}}if(!s||typeof s!="object")return{catalogEntriesRemoved:0,onlyBuiltRemoved:!1};let o=0;const a=Te(p=>p==="nx"||p.startsWith("@nx/"),"isNxKey"),l=Te((p,m,g)=>{if(!p||typeof p!="object")return;const $=Object.keys(p).length,S=Object.fromEntries(Object.entries(p).filter(([v])=>!a(v))),k=$-Object.keys(S).length;k>0&&(o+=k,m[g]=S)},"stripBucketInto");l(s.catalog,s,"catalog");const c=s.catalogs;if(c&&typeof c=="object")for(const[p,m]of Object.entries(c))l(m,c,p);let u=!1;const d=s.onlyBuiltDependencies;if(Array.isArray(d)){const p=d.filter(m=>m!=="nx");p.length!==d.length&&(s.onlyBuiltDependencies=p,u=!0)}return(o>0||u)&&(t.dryRun?(o>0&&r.info(`Would remove ${String(o)} nx-related catalog entr(y/ies) from pnpm-workspace.yaml.`),u&&r.info("Would remove `nx` from pnpm-workspace.yaml#onlyBuiltDependencies.")):(Ee(i,n),xo(i,s),o>0&&r.info(`Removed ${String(o)} nx-related catalog entr(y/ies) from pnpm-workspace.yaml.`),u&&r.info("Removed `nx` from pnpm-workspace.yaml#onlyBuiltDependencies."))),{catalogEntriesRemoved:o,onlyBuiltRemoved:u}},"cleanPnpmWorkspaceYaml"),$7=Te(e=>{const t={eslintHits:[],ignoreFile:!1,nxJson:!1,pkgDevDeps:[],pkgScripts:[],workflowHits:[]};x(C(e,"nx.json"))&&(t.nxJson=!0),x(C(e,".github/ignore-files-for-nx-affected.yml"))&&(t.ignoreFile=!0);const r=C(e,"package.json");if(x(r))try{const i=JSON.parse(J(r));if(i.devDependencies)for(const s of Object.keys(i.devDependencies))(s==="nx"||s.startsWith("@nx/")||s.startsWith("@nrwl/"))&&t.pkgDevDeps.push(s);if(i.scripts)for(const[s,o]of Object.entries(i.scripts))typeof o=="string"&&(/\bnx\s+(?:run-many|run|affected|exec|reset|repair)\b/u.test(o)||o.startsWith("nx "))&&t.pkgScripts.push(s)}catch{}const n=C(e,".github/workflows");if(x(n))try{for(const i of Kt(n)){if(!i.endsWith(".yml")&&!i.endsWith(".yaml"))continue;const s=C(n,i),o=J(s);/nrwl\/nx-set-shas/u.test(o)&&t.workflowHits.push({file:`.github/workflows/${i}`,reason:"uses nrwl/nx-set-shas action"}),/\bNX_BRANCH\b|\bNX_RUN_GROUP\b/u.test(o)&&t.workflowHits.push({file:`.github/workflows/${i}`,reason:"sets NX_BRANCH / NX_RUN_GROUP env"}),(/--files=\$\{\{[^}]*tj-actions/u.test(o)||/tj-actions\/changed-files/u.test(o))&&t.workflowHits.push({file:`.github/workflows/${i}`,reason:"uses tj-actions/changed-files (no longer needed; vis does its own affected diff)"})}}catch{}for(const i of["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts",".eslintrc.json",".eslintrc.js"]){const s=C(e,i);if(!x(s))continue;const o=J(s);/@nx\/eslint-plugin|@nx\/enforce-module-boundaries|@nx\/dependency-checks|@nx\/nx-plugin-checks/u.test(o)&&t.eslintHits.push(i)}return t},"collectCleanupChecklist"),w7=Te((e,t,r)=>{const n=[];if(e.nxJson&&!r.backedUpNxJson&&n.push(`Remove ${C(t,"nx.json")} once you're satisfied with vis.config.ts.`),e.ignoreFile&&n.push("Delete .github/ignore-files-for-nx-affected.yml — vis uses git-based affected diff and has no equivalent."),e.pkgDevDeps.length>0&&n.push(`Remove these nx devDependencies from package.json: ${e.pkgDevDeps.join(", ")}.`),e.pkgScripts.length>0&&n.push(`Rewrite these package.json scripts to use \`vis run\`: ${e.pkgScripts.join(", ")}.`),e.workflowHits.length>0){const i=new Map;for(const s of e.workflowHits){const o=i.get(s.file)??new Set;o.add(s.reason),i.set(s.file,o)}for(const[s,o]of i)n.push(`Update ${s}: ${[...o].join("; ")}.`)}return e.eslintHits.length>0&&n.push(`Remove @nx/eslint-plugin imports + rules (enforce-module-boundaries, dependency-checks, nx-plugin-checks) from: ${e.eslintHits.join(", ")}. There is no vis equivalent yet.`),n.map((i,s)=>`${String(s+1)}. ${i}`)},"formatChecklist"),k7=Te((e,t)=>{if(e.length!==0){t.info(""),t.info("── Post-migrate cleanup ──");for(const r of e)t.info(r)}},"printChecklist"),py=Te((e,t)=>{const r=ho(e,t);return r.startsWith("..")?t:r.split(HE).join("/")},"relativeFromRoot"),dy=Te((e,t,r,n)=>{const i=ak(e,"nx.json");if(!i){r.warn("No nx.json found in workspace root — nothing to migrate."),n.warnings.push("No nx.json at workspace root.");return}i.targetDefaults&&(i.targetDefaults=s7(i.targetDefaults,n));const s=n7(e),o=c7(s),a=h7(e,o,t,r,n);g7(i,a.rewrittenTargets,n);for(const p of a.unmappedHits)n.warnings.push(`scripts.${p.script}: pnpm filter(s) ${p.filters.map(m=>`\`${m}\``).join(", ")} don't match any known project.json#name or sibling package.json#name. Left untouched — fix the filter or add the missing project.json before re-running.`);const l=o7(i,e,t.useEditorconfig);if(!am(e,l,t,r,n))return;a7(s,t,r,n);const{punchList:c}=v7(s,t,r,n);for(const p of c){p.nonShimTargets.length>0&&n.manualSteps.push(`Review targets in ${py(e,p.file)} (project: ${p.name}) — non-shim targets need manual review: ${p.nonShimTargets.join(", ")}.`);for(const m of p.syncGenerators)n.warnings.push(`syncGenerators on \`${p.name}#${m.target}\` (${py(e,p.file)}) has no vis equivalent. Move ${m.sync.join(", ")} into a \`prebuild\` script in package.json or a vis plugin.`)}b7(e,t,r,n),n.manualSteps.push("vis adds two task primitives nx doesn't expose declaratively: `when: { os, env, branch, ci, not.* }` for conditional execution (replaces ad-hoc `configurations`) and `always: true` for finally/teardown tasks that run even when upstream fails. See docs/guides/conditional-and-finally-tasks.mdx."),(i.affected?.defaultBase||i.defaultBase)&&n.manualSteps.push(`nx's default base branch (${i.affected?.defaultBase??i.defaultBase}) is honoured by vis via the --base flag; no vis config change needed.`);const u=$7(e),d=w7(u,e,{});if(k7(d,r),t.force&&!t.dryRun&&u.nxJson){const p=C(e,"nx.json");Ee(p,n);try{Vi(p),r.info(`Removed ${p} (backup at ${p}.bak).`)}catch{}}},"migrateNx");var S7=Object.defineProperty,Tr=f((e,t)=>S7(e,"name",{value:t,configurable:!0}),"a$g");const uk=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],pk=[".secretlintignore"],dk=Tr(e=>uk.find(t=>x(C(e,t))),"detectSecretlintConfig"),fk=Tr(e=>pk.find(t=>x(C(e,t))),"detectSecretlintIgnore"),E7=Tr((e,t,r)=>{if(t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs"))return de(r,`${t} is a JS config — cannot auto-extract rule IDs. Review manually to confirm coverage.`),[];if(t.endsWith(".yml")||t.endsWith(".yaml"))return de(r,`${t} is YAML — cannot auto-extract rule IDs without a YAML parser. Review manually.`),[];const n=tt(C(e,t));if(!n)return[];const i=new Set,s=Tr(o=>{if(o)for(const a of o)a.id&&i.add(a.id),a.rules&&s(a.rules)},"walk");return s(n.rules),[...i]},"extractRuleIds"),D7=Tr((e,t,r,n)=>{for(const i of[...uk,...pk]){const s=C(e,i);if(x(s)){if(t){r.info(`[dry-run] Would remove ${s}`);continue}Ee(s,n),Vi(s),ot(n,"secretlint","removedConfigCount"),r.info(`Removed ${s}`)}}},"removeSecretlintConfigFiles"),C7=Tr((e,t,r,n)=>{const i=C(e,".secretlintignore");if(!x(i))return;const s=J(i).split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("#"));s.length!==0&&(be(n,`.secretlintignore contained ${String(s.length)} path pattern(s). vis secrets uses .gitignore + --exclude / --exclude-from; add these globs to your .gitignore or pass --exclude: ${s.slice(0,5).join(", ")}${s.length>5?", ...":""}`),t&&r.info(`[dry-run] Would consume ${i} (${String(s.length)} patterns) and surface as manual step.`))},"convertIgnoreFile"),A7=Tr((e,t,r,n,i)=>{const s=C(e,"package.json");if(!x(s))return;const o=tt(s);if(!o)return;let a=!1;if(o.scripts){for(const[c,u]of Object.entries(o.scripts))if(typeof u=="string"&&/\bsecretlint\b/.test(u)){const d=u.replaceAll(/\bsecretlint\b[^\n&|;]*/g,"vis secrets").trim();d!==u&&(o.scripts[c]=d,a=!0,ot(n,"secretlint","rewrittenScriptCount"),r.info(` scripts.${c}: "${u}" -> "${d}"`))}}if(o.devDependencies){const c=o.devDependencies,u=[];for(const d of Object.keys(c))(d==="secretlint"||d.startsWith("@secretlint/"))&&(delete c[d],u.push(d),a=!0,ot(n,"secretlint","removedPackageCount"));u.length>0&&r.info(` removed ${String(u.length)} secretlint devDependencies: ${u.join(", ")}`)}if(!a)return;if(t){r.info(`[dry-run] Would update ${s}`);return}const l=br(s,J(s),{defaultIndent:" ",useEditorconfig:i});Ee(s,n),ze(s,`${JSON.stringify(o,null,l)}
|
|
1061
|
+
`)},"rewriteScripts"),O7=Tr((e,t,r,n)=>{const i=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"];for(const s of i){const o=C(e,s);if(!x(o))continue;const a=J(o);if(!/\bsecretlint\b/.test(a))continue;const l=a.replaceAll(/\bsecretlint\b[^\n&|;]*/g,"vis secrets --staged");if(t){r.info(`[dry-run] Would rewrite ${o}`);continue}Ee(o,n),ze(o,l),n.gitHooksConfigured=!0,r.info(`Rewrote secretlint invocation in ${s}`)}},"rewriteHooks"),fy=Tr((e,t,r,n)=>{const i=dk(e),s=fk(e);if(!(i??s))return t.silent||r.info("No secretlint artifacts found — nothing to migrate."),!1;if(i){const o=E7(e,i,n);r.info(`Found ${i}`),o.length>0?(r.info(` active rules/presets: ${o.join(", ")}`),be(n,`secretlint used these rules: ${o.join(", ")}. vis secrets ships the gitleaks ruleset (177 rules covering AWS/GCP/Azure/GitHub/Slack/Stripe and more). Verify parity before removing secretlint.`)):be(n,`Rule IDs could not be auto-extracted from ${i}. Verify that the bundled gitleaks ruleset covers your secretlint rule set.`)}return C7(e,t.dryRun,r,n),A7(e,t.dryRun,r,n,t.useEditorconfig),O7(e,t.dryRun,r,n),D7(e,t.dryRun,r,n),!0},"migrateSecretlint");var j7=Object.defineProperty,Xt=f((e,t)=>j7(e,"name",{value:t,configurable:!0}),"c$9");const $u="sherif",zc=/\bsherif\b/,nd={"empty-dependencies":"empty-deps","multiple-dependency-versions":"workspace-versions","non-existant-packages":"dead-workspace-patterns","packages-without-package-json":"missing-package-json","root-package-dependencies":"root-deps","root-package-manager-field":"root-package-manager","root-package-private-field":"root-private","types-in-dependencies":"types-in-deps","unordered-dependencies":void 0,"unsync-similar-dependencies":"similar-deps"},x7=Object.values(nd).filter(e=>e!==void 0),mk=Xt(e=>{const t=C(e,"package.json");return x(t)&&tt(t)?.sherif?"package.json":void 0},"detectSherifConfig"),hk=Xt(e=>{const t=C(e,"package.json");if(!x(t))return!1;const r=tt(t);if(!r)return!1;if(r.devDependencies?.sherif||r.dependencies?.sherif)return!0;if(r.scripts){for(const n of Object.values(r.scripts))if(typeof n=="string"&&zc.test(n))return!0}return!1},"detectSherifInstallation"),P7=Xt(e=>tt(C(e,"package.json"))?.sherif,"extractSherifFromPackageJson"),gk=Xt((e,t)=>{const r={unmapped:[],visDisabled:[]};if(!Array.isArray(e["ignore-rules"]))return r;for(const n of e["ignore-rules"]){if(typeof n!="string"||n.length===0)continue;const i=nd[n];if(i===void 0){n==="unordered-dependencies"?de(t,"sherif rule `unordered-dependencies` has no `vis lint` equivalent — vis covers ordering via `vis sort-package-json` (separate command). No migration needed; skip running it if you don't want it."):Object.hasOwn(nd,n)?r.unmapped.push(n):de(t,`sherif rule \`${n}\` is unknown to vis migrate — skipped.`);continue}r.visDisabled.push(i)}return r},"translateIgnoreRules"),yk=Xt(e=>{const t=x7.filter(r=>!e.includes(r));return t.length===0?"vis lint":`vis lint ${t.map(r=>`--${r}`).join(" ")}`},"buildPositiveLintCommand"),N7=Xt((e,t)=>{const r=C(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1,removedScripts:[],scriptCount:0};if(!x(r))return n;const i=J(r),s=JSON.parse(i);let o=!1;s.sherif&&(delete s.sherif,o=!0,n.configRemoved=!0);for(const l of["dependencies","devDependencies"]){const c=s[l];c?.sherif&&(delete c.sherif,o=!0,n.dependencyRemoved=!0)}const a=s.scripts;if(a){const l={};for(const[c,u]of Object.entries(a))typeof u=="string"&&zc.test(u)?(n.scriptCount+=1,n.removedScripts.push({name:c,value:u}),o=!0):l[c]=u;n.scriptCount>0&&(Object.keys(l).length===0?delete s.scripts:s.scripts=l)}if(o){const l=Ro(r,i,{useEditorconfig:t});Ee(r),Ve(r,`${JSON.stringify(s,void 0,l)}
|
|
1062
|
+
`,"utf8")}return n},"removeSherifFromPackageJson"),R7=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],F7=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],vk=Xt((e,t)=>{const r=[];for(const n of R7){const i=C(e,n);x(i)&&zc.test(J(i))&&(r.push(n),be(t,`Update ${n} — replace \`sherif\` invocation with \`vis lint\`.`))}return r},"detectHookReferences"),bk=Xt((e,t)=>{const r=[],n=Xt(i=>{const s=C(e,i);x(s)&&zc.test(J(s))&&(r.push(i),be(t,`Update ${i} — replace \`sherif\` invocation with \`vis lint\`.`))},"scanFile");for(const i of F7){const s=C(e,i);if(x(s)){if(i===".github/workflows"){try{for(const o of Kt(s))(o.endsWith(".yml")||o.endsWith(".yaml"))&&n(`.github/workflows/${o}`)}catch{}continue}n(i)}}return r},"detectCiReferences"),L7=Xt((e,t,r,n,i)=>{const s=gk(t,i);if(s.visDisabled.length>0){const p=yk(s.visDisabled);be(i,`sherif's \`ignore-rules\` was set to [${s.visDisabled.map(m=>JSON.stringify(m)).join(", ")}] (vis names). vis has no global rule-disable; replace any \`sherif\` script with the explicit positive list: \`${p}\`.`)}s.unmapped.length>0&&de(i,`sherif rule(s) [${s.unmapped.map(p=>JSON.stringify(p)).join(", ")}] could not be mapped — please re-evaluate manually.`),Array.isArray(t["ignore-dependencies"])&&t["ignore-dependencies"].length>0&&be(i,`sherif's \`ignore-dependencies\` was set to [${t["ignore-dependencies"].map(p=>JSON.stringify(p)).join(", ")}]. Mirror this in vis.config.ts under \`policy.workspaceVersions.ignore\`, \`policy.customTypes.ignore\`, \`policy.typesInDeps.ignore\` (and \`policy.redefineRoot.ignore\`) for the lints where it applies.`),Array.isArray(t["ignore-packages"])&&t["ignore-packages"].length>0&&(de(i,`sherif's \`ignore-packages\` was set to [${t["ignore-packages"].map(p=>JSON.stringify(p)).join(", ")}] — vis has no global package-skip yet (only per-rule scoping via policy.bannedDeps.{packages,paths}). Tracked alongside the dep filter work.`),be(i,"Re-evaluate sherif `ignore-packages` — vis has no equivalent global filter yet.")),Array.isArray(t["ignore-paths"])&&t["ignore-paths"].length>0&&(de(i,`sherif's \`ignore-paths\` was set to [${t["ignore-paths"].map(p=>JSON.stringify(p)).join(", ")}] — vis has no global path-skip yet.`),be(i,"Re-evaluate sherif `ignore-paths` — vis has no equivalent global filter yet."));const o=vk(e,i);o.length>0&&!r.silent&&n.warn(`Found sherif reference in ${String(o.length)} hook file(s) — see manualSteps for details.`);const a=bk(e,i);a.length>0&&!r.silent&&n.warn(`Found sherif reference in ${String(a.length)} CI file(s) — see manualSteps for details.`);const{configRemoved:l,dependencyRemoved:c,removedScripts:u,scriptCount:d}=N7(e,r.useEditorconfig);if(l&&!r.silent&&n.info("Removed `sherif` block from package.json"),l&&ot(i,$u,"removedConfigCount"),c&&ot(i,$u,"removedPackageCount"),d>0){ot(i,$u,"rewrittenScriptCount",d);for(const{name:p,value:m}of u)be(i,`Recreate script \`${p}\` (removed; was \`${m}\`). Replace \`sherif\` with \`vis lint\` (sherif's lint surface ≈ \`vis lint\`).`);r.silent||n.info(`Removed ${String(d)} script(s) referencing \`sherif\`. Replace with \`vis lint\`.`)}},"applyMigration"),my=Xt((e,t,r,n)=>{const i=mk(e),s=hk(e);if(!i&&!s)return t.silent||r.info("No sherif configuration or installation found — nothing to migrate."),!1;const o=P7(e)??{};if(t.dryRun){const a=gk(o,n);if(vk(e,n),bk(e,n),!t.silent&&(i&&r.info("[dry-run] Would remove `sherif` block from package.json"),s&&r.info("[dry-run] Would strip `sherif` from devDependencies/scripts"),a.visDisabled.length>0)){const l=yk(a.visDisabled);r.info(`[dry-run] Suggested replacement script: ${l}`)}return!0}return L7(e,o,t,r,n),!0},"migrateSherif");var ia={exports:{}},wu,hy;function Fo(){return hy||(hy=1,wu={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}),wu}f(Fo,"requireConstants");var ku,gy;function Hc(){return gy||(gy=1,ku=process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),ku}f(Hc,"requireDebug");var yy;function Lo(){return yy||(yy=1,(function(e,t){var r=Object.defineProperty,n=f((v,h)=>r(v,"name",{value:h,configurable:!0}),"O");const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:o}=Fo(),a=Hc();t=e.exports={};const l=t.re=[],c=t.safeRe=[],u=t.src=[],d=t.safeSrc=[],p=t.t={};let m=0;const g="[a-zA-Z0-9-]",$=[["\\s",1],["\\d",o],[g,s]],S=n(v=>{for(const[h,b]of $)v=v.split(`${h}*`).join(`${h}{0,${b}}`).split(`${h}+`).join(`${h}{1,${b}}`);return v},"makeSafeRegex"),k=n((v,h,b)=>{const w=S(h),y=m++;a(v,y,h),p[v]=y,u[y]=h,d[y]=w,l[y]=new RegExp(h,b?"g":void 0),c[y]=new RegExp(w,b?"g":void 0)},"createToken");k("NUMERICIDENTIFIER","0|[1-9]\\d*"),k("NUMERICIDENTIFIERLOOSE","\\d+"),k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),k("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),k("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),k("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),k("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),k("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),k("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),k("BUILDIDENTIFIER",`${g}+`),k("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),k("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),k("FULL",`^${u[p.FULLPLAIN]}$`),k("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),k("LOOSE",`^${u[p.LOOSEPLAIN]}$`),k("GTLT","((?:<|>)?=?)"),k("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),k("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),k("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),k("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),k("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),k("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),k("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),k("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?(?:${u[p.BUILD]})?(?:$|[^\\d])`),k("COERCERTL",u[p.COERCE],!0),k("COERCERTLFULL",u[p.COERCEFULL],!0),k("LONETILDE","(?:~>?)"),k("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",k("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),k("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),k("LONECARET","(?:\\^)"),k("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",k("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),k("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),k("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),k("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),k("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",k("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),k("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),k("STAR","(<|>)?=?\\s*\\*"),k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ia,ia.exports)),ia.exports}f(Lo,"requireRe");var Su,vy;function lm(){if(vy)return Su;vy=1;var e=Object.defineProperty,t=f((s,o)=>e(s,"name",{value:o,configurable:!0}),"t");const r=Object.freeze({loose:!0}),n=Object.freeze({});return Su=t(s=>s?typeof s!="object"?r:s:n,"parseOptions"),Su}f(lm,"requireParseOptions");var Eu,by;function $k(){if(by)return Eu;by=1;var e=Object.defineProperty,t=f((s,o)=>e(s,"name",{value:o,configurable:!0}),"s");const r=/^[0-9]+$/,n=t((s,o)=>{if(typeof s=="number"&&typeof o=="number")return s===o?0:s<o?-1:1;const a=r.test(s),l=r.test(o);return a&&l&&(s=+s,o=+o),s===o?0:a&&!l?-1:l&&!a?1:s<o?-1:1},"compareIdentifiers"),i=t((s,o)=>n(o,s),"rcompareIdentifiers");return Eu={compareIdentifiers:n,rcompareIdentifiers:i},Eu}f($k,"requireIdentifiers");var Du,$y;function ut(){if($y)return Du;$y=1;var e=Object.defineProperty,t=f((u,d)=>e(u,"name",{value:d,configurable:!0}),"a");const r=Hc(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:i}=Fo(),{safeRe:s,t:o}=Lo(),a=lm(),{compareIdentifiers:l}=$k();class c{static{f(this,"SemVer")}static{t(this,"SemVer")}constructor(d,p){if(p=a(p),d instanceof c){if(d.loose===!!p.loose&&d.includePrerelease===!!p.includePrerelease)return d;d=d.version}else if(typeof d!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof d}".`);if(d.length>n)throw new TypeError(`version is longer than ${n} characters`);r("SemVer",d,p),this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease;const m=d.trim().match(p.loose?s[o.LOOSE]:s[o.FULL]);if(!m)throw new TypeError(`Invalid Version: ${d}`);if(this.raw=d,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){const $=+g;if($>=0&&$<i)return $}return g}):this.prerelease=[],this.build=m[5]?m[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(d){if(r("SemVer.compare",this.version,this.options,d),!(d instanceof c)){if(typeof d=="string"&&d===this.version)return 0;d=new c(d,this.options)}return d.version===this.version?0:this.compareMain(d)||this.comparePre(d)}compareMain(d){return d instanceof c||(d=new c(d,this.options)),this.major<d.major?-1:this.major>d.major?1:this.minor<d.minor?-1:this.minor>d.minor?1:this.patch<d.patch?-1:this.patch>d.patch?1:0}comparePre(d){if(d instanceof c||(d=new c(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;let p=0;do{const m=this.prerelease[p],g=d.prerelease[p];if(r("prerelease compare",p,m,g),m===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(m===void 0)return-1;if(m!==g)return l(m,g)}while(++p)}compareBuild(d){d instanceof c||(d=new c(d,this.options));let p=0;do{const m=this.build[p],g=d.build[p];if(r("build compare",p,m,g),m===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(m===void 0)return-1;if(m!==g)return l(m,g)}while(++p)}inc(d,p,m){if(d.startsWith("pre")){if(!p&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(p){const g=`-${p}`.match(this.options.loose?s[o.PRERELEASELOOSE]:s[o.PRERELEASE]);if(!g||g[1]!==p)throw new Error(`invalid identifier: ${p}`)}}switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",p,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",p,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",p,m),this.inc("pre",p,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",p,m),this.inc("pre",p,m);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":{const g=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let $=this.prerelease.length;for(;--$>=0;)typeof this.prerelease[$]=="number"&&(this.prerelease[$]++,$=-2);if($===-1){if(p===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(p){let $=[p,g];m===!1&&($=[p]),l(this.prerelease[0],p)===0?isNaN(this.prerelease[1])&&(this.prerelease=$):this.prerelease=$}break}default:throw new Error(`invalid increment argument: ${d}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Du=c,Du}f(ut,"requireSemver$1");var Cu,wy;function ii(){if(wy)return Cu;wy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=ut();return Cu=t((i,s,o=!1)=>{if(i instanceof r)return i;try{return new r(i,s)}catch(a){if(!o)return null;throw a}},"parse"),Cu}f(ii,"requireParse");var Au,ky;function I7(){if(ky)return Au;ky=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=ii();return Au=t((i,s)=>{const o=r(i,s);return o?o.version:null},"valid"),Au}f(I7,"requireValid$1");var Ou,Sy;function T7(){if(Sy)return Ou;Sy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=ii();return Ou=t((i,s)=>{const o=r(i.trim().replace(/^[=v]+/,""),s);return o?o.version:null},"clean"),Ou}f(T7,"requireClean");var ju,Ey;function B7(){if(Ey)return ju;Ey=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"u");const r=ut();return ju=t((i,s,o,a,l)=>{typeof o=="string"&&(l=a,a=o,o=void 0);try{return new r(i instanceof r?i.version:i,o).inc(s,a,l).version}catch{return null}},"inc"),ju}f(B7,"requireInc");var xu,Dy;function _7(){if(Dy)return xu;Dy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"u");const r=ii();return xu=t((i,s)=>{const o=r(i,null,!0),a=r(s,null,!0),l=o.compare(a);if(l===0)return null;const c=l>0,u=c?o:a,d=c?a:o,p=!!u.prerelease.length;if(d.prerelease.length&&!p){if(!d.patch&&!d.minor)return"major";if(d.compareMain(u)===0)return d.minor&&!d.patch?"minor":"patch"}const m=p?"pre":"";return o.major!==a.major?m+"major":o.minor!==a.minor?m+"minor":o.patch!==a.patch?m+"patch":"prerelease"},"diff"),xu}f(_7,"requireDiff");var Pu,Cy;function M7(){if(Cy)return Pu;Cy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"r");const r=ut();return Pu=t((i,s)=>new r(i,s).major,"major"),Pu}f(M7,"requireMajor");var Nu,Ay;function V7(){if(Ay)return Nu;Ay=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"r");const r=ut();return Nu=t((i,s)=>new r(i,s).minor,"minor"),Nu}f(V7,"requireMinor");var Ru,Oy;function W7(){if(Oy)return Ru;Oy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=ut();return Ru=t((i,s)=>new r(i,s).patch,"patch"),Ru}f(W7,"requirePatch");var Fu,jy;function U7(){if(jy)return Fu;jy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=ii();return Fu=t((i,s)=>{const o=r(i,s);return o&&o.prerelease.length?o.prerelease:null},"prerelease"),Fu}f(U7,"requirePrerelease");var Lu,xy;function tr(){if(xy)return Lu;xy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"c");const r=ut();return Lu=t((i,s,o)=>new r(i,o).compare(new r(s,o)),"compare"),Lu}f(tr,"requireCompare");var Iu,Py;function G7(){if(Py)return Iu;Py=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"o");const r=tr();return Iu=t((i,s,o)=>r(s,i,o),"rcompare"),Iu}f(G7,"requireRcompare");var Tu,Ny;function q7(){if(Ny)return Tu;Ny=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"r");const r=tr();return Tu=t((i,s)=>r(i,s,!0),"compareLoose"),Tu}f(q7,"requireCompareLoose");var Bu,Ry;function um(){if(Ry)return Bu;Ry=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"o");const r=ut();return Bu=t((i,s,o)=>{const a=new r(i,o),l=new r(s,o);return a.compare(l)||a.compareBuild(l)},"compareBuild"),Bu}f(um,"requireCompareBuild");var _u,Fy;function z7(){if(Fy)return _u;Fy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"e");const r=um();return _u=t((i,s)=>i.sort((o,a)=>r(o,a,s)),"sort"),_u}f(z7,"requireSort");var Mu,Ly;function H7(){if(Ly)return Mu;Ly=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"e");const r=um();return Mu=t((i,s)=>i.sort((o,a)=>r(a,o,s)),"rsort"),Mu}f(H7,"requireRsort");var Vu,Iy;function Jc(){if(Iy)return Vu;Iy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"r");const r=tr();return Vu=t((i,s,o)=>r(i,s,o)>0,"gt"),Vu}f(Jc,"requireGt");var Wu,Ty;function pm(){if(Ty)return Wu;Ty=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"r");const r=tr();return Wu=t((i,s,o)=>r(i,s,o)<0,"lt"),Wu}f(pm,"requireLt");var Uu,By;function wk(){if(By)return Uu;By=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"r");const r=tr();return Uu=t((i,s,o)=>r(i,s,o)===0,"eq"),Uu}f(wk,"requireEq");var Gu,_y;function kk(){if(_y)return Gu;_y=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"r");const r=tr();return Gu=t((i,s,o)=>r(i,s,o)!==0,"neq"),Gu}f(kk,"requireNeq");var qu,My;function dm(){if(My)return qu;My=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"r");const r=tr();return qu=t((i,s,o)=>r(i,s,o)>=0,"gte"),qu}f(dm,"requireGte");var zu,Vy;function fm(){if(Vy)return zu;Vy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"r");const r=tr();return zu=t((i,s,o)=>r(i,s,o)<=0,"lte"),zu}f(fm,"requireLte");var Hu,Wy;function Sk(){if(Wy)return Hu;Wy=1;var e=Object.defineProperty,t=f((c,u)=>e(c,"name",{value:u,configurable:!0}),"n");const r=wk(),n=kk(),i=Jc(),s=dm(),o=pm(),a=fm();return Hu=t((c,u,d,p)=>{switch(u){case"===":return typeof c=="object"&&(c=c.version),typeof d=="object"&&(d=d.version),c===d;case"!==":return typeof c=="object"&&(c=c.version),typeof d=="object"&&(d=d.version),c!==d;case"":case"=":case"==":return r(c,d,p);case"!=":return n(c,d,p);case">":return i(c,d,p);case">=":return s(c,d,p);case"<":return o(c,d,p);case"<=":return a(c,d,p);default:throw new TypeError(`Invalid operator: ${u}`)}},"cmp"),Hu}f(Sk,"requireCmp");var Ju,Uy;function J7(){if(Uy)return Ju;Uy=1;var e=Object.defineProperty,t=f((a,l)=>e(a,"name",{value:l,configurable:!0}),"u");const r=ut(),n=ii(),{safeRe:i,t:s}=Lo();return Ju=t((a,l)=>{if(a instanceof r)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;l=l||{};let c=null;if(!l.rtl)c=a.match(l.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);else{const $=l.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL];let S;for(;(S=$.exec(a))&&(!c||c.index+c[0].length!==a.length);)(!c||S.index+S[0].length!==c.index+c[0].length)&&(c=S),$.lastIndex=S.index+S[1].length+S[2].length;$.lastIndex=-1}if(c===null)return null;const u=c[2],d=c[3]||"0",p=c[4]||"0",m=l.includePrerelease&&c[5]?`-${c[5]}`:"",g=l.includePrerelease&&c[6]?`+${c[6]}`:"";return n(`${u}.${d}.${p}${m}${g}`,l)},"coerce"),Ju}f(J7,"requireCoerce");var Ku,Gy;function K7(){if(Gy)return Ku;Gy=1;var e=Object.defineProperty,t=f((c,u)=>e(c,"name",{value:u,configurable:!0}),"t");const r=ii(),n=Fo(),i=ut(),s=t((c,u,d)=>{if(!n.RELEASE_TYPES.includes(u))return null;const p=o(c,d);return p&&a(p,u)},"truncate"),o=t((c,u)=>{const d=c instanceof i?c.version:c;return r(d,u)},"cloneInputVersion"),a=t((c,u)=>{if(l(u))return c.version;switch(c.prerelease=[],u){case"major":c.minor=0,c.patch=0;break;case"minor":c.patch=0;break}return c.format()},"doTruncation"),l=t(c=>c.startsWith("pre"),"isPrerelease");return Ku=s,Ku}f(K7,"requireTruncate");var Yu,qy;function Y7(){if(qy)return Yu;qy=1;var e=Object.defineProperty,t=f((n,i)=>e(n,"name",{value:i,configurable:!0}),"i");class r{static{f(this,"LRUCache")}static{t(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(i){const s=this.map.get(i);if(s!==void 0)return this.map.delete(i),this.map.set(i,s),s}delete(i){return this.map.delete(i)}set(i,s){if(!this.delete(i)&&s!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(i,s)}return this}}return Yu=r,Yu}f(Y7,"requireLrucache");var Xu,zy;function rr(){if(zy)return Xu;zy=1;var e=Object.defineProperty,t=f((P,N)=>e(P,"name",{value:N,configurable:!0}),"o");const r=/\s+/g;class n{static{f(this,"Range")}static{t(this,"Range")}constructor(N,O){if(O=o(O),N instanceof n)return N.loose===!!O.loose&&N.includePrerelease===!!O.includePrerelease?N:new n(N.raw,O);if(N instanceof a)return this.raw=N.value,this.set=[[N]],this.formatted=void 0,this;if(this.options=O,this.loose=!!O.loose,this.includePrerelease=!!O.includePrerelease,this.raw=N.trim().replace(r," "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const R=this.set[0];if(this.set=this.set.filter(_=>!k(_[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const _ of this.set)if(_.length===1&&v(_[0])){this.set=[_];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let N=0;N<this.set.length;N++){N>0&&(this.formatted+="||");const O=this.set[N];for(let R=0;R<O.length;R++)R>0&&(this.formatted+=" "),this.formatted+=O[R].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(N){const O=((this.options.includePrerelease&&$)|(this.options.loose&&S))+":"+N,R=s.get(O);if(R)return R;const _=this.options.loose,L=_?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];N=N.replace(L,te(this.options.includePrerelease)),l("hyphen replace",N),N=N.replace(u[d.COMPARATORTRIM],p),l("comparator trim",N),N=N.replace(u[d.TILDETRIM],m),l("tilde trim",N),N=N.replace(u[d.CARETTRIM],g),l("caret trim",N);let T=N.split(" ").map(Q=>b(Q,this.options)).join(" ").split(/\s+/).map(Q=>ce(Q,this.options));_&&(T=T.filter(Q=>(l("loose invalid filter",Q,this.options),!!Q.match(u[d.COMPARATORLOOSE])))),l("range list",T);const U=new Map,q=T.map(Q=>new a(Q,this.options));for(const Q of q){if(k(Q))return[Q];U.set(Q.value,Q)}U.size>1&&U.has("")&&U.delete("");const X=[...U.values()];return s.set(O,X),X}intersects(N,O){if(!(N instanceof n))throw new TypeError("a Range is required");return this.set.some(R=>h(R,O)&&N.set.some(_=>h(_,O)&&R.every(L=>_.every(T=>L.intersects(T,O)))))}test(N){if(!N)return!1;if(typeof N=="string")try{N=new c(N,this.options)}catch{return!1}for(let O=0;O<this.set.length;O++)if(Y(this.set[O],N,this.options))return!0;return!1}}Xu=n;const i=Y7(),s=new i,o=lm(),a=Kc(),l=Hc(),c=ut(),{safeRe:u,t:d,comparatorTrimReplace:p,tildeTrimReplace:m,caretTrimReplace:g}=Lo(),{FLAG_INCLUDE_PRERELEASE:$,FLAG_LOOSE:S}=Fo(),k=t(P=>P.value==="<0.0.0-0","isNullSet"),v=t(P=>P.value==="","isAny"),h=t((P,N)=>{let O=!0;const R=P.slice();let _=R.pop();for(;O&&R.length;)O=R.every(L=>_.intersects(L,N)),_=R.pop();return O},"isSatisfiable"),b=t((P,N)=>(P=P.replace(u[d.BUILD],""),l("comp",P,N),P=E(P,N),l("caret",P),P=y(P,N),l("tildes",P),P=j(P,N),l("xrange",P),P=W(P,N),l("stars",P),P),"parseComparator"),w=t(P=>!P||P.toLowerCase()==="x"||P==="*","isX"),y=t((P,N)=>P.trim().split(/\s+/).map(O=>D(O,N)).join(" "),"replaceTildes"),D=t((P,N)=>{const O=N.loose?u[d.TILDELOOSE]:u[d.TILDE];return P.replace(O,(R,_,L,T,U)=>{l("tilde",P,R,_,L,T,U);let q;return w(_)?q="":w(L)?q=`>=${_}.0.0 <${+_+1}.0.0-0`:w(T)?q=`>=${_}.${L}.0 <${_}.${+L+1}.0-0`:U?(l("replaceTilde pr",U),q=`>=${_}.${L}.${T}-${U} <${_}.${+L+1}.0-0`):q=`>=${_}.${L}.${T} <${_}.${+L+1}.0-0`,l("tilde return",q),q})},"replaceTilde"),E=t((P,N)=>P.trim().split(/\s+/).map(O=>A(O,N)).join(" "),"replaceCarets"),A=t((P,N)=>{l("caret",P,N);const O=N.loose?u[d.CARETLOOSE]:u[d.CARET],R=N.includePrerelease?"-0":"";return P.replace(O,(_,L,T,U,q)=>{l("caret",P,_,L,T,U,q);let X;return w(L)?X="":w(T)?X=`>=${L}.0.0${R} <${+L+1}.0.0-0`:w(U)?L==="0"?X=`>=${L}.${T}.0${R} <${L}.${+T+1}.0-0`:X=`>=${L}.${T}.0${R} <${+L+1}.0.0-0`:q?(l("replaceCaret pr",q),L==="0"?T==="0"?X=`>=${L}.${T}.${U}-${q} <${L}.${T}.${+U+1}-0`:X=`>=${L}.${T}.${U}-${q} <${L}.${+T+1}.0-0`:X=`>=${L}.${T}.${U}-${q} <${+L+1}.0.0-0`):(l("no pr"),L==="0"?T==="0"?X=`>=${L}.${T}.${U}${R} <${L}.${T}.${+U+1}-0`:X=`>=${L}.${T}.${U}${R} <${L}.${+T+1}.0-0`:X=`>=${L}.${T}.${U} <${+L+1}.0.0-0`),l("caret return",X),X})},"replaceCaret"),j=t((P,N)=>(l("replaceXRanges",P,N),P.split(/\s+/).map(O=>G(O,N)).join(" ")),"replaceXRanges"),G=t((P,N)=>{P=P.trim();const O=N.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return P.replace(O,(R,_,L,T,U,q)=>{l("xRange",P,R,_,L,T,U,q);const X=w(L),Q=X||w(T),B=Q||w(U),F=B;return _==="="&&F&&(_=""),q=N.includePrerelease?"-0":"",X?_===">"||_==="<"?R="<0.0.0-0":R="*":_&&F?(Q&&(T=0),U=0,_===">"?(_=">=",Q?(L=+L+1,T=0,U=0):(T=+T+1,U=0)):_==="<="&&(_="<",Q?L=+L+1:T=+T+1),_==="<"&&(q="-0"),R=`${_+L}.${T}.${U}${q}`):Q?R=`>=${L}.0.0${q} <${+L+1}.0.0-0`:B&&(R=`>=${L}.${T}.0${q} <${L}.${+T+1}.0-0`),l("xRange return",R),R})},"replaceXRange"),W=t((P,N)=>(l("replaceStars",P,N),P.trim().replace(u[d.STAR],"")),"replaceStars"),ce=t((P,N)=>(l("replaceGTE0",P,N),P.trim().replace(u[N.includePrerelease?d.GTE0PRE:d.GTE0],"")),"replaceGTE0"),te=t(P=>(N,O,R,_,L,T,U,q,X,Q,B,F)=>(w(R)?O="":w(_)?O=`>=${R}.0.0${P?"-0":""}`:w(L)?O=`>=${R}.${_}.0${P?"-0":""}`:T?O=`>=${O}`:O=`>=${O}${P?"-0":""}`,w(X)?q="":w(Q)?q=`<${+X+1}.0.0-0`:w(B)?q=`<${X}.${+Q+1}.0-0`:F?q=`<=${X}.${Q}.${B}-${F}`:P?q=`<${X}.${Q}.${+B+1}-0`:q=`<=${q}`,`${O} ${q}`.trim()),"hyphenReplace"),Y=t((P,N,O)=>{for(let R=0;R<P.length;R++)if(!P[R].test(N))return!1;if(N.prerelease.length&&!O.includePrerelease){for(let R=0;R<P.length;R++)if(l(P[R].semver),P[R].semver!==a.ANY&&P[R].semver.prerelease.length>0){const _=P[R].semver;if(_.major===N.major&&_.minor===N.minor&&_.patch===N.patch)return!0}return!1}return!0},"testSet");return Xu}f(rr,"requireRange");var Qu,Hy;function Kc(){if(Hy)return Qu;Hy=1;var e=Object.defineProperty,t=f((d,p)=>e(d,"name",{value:p,configurable:!0}),"i");const r=Symbol("SemVer ANY");class n{static{f(this,"Comparator")}static{t(this,"Comparator")}static get ANY(){return r}constructor(p,m){if(m=i(m),p instanceof n){if(p.loose===!!m.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),l("comparator",p,m),this.options=m,this.loose=!!m.loose,this.parse(p),this.semver===r?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(p){const m=this.options.loose?s[o.COMPARATORLOOSE]:s[o.COMPARATOR],g=p.match(m);if(!g)throw new TypeError(`Invalid comparator: ${p}`);this.operator=g[1]!==void 0?g[1]:"",this.operator==="="&&(this.operator=""),g[2]?this.semver=new c(g[2],this.options.loose):this.semver=r}toString(){return this.value}test(p){if(l("Comparator.test",p,this.options.loose),this.semver===r||p===r)return!0;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}return a(p,this.operator,this.semver,this.options)}intersects(p,m){if(!(p instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(p.value,m).test(this.value):p.operator===""?p.value===""?!0:new u(this.value,m).test(p.semver):(m=i(m),m.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||a(this.semver,"<",p.semver,m)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||a(this.semver,">",p.semver,m)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}Qu=n;const i=lm(),{safeRe:s,t:o}=Lo(),a=Sk(),l=Hc(),c=ut(),u=rr();return Qu}f(Kc,"requireComparator");var Zu,Jy;function Yc(){if(Jy)return Zu;Jy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=rr();return Zu=t((i,s,o)=>{try{s=new r(s,o)}catch{return!1}return s.test(i)},"satisfies"),Zu}f(Yc,"requireSatisfies");var ep,Ky;function X7(){if(Ky)return ep;Ky=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"t");const r=rr();return ep=t((i,s)=>new r(i,s).set.map(o=>o.map(a=>a.value).join(" ").trim().split(" ")),"toComparators"),ep}f(X7,"requireToComparators");var tp,Yy;function Q7(){if(Yy)return tp;Yy=1;var e=Object.defineProperty,t=f((s,o)=>e(s,"name",{value:o,configurable:!0}),"c");const r=ut(),n=rr();return tp=t((s,o,a)=>{let l=null,c=null,u=null;try{u=new n(o,a)}catch{return null}return s.forEach(d=>{u.test(d)&&(!l||c.compare(d)===-1)&&(l=d,c=new r(l,a))}),l},"maxSatisfying"),tp}f(Q7,"requireMaxSatisfying");var rp,Xy;function Z7(){if(Xy)return rp;Xy=1;var e=Object.defineProperty,t=f((s,o)=>e(s,"name",{value:o,configurable:!0}),"u");const r=ut(),n=rr();return rp=t((s,o,a)=>{let l=null,c=null,u=null;try{u=new n(o,a)}catch{return null}return s.forEach(d=>{u.test(d)&&(!l||c.compare(d)===1)&&(l=d,c=new r(l,a))}),l},"minSatisfying"),rp}f(Z7,"requireMinSatisfying");var np,Qy;function e5(){if(Qy)return np;Qy=1;var e=Object.defineProperty,t=f((o,a)=>e(o,"name",{value:a,configurable:!0}),"i");const r=ut(),n=rr(),i=Jc();return np=t((o,a)=>{o=new n(o,a);let l=new r("0.0.0");if(o.test(l)||(l=new r("0.0.0-0"),o.test(l)))return l;l=null;for(let c=0;c<o.set.length;++c){const u=o.set[c];let d=null;u.forEach(p=>{const m=new r(p.semver.version);switch(p.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!d||i(m,d))&&(d=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${p.operator}`)}}),d&&(!l||i(l,d))&&(l=d)}return l&&o.test(l)?l:null},"minVersion"),np}f(e5,"requireMinVersion");var ip,Zy;function t5(){if(Zy)return ip;Zy=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"n");const r=rr();return ip=t((i,s)=>{try{return new r(i,s).range||"*"}catch{return null}},"validRange"),ip}f(t5,"requireValid");var sp,ev;function mm(){if(ev)return sp;ev=1;var e=Object.defineProperty,t=f((p,m)=>e(p,"name",{value:m,configurable:!0}),"m");const r=ut(),n=Kc(),{ANY:i}=n,s=rr(),o=Yc(),a=Jc(),l=pm(),c=fm(),u=dm();return sp=t((p,m,g,$)=>{p=new r(p,$),m=new s(m,$);let S,k,v,h,b;switch(g){case">":S=a,k=c,v=l,h=">",b=">=";break;case"<":S=l,k=u,v=a,h="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(p,m,$))return!1;for(let w=0;w<m.set.length;++w){const y=m.set[w];let D=null,E=null;if(y.forEach(A=>{A.semver===i&&(A=new n(">=0.0.0")),D=D||A,E=E||A,S(A.semver,D.semver,$)?D=A:v(A.semver,E.semver,$)&&(E=A)}),D.operator===h||D.operator===b||(!E.operator||E.operator===h)&&k(p,E.semver)||E.operator===b&&v(p,E.semver))return!1}return!0},"outside"),sp}f(mm,"requireOutside");var op,tv;function r5(){if(tv)return op;tv=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"s");const r=mm();return op=t((i,s,o)=>r(i,s,">",o),"gtr"),op}f(r5,"requireGtr");var ap,rv;function n5(){if(rv)return ap;rv=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"s");const r=mm();return ap=t((i,s,o)=>r(i,s,"<",o),"ltr"),ap}f(n5,"requireLtr");var cp,nv;function i5(){if(nv)return cp;nv=1;var e=Object.defineProperty,t=f((i,s)=>e(i,"name",{value:s,configurable:!0}),"n");const r=rr();return cp=t((i,s,o)=>(i=new r(i,o),s=new r(s,o),i.intersects(s,o)),"intersects"),cp}f(i5,"requireIntersects");var lp,iv;function s5(){if(iv)return lp;iv=1;const e=Yc(),t=tr();return lp=f((r,n,i)=>{const s=[];let o=null,a=null;const l=r.sort((p,m)=>t(p,m,i));for(const p of l)e(p,n,i)?(a=p,o||(o=p)):(a&&s.push([o,a]),a=null,o=null);o&&s.push([o,null]);const c=[];for(const[p,m]of s)p===m?c.push(p):!m&&p===l[0]?c.push("*"):m?p===l[0]?c.push(`<=${m}`):c.push(`${p} - ${m}`):c.push(`>=${p}`);const u=c.join(" || "),d=typeof n.raw=="string"?n.raw:String(n);return u.length<d.length?u:n},"simplify"),lp}f(s5,"requireSimplify");var up,sv;function o5(){if(sv)return up;sv=1;var e=Object.defineProperty,t=f((m,g)=>e(m,"name",{value:g,configurable:!0}),"u");const r=rr(),n=Kc(),{ANY:i}=n,s=Yc(),o=tr(),a=t((m,g,$={})=>{if(m===g)return!0;m=new r(m,$),g=new r(g,$);let S=!1;e:for(const k of m.set){for(const v of g.set){const h=u(k,v,$);if(S=S||h!==null,h)continue e}if(S)return!1}return!0},"subset"),l=[new n(">=0.0.0-0")],c=[new n(">=0.0.0")],u=t((m,g,$)=>{if(m===g)return!0;if(m.length===1&&m[0].semver===i){if(g.length===1&&g[0].semver===i)return!0;$.includePrerelease?m=l:m=c}if(g.length===1&&g[0].semver===i){if($.includePrerelease)return!0;g=c}const S=new Set;let k,v;for(const j of m)j.operator===">"||j.operator===">="?k=d(k,j,$):j.operator==="<"||j.operator==="<="?v=p(v,j,$):S.add(j.semver);if(S.size>1)return null;let h;if(k&&v&&(h=o(k.semver,v.semver,$),h>0||h===0&&(k.operator!==">="||v.operator!=="<=")))return null;for(const j of S){if(k&&!s(j,String(k),$)||v&&!s(j,String(v),$))return null;for(const G of g)if(!s(j,String(G),$))return!1;return!0}let b,w,y,D,E=v&&!$.includePrerelease&&v.semver.prerelease.length?v.semver:!1,A=k&&!$.includePrerelease&&k.semver.prerelease.length?k.semver:!1;E&&E.prerelease.length===1&&v.operator==="<"&&E.prerelease[0]===0&&(E=!1);for(const j of g){if(D=D||j.operator===">"||j.operator===">=",y=y||j.operator==="<"||j.operator==="<=",k){if(A&&j.semver.prerelease&&j.semver.prerelease.length&&j.semver.major===A.major&&j.semver.minor===A.minor&&j.semver.patch===A.patch&&(A=!1),j.operator===">"||j.operator===">="){if(b=d(k,j,$),b===j&&b!==k)return!1}else if(k.operator===">="&&!s(k.semver,String(j),$))return!1}if(v){if(E&&j.semver.prerelease&&j.semver.prerelease.length&&j.semver.major===E.major&&j.semver.minor===E.minor&&j.semver.patch===E.patch&&(E=!1),j.operator==="<"||j.operator==="<="){if(w=p(v,j,$),w===j&&w!==v)return!1}else if(v.operator==="<="&&!s(v.semver,String(j),$))return!1}if(!j.operator&&(v||k)&&h!==0)return!1}return!(k&&y&&!v&&h!==0||v&&D&&!k&&h!==0||A||E)},"simpleSubset"),d=t((m,g,$)=>{if(!m)return g;const S=o(m.semver,g.semver,$);return S>0?m:S<0||g.operator===">"&&m.operator===">="?g:m},"higherGT"),p=t((m,g,$)=>{if(!m)return g;const S=o(m.semver,g.semver,$);return S<0?m:S>0||g.operator==="<"&&m.operator==="<="?g:m},"lowerLT");return up=a,up}f(o5,"requireSubset");var pp,ov;function a5(){if(ov)return pp;ov=1;const e=Lo(),t=Fo(),r=ut(),n=$k(),i=ii(),s=I7(),o=T7(),a=B7(),l=_7(),c=M7(),u=V7(),d=W7(),p=U7(),m=tr(),g=G7(),$=q7(),S=um(),k=z7(),v=H7(),h=Jc(),b=pm(),w=wk(),y=kk(),D=dm(),E=fm(),A=Sk(),j=J7(),G=K7(),W=Kc(),ce=rr(),te=Yc(),Y=X7(),P=Q7(),N=Z7(),O=e5(),R=t5(),_=mm(),L=r5(),T=n5(),U=i5(),q=s5(),X=o5();return pp={parse:i,valid:s,clean:o,inc:a,diff:l,major:c,minor:u,patch:d,prerelease:p,compare:m,rcompare:g,compareLoose:$,compareBuild:S,sort:k,rsort:v,gt:h,lt:b,eq:w,neq:y,gte:D,lte:E,cmp:A,coerce:j,truncate:G,Comparator:W,Range:ce,satisfies:te,toComparators:Y,maxSatisfying:P,minSatisfying:N,minVersion:O,validRange:R,outside:_,gtr:L,ltr:T,intersects:U,simplifyRange:q,subset:X,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},pp}f(a5,"requireSemver");var Qt=a5();const FZ=fc(Qt);var c5=Object.defineProperty,nr=f((e,t)=>c5(e,"name",{value:t,configurable:!0}),"r$b");const hm=nr(()=>C(wb(),".vis"),"getVisHomeDir"),l5=nr(()=>C(hm(),"cache"),"getVisCacheDir"),dn=nr(()=>C(hm(),"state"),"getVisStateDir"),u5=nr(e=>ED("sha256").update(e).digest("hex").slice(0,12),"hashWorkspace"),LZ=nr(e=>C(hm(),"workspaces",u5(e)),"getVisWorkspaceDir"),Ek=".vis",Xc=nr(e=>C(e,Ek),"getVisWorkspaceDataDir"),IZ=`${Ek}/cache`;nr(e=>C(Xc(e),"cache"),"getVisWorkspaceCacheDir");const TZ=nr(e=>C(Xc(e),"runs"),"getVisRunsDir");nr(e=>C(Xc(e),"last-summary.json"),"getVisLastSummaryPath");const BZ=nr(e=>C(Xc(e),"last-failures"),"getVisLastFailuresDir"),_Z=nr(e=>{const t=Od()==="win32";for(const r of[".task-runner",".task-runner-cache"]){const n=C(e,r);if(rc(n))try{const i=t?vh("cmd.exe",["/c","rmdir","/s","/q",n],{detached:!0,stdio:"ignore"}):vh("rm",["-rf",n],{detached:!0,stdio:"ignore"});i.on("error",()=>{}),i.unref()}catch{}}},"cleanupLegacyTaskRunnerLayout");var p5=Object.defineProperty,qe=f((e,t)=>p5(e,"name",{value:t,configurable:!0}),"l$d");const d5="https://api.socket.dev/v0/purl?alerts=true",Io=qe(()=>C(l5(),"socket-security"),"getCacheDirectory"),f5=3600*1e3,gm=.4,av=100,m5=qe(e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm","isPackageReportData"),h5=qe(()=>{Jt(Io())},"ensureCacheDirectory"),Dk=qe((e,t)=>`${encodeURIComponent(e)}@${encodeURIComponent(t)}`,"buildCacheKey"),g5=qe((e,t)=>{const r=Dk(e,t),n=C(Io(),`${r}.json`);try{const i=ke(n);if(Date.now()-i.createdAt>i.ttlMs){Ad(n,{force:!0});return}return i.report}catch{return}},"getCachedReport"),y5=qe((e,t,r,n)=>{const i=Dk(e,t),s={createdAt:Date.now(),report:r,ttlMs:n};Ve(C(Io(),`${i}.json`),JSON.stringify(s),"utf8")},"setCachedReport"),v5=qe(e=>{const t=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((t.reduce((r,n)=>r+n,0)/t.length).toFixed(2))},"calculateOverallScore"),Ck=qe(async(e,t={})=>{const{apiToken:r,cacheTtlMs:n=f5,timeoutMs:i=15e3}=t,s=new Map;if(e.length===0||!r)return s;const o=[];for(const c of e){const u=g5(c.name,c.version);u?s.set(`${c.name}@${c.version}`,u):o.push(c)}if(o.length===0)return s;const a=`Basic ${Buffer.from(`${r}:`).toString("base64")}`;h5();const l=[];for(let c=0;c<o.length;c+=av)l.push(o.slice(c,c+av));for(const c of l){const u=c.map(m=>({purl:`pkg:npm/${m.name}@${m.version}`})),d=new AbortController,p=setTimeout(()=>{d.abort()},i);try{const m=await fetch(d5,{body:JSON.stringify({components:u}),headers:{Authorization:a,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:d.signal});if(!m.ok)continue;const g=await m.text();b5(g,c,s,n)}catch{}finally{clearTimeout(p)}}return s},"fetchSocketReports"),b5=qe((e,t,r,n)=>{const i=new Map;for(const o of t)i.set(`${o.name}@${o.version}`,o);const s=e.split(`}
|
|
1063
|
+
`);for(const o of s){const a=o.trim();if(a)try{const l=JSON.parse(a.endsWith("}")?a:`${a}}`),c=`${l.namespace?`${l.namespace}/`:""}${l.name}`,u=`${c}@${l.version}`;if(!i.has(u))continue;const d=l.score.overall??v5(l.score),p={alerts:l.alerts,author:l.author,id:l.id,license:l.license,name:l.name,score:{...l.score,overall:d},size:l.size,type:"npm",version:l.version};l.namespace&&(p.namespace=l.namespace),m5(p)&&(r.set(u,p),y5(c,l.version,p,n))}catch{}}},"parseNdjsonResponse"),Ak=qe(e=>e.namespace?`${e.namespace}/${e.name}`:e.name,"getFullPackageName"),$5=qe(e=>e>=.8?"excellent":e>=.6?"good":e>=.4?"fair":e>=.2?"poor":"critical","scoreLabel"),MZ=qe(e=>e>=.6?"green":e>=.4?"yellow":"red","scoreColor"),VZ=qe(e=>{const t=Ak(e),r=`score: ${String(Math.round(e.score.overall*100))}%`,n=e.alerts.length,i=n>0?`${String(n)} alert${n===1?"":"s"}`:"no alerts";return`${t}@${e.version} (${r}, ${i})`},"formatReportSummary");qe(e=>{const t=[`${Ak(e)}@${e.version}`,` License: ${e.license||"unknown"}`,` Overall Score: ${String(Math.round(e.score.overall*100))}% (${$5(e.score.overall)})`,` Supply Chain: ${String(Math.round(e.score.supplyChain*100))}%`,` Quality: ${String(Math.round(e.score.quality*100))}%`,` Maintenance: ${String(Math.round(e.score.maintenance*100))}%`,` Vulnerability: ${String(Math.round(e.score.vulnerability*100))}%`,` License: ${String(Math.round(e.score.license*100))}%`];if(e.alerts.length>0){t.push(` Alerts (${String(e.alerts.length)}):`);for(const r of e.alerts){const n=r.props?.cveId?` (${r.props.cveId})`:"";t.push(` [${r.severity.toUpperCase()}] ${r.type}${n} — ${r.category}`)}}return t.join(`
|
|
1064
|
+
`)},"formatReportDetailed");const w5=qe((e,t=gm)=>{if(e.size===0)return"";let r=0,n=0,i=0,s=0,o=0,a=0;for(const c of e.values()){for(const u of c.alerts)switch(r++,u.severity){case"critical":{n++;break}case"high":{i++;break}case"medium":{s++;break}default:o++}c.score.overall<t&&a++}const l=[`Socket.dev: scanned ${String(e.size)} package${e.size===1?"":"s"}`];if(r>0){const c=[];n>0&&c.push(`${String(n)} critical`),i>0&&c.push(`${String(i)} high`),s>0&&c.push(`${String(s)} medium`),o>0&&c.push(`${String(o)} low`),l.push(` Alerts: ${String(r)} total (${c.join(", ")})`)}else l.push(" No security alerts found.");if(a>0){const c=Math.round(t*100);l.push(` ${String(a)} package${a===1?"":"s"} with low security score (<${String(c)}%)`)}return l.join(`
|
|
1065
|
+
`)},"formatSecurityOverview"),WZ=qe(()=>{const e=Io();if(!x(e))return 0;const t=Kt(e).filter(r=>r.endsWith(".json"));for(const r of t)Ad(C(e,r),{force:!0});return t.length},"clearSocketCache"),UZ=qe(()=>{const e=Io();if(!x(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const t=Kt(e).filter(s=>s.endsWith(".json"));let r=0,n,i;for(const s of t){const o=Pi(C(e,s));r+=o.size;const{mtimeMs:a}=o;(n===void 0||a<n)&&(n=a),(i===void 0||a>i)&&(i=a)}return{entries:t.length,newestEntry:i,oldestEntry:n,totalSizeBytes:r}},"getSocketCacheStats"),k5=qe((e,t)=>e?.enabled?{apiToken:e.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:e.cacheTtlMs,minimumScore:t??gm,timeoutMs:e.timeoutMs}:void 0,"buildSocketOptions"),S5=qe((e,t,r,n)=>{if(!r)return;const i=Date.now(),s=qe(a=>{if(a.expiresAt){const l=Date.parse(a.expiresAt);if(!Number.isNaN(l)&&l<i)return!1}return!(n&&a.policies&&!a.policies.includes(n))},"matches"),o=`${e}@${t}`;if(r[o]&&s(r[o]))return r[o];if(r[e]&&s(r[e]))return r[e];for(const[a,l]of Object.entries(r))if(a.endsWith("*")&&e.startsWith(a.slice(0,-1))&&s(l))return l},"findAcceptedRisk"),GZ=qe((e,t,r,n)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${e}"`}: {`,` reason: "${n}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(r)},`,' policies: ["score"],'," },"].join(`
|
|
1066
|
+
`),"formatAcceptedRiskSnippet");var E5=Object.defineProperty,M=f((e,t)=>E5(e,"name",{value:t,configurable:!0}),"c$8");const D5=/^([\^~]|>=|<=|[><=])/,C5=/^(?:'([^']+)'|"([^"]+)"|([^:\s]+)):\s*(?:'([^']+)'|"([^"]+)"|(\S+))/,A5=/^catalog:/m,O5=/^catalogs:/m,j5=/^(@[^:]+):registry$/,x5=/^\/\/(.+)\/:_authToken$/,P5=/\*+/g,N5=/[.+^${}()|[\]\\]/g,cv=/[.*+?^${}()|[\]\\]/g,Ok=/^['"]|['"]$/g,R5=/^https?:\/\//,ym=/\/$/,F5=/\n(\s+)/,id=["dependencies","devDependencies","optionalDependencies"],L5=new Set([...id,"overrides","peerDependencies","pnpm.overrides","resolutions"]),Qc=M(e=>{const t=pb("vis",{create:!0,cwd:e});if(!t)throw new Error("Cannot resolve cache directory. Ensure node_modules exists in your workspace. Run your package manager's install command first.");return C(t,"backup")},"getBackupDir"),xt=M(e=>{const t=e.replace(/^[\^~]|^>=|^<=|^[><]/,""),r=Qt.parse(t);if(r)return{major:r.major,minor:r.minor,patch:r.patch,prerelease:Array.isArray(r.prerelease)?r.prerelease.join("."):String(r.prerelease??"")};const n=Qt.coerce(e);if(n)return{major:n.major,minor:n.minor,patch:n.patch,prerelease:""}},"parseVersion"),Zc=M(e=>D5.exec(e)?.[1]??"","extractPrefix"),lv=M(e=>{if(!e.prerelease)return"";const t=e.prerelease.split(".")[0]??"";return/^\d+$/.test(t)?"":t},"extractChannel"),jk=M((e,t,r)=>r==="any"?!0:r==="same"?lv(e)===lv(t):e.prerelease==="","matchesReleaseChannel"),I5=M(e=>{const t=`${String(e.major)}.${String(e.minor)}.${String(e.patch)}`;return e.prerelease?`${t}-${e.prerelease}`:t},"versionToString"),vm=M((e,t)=>e.major!==t.major?"major":e.minor!==t.minor?"minor":e.patch!==t.patch||e.prerelease!==t.prerelease?"patch":"none","getUpdateType"),T5=M((e,t)=>e.major!==t.major?e.major-t.major:e.minor!==t.minor?e.minor-t.minor:e.patch!==t.patch?e.patch-t.patch:!e.prerelease&&t.prerelease?1:e.prerelease&&!t.prerelease?-1:e.prerelease&&t.prerelease?e.prerelease<t.prerelease?-1:e.prerelease>t.prerelease?1:0:0,"compareVersions"),Bi=M((e,t)=>T5(t,e)>0,"isNewer"),Wn=M((e,t)=>{const r=t.replaceAll(P5,"*").replaceAll(N5,String.raw`\$&`);return new RegExp(`^${r.replaceAll("*",".*").replaceAll("?",".")}$`).test(e)},"matchesPattern"),bm=M((e,t,r)=>r.some(n=>Wn(e,n))?!1:t.length>0?t.some(n=>Wn(e,n)):!0,"matchesFilters"),xk=M(e=>{const t=C5.exec(e);if(!t)return;const r=t[1]??t[2]??t[3],n=t[4]??t[5]??t[6];if(!(!r||!n))return[r,n]},"parseYamlEntry"),Pk=M((e,t,r,n)=>{e.has(t)||e.set(t,new Map);const i=e.get(t);i&&i.set(r,n)},"setCatalogEntry"),B5=M((e,t,r)=>{if(r<2)return;const n=xk(t);n&&Pk(e,"default",n[0],n[1])},"parseCatalogSection"),_5=M((e,t,r,n)=>{if(r===2&&t.endsWith(":"))return t.slice(0,-1).trim().replaceAll(Ok,"");if(r>=4&&n){const i=xk(t);i&&Pk(e,n,i[0],i[1])}return n},"parseCatalogsSection"),Nk=M(e=>e==="catalog:"||e.startsWith("catalog:")?"catalog":e==="catalogs:"||e.startsWith("catalogs:")?"catalogs":"none","detectTopLevelSection"),Rk=M(e=>{const t=new Map;let r="none",n="";for(const i of e.split(`
|
|
1067
|
+
`)){const s=i.trimStart(),o=i.length-s.length;if(o===0&&s.length>0&&!s.startsWith("#")){r=Nk(s),r==="catalogs"&&(n="");continue}s.length===0||s.startsWith("#")||(r==="catalog"&&B5(t,s,o),r==="catalogs"&&(n=_5(t,s,o,n)))}return t},"parseCatalogsFromYaml"),M5=M(e=>{const t=C(e,"pnpm-workspace.yaml");if(!x(t))return!1;const r=J(t);return A5.test(r)||O5.test(r)},"hasPnpmCatalogs"),V5=M(e=>{const t=C(e,"pnpm-workspace.yaml");if(!x(t))return new Map;const r=J(t);return Rk(r)},"readPnpmCatalogs"),Fk=M(e=>{if(x(e))try{return ke(e)}catch{return}},"readPackageJsonSafe"),W5=M(e=>{const t=Fk(C(e,"package.json"));return!!(t?.workspaces?.catalog||t?.workspaces?.catalogs)},"hasBunCatalogs"),Lk=M(e=>{const t=new Map;if(e.workspaces?.catalog&&typeof e.workspaces.catalog=="object"&&t.set("default",new Map(Object.entries(e.workspaces.catalog))),e.workspaces?.catalogs&&typeof e.workspaces.catalogs=="object")for(const[r,n]of Object.entries(e.workspaces.catalogs))n&&typeof n=="object"&&t.set(r,new Map(Object.entries(n)));return t},"parseBunCatalogs"),U5=M(e=>{const t=Fk(C(e,"package.json"));return t?Lk(t):new Map},"readBunCatalogs"),rs=M(e=>{const t=e.lastIndexOf(":");if(t===-1)return;const r=e.slice(t+1);if(L5.has(r))return{depType:r,relativePath:e.slice(0,t)}},"parseCompositeCatalogName"),Ik=M(e=>e?.dev?["devDependencies"]:e?.prod?["dependencies"]:e?.depFields&&e.depFields.length>0?e.depFields:e?.peer?[...id,"peerDependencies"]:id,"getDepTypesToInclude"),G5=M((e,t,r)=>{const n=new Set;t&&n.add(t);for(const i of r){const s=C(e,i,"package.json");if(x(s))try{const o=ke(s);o.name&&n.add(o.name)}catch{}}return n},"collectInternalPackageNames"),$m=M((e,t)=>{const r=t.split(".");let n=e;for(const i of r)if(n&&typeof n=="object")n=n[i];else return;return typeof n=="object"&&n!==null?n:void 0},"getNestedField"),q5=M((e,t,r,n)=>{const i=t.split(".");let s=e;for(const a of i.slice(0,-1))(!s[a]||typeof s[a]!="object")&&(s[a]={}),s=s[a];const o=i.at(-1);(!s[o]||typeof s[o]!="object")&&(s[o]={}),s[o][r]=n},"setNestedField"),z5=M((e,t)=>{const r=new Map;for(const[n,i]of Object.entries(e))t.has(n)||i.startsWith("workspace:")||i.startsWith("file:")||i.startsWith("link:")||i.startsWith("catalog:")||i.startsWith("$")||r.set(n,i);return r},"filterExternalDeps"),H5=M((e,t,r,n,i,s)=>{const o=t==="."?r:C(e,t,"package.json");if(!x(o))return;let a;try{a=ke(o)}catch{return}for(const l of n){const c=l.includes(".")?$m(a,l):a[l];if(!c||typeof c!="object")continue;const u=z5(c,i);u.size>0&&s.set(`${t}:${l}`,u)}},"scanDirectoryDeps"),Tk=M((e,t)=>{const r=new Map,n=C(e,"package.json");if(!x(n))return r;const i=ke(n);let s=[];const o=Zi(e);if(o)s=sn(e,o);else{const u=i.workspaces;if(u){const d=Array.isArray(u)?u:u.packages;d&&(s=sn(e,d))}}const a=t?.includeInternal?new Set:G5(e,i.name,s),l=Ik(t),c=[".",...s];for(const u of c)H5(e,u,n,l,a,r);return r},"readPackageJsonDeps"),wa=M(e=>{const t=C(e,"package.json");if(!x(t))return!1;try{const r=ke(t);return!!(r.dependencies||r.devDependencies||r.peerDependencies||r.optionalDependencies||r.overrides||r.resolutions||$m(r,"pnpm.overrides"))}catch{return!1}},"hasPackageJsonDeps"),sd=M((e,t,r)=>{const n=new Map;for(const i of t){const s=rs(i.catalogName);if(!s)continue;const o=s.relativePath==="."?C(e,"package.json"):C(e,s.relativePath,"package.json");n.has(o)||n.set(o,[]);const a=n.get(o);a&&a.push({depType:s.depType,newRange:i.newRange,packageName:i.packageName})}for(const[i,s]of n){const o=ke(i);for(const{depType:a,newRange:l,packageName:c}of s)a.includes(".")?q5(o,a,c,l):o[a]&&(o[a][c]=l);go(i,o,{indent:Jf(i,{useEditorconfig:r}),overwrite:!0})}},"applyPackageJsonUpdates"),J5=M((e,t)=>t==="bun"?W5(e)||wa(e):t==="npm"||t==="yarn"?wa(e):M5(e)||wa(e),"hasCatalogs"),K5=M((e,t,r)=>{let n;t==="bun"?n=U5(e):t==="npm"||t==="yarn"?n=new Map:n=V5(e);const i=Tk(e,r);for(const[s,o]of i)n.has(s)||n.set(s,o);return n},"readCatalogs"),Y5=M((e,t)=>{const r=new Map;for(const n of t){const i=C(e,n,"package.json");if(x(i))try{const s=ke(i);s.name&&s.version&&r.set(s.name,s.version)}catch{}}return r},"collectInternalPackageVersions"),X5=M((e,t)=>{const r=C(e,"package.json");if(!x(r))return{ignored:[],outdated:[]};const n=ke(r);let i=[];const s=Zi(e);if(s)i=sn(e,s);else{const $=n.workspaces;if($){const S=Array.isArray($)?$:$.packages;S&&(i=sn(e,S))}}const o=Y5(e,i);if(o.size===0)return{ignored:[],outdated:[]};const a=Ik(t),l=[".",...i],c=t?.include??[],u=t?.exclude??[],d=t?.ignore??[],p=t?.target??"latest",m=new Set,g=[];for(const $ of l){const S=$==="."?r:C(e,$,"package.json");if(!x(S))continue;let k;try{k=ke(S)}catch{continue}for(const v of a){const h=v.includes(".")?$m(k,v):k[v];if(!(!h||typeof h!="object"))for(const[b,w]of Object.entries(h)){const y=o.get(b);if(!y||w.startsWith("workspace:")||w.startsWith("file:")||w.startsWith("link:")||w.startsWith("catalog:")||w.startsWith("$")||w==="*")continue;if(d.some(W=>Wn(b,W))){m.add(b);continue}if(!bm(b,c,u))continue;const D=xt(w),E=xt(y);if(!D||!E||!Bi(D,E))continue;const A=vm(D,E);if(A==="none")continue;const j=km(b,p,t?.packageMode);if(j==="patch"&&A!=="patch"||j==="minor"&&A==="major")continue;const G=Zc(w);g.push({catalogName:`${$}:${v}`,currentRange:w,newRange:`${G}${y}`,packageName:b,targetVersion:y,updateType:A})}}}return{ignored:[...m],outdated:g}},"collectInternalOutdated"),od=M(e=>{const t=new Map,r=new Map;let n="https://registry.npmjs.org";for(const i of e.split(`
|
|
1068
|
+
`)){const s=i.trim();if(!s||s.startsWith("#")||s.startsWith(";"))continue;const o=s.indexOf("=");if(o===-1)continue;const a=s.slice(0,o).trim(),l=s.slice(o+1).trim(),c=j5.exec(a);if(c?.[1]){t.set(c[1],l);continue}if(a==="registry"){n=l;continue}const u=x5.exec(a);u?.[1]&&r.set(u[1],l)}return{authTokens:r,defaultRegistry:n,registries:t}},"parseNpmrc"),Q5=M((e,t)=>({authTokens:new Map([...e.authTokens,...t.authTokens]),defaultRegistry:t.defaultRegistry==="https://registry.npmjs.org"?e.defaultRegistry:t.defaultRegistry,registries:new Map([...e.registries,...t.registries])}),"mergeNpmrcConfigs"),Z5=M(e=>{const t={authTokens:new Map,defaultRegistry:"https://registry.npmjs.org",registries:new Map},r=process.env.HOME??process.env.USERPROFILE??"",n=C(r,".npmrc");let i=r&&x(n)?od(J(n)):t;const s=C(e,".npmrc");return x(s)&&(i=Q5(i,od(J(s)))),i},"loadNpmrc"),wm=M((e,t)=>{let r=t.defaultRegistry;if(e.startsWith("@")){const i=e.split("/")[0];if(i&&t.registries.has(i)){const s=t.registries.get(i);s&&(r=s)}}const n=r.replace(R5,"").replace(ym,"");return{token:t.authTokens.get(n),url:r}},"getRegistryForPackage"),Bk=15e3,_k=M(async(e,t,r=Bk,n=!1)=>{const i=`${(t?.url??"https://registry.npmjs.org").replace(ym,"")}/${e}`,s=n?{Accept:"application/json"}:{Accept:"application/vnd.npm.install-v1+json"};t?.authToken&&(s.Authorization=`Bearer ${t.authToken}`);const o=new AbortController,a=setTimeout(()=>{o.abort()},r);try{const l=await fetch(i,{headers:s,signal:o.signal});if(!l.ok)throw new Error(`Failed to fetch ${e}: ${String(l.status)} ${l.statusText}`);const c=await l.json(),u={latest:c["dist-tags"]?.latest??"",versions:Object.keys(c.versions??{})};return n&&c.time&&(u.publishTimes=new Map(Object.entries(c.time))),u}finally{clearTimeout(a)}},"fetchPackageVersions"),e6=M(e=>{const t=e.database_specific?.severity?.toUpperCase();if(t==="CRITICAL"||t==="HIGH"||t==="MODERATE"||t==="LOW")return t;const r=e.severity?.find(n=>n.type==="CVSS_V3")?.score;if(r){const n=Number.parseFloat(r);return n>=9?"CRITICAL":n>=7?"HIGH":n>=4?"MODERATE":"LOW"}return"UNKNOWN"},"mapOsvSeverity"),t6=M(e=>{const t=e.severity?.find(r=>r.type==="CVSS_V3")?.score;return t?Number.parseFloat(t):void 0},"mapOsvCvss"),r6=M(e=>{const t=[];for(const r of e.affected??[])for(const n of r.ranges??[])for(const i of n.events??[])i.fixed&&t.push(i.fixed);return t},"mapOsvFixedVersions"),n6=M(e=>({aliases:e.aliases?.length?e.aliases:void 0,cvssScore:t6(e),fixedVersions:r6(e),id:e.id,severity:e6(e),summary:e.summary??""}),"mapOsvVuln"),Mk=M(async(e,t=1e4)=>{if(e.length===0)return new Map;const r=e.map(s=>({package:{ecosystem:"npm",name:s.name},version:s.version})),n=new AbortController,i=setTimeout(()=>{n.abort()},t);try{const s=await fetch("https://api.osv.dev/v1/querybatch",{body:JSON.stringify({queries:r}),headers:{"Content-Type":"application/json"},method:"POST",signal:n.signal});if(!s.ok)return new Map;const o=await s.json(),a=new Map;for(const[l,c]of e.entries()){const u=o.results[l]?.vulns;u&&u.length>0&&a.set(c.name,u.map(d=>n6(d)))}return a}catch{return new Map}finally{clearTimeout(i)}},"fetchVulnerabilities"),uv=new Map,km=M((e,t,r)=>{if(!r)return t;const n=r[e];if(n!==void 0)return n;for(const[i,s]of Object.entries(r))if(i!==e){if(i.startsWith("/")&&i.endsWith("/")){let o=uv.get(i);if(o||(o=new RegExp(i.slice(1,-1)),uv.set(i,o)),o.test(e))return s}else if(Wn(e,i))return s}return t},"resolvePackageTarget"),Vk=M((e,t,r)=>{const n=t?.get(e);return n?Date.now()-new Date(n).getTime()<r:!1},"isTooNew"),i6=M(e=>e?.minimumReleaseAge?e.packageName&&e.minimumReleaseAgeExclude?.some(t=>Wn(e.packageName,t))?0:e.minimumReleaseAge*60*1e3:0,"resolveMinAgeMs"),Wk=M((e,t)=>t??(e?"any":"stable"),"resolveReleaseChannel"),dp=M((e,t,r,n,i,s,o)=>{const a=Wk(r,o);return e.map(l=>({parsed:xt(l),raw:l})).filter(l=>!l.parsed||!jk(l.parsed,t,a)||!Bi(t,l.parsed)||n&&Vk(l.raw,i,n)?!1:s?s(l.parsed):!0).toSorted((l,c)=>Qt.rcompare(l.raw,c.raw))[0]?.raw},"filterCandidates"),Uk=M((e,t,r,n,i,s,o)=>{const a=xt(r);if(!a)return;const l=i6(s),c=Wk(i,o);if(n==="latest"){const d=xt(t);return d?jk(d,a,c)?Bi(a,d)?!l||!Vk(t,s?.publishTimes,l)?t:dp(e,a,i,l,s?.publishTimes,void 0,c):void 0:dp(e,a,i,l,s?.publishTimes,void 0,c):void 0}const u=n==="patch"?d=>d.major===a.major&&d.minor===a.minor:d=>d.major===a.major;return dp(e,a,i,l,s?.publishTimes,u,c)},"findTargetVersion"),s6=M((e,t)=>{const r=[],n=new Set;for(const[i,s]of e)for(const[o,a]of s)if(!(a.startsWith("workspace:")||a.startsWith("file:")||a.startsWith("link:")||a==="*")&&!(!t.includeLocked&&!Zc(a))){if(t.ignore.some(l=>Wn(o,l))){n.add(o);continue}bm(o,t.include,t.exclude)&&r.push({catalogName:i,packageName:o,range:a})}return{entries:r,ignored:[...n]}},"collectEntries"),o6=M(async(e,t,r,n=!1,i)=>{const s=new Map,o=[],a=Math.max(1,Math.min(64,Math.floor(i??8)||8));let l=0;for(let c=0;c<e.length;c+=a){const u=e.slice(c,c+a),d=await Promise.allSettled(u.map(async p=>{const m=t?wm(p,t):void 0,g=await _k(p,m?{authToken:m.token,url:m.url}:void 0,Bk,n);return s.set(p,g),p}));for(const[p,m]of d.entries())if(l+=1,m.status==="rejected"){const g=u[p];g&&o.push(g)}r&&r(l,e.length)}return{failed:o,versionCache:s}},"fetchVersionsBatched"),pv=M((e,t,r)=>{const n=[];for(const i of e){const s=t.get(i.packageName);if(!s)continue;const o=km(i.packageName,r.target,r.packageMode),a=Uk(s.versions,s.latest,i.range,o,r.includePrerelease,{minimumReleaseAge:r.minimumReleaseAge,minimumReleaseAgeExclude:r.minimumReleaseAgeExclude,packageName:i.packageName,publishTimes:s.publishTimes},r.releaseChannel);if(!a)continue;const l=xt(i.range),c=xt(a);if(!l||!c)continue;const u=vm(l,c);if(u==="none")continue;const d=Zc(i.range);n.push({catalogName:i.catalogName,currentRange:i.range,newRange:`${d}${a}`,packageName:i.packageName,targetVersion:a,updateType:u})}return n},"buildOutdatedEntries"),dv=M(e=>e?I5(e):"","formatVersionString"),a6=M(async(e,t,r,n)=>{const i=[...new Map(t.map(l=>{const c=xt(l.range);return[l.packageName,{name:l.packageName,version:dv(c)}]})).values()].filter(l=>l.version),s=r?Ck(i,r):void 0,[o,a]=await Promise.all([Mk(i),s]);for(const l of e){const c=o.get(l.packageName);c&&c.length>0&&(l.vulnerabilities=c);const u=xt(l.currentRange),d=dv(u);if(a){const p=a.get(`${l.packageName}@${d}`);p&&(l.socketReport={alerts:p.alerts,license:p.license,score:p.score})}if(n){const p=S5(l.packageName,d,n);p&&(l.acceptedRisk=p)}}},"enrichWithSecurity"),c6=6e4,l6=M((e,t,r,n)=>{const i=[];for(const[a,l]of e)for(const[c,u]of l)i.push(`${a}:${c}=${u}`);if(i.push(`target=${t.target},pre=${String(t.includePrerelease)},chan=${t.releaseChannel??"_"},sec=${String(t.security??!1)}`),i.push(`in=${t.include.join(",")},ex=${t.exclude.join(",")},ig=${t.ignore.join(",")}`),i.push(`locked=${String(t.includeLocked)}`),i.push(`mra=${String(t.minimumReleaseAge??0)}`),t.packageMode){const a=Object.entries(t.packageMode).map(([l,c])=>`${l}=${c}`).toSorted().join(",");i.push(`pkgMode=${a}`)}i.push(`socket=${String(r??!1)}`),n&&n.length>0&&i.push(`risks=${n.toSorted().join(",")}`);let s=5381;const o=i.join("|");for(let a=0;a<o.length;a++)s=(s<<5)+s+o.charCodeAt(a)|0;return String(s)},"computeCacheHash"),Gk=M(e=>{const t=pb("vis",{create:!0,cwd:e});return t?C(t,"outdated-cache.json"):void 0},"getOutdatedCachePath"),u6=M((e,t)=>{const r=Gk(e);if(!(!r||!x(r)))try{const n=ke(r);if(n.hash===t&&Date.now()-n.timestamp<c6)return n.result}catch{}},"readOutdatedCache"),p6=M((e,t,r)=>{const n=Gk(e);if(n)try{Jt(Ge(n)),go(n,{hash:t,result:r,timestamp:Date.now()})}catch{}},"writeOutdatedCache"),d6=M(async(e,t,r,n,i,s,o)=>{const a=l6(e,t,!!s,o?Object.keys(o):void 0);if(i){const k=u6(i,a);if(k)return k}const{entries:l,ignored:c}=s6(e,t),u=[...new Set(l.map(k=>k.packageName))],d=!!(t.minimumReleaseAge&&t.minimumReleaseAge>0),{failed:p,versionCache:m}=await o6(u,r,n,d,t.maxConcurrentRequests),g=pv(l,m,t);let $=[];if(t.target!=="latest"){const k=new Set(g.map(h=>h.packageName)),v={...t,packageMode:void 0,target:"latest"};$=pv(l,m,v).filter(h=>!k.has(h.packageName))}(t.security||s)&&g.length>0&&await a6(g,l,s,o);const S={checkedCount:u.length,failed:p,filteredByTarget:$,ignored:c,outdated:g};return i&&p6(i,a,S),S},"checkOutdated"),Sm=M((e,t)=>t==="bun"?C(e,"package.json"):C(e,"pnpm-workspace.yaml"),"getCatalogFilePath"),fv=M((e,t)=>{const r=Qc(e),n=new Set;for(const i of t){const s=rs(i.catalogName);s&&n.add(s.relativePath==="."?"package.json":C(s.relativePath,"package.json"))}if(n.size!==0){Jt(r);for(const i of n){const s=C(e,i);if(x(s)){const o=C(r,i),a=Ge(o);Jt(a),ze(o,J(s))}}return r}},"createPackageJsonBackup"),Em=M((e,t)=>{const r=Sm(e,t),n=Qc(e);return C(n,`${cb(r)}.bak`)},"getCatalogBackupPath"),qk=M((e,t,r)=>{if((t==="npm"||t==="yarn")&&r)return fv(e,r);let n;const i=Sm(e,t);if(x(i)&&(n=Em(e,t),Jt(Ge(n)),ze(n,J(i))),r){const s=r.filter(o=>rs(o.catalogName));s.length>0&&fv(e,s)}return n},"createBackup"),f6=M(e=>{const t=Qc(e);if(!x(t))return!1;for(const r of an(t,{includeDirs:!1})){const n=r.path.slice(t.length+1),i=C(e,n);ze(i,J(r.path))}return UC(t),!0},"restorePackageJsonBackup"),m6=M((e,t)=>{if(t==="npm"||t==="yarn")return f6(e);const r=Sm(e,t),n=Em(e,t);if(!x(n))return!1;const i=J(n);return ze(r,i),!0},"restoreFromBackup"),h6=M((e,t)=>{if(t==="npm"||t==="yarn")try{const r=Qc(e);return x(r)}catch{return!1}try{return x(Em(e,t))}catch{return!1}},"hasBackup"),g6=M(e=>JSON.stringify(e,void 0,2),"formatOutdatedJson"),y6=M(e=>e.map(t=>`${t.packageName} ${t.currentRange} → ${t.newRange}`).join(`
|
|
1069
|
+
`),"formatOutdatedMinimal"),v6=M(e=>e?Array.isArray(e)?e:[e]:[],"toFilterArray"),zk=M(e=>{const t=new Map;for(const r of e){t.has(r.catalogName)||t.set(r.catalogName,[]);const n=t.get(r.catalogName);n&&n.push(r)}return t},"groupByCatalog"),b6=M(e=>{const t=rs(e);return t?`${t.relativePath==="."?"root":t.relativePath} (${t.depType})`:`Catalog: ${e}`},"formatCatalogDisplayName"),$6=M((e,t)=>{const r=zk(e),n=process.stdout.columns||80,i=e.some(s=>s.socketReport);for(const[s,o]of r){const a=o.flatMap(u=>{const d=u.vulnerabilities&&u.vulnerabilities.length>0,p=u.socketReport&&u.socketReport.alerts.length>0,m=`${d||p?"[SEC] ":""}${u.packageName}`,g=u.socketReport?`${String(Math.round(u.socketReport.score.overall*100))}%`:"",$={current:u.currentRange,package:m,target:u.newRange,type:u.updateType};i&&($.score=g);const S=[$];if(u.vulnerabilities)for(const k of u.vulnerabilities){const v={current:k.summary,package:` ${k.severity} ${k.id}`,target:"",type:""};i&&(v.score=""),S.push(v)}if(u.socketReport)for(const k of u.socketReport.alerts){const v={current:k.category,package:` [${k.severity.toUpperCase()}] ${k.type}`,target:"",type:""};i&&(v.score=""),S.push(v)}return S}),l=b6(s),c=hb(Si.createElement(SD,{data:a}),{columns:n});t.info(`${l}
|
|
1070
|
+
${c}
|
|
1071
|
+
`)}},"formatOutdatedTable"),w6=M((e,t=gm)=>{let r=0,n=0,i=0,s=0,o=0,a=0;for(const p of e)p.updateType==="major"?r++:p.updateType==="minor"?n++:i++,p.vulnerabilities&&p.vulnerabilities.length>0&&s++,p.socketReport?.alerts.length&&o++,p.socketReport&&p.socketReport.score.overall<t&&a++;const l=[];r&&l.push(`${String(r)} major`),n&&l.push(`${String(n)} minor`),i&&l.push(`${String(i)} patch`),s&&l.push(`${String(s)} with vulnerabilities`),o&&l.push(`${String(o)} with Socket.dev alerts`);const c=`Found ${String(e.length)} outdated (${l.join(", ")})`,u=process.stdout.columns||80,d=[Si.createElement(H,{bold:!0},"─ Summary"),Si.createElement(H,null,` ${c}`)];return a>0&&d.push(Si.createElement(H,{color:"yellow"},` ${String(a)} package${a===1?"":"s"} with low Socket.dev score (<${String(Math.round(t*100))}%)`)),hb(Si.createElement(he,{flexDirection:"column",paddingX:1},...d),{columns:u})},"formatSummary"),k6=M((e,t)=>{const r=e.replaceAll(cv,String.raw`\$&`),n=t.replaceAll(cv,String.raw`\$&`);return new RegExp(String.raw`^(?:'${r}'|"${r}"|${r}):\s*['"]?${n}['"]?`)},"buildLineMatchRegex"),S6=M((e,t,r)=>k6(t,r).test(e),"lineMatchesPackage"),E6=M(e=>{const t=new Map;for(const r of e){t.has(r.catalogName)||t.set(r.catalogName,new Map);const n=t.get(r.catalogName);n&&n.set(r.packageName,{newRange:r.newRange,oldRange:r.currentRange})}return t},"buildUpdateMap"),mv=M((e,t,r)=>{if(!r)return e;for(const[n,{newRange:i,oldRange:s}]of r)if(S6(t,n,s))return e.replace(s,i);return e},"applyLineUpdate"),D6=M((e,t,r,n)=>{const i=e.trimStart(),s=e.length-i.length;return i.length===0||i.startsWith("#")?e:t==="catalog"&&s>=2?mv(e,i,n.get("default")):t==="catalogs"&&s>=4&&r?mv(e,i,n.get(r)):e},"processYamlLineForUpdate"),C6=M((e,t)=>{const r=C(e,"pnpm-workspace.yaml"),n=J(r).split(`
|
|
1072
|
+
`),i=E6(t);let s="none",o="";const a=[];for(const l of n){const c=l.trimStart(),u=l.length-c.length;u===0&&c.length>0&&!c.startsWith("#")&&(s=Nk(c),s==="catalogs"&&(o="")),s==="catalogs"&&u===2&&c.endsWith(":")&&(o=c.slice(0,-1).trim().replaceAll(Ok,"")),a.push(D6(l,s,o,i))}ze(r,a.join(`
|
|
1073
|
+
`))},"applyPnpmCatalogUpdates");M(e=>{const t=F5.exec(e);if(!t)return 2;const r=t[1];return r?r.includes(" ")?r:r.length:2},"detectJsonIndent");const A6=M((e,t,r)=>{const n=C(e,"package.json"),i=ke(n);for(const s of t)if(s.catalogName==="default")i.workspaces?.catalog&&(i.workspaces.catalog[s.packageName]=s.newRange);else{const o=i.workspaces?.catalogs?.[s.catalogName];o&&(o[s.packageName]=s.newRange)}go(n,i,{indent:Jf(n,{useEditorconfig:r}),overwrite:!0})},"applyBunCatalogUpdates"),O6=M((e,t,r,n=!0,i={})=>{const{useEditorconfig:s}=i;let o;n&&(o=qk(e,r,t));const a=[],l=[];for(const c of t)rs(c.catalogName)?l.push(c):a.push(c);return a.length>0&&(r==="npm"||r==="yarn"?sd(e,a,s):r==="bun"?A6(e,a,s):C6(e,a)),l.length>0&&sd(e,l,s),o},"applyCatalogUpdates"),j6=M(async e=>{const t=kb({input:process.stdin,output:process.stdout}),r=M(i=>new Promise(s=>{t.question(i,o=>{s(o.trim())})}),"ask");process.stdout.write(`
|
|
1074
|
+
Outdated catalog dependencies:
|
|
1075
|
+
`);for(const[i,s]of e.entries())s&&process.stdout.write(` ${String(i+1)}. ${s.packageName}: ${s.currentRange} → ${s.newRange} (${s.updateType})
|
|
1076
|
+
`);process.stdout.write(`
|
|
1077
|
+
`);const n=await r("Apply updates? [a]ll / [n]one / [s]elect: ");if(n.toLowerCase()==="a"||n.toLowerCase()==="all")return t.close(),e;if(n.toLowerCase()==="n"||n.toLowerCase()==="none")return t.close(),[];if(n.toLowerCase()==="s"||n.toLowerCase()==="select"){const i=await r("Enter numbers to apply (comma-separated): ");return t.close(),i.split(",").map(s=>Number.parseInt(s.trim(),10)-1).filter(s=>s>=0&&s<e.length).map(s=>e[s]).filter(s=>s!==void 0)}return t.close(),[]},"promptPackageSelection"),x6=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git|\/|$)/,P6=M(async(e,t=1e4,r)=>{const n=[],i=new AbortController,s=setTimeout(()=>{i.abort()},t);try{const o=e.map(async a=>{const l=`https://www.npmjs.com/package/${a.packageName}`;try{const c=r?wm(a.packageName,r):{url:"https://registry.npmjs.org"},u=c.url.replace(ym,""),d={Accept:"application/json"};c.token&&(d.Authorization=`Bearer ${c.token}`);const p=await fetch(`${u}/${a.packageName}`,{headers:d,signal:i.signal});if(!p.ok)return{npmUrl:l,packageName:a.packageName};const m=(await p.json()).repository?.url;if(!m)return{npmUrl:l,packageName:a.packageName};const g=x6.exec(m);if(!g)return{npmUrl:l,packageName:a.packageName,repoUrl:m};const $=g[1],S=g[2],k=`https://github.com/${$}/${S}/releases/tag/v${a.targetVersion}`;return{npmUrl:l,packageName:a.packageName,releaseUrl:k,repoUrl:`https://github.com/${$}/${S}`}}catch{return{npmUrl:l,packageName:a.packageName}}});n.push(...await Promise.all(o))}finally{clearTimeout(s)}return n},"fetchChangelogInfo"),qZ=Object.defineProperty({__proto__:null,applyCatalogUpdates:O6,applyPackageJsonUpdates:sd,checkOutdated:d6,collectInternalOutdated:X5,createBackup:qk,extractPrefix:Zc,fetchChangelogInfo:P6,fetchPackageVersions:_k,fetchVulnerabilities:Mk,findTargetVersion:Uk,formatOutdatedJson:g6,formatOutdatedMinimal:y6,formatOutdatedTable:$6,formatSummary:w6,getRegistryForPackage:wm,getUpdateType:vm,groupByCatalog:zk,hasBackup:h6,hasCatalogs:J5,hasPackageJsonDeps:wa,isNewer:Bi,loadNpmrc:Z5,matchesFilters:bm,matchesPattern:Wn,parseBunCatalogs:Lk,parseCatalogsFromYaml:Rk,parseCompositeCatalogName:rs,parseNpmrc:od,parseVersion:xt,promptPackageSelection:j6,readCatalogs:K5,readPackageJsonDeps:Tk,resolvePackageTarget:km,restoreFromBackup:m6,toFilterArray:v6},Symbol.toStringTag,{value:"Module"});var N6=Object.defineProperty,ns=f((e,t)=>N6(e,"name",{value:t,configurable:!0}),"c$7");const R6=["dependencies","devDependencies","peerDependencies","optionalDependencies","overrides","resolutions","pnpm.overrides"],F6=ns((e,t)=>{const r=t.split(".");let n=e;for(const i of r){if(typeof n!="object"||n===null)return;n=n[i]}return typeof n=="object"&&n!==null?n:void 0},"getNested"),Dm=ns(e=>{const t=C(e,"package.json");if(!x(t))return["."];const r=ke(t).workspaces;let n=[];if(r){const i=Array.isArray(r)?r:r.packages;i&&(n=sn(e,i))}if(n.length===0){const i=Zi(e);i&&(n=sn(e,i))}return[".",...n]},"collectWorkspaceDirectories"),el=ns(e=>{if(x(e))try{return ke(e)}catch{return}},"readPkg"),L6=ns(e=>{const t=new Set,r=Dm(e);for(const n of r){const i=el(C(e,n,"package.json"));i&&typeof i.name=="string"&&t.add(i.name)}return t},"collectWorkspacePackageNames"),zZ=ns((e,t={})=>{const r=t.includeInternal??!0,n=t.depTypes??R6,i=Dm(e),s=L6(e),o=[],a=n.includes("pnpm.overrides")?BM(e):void 0,l=a?C(e,"pnpm-workspace.yaml"):void 0;for(const c of i){const u=C(e,c,"package.json"),d=el(u);if(!d)continue;const p=typeof d.name=="string"?d.name:void 0,m=c==="."?".":ho(e,C(e,c));for(const g of n){const $=g.includes(".")?F6(d,g):d[g];if(!(!$||typeof $!="object"))for(const[S,k]of Object.entries($)){if(typeof k!="string")continue;const v=s.has(S);!r&&v||o.push({depName:S,depType:g,isInternal:v,packageDir:m,packageJsonPath:u,packageName:p,specifier:k})}}}if(a&&l)for(const[c,u]of Object.entries(a)){const d=s.has(c);!r&&d||o.push({depName:c,depType:"pnpm.overrides",isInternal:d,packageDir:".",packageJsonPath:l,packageName:void 0,specifier:u})}return o},"iterateWorkspaceDeps");ns(e=>{const t=new Map;for(const r of e){const n=t.get(r.depName);n?n.push(r):t.set(r.depName,[r])}return t},"groupInstancesByDep");var I6=Object.defineProperty,Nt=f((e,t)=>I6(e,"name",{value:t,configurable:!0}),"u$9");const Cm=new Set(["devEngines.packageManager","devEngines.runtime","engines","packageManager","volta"]),T6=["engines","volta"],B6=new Set(["extends"]),_6=/^([@\w./-]+?)@([^+]+)(\+.+)?$/,M6=/^([@\w./-]+)~(.+)$/,tl=Nt(e=>{const t=_6.exec(e.trim());if(!(!t?.[1]||!t[2]))return{hash:t[3]??"",name:t[1],version:t[2]}},"parsePackageManager"),Hk=Nt(e=>{const t=M6.exec(e.trim());if(!(!t?.[1]||!t[2]))return{name:t[1],version:t[2]}},"parseNameTildeVersion"),uo=Nt(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Jk=Nt(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.name=="string","isDevEnginesEntry"),V6=new Set(["name@version","name~version","string","versionsByName"]),HZ=Nt(e=>{const t=[];if(!e)return t;const r=new Set;for(const n of e){const i=typeof n?.name=="string"&&n.name.length>0?n.name:"<unnamed>";if(typeof n?.name!="string"||n.name.length===0){t.push("extraTypes entry missing 'name'");continue}Cm.has(n.name)&&t.push(`extraTypes[${i}]: name collides with a built-in customType`),r.has(n.name)&&t.push(`extraTypes[${i}]: duplicate name`),r.add(n.name),(typeof n.path!="string"||n.path.length===0)&&t.push(`extraTypes[${i}]: missing 'path'`),V6.has(n.strategy)||t.push(`extraTypes[${i}]: invalid strategy "${String(n.strategy)}" (expected name@version | name~version | string | versionsByName)`),n.strategy==="string"&&(typeof n.depName!="string"||n.depName.length===0)&&t.push(`extraTypes[${i}]: strategy 'string' requires 'depName'`)}return t},"validateExtraTypes"),W6=Nt((e,t)=>{if(t.length===0)return;let r=e;for(const n of t.split(".")){if(typeof r!="object"||r===null||Array.isArray(r))return;r=r[n]}return r},"getNested"),U6=Nt((e,t,r,n,i)=>{const s=W6(t,e.path);if(s===void 0)return[];const o=Object.freeze({depName:e.depName,path:e.path,strategy:e.strategy});if(e.strategy==="versionsByName"){if(!uo(s))return[];const a=[];for(const[l,c]of Object.entries(s))typeof c=="string"&&a.push({customType:e.name,depName:l,extra:o,packageDir:r,packageJsonPath:n,packageName:i,rawValue:c,specifier:c});return a}if(e.strategy==="name@version"){if(typeof s!="string")return[];const a=tl(s);return a?[{customType:e.name,depName:a.name,extra:o,packageDir:r,packageJsonPath:n,packageName:i,rawValue:s,specifier:a.version}]:[]}if(e.strategy==="name~version"){if(typeof s!="string")return[];const a=Hk(s);return a?[{customType:e.name,depName:a.name,extra:o,packageDir:r,packageJsonPath:n,packageName:i,rawValue:s,specifier:a.version}]:[]}return typeof s!="string"||typeof e.depName!="string"||e.depName.length===0?[]:[{customType:e.name,depName:e.depName,extra:o,packageDir:r,packageJsonPath:n,packageName:i,rawValue:s,specifier:s}]},"iterateExtraType"),JZ=Nt((e,t)=>{const r=Dm(e),n=[];for(const i of r){const s=C(e,i,"package.json"),o=el(s);if(!o)continue;const a=typeof o.name=="string"?o.name:void 0,l=i==="."?".":ho(e,C(e,i));for(const u of T6){const d=o[u];if(uo(d))for(const[p,m]of Object.entries(d))typeof m=="string"&&(u==="volta"&&B6.has(p)||n.push({customType:u,depName:p,packageDir:l,packageJsonPath:s,packageName:a,rawValue:m,specifier:m}))}if(typeof o.packageManager=="string"){const u=tl(o.packageManager);u&&n.push({customType:"packageManager",depName:u.name,packageDir:l,packageJsonPath:s,packageName:a,rawValue:o.packageManager,specifier:u.version})}const{devEngines:c}=o;if(typeof c=="object"&&c!==null&&!Array.isArray(c))for(const u of["runtime","packageManager"]){const d=c[u];if(d===void 0)continue;const p=Array.isArray(d)?d:[d];for(const m of p)!Jk(m)||typeof m.version!="string"||n.push({customType:u==="runtime"?"devEngines.runtime":"devEngines.packageManager",depName:m.name,packageDir:l,packageJsonPath:s,packageName:a,rawValue:m.version,specifier:m.version})}if(t){for(const u of t)if(!(typeof u?.name!="string"||u.name.length===0)&&!Cm.has(u.name))for(const d of U6(u,o,l,s,a))n.push(d)}}return n},"iterateCustomTypeDeps"),G6=Nt((e,t)=>`${e} ${t}`,"pinKey"),q6=Nt((e,t)=>{const r=[...e].sort((i,s)=>(i.packageName??i.packageDir).localeCompare(s.packageName??s.packageDir));let n;for(const i of r){const s=xt(i.specifier);if(!s)continue;if(!n){n=i;continue}const o=xt(n.specifier);if(!o){n=i;continue}const a=Bi(o,s),l=Bi(s,o);(t==="highest"&&a||t==="lowest"&&l)&&(n=i)}return n},"pickCanonical"),KZ=Nt((e,t={})=>{const r=new Set(t.ignoreDeps),n=t.resolve??"highest",i=[],s=e.filter(a=>t.dep!==void 0&&a.depName!==t.dep?!1:!r.has(a.depName)),o=new Map;for(const a of s){const l=G6(a.customType,a.depName),c=o.get(l);c?c.push(a):o.set(l,[a])}for(const[,a]of o){if(a.length<2||new Set(a.map(c=>c.specifier)).size<=1)continue;const l=q6(a,n);if(l)for(const c of a)c.specifier!==l.specifier&&xt(c.specifier)!==void 0&&i.push({canonicalSource:l.packageName??l.packageDir,customType:c.customType,depName:c.depName,...c.extra?{extra:c.extra}:{},fix:l.specifier,packageDir:c.packageDir,packageJsonPath:c.packageJsonPath,packageName:c.packageName,specifier:c.specifier})}return i},"lintCustomTypes"),z6=Nt((e,t)=>{const r=t.extra;if(!r)return!1;const n=r.path.split(".");if(n.length===0||n.some(o=>o.length===0))return!1;let i=e;for(let o=0;o<n.length-1;o+=1){const a=i[n[o]];if(typeof a!="object"||a===null||Array.isArray(a))return!1;i=a}const s=n.at(-1);if(r.strategy==="versionsByName"){const o=i[s];return uo(o)?(o[t.depName]=t.fix,!0):!1}if(r.strategy==="name@version"){const o=i[s];if(typeof o!="string")return!1;const a=tl(o);return a?(i[s]=`${a.name}@${t.fix}`,!0):!1}if(r.strategy==="name~version"){const o=i[s];if(typeof o!="string")return!1;const a=Hk(o);return a?(i[s]=`${a.name}~${t.fix}`,!0):!1}return typeof i[s]!="string"?!1:(i[s]=t.fix,!0)},"applyExtraTypeFix"),YZ=Nt((e,t={})=>{const{useEditorconfig:r}=t,n=new Map;for(const s of e){const o=n.get(s.packageJsonPath);o?o.push(s):n.set(s.packageJsonPath,[s])}const i=[];for(const[s,o]of n){const a=el(s);if(!a)continue;let l=!1;for(const c of o){if(c.extra){z6(a,c)&&(l=!0);continue}if(c.customType==="engines"||c.customType==="volta"){const g=a[c.customType];uo(g)&&(g[c.depName]=c.fix,l=!0);continue}if(c.customType==="packageManager"){const g=a.packageManager;if(typeof g=="string"){const $=tl(g);$&&(a.packageManager=`${$.name}@${c.fix}`,l=!0)}continue}const u=c.customType==="devEngines.runtime"?"runtime":"packageManager",{devEngines:d}=a;if(!uo(d))continue;const p=d[u];if(p===void 0)continue;const m=Array.isArray(p)?p:[p];for(const g of m)Jk(g)&&g.name===c.depName&&(g.version=c.fix,l=!0)}l&&(go(s,a,{indent:Jf(s,{useEditorconfig:r}),overwrite:!0}),i.push(s))}return i},"applyCustomTypeFixes");var H6=Object.defineProperty,Fe=f((e,t)=>H6(e,"name",{value:t,configurable:!0}),"a$e");const ad="syncpack",Kk=[".syncpackrc",".syncpackrc.json"],Am=[".syncpackrc.yaml",".syncpackrc.yml"],Om=[".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],J6=[...Kk,...Am,...Om],K6=/\bextraTypes\s*:/,Y6=/\bpolicy\s*:/,hv=/(defineConfig\(\{)/,gv=/(export\s+default\s+\{)/,jm=/\bsyncpack\b/,Yk=Fe(e=>{const t=C(e,"package.json");if(x(t)&&tt(t)?.syncpack)return"package.json";for(const r of J6)if(x(C(e,r)))return r},"detectSyncpackConfig"),X6=Fe(e=>{for(const r of Om)if(x(C(e,r)))return r;const t=C(e,".syncpackrc");if(x(t)&&!es(t))try{Mt(t);return}catch{return".syncpackrc"}},"hasUnsupportedSyncpackConfig"),Q6=Fe(e=>{const t=zn(e);return t?K6.test(J(t)):!1},"hasPolicyExtraTypesInVisConfig"),Z6=Fe(e=>tt(C(e,"package.json"))?.syncpack,"extractSyncpackFromPackageJson"),eV=Fe(e=>tt(e),"parseSyncpackJsonFile"),yv=Fe(e=>{try{return Mt(e)}catch{return}},"parseSyncpackYamlFile"),tV=Fe((e,t,r)=>{if(t==="package.json")return Z6(e);if(Om.includes(t)){de(r,`${t} is a TS/JS config and cannot be auto-migrated — vis migrate does not load executable config. Convert to .syncpackrc.json and re-run, or translate directly into vis.config.ts. Tracked in https://github.com/visulima/visulima/issues/622.`),be(r,`Translate ${t} into vis.config.ts (policy.* and security.*) — see https://github.com/visulima/visulima/issues/622`);return}const n=C(e,t);if(Am.includes(t))return yv(n);if(t===".syncpackrc"&&!es(n)){const i=yv(n);if(i)return i;de(r,".syncpackrc is neither valid JSON nor YAML — please migrate manually.");return}return eV(n)},"extractConfig"),Xk=Fe((e,t)=>{const r=[];if(!e.customTypes)return r;for(const[n,i]of Object.entries(e.customTypes)){if(!i||typeof i!="object")continue;const{strategy:s}=i,{path:o}=i;if(typeof o!="string"||o.length===0){de(t,`customType "${n}" has no \`path\` — skipped.`);continue}if(s!=="name@version"&&s!=="string"&&s!=="versionsByName"){de(t,`customType "${n}" has unsupported strategy ${JSON.stringify(s)} — skipped.`);continue}if(Cm.has(n)){de(t,`customType "${n}" collides with a vis built-in and was dropped — vis already lints this surface.`);continue}const a={name:n,path:o,strategy:s};if(s==="string"){const{depName:l}=i;typeof l=="string"&&l.length>0?a.depName=l:(de(t,`customType "${n}" uses strategy "string" but has no \`depName\` — vis requires it. Add it manually after migration.`),be(t,`Set policy.customTypes.extraTypes[name="${n}"].depName before running vis lint`))}r.push(a)}return r},"translateCustomTypes"),Qk=Fe(e=>e.isBanned===!0,"isVersionGroupBanned"),Zk=Fe((e,t)=>{if(Array.isArray(e.versionGroups)&&e.versionGroups.length>0){const r=e.versionGroups.filter(n=>n&&typeof n=="object"&&!Qk(n));r.length>0&&(de(t,`${String(r.length)} versionGroups rule(s) cannot be migrated — \`pinVersion\`, \`snapTo\`, and \`policy: "sameRange"\` (and other versionGroups DSL surfaces) are tracked in https://github.com/visulima/visulima/issues/622.`),be(t,'Re-implement versionGroups rules using `pinVersion` / `snapTo` / `policy: "sameRange"` once the vis DSL ships (issue #622).'))}Array.isArray(e.semverGroups)&&e.semverGroups.length>0&&(de(t,`${String(e.semverGroups.length)} semverGroups rule(s) cannot be migrated — semverGroups DSL is tracked in https://github.com/visulima/visulima/issues/622.`),be(t,"Re-implement semverGroups rules manually once the vis DSL ships (issue #622)")),Array.isArray(e.dependencyTypes)&&e.dependencyTypes.length>0&&be(t,"Review syncpack `dependencyTypes` — vis applies policies to dependencies/devDependencies/peerDependencies/optionalDependencies/overrides by default. Narrow via policy.* filters if needed."),Array.isArray(e.specifierTypes)&&e.specifierTypes.length>0&&be(t,"Review syncpack `specifierTypes` — vis has no direct equivalent today; specifier filtering belongs in versionGroups (issue #622)."),typeof e.filter=="string"&&e.filter.length>0&&be(t,`Re-implement syncpack \`filter\` regex (${e.filter}) once vis exposes a top-level dep filter.`),(Array.isArray(e.sortAz)&&e.sortAz.length>0||Array.isArray(e.sortFirst)&&e.sortFirst.length>0||Array.isArray(e.sortExports)&&e.sortExports.length>0)&&de(t,"syncpack sort options (sortAz / sortFirst / sortExports) are superseded by `vis sort-package-json` — no migration needed."),(e.sortPackages!==void 0||e.formatBugs!==void 0||e.formatRepository!==void 0)&&de(t,"syncpack package.json shape options (sortPackages / formatBugs / formatRepository) are superseded by `vis sort-package-json` — no migration needed."),(e.lintFormatting!==void 0||e.lintSemverRanges!==void 0||e.lintVersions!==void 0)&&de(t,"syncpack lint toggles (lintFormatting / lintSemverRanges / lintVersions) are covered by `vis lint` by default — no migration needed."),Array.isArray(e.source)&&e.source.length>0&&be(t,`syncpack \`source\` was set to [${e.source.map(r=>JSON.stringify(r)).join(", ")}]. vis derives workspace globs from pnpm-workspace.yaml / package.json#workspaces — verify they match before relying on \`vis lint\`.`),typeof e.indent=="string"&&e.indent.length>0&&de(t,"syncpack `indent` is implicit in vis — JSON writers honor `.editorconfig` (and the source file's existing indentation). No migration needed.")},"noteUnsupportedKeys"),eS=Fe((e,t)=>{const r={};if(!Array.isArray(e.versionGroups))return r;for(const n of e.versionGroups){if(!n||typeof n!="object")continue;const i=n;if(!Qk(i))continue;const s=Array.isArray(i.dependencies)?i.dependencies.filter(c=>typeof c=="string"&&c.length>0):[];if(s.length===0){de(t,"versionGroup with `isBanned: true` has no `dependencies` entries — skipped.");continue}const o=Array.isArray(i.packages)?i.packages.filter(c=>typeof c=="string"&&c.length>0):[],a=i.label,l=typeof a=="string"&&a.length>0?a:"banned via syncpack versionGroups";for(const c of s){if(r[c]!==void 0){de(t,`Multiple banned versionGroups target "${c}" — kept the first match; merge manually if needed.`);continue}r[c]=o.length>0?{packages:o,reason:l}:l}}return r},"translateBannedDeps"),rV=Fe(e=>{const t=[`name: ${JSON.stringify(e.name)}`,`path: ${JSON.stringify(e.path)}`,`strategy: ${JSON.stringify(e.strategy)}`];return e.depName!==void 0&&t.push(`depName: ${JSON.stringify(e.depName)}`),` { ${t.join(", ")} }`},"formatExtraTypeLiteral"),nV=Fe((e,t)=>{if(typeof t=="string")return` ${JSON.stringify(e)}: ${JSON.stringify(t)}`;const r=[`reason: ${JSON.stringify(t.reason)}`];return t.packages&&t.packages.length>0&&r.push(`packages: [${t.packages.map(n=>JSON.stringify(n)).join(", ")}]`),t.paths&&t.paths.length>0&&r.push(`paths: [${t.paths.map(n=>JSON.stringify(n)).join(", ")}]`),t.replacement!==void 0&&r.push(`replacement: ${JSON.stringify(t.replacement)}`),` ${JSON.stringify(e)}: { ${r.join(", ")} }`},"formatBannedDepRule"),cd=Fe((e,t={})=>{const r=[],n=Object.entries(t);if(n.length>0){const i=n.map(([s,o])=>nV(s,o)).join(`,
|
|
1078
|
+
`);r.push(` bannedDeps: {
|
|
1079
|
+
${i},
|
|
1080
|
+
}`)}if(e.length>0){const i=e.map(s=>rV(s)).join(`,
|
|
1081
|
+
`);r.push(` customTypes: {
|
|
1082
|
+
extraTypes: [
|
|
1083
|
+
${i},
|
|
1084
|
+
],
|
|
1085
|
+
}`)}return` policy: {
|
|
1086
|
+
${r.join(`,
|
|
1087
|
+
`)},
|
|
1088
|
+
}`},"generatePolicySnippet"),tS=Fe((e,t)=>{const r=[],n=Object.keys(t).length;return e.length>0&&r.push(`${String(e.length)} customType(s)`),n>0&&r.push(`${String(n)} bannedDep(s)`),r.join(" + ")},"summarizePolicyContents"),iV=Fe((e,t,r,n={})=>{const i=tS(t,n);if(i==="")return!1;const s=zn(e);if(s){const l=J(s);if(Y6.test(l))return r.warn(`vis.config.ts already has a "policy" block — please merge ${i} manually.`),!1;const c=cd(t,n);let u;return hv.test(l)?u=l.replace(hv,`$1
|
|
1089
|
+
${c},`):gv.test(l)&&(u=l.replace(gv,`$1
|
|
1090
|
+
${c},`)),u?(Ee(s),Ve(s,u,"utf8"),r.info(`Merged ${i} into ${s}`),!0):(r.warn(`Could not auto-insert policy block into ${s} — please add manually`),!1)}const o=C(e,"vis.config.ts"),a=`import { defineConfig } from "@visulima/vis/config";
|
|
1091
|
+
|
|
1092
|
+
export default defineConfig({
|
|
1093
|
+
${cd(t,n)},
|
|
1094
|
+
});
|
|
1095
|
+
`;return Ve(o,a,"utf8"),r.info(`Created ${o} with ${i}`),!0},"insertPolicyIntoVisConfig"),sV=Fe((e,t)=>{const r=C(e,"package.json"),n={catalogStripped:!1,configRemoved:!1,dependencyRemoved:!1,removedScripts:[],scriptCount:0};if(!x(r))return n;const i=J(r),s=JSON.parse(i);let o=!1;s.syncpack&&(delete s.syncpack,o=!0,n.configRemoved=!0);for(const u of["dependencies","devDependencies"]){const d=s[u];d?.syncpack&&(delete d.syncpack,o=!0,n.dependencyRemoved=!0)}const a=s.workspaces;if(a&&typeof a=="object"&&!Array.isArray(a)){const u=a.catalog;u&&typeof u.syncpack=="string"&&(delete u.syncpack,o=!0,n.catalogStripped=!0);const d=a.catalogs;if(d&&typeof d=="object")for(const p of Object.values(d))p&&typeof p.syncpack=="string"&&(delete p.syncpack,o=!0,n.catalogStripped=!0)}const l=s.catalog;l&&typeof l.syncpack=="string"&&(delete l.syncpack,o=!0,n.catalogStripped=!0);const c=s.scripts;if(c){const u={};for(const[d,p]of Object.entries(c))typeof p=="string"&&jm.test(p)?(n.scriptCount+=1,n.removedScripts.push({name:d,value:p}),o=!0):u[d]=p;n.scriptCount>0&&(Object.keys(u).length===0?delete s.scripts:s.scripts=u)}if(o){const u=Ro(r,i,{useEditorconfig:t});Ee(r),Ve(r,`${JSON.stringify(s,void 0,u)}
|
|
1096
|
+
`,"utf8")}return n},"removeSyncpackFromPackageJson"),oV=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],aV=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],rS=Fe((e,t)=>{const r=[],n=Fe(i=>{const s=C(e,i);x(s)&&jm.test(J(s))&&(r.push(i),be(t,`Update ${i} — replace \`syncpack\` invocation(s) with \`vis lint\` / \`vis sort-package-json\` as appropriate.`))},"scanFile");for(const i of aV){const s=C(e,i);if(x(s)){if(i===".github/workflows"){try{for(const o of Kt(s))(o.endsWith(".yml")||o.endsWith(".yaml"))&&n(`.github/workflows/${o}`)}catch{}continue}n(i)}}return r},"detectCiReferences"),nS=Fe((e,t)=>{const r=[];for(const n of oV){const i=C(e,n);x(i)&&jm.test(J(i))&&(r.push(n),be(t,`Update ${n} — replace \`syncpack\` invocation with \`vis lint\` / \`vis sort-package-json\` as appropriate.`))}return r},"detectHookReferences"),cV=Fe(e=>{const t=C(e,"pnpm-workspace.yaml");if(!x(t))return!1;let r;try{r=Mt(t)}catch{return!1}if(!r||typeof r!="object")return!1;let n=!1;const i=r.catalog;i&&typeof i.syncpack=="string"&&(delete i.syncpack,n=!0);const s=r.catalogs;if(s&&typeof s=="object")for(const o of Object.values(s))o&&typeof o.syncpack=="string"&&(delete o.syncpack,n=!0);return n&&(Ee(t),xo(t,r)),n},"removeSyncpackFromPnpmCatalogs"),lV=Fe((e,t)=>{for(const r of[...Kk,...Am]){const n=C(e,r);x(n)&&(Ee(n,t),Vi(n),ot(t,ad,"removedConfigCount"))}},"removeSyncpackConfigFiles"),uV=Fe((e,t,r,n,i)=>{const s=Xk(t,i);Zk(t,i);const o=nS(e,i);o.length>0&&!r.silent&&n.warn(`Found syncpack reference in ${String(o.length)} hook file(s) — see manualSteps for details.`);const a=rS(e,i);a.length>0&&!r.silent&&n.warn(`Found syncpack reference in ${String(a.length)} CI file(s) — see manualSteps for details.`);const l=eS(t,i);(s.length>0||Object.keys(l).length>0)&&iV(e,s,n,l);const{catalogStripped:c,configRemoved:u,dependencyRemoved:d,removedScripts:p,scriptCount:m}=sV(e,r.useEditorconfig);u&&!r.silent&&n.info("Removed `syncpack` block from package.json"),d&&ot(i,ad,"removedPackageCount");const g=cV(e);if((c||g)&&!r.silent&&n.info("Stripped `syncpack` from catalog protocol entries."),m>0){ot(i,ad,"rewrittenScriptCount",m);for(const{name:$,value:S}of p)be(i,`Recreate script \`${$}\` (removed; was \`${S}\`). Replace \`syncpack\` with \`vis lint\` / \`vis sort-package-json\` as appropriate.`);r.silent||n.info(`Removed ${String(m)} script(s) referencing \`syncpack\`. Replace with \`vis lint\` / \`vis sort-package-json\` as appropriate.`)}lV(e,i)},"applyMigration"),vv=Fe((e,t,r,n)=>{const i=Yk(e);if(!i)return t.silent||r.info("No syncpack configuration found — nothing to migrate."),!1;const s=X6(e);s&&(de(n,`Syncpack config ${s} is a TS/JS format vis migrate cannot load — executable config support is tracked in https://github.com/visulima/visulima/issues/622. Convert to .syncpackrc.json and re-run.`),be(n,`Convert ${s} to .syncpackrc.json (or translate it directly into policy.customTypes.extraTypes in vis.config.ts) — see https://github.com/visulima/visulima/issues/622`),t.silent||r.warn(`Cannot read ${s} — manual migration required (https://github.com/visulima/visulima/issues/622).`)),Q6(e)&&(de(n,"vis.config.ts already declares `policy.customTypes.extraTypes` — skipping syncpack customTypes merge to avoid duplicates."),t.silent||r.warn("vis.config.ts already has policy.customTypes.extraTypes — skipping merge"));const o=tV(e,i,n);if(!o)return!1;if(t.dryRun){const a=Xk(o,n),l=eS(o,n);Zk(o,n),nS(e,n),rS(e,n);const c=tS(a,l);return t.silent||(c===""?r.info("[dry-run] No policy entries to merge — manualSteps will surface the rest."):(r.info(`[dry-run] Would merge ${c} into vis.config.ts:`),r.info(cd(a,l)))),!0}return uV(e,o,t,r,n),!0},"migrateSyncpack");var pV=Object.defineProperty,xm=f((e,t)=>pV(e,"name",{value:t,configurable:!0}),"l$b");const dV=xm(e=>e.map(t=>{if(t.startsWith("^"))return{dependencies:!0,target:t.slice(1)};if(t.includes("#")){const[r,n]=t.split("#");return{projects:r,target:n}}return t}),"convertDependsOn"),fV=xm((e,t,r)=>{const n=e.tasks??e.pipeline??{},i={};for(const[a,l]of Object.entries(n)){if(a.includes("#"))continue;const c={};l.persistent&&(c.persistent=!0),l.interactive&&(c.interactive=!0);const u={};l.cache===!1&&(u.cache=!1),l.dependsOn&&l.dependsOn.length>0&&(u.dependsOn=dV(l.dependsOn)),l.inputs&&l.inputs.length>0&&(u.inputs=l.inputs),l.outputs&&l.outputs.length>0&&(u.outputs=l.outputs),l.env&&l.env.length>0&&(u.env=l.env),l.passThroughEnv&&l.passThroughEnv.length>0&&(u.passThroughEnv=l.passThroughEnv),Object.keys(c).length>0&&(u.options=c),i[a]=u}const s={};Object.keys(i).length>0&&(s.tasks=i);const o={};return e.globalDependencies&&e.globalDependencies.length>0&&(o.globalInputs=e.globalDependencies),e.globalEnv&&e.globalEnv.length>0&&(o.globalEnv=e.globalEnv),e.globalPassThroughEnv&&e.globalPassThroughEnv.length>0&&(o.globalPassThroughEnv=e.globalPassThroughEnv),Object.keys(o).length>0&&(s.taskRunner=o),["// Migrated from turbo.json by `vis migrate turborepo`.","// Review the generated `tasks` block and move project-specific tasks","// into each project's project.json.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${om(s,C(t,"vis.config.ts"),r)});`,""].join(`
|
|
1097
|
+
`)},"renderVisConfig"),bv=xm((e,t,r,n)=>{const i=ak(e,"turbo.json");if(!i){r.warn("No turbo.json found in workspace root — nothing to migrate."),n.warnings.push("No turbo.json at workspace root.");return}const s=fV(i,e,t.useEditorconfig);if(!am(e,s,t,r,n))return;n.manualSteps.push("Review the `tasks` block in vis.config.ts — project-specific tasks (turbo's project#task syntax) were skipped and should be moved into each project's project.json."),n.manualSteps.push("vis adds two task primitives turbo doesn't have: `when: { os, env, branch, ci, not.* }` for conditional execution and `always: true` for finally/teardown tasks that run even when upstream fails. See docs/guides/conditional-and-finally-tasks.mdx.");const o=i.tasks??i.pipeline??{};Object.values(o).some(a=>a.outputLogs!==void 0)&&n.warnings.push("`outputLogs` was found on one or more tasks but vis has no equivalent setting — review and remove."),i.remoteCache?.enabled&&n.manualSteps.push("turbo remote cache detected. vis speaks the same HTTP protocol — set taskRunner.remoteCache { url, token, teamId } in vis.config.ts, or keep your TURBO_API / TURBO_TOKEN / TURBO_TEAM env vars (vis honours them as fallbacks).")},"migrateTurborepo");var mV=Object.defineProperty,oe=f((e,t)=>mV(e,"name",{value:t,configurable:!0}),"n$g");const hV=/\b(?:husky|lint-staged|nano-staged)\b/,gV=oe(e=>{const t=C(e,"package.json");if(x(t))try{return JSON.parse(J(t))}catch{return}},"readPackageJson"),yV=oe((e,t)=>{const r=gV(e);if(!r)return!1;const n={...r.dependencies,...r.devDependencies};for(const s of J1)if(n[s])return!0;if(r.scripts){for(const s of Object.values(r.scripts))if(typeof s=="string"&&hV.test(s))return!0}const{overrides:i}=t;return i?Object.keys(i).length>0:!1},"detectDepsNeedsMigration"),vV=oe(e=>x(C(e,"turbo.json")),"detectTurborepo"),bV=oe(e=>x(C(e,"nx.json")),"detectNx"),$V=oe(e=>x(C(e,".moon")),"detectMoon"),Gt=oe(()=>{const e=[];return{lines:e,logger:{info:oe(t=>{e.push(t)},"info"),warn:oe(t=>{e.push(`⚠ ${t}`)},"warn")}}},"createCapturingLogger"),wV=[{apply:oe(({packageManager:e,root:t,visConfig:r},n,i)=>{ey(t,e,r,{dryRun:!1},i,n)},"apply"),description:"Remove husky/lint-staged/nano-staged from package.json and rewrite scripts to `vis staged`.",detect:oe(({root:e,visConfig:t})=>yV(e,t),"detect"),id:"deps",probe:oe(({packageManager:e,root:t,visConfig:r})=>{const{lines:n,logger:i}=Gt(),s=Lt();return ey(t,e,r,{dryRun:!0},i,s),n},"probe"),title:"Dependencies & scripts"},{apply:oe(({root:e},t,r)=>{oy(e,{dryRun:!1},r,t)},"apply"),description:"Inline lint-staged configuration into vis.config.ts.",detect:oe(({root:e})=>!!sk(e),"detect"),id:"lint-staged",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return oy(e,{dryRun:!0},r,n),t},"probe"),title:"lint-staged"},{apply:oe(({root:e},t,r)=>{uy(e,{dryRun:!1},r,t)},"apply"),description:"Inline nano-staged configuration into vis.config.ts.",detect:oe(({root:e})=>!!ck(e),"detect"),id:"nano-staged",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return uy(e,{dryRun:!0},r,n),t},"probe"),title:"nano-staged"},{apply:oe(({root:e},t,r)=>{bv(e,{dryRun:!1},r,t)},"apply"),description:"Translate turbo.json tasks into vis.config.ts.",detect:oe(({root:e})=>vV(e),"detect"),id:"turborepo",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return bv(e,{dryRun:!0},r,n),t},"probe"),title:"Turborepo"},{apply:oe(({root:e},t,r)=>{dy(e,{dryRun:!1},r,t)},"apply"),description:"Translate nx.json targets into vis.config.ts.",detect:oe(({root:e})=>bV(e),"detect"),id:"nx",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return dy(e,{dryRun:!0},r,n),t},"probe"),title:"Nx"},{apply:oe(({root:e},t,r)=>{ay(e,{copyTemplates:!1,dryRun:!1},r,t)},"apply"),description:"Translate .moon/tasks.yml into vis.config.ts.",detect:oe(({root:e})=>$V(e),"detect"),id:"moon",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return ay(e,{copyTemplates:!1,dryRun:!0},r,n),t},"probe"),title:"Moon"},{apply:oe(({root:e},t,r)=>{ty(e,{dryRun:!1},r,t)},"apply"),description:"Convert gitleaks config/baseline/hooks to `vis secrets`.",detect:oe(({root:e})=>!!(Gc(e)??rm(e)??nm(e)),"detect"),id:"gitleaks",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return ty(e,{dryRun:!0},r,n),t},"probe"),title:"Gitleaks"},{apply:oe(({root:e},t,r)=>{ny(e,{dryRun:!1},r,t)},"apply"),description:"Convert Kingfisher baseline/rules/hooks to `vis secrets`.",detect:oe(({root:e})=>!!(im(e)??qc(e)),"detect"),id:"kingfisher",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return ny(e,{dryRun:!0},r,n),t},"probe"),title:"Kingfisher"},{apply:oe(({root:e},t,r)=>{fy(e,{dryRun:!1},r,t)},"apply"),description:"Replace secretlint config/hooks with `vis secrets`.",detect:oe(({root:e})=>!!(dk(e)??fk(e)),"detect"),id:"secretlint",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return fy(e,{dryRun:!0},r,n),t},"probe"),title:"Secretlint"},{apply:oe(({root:e},t,r)=>{vv(e,{dryRun:!1},r,t)},"apply"),description:"Translate syncpack customTypes into policy.customTypes.extraTypes and strip the syncpack dep/scripts.",detect:oe(({root:e})=>!!Yk(e),"detect"),id:"syncpack",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return vv(e,{dryRun:!0},r,n),t},"probe"),title:"Syncpack"},{apply:oe(({root:e},t,r)=>{my(e,{dryRun:!1},r,t)},"apply"),description:"Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command.",detect:oe(({root:e})=>!!mk(e)||hk(e),"detect"),id:"sherif",probe:oe(({root:e})=>{const{lines:t,logger:r}=Gt(),n=Lt();return my(e,{dryRun:!0},r,n),t},"probe"),title:"Sherif"}],kV=oe(e=>wV.filter(t=>t.detect(e)),"getApplicableMigrations"),SV=oe((e,t)=>({packageManager:Y1(e),root:e,visConfig:t}),"buildProbeContext");var EV=Object.defineProperty,DV=f((e,t)=>EV(e,"name",{value:t,configurable:!0}),"s$b");const CV=DV((e,t)=>{t.info("── Migration Summary ──");const r=[["Staged configs merged into vis.config.ts",e.mergedStagedConfigCount],["Lint-staged configs inlined",e.inlinedLintStagedConfigCount],["Config files removed",e.removedConfigCount],["Packages removed",e.removedPackageCount],["Scripts rewritten",e.rewrittenScriptCount]];for(const[i,s]of r)s>0&&t.info(` ${i}: ${String(s)}`);e.gitHooksConfigured&&t.info(" Pre-commit hook updated to use vis staged");const n=Object.entries(e.perMigration);if(n.length>0){t.info(""),t.info("By migration:");for(const[i,s]of n){const o=[];s.removedConfigCount>0&&o.push(`${String(s.removedConfigCount)} config(s) removed`),s.removedPackageCount>0&&o.push(`${String(s.removedPackageCount)} package(s) removed`),s.rewrittenScriptCount>0&&o.push(`${String(s.rewrittenScriptCount)} script(s) rewritten`),t.info(` ${i}: ${o.join(", ")||"no changes"}`)}}if(e.backupsCreated.length>0&&(t.info(""),t.info(`Created ${String(e.backupsCreated.length)} .bak file(s) for rollback. Remove them once you're happy.`)),e.warnings.length>0){t.info(""),t.warn("Warnings:");for(const i of e.warnings)t.warn(` - ${i}`)}if(e.manualSteps.length>0){t.info(""),t.info("Manual steps required:");for(const i of e.manualSteps)t.info(` - ${i}`)}},"printSummary");var AV=Object.defineProperty,iS=f((e,t)=>AV(e,"name",{value:t,configurable:!0}),"c$6");const OV=iS((e,t)=>{if(e.length===0){t.info("No applicable migrations detected in this workspace.");return}t.info(`Detected migrations (non-interactive preview):
|
|
1098
|
+
`);for(const r of e){t.info(` • ${r.entry.title} — ${r.entry.description}`);for(const n of r.preview)t.info(` ${n}`);t.info("")}t.info("Run a specific migration with `vis migrate <name>` (e.g. `vis migrate deps`).")},"renderFallbackTable"),jV=iS(async e=>{const t=e.workspaceRoot??process.cwd(),r=e.visConfig??{},n=SV(t,r),i=kV(n).map(d=>({entry:d,preview:d.probe(n)}));if(!(process.stdout.isTTY&&!Ir)){OV(i,e.logger);return}if(i.length===0){e.logger.info("No applicable migrations detected in this workspace.");return}const s=new V_(i),o=r.tui?.autoExit??!1,a=o===!0?3:typeof o=="number"?o:0,l=await tD(Si.createElement(t3,{autoExitSeconds:a,isDryRun:!1,store:s}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();if(!l||l.length===0){e.logger.info("No migrations selected — exiting.");return}const c=Lt(),u=[];for(const d of l)try{e.logger.info(`── Applying ${d.entry.title} ──`),d.entry.apply(n,c,e.logger),e.logger.info("")}catch(p){u.push({entry:d.entry,error:p}),e.logger.warn(`Failed to apply ${d.entry.title}: ${p.message}`)}CV(c,e.logger),u.length>0&&(e.logger.warn(""),e.logger.warn(`${String(u.length)} migration(s) failed — see messages above.`),process.exitCode=1)},"runMigrateInteractive");var xV=Object.defineProperty,PV=f((e,t)=>xV(e,"name",{value:t,configurable:!0}),"e$k");const NV={description:"Analyze and optimize dependencies using e18e replacements and @socketregistry overrides",examples:[["vis optimize","Interactive TUI to select and apply optimizations"],["vis optimize --dry-run","Preview available optimizations"],["vis optimize --pin","Pin Socket.dev overrides to exact versions"],["vis optimize --prod","Only optimize production dependencies"]],group:"Workspace",loader:PV(()=>import("./handler40.js").then(e=>e.h),"loader"),name:"optimize",options:[{alias:"d",defaultValue:!1,description:"Preview available optimizations without applying",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Pin Socket.dev overrides to exact versions",name:"pin",type:Boolean},{defaultValue:!1,description:"Only optimize production dependencies",name:"prod",type:Boolean},{defaultValue:!1,description:"Skip running install after applying overrides",name:"no-install",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var RV=Object.defineProperty,FV=f((e,t)=>RV(e,"name",{value:t,configurable:!0}),"e$j");const LV={argument:{description:"Subcommand and arguments (e.g., cache dir, publish --dry-run, list --depth 0)",name:"args",type:String},description:"Package manager utilities (cache, publish, audit, list, config, etc.)",examples:[["vis pm cache dir","Show cache directory"],["vis pm cache clean","Clean cache"],["vis pm publish --dry-run","Preview publishing"],["vis pm list --depth 0","List direct dependencies"],["vis pm audit","Run security audit"],["vis pm whoami","Show logged-in user"]],group:"System",loader:FV(()=>import("./handler18.js"),"loader"),name:"pm"};var IV=Object.defineProperty,TV=f((e,t)=>IV(e,"name",{value:t,configurable:!0}),"e$i");const BV={alias:["rm","un","uninstall"],argument:{description:"Packages to remove",name:"packages",type:String},description:"Remove packages using the detected package manager",examples:[["vis remove lodash","Remove a package"],["vis rm old-package","Remove using alias"],["vis remove --filter app react","Remove from specific workspace"],["vis remove -g typescript","Remove global package"]],group:"Dependencies",loader:TV(()=>import("./handler19.js"),"loader"),name:"remove",options:[{alias:"D",defaultValue:!1,description:"Remove from devDependencies",name:"save-dev",type:Boolean},{alias:"g",defaultValue:!1,description:"Remove global package",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Remove from all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Remove from workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]},_V={description:"Replay a previous task run from .vis/runs/ — show task results without re-executing",examples:[["vis replay","Show the most recent run summary"],["vis replay --run 2026-04-28T12-34-56_ab12","Inspect a specific historical run"],["vis replay --list","List every recorded run, newest first"],["vis replay --task @myorg/app:build","Focus on one task within the loaded run"],["vis replay --failed","Filter to only failed tasks"],["vis replay --format=json","Machine-readable output for CI"]],group:"Workspace",loader:Pe(()=>import("./handler20.js"),"replayExecute"),name:"replay",options:[{description:"Run id to replay (defaults to the most recent run)",name:"run",type:String},{defaultValue:!1,description:"List every available run instead of replaying one",name:"list",type:Boolean},{description:"Filter the replay to a single task id (e.g. @my/app:build)",name:"task",type:String},{defaultValue:!1,description:"Filter the replay to failed tasks only",name:"failed",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var MV=Object.defineProperty,VV=f((e,t)=>MV(e,"name",{value:t,configurable:!0}),"e$h");const WV={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target across workspace projects",examples:[["vis run","List all available targets"],["vis run build","Run build on all projects"],["vis run :build","Run build on all projects (moon-style)"],["vis run ~:test","Run test on the project closest to the current directory"],['vis run "#frontend:build"',"Run build on projects tagged 'frontend'"],['vis run :build --query "language=typescript"',"Filter by project metadata"],["vis run test --affected","Run test only on git-changed projects"],["vis run build --fail-fast","Stop on first failure"],["vis run build --dry-run","Show execution plan without running"],["vis run destroy --reverse","Run leaves-first (teardown order, e.g. CDK/Pulumi destroy)"]],group:"Run & Execute",loader:VV(()=>import("./handler48.js"),"loader"),name:"run",options:[{alias:"p",description:"Comma-separated list of projects to run",name:"projects",type:String},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{description:"Detect lockfile/node_modules drift before running (warns in TTY, fails in CI). Use --no-preflight to disable.",name:"preflight",type:Boolean},{defaultValue:3,description:"Maximum number of parallel tasks (falls back to VIS_RUN_CONCURRENCY_LIMIT env var, then 3)",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{description:"Comma-separated selectors of tasks to bypass cache for (e.g. 'app:test', ':e2e', '#flaky:lint'). Other tasks in the run still cache normally. --no-cache wins when both are set.",name:"skip-cache",type:String},{description:"Custom cache directory",name:"cache-dir",type:String},{description:"Remote cache mode: read | write | readwrite (defaults to readwrite when remoteCache is configured)",name:"cache-mode",type:String},{description:"Remote cache wire backend: http (Turborepo-compatible) or reapi (Bazel Remote Execution API gRPC)",name:"cache-backend",type:String},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Generate a run summary after execution",name:"summarize",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{defaultValue:!1,description:"Skip project constraint validation",name:"skip-constraints",type:Boolean},{description:"Filter matched projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String},{defaultValue:!1,description:"Only run on projects affected by git changes (shorthand for vis affected)",name:"affected",type:Boolean},{defaultValue:!1,description:"Rerun affected tasks on file change. Ctrl+C to exit.",name:"watch",type:Boolean},{defaultValue:!1,description:"Stop all tasks on first failure",name:"fail-fast",type:Boolean},{defaultValue:!1,description:"Run the dependency graph in reverse (leaves first, then their dependents). Useful for teardown targets like `destroy`/`undeploy` where dependents must run before the things they depend on.",name:"reverse",type:Boolean},{description:"Output mode: interleaved (pass-through), labeled (prefix each line with [pkg#task]), or grouped (vite-task-style block)",name:"log",type:String},{description:"Output style: normal (print every task) or quiet (skip output for successful/cached tasks; failed tasks still print in CI mode, and remain in TUI scrollback in interactive mode). Per-target options.outputStyle overrides this.",name:"output-style",type:String},{defaultValue:!1,description:"Run every task through a pseudo-terminal so color-aware tools render as if attached to a TTY (disables caching)",name:"pty",type:Boolean},{description:"Global retry budget: cap on total task retries across the run (per-target retryCount is still honored up to the budget)",name:"retry-budget",type:Number},{description:"Write a Chrome Tracing JSON profile of the run to this path (open in chrome://tracing or Perfetto)",name:"profile",type:String},{defaultValue:!1,description:"Render the most-recent run's saved summary (from .vis/last-summary.json) and exit without executing any tasks",name:"last-details",type:Boolean},{defaultValue:!0,description:"Show flaky task report on failure (use --no-flaky to suppress)",name:"flaky",type:Boolean},{defaultValue:!1,description:"Treat any task that needed at least one retry as a run failure (exit non-zero), even when retries eventually succeeded. Use in CI to surface flakes that retries would otherwise mask.",name:"fail-on-retry",type:Boolean},{description:"Fail a task if its command references an env var that is unset (no silent empty-string substitution). Use --no-strict-env to disable when set in config.",name:"strict-env",type:Boolean},{description:"Comma-separated tags this runner advertises (e.g. 'gpu,slow'). Tasks declaring `options.runnerTags` only run when at least one tag overlaps. Untagged tasks always run. Falls back to VIS_RUNNER_TAGS env var.",name:"runner-tags",type:String},{description:"Auto-start service deps. One of: auto | ephemeral | persistent | off. Defaults to `auto` in TTY, `off` in CI.",name:"services",type:String},{defaultValue:!1,description:"Stop services this run auto-started in registry mode when the run exits (clean, q, or Ctrl+C). Ephemeral services already die with the run.",name:"stop-services",type:Boolean}]};var UV=Object.defineProperty,GV=f((e,t)=>UV(e,"name",{value:t,configurable:!0}),"e$g");const qV={description:"Generate a CycloneDX 1.7 Software Bill of Materials for the workspace",examples:[["vis sbom","Write the full-workspace SBOM to sbom.cdx.json"],["vis sbom --focus=my-app","Scope the SBOM to my-app's transitive closure"],["vis sbom --focus=my-app,other","Focus multiple projects"],["vis sbom --format=xml --output=sbom.cdx.xml","Emit XML instead of JSON"],["vis sbom --include-dev","Include devDependencies (default: production only)"],["vis sbom --output=-","Write to stdout"]],group:"Security & Health",loader:GV(()=>import("./handler21.js"),"loader"),name:"sbom",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{defaultValue:"json",description:"Output format: json (default) or xml",name:"format",type:String},{description:"Output path (use '-' for stdout; default: sbom.cdx.json)",name:"output",type:String},{defaultValue:!1,description:"Include devDependencies (default: production only)",name:"include-dev",type:Boolean}]};var zV=Object.defineProperty,HV=f((e,t)=>zV(e,"name",{value:t,configurable:!0}),"e$f");const JV={argument:{description:"One or more paths to scan (defaults to workspace root)",name:"paths",type:String},description:"Scan a repository for hardcoded secrets and credentials",examples:[["vis secrets","Scan the workspace with grouped, colourised output"],["vis secrets --staged","Scan only files staged for the current commit (pre-commit hooks)"],["vis secrets --since main","Scan only files changed since the `main` branch"],["vis secrets --affected","Scan only projects affected by the current branch"],["vis secrets --init","Write an initial baseline from current findings"],["vis secrets --list-rules","Print all bundled detection rules"],["vis secrets --list-validators","Print non-HTTP validator types in the ruleset + install hints for each"],["vis secrets --exclude-rule generic-api-key --exclude-rule aws-access-token","Drop noisy rules"],["vis secrets --include-rule stripe-access-token","Check a single rule"],["vis secrets --enable-rule tag:preset:weak-passwords","Enable an opt-in rule group additively (defaults still fire)"],["vis secrets --include-rule tag:preset:password-manager","Restrict output to one opt-in group only"],["vis secrets --min-confidence high","Drop rules without a high confidence label (CI-friendly precision filter)"],["vis secrets --validate --only-verified","Live-verify each finding against its provider (one HTTP call per finding)"],["vis secrets --exclude 'dist/**' --exclude-from .secretsignore","Extra gitignore-syntax exclusions for the walker"],["vis secrets --config ./leaks.json --no-extend-bundled","Use only the supplied config, skip the bundled ruleset"],["vis secrets --concurrency 4","Cap the rayon thread pool (0 / omit = auto)"],["vis secrets --baseline .secrets-baseline.json","Suppress known findings; print diff vs. baseline"],["vis secrets --update-baseline","Merge current findings into the baseline (use --replace-baseline to overwrite)"],["vis secrets --format sarif > report.sarif","SARIF output for GitHub code-scanning"]],group:"Security",loader:HV(()=>import("./handler49.js"),"loader"),name:"secrets",options:[{description:"Path to a JSON config (gitleaks-compatible shape). Defaults to the bundled ruleset.",name:"config",type:String},{description:"Drop rules below this author-declared confidence: low (default), medium, high. Rules without a declared confidence (every gitleaks rule) are treated as low, so --min-confidence medium or higher drops them along with explicit low-confidence rules.",name:"min-confidence",type:String},{defaultValue:!1,description:"Live-verify each finding against its provider (one HTTP call per finding, max 8 concurrent). Only supports Kingfisher-style HTTP validators with StatusMatch / WordMatch response matchers; other types (gRPC, multi-step, checksum) mark the finding as validation=skipped. WARNING: sends candidate secrets to the provider — some providers alert their security team on failed auth attempts.",name:"validate",type:Boolean},{defaultValue:!1,description:"With --validate, drop every finding whose validation is not 'verified'. Useful for CI gating.",name:"only-verified",type:Boolean},{defaultValue:!1,description:"With --config, do not merge on top of the bundled ruleset — replace it.",name:"no-extend-bundled",type:Boolean},{defaultValue:"text",description:"Output format: text (default), json, sarif",name:"format",type:String},{description:"Path to a baseline JSON of previously-triaged findings",name:"baseline",type:String},{defaultValue:!1,description:"Scan only files staged for commit",name:"staged",type:Boolean},{description:"Scan only files changed since <ref> (e.g. main, origin/HEAD)",name:"since",type:String},{defaultValue:!1,description:"Scan only projects affected by the current branch",name:"affected",type:Boolean},{description:"Enable an opt-in rule or tag without restricting output — additive (e.g. tag:preset:weak-passwords, tag:preset:password-manager). Repeatable.",multiple:!0,name:"enable-rule",type:String},{description:"Rule id or tag:<name> selector — whitelist, only matching findings are emitted. Implies enablement. Repeatable.",multiple:!0,name:"include-rule",type:String},{description:"Rule id or tag:<name> selector — drop matching findings. Repeatable.",multiple:!0,name:"exclude-rule",type:String},{description:"Gitignore-syntax pattern to exclude from the walk (repeatable)",multiple:!0,name:"exclude",type:String},{description:"Path to a gitignore-shaped file the walker should honor (repeatable)",multiple:!0,name:"exclude-from",type:String},{defaultValue:!1,description:"Mask secret values in output",name:"redact",type:Boolean},{defaultValue:!1,description:"Scan dotfiles",name:"include-hidden",type:Boolean},{defaultValue:!1,description:"Do not respect .gitignore",name:"no-gitignore",type:Boolean},{description:"Skip files larger than this (bytes). Default: 10 MiB",name:"max-size",type:Number},{description:"Rayon worker threads (0 / omit = auto)",name:"concurrency",type:Number},{defaultValue:!1,description:"Merge current findings into the baseline and exit 0",name:"update-baseline",type:Boolean},{defaultValue:!1,description:"With --update-baseline, replace rather than merge",name:"replace-baseline",type:Boolean},{defaultValue:!1,description:"Scaffold a baseline from current findings",name:"init",type:Boolean},{defaultValue:!1,description:"With --init, preview the baseline without writing files",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Print all bundled detection rules and exit",name:"list-rules",type:Boolean},{defaultValue:!1,description:"Print non-HTTP validator types referenced by the current ruleset, with install hints for their optional peer dependencies.",name:"list-validators",type:Boolean},{defaultValue:!1,description:"Suppress all progress output (only emit findings)",name:"quiet",type:Boolean},{defaultValue:!1,description:"Print diagnostic info (skipped rules, etc.)",name:"verbose",type:Boolean}]};var KV=Object.defineProperty,To=f((e,t)=>KV(e,"name",{value:t,configurable:!0}),"e$e");const YV={commandPath:["security"],description:"List build-script status — allowed, unapproved, and stale allowlist entries",examples:[["vis security list","Show the full build-script triage report"],["vis security list --json","Emit the report as JSON for tooling"]],group:"Security & Health",loader:To(()=>import("./list.js"),"loader"),name:"list",options:[{defaultValue:!1,description:"Emit the report as JSON instead of human-readable text",name:"json",type:Boolean}]},XV={commandPath:["security"],description:"Push vis.config security settings to the package manager's native config",examples:[["vis security sync","Sync allowBuilds + minimumReleaseAge to the PM-native config files"],["vis security sync --skip-allow-builds","Sync only the minimumReleaseAge knobs"],["vis security sync --skip-min-release-age","Sync only allowBuilds (trustedDependencies / onlyBuiltDependencies)"]],group:"Security & Health",loader:To(()=>import("./sync2.js"),"loader"),name:"sync",options:[{defaultValue:!1,description:"Skip syncing allowBuilds (trustedDependencies, onlyBuiltDependencies)",name:"skip-allow-builds",type:Boolean},{defaultValue:!1,description:"Skip syncing minimumReleaseAge and its excludes",name:"skip-min-release-age",type:Boolean}]},QV={commandPath:["security"],description:"Run lifecycle scripts for packages in security.policies.installScripts.allow (LavaMoat 'run' parity)",examples:[["vis security run","Run preinstall/install/postinstall for every approved package"],["vis security run --with-root","Also run the workspace root's prepublish + prepare hooks"],["vis security run --root-only","Run only the workspace root's prepublish + prepare hooks"]],group:"Security & Health",loader:To(()=>import("./run.js"),"loader"),name:"run",options:[{defaultValue:!1,description:"Also run the workspace root's prepublish + prepare hooks after dependencies",name:"with-root",type:Boolean},{defaultValue:!1,description:"Skip dependency scripts and only run the workspace root's prepublish + prepare hooks",name:"root-only",type:Boolean}]},ZV={commandPath:["security"],description:"Install @lavamoat/preinstall-always-fail as a devDep so a missing ignore-scripts setting fails loudly",examples:[["vis security tripwire","Install the tripwire devDependency"],["vis security tripwire --status","Report whether the tripwire is installed"],["vis security tripwire --remove","Remove the tripwire from package.json"]],group:"Security & Health",loader:To(()=>import("./tripwire.js"),"loader"),name:"tripwire",options:[{defaultValue:!1,description:"Report whether @lavamoat/preinstall-always-fail is installed",name:"status",type:Boolean},{defaultValue:!1,description:"Remove @lavamoat/preinstall-always-fail from package.json",name:"remove",type:Boolean}]},eW={commandPath:["security"],description:"Force-refresh the cached npm signing keys used by the signatures marshall",examples:[["vis security keys-refresh","Drop the disk cache and fetch a fresh key set from registry.npmjs.org"],["vis security keys-refresh --clear","Only drop the cache, do not refetch"],["vis security keys-refresh --json","Emit the refresh result as JSON for tooling"]],group:"Security & Health",loader:To(()=>import("./keys-refresh.js"),"loader"),name:"keys-refresh",options:[{defaultValue:!1,description:"Only clear the cache, do not refetch",name:"clear",type:Boolean},{defaultValue:!1,description:"Emit the result as JSON instead of human-readable text",name:"json",type:Boolean}]},tW=[YV,XV,QV,ZV,eW],rl={description:"Target id, e.g. @my/api:db",name:"targetId",type:String},rW={description:"Output format: table or json (default: table)",name:"format",type:String},nW={argument:rl,commandPath:["service"],description:"Start a service target detached so it survives across `vis run` invocations",examples:[["vis service start @my/api:db","Boot the db target as a long-lived service"],["vis service start @my/api:db --timeout=60000","Override readiness timeout"],["vis service start @my/api:db --no-readiness","Skip the readiness probe"]],group:"Workspace",loader:Pe(()=>import("./handler22.js"),"serviceStartExecute"),name:"start",options:[{description:"Readiness probe timeout in milliseconds",name:"timeout",type:Number},{defaultValue:!1,description:"Skip the readiness probe",name:"no-readiness",type:Boolean}]},iW={argument:{description:"Target id to stop, or omit when using --all",name:"targetId",required:!1,type:String},commandPath:["service"],description:"Stop a running service",examples:[["vis service stop @my/api:db","Stop the db service"],["vis service stop --all","Stop every running service in this workspace"]],group:"Workspace",loader:Pe(()=>import("./handler22.js"),"serviceStopExecute"),name:"stop",options:[{defaultValue:!1,description:"Stop every service registered for this workspace",name:"all",type:Boolean},{description:"Override the SIGTERM→SIGKILL grace period in milliseconds",name:"grace-ms",type:Number}]},sW={commandPath:["service"],description:"List services registered for this workspace",examples:[["vis service list","Print running services"],["vis service list --format=json","Machine-readable list"]],group:"Workspace",loader:Pe(()=>import("./handler22.js"),"serviceListExecute"),name:"list",options:[rW]},oW={argument:rl,commandPath:["service"],description:"Re-run the readiness probe and report a service's health",examples:[["vis service status @my/api:db","Check whether the db service is reachable"]],group:"Workspace",loader:Pe(()=>import("./handler22.js"),"serviceStatusExecute"),name:"status",options:[{description:"Probe timeout in milliseconds",name:"timeout",type:Number}]},aW={argument:rl,commandPath:["service"],description:"Stop and re-start a running service",examples:[["vis service restart @my/api:db","Recycle the db service"],["vis service restart @my/api:db --no-readiness","Recycle and skip the readiness probe"]],group:"Workspace",loader:Pe(()=>import("./handler22.js"),"serviceRestartExecute"),name:"restart",options:[{description:"Readiness probe timeout in milliseconds",name:"timeout",type:Number},{description:"Override the SIGTERM→SIGKILL grace period in milliseconds",name:"grace-ms",type:Number},{defaultValue:!1,description:"Skip the readiness probe after restart",name:"no-readiness",type:Boolean}]},cW={argument:rl,commandPath:["service"],description:"Print or tail a service's captured stdout/stderr",examples:[["vis service logs @my/api:db","Print the captured log"],["vis service logs @my/api:db -f","Tail the log (Ctrl-C to exit)"]],group:"Workspace",loader:Pe(()=>import("./handler22.js"),"serviceLogsExecute"),name:"logs",options:[{alias:"f",defaultValue:!1,description:"Follow the log file (like `tail -f`)",name:"follow",type:Boolean}]},lW=[nW,iW,sW,oW,aW,cW];var uW=Object.defineProperty,pW=f((e,t)=>uW(e,"name",{value:t,configurable:!0}),"e$d");const dW={description:"Sort package.json files across the workspace using the sort-package-json Rust crate",examples:[["vis sort-package-json","Sort all package.json files in the workspace"],["vis sort-package-json --check","Check if files are already sorted (exit 1 if not)"],["vis sort-package-json --sort-scripts","Also sort the scripts field alphabetically"],["vis sort-package-json --indent 4","Force 4-space indentation (overrides per-file detection)"],["vis sort-package-json --indent tab","Force tab indentation"],["vis sort-package-json --ignore '**/fixtures/**'","Skip files matching one or more glob patterns"],["vis sort-package-json --sort-order name,version,license","Pin a custom prefix order before the default field order"],["vis sort-package-json --unsorted dependencies,devDependencies","Preserve original key order for the listed top-level sections"],["vis sort-package-json --no-final-newline","Do not append a trailing newline"],["vis sort-package-json --line-ending crlf","Force CRLF line endings (default: auto-detect per file)"]],group:"Workspace",loader:pW(()=>import("./handler39.js"),"loader"),name:"sort-package-json",options:[{alias:"c",defaultValue:!1,description:"Check if package.json files are sorted without writing (exits 1 if unsorted)",name:"check",type:Boolean},{defaultValue:!1,description:"Also sort the scripts field alphabetically",name:"sort-scripts",type:Boolean},{description:"Indent override: a number of spaces, the literal `tab`, or a literal whitespace string. When unset, the original file's indent is preserved.",name:"indent",type:String},{description:"Glob pattern of files to skip (basename match, or path-relative when the pattern contains `/`). Repeatable.",multiple:!0,name:"ignore",type:String},{description:"Comma-separated list of top-level keys to place first, before the default field order. Repeatable.",multiple:!0,name:"sort-order",type:String},{description:"Comma-separated list of top-level sections whose key order should be preserved (e.g. dependencies,devDependencies). Repeatable.",multiple:!0,name:"unsorted",type:String},{defaultValue:!1,description:"Do not append a trailing newline to the output (default: append one).",name:"no-final-newline",type:Boolean},{defaultValue:"auto",description:"Line ending to write: auto (per-file detection, default), lf, or crlf.",name:"line-ending",type:String},{description:"Disable collapsing `bugs: { url }` to the bare string form (default: enabled).",name:"no-format-bugs",type:Boolean},{description:"Disable collapsing `repository: { type, url }` to the GitHub `owner/repo` shorthand (default: enabled).",name:"no-format-repository",type:Boolean},{description:"Disable canonical sorting of `exports` condition keys (default: enabled).",name:"no-sort-exports",type:Boolean},{description:"Disable .editorconfig discovery for indent / line-ending defaults (default: enabled).",name:"no-editorconfig",type:Boolean}]};var fW=Object.defineProperty,mW=f((e,t)=>fW(e,"name",{value:t,configurable:!0}),"e$c");const hW={description:"Run linters on staged files using config from vis.config.ts",examples:[["vis staged","Run staged linters"],["vis staged --verbose","Run with verbose output"],["vis staged --no-stash","Run without backup stash"],["vis staged --diff HEAD~1","Run against a specific diff"]],group:"Run & Execute",loader:mW(()=>import("./handler47.js"),"loader"),name:"staged",options:[{defaultValue:!1,description:"Allow empty commits when tasks revert all staged changes",name:"allow-empty",type:Boolean},{defaultValue:!1,description:"Automatically stage new files that tasks create during the run",name:"auto-stage",type:Boolean},{description:"Number of concurrent tasks or false for serial",name:"concurrent",type:String},{defaultValue:!1,description:"Run all tasks to completion even if one fails",name:"continue-on-error",type:Boolean},{description:"Working directory to run all tasks in",name:"cwd",type:String},{defaultValue:!1,description:"Enable debug output",name:"debug",type:Boolean},{description:"Override the default --staged flag of git diff",name:"diff",type:String},{description:"Override the default diff-filter",name:"diff-filter",type:String},{defaultValue:!1,description:"Fail with exit code 1 when tasks modify tracked files",name:"fail-on-changes",type:Boolean},{defaultValue:!1,description:"Kill in-flight tasks with SIGKILL on fast-fail instead of the default SIGTERM",name:"force-kill",type:Boolean},{defaultValue:!1,description:"Hide unstaged changes from partially staged files",name:"hide-partially-staged",type:Boolean},{defaultValue:!1,description:"Hide all unstaged changes before running tasks",name:"hide-unstaged",type:Boolean},{defaultValue:!1,description:"Suppress console output",name:"quiet",type:Boolean},{defaultValue:!1,description:"Pass filepaths relative to cwd to tasks",name:"relative",type:Boolean},{defaultValue:!1,description:"Revert to original state in case of errors",name:"revert",type:Boolean},{defaultValue:!0,description:"Enable backup stash",name:"stash",type:Boolean},{defaultValue:!1,description:"Show task output even when tasks succeed",name:"verbose",type:Boolean}]};var gW=Object.defineProperty,yW=f((e,t)=>gW(e,"name",{value:t,configurable:!0}),"t$a");const vW={description:"Show a workspace health dashboard at a glance",examples:[["vis status","Full status overview"],["vis status --json","Machine-readable output"]],group:"Workspace",loader:yW(()=>import("./handler24.js"),"loader"),name:"status",options:[{defaultValue:!1,description:"Emit JSON output",name:"json",type:Boolean}]};var bW=Object.defineProperty,$W=f((e,t)=>bW(e,"name",{value:t,configurable:!0}),"e$b");const wW={argument:{description:"What to sync: codeowners | package-json-fields",name:"kind",type:String},description:"Synchronise derived workspace artefacts (codeowners, package.json fields, tsconfig refs, …)",examples:[["vis sync codeowners","Generate CODEOWNERS at the repository root"],["vis sync codeowners --out=.github/CODEOWNERS","Write to .github/CODEOWNERS instead"],["vis sync codeowners --check","Fail if the existing file is stale"],["vis sync codeowners --from=project-json,nested-codeowners","Also aggregate nested CODEOWNERS files in the tree"],["vis sync codeowners --regeneration-command='pnpm codeowners'","Set a custom header instruction"],["vis sync codeowners --preserve-block","Splice the generated block between markers in an existing CODEOWNERS"],["vis sync package-json-fields","Mirror license/author/repository/bugs/homepage/engines from root to every workspace package"],["vis sync package-json-fields --check","Fail if any workspace package.json is out of sync"],["vis sync package-json-fields --fields license,engines","Override the default field list for this run"]],group:"Workspace",loader:$W(()=>import("./handler36.js"),"loader"),name:"sync",options:[{description:"Output path for the generated file (default: <workspace>/CODEOWNERS) — codeowners kind only",name:"out",type:String},{defaultValue:!1,description:"Verify state without writing (exit non-zero if drift is found)",name:"check",type:Boolean},{description:"Input sources for codeowners. Comma-separated or repeated. Values: project-json | nested-codeowners | package-json-maintainers. Defaults to project-json.",multiple:!0,name:"from",type:String},{description:"Glob (repeatable) used to discover nested CODEOWNERS files. Defaults to `**/CODEOWNERS`.",multiple:!0,name:"nested-includes",type:String},{description:"Header instruction shown to reviewers (replaces the default 'update project.json' note). Codeowners kind only.",name:"regeneration-command",type:String},{defaultValue:!1,description:"Splice the generated block between markers in the existing file instead of overwriting it. Codeowners kind only.",name:"preserve-block",type:Boolean},{description:"Comma-separated list of fields to mirror from root → workspace packages (package-json-fields kind only). Repeatable.",multiple:!0,name:"fields",type:String},{description:"Glob pattern of package names to skip (package-json-fields kind only). Repeatable.",multiple:!0,name:"ignore-package-name",type:String},{defaultValue:"human",description:"Output format for package-json-fields: human | json",name:"format",type:String},{defaultValue:!1,description:"Suppress per-package log lines; print only the summary (package-json-fields kind only)",name:"quiet",type:Boolean}]};var kW=Object.defineProperty,SW=f((e,t)=>kW(e,"name",{value:t,configurable:!0}),"t$8");const EW={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},description:"Explain why a task is included in the graph by walking its dependency chain to a root",examples:[["vis task-why @myorg/app:build","Show what pulls build in"],["vis task-why lib-a:test","Check the test task's triggers"]],group:"Workspace",loader:SW(()=>import("./handler25.js"),"loader"),name:"task-why"};var DW=Object.defineProperty,CW=f((e,t)=>DW(e,"name",{value:t,configurable:!0}),"e$a");const AW={argument:{description:"Subcommand: status | detect | install | use | which",name:"action",type:String},description:"Inspect and delegate to the workspace version managers (proto, mise, fnm, volta, asdf, nvm, corepack)",examples:[["vis toolchain status","Show every detected manager + expected vs actual tool versions"],["vis toolchain install","Install pinned versions — per-tool delegation"],["vis toolchain use node@22.13.0","Pin node 22.13.0 via the best runtime manager"],["vis toolchain use pnpm@10.32.1","Update the packageManager field; pnpm self-activates"],["vis toolchain which node","Resolve the node binary the manager would launch"],["vis toolchain detect","Print the primary manager's name"]],group:"Workspace",loader:CW(()=>import("./handler26.js"),"loader"),name:"toolchain",options:[{defaultValue:!1,description:"With `status`: exit 1 if any tool mismatches",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Print the command that would run, but don't execute",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Emit JSON (status subcommand only)",name:"json",type:Boolean},{defaultValue:!0,description:"With `use`: also mirror the version into engines.<tool> when that field already exists. --no-engines to skip.",name:"engines",type:Boolean}]};var OW=Object.defineProperty,jW=f((e,t)=>OW(e,"name",{value:t,configurable:!0}),"e$9");const xW={argument:{description:"Packages to unlink (omit for current package)",name:"packages",type:String},description:"Unlink a previously linked package",examples:[["vis unlink","Unlink current package"],["vis unlink react","Unlink specific package"],["vis unlink -r","Unlink in all workspace packages"]],group:"Dependencies",loader:jW(()=>import("./handler27.js"),"loader"),name:"unlink",options:[{alias:"r",defaultValue:!1,description:"Unlink in all workspace packages",name:"recursive",type:Boolean}]};var PW=Object.defineProperty,NW=f((e,t)=>PW(e,"name",{value:t,configurable:!0}),"e$8");const RW={alias:"up",argument:{description:"Packages to update (updates all if omitted)",name:"packages",type:String},description:"Update packages to their latest versions",examples:[["vis update react","Update react within semver range"],["vis up react -L","Update react to latest"],["vis update -i","Interactive mode"],["vis update --filter app","Update in specific workspace"],["vis update -r","Update in all workspaces"],["vis update --target minor","Only apply minor/patch updates (catalog mode)"],["vis update --dry-run","Preview changes without applying"],["vis update --exclude '@types/*'","Exclude packages by pattern"],["vis update --changelog","Show changelog links after updating"],["vis update --rollback","Restore catalog from last backup"],["vis update --ai","Run AI analysis before applying updates"]],group:"Dependencies",loader:NW(()=>import("./handler34.js"),"loader"),name:"update",options:[{alias:"L",conflicts:"target",description:"Update to latest version (ignore semver range; equivalent to --target latest)",name:"latest",type:Boolean},{alias:"t",conflicts:"latest",description:"Update target: latest, minor, or patch (default: latest, catalog mode)",name:"target",type:String},{alias:"d",defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"g",defaultValue:!1,description:"Update global packages",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Update recursively in all workspace packages",name:"recursive",type:Boolean},{description:"Filter packages in monorepo (pm-wrapper mode; catalog mode uses --include/--exclude)",name:"filter",type:String},{alias:"w",defaultValue:!1,description:"Include workspace root",name:"workspace-root",type:Boolean},{alias:"D",conflicts:"prod",description:"Update only devDependencies",name:"dev",type:Boolean},{alias:"P",conflicts:"dev",description:"Update only dependencies",name:"prod",type:Boolean},{alias:"i",defaultValue:!1,description:"Interactive mode",name:"interactive",type:Boolean},{defaultValue:!1,description:"Don't update optionalDependencies",name:"no-optional",type:Boolean},{defaultValue:!1,description:"Include peerDependencies in update checks",name:"peer",type:Boolean},{defaultValue:!1,description:"Also check workspace-owned package names against the registry (catalog mode)",name:"include-internal",type:Boolean},{alias:"l",defaultValue:!1,description:"Include packages with pinned/exact versions (no ^ or ~ prefix; catalog mode)",name:"include-locked",type:Boolean},{defaultValue:!1,description:"Update lockfile only",name:"no-save",type:Boolean},{description:"Glob pattern to include packages (repeatable, catalog mode)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable, catalog mode)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions (catalog mode)",name:"prerelease",type:Boolean},{defaultValue:!1,description:"Check for known security vulnerabilities (via OSV.dev)",name:"security",type:Boolean},{defaultValue:!1,description:"Skip catalog mode, use package manager directly",name:"no-catalog",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Show changelog URLs for updated packages",name:"changelog",type:Boolean},{description:"Run install after catalog update, --no-install to skip (default: true)",name:"install",type:Boolean},{defaultValue:!1,description:"Restore catalog file from the last backup",name:"rollback",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages before updating (catalog mode)",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Skip typosquat name check for package arguments",name:"no-typosquat-check",type:Boolean},{defaultValue:!1,description:"Skip the offline marshall pipeline (author, provenance, metadata, downloads, expired-domains, new-bin, signatures, archived-repo) when explicit package arguments are supplied",name:"no-marshall-check",type:Boolean},{description:"Cap concurrent registry requests during outdated checks (default: 8)",name:"max-concurrent-requests",type:Number},{description:"Release channel filter: stable (default), same (match current's prerelease channel), or any",name:"release-channel",type:String},{alias:"y",defaultValue:!1,description:"Skip the confirmation prompt for blanket --latest updates. Required in non-TTY contexts (CI) when running `vis update --latest` without explicit package arguments.",name:"yes",type:Boolean}]};var FW=Object.defineProperty,LW=f((e,t)=>FW(e,"name",{value:t,configurable:!0}),"e$7");const IW={argument:{description:"Target version (defaults to latest)",name:"version",type:String},description:"Update vis itself to the latest version",examples:[["vis self-update","Update to latest"],["vis self-update 2.0.0","Install specific version"],["vis self-update --check","Check for updates without installing"]],group:"System",loader:LW(()=>import("./handler28.js"),"loader"),name:"self-update",options:[{defaultValue:!1,description:"Check for updates without installing",name:"check",type:Boolean},{defaultValue:!1,description:"Reinstall even if already current",name:"force",type:Boolean},{defaultValue:!1,description:"Suppress output (CI mode)",name:"silent",type:Boolean}]};var TW=Object.defineProperty,BW=f((e,t)=>TW(e,"name",{value:t,configurable:!0}),"e$6");const _W={alias:"explain",argument:{description:"Package(s) to explain",name:"packages",type:String},description:"Show why a package is installed (dependency chain)",examples:[["vis why react","Show why react is installed"],["vis why react --json","Output as JSON"],["vis why react -r","Check across all workspaces"],["vis explain react","Alias matching npm's command"]],group:"Dependencies",loader:BW(()=>import("./handler29.js"),"loader"),name:"why",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean},{defaultValue:!1,description:"Show extended information (pnpm)",name:"long",type:Boolean},{defaultValue:!1,description:"Machine-readable output (pnpm)",name:"parseable",type:Boolean},{alias:"r",defaultValue:!1,description:"Check across all workspaces",name:"recursive",type:Boolean},{alias:"D",conflicts:"prod",description:"Filter to dev dependencies (pnpm)",name:"dev",type:Boolean},{alias:"P",conflicts:"dev",description:"Filter to production dependencies (pnpm)",name:"prod",type:Boolean},{defaultValue:!1,description:"Exclude optional dependencies (pnpm)",name:"no-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Check globally installed packages (pnpm)",name:"global",type:Boolean},{description:"Limit dependency tree depth",name:"depth",type:Number},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]},$v="\x1B]",wv="\x07",sa=";";var MW=Object.defineProperty,VW=f((e,t)=>MW(e,"name",{value:t,configurable:!0}),"n$9"),WW=Object.defineProperty,UW=VW((e,t)=>WW(e,"name",{value:t,configurable:!0}),"n"),GW=Object.defineProperty,qW=UW((e,t)=>GW(e,"name",{value:t,configurable:!0}),"n");const zW=qW((e,t)=>[$v,"8",sa,sa,t,wv,e,$v,"8",sa,sa,wv].join(""),"hyperlink");var HW=Object.defineProperty,nl=f((e,t)=>HW(e,"name",{value:t,configurable:!0}),"e$5");nl((e,t)=>!process.stderr.isTTY||process.env.TERM==="dumb"?e===t?t:`${e} (${jn(t)})`:zW(e,t),"link");const JW=nl(()=>{if(process.env.VIS_VERSION)return process.env.VIS_VERSION;try{const e=new URL("../../package.json",import.meta.url);return ke(e).version}catch{return"0.0.0"}},"getVersion"),KW=nl(()=>{process.env.VIS_VERSION=JW()},"injectVersion"),YW=nl(e=>{!process.stdout.isTTY||Ir||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},"setTerminalTitle");var XW=Object.defineProperty,QW=f((e,t)=>XW(e,"name",{value:t,configurable:!0}),"v$6");const ZW={beforeCommand:QW(async e=>{try{const t=e.options?.cwd,r=e.options?.config;let n;if(t)n=ht(process.cwd(),t);else{const a=process.env.VIS_MONOREPO_ROOT;n=a&&a.length>0?a:L1(process.cwd()).path}e.workspaceRoot=n;const i=r?ht(process.cwd(),r):void 0;let s=i??zn(n);try{e.visConfig=await gh(n,i?{explicitConfigPath:i}:void 0);const a=e.visConfig?.versionConstraint;if(a&&!Qt.validRange(a)){e.logger.error(""),e.logger.error(yu(ir("✖ Invalid versionConstraint"))),e.logger.error(` vis.config.ts has versionConstraint ${ir(JSON.stringify(a))}, which is not a valid semver range.`),e.logger.error(""),process.exitCode=1;return}if(a&&!Qt.satisfies(Ua.version,a)){e.logger.error(""),e.logger.error(yu(ir("✖ vis version too old"))),e.logger.error(` vis.config.ts requires vis ${ir(a)}, but the current version is ${ir(Ua.version)}.`),e.logger.error(` ${Us("→")} Upgrade: ${Kr("pnpm add -D @visulima/vis@latest")}`),e.logger.error(""),process.exitCode=1;return}}catch(a){const l=s,c=a instanceof Error?a.message:String(a);e.visConfigError={file:l??void 0,message:c};const u=!!process.stdout.isTTY&&!Ir;if(l&&!u){if(e.logger.error(""),e.logger.error(yu(ir(`✖ Failed to load ${l}`))),e.logger.error(` ${c}`),e.logger.error(""),c.includes("Cannot find module")){const d=/Cannot find module '([^']+)'/.exec(c)?.[1]??"unknown";e.logger.error(`${Us("→ Hint:")} The module ${ir(d)} could not be resolved.`),d.includes("@visulima/vis")?(e.logger.error(" This usually means the package isn't installed or the export path changed."),e.logger.error(` Try: ${Kr("pnpm add @visulima/vis")}`),e.logger.error(` Or regenerate: ${Kr("vis init --force")}`)):e.logger.error(` Try: ${Kr(`pnpm add ${d}`)}`)}else c.includes("SyntaxError")||c.includes("Unexpected token")?(e.logger.error(`${Us("→ Hint:")} The config file has a syntax error.`),e.logger.error(" Check your config for typos or invalid syntax."),e.logger.error(` Or regenerate: ${Kr("vis init --force")}`)):(e.logger.error(`${Us("→ Hint:")} Delete the broken config and recreate it:`),e.logger.error(` ${Kr(`rm ${l} && vis init`)}`));e.logger.error(""),e.logger.error(` Continuing with default settings.
|
|
1099
|
+
`)}e.visConfig={}}const o=process.argv[2]??"";if(!new Set(["--help","--version","-h","-V","create","help","implode","init"]).has(o)&&!s&&!Ir)if(process.stdin.isTTY){const a=kb({input:process.stdin,output:process.stderr}),l=await new Promise(c=>{a.question("\x1B[36;1m?\x1B[0m \x1B[1mNo vis.config.ts found. Create one with best-practice security defaults?\x1B[0m \x1B[90m(\x1B[92mY\x1B[90m/n)\x1B[0m ",c),a.on("SIGINT",()=>{a.close(),c("n")})});if(a.close(),!l.trim()||l.trim().toLowerCase()==="y"||l.trim().toLowerCase()==="yes"){const c=C(n,"vis.config.ts"),u=['import { defineConfig } from "@visulima/vis/config";',"","// Secure defaults are applied automatically by defineConfig().","// You only need to add allowBuilds for packages with build scripts.","// Run 'vis check --security-config' to see all active settings.","export default defineConfig({"," security: {"," allowBuilds: {",' // "esbuild": true,'," },"," },","});",""].join(`
|
|
1100
|
+
`);Ve(c,u),e.logger.info(`✓ Created ${c}
|
|
1101
|
+
`),e.visConfig=await gh(n),s=c}}else e.logger.warn("No vis.config.ts found. Run 'vis init' to create one with best-practice security defaults.")}catch(t){t instanceof Error&&!t.message.includes("monorepo root")&&e.logger.warn(`Failed to detect workspace: ${t.message}`),e.visConfig={}}},"beforeCommand"),name:"config-loader"};var eU=Object.defineProperty,Et=f((e,t)=>eU(e,"name",{value:t,configurable:!0}),"r$3");const tU=336*60*60*1e3,ld=C(dn(),"mcp-promote.json"),fn="@visulima/vis-mcp",rU=new Set(["--help","--version","-h","-V","ai","help","implode","mcp"]),nU=Et(()=>{try{if(x(ld))return ke(ld)}catch{}return{lastShown:0}},"readState"),iU=Et(e=>{try{Jt(dn()),ze(ld,JSON.stringify(e))}catch{}},"writeState"),is=Et(e=>{try{return x(e)?ke(e):void 0}catch{return}},"readJsonSafe"),ss=Et(e=>{if(typeof e!="object"||e===null)return!1;for(const t of Object.values(e)){if(typeof t!="object"||t===null)continue;const r=t,n=Array.isArray(r.args)?r.args.join(" "):"",i=`${typeof r.command=="string"?r.command:""} ${n}`;if(i.includes(fn)||i.includes("vis-mcp"))return!0}return!1},"mapHasVisMcp"),sU=Et(e=>{if(!Array.isArray(e))return!1;for(const t of e){if(typeof t!="object"||t===null)continue;const r=t,n=Array.isArray(r.args)?r.args.join(" "):"",i=`${typeof r.command=="string"?r.command:""} ${n} ${typeof r.name=="string"?r.name:""}`;if(i.includes(fn)||i.includes("vis-mcp"))return!0}return!1},"arrayHasVisMcp"),oU=Et(e=>{const t=C(e,".claude"),r=C(e,".claude.json"),n=x(t)||x(r);let i=!1;if(n){const s=is(r);i=ss(s?.mcpServers)}return{displayName:"Claude Code",id:"claude-code",installCommand:`claude mcp add vis -- npx -y ${fn}@latest`,isConfigured:i,isInstalled:n}},"detectClaudeCode"),aU=Et(e=>{const t=C(e,".cursor","mcp.json"),r=x(C(e,".cursor"));let n=!1;if(r){const i=is(t);n=ss(i?.mcpServers)}return{displayName:"Cursor",id:"cursor",installCommand:`Add to ~/.cursor/mcp.json: "vis": { "command": "npx", "args": ["-y", "${fn}@latest"] }`,isConfigured:n,isInstalled:r}},"detectCursor"),cU=Et(e=>{const t=C(e,".codeium","windsurf"),r=C(t,"mcp_config.json"),n=x(t);let i=!1;if(n){const s=is(r);i=ss(s?.mcpServers)}return{displayName:"Windsurf",id:"windsurf",installCommand:`Add to ~/.codeium/windsurf/mcp_config.json: "vis": { "command": "npx", "args": ["-y", "${fn}@latest"] }`,isConfigured:i,isInstalled:n}},"detectWindsurf"),lU=Et(e=>{const t=C(e,".continue"),r=C(t,"config.json"),n=x(t);let i=!1;if(n){const s=is(r);i=ss(s?.mcpServers)||sU(s?.mcpServers)}return{displayName:"Continue",id:"continue",installCommand:`Add to ~/.continue/config.json mcpServers: { "name": "vis", "command": "npx", "args": ["-y", "${fn}@latest"] }`,isConfigured:i,isInstalled:n}},"detectContinue"),uU=Et(e=>{const t=C(e,"Library","Application Support","Zed","settings.json"),r=C(e,".config","zed","settings.json"),n=Od()==="darwin"?t:r,i=x(n);let s=!1;if(i){const o=is(n);s=ss(o?.context_servers)}return{displayName:"Zed",id:"zed",installCommand:`Add to Zed settings.json under context_servers: "vis": { "command": "npx", "args": ["-y", "${fn}@latest"] }`,isConfigured:s,isInstalled:i}},"detectZed"),pU=Et(e=>{const t=[C(e,".config","Code","User","globalStorage","saoudrizwan.claude-dev","settings","cline_mcp_settings.json"),C(e,"Library","Application Support","Code","User","globalStorage","saoudrizwan.claude-dev","settings","cline_mcp_settings.json")];let r;for(const s of t)if(x(s)){r=s;break}const n=r!==void 0;let i=!1;if(r!==void 0){const s=is(r);i=ss(s?.mcpServers)}return{displayName:"Cline",id:"cline",installCommand:`In VS Code: open Cline > MCP Servers, add "vis" with command "npx" and args ["-y", "${fn}@latest"]`,isConfigured:i,isInstalled:n}},"detectCline"),dU=Et(()=>{const e=wb();return[oU(e),aU(e),cU(e),lU(e),uU(e),pU(e)]},"detectAiClis"),fU=Et(e=>{if(!e.success||process.env.VIS_CLI_TEST||Ir||process.env.VIS_NO_MCP_PROMOTE==="1"||e.visConfig?.mcpPromote?.enabled===!1||!process.stderr.isTTY||e.command!==void 0&&rU.has(e.command))return!1;const t=new Set(process.argv.slice(2));return!(t.has("--silent")||t.has("-s")||t.has("--json"))},"shouldRun"),mU=Et(e=>{if(!fU(e))return;const t=Date.now(),r=nU();if(t-r.lastShown<tU)return;const n=dU().find(i=>i.isInstalled&&!i.isConfigured);n!==void 0&&(process.stderr.write(`
|
|
1102
|
+
${Kr("✨")} ${ir(`vis ships an MCP server for ${n.displayName}.`)}
|
|
1103
|
+
${n.installCommand}
|
|
1104
|
+
${jn("Hide this with VIS_NO_MCP_PROMOTE=1 or mcpPromote: { enabled: false } in vis.config.ts")}
|
|
1105
|
+
`),iU({lastShown:t}))},"showMcpPromote");var hU=Object.defineProperty,Pm=f((e,t)=>hU(e,"name",{value:t,configurable:!0}),"t$6");const gU=336*60*60*1e3,yU="https://github.com/sponsors/prisis",ud=C(dn(),"sponsor.json"),vU=Pm(()=>{try{if(x(ud))return ke(ud)}catch{}return{lastShown:0}},"readState"),bU=Pm(e=>{try{Jt(dn()),ze(ud,JSON.stringify(e))}catch{}},"writeState"),$U=Pm(e=>{if(!e.success||process.env.VIS_CLI_TEST||Ir||process.env.VIS_NO_SPONSOR==="1"||e.visConfig?.sponsor?.enabled===!1||!process.stderr.isTTY)return;const t=Date.now(),r=vU();t-r.lastShown<gU||(process.stderr.write(`
|
|
1106
|
+
${CM("♥")} ${ir("Enjoying visulima?")} ${jn(`Consider sponsoring at ${yU}`)}
|
|
1107
|
+
${jn(" Hide this with VIS_NO_SPONSOR=1 or sponsor.enabled = false in vis.config.ts")}
|
|
1108
|
+
`),bU({lastShown:t}))},"showSponsorNotice");var wU=Object.defineProperty,ye=f((e,t)=>wU(e,"name",{value:t,configurable:!0}),"e$4");const kv=300*1e3,pd=C(dn(),"tips.json"),kU=ye(()=>{try{if(x(pd))return ke(pd)}catch{}return{lastGlobal:0,perTip:{}}},"readState"),SU=ye(e=>{try{Jt(dn()),ze(pd,JSON.stringify(e))}catch{}},"writeState"),EU=[{cooldownMs:1800*1e3,id:"short-aliases",matches:ye(e=>["install","link","remove","uninstall","update"].includes(e.command),"matches"),message:ye(e=>{const t={install:"i",link:"ln",remove:"rm",uninstall:"rm",update:"up"}[e.command];return t?`You can use 'vis ${t}' as a shorthand for 'vis ${e.command}'`:""},"message"),probability:.5},{id:"use-exec",matches:ye(e=>e.command==="dlx"&&e.success,"matches"),message:ye(()=>"Use 'vis exec' to run locally installed binaries without downloading.","message")},{id:"security-check",matches:ye(e=>(e.command==="check"||e.command==="update")&&e.success&&!e.args.includes("--security"),"matches"),message:ye(()=>"Add --security to check for known vulnerabilities via OSV.dev","message"),probability:.3},{cooldownMs:3600*1e3,id:"ai-analysis",matches:ye(e=>(e.command==="check"||e.command==="update")&&e.success&&!e.args.includes("--ai"),"matches"),message:ye(()=>"Add --ai to run AI analysis on outdated packages before updating.","message"),probability:.2},{cooldownMs:1440*60*1e3,id:"socket-security",matches:ye(e=>(e.command==="install"||e.command==="update"||e.command==="check")&&e.success,"matches"),message:ye(()=>"Enable Socket.dev in vis.config.ts for security scores and supply chain alerts: security.socket.enabled = true","message"),probability:.15},{id:"dedupe-after-install",matches:ye(e=>e.command==="install"&&e.success,"matches"),message:ye(()=>"Run 'vis dedupe' periodically to remove duplicate dependencies.","message"),probability:.15},{cooldownMs:720*60*1e3,id:"doctor-checkup",matches:ye(e=>(e.command==="install"||e.command==="add"||e.command==="update")&&e.success,"matches"),message:ye(()=>"Run 'vis doctor' for a full project health check — outdated, security, duplicates, and optimizations in one view.","message"),probability:.25},{cooldownMs:10080*60*1e3,id:"init-config",matches:ye(e=>(e.command==="install"||e.command==="run")&&e.success&&!e.hasVisConfig,"matches"),message:ye(()=>"Run 'vis init' to create a vis.config.ts with secure defaults — supply chain protection enabled automatically.","message"),probability:.4},{id:"why-command",matches:ye(e=>e.command==="outdated"&&e.success,"matches"),message:ye(()=>"Use 'vis why <package>' to understand why a dependency is installed.","message"),probability:.3},{id:"graph-command",matches:ye(e=>e.command==="run"&&e.success,"matches"),message:ye(()=>"Use 'vis graph' to visualize your project dependency graph.","message"),probability:.1},{id:"affected-command",matches:ye(e=>e.command==="run"&&e.success&&!e.args.includes("--projects"),"matches"),message:ye(()=>"Use 'vis affected <target>' to run tasks only on changed projects.","message"),probability:.2},{id:"pm-cache",matches:ye(e=>e.command==="install"&&e.success,"matches"),message:ye(()=>"Use 'vis pm cache dir' to find your package manager's cache location.","message"),probability:.1},{id:"create-editor",matches:ye(e=>e.command==="create"&&e.success,"matches"),message:ye(()=>"Add --editor vscode to generate VS Code configuration during project creation.","message"),probability:.5},{id:"env-pin",matches:ye(e=>e.command==="env"&&e.args.includes("install")&&e.success,"matches"),message:ye(()=>"Use 'vis env pin <version>' to pin the Node.js version for your project.","message"),probability:.5},{id:"upgrade-check",matches:ye(e=>e.command!=="self-update"&&e.success,"matches"),message:ye(()=>"Run 'vis self-update --check' to see if a newer version of vis is available.","message"),probability:.05}],DU=ye(e=>{if(process.env.VIS_CLI_TEST||Ir)return;const t=Date.now(),r=kU();if(t-r.lastGlobal<kv)return;const n=EU.filter(o=>{if(!o.matches(e))return!1;const a=r.perTip[o.id]??0,l=o.cooldownMs??kv;return t-a>=l});if(n.length===0)return;const i=n.find(o=>{const a=o.probability??1;return Math.random()<a});if(!i)return;const s=i.message(e);s&&(process.stderr.write(`
|
|
1109
|
+
\x1B[2mtip: ${s}\x1B[0m
|
|
1110
|
+
`),r.lastGlobal=t,r.perTip[i.id]=t,SU(r))},"showTip");var CU=Object.defineProperty,Sv=f((e,t)=>CU(e,"name",{value:t,configurable:!0}),"n$6");const AU=Sv(e=>({afterCommand:Sv(async t=>{const r=process.argv.slice(2),n=r[0]??"",i=process.exitCode===void 0||process.exitCode===0;e&&e(),DU({args:r,command:n,hasVisConfig:t.visConfig!==void 0&&Object.keys(t.visConfig).length>0,success:i}),$U({success:i,visConfig:t.visConfig}),mU({command:n,success:i,visConfig:t.visConfig})},"afterCommand"),name:"post-command"}),"postCommandPlugin");var OU=Object.defineProperty,Vr=f((e,t)=>OU(e,"name",{value:t,configurable:!0}),"v$4"),jU=Object.defineProperty,nt=Vr((e,t)=>jU(e,"name",{value:t,configurable:!0}),"p");const xU=Ze(import.meta.url),$i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nm=nt(e=>{if(typeof $i<"u"&&$i.versions&&$i.versions.node){const[t,r]=$i.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return $i.getBuiltinModule(e)}return xU(e)},"__cjs_getBuiltinModule"),Pn=$i,{execFileSync:PU}=Nm("node:child_process"),Gs=Nm("node:fs"),NU=Nm("node:tty");var RU=Object.defineProperty,mn=nt((e,t)=>RU(e,"name",{value:t,configurable:!0}),"n$2");const Rm=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Fm=[12288,12288,65281,65376,65504,65510],Lm=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Im=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],il=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Bo=mn((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=i*2;if(t<e[s])n=i-1;else if(t>e[s+1])r=i+1;else return!0}return!1},"isInRange"),FU=Rm[0],LU=Rm.at(-1),IU=Fm[0],TU=Fm.at(-1),BU=Lm[0],_U=Lm.at(-1),MU=Im[0],VU=Im.at(-1),WU=il[0],UU=il.at(-1),Ev=19968,[GU,qU]=sl(il);function sl(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],s=e[n+1];if(Ev>=i&&Ev<=s)return[i,s];s-i>r-t&&(t=i,r=s)}return[t,r]}f(sl,"it$1");Vr(sl,"le");nt(sl,"k$3");mn(sl,"findWideFastPathRange");const sS=mn(e=>e<FU||e>LU?!1:Bo(Rm,e),"isAmbiguous"),oS=mn(e=>e<IU||e>TU?!1:Bo(Fm,e),"isFullWidth"),zU=mn(e=>e<BU||e>_U?!1:Bo(Lm,e),"isHalfWidth"),HU=mn(e=>e<MU||e>VU?!1:Bo(Im,e),"isNarrow"),aS=mn(e=>e>=GU&&e<=qU?!0:e<WU||e>UU?!1:Bo(il,e),"isWide");function ol(e){return sS(e)?"ambiguous":oS(e)?"fullwidth":zU(e)?"halfwidth":HU(e)?"narrow":aS(e)?"wide":"neutral"}f(ol,"et$1");Vr(ol,"fe");nt(ol,"I$2");mn(ol,"getCategory");var JU=Object.defineProperty,Tm=nt((e,t)=>JU(e,"name",{value:t,configurable:!0}),"e$1");function _o(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}f(_o,"P$3");Vr(_o,"X");nt(_o,"r$2");Tm(_o,"validate");function Mo(e){return _o(e),ol(e)}f(Mo,"H$3");Vr(Mo,"ee");nt(Mo,"p$4");Tm(Mo,"eastAsianWidthType");function Bm(e,{ambiguousAsWide:t=!1}={}){return _o(e),oS(e)||aS(e)||t&&sS(e)?2:1}f(Bm,"gt$1");Vr(Bm,"Ye");nt(Bm,"g$2");Tm(Bm,"eastAsianWidth");var KU=Object.defineProperty,cS=nt((e,t)=>KU(e,"name",{value:t,configurable:!0}),"n$1");const lS=String.raw,Dv=lS`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,YU=cS(()=>new RegExp(lS`\p{RI}{2}|(?)${Dv}(?:\u200D${Dv})*`,"gu"),"emojiRegex"),os=new Set(["\x1B",""]),al="\x07",uS="[",_m="m",Ja="]8;;",XU=39,QU=/[\u200B\uFEFF\u2060-\u2064]/g,ZU=new RegExp(`(?:\\${uS}(?<code>\\d+)m|\\${Ja}(?<uri>.*)${al})`),eG=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Ps=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,oa=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ka=YU();cS(e=>e.replace(ka,""),"stripEmoji");var tG=Object.defineProperty,cl=nt((e,t)=>tG(e,"name",{value:t,configurable:!0}),"b$1");const Cv=new Map,aa=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Sa=cl(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),rG=cl((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Cv.get(r);if(i||(i=new Map,Cv.set(r,i)),i.has(n))return i.get(n);let s;if(Sa(e)==="latin")s=t.width.regular;else if(Sa(e)==="control")s=t.width.control;else if(Sa(e)==="wide")s=t.width.wide;else switch(Mo(e)){case"ambiguous":{s=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{s=t.width.fullWidth;break}case"wide":{s=t.width.wide;break}default:s=t.width.regular}return i.set(n,s),s},"getCachedCharWidth"),nG=cl(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),dd=cl((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?dd(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,s=i>1e4;let o=0,a=0,l=i,c=!1;const u=e.includes("\x1B")||e.includes("");for(;o<i;){if(u&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const S="\x1B]8;;\x07",k=S.length,v=e.indexOf("\x07",o+5);if(v!==-1){const h=e.indexOf(S,v+1);if(h!==-1){const b=h+k,w=e.slice(v+1,h).replace(Ps,""),y=dd(w,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),D=y.width;if(y.truncated)c=!0,l=Math.min(l,o);else if(a+D>n&&(l=Math.min(l,o),c=!0,a+D>r.truncation.limit))break;if(a+=D,o=b,c&&a>=r.truncation.limit)break;continue}}}if(Ps.lastIndex=o,Ps.test(e)){const S=Ps.lastIndex-o,k=r.truncation.countAnsiEscapeCodes?S:r.width.ansi;if(a+k>n&&(l=Math.min(l,o),a+k>r.truncation.limit)){c=!0;break}a+=k,o=Ps.lastIndex;continue}}const m=e.codePointAt(o);if(m===8203||m===65279||m>=8288&&m<=8292){o+=1;continue}if(m===9){if(a+r.width.tab>n&&(l=Math.min(l,o),a+r.width.tab>r.truncation.limit)){c=!0;break}a+=r.width.tab,o+=1;continue}if(aa.lastIndex=o,aa.test(e)){const S=(aa.lastIndex-o)*r.width.regular;if(a+S>n){const k=Math.floor((n-a)/r.width.regular);if(l=Math.min(l,o+k),a+S>r.truncation.limit){c=!0;break}}a+=S,o=aa.lastIndex;continue}if((m<=31||m>=127&&m<=159)&&(oa.lastIndex=o,oa.test(e))){const S=(oa.lastIndex-o)*r.width.control;if(a+S>n&&(l=Math.min(l,o+Math.floor((n-a)/r.width.control)),a+S>r.truncation.limit)){c=!0;break}a+=S,o=oa.lastIndex;continue}if(ka.lastIndex=o,ka.test(e)){if(a+r.width.emoji>n&&(l=Math.min(l,o),a+r.width.emoji>r.truncation.limit)){c=!0;break}a+=r.width.emoji,o=ka.lastIndex;continue}const g=e.codePointAt(o)??0;if(nG(g)){o+=g>65535?2:1;continue}let $;if(s)$=rG(g,r);else switch(Sa(g)){case"control":{$=r.width.control;break}case"latin":{$=r.width.regular;break}case"wide":{$=r.width.wide;break}case"zero":{$=0;break}default:switch(Mo(g)){case"ambiguous":{$=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{$=r.width.fullWidth;break}case"wide":{$=r.width.wide;break}default:$=r.width.regular}}if(a+$>n&&(l=Math.min(l,o),a+$>r.truncation.limit)){c=!0;break}a+=$,o+=g>65535?2:1}let d=a,p=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(d=r.truncation.limit,p=!0),{ellipsed:p,index:c?l:i,truncated:c,width:d}},"getStringTruncatedWidth");var iG=Object.defineProperty,sG=nt((e,t)=>iG(e,"name",{value:t,configurable:!0}),"e");const rn=sG((e,t={})=>dd(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var oG=Object.defineProperty,kt=nt((e,t)=>oG(e,"name",{value:t,configurable:!0}),"p$1");const aG=/\x1B\[(\d+)m/;let pS=class{static{f(this,"Et")}static{Vr(this,"we")}static{nt(this,"C")}static{kt(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=aG.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];i&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(n=>{const i=r[n];i&&t.push(i)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}};const dS=kt((e,t)=>{if(!os.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+Ja.length).join("")===Ja;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),cG=kt((e,t={})=>{const r=new pS;let n="",i=!1,s="",o="",a=!1;const l=[...e];for(let c=0;c<l.length;c++){const u=l[c];if(u&&os.has(u)){if(n){const $=t.getWidth?.(n)??0,S={isEscapeSequence:!1,isGrapheme:!0,text:n,width:$};if(a&&(S.isHyperlink=!0,S.hyperlinkUrl=o),t.onSegment?.(S,r)===!1)return;n=""}i=!0,s=u;const m=dS(l,c),{isInsideLinkEscape:g}=m;if(g){let $=c+1;for(o="";$<l.length;){const k=l[$];if(k===al)break;o+=k,$+=1}o=o.slice(4);const S={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(S,r)===!1)return;c=$,a=!0,i=!1,s="";continue}if(c+1<l.length&&l[c+1]==="\\"&&a){const $={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.($,r)===!1)return;a=!1,o="",c+=1,i=!1,s="";continue}}if(i){if(s!==u&&(s+=u),u===_m){i=!1,r.processEscape(s);const m={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(m,r)===!1)return;s=""}continue}n+=u;const d=t.getWidth?.(n)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:n,width:d};if(a&&(p.isHyperlink=!0,p.hyperlinkUrl=o),t.onSegment?.(p,r)===!1)return;n=""}if(n){const c=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:c};a&&(u.isHyperlink=!0,u.hyperlinkUrl=o),t.onSegment?.(u,r)}if(s){const c={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(c,r)}},"processAnsiString"),Av=kt(e=>`${os.values().next().value}${uS}${String(e)}${_m}`,"wrapAnsiCode"),Ov=kt(e=>`${os.values().next().value}${Ja}${e}${al}`,"wrapAnsiHyperlink"),lG=kt(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
|
|
1111
|
+
`),s=[...i];let o=0;for(const[a,l]of s.entries()){if(t+=l,os.has(l)){const u=ZU.exec(i.slice(o))?.groups??{};if(u.code!==void 0){const d=Number.parseFloat(u.code);r=d===XU?void 0:d}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=eG.get(Number(r));s[a+1]===`
|
|
1112
|
+
`?(n&&(t+=Ov("")),r&&c&&(t+=Av(c))):l===`
|
|
1113
|
+
`&&(r&&c&&(t+=Av(r)),n&&(t+=Ov(n))),o+=l.length}return t},"preserveAnsi"),fS=/(?=\s)|(?<=\s)/,mS=/^\s+$/,fp=kt(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),Nn=kt(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&rn(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),hS=kt((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new pS;let s="",o=0,a=!1,l=!1,c="",u=0;for(;u<e.length;){const d=e[u];if(os.has(d)){a=!0,c=d,s+=d,l=dS([...e],u).isInsideLinkEscape,u+=1;continue}if(a){c+=d,s+=d,l?d===al&&(a=l=!1):d===_m&&(a=!1,i.processEscape(c)),u+=1;continue}const p=rn(d),m=d===" ";if(p===0){s+=d,u+=1;continue}if(o+p>t&&(s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=rn(s),m&&r)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(s+=d,o+=p,o===t&&u<e.length-1&&(n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=rn(s),u+1<e.length&&e[u+1]===" "&&r)){for(u+=1;u<e.length&&e[u]===" ";)u+=1;continue}u+=1}return s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),r?n.map(d=>Nn(d)):n},"wrapWithBreakAtWidth"),uG=kt((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let s="",o=0;return cG(n,{getWidth:rn,onSegment:kt((a,l)=>{const c=a.text??"";if(a.isEscapeSequence)s+=c;else{const u=c===" ";if(a.width===0)return s+=c,!0;if(o+a.width>t&&(s&&i.push(s),s=l.getStartEscapesForAllActiveAttributes(),o=0,u))return r||i.push(l.getStartEscapesForAllActiveAttributes()+c),!0;s+=c,o+=a.width}return!0},"onSegment")}),s&&i.push(s),r?i.map(a=>Nn(a)):i},"wrapCharByChar"),pG=kt((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(fS),s=[];let o="",a=0,l=0;for(;l<i.length;){const c=i[l],u=mS.test(c),d=rn(c);if(c.length===0){l+=1;continue}if(r&&u&&a===0){l+=1;continue}if(a+d>t&&a>0){r?s.push(Nn(o)):s.push(o),o="",a=0;continue}o+=c,a+=d,l+=1}return o&&(r?s.push(Nn(o)):s.push(o)),s},"wrapWithWordBoundaries"),dG=kt((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(fS),s=[];let o="",a=0,l=0;for(;l<i.length;){const c=i[l],u=mS.test(c),d=rn(c);if(c.length===0){l+=1;continue}if(r&&u&&a===0){l+=1;continue}if(d>t){o&&s.push(fp(r?Nn(o):o));const p=hS(c,t,r);if(p.length>0){for(let m=0;m<p.length-1;m+=1)s.push(p[m]);o=p.at(-1),a=rn(o)}else o="",a=0;l+=1;continue}if(a+d>t&&a>0&&(s.push(fp(r?Nn(o):o)),o="",a=0,r&&u)){l+=1;continue}o+=c,a+=d,l+=1}return o&&s.push(fp(r?Nn(o):o)),s},"wrapAndBreakWords"),qs={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},fG=kt((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:s=qs.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
|
|
1114
|
+
`,`
|
|
1115
|
+
`);return r&&(o=o.replaceAll(QU,"")),o.split(`
|
|
1116
|
+
`).map(a=>{if(n&&a.trim()==="")return"";let l;switch(s){case qs.BREAK_AT_CHARACTERS:{l=uG(a,i,n);break}case qs.BREAK_WORDS:{l=dG(a,i,n);break}case qs.STRICT_WIDTH:{l=hS(a,i,n);break}default:l=pG(a,i,n)}return lG(l)}).join(`
|
|
1117
|
+
`)},"wordWrap");var mG=Object.defineProperty,hn=nt((e,t)=>mG(e,"name",{value:t,configurable:!0}),"n");const gS=80,yS=24,fd=hn((e,t,{shell:r,env:n}={})=>PU(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Ea=hn((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),vS=hn((e,t)=>{const{columns:r,rows:n}=Ea(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===gS&&n===yS))return{columns:r,rows:n}},"createIfNotDefault"),hG=hn(()=>{if(Pn.platform!=="linux")return!0;try{const e=Gs.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}},"isForegroundProcess");function ll(){const{env:e,stdout:t,stderr:r}=Pn;if(t?.columns&&t?.rows)return Ea(t.columns,t.rows);if(r?.columns&&r?.rows)return Ea(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Ea(e.COLUMNS,e.LINES);const n={columns:gS,rows:yS};return Pn.platform==="win32"?mp()??n:Pn.platform==="darwin"?jv()??mp()??n:jv()??mp()??gG()??n}f(ll,"st$1");Vr(ll,"Se");nt(ll,"O");hn(ll,"terminalSize");const jv=hn(()=>{try{const e=Pn.platform==="darwin"?Gs.constants.O_EVTONLY|Gs.constants.O_NONBLOCK:Gs.constants.O_NONBLOCK,{columns:t,rows:r}=NU.WriteStream(Gs.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),mp=hn(()=>{try{const e=fd("tput",["cols"],{env:{TERM:"dumb",...Pn.env}}),t=fd("tput",["lines"],{env:{TERM:"dumb",...Pn.env}});if(e&&t)return vS(e,t)}catch{}},"tput"),gG=hn(()=>{try{if(!hG())return;const e=fd("resize",["-u"]).match(/\d+/g);if(e.length===2)return vS(e[0],e[1])}catch{}},"resize");var yG=Object.defineProperty,vG=nt((e,t)=>yG(e,"name",{value:t,configurable:!0}),"c");let bG=class{static{f(this,"Ai")}static{Vr(this,"xt")}static{nt(this,"k")}static{vG(this,"InteractiveManager")}#e;#r=!1;#t=!1;#s=0;#c=0;constructor(t,r){this.#e={stderr:r,stdout:t}}get lastLength(){return this.#s}get outside(){return this.#c}get isHooked(){return this.#r}get isSuspended(){return this.#t}erase(t,r=this.#s){this.#e[t].erase(r)}hook(){if(this.#r)return!1;const t=Object.values(this.#e);for(const r of t)r.active();return this.#m(!0),!0}resume(t,r){if(this.#t){this.#t=!1,r&&this.erase(t,r),this.#s=0;const n=Object.values(this.#e);for(const i of n)i.active()}}suspend(t,r=!0){if(!this.#t){this.#t=!0,r&&this.erase(t);const n=Object.values(this.#e);for(const i of n)i.renew()}}unhook(t=!0){if(!this.#r)return!1;const r=Object.values(this.#e);for(const n of r)n.inactive(t);return this.#m(),!0}update(t,r,n=0){if(r.length>0){const i=this.#e[t],{columns:s,rows:o}=ll(),a=n>o?o-1:Math.max(0,Math.min(o-1,n)),l=this.lastLength-a,c=Math.max(l-o,this.outside);let u=r.reduce((d,p)=>[...d,fG(p,{trim:!1,width:s,wrapMode:qs.STRICT_WIDTH})],[]);o<=l?(i.erase(o),a<c&&(u=u.slice(c-a+1))):l&&i.erase(l),i.write(`${u.join(`
|
|
1118
|
+
`)}
|
|
1119
|
+
`),this.#s=c?c+u.length+1:u.length,this.#c=Math.max(this.lastLength-o,this.outside)}}#m(t=!1){this.#r=t,this.#s=0,this.#c=0}};var $G=Object.defineProperty,bS=f((e,t)=>$G(e,"name",{value:t,configurable:!0}),"c$2"),wG=Object.defineProperty,Vo=bS((e,t)=>wG(e,"name",{value:t,configurable:!0}),"o");const kG=Ze(import.meta.url),Ns=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,SG=Vo(e=>{if(typeof Ns<"u"&&Ns.versions&&Ns.versions.node){const[t,r]=Ns.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ns.getBuiltinModule(e)}return kG(e)},"__cjs_getBuiltinModule"),{StringDecoder:EG}=SG("node:string_decoder"),Re="\x1B[",$S=";";var DG=Object.defineProperty,CG=Vo((e,t)=>DG(e,"name",{value:t,configurable:!0}),"t"),AG=Object.defineProperty,OG=CG((e,t)=>AG(e,"name",{value:t,configurable:!0}),"t"),jG=Object.defineProperty,pt=OG((e,t)=>jG(e,"name",{value:t,configurable:!0}),"n");const xG=pt((e=1)=>`${Re}${String(e)}D`,"cursorBackward");pt((e=1)=>`${Re}${String(e)}B`,"cursorDown");pt((e=1)=>`${Re}${String(e)}C`,"cursorForward");const PG=`${Re}?25l`,NG=`${Re}G`;pt((e=1)=>xG(e),"cursorLeft");const RG=pt((e=1)=>`${Re}${String(e)}G`,"cursorHorizontalAbsolute");pt((e,t)=>{let r="";return e<0?r+=`${Re}${String(-e)}D`:e>0&&(r+=`${Re}${String(e)}C`),t<0?r+=`${Re}${String(-t)}A`:t>0&&(r+=`${Re}${String(t)}B`),r},"cursorMove");pt((e=1)=>`${Re}${String(e)}E`,"cursorNextLine");pt((e=1)=>`${Re}${String(e)}F`,"cursorPreviousLine");const FG=`${Re}?25h`;pt((e,t)=>t===void 0?RG(e+1):`${Re}${String(t+1)}${$S}${String(e+1)}H`,"cursorTo");pt((e,t)=>t===void 0?`${Re}${String(e)}H`:`${Re}${String(e)}${$S}${String(t)}H`,"cursorPosition");pt((e=1)=>`${Re}${String(e)}I`,"cursorHorizontalForwardTab");pt((e=1)=>`${Re}${String(e)}Z`,"cursorBackwardTab");pt((e=1)=>`${Re}${String(e)}X`,"eraseCharacter");pt((e=1)=>`${Re}${String(e)}d`,"cursorVerticalAbsolute");const LG=pt((e=1)=>`${Re}${String(e)}A`,"cursorUp");var IG=(e=>(e[e.Default=0]="Default",e[e.BlinkingBlock=1]="BlinkingBlock",e[e.SteadyBlock=2]="SteadyBlock",e[e.BlinkingUnderline=3]="BlinkingUnderline",e[e.SteadyUnderline=4]="SteadyUnderline",e[e.BlinkingBar=5]="BlinkingBar",e[e.SteadyBar=6]="SteadyBar",e))(IG||{});pt(e=>`${Re}${String(e)} q`,"setCursorStyle");var TG=Object.defineProperty,BG=Vo((e,t)=>TG(e,"name",{value:t,configurable:!0}),"o$1"),_G=Object.defineProperty,MG=BG((e,t)=>_G(e,"name",{value:t,configurable:!0}),"s"),VG=Object.defineProperty,Mm=MG((e,t)=>VG(e,"name",{value:t,configurable:!0}),"o"),WG=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e))(WG||{});const ul=Mm(e=>{const t=e>=0&&e<=3?e:0;return`${Re}${t===0?"":String(t)}J`},"eraseDisplay");var UG=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireLine=2]="EntireLine",e))(UG||{});const Vm=Mm(e=>{const t=e>=0&&e<=2?e:0;return`${Re}${t===0?"":String(t)}K`},"eraseInLine");ul(0);const GG=Vm(2);Vm(0);Vm(1);const qG=Mm(e=>{if(e<=0)return"";let t="";for(let r=0;r<e;r+=1)t+=GG,r<e-1&&(t+=LG());return t+=NG,t},"eraseLines");ul(2);ul(1);ul(3);var zG=Object.defineProperty,HG=Vo((e,t)=>zG(e,"name",{value:t,configurable:!0}),"o");let xv=class wS{static{f(this,"g")}static{bS(this,"$")}static{Vo(this,"e")}static{HG(this,"InteractiveStreamHook")}static DRAIN=!0;#e=new EG;#r=[];#t;#s;constructor(t){this.#t=t.write.bind(t),this.#s=t}active(){this.write(PG),this.#s.write=(t,...r)=>{const n=r.at(-1);return this.#r.push(this.#e.write(typeof t=="string"?Buffer.from(t,typeof r[0]=="string"?r[0]:void 0):Buffer.from(t))),typeof n=="function"&&n(),wS.DRAIN}}erase(t){t>0&&this.write(qG(t+1))}inactive(t=!1){this.#r.length>0&&(t&&this.write(`
|
|
1120
|
+
`),this.#r.forEach(r=>{this.write(r)}),this.#r=[]),this.renew()}renew(){this.#s.write=this.#t,this.write(FG)}write(t){this.#t.apply(this.#s,[t])}};var JG=Object.defineProperty,kr=f((e,t)=>JG(e,"name",{value:t,configurable:!0}),"S"),KG=Object.defineProperty,De=kr((e,t)=>KG(e,"name",{value:t,configurable:!0}),"b");const YG=Ze(import.meta.url),wi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pl=De(e=>{if(typeof wi<"u"&&wi.versions&&wi.versions.node){const[t,r]=wi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return wi.getBuiltinModule(e)}return YG(e)},"__cjs_getBuiltinModule"),{createRequire:XG}=pl("node:module"),Rn=wi,{execFileSync:QG}=pl("node:child_process"),zs=pl("node:fs"),ZG=pl("node:tty"),eq={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},kS={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},warning:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},Wm=Symbol("EMPTY");var tq=Object.defineProperty,rq=De((e,t)=>tq(e,"name",{value:t,configurable:!0}),"g$6");const Ka=rq(e=>{const t=Object.keys(e).map(r=>e[r].label??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestLabel");var nq=Object.defineProperty,SS=De((e,t)=>nq(e,"name",{value:t,configurable:!0}),"T$5"),iq=Object.defineProperty,Ne=SS((e,t)=>iq(e,"name",{value:t,configurable:!0}),"l"),sq=Object.defineProperty,oq=Ne((e,t)=>sq(e,"name",{value:t,configurable:!0}),"L");const Zt=oq((e,t,r,n,i,s=", ")=>{const o=e.length;if(o===0)return"";let a=n;i!==void 0&&(a=i);const l=r.truncate;let c="",u="",d="";for(let p=0;p<o;p+=1){const m=p+1===e.length,g=p+2===e.length;d=`…(${String(e.length-p)})`;let $=e[p];r.truncate=l-c.length-(m?0:s.length);const S=u||a($,t,r,n)+(m?"":s),k=c.length+S.length,v=k+d.length;if(m&&k>l&&c.length+d.length<=l||!m&&!g&&v>l)break;$=e[p+1];const h=g?"":s;if(m?u="":u=a($,t,r,n)+h,!m&&g&&v>l&&k+u.length>l)break;if(c+=S,!m&&!g&&k+u.length>=l){d=`…(${String(e.length-p-1)})`;break}d=""}return`${c}${d}`},"inspectList");var aq=Object.defineProperty,dl=Ne((e,t)=>aq(e,"name",{value:t,configurable:!0}),"s$6");const cq=dl(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),lq=dl((e,t,r)=>{switch(e.nodeType){case 1:return ES(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},"inspectNode"),md=dl((e,t,r,n)=>Zt(e,e,t,r,lq,`
|
|
1121
|
+
`),"inspectNodeCollection"),ES=dl((e,t,r,n)=>{const i=e.getAttributeNames(),s=e.tagName.toLowerCase(),o=r.stylize(`<${s}`,"special"),a=r.stylize(">","special"),l=r.stylize(`</${s}>`,"special");r.truncate-=s.length*2+5;let c="";i.length>0&&(c+=" ",c+=Zt(i.map(p=>[p,e.getAttribute(p)]),t,r,n,cq," ")),r.truncate-=c.length;const{truncate:u}=r;let d=md(e.children,r,n,void 0);return d&&d.length>u&&(d=`…(${String(e.children.length)})`),`${o}${c}${a}${d}${l}`},"inspectHTMLElement");var uq=Object.defineProperty,pq=Ne((e,t)=>uq(e,"name",{value:t,configurable:!0}),"n$4");const dq=pq((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${Zt(e,e,t,r)} ]`),"inspectArguments");var fq=Object.defineProperty,DS=Ne((e,t)=>fq(e,"name",{value:t,configurable:!0}),"r$3");const mq=DS((e,t)=>{let r;if(e===" ")r=" ";else if(typeof e=="number"&&e>0)r=Array.from({length:e+1}).join(" ");else return;return{base:r,prev:`
|
|
1122
|
+
${Array.from({length:t+1}).join(r)}`}},"getIndent"),fl=DS((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var hq=Object.defineProperty,CS=Ne((e,t)=>hq(e,"name",{value:t,configurable:!0}),"i$5");const gq=/^[a-z_]\w*$/i,yq=/^"|"$/g,vq=CS((e,t)=>{if(gq.test(e))return e;const r=JSON.stringify(e);return t.quoteStyle==="double"?r.replaceAll('"',String.raw`\"`):r.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(yq,"'")},"quoteComplexKey"),po=CS(([e,t],r,n,i)=>{n.truncate-=2;let s;typeof e=="string"?s=vq(e,n):typeof e=="number"?s=String(e):s=`[${i(e,r,n)}]`,n.truncate-=s.length;const o=i(t,r,n);return`${s}: ${o}`},"inspectProperty");var bq=Object.defineProperty,AS=Ne((e,t)=>bq(e,"name",{value:t,configurable:!0}),"p$4");const $q=AS(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),wq=AS((e,t,r,n)=>{const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;let s=Zt(e,e,t,r);t.truncate-=s.length;let o="";i.length>0&&(o=Zt(i.map(l=>[l,e[l]]),e,t,r,po));const a=n&&$q(e);return a&&(s=fl(s,n)),`[${a?"":" "}${s}${o?`, ${o}`:""}${a?"":" "}]`},"inspectArray");var kq=Object.defineProperty,Sq=Ne((e,t)=>kq(e,"name",{value:t,configurable:!0}),"o$7");const Pv=/\d(?=(?:\d{3})+(?!\d))/g,Eq=/\d{3}/g,Dq=/_$/,OS=Sq((e,t)=>{if(e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const r=e<0?-Math.floor(-e):Math.floor(e);if(r!==e){const n=String(r),i=t.slice(n.length+1);return`${n.replace(Pv,"$&_")}.${i.replace(Eq,"$&_").replace(Dq,"")}`}}return t.replace(Pv,"$&_")},"addNumericSeparator");var Cq=Object.defineProperty,jS=Ne((e,t)=>Cq(e,"name",{value:t,configurable:!0}),"i$4");const Aq=jS(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),gn=jS((e,t,r="…")=>{e=String(e);const n=r.length,i=e.length;if(n>t&&i>n)return r;if(i>t&&i>n){let s=t-n;return s>0&&Aq(e[s-1])&&(s-=1),`${e.slice(0,s)}${r}`}return e},"truncate");var Oq=Object.defineProperty,jq=Ne((e,t)=>Oq(e,"name",{value:t,configurable:!0}),"e$4");const Nv=jq((e,t)=>{let r=gn(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?OS(e,r):r,"bigint")},"inspectBigInt");var xq=Object.defineProperty,Pq=Ne((e,t)=>xq(e,"name",{value:t,configurable:!0}),"y");const Nq=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),Da=Pq((e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis||"global"in globalThis&&e===globalThis)return"{ [object globalThis] }";const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e),o=Nq(e)===Object.prototype||e.constructor===Object,a=e instanceof Object?"":"null prototype";let l;!o&&Symbol.toStringTag in e?l=e[Symbol.toStringTag]:l=a?"Object":"";const c=l||a?`[${[l,a].filter(Boolean).join(": ")}] `:"";if(i.length===0&&s.length===0)return`${c}{}`;t.truncate-=4;const u=Zt(i.map(m=>[m,e[m]]),e,t,r,po),d=Zt(s.map(m=>[m,e[m]]),e,t,r,po);let p="";return u&&d&&(p=", "),n?`${c}{${fl(u+p+d,n)}}`:`${c}{ ${u}${p}${d} }`},"inspectObject");var Rq=Object.defineProperty,Fq=Ne((e,t)=>Rq(e,"name",{value:t,configurable:!0}),"s$3");const Lq=Fq((e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${Da(e,t,r,n)}`},"inspectClass");var Iq=Object.defineProperty,Tq=Ne((e,t)=>Iq(e,"name",{value:t,configurable:!0}),"i$3");const Bq=Tq((e,t)=>{const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),i=n[0];return t.stylize(`${i}T${gn(n[1],t.truncate-i.length-1)}`,"date")},"inspectDate");var _q=Object.defineProperty,Mq=Ne((e,t)=>_q(e,"name",{value:t,configurable:!0}),"c$4");const Vq=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Wq=Mq((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(a=>!Vq.has(a)),{name:i}=e;t.truncate-=i.length;let s="";typeof e.message=="string"?s=gn(e.message,t.truncate):n.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const o=Zt(n.map(a=>[a,e[a]]),e,t,r,po);return`${i}${s}${o?` { ${o} }`:""}`},"inspectObject");var Uq=Object.defineProperty,Gq=Ne((e,t)=>Uq(e,"name",{value:t,configurable:!0}),"c$3");const Rv=Gq((e,t)=>{const r=e[Symbol.toStringTag]||"Function",n=e.toString();if(n.length<t.truncate-12)return t.stylize(`[${r}: ${n}]`,"special");const{name:i}=e;return i?t.stylize(`[${r} ${gn(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},"inspectFunction");var qq=Object.defineProperty,xS=Ne((e,t)=>qq(e,"name",{value:t,configurable:!0}),"p$3");const zq=xS(([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),"inspectMapEntry"),Hq=xS((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=Zt([...e.entries()],e,t,r,zq);return n&&(i=fl(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectMap");var Jq=Object.defineProperty,Kq=Ne((e,t)=>Jq(e,"name",{value:t,configurable:!0}),"e$3");function Un(e,t){return Number.isNaN(e)?t.stylize("NaN","number"):e===Number.POSITIVE_INFINITY?t.stylize("Infinity","number"):e===Number.NEGATIVE_INFINITY?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===Number.POSITIVE_INFINITY?"+0":"-0","number"):t.stylize(gn(t.numericSeparator?OS(e,e.toString()):e.toString(),t.truncate),"number")}f(Un,"R$3");kr(Un,"Y");De(Un,"j$5");SS(Un,"P");Ne(Un,"u$3");Kq(Un,"inspectNumber");var Yq=Object.defineProperty,Xq=Ne((e,t)=>Yq(e,"name",{value:t,configurable:!0}),"e$2");const Qq=Xq(()=>"Promise{…}","getPromiseValue");var Zq=Object.defineProperty,ez=Ne((e,t)=>Zq(e,"name",{value:t,configurable:!0}),"p$1");const tz=ez((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${gn(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var rz=Object.defineProperty,nz=Ne((e,t)=>rz(e,"name",{value:t,configurable:!0}),"i$1");const iz=nz((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=Zt([...e],e,t,r);return n&&(i=fl(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectSet");var sz=Object.defineProperty,oz=Ne((e,t)=>sz(e,"name",{value:t,configurable:!0}),"l");const az=oz((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var cz=Object.defineProperty,PS=Ne((e,t)=>cz(e,"name",{value:t,configurable:!0}),"e$1");const Fv=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),lz={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},uz=16,pz=PS(e=>lz[e]||String.raw`\u${`0000${e.codePointAt(0).toString(uz)}`.slice(-4)}`,"escape"),Lv=PS((e,t)=>(Fv.test(e)&&(e=e.replaceAll(Fv,pz)),t.stylize(az(gn(e,t.truncate-2),t),"string")),"inspectString");var dz=Object.defineProperty,fz=Ne((e,t)=>dz(e,"name",{value:t,configurable:!0}),"o");const Iv=fz(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var mz=Object.defineProperty,NS=Ne((e,t)=>mz(e,"name",{value:t,configurable:!0}),"f");const hz=NS(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),Dr=NS((e,t,r)=>{const n=hz(e);t.truncate-=n.length+4;const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return`${n}[]`;let s="";for(let a=0;a<e.length;a++){const l=`${t.stylize(gn(e[a],t.truncate),"number")}${a===e.length-1?"":", "}`;if(t.truncate-=l.length,e[a]!==e.length&&t.truncate<=3){s+=`…(${String(e.length-e[a]+1)})`;break}s+=l}let o="";return i.length>0&&(o=Zt(i.map(a=>[a,e[a]]),e,t,r,po)),`${n}[ ${s}${o?`, ${o}`:""} ]`},"inspectTypedArray");var gz=Object.defineProperty,st=Ne((e,t)=>gz(e,"name",{value:t,configurable:!0}),"r");const Ya=new WeakMap,hd={},yz={Arguments:dq,Array:wq,ArrayBuffer:st(()=>"","ArrayBuffer"),BigInt:Nv,bigint:Nv,Boolean:st((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:st((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:st(()=>"","DataView"),Date:Bq,Error:Wq,Float32Array:Dr,Float64Array:Dr,Function:Rv,function:Rv,Generator:st(()=>"","Generator"),HTMLCollection:md,Int8Array:Dr,Int16Array:Dr,Int32Array:Dr,Map:Hq,NodeList:md,null:st((e,t)=>t.stylize("null","null"),"null"),Number:Un,number:Un,Promise:Qq,RegExp:tz,Set:iz,String:Lv,string:Lv,Symbol:Iv,symbol:Iv,Uint8Array:Dr,Uint8ClampedArray:Dr,Uint16Array:Dr,Uint32Array:Dr,undefined:st((e,t)=>t.stylize("undefined","undefined"),"undefined"),WeakMap:st((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),WeakSet:st((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet")},Tv=Symbol.for("nodejs.util.inspect.custom"),vz=st((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[Tv]=="function")return e[Tv](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&Ya.has(e.constructor))return Ya.get(e.constructor)?.(e,t)??"unknown";const i=hd[r];return i?i(e,t):""},"inspectCustom"),RS=st((e,t,r,n)=>{if(n.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const i=st((c,u,d)=>(u&&(n=[...n,u]),RS(c,d,r+1,n)),"inspect"),s=t.indent?mq(t.indent,r):void 0;let o=e===null?"null":typeof e;o==="object"&&(o=Object.prototype.toString.call(e).slice(8,-1));const a=yz[o];if(a!==void 0)return a(e,t,i,s);if(t.customInspect&&e){const c=vz(e,t,o,t.depth-r);if(c)return typeof c=="string"?c:i(c,e,t)}const l=e?Object.getPrototypeOf(e):!1;return l===Object.prototype||l===null?Da(e,t,i,s):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?ES(e,e,t,i):"constructor"in e?e.constructor!==Object?Lq(e,t,i,s):Da(e,t,i,s):e===Object(e)?Da(e,t,i,s):t.stylize(String(e),o)},"internalInspect"),Xa=st((e,t={})=>{const r={breakLength:Number.POSITIVE_INFINITY,customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,showProxy:!1,stylize:st(n=>n,"stylize"),truncate:Number.POSITIVE_INFINITY,...t};if(r.indent!==void 0&&r.indent!==" "&&!(Number.parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');return RS(e,r,0,[])},"inspect");st((e,t)=>Ya.has(e)?!1:(Ya.set(e,t),!0),"registerConstructor");st((e,t)=>e in hd?!1:(hd[e]=t,!0),"registerStringTag");var bz=Object.defineProperty,$z=De((e,t)=>bz(e,"name",{value:t,configurable:!0}),"r$6");const FS=$z((e,t)=>(t.__write??t.write.bind(t)).call(t,e),"writeStream");var wz=Object.defineProperty,kz=De((e,t)=>wz(e,"name",{value:t,configurable:!0}),"A$4"),Sz=Object.defineProperty,Um=kz((e,t)=>Sz(e,"name",{value:t,configurable:!0}),"$"),Ez=Object.defineProperty,Dz=Um((e,t)=>Ez(e,"name",{value:t,configurable:!0}),"r$1");const Cz=Dz(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
1123
|
+
`),"normalizeLF"),Az=globalThis.process??Object.create(null),Bv={versions:{}},_v=new Proxy(Az,{get(e,t){if(t in e)return e[t];if(t in Bv)return Bv[t]}});var Oz=Object.defineProperty,jz=Um((e,t)=>Oz(e,"name",{value:t,configurable:!0}),"b");const xz=jz((e,t,r,n)=>{const i={column:0,line:-1,...e.start},s={...i,...e.end},o=i.line,a=i.column,l=s.line,c=s.column;let u=Math.max(o-(r+1),0),d=Math.min(t.length,l+n);o===-1&&(u=0),l===-1&&(d=t.length);const p=l-o,m={};if(p)for(let g=0;g<=p;g++){const $=g+o;if(!a)m[$]=!0;else if(g===0){const S=t[$-1]?.length;m[$]=[a,(S??0)-a+1]}else if(g===p)m[$]=[0,c];else{const S=t[$-g]?.length;m[$]=[0,S]}}else a===c?m[o]=a?[a,0]:!0:m[o]=[a,(c??0)-(a??0)];return{end:d,markerLines:m,start:u}},"getMarkerLines");var Pz=Object.defineProperty,ca=Um((e,t)=>Pz(e,"name",{value:t,configurable:!0}),"t");const Nz=_v.platform==="win32"&&!_v.env?.WT_SESSION?">":"❯",Rz=ca((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:ca(g=>g,"gutter"),marker:ca(g=>g,"marker"),message:ca(g=>g,"message"),...r?.color}},i=typeof t.start.column=="number";let s=Cz(e).split(`
|
|
1124
|
+
`);typeof n.tabWidth=="number"&&(s=s.map(g=>g.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:a,start:l}=xz(t,s,n.linesAbove,n.linesBelow),c=String(o).length,{gutter:u,marker:d,message:p}=n.color;let m=s.slice(l,o).map((g,$)=>{const S=l+1+$,k=a[S],v=` ${String(S)}`.slice(-c),h=!a[S+1],b=` ${v}${n.showGutter?" |":""}`;if(k){let w="";if(Array.isArray(k)){const y=g.replaceAll(/[^\t]/g," ").slice(0,Math.max(k[0]-1,0)),D=k[1]||1;w=[`
|
|
1125
|
+
`,n.prefix+u(b.replaceAll(/\d/g," "))," ",y,d("^").repeat(D)].join(""),h&&n.message&&(w+=` ${p(n.message)}`)}return[n.prefix+d(Nz),u(b),g.length>0?` ${g}`:"",w].join("")}return`${n.prefix} ${u(b)}${g.length>0?` ${g}`:""}`}).join(`
|
|
1126
|
+
`);return n.message&&!i&&(m=`${n.prefix+" ".repeat(c+1)+n.message}
|
|
1127
|
+
${m}`),m},"codeFrame");var Fz=Object.defineProperty,Lz=De((e,t)=>Fz(e,"name",{value:t,configurable:!0}),"x$3"),Iz=Object.defineProperty,Tz=Lz((e,t)=>Iz(e,"name",{value:t,configurable:!0}),"x"),Bz=Object.defineProperty,Wr=Tz((e,t)=>Bz(e,"name",{value:t,configurable:!0}),"u");const Gn=Wr((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),qn="<unknown>",_z=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mz=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Vz=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Wz=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Uz=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Gz=/in\s(.*)\s\(at\s(.+)\)\sat/,qz=/^(?:.*@)?(.*):(\d+):(\d+)$/,zz=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Hz=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Jz=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Mv=/\(error: (.*)\)/,Kz=/at\s/,Yz=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Xz=/^\s+|\s+$/g,Qz=/\S*(?:Error: |AggregateError:)/,LS=/^Anonymous function$/,Zz=/^\s*in\s.*/,eH=/^.*?\s*at\s.*/,tH=/^.*?\s*@.*|\[native code\]/,IS=Wr((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:qn,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),TS=Wr((e,t)=>{const r=Vz.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),rH=Wr(e=>{const t=Gz.exec(e);if(t){Gn(`parse nested node error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const n=t[2].split(":");return{column:n[2]?+n[2]:void 0,file:n[0],line:n[1]?+n[1]:void 0,methodName:t[1]??qn,raw:e,type:void 0}}const r=Uz.exec(e);if(r){Gn(`parse node error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n={column:r[4]?+r[4]:void 0,file:r[2]?r[2].replace(Kz,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??qn,raw:e,type:e.startsWith("internal")?"internal":void 0};return TS(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),nH=Wr(e=>{const t=_z.exec(e);if(t){Gn(`parse chrome error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const r=t[2]?.startsWith("native"),n=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,s;if(n){const c=Mz.exec(e);if(c){const u=Yz.exec(c[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):c[2]&&(t[2]=c[1]),c[2]&&(i={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=Wz.exec(e);u&&(s={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},i={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[o,a]=IS(t[1]?t[1].replace(LS,"<anonymous>"):qn,t[2]),l={column:t[4]?+t[4]:void 0,evalOrigin:i,file:a,line:t[3]?+t[3]:void 0,methodName:o,raw:e,type:n?"eval":r?"native":void 0};return s?(l.column=s.column,l.file=s.file,l.line=s.line):TS(l,`${a}:${t[3]}:${t[4]}`),l}},"parseChromium"),iH=Wr((e,t)=>{const r=zz.exec(e);if(r){Gn(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&Hz.exec(r[3]);let s;n&&i&&(r[3]=i[1],s={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0,methodName:"eval",raw:e,type:"eval"},r[4]=i[2]);const[o,a]=IS(r[1]?r[1].replace(LS,"<anonymous>"):qn,r[3]);let l;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?l=t.column:!n&&r[5]&&(l=+r[5]);let c;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?c=t.line:r[4]&&(c=+r[4]),{column:l,evalOrigin:s,file:a,line:c,methodName:o,raw:e,type:n?"eval":a.includes("[native code]")?"native":void 0}}},"parseGecko"),sH=Wr((e,t)=>{const r=Jz.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return Gn(`parse firefox error stack line: "${e}"`,`found: ${JSON.stringify(r)}`),{column:r[4]?+r[4]:t?.column??void 0,file:r[2],line:r[3]?+r[3]:t?.line??void 0,methodName:r[1]||qn,raw:e,type:void 0}},"parseFirefox"),oH=Wr(e=>{const t=qz.exec(e);if(t)return Gn(`parse react android native error stack line: "${e}"`,`found: ${JSON.stringify(t)}`),{column:t[3]?+t[3]:void 0,file:t[1],line:t[2]?+t[2]:void 0,methodName:qn,raw:e,type:void 0}},"parseReactAndroidNative"),BS=Wr((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
|
|
1128
|
+
`).map(s=>(Mv.test(s)?s.replace(Mv,"$1"):s).replaceAll(Xz,"")).filter(s=>!Qz.test(s)&&s!=="eval code");return t&&(i=i.filter(s=>t(s))),i=i.slice(0,r),i.reduce((s,o,a)=>{if(!o||o.length>1024)return s;let l;if(Zz.test(o))l=rH(o);else if(eH.test(o))l=nH(o);else if(tH.test(o)){let c;if(a===0){const u=e,d=u.columnNumber,p=u.lineNumber,m=u.line,g=u.column;d||p?c={column:d,line:p,type:"firefox"}:(m||g)&&(c={column:g,line:m,type:"safari"})}l=sH(o,c)??iH(o,c)}else l=oH(o);return l?s.push(l):Gn(`parse error stack line: "${o}"`,"not parser found"),s},[])},"parseStacktrace");var aH=Object.defineProperty,cH=De((e,t)=>aH(e,"name",{value:t,configurable:!0}),"p$6"),lH=Object.defineProperty,_S=cH((e,t)=>lH(e,"name",{value:t,configurable:!0}),"m");const uH=XG(import.meta.url),ki=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gm=_S(e=>{if(typeof ki<"u"&&ki.versions&&ki.versions.node){const[t,r]=ki.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ki.getBuiltinModule(e)}return uH(e)},"__cjs_getBuiltinModule"),{existsSync:pH,readFileSync:dH}=Gm("node:fs"),{relative:fH}=Gm("node:path"),{cwd:mH}=ki,{fileURLToPath:hH}=Gm("node:url");var gH=Object.defineProperty,Je=_S((e,t)=>gH(e,"name",{value:t,configurable:!0}),"o");const as=Je((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),yH=Je((e,t)=>{const r=e.replace("async file:","file:");return fH(t,r.startsWith("file:")?hH(r):r)},"getRelativePath"),vH=Je((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),MS=Je((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},s)=>`${as(i,n,s)}${vH(e,r,t)}
|
|
1129
|
+
`,"getMessage"),VS=Je((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const s=as(n,r,i);let o="";if(Array.isArray(e.hint))for(const a of e.hint)o+=`${s+a}
|
|
1130
|
+
`;else o+=s+e.hint;return t.hint(o)},"getHint"),qm=Je((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:s},o=0)=>{const a=n?yH(e.file,r):e.file,{fileLine:l,method:c}=t;return`${as(s,i,o)}at ${e.methodName?`${c(e.methodName)} `:""}${l(a)}:${l(e.line?.toString()??"")}`},"getMainFrame"),WS=Je((e,{color:t,indentation:r,linesAbove:n,linesBelow:i,prefix:s,showGutter:o,showLineNumbers:a,tabWidth:l},c)=>{if(e.file===void 0)return;const u=e.file.replace("file://","");if(!pH(u))return;const d=dH(u,"utf8");return Rz(d,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:as(s,r,c),showGutter:o,showLineNumbers:a,tabWidth:l})},"getCode"),US=Je((e,t,r)=>{if(e.errors.length===0)return;let n=`${as(t.prefix,t.indentation,r)}Errors:
|
|
1131
|
+
|
|
1132
|
+
`,i=!0;for(const s of e.errors)i?i=!1:n+=`
|
|
1133
|
+
|
|
1134
|
+
`,n+=qS(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
|
|
1135
|
+
${n}`},"getErrors"),GS=Je((e,t,r)=>{let n=`${as(t.prefix,t.indentation,r)}Caused by:
|
|
1136
|
+
|
|
1137
|
+
`;const i=e.cause;n+=MS(i,t,r);const s=BS(i).shift(),o=VS(i,t,r);if(o&&(n+=`${o}
|
|
1138
|
+
`),s&&(n+=qm(s,t,r),!t.hideErrorCauseCodeView)){const a=WS(s,t,r);a!==void 0&&(n+=`
|
|
1139
|
+
${a}`)}if(i.cause)n+=`
|
|
1140
|
+
${GS(i,t,r+1)}`;else if(i instanceof AggregateError){const a=US(i,t,r);a!==void 0&&(n+=`
|
|
1141
|
+
${a}`)}return`
|
|
1142
|
+
${n}`},"getCause"),bH=Je((e,t)=>(e.length>0?`
|
|
1143
|
+
`:"")+e.map(r=>qm(r,t)).join(`
|
|
1144
|
+
`),"getStacktrace"),qS=Je((e,t,r)=>{const n={cwd:mH(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...t,color:{fileLine:Je(o=>o,"fileLine"),gutter:Je(o=>o,"gutter"),hint:Je(o=>o,"hint"),marker:Je(o=>o,"marker"),message:Je(o=>o,"message"),method:Je(o=>o,"method"),title:Je(o=>o,"title"),...t.color}},i=BS(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),s=i.shift();return[t.hideMessage?void 0:MS(e,n,r),VS(e,n,r),s?qm(s,n,r):void 0,s&&!n.hideErrorCodeView?WS(s,n,r):void 0,e instanceof AggregateError?US(e,n,r):void 0,e.cause===void 0?void 0:GS(e,n,r),i.length>0?bH(i,n):void 0].filter(Boolean).join(`
|
|
1145
|
+
`).replaceAll("\\","/")},"internalRenderError"),hp=Je((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return qS(e,t,0)},"renderError");var $H=Object.defineProperty,zm=De((e,t)=>$H(e,"name",{value:t,configurable:!0}),"s$3"),wH=Object.defineProperty,ml=zm((e,t)=>wH(e,"name",{value:t,configurable:!0}),"l");const Hm=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Jm=[12288,12288,65281,65376,65504,65510],Km=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Ym=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],hl=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var kH=Object.defineProperty,SH=ml((e,t)=>kH(e,"name",{value:t,configurable:!0}),"r$1");const Wo=SH((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=i*2;if(t<e[s])n=i-1;else if(t>e[s+1])r=i+1;else return!0}return!1},"isInRange");var EH=Object.defineProperty,si=ml((e,t)=>EH(e,"name",{value:t,configurable:!0}),"r");const DH=Hm[0],CH=Hm.at(-1),AH=Jm[0],OH=Jm.at(-1),jH=Km[0],xH=Km.at(-1),PH=Ym[0],NH=Ym.at(-1),RH=hl[0],FH=hl.at(-1),Vv=19968,[LH,IH]=cs(hl);function cs(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],s=e[n+1];if(Vv>=i&&Vv<=s)return[i,s];s-i>r-t&&(t=i,r=s)}return[t,r]}f(cs,"X");kr(cs,"ge");De(cs,"b$2");zm(cs,"b");ml(cs,"N");si(cs,"findWideFastPathRange");const zS=si(e=>e<DH||e>CH?!1:Wo(Hm,e),"isAmbiguous"),HS=si(e=>e<AH||e>OH?!1:Wo(Jm,e),"isFullWidth"),TH=si(e=>e<jH||e>xH?!1:Wo(Km,e),"isHalfWidth"),BH=si(e=>e<PH||e>NH?!1:Wo(Ym,e),"isNarrow"),JS=si(e=>e>=LH&&e<=IH?!0:e<RH||e>FH?!1:Wo(hl,e),"isWide");function ls(e){return zS(e)?"ambiguous":HS(e)?"fullwidth":TH(e)?"halfwidth":BH(e)?"narrow":JS(e)?"wide":"neutral"}f(ls,"ee");kr(ls,"pe");De(ls,"v$2");zm(ls,"q");ml(ls,"getCategory");si(ls,"getCategory");var _H=Object.defineProperty,gl=De((e,t)=>_H(e,"name",{value:t,configurable:!0}),"i$3"),MH=Object.defineProperty,yl=gl((e,t)=>MH(e,"name",{value:t,configurable:!0}),"a"),VH=Object.defineProperty,Xm=yl((e,t)=>VH(e,"name",{value:t,configurable:!0}),"e");function oi(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}f(oi,"V");kr(oi,"J");De(oi,"s$2");gl(oi,"s");yl(oi,"r");Xm(oi,"validate");function ai(e){return oi(e),ls(e)}f(ai,"H$1");kr(ai,"K");De(ai,"r$5");gl(ai,"p");yl(ai,"eastAsianWidthType");Xm(ai,"eastAsianWidthType");function Uo(e,{ambiguousAsWide:t=!1}={}){return oi(e),HS(e)||JS(e)||t&&zS(e)?2:1}f(Uo,"ve$1");kr(Uo,"Fe");De(Uo,"o$5");gl(Uo,"W");yl(Uo,"eastAsianWidth");Xm(Uo,"eastAsianWidth");var WH=Object.defineProperty,UH=De((e,t)=>WH(e,"name",{value:t,configurable:!0}),"p$3"),GH=Object.defineProperty,KS=UH((e,t)=>GH(e,"name",{value:t,configurable:!0}),"e"),qH=Object.defineProperty,zH=KS((e,t)=>qH(e,"name",{value:t,configurable:!0}),"E");const YS=String.raw,Wv=YS`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,HH=zH(()=>new RegExp(YS`\p{RI}{2}|(?)${Wv}(?:\u200D${Wv})*`,"gu"),"default");var JH=Object.defineProperty,KH=KS((e,t)=>JH(e,"name",{value:t,configurable:!0}),"p");const us=new Set(["\x1B",""]),vl="\x07",XS="[",Qm="m",Qa="]8;;",YH=39,XH=/[\u200B\uFEFF\u2060-\u2064]/g,QH=new RegExp(`(?:\\${XS}(?<code>\\d+)m|\\${Qa}(?<uri>.*)${vl})`),ZH=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Rs=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,la=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ca=HH();KH(e=>e.replace(Ca,""),"stripEmoji");var eJ=Object.defineProperty,tJ=De((e,t)=>eJ(e,"name",{value:t,configurable:!0}),"E"),rJ=Object.defineProperty,nJ=tJ((e,t)=>rJ(e,"name",{value:t,configurable:!0}),"A"),iJ=Object.defineProperty,bl=nJ((e,t)=>iJ(e,"name",{value:t,configurable:!0}),"d");const Uv=new Map,ua=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Aa=bl(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),sJ=bl((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Uv.get(r);if(i||(i=new Map,Uv.set(r,i)),i.has(n))return i.get(n);let s;if(Aa(e)==="latin")s=t.width.regular;else if(Aa(e)==="control")s=t.width.control;else if(Aa(e)==="wide")s=t.width.wide;else switch(ai(e)){case"ambiguous":{s=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{s=t.width.fullWidth;break}case"wide":{s=t.width.wide;break}default:s=t.width.regular}return i.set(n,s),s},"getCachedCharWidth"),oJ=bl(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),gd=bl((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?gd(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,s=i>1e4;let o=0,a=0,l=i,c=!1;const u=e.includes("\x1B")||e.includes("");for(;o<i;){if(u&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const S="\x1B]8;;\x07",k=S.length,v=e.indexOf("\x07",o+5);if(v!==-1){const h=e.indexOf(S,v+1);if(h!==-1){const b=h+k,w=e.slice(v+1,h).replace(Rs,""),y=gd(w,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),D=y.width;if(y.truncated)c=!0,l=Math.min(l,o);else if(a+D>n&&(l=Math.min(l,o),c=!0,a+D>r.truncation.limit))break;if(a+=D,o=b,c&&a>=r.truncation.limit)break;continue}}}if(Rs.lastIndex=o,Rs.test(e)){const S=Rs.lastIndex-o,k=r.truncation.countAnsiEscapeCodes?S:r.width.ansi;if(a+k>n&&(l=Math.min(l,o),a+k>r.truncation.limit)){c=!0;break}a+=k,o=Rs.lastIndex;continue}}const m=e.codePointAt(o);if(m===8203||m===65279||m>=8288&&m<=8292){o+=1;continue}if(m===9){if(a+r.width.tab>n&&(l=Math.min(l,o),a+r.width.tab>r.truncation.limit)){c=!0;break}a+=r.width.tab,o+=1;continue}if(ua.lastIndex=o,ua.test(e)){const S=(ua.lastIndex-o)*r.width.regular;if(a+S>n){const k=Math.floor((n-a)/r.width.regular);if(l=Math.min(l,o+k),a+S>r.truncation.limit){c=!0;break}}a+=S,o=ua.lastIndex;continue}if((m<=31||m>=127&&m<=159)&&(la.lastIndex=o,la.test(e))){const S=(la.lastIndex-o)*r.width.control;if(a+S>n&&(l=Math.min(l,o+Math.floor((n-a)/r.width.control)),a+S>r.truncation.limit)){c=!0;break}a+=S,o=la.lastIndex;continue}if(Ca.lastIndex=o,Ca.test(e)){if(a+r.width.emoji>n&&(l=Math.min(l,o),a+r.width.emoji>r.truncation.limit)){c=!0;break}a+=r.width.emoji,o=Ca.lastIndex;continue}const g=e.codePointAt(o)??0;if(oJ(g)){o+=g>65535?2:1;continue}let $;if(s)$=sJ(g,r);else switch(Aa(g)){case"control":{$=r.width.control;break}case"latin":{$=r.width.regular;break}case"wide":{$=r.width.wide;break}case"zero":{$=0;break}default:switch(ai(g)){case"ambiguous":{$=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{$=r.width.fullWidth;break}case"wide":{$=r.width.wide;break}default:$=r.width.regular}}if(a+$>n&&(l=Math.min(l,o),a+$>r.truncation.limit)){c=!0;break}a+=$,o+=g>65535?2:1}let d=a,p=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(d=r.truncation.limit,p=!0),{ellipsed:p,index:c?l:i,truncated:c,width:d}},"getStringTruncatedWidth");var aJ=Object.defineProperty,cJ=De((e,t)=>aJ(e,"name",{value:t,configurable:!0}),"i$1"),lJ=Object.defineProperty,uJ=cJ((e,t)=>lJ(e,"name",{value:t,configurable:!0}),"e"),pJ=Object.defineProperty,dJ=uJ((e,t)=>pJ(e,"name",{value:t,configurable:!0}),"r");const Tt=dJ((e,t={})=>gd(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var fJ=Object.defineProperty,QS=De((e,t)=>fJ(e,"name",{value:t,configurable:!0}),"b"),mJ=Object.defineProperty,ci=QS((e,t)=>mJ(e,"name",{value:t,configurable:!0}),"d"),hJ=Object.defineProperty,gJ=ci((e,t)=>hJ(e,"name",{value:t,configurable:!0}),"a");const yJ=/\x1B\[(\d+)m/;let ZS=class{static{f(this,"Wt")}static{kr(this,"Pt")}static{De(this,"T")}static{QS(this,"T")}static{ci(this,"d")}static{gJ(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=yJ.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];i&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(n=>{const i=r[n];i&&t.push(i)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}};var vJ=Object.defineProperty,eE=ci((e,t)=>vJ(e,"name",{value:t,configurable:!0}),"o");const tE=eE((e,t)=>{if(!us.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+Qa.length).join("")===Qa;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),bJ=eE((e,t={})=>{const r=new ZS;let n="",i=!1,s="",o="",a=!1;const l=[...e];for(let c=0;c<l.length;c++){const u=l[c];if(u&&us.has(u)){if(n){const $=t.getWidth?.(n)??0,S={isEscapeSequence:!1,isGrapheme:!0,text:n,width:$};if(a&&(S.isHyperlink=!0,S.hyperlinkUrl=o),t.onSegment?.(S,r)===!1)return;n=""}i=!0,s=u;const m=tE(l,c),{isInsideLinkEscape:g}=m;if(g){let $=c+1;for(o="";$<l.length;){const k=l[$];if(k===vl)break;o+=k,$+=1}o=o.slice(4);const S={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(S,r)===!1)return;c=$,a=!0,i=!1,s="";continue}if(c+1<l.length&&l[c+1]==="\\"&&a){const $={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.($,r)===!1)return;a=!1,o="",c+=1,i=!1,s="";continue}}if(i){if(s!==u&&(s+=u),u===Qm){i=!1,r.processEscape(s);const m={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(m,r)===!1)return;s=""}continue}n+=u;const d=t.getWidth?.(n)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:n,width:d};if(a&&(p.isHyperlink=!0,p.hyperlinkUrl=o),t.onSegment?.(p,r)===!1)return;n=""}if(n){const c=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:c};a&&(u.isHyperlink=!0,u.hyperlinkUrl=o),t.onSegment?.(u,r)}if(s){const c={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(c,r)}},"processAnsiString");var $J=Object.defineProperty,wJ=ci((e,t)=>$J(e,"name",{value:t,configurable:!0}),"t$1");const Gv=wJ(e=>`${us.values().next().value}${XS}${String(e)}${Qm}`,"wrapAnsiCode");var kJ=Object.defineProperty,SJ=ci((e,t)=>kJ(e,"name",{value:t,configurable:!0}),"s");const qv=SJ(e=>`${us.values().next().value}${Qa}${e}${vl}`,"wrapAnsiHyperlink");var EJ=Object.defineProperty,DJ=ci((e,t)=>EJ(e,"name",{value:t,configurable:!0}),"l");const CJ=DJ(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
|
|
1146
|
+
`),s=[...i];let o=0;for(const[a,l]of s.entries()){if(t+=l,us.has(l)){const u=QH.exec(i.slice(o))?.groups??{};if(u.code!==void 0){const d=Number.parseFloat(u.code);r=d===YH?void 0:d}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=ZH.get(Number(r));s[a+1]===`
|
|
1147
|
+
`?(n&&(t+=qv("")),r&&c&&(t+=Gv(c))):l===`
|
|
1148
|
+
`&&(r&&c&&(t+=Gv(r)),n&&(t+=qv(n))),o+=l.length}return t},"preserveAnsi");var AJ=Object.defineProperty,on=ci((e,t)=>AJ(e,"name",{value:t,configurable:!0}),"f");const rE=/(?=\s)|(?<=\s)/,nE=/^\s+$/,gp=on(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),Fn=on(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&Tt(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),iE=on((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new ZS;let s="",o=0,a=!1,l=!1,c="",u=0;for(;u<e.length;){const d=e[u];if(us.has(d)){a=!0,c=d,s+=d,l=tE([...e],u).isInsideLinkEscape,u+=1;continue}if(a){c+=d,s+=d,l?d===vl&&(a=l=!1):d===Qm&&(a=!1,i.processEscape(c)),u+=1;continue}const p=Tt(d),m=d===" ";if(p===0){s+=d,u+=1;continue}if(o+p>t&&(s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=Tt(s),m&&r)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(s+=d,o+=p,o===t&&u<e.length-1&&(n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=Tt(s),u+1<e.length&&e[u+1]===" "&&r)){for(u+=1;u<e.length&&e[u]===" ";)u+=1;continue}u+=1}return s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),r?n.map(d=>Fn(d)):n},"wrapWithBreakAtWidth"),OJ=on((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let s="",o=0;return bJ(n,{getWidth:Tt,onSegment:on((a,l)=>{const c=a.text??"";if(a.isEscapeSequence)s+=c;else{const u=c===" ";if(a.width===0)return s+=c,!0;if(o+a.width>t&&(s&&i.push(s),s=l.getStartEscapesForAllActiveAttributes(),o=0,u))return r||i.push(l.getStartEscapesForAllActiveAttributes()+c),!0;s+=c,o+=a.width}return!0},"onSegment")}),s&&i.push(s),r?i.map(a=>Fn(a)):i},"wrapCharByChar"),jJ=on((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(rE),s=[];let o="",a=0,l=0;for(;l<i.length;){const c=i[l],u=nE.test(c),d=Tt(c);if(c.length===0){l+=1;continue}if(r&&u&&a===0){l+=1;continue}if(a+d>t&&a>0){r?s.push(Fn(o)):s.push(o),o="",a=0;continue}o+=c,a+=d,l+=1}return o&&(r?s.push(Fn(o)):s.push(o)),s},"wrapWithWordBoundaries"),xJ=on((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(rE),s=[];let o="",a=0,l=0;for(;l<i.length;){const c=i[l],u=nE.test(c),d=Tt(c);if(c.length===0){l+=1;continue}if(r&&u&&a===0){l+=1;continue}if(d>t){o&&s.push(gp(r?Fn(o):o));const p=iE(c,t,r);if(p.length>0){for(let m=0;m<p.length-1;m+=1)s.push(p[m]);o=p.at(-1),a=Tt(o)}else o="",a=0;l+=1;continue}if(a+d>t&&a>0&&(s.push(gp(r?Fn(o):o)),o="",a=0,r&&u)){l+=1;continue}o+=c,a+=d,l+=1}return o&&s.push(gp(r?Fn(o):o)),s},"wrapAndBreakWords"),Hs={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},PJ=on((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:s=Hs.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
|
|
1149
|
+
`,`
|
|
1150
|
+
`);return r&&(o=o.replaceAll(XH,"")),o.split(`
|
|
1151
|
+
`).map(a=>{if(n&&a.trim()==="")return"";let l;switch(s){case Hs.BREAK_AT_CHARACTERS:{l=OJ(a,i,n);break}case Hs.BREAK_WORDS:{l=xJ(a,i,n);break}case Hs.STRICT_WIDTH:{l=iE(a,i,n);break}default:l=jJ(a,i,n)}return CJ(l)}).join(`
|
|
1152
|
+
`)},"wordWrap");var NJ=Object.defineProperty,yn=De((e,t)=>NJ(e,"name",{value:t,configurable:!0}),"n$2");const sE=80,oE=24,yd=yn((e,t,{shell:r,env:n}={})=>QG(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Oa=yn((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),aE=yn((e,t)=>{const{columns:r,rows:n}=Oa(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===sE&&n===oE))return{columns:r,rows:n}},"createIfNotDefault"),RJ=yn(()=>{if(Rn.platform!=="linux")return!0;try{const e=zs.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}},"isForegroundProcess");function $l(){const{env:e,stdout:t,stderr:r}=Rn;if(t?.columns&&t?.rows)return Oa(t.columns,t.rows);if(r?.columns&&r?.rows)return Oa(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Oa(e.COLUMNS,e.LINES);const n={columns:sE,rows:oE};return Rn.platform==="win32"?yp()??n:Rn.platform==="darwin"?zv()??yp()??n:zv()??yp()??FJ()??n}f($l,"_e$1");kr($l,"ja");De($l,"O");yn($l,"terminalSize");const zv=yn(()=>{try{const e=Rn.platform==="darwin"?zs.constants.O_EVTONLY|zs.constants.O_NONBLOCK:zs.constants.O_NONBLOCK,{columns:t,rows:r}=ZG.WriteStream(zs.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),yp=yn(()=>{try{const e=yd("tput",["cols"],{env:{TERM:"dumb",...Rn.env}}),t=yd("tput",["lines"],{env:{TERM:"dumb",...Rn.env}});if(e&&t)return aE(e,t)}catch{}},"tput"),FJ=yn(()=>{try{if(!RJ())return;const e=yd("resize",["-u"]).match(/\d+/g);if(e.length===2)return aE(e[0],e[1])}catch{}},"resize");var LJ=Object.defineProperty,IJ=De((e,t)=>LJ(e,"name",{value:t,configurable:!0}),"r$2");const TJ=IJ(e=>{const t=Object.keys(e).map(r=>e[r].badge??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestBadge");var BJ=Object.defineProperty,_J=De((e,t)=>BJ(e,"name",{value:t,configurable:!0}),"r$1");const{bold:MJ,cyan:VJ,green:Hv,grey:WJ,magenta:UJ,red:GJ,yellow:vp}=Ut,qJ={indent:2,quoteStyle:"single",stylize:_J((e,t)=>{const r={bigint:vp,boolean:vp,date:UJ,null:MJ,number:vp,regexp:GJ,special:VJ,string:Hv,symbol:Hv,undefined:WJ};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var zJ=Object.defineProperty,HJ=De((e,t)=>zJ(e,"name",{value:t,configurable:!0}),"o$1");const{bold:JJ,underline:KJ}=Ut,YJ=HJ((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?KJ(r):r,t.bold.label&&(r=JJ(r)),r},"formatLabel");var XJ=Object.defineProperty,cE=De((e,t)=>XJ(e,"name",{value:t,configurable:!0}),"o");const QJ=cE(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class ZJ{static{f(this,"to")}static{kr(this,"ro")}static{De(this,"AbstractPrettyReporter")}static{cE(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:QJ,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=kS}setLoggerTypes(t){this.loggerTypes=t}}var eK=Object.defineProperty,we=f((e,t)=>eK(e,"name",{value:t,configurable:!0}),"k$5"),tK=Object.defineProperty,ie=we((e,t)=>tK(e,"name",{value:t,configurable:!0}),"p");Ze(import.meta.url);const rK=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:Zm,stderr:eh,env:eo}=rK,nK="\x1B",Oe="\x1B[",lE=";";var iK=Object.defineProperty,sK=ie((e,t)=>iK(e,"name",{value:t,configurable:!0}),"t$3"),oK=Object.defineProperty,aK=sK((e,t)=>oK(e,"name",{value:t,configurable:!0}),"t");const cK=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,lK=/^(?:msys|cygwin)$/,uK=!cK&&(process.platform==="win32"||lK.test(process.env.OSTYPE));var pK=Object.defineProperty,dt=aK((e,t)=>pK(e,"name",{value:t,configurable:!0}),"n");const dK=dt((e=1)=>`${Oe}${String(e)}D`,"cursorBackward");dt((e=1)=>`${Oe}${String(e)}B`,"cursorDown");dt((e=1)=>`${Oe}${String(e)}C`,"cursorForward");const fK=`${Oe}G`;dt((e=1)=>dK(e),"cursorLeft");const mK=dt((e=1)=>`${Oe}${String(e)}G`,"cursorHorizontalAbsolute");dt((e,t)=>{let r="";return e<0?r+=`${Oe}${String(-e)}D`:e>0&&(r+=`${Oe}${String(e)}C`),t<0?r+=`${Oe}${String(-t)}A`:t>0&&(r+=`${Oe}${String(t)}B`),r},"cursorMove");dt((e=1)=>`${Oe}${String(e)}E`,"cursorNextLine");dt((e=1)=>`${Oe}${String(e)}F`,"cursorPreviousLine");const hK=dt((e,t)=>t===void 0?mK(e+1):`${Oe}${String(t+1)}${lE}${String(e+1)}H`,"cursorTo");dt((e,t)=>t===void 0?`${Oe}${String(e)}H`:`${Oe}${String(e)}${lE}${String(t)}H`,"cursorPosition");dt((e=1)=>`${Oe}${String(e)}I`,"cursorHorizontalForwardTab");dt((e=1)=>`${Oe}${String(e)}Z`,"cursorBackwardTab");dt((e=1)=>`${Oe}${String(e)}X`,"eraseCharacter");dt((e=1)=>`${Oe}${String(e)}d`,"cursorVerticalAbsolute");const gK=dt((e=1)=>`${Oe}${String(e)}A`,"cursorUp");var yK=(e=>(e[e.Default=0]="Default",e[e.BlinkingBlock=1]="BlinkingBlock",e[e.SteadyBlock=2]="SteadyBlock",e[e.BlinkingUnderline=3]="BlinkingUnderline",e[e.SteadyUnderline=4]="SteadyUnderline",e[e.BlinkingBar=5]="BlinkingBar",e[e.SteadyBar=6]="SteadyBar",e))(yK||{});dt(e=>`${Oe}${String(e)} q`,"setCursorStyle");var vK=Object.defineProperty,bK=ie((e,t)=>vK(e,"name",{value:t,configurable:!0}),"o$3"),$K=Object.defineProperty,wK=bK((e,t)=>$K(e,"name",{value:t,configurable:!0}),"s"),kK=Object.defineProperty,th=wK((e,t)=>kK(e,"name",{value:t,configurable:!0}),"o"),xi=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e))(xi||{});const Lr=th(e=>{const t=e>=0&&e<=3?e:0;return`${Oe}${t===0?"":String(t)}J`},"eraseDisplay");var uE=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireLine=2]="EntireLine",e))(uE||{});const wl=th(e=>{const t=e>=0&&e<=2?e:0;return`${Oe}${t===0?"":String(t)}K`},"eraseInLine");Lr(0);const SK=wl(2);wl(0);wl(1);th(e=>{if(e<=0)return"";let t="";for(let r=0;r<e;r+=1)t+=SK,r<e-1&&(t+=gK());return t+=fK,t},"eraseLines");Lr(2);Lr(1);Lr(3);hK(0,0)+Lr(xi.ToEnd);`${wl(uE.EntireLine)}${Oe}`;`${Oe}${Lr(xi.EntireScreen)}`;const Jv=uK?`${Lr(xi.EntireScreen)}${Oe}0f`:`${Lr(xi.EntireScreen)}${Lr(xi.EntireScreenAndScrollback)}${Oe}H${nK}c`;var EK=Object.defineProperty,_i=ie((e,t)=>EK(e,"name",{value:t,configurable:!0}),"t$2");function kl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}f(kl,"ke");we(kl,"Ie");ie(kl,"getDefaultExportFromCjs");_i(kl,"getDefaultExportFromCjs");function rh(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}f(rh,"qe");we(rh,"Tt");ie(rh,"getDefaultExportFromNamespaceIfPresent");_i(rh,"getDefaultExportFromNamespaceIfPresent");function nh(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}f(nh,"Ve");we(nh,"kt");ie(nh,"getDefaultExportFromNamespaceIfNotNamed");_i(nh,"getDefaultExportFromNamespaceIfNotNamed");function ih(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=_i(ie(we(f(function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"s"),"s"),"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:_i(function(){return e[n]},"get")})}),r}f(ih,"Je");we(ih,"Mt");ie(ih,"getAugmentedNamespace");_i(ih,"getAugmentedNamespace");var bp={exports:{}},Kv;function sh(){return Kv||(Kv=1,(function(e,t){var r=Object.defineProperty,n=ie((b,w)=>r(b,"name",{value:w,configurable:!0}),"$");const{hasOwnProperty:i}=Object.prototype,s=h();s.configure=h,s.stringify=s,s.default=s,t.stringify=s,t.configure=h,e.exports=s;const o=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(b){return b.length<5e3&&!o.test(b)?`"${b}"`:JSON.stringify(b)}f(a,"o"),we(a,"n"),ie(a,"strEscape"),n(a,"strEscape");function l(b,w){if(b.length>200||w)return b.sort(w);for(let y=1;y<b.length;y++){const D=b[y];let E=y;for(;E!==0&&b[E-1]>D;)b[E]=b[E-1],E--;b[E]=D}return b}f(l,"u"),we(l,"g"),ie(l,"sort"),n(l,"sort");const c=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function u(b){return c.call(b)!==void 0&&b.length!==0}f(u,"c"),we(u,"c"),ie(u,"isTypedArrayWithEntries"),n(u,"isTypedArrayWithEntries");function d(b,w,y){b.length<y&&(y=b.length);const D=w===","?"":" ";let E=`"0":${D}${b[0]}`;for(let A=1;A<y;A++)E+=`${w}"${A}":${D}${b[A]}`;return E}f(d,"h"),we(d,"d"),ie(d,"stringifyTypedArray"),n(d,"stringifyTypedArray");function p(b){if(i.call(b,"circularValue")){const w=b.circularValue;if(typeof w=="string")return`"${w}"`;if(w==null)return w;if(w===Error||w===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}f(p,"y"),we(p,"b"),ie(p,"getCircularValueOption"),n(p,"getCircularValueOption");function m(b){let w;if(i.call(b,"deterministic")&&(w=b.deterministic,typeof w!="boolean"&&typeof w!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return w===void 0?!0:w}f(m,"E"),we(m,"A"),ie(m,"getDeterministicOption"),n(m,"getDeterministicOption");function g(b,w){let y;if(i.call(b,w)&&(y=b[w],typeof y!="boolean"))throw new TypeError(`The "${w}" argument must be of type boolean`);return y===void 0?!0:y}f(g,"V"),we(g,"q"),ie(g,"getBooleanOption"),n(g,"getBooleanOption");function $(b,w){let y;if(i.call(b,w)){if(y=b[w],typeof y!="number")throw new TypeError(`The "${w}" argument must be of type number`);if(!Number.isInteger(y))throw new TypeError(`The "${w}" argument must be an integer`);if(y<1)throw new RangeError(`The "${w}" argument must be >= 1`)}return y===void 0?1/0:y}f($,"J"),we($,"z"),ie($,"getPositiveIntegerOption"),n($,"getPositiveIntegerOption");function S(b){return b===1?"1 item":`${b} items`}f(S,"R"),we(S,"R"),ie(S,"getItemCount"),n(S,"getItemCount");function k(b){const w=new Set;for(const y of b)(typeof y=="string"||typeof y=="number")&&w.add(String(y));return w}f(k,"q"),we(k,"F"),ie(k,"getUniqueReplacerSet"),n(k,"getUniqueReplacerSet");function v(b){if(i.call(b,"strict")){const w=b.strict;if(typeof w!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(w)return y=>{let D=`Object can not safely be stringified. Received type ${typeof y}`;throw typeof y!="function"&&(D+=` (${y.toString()})`),new Error(D)}}}f(v,"Q"),we(v,"Y"),ie(v,"getStrictOption"),n(v,"getStrictOption");function h(b){b={...b};const w=v(b);w&&(b.bigint===void 0&&(b.bigint=!1),"circularValue"in b||(b.circularValue=Error));const y=p(b),D=g(b,"bigint"),E=m(b),A=typeof E=="function"?E:void 0,j=$(b,"maximumDepth"),G=$(b,"maximumBreadth");function W(N,O,R,_,L,T){let U=O[N];switch(typeof U=="object"&&U!==null&&typeof U.toJSON=="function"&&(U=U.toJSON(N)),U=_.call(O,N,U),typeof U){case"string":return a(U);case"object":{if(U===null)return"null";if(R.indexOf(U)!==-1)return y;let q="",X=",";const Q=T;if(Array.isArray(U)){if(U.length===0)return"[]";if(j<R.length+1)return'"[Array]"';R.push(U),L!==""&&(T+=L,q+=`
|
|
1153
|
+
${T}`,X=`,
|
|
1154
|
+
${T}`);const $e=Math.min(U.length,G);let it=0;for(;it<$e-1;it++){const Gr=W(String(it),U,R,_,L,T);q+=Gr!==void 0?Gr:"null",q+=X}const Ct=W(String(it),U,R,_,L,T);if(q+=Ct!==void 0?Ct:"null",U.length-1>G){const Gr=U.length-G-1;q+=`${X}"... ${S(Gr)} not stringified"`}return L!==""&&(q+=`
|
|
1155
|
+
${Q}`),R.pop(),`[${q}]`}let B=Object.keys(U);const F=B.length;if(F===0)return"{}";if(j<R.length+1)return'"[Object]"';let V="",ne="";L!==""&&(T+=L,X=`,
|
|
1156
|
+
${T}`,V=" ");const le=Math.min(F,G);E&&!u(U)&&(B=l(B,A)),R.push(U);for(let $e=0;$e<le;$e++){const it=B[$e],Ct=W(it,U,R,_,L,T);Ct!==void 0&&(q+=`${ne}${a(it)}:${V}${Ct}`,ne=X)}if(F>G){const $e=F-G;q+=`${ne}"...":${V}"${S($e)} not stringified"`,ne=X}return L!==""&&ne.length>1&&(q=`
|
|
1157
|
+
${T}${q}
|
|
1158
|
+
${Q}`),R.pop(),`{${q}}`}case"number":return isFinite(U)?String(U):w?w(U):"null";case"boolean":return U===!0?"true":"false";case"undefined":return;case"bigint":if(D)return String(U);default:return w?w(U):void 0}}f(W,"ee"),we(W,"te"),ie(W,"J"),n(W,"stringifyFnReplacer");function ce(N,O,R,_,L,T){switch(typeof O=="object"&&O!==null&&typeof O.toJSON=="function"&&(O=O.toJSON(N)),typeof O){case"string":return a(O);case"object":{if(O===null)return"null";if(R.indexOf(O)!==-1)return y;const U=T;let q="",X=",";if(Array.isArray(O)){if(O.length===0)return"[]";if(j<R.length+1)return'"[Array]"';R.push(O),L!==""&&(T+=L,q+=`
|
|
1159
|
+
${T}`,X=`,
|
|
1160
|
+
${T}`);const F=Math.min(O.length,G);let V=0;for(;V<F-1;V++){const le=ce(String(V),O[V],R,_,L,T);q+=le!==void 0?le:"null",q+=X}const ne=ce(String(V),O[V],R,_,L,T);if(q+=ne!==void 0?ne:"null",O.length-1>G){const le=O.length-G-1;q+=`${X}"... ${S(le)} not stringified"`}return L!==""&&(q+=`
|
|
1161
|
+
${U}`),R.pop(),`[${q}]`}R.push(O);let Q="";L!==""&&(T+=L,X=`,
|
|
1162
|
+
${T}`,Q=" ");let B="";for(const F of _){const V=ce(F,O[F],R,_,L,T);V!==void 0&&(q+=`${B}${a(F)}:${Q}${V}`,B=X)}return L!==""&&B.length>1&&(q=`
|
|
1163
|
+
${T}${q}
|
|
1164
|
+
${U}`),R.pop(),`{${q}}`}case"number":return isFinite(O)?String(O):w?w(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(D)return String(O);default:return w?w(O):void 0}}f(ce,"te"),we(ce,"re"),ie(ce,"I"),n(ce,"stringifyArrayReplacer");function te(N,O,R,_,L){switch(typeof O){case"string":return a(O);case"object":{if(O===null)return"null";if(typeof O.toJSON=="function"){if(O=O.toJSON(N),typeof O!="object")return te(N,O,R,_,L);if(O===null)return"null"}if(R.indexOf(O)!==-1)return y;const T=L;if(Array.isArray(O)){if(O.length===0)return"[]";if(j<R.length+1)return'"[Array]"';R.push(O),L+=_;let V=`
|
|
1165
|
+
${L}`;const ne=`,
|
|
1166
|
+
${L}`,le=Math.min(O.length,G);let $e=0;for(;$e<le-1;$e++){const Ct=te(String($e),O[$e],R,_,L);V+=Ct!==void 0?Ct:"null",V+=ne}const it=te(String($e),O[$e],R,_,L);if(V+=it!==void 0?it:"null",O.length-1>G){const Ct=O.length-G-1;V+=`${ne}"... ${S(Ct)} not stringified"`}return V+=`
|
|
1167
|
+
${T}`,R.pop(),`[${V}]`}let U=Object.keys(O);const q=U.length;if(q===0)return"{}";if(j<R.length+1)return'"[Object]"';L+=_;const X=`,
|
|
1168
|
+
${L}`;let Q="",B="",F=Math.min(q,G);u(O)&&(Q+=d(O,X,G),U=U.slice(O.length),F-=O.length,B=X),E&&(U=l(U,A)),R.push(O);for(let V=0;V<F;V++){const ne=U[V],le=te(ne,O[ne],R,_,L);le!==void 0&&(Q+=`${B}${a(ne)}: ${le}`,B=X)}if(q>G){const V=q-G;Q+=`${B}"...": "${S(V)} not stringified"`,B=X}return B!==""&&(Q=`
|
|
1169
|
+
${L}${Q}
|
|
1170
|
+
${T}`),R.pop(),`{${Q}}`}case"number":return isFinite(O)?String(O):w?w(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(D)return String(O);default:return w?w(O):void 0}}f(te,"X"),we(te,"K"),ie(te,"V"),n(te,"stringifyIndent");function Y(N,O,R){switch(typeof O){case"string":return a(O);case"object":{if(O===null)return"null";if(typeof O.toJSON=="function"){if(O=O.toJSON(N),typeof O!="object")return Y(N,O,R);if(O===null)return"null"}if(R.indexOf(O)!==-1)return y;let _="";const L=O.length!==void 0;if(L&&Array.isArray(O)){if(O.length===0)return"[]";if(j<R.length+1)return'"[Array]"';R.push(O);const Q=Math.min(O.length,G);let B=0;for(;B<Q-1;B++){const V=Y(String(B),O[B],R);_+=V!==void 0?V:"null",_+=","}const F=Y(String(B),O[B],R);if(_+=F!==void 0?F:"null",O.length-1>G){const V=O.length-G-1;_+=`,"... ${S(V)} not stringified"`}return R.pop(),`[${_}]`}let T=Object.keys(O);const U=T.length;if(U===0)return"{}";if(j<R.length+1)return'"[Object]"';let q="",X=Math.min(U,G);L&&u(O)&&(_+=d(O,",",G),T=T.slice(O.length),X-=O.length,q=","),E&&(T=l(T,A)),R.push(O);for(let Q=0;Q<X;Q++){const B=T[Q],F=Y(B,O[B],R);F!==void 0&&(_+=`${q}${a(B)}:${F}`,q=",")}if(U>G){const Q=U-G;_+=`${q}"...":"${S(Q)} not stringified"`}return R.pop(),`{${_}}`}case"number":return isFinite(O)?String(O):w?w(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(D)return String(O);default:return w?w(O):void 0}}f(Y,"Z"),we(Y,"X"),ie(Y,"N"),n(Y,"stringifySimple");function P(N,O,R){if(arguments.length>1){let _="";if(typeof R=="number"?_=" ".repeat(Math.min(R,10)):typeof R=="string"&&(_=R.slice(0,10)),O!=null){if(typeof O=="function")return W("",{"":N},[],O,_,"");if(Array.isArray(O))return ce("",N,[],k(O),_,"")}if(_.length!==0)return te("",N,[],_,"")}return Y("",N,[])}return f(P,"ue"),we(P,"ke"),ie(P,"M"),n(P,"stringify"),P}f(h,"K"),we(h,"Q"),ie(h,"configure"),n(h,"configure")})(bp,bp.exports)),bp.exports}f(sh,"We");we(sh,"Ot");ie(sh,"requireSafeStableStringify");var DK=sh();const CK=kl(DK),AK=CK.configure;var OK=Object.defineProperty,jK=ie((e,t)=>OK(e,"name",{value:t,configurable:!0}),"o$1");const xK=jK(e=>{const t=console;return e==="error"?t.__error??console.error:e==="warn"?t.__warn??console.warn:e==="trace"?t.__trace??console.trace:t.__log??console.log},"writeConsoleLogBasedOnLevel");var PK=Object.defineProperty,NK=ie((e,t)=>PK(e,"name",{value:t,configurable:!0}),"t");let RK=class{static{f(this,"Vt")}static{we(this,"Ct")}static{ie(this,"a")}static{NK(this,"RawReporter")}log(e){const{context:t=[],message:r,type:n}=e;xK(n.level)(r,...t)}};var FK=Object.defineProperty,LK=ie((e,t)=>FK(e,"name",{value:t,configurable:!0}),"a");const vd=LK(e=>e===void 0?[]:Array.isArray(e)?e:[e],"arrayify");var IK=Object.defineProperty,TK=ie((e,t)=>IK(e,"name",{value:t,configurable:!0}),"g$3");const bd=TK((e,t)=>{const r={...e};return Object.keys(t).forEach(n=>{r[n]={...r[n],...t[n]}}),r},"mergeTypes");var BK=Object.defineProperty,$d=ie((e,t)=>BK(e,"name",{value:t,configurable:!0}),"d");const _K=$d(e=>{let t=!1;return function(...r){if(!t){t=!0;try{const n=e.apply(this,r);return t=!1,n}catch(n){throw t=!1,n}}}},"preventLoop");class oh{static{f(this,"Te")}static{we(this,"xe")}static{ie(this,"PailBrowserImpl")}static{$d(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;force={};constructor(t){this.throttle=t.throttle??1e3,this.throttleMin=t.throttleMin??5;const r=t.parentLongestLabel,n=t.parentTypes,i=t.parentStringify,s=t.parentLogLevels;this.stringify=i??AK({strict:!0}),this.startTimerMessage=t.messages?.timerStart??"Initialized timer...",this.endTimerMessage=t.messages?.timerEnd??"Timer run for:",n&&r?(this.types=n,this.longestLabel=r):(this.types=bd(kS,t.types??{}),this.longestLabel=Ka(this.types)),this.logLevels=s&&!t.logLevels?s:{...eq,...t.logLevels},this.generalLogLevel=this.#t(t.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=t.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=vd(t.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set,this.lastLog={},this.logger=_K(this.logger.bind(this)),this.#e(),Array.isArray(t.reporters)&&this.registerReporters(t.reporters),this.rawReporter=this.extendReporter(t.rawReporter??new RK),Array.isArray(t.processors)&&this.registerProcessors(t.processors)}#e(){for(const t in this.types)this[t]=this.logger.bind(this,t,!1,!1);for(const t in this.types)this.force[t]=this.logger.bind(this,t,!1,!0)}wrapConsole(){for(const t in this.types)console[`__${t}`]||(console[`__${t}`]=console[t]),console[t]=this[t]}restoreConsole(){for(const t in this.types)console[`__${t}`]&&(console[t]=console[`__${t}`],delete console[`__${t}`])}wrapException(){process.on("uncaughtException",t=>{this.error(t)}),process.on("unhandledRejection",t=>{this.error(t)})}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}pause(){this.paused=!0}resume(){this.paused=!1;const t=this.messageQueue.splice(0);for(let r=0;r<t.length;r+=1){const{messageObject:n,raw:i,type:s}=t[r];this.logger(s,i,!1,...n)}}scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}unscope(){this.scopeName=[]}child(t){const r=t?.types!==void 0,n=r?bd(this.types,t.types):this.types,i=t?.reporters??[],s=i.length>0?[...this.reporters,...i]:[...this.reporters],o=t?.processors??[],a=o.length>0?[...this.processors,...o]:[...this.processors],l=t?.logLevels?{...this.logLevels,...t.logLevels}:this.logLevels;let c;if(t?.scope){const p=vd(t.scope).filter(Boolean);c=this.scopeName.length>0?[...this.scopeName,...p]:p}else c=this.scopeName.length>0?this.scopeName:[];const u=t?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...t.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},d={disabled:t?.disabled??this.disabled,logLevel:t?.logLevel??this.generalLogLevel,logLevels:l,messages:u,processors:a,rawReporter:t?.rawReporter??this.rawReporter,reporters:s,scope:c,throttle:t?.throttle??this.throttle,throttleMin:t?.throttleMin??this.throttleMin};return r?(d.parentTypes=n,d.parentLongestLabel=Ka(n)):(d.parentTypes=this.types,d.parentLongestLabel=this.longestLabel),t?.logLevels||(d.parentLogLevels=this.logLevels),t?.messages||(d.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),d.parentStringify=this.stringify,new oh(d)}time(t="default"){this.seqTimers.has(t)?this.logger("warn",!1,!1,{message:`Timer '${t}' already exists`,prefix:t}):(this.seqTimers.add(t),this.timersMap.set(t,Date.now()),this.logger("start",!1,!1,{message:this.startTimerMessage,prefix:t}))}timeLog(t,...r){if(!t&&this.seqTimers.size>0&&(t=[...this.seqTimers].pop()),t&&this.timersMap.has(t)){const n=Date.now()-this.timersMap.get(t);this.logger("info",!1,!1,{context:r,message:n<1e3?`${String(n)} ms`:`${(n/1e3).toFixed(2)} s`,prefix:t})}else this.logger("warn",!1,!1,{context:r,message:"Timer not found",prefix:t})}timeEnd(t){if(!t&&this.seqTimers.size>0&&(t=[...this.seqTimers].pop()),t&&this.timersMap.has(t)){const r=Date.now()-this.timersMap.get(t);this.timersMap.delete(t),this.logger("stop",!1,!1,{message:`${this.endTimerMessage} ${r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(2)} s`}`,prefix:t})}else this.logger("warn",!1,!1,{message:"Timer not found",prefix:t})}group(t="console.group"){globalThis.window===void 0?this.groups.push(t):console.group(t)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(t="default"){const r=this.countMap.get(t)??0;this.countMap.set(t,r+1),this.logger("log",!1,!1,{message:`${t}: ${String(r+1)}`,prefix:t})}countReset(t="default"){this.countMap.has(t)?this.countMap.delete(t):this.logger("warn",!1,!1,{message:`Count for ${t} does not exist`,prefix:t})}clear(){console.clear()}raw(t,...r){this.disabled||this.logger("log",!0,!1,{context:r,message:t})}extendReporter(t){return typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),t}registerReporters(t){for(let r=0;r<t.length;r+=1)this.reporters.add(this.extendReporter(t[r]))}registerProcessors(t){for(let r=0;r<t.length;r+=1){const n=t[r];typeof n.setStringify=="function"&&n.setStringify(this.stringify),this.processors.add(n)}}#r(t,r){if(r)this.rawReporter.log(Object.freeze(t));else for(const n of this.reporters)n.log(Object.freeze(t))}#t(t){return t&&this.logLevels[t]?t:"debug"}#s(t,r,...n){const i={badge:void 0,context:void 0,error:void 0,label:void 0,message:Wm,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(i.type={level:r.logLevel,name:t},i.groups=this.groups,i.scope=this.scopeName,i.date=new Date,n.length>0&&n[0]instanceof Error)i.error=n[0],n.length>1&&(i.context=n.slice(1));else if(n.length>0&&typeof n[0]=="object"&&n[0]!==null&&"message"in n[0]){const{context:s,message:o,prefix:a,suffix:l}=n[0];if(s&&(i.context=s),a&&(i.prefix=a),l&&(i.suffix=l),i.message=o,n.length>1){const c=n.slice(1);i.context?i.context=Array.isArray(i.context)?[...i.context,...c]:[i.context,...c]:i.context=c}}else n.length>1?(i.message=n[0],i.context=n.slice(1)):n.length===1?i.message=n[0]:i.message=void 0;return r.logLevel==="trace"&&(i.traceError=new Error("Trace")),r.badge&&(i.badge=r.badge),r.label&&(i.label=r.label),i}logger(t,r,n,...i){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:i,raw:r,type:t});return}const s=this.types[t],o=this.#t(s.logLevel);if(n||this.logLevels[o]>=this.logLevels[this.generalLogLevel]){let a=this.#s(t,s,...i);const l=$d((u=!1)=>{const d=(this.lastLog.count??0)-this.throttleMin;if(this.lastLog.object&&d>0){const p={...this.lastLog.object};d>1&&(p.repeated=d),this.#r(p,r),this.lastLog.count=1}if(u){for(const p of this.processors)a={...p.process(a)};this.lastLog.object=a,this.#r(a,r)}},"resolveLog");clearTimeout(this.lastLog.timeout);const c=this.lastLog.time&&a.date?new Date(a.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(a.date),c<this.throttle)try{if(this.lastLog.object&&JSON.stringify([a.label,a.scope,a.type,a.message,a.prefix,a.suffix,a.context])===JSON.stringify([this.lastLog.object.label,this.lastLog.object.scope,this.lastLog.object.type,this.lastLog.object.message,this.lastLog.object.prefix,this.lastLog.object.suffix,this.lastLog.object.context])&&(this.lastLog.count=(this.lastLog.count??0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(l,this.throttle);return}}catch{}l(!0)}}}var MK=Object.defineProperty,VK=ie((e,t)=>MK(e,"name",{value:t,configurable:!0}),"c$1");let WK=class{static{f(this,"Kt")}static{we(this,"Ht")}static{ie(this,"v")}static{VK(this,"RawReporter")}#e;#r;#t;#s=!1;#c;constructor(e={}){this.#e=Zm,this.#r=eh,this.#c=e}setStdout(e){this.#e=e}setStderr(e){this.#r=e}setInteractiveManager(e){this.#t=e}setIsInteractive(e){this.#s=e}log(e){const{context:t,groups:r,message:n,type:i}=e,s=[];if(n!==Wm){const c=typeof n=="string"?n:Xa(n,this.#c);s.push(c)}t&&s.push(...t.map(c=>typeof c=="object"?` ${Xa(c,this.#c)}`:` ${String(c)}`));const o=["error","trace","warn"].includes(i.level)?"stderr":"stdout",a=o==="stderr"?this.#r:this.#e,l=r.map(()=>" ").join("");this.#s&&this.#t!==void 0&&a.isTTY?this.#t.update(o,(l+s.join("")).split(`
|
|
1171
|
+
`),0):FS(l+s.join(""),a)}};var UK=Object.defineProperty,GK=ie((e,t)=>UK(e,"name",{value:t,configurable:!0}),"m$1");class ah extends oh{static{f(this,"Me")}static{we(this,"Le")}static{ie(this,"c")}constructor(t){const r=t.parentStderr,n=t.parentStdout,{interactive:i,processors:s,rawReporter:o,reporters:a,stderr:l,stdout:c}=t,u=r??l,d=n??c,p=t.parentLongestLabel,m=t.parentTypes,{parentLogLevels:g,parentMessages:$,parentStringify:S}=t,k={disabled:t.disabled,logLevel:t.logLevel,logLevels:t.logLevels,messages:t.messages,processors:[],rawReporter:t.rawReporter,reporters:[],scope:t.scope,throttle:t.throttle,throttleMin:t.throttleMin},v="types"in t;m&&p&&!v?(k.parentTypes=m,k.parentLongestLabel=p):v&&t.types!==void 0&&(k.types=t.types),S&&(k.parentStringify=S),g&&!t.logLevels&&(k.parentLogLevels=g),$&&!t.messages&&(k.parentMessages=$),super(k),this.options=t,this.interactive=i??!1,this.stdout=d,this.stderr=u,this.interactive&&(this.interactiveManager=new bG(new xv(this.stdout),new xv(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(o??new WK),Array.isArray(s)&&this.registerProcessors(s)}options;static{GK(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}child(t){const r=t?.types!==void 0,n=r?bd(this.types,t.types):this.types,i=t?.reporters??[],s=i.length>0?[...this.reporters,...i]:[...this.reporters],o=t?.processors??[],a=o.length>0?[...this.processors,...o]:[...this.processors],l=t?.logLevels?{...this.logLevels,...t.logLevels}:this.logLevels;let c;if(t?.scope){const p=vd(t.scope).filter(Boolean);c=this.scopeName.length>0?[...this.scopeName,...p]:p}else c=this.scopeName.length>0?this.scopeName:[];const u=t?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...t.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},d={disabled:t?.disabled??this.disabled,interactive:t?.interactive??this.interactive,logLevel:t?.logLevel??this.generalLogLevel,logLevels:l,messages:u,processors:a,rawReporter:t?.rawReporter??this.rawReporter,reporters:s,scope:c,stderr:t?.stderr??this.stderr,stdout:t?.stdout??this.stdout,throttle:t?.throttle??this.throttle,throttleMin:t?.throttleMin??this.throttleMin};return this.#e(d,t,r,n),new ah(d)}#e(t,r,n,i){n?(t.parentTypes=i,t.parentLongestLabel=Ka(i)):(t.parentTypes=this.types,t.parentLongestLabel=this.longestLabel),r?.logLevels||(t.parentLogLevels=this.logLevels),r?.messages||(t.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),t.parentStringify=this.stringify,r?.stdout||(t.parentStdout=this.stdout),r?.stderr||(t.parentStderr=this.stderr)}getInteractiveManager(){return this.interactiveManager}wrapStd(){this.#r(this.stdout,"log"),this.#r(this.stderr,"log")}restoreStd(){this.#t(this.stdout),this.#t(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(Jv),this.stderr.write(Jv)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}#r(t,r){t&&(t.__write||(t.__write=t.write),t.write=n=>{this[r](String(n).trim())})}#t(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}}const qK=ah;var zK=Object.defineProperty,HK=ie((e,t)=>zK(e,"name",{value:t,configurable:!0}),"x"),JK=Object.defineProperty,pE=HK((e,t)=>JK(e,"name",{value:t,configurable:!0}),"h"),KK=Object.defineProperty,Go=pE((e,t)=>KK(e,"name",{value:t,configurable:!0}),"g$1");const Yv=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]]),YK=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,XK=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,QK=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,ZK=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,dE=Go(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),Xv=/\s+/,Za=Go(e=>{Yv.has(e)&&(e=Yv.get(e));const t=YK.exec(e);if(t)return[Number.parseInt(t[1],16),Number.parseInt(t[2],16),Number.parseInt(t[3],16)];const r=XK.exec(e);if(r)return[Number.parseInt(`${r[1]}${r[1]}`,16),Number.parseInt(`${r[2]}${r[2]}`,16),Number.parseInt(`${r[3]}${r[3]}`,16)];const n=QK.exec(e);if(n)return[Math.round(Math.max(0,Math.min(255,Number(n[1])))),Math.round(Math.max(0,Math.min(255,Number(n[2])))),Math.round(Math.max(0,Math.min(255,Number(n[3]))))];const i=ZK.exec(e);if(i){let s=Number(i[1])%360;s<0&&(s+=360);const o=Math.max(0,Math.min(100,Number(i[2])))/100,a=Math.max(0,Math.min(100,Number(i[3])))/100,l=(1-Math.abs(2*a-1))*o,c=l*(1-Math.abs(s/60%2-1)),u=a-l/2;let d,p,m;return s<60?{0:d,1:p,2:m}=[l,c,0]:s<120?{0:d,1:p,2:m}=[c,l,0]:s<180?{0:d,1:p,2:m}=[0,l,c]:s<240?{0:d,1:p,2:m}=[0,c,l]:s<300?{0:d,1:p,2:m}=[c,0,l]:{0:d,1:p,2:m}=[l,0,c],[Math.round((d+u)*255),Math.round((p+u)*255),Math.round((m+u)*255)]}return null},"parseCssColor"),$p=Go((e,t)=>e?.[0]===t?.[0]&&e?.[1]===t?.[1]&&e?.[2]===t?.[2],"colorEquals"),eY=Go(e=>{const t=dE(),r=[];let n=!1,i=null,s=0,o="";for(const a of e){if(a==="(")s+=1;else if(s>0)a===")"&&(s-=1);else if(n){if(a===";"){const l=o.trim();l!==""&&r.push([i,l]),i=null,o="",n=!1;continue}}else if(a===":"){i=o.trim(),o="",n=!0;continue}o+=a}if(n&&s===0){const a=o.trim();a!==""&&r.push([i,a]),i=null,o=""}for(const{0:a,1:l}of r)switch(a){case"background-color":{l!=null&&(t.backgroundColor=l);break}case"color":{l!=null&&(t.color=l);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(l)&&(t.fontStyle="italic");break}case"font-weight":{l==="bold"&&(t.fontWeight=l);break}case"text-decoration":{t.textDecorationColor=null,t.textDecorationLine=[];const c=l.split(Xv);for(const u of c){const d=Za(u);d!=null?t.textDecorationColor=d:["line-through","overline","underline"].includes(u)&&t.textDecorationLine.push(u)}break}case"text-decoration-color":{const c=Za(l);c!=null&&(t.textDecorationColor=c);break}case"text-decoration-line":{t.textDecorationLine=[];const c=l.split(Xv);for(const u of c)["line-through","overline","underline"].includes(u)&&t.textDecorationLine.push(u);break}}return t},"parseCss"),tY=Go((e,t)=>{t=t??dE();let r="";if(!$p(e.backgroundColor,t.backgroundColor))if(e.backgroundColor==null)r+="\x1B[49m";else switch(e.backgroundColor){case"black":{r+="\x1B[40m";break}case"blue":{r+="\x1B[44m";break}case"cyan":{r+="\x1B[46m";break}case"green":{r+="\x1B[42m";break}case"magenta":{r+="\x1B[45m";break}case"red":{r+="\x1B[41m";break}case"white":{r+="\x1B[47m";break}case"yellow":{r+="\x1B[43m";break}default:if(Array.isArray(e.backgroundColor)){const{0:n,1:i,2:s}=e.backgroundColor;r+=`\x1B[48;2;${String(n)};${String(i)};${String(s)}m`}else{const n=Za(e.backgroundColor);if(n===null)r+="\x1B[49m";else{const{0:i,1:s,2:o}=n;r+=`\x1B[48;2;${String(i)};${String(s)};${String(o)}m`}}}if(!$p(e.color,t.color))if(e.color==null)r+="\x1B[39m";else switch(e.color){case"black":{r+="\x1B[30m";break}case"blue":{r+="\x1B[34m";break}case"cyan":{r+="\x1B[36m";break}case"green":{r+="\x1B[32m";break}case"magenta":{r+="\x1B[35m";break}case"red":{r+="\x1B[31m";break}case"white":{r+="\x1B[37m";break}case"yellow":{r+="\x1B[33m";break}default:if(Array.isArray(e.color)){const{0:n,1:i,2:s}=e.color;r+=`\x1B[38;2;${String(n)};${String(i)};${String(s)}m`}else{const n=Za(e.color);if(n===null)r+="\x1B[39m";else{const{0:i,1:s,2:o}=n;r+=`\x1B[38;2;${String(i)};${String(s)};${String(o)}m`}}}if(e.fontWeight!==t.fontWeight&&(r+=e.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),e.fontStyle!==t.fontStyle&&(r+=e.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!$p(e.textDecorationColor,t.textDecorationColor))if(e.textDecorationColor==null)r+="\x1B[59m";else{const{0:n,1:i,2:s}=e.textDecorationColor;r+=`\x1B[58;2;${String(n)};${String(i)};${String(s)}m`}return e.textDecorationLine.includes("line-through")!==t.textDecorationLine.includes("line-through")&&(r+=e.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),e.textDecorationLine.includes("overline")!==t.textDecorationLine.includes("overline")&&(r+=e.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),e.textDecorationLine.includes("underline")!==t.textDecorationLine.includes("underline")&&(r+=e.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var rY=Object.defineProperty,ch=pE((e,t)=>rY(e,"name",{value:t,configurable:!0}),"y");const nY=ch(e=>{try{return JSON.stringify(e)}catch{return'"[Circular]"'}},"tryStringify"),Qv="%".codePointAt(0),iY="s".codePointAt(0),sY="d".codePointAt(0),oY="f".codePointAt(0),aY="i".codePointAt(0),cY="O".codePointAt(0),lY="o".codePointAt(0),uY="j".codePointAt(0),pY="c".codePointAt(0),dY=ch((e,t=[],r={})=>{if(typeof e!="string"&&typeof e!="object"||e===null)throw new TypeError(`fmt must be a string or object, got ${e===null?"null":typeof e}`);const n=r.stringify??nY,i=1;if(typeof e=="object"){const u=t.length+i;if(u===1)return"{}";const d=Array.from({length:u});d[0]=n(e);for(let p=1;p<u;p+=1)d[p]=n(t[p-i]);return d.join(" ")}if(t.length===0)return e;let s="",o=1-i,a=-1,l=!1,c;for(let u=0;u<e.length;){if(e.codePointAt(u)===Qv&&u+1<e.length){a=a>-1?a:0;const d=e.codePointAt(u+1);if(d===void 0){o+=1;break}switch(d){case pY:{if(globalThis.window===void 0){const p=eY(t[o]);a<u&&(s+=e.slice(a,u)),s+=tY(p,c),s!==""&&(l=!0,c=p)}a=u+2,u+=1;break}case sY:case oY:{if(o>=t.length||t[o]==null)break;a<u&&(s+=e.slice(a,u)),s+=Number(t[o]).toString(),a=u+2,u+=1;break}case aY:{if(o>=t.length||t[o]==null)break;a<u&&(s+=e.slice(a,u)),s+=Math.floor(Number(t[o])).toString(),a=u+2,u+=1;break}case uY:case cY:case lY:{if(o>=t.length||t[o]===void 0)break;a<u&&(s+=e.slice(a,u));const p=t[o],m=typeof p;if(m==="string"){s+=`'${p}'`,a=u+2;break}if(m==="function"){s+=p.name?`[Function: ${p.name}]`:"[Function: <anonymous>]",a=u+2;break}s+=n(p),a=u+2,u+=1;break}case Qv:{a<u&&(s+=e.slice(a,u)),s+="%",a=u+2,u+=1,o-=1;break}case iY:{if(o>=t.length)break;a<u&&(s+=e.slice(a,u)),s+=typeof t[o]=="object"?n(t[o]):String(t[o]),a=u+2,u+=1;break}default:typeof r.formatters?.[d]=="function"&&(a<u&&(s+=e.slice(a,u)),s+=r.formatters[d](t[o]),a=u+2,u+=1)}o+=1}u+=1}return a===-1?e:(a<e.length&&(s+=e.slice(a)),l&&(s+="\x1B[0m"),s)},"format"),fY=ch((e={})=>{const t={};return typeof e.formatters=="object"&&Object.entries(e.formatters).forEach(([r,n])=>{if(r.length===0)throw new Error(`Formatter %${r} has no characters`);if(r.length>1)throw new Error(`Formatter %${r} has more than one character`);if(typeof n!="function")throw new TypeError(`Formatter for %${r} is not a function`);const i=r.codePointAt(0);if(i===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);t[i]=n}),(r,n=[],i={})=>dY(r,n,{...i,formatters:t})},"build");var mY=Object.defineProperty,Zv=ie((e,t)=>mY(e,"name",{value:t,configurable:!0}),"i$1");let hY=class{static{f(this,"xr")}static{we(this,"$r")}static{ie(this,"g")}static{Zv(this,"MessageFormatterProcessor")}#e;#r;constructor(e={}){this.#r=e.formatters}setStringify(e){this.#e=e}process(e){const t=fY({formatters:this.#r,stringify:Zv(r=>this.#e?this.#e(r):JSON.stringify(r),"stringify")});return e.message!==void 0&&(e.message=this.#t(t,e.message,e.context??[])),e}#t(e,t,r=[]){if(typeof t=="string")return e(t,r);if(typeof t=="object"&&t!==null){const n=t,i=Object.keys(n);for(let s=0;s<i.length;s+=1){const o=i[s],a=n[o];(typeof a=="string"||Array.isArray(a)||typeof a=="object")&&(n[o]=this.#t(e,a,r))}}return t}};var gY=Object.defineProperty,fE=ie((e,t)=>gY(e,"name",{value:t,configurable:!0}),"M");const{bgGrey:yY,cyan:vY,green:bY,greenBright:$Y,grey:qt,red:wp,underline:eb,white:wY}=Ut,kY=/[\\/]pail[\\/]dist/,kp=fE(e=>!kY.test(e),"pailFileFilter");class SY extends ZJ{static{f(this,"Br")}static{we(this,"Mr")}static{ie(this,"PrettyReporter")}static{fE(this,"PrettyReporter")}#e;#r;#t;#s=!1;#c;#m;constructor(t={}){const{error:r,inspect:n,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#c={...qJ,...n},this.#m={...r,color:{fileLine:bY,hint:vY,marker:wp,message:wp,method:$Y,title:wp}},this.#e=Zm,this.#r=eh}setStdout(t){this.#e=t}setStderr(t){this.#r=t}setInteractiveManager(t){this.#t=t}setIsInteractive(t){this.#s=t}log(t){this._log(this._formatMessage(t),t.type.level)}_formatMessage(t){const{columns:r}=$l();let n=r;typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:i,context:s,date:o,error:a,file:l,groups:c,label:u,message:d,prefix:p,repeated:m,scope:g,suffix:$,traceError:S,type:k}=t,{color:v}=this.loggerTypes[k.name],h=v?Ut[v]:wY,b=c.map(()=>" ").join(""),w=[];if(c.length>0&&w.push(`${b+qt(`[${c.at(-1)??""}]`)} `),o&&w.push(`${qt(this.styles.dateFormatter(typeof o=="string"?new Date(o):o))} `),i)w.push(h(i));else{const E=TJ(this.loggerTypes);E.length>0&&w.push(`${qt(".".repeat(E.length))} `)}const y=Ka(this.loggerTypes);if(u){const E=Tt(y),A=Tt(u);w.push(`${h(YJ(u,this.styles))} `,qt(".".repeat(Math.max(0,E-A))))}else w.push(qt(".".repeat(y.length+2)));m&&w.push(`${yY.white(`[${String(m)}x]`)} `),Array.isArray(g)&&g.length>0&&w.push(` ${qt(`[${g.join(" > ")}]`)} `),p&&w.push(`${qt(`${Array.isArray(g)&&g.length>0?". ":" "}[${this.styles.underline.prefix?eb(p):p}]`)} `);const D=Tt(w.join(" "));if(l){const E=(l.name??"")+(l.line?`:${String(l.line)}`:""),A=Tt(E);if(A+D+2>n)w.push(qt(` ${E}`));else{const j=Math.max(0,n-D-A-2);w.push(qt(`${".".repeat(j)} ${E}`))}}else w.push(qt(".".repeat(Math.max(0,n-D-1))));if(w.length>0&&w.push(`
|
|
1172
|
+
|
|
1173
|
+
`),d!==Wm){const E=typeof d=="string"?d:Xa(d,this.#c);w.push(b+PJ(E,{trim:!1,width:n-3,wrapMode:Hs.STRICT_WIDTH}))}if(s){let E=!1;w.push(...s.map(A=>{if(A instanceof Error)return E=!0,`
|
|
1174
|
+
|
|
1175
|
+
${hp(A,{...this.#m,filterStacktrace:kp,prefix:b})}`;if(typeof A=="object")return` ${Xa(A,this.#c)}`;const j=(E?`
|
|
1176
|
+
|
|
1177
|
+
`:" ")+String(A);return E=!1,j}))}return a&&w.push(hp(a,{...this.#m,filterStacktrace:kp,prefix:b})),S&&w.push(`
|
|
1178
|
+
|
|
1179
|
+
${hp(S,{...this.#m,filterStacktrace:kp,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:b})}`),$&&w.push(`
|
|
1180
|
+
`,b+qt(this.styles.underline.suffix?eb($):$)),w.join("")}_log(t,r){const n=["error","trace","warn"].includes(r)?"stderr":"stdout",i=n==="stderr"?this.#r:this.#e;this.#s&&this.#t!==void 0&&i.isTTY?this.#t.update(n,t.split(`
|
|
1181
|
+
`),0):FS(`${t}
|
|
1182
|
+
`,i)}}var EY=Object.defineProperty,mE=ie((e,t)=>EY(e,"name",{value:t,configurable:!0}),"o");const DY=mE(()=>eo.NODE_ENV==="debug"||eo.DEBUG!==void 0?"debug":eo.NODE_ENV==="test"?"warning":"informational","getDefaultLogLevel"),hE=mE(e=>{let t=DY();return eo.PAIL_LOG_LEVEL!==void 0&&(t=eo.PAIL_LOG_LEVEL),new qK({logLevel:t,processors:[new hY],reporters:[new SY],stderr:eh,stdout:Zm,...e})},"createPail");hE();const ee=hE();var CY=Object.defineProperty,Dt=f((e,t)=>CY(e,"name",{value:t,configurable:!0}),"n$4");const li=Dt((e,t,r,n)=>{for(const i of t)e.push("--filter",i);r&&e.push("--recursive"),n&&e.push("--workspace-root")},"pushFilterGlobals"),AY=Dt(e=>{const t=[],r=[];return li(t,e.filter,e.recursive,e.workspaceRoot),e.silent&&t.push("--silent"),e.frozenLockfile&&t.push("--frozen-lockfile"),t.push("install"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.force&&t.push("--force"),e.ignoreScripts&&t.push("--ignore-scripts"),e.lockfileOnly&&t.push("--lockfile-only"),e.noOptional&&t.push("--no-optional"),e.offline&&t.push("--offline"),{args:t,bin:"aube",warnings:r}},"resolveAubeInstall"),OY=Dt(e=>{const t=[],r=[];return li(t,e.filter,!1,!1),t.push("add"),e.saveDev&&t.push("--save-dev"),e.exact&&t.push("--save-exact"),e.global&&t.push("--global"),e.optional&&t.push("--save-optional"),e.peer&&t.push("--save-peer"),e.workspace&&r.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&t.push("--workspace"),t.push(...e.packages),{args:t,bin:"aube",warnings:r}},"resolveAubeAdd"),jY=Dt(e=>{const t=[];return li(t,e.filter,e.recursive,!1),t.push("remove"),e.saveDev&&t.push("--save-dev"),e.global&&t.push("--global"),e.workspaceRoot&&t.push("--workspace"),t.push(...e.packages),{args:t,bin:"aube",warnings:[]}},"resolveAubeRemove"),xY=Dt(e=>{const t=["dedupe"];return e&&t.push("--check"),{args:t,bin:"aube",warnings:[]}},"resolveAubeDedupe"),PY=Dt(e=>{const t=[],r=[];li(t,e.filter,e.recursive,!1),t.push("why"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.json&&t.push("--json"),e.long&&t.push("--long"),e.parseable&&t.push("--parseable"),e.depth!==void 0&&r.push("aube why does not accept --depth; ignoring."),e.noOptional&&r.push("aube why does not accept --no-optional; ignoring."),e.global&&r.push("aube why does not accept --global; ignoring.");const[n,...i]=e.packages;return n===void 0?r.push("aube why requires a package name; none provided."):(i.length>0&&r.push("aube why takes a single package; using the first."),t.push(n)),{args:t,bin:"aube",warnings:r}},"resolveAubeWhy"),NY=Dt(e=>{const t=[],r=[];e.workspaceRoot&&r.push("aube outdated has no `--include-workspace-root` equivalent. Run `vis outdated` separately at the workspace root if you need its outdated list."),li(t,e.filter,e.recursive,!1),t.push("outdated"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.long&&t.push("--long"),e.format==="json"?t.push("--json"):e.format&&e.format!=="table"&&r.push(`aube outdated does not support format "${e.format}"; falling back to default table output.`),e.compatible&&r.push("aube outdated does not accept --compatible; ignoring."),e.noOptional&&r.push("aube outdated does not accept --no-optional; ignoring."),e.global&&r.push("aube outdated does not accept --global; ignoring.");const[n,...i]=e.packages;return n!==void 0&&(i.length>0&&r.push("aube outdated takes a single pattern argument; using the first."),t.push(n)),{args:t,bin:"aube",warnings:r}},"resolveAubeOutdated"),RY=Dt(e=>{const t=[];e.silent&&t.push("--silent"),t.push("dlx");for(const r of e.additionalPackages)t.push("--package",r);return e.shellMode&&t.push("--shell-mode"),t.push(e.package),t.push(...e.args),{args:t,bin:"aube",warnings:[]}},"resolveAubeDlx"),FY=Dt(e=>{const t=[];return li(t,e.filter,e.recursive,e.workspaceRoot),t.push("exec"),e.parallel&&t.push("--parallel"),e.reverse&&t.push("--reverse"),e.shellMode&&t.push("--shell-mode"),t.push(e.command),t.push(...e.args),{args:t,bin:"aube",warnings:[]}},"resolveAubeExec"),LY=Dt(e=>{const t=["link"];return e!==null&&t.push(e),{args:t,bin:"aube",warnings:[]}},"resolveAubeLink"),IY=Dt((e,t)=>{const r=[],n=[];return t&&r.push("--recursive"),r.push("unlink"),e.length>1&&n.push("aube unlink takes a single package; using the first."),e.length>0&&r.push(e[0]),{args:r,bin:"aube",warnings:n}},"resolveAubeUnlink"),TY=Dt(e=>{const t=["view","--",e.package],r=[],[n,...i]=e.fields;return n!==void 0?(i.length>0&&r.push("aube view only supports a single field; using the first."),e.json&&r.push("aube view does not support --json with a field selector; printing the field without --json."),t.push(n)):e.json&&t.push("--json"),{args:t,bin:"aube",warnings:r}},"resolveAubeInfo"),eee=Dt(e=>{const t=[],r=[];return li(t,e.filters,e.recursive,e.workspaceRoot),t.push("update"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.global&&t.push("--global"),e.interactive&&t.push("--interactive"),e.latest&&t.push("--latest"),e.noOptional&&t.push("--no-optional"),e.noSave&&t.push("--no-save"),t.push(...e.packages),{args:t,bin:"aube",warnings:r}},"resolveAubeUpdate"),BY=new Set(["fund","ping","search","token"]),_Y=Dt((e,t)=>BY.has(e)?{args:[e,...t],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...t],bin:"aube",warnings:[]},"resolveAubePmCommand");var MY=Object.defineProperty,qo=f((e,t)=>MY(e,"name",{value:t,configurable:!0}),"a$5");const Fs=qo(e=>{const t=Qt.coerce(e);return t?Qt.gte(t,"11.0.0"):!1},"isPnpm11Plus"),Cr=qo(e=>e.name==="yarn"&&!e.version.startsWith("1."),"isYarnBerry"),Sp=qo(e=>e.name==="yarn"&&e.version.startsWith("1."),"isYarn1"),VY=qo(e=>e[0]==="rm"?["remove",...e.slice(1)]:e,"rewriteRmToRemove"),WY=qo((e,t,r)=>{switch(t){case"audit":return Cr(e)?{args:["npm","audit",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(Cr(e)){const[n,...i]=r;return n==="delete"?{args:["config","unset",...i],bin:"yarn",kind:"rewrite",warning:"yarn berry uses `config unset`, not `config delete`."}:{kind:"passthrough"}}return e.name==="bun"?{kind:"skip",warning:"bun has no `config` CLI. Edit bunfig.toml or .npmrc directly."}:e.name==="deno"?{kind:"skip",warning:"deno has no registry-config CLI. Edit deno.json directly."}:{kind:"passthrough"}}case"dist-tag":return Sp(e)?{args:["tag",...r],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:Cr(e)?{args:["npm","tag",...VY(r)],bin:"yarn",kind:"rewrite"}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`dist-tag\`. Use \`npm dist-tag\` instead.`}:{kind:"passthrough"};case"login":case"logout":return Cr(e)?{args:["npm",t,...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[t,...r],bin:"npm",kind:"rewrite",warning:`bun has no \`${t}\`; falling back to \`npm ${t}\` (writes ~/.npmrc, which bun reads).`}:e.name==="deno"?{kind:"skip",warning:`deno has no \`${t}\`. JSR uses browser OAuth via \`deno publish\`.`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&Fs(e.version)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:Cr(e)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"bun has no `owner`; falling back to `npm owner`."}:e.name==="deno"?{kind:"skip",warning:"deno has no `owner`. JSR uses scope-member roles via the web UI."}:{kind:"passthrough"};case"ping":return e.name==="pnpm"&&Fs(e.version)?{args:["ping",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"plugin":return Cr(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return Sp(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:Cr(e)?{kind:"skip",warning:"yarn berry has no `prune`. Use `yarn workspaces focus --production` instead."}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`prune\`. Pruning happens automatically on install.`}:{kind:"passthrough"};case"publish":return Cr(e)?{args:["npm","publish",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return Sp(e)?{kind:"skip",warning:"yarn 1 has no `rebuild`. Re-install instead."}:e.name==="bun"?{kind:"skip",warning:"bun has no `rebuild`. Use `bun install --force` instead."}:e.name==="deno"?{kind:"skip",warning:"deno has no `rebuild`."}:{kind:"passthrough"};case"search":return e.name==="pnpm"&&Fs(e.version)?{args:["search",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&Fs(e.version)?{args:["token",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&Fs(e.version)?{args:["whoami",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:Cr(e)?{args:["npm","whoami",...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...r],bin:"bun",kind:"rewrite"}:e.name==="deno"?{kind:"skip",warning:"deno has no `whoami`. JSR uses browser auth."}:{kind:"passthrough"};default:return{kind:"passthrough"}}},"dispatchSubcommand");var UY=Object.defineProperty,fe=f((e,t)=>UY(e,"name",{value:t,configurable:!0}),"i$1");const wd=fe(e=>lD(e)!==null,"hasBinaryOnPath"),GY=fe(e=>{const t=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["bun.lock","bun"],["bun.lockb","bun"],["deno.lock","deno"]];let r=e;for(;;){for(const[i,s]of t)if(x(C(r,i)))return s;const n=Ge(r);if(n===r||mo(r).root===r)return;r=n}},"findNonAubeLockfile"),tee=fe((e,t)=>{if(t.name!=="aube")return;const r=GY(e);if(r!==void 0)return`Resolved installer is aube but the workspace has a ${r} lockfile. Aube reads and writes ${r}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},"detectLockfileDrift"),lh=fe(e=>{if(x(e))try{return JSON.parse(J(e,{buffer:!1}))}catch{return}},"readJson"),qY=fe(e=>{let t=e;for(;;){const r=C(t,"package.json"),n=lh(r);if(n&&typeof n.packageManager=="string"&&n.packageManager.length>0)return n.packageManager;const i=Ge(t);if(i===t||mo(t).root===t)return;t=i}},"readPackageManagerField"),gE=new Set(["npm","pnpm","yarn"]),tb=fe((e,t,r)=>r===!1||!gE.has(t)||!wd("corepack")?!1:r===!0?!0:qY(e)!==void 0,"shouldUseCorepack"),ree=fe((e,t)=>{const r=t.backend,n=process.env.VIS_INSTALLER,i=r??n??t.configBackend,s=t.configCorepack??"auto";if(i&&i!=="auto"){if(i==="aube"&&!wd("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:i,useCorepack:tb(e,i,s),version:"latest"}}if(wd("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const o=kd(e);return{...o,useCorepack:tb(e,o.name,s)}},"resolveInstaller"),kd=fe(e=>{if(!x(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const t=bD(e);return{name:t.name,version:t.version||"latest"}},"detectPm"),zY=fe((e,t)=>t.useCorepack!==!0||!gE.has(t.name)||e.bin==="corepack"||e.bin!==t.name?e:{...e,args:[t.name,...e.args],bin:"corepack"},"applyCorepack"),HY=fe((e,t,r)=>{if(r===void 0)return uD(e.bin,e.args,t);const n=An(e.bin,e.args,{cwd:t,env:{...process.env,...r},stdio:"inherit"});if(n.error)throw n.error;return n.status??1},"spawnResolved"),wt=fe((e,t,r,n,i={})=>{const s=zY(t,e);for(const o of s.warnings)n.warn(`warning: ${o}`);return i.dry?(n.log(`[dry-run] ${s.bin} ${s.args.join(" ")}`),0):HY(s,r,i.env)},"runResolved"),ui=fe((e,t,r,n,i={})=>wt(e,t(),r,n,i),"resolveAndRun"),JY=fe((e,t)=>t==="aube"||t==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},"applyPreferOffline"),KY=fe((e,t,r)=>t!=="yarn"||r.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},"applyImmutableCache"),nee=fe((e,t,r,n,i={})=>{let s=e.name==="aube"?AY(t):aD(e.name,e.version,{...t,silent:t.silent||i.silent===!0});return i.preferOffline&&(s=JY(s,e.name)),i.ciMode&&(s=KY(s,e.name,e.version)),uh(e,s,r,n,{dry:i.dry,env:i.env})},"runInstall"),yE=fe((e,t)=>{const r=t==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,r]}},"applySilent"),YY=fe((e,t)=>t==="yarn"||t==="aube"?null:{...e,args:[...e.args,"--dry-run"]},"applyDryRun"),uh=fe((e,t,r,n,i)=>{if(i.dry!==!0)return wt(e,t,r,n,i);const s=YY(t,e.name);return s===null?wt(e,t,r,n,i):wt(e,s,r,n,{env:i.env})},"runWithNativeDryRun"),XY=fe((e,t)=>t==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:t==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},"applyIgnoreScripts"),QY=fe((e,t,r,n,i={})=>{let s=e.name==="aube"?OY(t):cD(e.name,e.version,t);i.ignoreScripts&&(s=XY(s,e.name)),i.silent&&(s=yE(s,e.name));const o=uh(e,s,r,n,{dry:i.dry,env:i.env});return o===0&&i.autoInstallPeers&&rX(e,t,r,n,i),o},"runAdd"),ZY=fe(e=>{if(e.startsWith("@")){const r=e.indexOf("/");if(r===-1)return e;const n=e.indexOf("@",r);return n===-1?e:e.slice(0,n)}const t=e.indexOf("@");return t===-1?e:e.slice(0,t)},"stripVersionRange"),eX=fe((e,t)=>{let r=e;for(;;){const n=C(r,"node_modules",t,"package.json"),i=lh(n);if(i)return i;const s=Ge(r);if(s===r||mo(r).root===r)return;r=s}},"findInstalledManifest"),tX=fe(e=>{const t=lh(C(e,"package.json")),r=new Set;if(!t)return r;for(const n of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const i=t[n];if(i)for(const s of Object.keys(i))r.add(s)}return r},"collectExistingDeps"),rX=fe((e,t,r,n,i)=>{if(e.name==="deno")return;const s=tX(r),o=new Map;for(const c of t.packages){const u=ZY(c),d=eX(r,u);if(!d?.peerDependencies)continue;const p=d.peerDependenciesMeta??{};for(const[m,g]of Object.entries(d.peerDependencies))p[m]?.optional||s.has(m)||o.has(m)||o.set(m,g)}if(o.size===0)return;const a=[...o.entries()].map(([c,u])=>`${c}@${u}`);n.log(`auto-installing peer dependencies: ${a.join(", ")}`);const l={exact:!1,filter:t.filter,global:!1,optional:!1,packages:a,peer:!1,saveDev:t.saveDev,workspace:!1,workspaceRoot:t.workspaceRoot};QY(e,l,r,n,{ignoreScripts:i.ignoreScripts})},"installMissingPeers"),iee=fe((e,t,r,n,i={})=>{let s=e.name==="aube"?jY(t):gD(e.name,e.version,t);return i.silent&&(s=yE(s,e.name)),uh(e,s,r,n,{dry:i.dry,env:i.env})},"runRemove"),see=fe((e,t,r,n,i={})=>e.name==="aube"?wt(e,xY(t),r,n,i):ui(e,()=>pD(e.name,e.version,t),r,n,i),"runDedupe"),oee=fe((e,t,r,n,i={})=>e.name==="aube"?wt(e,PY(t),r,n,i):ui(e,()=>vD(e.name,e.version,t),r,n,i),"runWhy");fe((e,t,r,n,i={})=>e.name==="aube"?wt(e,NY(t),r,n,i):ui(e,()=>$D(e.name,e.version,t),r,n,i),"runOutdated");const nX=fe((e,t)=>{if(e.name==="aube")return TY(t);const r=[],n=[],i=e.name;switch(e.name){case"bun":{const s=Qt.coerce(e.version);s&&Qt.lt(s,"1.3.0")&&n.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${t.package}\` instead.`),r.push("pm","view","--",t.package,...t.fields),t.json&&r.push("--json");break}case"deno":{const s=t.package.startsWith("npm:")||t.package.startsWith("jsr:")||t.package.startsWith("https://")||t.package.startsWith("http://")||t.package.startsWith("file:")?t.package:`npm:${t.package}`;r.push("info","--",s),t.json&&r.push("--json"),t.fields.length>0&&n.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{r.push("view","--",t.package,...t.fields),t.json&&r.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){r.push("info","--",t.package);const[s,...o]=t.fields;s!==void 0&&(o.length>0&&n.push("yarn v1 only supports querying one field at a time; using the first."),r.push(s)),t.json&&r.push("--json")}else r.push("npm","info","--",t.package),t.fields.length>0&&n.push("yarn berry does not support field arguments to 'npm info'; ignoring."),t.json&&r.push("--json");break}default:{const s=e.name;throw new Error(`Unsupported package manager: ${s}`)}}return{args:r,bin:i,warnings:n}},"resolveInfo"),aee=fe((e,t,r,n,i={})=>wt(e,nX(e,t),r,n,i),"runInfo"),cee=fe((e,t,r,n,i={})=>e.name==="aube"?wt(e,LY(t),r,n,i):ui(e,()=>mD(e.name,e.version,t),r,n,i),"runLink"),lee=fe((e,t,r,n,i,s={})=>e.name==="aube"?wt(e,IY(t,r),n,i,s):ui(e,()=>yD(e.name,e.version,t,r),n,i,s),"runUnlink"),iX=fe((e,t,r)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const n=fe((i,s)=>{const o=[...e.args];return o.splice(s,0,i),{...e,args:o}},"insertAt");switch(t){case"aube":case"pnpm":return n("--offline",1);case"bun":return{...e,warnings:[...e.warnings,"bun x does not support --offline. Pre-install the package via `vis install` so bun x resolves from the local cache."]};case"deno":return n("--cached-only",1);case"npm":return n("--offline",1);case"yarn":return r.startsWith("1.")?n("--offline",0):{...e,warnings:[...e.warnings,"yarn berry has no --offline flag for dlx. Configure `enableNetwork: false` in .yarnrc.yml or set `enableMirror: true` for offline-first behavior."]};default:{const i=t;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(i)}`]}}}},"applyDlxOffline"),uee=fe((e,t,r,n,i={})=>{let s=e.name==="aube"?RY(t):dD(e.name,e.version,t);return i.offline&&(s=iX(s,e.name,e.version)),wt(e,s,r,n,{dry:i.dry,env:i.env})},"runDlx"),pee=fe((e,t,r,n,i={})=>e.name==="aube"?wt(e,FY(t),r,n,i):ui(e,()=>fD(e.name,e.version,t),r,n,i),"runExec"),dee=fe((e,t,r,n,i,s={})=>{if(e.name==="aube")return wt(e,_Y(t,r),n,i,s);const o=WY(e,t,r);return o.kind==="skip"?(i.warn(`warning: ${o.warning}`),0):o.kind==="rewrite"?wt(e,{args:o.args,bin:o.bin,warnings:o.warning?[o.warning]:[]},n,i,s):ui(e,()=>hD(e.name,e.version,t,r),n,i,s)},"runPmSubcommand");var sX=Object.defineProperty,ph=f((e,t)=>sX(e,"name",{value:t,configurable:!0}),"s$2");const oX=ph(e=>`MARSHALL_DISABLE_${e.replaceAll(/([A-Z])/g,"_$1").toUpperCase()}`,"envVarFor"),rb=ph(e=>{if(e===void 0||e==="")return!1;const t=e.toLowerCase();return t!=="0"&&t!=="false"&&t!=="no"},"isTruthyEnv"),nb=ph((e,t=process.env)=>rb(t.MARSHALL_DISABLE_ALL)?!0:rb(t[oX(e)]),"isMarshallDisabled");var aX=Object.defineProperty,Sl=f((e,t)=>aX(e,"name",{value:t,configurable:!0}),"p$5");const vE=Sl((e,t)=>{const r={errors:[],warnings:[]},{security:n}=e;if(!n)return r.warnings.push("No security settings configured. Use defineConfig() from '@visulima/vis/config' to get secure defaults automatically."),r;const i=n.policies??{},{installScripts:s}=i,o=s?.allow,a=o&&Object.keys(o).length>0;if(a||r.warnings.push(t==="pnpm"?"security.policies.installScripts.allow is not configured. pnpm blocks build scripts by default since v10. Run 'vis approve-builds' to review.":"security.policies.installScripts.allow is not configured. Consider listing which packages are allowed to run install/postinstall scripts."),i.firstSeen?.minutes===0&&r.warnings.push("security.policies.firstSeen.minutes is explicitly set to 0. New packages can be installed immediately after publishing."),i.publisherChange?.mode==="off"&&r.warnings.push("security.policies.publisherChange.mode is explicitly 'off'. Packages whose trust level has decreased will not be blocked."),n.blockExoticSubdeps===!1&&r.warnings.push("security.blockExoticSubdeps is explicitly disabled. Transitive dependencies can pull code from git repos or tarball URLs."),s?.strict===!1&&r.warnings.push("security.policies.installScripts.strict is explicitly disabled. Unapproved build scripts will only produce warnings, not errors."),s?.strict&&!a&&r.errors.push("security.policies.installScripts.strict is enabled but `.allow` is empty. All dependencies with build scripts will be blocked. Run 'vis approve-builds' to review and add packages."),n.acceptedRisks){const l=Date.now();for(const[c,u]of Object.entries(n.acceptedRisks)){const d=new Date(u.acceptedAt).getTime();l-d>7776e6&&r.warnings.push(`Accepted risk for "${c}" is over 90 days old (accepted ${u.acceptedAt}). Consider re-evaluating with 'vis audit'.`)}}return r},"checkSecurityConfig"),cX=Sl((e,t,r=!1)=>{if(Ir&&!process.env.VIS_SECURITY_WARNINGS)return;const n=vE(e,t);for(const s of n.errors)ee.error(s);const i=r?n.warnings.filter(s=>!s.startsWith("security.policies.installScripts.allow is not configured")):n.warnings;i.length>0&&ee.warn(`${i.length} security recommendation${i.length===1?"":"s"} found. Run 'vis check --security-config' for details.`)},"emitSecurityWarnings"),fee=Sl((e,t)=>{const r=vE(e,t),{security:n}=e;if(n){const i=n.policies??{},{firstSeen:s}=i,{publisherChange:o}=i,{installScripts:a}=i,{score:l}=i;if(ee.info("Active security settings:"),ee.info(` policies.firstSeen.minutes: ${s?.minutes??"not set"} minutes`),ee.info(` policies.publisherChange.mode: ${o?.mode??"not set"}`),ee.info(` policies.publisherChange.ignoreAfter: ${o?.ignoreAfter??"not set"} minutes`),ee.info(` blockExoticSubdeps: ${n.blockExoticSubdeps??!1}`),ee.info(` policies.installScripts.strict: ${a?.strict??!1}`),ee.info(` policies.installScripts.allow: ${a?.allow?`${Object.keys(a.allow).length} entries`:"not configured"}`),ee.info(""),ee.info("Socket.dev integration:"),ee.info(` socket.enabled: ${n.socket?.enabled??!1}`),ee.info(` socket.apiToken: ${n.socket?.apiToken||process.env.VIS_SOCKET_TOKEN?"configured":"using public token"}`),ee.info(` policies.score.minimum: ${l?.minimum??"default (0.4)"}`),ee.info(` socket.cacheTtlMs: ${n.socket?.cacheTtlMs??"default (1 hour)"}`),ee.info(` socket.timeoutMs: ${n.socket?.timeoutMs??"default (15s)"}`),n.acceptedRisks){const c=Object.entries(n.acceptedRisks);ee.info(` acceptedRisks: ${String(c.length)} entr${c.length===1?"y":"ies"}`);for(const[u,d]of c)ee.info(` ${u}: ${d.reason} (accepted ${d.acceptedAt.slice(0,10)})`)}else ee.info(" acceptedRisks: none");ee.info("")}if(r.errors.length===0&&r.warnings.length===0){ee.info("All recommended security settings are configured.");return}for(const i of r.errors)ee.error(i);for(const i of r.warnings)ee.warn(i);ee.notice(""),ee.notice("Secure defaults are applied by defineConfig(). You only need to add install-script allowances:"),ee.notice(""),ee.notice(" import { defineConfig } from '@visulima/vis/config';"),ee.notice(""),ee.notice(" export default defineConfig({"),ee.notice(" security: {"),ee.notice(" policies: {"),ee.notice(" installScripts: {"),ee.notice(" allow: {"),ee.notice(" esbuild: true,"),ee.notice(" '@prisma/client': true,"),ee.notice(" },"),ee.notice(" },"),ee.notice(" },"),ee.notice(" },"),ee.notice(" });")},"printSecurityReport"),mee=Sl(e=>{const{security:t}=e;if(!t)return[];const r=t.policies??{},{firstSeen:n}=r,{publisherChange:i}=r,{installScripts:s}=r,o=[];return n?.minutes!==void 0&&o.push(`minimumReleaseAge: ${n.minutes}`),i?.mode&&i.mode!=="off"&&o.push(`trustPolicy: ${i.mode}`),t.blockExoticSubdeps&&o.push("blockExoticSubdeps: true"),s?.allow&&o.push(`allowBuilds: ${Object.keys(s.allow).length} entries`),s?.strict&&o.push("strictDepBuilds: true"),i?.ignoreAfter!==void 0&&o.push(`trustPolicyIgnoreAfter: ${i.ignoreAfter}`),o},"previewPnpmSync");var lX=Object.defineProperty,dh=f((e,t)=>lX(e,"name",{value:t,configurable:!0}),"i");/*!
|
|
1183
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
1184
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1185
|
+
*
|
|
1186
|
+
* Redistribution and use in source and binary forms, with or without
|
|
1187
|
+
* modification, are permitted provided that the following conditions are met:
|
|
1188
|
+
*
|
|
1189
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
1190
|
+
* list of conditions and the following disclaimer.
|
|
1191
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
1192
|
+
* this list of conditions and the following disclaimer in the
|
|
1193
|
+
* documentation and/or other materials provided with the distribution.
|
|
1194
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
1195
|
+
* may be used to endorse or promote products derived from this software without
|
|
1196
|
+
* specific prior written permission.
|
|
1197
|
+
*
|
|
1198
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
1199
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
1200
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
1201
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
1202
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
1203
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
1204
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
1205
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
1206
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
1207
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1208
|
+
*/function bE(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}f(bE,"d$5");dh(bE,"getLineColFromPtr");function $E(e,t,r){let n=e.split(/\r\n|\n|\r/g),i="",s=(Math.log10(t+1)|0)+1;for(let o=t-1;o<=t+1;o++){let a=n[o-1];a&&(i+=o.toString().padEnd(s," "),i+=": ",i+=a,i+=`
|
|
1209
|
+
`,o===t&&(i+=" ".repeat(s+r+2),i+=`^
|
|
1210
|
+
`))}return i}f($E,"m$4");dh($E,"makeCodeBlock");class ve extends Error{static{f(this,"TomlError")}static{dh(this,"TomlError")}line;column;codeblock;constructor(t,r){const[n,i]=bE(r.toml,r.ptr),s=$E(r.toml,n,i);super(`Invalid TOML document: ${t}
|
|
1211
|
+
|
|
1212
|
+
${s}`,r),this.line=n,this.column=i,this.codeblock=s}}var uX=Object.defineProperty,ps=f((e,t)=>uX(e,"name",{value:t,configurable:!0}),"e$1");function wE(e,t){let r=0;for(;e[t-++r]==="\\";);return--r&&r%2}f(wE,"h$7");ps(wE,"isEscaped");function ec(e,t=0,r=e.length){let n=e.indexOf(`
|
|
1213
|
+
`,t);return e[n-1]==="\r"&&n--,n<=r?n:-1}f(ec,"indexOfNewline");ps(ec,"indexOfNewline");function zo(e,t){for(let r=t;r<e.length;r++){let n=e[r];if(n===`
|
|
1214
|
+
`)return r;if(n==="\r"&&e[r+1]===`
|
|
1215
|
+
`)return r+1;if(n<" "&&n!==" "||n==="")throw new ve("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}f(zo,"skipComment");ps(zo,"skipComment");function ur(e,t,r,n){let i;for(;;){for(;(i=e[t])===" "||i===" "||!r&&(i===`
|
|
1216
|
+
`||i==="\r"&&e[t+1]===`
|
|
1217
|
+
`);)t++;if(n||i!=="#")break;t=zo(e,t)}return t}f(ur,"skipVoid");ps(ur,"skipVoid");function kE(e,t,r,n,i=!1){if(!n)return t=ec(e,t),t<0?e.length:t;for(let s=t;s<e.length;s++){let o=e[s];if(o==="#")s=ec(e,s);else{if(o===r)return s+1;if(o===n||i&&(o===`
|
|
1218
|
+
`||o==="\r"&&e[s+1]===`
|
|
1219
|
+
`))return s}}throw new ve("cannot find end of structure",{toml:e,ptr:t})}f(kE,"skipUntil");ps(kE,"skipUntil");function fh(e,t){let r=e[t],n=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=n.length-1;do t=e.indexOf(n,++t);while(t>-1&&r!=="'"&&wE(e,t));return t>-1&&(t+=n.length,n.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}f(fh,"getStringEnd");ps(fh,"getStringEnd");var pX=Object.defineProperty,dX=f((e,t)=>pX(e,"name",{value:t,configurable:!0}),"l$3");/*!
|
|
1220
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
1221
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1222
|
+
*
|
|
1223
|
+
* Redistribution and use in source and binary forms, with or without
|
|
1224
|
+
* modification, are permitted provided that the following conditions are met:
|
|
1225
|
+
*
|
|
1226
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
1227
|
+
* list of conditions and the following disclaimer.
|
|
1228
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
1229
|
+
* this list of conditions and the following disclaimer in the
|
|
1230
|
+
* documentation and/or other materials provided with the distribution.
|
|
1231
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
1232
|
+
* may be used to endorse or promote products derived from this software without
|
|
1233
|
+
* specific prior written permission.
|
|
1234
|
+
*
|
|
1235
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
1236
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
1237
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
1238
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
1239
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
1240
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
1241
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
1242
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
1243
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
1244
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1245
|
+
*/let fX=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class Di extends Date{static{f(this,"TomlDate")}static{dX(this,"TomlDate")}#e=!1;#r=!1;#t=null;constructor(t){let r=!0,n=!0,i="Z";if(typeof t=="string"){let s=t.match(fX);s?(s[1]||(r=!1,t=`0000-01-01T${t}`),n=!!s[2],n&&t[10]===" "&&(t=t.replace(" ","T")),s[2]&&+s[2]>23?t="":(i=s[3]||null,t=t.toUpperCase(),!i&&n&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#e=r,this.#r=n,this.#t=i)}isDateTime(){return this.#e&&this.#r}isLocal(){return!this.#e||!this.#r||!this.#t}isDate(){return this.#e&&!this.#r}isTime(){return this.#r&&!this.#e}isValid(){return this.#e||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#t===null)return t.slice(0,-1);if(this.#t==="Z")return t;let r=+this.#t.slice(1,3)*60+ +this.#t.slice(4,6);return r=this.#t[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#t}static wrapAsOffsetDateTime(t,r="Z"){let n=new Di(t);return n.#t=r,n}static wrapAsLocalDateTime(t){let r=new Di(t);return r.#t=null,r}static wrapAsLocalDate(t){let r=new Di(t);return r.#r=!1,r.#t=null,r}static wrapAsLocalTime(t){let r=new Di(t);return r.#e=!1,r.#t=null,r}}var mX=Object.defineProperty,SE=f((e,t)=>mX(e,"name",{value:t,configurable:!0}),"w$1");let hX=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,gX=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,yX=/^[+-]?0[0-9_]/,vX=/^[0-9a-f]{2,8}$/i,ib={b:"\b",t:" ",n:`
|
|
1246
|
+
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function mh(e,t=0,r=e.length){let n=e[t]==="'",i=e[t++]===e[t]&&e[t]===e[t+1];i&&(r-=2,e[t+=2]==="\r"&&t++,e[t]===`
|
|
1247
|
+
`&&t++);let s=0,o,a="",l=t;for(;t<r-1;){let c=e[t++];if(c===`
|
|
1248
|
+
`||c==="\r"&&e[t]===`
|
|
1249
|
+
`){if(!i)throw new ve("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(c<" "&&c!==" "||c==="")throw new ve("control characters are not allowed in strings",{toml:e,ptr:t-1});if(o){if(o=!1,c==="x"||c==="u"||c==="U"){let u=e.slice(t,t+=c==="x"?2:c==="u"?4:8);if(!vX.test(u))throw new ve("invalid unicode escape",{toml:e,ptr:s});try{a+=String.fromCodePoint(parseInt(u,16))}catch{throw new ve("invalid unicode escape",{toml:e,ptr:s})}}else if(i&&(c===`
|
|
1250
|
+
`||c===" "||c===" "||c==="\r")){if(t=ur(e,t-1,!0),e[t]!==`
|
|
1251
|
+
`&&e[t]!=="\r")throw new ve("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:s});t=ur(e,t)}else if(c in ib)a+=ib[c];else throw new ve("unrecognized escape sequence",{toml:e,ptr:s});l=t}else!n&&c==="\\"&&(s=t-1,o=!0,a+=e.slice(l,s))}return a+e.slice(l,r-1)}f(mh,"parseString");SE(mh,"parseString");function EE(e,t,r,n){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return n?0n:0;let i=hX.test(e);if(i||gX.test(e)){if(yX.test(e))throw new ve("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let o=+e;if(isNaN(o))throw new ve("invalid number",{toml:t,ptr:r});if(i){if((i=!Number.isSafeInteger(o))&&!n)throw new ve("integer value cannot be represented losslessly",{toml:t,ptr:r});(i||n===!0)&&(o=BigInt(e))}return o}const s=new Di(e);if(!s.isValid())throw new ve("invalid value",{toml:t,ptr:r});return s}f(EE,"parseValue");SE(EE,"parseValue");var bX=Object.defineProperty,DE=f((e,t)=>bX(e,"name",{value:t,configurable:!0}),"t$3");function CE(e,t,r){let n=e.slice(t,r),i=n.indexOf("#");return i>-1&&(zo(e,i),n=n.slice(0,i)),[n.trimEnd(),i]}f(CE,"T$1");DE(CE,"sliceAndTrimEndOf");function El(e,t,r,n,i){if(n===0)throw new ve("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let s=e[t];if(s==="["||s==="{"){let[l,c]=s==="["?OE(e,t,n,i):AE(e,t,n,i);if(r){if(c=ur(e,c),e[c]===",")c++;else if(e[c]!==r)throw new ve("expected comma or end of structure",{toml:e,ptr:c})}return[l,c]}let o;if(s==='"'||s==="'"){o=fh(e,t);let l=mh(e,t,o);if(r){if(o=ur(e,o),e[o]&&e[o]!==","&&e[o]!==r&&e[o]!==`
|
|
1252
|
+
`&&e[o]!=="\r")throw new ve("unexpected character encountered",{toml:e,ptr:o});o+=+(e[o]===",")}return[l,o]}o=kE(e,t,",",r);let a=CE(e,t,o-+(e[o-1]===","));if(!a[0])throw new ve("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&a[1]>-1&&(o=ur(e,t+a[1]),o+=+(e[o]===",")),[EE(a[0],e,t,i),o]}f(El,"extractValue");DE(El,"extractValue");var $X=Object.defineProperty,hh=f((e,t)=>$X(e,"name",{value:t,configurable:!0}),"m$3");let wX=/^[a-zA-Z0-9-_]+[ \t]*$/;function tc(e,t,r="="){let n=t-1,i=[],s=e.indexOf(r,t);if(s<0)throw new ve("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let o=e[t=++n];if(o!==" "&&o!==" ")if(o==='"'||o==="'"){if(o===e[t+1]&&o===e[t+2])throw new ve("multiline strings are not allowed in keys",{toml:e,ptr:t});let a=fh(e,t);if(a<0)throw new ve("unfinished string encountered",{toml:e,ptr:t});n=e.indexOf(".",a);let l=e.slice(a,n<0||n>s?s:n),c=ec(l);if(c>-1)throw new ve("newlines are not allowed in keys",{toml:e,ptr:t+n+c});if(l.trimStart())throw new ve("found extra tokens after the string part",{toml:e,ptr:a});if(s<a&&(s=e.indexOf(r,a),s<0))throw new ve("incomplete key-value: cannot find end of key",{toml:e,ptr:t});i.push(mh(e,t,a))}else{n=e.indexOf(".",t);let a=e.slice(t,n<0||n>s?s:n);if(!wX.test(a))throw new ve("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});i.push(a.trimEnd())}}while(n+1&&n<s);return[i,ur(e,s+1,!0,!0)]}f(tc,"parseKey");hh(tc,"parseKey");function AE(e,t,r,n){let i={},s=new Set,o;for(t++;(o=e[t++])!=="}"&&o;){if(o===",")throw new ve("expected value, found comma",{toml:e,ptr:t-1});if(o==="#")t=zo(e,t);else if(o!==" "&&o!==" "&&o!==`
|
|
1253
|
+
`&&o!=="\r"){let a,l=i,c=!1,[u,d]=tc(e,t-1);for(let g=0;g<u.length;g++){if(g&&(l=c?l[a]:l[a]={}),a=u[g],(c=Object.hasOwn(l,a))&&(typeof l[a]!="object"||s.has(l[a])))throw new ve("trying to redefine an already defined value",{toml:e,ptr:t});!c&&a==="__proto__"&&Object.defineProperty(l,a,{enumerable:!0,configurable:!0,writable:!0})}if(c)throw new ve("trying to redefine an already defined value",{toml:e,ptr:t});let[p,m]=El(e,d,"}",r-1,n);s.add(p),l[a]=p,t=m}}if(!o)throw new ve("unfinished table encountered",{toml:e,ptr:t});return[i,t]}f(AE,"parseInlineTable");hh(AE,"parseInlineTable");function OE(e,t,r,n){let i=[],s;for(t++;(s=e[t++])!=="]"&&s;){if(s===",")throw new ve("expected value, found comma",{toml:e,ptr:t-1});if(s==="#")t=zo(e,t);else if(s!==" "&&s!==" "&&s!==`
|
|
1254
|
+
`&&s!=="\r"){let o=El(e,t-1,"]",r-1,n);i.push(o[0]),t=o[1]}}if(!s)throw new ve("unfinished array encountered",{toml:e,ptr:t});return[i,t]}f(OE,"parseArray");hh(OE,"parseArray");var kX=Object.defineProperty,jE=f((e,t)=>kX(e,"name",{value:t,configurable:!0}),"b$4");function Sd(e,t,r,n){let i=t,s=r,o,a=!1,l;for(let c=0;c<e.length;c++){if(c){if(i=a?i[o]:i[o]={},s=(l=s[o]).c,n===0&&(l.t===1||l.t===2))return null;if(l.t===2){let u=i.length-1;i=i[u],s=s[u].c}}if(o=e[c],(a=Object.hasOwn(i,o))&&s[o]?.t===0&&s[o]?.d)return null;a||(o==="__proto__"&&(Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(s,o,{enumerable:!0,configurable:!0,writable:!0})),s[o]={t:c<e.length-1&&n===2?3:n,d:!1,i:0,c:{}})}if(l=s[o],l.t!==n&&!(n===1&&l.t===3)||(n===2&&(l.d||(l.d=!0,i[o]=[]),i[o].push(i={}),l.c[l.i++]=l={t:1,d:!1,i:0,c:{}}),l.d))return null;if(l.d=!0,n===1)i=a?i[o]:i[o]={};else if(n===0&&a)return null;return[o,i,l.c]}f(Sd,"w");jE(Sd,"peekTable");function xE(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let n={},i={},s=n,o=i;for(let a=ur(e,0);a<e.length;){if(e[a]==="["){let l=e[++a]==="[",c=tc(e,a+=+l,"]");if(l){if(e[c[1]-1]!=="]")throw new ve("expected end of table declaration",{toml:e,ptr:c[1]-1});c[1]++}let u=Sd(c[0],n,i,l?2:1);if(!u)throw new ve("trying to redefine an already defined table or value",{toml:e,ptr:a});o=u[2],s=u[1],a=c[1]}else{let l=tc(e,a),c=Sd(l[0],s,o,0);if(!c)throw new ve("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=El(e,l[1],void 0,t,r);c[1][c[0]]=u[0],a=u[1]}if(a=ur(e,a,!0),e[a]&&e[a]!==`
|
|
1255
|
+
`&&e[a]!=="\r")throw new ve("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=ur(e,a)}return n}f(xE,"parse");jE(xE,"parse");var SX=Object.defineProperty,Ur=f((e,t)=>SX(e,"name",{value:t,configurable:!0}),"l$2");/*!
|
|
1256
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
1257
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1258
|
+
*
|
|
1259
|
+
* Redistribution and use in source and binary forms, with or without
|
|
1260
|
+
* modification, are permitted provided that the following conditions are met:
|
|
1261
|
+
*
|
|
1262
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
1263
|
+
* list of conditions and the following disclaimer.
|
|
1264
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
1265
|
+
* this list of conditions and the following disclaimer in the
|
|
1266
|
+
* documentation and/or other materials provided with the distribution.
|
|
1267
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
1268
|
+
* may be used to endorse or promote products derived from this software without
|
|
1269
|
+
* specific prior written permission.
|
|
1270
|
+
*
|
|
1271
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
1272
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
1273
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
1274
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
1275
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
1276
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
1277
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
1278
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
1279
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
1280
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1281
|
+
*/let PE=/^[a-z0-9-_]+$/i;function ds(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return t}f(ds,"g");Ur(ds,"extendedTypeOf");function NE(e){for(let t=0;t<e.length;t++)if(ds(e[t])!=="object")return!1;return e.length!=0}f(NE,"E");Ur(NE,"isArrayOfTables");function Dl(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}f(Dl,"a$3");Ur(Dl,"formatString");function Cl(e,t,r,n){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(t==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":n&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t==="bigint"||t==="boolean")return e.toString();if(t==="string")return Dl(e);if(t==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(t==="object")return RE(e,r,n);if(t==="array")return FE(e,r,n)}f(Cl,"d$4");Ur(Cl,"stringifyValue");function RE(e,t,r){let n=Object.keys(e);if(n.length===0)return"{}";let i="{ ";for(let s=0;s<n.length;s++){let o=n[s];s&&(i+=", "),i+=PE.test(o)?o:Dl(o),i+=" = ",i+=Cl(e[o],ds(e[o]),t-1,r)}return i+" }"}f(RE,"b$3");Ur(RE,"stringifyInlineTable");function FE(e,t,r){if(e.length===0)return"[]";let n="[ ";for(let i=0;i<e.length;i++){if(i&&(n+=", "),e[i]===null||e[i]===void 0)throw new TypeError("arrays cannot contain null or undefined values");n+=Cl(e[i],ds(e[i]),t-1,r)}return n+" ]"}f(FE,"x$2");Ur(FE,"stringifyArray");function LE(e,t,r,n){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let i="";for(let s=0;s<e.length;s++)i+=`${i&&`
|
|
1282
|
+
`}[[${t}]]
|
|
1283
|
+
`,i+=Al(0,e[s],t,r,n);return i}f(LE,"k$2");Ur(LE,"stringifyArrayTable");function Al(e,t,r,n,i){if(n===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let s="",o="",a=Object.keys(t);for(let l=0;l<a.length;l++){let c=a[l];if(t[c]!==null&&t[c]!==void 0){let u=ds(t[c]);if(u==="symbol"||u==="function")throw new TypeError(`cannot serialize values of type '${u}'`);let d=PE.test(c)?c:Dl(c);if(u==="array"&&NE(t[c]))o+=(o&&`
|
|
1284
|
+
`)+LE(t[c],r?`${r}.${d}`:d,n-1,i);else if(u==="object"){let p=r?`${r}.${d}`:d;o+=(o&&`
|
|
1285
|
+
`)+Al(p,t[c],p,n-1,i)}else s+=d,s+=" = ",s+=Cl(t[c],u,n,i),s+=`
|
|
1286
|
+
`}}return e&&(s||!o)&&(s=s?`[${e}]
|
|
1287
|
+
${s}`:`[${e}]`),s&&o?`${s}
|
|
1288
|
+
${o}`:s||o}f(Al,"h$3");Ur(Al,"stringifyTable");function EX(e,{maxDepth:t=1e3,numbersAsFloat:r=!1}={}){if(ds(e)!=="object")throw new TypeError("stringify can only be called with an object");let n=Al(0,e,"",t,r);return n[n.length-1]!==`
|
|
1289
|
+
`?n+`
|
|
1290
|
+
`:n}f(EX,"stringify");Ur(EX,"stringify");var DX=Object.defineProperty,CX=f((e,t)=>DX(e,"name",{value:t,configurable:!0}),"a$2"),AX=Object.defineProperty,OX=CX((e,t)=>AX(e,"name",{value:t,configurable:!0}),"t"),jX=Object.defineProperty,xX=OX((e,t)=>jX(e,"name",{value:t,configurable:!0}),"n");const PX=xX((e,t)=>{const r=J(e,{encoding:"utf8",...t});return xE(r)},"readTomlSync");var NX=Object.defineProperty,Ol=f((e,t)=>NX(e,"name",{value:t,configurable:!0}),"t$1");Ol(e=>{if(!Number.isFinite(e)||e<=0)return"0m";const t=Math.max(1,Math.round(e));return t%1440===0?`${String(t/1440)}d`:t%60===0?`${String(t/60)}h`:`${String(t)}m`},"formatMinutesAsTimeString");const IE=Ol(e=>{const t=e.trim();if(t==="")return;const r=/^(\d+(?:\.\d+)?)\s*([mhdw]?)$/i.exec(t);if(!r)return;const n=Number.parseFloat(r[1]);if(!(!Number.isFinite(n)||n<0))switch(r[2]?.toLowerCase()){case"":case"m":case void 0:return Math.round(n);case"d":return Math.round(n*1440);case"h":return Math.round(n*60);case"w":return Math.round(n*10080);default:return}},"parseDurationToMinutes"),RX=Ol(e=>e.startsWith("@")||e.includes("/")||/[:#\s]/.test(e),"needsYamlQuote"),hee=Ol(e=>RX(e)?`'${e.replaceAll("'","''")}'`:e,"renderYamlKey");var FX=Object.defineProperty,jl=f((e,t)=>FX(e,"name",{value:t,configurable:!0}),"p$2");const LX=jl(e=>{const t=e.trim();return/^\d+$/.test(t)?Number.parseInt(t,10)*1440:IE(t)},"parseNpmReleaseAgeValue"),IX=jl((e,t)=>{const r={};try{switch(e){case"bun":{const n=C(t,"package.json");if(x(n)){const s=ke(n);Array.isArray(s.trustedDependencies)&&(r.allowBuilds=new Set(s.trustedDependencies))}const i=C(t,"bunfig.toml");if(x(i)){const s=PX(i),o=s?.install?.minimumReleaseAge;typeof o=="number"&&(r.minReleaseAgeMinutes=Math.round(o/60)),Array.isArray(s?.install?.minimumReleaseAgeExcludes)&&(r.minReleaseAgeExcludes=new Set(s.install.minimumReleaseAgeExcludes))}break}case"npm":{const n=C(t,".npmrc");if(x(n)){const i=J(n),s=/^\s*min-release-age\s*=\s*([^\s#;]+)/m.exec(i);s&&(r.minReleaseAgeMinutes=LX(s[1]))}break}case"pnpm":{const n=C(t,"pnpm-workspace.yaml");if(x(n)){const i=Mt(n);i?.allowBuilds&&typeof i.allowBuilds=="object"?r.allowBuilds=new Set(Object.entries(i.allowBuilds).filter(([,s])=>s).map(([s])=>s)):Array.isArray(i?.onlyBuiltDependencies)&&(r.allowBuilds=new Set(i.onlyBuiltDependencies)),typeof i?.minimumReleaseAge=="number"&&(r.minReleaseAgeMinutes=i.minimumReleaseAge),Array.isArray(i?.minimumReleaseAgeExclude)&&(r.minReleaseAgeExcludes=new Set(i.minimumReleaseAgeExclude))}break}case"yarn":{const n=C(t,".yarnrc.yml");if(x(n)){const i=Mt(n),s=i?.npmMinimalAgeGate;typeof s=="string"?r.minReleaseAgeMinutes=IE(s):typeof s=="number"&&(r.minReleaseAgeMinutes=s),Array.isArray(i?.npmPreapprovedPackages)&&(r.minReleaseAgeExcludes=new Set(i.npmPreapprovedPackages))}break}}}catch{}return r},"readPmNativeSnapshot"),TX=jl((e,t,r)=>{const n=IX(t,r),i={hasDrift:!1,packageManager:t},s=(e.security??{}).policies??{},{installScripts:o}=s,{firstSeen:a}=s;if(o?.allow&&(t==="pnpm"||t==="bun")){const l=new Set(Object.entries(o.allow).filter(([,p])=>p).map(([p])=>p)),c=n.allowBuilds??new Set,u=[...l].filter(p=>!c.has(p)),d=[...c].filter(p=>!l.has(p));(u.length>0||d.length>0)&&(i.allowBuilds={onlyInPm:d,onlyInVis:u},i.hasDrift=!0)}if(a?.minutes!==void 0&&!(t==="yarn"&&n.minReleaseAgeMinutes===void 0&&!x(C(r,".yarnrc.yml")))&&n.minReleaseAgeMinutes!==a.minutes&&(i.minReleaseAge={pm:n.minReleaseAgeMinutes,vis:a.minutes},i.hasDrift=!0),a?.exclude&&(t==="pnpm"||t==="bun"||t==="yarn")){const l=new Set(a.exclude),c=n.minReleaseAgeExcludes??new Set,u=[...l].filter(p=>!c.has(p)),d=[...c].filter(p=>!l.has(p));(u.length>0||d.length>0)&&(i.minReleaseAgeExcludes={onlyInPm:d,onlyInVis:u},i.hasDrift=!0)}return i},"checkPmNativeConfigDrift"),BX=jl(e=>{if(!e.hasDrift)return[];const t=[`vis.config and ${e.packageManager}-native config disagree on security settings:`];if(e.allowBuilds&&(e.allowBuilds.onlyInVis.length>0&&t.push(` security.policies.installScripts.allow — only in vis.config: ${e.allowBuilds.onlyInVis.join(", ")}`),e.allowBuilds.onlyInPm.length>0&&t.push(` security.policies.installScripts.allow — only in ${e.packageManager} config: ${e.allowBuilds.onlyInPm.join(", ")}`)),e.minReleaseAge){const r=e.minReleaseAge.vis===void 0?"unset":`${String(e.minReleaseAge.vis)} min`,n=e.minReleaseAge.pm===void 0?"unset":`${String(e.minReleaseAge.pm)} min`;t.push(` security.policies.firstSeen.minutes — vis.config: ${r}, ${e.packageManager}: ${n}`)}return e.minReleaseAgeExcludes&&(e.minReleaseAgeExcludes.onlyInVis.length>0&&t.push(` security.policies.firstSeen.exclude — only in vis.config: ${e.minReleaseAgeExcludes.onlyInVis.join(", ")}`),e.minReleaseAgeExcludes.onlyInPm.length>0&&t.push(` security.policies.firstSeen.exclude — only in ${e.packageManager} config: ${e.minReleaseAgeExcludes.onlyInPm.join(", ")}`)),t.push(" Run 'vis security sync' to push vis.config values to the native config."),t},"formatDriftReport");var _X=Object.defineProperty,MX=f((e,t)=>_X(e,"name",{value:t,configurable:!0}),"o$2");const VX=MX(e=>x(C(e,".yarnrc.yml")),"isYarnBerry");var WX=Object.defineProperty,UX=f((e,t)=>WX(e,"name",{value:t,configurable:!0}),"l$1");const GX=UX((e,t,r)=>{const n={extraArgs:[],postInstallPackages:[],scriptsBlockedByDefault:!1,warnings:[]},i=r.security?.policies?.installScripts?.allow??{},s=Object.keys(i).length>0;switch(e){case"bun":{if(n.scriptsBlockedByDefault=!0,s){const o=C(t,"package.json");try{(x(o)?ke(o):{}).trustedDependencies?.length||n.warnings.push("vis security.policies.installScripts.allow is configured but trustedDependencies is empty. Run 'vis approve-builds --sync-native'.")}catch{}}break}case"npm":{n.scriptsBlockedByDefault=!1;const o=C(t,".npmrc"),a=x(o)&&/^\s*ignore-scripts\s*=\s*true\s*$/m.test(J(o));if(!a&&s?(n.warnings.push("npm does not block lifecycle scripts. vis will add --ignore-scripts automatically."),n.extraArgs.push("--ignore-scripts")):!a&&!s&&n.warnings.push("npm does not block lifecycle scripts. Add 'ignore-scripts=true' to .npmrc and configure security.policies.installScripts.allow."),s)for(const[l,c]of Object.entries(i))c&&n.postInstallPackages.push(l);break}case"pnpm":{n.scriptsBlockedByDefault=!0,s||n.warnings.push("pnpm blocks build scripts by default. Run 'vis approve-builds' to review packages that need scripts.");break}case"yarn":{if(n.scriptsBlockedByDefault=!1,VX(t)){const o=J(C(t,".yarnrc.yml"));/^\s*enableScripts\s*:\s*false\s*$/m.test(o)?n.scriptsBlockedByDefault=!0:n.warnings.push("yarn berry supports enableScripts. Add 'enableScripts: false' to .yarnrc.yml.")}else if(n.warnings.push("yarn classic does not support blocking lifecycle scripts. Consider upgrading to yarn berry."),s){n.extraArgs.push("--ignore-scripts");for(const[o,a]of Object.entries(i))a&&n.postInstallPackages.push(o)}break}}return n},"enforceScriptSecurity");var qX=Object.defineProperty,Ho=f((e,t)=>qX(e,"name",{value:t,configurable:!0}),"p$1");const TE=Ho((...e)=>{const t={...process.env},r=t.PATH??t.Path??"",n=e.filter(i=>i.length>0).join(yh);return t.PATH=n.length>0?r?`${n}${yh}${r}`:n:r,t},"envWithBin"),zX=Ho(e=>{if(e.endsWith("*"))return e.endsWith("@*")?e.slice(0,-2):e;const t=e.startsWith("@"),r=e.indexOf("@",t?1:0);return r===-1?e:e.slice(0,r)},"stripVersionSuffix"),HX=Ho((e,t)=>{const r=C(e,"node_modules"),n=[];for(const i of t){if(!i.endsWith("*")){n.push(zX(i));continue}const s=i.slice(0,-1);try{if(s.startsWith("@")&&s.endsWith("/")){const o=C(r,s.slice(0,-1));for(const a of Kt(o))!a.startsWith(".")&&Pi(C(o,a)).isDirectory()&&n.push(`${s.slice(0,-1)}/${a}`)}else for(const o of Kt(r))o.startsWith(s)&&Pi(C(r,o)).isDirectory()&&n.push(o)}catch{}}return n},"expandPatterns"),JX=Ho((e,t)=>{if(t.length===0)return;const r=HX(e,t);if(r.length===0)return;const n=C(e,"node_modules"),i=C(n,".bin");let s=!1;for(const o of r){if(o.includes("..")||o.startsWith("/")||o.startsWith("\\")){ee.warn(`Skipping invalid package name: ${o}`);continue}const a=(o.match(/\//g)??[]).length;if(a>1||a===1&&!o.startsWith("@")){ee.warn(`Skipping invalid package name: ${o}`);continue}const l=C(n,o),c=C(l,"package.json");if(x(c))try{const u=ke(c).scripts??{},d=C(l,"node_modules",".bin"),p=TE(d,i);for(const m of["preinstall","install","postinstall"])if(u[m]){ee.info(`Running ${m} for ${o}...`);try{const g=u[m];$b(g,{cwd:l,env:p,stdio:"inherit"})}catch{ee.error(`${m} script failed for ${o}`),s=!0}}}catch{}}s&&(process.exitCode=1)},"runApprovedScripts"),gee=Ho((e,t=["prepublish","prepare"])=>{const r=C(e,"package.json");if(!x(r))return;let n;try{n=ke(r).scripts??{}}catch{return}let i=!1;const s=TE(C(e,"node_modules",".bin"));for(const o of t){const a=n[o];if(a){ee.info(`Running root ${o}...`);try{$b(a,{cwd:e,env:s,stdio:"inherit"})}catch{ee.error(`Root ${o} script failed.`),i=!0}}}i&&(process.exitCode=1)},"runRootLifecycleScripts");var KX=Object.defineProperty,Ed=f((e,t)=>KX(e,"name",{value:t,configurable:!0}),"m");const Ep=new Set(["add","install","update"]),YX=new Set(["add","dedupe","install","remove","update"]),XX=/(\d+\.\d+\.\d+)/,QX=Ed(e=>{const t=C(e,"package.json");if(!x(t))return[];const r=[];try{const n=ke(t),i={...n.dependencies,...n.devDependencies};for(const[s,o]of Object.entries(i)){const a=C(e,"node_modules",s,"package.json");if(x(a))try{const c=ke(a);if(c.version){r.push({name:s,version:c.version});continue}}catch{}const l=XX.exec(o);l?.[1]&&r.push({name:s,version:l[1]})}}catch{}return r},"resolveInstalledPackages"),ZX={afterCommand:Ed(async e=>{if(process.exitCode&&process.exitCode!==0)return;const t=e.scriptEnforcement;t?.postInstallPackages.length&&e.workspaceRoot&&JX(e.workspaceRoot,t.postInstallPackages);const r=process.argv[2]??"",n=Ep.has(r)&&e.workspaceRoot?kd(e.workspaceRoot):void 0;if(n&&e.visConfig&&e.workspaceRoot&&new Set(["bun","npm","pnpm","yarn"]).has(n.name)){const s=TX(e.visConfig,n.name,e.workspaceRoot);if(s.hasDrift){ee.info("");for(const o of BX(s))ee.warn(o)}}const i=k5(e.visConfig?.security?.socket,e.visConfig?.security?.policies?.score?.minimum);if(Ep.has(r)&&i&&e.workspaceRoot&&!nb("socket"))try{const s=QX(e.workspaceRoot);if(s.length>0){const o=await Ck(s,i);if(o.size>0){const a=w5(o,i.minimumScore);if(a){ee.info(""),ee.info(a);let l=0;for(const c of o.values())for(const u of c.alerts)(u.severity==="critical"||u.severity==="high")&&l++;l>0&&ee.warn(`${String(l)} critical/high severity alert${l===1?"":"s"} detected. Run 'vis check --security' for details.`)}}}}catch{}},"afterCommand"),beforeCommand:Ed(async e=>{const t=process.argv[2]??"";if(YX.has(t)&&e.visConfig&&e.workspaceRoot){const r=kd(e.workspaceRoot),n=Ep.has(t);if(cX(e.visConfig,r.name,n),n&&!nb("installScripts")){const i=GX(r.name,e.workspaceRoot,e.visConfig);for(const s of i.warnings)e.logger.warn(`security: ${s}`);e.scriptEnforcement=i}}},"beforeCommand"),name:"security-enforcement"};var eQ=Object.defineProperty,tQ=f((e,t)=>eQ(e,"name",{value:t,configurable:!0}),"n$1");const rQ=tQ(()=>process.platform==="win32"?!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color":process.env.TERM!=="linux","isUnicodeSupported"),Ls=rQ(),nQ={arrow:Ls?"→":"->",dash:Ls?"—":"-",failure:Ls?"✗":"x",success:Ls?"✓":"v",warning:Ls?"⚠":"!"};var iQ=Object.defineProperty,fs=f((e,t)=>iQ(e,"name",{value:t,configurable:!0}),"s");const Dd=C(dn(),"upgrade-check.json"),sQ=1440*60*1e3,oQ=1440*60*1e3,aQ=500,cQ=new Set(["--help","--version","-h","-V","help","implode","self-update","upgrade"]),lQ=fs(()=>{try{if(x(Dd))return ke(Dd)}catch{}},"readCache"),BE=fs(e=>{try{Jt(dn()),ze(Dd,JSON.stringify(e))}catch{}},"writeCache"),uQ=fs(async e=>{try{const t=new AbortController,r=setTimeout(()=>{t.abort()},aQ),n=await fetch(`https://registry.npmjs.org/${e}/latest`,{headers:{accept:"application/json"},signal:t.signal});return clearTimeout(r),n.ok?(await n.json()).version:void 0}catch{return}},"fetchLatestVersion"),sb=fs((e,t)=>{let r;try{r=Qt.gt(t.latestVersion,e,{loose:!0})}catch{return}if(!r)return;const n=Date.now();n-t.lastNoticeAt<oQ||(process.stderr.write(`
|
|
1291
|
+
${jn("vis update available:")} ${Us(e)} ${jn(nQ.arrow)} ${DM(ir(t.latestVersion))}${jn(", run")} ${Kr("vis upgrade")}
|
|
1292
|
+
`),t.lastNoticeAt=n,BE(t))},"showUpgradeNotice"),pQ=fs(e=>{if(Ir||process.env.VIS_CLI_TEST||process.env.VIS_NO_UPDATE_CHECK==="1"||!process.stderr.isTTY||cQ.has(e))return!1;const t=new Set(process.argv.slice(2));return!(t.has("--silent")||t.has("-s")||t.has("--json"))},"shouldCheck"),dQ=fs((e,t)=>{if(!pQ(t))return;const r=lQ(),n=Date.now();if(r&&n-r.lastQueryAt<sQ)return()=>{sb(e,r)};let i=r;return uQ("@visulima/vis").then(s=>{s&&(i={lastNoticeAt:r?.lastNoticeAt??0,lastQueryAt:n,latestVersion:s},BE(i))}).catch(()=>{}),()=>{i&&sb(e,i)}},"startUpgradeCheck");var fQ=Object.defineProperty,ob=f((e,t)=>fQ(e,"name",{value:t,configurable:!0}),"n");tN();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");KW();try{const e=L1(process.cwd()).path;process.env.VIS_MONOREPO_ROOT=e;const t=ke(C(e,"package.json"));t.name&&YW(t.name)}catch{}const mQ=dQ(Ua.version,process.argv[2]??"");UP();const K=mP("vis",{packageName:"vis",packageVersion:Ua.version}),hQ=process.argv.includes("--debug")||!!process.env.DEBUG;K.addPlugin(fR({detailed:hQ,exitOnError:!1}));K.addGlobalOption({description:"Override workspace root directory",name:"cwd",type:String});K.addGlobalOption({description:"Path to a vis config file (overrides discovery)",name:"config",type:String});K.addPlugin(ZW);K.addPlugin(ZX);K.addCommand(WV);K.addCommand(iB);K.addCommand(FB);K.addCommand(yT);K.addCommand(AT);K.addCommand(EW);K.addCommand(_V);K.addCommand(zB);K.addCommand(RW);K.addCommand(tB);K.addCommand(f_);K.addCommand(TT);K.addCommand(dW);K.addCommand(hW);K.addCommand(vW);K.addCommand(wW);K.addCommand(kB);K.addCommand(g_);K.addCommand(AW);K.addCommand(RP);K.addCommand(a_);K.addCommand($T);K.addCommand(BV);K.addCommand(fB);K.addCommand(_W);K.addCommand(QB);K.addCommand(u_);K.addCommand(xW);K.addCommand(bB);K.addCommand(OB);K.addCommand(LV);K.addCommand(t_);K.addCommand(aB);K.addCommand(uB);K.addCommand(PB);K.addCommand(gB);K.addCommand(IW);K.addCommand(KB);K.addCommand(MT);K.addCommand(UT);K.addCommand(i_);K.addCommand(DB);K.addCommand(NV);K.addCommand(qV);K.addCommand(JV);for(const e of UB)K.addCommand(e);for(const e of N_)K.addCommand(e);for(const e of QT)K.addCommand(e);for(const e of ET)K.addCommand(e);for(const e of T1)K.addCommand(e);for(const e of lW)K.addCommand(e);for(const e of tW)K.addCommand(e);K.addPlugin(AU(mQ));if(T_(process.argv.slice(2))){const{loadVisConfig:e}=await import("../packem_shared/applyDefaults-BOVDw1jD.js"),t=process.env.VIS_MONOREPO_ROOT||process.cwd();let r;try{r=await e(t)}catch{r=void 0}try{await jV({logger:{info:ob(n=>{process.stdout.write(`${n}
|
|
1293
|
+
`)},"info"),warn:ob(n=>{process.stderr.write(`${n}
|
|
1294
|
+
`)},"warn")},visConfig:r,workspaceRoot:t})}catch(n){process.stderr.write(`${n.message}
|
|
1295
|
+
`),process.exitCode=1}}else(async()=>{try{await K.run({shouldExitProcess:!1})}catch{process.exitCode=process.exitCode||1}finally{process.exit(process.exitCode??0)}})();export{dee as $,kd as A,hm as B,aee as C,IZ as D,jn as E,v6 as F,$6 as G,w6 as H,DM as I,k5 as J,hee as K,tee as L,nee as M,Ck as N,Z5 as O,_k as P,cee as Q,K5 as R,xt as S,Mk as T,aT as U,d6 as V,MZ as W,iee as X,Xc as Y,JX as Z,Zc as _,yu as a,br as a$,gee as a0,RZ as a1,CZ as a2,AZ as a3,Rr as a4,lee as a5,Ua as a6,oee as a7,Ak as a8,S5 as a9,Lt as aA,Y1 as aB,ey as aC,CV as aD,oy as aE,uy as aF,bv as aG,dy as aH,ay as aI,ty as aJ,ny as aK,fy as aL,vv as aM,my as aN,SV as aO,kV as aP,fc as aQ,el as aR,Dm as aS,Vg as aT,PZ as aU,z9 as aV,jZ as aW,i3 as aX,FZ as aY,LZ as aZ,bo as a_,VZ as aa,$5 as ab,GZ as ac,Jf as ad,gm as ae,QY as af,nQ as ag,WZ as ah,UZ as ai,zZ as aj,TX as ak,BX as al,eee as am,PX as an,g6 as ao,O6 as ap,P6 as aq,X5 as ar,j6 as as,h6 as at,m6 as au,J5 as av,gZ as aw,Qt as ax,an as ay,Ee as az,fee as b,Y2 as b0,e0 as b1,I2 as b2,Ks as b3,pO as b4,nO as b5,U2 as b6,o0 as b7,Ti as b8,Bi as b9,EZ as bA,$w as bB,bG as bC,xv as bD,yZ as bE,qZ as bF,HZ as ba,JZ as bb,KZ as bc,YZ as bd,TQ as be,BQ as bf,Ci as bg,oM as bh,$n as bi,xZ as bj,M1 as bk,V1 as bl,vZ as bm,bZ as bn,wZ as bo,kZ as bp,$Z as bq,v3 as br,k3 as bs,SZ as bt,CM as bu,UC as bv,OZ as bw,_Z as bx,L9 as by,DZ as bz,mee as c,y6 as d,Us as e,ree as f,uee as g,Zi as h,nb as i,ir as j,sn as k,pee as l,NZ as m,l5 as n,TZ as o,ee as p,Kr as q,BZ as r,Ir as s,VX as t,Mt as u,yo as v,vo as w,see as x,qM as y,vm as z};
|