@visulima/vis 2.0.2 → 3.0.0

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 (147) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE.md +95 -65
  3. package/dist/bin.js +1 -1
  4. package/dist/binx.js +1 -1
  5. package/dist/packem_chunks/CONFIG_FILES.js +2 -2
  6. package/dist/packem_chunks/bloom-status.js +1 -1
  7. package/dist/packem_chunks/bloom-sync.js +1 -1
  8. package/dist/packem_chunks/catalog.js +47 -47
  9. package/dist/packem_chunks/cli-exec.js +1 -1
  10. package/dist/packem_chunks/cli-main.js +141 -141
  11. package/dist/packem_chunks/dispatch.js +1 -1
  12. package/dist/packem_chunks/fix.js +1 -1
  13. package/dist/packem_chunks/handler.js +1 -1
  14. package/dist/packem_chunks/handler10.js +1 -1
  15. package/dist/packem_chunks/handler11.js +1 -1
  16. package/dist/packem_chunks/handler12.js +1 -1
  17. package/dist/packem_chunks/handler13.js +1 -1
  18. package/dist/packem_chunks/handler14.js +1 -1
  19. package/dist/packem_chunks/handler15.js +1 -1
  20. package/dist/packem_chunks/handler16.js +1 -1
  21. package/dist/packem_chunks/handler17.js +1 -1
  22. package/dist/packem_chunks/handler18.js +1 -1
  23. package/dist/packem_chunks/handler19.js +1 -1
  24. package/dist/packem_chunks/handler2.js +1 -1
  25. package/dist/packem_chunks/handler20.js +1 -1
  26. package/dist/packem_chunks/handler21.js +1 -1
  27. package/dist/packem_chunks/handler22.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 +1 -1
  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/handler4.js +1 -1
  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/handler55.js +1 -1
  43. package/dist/packem_chunks/handler58.js +1 -1
  44. package/dist/packem_chunks/handler59.js +1 -1
  45. package/dist/packem_chunks/handler6.js +1 -1
  46. package/dist/packem_chunks/handler60.js +1 -1
  47. package/dist/packem_chunks/handler61.js +1 -1
  48. package/dist/packem_chunks/handler62.js +1 -1
  49. package/dist/packem_chunks/handler63.js +1 -1
  50. package/dist/packem_chunks/handler64.js +1 -1
  51. package/dist/packem_chunks/handler66.js +1 -1
  52. package/dist/packem_chunks/handler67.js +13 -13
  53. package/dist/packem_chunks/handler68.js +1 -1
  54. package/dist/packem_chunks/handler69.js +1 -1
  55. package/dist/packem_chunks/handler7.js +1 -1
  56. package/dist/packem_chunks/handler70.js +5 -5
  57. package/dist/packem_chunks/handler71.js +1 -1
  58. package/dist/packem_chunks/handler72.js +1 -1
  59. package/dist/packem_chunks/handler73.js +1 -1
  60. package/dist/packem_chunks/handler74.js +15 -15
  61. package/dist/packem_chunks/handler75.js +1 -1
  62. package/dist/packem_chunks/handler76.js +1 -1
  63. package/dist/packem_chunks/handler77.js +1 -1
  64. package/dist/packem_chunks/handler78.js +1 -1
  65. package/dist/packem_chunks/handler8.js +1 -1
  66. package/dist/packem_chunks/handler9.js +1 -1
  67. package/dist/packem_chunks/heal-accept.js +1 -1
  68. package/dist/packem_chunks/heal.js +1 -1
  69. package/dist/packem_chunks/help-command.js +1 -1
  70. package/dist/packem_chunks/index2.js +6 -4
  71. package/dist/packem_chunks/index3.js +1 -1
  72. package/dist/packem_chunks/index4.js +49 -49
  73. package/dist/packem_chunks/keys-refresh.js +1 -1
  74. package/dist/packem_chunks/lean.js +1 -1
  75. package/dist/packem_chunks/list.js +1 -1
  76. package/dist/packem_chunks/loader.js +1 -1
  77. package/dist/packem_chunks/orchestrator.js +2 -2
  78. package/dist/packem_chunks/prune.js +1 -1
  79. package/dist/packem_chunks/registry.js +10 -10
  80. package/dist/packem_chunks/status.js +1 -1
  81. package/dist/packem_chunks/sync.js +1 -1
  82. package/dist/packem_chunks/sync2.js +1 -1
  83. package/dist/packem_chunks/tripwire.js +1 -1
  84. package/dist/packem_chunks/ts-loader.js +1 -1
  85. package/dist/packem_chunks/verify-lockfile.js +1 -1
  86. package/dist/packem_shared/{advisories-CCBGdU8U.js → advisories-DsXRmIA5.js} +1 -1
  87. package/dist/packem_shared/{affected-selection-Dj-ymxhw.js → affected-selection-BE6VFCDV.js} +1 -1
  88. package/dist/packem_shared/{affected-shas-PwkVbPch.js → affected-shas-BKEu4RZc.js} +1 -1
  89. package/dist/packem_shared/{ai-analysis-bGCAc1jR.js → ai-analysis-DikAj6rX.js} +1 -1
  90. package/dist/packem_shared/{ai-fix-DV5-dHBY.js → ai-fix-bfWo0cZX.js} +1 -1
  91. package/dist/packem_shared/{augment-24KX2nkI.js → augment-BkJxi_GW.js} +1 -1
  92. package/dist/packem_shared/{bin-CtzhnYMp.js → bin-B-TytgzW.js} +1 -1
  93. package/dist/packem_shared/{build-scripts-w4SNeR7D.js → build-scripts-DWypBQ--.js} +1 -1
  94. package/dist/packem_shared/{command-runtime-BLFPUYAT.js → command-runtime-DQ7ZpLYL.js} +1 -1
  95. package/dist/packem_shared/{cyclonedx-C4KaVTn1.js → cyclonedx-DLBi65MV.js} +1 -1
  96. package/dist/packem_shared/dependency-scan-ZLOuLkGN.js +1 -0
  97. package/dist/packem_shared/{docker-DaVs-9wK.js → docker-B4zAZCZG.js} +15 -15
  98. package/dist/packem_shared/{en-D3CfXlO7.js → en-BDYMmM2_.js} +1 -1
  99. package/dist/packem_shared/{failure-log-CTneNcio.js → failure-log-DyhWPqno.js} +1 -1
  100. package/dist/packem_shared/glob-BUjyjdE8-Dp_QcayW.js +1 -0
  101. package/dist/packem_shared/index-BLtnel38.js +35 -0
  102. package/dist/packem_shared/index-CuKDxOCI.js +1 -0
  103. package/dist/packem_shared/index-tNFGWxc0.js +39 -0
  104. package/dist/packem_shared/{lifecycle-B8A2T3gx.js → lifecycle-KY9umOg6.js} +1 -1
  105. package/dist/packem_shared/{lockfile-Bccery3L.js → lockfile-YAuZf1gh.js} +1 -1
  106. package/dist/packem_shared/{manifests-BDkwiVbh.js → manifests-BwTn_1ad.js} +1 -1
  107. package/dist/packem_shared/{min-release-age-OaYpLwux.js → min-release-age-6avfn81h.js} +1 -1
  108. package/dist/packem_shared/{missing-package-json-BqS-OnKd.js → missing-package-json-Cl0vdz6K.js} +1 -1
  109. package/dist/packem_shared/{native-config-sync-Ds1FtcrM.js → native-config-sync-CHMCJx7H.js} +7 -7
  110. package/dist/packem_shared/{osv-bloom-pKp7urSB.js → osv-bloom-DdqDnLCt.js} +2 -2
  111. package/dist/packem_shared/package-version-BNRJ3o9C.js +4 -0
  112. package/dist/packem_shared/{packument-HBVbyf7x.js → packument-B9-WqReu.js} +1 -1
  113. package/dist/packem_shared/{pm-runner-C6eTANt1.js → pm-runner-DRybtzOV.js} +1 -1
  114. package/dist/packem_shared/{project-name-filter-CJ3XX2TI.js → project-name-filter-Dw0fC6IO.js} +1 -1
  115. package/dist/packem_shared/{provenance-D4Cza8cp.js → provenance-CLxuqCfL.js} +1 -1
  116. package/dist/packem_shared/{readJsonSync-DweZd5ZA-0eZh9sGm.js → readJsonSync-DweZd5ZA-CtrDlqpb.js} +1 -1
  117. package/dist/packem_shared/{registry-keys-C0ez2VND.js → registry-keys-cTN24144.js} +1 -1
  118. package/dist/packem_shared/{resolve-explicit-BbT764KS.js → resolve-explicit-Uw6WQl9R.js} +1 -1
  119. package/dist/packem_shared/{resolve-runtime-D_vZovbB.js → resolve-runtime-DztanwkZ.js} +1 -1
  120. package/dist/packem_shared/{run-file-DyPFFN9U.js → run-file-CaE5_xBY.js} +1 -1
  121. package/dist/packem_shared/{runtime-check-D4um-yQq.js → runtime-check-C32yE57I.js} +1 -1
  122. package/dist/packem_shared/{s1ngularity-St6dhKiq.js → s1ngularity-BIYhg82u.js} +1 -1
  123. package/dist/packem_shared/{scan-progress-q-N2JtIp.js → scan-progress-DWfY4zkp.js} +1 -1
  124. package/dist/packem_shared/{selectors-Ce_6UAoY.js → selectors-D2j4M9Ul.js} +1 -1
  125. package/dist/packem_shared/{signatures-Dyeyg1q9.js → signatures-C8iQ5fUq.js} +1 -1
  126. package/dist/packem_shared/target-merge-DLxJTcxn.js +11 -0
  127. package/dist/packem_shared/{target-options-7XcbqGDe.js → target-options-3t4-2F-F.js} +1 -1
  128. package/dist/packem_shared/{toolchain-C_pNMBM6.js → toolchain-BPzbahcQ.js} +1 -1
  129. package/dist/packem_shared/{typosquats-xzcAGPiM.js → typosquats-BWrmhh36.js} +1 -1
  130. package/dist/packem_shared/{use-measured-height-CBjN0fle.js → use-measured-height-BwAwGHjw.js} +1 -1
  131. package/dist/packem_shared/verify-CzUPT6Uk.js +1 -0
  132. package/dist/packem_shared/{vis-update-app-DMAC2pPf.js → vis-update-app-D6Wq8ZHM.js} +1 -1
  133. package/dist/packem_shared/{vis-user-error-xmha3L4n.js → vis-user-error-CfM4_ORo.js} +1 -1
  134. package/dist/packem_shared/{watch-BXOOX7lx.js → watch-D_oAxW_Z.js} +1 -1
  135. package/dist/packem_shared/{watch-loop-Q7UpkVbr.js → watch-loop-BrjblOz5.js} +1 -1
  136. package/dist/runtime/preload.js +1 -1
  137. package/index.d.ts +204 -204
  138. package/index.js +26 -26
  139. package/package.json +13 -13
  140. package/dist/packem_shared/dependency-scan-D_ona0Qm.js +0 -1
  141. package/dist/packem_shared/glob-BUjyjdE8-C4M8e02u.js +0 -1
  142. package/dist/packem_shared/index-CTMU29dI.js +0 -1
  143. package/dist/packem_shared/index-uBVnF4ji.js +0 -35
  144. package/dist/packem_shared/package-version-C47v64aB.js +0 -4
  145. package/dist/packem_shared/public-api-WqUCiyIe.js +0 -131
  146. package/dist/packem_shared/target-merge-Cfy7c__2.js +0 -11
  147. package/dist/packem_shared/verify-Dve9PQj3.js +0 -1
@@ -1,7 +1,7 @@
1
- import{w as c,z as $,j as i,l as y,u as O}from"./index-uBVnF4ji.js";import"./public-api-WqUCiyIe.js";import{n as C}from"../packem_chunks/cli-main.js";import{a as D}from"./readJsonSync-DweZd5ZA-0eZh9sGm.js";const W=(E,a,o)=>{const s=[],f=Object.entries(o).filter(([,n])=>n).map(([n])=>n);switch(E){case"bun":{const n=c(a,"package.json");if(y(n))try{const e=D(n);e.trustedDependencies=f,i(n,`${JSON.stringify(e,null,2)}
2
- `),s.push(`Updated package.json trustedDependencies with ${f.length} packages`)}catch(e){s.push(`Failed to update package.json: ${e instanceof Error?e.message:String(e)}`)}break}case"npm":{const n=c(a,".npmrc");let e=y(n)?$(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
1
+ import{w as c,z as $,j as i,l as y,a as O}from"./index-BLtnel38.js";import"./index-tNFGWxc0.js";import{n as C}from"../packem_chunks/cli-main.js";import{a as D}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";const W=(E,p,o)=>{const s=[],f=Object.entries(o).filter(([,n])=>n).map(([n])=>n);switch(E){case"bun":{const n=c(p,"package.json");if(y(n))try{const e=D(n);e.trustedDependencies=f,i(n,`${JSON.stringify(e,null,2)}
2
+ `),s.push(`Updated package.json trustedDependencies with ${f.length} packages`)}catch(e){s.push(`Failed to update package.json: ${e instanceof Error?e.message:String(e)}`)}break}case"npm":{const n=c(p,".npmrc");let e=y(n)?$(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
3
3
  ignore-scripts=true
4
- `,i(n,e),s.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const n=c(a,"pnpm-workspace.yaml");if(!y(n)){s.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let e={},m=[];try{const t=O(n);e=t?.allowBuilds??{},m=Array.isArray(t?.onlyBuiltDependencies)?t.onlyBuiltDependencies:[]}catch{}const g={...e,...o},j=Object.keys(o).filter(t=>e[t]!==o[t]).length,d=f.toSorted((t,p)=>t.localeCompare(p)),k=[...new Set([...m,...d])].toSorted((t,p)=>t.localeCompare(p)),w=d.filter(t=>!m.includes(t)).length;if(j===0&&w===0)s.push(`All ${String(Object.keys(o).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);else{const t=Object.keys(g).sort(),p=l=>l.startsWith("@")||l.includes("/")||/[:#\s]/.test(l),h=l=>p(l)?`'${l.replaceAll("'","''")}'`:l,u=`allowBuilds:
4
+ `,i(n,e),s.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const n=c(p,"pnpm-workspace.yaml");if(!y(n)){s.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let e={},m=[];try{const t=O(n);e=t?.allowBuilds??{},m=Array.isArray(t?.onlyBuiltDependencies)?t.onlyBuiltDependencies:[]}catch{}const g={...e,...o},j=Object.keys(o).filter(t=>e[t]!==o[t]).length,d=f.toSorted((t,a)=>t.localeCompare(a)),k=[...new Set([...m,...d])].toSorted((t,a)=>t.localeCompare(a)),w=d.filter(t=>!m.includes(t)).length;if(j===0&&w===0)s.push(`All ${String(Object.keys(o).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);else{const t=Object.keys(g).sort(),a=l=>l.startsWith("@")||l.includes("/")||/[:#\s]/.test(l),h=l=>a(l)?`'${l.replaceAll("'","''")}'`:l,u=`allowBuilds:
5
5
  ${t.map(l=>` ${h(l)}: ${String(g[l])}`).join(`
6
6
  `)}
7
7
  `;let r=$(n);r.endsWith(`
@@ -9,13 +9,13 @@ ${t.map(l=>` ${h(l)}: ${String(g[l])}`).join(`
9
9
  `);const S=/^allowBuilds:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;if(r=S.test(r)?r.replace(S,u):`${r.trimEnd()}
10
10
 
11
11
  ${u}`,k.length>0){const l=`onlyBuiltDependencies:
12
- ${k.map(B=>` - ${p(B)?`'${B.replaceAll("'","''")}'`:B}`).join(`
12
+ ${k.map(B=>` - ${a(B)?`'${B.replaceAll("'","''")}'`:B}`).join(`
13
13
  `)}
14
14
  `,A=/^onlyBuiltDependencies:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;r=A.test(r)?r.replace(A,l):`${r.trimEnd()}
15
15
 
16
- ${l}`}i(n,r),s.push(`Updated pnpm-workspace.yaml allowBuilds (${String(j)} new, ${String(t.length)} total)`),w>0&&s.push(`Updated pnpm-workspace.yaml onlyBuiltDependencies (${String(w)} new, ${String(k.length)} total)`)}const b=c(a,"package.json");if(y(b)&&d.length>0)try{const t=D(b),p=Array.isArray(t.pnpm?.onlyBuiltDependencies)?t.pnpm.onlyBuiltDependencies:[],h=[...new Set([...p,...d])].toSorted((r,S)=>r.localeCompare(S)),u=d.filter(r=>!p.includes(r)).length;u>0&&(t.pnpm={...t.pnpm,onlyBuiltDependencies:h},i(b,`${JSON.stringify(t,null,2)}
17
- `),s.push(`Updated package.json pnpm.onlyBuiltDependencies (${String(u)} new, ${String(h.length)} total)`))}catch(t){s.push(`Failed to update package.json pnpm.onlyBuiltDependencies: ${t instanceof Error?t.message:String(t)}`)}break}case"yarn":{if(C(a)){const n=c(a,".yarnrc.yml");let e=$(n);const m=/^\s*enableScripts\s*:/m.test(e),g=/^\s*enableScripts\s*:\s*false\s*$/m.test(e);m?g?s.push(".yarnrc.yml already has enableScripts: false"):(e=e.replace(/^\s*enableScripts\s*:.+$/m,"enableScripts: false"),i(n,e),s.push("Changed enableScripts to false in .yarnrc.yml")):(e=`${e.trimEnd()}
16
+ ${l}`}i(n,r),s.push(`Updated pnpm-workspace.yaml allowBuilds (${String(j)} new, ${String(t.length)} total)`),w>0&&s.push(`Updated pnpm-workspace.yaml onlyBuiltDependencies (${String(w)} new, ${String(k.length)} total)`)}const b=c(p,"package.json");if(y(b)&&d.length>0)try{const t=D(b),a=Array.isArray(t.pnpm?.onlyBuiltDependencies)?t.pnpm.onlyBuiltDependencies:[],h=[...new Set([...a,...d])].toSorted((r,S)=>r.localeCompare(S)),u=d.filter(r=>!a.includes(r)).length;u>0&&(t.pnpm={...t.pnpm,onlyBuiltDependencies:h},i(b,`${JSON.stringify(t,null,2)}
17
+ `),s.push(`Updated package.json pnpm.onlyBuiltDependencies (${String(u)} new, ${String(h.length)} total)`))}catch(t){s.push(`Failed to update package.json pnpm.onlyBuiltDependencies: ${t instanceof Error?t.message:String(t)}`)}break}case"yarn":{if(C(p)){const n=c(p,".yarnrc.yml");let e=$(n);const m=/^\s*enableScripts\s*:/m.test(e),g=/^\s*enableScripts\s*:\s*false\s*$/m.test(e);m?g?s.push(".yarnrc.yml already has enableScripts: false"):(e=e.replace(/^\s*enableScripts\s*:.+$/m,"enableScripts: false"),i(n,e),s.push("Changed enableScripts to false in .yarnrc.yml")):(e=`${e.trimEnd()}
18
18
  enableScripts: false
19
- `,i(n,e),s.push("Added enableScripts: false to .yarnrc.yml"))}else{const n=c(a,".npmrc");let e=y(n)?$(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
19
+ `,i(n,e),s.push("Added enableScripts: false to .yarnrc.yml"))}else{const n=c(p,".npmrc");let e=y(n)?$(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
20
20
  ignore-scripts=true
21
21
  `,i(n,e),s.push("Added ignore-scripts=true to .npmrc (yarn classic lacks enableScripts)"))}break}}return s};export{W as O};
@@ -1,2 +1,2 @@
1
- import{createRequire as j}from"node:module";import{F as W}from"./target-merge-Cfy7c__2.js";import{osvBloomDecode as J,osvBloomProbeBatch as z,NATIVE_BINDING_VERSION as D}from"#native";let C;const U=e=>(C??=j(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[o,t]=h.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return h.getBuiltinModule(e)}return U(e)},{createHash:F,randomUUID:V}=p("node:crypto"),{existsSync:g}=p("node:fs"),{readFile:O,mkdir:M,stat:B,writeFile:H,rename:G,unlink:q}=p("node:fs/promises"),{join:d,dirname:P}=p("node:path"),I=6;if(D!==I)throw new Error(`vis native binding ABI mismatch in osv-bloom: expected ${I}, got ${D}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const rt="https://endevco.github.io/osv-bloom",K=new Set(["endevco.github.io"]);class w extends Error{cause="OSV_BLOOM_SOURCE_NOT_ALLOWED";constructor(o){super(`osv-bloom source host '${o}' is not in the built-in allowlist. Add it to \`security.audit.advisories.bloom.allowedHosts\` if intentional.`),this.name="OsvBloomSourceNotAllowedError"}}class _ extends Error{cause="OSV_BLOOM_NETWORK";constructor(o,t){super(`osv-bloom fetch failed for ${o}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="OsvBloomNetworkError"}}class Y extends Error{cause="OSV_BLOOM_INTEGRITY";constructor(o,t){super(`osv-bloom filter.bin sha256 mismatch (expected ${o}, got ${t}). Refusing to install a corrupted filter.`),this.name="OsvBloomIntegrityError"}}class m extends Error{cause="OSV_BLOOM_MANIFEST";constructor(o){super(`osv-bloom manifest invalid: ${o}`),this.name="OsvBloomManifestError"}}class Q extends Error{cause="OSV_BLOOM_CACHE_MISS";constructor(o){super(`No osv-bloom cache at ${o}. Run 'vis advisories bloom sync' first.`),this.name="OsvBloomCacheMissError"}}const y=e=>{const o=W("vis",{create:!0,cwd:e})??d(e,"node_modules",".cache","vis");return d(o,"osv-bloom")},l=e=>d(e,"filter.bin"),R=e=>d(e,"manifest.json"),x=e=>d(e,"state.json"),X=(e,o)=>{let t;try{t=new URL(e)}catch{throw new w(e)}if(!t.host)throw new w(e);if(t.protocol!=="https:")throw new w(`${t.protocol}//${t.host}`);if(!new Set([...K,...o??[]]).has(t.host))throw new w(t.host);return t},it=async e=>{const o=Date.now(),t=e.cacheDir??y(e.workspaceRoot);await M(t,{recursive:!0});const s=X(e.source,e.allowedHosts),i=new URL("manifest.json",N(s.toString())),r=new URL("filter.bin",N(s.toString())),n=await A(i,{method:"GET"});if(!n.ok)throw new _(i.toString(),n.status);const v=await n.text(),a=L(v),f=await T(t);if(!e.force&&f?.setDigestSha256===a.setDigestSha256&&g(l(t)))return{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};const S={};!e.force&&f?.filterEtag&&(S.headers={"if-none-match":f.filterEtag});const u=await A(r,{...S,method:"GET"});if(u.status===304&&f&&g(l(t)))return await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:f.filterEtag,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};if(!u.ok||!u.body)throw new _(r.toString(),u.status);const c=Buffer.from(await u.arrayBuffer());e.onProgress&&e.onProgress(c.length,c.length);const E=Z(c);if(E!==a.filterSha256)throw new Y(a.filterSha256,E);if(c.length!==a.bloomByteLen)throw new m(`filter.bin length ${c.length} does not match manifest.bloom_byte_len ${a.bloomByteLen}`);const k=u.headers.get("etag")??void 0;return await b(l(t),c),await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:k,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:c.length,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!1}},nt=async(e,o)=>{const t=o?.cacheDir??y(e),s=l(t);if(!g(s)){if(o?.softFail)return null;throw new Q(t)}const i=await O(s);return J(i)},at=(e,o)=>z(e,o),ct=async(e,o)=>{const t=o??y(e);if(!g(l(t)))return{cacheDir:t,present:!1};let s,i;try{s=L(await O(R(t),"utf8"))}catch{}try{i=await T(t)}catch{}return{cacheDir:t,fetchedAtIso:i?.fetchedAtIso,manifest:s,present:!0}},L=e=>{let o;try{o=JSON.parse(e)}catch(r){throw new m(r instanceof Error?r.message:String(r))}const t=r=>{const n=o[r];if(typeof n!="number"||Number.isNaN(n))throw new m(`field '${r}' missing or non-numeric`);return n},s=r=>{const n=o[r];if(typeof n!="string"||n.length===0)throw new m(`field '${r}' missing or empty`);return n},i=t("format_version");if(i!==1)throw new m(`unsupported format_version ${i} (this build expects v1)`);return{advisoryCount:t("advisory_count"),bloomByteLen:t("bloom_byte_len"),bloomKHashes:t("bloom_k_hashes"),bloomMBits:t("bloom_m_bits"),builtAtRfc3339:s("built_at_rfc3339"),builtAtUnix:t("built_at_unix"),entryCount:t("entry_count"),filterSha256:s("filter_sha256"),formatVersion:i,setDigestSha256:s("set_digest_sha256"),sourceUrl:s("source_url"),targetFpr:t("target_fpr")}},T=async e=>{try{const o=await O(x(e),"utf8"),t=JSON.parse(o);return typeof t.setDigestSha256!="string"||typeof t.fetchedAtIso!="string"?void 0:{fetchedAtIso:t.fetchedAtIso,filterEtag:typeof t.filterEtag=="string"?t.filterEtag:void 0,setDigestSha256:t.setDigestSha256}}catch{return}},$=async(e,o,t)=>{await b(R(e),Buffer.from(o,"utf8")),await b(x(e),Buffer.from(`${JSON.stringify(t,void 0,2)}
2
- `,"utf8"))},b=async(e,o)=>{await M(P(e),{recursive:!0});const t=`${e}.${process.pid}.${V()}.tmp`;try{await H(t,o),await G(t,e)}catch(s){throw await q(t).catch(()=>{}),s}},Z=e=>F("sha256").update(e).digest("hex"),N=e=>e.endsWith("/")?e:`${e}/`,tt=3e4,A=async(e,o)=>{try{return await fetch(e,{...o,signal:AbortSignal.timeout(tt)})}catch(t){throw new _(e.toString(),t instanceof Error?t.message:String(t))}};export{rt as D,Q as O,ct as g,nt as l,at as p,it as s};
1
+ import{createRequire as j}from"node:module";import{K as P}from"./target-merge-DLxJTcxn.js";import{osvBloomDecode as W,osvBloomProbeBatch as J,NATIVE_BINDING_VERSION as D}from"#native";let C;const U=e=>(C??=j(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[o,t]=h.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return h.getBuiltinModule(e)}return U(e)},{createHash:V,randomUUID:F}=p("node:crypto"),{existsSync:g}=p("node:fs"),{readFile:O,mkdir:M,stat:B,writeFile:H,rename:G,unlink:q}=p("node:fs/promises"),{join:d,dirname:K}=p("node:path"),I=6;if(D!==I)throw new Error(`vis native binding ABI mismatch in osv-bloom: expected ${I}, got ${D}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const rt="https://endevco.github.io/osv-bloom",z=new Set(["endevco.github.io"]);class w extends Error{cause="OSV_BLOOM_SOURCE_NOT_ALLOWED";constructor(o){super(`osv-bloom source host '${o}' is not in the built-in allowlist. Add it to \`security.audit.advisories.bloom.allowedHosts\` if intentional.`),this.name="OsvBloomSourceNotAllowedError"}}class _ extends Error{cause="OSV_BLOOM_NETWORK";constructor(o,t){super(`osv-bloom fetch failed for ${o}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="OsvBloomNetworkError"}}class Y extends Error{cause="OSV_BLOOM_INTEGRITY";constructor(o,t){super(`osv-bloom filter.bin sha256 mismatch (expected ${o}, got ${t}). Refusing to install a corrupted filter.`),this.name="OsvBloomIntegrityError"}}class m extends Error{cause="OSV_BLOOM_MANIFEST";constructor(o){super(`osv-bloom manifest invalid: ${o}`),this.name="OsvBloomManifestError"}}class Q extends Error{cause="OSV_BLOOM_CACHE_MISS";constructor(o){super(`No osv-bloom cache at ${o}. Run 'vis advisories bloom sync' first.`),this.name="OsvBloomCacheMissError"}}const y=e=>{const o=P("vis",{create:!0,cwd:e})??d(e,"node_modules",".cache","vis");return d(o,"osv-bloom")},l=e=>d(e,"filter.bin"),R=e=>d(e,"manifest.json"),x=e=>d(e,"state.json"),X=(e,o)=>{let t;try{t=new URL(e)}catch{throw new w(e)}if(!t.host)throw new w(e);if(t.protocol!=="https:")throw new w(`${t.protocol}//${t.host}`);if(!new Set([...z,...o??[]]).has(t.host))throw new w(t.host);return t},it=async e=>{const o=Date.now(),t=e.cacheDir??y(e.workspaceRoot);await M(t,{recursive:!0});const s=X(e.source,e.allowedHosts),i=new URL("manifest.json",N(s.toString())),r=new URL("filter.bin",N(s.toString())),n=await A(i,{method:"GET"});if(!n.ok)throw new _(i.toString(),n.status);const v=await n.text(),a=L(v),f=await T(t);if(!e.force&&f?.setDigestSha256===a.setDigestSha256&&g(l(t)))return{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};const S={};!e.force&&f?.filterEtag&&(S.headers={"if-none-match":f.filterEtag});const u=await A(r,{...S,method:"GET"});if(u.status===304&&f&&g(l(t)))return await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:f.filterEtag,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};if(!u.ok||!u.body)throw new _(r.toString(),u.status);const c=Buffer.from(await u.arrayBuffer());e.onProgress&&e.onProgress(c.length,c.length);const E=Z(c);if(E!==a.filterSha256)throw new Y(a.filterSha256,E);if(c.length!==a.bloomByteLen)throw new m(`filter.bin length ${c.length} does not match manifest.bloom_byte_len ${a.bloomByteLen}`);const k=u.headers.get("etag")??void 0;return await b(l(t),c),await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:k,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:c.length,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!1}},nt=async(e,o)=>{const t=o?.cacheDir??y(e),s=l(t);if(!g(s)){if(o?.softFail)return null;throw new Q(t)}const i=await O(s);return W(i)},at=(e,o)=>J(e,o),ct=async(e,o)=>{const t=o??y(e);if(!g(l(t)))return{cacheDir:t,present:!1};let s,i;try{s=L(await O(R(t),"utf8"))}catch{}try{i=await T(t)}catch{}return{cacheDir:t,fetchedAtIso:i?.fetchedAtIso,manifest:s,present:!0}},L=e=>{let o;try{o=JSON.parse(e)}catch(r){throw new m(r instanceof Error?r.message:String(r))}const t=r=>{const n=o[r];if(typeof n!="number"||Number.isNaN(n))throw new m(`field '${r}' missing or non-numeric`);return n},s=r=>{const n=o[r];if(typeof n!="string"||n.length===0)throw new m(`field '${r}' missing or empty`);return n},i=t("format_version");if(i!==1)throw new m(`unsupported format_version ${i} (this build expects v1)`);return{advisoryCount:t("advisory_count"),bloomByteLen:t("bloom_byte_len"),bloomKHashes:t("bloom_k_hashes"),bloomMBits:t("bloom_m_bits"),builtAtRfc3339:s("built_at_rfc3339"),builtAtUnix:t("built_at_unix"),entryCount:t("entry_count"),filterSha256:s("filter_sha256"),formatVersion:i,setDigestSha256:s("set_digest_sha256"),sourceUrl:s("source_url"),targetFpr:t("target_fpr")}},T=async e=>{try{const o=await O(x(e),"utf8"),t=JSON.parse(o);return typeof t.setDigestSha256!="string"||typeof t.fetchedAtIso!="string"?void 0:{fetchedAtIso:t.fetchedAtIso,filterEtag:typeof t.filterEtag=="string"?t.filterEtag:void 0,setDigestSha256:t.setDigestSha256}}catch{return}},$=async(e,o,t)=>{await b(R(e),Buffer.from(o,"utf8")),await b(x(e),Buffer.from(`${JSON.stringify(t,void 0,2)}
2
+ `,"utf8"))},b=async(e,o)=>{await M(K(e),{recursive:!0});const t=`${e}.${process.pid}.${F()}.tmp`;try{await H(t,o),await G(t,e)}catch(s){throw await q(t).catch(()=>{}),s}},Z=e=>V("sha256").update(e).digest("hex"),N=e=>e.endsWith("/")?e:`${e}/`,tt=3e4,A=async(e,o)=>{try{return await fetch(e,{...o,signal:AbortSignal.timeout(tt)})}catch(t){throw new _(e.toString(),t instanceof Error?t.message:String(t))}};export{rt as D,Q as O,ct as g,nt as l,at as p,it as s};
@@ -0,0 +1,4 @@
1
+ import{createRequire as Bt}from"node:module";import{k as J,w as T,n as V,J as $,a as _e,b as Mt,z as jt,i as Wt}from"./index-BLtnel38.js";import{N as He,a as ze}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";import"./index-tNFGWxc0.js";import{a as Se,g as _t}from"./_commonjsHelpers-B5Y90VFO.js";import{r as Ht,a as zt}from"./clean-DWjQl14S.js";let Rt;const It=a=>(Rt??=Bt(import.meta.url))(a),R=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,K=a=>{if(typeof R<"u"&&R.versions&&R.versions.node){const[e,t]=R.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return R.getBuiltinModule(a)}return It(a)},{dirname:kt}=K("node:path"),je=K("node:url"),{fileURLToPath:Ut}=je,We=K("node:module"),{createRequire:z}=We,Yt=K("util"),O=a=>"Deno"in a,xr=()=>{if(O(globalThis)){const a=globalThis.Deno,e=a.execPath();let t=e;try{const{importMeta:i}=globalThis;i?.url&&(t=i.url)}catch{}return[e,t,...a.args]}return process.argv},Ar=()=>O(globalThis)?globalThis.Deno.cwd():process.cwd(),Er=()=>{if(O(globalThis)){const a=globalThis.Deno;return new Proxy(a.env.toObject(),{get:(e,t)=>typeof t=="string"?a.env.get(t):e[t],has:(e,t)=>typeof t=="string"?a.env.has(t):t in e,set:(e,t,i)=>typeof t=="string"?(i===void 0||a.env.set(t,i),!0):!1})}return process.env},$r=()=>O(globalThis)?[]:process.execArgv,Or=()=>O(globalThis)?globalThis.Deno.execPath():process.execPath,Nr=()=>{if(O(globalThis)){const a=globalThis.Deno.build?.os??"unknown";return a==="windows"?"win32":a}return process.platform},Fr=()=>{if(O(globalThis)){const a=globalThis.Deno.build?.arch??"unknown";return a==="x86_64"?"x64":a==="aarch64"?"arm64":a}return process.arch},Gr=(a=0)=>{if(O(globalThis))throw globalThis.Deno.exit(a),new Error("Deno exit failed");process.exit(a)},Tr=(a,e)=>{if(O(globalThis))return()=>{};const t=process;return t.on(a,e),()=>{t.removeListener(a,e)}},qt=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"];let Vt;const Kt=a=>(Vt??=z(import.meta.url))(a),I=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ye=a=>{if(typeof I<"u"&&I.versions&&I.versions.node){const[e,t]=I.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return I.getBuiltinModule(a)}return Kt(a)},{execFileSync:Jt}=Ye("node:child_process"),{existsSync:ye,readFileSync:Xt}=Ye("node:fs"),Zt=[...qt],be=new Set(["bun","npm","pnpm","yarn"]),qe=a=>{const e=He(Xt(a,"utf8"));return typeof e?.packageManager=="string"?e.packageManager:void 0},Qt=a=>{let e;if(Zt.forEach(i=>{!e&&ye(T(a,i))&&(e=T(a,i))}),e)return e;const t=T(a,"package.json");if(ye(t)&&qe(t)!==void 0)return t},ei=a=>{if(!a)throw new V("Could not find a package manager");if(a.endsWith("package.json")){const e=qe(a);if(e){const t=["npm","yarn","pnpm","bun"].find(i=>e.startsWith(i));if(t)return{packageManager:t,path:$(a)}}}if(a.endsWith("yarn.lock"))return{packageManager:"yarn",path:$(a)};if(a.endsWith("package-lock.json")||a.endsWith("npm-shrinkwrap.json"))return{packageManager:"npm",path:$(a)};if(a.endsWith("pnpm-lock.yaml"))return{packageManager:"pnpm",path:$(a)};if(a.endsWith("bun.lock")||a.endsWith("bun.lockb"))return{packageManager:"bun",path:$(a)};throw new V("Could not find a package manager")},ti=a=>{const e=J(Qt,{...a&&{cwd:a}});return ei(e)},Br=a=>{if(!be.has(a))throw new Error(`Unsupported package manager "${a}". Expected one of: ${[...be].join(", ")}.`);return Jt(a,["--version"]).toString("utf8").trim()};let ii;const ri=a=>(ii??=z(import.meta.url))(a),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ve=a=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[e,t]=k.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return k.getBuiltinModule(a)}return ri(a)};Ve("node:fs");Ve("node:fs/promises");const si={sha256:"sha256",sha384:"sha384",sha512:"sha512"},ni=1024,oi=/^[A-Z0-9+/]+={0,2}$/i,Ce="node_modules/",_=/^['"]/,H=/['"]$/,ai=/^[a-z][a-zA-Z0-9]*:\s*$/m,li=/resolution:\s*\{[^}]*integrity:\s*([^,}\s]+)/,ci=/^["']?((?:@[^/@"']+\/)?[^@"'\n]+)@[^\n]+\n((?:[\t ][^\n]*(?:\n|$))+)/gm,hi=/^\s+version:?\s+"?([^"\n]+)"?/m,ui=/^\s+integrity[\s:]+"?([^"\s]+)"?/m,X=a=>{if(a.length>ni)return;const e=a.indexOf("-");if(e<=0)return;const t=si[a.slice(0,e).toLowerCase()];if(!t)return;const i=a.slice(e+1);if(oi.test(i))try{const s=Buffer.from(i,"base64");return s.length===0?void 0:{algorithm:t,hex:s.toString("hex")}}catch{return}},Z=(a,e,t)=>{const i=`${t.name}@${t.version}`;e.has(i)||(e.add(i),a.push(t))},x=(a,e,t)=>{t&&Object.keys(t).length>0&&(a[e]={...t})},B=a=>{if(!a)return;const e={};for(const[t,i]of Object.entries(a))e[t]=[i];return Object.keys(e).length>0?e:void 0},pi=a=>{const e=[],t=new Set;let i;try{i=JSON.parse(a)}catch{return e}if(!i.packages)return e;for(const[s,r]of Object.entries(i.packages)){if(!s||!r.version)continue;const o=s.lastIndexOf(Ce);if(o===-1)continue;const n=s.slice(o+Ce.length);if(n.length===0)continue;const l=n.split("/"),u=n.startsWith("@")?2:1;if(l.length!==u||l.some(v=>v.length===0))continue;const f=r.name??n;if(f.startsWith("."))continue;const g={name:f,version:r.version};if(r.integrity){const v=X(r.integrity);v&&(g.integrity=v)}x(g,"dependencies",B(r.dependencies)),x(g,"peerDependencies",B(r.peerDependencies)),x(g,"optionalDependencies",B(r.optionalDependencies)),Z(e,t,g)}return e},Ke=a=>{let e=a.trim();e.startsWith("/")&&(e=e.slice(1)),e=e.replace(_,"").replace(H,"");const t=e.indexOf("(");t>0&&(e=e.slice(0,t));const i=e.lastIndexOf("@");if(i<=0)return;const s=e.slice(0,i),r=e.slice(i+1);if(!(!s||!r||r.startsWith("link:")||r.startsWith("workspace:")||r.startsWith("file:")))return{name:s,version:r}},Je=(a,e)=>{const t=new RegExp(String.raw`^${e}:\s*$`,"m").exec(a);if(!t)return;const i=t.index+t[0].length,s=ai.exec(a.slice(i));return a.slice(i,s?i+s.index:a.length)},fi=a=>{const e=new Map,t=Je(a,"snapshots");if(!t)return e;const i=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let s;for(;(s=i.exec(t)??void 0)!==void 0;){const r=Ke(s[1]);if(!r)continue;const o=`${r.name}@${r.version}`,n=s[2],l=e.get(o)??{};for(const u of["dependencies","peerDependencies","optionalDependencies"]){const f=Y(n,u);if(!f)continue;const g=l[u]??{};for(const[v,y]of Object.entries(f)){const b=g[v]??[];for(const m of y)b.includes(m)||b.push(m);g[v]=b}l[u]=g}e.set(o,l)}return e},di=a=>{const e=[],t=new Set,i=Je(a,"packages");if(!i)return e;const s=fi(a),r=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let o;for(;(o=r.exec(i)??void 0)!==void 0;){const n=Ke(o[1]);if(!n)continue;const l=o[2],u=li.exec(l),f={name:n.name,version:n.version};if(u?.[1]){const v=X(u[1]);v&&(f.integrity=v)}const g=s.get(`${n.name}@${n.version}`);x(f,"dependencies",g?.dependencies??Y(l,"dependencies")),x(f,"peerDependencies",g?.peerDependencies??Y(l,"peerDependencies")),x(f,"optionalDependencies",g?.optionalDependencies??Y(l,"optionalDependencies")),Z(e,t,f)}return e},Y=(a,e)=>{const t=new RegExp(String.raw`^ {4}${e}:\s*\n((?: {6,}[^\n]*\n?)+)`,"m").exec(a);if(!t?.[1])return;const i={},s=/^ {6}([^\s:]+):\s*([^\n]+)/gm;let r;for(;(r=s.exec(t[1])??void 0)!==void 0;){const o=r[1].replace(_,"").replace(H,"");let n=r[2].trim();n=n.replace(_,"").replace(H,"");const l=n.indexOf("(");if(l>0&&(n=n.slice(0,l).trim()),!o||!n)continue;const u=i[o]??[];u.includes(n)||u.push(n),i[o]=u}return Object.keys(i).length>0?i:void 0},mi=a=>{const e=[],t=new Set,i=ci;i.lastIndex=0;let s;for(;(s=i.exec(a)??void 0)!==void 0;){const r=s[1].replace(_,"").replace(H,"");if(!r)continue;const o=s[2],n=hi.exec(o);if(!n?.[1])continue;const l={name:r,version:n[1].trim()},u=ui.exec(o);if(u?.[1]){const f=X(u[1]);f&&(l.integrity=f)}x(l,"dependencies",ee(o,"dependencies")),x(l,"peerDependencies",ee(o,"peerDependencies")),x(l,"optionalDependencies",ee(o,"optionalDependencies")),Z(e,t,l)}return e},ee=(a,e)=>{const t=new RegExp(String.raw`^ {2}${e}:\s*\n((?: {4,}[^\n]*\n?)+)`,"m").exec(a);if(!t?.[1])return;const i={},s=/^ {4}(['"]?[^\s:'"]+['"]?)\s*(?::\s*)?['"]([^'"\n]+)['"]/gm;let r;for(;(r=s.exec(t[1])??void 0)!==void 0;){const o=r[1].replace(_,"").replace(H,""),n=r[2];if(o&&n){const l=i[o]??[];l.includes(n)||l.push(n),i[o]=l}}return Object.keys(i).length>0?i:void 0},gi=/,(?=\s*[}\]])/g,Li=a=>{const e=[],t=new Set;let i;try{i=JSON.parse(a.replaceAll(gi,""))}catch{return e}if(!i.packages)return e;for(const s of Object.values(i.packages)){const r=s[0];if(typeof r!="string")continue;const o=r.indexOf("@",1);if(o<=0)continue;const n=r.slice(0,o),l=r.slice(o+1);if(!n||!l||l.startsWith("workspace:")||l.startsWith("link:")||l.startsWith("file:"))continue;const u={name:n,version:l},f=s[3];if(typeof f=="string"&&f.length>0){const v=X(f);v&&(u.integrity=v)}const g=s[2];if(g&&typeof g=="object"&&!Array.isArray(g)){const v=g;x(u,"dependencies",B(v.dependencies)),x(u,"peerDependencies",B(v.peerDependencies)),x(u,"optionalDependencies",B(v.optionalDependencies))}Z(e,t,u)}return e},Rr=(a,e)=>{switch(e){case"bun":return Li(a);case"npm":return pi(a);case"pnpm":return di(a);case"yarn":return mi(a);default:return[]}};let Si;const vi=a=>(Si??=z(import.meta.url))(a),U=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yi=a=>{if(typeof U<"u"&&U.versions&&U.versions.node){const[e,t]=U.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return U.getBuiltinModule(a)}return vi(a)},{existsSync:Pe,readFileSync:bi}=yi("node:fs"),Ci=a=>{let e;try{e=He(a)}catch{return!1}if(!e||typeof e!="object"||Array.isArray(e))return!1;const{workspaces:t}=e;return typeof t=="object"&&t!==null},Ir=a=>{const e=J(["lerna.json","turbo.json"],{type:"file",...a&&{cwd:a}});if(e?.endsWith("lerna.json")){const i=ze(e);if(i&&typeof i=="object"&&!Array.isArray(i)){const s=i;if(s.useWorkspaces||s.packages)return{path:$(e),strategy:"lerna"}}}const t=e?.endsWith("turbo.json");try{const{packageManager:i,path:s}=ti(a);if(["npm","yarn"].includes(i)){const r=T(s,"package.json");if(Pe(r)){const o=bi(T(s,"package.json"),"utf8");if(Ci(o))return{path:s,strategy:t?"turbo":i}}}else if(i==="pnpm"){const r=T(s,"pnpm-workspace.yaml");if(Pe(r))return{path:s,strategy:t?"turbo":"pnpm"}}}catch(i){if(!(i instanceof V))throw i}throw new Error(`No monorepo root could be found upwards from the directory ${String(a??process.cwd())} using lerna, yarn, pnpm, or npm as indicators.`)};let Pi;const Di=a=>(Pi??=z(import.meta.url))(a),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wi=a=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,t]=M.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return M.getBuiltinModule(a)}return Di(a)};wi("node:fs");var te,De;function Xe(){return De||(De=1,te=["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"]),te}var ie,we;function xi(){return we||(we=1,ie=["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"]),ie}var re,xe;function Ai(){return xe||(xe=1,re=["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"]),re}var se,Ae;function Ei(){if(Ae)return se;Ae=1;var a=[].concat(Xe()).concat(xi()),e=Ai();return se=function(t){var i=0;function s(){return i<t.length}function r(L){if(L instanceof RegExp){var h=t.slice(i),S=h.match(L);if(S)return i+=S[0].length,S[0]}else if(t.indexOf(L,i)===i)return i+=L.length,L}function o(){r(/[ ]*/)}function n(){for(var L,h=["WITH","AND","OR","(",")",":","+"],S=0;S<h.length&&(L=r(h[S]),!L);S++);if(L==="+"&&i>1&&t[i-2]===" ")throw new Error("Space before `+`");return L&&{type:"OPERATOR",string:L}}function l(){return r(/[A-Za-z0-9-.]+/)}function u(){var L=l();if(!L)throw new Error("Expected idstring at offset "+i);return L}function f(){if(r("DocumentRef-")){var L=u();return{type:"DOCUMENTREF",string:L}}}function g(){if(r("LicenseRef-")){var L=u();return{type:"LICENSEREF",string:L}}}function v(){var L=i,h=l();if(a.indexOf(h)!==-1)return{type:"LICENSE",string:h};if(e.indexOf(h)!==-1)return{type:"EXCEPTION",string:h};i=L}function y(){return n()||f()||g()||v()}for(var b=[];s()&&(o(),!!s());){var m=y();if(!m)throw new Error("Unexpected `"+t[i]+"` at offset "+i);b.push(m)}return b},se}var ne,Ee;function $i(){return Ee||(Ee=1,ne=function(a){var e=0;function t(){return e<a.length}function i(){return t()?a[e]:null}function s(){if(!t())throw new Error;e++}function r(m){var L=i();if(L&&L.type==="OPERATOR"&&m===L.string)return s(),L.string}function o(){if(r("WITH")){var m=i();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function n(){var m=e,L="",h=i();if(h.type==="DOCUMENTREF"&&(s(),L+="DocumentRef-"+h.string+":",!r(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(h=i(),h.type==="LICENSEREF")return s(),L+="LicenseRef-"+h.string,{license:L};e=m}function l(){var m=i();if(m&&m.type==="LICENSE"){s();var L={license:m.string};r("+")&&(L.plus=!0);var h=o();return h&&(L.exception=h),L}}function u(){var m=r("(");if(m){var L=y();if(!r(")"))throw new Error("Expected `)`");return L}}function f(){return u()||n()||l()}function g(m,L){return function h(){var S=L();if(S){if(!r(m))return S;var C=h();if(!C)throw new Error("Expected expression");return{left:S,conjunction:m.toLowerCase(),right:C}}}}var v=g("AND",f),y=g("OR",v),b=y();if(!b||t())throw new Error("Syntax error");return b}),ne}var oe,$e;function Ze(){if($e)return oe;$e=1;var a=Ei(),e=$i();return oe=function(t){return e(a(t))},oe}var ae,Oe;function Oi(){if(Oe)return ae;Oe=1;var a=Ze(),e=Xe();function t(h){try{return a(h),!0}catch{return!1}}function i(h,S){var C=S[0].length-h[0].length;return C!==0?C:h[0].toUpperCase().localeCompare(S[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),r=0,o=1,n=[function(h){return h.toUpperCase()},function(h){return h.trim()},function(h){return h.replace(/\./g,"")},function(h){return h.replace(/\s+/g,"")},function(h){return h.replace(/\s+/g,"-")},function(h){return h.replace("v","-")},function(h){return h.replace(/,?\s*(\d)/,"-$1")},function(h){return h.replace(/,?\s*(\d)/,"-$1.0")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(h){return h[0].toUpperCase()+h.slice(1)},function(h){return h.replace("/","-")},function(h){return h.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(h){return h.indexOf("3.0")!==-1?h+"-or-later":h+"-only"},function(h){return h+"only"},function(h){return h.replace(/(\d)$/,"-$1.0")},function(h){return h.replace(/(-| )?(\d)$/,"-$2-Clause")},function(h){return h.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(h){return h.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(h){return h.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(h){return h.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(h){return h.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(h){return h.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(h){return"CC-"+h},function(h){return"CC-"+h+"-4.0"},function(h){return h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(h){return"CC-"+h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],l=e.map(function(h){var S=/^(.*)-\d+\.\d+$/.exec(h);return S?[S[0],S[1]]:[h,null]}).reduce(function(h,S){var C=S[1];return h[C]=h[C]||[],h[C].push(S[0]),h},{}),u=Object.keys(l).map(function(h){return[h,l[h]]}).filter(function(h){return h[1].length===1&&h[0]!==null&&h[0]!=="APL"}).map(function(h){return[h[0],h[1][0]]});l=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),g=0,v=1,y=function(h){for(var S=0;S<n.length;S++){var C=n[S](h).trim();if(C!==h&&t(C))return C}return null},b=function(h){for(var S=h.toUpperCase(),C=0;C<f.length;C++){var c=f[C];if(S.indexOf(c[g])>-1)return c[v]}return null},m=function(h,S){for(var C=0;C<s.length;C++){var c=s[C],p=c[r];if(h.indexOf(p)>-1){var d=h.replace(p,c[o]),P=S(d);if(P!==null)return P}}return null};ae=function(h,S){S=S||{};var C=S.upgrade===void 0?!0:!!S.upgrade;function c(D){return C?L(D):D}var p=typeof h=="string"&&h.trim().length!==0;if(!p)throw Error("Invalid argument. Expected non-empty string.");if(h=h.trim(),t(h))return c(h);var d=h.replace(/\+$/,"").trim();if(t(d))return c(d);var P=y(h);return P!==null||(P=m(h,function(D){return t(D)?D:y(D)}),P!==null)||(P=b(h),P!==null)||(P=m(h,b),P!==null)?c(P):null};function L(h){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(h)!==-1?h+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(h)!==-1?h.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(h)!==-1?h+"-or-later":h}return ae}var le,Ne;function Ni(){if(Ne)return le;Ne=1;var a=Ze(),e=Oi(),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(o,n){return n.slice(0,o.length)===o}function r(o){if(o.hasOwnProperty("license")){var n=o.license;return s("LicenseRef",n)||s("DocumentRef",n)}else return r(o.left)||r(o.right)}return le=function(o){var n;try{n=a(o)}catch{var l;if(o==="UNLICENSED"||o==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(l=i.exec(o))return{validForOldPackages:!0,validForNewPackages:!0,inFile:l[1]};var u={validForOldPackages:!1,validForNewPackages:!1,warnings:[t]};if(o.trim().length!==0){var f=e(o);f&&u.warnings.push('license is similar to the valid expression "'+f+'"')}return u}return r(n)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[t]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},le}var Qe={hasSubscribers:!1},w=Qe,G=Qe;import("node:diagnostics_channel").then(a=>{w=a.channel("lru-cache:metrics"),G=a.tracingChannel("lru-cache")}).catch(()=>{});var Fi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ce=()=>w.hasSubscribers||G.hasSubscribers,et=new Set,Fe=process||{},Gi=(a,e,t,i)=>{typeof Fe.emitWarning=="function"?Fe.emitWarning(a,e,t,i):console.error(`[${t}] ${e}: ${a}`)},Ti=a=>!et.has(a),F=a=>!!a&&a===Math.floor(a)&&a>0&&isFinite(a),tt=a=>F(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?q:null:null,q=class extends Array{constructor(e){super(e),this.fill(0)}},Bi=class W{heap;length;static#s=!1;static create(e){let t=tt(e);if(!t)return[];W.#s=!0;let i=new W(e,t);return W.#s=!1,i}constructor(e,t){if(!W.#s)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]}},Ri=class it{#s;#c;#t;#$;#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;#n;#r;#e;#u;#f;#h;#a;#y;#l;#b;#C;#d;#m;#P;#I;#p;#O;static unsafeExposeInternals(e){return{starts:e.#C,ttls:e.#d,autopurgeTimers:e.#m,sizes:e.#b,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#f,get head(){return e.#h},get tail(){return e.#a},free:e.#y,isBackgroundFetch:t=>e.#i(t),backgroundFetch:(t,i,s,r)=>e.#M(t,i,s,r),moveToTail:t=>e.#T(t),indexes:t=>e.#D(t),rindexes:t=>e.#w(t),isStale:t=>e.#g(t)}}get max(){return this.#s}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.#$}get disposeAfter(){return this.#L}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:n,allowStale:l,dispose:u,onInsert:f,disposeAfter:g,noDisposeOnSet:v,noUpdateTTL:y,maxSize:b=0,maxEntrySize:m=0,sizeCalculation:L,fetchMethod:h,memoMethod:S,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:c,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??Fi,t!==0&&!F(t))throw new TypeError("max option must be a nonnegative integer");let E=t?tt(t):Array;if(!E)throw new Error("invalid max value: "+t);if(this.#s=t,this.#c=b,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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#R=S,h!==void 0&&typeof h!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#B=h,this.#I=!!h,this.#n=new Map,this.#r=Array.from({length:t}).fill(void 0),this.#e=Array.from({length:t}).fill(void 0),this.#u=new E(t),this.#f=new E(t),this.#h=0,this.#a=0,this.#y=Bi.create(t),this.#o=0,this.#v=0,typeof u=="function"&&(this.#t=u),typeof f=="function"&&(this.#$=f),typeof g=="function"?(this.#L=g,this.#l=[]):(this.#L=void 0,this.#l=void 0),this.#P=!!this.#t,this.#O=!!this.#$,this.#p=!!this.#L,this.noDisposeOnSet=!!v,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#c!==0&&!F(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!F(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!c,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!n,this.ttlResolution=F(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!F(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#j()}if(this.#s===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#s&&!this.#c){let Q="LRU_CACHE_UNBOUNDED";Ti(Q)&&(et.add(Q),Gi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Q,it))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#j(){let e=new q(this.#s),t=new q(this.#s);this.#d=e,this.#C=t;let i=this.ttlAutopurge?Array.from({length:this.#s}):void 0;this.#m=i,this.#W=(n,l,u=this.#S.now())=>{t[n]=l!==0?u:0,e[n]=l,s(n,l)},this.#N=n=>{t[n]=e[n]!==0?this.#S.now():0,s(n,e[n])};let s=this.ttlAutopurge?(n,l)=>{if(i?.[n]&&(clearTimeout(i[n]),i[n]=void 0),l&&l!==0&&i){let u=setTimeout(()=>{this.#g(n)&&this.#x(this.#r[n],"expire")},l+1);u.unref&&u.unref(),i[n]=u}}:()=>{};this.#A=(n,l)=>{if(e[l]){let u=e[l],f=t[l];if(!u||!f)return;n.ttl=u,n.start=f,n.now=r||o();let g=n.now-f;n.remainingTTL=u-g}};let r=0,o=()=>{let n=this.#S.now();if(this.ttlResolution>0){r=n;let l=setTimeout(()=>r=0,this.ttlResolution);l.unref&&l.unref()}return n};this.getRemainingTTL=n=>{let l=this.#n.get(n);if(l===void 0)return 0;let u=e[l],f=t[l];if(!u||!f)return 1/0;let g=(r||o())-f;return u-g},this.#g=n=>{let l=t[n],u=e[n];return!!u&&!!l&&(r||o())-l>u}}#N=()=>{};#A=()=>{};#W=()=>{};#g=()=>!1;#V(){let e=new q(this.#s);this.#v=0,this.#b=e,this.#F=t=>{this.#v-=e[t],e[t]=0},this.#_=(t,i,s,r)=>{if(!F(s)){if(this.#i(i))return this.backgroundFetchSize;if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,t),!F(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.#k=(t,i,s)=>{if(e[t]=i,this.#c){let r=this.#c-e[t];for(;this.#v>r;)this.#U(!0)}this.#v+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#v)}}#F=e=>{};#k=(e,t,i)=>{};#_=(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.#a;this.#H(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.#H(t)&&((e||!this.#g(t))&&(yield t),t!==this.#a);)t=this.#u[t]}#H(e){return e!==void 0&&this.#n.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],r=this.#i(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#r[i],this))return this.#G(this.#r[i],t)}}forEach(e,t=this){for(let i of this.#D()){let s=this.#e[i],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[i],this)}}rforEach(e,t=this){for(let i of this.#w()){let s=this.#e[i],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[i],this)}}purgeStale(){let e=!1;for(let t of this.#w({allowStale:!0}))this.#g(t)&&(this.#x(this.#r[t],"expire"),e=!0);return e}info(e){let t=this.#n.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 r={value:s};if(this.#d&&this.#C){let o=this.#d[t],n=this.#C[t];if(o&&n){let l=o-(this.#S.now()-n);r.ttl=l,r.start=Date.now()}}return this.#b&&(r.size=this.#b[t]),r}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let i=this.#r[t],s=this.#e[t],r=this.#i(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;let o={value:r};if(this.#d&&this.#C){o.ttl=this.#d[t];let n=this.#S.now()-this.#C[t];o.start=Math.floor(Date.now()-n)}this.#b&&(o.size=this.#b[t]),e.unshift([i,o])}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 r=this.#E(e,t,i);return s&&w.hasSubscribers&&w.publish(s),r}#E(e,t,i,s){let{ttl:r=this.ttl,start:o,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=i,f=this.#i(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:g=this.noUpdateTTL}=i;u&&!f&&(u.value=t);let v=this.#_(e,t,i.size||0,l,u);if(this.maxEntrySize&&v>this.maxEntrySize)return this.#x(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let y=this.#o===0?void 0:this.#n.get(e);if(y===void 0)y=this.#o===0?this.#a:this.#y.length!==0?this.#y.pop():this.#o===this.#s?this.#U(!1):this.#o,this.#r[y]=e,this.#e[y]=t,this.#n.set(e,y),this.#u[this.#a]=y,this.#f[y]=this.#a,this.#a=y,this.#o++,this.#k(y,v,u),u&&(u.set="add"),g=!1,this.#O&&!f&&this.#$?.(t,e,"add");else{this.#T(y);let b=this.#e[y];if(t!==b){if(!n)if(this.#i(b)){b!==s&&b.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=b;m!==void 0&&m!==t&&(this.#P&&this.#t?.(m,e,"set"),this.#p&&this.#l?.push([m,e,"set"]))}else this.#P&&this.#t?.(b,e,"set"),this.#p&&this.#l?.push([b,e,"set"]);if(this.#F(y),this.#k(y,v,u),this.#e[y]=t,!f){let m=b&&this.#i(b)?b.__staleWhileFetching:b,L=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=L,m!==void 0&&(u.oldValue=m)),this.#O&&this.onInsert?.(t,e,L)}}else f||(u&&(u.set="update"),this.#O&&this.onInsert?.(t,e,"update"))}if(r!==0&&!this.#d&&this.#j(),this.#d&&(g||this.#W(y,r,o),u&&this.#A(u,y)),!n&&this.#p&&this.#l){let b=this.#l,m;for(;m=b?.shift();)this.#L?.(...m)}return this}pop(){try{for(;this.#o;){let e=this.#e[this.#h];if(this.#U(!0),this.#i(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#l){let e=this.#l,t;for(;t=e?.shift();)this.#L?.(...t)}}}#U(e){let t=this.#h,i=this.#r[t],s=this.#e[t],r=this.#i(s);r&&s.__abortController.abort(new Error("evicted"));let o=r?s.__staleWhileFetching:s;return(this.#P||this.#p)&&o!==void 0&&(this.#P&&this.#t?.(o,i,"evict"),this.#p&&this.#l?.push([o,i,"evict"])),this.#F(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.#y.push(t)),this.#o===1?(this.#h=this.#a=0,this.#y.length=0):this.#h=this.#u[t],this.#n.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,r=this.#n.get(e);if(r!==void 0){let o=this.#e[r];if(this.#i(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#g(r))s&&(s.has="stale",this.#A(s,r));else return i&&this.#N(r),s&&(s.has="hit",this.#A(s,r)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=ce()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return w.hasSubscribers&&w.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,r=this.#n.get(e);if(r===void 0||!s&&this.#g(r)){i&&(i.peek=r===void 0?"miss":"stale");return}let o=this.#e[r],n=this.#i(o)?o.__staleWhileFetching:o;return i&&(n!==void 0?(i.peek="hit",i.value=n):i.peek="miss"),n}#M(e,t,i,s){let r=t===void 0?void 0:this.#e[t];if(this.#i(r))return r;let o=new AbortController,{signal:n}=i;n?.addEventListener("abort",()=>o.abort(n.reason),{signal:o.signal});let l={signal:o.signal,options:i,context:s},u=(m,L=!1)=>{let{aborted:h}=o.signal,S=i.ignoreFetchAbort&&m!==void 0,C=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&m!==void 0);if(i.status&&(h&&!L?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),h&&!S&&!L)return g(o.signal.reason,C);let c=y,p=this.#e[t];return(p===y||p===void 0&&S&&L)&&(m===void 0?c.__staleWhileFetching!==void 0?this.#e[t]=c.__staleWhileFetching:this.#x(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#E(e,m,l.options,c))),m},f=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),g(m,!1)),g=(m,L)=>{let{aborted:h}=o.signal,S=h&&i.allowStaleOnFetchAbort,C=S||i.allowStaleOnFetchRejection,c=C||i.noDeleteOnFetchRejection,p=y;if(this.#e[t]===y&&(!c||!L&&p.__staleWhileFetching===void 0?this.#x(e,"fetch"):S||(this.#e[t]=p.__staleWhileFetching)),C)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw m},v=(m,L)=>{let h=this.#B?.(e,r,l);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=S=>u(S,!0)))}),h&&h instanceof Promise?h.then(S=>m(S===void 0?void 0:S),L):h!==void 0&&m(h)};i.status&&(i.status.fetchDispatched=!0);let y=new Promise(v).then(u,f),b=Object.assign(y,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.#E(e,b,{...l.options,status:void 0}),t=this.#n.get(e)):this.#e[t]=b,b}#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=G.hasSubscribers,{status:s=ce()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#z(e,t);return s&&i&&(s.trace=!0,G.tracePromise(()=>r,s).catch(()=>{})),r}async#z(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:n=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:v=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:m,forceRefresh:L=!1,status:h,signal:S}=t;if(h&&(h.op="fetch",h.key=e,L&&(h.forceRefresh=!0),h.cache=this),!this.#I)return h&&(h.fetch="get"),this.#G(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:h});let C={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:n,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:b,ignoreFetchAbort:y,status:h,signal:S},c=this.#n.get(e);if(c===void 0){h&&(h.fetch="miss");let p=this.#M(e,c,C,m);return p.__returned=p}else{let p=this.#e[c];if(this.#i(p)){let A=i&&p.__staleWhileFetching!==void 0;return h&&(h.fetch="inflight",A&&(h.returnedStale=!0)),A?p.__staleWhileFetching:p.__returned=p}let d=this.#g(c);if(!L&&!d)return h&&(h.fetch="hit"),this.#T(c),s&&this.#N(c),h&&this.#A(h,c),p;let P=this.#M(e,c,C,m),D=P.__staleWhileFetching!==void 0&&i;return h&&(h.fetch=d?"stale":"refresh",D&&d&&(h.returnedStale=!0)),D?P.__staleWhileFetching:P.__returned=P}}forceFetch(e,t={}){let i=G.hasSubscribers,{status:s=ce()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#X(e,t);return s&&i&&(s.trace=!0,G.tracePromise(()=>r,s).catch(()=>{})),r}async#X(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:r,forceRefresh:o,...n}=t;r&&o&&(r.forceRefresh=!0);let l=this.#G(e,n),u=o||l===void 0;if(r&&(r.memo=u?"miss":"hit",u||(r.value=l)),!u)return l;let f=i(e,l,{options:n,context:s});return r&&(r.value=f),this.#E(e,f,n),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.#G(e,t);return i&&(s!==void 0&&(i.value=s),w.hasSubscribers&&w.publish(i)),s}#G(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,n=this.#n.get(e);if(n===void 0){o&&(o.get="miss");return}let l=this.#e[n],u=this.#i(l);return o&&this.#A(o,n),this.#g(n)?u?(o&&(o.get="stale-fetching"),i&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(r||this.#x(e,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=u?"fetching":"hit"),this.#T(n),s&&this.#N(n),u?l.__staleWhileFetching:l)}#Y(e,t){this.#f[t]=e,this.#u[e]=t}#T(e){e!==this.#a&&(e===this.#h?this.#h=this.#u[e]:this.#Y(this.#f[e],this.#u[e]),this.#Y(this.#a,e),this.#a=e)}delete(e){return this.#x(e,"delete")}#x(e,t){w.hasSubscribers&&w.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#o!==0){let s=this.#n.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.#F(s);let r=this.#e[s];if(this.#i(r)?r.__abortController.abort(new Error("deleted")):(this.#P||this.#p)&&(this.#P&&this.#t?.(r,e,t),this.#p&&this.#l?.push([r,e,t])),this.#n.delete(e),this.#r[s]=void 0,this.#e[s]=void 0,s===this.#a)this.#a=this.#f[s];else if(s===this.#h)this.#h=this.#u[s];else{let o=this.#f[s];this.#u[o]=this.#u[s];let n=this.#u[s];this.#f[n]=this.#f[s]}this.#o--,this.#y.push(s)}}if(this.#p&&this.#l?.length){let s=this.#l,r;for(;r=s?.shift();)this.#L?.(...r)}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.#P&&this.#t?.(i,s,e),this.#p&&this.#l?.push([i,s,e])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#C){this.#d.fill(0),this.#C.fill(0);for(let t of this.#m??[])t!==void 0&&clearTimeout(t);this.#m?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#h=0,this.#a=0,this.#y.length=0,this.#v=0,this.#o=0,this.#p&&this.#l){let t=this.#l,i;for(;i=t?.shift();)this.#L?.(...i)}}};const Ii=Object.defineProperty({__proto__:null,LRUCache:Ri},Symbol.toStringTag,{value:"Module"}),ki=Se(Ii);var he,Ge;function Ui(){if(Ge)return he;Ge=1;const a=(...r)=>r.every(o=>o)?r.join(""):"",e=r=>r?encodeURIComponent(r):"",t=r=>r.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:r,user:o,project:n,committish:l})=>`git@${r}:${o}/${n}.git${a("#",l)}`,sshurltemplate:({domain:r,user:o,project:n,committish:l})=>`git+ssh://git@${r}/${o}/${n}.git${a("#",l)}`,edittemplate:({domain:r,user:o,project:n,committish:l,editpath:u,path:f})=>`https://${r}/${o}/${n}${a("/",u,"/",e(l||"HEAD"),"/",f)}`,browsetemplate:({domain:r,user:o,project:n,committish:l,treepath:u})=>`https://${r}/${o}/${n}${a("/",u,"/",e(l))}`,browsetreetemplate:({domain:r,user:o,project:n,committish:l,treepath:u,path:f,fragment:g,hashformat:v})=>`https://${r}/${o}/${n}/${u}/${e(l||"HEAD")}/${f}${a("#",v(g||""))}`,browseblobtemplate:({domain:r,user:o,project:n,committish:l,blobpath:u,path:f,fragment:g,hashformat:v})=>`https://${r}/${o}/${n}/${u}/${e(l||"HEAD")}/${f}${a("#",v(g||""))}`,docstemplate:({domain:r,user:o,project:n,treepath:l,committish:u})=>`https://${r}/${o}/${n}${a("/",l,"/",e(u))}#readme`,httpstemplate:({auth:r,domain:o,user:n,project:l,committish:u})=>`git+https://${a(r,"@")}${o}/${n}/${l}.git${a("#",u)}`,filetemplate:({domain:r,user:o,project:n,committish:l,path:u})=>`https://${r}/${o}/${n}/raw/${e(l||"HEAD")}/${u}`,shortcuttemplate:({type:r,user:o,project:n,committish:l})=>`${r}:${o}/${n}${a("#",l)}`,pathtemplate:({user:r,project:o,committish:n})=>`${r}/${o}${a("#",n)}`,bugstemplate:({domain:r,user:o,project:n})=>`https://${r}/${o}/${n}/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:r,user:o,project:n,committish:l,path:u})=>`https://${a(r,"@")}raw.githubusercontent.com/${o}/${n}/${e(l||"HEAD")}/${u}`,gittemplate:({auth:r,domain:o,user:n,project:l,committish:u})=>`git://${a(r,"@")}${o}/${n}/${l}.git${a("#",u)}`,tarballtemplate:({domain:r,user:o,project:n,committish:l})=>`https://codeload.${r}/${o}/${n}/tar.gz/${e(l||"HEAD")}`,extract:r=>{let[,o,n,l,u]=r.pathname.split("/",5);if(!(l&&l!=="tree")&&(l||(u=r.hash.slice(1)),n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!o||!n)))return{user:o,project:n,committish:u}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:r,user:o,project:n,committish:l,treepath:u,path:f,editpath:g})=>`https://${r}/${o}/${n}${a("/",u,"/",e(l||"HEAD"),"/",f,g)}`,tarballtemplate:({domain:r,user:o,project:n,committish:l})=>`https://${r}/${o}/${n}/get/${e(l||"HEAD")}.tar.gz`,extract:r=>{let[,o,n,l]=r.pathname.split("/",4);if(!["get"].includes(l)&&(n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!o||!n)))return{user:o,project:n,committish:r.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:({domain:r,user:o,project:n,committish:l})=>`https://${r}/api/v4/projects/${e(o+"/"+n)}/repository/archive.tar.gz?sha=${e(l||"HEAD")}`,extract:r=>{const o=r.pathname.slice(1);if(o.includes("/-/")||o.includes("/archive.tar.gz"))return;const n=o.split("/");let l=n.pop();l.endsWith(".git")&&(l=l.slice(0,-4));const u=n.join("/");if(!(!u||!l))return{user:u,project:l,committish:r.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:r,project:o,committish:n})=>`git@${r}:${o}.git${a("#",n)}`,sshurltemplate:({domain:r,project:o,committish:n})=>`git+ssh://git@${r}/${o}.git${a("#",n)}`,edittemplate:({domain:r,user:o,project:n,committish:l,editpath:u})=>`https://${r}/${o}/${n}${a("/",e(l))}/${u}`,browsetemplate:({domain:r,project:o,committish:n})=>`https://${r}/${o}${a("/",e(n))}`,browsetreetemplate:({domain:r,project:o,committish:n,path:l,hashformat:u})=>`https://${r}/${o}${a("/",e(n))}${a("#",u(l))}`,browseblobtemplate:({domain:r,project:o,committish:n,path:l,hashformat:u})=>`https://${r}/${o}${a("/",e(n))}${a("#",u(l))}`,docstemplate:({domain:r,project:o,committish:n})=>`https://${r}/${o}${a("/",e(n))}`,httpstemplate:({domain:r,project:o,committish:n})=>`git+https://${r}/${o}.git${a("#",n)}`,filetemplate:({user:r,project:o,committish:n,path:l})=>`https://gist.githubusercontent.com/${r}/${o}/raw${a("/",e(n))}/${l}`,shortcuttemplate:({type:r,project:o,committish:n})=>`${r}:${o}${a("#",n)}`,pathtemplate:({project:r,committish:o})=>`${r}${a("#",o)}`,bugstemplate:({domain:r,project:o})=>`https://${r}/${o}`,gittemplate:({domain:r,project:o,committish:n})=>`git://${r}/${o}.git${a("#",n)}`,tarballtemplate:({project:r,committish:o})=>`https://codeload.github.com/gist/${r}/tar.gz/${e(o||"HEAD")}`,extract:r=>{let[,o,n,l]=r.pathname.split("/",4);if(l!=="raw"){if(!n){if(!o)return;n=o,o=null}return n.endsWith(".git")&&(n=n.slice(0,-4)),{user:o,project:n,committish:r.hash.slice(1)}}},hashformat:function(r){return r&&"file-"+t(r)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:r,user:o,project:n,committish:l,path:u})=>`https://${r}/${o}/${n}/blob/${e(l)||"HEAD"}/${u}`,httpstemplate:({domain:r,user:o,project:n,committish:l})=>`https://${r}/${o}/${n}${a("#",l)}`,tarballtemplate:({domain:r,user:o,project:n,committish:l})=>`https://${r}/${o}/${n}/archive/${e(l)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:r=>{let[,o,n,l]=r.pathname.split("/",4);if(!["archive"].includes(l)&&(n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!o||!n)))return{user:o,project:n,committish:r.hash.slice(1)}}};for(const[r,o]of Object.entries(s))s[r]=Object.assign({},i,o);return he=s,he}var ue,Te;function rt(){if(Te)return ue;Te=1;const a=(s,r,o)=>{const n=s.indexOf(o);return s.lastIndexOf(r,n>-1?n:1/0)},e=s=>{try{return new URL(s)}catch{}},t=(s,r)=>{const o=s.indexOf(":"),n=s.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(r,n)||s.substr(o,3)==="://")return s;const l=s.indexOf("@");return l>-1?l>o?`git+ssh://${s}`:s:`${s.slice(0,o+1)}//${s.slice(o+1)}`},i=s=>{const r=a(s,"@","#"),o=a(s,":","#");return o>r&&(s=s.slice(0,o)+"/"+s.slice(o+1)),a(s,":","#")===-1&&s.indexOf("//")===-1&&(s=`git+ssh://${s}`),s};return ue=(s,r)=>{const o=r?t(s,r):s;return e(o)||e(i(o))},ue}var pe,Be;function Mi(){if(Be)return pe;Be=1;const a=rt(),e=t=>{const i=t.indexOf("#"),s=t.indexOf("/"),r=t.indexOf("/",s+1),o=t.indexOf(":"),n=/\s/.exec(t),l=t.indexOf("@"),u=!n||i>-1&&n.index>i,f=l===-1||i>-1&&l>i,g=o===-1||i>-1&&o>i,v=r===-1||i>-1&&r>i,y=s>0,b=i>-1?t[i-1]!=="/":!t.endsWith("/"),m=!t.startsWith(".");return u&&y&&b&&m&&f&&g&&v};return pe=(t,i,{gitHosts:s,protocols:r})=>{if(!t)return;const o=e(t)?`github:${t}`:t,n=a(o,r);if(!n)return;const l=s.byShortcut[n.protocol],u=s.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],f=l||u;if(!f)return;const g=s[l||u];let v=null;r[n.protocol]?.auth&&(n.username||n.password)&&(v=`${n.username}${n.password?":"+n.password:""}`);let y=null,b=null,m=null,L=null;try{if(l){let h=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname;const S=h.indexOf("@");S>-1&&(h=h.slice(S+1));const C=h.lastIndexOf("/");C>-1?(b=decodeURIComponent(h.slice(0,C)),b||(b=null),m=decodeURIComponent(h.slice(C+1))):m=decodeURIComponent(h),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(y=decodeURIComponent(n.hash.slice(1))),L="shortcut"}else{if(!g.protocols.includes(n.protocol))return;const h=g.extract(n);if(!h)return;b=h.user&&decodeURIComponent(h.user),m=decodeURIComponent(h.project),y=decodeURIComponent(h.committish),L=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(h){if(h instanceof URIError)return;throw h}return[f,b,v,m,y,L,i]},pe}var fe,Re;function ji(){if(Re)return fe;Re=1;const{LRUCache:a}=ki,e=Ui(),t=Mi(),i=rt(),s=new a({max:1e3});function r(n){try{const{protocol:l,hostname:u,pathname:f}=new URL(n);if(!u)return null;const g=/(?:git\+)http:$/.test(l)?"http:":"https:",v=f.replace(/\.git$/,"");return`${g}//${u}${v}`}catch{return null}}class o{constructor(l,u,f,g,v,y,b={}){Object.assign(this,o.#s[l],{type:l,user:u,auth:f,project:g,committish:v,default:y,opts:b})}static#s={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(l,u){o.#s[l]=u,o.#s.byDomain[u.domain]=l,o.#s.byShortcut[`${l}:`]=l,o.#c[`${l}:`]={name:l}}static fromUrl(l,u){if(typeof l!="string")return;const f=l+JSON.stringify(u||{});if(!s.has(f)){const g=t(l,u,{gitHosts:o.#s,protocols:o.#c});s.set(f,g?new o(...g):void 0)}return s.get(f)}static fromManifest(l,u={}){if(!l||typeof l!="object")return;const f=l.repository,g=f&&(typeof f=="string"?f:typeof f=="object"&&typeof f.url=="string"?f.url:null);if(!g)throw new Error("no repository");const v=g&&o.fromUrl(g.replace(/^git\+/,""),u)||null;if(v)return v;const y=r(g);return o.fromUrl(y,u)||y}static parseUrl(l){return i(l)}#t(l,u){if(typeof l!="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 g=l(f);return f.noGitPlus&&g.startsWith("git+")?g.slice(4):g}hash(){return this.committish?`#${this.committish}`:""}ssh(l){return this.#t(this.sshtemplate,l)}sshurl(l){return this.#t(this.sshurltemplate,l)}browse(l,...u){return typeof l!="string"?this.#t(this.browsetemplate,l):typeof u[0]!="string"?this.#t(this.browsetreetemplate,{...u[0],path:l}):this.#t(this.browsetreetemplate,{...u[1],fragment:u[0],path:l})}browseFile(l,...u){return typeof u[0]!="string"?this.#t(this.browseblobtemplate,{...u[0],path:l}):this.#t(this.browseblobtemplate,{...u[1],fragment:u[0],path:l})}docs(l){return this.#t(this.docstemplate,l)}bugs(l){return this.#t(this.bugstemplate,l)}https(l){return this.#t(this.httpstemplate,l)}git(l){return this.#t(this.gittemplate,l)}shortcut(l){return this.#t(this.shortcuttemplate,l)}path(l){return this.#t(this.pathtemplate,l)}tarball(l){return this.#t(this.tarballtemplate,{...l,noCommittish:!1})}file(l,u){return this.#t(this.filetemplate,{...u,path:l})}edit(l,u){return this.#t(this.edittemplate,{...u,path:l})}getDefaultRepresentation(){return this.default}toString(l){return this.default&&typeof this[this.default]=="function"?this[this.default](l):this.sshurl(l)}}for(const[n,l]of Object.entries(e))o.addHost(n,l);return fe=o,fe}var de,Ie;function Wi(){if(Ie)return de;Ie=1,de=a;function a(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 de}var st={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"},nt={web:"url",name:"url"},ot={server:"start",tests:"test"};const _i={topLevel:st,bugs:nt,script:ot},Hi=Object.defineProperty({__proto__:null,bugs:nt,default:_i,script:ot,topLevel:st},Symbol.toStringTag,{value:"Module"}),zi=Se(Hi);var me,ke;function Yi(){if(ke)return me;ke=1;var{URL:a}=je,e=Ht(),t=zt(),i=Ni(),s=ji(),{isBuiltin:r}=We,o=["dependencies","devDependencies","optionalDependencies"],n=Wi(),l=zi,u=c=>c.includes("@")&&c.indexOf("@")<c.lastIndexOf(".");me={warn:function(){},fixRepositoryField:function(c){if(c.repositories&&(this.warn("repositories"),c.repository=c.repositories[0]),!c.repository)return this.warn("missingRepository");typeof c.repository=="string"&&(c.repository={type:"git",url:c.repository});var p=c.repository.url||"";if(p){var d=s.fromUrl(p);d&&(p=c.repository.url=d.getDefaultRepresentation()==="shortcut"?d.https():d.toString())}p.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",p)},fixTypos:function(c){Object.keys(l.topLevel).forEach(function(p){Object.prototype.hasOwnProperty.call(c,p)&&this.warn("typo",p,l.topLevel[p])},this)},fixScriptsField:function(c){if(c.scripts){if(typeof c.scripts!="object"){this.warn("nonObjectScripts"),delete c.scripts;return}Object.keys(c.scripts).forEach(function(p){typeof c.scripts[p]!="string"?(this.warn("nonStringScript"),delete c.scripts[p]):l.script[p]&&!c.scripts[l.script[p]]&&this.warn("typo",p,l.script[p],"scripts")},this)}},fixFilesField:function(c){var p=c.files;p&&!Array.isArray(p)?(this.warn("nonArrayFiles"),delete c.files):c.files&&(c.files=c.files.filter(function(d){return!d||typeof d!="string"?(this.warn("invalidFilename",d),!1):!0},this))},fixBinField:function(c){if(c.bin&&typeof c.bin=="string"){var p={},d;(d=c.name.match(/^@[^/]+[/](.*)$/))?p[d[1]]=c.bin:p[c.name]=c.bin,c.bin=p}},fixManField:function(c){c.man&&typeof c.man=="string"&&(c.man=[c.man])},fixBundleDependenciesField:function(c){var p="bundledDependencies",d="bundleDependencies";c[p]&&!c[d]&&(c[d]=c[p],delete c[p]),c[d]&&!Array.isArray(c[d])?(this.warn("nonArrayBundleDependencies"),delete c[d]):c[d]&&(c[d]=c[d].filter(function(P){return!P||typeof P!="string"?(this.warn("nonStringBundleDependency",P),!1):(c.dependencies||(c.dependencies={}),Object.prototype.hasOwnProperty.call(c.dependencies,P)||(this.warn("nonDependencyBundleDependency",P),c.dependencies[P]="*"),!0)},this))},fixDependencies:function(c){S(c,this.warn),L(c),this.fixBundleDependenciesField(c),["dependencies","devDependencies"].forEach(function(p){if(p in c){if(!c[p]||typeof c[p]!="object"){this.warn("nonObjectDependencies",p),delete c[p];return}Object.keys(c[p]).forEach(function(d){var P=c[p][d];typeof P!="string"&&(this.warn("nonStringDependency",d,JSON.stringify(P)),delete c[p][d]);var D=s.fromUrl(c[p][d]);D&&(c[p][d]=D.toString())},this)}},this)},fixModulesField:function(c){c.modules&&(this.warn("deprecatedModules"),delete c.modules)},fixKeywordsField:function(c){typeof c.keywords=="string"&&(c.keywords=c.keywords.split(/,\s+/)),c.keywords&&!Array.isArray(c.keywords)?(delete c.keywords,this.warn("nonArrayKeywords")):c.keywords&&(c.keywords=c.keywords.filter(function(p){return typeof p!="string"||!p?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(c,p){var d=!p;if(!c.version)return c.version="",!0;if(!e(c.version,d))throw new Error('Invalid version: "'+c.version+'"');return c.version=t(c.version,d),!0},fixPeople:function(c){y(c,b),y(c,m)},fixNameField:function(c,p){typeof p=="boolean"?p={strict:p}:typeof p>"u"&&(p={});var d=p.strict;if(!c.name&&!d){c.name="";return}if(typeof c.name!="string")throw new Error("name field must be a string.");d||(c.name=c.name.trim()),v(c.name,d,p.allowLegacyCase),r(c.name)&&this.warn("conflictingName",c.name)},fixDescriptionField:function(c){c.description&&typeof c.description!="string"&&(this.warn("nonStringDescription"),delete c.description),c.readme&&!c.description&&(c.description=n(c.readme)),c.description===void 0&&delete c.description,c.description||this.warn("missingDescription")},fixReadmeField:function(c){c.readme||(this.warn("missingReadme"),c.readme="ERROR: No README data found!")},fixBugsField:function(c){if(!c.bugs&&c.repository&&c.repository.url){var p=s.fromUrl(c.repository.url);p&&p.bugs()&&(c.bugs={url:p.bugs()})}else if(c.bugs){if(typeof c.bugs=="string")u(c.bugs)?c.bugs={email:c.bugs}:a.canParse(c.bugs)?c.bugs={url:c.bugs}:this.warn("nonEmailUrlBugsString");else{C(c.bugs,this.warn);var d=c.bugs;c.bugs={},d.url&&(a.canParse(d.url)?c.bugs.url=d.url:this.warn("nonUrlBugsUrlField")),d.email&&(typeof d.email=="string"&&u(d.email)?c.bugs.email=d.email:this.warn("nonEmailBugsEmailField"))}!c.bugs.email&&!c.bugs.url&&(delete c.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(c){if(!c.homepage&&c.repository&&c.repository.url){var p=s.fromUrl(c.repository.url);p&&p.docs()&&(c.homepage=p.docs())}if(c.homepage){if(typeof c.homepage!="string")return this.warn("nonUrlHomepage"),delete c.homepage;a.canParse(c.homepage)||(c.homepage="http://"+c.homepage)}},fixLicenseField:function(c){const p=c.license||c.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(c){if(c.charAt(0)!=="@")return!1;var p=c.slice(1).split("/");return p.length!==2?!1:p[0]&&p[1]&&p[0]===encodeURIComponent(p[0])&&p[1]===encodeURIComponent(p[1])}function g(c){return!c.match(/[/@\s+%:]/)&&c===encodeURIComponent(c)}function v(c,p,d){if(c.charAt(0)==="."||!(f(c)||g(c))||p&&!d&&c!==c.toLowerCase()||c.toLowerCase()==="node_modules"||c.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(c))}function y(c,p){return c.author&&(c.author=p(c.author)),["maintainers","contributors"].forEach(function(d){Array.isArray(c[d])&&(c[d]=c[d].map(p))}),c}function b(c){if(typeof c=="string")return c;var p=c.name||"",d=c.url||c.web,P=d?" ("+d+")":"",D=c.email||c.mail,A=D?" <"+D+">":"";return p+A+P}function m(c){if(typeof c!="string")return c;var p=c.match(/^([^(<]+)/),d=c.match(/\(([^()]+)\)/),P=c.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(c){var p=c.optionalDependencies;if(p){var d=c.dependencies||{};Object.keys(p).forEach(function(P){d[P]=p[P]}),c.dependencies=d}}function h(c,p,d){if(!c)return{};if(typeof c=="string"&&(c=c.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(c))return c;d("deprecatedArrayDependencies",p);var P={};return c.filter(function(D){return typeof D=="string"}).forEach(function(D){D=D.trim().split(/(:?[@\s><=])/);var A=D.shift(),E=D.join("");E=E.trim(),E=E.replace(/^@/,""),P[A]=E}),P}function S(c,p){o.forEach(function(d){c[d]&&(c[d]=h(c[d],d,p))})}function C(c,p){c&&Object.keys(c).forEach(function(d){l.bugs[d]&&(p("typo",d,l.bugs[d],"bugs"),c[l.bugs[d]]=c[d],delete c[d])})}return me}var at="'repositories' (plural) Not supported. Please pick one as the 'repository' field",lt="No repository field.",ct="Probably broken git url: %s",ht="scripts must be an object",ut="script values must be string commands",pt="Invalid 'files' member",ft="Invalid filename in 'files' list: %s",dt="Invalid 'bundleDependencies' list. Must be array of package names",mt="Invalid bundleDependencies member: %s",gt="Non-dependency in bundleDependencies: %s",Lt="%s field must be an object",St="Invalid dependency: %s %s",vt="specifying %s as array is deprecated",yt="modules field is deprecated",bt="keywords should be an array of strings",Ct="keywords should be an array of strings",Pt="%s is also the name of a node core module.",Dt="'description' field should be a string",wt="No description",xt="No README data",At="No license field.",Et="Bug string field must be url, email, or {email,url}",$t="bugs.url field must be a string url. Deleted.",Ot="bugs.email field must be a string email. Deleted.",Nt="Normalized value of bugs field is an empty object. Deleted.",Ft="homepage field must be a string url. Deleted.",Gt="license should be a valid SPDX license expression",Tt="%s should probably be %s.";const qi={repositories:at,missingRepository:lt,brokenGitUrl:ct,nonObjectScripts:ht,nonStringScript:ut,nonArrayFiles:pt,invalidFilename:ft,nonArrayBundleDependencies:dt,nonStringBundleDependency:mt,nonDependencyBundleDependency:gt,nonObjectDependencies:Lt,nonStringDependency:St,deprecatedArrayDependencies:vt,deprecatedModules:yt,nonArrayKeywords:bt,nonStringKeyword:Ct,conflictingName:Pt,nonStringDescription:Dt,missingDescription:wt,missingReadme:xt,missingLicense:At,nonEmailUrlBugsString:Et,nonUrlBugsUrlField:$t,nonEmailBugsEmailField:Ot,emptyNormalizedBugs:Nt,nonUrlHomepage:Ft,invalidLicense:Gt,typo:Tt},Vi=Object.defineProperty({__proto__:null,brokenGitUrl:ct,conflictingName:Pt,default:qi,deprecatedArrayDependencies:vt,deprecatedModules:yt,emptyNormalizedBugs:Nt,invalidFilename:ft,invalidLicense:Gt,missingDescription:wt,missingLicense:At,missingReadme:xt,missingRepository:lt,nonArrayBundleDependencies:dt,nonArrayFiles:pt,nonArrayKeywords:bt,nonDependencyBundleDependency:gt,nonEmailBugsEmailField:Ot,nonEmailUrlBugsString:Et,nonObjectDependencies:Lt,nonObjectScripts:ht,nonStringBundleDependency:mt,nonStringDependency:St,nonStringDescription:Dt,nonStringKeyword:Ct,nonStringScript:ut,nonUrlBugsUrlField:$t,nonUrlHomepage:Ft,repositories:at,typo:Tt},Symbol.toStringTag,{value:"Module"}),Ki=Se(Vi);var ge,Ue;function Ji(){if(Ue)return ge;Ue=1;var a=Yt,e=Ki;ge=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return t.apply(null,i);var r=e[s]?e[s]:s+": '%s'";return i.unshift(r),a.format.apply(null,i)};function t(i,s,r){return r&&(i=r+"['"+i+"']",s=r+"['"+s+"']"),a.format(e.typo,i,s)}return ge}var Le,Me;function Xi(){if(Me)return Le;Me=1,Le=r;var a=Yi();r.fixer=a;var e=Ji(),t=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=t.map(function(n){return o(n)+"Field"});s=s.concat(i);function r(n,l,u){l===!0&&(l=null,u=!0),u||(u=!1),(!l||n.private)&&(l=function(){}),n.scripts&&n.scripts.install==="node-gyp rebuild"&&!n.scripts.preinstall&&(n.gypfile=!0),a.warn=function(){l(e.apply(null,arguments))},s.forEach(function(f){a["fix"+o(f)](n,u)}),n._id=n.name+"@"+n.version}function o(n){return n.charAt(0).toUpperCase()+n.slice(1)}return Le}var Zi=Xi();const Qi=_t(Zi),er=(a,e,t)=>{const i=$(a),s=$(e),r=s===i?".":Mt(i,s);return t.some(o=>{const n=o.startsWith("./")?o.slice(2):o,l=r.startsWith("./")?r.slice(2):r;if(n==="."&&l===".")return!0;if(n.endsWith("/**")){const u=n.slice(0,-3);return l===u||l.startsWith(`${u}/`)}if(n.endsWith("/*")){const u=n.slice(0,-2);return u===""?l!=="."&&!l.includes("/"):l.startsWith(`${u}/`)||l===u}return l===n||l.startsWith(`${n}/`)})},tr=a=>{const e=J("pnpm-workspace.yaml",{cwd:$(a),type:"file"});if(!e)return;const t=_e(e),i=Array.isArray(t.packages)?t.packages:[];if(!er(e,a,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},ir=(a,e,t)=>{if(e==="catalog:")return t.catalog?.[a];if(e.startsWith("catalog:")){const i=e.slice(8);return t.catalogs?.[i]?.[a]}},rr=(a,e)=>{for(const[t,i]of Object.entries(a)){if(typeof i!="string")continue;const s=ir(t,i,e);s&&(a[t]=s)}},sr=(a,e)=>{const t=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const i of t){if(!a[i]||typeof a[i]!="object")continue;const s=a[i];rr(s,e)}};let nr;const or=a=>(nr??=z(import.meta.url))(a),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ve=a=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[e,t]=j.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return j.getBuiltinModule(a)}return or(a)};ve("node:fs");ve("node:readline");ve("node:util");const ar=/, ([^,]*)$/,lr=new Map,cr=(a,e={})=>{const t=e.strict&&e.ignoreWarnings?e.ignoreWarnings.map(String).toSorted((i,s)=>i.localeCompare(s)).join(","):"";return`${a}|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 hr extends Error{constructor(e){super(`The following warnings were encountered while normalizing package data:
3
+ - ${e.join(`
4
+ - `)}`),this.name="PackageJsonValidationError"}}const ur=(a,e,t=[])=>{const i=[];if(Qi(a,s=>{i.push(s)},e),e&&i.length>0){const s=i.filter(r=>!t.some(o=>o instanceof RegExp?o.test(r):o===r));if(s.length>0)throw new hr(s)}return a},pr=a=>_e(a),fr=a=>{const e=jt(a);return Wt.parse(e)},dr=(a,e)=>e?.yaml!==!1&&(a.endsWith(".yaml")||a.endsWith(".yml"))?pr(a):e?.json5!==!1&&a.endsWith(".json5")?fr(a):ze(a),mr=(a,e={})=>{const t={type:"file"};a&&(t.cwd=a);const i=["package.json"];e.yaml!==!1&&i.push("package.yaml","package.yml"),e.json5!==!1&&i.push("package.json5");const s=J(i,t);if(!s)throw new V(`No such file or directory, for ${i.join(", ").replace(ar," or $1")} found.`);const r=e.cache&&typeof e.cache!="boolean"?e.cache:lr,o=cr(s,e);if(e.cache&&r.has(o))return r.get(o);const n=dr(s,e);if(e.resolveCatalogs){const u=tr(s);u&&sr(n,u)}ur(n,e.strict??!1,e.ignoreWarnings);const l={packageJson:n,path:s};return e.cache&&r.set(o,l),l};var gr="2.0.2";const Lr={version:gr},Sr=Lr.version,vr="@visulima/vis";let N;const Ur=()=>{if(N!==void 0)return N;const a=process.env.VIS_VERSION;if(a)return N=a,N;try{const{packageJson:e}=mr(kt(Ut(import.meta.url)),{json5:!1,yaml:!1});if(e.name===vr&&typeof e.version=="string")return N=e.version,N}catch{}return N=Sr,N};export{Rr as D,Ir as E,ti as I,Br as N,Er as a,Fr as b,$r as c,Nr as g,Or as h,Ar as l,Ur as m,xr as t,Gr as u,Tr as v};
@@ -1 +1 @@
1
- import{createRequire as h}from"node:module";import{l as j,d as T,w as m}from"./index-uBVnF4ji.js";import{s as S}from"./index-BAe6e0XE.js";import{g as R}from"./en-D3CfXlO7.js";import{a as C}from"./readJsonSync-DweZd5ZA-0eZh9sGm.js";let b;const k=t=>(b??=h(import.meta.url))(t),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,s]=u.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return u.getBuiltinModule(t)}return k(t)},{rmSync:l,writeFileSync:w}=_("node:fs"),f=3,U=1800*1e3,z=15e3,g=()=>m(R(),"packuments"),y=t=>m(g(),`${encodeURIComponent(t)}.json`),F=t=>{const e=y(t);if(j(e))try{const s=C(e);if(s.cacheVersion!==f){l(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){l(e,{force:!0});return}return s.packument}catch{l(e,{force:!0});return}},M=(t,e,s)=>{T(g());const n={cacheVersion:f,createdAt:Date.now(),packument:e,ttlMs:s};w(y(t),JSON.stringify(n),"utf8")},$=t=>{const e={},s=t.versions??{};for(const[c,r]of Object.entries(s)){const i=r.dist,o={version:c};if(r._npmUser!==void 0&&(o._npmUser=r._npmUser),r.maintainers!==void 0&&(o.maintainers=r.maintainers),r.bin!==void 0&&(o.bin=r.bin),i!==void 0){const a={};i.signatures!==void 0&&(a.signatures=i.signatures),i.attestations!==void 0&&(a.attestations=i.attestations),typeof i.integrity=="string"&&(a.integrity=i.integrity),typeof i.tarball=="string"&&(a.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(a.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(a.fileCount=i.fileCount),o.dist=a}r.repository!==void 0&&(o.repository=r.repository),r.license!==void 0&&(o.license=r.license),typeof r.readme=="string"&&(o.readme=r.readme),typeof r.readmeFilename=="string"&&(o.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(o.private=r.private),typeof r.deprecated=="string"&&(o.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(o.scripts=r.scripts),e[c]=o}const n={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(n["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(n.time=t.time),typeof t.readme=="string"&&(n.readme=t.readme),n},A=t=>{const e={Accept:"application/json"};return t!==void 0&&t!==""&&(e.Authorization=`Bearer ${t}`),e},N=async(t,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:s,loadNpmrc:n}=await import("../packem_chunks/catalog.js").then(o=>o.a0),c=n(e.workspaceRoot),{token:r,url:i}=s(t,c);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},P=async(t,e={})=>{const s=e.cacheTtlMs??U,n=F(t);if(n!==void 0)return n;if(e.offline)return;const c=await N(t,e),r=`${c.url.endsWith("/")?c.url.slice(0,-1):c.url}/${t.replace("/","%2f")}`,i=new AbortController,o=setTimeout(()=>{i.abort()},z),a=()=>{i.abort()};e.signal?.addEventListener("abort",a,{once:!0});try{const d=await fetch(r,{headers:A(c.authToken),signal:i.signal});if(d.status===404)return;if(!d.ok)throw new Error(`Registry returned ${String(d.status)} for ${t}`);const v=await d.json(),p=$(v);return M(t,p,s),p}finally{clearTimeout(o),e.signal?.removeEventListener("abort",a)}},x=(t,e)=>{const s=Object.keys(t.versions);if(s.length===0)return;if(e===void 0||e===""||e==="latest")return t["dist-tags"]?.latest??s.at(-1);const n=t["dist-tags"]?.[e];return n!==void 0?n:Object.hasOwn(t.versions,e)?e:S.maxSatisfying(s,e)??void 0};export{P as g,x as r};
1
+ import{createRequire as h}from"node:module";import{l as j,d as T,w as m}from"./index-BLtnel38.js";import{s as S}from"./index-BAe6e0XE.js";import{g as R}from"./en-BDYMmM2_.js";import{a as C}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";let b;const k=t=>(b??=h(import.meta.url))(t),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,s]=u.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return u.getBuiltinModule(t)}return k(t)},{rmSync:l,writeFileSync:w}=_("node:fs"),f=3,U=1800*1e3,z=15e3,g=()=>m(R(),"packuments"),y=t=>m(g(),`${encodeURIComponent(t)}.json`),F=t=>{const e=y(t);if(j(e))try{const s=C(e);if(s.cacheVersion!==f){l(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){l(e,{force:!0});return}return s.packument}catch{l(e,{force:!0});return}},M=(t,e,s)=>{T(g());const n={cacheVersion:f,createdAt:Date.now(),packument:e,ttlMs:s};w(y(t),JSON.stringify(n),"utf8")},$=t=>{const e={},s=t.versions??{};for(const[c,r]of Object.entries(s)){const i=r.dist,o={version:c};if(r._npmUser!==void 0&&(o._npmUser=r._npmUser),r.maintainers!==void 0&&(o.maintainers=r.maintainers),r.bin!==void 0&&(o.bin=r.bin),i!==void 0){const a={};i.signatures!==void 0&&(a.signatures=i.signatures),i.attestations!==void 0&&(a.attestations=i.attestations),typeof i.integrity=="string"&&(a.integrity=i.integrity),typeof i.tarball=="string"&&(a.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(a.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(a.fileCount=i.fileCount),o.dist=a}r.repository!==void 0&&(o.repository=r.repository),r.license!==void 0&&(o.license=r.license),typeof r.readme=="string"&&(o.readme=r.readme),typeof r.readmeFilename=="string"&&(o.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(o.private=r.private),typeof r.deprecated=="string"&&(o.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(o.scripts=r.scripts),e[c]=o}const n={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(n["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(n.time=t.time),typeof t.readme=="string"&&(n.readme=t.readme),n},A=t=>{const e={Accept:"application/json"};return t!==void 0&&t!==""&&(e.Authorization=`Bearer ${t}`),e},N=async(t,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:s,loadNpmrc:n}=await import("../packem_chunks/catalog.js").then(o=>o.a0),c=n(e.workspaceRoot),{token:r,url:i}=s(t,c);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},P=async(t,e={})=>{const s=e.cacheTtlMs??U,n=F(t);if(n!==void 0)return n;if(e.offline)return;const c=await N(t,e),r=`${c.url.endsWith("/")?c.url.slice(0,-1):c.url}/${t.replace("/","%2f")}`,i=new AbortController,o=setTimeout(()=>{i.abort()},z),a=()=>{i.abort()};e.signal?.addEventListener("abort",a,{once:!0});try{const d=await fetch(r,{headers:A(c.authToken),signal:i.signal});if(d.status===404)return;if(!d.ok)throw new Error(`Registry returned ${String(d.status)} for ${t}`);const v=await d.json(),p=$(v);return M(t,p,s),p}finally{clearTimeout(o),e.signal?.removeEventListener("abort",a)}},x=(t,e)=>{const s=Object.keys(t.versions);if(s.length===0)return;if(e===void 0||e===""||e==="latest")return t["dist-tags"]?.latest??s.at(-1);const n=t["dist-tags"]?.[e];return n!==void 0?n:Object.hasOwn(t.versions,e)?e:S.maxSatisfying(s,e)??void 0};export{P as g,x as r};
@@ -1 +1 @@
1
- import{createRequire as N}from"node:module";import{l as j,w as v,J as R,M as S,z}from"./index-uBVnF4ji.js";import{withEnhancedPath as F,collectNodeModulesBinDirs as H}from"@visulima/task-runner";import{s as $}from"./index-BAe6e0XE.js";import{resolveDlx as V,whichBin as Y,detectPackageManager as G,execPmCommandInteractive as K,resolveAdd as Q,resolveRemove as X,resolveDedupe as Z,resolveWhy as ee,resolveLink as ne,resolveUnlink as se,resolvePmCommand as re,resolveInstall as ae,resolveExec as oe}from"#native";let T;const q=e=>(T??=N(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,B=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,s]=b.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return b.getBuiltinModule(e)}return q(e)},{spawn:J,spawnSync:E}=B("node:child_process"),h=(e,n,s,r)=>{for(const a of n)e.push("--filter",a);s&&e.push("--recursive"),r&&e.push("--workspace-root")},ie=e=>{const n=[],s=[];return h(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:s}},te=e=>{const n=[],s=[];return h(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&&s.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:s}},pe=e=>{const n=[];return h(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:[]}},ue=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},ce=e=>{const n=[],s=[];h(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&&s.push("aube why does not accept --depth; ignoring."),e.noOptional&&s.push("aube why does not accept --no-optional; ignoring."),e.global&&s.push("aube why does not accept --global; ignoring.");const[r,...a]=e.packages;return r===void 0?s.push("aube why requires a package name; none provided."):(a.length>0&&s.push("aube why takes a single package; using the first."),n.push(r)),{args:n,bin:"aube",warnings:s}},le=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const s of e.additionalPackages)n.push("--package",s);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},ge=e=>{const n=[];return h(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:[]}},de=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},he=(e,n)=>{const s=[],r=[];return n&&s.push("--recursive"),s.push("unlink"),e.length>1&&r.push("aube unlink takes a single package; using the first."),e.length>0&&s.push(e[0]),{args:s,bin:"aube",warnings:r}},fe=e=>{const n=["view","--",e.package],s=[],[r,...a]=e.fields;return r!==void 0?(a.length>0&&s.push("aube view only supports a single field; using the first."),e.json&&s.push("aube view does not support --json with a field selector; printing the field without --json."),n.push(r)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:s}},ze=e=>{const n=[],s=[];return h(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:s}},me=new Set(["fund","ping","search","token"]),be=(e,n)=>me.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},k=256*1024,ke=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},M=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,we=async(e,n,s)=>new Promise((r,a)=>{const o=process.platform==="win32",i=J(o?M(e):e,o?n.map(t=>M(t)):[...n],{cwd:s.cwd,env:ke(s.env),shell:o,stdio:["inherit","pipe","pipe"],windowsHide:!0});let u=[],l=0;const g=t=>{if(u.push(t),l+=t.length,!(l<=k)){for(;u.length>1&&l-u[0].length>k;)l-=u.shift().length;if(u.length===1&&l>k){const d=u[0];u[0]=d.subarray(d.length-k),l=k}}},m=()=>Buffer.concat(u).toString("utf8");i.stdout?.on("data",t=>{process.stdout.write(t),g(t)}),i.stderr?.on("data",t=>{process.stderr.write(t),g(t)}),i.on("error",a),i.on("close",t=>{const d=m();u=[],r({code:t??1,output:d})})}),w=e=>{const n=$.coerce(e);return n?$.gte(n,"11.0.0"):!1},c=e=>e.name==="yarn"&&!e.version.startsWith("1."),x=e=>e.name==="yarn"&&e.version.startsWith("1."),ve=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,ye=(e,n,s)=>{switch(n){case"audit":return c(e)?{args:["npm","audit",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(c(e)){const[r,...a]=s;return r==="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 x(e)?{args:["tag",...s],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:c(e)?{args:["npm","tag",...ve(s)],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 c(e)?{args:["npm",n,...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...s],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"&&w(e.version)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:c(e)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...s],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"&&w(e.version)?{args:["ping",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"plugin":return c(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return x(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:c(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 c(e)?{args:["npm","publish",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return x(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"&&w(e.version)?{args:["search",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&w(e.version)?{args:["token",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&w(e.version)?{args:["whoami",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:c(e)?{args:["npm","whoami",...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...s],bin:"bun",kind:"rewrite"}:e.name==="deno"?{kind:"skip",warning:"deno has no `whoami`. JSR uses browser auth."}:{kind:"passthrough"};default:return{kind:"passthrough"}}},O=e=>Y(e)!==null,$e=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 s=e;for(;;){for(const[a,o]of n)if(j(v(s,a)))return o;const r=R(s);if(r===s||S(s).root===s)return;s=r}},Fe=(e,n)=>{if(n.name!=="aube")return;const s=$e(e);if(s!==void 0)return`Resolved installer is aube but the workspace has a ${s} lockfile. Aube reads and writes ${s}'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.`},_=e=>{if(j(e))try{return JSON.parse(z(e,{buffer:!1}))}catch{return}},je=e=>{let n=e;for(;;){const s=v(n,"package.json"),r=_(s);if(r&&typeof r.packageManager=="string"&&r.packageManager.length>0)return r.packageManager;const a=R(n);if(a===n||S(n).root===n)return;n=a}},P=new Set(["npm","pnpm","yarn"]),W=(e,n,s)=>s===!1||!P.has(n)||!O("corepack")?!1:s===!0?!0:je(e)!==void 0,He=(e,n)=>{const s=n.backend,r=process.env.VIS_INSTALLER,a=s??r??n.configBackend,o=n.configCorepack??"auto";if(a&&a!=="auto"){if(a==="aube"&&!O("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:W(e,a,o),version:"latest"}}if(O("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const i=xe(e);return{...i,useCorepack:W(e,i.name,o)}},xe=e=>{if(!j(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||!P.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},Oe=(e,n,s)=>{if(s===void 0)return K(e.bin,e.args,n);const r=E(e.bin,e.args,{cwd:n,env:{...process.env,...s},stdio:"inherit"});if(r.error)throw r.error;return r.status??1},p=(e,n,s,r,a={})=>{const o=L(n,e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),0):Oe(o,s,a.env)},f=(e,n,s,r,a={})=>p(e,n(),s,r,a),Re=(e,n)=>n==="aube"||n==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},Se=(e,n,s)=>n!=="yarn"||s.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},I=(e,n,s)=>{let r=e.name==="aube"?ie(n):ae(e.name,e.version,{...n,silent:n.silent||s.silent===!0});return s.preferOffline&&(r=Re(r,e.name)),s.ciMode&&(r=Se(r,e.name,e.version)),r},Ve=(e,n,s,r,a={})=>{const o=I(e,n,a);return C(e,o,s,r,{dry:a.dry,env:a.env})},Ye=async(e,n,s,r,a={})=>{const o=L(I(e,n,a),e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),{code:0,output:""}):we(o.bin,o.args,{cwd:s,env:a.env?{...process.env,...a.env}:process.env})},A=(e,n)=>{const s=n==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,s]}},_e=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},C=(e,n,s,r,a)=>{if(a.dry!==!0)return p(e,n,s,r,a);const o=_e(n,e.name);return o===null?p(e,n,s,r,a):p(e,o,s,r,{env:a.env})},Ce=(e,n)=>n==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:n==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},De=(e,n,s,r,a={})=>{let o=e.name==="aube"?te(n):Q(e.name,e.version,n);a.ignoreScripts&&(o=Ce(o,e.name)),a.silent&&(o=A(o,e.name));const i=C(e,o,s,r,{dry:a.dry,env:a.env});return i===0&&a.autoInstallPeers&&Pe(e,n,s,r,a),i},Me=e=>{if(e.startsWith("@")){const s=e.indexOf("/");if(s===-1)return e;const r=e.indexOf("@",s);return r===-1?e:e.slice(0,r)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},We=(e,n)=>{let s=e;for(;;){const r=v(s,"node_modules",n,"package.json"),a=_(r);if(a)return a;const o=R(s);if(o===s||S(s).root===s)return;s=o}},Ee=e=>{const n=_(v(e,"package.json")),s=new Set;if(!n)return s;for(const r of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const a=n[r];if(a)for(const o of Object.keys(a))s.add(o)}return s},Pe=(e,n,s,r,a)=>{if(e.name==="deno")return;const o=Ee(s),i=new Map;for(const g of n.packages){const m=Me(g),t=We(s,m);if(!t?.peerDependencies)continue;const d=t.peerDependenciesMeta??{};for(const[y,U]of Object.entries(t.peerDependencies))d[y]?.optional||o.has(y)||i.has(y)||i.set(y,U)}if(i.size===0)return;const u=[...i.entries()].map(([g,m])=>`${g}@${m}`);r.log(`auto-installing peer dependencies: ${u.join(", ")}`);const l={exact:!1,filter:n.filter,global:!1,optional:!1,packages:u,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};De(e,l,s,r,{ignoreScripts:a.ignoreScripts})},Ge=(e,n,s,r,a={})=>{let o=e.name==="aube"?pe(n):X(e.name,e.version,n);return a.silent&&(o=A(o,e.name)),C(e,o,s,r,{dry:a.dry,env:a.env})},Ke=(e,n,s,r,a={})=>e.name==="aube"?p(e,ue(n),s,r,a):f(e,()=>Z(e.name,e.version,n),s,r,a),Qe=(e,n,s,r,a={})=>e.name==="aube"?p(e,ce(n),s,r,a):f(e,()=>ee(e.name,e.version,n),s,r,a),Le=(e,n)=>{if(e.name==="aube")return fe(n);const s=[],r=[],a=e.name;switch(e.name){case"bun":{const o=$.coerce(e.version);o&&$.lt(o,"1.3.0")&&r.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),s.push("pm","view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"deno":{const o=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}`;s.push("info","--",o),n.json&&s.push("--json"),n.fields.length>0&&r.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{s.push("view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){s.push("info","--",n.package);const[o,...i]=n.fields;o!==void 0&&(i.length>0&&r.push("yarn v1 only supports querying one field at a time; using the first."),s.push(o)),n.json&&s.push("--json")}else s.push("npm","info","--",n.package),n.fields.length>0&&r.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&s.push("--json");break}default:{const o=e.name;throw new Error(`Unsupported package manager: ${o}`)}}return{args:s,bin:a,warnings:r}},Xe=(e,n,s,r,a={})=>p(e,Le(e,n),s,r,a),Ze=(e,n,s,r,a={})=>e.name==="aube"?p(e,de(n),s,r,a):f(e,()=>ne(e.name,e.version,n),s,r,a),en=(e,n,s,r,a,o={})=>e.name==="aube"?p(e,he(n,s),r,a,o):f(e,()=>se(e.name,e.version,n,s),r,a,o),Ie=(e,n,s)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const r=(a,o)=>{const i=[...e.args];return i.splice(o,0,a),{...e,args:i}};switch(n){case"aube":case"pnpm":return r("--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 r("--cached-only",1);case"npm":return r("--offline",1);case"yarn":return s.startsWith("1.")?r("--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)}`]}}}},nn=(e,n,s,r,a={})=>{let o=e.name==="aube"?le(n):V(e.name,e.version,n);return a.offline&&(o=Ie(o,e.name,e.version)),p(e,o,s,r,{dry:a.dry,env:a.env})},D=process.platform==="win32",Ae=D?[".exe",".cmd",".bat",".ps1",""]:[""],Ue=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const s of H(n))for(const r of Ae){const a=v(s,`${e}${r}`);if(j(a))return D?a.replaceAll("/","\\"):a}},sn=(e,n,s)=>{const r=Ue(e,s);if(r===void 0||D&&!r.toLowerCase().endsWith(".exe"))return null;const a=E(r,n,{cwd:s,env:F({...process.env},s),stdio:"inherit"});if(a.error)throw a.error;return a.status??1},rn=(e,n,s,r,a={})=>e.name==="aube"?p(e,ge(n),s,r,a):f(e,()=>oe(e.name,e.version,n),s,r,a),an=(e,n,s,r,a,o={})=>{if(e.name==="aube")return p(e,be(n,s),r,a,o);const i=ye(e,n,s);return i.kind==="skip"?(a.warn(`warning: ${i.warning}`),0):i.kind==="rewrite"?p(e,{args:i.args,bin:i.bin,warnings:i.warning?[i.warning]:[]},r,a,o):f(e,()=>re(e.name,e.version,n,s),r,a,o)};export{en as $,xe as A,Ye as C,Ge as E,Fe as I,sn as L,Ke as M,rn as N,Qe as P,Ze as S,an as U,nn as W,Xe as a,He as h,De as j,we as s,ze as v,Ve as y};
1
+ import{createRequire as N}from"node:module";import{l as j,w as v,J as R,M as S,z}from"./index-BLtnel38.js";import{withEnhancedPath as F,collectNodeModulesBinDirs as H}from"@visulima/task-runner";import{s as $}from"./index-BAe6e0XE.js";import{resolveDlx as V,whichBin as Y,detectPackageManager as G,execPmCommandInteractive as K,resolveAdd as Q,resolveRemove as X,resolveDedupe as Z,resolveWhy as ee,resolveLink as ne,resolveUnlink as se,resolvePmCommand as re,resolveInstall as ae,resolveExec as oe}from"#native";let T;const q=e=>(T??=N(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,B=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,s]=b.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return b.getBuiltinModule(e)}return q(e)},{spawn:J,spawnSync:E}=B("node:child_process"),h=(e,n,s,r)=>{for(const a of n)e.push("--filter",a);s&&e.push("--recursive"),r&&e.push("--workspace-root")},ie=e=>{const n=[],s=[];return h(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:s}},te=e=>{const n=[],s=[];return h(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&&s.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:s}},pe=e=>{const n=[];return h(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:[]}},ue=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},ce=e=>{const n=[],s=[];h(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&&s.push("aube why does not accept --depth; ignoring."),e.noOptional&&s.push("aube why does not accept --no-optional; ignoring."),e.global&&s.push("aube why does not accept --global; ignoring.");const[r,...a]=e.packages;return r===void 0?s.push("aube why requires a package name; none provided."):(a.length>0&&s.push("aube why takes a single package; using the first."),n.push(r)),{args:n,bin:"aube",warnings:s}},le=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const s of e.additionalPackages)n.push("--package",s);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},ge=e=>{const n=[];return h(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:[]}},de=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},he=(e,n)=>{const s=[],r=[];return n&&s.push("--recursive"),s.push("unlink"),e.length>1&&r.push("aube unlink takes a single package; using the first."),e.length>0&&s.push(e[0]),{args:s,bin:"aube",warnings:r}},fe=e=>{const n=["view","--",e.package],s=[],[r,...a]=e.fields;return r!==void 0?(a.length>0&&s.push("aube view only supports a single field; using the first."),e.json&&s.push("aube view does not support --json with a field selector; printing the field without --json."),n.push(r)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:s}},ze=e=>{const n=[],s=[];return h(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:s}},me=new Set(["fund","ping","search","token"]),be=(e,n)=>me.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},k=256*1024,ke=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},M=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,we=async(e,n,s)=>new Promise((r,a)=>{const o=process.platform==="win32",i=J(o?M(e):e,o?n.map(t=>M(t)):[...n],{cwd:s.cwd,env:ke(s.env),shell:o,stdio:["inherit","pipe","pipe"],windowsHide:!0});let u=[],l=0;const g=t=>{if(u.push(t),l+=t.length,!(l<=k)){for(;u.length>1&&l-u[0].length>k;)l-=u.shift().length;if(u.length===1&&l>k){const d=u[0];u[0]=d.subarray(d.length-k),l=k}}},m=()=>Buffer.concat(u).toString("utf8");i.stdout?.on("data",t=>{process.stdout.write(t),g(t)}),i.stderr?.on("data",t=>{process.stderr.write(t),g(t)}),i.on("error",a),i.on("close",t=>{const d=m();u=[],r({code:t??1,output:d})})}),w=e=>{const n=$.coerce(e);return n?$.gte(n,"11.0.0"):!1},c=e=>e.name==="yarn"&&!e.version.startsWith("1."),x=e=>e.name==="yarn"&&e.version.startsWith("1."),ve=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,ye=(e,n,s)=>{switch(n){case"audit":return c(e)?{args:["npm","audit",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(c(e)){const[r,...a]=s;return r==="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 x(e)?{args:["tag",...s],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:c(e)?{args:["npm","tag",...ve(s)],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 c(e)?{args:["npm",n,...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...s],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"&&w(e.version)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:c(e)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...s],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"&&w(e.version)?{args:["ping",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"plugin":return c(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return x(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:c(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 c(e)?{args:["npm","publish",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return x(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"&&w(e.version)?{args:["search",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&w(e.version)?{args:["token",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&w(e.version)?{args:["whoami",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:c(e)?{args:["npm","whoami",...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...s],bin:"bun",kind:"rewrite"}:e.name==="deno"?{kind:"skip",warning:"deno has no `whoami`. JSR uses browser auth."}:{kind:"passthrough"};default:return{kind:"passthrough"}}},O=e=>Y(e)!==null,$e=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 s=e;for(;;){for(const[a,o]of n)if(j(v(s,a)))return o;const r=R(s);if(r===s||S(s).root===s)return;s=r}},Fe=(e,n)=>{if(n.name!=="aube")return;const s=$e(e);if(s!==void 0)return`Resolved installer is aube but the workspace has a ${s} lockfile. Aube reads and writes ${s}'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.`},_=e=>{if(j(e))try{return JSON.parse(z(e,{buffer:!1}))}catch{return}},je=e=>{let n=e;for(;;){const s=v(n,"package.json"),r=_(s);if(r&&typeof r.packageManager=="string"&&r.packageManager.length>0)return r.packageManager;const a=R(n);if(a===n||S(n).root===n)return;n=a}},P=new Set(["npm","pnpm","yarn"]),W=(e,n,s)=>s===!1||!P.has(n)||!O("corepack")?!1:s===!0?!0:je(e)!==void 0,He=(e,n)=>{const s=n.backend,r=process.env.VIS_INSTALLER,a=s??r??n.configBackend,o=n.configCorepack??"auto";if(a&&a!=="auto"){if(a==="aube"&&!O("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:W(e,a,o),version:"latest"}}if(O("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const i=xe(e);return{...i,useCorepack:W(e,i.name,o)}},xe=e=>{if(!j(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||!P.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},Oe=(e,n,s)=>{if(s===void 0)return K(e.bin,e.args,n);const r=E(e.bin,e.args,{cwd:n,env:{...process.env,...s},stdio:"inherit"});if(r.error)throw r.error;return r.status??1},p=(e,n,s,r,a={})=>{const o=L(n,e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),0):Oe(o,s,a.env)},f=(e,n,s,r,a={})=>p(e,n(),s,r,a),Re=(e,n)=>n==="aube"||n==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},Se=(e,n,s)=>n!=="yarn"||s.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},I=(e,n,s)=>{let r=e.name==="aube"?ie(n):ae(e.name,e.version,{...n,silent:n.silent||s.silent===!0});return s.preferOffline&&(r=Re(r,e.name)),s.ciMode&&(r=Se(r,e.name,e.version)),r},Ve=(e,n,s,r,a={})=>{const o=I(e,n,a);return C(e,o,s,r,{dry:a.dry,env:a.env})},Ye=async(e,n,s,r,a={})=>{const o=L(I(e,n,a),e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),{code:0,output:""}):we(o.bin,o.args,{cwd:s,env:a.env?{...process.env,...a.env}:process.env})},A=(e,n)=>{const s=n==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,s]}},_e=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},C=(e,n,s,r,a)=>{if(a.dry!==!0)return p(e,n,s,r,a);const o=_e(n,e.name);return o===null?p(e,n,s,r,a):p(e,o,s,r,{env:a.env})},Ce=(e,n)=>n==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:n==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},De=(e,n,s,r,a={})=>{let o=e.name==="aube"?te(n):Q(e.name,e.version,n);a.ignoreScripts&&(o=Ce(o,e.name)),a.silent&&(o=A(o,e.name));const i=C(e,o,s,r,{dry:a.dry,env:a.env});return i===0&&a.autoInstallPeers&&Pe(e,n,s,r,a),i},Me=e=>{if(e.startsWith("@")){const s=e.indexOf("/");if(s===-1)return e;const r=e.indexOf("@",s);return r===-1?e:e.slice(0,r)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},We=(e,n)=>{let s=e;for(;;){const r=v(s,"node_modules",n,"package.json"),a=_(r);if(a)return a;const o=R(s);if(o===s||S(s).root===s)return;s=o}},Ee=e=>{const n=_(v(e,"package.json")),s=new Set;if(!n)return s;for(const r of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const a=n[r];if(a)for(const o of Object.keys(a))s.add(o)}return s},Pe=(e,n,s,r,a)=>{if(e.name==="deno")return;const o=Ee(s),i=new Map;for(const g of n.packages){const m=Me(g),t=We(s,m);if(!t?.peerDependencies)continue;const d=t.peerDependenciesMeta??{};for(const[y,U]of Object.entries(t.peerDependencies))d[y]?.optional||o.has(y)||i.has(y)||i.set(y,U)}if(i.size===0)return;const u=[...i.entries()].map(([g,m])=>`${g}@${m}`);r.log(`auto-installing peer dependencies: ${u.join(", ")}`);const l={exact:!1,filter:n.filter,global:!1,optional:!1,packages:u,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};De(e,l,s,r,{ignoreScripts:a.ignoreScripts})},Ge=(e,n,s,r,a={})=>{let o=e.name==="aube"?pe(n):X(e.name,e.version,n);return a.silent&&(o=A(o,e.name)),C(e,o,s,r,{dry:a.dry,env:a.env})},Ke=(e,n,s,r,a={})=>e.name==="aube"?p(e,ue(n),s,r,a):f(e,()=>Z(e.name,e.version,n),s,r,a),Qe=(e,n,s,r,a={})=>e.name==="aube"?p(e,ce(n),s,r,a):f(e,()=>ee(e.name,e.version,n),s,r,a),Le=(e,n)=>{if(e.name==="aube")return fe(n);const s=[],r=[],a=e.name;switch(e.name){case"bun":{const o=$.coerce(e.version);o&&$.lt(o,"1.3.0")&&r.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),s.push("pm","view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"deno":{const o=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}`;s.push("info","--",o),n.json&&s.push("--json"),n.fields.length>0&&r.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{s.push("view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){s.push("info","--",n.package);const[o,...i]=n.fields;o!==void 0&&(i.length>0&&r.push("yarn v1 only supports querying one field at a time; using the first."),s.push(o)),n.json&&s.push("--json")}else s.push("npm","info","--",n.package),n.fields.length>0&&r.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&s.push("--json");break}default:{const o=e.name;throw new Error(`Unsupported package manager: ${o}`)}}return{args:s,bin:a,warnings:r}},Xe=(e,n,s,r,a={})=>p(e,Le(e,n),s,r,a),Ze=(e,n,s,r,a={})=>e.name==="aube"?p(e,de(n),s,r,a):f(e,()=>ne(e.name,e.version,n),s,r,a),en=(e,n,s,r,a,o={})=>e.name==="aube"?p(e,he(n,s),r,a,o):f(e,()=>se(e.name,e.version,n,s),r,a,o),Ie=(e,n,s)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const r=(a,o)=>{const i=[...e.args];return i.splice(o,0,a),{...e,args:i}};switch(n){case"aube":case"pnpm":return r("--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 r("--cached-only",1);case"npm":return r("--offline",1);case"yarn":return s.startsWith("1.")?r("--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)}`]}}}},nn=(e,n,s,r,a={})=>{let o=e.name==="aube"?le(n):V(e.name,e.version,n);return a.offline&&(o=Ie(o,e.name,e.version)),p(e,o,s,r,{dry:a.dry,env:a.env})},D=process.platform==="win32",Ae=D?[".exe",".cmd",".bat",".ps1",""]:[""],Ue=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const s of H(n))for(const r of Ae){const a=v(s,`${e}${r}`);if(j(a))return D?a.replaceAll("/","\\"):a}},sn=(e,n,s)=>{const r=Ue(e,s);if(r===void 0||D&&!r.toLowerCase().endsWith(".exe"))return null;const a=E(r,n,{cwd:s,env:F({...process.env},s),stdio:"inherit"});if(a.error)throw a.error;return a.status??1},rn=(e,n,s,r,a={})=>e.name==="aube"?p(e,ge(n),s,r,a):f(e,()=>oe(e.name,e.version,n),s,r,a),an=(e,n,s,r,a,o={})=>{if(e.name==="aube")return p(e,be(n,s),r,a,o);const i=ye(e,n,s);return i.kind==="skip"?(a.warn(`warning: ${i.warning}`),0):i.kind==="rewrite"?p(e,{args:i.args,bin:i.bin,warnings:i.warning?[i.warning]:[]},r,a,o):f(e,()=>re(e.name,e.version,n,s),r,a,o)};export{en as $,xe as A,Ye as C,Ge as E,Fe as I,sn as L,Ke as M,rn as N,Qe as P,Ze as S,an as U,nn as W,Xe as a,He as h,De as j,we as s,ze as v,Ve as y};
@@ -1,4 +1,4 @@
1
- import{createRequire as p}from"node:module";import{a as l}from"./vis-user-error-xmha3L4n.js";let m;const d=t=>(m??=p(import.meta.url))(t),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=t=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,o]=c.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return c.getBuiltinModule(t)}return d(t)},{createInterface:j}=h("node:readline"),v=t=>{const s=new Set;for(const o of Object.values(t.projects))for(const e of Object.keys(o.targets??{}))s.add(e);return[...s].sort()},y=t=>{const s=new Map;for(const o of t.values())for(const[e,r]of Object.entries(o))for(const n of r.aliases??[])s.has(n)||s.set(n,e);return s},$=(t,s)=>s.get(t)??t,w=(t,s)=>{if(t.length===0)return s.length;if(s.length===0)return t.length;const o=[];for(let e=0;e<=s.length;e++)o[e]=[e];for(let e=0;e<=t.length;e++)o[0][e]=e;for(let e=1;e<=s.length;e++)for(let r=1;r<=t.length;r++){const n=s[e-1]===t[r-1]?0:1;o[e][r]=Math.min(o[e-1][r]+1,o[e][r-1]+1,o[e-1][r-1]+n)}return o[s.length][t.length]},b=(t,s,o=3)=>u(t,s,1,o)[0],u=(t,s,o=3,e=3)=>{const r=[];for(const n of s){const a=w(t.toLowerCase(),n.toLowerCase());a<=e&&r.push({distance:a,name:n})}return r.sort((n,a)=>n.distance-a.distance||n.name.localeCompare(a.name)),r.slice(0,o).map(n=>n.name)},M=t=>t.length===0?" (no targets found)":t.map(s=>` - ${s}`).join(`
1
+ import{createRequire as p}from"node:module";import{a as l}from"./vis-user-error-CfM4_ORo.js";let m;const d=t=>(m??=p(import.meta.url))(t),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=t=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,o]=c.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return c.getBuiltinModule(t)}return d(t)},{createInterface:j}=h("node:readline"),v=t=>{const s=new Set;for(const o of Object.values(t.projects))for(const e of Object.keys(o.targets??{}))s.add(e);return[...s].sort()},y=t=>{const s=new Map;for(const o of t.values())for(const[e,r]of Object.entries(o))for(const n of r.aliases??[])s.has(n)||s.set(n,e);return s},$=(t,s)=>s.get(t)??t,w=(t,s)=>{if(t.length===0)return s.length;if(s.length===0)return t.length;const o=[];for(let e=0;e<=s.length;e++)o[e]=[e];for(let e=0;e<=t.length;e++)o[0][e]=e;for(let e=1;e<=s.length;e++)for(let r=1;r<=t.length;r++){const n=s[e-1]===t[r-1]?0:1;o[e][r]=Math.min(o[e-1][r]+1,o[e][r-1]+1,o[e-1][r-1]+n)}return o[s.length][t.length]},b=(t,s,o=3)=>u(t,s,1,o)[0],u=(t,s,o=3,e=3)=>{const r=[];for(const n of s){const a=w(t.toLowerCase(),n.toLowerCase());a<=e&&r.push({distance:a,name:n})}return r.sort((n,a)=>n.distance-a.distance||n.name.localeCompare(a.name)),r.slice(0,o).map(n=>n.name)},M=t=>t.length===0?" (no targets found)":t.map(s=>` - ${s}`).join(`
2
2
  `),S=async t=>{if(t.length===0||!process.stdin.isTTY||!process.stdout.isTTY)return;const s=j({input:process.stdin,output:process.stdout});try{process.stdout.write(`Available targets:
3
3
  `);for(const[r,n]of t.entries())process.stdout.write(` ${String(r+1).padStart(2," ")}. ${n}
4
4
  `);process.stdout.write(`
@@ -1 +1 @@
1
- import{s as c}from"./index-BAe6e0XE.js";import{g as m}from"./packument-HBVbyf7x.js";import{i as v}from"../packem_chunks/cli-main.js";const h=8,u=async(t,r,e)=>{if(t.length===0)return[];const o=Math.max(1,Math.min(r,t.length)),s=Array.from({length:t.length});let n=0;const i=async()=>{for(;n<t.length;){const a=n;n+=1;const f=t[a];s[a]=await e(f,a)}};return await Promise.all(Array.from({length:o},()=>i())),s},l=(t,r)=>t.versions[r]?.dist?.attestations?.provenance!==void 0,p=(t,r)=>c.valid(r)?Object.keys(t.versions).filter(e=>c.valid(e)!==null&&c.lt(e,r)).filter(e=>c.satisfies(e,"*",{includePrerelease:!1})).filter(e=>l(t,e)).sort((e,o)=>c.lt(e,o)?1:-1)[0]:void 0,y=async(t,r={})=>{if(v("provenance"))return[];const e=new Set(r.allowlist),o=r.concurrency??h;return(await u(t,o,async({name:s,version:n})=>{if(e.has(s))return;const i=await m(s,{workspaceRoot:r.workspaceRoot});if(i===void 0||l(i,n))return;const a=p(i,n);if(a!==void 0)return{packageName:s,priorVersionWithProvenance:a,version:n}})).filter(s=>s!==void 0)};export{h as D,p as f,u as m,y as r};
1
+ import{s as c}from"./index-BAe6e0XE.js";import{g as m}from"./packument-B9-WqReu.js";import{i as v}from"../packem_chunks/cli-main.js";const h=8,u=async(t,r,e)=>{if(t.length===0)return[];const o=Math.max(1,Math.min(r,t.length)),s=Array.from({length:t.length});let n=0;const i=async()=>{for(;n<t.length;){const a=n;n+=1;const f=t[a];s[a]=await e(f,a)}};return await Promise.all(Array.from({length:o},()=>i())),s},l=(t,r)=>t.versions[r]?.dist?.attestations?.provenance!==void 0,p=(t,r)=>c.valid(r)?Object.keys(t.versions).filter(e=>c.valid(e)!==null&&c.lt(e,r)).filter(e=>c.satisfies(e,"*",{includePrerelease:!1})).filter(e=>l(t,e)).sort((e,o)=>c.lt(e,o)?1:-1)[0]:void 0,y=async(t,r={})=>{if(v("provenance"))return[];const e=new Set(r.allowlist),o=r.concurrency??h;return(await u(t,o,async({name:s,version:n})=>{if(e.has(s))return;const i=await m(s,{workspaceRoot:r.workspaceRoot});if(i===void 0||l(i,n))return;const a=p(i,n);if(a!==void 0)return{packageName:s,priorVersionWithProvenance:a,version:n}})).filter(s=>s!==void 0)};export{h as D,p as f,u as m,y as r};
@@ -1 +1 @@
1
- import{s as a,E as s,L as l,z as f,e as d}from"./index-uBVnF4ji.js";const m=e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,p=(e,o,c)=>l(e,{start:o},{tabWidth:!1,...c}),g=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,h=(e,o)=>{const c=g.exec(o);if(!c)return;const[,i,t,n]=c;if(t&&n)return{column:Number(n),line:Number(t)};let r=Number(i);return r===e.length&&(r=e.length-1),s(e,r)},N=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,b=e=>e.replace(N,(o,c,i)=>`"${i}"(${m(i)})`);function w(e,o,c,i){let t;try{return JSON.parse(e,o)}catch(u){t=u.message}let n;e?(n=h(e,t),t=b(t)):t+=" while parsing empty string";const r=new a(t);throw r.fileName=c,n&&(r.codeFrame=p(e,n,i)),r}function S(e,o,c){const i=f(e,{buffer:!0,encoding:void 0});let t=new TextDecoder().decode(i);const{beforeParse:n,color:r}={};return typeof n=="function"&&(t=n(t)),w(t,o,d(e),{color:r})}export{w as N,S as a};
1
+ import{s as a,E as s,L as l,z as f,f as d}from"./index-BLtnel38.js";const m=e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,p=(e,o,c)=>l(e,{start:o},{tabWidth:!1,...c}),g=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,h=(e,o)=>{const c=g.exec(o);if(!c)return;const[,i,t,n]=c;if(t&&n)return{column:Number(n),line:Number(t)};let r=Number(i);return r===e.length&&(r=e.length-1),s(e,r)},N=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,b=e=>e.replace(N,(o,c,i)=>`"${i}"(${m(i)})`);function w(e,o,c,i){let t;try{return JSON.parse(e,o)}catch(u){t=u.message}let n;e?(n=h(e,t),t=b(t)):t+=" while parsing empty string";const r=new a(t);throw r.fileName=c,n&&(r.codeFrame=p(e,n,i)),r}function S(e,o,c){const i=f(e,{buffer:!0,encoding:void 0});let t=new TextDecoder().decode(i);const{beforeParse:n,color:r}={};return typeof n=="function"&&(t=n(t)),w(t,o,d(e),{color:r})}export{w as N,S as a};
@@ -1 +1 @@
1
- import{createRequire as g}from"node:module";import{l as f,w as d,d as j}from"./index-uBVnF4ji.js";import{g as b}from"./en-D3CfXlO7.js";import{a as w}from"./readJsonSync-DweZd5ZA-0eZh9sGm.js";let _;const h=e=>(_??=g(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,t]=o.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return o.getBuiltinModule(e)}return h(e)},{rmSync:l,writeFileSync:v}=k("node:fs"),C=1440*60*1e3,R=15e3,A="https://registry.npmjs.org/-/npm/v1/keys",m=()=>d(b(),"registry-keys"),i=()=>d(m(),"npmjs.json"),M=()=>{const e=i();if(f(e))try{const r=w(e),t=Date.now()-r.createdAt>r.ttlMs;return{entry:r,expired:t}}catch{l(e,{force:!0});return}},S=(e,r)=>{j(m());const t={createdAt:Date.now(),keys:e,ttlMs:r};v(i(),JSON.stringify(t),"utf8")},x=async(e={})=>{const r=e.ttlMs??C,t=e.keysUrl??process.env.VIS_NPM_KEYS_URL??A,s=M();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,p=setTimeout(()=>{n.abort()},R),c=()=>{n.abort()};e.signal?.addEventListener("abort",c,{once:!0});try{const a=await fetch(t,{headers:{Accept:"application/json"},signal:n.signal});if(!a.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const y=await a.json(),u=Array.isArray(y.keys)?y.keys:[];return S(u,r),{fromCache:!1,keys:u}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(p),e.signal?.removeEventListener("abort",c)}},D=()=>{const e=i();return f(e)?(l(e,{force:!0}),!0):!1};export{D as c,x as f};
1
+ import{createRequire as g}from"node:module";import{l as f,w as d,d as j}from"./index-BLtnel38.js";import{g as b}from"./en-BDYMmM2_.js";import{a as w}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";let _;const h=e=>(_??=g(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,t]=o.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return o.getBuiltinModule(e)}return h(e)},{rmSync:l,writeFileSync:v}=k("node:fs"),C=1440*60*1e3,R=15e3,A="https://registry.npmjs.org/-/npm/v1/keys",m=()=>d(b(),"registry-keys"),i=()=>d(m(),"npmjs.json"),M=()=>{const e=i();if(f(e))try{const r=w(e),t=Date.now()-r.createdAt>r.ttlMs;return{entry:r,expired:t}}catch{l(e,{force:!0});return}},S=(e,r)=>{j(m());const t={createdAt:Date.now(),keys:e,ttlMs:r};v(i(),JSON.stringify(t),"utf8")},x=async(e={})=>{const r=e.ttlMs??C,t=e.keysUrl??process.env.VIS_NPM_KEYS_URL??A,s=M();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,p=setTimeout(()=>{n.abort()},R),c=()=>{n.abort()};e.signal?.addEventListener("abort",c,{once:!0});try{const a=await fetch(t,{headers:{Accept:"application/json"},signal:n.signal});if(!a.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const y=await a.json(),u=Array.isArray(y.keys)?y.keys:[];return S(u,r),{fromCache:!1,keys:u}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(p),e.signal?.removeEventListener("abort",c)}},D=()=>{const e=i();return f(e)?(l(e,{force:!0}),!0):!1};export{D as c,x as f};
@@ -1,4 +1,4 @@
1
- import{I as N}from"./index-BWl4DbMp.js";import{i as D}from"./en-D3CfXlO7.js";import{p as y,d as R}from"./prompt-BSAy8SMH.js";import{h as M,M as T,r as A,a as S,b as E,c as C,d as P,e as x,f as V}from"./s1ngularity-St6dhKiq.js";import{m as u,D as g,r as j}from"./provenance-D4Cza8cp.js";import{g as w}from"./packument-HBVbyf7x.js";import{i as b,p as m}from"../packem_chunks/cli-main.js";import{r as I}from"./signatures-Dyeyg1q9.js";import{s as L}from"./index-BAe6e0XE.js";import{f as O}from"./utils-CRueU43T.js";const W=15,B=e=>{const a=(e.TERM??"").toLowerCase();return a!=="dumb"&&a!=="unknown"&&a!==""},U=async(e,a,n,s)=>new Promise(c=>{if(s?.aborted){c(!1);return}const o=B(n)&&a.isTTY!==!1;let r=e;const i=()=>{o?a.write(`\rContinuing in ${String(r)}s... press Ctrl-C to abort. `):r===e&&a.write(`Warnings present; proceeding in ${String(e)}s.
1
+ import{I as N}from"./index-BWl4DbMp.js";import{i as D}from"./en-BDYMmM2_.js";import{p as y,d as R}from"./prompt-BSAy8SMH.js";import{h as M,M as T,r as A,a as S,b as E,c as C,d as P,e as x,f as V}from"./s1ngularity-BIYhg82u.js";import{m as u,D as g,r as j}from"./provenance-CLxuqCfL.js";import{g as w}from"./packument-B9-WqReu.js";import{i as b,p as m}from"../packem_chunks/cli-main.js";import{r as I}from"./signatures-C8iQ5fUq.js";import{s as L}from"./index-BAe6e0XE.js";import{f as O}from"./utils-CRueU43T.js";const W=15,B=e=>{const a=(e.TERM??"").toLowerCase();return a!=="dumb"&&a!=="unknown"&&a!==""},U=async(e,a,n,s)=>new Promise(c=>{if(s?.aborted){c(!1);return}const o=B(n)&&a.isTTY!==!1;let r=e;const i=()=>{o?a.write(`\rContinuing in ${String(r)}s... press Ctrl-C to abort. `):r===e&&a.write(`Warnings present; proceeding in ${String(e)}s.
2
2
  `)};i();const d=setInterval(()=>{if(r-=1,r<=0){clearInterval(d),s?.removeEventListener("abort",l),o&&a.write(`\rContinuing now.
3
3
  `),c(!0);return}i()},1e3),l=()=>{clearInterval(d),o&&a.write(`\rAborted.
4
4
  `),c(!1)};s?.addEventListener("abort",l,{once:!0})}),Y=async(e,a={})=>{if(e.length===0)return{proceed:!0};const n=a.env??process.env,s=a.isTty??!!process.stdin.isTTY,c=a.isCi??N,o=a.strict??!1,r=a.readline??R,i=a.output??{isTTY:!!process.stdout.isTTY,write:p=>process.stdout.write(p)},d=D(n.VIS_DISABLE_AUTO_CONTINUE),l=Number.parseInt(n.VIS_AUTO_CONTINUE_SECONDS??"",10),t=a.countdownSeconds??(Number.isFinite(l)&&l>0?l:W);return e.some(p=>p.severity==="error")?o?{proceed:!1,reason:"errors-present"}:c?{proceed:!1,reason:"errors-present"}:s?await y("Proceed despite errors? [y/N] ",r)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!1,reason:"non-tty"}:o?{proceed:!1,reason:"ci-strict"}:s?d?await y("Proceed despite warnings? [y/N] ",r)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:await U(t,i,n,a.signal)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!0}},be=async(e,a={})=>{if(e.isEmpty())return!0;const n=e.all(),s=a.output??{isTTY:!!process.stdout.isTTY,write:c=>process.stdout.write(c)};for(const c of M(n))s.write(`${c}
@@ -1 +1 @@
1
- import{l as s,w as f,J as b,M as g}from"./index-uBVnF4ji.js";const v={id:"bun",label:"Bun",lockfiles:["bun.lock","bun.lockb"],scriptSource:"package.json"},j={id:"node",label:"Node.js",lockfiles:["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json"],scriptSource:"package.json"},l={bun:v,node:j},a=["node","bun"],u={"deno.lock":"deno"},$=a.flatMap(o=>l[o].lockfiles.map(e=>[e,o])),p="Deno is not supported yet (deferred — see rfc/design-runtime-multitool.md).",d=(o,e)=>{if(o==="node"||o==="bun")return o;throw o in u||o==="deno"?new Error(`${e} requested runtime "${o}", but ${p}`):new Error(`${e} requested unknown runtime "${o}". Supported: ${a.join(", ")}.`)},w=o=>{let e=o;for(;;){for(const[r,n]of $)if(s(f(e,r)))return{runtime:n};for(const r of Object.keys(u))if(s(f(e,r)))return{deferred:u[r]};const t=b(e);if(t===e||g(e).root===e)return{};e=t}},M=(o,e={})=>{const t=e.env??process.env,r=(c,m,k)=>({adapter:l[c],deferredNotice:k,runtime:c,source:m});if(e.flag!==void 0&&e.flag!=="")return r(d(e.flag,"--runtime"),"flag");const n=t.VIS_RUNTIME;if(n!==void 0&&n!=="")return r(d(n,"VIS_RUNTIME"),"env");if(e.config!==void 0)return r(d(e.config,"config runtime:"),"config");const i=w(o);return i.runtime!==void 0?r(i.runtime,"lockfile"):i.deferred!==void 0?r("node","default",`Detected a ${i.deferred} project but ${p} Falling back to node.`):r("node","default")};export{M as r};
1
+ import{l as s,w as f,J as b,M as g}from"./index-BLtnel38.js";const v={id:"bun",label:"Bun",lockfiles:["bun.lock","bun.lockb"],scriptSource:"package.json"},j={id:"node",label:"Node.js",lockfiles:["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json"],scriptSource:"package.json"},l={bun:v,node:j},a=["node","bun"],u={"deno.lock":"deno"},$=a.flatMap(o=>l[o].lockfiles.map(e=>[e,o])),p="Deno is not supported yet (deferred — see rfc/design-runtime-multitool.md).",d=(o,e)=>{if(o==="node"||o==="bun")return o;throw o in u||o==="deno"?new Error(`${e} requested runtime "${o}", but ${p}`):new Error(`${e} requested unknown runtime "${o}". Supported: ${a.join(", ")}.`)},w=o=>{let e=o;for(;;){for(const[r,n]of $)if(s(f(e,r)))return{runtime:n};for(const r of Object.keys(u))if(s(f(e,r)))return{deferred:u[r]};const t=b(e);if(t===e||g(e).root===e)return{};e=t}},M=(o,e={})=>{const t=e.env??process.env,r=(c,m,k)=>({adapter:l[c],deferredNotice:k,runtime:c,source:m});if(e.flag!==void 0&&e.flag!=="")return r(d(e.flag,"--runtime"),"flag");const n=t.VIS_RUNTIME;if(n!==void 0&&n!=="")return r(d(n,"VIS_RUNTIME"),"env");if(e.config!==void 0)return r(d(e.config,"config runtime:"),"config");const i=w(o);return i.runtime!==void 0?r(i.runtime,"lockfile"):i.deferred!==void 0?r("node","default",`Detected a ${i.deferred} project but ${p} Falling back to node.`):r("node","default")};export{M as r};
@@ -1 +1 @@
1
- import{createRequire as S}from"node:module";import{w as i,J as l}from"./index-uBVnF4ji.js";import{p as w}from"./augment-24KX2nkI.js";let h;const b=r=>(h??=S(import.meta.url))(r),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=r=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[e,s]=a.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return a.getBuiltinModule(r)}return b(r)},{spawnSync:u}=d("node:child_process"),{existsSync:p}=d("node:fs"),y=r=>{let e=r;for(;;){const s=i(e,".pnp.cjs");if(p(s)){const t=i(e,".pnp.loader.mjs");return{esmLoader:p(t)?t:void 0,pnpCjs:s}}const o=l(e);if(o===e)return;e=o}},x=r=>{const e=y(r);if(e===void 0)return[];const s=["--require",e.pnpCjs];return e.esmLoader!==void 0&&s.push("--import",e.esmLoader),s},E=[{flag:"--enable-source-maps",key:"sourcemaps",min:[22,0]},{flag:"--experimental-sqlite",key:"sqlite",min:[22,5]},{flag:"--experimental-webstorage",key:"webstorage",min:[22,4]},{flag:"--experimental-eventsource",key:"eventsource",min:[22,3]},{flag:"--experimental-websocket",key:"websocket",max:[21,999],min:[20,10]},{flag:"--experimental-vm-modules",key:"vm-modules",min:[22,0]}],I=[22,4],P=r=>{const[e,s]=r.split(".").map(o=>Number.parseInt(o,10));return[e??0,s??0]},f=(r,e)=>r[0]>e[0]||r[0]===e[0]&&r[1]>=e[1],j=(r,e)=>r[0]<e[0]||r[0]===e[0]&&r[1]<=e[1],T=(r,e)=>f(r,e.min)&&(e.max===void 0||j(r,e.max)),L=r=>{const e=r.trim().toLowerCase();return e===""||e==="all"||e==="1"||e==="true"},m=(r,e)=>L(r)||r.split(",").some(s=>s.trim().toLowerCase()===e),g=(r,e,s)=>{const o=P(e),t=[];for(const n of E)m(r,n.key)&&T(o,n)&&t.push(n.flag);return m(r,"localstorage")&&f(o,I)&&(t.includes("--experimental-webstorage")||t.push("--experimental-webstorage"),t.push(`--localstorage-file=${s}`)),t},v="VIS_X_REEXEC",k=(r,e,s)=>{const o={...process.env},t=i(l(process.argv[1]),"runtime","preload.js");if(o.NODE_OPTIONS){const c=o.NODE_OPTIONS.replace(`--import ${JSON.stringify(t)}`,"").replace(`--import ${t}`,"").replaceAll(/\s+/gu," ").trim();c===""?delete o.NODE_OPTIONS:o.NODE_OPTIONS=c}delete o.VIS_AUGMENT_SUBPROCESS,delete o.VIS_UNFLAG,delete o.VIS_POLYFILL;const n=u(process.execPath,[r,...e],{cwd:s,env:o,stdio:"inherit"});if(n.error)throw n.error;return n.status??(n.signal===null?0:1)},_=r=>{let e=r;for(;;){if(p(i(e,"package.json"))||p(i(e,".pnp.cjs")))return i(e,".vis","localstorage");const s=l(e);if(s===e)return i(r,".vis","localstorage");e=s}},A=r=>{const e=process.env.VIS_UNFLAG;return[...e===void 0?[]:g(e,process.versions.node,_(r)),...x(r)]},C=(r,e,s)=>{const o=u("bun",["run",r,...e],{cwd:s,stdio:"inherit"});if(o.error)throw o.error.code==="ENOENT"?new Error("Runtime is set to bun but the `bun` binary is not on PATH. Install it from https://bun.sh."):o.error;return o.status??(o.signal===null?0:1)},R=(r,e,s,o)=>{const t=u(process.execPath,[...r,process.argv[1],"x",e,...s],{cwd:o,env:{...process.env,[v]:"1"},stdio:"inherit"});return t.status??(t.signal===null?0:1)},q=async(r,e,s)=>{if(process.env[v]===void 0){const n=A(s);if(n.length>0)return R(n,r,e,s)}if(process.env.VIS_AUGMENT_SUBPROCESS!==void 0){const n=i(l(process.argv[1]),"runtime","preload.js"),c=process.env.VIS_UNFLAG,O=c===void 0?[]:g(c,process.versions.node,_(s)),N=[process.env.NODE_OPTIONS??"",...O,`--import ${JSON.stringify(n)}`].filter(Boolean);process.env.NODE_OPTIONS=N.join(" ").trim()}const{importTs:o}=await import("../packem_chunks/ts-loader.js").then(n=>n.t);await w(s);const t=process.argv;process.argv=[process.execPath,r,...e];try{await o(r)}finally{process.argv=t}return typeof process.exitCode=="number"?process.exitCode:0},$=async(r,e,s,o,t={})=>t.node?k(r,e,o):s==="bun"?C(r,e,o):q(r,e,o);export{$ as r};
1
+ import{createRequire as S}from"node:module";import{w as i,J as l}from"./index-BLtnel38.js";import{p as w}from"./augment-BkJxi_GW.js";let h;const b=r=>(h??=S(import.meta.url))(r),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=r=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[e,s]=a.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return a.getBuiltinModule(r)}return b(r)},{spawnSync:u}=d("node:child_process"),{existsSync:p}=d("node:fs"),y=r=>{let e=r;for(;;){const s=i(e,".pnp.cjs");if(p(s)){const t=i(e,".pnp.loader.mjs");return{esmLoader:p(t)?t:void 0,pnpCjs:s}}const o=l(e);if(o===e)return;e=o}},x=r=>{const e=y(r);if(e===void 0)return[];const s=["--require",e.pnpCjs];return e.esmLoader!==void 0&&s.push("--import",e.esmLoader),s},E=[{flag:"--enable-source-maps",key:"sourcemaps",min:[22,0]},{flag:"--experimental-sqlite",key:"sqlite",min:[22,5]},{flag:"--experimental-webstorage",key:"webstorage",min:[22,4]},{flag:"--experimental-eventsource",key:"eventsource",min:[22,3]},{flag:"--experimental-websocket",key:"websocket",max:[21,999],min:[20,10]},{flag:"--experimental-vm-modules",key:"vm-modules",min:[22,0]}],I=[22,4],P=r=>{const[e,s]=r.split(".").map(o=>Number.parseInt(o,10));return[e??0,s??0]},f=(r,e)=>r[0]>e[0]||r[0]===e[0]&&r[1]>=e[1],j=(r,e)=>r[0]<e[0]||r[0]===e[0]&&r[1]<=e[1],T=(r,e)=>f(r,e.min)&&(e.max===void 0||j(r,e.max)),L=r=>{const e=r.trim().toLowerCase();return e===""||e==="all"||e==="1"||e==="true"},m=(r,e)=>L(r)||r.split(",").some(s=>s.trim().toLowerCase()===e),g=(r,e,s)=>{const o=P(e),t=[];for(const n of E)m(r,n.key)&&T(o,n)&&t.push(n.flag);return m(r,"localstorage")&&f(o,I)&&(t.includes("--experimental-webstorage")||t.push("--experimental-webstorage"),t.push(`--localstorage-file=${s}`)),t},v="VIS_X_REEXEC",k=(r,e,s)=>{const o={...process.env},t=i(l(process.argv[1]),"runtime","preload.js");if(o.NODE_OPTIONS){const c=o.NODE_OPTIONS.replace(`--import ${JSON.stringify(t)}`,"").replace(`--import ${t}`,"").replaceAll(/\s+/gu," ").trim();c===""?delete o.NODE_OPTIONS:o.NODE_OPTIONS=c}delete o.VIS_AUGMENT_SUBPROCESS,delete o.VIS_UNFLAG,delete o.VIS_POLYFILL;const n=u(process.execPath,[r,...e],{cwd:s,env:o,stdio:"inherit"});if(n.error)throw n.error;return n.status??(n.signal===null?0:1)},_=r=>{let e=r;for(;;){if(p(i(e,"package.json"))||p(i(e,".pnp.cjs")))return i(e,".vis","localstorage");const s=l(e);if(s===e)return i(r,".vis","localstorage");e=s}},A=r=>{const e=process.env.VIS_UNFLAG;return[...e===void 0?[]:g(e,process.versions.node,_(r)),...x(r)]},C=(r,e,s)=>{const o=u("bun",["run",r,...e],{cwd:s,stdio:"inherit"});if(o.error)throw o.error.code==="ENOENT"?new Error("Runtime is set to bun but the `bun` binary is not on PATH. Install it from https://bun.sh."):o.error;return o.status??(o.signal===null?0:1)},R=(r,e,s,o)=>{const t=u(process.execPath,[...r,process.argv[1],"x",e,...s],{cwd:o,env:{...process.env,[v]:"1"},stdio:"inherit"});return t.status??(t.signal===null?0:1)},q=async(r,e,s)=>{if(process.env[v]===void 0){const n=A(s);if(n.length>0)return R(n,r,e,s)}if(process.env.VIS_AUGMENT_SUBPROCESS!==void 0){const n=i(l(process.argv[1]),"runtime","preload.js"),c=process.env.VIS_UNFLAG,O=c===void 0?[]:g(c,process.versions.node,_(s)),N=[process.env.NODE_OPTIONS??"",...O,`--import ${JSON.stringify(n)}`].filter(Boolean);process.env.NODE_OPTIONS=N.join(" ").trim()}const{importTs:o}=await import("../packem_chunks/ts-loader.js").then(n=>n.t);await w(s);const t=process.argv;process.argv=[process.execPath,r,...e];try{await o(r)}finally{process.argv=t}return typeof process.exitCode=="number"?process.exitCode:0},$=async(r,e,s,o,t={})=>t.node?k(r,e,o):s==="bun"?C(r,e,o):q(r,e,o);export{$ as r};
@@ -1 +1 @@
1
- import{w as g,l as m,z as h}from"./index-uBVnF4ji.js";import{whichBin as d}from"#native";import{a as k}from"./readJsonSync-DweZd5ZA-0eZh9sGm.js";const v=r=>{for(const s of[".nvmrc",".node-version"]){const i=g(r,s);if(m(i))try{return h(i).trim().replace(/^v/,"")}catch{}}},l=(r,s)=>{const i=r.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),c=s.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),e=Math.max(i.length,c.length);for(let n=0;n<e;n++){const t=i[n]??0,a=c[n]??0;if(t!==a)return t-a}return 0},$=(r,s)=>{const i=s.trim();if(i===""||i==="*")return!0;const c=i.split(/\s+/).filter(Boolean);for(const e of c)if(e.startsWith(">=")){if(l(r,e.slice(2).trim())<0)return!1}else if(e.startsWith("<=")){if(l(r,e.slice(2).trim())>0)return!1}else if(e.startsWith(">")){if(l(r,e.slice(1).trim())<=0)return!1}else if(e.startsWith("<")){if(l(r,e.slice(1).trim())>=0)return!1}else if(/^\d/.test(e)){const n=r.split("."),t=e.split(".");for(const[a,o]of t.entries())if(o!==n[a])return!1}return!0},j=r=>{const s=[],i=g(r,"package.json");let c;try{c=k(i)}catch{return s}const e=process.versions.node;if(c.engines?.node){const t=c.engines.node;$(e,t)||s.push({actual:e,expected:t,kind:"node",message:`package.json engines.node requires ${t}, but the current Node.js is ${e}.`,severity:"error"})}const n=v(r);if(n){const[t,a]=n.split("."),[o,p]=e.split(".");(t!==o||a!==void 0&&a!==p)&&s.push({actual:e,expected:n,kind:"node",message:`.nvmrc pins Node ${n} but the current Node.js is ${e}. Run \`nvm use\` or switch runtimes.`,severity:"warning"})}if(c.packageManager){const[t,a]=c.packageManager.split("@"),o=(process.env.npm_config_user_agent??"").split(" ")[0]??"",[p,u]=o.split("/"),f=t==="aube"&&d("aube")!==null;p&&t&&p!==t?s.push({actual:p,expected:t,kind:"packageManager",message:`package.json packageManager pins ${c.packageManager} but the current invocation is ${o}. Install the correct package manager.`,severity:f?"warning":"error"}):u&&a&&u!==a&&s.push({actual:u,expected:a,kind:"packageManager",message:`package.json packageManager pins ${t}@${a} but the current invocation uses ${t}@${u}.`,severity:"warning"})}return s};export{j as c};
1
+ import{w as g,l as m,z as h}from"./index-BLtnel38.js";import{whichBin as d}from"#native";import{a as k}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";const v=r=>{for(const s of[".nvmrc",".node-version"]){const i=g(r,s);if(m(i))try{return h(i).trim().replace(/^v/,"")}catch{}}},l=(r,s)=>{const i=r.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),c=s.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),e=Math.max(i.length,c.length);for(let n=0;n<e;n++){const t=i[n]??0,a=c[n]??0;if(t!==a)return t-a}return 0},$=(r,s)=>{const i=s.trim();if(i===""||i==="*")return!0;const c=i.split(/\s+/).filter(Boolean);for(const e of c)if(e.startsWith(">=")){if(l(r,e.slice(2).trim())<0)return!1}else if(e.startsWith("<=")){if(l(r,e.slice(2).trim())>0)return!1}else if(e.startsWith(">")){if(l(r,e.slice(1).trim())<=0)return!1}else if(e.startsWith("<")){if(l(r,e.slice(1).trim())>=0)return!1}else if(/^\d/.test(e)){const n=r.split("."),t=e.split(".");for(const[a,o]of t.entries())if(o!==n[a])return!1}return!0},j=r=>{const s=[],i=g(r,"package.json");let c;try{c=k(i)}catch{return s}const e=process.versions.node;if(c.engines?.node){const t=c.engines.node;$(e,t)||s.push({actual:e,expected:t,kind:"node",message:`package.json engines.node requires ${t}, but the current Node.js is ${e}.`,severity:"error"})}const n=v(r);if(n){const[t,a]=n.split("."),[o,p]=e.split(".");(t!==o||a!==void 0&&a!==p)&&s.push({actual:e,expected:n,kind:"node",message:`.nvmrc pins Node ${n} but the current Node.js is ${e}. Run \`nvm use\` or switch runtimes.`,severity:"warning"})}if(c.packageManager){const[t,a]=c.packageManager.split("@"),o=(process.env.npm_config_user_agent??"").split(" ")[0]??"",[p,u]=o.split("/"),f=t==="aube"&&d("aube")!==null;p&&t&&p!==t?s.push({actual:p,expected:t,kind:"packageManager",message:`package.json packageManager pins ${c.packageManager} but the current invocation is ${o}. Install the correct package manager.`,severity:f?"warning":"error"}):u&&a&&u!==a&&s.push({actual:u,expected:a,kind:"packageManager",message:`package.json packageManager pins ${t}@${a} but the current invocation uses ${t}@${u}.`,severity:"warning"})}return s};export{j as c};