@visulima/vis 5.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +2 -2
  4. package/dist/bin.js +1 -1
  5. package/dist/binx.js +1 -1
  6. package/dist/config/index.d.ts +16 -18
  7. package/dist/packem_chunks/bloom-status.js +1 -1
  8. package/dist/packem_chunks/bloom-sync.js +1 -1
  9. package/dist/packem_chunks/catalog.js +49 -48
  10. package/dist/packem_chunks/cli-exec.js +1 -1
  11. package/dist/packem_chunks/cli-main.js +200 -176
  12. package/dist/packem_chunks/doctor-probe.js +1 -1
  13. package/dist/packem_chunks/fix.js +1 -1
  14. package/dist/packem_chunks/handler.js +1 -1
  15. package/dist/packem_chunks/handler10.js +1 -1
  16. package/dist/packem_chunks/handler11.js +1 -1
  17. package/dist/packem_chunks/handler12.js +1 -1
  18. package/dist/packem_chunks/handler13.js +1 -1
  19. package/dist/packem_chunks/handler14.js +1 -1
  20. package/dist/packem_chunks/handler15.js +1 -1
  21. package/dist/packem_chunks/handler16.js +1 -1
  22. package/dist/packem_chunks/handler17.js +1 -1
  23. package/dist/packem_chunks/handler18.js +1 -1
  24. package/dist/packem_chunks/handler19.js +1 -1
  25. package/dist/packem_chunks/handler2.js +1 -1
  26. package/dist/packem_chunks/handler20.js +1 -1
  27. package/dist/packem_chunks/handler21.js +1 -1
  28. package/dist/packem_chunks/handler23.js +1 -1
  29. package/dist/packem_chunks/handler24.js +1 -1
  30. package/dist/packem_chunks/handler26.js +3 -3
  31. package/dist/packem_chunks/handler27.js +1 -1
  32. package/dist/packem_chunks/handler28.js +1 -1
  33. package/dist/packem_chunks/handler29.js +1 -1
  34. package/dist/packem_chunks/handler3.js +1 -1
  35. package/dist/packem_chunks/handler30.js +1 -1
  36. package/dist/packem_chunks/handler39.js +6 -6
  37. package/dist/packem_chunks/handler5.js +1 -1
  38. package/dist/packem_chunks/handler50.js +1 -1
  39. package/dist/packem_chunks/handler51.js +1 -1
  40. package/dist/packem_chunks/handler53.js +1 -1
  41. package/dist/packem_chunks/handler54.js +1 -1
  42. package/dist/packem_chunks/handler59.js +1 -1
  43. package/dist/packem_chunks/handler6.js +1 -1
  44. package/dist/packem_chunks/handler60.js +1 -1
  45. package/dist/packem_chunks/handler61.js +2 -2
  46. package/dist/packem_chunks/handler62.js +1 -1
  47. package/dist/packem_chunks/handler65.js +3 -3
  48. package/dist/packem_chunks/handler66.js +2 -2
  49. package/dist/packem_chunks/handler67.js +9 -9
  50. package/dist/packem_chunks/handler68.js +1 -1
  51. package/dist/packem_chunks/handler69.js +4 -4
  52. package/dist/packem_chunks/handler7.js +1 -1
  53. package/dist/packem_chunks/handler70.js +1 -1
  54. package/dist/packem_chunks/handler71.js +1 -1
  55. package/dist/packem_chunks/handler72.js +1 -1
  56. package/dist/packem_chunks/handler73.js +1 -1
  57. package/dist/packem_chunks/handler74.js +1 -1
  58. package/dist/packem_chunks/handler75.js +32 -32
  59. package/dist/packem_chunks/handler76.js +1 -1
  60. package/dist/packem_chunks/handler77.js +3 -3
  61. package/dist/packem_chunks/handler78.js +26 -26
  62. package/dist/packem_chunks/handler9.js +1 -1
  63. package/dist/packem_chunks/heal-accept.js +1 -1
  64. package/dist/packem_chunks/heal.js +1 -1
  65. package/dist/packem_chunks/help-command.js +1 -1
  66. package/dist/packem_chunks/index2.js +32 -32
  67. package/dist/packem_chunks/index6.js +1 -1
  68. package/dist/packem_chunks/keys-refresh.js +1 -1
  69. package/dist/packem_chunks/lean.js +3 -4
  70. package/dist/packem_chunks/list.js +1 -1
  71. package/dist/packem_chunks/loader.js +1 -1
  72. package/dist/packem_chunks/prompts.js +1 -1
  73. package/dist/packem_chunks/status.js +1 -1
  74. package/dist/packem_chunks/sync.js +1 -1
  75. package/dist/packem_chunks/sync2.js +1 -1
  76. package/dist/packem_chunks/tripwire.js +1 -1
  77. package/dist/packem_chunks/verify-lockfile.js +1 -1
  78. package/dist/packem_shared/Table-Bo1JKNCN-CGGet8ES.js +34 -0
  79. package/dist/packem_shared/{affected-selection-BJXJW_3Q.js → affected-selection-CrW7fWEd.js} +1 -1
  80. package/dist/packem_shared/{ai-fix-BC6aIRJT.js → ai-fix-D9MxigBQ.js} +1 -1
  81. package/dist/packem_shared/{bin-Dx8mjl3g.js → bin-D3TtXgz6.js} +1 -1
  82. package/dist/packem_shared/command-runtime-HSsYGCQd.js +1 -0
  83. package/dist/packem_shared/{ecosystem-gate-CeV20GSB.js → ecosystem-gate-ByxWtzPE.js} +1 -1
  84. package/dist/packem_shared/{failure-log-D2x5BT8S.js → failure-log-BP-gCUb5.js} +1 -1
  85. package/dist/packem_shared/{formatBytes-BHAzNIrn-CrusHOew.js → formatBytes-_HvjOy8a-B_qQr4Hw.js} +3 -3
  86. package/dist/packem_shared/{getRandomSpinner-4ZEcbTYv-DCyIuj19.js → getRandomSpinner-DX11qCB2-CoIsn7ZU.js} +1 -1
  87. package/dist/packem_shared/{index-C_ScJMpb.js → index-BKbMnn8K.js} +1 -1
  88. package/dist/packem_shared/{index-nEyN71oX.js → index-DGdD4w-b.js} +1 -1
  89. package/dist/packem_shared/index.server-Ca_EEVfw.js +2 -0
  90. package/dist/packem_shared/{lifecycle-D6PMPor-.js → lifecycle-DvmDIRbb.js} +1 -1
  91. package/dist/packem_shared/package-version-QFmE9anh.js +4 -0
  92. package/dist/packem_shared/{packument-Df46y5MY.js → packument-zb18Jnlw.js} +1 -1
  93. package/dist/packem_shared/pm-runner-RM72mDZg.js +1 -0
  94. package/dist/packem_shared/{project-name-filter-CH8Ih7Qr.js → project-name-filter-DIqpdsvP.js} +1 -1
  95. package/dist/packem_shared/{provenance-DKeR0Ig1.js → provenance-L1M2FPy_.js} +1 -1
  96. package/dist/packem_shared/{registry-keys-DwB3ZXS_.js → registry-keys-DxdqMzyp.js} +1 -1
  97. package/dist/packem_shared/{resolve-explicit-BmV8YBE-.js → resolve-explicit-CQa37JSq.js} +1 -1
  98. package/dist/packem_shared/resolve-runtime-DNukUjIr.js +1 -0
  99. package/dist/packem_shared/{s1ngularity-DZhkIqL4.js → s1ngularity-CO5GkkqX.js} +1 -1
  100. package/dist/packem_shared/{scan-progress-CkumcBG-.js → scan-progress-RwCRxJdX.js} +1 -1
  101. package/dist/packem_shared/{signatures-BxTMck2l.js → signatures-DIqFUOfs.js} +1 -1
  102. package/dist/packem_shared/spinner-BJjbNl1F.js +1 -0
  103. package/dist/packem_shared/toolchain-Bz70UIcp.js +5 -0
  104. package/dist/packem_shared/{typosquats-8u0drCqQ.js → typosquats-D4DEHhFy.js} +1 -1
  105. package/dist/packem_shared/{vis-update-app-BCIccZfA.js → vis-update-app-9b2kSk9f.js} +1 -1
  106. package/dist/packem_shared/{vis-user-error-Dd7hwxlW.js → vis-user-error-S0Fesz5y.js} +11 -11
  107. package/dist/packem_shared/watch-loop-BEnGuMBn.js +11 -0
  108. package/dist/release/core/version-actions/index.d.ts +1 -1
  109. package/dist/release/presets.d.ts +1 -55
  110. package/dist/release/presets.js +1 -1
  111. package/dist/release/types.d.ts +1 -18
  112. package/index.d.ts +204 -204
  113. package/index.js +26 -26
  114. package/package.json +13 -13
  115. package/schemas/vis-config.schema.json +6 -28
  116. package/schemas/vis-release-config.schema.json +1 -12
  117. package/dist/packem_shared/Table-BB8xHTU5-BLPS917D.js +0 -11
  118. package/dist/packem_shared/command-runtime-p4IXiIf6.js +0 -1
  119. package/dist/packem_shared/index.server-sXNQYpsl.js +0 -2
  120. package/dist/packem_shared/package-version-CiRZecQu.js +0 -4
  121. package/dist/packem_shared/pm-runner-3iiQayy-.js +0 -1
  122. package/dist/packem_shared/resolve-runtime-CNiHcVtx.js +0 -1
  123. package/dist/packem_shared/spinner-ukDEdGvp.js +0 -1
  124. package/dist/packem_shared/toolchain-BRdpaAC4.js +0 -5
  125. package/dist/packem_shared/watch-loop-BBkg02-Q.js +0 -11
@@ -1 +0,0 @@
1
- import{r as i}from"./resolve-runtime-CNiHcVtx.js";const t=e=>{if(e!==null&&typeof e=="object"&&"runtime"in e){const r=e.runtime;if(typeof r=="string")return r}},u=(e,r)=>{const n=i(r,{config:e.visConfig?.runtime,flag:t(e.options)});return n.deferredNotice!==void 0&&e.logger?.warn?.(n.deferredNotice),n},a=e=>e.runtime==="bun"?"bun":void 0;export{a,u as r};
@@ -1,2 +0,0 @@
1
- const G=/^-{1,2}(no-color|no-colors|color=false|color=never)$/,D=/^-{1,2}(color=256)$/,P=/^-{1,2}(color=16m|color=full|color=truecolor)$/,L=/^-{1,2}(color|colors|color=true|color=always)$/,F=/-mono|dumb/i,Y=/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/,j=/-256(color)?$/i,W=/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i,V=()=>{const t=globalThis.process?.getBuiltinModule;return typeof t!="function"?"":t("node:os").release()},_=(t,e={})=>{const{isTTY:s,sniffFlags:i=!0}=e,c=globalThis,g=c.Deno!=null,u=c.process??c.Deno??{},$=u.argv??u.args??[],p=i?$.indexOf("--"):-1,a=f=>{if(!i)return!1;const R=$.findIndex(k=>f.test(k));return R!==-1&&(p===-1||R<p)};let n={};try{n=g?c.Deno.env.toObject():u.env??{}}catch{}const o="FORCE_COLOR",b=o in n,l=n[o]??void 0,m=typeof l=="string",y=typeof l=="number";let B;if(l==="true")B=1;else if(l==="false")B=0;else if(m&&l.length===0)B=1;else if(m&&l.length>0){const f=Number.parseInt(l,10);B=Number.isNaN(f)?void 0:Math.max(0,Math.min(f,3))}else y&&(B=Number.isNaN(l)?void 0:Math.max(0,Math.min(l,3)));if(l!=="true"&&l!=="false"&&B!==void 0&&B<4)return B;const w=b&&B!==void 0&&B>0;if(b&&B===0||a(G)||!w&&"NO_COLOR"in n)return 0;if(a(D))return 2;if(a(P))return 3;if(a(L))return 1;const T=B??0;if("TF_BUILD"in n&&"AGENT_NAME"in n)return 1;if(n.TERM&&F.test(n.TERM))return T;if(g?c.Deno.build.os==="windows":u.platform==="win32"){if("WT_SESSION"in n)return 3;if("ANSICON"in n)return 1;try{let f;g?f=c.Deno.osRelease():typeof u.os?.release=="function"?f=u.os.release():f=V();const R=f.split(".");return Number(R[0])>=10&&Number(R[2])>=10586?Number(R[2])>=14931?3:2:1}catch{}}if("CI"in n)return["GITEA_ACTIONS","CIRCLECI","GITHUB_WORKFLOW","GITHUB_ACTIONS"].some(f=>f in n)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(f=>f in n)||n.CI_NAME==="codeship"?1:T;if(n.TERMINAL_EMULATOR?.includes("JediTerm"))return 3;if("TEAMCITY_VERSION"in n)return Y.test(n.TEAMCITY_VERSION)?1:0;if(n.COLORTERM==="truecolor"||n.TERM==="xterm-kitty"||n.TERM==="xterm-ghostty"||n.TERM==="wezterm")return 3;if("TERM_PROGRAM"in n){const f=Number.parseInt((n.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(n.TERM_PROGRAM==="iTerm.app")return f>=3?3:2;if(n.TERM_PROGRAM==="Apple_Terminal")return 2}if(j.test(n.TERM))return 2;let O;return s!==void 0?O=s:g?O=t==="out"?c.Deno.stdout.isTerminal():c.Deno.stderr.isTerminal():"PM2_HOME"in n&&"pm_id"in n?O=!0:O=!!u[`std${t}`]?.isTTY,O&&W.test(n.TERM)||"COLORTERM"in n?1:T},H=()=>_("out"),U=()=>_("err");function q({onlyFirst:t=!1}={}){const e="(?:\\u001B\\][^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(e,t?void 0:"g")}const M=(t,e,s)=>e>t?e:Math.min(t,s),z=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,J=t=>{let[,e]=z.exec(t)??[];const s=e?e.length:0;if(s===3){const c=e.charAt(0),g=e.charAt(1),u=e.charAt(2);e=c+c+g+g+u+u}else if(s!==6)return globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`[@visulima/colorize] Invalid hex color "${t}"; expected a 3- or 6-digit hex string (e.g. "#96C" or "#E0115F"). Falling back to black.`),[0,0,0];const i=Number.parseInt(e,16);return[i>>16&255,i>>8&255,i&255]},v=(t,e,s)=>t===e&&e===s?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/51)+6*Math.round(e/51)+Math.round(s/51),C=t=>{let e,s,i;if(t<8)return 30+t;if(t<16)return 90+(t-8);if(t>=232)e=s=i=((t-232)*10+8)/255;else{t-=16;const u=t%36;e=Math.floor(t/36)/5,s=Math.floor(u/6)/5,i=u%6/5}const c=Math.max(e,s,i)*2;if(c===0)return 30;const g=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(e));return c===2?g+60:g},S=(t,e,s)=>C(v(t,e,s)),h=39,d=49,N=10,E={close:"",open:""},I=t=>{const e=t>0?(o,b)=>({close:`\x1B[${String(b)}m`,open:`\x1B[${String(o)}m`}):()=>E,s=o=>(b,l,m)=>o(v(Number(b),Number(l),Number(m))),i=o=>b=>{const[l,m,y]=J(b);return o(l,m,y)};let c=o=>e(`38;5;${String(o)}`,h),g=o=>e(`48;5;${String(o)}`,d),u=(o,b,l)=>e(`38;2;${String(o)};${String(b)};${String(l)}`,h),$=(o,b,l)=>e(`48;2;${String(o)};${String(b)};${String(l)}`,d);t===1?(c=o=>e(C(Number(o)),h),g=o=>e(C(Number(o))+N,d),u=(o,b,l)=>e(S(Number(o),Number(b),Number(l)),h),$=(o,b,l)=>e(S(Number(o),Number(b),Number(l))+N,d)):t===2&&(u=s(c),$=s(g));const p={bold:e(1,22),dim:e(2,22),hidden:e(8,28),inverse:e(7,27),italic:e(3,23),overline:e(53,55),reset:e(0,0),strike:e(9,29),strikethrough:e(9,29),underline:e(4,24),underlineCurly:e("4:3",24),underlineDashed:e("4:5",24),underlineDotted:e("4:4",24),underlineDouble:e("4:2",24),visible:E},a={bgBlack:e(40,d),bgBlackBright:e(100,d),bgBlue:e(44,d),bgBlueBright:e(104,d),bgCyan:e(46,d),bgCyanBright:e(106,d),bgGray:e(100,d),bgGreen:e(42,d),bgGreenBright:e(102,d),bgGrey:e(100,d),bgMagenta:e(45,d),bgMagentaBright:e(105,d),bgRed:e(41,d),bgRedBright:e(101,d),bgWhite:e(47,d),bgWhiteBright:e(107,d),bgYellow:e(43,d),bgYellowBright:e(103,d),black:e(30,h),blackBright:e(90,h),blue:e(34,h),blueBright:e(94,h),cyan:e(36,h),cyanBright:e(96,h),gray:e(90,h),green:e(32,h),greenBright:e(92,h),grey:e(90,h),magenta:e(35,h),magentaBright:e(95,h),red:e(31,h),redBright:e(91,h),white:e(37,h),whiteBright:e(97,h),yellow:e(33,h),yellowBright:e(93,h)},n={bg:o=>g(M(o,0,255)),bgHex:i($),bgRgb:(o,b,l)=>$(M(o,0,255),M(b,0,255),M(l,0,255)),fg:o=>c(M(o,0,255)),hex:i(u),rgb:(o,b,l)=>u(M(o,0,255),M(b,0,255),M(l,0,255))};return{baseColors:a,baseStyles:p,styleMethods:n}},x=H(),K=U();I(x);const X=(t,e,s)=>{if(e==="")return t;let i=t.indexOf(e);if(i<0)return t;const c=e.length;let g=0,u="";for(;~i;)u+=t.slice(g,i)+s,g=i+c,i=t.indexOf(e,g);return u+t.slice(g)},Z=(t,e,s)=>{if(t==null||t==="")return"";let i;if(t.raw===void 0?i=String(t):i=String.raw(t,...e),i.includes("\x1B"))for(let c=s;c;c=c.props)i=X(i,c.close,c.open);return i.includes(`
2
- `)&&(i=i.replace(/(\r*\n)/g,`${s.closeStack}$1${s.openStack}`)),s.openStack+i+s.closeStack},A=function(t){const e=t?.level??x,{baseColors:s,baseStyles:i,styleMethods:c}=I(e),g={};let u=null;const $=({props:a},{close:n,open:o})=>{const b=(a?.openStack??"")+o,l=n+(a?.closeStack??""),m=(y,...B)=>Z(y,B,m.props);return Object.setPrototypeOf(m,u),m.props={close:n,closeStack:l,open:o,openStack:b,props:a},m.open=b,m.close=l,m},p=a=>String(a);p.strip=a=>a.replaceAll(q(),"");for(const a in s)g[a]={get(){const n=$(this,s[a]);return Object.defineProperty(this,a,{value:n}),n}};for(const a in i)g[a]={get(){const n=$(this,i[a]);return Object.defineProperty(this,a,{value:n}),n}};for(const a in c)g[a]={get(){return(...n)=>$(this,c[a](...n))}};return g.ansi256=g.fg,g.bgAnsi256=g.bg,u=Object.defineProperties({},g),Object.setPrototypeOf(p,u),p},r=new A;new A({level:K});r.ansi256;r.bg;r.bgAnsi256;r.bgHex;r.bgRgb;r.fg;r.hex;r.rgb;r.strip;r.bgBlack;r.bgBlackBright;r.bgBlue;r.bgBlueBright;r.bgCyan;r.bgCyanBright;r.bgGray;r.bgGreen;r.bgGreenBright;r.bgGrey;r.bgMagenta;r.bgMagentaBright;r.bgRed;r.bgRedBright;r.bgWhite;r.bgWhiteBright;r.bgYellow;r.bgYellowBright;r.black;r.blackBright;r.blue;r.blueBright;const Q=r.bold,ee=r.cyan;r.cyanBright;const re=r.dim;r.gray;const te=r.green;r.greenBright;r.grey;r.hidden;const ne=r.inverse;r.italic;const oe=r.magenta;r.magentaBright;r.overline;const ie=r.red;r.redBright;r.reset;r.strike;r.strikethrough;const se=r.underline;r.underlineCurly;r.underlineDashed;r.underlineDotted;r.underlineDouble;r.visible;r.white;r.whiteBright;const le=r.yellow;r.yellowBright;export{U as $,re as F,te as J,ne as P,oe as T,ie as X,le as b,se as e,Q as j,ee as q,r as t,H as w};
@@ -1,4 +0,0 @@
1
- import{createRequire as ht}from"node:module";import{k as De,m as te,z as ie,a as gt,g as Lt,f as St}from"./index-BzhrR_iC.js";import{L as we}from"./index-BisalDCf.js";import{a as re,g as vt}from"./_commonjsHelpers-DTfxOvZk.js";import{r as Ct,a as Pt}from"./clean-DRiLimTx.js";import{p as bt}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";let ut;const pt=h=>(ut??=ht(import.meta.url))(h),G=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=h=>{if(typeof G<"u"&&G.versions&&G.versions.node){const[e,t]=G.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return G.getBuiltinModule(h)}return pt(h)},{dirname:ft}=R("node:path"),ye=R("node:url"),{fileURLToPath:dt}=ye,be=R("node:module"),{createRequire:mt}=be,yt=R("util"),E=h=>"Deno"in h,wi=()=>{if(E(globalThis)){const h=globalThis.Deno,e=h.execPath();let t=e;try{const{importMeta:i}=globalThis;i?.url&&(t=i.url)}catch{}return[e,t,...h.args]}return process.argv},Ai=()=>E(globalThis)?globalThis.Deno.cwd():process.cwd(),xi=()=>{if(E(globalThis)){const h=globalThis.Deno;return new Proxy(h.env.toObject(),{get:(e,t)=>typeof t=="string"?h.env.get(t):e[t],has:(e,t)=>typeof t=="string"?h.env.has(t):t in e,set:(e,t,i)=>typeof t=="string"?(i===void 0||h.env.set(t,i),!0):!1})}return process.env},Ei=()=>E(globalThis)?[]:process.execArgv,Oi=()=>E(globalThis)?globalThis.Deno.execPath():process.execPath,Ni=()=>{if(E(globalThis)){const h=globalThis.Deno.build?.os??"unknown";return h==="windows"?"win32":h}return process.platform},Fi=()=>{if(E(globalThis)){const h=globalThis.Deno.build?.arch??"unknown";return h==="x86_64"?"x64":h==="aarch64"?"arm64":h}return process.arch},Gi=(h=0)=>{if(E(globalThis))throw globalThis.Deno.exit(h),new Error("Deno exit failed");process.exit(h)},$i=(h,e)=>{if(E(globalThis))return()=>{};const t=process;return t.on(h,e),()=>{t.removeListener(h,e)}};var U,se;function Ae(){return se||(se=1,U=["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"]),U}var M,oe;function Dt(){return oe||(oe=1,M=["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"]),M}var k,le;function wt(){return le||(le=1,k=["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"]),k}var _,ae;function At(){if(ae)return _;ae=1;var h=[].concat(Ae()).concat(Dt()),e=wt();return _=function(t){var i=0;function s(){return i<t.length}function n(L){if(L instanceof RegExp){var c=t.slice(i),g=c.match(L);if(g)return i+=g[0].length,g[0]}else if(t.indexOf(L,i)===i)return i+=L.length,L}function l(){n(/[ ]*/)}function a(){for(var L,c=["WITH","AND","OR","(",")",":","+"],g=0;g<c.length&&(L=n(c[g]),!L);g++);if(L==="+"&&i>1&&t[i-2]===" ")throw new Error("Space before `+`");return L&&{type:"OPERATOR",string:L}}function o(){return n(/[A-Za-z0-9-.]+/)}function u(){var L=o();if(!L)throw new Error("Expected idstring at offset "+i);return L}function f(){if(n("DocumentRef-")){var L=u();return{type:"DOCUMENTREF",string:L}}}function S(){if(n("LicenseRef-")){var L=u();return{type:"LICENSEREF",string:L}}}function b(){var L=i,c=o();if(h.indexOf(c)!==-1)return{type:"LICENSE",string:c};if(e.indexOf(c)!==-1)return{type:"EXCEPTION",string:c};i=L}function v(){return a()||f()||S()||b()}for(var C=[];s()&&(l(),!!s());){var m=v();if(!m)throw new Error("Unexpected `"+t[i]+"` at offset "+i);C.push(m)}return C},_}var W,ce;function xt(){return ce||(ce=1,W=function(h){var e=0;function t(){return e<h.length}function i(){return t()?h[e]:null}function s(){if(!t())throw new Error;e++}function n(m){var L=i();if(L&&L.type==="OPERATOR"&&m===L.string)return s(),L.string}function l(){if(n("WITH")){var m=i();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function a(){var m=e,L="",c=i();if(c.type==="DOCUMENTREF"&&(s(),L+="DocumentRef-"+c.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(c=i(),c.type==="LICENSEREF")return s(),L+="LicenseRef-"+c.string,{license:L};e=m}function o(){var m=i();if(m&&m.type==="LICENSE"){s();var L={license:m.string};n("+")&&(L.plus=!0);var c=l();return c&&(L.exception=c),L}}function u(){var m=n("(");if(m){var L=v();if(!n(")"))throw new Error("Expected `)`");return L}}function f(){return u()||a()||o()}function S(m,L){return function c(){var g=L();if(g){if(!n(m))return g;var y=c();if(!y)throw new Error("Expected expression");return{left:g,conjunction:m.toLowerCase(),right:y}}}}var b=S("AND",f),v=S("OR",b),C=v();if(!C||t())throw new Error("Syntax error");return C}),W}var H,he;function xe(){if(he)return H;he=1;var h=At(),e=xt();return H=function(t){return e(h(t))},H}var j,ue;function Et(){if(ue)return j;ue=1;var h=xe(),e=Ae();function t(c){try{return h(c),!0}catch{return!1}}function i(c,g){var y=g[0].length-c[0].length;return y!==0?y:c[0].toUpperCase().localeCompare(g[0].toUpperCase())}var s=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(i),n=0,l=1,a=[function(c){return c.toUpperCase()},function(c){return c.trim()},function(c){return c.replace(/\./g,"")},function(c){return c.replace(/\s+/g,"")},function(c){return c.replace(/\s+/g,"-")},function(c){return c.replace("v","-")},function(c){return c.replace(/,?\s*(\d)/,"-$1")},function(c){return c.replace(/,?\s*(\d)/,"-$1.0")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(c){return c[0].toUpperCase()+c.slice(1)},function(c){return c.replace("/","-")},function(c){return c.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(c){return c.indexOf("3.0")!==-1?c+"-or-later":c+"-only"},function(c){return c+"only"},function(c){return c.replace(/(\d)$/,"-$1.0")},function(c){return c.replace(/(-| )?(\d)$/,"-$2-Clause")},function(c){return c.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(c){return c.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(c){return c.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(c){return c.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(c){return c.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(c){return c.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(c){return"CC-"+c},function(c){return"CC-"+c+"-4.0"},function(c){return c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(c){return"CC-"+c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],o=e.map(function(c){var g=/^(.*)-\d+\.\d+$/.exec(c);return g?[g[0],g[1]]:[c,null]}).reduce(function(c,g){var y=g[1];return c[y]=c[y]||[],c[y].push(g[0]),c},{}),u=Object.keys(o).map(function(g){return[g,o[g]]}).filter(function(g){return g[1].length===1&&g[0]!==null&&g[0]!=="APL"}).map(function(g){return[g[0],g[1][0]]});o=void 0;var f=[["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(u).sort(i),S=0,b=1,v=function(c){for(var g=0;g<a.length;g++){var y=a[g](c).trim();if(y!==c&&t(y))return y}return null},C=function(c){for(var g=c.toUpperCase(),y=0;y<f.length;y++){var r=f[y];if(g.indexOf(r[S])>-1)return r[b]}return null},m=function(c,g){for(var y=0;y<s.length;y++){var r=s[y],p=r[n];if(c.indexOf(p)>-1){var d=c.replace(p,r[l]),P=g(d);if(P!==null)return P}}return null};j=function(c,g){g=g||{};var y=g.upgrade===void 0?!0:!!g.upgrade;function r(D){return y?L(D):D}var p=typeof c=="string"&&c.trim().length!==0;if(!p)throw Error("Invalid argument. Expected non-empty string.");if(c=c.trim(),t(c))return r(c);var d=c.replace(/\+$/,"").trim();if(t(d))return r(d);var P=v(c);return P!==null||(P=m(c,function(D){return t(D)?D:v(D)}),P!==null)||(P=C(c),P!==null)||(P=m(c,C),P!==null)?r(P):null};function L(c){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(c)!==-1?c+"-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(c)!==-1?c.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(c)!==-1?c+"-or-later":c}return j}var z,pe;function Ot(){if(pe)return z;pe=1;var h=xe(),e=Et(),t='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',i=/^SEE LICEN[CS]E IN (.+)$/;function s(l,a){return a.slice(0,l.length)===l}function n(l){if(l.hasOwnProperty("license")){var a=l.license;return s("LicenseRef",a)||s("DocumentRef",a)}else return n(l.left)||n(l.right)}return z=function(l){var a;try{a=h(l)}catch{var o;if(l==="UNLICENSED"||l==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(o=i.exec(l))return{validForOldPackages:!0,validForNewPackages:!0,inFile:o[1]};var u={validForOldPackages:!1,validForNewPackages:!1,warnings:[t]};if(l.trim().length!==0){var f=e(l);f&&u.warnings.push('license is similar to the valid expression "'+f+'"')}return u}return n(a)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[t]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},z}var Ee={hasSubscribers:!1},w=Ee,F=Ee;import("node:diagnostics_channel").then(h=>{w=h.channel("lru-cache:metrics"),F=h.tracingChannel("lru-cache")}).catch(()=>{});var Nt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Y=()=>w.hasSubscribers||F.hasSubscribers,Oe=new Set,fe=process||{},Ft=(h,e,t,i)=>{typeof fe.emitWarning=="function"?fe.emitWarning(h,e,t,i):console.error(`[${t}] ${e}: ${h}`)},Gt=h=>!Oe.has(h),N=h=>!!h&&h===Math.floor(h)&&h>0&&isFinite(h),Ne=h=>N(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?B:null:null,B=class extends Array{constructor(e){super(e),this.fill(0)}},$t=class T{heap;length;static#n=!1;static create(e){let t=Ne(e);if(!t)return[];T.#n=!0;let i=new T(e,t);return T.#n=!1,i}constructor(e,t){if(!T.#n)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Tt=class Fe{#n;#c;#t;#O;#L;#B;#R;#S;get perf(){return this.#S}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#o;#v;#s;#r;#e;#u;#f;#h;#l;#C;#a;#P;#y;#d;#m;#b;#I;#p;#N;static unsafeExposeInternals(e){return{starts:e.#y,ttls:e.#d,autopurgeTimers:e.#m,sizes:e.#P,keyMap:e.#s,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#f,get head(){return e.#h},get tail(){return e.#l},free:e.#C,isBackgroundFetch:t=>e.#i(t),backgroundFetch:(t,i,s,n)=>e.#k(t,i,s,n),moveToTail:t=>e.#T(t),indexes:t=>e.#D(t),rindexes:t=>e.#w(t),isStale:t=>e.#g(t)}}get max(){return this.#n}get maxSize(){return this.#c}get calculatedSize(){return this.#v}get size(){return this.#o}get fetchMethod(){return this.#B}get memoMethod(){return this.#R}get dispose(){return this.#t}get onInsert(){return this.#O}get disposeAfter(){return this.#L}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:l,updateAgeOnHas:a,allowStale:o,dispose:u,onInsert:f,disposeAfter:S,noDisposeOnSet:b,noUpdateTTL:v,maxSize:C=0,maxEntrySize:m=0,sizeCalculation:L,fetchMethod:c,memoMethod:g,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:r,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:d,ignoreFetchAbort:P,backgroundFetchSize:D=1,perf:A}=e;if(this.backgroundFetchSize=D,A!==void 0&&typeof A?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#S=A??Nt,t!==0&&!N(t))throw new TypeError("max option must be a nonnegative integer");let x=t?Ne(t):Array;if(!x)throw new Error("invalid max value: "+t);if(this.#n=t,this.#c=C,this.maxEntrySize=m||this.#c,this.sizeCalculation=L,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(g!==void 0&&typeof g!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#R=g,c!==void 0&&typeof c!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#B=c,this.#I=!!c,this.#s=new Map,this.#r=Array.from({length:t}).fill(void 0),this.#e=Array.from({length:t}).fill(void 0),this.#u=new x(t),this.#f=new x(t),this.#h=0,this.#l=0,this.#C=$t.create(t),this.#o=0,this.#v=0,typeof u=="function"&&(this.#t=u),typeof f=="function"&&(this.#O=f),typeof S=="function"?(this.#L=S,this.#a=[]):(this.#L=void 0,this.#a=void 0),this.#b=!!this.#t,this.#N=!!this.#O,this.#p=!!this.#L,this.noDisposeOnSet=!!b,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#c!==0&&!N(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!N(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!r,this.updateAgeOnGet=!!l,this.updateAgeOnHas=!!a,this.ttlResolution=N(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!N(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#_()}if(this.#n===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#c){let I="LRU_CACHE_UNBOUNDED";Gt(I)&&(Oe.add(I),Ft("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",I,Fe))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#_(){let e=new B(this.#n),t=new B(this.#n);this.#d=e,this.#y=t;let i=this.ttlAutopurge?Array.from({length:this.#n}):void 0;this.#m=i,this.#W=(o,u,f=this.#S.now())=>{t[o]=u!==0?f:0,e[o]=u,s(o,u)},this.#F=o=>{t[o]=e[o]!==0?this.#S.now():0,s(o,e[o])};let s=this.ttlAutopurge?(o,u)=>{if(i?.[o]&&(clearTimeout(i[o]),i[o]=void 0),u&&u!==0&&i){let f=setTimeout(()=>{this.#g(o)?(this.#A(this.#r[o],"expire"),i[o]=void 0):s(o,a(o))},u+1);f.unref&&f.unref(),i[o]=f}}:()=>{};this.#x=(o,u)=>{if(e[u]){let f=e[u],S=t[u];if(!f||!S)return;o.ttl=f,o.start=S,o.now=n||l();let b=o.now-S;o.remainingTTL=f-b}};let n=0,l=()=>{let o=this.#S.now();if(this.ttlResolution>0){n=o;let u=setTimeout(()=>n=0,this.ttlResolution);u.unref&&u.unref()}return o};this.getRemainingTTL=o=>{let u=this.#s.get(o);return u===void 0?0:a(u)};let a=o=>{let u=e[o],f=t[o];if(!u||!f)return 1/0;let S=(n||l())-f;return u-S};this.#g=o=>{let u=t[o],f=e[o];return!!f&&!!u&&(n||l())-u>f}}#F=()=>{};#x=()=>{};#W=()=>{};#g=()=>!1;#V(){let e=new B(this.#n);this.#v=0,this.#P=e,this.#G=t=>{this.#v-=e[t],e[t]=0},this.#H=(t,i,s,n)=>{if(!N(s)){if(this.#i(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!N(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#U=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#v>n;)this.#M(!0)}this.#v+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#v)}}#G=e=>{};#U=(e,t,i)=>{};#H=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#D({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#l;this.#j(t)&&((e||!this.#g(t))&&(yield t),t!==this.#h);)t=this.#f[t]}*#w({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#h;this.#j(t)&&((e||!this.#g(t))&&(yield t),t!==this.#l);)t=this.#u[t]}#j(e){return e!==void 0&&this.#s.get(this.#r[e])===e}*entries(){for(let e of this.#D())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#w())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#D()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*rkeys(){for(let e of this.#w()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*values(){for(let e of this.#D())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#w())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#D()){let s=this.#e[i],n=this.#i(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#r[i],this))return this.#$(this.#r[i],t)}}forEach(e,t=this){for(let i of this.#D()){let s=this.#e[i],n=this.#i(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#r[i],this)}}rforEach(e,t=this){for(let i of this.#w()){let s=this.#e[i],n=this.#i(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#r[i],this)}}purgeStale(){let e=!1;for(let t of this.#w({allowStale:!0}))this.#g(t)&&(this.#A(this.#r[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#e[t],s=this.#i(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#y){let l=this.#d[t],a=this.#y[t];if(l&&a){let o=l-(this.#S.now()-a);n.ttl=o,n.start=Date.now()}}return this.#P&&(n.size=this.#P[t]),n}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let i=this.#r[t],s=this.#e[t],n=this.#i(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let l={value:n};if(this.#d&&this.#y){l.ttl=this.#d[t];let a=this.#S.now()-this.#y[t];l.start=Math.floor(Date.now()-a)}this.#P&&(l.size=this.#P[t]),e.unshift([i,l])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#S.now()-s}this.#E(t,i.value,i)}}set(e,t,i={}){let{status:s=w.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#E(e,t,i);return s&&w.hasSubscribers&&w.publish(s),n}#E(e,t,i,s){let{ttl:n=this.ttl,start:l,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:u}=i,f=this.#i(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:S=this.noUpdateTTL}=i;u&&!f&&(u.value=t);let b=this.#H(e,t,i.size||0,o,u);if(this.maxEntrySize&&b>this.maxEntrySize)return this.#A(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let v=this.#o===0?void 0:this.#s.get(e);if(v===void 0)v=this.#o===0?this.#l:this.#C.length!==0?this.#C.pop():this.#o===this.#n?this.#M(!1):this.#o,this.#r[v]=e,this.#e[v]=t,this.#s.set(e,v),this.#u[this.#l]=v,this.#f[v]=this.#l,this.#l=v,this.#o++,this.#U(v,b,u),u&&(u.set="add"),S=!1,this.#N&&!f&&this.#O?.(t,e,"add");else{this.#T(v);let C=this.#e[v];if(t!==C){if(!a)if(this.#i(C)){C!==s&&C.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=C;m!==void 0&&m!==t&&(this.#b&&this.#t?.(m,e,"set"),this.#p&&this.#a?.push([m,e,"set"]))}else this.#b&&this.#t?.(C,e,"set"),this.#p&&this.#a?.push([C,e,"set"]);if(this.#G(v),this.#U(v,b,u),this.#e[v]=t,!f){let m=C&&this.#i(C)?C.__staleWhileFetching:C,L=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=L,m!==void 0&&(u.oldValue=m)),this.#N&&this.onInsert?.(t,e,L)}}else f||(u&&(u.set="update"),this.#N&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#_(),this.#d&&(S||this.#W(v,n,l),u&&this.#x(u,v)),!a&&this.#p&&this.#a){let C=this.#a,m;for(;m=C?.shift();)this.#L?.(...m)}return this}pop(){try{for(;this.#o;){let e=this.#e[this.#h];if(this.#M(!0),this.#i(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#a){let e=this.#a,t;for(;t=e?.shift();)this.#L?.(...t)}}}#M(e){let t=this.#h,i=this.#r[t],s=this.#e[t],n=this.#i(s);n&&s.__abortController.abort(new Error("evicted"));let l=n?s.__staleWhileFetching:s;return(this.#b||this.#p)&&l!==void 0&&(this.#b&&this.#t?.(l,i,"evict"),this.#p&&this.#a?.push([l,i,"evict"])),this.#G(t),this.#m?.[t]&&(clearTimeout(this.#m[t]),this.#m[t]=void 0),e&&(this.#r[t]=void 0,this.#e[t]=void 0,this.#C.push(t)),this.#o===1?(this.#h=this.#l=0,this.#C.length=0):this.#h=this.#u[t],this.#s.delete(i),this.#o--,t}has(e,t={}){let{status:i=w.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#K(e,t);return w.hasSubscribers&&w.publish(i),s}#K(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let l=this.#e[n];if(this.#i(l)&&l.__staleWhileFetching===void 0)return!1;if(this.#g(n))s&&(s.has="stale",this.#x(s,n));else return i&&this.#F(n),s&&(s.has="hit",this.#x(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=Y()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#X(e,t);return w.hasSubscribers&&w.publish(i),s}#X(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#g(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let l=this.#e[n],a=this.#i(l)?l.__staleWhileFetching:l;return i&&(a!==void 0?(i.peek="hit",i.value=a):i.peek="miss"),a}#k(e,t,i,s){let n=t===void 0?void 0:this.#e[t];if(this.#i(n))return n;let l=new AbortController,{signal:a}=i;a?.addEventListener("abort",()=>l.abort(a.reason),{signal:l.signal});let o={signal:l.signal,options:i,context:s},u=(m,L=!1)=>{let{aborted:c}=l.signal,g=i.ignoreFetchAbort&&m!==void 0,y=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&m!==void 0);if(i.status&&(c&&!L?(i.status.fetchAborted=!0,i.status.fetchError=l.signal.reason,g&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),c&&!g&&!L)return S(l.signal.reason,y);let r=v,p=this.#e[t];return(p===v||p===void 0&&g&&L)&&(m===void 0?r.__staleWhileFetching!==void 0?this.#e[t]=r.__staleWhileFetching:this.#A(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#E(e,m,o.options,r))),m},f=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),S(m,!1)),S=(m,L)=>{let{aborted:c}=l.signal,g=c&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,r=y||i.noDeleteOnFetchRejection,p=v;if(this.#e[t]===v&&(!r||!L&&p.__staleWhileFetching===void 0?this.#A(e,"fetch"):g||(this.#e[t]=p.__staleWhileFetching)),y)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw m},b=(m,L)=>{let c=this.#B?.(e,n,o);l.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=g=>u(g,!0)))}),c&&c instanceof Promise?c.then(g=>m(g===void 0?void 0:g),L):c!==void 0&&m(c)};i.status&&(i.status.fetchDispatched=!0);let v=new Promise(b).then(u,f),C=Object.assign(v,{__abortController:l,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#E(e,C,{...o.options,status:void 0}),t=this.#s.get(e)):this.#e[t]=C,C}#i(e){if(!this.#I)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=F.hasSubscribers,{status:s=Y()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#z(e,t);return s&&i&&(s.trace=!0,F.tracePromise(()=>n,s).catch(()=>{})),n}async#z(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:l=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:C=this.allowStaleOnFetchAbort,context:m,forceRefresh:L=!1,status:c,signal:g}=t;if(c&&(c.op="fetch",c.key=e,L&&(c.forceRefresh=!0),c.cache=this),!this.#I)return c&&(c.fetch="get"),this.#$(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:c});let y={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:l,noDisposeOnSet:a,size:o,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:C,ignoreFetchAbort:v,status:c,signal:g},r=this.#s.get(e);if(r===void 0){c&&(c.fetch="miss");let p=this.#k(e,r,y,m);return p.__returned=p}else{let p=this.#e[r];if(this.#i(p)){let A=i&&p.__staleWhileFetching!==void 0;return c&&(c.fetch="inflight",A&&(c.returnedStale=!0)),A?p.__staleWhileFetching:p.__returned=p}let d=this.#g(r);if(!L&&!d)return c&&(c.fetch="hit"),this.#T(r),s&&this.#F(r),c&&this.#x(c,r),p;let P=this.#k(e,r,y,m),D=P.__staleWhileFetching!==void 0&&i;return c&&(c.fetch=d?"stale":"refresh",D&&d&&(c.returnedStale=!0)),D?P.__staleWhileFetching:P.__returned=P}}forceFetch(e,t={}){let i=F.hasSubscribers,{status:s=Y()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#J(e,t);return s&&i&&(s.trace=!0,F.tracePromise(()=>n,s).catch(()=>{})),n}async#J(e,t={}){let i=await this.#z(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=w.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Z(e,t);return i&&(i.value=s),w.hasSubscribers&&w.publish(i),s}#Z(e,t={}){let i=this.#R;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:l,...a}=t;n&&l&&(n.forceRefresh=!0);let o=this.#$(e,a),u=l||o===void 0;if(n&&(n.memo=u?"miss":"hit",u||(n.value=o)),!u)return o;let f=i(e,o,{options:a,context:s});return n&&(n.value=f),this.#E(e,f,a),f}get(e,t={}){let{status:i=w.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#$(e,t);return i&&(s!==void 0&&(i.value=s),w.hasSubscribers&&w.publish(i)),s}#$(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:l}=t,a=this.#s.get(e);if(a===void 0){l&&(l.get="miss");return}let o=this.#e[a],u=this.#i(o);return l&&this.#x(l,a),this.#g(a)?u?(l&&(l.get="stale-fetching"),i&&o.__staleWhileFetching!==void 0?(l&&(l.returnedStale=!0),o.__staleWhileFetching):void 0):(n||this.#A(e,"expire"),l&&(l.get="stale"),i?(l&&(l.returnedStale=!0),o):void 0):(l&&(l.get=u?"fetching":"hit"),this.#T(a),s&&this.#F(a),u?o.__staleWhileFetching:o)}#Y(e,t){this.#f[t]=e,this.#u[e]=t}#T(e){e!==this.#l&&(e===this.#h?this.#h=this.#u[e]:this.#Y(this.#f[e],this.#u[e]),this.#Y(this.#l,e),this.#l=e)}delete(e){return this.#A(e,"delete")}#A(e,t){w.hasSubscribers&&w.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#o!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#m?.[s]&&(clearTimeout(this.#m[s]),this.#m[s]=void 0),i=!0,this.#o===1)this.#q(t);else{this.#G(s);let n=this.#e[s];if(this.#i(n)?n.__abortController.abort(new Error("deleted")):(this.#b||this.#p)&&(this.#b&&this.#t?.(n,e,t),this.#p&&this.#a?.push([n,e,t])),this.#s.delete(e),this.#r[s]=void 0,this.#e[s]=void 0,s===this.#l)this.#l=this.#f[s];else if(s===this.#h)this.#h=this.#u[s];else{let l=this.#f[s];this.#u[l]=this.#u[s];let a=this.#u[s];this.#f[a]=this.#f[s]}this.#o--,this.#C.push(s)}}if(this.#p&&this.#a?.length){let s=this.#a,n;for(;n=s?.shift();)this.#L?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#w({allowStale:!0})){let i=this.#e[t];if(this.#i(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#r[t];this.#b&&this.#t?.(i,s,e),this.#p&&this.#a?.push([i,s,e])}}if(this.#s.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#y){this.#d.fill(0),this.#y.fill(0);for(let t of this.#m??[])t!==void 0&&clearTimeout(t);this.#m?.fill(void 0)}if(this.#P&&this.#P.fill(0),this.#h=0,this.#l=0,this.#C.length=0,this.#v=0,this.#o=0,this.#p&&this.#a){let t=this.#a,i;for(;i=t?.shift();)this.#L?.(...i)}}};const Bt=Object.defineProperty({__proto__:null,LRUCache:Tt},Symbol.toStringTag,{value:"Module"}),Rt=re(Bt);var q,de;function It(){if(de)return q;de=1;const h=(...n)=>n.every(l=>l)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",t=n=>n.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:n,user:l,project:a,committish:o})=>`git@${n}:${l}/${a}.git${h("#",o)}`,sshurltemplate:({domain:n,user:l,project:a,committish:o})=>`git+ssh://git@${n}/${l}/${a}.git${h("#",o)}`,edittemplate:({domain:n,user:l,project:a,committish:o,editpath:u,path:f})=>`https://${n}/${l}/${a}${h("/",u,"/",e(o||"HEAD"),"/",f)}`,browsetemplate:({domain:n,user:l,project:a,committish:o,treepath:u})=>`https://${n}/${l}/${a}${h("/",u,"/",e(o))}`,browsetreetemplate:({domain:n,user:l,project:a,committish:o,treepath:u,path:f,fragment:S,hashformat:b})=>`https://${n}/${l}/${a}/${u}/${e(o||"HEAD")}/${f}${h("#",b(S||""))}`,browseblobtemplate:({domain:n,user:l,project:a,committish:o,blobpath:u,path:f,fragment:S,hashformat:b})=>`https://${n}/${l}/${a}/${u}/${e(o||"HEAD")}/${f}${h("#",b(S||""))}`,docstemplate:({domain:n,user:l,project:a,treepath:o,committish:u})=>`https://${n}/${l}/${a}${h("/",o,"/",e(u))}#readme`,httpstemplate:({auth:n,domain:l,user:a,project:o,committish:u})=>`git+https://${h(n,"@")}${l}/${a}/${o}.git${h("#",u)}`,filetemplate:({domain:n,user:l,project:a,committish:o,path:u})=>`https://${n}/${l}/${a}/raw/${e(o||"HEAD")}/${u}`,shortcuttemplate:({type:n,user:l,project:a,committish:o})=>`${n}:${l}/${a}${h("#",o)}`,pathtemplate:({user:n,project:l,committish:a})=>`${n}/${l}${h("#",a)}`,bugstemplate:({domain:n,user:l,project:a})=>`https://${n}/${l}/${a}/issues`,hashformat:t},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:l,project:a,committish:o,path:u})=>`https://${h(n,"@")}raw.githubusercontent.com/${l}/${a}/${e(o||"HEAD")}/${u}`,gittemplate:({auth:n,domain:l,user:a,project:o,committish:u})=>`git://${h(n,"@")}${l}/${a}/${o}.git${h("#",u)}`,tarballtemplate:({domain:n,user:l,project:a,committish:o})=>`https://codeload.${n}/${l}/${a}/tar.gz/${e(o||"HEAD")}`,extract:n=>{let[,l,a,o,u]=n.pathname.split("/",5);if(!(o&&o!=="tree")&&(o||(u=n.hash.slice(1)),a&&a.endsWith(".git")&&(a=a.slice(0,-4)),!(!l||!a)))return{user:l,project:a,committish:u}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:l,project:a,committish:o,treepath:u,path:f,editpath:S})=>`https://${n}/${l}/${a}${h("/",u,"/",e(o||"HEAD"),"/",f,S)}`,tarballtemplate:({domain:n,user:l,project:a,committish:o})=>`https://${n}/${l}/${a}/get/${e(o||"HEAD")}.tar.gz`,extract:n=>{let[,l,a,o]=n.pathname.split("/",4);if(!["get"].includes(o)&&(a&&a.endsWith(".git")&&(a=a.slice(0,-4)),!(!l||!a)))return{user:l,project:a,committish:n.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:({domain:n,user:l,project:a,committish:o})=>`https://${n}/api/v4/projects/${e(l+"/"+a)}/repository/archive.tar.gz?sha=${e(o||"HEAD")}`,extract:n=>{const l=n.pathname.slice(1);if(l.includes("/-/")||l.includes("/archive.tar.gz"))return;const a=l.split("/");let o=a.pop();o.endsWith(".git")&&(o=o.slice(0,-4));const u=a.join("/");if(!(!u||!o))return{user:u,project:o,committish:n.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:l,committish:a})=>`git@${n}:${l}.git${h("#",a)}`,sshurltemplate:({domain:n,project:l,committish:a})=>`git+ssh://git@${n}/${l}.git${h("#",a)}`,edittemplate:({domain:n,user:l,project:a,committish:o,editpath:u})=>`https://${n}/${l}/${a}${h("/",e(o))}/${u}`,browsetemplate:({domain:n,project:l,committish:a})=>`https://${n}/${l}${h("/",e(a))}`,browsetreetemplate:({domain:n,project:l,committish:a,path:o,hashformat:u})=>`https://${n}/${l}${h("/",e(a))}${h("#",u(o))}`,browseblobtemplate:({domain:n,project:l,committish:a,path:o,hashformat:u})=>`https://${n}/${l}${h("/",e(a))}${h("#",u(o))}`,docstemplate:({domain:n,project:l,committish:a})=>`https://${n}/${l}${h("/",e(a))}`,httpstemplate:({domain:n,project:l,committish:a})=>`git+https://${n}/${l}.git${h("#",a)}`,filetemplate:({user:n,project:l,committish:a,path:o})=>`https://gist.githubusercontent.com/${n}/${l}/raw${h("/",e(a))}/${o}`,shortcuttemplate:({type:n,project:l,committish:a})=>`${n}:${l}${h("#",a)}`,pathtemplate:({project:n,committish:l})=>`${n}${h("#",l)}`,bugstemplate:({domain:n,project:l})=>`https://${n}/${l}`,gittemplate:({domain:n,project:l,committish:a})=>`git://${n}/${l}.git${h("#",a)}`,tarballtemplate:({project:n,committish:l})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(l||"HEAD")}`,extract:n=>{let[,l,a,o]=n.pathname.split("/",4);if(o!=="raw"){if(!a){if(!l)return;a=l,l=null}return a.endsWith(".git")&&(a=a.slice(0,-4)),{user:l,project:a,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+t(n)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:l,project:a,committish:o,path:u})=>`https://${n}/${l}/${a}/blob/${e(o)||"HEAD"}/${u}`,httpstemplate:({domain:n,user:l,project:a,committish:o})=>`https://${n}/${l}/${a}${h("#",o)}`,tarballtemplate:({domain:n,user:l,project:a,committish:o})=>`https://${n}/${l}/${a}/archive/${e(o)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,l,a,o]=n.pathname.split("/",4);if(!["archive"].includes(o)&&(a&&a.endsWith(".git")&&(a=a.slice(0,-4)),!(!l||!a)))return{user:l,project:a,committish:n.hash.slice(1)}}};for(const[n,l]of Object.entries(s))s[n]=Object.assign({},i,l);return q=s,q}var V,me;function Ge(){if(me)return V;me=1;const h=(s,n,l)=>{const a=s.indexOf(l);return s.lastIndexOf(n,a>-1?a:1/0)},e=s=>{try{return new URL(s)}catch{}},t=(s,n)=>{const l=s.indexOf(":"),a=s.slice(0,l+1);if(Object.prototype.hasOwnProperty.call(n,a)||s.substr(l,3)==="://")return s;const o=s.indexOf("@");return o>-1?o>l?`git+ssh://${s}`:s:`${s.slice(0,l+1)}//${s.slice(l+1)}`},i=s=>{const n=h(s,"@","#"),l=h(s,":","#");return l>n&&(s=s.slice(0,l)+"/"+s.slice(l+1)),h(s,":","#")===-1&&s.indexOf("//")===-1&&(s=`git+ssh://${s}`),s};return V=(s,n)=>{const l=n?t(s,n):s;return e(l)||e(i(l))},V}var K,ge;function Ut(){if(ge)return K;ge=1;const h=Ge(),e=t=>{const i=t.indexOf("#"),s=t.indexOf("/"),n=t.indexOf("/",s+1),l=t.indexOf(":"),a=/\s/.exec(t),o=t.indexOf("@"),u=!a||i>-1&&a.index>i,f=o===-1||i>-1&&o>i,S=l===-1||i>-1&&l>i,b=n===-1||i>-1&&n>i,v=s>0,C=i>-1?t[i-1]!=="/":!t.endsWith("/"),m=!t.startsWith(".");return u&&v&&C&&m&&f&&S&&b};return K=(t,i,{gitHosts:s,protocols:n})=>{if(!t)return;const l=e(t)?`github:${t}`:t,a=h(l,n);if(!a)return;const o=s.byShortcut[a.protocol],u=s.byDomain[a.hostname.startsWith("www.")?a.hostname.slice(4):a.hostname],f=o||u;if(!f)return;const S=s[o||u];let b=null;n[a.protocol]?.auth&&(a.username||a.password)&&(b=`${a.username}${a.password?":"+a.password:""}`);let v=null,C=null,m=null,L=null;try{if(o){let c=a.pathname.startsWith("/")?a.pathname.slice(1):a.pathname;const g=c.indexOf("@");g>-1&&(c=c.slice(g+1));const y=c.lastIndexOf("/");y>-1?(C=decodeURIComponent(c.slice(0,y)),C||(C=null),m=decodeURIComponent(c.slice(y+1))):m=decodeURIComponent(c),m.endsWith(".git")&&(m=m.slice(0,-4)),a.hash&&(v=decodeURIComponent(a.hash.slice(1))),L="shortcut"}else{if(!S.protocols.includes(a.protocol))return;const c=S.extract(a);if(!c)return;C=c.user&&decodeURIComponent(c.user),m=decodeURIComponent(c.project),v=decodeURIComponent(c.committish),L=n[a.protocol]?.name||a.protocol.slice(0,-1)}}catch(c){if(c instanceof URIError)return;throw c}return[f,C,b,m,v,L,i]},K}var X,Le;function Mt(){if(Le)return X;Le=1;const{LRUCache:h}=Rt,e=It(),t=Ut(),i=Ge(),s=new h({max:1e3});function n(a){try{const{protocol:o,hostname:u,pathname:f}=new URL(a);if(!u)return null;const S=/(?:git\+)http:$/.test(o)?"http:":"https:",b=f.replace(/\.git$/,"");return`${S}//${u}${b}`}catch{return null}}class l{constructor(o,u,f,S,b,v,C={}){Object.assign(this,l.#n[o],{type:o,user:u,auth:f,project:S,committish:b,default:v,opts:C})}static#n={byShortcut:{},byDomain:{}};static#c={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(o,u){l.#n[o]=u,l.#n.byDomain[u.domain]=o,l.#n.byShortcut[`${o}:`]=o,l.#c[`${o}:`]={name:o}}static fromUrl(o,u){if(typeof o!="string")return;const f=o+JSON.stringify(u||{});if(!s.has(f)){const S=t(o,u,{gitHosts:l.#n,protocols:l.#c});s.set(f,S?new l(...S):void 0)}return s.get(f)}static fromManifest(o,u={}){if(!o||typeof o!="object")return;const f=o.repository,S=f&&(typeof f=="string"?f:typeof f=="object"&&typeof f.url=="string"?f.url:null);if(!S)throw new Error("no repository");const b=S&&l.fromUrl(S.replace(/^git\+/,""),u)||null;if(b)return b;const v=n(S);return l.fromUrl(v,u)||v}static parseUrl(o){return i(o)}#t(o,u){if(typeof o!="function")return null;const f={...this,...this.opts,...u};f.path||(f.path=""),f.path.startsWith("/")&&(f.path=f.path.slice(1)),f.noCommittish&&(f.committish=null);const S=o(f);return f.noGitPlus&&S.startsWith("git+")?S.slice(4):S}hash(){return this.committish?`#${this.committish}`:""}ssh(o){return this.#t(this.sshtemplate,o)}sshurl(o){return this.#t(this.sshurltemplate,o)}browse(o,...u){return typeof o!="string"?this.#t(this.browsetemplate,o):typeof u[0]!="string"?this.#t(this.browsetreetemplate,{...u[0],path:o}):this.#t(this.browsetreetemplate,{...u[1],fragment:u[0],path:o})}browseFile(o,...u){return typeof u[0]!="string"?this.#t(this.browseblobtemplate,{...u[0],path:o}):this.#t(this.browseblobtemplate,{...u[1],fragment:u[0],path:o})}docs(o){return this.#t(this.docstemplate,o)}bugs(o){return this.#t(this.bugstemplate,o)}https(o){return this.#t(this.httpstemplate,o)}git(o){return this.#t(this.gittemplate,o)}shortcut(o){return this.#t(this.shortcuttemplate,o)}path(o){return this.#t(this.pathtemplate,o)}tarball(o){return this.#t(this.tarballtemplate,{...o,noCommittish:!1})}file(o,u){return this.#t(this.filetemplate,{...u,path:o})}edit(o,u){return this.#t(this.edittemplate,{...u,path:o})}getDefaultRepresentation(){return this.default}toString(o){return this.default&&typeof this[this.default]=="function"?this[this.default](o):this.sshurl(o)}}for(const[a,o]of Object.entries(e))l.addHost(a,o);return X=l,X}var J,Se;function kt(){if(Se)return J;Se=1,J=h;function h(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
2
- `);let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;const i=e.length;let s=t+1;for(;s<i&&e[s].trim();)s++;return e.slice(t,s).join(" ").trim()}return J}var $e={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"},Te={web:"url",name:"url"},Be={server:"start",tests:"test"};const _t={topLevel:$e,bugs:Te,script:Be},Wt=Object.defineProperty({__proto__:null,bugs:Te,default:_t,script:Be,topLevel:$e},Symbol.toStringTag,{value:"Module"}),Ht=re(Wt);var Z,ve;function jt(){if(ve)return Z;ve=1;var{URL:h}=ye,e=Ct(),t=Pt(),i=Ot(),s=Mt(),{isBuiltin:n}=be,l=["dependencies","devDependencies","optionalDependencies"],a=kt(),o=Ht,u=r=>r.includes("@")&&r.indexOf("@")<r.lastIndexOf(".");Z={warn:function(){},fixRepositoryField:function(r){if(r.repositories&&(this.warn("repositories"),r.repository=r.repositories[0]),!r.repository)return this.warn("missingRepository");typeof r.repository=="string"&&(r.repository={type:"git",url:r.repository});var p=r.repository.url||"";if(p){var d=s.fromUrl(p);d&&(p=r.repository.url=d.getDefaultRepresentation()==="shortcut"?d.https():d.toString())}p.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",p)},fixTypos:function(r){Object.keys(o.topLevel).forEach(function(p){Object.prototype.hasOwnProperty.call(r,p)&&this.warn("typo",p,o.topLevel[p])},this)},fixScriptsField:function(r){if(r.scripts){if(typeof r.scripts!="object"){this.warn("nonObjectScripts"),delete r.scripts;return}Object.keys(r.scripts).forEach(function(p){typeof r.scripts[p]!="string"?(this.warn("nonStringScript"),delete r.scripts[p]):o.script[p]&&!r.scripts[o.script[p]]&&this.warn("typo",p,o.script[p],"scripts")},this)}},fixFilesField:function(r){var p=r.files;p&&!Array.isArray(p)?(this.warn("nonArrayFiles"),delete r.files):r.files&&(r.files=r.files.filter(function(d){return!d||typeof d!="string"?(this.warn("invalidFilename",d),!1):!0},this))},fixBinField:function(r){if(r.bin&&typeof r.bin=="string"){var p={},d;(d=r.name.match(/^@[^/]+[/](.*)$/))?p[d[1]]=r.bin:p[r.name]=r.bin,r.bin=p}},fixManField:function(r){r.man&&typeof r.man=="string"&&(r.man=[r.man])},fixBundleDependenciesField:function(r){var p="bundledDependencies",d="bundleDependencies";r[p]&&!r[d]&&(r[d]=r[p],delete r[p]),r[d]&&!Array.isArray(r[d])?(this.warn("nonArrayBundleDependencies"),delete r[d]):r[d]&&(r[d]=r[d].filter(function(P){return!P||typeof P!="string"?(this.warn("nonStringBundleDependency",P),!1):(r.dependencies||(r.dependencies={}),Object.prototype.hasOwnProperty.call(r.dependencies,P)||(this.warn("nonDependencyBundleDependency",P),r.dependencies[P]="*"),!0)},this))},fixDependencies:function(r){g(r,this.warn),L(r,this.warn),this.fixBundleDependenciesField(r),["dependencies","devDependencies"].forEach(function(p){if(p in r){if(!r[p]||typeof r[p]!="object"){this.warn("nonObjectDependencies",p),delete r[p];return}Object.keys(r[p]).forEach(function(d){var P=r[p][d];typeof P!="string"&&(this.warn("nonStringDependency",d,JSON.stringify(P)),delete r[p][d]);var D=s.fromUrl(r[p][d]);D&&(r[p][d]=D.toString())},this)}},this)},fixModulesField:function(r){r.modules&&(this.warn("deprecatedModules"),delete r.modules)},fixKeywordsField:function(r){typeof r.keywords=="string"&&(r.keywords=r.keywords.split(/,\s+/)),r.keywords&&!Array.isArray(r.keywords)?(delete r.keywords,this.warn("nonArrayKeywords")):r.keywords&&(r.keywords=r.keywords.filter(function(p){return typeof p!="string"||!p?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(r,p){var d=!p;if(!r.version)return r.version="",!0;if(!e(r.version,d))throw new Error('Invalid version: "'+r.version+'"');return r.version=t(r.version,d),!0},fixPeople:function(r){v(r,C),v(r,m)},fixNameField:function(r,p){typeof p=="boolean"?p={strict:p}:typeof p>"u"&&(p={});var d=p.strict;if(!r.name&&!d){r.name="";return}if(typeof r.name!="string")throw new Error("name field must be a string.");d||(r.name=r.name.trim()),b(r.name,d,p.allowLegacyCase),n(r.name)&&this.warn("conflictingName",r.name)},fixDescriptionField:function(r){r.description&&typeof r.description!="string"&&(this.warn("nonStringDescription"),delete r.description),r.readme&&!r.description&&(r.description=a(r.readme)),r.description===void 0&&delete r.description,r.description||this.warn("missingDescription")},fixReadmeField:function(r){r.readme||(this.warn("missingReadme"),r.readme="ERROR: No README data found!")},fixBugsField:function(r){if(!r.bugs&&r.repository&&r.repository.url){var p=s.fromUrl(r.repository.url);p&&p.bugs()&&(r.bugs={url:p.bugs()})}else if(r.bugs){if(typeof r.bugs=="string")u(r.bugs)?r.bugs={email:r.bugs}:h.canParse(r.bugs)?r.bugs={url:r.bugs}:this.warn("nonEmailUrlBugsString");else{y(r.bugs,this.warn);var d=r.bugs;r.bugs={},d.url&&(h.canParse(d.url)?r.bugs.url=d.url:this.warn("nonUrlBugsUrlField")),d.email&&(typeof d.email=="string"&&u(d.email)?r.bugs.email=d.email:this.warn("nonEmailBugsEmailField"))}!r.bugs.email&&!r.bugs.url&&(delete r.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(r){if(!r.homepage&&r.repository&&r.repository.url){var p=s.fromUrl(r.repository.url);p&&p.docs()&&(r.homepage=p.docs())}if(r.homepage){if(typeof r.homepage!="string")return this.warn("nonUrlHomepage"),delete r.homepage;h.canParse(r.homepage)||(r.homepage="http://"+r.homepage)}},fixLicenseField:function(r){const p=r.license||r.licence;if(!p)return this.warn("missingLicense");if(typeof p!="string"||p.length<1||p.trim()==="")return this.warn("invalidLicense");if(!i(p).validForNewPackages)return this.warn("invalidLicense")}};function f(r){if(r.charAt(0)!=="@")return!1;var p=r.slice(1).split("/");return p.length!==2?!1:p[0]&&p[1]&&p[0]===encodeURIComponent(p[0])&&p[1]===encodeURIComponent(p[1])}function S(r){return!r.match(/[/@\s+%:]/)&&r===encodeURIComponent(r)}function b(r,p,d){if(r.charAt(0)==="."||!(f(r)||S(r))||p&&!d&&r!==r.toLowerCase()||r.toLowerCase()==="node_modules"||r.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(r))}function v(r,p){return r.author&&(r.author=p(r.author)),["maintainers","contributors"].forEach(function(d){Array.isArray(r[d])&&(r[d]=r[d].map(p))}),r}function C(r){if(typeof r=="string")return r;var p=r.name||"",d=r.url||r.web,P=d?" ("+d+")":"",D=r.email||r.mail,A=D?" <"+D+">":"";return p+A+P}function m(r){if(typeof r!="string")return r;var p=r.match(/^([^(<]+)/),d=r.match(/\(([^()]+)\)/),P=r.match(/<([^<>]+)>/),D={};return p&&p[0].trim()&&(D.name=p[0].trim()),P&&(D.email=P[1]),d&&(D.url=d[1]),D}function L(r){var p=r.optionalDependencies;if(p){var d=r.dependencies||{};Object.keys(p).forEach(function(P){d[P]=p[P]}),r.dependencies=d}}function c(r,p,d){if(!r)return{};if(typeof r=="string"&&(r=r.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(r))return r;d("deprecatedArrayDependencies",p);var P={};return r.filter(function(D){return typeof D=="string"}).forEach(function(D){D=D.trim().split(/(:?[@\s><=])/);var A=D.shift(),x=D.join("");x=x.trim(),x=x.replace(/^@/,""),P[A]=x}),P}function g(r,p){l.forEach(function(d){r[d]&&(r[d]=c(r[d],d,p))})}function y(r,p){r&&Object.keys(r).forEach(function(d){o.bugs[d]&&(p("typo",d,o.bugs[d],"bugs"),r[o.bugs[d]]=r[d],delete r[d])})}return Z}var Re="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Ie="No repository field.",Ue="Probably broken git url: %s",Me="scripts must be an object",ke="script values must be string commands",_e="Invalid 'files' member",We="Invalid filename in 'files' list: %s",He="Invalid 'bundleDependencies' list. Must be array of package names",je="Invalid bundleDependencies member: %s",ze="Non-dependency in bundleDependencies: %s",Ye="%s field must be an object",qe="Invalid dependency: %s %s",Ve="specifying %s as array is deprecated",Ke="modules field is deprecated",Xe="keywords should be an array of strings",Je="keywords should be an array of strings",Ze="%s is also the name of a node core module.",Qe="'description' field should be a string",et="No description",tt="No README data",it="No license field.",rt="Bug string field must be url, email, or {email,url}",nt="bugs.url field must be a string url. Deleted.",st="bugs.email field must be a string email. Deleted.",ot="Normalized value of bugs field is an empty object. Deleted.",lt="homepage field must be a string url. Deleted.",at="license should be a valid SPDX license expression",ct="%s should probably be %s.";const zt={repositories:Re,missingRepository:Ie,brokenGitUrl:Ue,nonObjectScripts:Me,nonStringScript:ke,nonArrayFiles:_e,invalidFilename:We,nonArrayBundleDependencies:He,nonStringBundleDependency:je,nonDependencyBundleDependency:ze,nonObjectDependencies:Ye,nonStringDependency:qe,deprecatedArrayDependencies:Ve,deprecatedModules:Ke,nonArrayKeywords:Xe,nonStringKeyword:Je,conflictingName:Ze,nonStringDescription:Qe,missingDescription:et,missingReadme:tt,missingLicense:it,nonEmailUrlBugsString:rt,nonUrlBugsUrlField:nt,nonEmailBugsEmailField:st,emptyNormalizedBugs:ot,nonUrlHomepage:lt,invalidLicense:at,typo:ct},Yt=Object.defineProperty({__proto__:null,brokenGitUrl:Ue,conflictingName:Ze,default:zt,deprecatedArrayDependencies:Ve,deprecatedModules:Ke,emptyNormalizedBugs:ot,invalidFilename:We,invalidLicense:at,missingDescription:et,missingLicense:it,missingReadme:tt,missingRepository:Ie,nonArrayBundleDependencies:He,nonArrayFiles:_e,nonArrayKeywords:Xe,nonDependencyBundleDependency:ze,nonEmailBugsEmailField:st,nonEmailUrlBugsString:rt,nonObjectDependencies:Ye,nonObjectScripts:Me,nonStringBundleDependency:je,nonStringDependency:qe,nonStringDescription:Qe,nonStringKeyword:Je,nonStringScript:ke,nonUrlBugsUrlField:nt,nonUrlHomepage:lt,repositories:Re,typo:ct},Symbol.toStringTag,{value:"Module"}),qt=re(Yt);var Q,Ce;function Vt(){if(Ce)return Q;Ce=1;var h=yt,e=qt;Q=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return t.apply(null,i);var n=e[s]?e[s]:s+": '%s'";return i.unshift(n),h.format.apply(null,i)};function t(i,s,n){return n&&(i=n+"['"+i+"']",s=n+"['"+s+"']"),h.format(e.typo,i,s)}return Q}var ee,Pe;function Kt(){if(Pe)return ee;Pe=1,ee=n;var h=jt();n.fixer=h;var e=Vt(),t=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=t.map(function(a){return l(a)+"Field"});s=s.concat(i);function n(a,o,u){o===!0&&(o=null,u=!0),u||(u=!1),(!o||a.private)&&(o=function(){}),a.scripts&&a.scripts.install==="node-gyp rebuild"&&!a.scripts.preinstall&&(a.gypfile=!0),h.warn=function(){o(e.apply(null,arguments))},s.forEach(function(f){h["fix"+l(f)](a,u)}),a._id=a.name+"@"+a.version}function l(a){return a.charAt(0).toUpperCase()+a.slice(1)}return ee}var Xt=Kt();const Jt=vt(Xt),Zt=(h,e,t)=>{const i=te(h),s=te(e),n=s===i?".":gt(i,s);return t.some(l=>{const a=l.startsWith("./")?l.slice(2):l,o=n.startsWith("./")?n.slice(2):n;if(a==="."&&o===".")return!0;if(a.endsWith("/**")){const u=a.slice(0,-3);return o===u||o.startsWith(`${u}/`)}if(a.endsWith("/*")){const u=a.slice(0,-2);return u===""?o!=="."&&!o.includes("/"):o.startsWith(`${u}/`)||o===u}return o===a||o.startsWith(`${a}/`)})},Qt=h=>{const e=De("pnpm-workspace.yaml",{cwd:te(h),type:"file"});if(!e)return;const t=we(ie(e)),i=Array.isArray(t.packages)?t.packages:[];if(!Zt(e,h,i))return;const s={};return t.catalog&&typeof t.catalog=="object"&&(s.catalog=t.catalog),t.catalogs&&typeof t.catalogs=="object"&&(s.catalogs=t.catalogs),Object.keys(s).length>0?s:void 0},ei=(h,e,t)=>{if(e==="catalog:")return t.catalog?.[h];if(e.startsWith("catalog:")){const i=e.slice(8);return t.catalogs?.[i]?.[h]}},ti=(h,e)=>{for(const[t,i]of Object.entries(h)){if(typeof i!="string")continue;const s=ei(t,i,e);s&&(h[t]=s)}},ii=(h,e)=>{const t=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const i of t){if(!h[i]||typeof h[i]!="object")continue;const s=h[i];ti(s,e)}};let ri;const ni=h=>(ri??=mt(import.meta.url))(h),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ne=h=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[e,t]=$.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return $.getBuiltinModule(h)}return ni(h)},{existsSync:Bi}=ne("node:fs"),{createInterface:Ri}=ne("node:readline"),{styleText:Ii}=ne("node:util"),si=new Set(["__proto__","prototype","constructor"]);Math.max(...[...si].map(h=>h.length));typeof process.stdout<"u"&&!process.versions.deno&&globalThis.window;const oi=/, ([^,]*)$/,li=new Map,ai=(h,e={})=>{const t=e.strict&&e.ignoreWarnings?e.ignoreWarnings.map(String).toSorted((i,s)=>i.localeCompare(s)).join(","):"";return`${h}|s${String(e.strict?1:0)}|c${String(e.resolveCatalogs?1:0)}|j${String(e.json5===!1?0:1)}|y${String(e.yaml===!1?0:1)}|w${t}`};class ci extends Error{constructor(e){super(`The following warnings were encountered while normalizing package data:
3
- - ${e.join(`
4
- - `)}`),this.name="PackageJsonValidationError"}}const hi=(h,e,t=[])=>{const i=[];if(Jt(h,s=>{i.push(s)},e),e&&i.length>0){const s=i.filter(n=>!t.some(l=>l instanceof RegExp?l.test(n):l===n));if(s.length>0)throw new ci(s)}return h},ui=h=>{const e=ie(h);return we(e)},pi=h=>{const e=ie(h);return St.parse(e)},fi=(h,e)=>e?.yaml!==!1&&(h.endsWith(".yaml")||h.endsWith(".yml"))?ui(h):e?.json5!==!1&&h.endsWith(".json5")?pi(h):bt(h),di=(h,e={})=>{const t={type:"file"};h&&(t.cwd=h);const i=["package.json"];e.yaml!==!1&&i.push("package.yaml","package.yml"),e.json5!==!1&&i.push("package.json5");const s=De(i,t);if(!s)throw new Lt(`No such file or directory, for ${i.join(", ").replace(oi," or $1")} found.`);const n=e.cache&&typeof e.cache!="boolean"?e.cache:li,l=ai(s,e);if(e.cache&&n.has(l))return n.get(l);const a=fi(s,e);if(e.resolveCatalogs){const u=Qt(s);u&&ii(a,u)}hi(a,e.strict??!1,e.ignoreWarnings);const o={packageJson:a,path:s};return e.cache&&n.set(l,o),o};var mi="4.3.1";const gi={version:mi},Li=gi.version,Si="@visulima/vis";let O;const Ui=()=>{if(O!==void 0)return O;const h=process.env.VIS_VERSION;if(h)return O=h,O;try{const{packageJson:e}=di(ft(dt(import.meta.url)),{json5:!1,yaml:!1});if(e.name===Si&&typeof e.version=="string")return O=e.version,O}catch{}return O=Li,O};export{Oi as a,xi as b,Gi as c,Ai as d,$i as e,Ui as g,Fi as h,wi as i,Ei as l,Ni as u};
@@ -1 +0,0 @@
1
- import{createRequire as U}from"node:module";import{e as y,m as O,b as S,z as J}from"./index-BzhrR_iC.js";import{withEnhancedPath as Y,collectNodeModulesBinDirs as z}from"@visulima/task-runner";import{s as j}from"./index-B4AjSxHU.js";import{detectPackageManager as G,resolveAdd as H,resolveRemove as V,whichBin as X,resolveUnlink as K,resolveInstall as Q,execPmCommandInteractive as Z,resolveDlx as ee,resolveExec as ne,resolveDedupe as re,resolveWhy as se,resolveLink as ae,resolvePmCommand as ie}from"#native";import{y as R}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";let T;const x=e=>(T??=U(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[n,r]=k.versions.node.split(".").map(Number);if(n>22||n===22&&r>=3||n===20&&r>=16)return k.getBuiltinModule(e)}return x(e)},{spawn:F,spawnSync:E}=q("node:child_process"),p=(e,n,r,s)=>{for(const a of n)e.push("--filter",a);r&&e.push("--recursive"),s&&e.push("--workspace-root")},te=e=>{const n=[],r=[];return p(n,e.filter,e.recursive,e.workspaceRoot),e.silent&&n.push("--silent"),e.frozenLockfile&&n.push("--frozen-lockfile"),n.push("install"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.force&&n.push("--force"),e.ignoreScripts&&n.push("--ignore-scripts"),e.lockfileOnly&&n.push("--lockfile-only"),e.noOptional&&n.push("--no-optional"),e.offline&&n.push("--offline"),{args:n,bin:"aube",warnings:r}},oe=e=>{const n=[],r=[];return p(n,e.filter,!1,!1),n.push("add"),e.saveDev&&n.push("--save-dev"),e.exact&&n.push("--save-exact"),e.global&&n.push("--global"),e.optional&&n.push("--save-optional"),e.peer&&n.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&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},ue=e=>{const n=[];return p(n,e.filter,e.recursive,!1),n.push("remove"),e.saveDev&&n.push("--save-dev"),e.global&&n.push("--global"),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:[]}},ce=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},le=e=>{const n=[],r=[];p(n,e.filter,e.recursive,!1),n.push("why"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.json&&n.push("--json"),e.long&&n.push("--long"),e.parseable&&n.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[s,...a]=e.packages;return s===void 0?r.push("aube why requires a package name; none provided."):(a.length>0&&r.push("aube why takes a single package; using the first."),n.push(s)),{args:n,bin:"aube",warnings:r}},fe=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const r of e.additionalPackages)n.push("--package",r);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},de=e=>{const n=[];return p(n,e.filter,e.recursive,e.workspaceRoot),n.push("exec"),e.parallel&&n.push("--parallel"),e.reverse&&n.push("--reverse"),e.shellMode&&n.push("--shell-mode"),n.push(e.command),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},he=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},pe=(e,n)=>{const r=[],s=[];return n&&r.push("--recursive"),r.push("unlink"),e.length>1&&s.push("aube unlink takes a single package; using the first."),e.length>0&&r.push(e[0]),{args:r,bin:"aube",warnings:s}},ge=e=>{const n=["view","--",e.package],r=[],[s,...a]=e.fields;return s!==void 0?(a.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."),n.push(s)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:r}},Ye=e=>{const n=[],r=[];return p(n,e.filters,e.recursive,e.workspaceRoot),n.push("update"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.global&&n.push("--global"),e.interactive&&n.push("--interactive"),e.latest&&n.push("--latest"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},be=new Set(["fund","ping","search","token"]),ke=(e,n)=>be.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},w=256*1024,we=e=>{const n=e?{...process.env,...e}:{...process.env};return process.stderr.isTTY&&n.FORCE_COLOR===void 0&&n.NO_COLOR===void 0&&(n.FORCE_COLOR="1"),n},I=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,ve=async(e,n,r)=>new Promise((s,a)=>{const i=process.platform==="win32",t=F(i?I(e):e,i?n.map(o=>I(o)):[...n],{cwd:r.cwd,env:we(r.env),shell:i,stdio:["inherit","pipe","pipe"],windowsHide:!0});let c=[],f=0;const d=o=>{if(c.push(o),f+=o.length,!(f<=w)){for(;c.length>1&&f-c[0].length>w;)f-=c.shift().length;if(c.length===1&&f>w){const h=c[0];c[0]=h.subarray(h.length-w),f=w}}},b=()=>Buffer.concat(c).toString("utf8");t.stdout?.on("data",o=>{process.stdout.write(o),d(o)}),t.stderr?.on("data",o=>{process.stderr.write(o),d(o)}),t.on("error",a),t.on("close",o=>{const h=b();c=[],s({code:o??1,output:h})})}),v=e=>{const n=j.coerce(e);return n?j.gte(n,"11.0.0"):!1},l=e=>e.name==="yarn"&&!e.version.startsWith("1."),$=e=>e.name==="yarn"&&e.version.startsWith("1."),ye=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,me=(e,n,r)=>{switch(n){case"audit":return l(e)?{args:["npm","audit",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(l(e)){const[s,...a]=r;return s==="delete"?{args:["config","unset",...a],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 $(e)?{args:["tag",...r],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:l(e)?{args:["npm","tag",...ye(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 l(e)?{args:["npm",n,...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...r],bin:"npm",kind:"rewrite",warning:`bun has no \`${n}\`; falling back to \`npm ${n}\` (writes ~/.npmrc, which bun reads).`}:e.name==="deno"?{kind:"skip",warning:`deno has no \`${n}\`. JSR uses browser OAuth via \`deno publish\`.`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&v(e.version)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:l(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"&&v(e.version)?{args:["ping",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"pkg":return e.name==="bun"?{args:["pm","pkg",...r],bin:"bun",kind:"rewrite"}:e.name==="yarn"||e.name==="deno"?{args:["pkg",...r],bin:"npm",kind:"rewrite",warning:`${e.name} has no \`pkg\` command; falling back to \`npm pkg\`.`}:{kind:"passthrough"};case"plugin":return l(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return $(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:l(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 l(e)?{args:["npm","publish",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return $(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"&&v(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"&&v(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"&&v(e.version)?{args:["whoami",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:l(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"}}},A=e=>X(e)!==null,je=e=>{const n=[["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[a,i]of n)if(R(y(r,a)))return i;const s=O(r);if(s===r||S(r).root===r)return;r=s}},ze=(e,n)=>{if(n.name!=="aube")return;const r=je(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.`},C=e=>{if(R(e))try{return JSON.parse(J(e,{buffer:!1}))}catch{return}},Re=e=>{let n=e;for(;;){const r=y(n,"package.json"),s=C(r);if(s&&typeof s.packageManager=="string"&&s.packageManager.length>0)return s.packageManager;const a=O(n);if(a===n||S(n).root===n)return;n=a}},M=new Set(["npm","pnpm","yarn"]),P=(e,n,r)=>r===!1||!M.has(n)||!A("corepack")?!1:r===!0?!0:Re(e)!==void 0,Ge=(e,n)=>{const r=n.backend,s=process.env.VIS_INSTALLER,a=r??s??n.configBackend,i=n.configCorepack??"auto";if(a&&a!=="auto"){if(a==="aube"&&!A("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:a,useCorepack:P(e,a,i),version:"latest"}}if(A("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const t=$e(e);return{...t,useCorepack:P(e,t.name,i)}},$e=e=>{if(!R(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const n=G(e);return{name:n.name,version:n.version||"latest"}},L=(e,n)=>n.useCorepack!==!0||!M.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},Ae=(e,n,r)=>{if(r===void 0)return Z(e.bin,e.args,n);const s=E(e.bin,e.args,{cwd:n,env:{...process.env,...r},stdio:"inherit"});if(s.error)throw s.error;return s.status??1},u=(e,n,r,s,a={})=>{const i=L(n,e);for(const t of i.warnings)s.warn(`warning: ${t}`);return a.dry?(s.log(`[dry-run] ${i.bin} ${i.args.join(" ")}`),0):Ae(i,r,a.env)},g=(e,n,r,s,a={})=>u(e,n(),r,s,a),Oe=(e,n)=>n==="aube"||n==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},Se=(e,n,r)=>n!=="yarn"||r.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},W=(e,n,r)=>{let s=e.name==="aube"?te(n):Q(e.name,e.version,{...n,silent:n.silent||r.silent===!0});return r.preferOffline&&(s=Oe(s,e.name)),r.ciMode&&(s=Se(s,e.name,e.version)),s},He=(e,n,r,s,a={})=>{const i=W(e,n,a);return D(e,i,r,s,{dry:a.dry,env:a.env})},Ve=async(e,n,r,s,a={})=>{const i=L(W(e,n,a),e);for(const t of i.warnings)s.warn(`warning: ${t}`);return a.dry?(s.log(`[dry-run] ${i.bin} ${i.args.join(" ")}`),{code:0,output:""}):ve(i.bin,i.args,{cwd:r,env:a.env?{...process.env,...a.env}:process.env})},N=(e,n)=>{const r=n==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,r]}},Ce=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},D=(e,n,r,s,a)=>{if(a.dry!==!0)return u(e,n,r,s,a);const i=Ce(n,e.name);return i===null?u(e,n,r,s,a):u(e,i,r,s,{env:a.env})},De=(e,n)=>n==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:n==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},_e=(e,n,r,s,a={})=>{let i=e.name==="aube"?oe(n):H(e.name,e.version,n);a.ignoreScripts&&(i=De(i,e.name)),a.silent&&(i=N(i,e.name));const t=D(e,i,r,s,{dry:a.dry,env:a.env});return t===0&&a.autoInstallPeers&&Me(e,n,r,s,a),t},Ie=e=>{if(e.startsWith("@")){const r=e.indexOf("/");if(r===-1)return e;const s=e.indexOf("@",r);return s===-1?e:e.slice(0,s)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},Pe=(e,n)=>{let r=e;for(;;){const s=y(r,"node_modules",n,"package.json"),a=C(s);if(a)return a;const i=O(r);if(i===r||S(r).root===r)return;r=i}},Ee=e=>{const n=C(y(e,"package.json")),r=new Set;if(!n)return r;for(const s of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const a=n[s];if(a)for(const i of Object.keys(a))r.add(i)}return r},Me=(e,n,r,s,a)=>{if(e.name==="deno")return;const i=Ee(r),t=new Map;for(const d of n.packages){const b=Ie(d),o=Pe(r,b);if(!o?.peerDependencies)continue;const h=o.peerDependenciesMeta??{};for(const[m,B]of Object.entries(o.peerDependencies))h[m]?.optional||i.has(m)||t.has(m)||t.set(m,B)}if(t.size===0)return;const c=[...t.entries()].map(([d,b])=>`${d}@${b}`);s.log(`auto-installing peer dependencies: ${c.join(", ")}`);const f={exact:!1,filter:n.filter,global:!1,optional:!1,packages:c,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};_e(e,f,r,s,{ignoreScripts:a.ignoreScripts})},Xe=(e,n,r,s,a={})=>{let i=e.name==="aube"?ue(n):V(e.name,e.version,n);return a.silent&&(i=N(i,e.name)),D(e,i,r,s,{dry:a.dry,env:a.env})},Ke=(e,n,r,s,a={})=>e.name==="aube"?u(e,ce(n),r,s,a):g(e,()=>re(e.name,e.version,n),r,s,a),Qe=(e,n,r,s,a={})=>e.name==="aube"?u(e,le(n),r,s,a):g(e,()=>se(e.name,e.version,n),r,s,a),Le=(e,n)=>{if(e.name==="aube")return ge(n);const r=[],s=[],a=e.name;switch(e.name){case"bun":{const i=j.coerce(e.version);i&&j.lt(i,"1.3.0")&&s.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),r.push("pm","view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"deno":{const i=n.package.startsWith("npm:")||n.package.startsWith("jsr:")||n.package.startsWith("https://")||n.package.startsWith("http://")||n.package.startsWith("file:")?n.package:`npm:${n.package}`;r.push("info","--",i),n.json&&r.push("--json"),n.fields.length>0&&s.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{r.push("view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){r.push("info","--",n.package);const[i,...t]=n.fields;i!==void 0&&(t.length>0&&s.push("yarn v1 only supports querying one field at a time; using the first."),r.push(i)),n.json&&r.push("--json")}else r.push("npm","info","--",n.package),n.fields.length>0&&s.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&r.push("--json");break}default:{const i=e.name;throw new Error(`Unsupported package manager: ${i}`)}}return{args:r,bin:a,warnings:s}},Ze=(e,n,r,s,a={})=>u(e,Le(e,n),r,s,a),en=(e,n,r,s,a={})=>e.name==="aube"?u(e,he(n),r,s,a):g(e,()=>ae(e.name,e.version,n),r,s,a),nn=(e,n,r,s,a,i={})=>e.name==="aube"?u(e,pe(n,r),s,a,i):g(e,()=>K(e.name,e.version,n,r),s,a,i),We=(e,n,r)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const s=(a,i)=>{const t=[...e.args];return t.splice(i,0,a),{...e,args:t}};switch(n){case"aube":case"pnpm":return s("--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 s("--cached-only",1);case"npm":return s("--offline",1);case"yarn":return r.startsWith("1.")?s("--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 a=n;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(a)}`]}}}},rn=(e,n,r,s,a={})=>{let i=e.name==="aube"?fe(n):ee(e.name,e.version,n);return a.offline&&(i=We(i,e.name,e.version)),u(e,i,r,s,{dry:a.dry,env:a.env})},_=process.platform==="win32",Ne=_?[".exe",".cmd",".bat",".ps1",""]:[""],Be=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const r of z(n))for(const s of Ne){const a=y(r,`${e}${s}`);if(R(a))return _?a.replaceAll("/","\\"):a}},sn=(e,n,r)=>{const s=Be(e,r);if(s===void 0||_&&!s.toLowerCase().endsWith(".exe"))return null;const a=E(s,n,{cwd:r,env:Y({...process.env},r),stdio:"inherit"});if(a.error)throw a.error;return a.status??1},an=(e,n,r,s,a={})=>e.name==="aube"?u(e,de(n),r,s,a):g(e,()=>ne(e.name,e.version,n),r,s,a),tn=(e,n,r,s,a,i={})=>{if(e.name==="aube")return u(e,ke(n,r),s,a,i);const t=me(e,n,r);return t.kind==="skip"?(a.warn(`warning: ${t.warning}`),0):t.kind==="rewrite"?u(e,{args:t.args,bin:t.bin,warnings:t.warning?[t.warning]:[]},s,a,i):g(e,()=>ie(e.name,e.version,n,r),s,a,i)};export{Ge as a,an as b,_e as c,$e as d,Ke as e,Ze as f,ze as g,Ve as h,en as i,tn as j,Xe as k,nn as l,Qe as m,He as n,rn as o,Ye as p,sn as r,ve as s};
@@ -1 +0,0 @@
1
- import{e as d,m as E,b}from"./index-BzhrR_iC.js";import{y as u}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const g={id:"bun",label:"Bun",lockfiles:["bun.lock","bun.lockb"],scriptSource:"package.json"},R={id:"node",label:"Node.js",lockfiles:["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json"],scriptSource:"package.json"},l={bun:g,node:R},a=["node","bun"],i={"deno.lock":"deno"},j=a.flatMap(n=>l[n].lockfiles.map(e=>[e,n])),p="Deno is not supported yet (deferred — see rfc/design-runtime-multitool.md).",s=(n,e)=>{if(n==="node"||n==="bun")return n;throw n in i||n==="deno"?new Error(`${e} requested runtime "${n}", but ${p}`):new Error(`${e} requested unknown runtime "${n}". Supported: ${a.join(", ")}.`)},D=n=>{let e=n;for(;;){for(const[o,t]of j)if(u(d(e,o)))return{runtime:t};for(const o of Object.keys(i))if(u(d(e,o)))return{deferred:i[o]};const r=E(e);if(r===e||b(e).root===e)return{};e=r}},$=(n,e={})=>{const r=e.env??process.env,o=(f,m,k)=>({adapter:l[f],deferredNotice:k,runtime:f,source:m});if(e.flag!==void 0&&e.flag!=="")return o(s(e.flag,"--runtime"),"flag");const t=r.VIS_RUNTIME;if(t!==void 0&&t!=="")return o(s(t,"VIS_RUNTIME"),"env");if(e.config!==void 0)return o(s(e.config,"config runtime:"),"config");const c=D(n);return c.runtime!==void 0?o(c.runtime,"lockfile"):c.deferred!==void 0?o("node","default",`Detected a ${c.deferred} project but ${p} Falling back to node.`):o("node","default")};export{$ as r};
@@ -1 +0,0 @@
1
- import{x as r,F as C,o as K}from"../packem_chunks/catalog.js";import{W as h}from"./getRandomSpinner-4ZEcbTYv-DCyIuj19.js";import{k as S}from"../packem_chunks/cli-main.js";const A=100,T=2147483647,m={delta:0,frame:0,time:0};function j(s){const{interval:i=A,isActive:e=!0}=s??{},t=F(i),{renderThrottleMs:c,subscribe:v}=r.useContext(S),[n,M]=r.useState(0),[R,p]=r.useState(m),o=r.useRef(0),f=r.useRef(0),x=r.useRef({isActive:e,resetKey:n,safeInterval:t}),l=x.current,E=e&&(t!==l.safeInterval||!l.isActive||n!==l.resetKey),b=r.useCallback(()=>{M(u=>u+1)},[]);return r.useLayoutEffect(()=>{if(!e)return;p(m);let u=0;const{startTime:d,unsubscribe:I}=v(a=>{if(c>0&&a<o.current)return;const y=a-u,k=a-f.current;f.current=a,o.current=a+c,p({delta:k,frame:Math.floor(y/t),time:y})},t);return u=d,f.current=d,o.current=u+c,I},[t,e,v,c,n]),r.useLayoutEffect(()=>{x.current={isActive:e,resetKey:n,safeInterval:t}},[e,t,n]),E?{...m,reset:b}:{...R,reset:b}}function F(s){return Number.isFinite(s)?Math.min(T,Math.max(1,s)):A}function g({type:s="dots"}){const i=h(s)??h("dots"),e=i?.frames??[" "],{frame:t}=j({interval:i?.interval??80});return C.jsx(K,{children:e[t%e.length]})}export{g as l};
@@ -1,5 +0,0 @@
1
- import{createRequire as z}from"node:module";import{e as p,l as H,z as M}from"./index-BzhrR_iC.js";import{y as v}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as A}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";let B;const D=e=>(B??=z(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[n,t]=k.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return k.getBuiltinModule(e)}return D(e)},{execFileSync:P}=T("node:child_process"),{randomBytes:L}=T("node:crypto"),{writeFileSync:V,renameSync:q,unlinkSync:R}=T("node:fs"),{delimiter:U}=T("node:path"),J=["proto","mise","fnm","volta","asdf","nvm","corepack"],G={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["aube","bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},Z=["proto","mise","fnm","volta","asdf","nvm","corepack"],O={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},y=new Map,b=e=>{const n=y.get(e);if(n!==void 0||y.has(e))return n;const t=process.env.PATH;if(!t){y.set(e,void 0);return}const o=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const i of t.split(U)){const c=i.replaceAll(/^["']|["']$/g,"").trim();if(c!=="")for(const s of o){const a=`${c}${H}${e}${s}`;if(v(a))return y.set(e,a),a}}y.set(e,void 0)},S=(e,n=["--version"])=>{try{const t=P(e,n,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),r=/\d+\.\d+(?:\.\d+)?/.exec(t);return r?r[0]:t.trim()||void 0}catch{return}},j=(e,n)=>{const t=p(e,"package.json");if(!v(t))return[];try{const o=A(t)[n];if(n==="volta"&&typeof o=="object"&&o!==null&&Object.keys(o).length>0)return["package.json"];if(n==="packageManager"&&typeof o=="string"&&o.length>0)return["package.json"]}catch{}return[]},X=(e,n)=>e==="volta"?j(n,"volta"):e==="corepack"?j(n,"packageManager"):O[e].filter(t=>v(p(n,t))),x=new Map,Y=()=>{x.clear(),y.clear()},N=(e,n)=>{{const i=x.get(e);if(i)return i}const t=[],r=!!b("pnpm")||!!b("yarn");for(const i of Z){const c=i==="nvm"?void 0:b(i),s=i==="nvm"&&!!process.env.NVM_DIR,a=X(i,e),l=!!c||s;i==="corepack"&&!l&&(!(a.length>0)||r)||!l&&a.length===0||t.push({binPath:c,configFiles:a,installed:l,name:i,version:c?S(c):void 0})}const o=Object.freeze(t);return x.set(e,o),o},$n=(e,n,t)=>{const r=N(e);return n?.preferredManager&&n.preferredManager!=="none"?r.find(o=>o.name===n.preferredManager)??{configFiles:[],installed:!1,name:n.preferredManager}:r.find(o=>o.installed&&o.configFiles.length>0)??r.find(o=>o.installed)??r.find(o=>o.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},K=(e,n)=>{for(const t of n){const r=p(e,t);if(v(r))try{const o=M(r).trim();if(o!=="")return{name:t,value:o.replace(/^v/,"")}}catch{}}},Q=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,nn=e=>{const n=p(e,".prototools");if(!v(n))return[];const t=M(n),r=[];let o=!1;for(const i of t.split(/\r?\n/)){const c=i.trim();if(c===""||c.startsWith("#"))continue;if(c.startsWith("[")){o=!0;continue}if(o)continue;const s=Q.exec(c);if(!s)continue;const[,a,l]=s,f=g(a);f&&r.push({source:".prototools",tool:f,version:l.trim()})}return r},en=/^\[tools\]\s*$/i,tn=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,on=e=>{for(const n of O.mise){const t=p(e,n);if(!v(t))continue;const r=[],o=M(t);let i=!1;for(const c of o.split(/\r?\n/)){const s=c.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=en.test(s);continue}if(!i)continue;const a=tn.exec(s);if(!a)continue;const[,l,f]=a,d=g(l);d&&r.push({source:".mise.toml",tool:d,version:f.trim()})}if(r.length>0)return r}return[]},rn=e=>{const n=p(e,".tool-versions");if(!v(n))return[];const t=M(n),r=[];for(const o of t.split(/\r?\n/)){const i=o.trim();if(i===""||i.startsWith("#"))continue;const c=i.split(/\s+/);if(c.length<2)continue;const[s,...a]=c,l=g(s);l&&a[0]&&r.push({source:".tool-versions",tool:l,version:a[0]})}return r},g=e=>{switch(e.toLowerCase()){case"aube":return"aube";case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},sn=e=>{const[n]=e.split("+",1),t=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(n??"");if(!t)return;const r=g(t[1]);if(r)return{source:"packageManager",tool:r,version:t[2]}},an=(e,n)=>{const t=new Map,r=s=>{t.set(s.tool,s)},o=p(e,"package.json");let i={};try{v(o)&&(i=A(o))}catch{}if(i.engines)for(const[s,a]of Object.entries(i.engines)){const l=g(s);l&&typeof a=="string"&&r({source:"engines",tool:l,version:a})}if(i.packageManager){const s=sn(i.packageManager);s&&r(s)}if(i.volta)for(const[s,a]of Object.entries(i.volta)){const l=g(s);l&&typeof a=="string"&&r({source:"volta",tool:l,version:a})}const c=K(e,[".nvmrc",".node-version"]);c&&r({source:c.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:c.value});for(const s of rn(e))r(s);for(const s of on(e))r(s);for(const s of nn(e))r(s);if(n?.tools)for(const[s,a]of Object.entries(n.tools)){const l=g(s);l&&typeof a=="string"&&r({source:"vis.config.ts",tool:l,version:a})}return[...t.values()]},E={aube:{args:["--version"],binaries:["aube"]},bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},F=e=>{const n=E[e];for(const t of n.binaries){const r=b(t);if(r)return S(r,n.args)}if(e==="node")return process.versions.node},W=(e,n)=>{const t=n.trim();if(t===""||t==="*"||t==="latest")return!0;if(/^\d[\d.]*$/.test(t))return e===t||e.startsWith(`${t}.`);const r=s=>s.split(/[.\-+]/).map(a=>Number.parseInt(a,10)||0),o=(s,a)=>{const l=r(s),f=r(a),d=Math.max(l.length,f.length);for(let h=0;h<d;h++){const $=l[h]??0,u=f[h]??0;if($!==u)return $-u}return 0},i=s=>{for(const a of s)if(a.startsWith(">=")){if(o(e,a.slice(2).trim())<0)return!1}else if(a.startsWith("<=")){if(o(e,a.slice(2).trim())>0)return!1}else if(a.startsWith(">")){if(o(e,a.slice(1).trim())<=0)return!1}else if(a.startsWith("<")){if(o(e,a.slice(1).trim())>=0)return!1}else if(a.startsWith("^")||a.startsWith("~")){const l=a.slice(1).trim(),[f,d]=r(l),[h,$]=r(e);if(h!==f||a.startsWith("~")&&$!==d||o(e,l)<0)return!1}return!0},c=t.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return c.length===0?!0:c.some(s=>i(s))},cn=(e,n)=>{switch(e){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return n==="pnpm"||n==="yarn"?["self-activate","volta","proto","mise","corepack"]:n==="npm"?["volta","proto","mise","asdf","corepack"]:n==="aube"?["mise"]:n==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},ln=(e,n,t)=>{if(t?.preferredManager&&t.preferredManager!=="none"&&_(t.preferredManager,e.tool)){const o=n.find(i=>i.name===t.preferredManager);return o?{installed:o.installed,name:o.name}:{installed:!1,name:t.preferredManager,note:`${t.preferredManager} is the preferred manager but isn't on PATH`}}const r=cn(e.source,e.tool);for(const o of r){if(o==="self-activate"){if((e.tool==="pnpm"||e.tool==="yarn")&&b(e.tool))return{installed:!0,name:"self-activate",note:`${e.tool} will activate ${e.version} from the packageManager field on next invocation`};continue}if(!_(o,e.tool))continue;if(n.find(c=>c.name===o)?.installed)return{installed:!0,name:o}}for(const o of r)if(!(o==="self-activate"||!_(o,e.tool)))return{installed:!1,name:o,note:`${o} can install ${e.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},_=(e,n)=>e==="none"?!1:e==="self-activate"?n==="pnpm"||n==="yarn":G[e].includes(n),fn=(e,n)=>{const t=N(e),o=an(e,n).map(i=>{const c=F(i.tool),s=c!==void 0&&W(c,i.version),a=ln(i,t,n);return{actual:c,expected:i,manager:a,matches:s}});return{detected:t,tools:o}},un=(e,n)=>{switch(e){case"asdf":return n?{args:["install",n.tool,n.version],bin:"asdf"}:void 0;case"corepack":return n?{args:["prepare",`${n.tool}@${n.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return n?.tool!=="node"?void 0:{args:["install",n.version],bin:"fnm"};case"mise":return n?{args:["install",`${n.tool}@${n.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return n?{args:["install",n.tool,n.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:n?.tool??"pnpm",hint:`${n?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return n?{args:["install",`${n.tool}@${n.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const t=e;throw new Error(`Unknown manager: ${t}`)}}},yn=(e,n)=>{switch(e){case"asdf":return{args:["local",n.tool,n.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${n.tool} ${n.version}`}};case"corepack":return n.tool!=="npm"&&n.tool!=="pnpm"&&n.tool!=="yarn"?void 0:{args:["use",`${n.tool}@${n.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${n.tool}@${n.version}"`}};case"fnm":return n.tool==="node"?{args:["use",n.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${n.tool}@${n.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${n.tool} ${n.version}`}};case"none":return;case"nvm":return n.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",n.tool,n.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${n.tool} ${n.version}`}};case"self-activate":return{args:[],bin:n.tool,configChange:{file:"package.json",hint:`Set packageManager: "${n.tool}@${n.version}" — ${n.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${n.tool}@${n.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${n.tool}`}};default:{const t=e;throw new Error(`Unknown manager: ${t}`)}}},Mn=e=>{for(const n of E[e].binaries){const t=b(n);if(t)return t}},wn=(e,n)=>{const t=E[n].binaries;if(e.installed&&e.binPath&&(e.name==="proto"||e.name==="mise"||e.name==="asdf"||e.name==="volta"||e.name==="fnm"))for(const r of t)try{const i=P(e.binPath,["which",r],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(i)return i}catch{}for(const r of t){const o=b(r);if(o)return o}},I=(e,n)=>{const t=`${e}.${process.pid}.${L(6).toString("hex")}.tmp`;V(t,n);try{q(t,e)}catch(r){try{R(t)}catch{}throw r}},dn=(e,n)=>{if("packageManager"in e)return e.packageManager=n,e;const t={};let r=!1;for(const[o,i]of Object.entries(e))!r&&(o==="dependencies"||o==="devDependencies"||o==="peerDependencies"||o==="optionalDependencies")&&(t.packageManager=n,r=!0),t[o]=i;return r||(t.packageManager=n),t},kn=(e,n)=>{if(n.tool!=="pnpm"&&n.tool!=="yarn"&&n.tool!=="npm"&&n.tool!=="bun")return;const t=p(e,"package.json");if(!v(t))throw new Error(`Cannot pin ${n.tool}: ${t} does not exist.`);const r=M(t),i=/\n([ \t]+)/.exec(r)?.[1]??" ";let c;try{c=JSON.parse(r)}catch(f){throw new Error(`${t} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${f.message}`,{cause:f})}const s=`${n.tool}@${n.version}`,a=dn(c,s),l=r.endsWith(`
2
- `)?`
3
- `:"";return I(t,`${JSON.stringify(a,void 0,i)}${l}`),s},Tn=(e,n)=>{const t=p(e,"package.json");if(!v(t))return;const r=M(t);let o;try{o=JSON.parse(r)}catch(a){throw new Error(`${t} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}if(o.engines?.[n.tool]===void 0||o.engines[n.tool]===n.version)return;o.engines[n.tool]=n.version;const c=/\n([ \t]+)/.exec(r)?.[1]??" ",s=r.endsWith(`
4
- `)?`
5
- `:"";return I(t,`${JSON.stringify(o,void 0,c)}${s}`),n.version},Pn=e=>{const n=/^([a-z][\w-]*)@(.+)$/i.exec(e.trim());if(!n)return;const t=g(n[1]);if(t)return{source:"vis.config.ts",tool:t,version:n[2]}},mn=async(e,n,t)=>{const r=fn(e,n),o=r.tools.filter(f=>!f.matches);if(o.length===0)return{attempted:[],failed:[],upToDate:!0};const i=r.detected.some(f=>f.installed);if(!(n?.autoInstall??i))return{attempted:[],failed:[],upToDate:!1};const s=[],a=[],l=new Map;for(const f of o){const d=l.get(f.manager.name);d?d.push(f):l.set(f.manager.name,[f])}for(const[f,d]of l){if(f==="self-activate"){for(const{expected:u}of d)t.info(`toolchain: ${u.tool} ${u.version} will self-activate on next ${u.tool} invocation`),s.push(u);continue}if(f==="none"){for(const{expected:u}of d)a.push({error:`no manager can install ${u.tool} — install one of ${J.join(", ")}`,spec:u});continue}if(!r.detected.find(u=>u.name===f)?.installed){for(const{expected:u}of d)a.push({error:`${f} is not on PATH`,spec:u});continue}const $=d.map(u=>({invocation:un(f,u.expected),tool:u})).filter(u=>u.invocation!==void 0);for(const{invocation:u,tool:C}of $){const{expected:m}=C;if(u.bin==="nvm"&&u.args.length===0){const w=F(m.tool);if(w!==void 0&&W(w,m.version)){t.info(`toolchain: ${m.tool} ${w} already satisfies ${m.version}; skipping nvm shell activation`),s.push(m);continue}t.warn(`toolchain: nvm requires a shell-side activation for ${m.tool} ${m.version}. Run \`nvm install\` / \`nvm use\` manually.`),a.push({error:"nvm requires shell-side activation",spec:m});continue}t.info(`toolchain: $ ${u.bin} ${u.args.join(" ")}`);try{P(u.bin,u.args,{cwd:e,stdio:"inherit"}),s.push(m),f==="fnm"&&vn(u.bin,t)}catch(w){a.push({error:w.message,spec:m});break}}}return Y(),{attempted:s,failed:a,upToDate:!1}},_n=async(e,n,t,r=!1)=>{if(r)return;const o=await mn(e,n,t);for(const i of o.failed)t.warn(`toolchain: ${i.spec.tool} ${i.spec.version} — ${i.error}`)},vn=(e,n)=>{const t=process.platform==="win32"?"powershell":"bash";try{const r=P(e,["env","--shell",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3});for(const o of r.split(/\r?\n/)){const i=o.trim();if(i==="")continue;const c=/^\$env:([A-Z_]\w*)\s*=\s*(.+)$/i.exec(i);if(c){const[,l,f]=c;process.env[l]=f.replaceAll(/^["']|["']$/g,"");continue}const s=/^set\s+"?([A-Z_]\w*)=(.*?)"?$/i.exec(i);if(s){const[,l,f]=s;process.env[l]=f;continue}const a=/^(?:export\s+)?([A-Z_]\w*)=(.+)$/i.exec(i);if(a){const[,l,f]=a;process.env[l]=f.replaceAll(/^["']|["']$/g,"")}}}catch(r){n.warn(`toolchain: could not activate fnm env (${r.message}). Subsequent tasks may use the previous Node version.`)}};export{J as S,Pn as a,un as b,ln as c,yn as d,wn as e,N as f,fn as g,Mn as h,$n as p,_n as r,Tn as u,kn as w};
@@ -1,11 +0,0 @@
1
- import{createRequire as K}from"node:module";import{e as h,z as H,v as S,U as Y,m as Q}from"./index-BzhrR_iC.js";import{T as w}from"../packem_chunks/catalog.js";import{y as C}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as ee}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as le}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";import{s as ue}from"./watch-CcTketln.js";let z;const G=e=>(z??=K(import.meta.url))(e),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,n]=x.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return x.getBuiltinModule(e)}return G(e)},{createHash:g}=A("node:crypto"),{fileURLToPath:X,pathToFileURL:Z}=A("node:url"),{spawnSync:te,spawn:ne}=A("node:child_process"),{openSync:se,writeSync:re,closeSync:oe,statSync:ie,readFileSync:P,mkdirSync:ce,writeFileSync:ae}=A("node:fs"),{availableParallelism:k}=A("node:os"),D=(e,t)=>{for(const n of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const s=e[n];if(s&&typeof s[t]=="string")return s[t]}},F=(e,t)=>{for(const n of t){const s=h(e,n);if(C(s))return s}},de=e=>{const t=h(e,"package.json");if(!C(t))return{};try{return ee(t)}catch{return{}}},rt=(e,t)=>{const n=de(e),s=new Map;for(const o of t){const r=o.detect(e,n);r&&s.set(o.id,r)}return s},fe={error:"error",info:"info",information:"info",warning:"warning"},ot={argsCheck:(e,t)=>I(e,t,!1),argsFix:(e,t)=>I(e,t,!0),bin:()=>["pnpm","exec","biome"],cacheKey:(e,t)=>{const n=["biome",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:(e,t)=>{const n=D(t,w.biome.packageNames[0]),s=F(e,w.biome.configFiles);if(!(!n&&!s))return{adapter:"biome",configFile:s,declared:!!n,declaredVersion:n,root:e}},extensions:["astro","cjs","css","cts","js","json","jsonc","jsx","mjs","mts","svelte","ts","tsx","vue"],id:"biome",kind:"both",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"biome",file:t.root,fixable:!1,message:`biome output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n.diagnostics??[]){const r=o.location?.start,i=o.location?.end,c=pe(t.root,o.location?.path),u=o.category??"",a=u==="format"||u.startsWith("format/");s.push({adapter:"biome",column:r?.column&&r.column>0?r.column:void 0,endColumn:i?.column&&i.column>0?i.column:void 0,endLine:i?.line&&i.line>0?i.line:void 0,file:c,fixable:!0,line:r?.line&&r.line>0?r.line:void 0,message:a?"Code style issues would be auto-fixed":o.message??"",ruleId:u||void 0,severity:fe[o.severity??""]??"warning"})}return s}},I=(e,t,n)=>{const s=["check","--reporter=json"];return n&&s.push("--write"),typeof t.maxWarnings=="number"&&s.push(`--max-diagnostics=${String(t.maxWarnings)}`),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},pe=(e,t)=>{const n=typeof t=="string"?t:t?.file;return n?n.startsWith("/")||/^[a-z]:[\\/]/i.test(n)?n:h(e,n):e},N=e=>t=>{const n=F(t,w.deno.configFiles);if(n)return{adapter:e,configFile:n,declared:!1,root:t}},O=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),it={argsCheck:(e,t)=>b(e,t,!1),argsFix:(e,t)=>b(e,t,!0),bin:()=>["deno","lint"],cacheKey:(e,t)=>{const n=["deno-lint",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("deno-lint"),extensions:["js","jsx","mjs","mts","ts","tsx"],id:"deno-lint",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"deno-lint",file:t.root,fixable:!1,message:`deno lint output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n.diagnostics??[]){const r=o.range?.start,i=o.range?.end;s.push({adapter:"deno-lint",column:r?.col===void 0?void 0:r.col+1,endColumn:i?.col===void 0?void 0:i.col+1,endLine:i?.line===void 0?void 0:i.line+1,file:he(o.filename??t.root,t.root),fixable:!1,line:r?.line===void 0?void 0:r.line+1,message:o.message??"",ruleId:o.code,severity:"warning"})}return s}},ct={argsCheck:(e,t)=>R(e,t,!1),argsFix:(e,t)=>R(e,t,!0),bin:()=>["deno","fmt"],cacheKey:(e,t)=>{const n=["deno-fmt",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("deno-fmt"),extensions:["astro","cjs","css","cts","html","ipynb","js","json","jsonc","jsx","less","md","mjs","mts","sass","scss","sql","svelte","ts","tsx","vue","yaml","yml"],id:"deno-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const n=[],s=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=/^from (.+):$/.exec(o);if(!r)continue;const i=r[1];s.has(i)||(s.add(i),n.push({adapter:"deno-fmt",file:O(i)?i:`${t.root}/${i}`,fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return n}},b=(e,t,n)=>{const s=["--json"];return n&&s.push("--fix"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},R=(e,t,n)=>{const s=[];return n||s.push("--check"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},he=(e,t)=>e.startsWith("file://")?X(e):O(e)?e:`${t}/${e}`,W="pyproject.toml",me=/^\[tool\.ruff(?:\.[\w-]+)*\]\s*$/m,ge=/^Would reformat:?\s+(.+)$/,ye=e=>{const t=h(e,W);if(!C(t))return!1;try{const n=H(t);return me.test(n)}catch{return!1}},B=e=>(t,n)=>{const s=w.ruff.packageNames.map(c=>D(n,c)).find(c=>c!==void 0),o=F(t,w.ruff.configFiles),r=o?void 0:ye(t)?h(t,W):void 0,i=o??r;if(!(!s&&!i))return{adapter:e,configFile:i,declared:!!s,declaredVersion:s,root:t}},xe=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),J=(e,t)=>e?xe(e)?e:h(t,e):t,ve=e=>ge.exec(e)?.[1]?.trim(),at={argsCheck:(e,t)=>T(e,t,!1),argsFix:(e,t)=>T(e,t,!0),bin:()=>["ruff","check"],cacheKey:(e,t)=>{const n=["ruff-check",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:B("ruff-check"),extensions:["py","pyi"],id:"ruff-check",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"ruff-check",file:t.root,fixable:!1,message:`ruff check output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n){const r=o.location,i=o.end_location;s.push({adapter:"ruff-check",column:r?.column,endColumn:i?.column,endLine:i?.row,file:J(o.filename,t.root),fixable:!!o.fix,line:r?.row,message:o.message??"",ruleId:o.code,severity:"warning"})}return s}},lt={argsCheck:(e,t)=>L(e,t,!1),argsFix:(e,t)=>L(e,t,!0),bin:()=>["ruff","format"],cacheKey:(e,t)=>{const n=["ruff-fmt",e.declaredVersion??"unknown",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:B("ruff-fmt"),extensions:["py","pyi"],id:"ruff-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const n=[],s=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=ve(o);!r||s.has(r)||(s.add(r),n.push({adapter:"ruff-fmt",file:J(r,t.root),fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return n}},T=(e,t,n)=>{const s=["--output-format=json"];return n&&s.push("--fix"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},L=(e,t,n)=>{const s=[];return n||s.push("--check"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},ut=(e,t)=>{const n=v(e,["diff","--name-only","--diff-filter=ACMR","-z",`${t}...HEAD`]);if(n===void 0)return;const s=v(e,["diff","--name-only","--diff-filter=ACMR","-z"]),o=v(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]),r=v(e,["ls-files","--others","--exclude-standard","-z"]),i=new Set;for(const c of[n,s??"",o??"",r??""])for(const u of c.split("\0"))u.length!==0&&i.add(S(u)?u:h(e,u));return[...i].sort()},dt=e=>{const t=v(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]);if(t===void 0)return;const n=new Set;for(const s of t.split("\0"))s.length!==0&&n.add(S(s)?s:h(e,s));return[...n].sort()},v=(e,t)=>{const n=te("git",[...t],{cwd:e,encoding:"utf8",timeout:1e4});if(n.status===0)return n.stdout},ft=(e,t)=>{const n=new Set(t.map(r=>r.toLowerCase())),s=[],o=new Set;for(const r of e){const i=r.lastIndexOf(".");if(i===-1||i===r.length-1)continue;const c=r.slice(i+1).toLowerCase();n.has(c)&&(o.has(r)||(o.add(r),s.push(r)))}return s},we=new Set(["-","stdout"]),_=e=>({close:()=>{},write:t=>{e.write(t)}}),Ae=e=>{le(Q(e));const t=se(e,"w");let n=[];return{close:()=>{n.length>0&&(re(t,n.join("")),n=[]),oe(t)},write:s=>{n.push(s)}}},pt=e=>{const{cwd:t,target:n}=e;if(n===void 0||we.has(n))return _(process.stdout);if(n==="stderr")return _(process.stderr);const s=S(n)?n:Y(t,n);return Ae(s)},j=["oxlint","oxfmt","biome","eslint","dprint","prettier","stylelint","ruff-check","ruff-fmt","markdownlint","shellcheck","deno-lint","deno-fmt","typecheck"],ht=(e,t)=>{const n=new Map(e.map(i=>[i.id,i])),s=[],o=new Set,r=t&&t.length>0?t:j;for(const i of r){const c=n.get(i);c&&!o.has(i)&&(s.push(c),o.add(i))}if(t&&t.length>0)for(const i of j){const c=n.get(i);c&&!o.has(i)&&(s.push(c),o.add(i))}for(const i of e)o.has(i.id)||(s.push(i),o.add(i.id));return s},mt=(e,t,n)=>{const s=[];for(const o of t){const r=e.get(o.id);r&&Se(o.kind,n)&&s.push({adapter:o,presence:r})}return s},Se=(e,t)=>e===t||e==="both",gt=(e,t,n={})=>{const s=new Map;for(const o of e){const r=$e(o),i=Ce(r,t,n);if(!i)continue;const c=s.get(i);c?c.push(o):s.set(i,[o])}return s},$e=e=>{const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()},Ce=(e,t,n)=>{const s=n[e];if(s&&t.some(o=>o.adapter.id===s))return s;for(const{adapter:o}of t)if(o.extensions.includes(e))return o.id},Fe=e=>e==="error"?"error":e==="warning"?"warning":"notice",V=e=>e.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
2
- `,"%0A"),M=e=>V(e).replaceAll(",","%2C").replaceAll(":","%3A").replaceAll("=","%3D"),ke=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,Ie=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),be=(e,t)=>{const n=Fe(e.severity),s=ke(e.file,t),o=e.ruleId?`${e.adapter}(${e.ruleId})`:e.adapter,r=[`file=${M(s)}`];return e.line!==void 0&&r.push(`line=${String(e.line)}`),e.endLine!==void 0&&r.push(`endLine=${String(e.endLine)}`),e.column!==void 0&&r.push(`col=${String(e.column)}`),e.endColumn!==void 0&&r.push(`endColumn=${String(e.endColumn)}`),r.push(`title=${M(o)}`),`::${n} ${r.join(",")}::${V(e.message)}
3
- `},yt=e=>e.runs.flatMap(n=>[...n.findings]).sort(Ie).map(n=>be(n,e.workspaceRoot)).join(""),y=e=>e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;"),Re=e=>`<![CDATA[${e.replaceAll("]]>","]]]]><![CDATA[>")}]]>`,Te=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),Le=e=>e==="error"?"error":e==="warning"?"warning":"info",_e=(e,t)=>{let{file:n}=e;return t&&e.file.startsWith(`${t}/`)&&(n=e.file.slice(t.length+1)),e.line===void 0?n:e.column===void 0?`${n}:${String(e.line)}`:`${n}:${String(e.line)}:${String(e.column)}`},je=(e,t,n)=>{const s=_e(e,n),o=Le(e.severity),r=e.ruleId?`[${e.ruleId}] ${e.message}`:e.message;return[` <testcase classname="${y(t)}" name="${y(s)}">`,` <failure type="${y(o)}" message="${y(r)}">${Re(e.message)}</failure>`," </testcase>",""].join(`
4
- `)},Me=(e,t,n)=>{const s=[...e.findings].sort(Te),o=s.filter(d=>d.severity==="error").length,r=s.filter(d=>d.severity==="warning").length,i=s.length,c=(e.durationMs/1e3).toFixed(3),u=s.map(d=>je(d,e.adapter,n)).join("");return` <testsuite ${[`name="${y(e.adapter)}"`,`tests="${String(i)}"`,`failures="${String(o)}"`,'errors="0"',`skipped="${String(r)}"`,`time="${c}"`,`timestamp="${t}"`].join(" ")}>
5
- ${u} </testsuite>
6
- `},xt=e=>{const t=(e.now??new Date).toISOString(),n=e.suiteName??"vis-lint-fmt",s=e.runs.map(a=>Me(a,t,e.workspaceRoot)).join(""),o=e.runs.reduce((a,d)=>a+d.findings.length,0),r=e.runs.reduce((a,d)=>a+d.findings.filter(l=>l.severity==="error").length,0),i=e.runs.reduce((a,d)=>a+d.findings.filter(l=>l.severity==="warning").length,0),c=(e.runs.reduce((a,d)=>a+d.durationMs,0)/1e3).toFixed(3);return`<?xml version="1.0" encoding="UTF-8"?>
7
- <testsuites ${[`name="${y(n)}"`,`tests="${String(o)}"`,`failures="${String(r)}"`,'errors="0"',`skipped="${String(i)}"`,`time="${c}"`].join(" ")}>
8
- ${s}</testsuites>
9
- `},Ee="2.1.0",qe="https://json.schemastore.org/sarif-2.1.0.json",Pe=e=>e==="error"?"error":e==="warning"?"warning":"note",De=(e,t)=>t&&e.startsWith(`${t}/`)?{uri:e.slice(t.length+1),uriBaseId:"SRCROOT"}:{uri:e},Ne=e=>{const{href:t}=Z(e);return t.endsWith("/")?t:`${t}/`},Oe=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),We=e=>{const t=new Map;for(const n of e)n.ruleId&&(t.has(n.ruleId)||t.set(n.ruleId,{id:n.ruleId,name:n.ruleId}));return[...t.values()]},Be=(e,t)=>{const{uri:n,uriBaseId:s}=De(e.file,t),o={artifactLocation:s?{uri:n,uriBaseId:s}:{uri:n}};if(e.line!==void 0){const i={startLine:e.line};e.column!==void 0&&(i.startColumn=e.column),e.endLine!==void 0&&(i.endLine=e.endLine),e.endColumn!==void 0&&(i.endColumn=e.endColumn),o.region=i}const r={level:Pe(e.severity),locations:[{physicalLocation:o}],message:{text:e.message}};return e.ruleId&&(r.ruleId=e.ruleId),r},Je=(e,t)=>{const n=[...e.findings].sort(Oe),s=We(n),o={name:e.adapter,rules:s};e.presence?.declaredVersion&&(o.version=e.presence.declaredVersion);const r={results:n.map(i=>Be(i,t)),tool:{driver:o}};return t&&(r.originalUriBaseIds={SRCROOT:{uri:Ne(t)}}),r},vt=e=>{const t={$schema:qe,runs:e.runs.map(n=>Je(n,e.workspaceRoot)),version:Ee};return`${JSON.stringify(t,void 0,2)}
10
- `},E={error:3,info:1,warning:2},wt=e=>{const t=[],n=[];let s,o=!1;for(const r of e){n.push({adapter:r.adapter,durationMs:r.durationMs,exitCode:r.exitCode,findingCount:r.findings.length}),r.exitCode!==0&&r.exitCode!==null&&r.findings.length===0&&(o=!0);for(const i of r.findings)t.push(i),(!s||E[i.severity]>E[s])&&(s=i.severity)}return{findings:t,hadProcessFailure:o,maxSeverity:s,runs:n}},At=e=>{const t=new Map;for(const n of e){const s=t.get(n.file);s?s.push(n):t.set(n.file,[n])}return t},St=e=>e.hadProcessFailure||e.maxSeverity==="error"?1:0,Ve=(e,t)=>{if(t==="fix"||process.env.VIS_NO_CACHE==="1"||e.length===0)return!1;for(const n of e)if(n==="."||n==="./"||n==="..")return!1;return!0},Ue=e=>{try{const t=P(e);return g("sha256").update(t).digest("hex")}catch{return}},Ke=(e,t,n,s,o)=>{const r=e.cacheKey(t,s),i=[];for(const u of[...n].sort()){const a=S(u)?u:h(t.root,u);try{ie(a)}catch{return}const d=Ue(a);if(!d)return;i.push({hash:d,path:a})}const c=g("sha256");c.update(e.id),c.update("\0"),c.update(r),c.update("\0"),c.update(o);for(const u of i)c.update("\0"),c.update(u.path),c.update("\0"),c.update(u.hash);return{fileHashes:i,key:c.digest("hex")}},U=(e,t)=>h(e,"lint-fmt",t),ze=(e,t,n)=>{const s=h(U(e,t.id),`${n}.json`);try{const o=P(s,"utf8"),r=JSON.parse(o);return r.schema!==1?void 0:r}catch{return}},Ge=(e,t,n,s,o)=>{const r=U(e,t.id),i={fileHashes:o,result:s,savedAt:Date.now(),schema:1};try{ce(r,{recursive:!0}),ae(h(r,`${n}.json`),JSON.stringify(i))}catch{}},q=async(e,t,n,s,o)=>{const r=e.bin(t),i=[...r.slice(1),...o==="fix"?e.argsFix(n,s):e.argsCheck(n,s)];return new Promise(c=>{const u=Date.now(),a=ne(r[0],i,{cwd:t.root}),d=[],l=[];let m=!1;const p=setTimeout(()=>{m=!0,a.kill("SIGKILL")},6e4);a.stdout.on("data",f=>d.push(f)),a.stderr.on("data",f=>l.push(f)),a.on("error",f=>{clearTimeout(p),c({durationMs:Date.now()-u,exitCode:null,stderr:f.message,stdout:""})}),a.on("close",f=>{clearTimeout(p),c({durationMs:Date.now()-u,exitCode:m?null:f,stderr:Buffer.concat(l).toString("utf8"),stdout:Buffer.concat(d).toString("utf8")})})})},$t=async(e,t,n,s=k())=>{if(e.length===0)return[];const{cacheRoot:o,concurrency:r}=typeof s=="number"?{concurrency:s}:{cacheRoot:s.cacheRoot,concurrency:s.concurrency??k()},i=async l=>{const m=l.options??t;if(o&&Ve(l.files,n)){const p=Ke(l.adapter,l.presence,l.files,m,n);if(p){const f=ze(o,l.adapter,p.key);if(f)return f.result;const $=await q(l.adapter,l.presence,l.files,m,n);return $.exitCode!==null&&Ge(o,l.adapter,p.key,$,p.fileHashes),$}}return q(l.adapter,l.presence,l.files,m,n)};if(process.env.VIS_LINT_FMT_SERIAL==="1"){const l=[];for(const m of e)l.push(await i(m));return l}const c=Math.max(1,Math.min(r,e.length)),u=Array.from({length:e.length});let a=0;const d=async()=>{for(;;){const l=a;if(a+=1,l>=e.length)return;u[l]=await i(e[l])}};return await Promise.all(Array.from({length:c},()=>d())),u},He=e=>{const t=new Set;for(const n of e)t.add(n.toLowerCase());return t},Ye=(e,t)=>{const n=e.lastIndexOf(".");return n===-1||n===e.length-1?!1:t.has(e.slice(n+1).toLowerCase())},Ct=async e=>{const{extensions:t,initialFiles:n,label:s,log:o,runCycle:r,workspaceRoot:i}=e,c=o??(p=>{process.stdout.write(`${p}
11
- `)}),u=He(t);await r(n),c(`▸ ${s}: watching workspace — press Ctrl-C to exit`);let a=new Set,d=!1;const l=async()=>{for(;a.size>0;){const p=[...a];a=new Set;try{await r(p)}catch(f){c(`✗ ${s}: watch cycle failed — ${f.message}`)}}},m=ue({debounceMs:200,filter:p=>Ye(p,u),onChange:async p=>{for(const f of p)a.add(S(f)?f:h(i,f));if(!d){d=!0;try{await l()}finally{d=!1}}},paths:[i]});await new Promise(p=>{const f=()=>{m.close(),process.off("SIGINT",f),process.off("SIGTERM",f),p()};process.once("SIGINT",f),process.once("SIGTERM",f)})};export{rt as a,mt as b,ut as c,D as d,Ct as e,F as f,ot as g,lt as h,ct as i,gt as j,$t as k,wt as l,pt as m,vt as n,xt as o,yt as p,St as q,ht as r,dt as s,At as t,de as u,at as v,it as w,ft as x};