@visulima/vis 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE.md +89 -152
  3. package/dist/bin.js +1 -1
  4. package/dist/binx.js +1 -1
  5. package/dist/packem_chunks/CONFIG_FILES.js +4 -4
  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 +52 -61
  9. package/dist/packem_chunks/cli-exec.js +1 -1
  10. package/dist/packem_chunks/cli-main.js +150 -152
  11. package/dist/packem_chunks/dart-plan.js +1 -1
  12. package/dist/packem_chunks/dart-projects.js +1 -1
  13. package/dist/packem_chunks/dispatch.js +1 -1
  14. package/dist/packem_chunks/doctor-probe.js +1 -1
  15. package/dist/packem_chunks/fix.js +1 -1
  16. package/dist/packem_chunks/handler.js +1 -1
  17. package/dist/packem_chunks/handler10.js +4 -4
  18. package/dist/packem_chunks/handler11.js +1 -1
  19. package/dist/packem_chunks/handler12.js +1 -1
  20. package/dist/packem_chunks/handler13.js +1 -1
  21. package/dist/packem_chunks/handler14.js +1 -1
  22. package/dist/packem_chunks/handler15.js +1 -1
  23. package/dist/packem_chunks/handler16.js +1 -1
  24. package/dist/packem_chunks/handler17.js +1 -1
  25. package/dist/packem_chunks/handler18.js +1 -1
  26. package/dist/packem_chunks/handler19.js +1 -1
  27. package/dist/packem_chunks/handler2.js +1 -1
  28. package/dist/packem_chunks/handler20.js +2 -2
  29. package/dist/packem_chunks/handler21.js +1 -1
  30. package/dist/packem_chunks/handler22.js +2 -2
  31. package/dist/packem_chunks/handler23.js +1 -1
  32. package/dist/packem_chunks/handler24.js +1 -1
  33. package/dist/packem_chunks/handler26.js +1 -1
  34. package/dist/packem_chunks/handler27.js +1 -1
  35. package/dist/packem_chunks/handler28.js +1 -1
  36. package/dist/packem_chunks/handler29.js +1 -1
  37. package/dist/packem_chunks/handler3.js +1 -1
  38. package/dist/packem_chunks/handler30.js +1 -1
  39. package/dist/packem_chunks/handler5.js +1 -1
  40. package/dist/packem_chunks/handler50.js +2 -2
  41. package/dist/packem_chunks/handler51.js +1 -1
  42. package/dist/packem_chunks/handler53.js +1 -1
  43. package/dist/packem_chunks/handler54.js +1 -1
  44. package/dist/packem_chunks/handler55.js +1 -1
  45. package/dist/packem_chunks/handler58.js +1 -1
  46. package/dist/packem_chunks/handler59.js +1 -1
  47. package/dist/packem_chunks/handler6.js +1 -1
  48. package/dist/packem_chunks/handler60.js +7 -7
  49. package/dist/packem_chunks/handler61.js +1 -1
  50. package/dist/packem_chunks/handler62.js +2 -2
  51. package/dist/packem_chunks/handler63.js +1 -1
  52. package/dist/packem_chunks/handler64.js +2 -2
  53. package/dist/packem_chunks/handler65.js +1 -1
  54. package/dist/packem_chunks/handler66.js +1 -1
  55. package/dist/packem_chunks/handler67.js +20 -31
  56. package/dist/packem_chunks/handler68.js +1 -1
  57. package/dist/packem_chunks/handler69.js +1 -1
  58. package/dist/packem_chunks/handler7.js +1 -1
  59. package/dist/packem_chunks/handler70.js +5 -5
  60. package/dist/packem_chunks/handler71.js +1 -1
  61. package/dist/packem_chunks/handler72.js +1 -1
  62. package/dist/packem_chunks/handler73.js +1 -1
  63. package/dist/packem_chunks/handler74.js +1 -1
  64. package/dist/packem_chunks/handler75.js +17 -17
  65. package/dist/packem_chunks/handler76.js +1 -1
  66. package/dist/packem_chunks/handler77.js +2 -2
  67. package/dist/packem_chunks/handler78.js +31 -31
  68. package/dist/packem_chunks/handler8.js +1 -1
  69. package/dist/packem_chunks/handler9.js +1 -1
  70. package/dist/packem_chunks/heal-accept.js +1 -1
  71. package/dist/packem_chunks/heal.js +1 -1
  72. package/dist/packem_chunks/help-command.js +7 -40
  73. package/dist/packem_chunks/index2.js +11 -11
  74. package/dist/packem_chunks/index6.js +1 -1
  75. package/dist/packem_chunks/keys-refresh.js +1 -1
  76. package/dist/packem_chunks/lean.js +1 -1
  77. package/dist/packem_chunks/list.js +1 -1
  78. package/dist/packem_chunks/loader.js +1 -1
  79. package/dist/packem_chunks/orchestrator.js +1 -1
  80. package/dist/packem_chunks/prompts.js +1 -1
  81. package/dist/packem_chunks/status.js +1 -1
  82. package/dist/packem_chunks/sync.js +1 -1
  83. package/dist/packem_chunks/sync2.js +1 -1
  84. package/dist/packem_chunks/tripwire.js +1 -1
  85. package/dist/packem_chunks/ts-loader.js +5 -5
  86. package/dist/packem_chunks/verify-lockfile.js +1 -1
  87. package/dist/packem_shared/Table-Bo1JKNCN-CGGet8ES.js +34 -0
  88. package/dist/packem_shared/{affected-selection-DDxwjwM4.js → affected-selection-CrW7fWEd.js} +1 -1
  89. package/dist/packem_shared/{affected-shas-BuaWvmsG.js → affected-shas-B_kfSKss.js} +1 -1
  90. package/dist/packem_shared/{ai-fix-C2BhFFhi.js → ai-fix-D9MxigBQ.js} +5 -5
  91. package/dist/packem_shared/{augment-CxUPE8KX.js → augment-B9kSZuvW.js} +1 -1
  92. package/dist/packem_shared/{bin-Be7_QhQK.js → bin-D3TtXgz6.js} +1 -1
  93. package/dist/packem_shared/{build-scripts-DxyVSkgM.js → build-scripts-CEDx_nJp.js} +1 -1
  94. package/dist/packem_shared/{command-runtime-BXvH5EC0.js → command-runtime-HSsYGCQd.js} +1 -1
  95. package/dist/packem_shared/{dart-pubspec-DvmyleIr.js → dart-pubspec-BK_cK2EP.js} +2 -2
  96. package/dist/packem_shared/{dependency-scan-DKK3ZEZI.js → dependency-scan-B8jroa1D.js} +1 -1
  97. package/dist/packem_shared/{docker-BTuwdXaC.js → docker-DXqV-07f.js} +1 -1
  98. package/dist/packem_shared/{ecosystem-gate-BpQNUJzN.js → ecosystem-gate-ByxWtzPE.js} +1 -1
  99. package/dist/packem_shared/{env-consistency-CUBJHENL.js → env-consistency-Dt_uDbSP.js} +1 -1
  100. package/dist/packem_shared/{failure-log-kp0n2rbD.js → failure-log-BP-gCUb5.js} +1 -1
  101. package/dist/packem_shared/{formatBytes-BHAzNIrn-DRcKvqnb.js → formatBytes-_HvjOy8a-B_qQr4Hw.js} +3 -3
  102. package/dist/packem_shared/{getRandomSpinner-4ZEcbTYv-DCyIuj19.js → getRandomSpinner-DX11qCB2-CoIsn7ZU.js} +1 -1
  103. package/dist/packem_shared/{index-DsSWb5XH.js → index-BKbMnn8K.js} +1 -1
  104. package/dist/packem_shared/index-BisalDCf.js +39 -0
  105. package/dist/packem_shared/{index-BdMIfGVZ.js → index-BzhrR_iC.js} +15 -15
  106. package/dist/packem_shared/{index-DQfNpt2u.js → index-DGdD4w-b.js} +1 -1
  107. package/dist/packem_shared/index.server-Ca_EEVfw.js +2 -0
  108. package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-BwaMhQs0.js → isAccessibleSync-DYKTrrvc-C-_5cgwu.js} +1 -1
  109. package/dist/packem_shared/{lifecycle-BAhkhE2L.js → lifecycle-DvmDIRbb.js} +1 -1
  110. package/dist/packem_shared/{lockfile-DHmlPGk1.js → lockfile-CiUtEbnt.js} +1 -1
  111. package/dist/packem_shared/{manifests-Dd4Hoztt.js → manifests-Du4yKlf_.js} +1 -1
  112. package/dist/packem_shared/{min-release-age-BJnOQaoF.js → min-release-age-JViyQuBM.js} +1 -1
  113. package/dist/packem_shared/{missing-package-json-DfzrGwe1.js → missing-package-json-Cu5YVAot.js} +1 -1
  114. package/dist/packem_shared/{multi-eco-lockfiles-BIa6xvJc.js → multi-eco-lockfiles-B2X3yhyo.js} +1 -1
  115. package/dist/packem_shared/{native-config-sync-Dr9XvxOf.js → native-config-sync-TdTWjVgI.js} +1 -1
  116. package/dist/packem_shared/osv-bloom-BCAX5ARR.js +2 -0
  117. package/dist/packem_shared/package-version-QFmE9anh.js +4 -0
  118. package/dist/packem_shared/{packument-C9nRiBJf.js → packument-zb18Jnlw.js} +1 -1
  119. package/dist/packem_shared/{pm-runner-ImwtpnWY.js → pm-runner-RM72mDZg.js} +1 -1
  120. package/dist/packem_shared/{project-name-filter-C2rkW-Vn.js → project-name-filter-DIqpdsvP.js} +1 -1
  121. package/dist/packem_shared/{provenance-DF-ypZj3.js → provenance-L1M2FPy_.js} +1 -1
  122. package/dist/packem_shared/{readJsonSync-CbryXYxN-Bm5i10UW.js → readJsonSync-CbryXYxN-EWl7_7KX.js} +1 -1
  123. package/dist/packem_shared/{registry-keys-BLuHOyZu.js → registry-keys-DxdqMzyp.js} +1 -1
  124. package/dist/packem_shared/{resolve-explicit-BDaQRR6o.js → resolve-explicit-CQa37JSq.js} +1 -1
  125. package/dist/packem_shared/{resolve-runtime-Cr19Pk6L.js → resolve-runtime-DNukUjIr.js} +1 -1
  126. package/dist/packem_shared/{run-file-XbRCF6Mp.js → run-file-UBukWaha.js} +1 -1
  127. package/dist/packem_shared/{runtime-check-Bh5q9IrT.js → runtime-check-1U8HrQd9.js} +1 -1
  128. package/dist/packem_shared/{s1ngularity-UCZN7skW.js → s1ngularity-CO5GkkqX.js} +1 -1
  129. package/dist/packem_shared/{scan-progress-DcYI76zE.js → scan-progress-RwCRxJdX.js} +1 -1
  130. package/dist/packem_shared/{selectors-DCiEU0iv.js → selectors-edwcgNl3.js} +2 -2
  131. package/dist/packem_shared/{signatures-CicxPHN4.js → signatures-DIqFUOfs.js} +1 -1
  132. package/dist/packem_shared/spinner-BJjbNl1F.js +1 -0
  133. package/dist/packem_shared/target-merge-DVJl-7Qz.js +4 -0
  134. package/dist/packem_shared/{target-options-PgWIuJnb.js → target-options-DsHFmRZH.js} +1 -1
  135. package/dist/packem_shared/{task-env-Dl08aklA.js → task-env-DzR4RkOj.js} +1 -1
  136. package/dist/packem_shared/{toolchain-DvUxlbDz.js → toolchain-Bz70UIcp.js} +1 -1
  137. package/dist/packem_shared/{typosquats-DxPzyK7u.js → typosquats-D4DEHhFy.js} +1 -1
  138. package/dist/packem_shared/{verify-CadR9PUk.js → verify-B_MblU_Q.js} +1 -1
  139. package/dist/packem_shared/{vis-update-app-DrFWQyPn.js → vis-update-app-9b2kSk9f.js} +1 -1
  140. package/dist/packem_shared/{vis-user-error-k7CLTpA4.js → vis-user-error-S0Fesz5y.js} +15 -15
  141. package/dist/packem_shared/{watch-Dr_6yz3o.js → watch-CcTketln.js} +1 -1
  142. package/dist/packem_shared/{watch-loop-BId9vT7Q.js → watch-loop-BEnGuMBn.js} +1 -1
  143. package/dist/packem_shared/{writeFileSync-DJoHk3Ks-Dhem3Uof.js → writeFileSync-DJoHk3Ks-BPRoepNw.js} +1 -1
  144. package/dist/runtime/preload.js +1 -1
  145. package/index.js +26 -26
  146. package/package.json +12 -12
  147. package/dist/packem_shared/index-C9ENZqH9.js +0 -39
  148. package/dist/packem_shared/index.server-D8BLnYZO.js +0 -2
  149. package/dist/packem_shared/osv-bloom-t40ra5U5.js +0 -2
  150. package/dist/packem_shared/package-version-CFuNUWDG.js +0 -4
  151. package/dist/packem_shared/spinner-ukDEdGvp.js +0 -1
  152. package/dist/packem_shared/target-merge-BClIXg2k.js +0 -14
@@ -0,0 +1,4 @@
1
+ import{createRequire as ct}from"node:module";import{k as be,m as ee,z as te,a as mt,g as Lt,f as gt}from"./index-BzhrR_iC.js";import{L as De}from"./index-BisalDCf.js";import{a as ie,g as St}from"./_commonjsHelpers-DTfxOvZk.js";import{r as vt,a as Ct}from"./clean-DRiLimTx.js";import{p as yt}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";let ht;const ut=u=>(ht??=ct(import.meta.url))(u),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=u=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[e,t]=F.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return F.getBuiltinModule(u)}return ut(u)},{dirname:pt}=R("node:path"),Pe=R("node:url"),{fileURLToPath:ft}=Pe,ye=R("node:module"),{createRequire:dt}=ye,Pt=R("util"),Di=u=>"Bun"in u,Ai=()=>process.argv,wi=()=>process.cwd(),xi=()=>process.env,Ei=()=>process.execArgv,Oi=()=>process.execPath,Ni=()=>process.platform,Fi=()=>process.arch,Gi=(u=0)=>{process.exit(u)},$i=(u,e)=>{const t=process;return t.on(u,e),()=>{t.removeListener(u,e)}};var T,ne;function Ae(){return ne||(ne=1,T=["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"]),T}var U,se;function bt(){return se||(se=1,U=["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"]),U}var M,oe;function Dt(){return oe||(oe=1,M=["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"]),M}var k,ae;function At(){if(ae)return k;ae=1;var u=[].concat(Ae()).concat(bt()),e=Dt();return k=function(t){var n=0;function s(){return n<t.length}function r(g){if(g instanceof RegExp){var c=t.slice(n),L=c.match(g);if(L)return n+=L[0].length,L[0]}else if(t.indexOf(g,n)===n)return n+=g.length,g}function a(){r(/[ ]*/)}function l(){for(var g,c=["WITH","AND","OR","(",")",":","+"],L=0;L<c.length&&(g=r(c[L]),!g);L++);if(g==="+"&&n>1&&t[n-2]===" ")throw new Error("Space before `+`");return g&&{type:"OPERATOR",string:g}}function o(){return r(/[A-Za-z0-9-.]+/)}function h(){var g=o();if(!g)throw new Error("Expected idstring at offset "+n);return g}function f(){if(r("DocumentRef-")){var g=h();return{type:"DOCUMENTREF",string:g}}}function S(){if(r("LicenseRef-")){var g=h();return{type:"LICENSEREF",string:g}}}function b(){var g=n,c=o();if(u.indexOf(c)!==-1)return{type:"LICENSE",string:c};if(e.indexOf(c)!==-1)return{type:"EXCEPTION",string:c};n=g}function v(){return l()||f()||S()||b()}for(var C=[];s()&&(a(),!!s());){var m=v();if(!m)throw new Error("Unexpected `"+t[n]+"` at offset "+n);C.push(m)}return C},k}var _,le;function wt(){return le||(le=1,_=function(u){var e=0;function t(){return e<u.length}function n(){return t()?u[e]:null}function s(){if(!t())throw new Error;e++}function r(m){var g=n();if(g&&g.type==="OPERATOR"&&m===g.string)return s(),g.string}function a(){if(r("WITH")){var m=n();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function l(){var m=e,g="",c=n();if(c.type==="DOCUMENTREF"&&(s(),g+="DocumentRef-"+c.string+":",!r(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(c=n(),c.type==="LICENSEREF")return s(),g+="LicenseRef-"+c.string,{license:g};e=m}function o(){var m=n();if(m&&m.type==="LICENSE"){s();var g={license:m.string};r("+")&&(g.plus=!0);var c=a();return c&&(g.exception=c),g}}function h(){var m=r("(");if(m){var g=v();if(!r(")"))throw new Error("Expected `)`");return g}}function f(){return h()||l()||o()}function S(m,g){return function c(){var L=g();if(L){if(!r(m))return L;var y=c();if(!y)throw new Error("Expected expression");return{left:L,conjunction:m.toLowerCase(),right:y}}}}var b=S("AND",f),v=S("OR",b),C=v();if(!C||t())throw new Error("Syntax error");return C}),_}var W,ce;function we(){if(ce)return W;ce=1;var u=At(),e=wt();return W=function(t){return e(u(t))},W}var H,he;function xt(){if(he)return H;he=1;var u=we(),e=Ae();function t(c){try{return u(c),!0}catch{return!1}}function n(c,L){var y=L[0].length-c[0].length;return y!==0?y:c[0].toUpperCase().localeCompare(L[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(n),r=0,a=1,l=[function(c){return c.toUpperCase()},function(c){return c.trim()},function(c){return c.replace(/\./g,"")},function(c){return c.replace(/\s+/g,"")},function(c){return c.replace(/\s+/g,"-")},function(c){return c.replace("v","-")},function(c){return c.replace(/,?\s*(\d)/,"-$1")},function(c){return c.replace(/,?\s*(\d)/,"-$1.0")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(c){return c[0].toUpperCase()+c.slice(1)},function(c){return c.replace("/","-")},function(c){return c.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(c){return c.indexOf("3.0")!==-1?c+"-or-later":c+"-only"},function(c){return c+"only"},function(c){return c.replace(/(\d)$/,"-$1.0")},function(c){return c.replace(/(-| )?(\d)$/,"-$2-Clause")},function(c){return c.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(c){return c.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(c){return c.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(c){return c.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(c){return c.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(c){return c.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(c){return"CC-"+c},function(c){return"CC-"+c+"-4.0"},function(c){return c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(c){return"CC-"+c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],o=e.map(function(c){var L=/^(.*)-\d+\.\d+$/.exec(c);return L?[L[0],L[1]]:[c,null]}).reduce(function(c,L){var y=L[1];return c[y]=c[y]||[],c[y].push(L[0]),c},{}),h=Object.keys(o).map(function(L){return[L,o[L]]}).filter(function(L){return L[1].length===1&&L[0]!==null&&L[0]!=="APL"}).map(function(L){return[L[0],L[1][0]]});o=void 0;var f=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(h).sort(n),S=0,b=1,v=function(c){for(var L=0;L<l.length;L++){var y=l[L](c).trim();if(y!==c&&t(y))return y}return null},C=function(c){for(var L=c.toUpperCase(),y=0;y<f.length;y++){var i=f[y];if(L.indexOf(i[S])>-1)return i[b]}return null},m=function(c,L){for(var y=0;y<s.length;y++){var i=s[y],p=i[r];if(c.indexOf(p)>-1){var d=c.replace(p,i[a]),P=L(d);if(P!==null)return P}}return null};H=function(c,L){L=L||{};var y=L.upgrade===void 0?!0:!!L.upgrade;function i(D){return y?g(D):D}var p=typeof c=="string"&&c.trim().length!==0;if(!p)throw Error("Invalid argument. Expected non-empty string.");if(c=c.trim(),t(c))return i(c);var d=c.replace(/\+$/,"").trim();if(t(d))return i(d);var P=v(c);return P!==null||(P=m(c,function(D){return t(D)?D:v(D)}),P!==null)||(P=C(c),P!==null)||(P=m(c,C),P!==null)?i(P):null};function g(c){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(c)!==-1?c+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(c)!==-1?c.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(c)!==-1?c+"-or-later":c}return H}var j,ue;function Et(){if(ue)return j;ue=1;var u=we(),e=xt(),t='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',n=/^SEE LICEN[CS]E IN (.+)$/;function s(a,l){return l.slice(0,a.length)===a}function r(a){if(a.hasOwnProperty("license")){var l=a.license;return s("LicenseRef",l)||s("DocumentRef",l)}else return r(a.left)||r(a.right)}return j=function(a){var l;try{l=u(a)}catch{var o;if(a==="UNLICENSED"||a==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(o=n.exec(a))return{validForOldPackages:!0,validForNewPackages:!0,inFile:o[1]};var h={validForOldPackages:!1,validForNewPackages:!1,warnings:[t]};if(a.trim().length!==0){var f=e(a);f&&h.warnings.push('license is similar to the valid expression "'+f+'"')}return h}return r(l)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[t]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},j}var xe={hasSubscribers:!1},A=xe,N=xe;import("node:diagnostics_channel").then(u=>{A=u.channel("lru-cache:metrics"),N=u.tracingChannel("lru-cache")}).catch(()=>{});var Ot=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,z=()=>A.hasSubscribers||N.hasSubscribers,Ee=new Set,pe=process||{},Nt=(u,e,t,n)=>{typeof pe.emitWarning=="function"?pe.emitWarning(u,e,t,n):console.error(`[${t}] ${e}: ${u}`)},Ft=u=>!Ee.has(u),O=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),Oe=u=>O(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?B:null:null,B=class extends Array{constructor(e){super(e),this.fill(0)}},Gt=class ${heap;length;static#n=!1;static create(e){let t=Oe(e);if(!t)return[];$.#n=!0;let n=new $(e,t);return $.#n=!1,n}constructor(e,t){if(!$.#n)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},$t=class Ne{#n;#c;#t;#O;#g;#R;#I;#S;get perf(){return this.#S}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#o;#v;#s;#r;#e;#u;#f;#h;#a;#C;#l;#P;#y;#d;#m;#b;#T;#p;#N;static unsafeExposeInternals(e){return{starts:e.#y,ttls:e.#d,autopurgeTimers:e.#m,sizes:e.#P,keyMap:e.#s,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#f,get head(){return e.#h},get tail(){return e.#a},free:e.#C,isBackgroundFetch:t=>e.#i(t),backgroundFetch:(t,n,s,r)=>e.#k(t,n,s,r),moveToTail:t=>e.#B(t),indexes:t=>e.#D(t),rindexes:t=>e.#A(t),isStale:t=>e.#L(t)}}get max(){return this.#n}get maxSize(){return this.#c}get calculatedSize(){return this.#v}get size(){return this.#o}get fetchMethod(){return this.#R}get memoMethod(){return this.#I}get dispose(){return this.#t}get onInsert(){return this.#O}get disposeAfter(){return this.#g}constructor(e){let{max:t=0,ttl:n,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:o,dispose:h,onInsert:f,disposeAfter:S,noDisposeOnSet:b,noUpdateTTL:v,maxSize:C=0,maxEntrySize:m=0,sizeCalculation:g,fetchMethod:c,memoMethod:L,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:i,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:d,ignoreFetchAbort:P,backgroundFetchSize:D=1,perf:w}=e;if(this.backgroundFetchSize=D,w!==void 0&&typeof w?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#S=w??Ot,t!==0&&!O(t))throw new TypeError("max option must be a nonnegative integer");let x=t?Oe(t):Array;if(!x)throw new Error("invalid max value: "+t);if(this.#n=t,this.#c=C,this.maxEntrySize=m||this.#c,this.sizeCalculation=g,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(L!==void 0&&typeof L!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=L,c!==void 0&&typeof c!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=c,this.#T=!!c,this.#s=new Map,this.#r=Array.from({length:t}).fill(void 0),this.#e=Array.from({length:t}).fill(void 0),this.#u=new x(t),this.#f=new x(t),this.#h=0,this.#a=0,this.#C=Gt.create(t),this.#o=0,this.#v=0,typeof h=="function"&&(this.#t=h),typeof f=="function"&&(this.#O=f),typeof S=="function"?(this.#g=S,this.#l=[]):(this.#g=void 0,this.#l=void 0),this.#b=!!this.#t,this.#N=!!this.#O,this.#p=!!this.#g,this.noDisposeOnSet=!!b,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#c!==0&&!O(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!O(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!i,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=O(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!O(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#_()}if(this.#n===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#c){let I="LRU_CACHE_UNBOUNDED";Ft(I)&&(Ee.add(I),Nt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",I,Ne))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#_(){let e=new B(this.#n),t=new B(this.#n);this.#d=e,this.#y=t;let n=this.ttlAutopurge?Array.from({length:this.#n}):void 0;this.#m=n,this.#W=(o,h,f=this.#S.now())=>{t[o]=h!==0?f:0,e[o]=h,s(o,h)},this.#F=o=>{t[o]=e[o]!==0?this.#S.now():0,s(o,e[o])};let s=this.ttlAutopurge?(o,h)=>{if(n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),h&&h!==0&&n){let f=setTimeout(()=>{this.#L(o)?(this.#w(this.#r[o],"expire"),n[o]=void 0):s(o,l(o))},h+1);f.unref&&f.unref(),n[o]=f}}:()=>{};this.#x=(o,h)=>{if(e[h]){let f=e[h],S=t[h];if(!f||!S)return;o.ttl=f,o.start=S,o.now=r||a();let b=o.now-S;o.remainingTTL=f-b}};let r=0,a=()=>{let o=this.#S.now();if(this.ttlResolution>0){r=o;let h=setTimeout(()=>r=0,this.ttlResolution);h.unref&&h.unref()}return o};this.getRemainingTTL=o=>{let h=this.#s.get(o);return h===void 0?0:l(h)};let l=o=>{let h=e[o],f=t[o];if(!h||!f)return 1/0;let S=(r||a())-f;return h-S};this.#L=o=>{let h=t[o],f=e[o];return!!f&&!!h&&(r||a())-h>f}}#F=()=>{};#x=()=>{};#W=()=>{};#L=()=>!1;#V(){let e=new B(this.#n);this.#v=0,this.#P=e,this.#G=t=>{this.#v-=e[t],e[t]=0},this.#H=(t,n,s,r)=>{if(!O(s)){if(this.#i(n))return this.backgroundFetchSize;if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(n,t),!O(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#U=(t,n,s)=>{if(e[t]=n,this.#c){let r=this.#c-e[t];for(;this.#v>r;)this.#M(!0)}this.#v+=e[t],s&&(s.entrySize=n,s.totalCalculatedSize=this.#v)}}#G=e=>{};#U=(e,t,n)=>{};#H=(e,t,n,s)=>{if(n||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.#j(t)&&((e||!this.#L(t))&&(yield t),t!==this.#h);)t=this.#f[t]}*#A({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#h;this.#j(t)&&((e||!this.#L(t))&&(yield t),t!==this.#a);)t=this.#u[t]}#j(e){return e!==void 0&&this.#s.get(this.#r[e])===e}*entries(){for(let e of this.#D())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#A())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.#A()){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.#A())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 n of this.#D()){let s=this.#e[n],r=this.#i(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#r[n],this))return this.#$(this.#r[n],t)}}forEach(e,t=this){for(let n of this.#D()){let s=this.#e[n],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[n],this)}}rforEach(e,t=this){for(let n of this.#A()){let s=this.#e[n],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[n],this)}}purgeStale(){let e=!1;for(let t of this.#A({allowStale:!0}))this.#L(t)&&(this.#w(this.#r[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let n=this.#e[t],s=this.#i(n)?n.__staleWhileFetching:n;if(s===void 0)return;let r={value:s};if(this.#d&&this.#y){let a=this.#d[t],l=this.#y[t];if(a&&l){let o=a-(this.#S.now()-l);r.ttl=o,r.start=Date.now()}}return this.#P&&(r.size=this.#P[t]),r}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let n=this.#r[t],s=this.#e[t],r=this.#i(s)?s.__staleWhileFetching:s;if(r===void 0||n===void 0)continue;let a={value:r};if(this.#d&&this.#y){a.ttl=this.#d[t];let l=this.#S.now()-this.#y[t];a.start=Math.floor(Date.now()-l)}this.#P&&(a.size=this.#P[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let s=Date.now()-n.start;n.start=this.#S.now()-s}this.#E(t,n.value,n)}}set(e,t,n={}){let{status:s=A.hasSubscribers?{}:void 0}=n;n.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let r=this.#E(e,t,n);return s&&A.hasSubscribers&&A.publish(s),r}#E(e,t,n,s){let{ttl:r=this.ttl,start:a,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:h}=n,f=this.#i(t);if(t===void 0)return h&&(h.set="deleted"),this.delete(e),this;let{noUpdateTTL:S=this.noUpdateTTL}=n;h&&!f&&(h.value=t);let b=this.#H(e,t,n.size||0,o,h);if(this.maxEntrySize&&b>this.maxEntrySize)return this.#w(e,"set"),h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this;let v=this.#o===0?void 0:this.#s.get(e);if(v===void 0)v=this.#o===0?this.#a:this.#C.length!==0?this.#C.pop():this.#o===this.#n?this.#M(!1):this.#o,this.#r[v]=e,this.#e[v]=t,this.#s.set(e,v),this.#u[this.#a]=v,this.#f[v]=this.#a,this.#a=v,this.#o++,this.#U(v,b,h),h&&(h.set="add"),S=!1,this.#N&&!f&&this.#O?.(t,e,"add");else{this.#B(v);let C=this.#e[v];if(t!==C){if(!l)if(this.#i(C)){C!==s&&C.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=C;m!==void 0&&m!==t&&(this.#b&&this.#t?.(m,e,"set"),this.#p&&this.#l?.push([m,e,"set"]))}else this.#b&&this.#t?.(C,e,"set"),this.#p&&this.#l?.push([C,e,"set"]);if(this.#G(v),this.#U(v,b,h),this.#e[v]=t,!f){let m=C&&this.#i(C)?C.__staleWhileFetching:C,g=m===void 0?"add":t!==m?"replace":"update";h&&(h.set=g,m!==void 0&&(h.oldValue=m)),this.#N&&this.onInsert?.(t,e,g)}}else f||(h&&(h.set="update"),this.#N&&this.onInsert?.(t,e,"update"))}if(r!==0&&!this.#d&&this.#_(),this.#d&&(S||this.#W(v,r,a),h&&this.#x(h,v)),!l&&this.#p&&this.#l){let C=this.#l,m;for(;m=C?.shift();)this.#g?.(...m)}return this}pop(){try{for(;this.#o;){let e=this.#e[this.#h];if(this.#M(!0),this.#i(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#l){let e=this.#l,t;for(;t=e?.shift();)this.#g?.(...t)}}}#M(e){let t=this.#h,n=this.#r[t],s=this.#e[t],r=this.#i(s);r&&s.__abortController.abort(new Error("evicted"));let a=r?s.__staleWhileFetching:s;return(this.#b||this.#p)&&a!==void 0&&(this.#b&&this.#t?.(a,n,"evict"),this.#p&&this.#l?.push([a,n,"evict"])),this.#G(t),this.#m?.[t]&&(clearTimeout(this.#m[t]),this.#m[t]=void 0),e&&(this.#r[t]=void 0,this.#e[t]=void 0,this.#C.push(t)),this.#o===1?(this.#h=this.#a=0,this.#C.length=0):this.#h=this.#u[t],this.#s.delete(n),this.#o--,t}has(e,t={}){let{status:n=A.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let s=this.#K(e,t);return A.hasSubscribers&&A.publish(n),s}#K(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=t,r=this.#s.get(e);if(r!==void 0){let a=this.#e[r];if(this.#i(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#L(r))s&&(s.has="stale",this.#x(s,r));else return n&&this.#F(r),s&&(s.has="hit",this.#x(s,r)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:n=z()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let s=this.#X(e,t);return A.hasSubscribers&&A.publish(n),s}#X(e,t){let{status:n,allowStale:s=this.allowStale}=t,r=this.#s.get(e);if(r===void 0||!s&&this.#L(r)){n&&(n.peek=r===void 0?"miss":"stale");return}let a=this.#e[r],l=this.#i(a)?a.__staleWhileFetching:a;return n&&(l!==void 0?(n.peek="hit",n.value=l):n.peek="miss"),l}#k(e,t,n,s){let r=t===void 0?void 0:this.#e[t];if(this.#i(r))return r;let a=new AbortController,{signal:l}=n;l?.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let o={signal:a.signal,options:n,context:s},h=(m,g=!1)=>{let{aborted:c}=a.signal,L=n.ignoreFetchAbort&&m!==void 0,y=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(c&&!g?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,L&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),c&&!L&&!g)return S(a.signal.reason,y);let i=v,p=this.#e[t];return(p===v||p===void 0&&L&&g)&&(m===void 0?i.__staleWhileFetching!==void 0?this.#e[t]=i.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#E(e,m,o.options,i))),m},f=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),S(m,!1)),S=(m,g)=>{let{aborted:c}=a.signal,L=c&&n.allowStaleOnFetchAbort,y=L||n.allowStaleOnFetchRejection,i=y||n.noDeleteOnFetchRejection,p=v;if(this.#e[t]===v&&(!i||!g&&p.__staleWhileFetching===void 0?this.#w(e,"fetch"):L||(this.#e[t]=p.__staleWhileFetching)),y)return n.status&&p.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw m},b=(m,g)=>{let c=this.#R?.(e,r,o);a.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=L=>h(L,!0)))}),c&&c instanceof Promise?c.then(L=>m(L===void 0?void 0:L),g):c!==void 0&&m(c)};n.status&&(n.status.fetchDispatched=!0);let v=new Promise(b).then(h,f),C=Object.assign(v,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.#E(e,C,{...o.options,status:void 0}),t=this.#s.get(e)):this.#e[t]=C,C}#i(e){if(!this.#T)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=N.hasSubscribers,{status:s=z()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#z(e,t);return s&&n&&(s.trace=!0,N.tracePromise(()=>r,s).catch(()=>{})),r}async#z(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:o=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:C=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:c,signal:L}=t;if(c&&(c.op="fetch",c.key=e,g&&(c.forceRefresh=!0),c.cache=this),!this.#T)return c&&(c.fetch="get"),this.#$(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:c});let y={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:l,size:o,sizeCalculation:h,noUpdateTTL:f,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:C,ignoreFetchAbort:v,status:c,signal:L},i=this.#s.get(e);if(i===void 0){c&&(c.fetch="miss");let p=this.#k(e,i,y,m);return p.__returned=p}else{let p=this.#e[i];if(this.#i(p)){let w=n&&p.__staleWhileFetching!==void 0;return c&&(c.fetch="inflight",w&&(c.returnedStale=!0)),w?p.__staleWhileFetching:p.__returned=p}let d=this.#L(i);if(!g&&!d)return c&&(c.fetch="hit"),this.#B(i),s&&this.#F(i),c&&this.#x(c,i),p;let P=this.#k(e,i,y,m),D=P.__staleWhileFetching!==void 0&&n;return c&&(c.fetch=d?"stale":"refresh",D&&d&&(c.returnedStale=!0)),D?P.__staleWhileFetching:P.__returned=P}}forceFetch(e,t={}){let n=N.hasSubscribers,{status:s=z()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#J(e,t);return s&&n&&(s.trace=!0,N.tracePromise(()=>r,s).catch(()=>{})),r}async#J(e,t={}){let n=await this.#z(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=A.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let s=this.#Z(e,t);return n&&(n.value=s),A.hasSubscribers&&A.publish(n),s}#Z(e,t={}){let n=this.#I;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,status:r,forceRefresh:a,...l}=t;r&&a&&(r.forceRefresh=!0);let o=this.#$(e,l),h=a||o===void 0;if(r&&(r.memo=h?"miss":"hit",h||(r.value=o)),!h)return o;let f=n(e,o,{options:l,context:s});return r&&(r.value=f),this.#E(e,f,l),f}get(e,t={}){let{status:n=A.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let s=this.#$(e,t);return n&&(s!==void 0&&(n.value=s),A.hasSubscribers&&A.publish(n)),s}#$(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=t,l=this.#s.get(e);if(l===void 0){a&&(a.get="miss");return}let o=this.#e[l],h=this.#i(o);return a&&this.#x(a,l),this.#L(l)?h?(a&&(a.get="stale-fetching"),n&&o.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),o.__staleWhileFetching):void 0):(r||this.#w(e,"expire"),a&&(a.get="stale"),n?(a&&(a.returnedStale=!0),o):void 0):(a&&(a.get=h?"fetching":"hit"),this.#B(l),s&&this.#F(l),h?o.__staleWhileFetching:o)}#Y(e,t){this.#f[t]=e,this.#u[e]=t}#B(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.#w(e,"delete")}#w(e,t){A.hasSubscribers&&A.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#o!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#m?.[s]&&(clearTimeout(this.#m[s]),this.#m[s]=void 0),n=!0,this.#o===1)this.#q(t);else{this.#G(s);let r=this.#e[s];if(this.#i(r)?r.__abortController.abort(new Error("deleted")):(this.#b||this.#p)&&(this.#b&&this.#t?.(r,e,t),this.#p&&this.#l?.push([r,e,t])),this.#s.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 a=this.#f[s];this.#u[a]=this.#u[s];let l=this.#u[s];this.#f[l]=this.#f[s]}this.#o--,this.#C.push(s)}}if(this.#p&&this.#l?.length){let s=this.#l,r;for(;r=s?.shift();)this.#g?.(...r)}return n}clear(){return this.#q("delete")}#q(e){for(let t of this.#A({allowStale:!0})){let n=this.#e[t];if(this.#i(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#r[t];this.#b&&this.#t?.(n,s,e),this.#p&&this.#l?.push([n,s,e])}}if(this.#s.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#y){this.#d.fill(0),this.#y.fill(0);for(let t of this.#m??[])t!==void 0&&clearTimeout(t);this.#m?.fill(void 0)}if(this.#P&&this.#P.fill(0),this.#h=0,this.#a=0,this.#C.length=0,this.#v=0,this.#o=0,this.#p&&this.#l){let t=this.#l,n;for(;n=t?.shift();)this.#g?.(...n)}}};const Bt=Object.defineProperty({__proto__:null,LRUCache:$t},Symbol.toStringTag,{value:"Module"}),Rt=ie(Bt);var Y,fe;function It(){if(fe)return Y;fe=1;const u=(...r)=>r.every(a=>a)?r.join(""):"",e=r=>r?encodeURIComponent(r):"",t=r=>r.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),n={sshtemplate:({domain:r,user:a,project:l,committish:o})=>`git@${r}:${a}/${l}.git${u("#",o)}`,sshurltemplate:({domain:r,user:a,project:l,committish:o})=>`git+ssh://git@${r}/${a}/${l}.git${u("#",o)}`,edittemplate:({domain:r,user:a,project:l,committish:o,editpath:h,path:f})=>`https://${r}/${a}/${l}${u("/",h,"/",e(o||"HEAD"),"/",f)}`,browsetemplate:({domain:r,user:a,project:l,committish:o,treepath:h})=>`https://${r}/${a}/${l}${u("/",h,"/",e(o))}`,browsetreetemplate:({domain:r,user:a,project:l,committish:o,treepath:h,path:f,fragment:S,hashformat:b})=>`https://${r}/${a}/${l}/${h}/${e(o||"HEAD")}/${f}${u("#",b(S||""))}`,browseblobtemplate:({domain:r,user:a,project:l,committish:o,blobpath:h,path:f,fragment:S,hashformat:b})=>`https://${r}/${a}/${l}/${h}/${e(o||"HEAD")}/${f}${u("#",b(S||""))}`,docstemplate:({domain:r,user:a,project:l,treepath:o,committish:h})=>`https://${r}/${a}/${l}${u("/",o,"/",e(h))}#readme`,httpstemplate:({auth:r,domain:a,user:l,project:o,committish:h})=>`git+https://${u(r,"@")}${a}/${l}/${o}.git${u("#",h)}`,filetemplate:({domain:r,user:a,project:l,committish:o,path:h})=>`https://${r}/${a}/${l}/raw/${e(o||"HEAD")}/${h}`,shortcuttemplate:({type:r,user:a,project:l,committish:o})=>`${r}:${a}/${l}${u("#",o)}`,pathtemplate:({user:r,project:a,committish:l})=>`${r}/${a}${u("#",l)}`,bugstemplate:({domain:r,user:a,project:l})=>`https://${r}/${a}/${l}/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:a,project:l,committish:o,path:h})=>`https://${u(r,"@")}raw.githubusercontent.com/${a}/${l}/${e(o||"HEAD")}/${h}`,gittemplate:({auth:r,domain:a,user:l,project:o,committish:h})=>`git://${u(r,"@")}${a}/${l}/${o}.git${u("#",h)}`,tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://codeload.${r}/${a}/${l}/tar.gz/${e(o||"HEAD")}`,extract:r=>{let[,a,l,o,h]=r.pathname.split("/",5);if(!(o&&o!=="tree")&&(o||(h=r.hash.slice(1)),l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!a||!l)))return{user:a,project:l,committish:h}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:r,user:a,project:l,committish:o,treepath:h,path:f,editpath:S})=>`https://${r}/${a}/${l}${u("/",h,"/",e(o||"HEAD"),"/",f,S)}`,tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/${a}/${l}/get/${e(o||"HEAD")}.tar.gz`,extract:r=>{let[,a,l,o]=r.pathname.split("/",4);if(!["get"].includes(o)&&(l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!a||!l)))return{user:a,project:l,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:a,project:l,committish:o})=>`https://${r}/api/v4/projects/${e(a+"/"+l)}/repository/archive.tar.gz?sha=${e(o||"HEAD")}`,extract:r=>{const a=r.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;const l=a.split("/");let o=l.pop();o.endsWith(".git")&&(o=o.slice(0,-4));const h=l.join("/");if(!(!h||!o))return{user:h,project:o,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:a,committish:l})=>`git@${r}:${a}.git${u("#",l)}`,sshurltemplate:({domain:r,project:a,committish:l})=>`git+ssh://git@${r}/${a}.git${u("#",l)}`,edittemplate:({domain:r,user:a,project:l,committish:o,editpath:h})=>`https://${r}/${a}/${l}${u("/",e(o))}/${h}`,browsetemplate:({domain:r,project:a,committish:l})=>`https://${r}/${a}${u("/",e(l))}`,browsetreetemplate:({domain:r,project:a,committish:l,path:o,hashformat:h})=>`https://${r}/${a}${u("/",e(l))}${u("#",h(o))}`,browseblobtemplate:({domain:r,project:a,committish:l,path:o,hashformat:h})=>`https://${r}/${a}${u("/",e(l))}${u("#",h(o))}`,docstemplate:({domain:r,project:a,committish:l})=>`https://${r}/${a}${u("/",e(l))}`,httpstemplate:({domain:r,project:a,committish:l})=>`git+https://${r}/${a}.git${u("#",l)}`,filetemplate:({user:r,project:a,committish:l,path:o})=>`https://gist.githubusercontent.com/${r}/${a}/raw${u("/",e(l))}/${o}`,shortcuttemplate:({type:r,project:a,committish:l})=>`${r}:${a}${u("#",l)}`,pathtemplate:({project:r,committish:a})=>`${r}${u("#",a)}`,bugstemplate:({domain:r,project:a})=>`https://${r}/${a}`,gittemplate:({domain:r,project:a,committish:l})=>`git://${r}/${a}.git${u("#",l)}`,tarballtemplate:({project:r,committish:a})=>`https://codeload.github.com/gist/${r}/tar.gz/${e(a||"HEAD")}`,extract:r=>{let[,a,l,o]=r.pathname.split("/",4);if(o!=="raw"){if(!l){if(!a)return;l=a,a=null}return l.endsWith(".git")&&(l=l.slice(0,-4)),{user:a,project:l,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:a,project:l,committish:o,path:h})=>`https://${r}/${a}/${l}/blob/${e(o)||"HEAD"}/${h}`,httpstemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/${a}/${l}${u("#",o)}`,tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/${a}/${l}/archive/${e(o)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:r=>{let[,a,l,o]=r.pathname.split("/",4);if(!["archive"].includes(o)&&(l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!a||!l)))return{user:a,project:l,committish:r.hash.slice(1)}}};for(const[r,a]of Object.entries(s))s[r]=Object.assign({},n,a);return Y=s,Y}var q,de;function Fe(){if(de)return q;de=1;const u=(s,r,a)=>{const l=s.indexOf(a);return s.lastIndexOf(r,l>-1?l:1/0)},e=s=>{try{return new URL(s)}catch{}},t=(s,r)=>{const a=s.indexOf(":"),l=s.slice(0,a+1);if(Object.prototype.hasOwnProperty.call(r,l)||s.substr(a,3)==="://")return s;const o=s.indexOf("@");return o>-1?o>a?`git+ssh://${s}`:s:`${s.slice(0,a+1)}//${s.slice(a+1)}`},n=s=>{const r=u(s,"@","#"),a=u(s,":","#");return a>r&&(s=s.slice(0,a)+"/"+s.slice(a+1)),u(s,":","#")===-1&&s.indexOf("//")===-1&&(s=`git+ssh://${s}`),s};return q=(s,r)=>{const a=r?t(s,r):s;return e(a)||e(n(a))},q}var V,me;function Tt(){if(me)return V;me=1;const u=Fe(),e=t=>{const n=t.indexOf("#"),s=t.indexOf("/"),r=t.indexOf("/",s+1),a=t.indexOf(":"),l=/\s/.exec(t),o=t.indexOf("@"),h=!l||n>-1&&l.index>n,f=o===-1||n>-1&&o>n,S=a===-1||n>-1&&a>n,b=r===-1||n>-1&&r>n,v=s>0,C=n>-1?t[n-1]!=="/":!t.endsWith("/"),m=!t.startsWith(".");return h&&v&&C&&m&&f&&S&&b};return V=(t,n,{gitHosts:s,protocols:r})=>{if(!t)return;const a=e(t)?`github:${t}`:t,l=u(a,r);if(!l)return;const o=s.byShortcut[l.protocol],h=s.byDomain[l.hostname.startsWith("www.")?l.hostname.slice(4):l.hostname],f=o||h;if(!f)return;const S=s[o||h];let b=null;r[l.protocol]?.auth&&(l.username||l.password)&&(b=`${l.username}${l.password?":"+l.password:""}`);let v=null,C=null,m=null,g=null;try{if(o){let c=l.pathname.startsWith("/")?l.pathname.slice(1):l.pathname;const L=c.indexOf("@");L>-1&&(c=c.slice(L+1));const y=c.lastIndexOf("/");y>-1?(C=decodeURIComponent(c.slice(0,y)),C||(C=null),m=decodeURIComponent(c.slice(y+1))):m=decodeURIComponent(c),m.endsWith(".git")&&(m=m.slice(0,-4)),l.hash&&(v=decodeURIComponent(l.hash.slice(1))),g="shortcut"}else{if(!S.protocols.includes(l.protocol))return;const c=S.extract(l);if(!c)return;C=c.user&&decodeURIComponent(c.user),m=decodeURIComponent(c.project),v=decodeURIComponent(c.committish),g=r[l.protocol]?.name||l.protocol.slice(0,-1)}}catch(c){if(c instanceof URIError)return;throw c}return[f,C,b,m,v,g,n]},V}var K,Le;function Ut(){if(Le)return K;Le=1;const{LRUCache:u}=Rt,e=It(),t=Tt(),n=Fe(),s=new u({max:1e3});function r(l){try{const{protocol:o,hostname:h,pathname:f}=new URL(l);if(!h)return null;const S=/(?:git\+)http:$/.test(o)?"http:":"https:",b=f.replace(/\.git$/,"");return`${S}//${h}${b}`}catch{return null}}class a{constructor(o,h,f,S,b,v,C={}){Object.assign(this,a.#n[o],{type:o,user:h,auth:f,project:S,committish:b,default:v,opts:C})}static#n={byShortcut:{},byDomain:{}};static#c={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(o,h){a.#n[o]=h,a.#n.byDomain[h.domain]=o,a.#n.byShortcut[`${o}:`]=o,a.#c[`${o}:`]={name:o}}static fromUrl(o,h){if(typeof o!="string")return;const f=o+JSON.stringify(h||{});if(!s.has(f)){const S=t(o,h,{gitHosts:a.#n,protocols:a.#c});s.set(f,S?new a(...S):void 0)}return s.get(f)}static fromManifest(o,h={}){if(!o||typeof o!="object")return;const f=o.repository,S=f&&(typeof f=="string"?f:typeof f=="object"&&typeof f.url=="string"?f.url:null);if(!S)throw new Error("no repository");const b=S&&a.fromUrl(S.replace(/^git\+/,""),h)||null;if(b)return b;const v=r(S);return a.fromUrl(v,h)||v}static parseUrl(o){return n(o)}#t(o,h){if(typeof o!="function")return null;const f={...this,...this.opts,...h};f.path||(f.path=""),f.path.startsWith("/")&&(f.path=f.path.slice(1)),f.noCommittish&&(f.committish=null);const S=o(f);return f.noGitPlus&&S.startsWith("git+")?S.slice(4):S}hash(){return this.committish?`#${this.committish}`:""}ssh(o){return this.#t(this.sshtemplate,o)}sshurl(o){return this.#t(this.sshurltemplate,o)}browse(o,...h){return typeof o!="string"?this.#t(this.browsetemplate,o):typeof h[0]!="string"?this.#t(this.browsetreetemplate,{...h[0],path:o}):this.#t(this.browsetreetemplate,{...h[1],fragment:h[0],path:o})}browseFile(o,...h){return typeof h[0]!="string"?this.#t(this.browseblobtemplate,{...h[0],path:o}):this.#t(this.browseblobtemplate,{...h[1],fragment:h[0],path:o})}docs(o){return this.#t(this.docstemplate,o)}bugs(o){return this.#t(this.bugstemplate,o)}https(o){return this.#t(this.httpstemplate,o)}git(o){return this.#t(this.gittemplate,o)}shortcut(o){return this.#t(this.shortcuttemplate,o)}path(o){return this.#t(this.pathtemplate,o)}tarball(o){return this.#t(this.tarballtemplate,{...o,noCommittish:!1})}file(o,h){return this.#t(this.filetemplate,{...h,path:o})}edit(o,h){return this.#t(this.edittemplate,{...h,path:o})}getDefaultRepresentation(){return this.default}toString(o){return this.default&&typeof this[this.default]=="function"?this[this.default](o):this.sshurl(o)}}for(const[l,o]of Object.entries(e))a.addHost(l,o);return K=a,K}var X,ge;function Mt(){if(ge)return X;ge=1,X=u;function u(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 n=e.length;let s=t+1;for(;s<n&&e[s].trim();)s++;return e.slice(t,s).join(" ").trim()}return X}var Ge={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"},$e={web:"url",name:"url"},Be={server:"start",tests:"test"};const kt={topLevel:Ge,bugs:$e,script:Be},_t=Object.defineProperty({__proto__:null,bugs:$e,default:kt,script:Be,topLevel:Ge},Symbol.toStringTag,{value:"Module"}),Wt=ie(_t);var J,Se;function Ht(){if(Se)return J;Se=1;var{URL:u}=Pe,e=vt(),t=Ct(),n=Et(),s=Ut(),{isBuiltin:r}=ye,a=["dependencies","devDependencies","optionalDependencies"],l=Mt(),o=Wt,h=i=>i.includes("@")&&i.indexOf("@")<i.lastIndexOf(".");J={warn:function(){},fixRepositoryField:function(i){if(i.repositories&&(this.warn("repositories"),i.repository=i.repositories[0]),!i.repository)return this.warn("missingRepository");typeof i.repository=="string"&&(i.repository={type:"git",url:i.repository});var p=i.repository.url||"";if(p){var d=s.fromUrl(p);d&&(p=i.repository.url=d.getDefaultRepresentation()==="shortcut"?d.https():d.toString())}p.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",p)},fixTypos:function(i){Object.keys(o.topLevel).forEach(function(p){Object.prototype.hasOwnProperty.call(i,p)&&this.warn("typo",p,o.topLevel[p])},this)},fixScriptsField:function(i){if(i.scripts){if(typeof i.scripts!="object"){this.warn("nonObjectScripts"),delete i.scripts;return}Object.keys(i.scripts).forEach(function(p){typeof i.scripts[p]!="string"?(this.warn("nonStringScript"),delete i.scripts[p]):o.script[p]&&!i.scripts[o.script[p]]&&this.warn("typo",p,o.script[p],"scripts")},this)}},fixFilesField:function(i){var p=i.files;p&&!Array.isArray(p)?(this.warn("nonArrayFiles"),delete i.files):i.files&&(i.files=i.files.filter(function(d){return!d||typeof d!="string"?(this.warn("invalidFilename",d),!1):!0},this))},fixBinField:function(i){if(i.bin&&typeof i.bin=="string"){var p={},d;(d=i.name.match(/^@[^/]+[/](.*)$/))?p[d[1]]=i.bin:p[i.name]=i.bin,i.bin=p}},fixManField:function(i){i.man&&typeof i.man=="string"&&(i.man=[i.man])},fixBundleDependenciesField:function(i){var p="bundledDependencies",d="bundleDependencies";i[p]&&!i[d]&&(i[d]=i[p],delete i[p]),i[d]&&!Array.isArray(i[d])?(this.warn("nonArrayBundleDependencies"),delete i[d]):i[d]&&(i[d]=i[d].filter(function(P){return!P||typeof P!="string"?(this.warn("nonStringBundleDependency",P),!1):(i.dependencies||(i.dependencies={}),Object.prototype.hasOwnProperty.call(i.dependencies,P)||(this.warn("nonDependencyBundleDependency",P),i.dependencies[P]="*"),!0)},this))},fixDependencies:function(i){L(i,this.warn),g(i,this.warn),this.fixBundleDependenciesField(i),["dependencies","devDependencies"].forEach(function(p){if(p in i){if(!i[p]||typeof i[p]!="object"){this.warn("nonObjectDependencies",p),delete i[p];return}Object.keys(i[p]).forEach(function(d){var P=i[p][d];typeof P!="string"&&(this.warn("nonStringDependency",d,JSON.stringify(P)),delete i[p][d]);var D=s.fromUrl(i[p][d]);D&&(i[p][d]=D.toString())},this)}},this)},fixModulesField:function(i){i.modules&&(this.warn("deprecatedModules"),delete i.modules)},fixKeywordsField:function(i){typeof i.keywords=="string"&&(i.keywords=i.keywords.split(/,\s+/)),i.keywords&&!Array.isArray(i.keywords)?(delete i.keywords,this.warn("nonArrayKeywords")):i.keywords&&(i.keywords=i.keywords.filter(function(p){return typeof p!="string"||!p?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(i,p){var d=!p;if(!i.version)return i.version="",!0;if(!e(i.version,d))throw new Error('Invalid version: "'+i.version+'"');return i.version=t(i.version,d),!0},fixPeople:function(i){v(i,C),v(i,m)},fixNameField:function(i,p){typeof p=="boolean"?p={strict:p}:typeof p>"u"&&(p={});var d=p.strict;if(!i.name&&!d){i.name="";return}if(typeof i.name!="string")throw new Error("name field must be a string.");d||(i.name=i.name.trim()),b(i.name,d,p.allowLegacyCase),r(i.name)&&this.warn("conflictingName",i.name)},fixDescriptionField:function(i){i.description&&typeof i.description!="string"&&(this.warn("nonStringDescription"),delete i.description),i.readme&&!i.description&&(i.description=l(i.readme)),i.description===void 0&&delete i.description,i.description||this.warn("missingDescription")},fixReadmeField:function(i){i.readme||(this.warn("missingReadme"),i.readme="ERROR: No README data found!")},fixBugsField:function(i){if(!i.bugs&&i.repository&&i.repository.url){var p=s.fromUrl(i.repository.url);p&&p.bugs()&&(i.bugs={url:p.bugs()})}else if(i.bugs){if(typeof i.bugs=="string")h(i.bugs)?i.bugs={email:i.bugs}:u.canParse(i.bugs)?i.bugs={url:i.bugs}:this.warn("nonEmailUrlBugsString");else{y(i.bugs,this.warn);var d=i.bugs;i.bugs={},d.url&&(u.canParse(d.url)?i.bugs.url=d.url:this.warn("nonUrlBugsUrlField")),d.email&&(typeof d.email=="string"&&h(d.email)?i.bugs.email=d.email:this.warn("nonEmailBugsEmailField"))}!i.bugs.email&&!i.bugs.url&&(delete i.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(i){if(!i.homepage&&i.repository&&i.repository.url){var p=s.fromUrl(i.repository.url);p&&p.docs()&&(i.homepage=p.docs())}if(i.homepage){if(typeof i.homepage!="string")return this.warn("nonUrlHomepage"),delete i.homepage;u.canParse(i.homepage)||(i.homepage="http://"+i.homepage)}},fixLicenseField:function(i){const p=i.license||i.licence;if(!p)return this.warn("missingLicense");if(typeof p!="string"||p.length<1||p.trim()==="")return this.warn("invalidLicense");if(!n(p).validForNewPackages)return this.warn("invalidLicense")}};function f(i){if(i.charAt(0)!=="@")return!1;var p=i.slice(1).split("/");return p.length!==2?!1:p[0]&&p[1]&&p[0]===encodeURIComponent(p[0])&&p[1]===encodeURIComponent(p[1])}function S(i){return!i.match(/[/@\s+%:]/)&&i===encodeURIComponent(i)}function b(i,p,d){if(i.charAt(0)==="."||!(f(i)||S(i))||p&&!d&&i!==i.toLowerCase()||i.toLowerCase()==="node_modules"||i.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(i))}function v(i,p){return i.author&&(i.author=p(i.author)),["maintainers","contributors"].forEach(function(d){Array.isArray(i[d])&&(i[d]=i[d].map(p))}),i}function C(i){if(typeof i=="string")return i;var p=i.name||"",d=i.url||i.web,P=d?" ("+d+")":"",D=i.email||i.mail,w=D?" <"+D+">":"";return p+w+P}function m(i){if(typeof i!="string")return i;var p=i.match(/^([^(<]+)/),d=i.match(/\(([^()]+)\)/),P=i.match(/<([^<>]+)>/),D={};return p&&p[0].trim()&&(D.name=p[0].trim()),P&&(D.email=P[1]),d&&(D.url=d[1]),D}function g(i){var p=i.optionalDependencies;if(p){var d=i.dependencies||{};Object.keys(p).forEach(function(P){d[P]=p[P]}),i.dependencies=d}}function c(i,p,d){if(!i)return{};if(typeof i=="string"&&(i=i.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(i))return i;d("deprecatedArrayDependencies",p);var P={};return i.filter(function(D){return typeof D=="string"}).forEach(function(D){D=D.trim().split(/(:?[@\s><=])/);var w=D.shift(),x=D.join("");x=x.trim(),x=x.replace(/^@/,""),P[w]=x}),P}function L(i,p){a.forEach(function(d){i[d]&&(i[d]=c(i[d],d,p))})}function y(i,p){i&&Object.keys(i).forEach(function(d){o.bugs[d]&&(p("typo",d,o.bugs[d],"bugs"),i[o.bugs[d]]=i[d],delete i[d])})}return J}var Re="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Ie="No repository field.",Te="Probably broken git url: %s",Ue="scripts must be an object",Me="script values must be string commands",ke="Invalid 'files' member",_e="Invalid filename in 'files' list: %s",We="Invalid 'bundleDependencies' list. Must be array of package names",He="Invalid bundleDependencies member: %s",je="Non-dependency in bundleDependencies: %s",ze="%s field must be an object",Ye="Invalid dependency: %s %s",qe="specifying %s as array is deprecated",Ve="modules field is deprecated",Ke="keywords should be an array of strings",Xe="keywords should be an array of strings",Je="%s is also the name of a node core module.",Ze="'description' field should be a string",Qe="No description",et="No README data",tt="No license field.",it="Bug string field must be url, email, or {email,url}",rt="bugs.url field must be a string url. Deleted.",nt="bugs.email field must be a string email. Deleted.",st="Normalized value of bugs field is an empty object. Deleted.",ot="homepage field must be a string url. Deleted.",at="license should be a valid SPDX license expression",lt="%s should probably be %s.";const jt={repositories:Re,missingRepository:Ie,brokenGitUrl:Te,nonObjectScripts:Ue,nonStringScript:Me,nonArrayFiles:ke,invalidFilename:_e,nonArrayBundleDependencies:We,nonStringBundleDependency:He,nonDependencyBundleDependency:je,nonObjectDependencies:ze,nonStringDependency:Ye,deprecatedArrayDependencies:qe,deprecatedModules:Ve,nonArrayKeywords:Ke,nonStringKeyword:Xe,conflictingName:Je,nonStringDescription:Ze,missingDescription:Qe,missingReadme:et,missingLicense:tt,nonEmailUrlBugsString:it,nonUrlBugsUrlField:rt,nonEmailBugsEmailField:nt,emptyNormalizedBugs:st,nonUrlHomepage:ot,invalidLicense:at,typo:lt},zt=Object.defineProperty({__proto__:null,brokenGitUrl:Te,conflictingName:Je,default:jt,deprecatedArrayDependencies:qe,deprecatedModules:Ve,emptyNormalizedBugs:st,invalidFilename:_e,invalidLicense:at,missingDescription:Qe,missingLicense:tt,missingReadme:et,missingRepository:Ie,nonArrayBundleDependencies:We,nonArrayFiles:ke,nonArrayKeywords:Ke,nonDependencyBundleDependency:je,nonEmailBugsEmailField:nt,nonEmailUrlBugsString:it,nonObjectDependencies:ze,nonObjectScripts:Ue,nonStringBundleDependency:He,nonStringDependency:Ye,nonStringDescription:Ze,nonStringKeyword:Xe,nonStringScript:Me,nonUrlBugsUrlField:rt,nonUrlHomepage:ot,repositories:Re,typo:lt},Symbol.toStringTag,{value:"Module"}),Yt=ie(zt);var Z,ve;function qt(){if(ve)return Z;ve=1;var u=Pt,e=Yt;Z=function(){var n=Array.prototype.slice.call(arguments,0),s=n.shift();if(s==="typo")return t.apply(null,n);var r=e[s]?e[s]:s+": '%s'";return n.unshift(r),u.format.apply(null,n)};function t(n,s,r){return r&&(n=r+"['"+n+"']",s=r+"['"+s+"']"),u.format(e.typo,n,s)}return Z}var Q,Ce;function Vt(){if(Ce)return Q;Ce=1,Q=r;var u=Ht();r.fixer=u;var e=qt(),t=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],n=["dependencies","people","typos"],s=t.map(function(l){return a(l)+"Field"});s=s.concat(n);function r(l,o,h){o===!0&&(o=null,h=!0),h||(h=!1),(!o||l.private)&&(o=function(){}),l.scripts&&l.scripts.install==="node-gyp rebuild"&&!l.scripts.preinstall&&(l.gypfile=!0),u.warn=function(){o(e.apply(null,arguments))},s.forEach(function(f){u["fix"+a(f)](l,h)}),l._id=l.name+"@"+l.version}function a(l){return l.charAt(0).toUpperCase()+l.slice(1)}return Q}var Kt=Vt();const Xt=St(Kt),Jt=(u,e,t)=>{const n=ee(u),s=ee(e),r=s===n?".":mt(n,s);return t.some(a=>{const l=a.startsWith("./")?a.slice(2):a,o=r.startsWith("./")?r.slice(2):r;if(l==="."&&o===".")return!0;if(l.endsWith("/**")){const h=l.slice(0,-3);return o===h||o.startsWith(`${h}/`)}if(l.endsWith("/*")){const h=l.slice(0,-2);return h===""?o!=="."&&!o.includes("/"):o.startsWith(`${h}/`)||o===h}return o===l||o.startsWith(`${l}/`)})},Zt=u=>{const e=be("pnpm-workspace.yaml",{cwd:ee(u),type:"file"});if(!e)return;const t=De(te(e)),n=Array.isArray(t.packages)?t.packages:[];if(!Jt(e,u,n))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},Qt=(u,e,t)=>{if(e==="catalog:")return t.catalog?.[u];if(e.startsWith("catalog:")){const n=e.slice(8);return t.catalogs?.[n]?.[u]}},ei=(u,e)=>{for(const[t,n]of Object.entries(u)){if(typeof n!="string")continue;const s=Qt(t,n,e);s&&(u[t]=s)}},ti=(u,e)=>{const t=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const n of t){if(!u[n]||typeof u[n]!="object")continue;const s=u[n];ei(s,e)}};let ii;const ri=u=>(ii??=dt(import.meta.url))(u),G=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,re=u=>{if(typeof G<"u"&&G.versions&&G.versions.node){const[e,t]=G.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return G.getBuiltinModule(u)}return ri(u)},{existsSync:Ri}=re("node:fs"),{createInterface:Ii}=re("node:readline"),{styleText:Ti}=re("node:util"),ni=new Set(["__proto__","prototype","constructor"]);Math.max(...[...ni].map(u=>u.length));typeof process.stdout<"u"&&globalThis.window;const si=/, ([^,]*)$/,oi=new Map,ai=(u,e={})=>{const t=e.strict&&e.ignoreWarnings?e.ignoreWarnings.map(String).toSorted((n,s)=>n.localeCompare(s)).join(","):"";return`${u}|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 li extends Error{constructor(e){super(`The following warnings were encountered while normalizing package data:
3
+ - ${e.join(`
4
+ - `)}`),this.name="PackageJsonValidationError"}}const ci=(u,e,t=[])=>{const n=[];if(Xt(u,s=>{n.push(s)},e),e&&n.length>0){const s=n.filter(r=>!t.some(a=>a instanceof RegExp?a.test(r):a===r));if(s.length>0)throw new li(s)}return u},hi=u=>{const e=te(u);return De(e)},ui=u=>{const e=te(u);return gt.parse(e)},pi=(u,e)=>e?.yaml!==!1&&(u.endsWith(".yaml")||u.endsWith(".yml"))?hi(u):e?.json5!==!1&&u.endsWith(".json5")?ui(u):yt(u),fi=(u,e={})=>{const t={type:"file"};u&&(t.cwd=u);const n=["package.json"];e.yaml!==!1&&n.push("package.yaml","package.yml"),e.json5!==!1&&n.push("package.json5");const s=be(n,t);if(!s)throw new Lt(`No such file or directory, for ${n.join(", ").replace(si," or $1")} found.`);const r=e.cache&&typeof e.cache!="boolean"?e.cache:oi,a=ai(s,e);if(e.cache&&r.has(a))return r.get(a);const l=pi(s,e);if(e.resolveCatalogs){const h=Zt(s);h&&ti(l,h)}ci(l,e.strict??!1,e.ignoreWarnings);const o={packageJson:l,path:s};return e.cache&&r.set(a,o),o};var di="6.0.0";const mi={version:di},Li=mi.version,gi="@visulima/vis";let E;const Ui=()=>{if(E!==void 0)return E;const u=process.env.VIS_VERSION;if(u)return E=u,E;try{const{packageJson:e}=fi(pt(ft(import.meta.url)),{json5:!1,yaml:!1});if(e.name===gi&&typeof e.version=="string")return E=e.version,E}catch{}return E=Li,E};export{$i as P,Ei as a,Ni as b,Ai as c,Ui as g,Oi as i,wi as n,Fi as p,Di as r,xi as t,Gi as u};
@@ -1 +1 @@
1
- import{createRequire as b}from"node:module";import{e as p}from"./index-BdMIfGVZ.js";import{s as j}from"./index-B4AjSxHU.js";import{g as S}from"./formatBytes-BHAzNIrn-DRcKvqnb.js";import{y as U}from"./isAccessibleSync-DYKTrrvc-BwaMhQs0.js";import{p as E}from"./readJsonSync-CbryXYxN-Bm5i10UW.js";import{h as R}from"./writeFileSync-DJoHk3Ks-Dhem3Uof.js";let _;const T=t=>(_??=b(import.meta.url))(t),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,s]=d.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return d.getBuiltinModule(t)}return T(t)},{rmSync:u,writeFileSync:C}=k("node:fs"),g=3,F=1800*1e3,A=15e3,v=()=>p(S(),"packuments"),y=t=>p(v(),`${encodeURIComponent(t)}.json`),M=t=>{const e=y(t);if(U(e))try{const s=E(e);if(s.cacheVersion!==g){u(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){u(e,{force:!0});return}return s.packument}catch{u(e,{force:!0});return}},w=(t,e,s)=>{R(v());const o={cacheVersion:g,createdAt:Date.now(),packument:e,ttlMs:s};C(y(t),JSON.stringify(o),"utf8")},P=t=>{const e={},s=t.versions??{};for(const[a,r]of Object.entries(s)){const i=r.dist,n={version:a};if(r._npmUser!==void 0&&(n._npmUser=r._npmUser),r.maintainers!==void 0&&(n.maintainers=r.maintainers),r.bin!==void 0&&(n.bin=r.bin),i!==void 0){const c={};i.signatures!==void 0&&(c.signatures=i.signatures),i.attestations!==void 0&&(c.attestations=i.attestations),typeof i.integrity=="string"&&(c.integrity=i.integrity),typeof i.tarball=="string"&&(c.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(c.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(c.fileCount=i.fileCount),n.dist=c}r.repository!==void 0&&(n.repository=r.repository),r.license!==void 0&&(n.license=r.license),typeof r.readme=="string"&&(n.readme=r.readme),typeof r.readmeFilename=="string"&&(n.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(n.private=r.private),typeof r.deprecated=="string"&&(n.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(n.scripts=r.scripts),e[a]=n}const o={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(o["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(o.time=t.time),typeof t.readme=="string"&&(o.readme=t.readme),o},D=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:o}=await import("../packem_chunks/catalog.js").then(n=>n.aq),a=o(e.workspaceRoot),{token:r,url:i}=s(t,a);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},x=async(t,e={})=>{const s=e.cacheTtlMs??F,o=M(t);if(o!==void 0)return o;if(e.offline)return;const a=await N(t,e),i=`${a.url.endsWith("/")?a.url.slice(0,-1):a.url}/${t.replace("/","%2f")}`,n=new AbortController,c=setTimeout(()=>{n.abort()},A),l=()=>{n.abort()};e.signal?.addEventListener("abort",l,{once:!0});try{const f=await fetch(i,{headers:D(a.authToken),signal:n.signal});if(f.status===404)return;if(!f.ok)throw new Error(`Registry returned ${String(f.status)} for ${t}`);const h=await f.json(),m=P(h);return w(t,m,s),m}finally{clearTimeout(c),e.signal?.removeEventListener("abort",l)}},B=(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 o=t["dist-tags"]?.[e];return o!==void 0?o:Object.hasOwn(t.versions,e)?e:j.maxSatisfying(s,e)??void 0};export{x as g,B as r};
1
+ import{createRequire as b}from"node:module";import{e as p}from"./index-BzhrR_iC.js";import{s as j}from"./index-B4AjSxHU.js";import{g as S}from"./formatBytes-_HvjOy8a-B_qQr4Hw.js";import{y as U}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as E}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as R}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let _;const T=t=>(_??=b(import.meta.url))(t),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,s]=d.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return d.getBuiltinModule(t)}return T(t)},{rmSync:u,writeFileSync:C}=k("node:fs"),g=3,F=1800*1e3,A=15e3,v=()=>p(S(),"packuments"),y=t=>p(v(),`${encodeURIComponent(t)}.json`),M=t=>{const e=y(t);if(U(e))try{const s=E(e);if(s.cacheVersion!==g){u(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){u(e,{force:!0});return}return s.packument}catch{u(e,{force:!0});return}},w=(t,e,s)=>{R(v());const o={cacheVersion:g,createdAt:Date.now(),packument:e,ttlMs:s};C(y(t),JSON.stringify(o),"utf8")},P=t=>{const e={},s=t.versions??{};for(const[a,r]of Object.entries(s)){const i=r.dist,n={version:a};if(r._npmUser!==void 0&&(n._npmUser=r._npmUser),r.maintainers!==void 0&&(n.maintainers=r.maintainers),r.bin!==void 0&&(n.bin=r.bin),i!==void 0){const c={};i.signatures!==void 0&&(c.signatures=i.signatures),i.attestations!==void 0&&(c.attestations=i.attestations),typeof i.integrity=="string"&&(c.integrity=i.integrity),typeof i.tarball=="string"&&(c.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(c.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(c.fileCount=i.fileCount),n.dist=c}r.repository!==void 0&&(n.repository=r.repository),r.license!==void 0&&(n.license=r.license),typeof r.readme=="string"&&(n.readme=r.readme),typeof r.readmeFilename=="string"&&(n.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(n.private=r.private),typeof r.deprecated=="string"&&(n.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(n.scripts=r.scripts),e[a]=n}const o={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(o["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(o.time=t.time),typeof t.readme=="string"&&(o.readme=t.readme),o},D=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:o}=await import("../packem_chunks/catalog.js").then(n=>n.aq),a=o(e.workspaceRoot),{token:r,url:i}=s(t,a);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},x=async(t,e={})=>{const s=e.cacheTtlMs??F,o=M(t);if(o!==void 0)return o;if(e.offline)return;const a=await N(t,e),i=`${a.url.endsWith("/")?a.url.slice(0,-1):a.url}/${t.replace("/","%2f")}`,n=new AbortController,c=setTimeout(()=>{n.abort()},A),l=()=>{n.abort()};e.signal?.addEventListener("abort",l,{once:!0});try{const f=await fetch(i,{headers:D(a.authToken),signal:n.signal});if(f.status===404)return;if(!f.ok)throw new Error(`Registry returned ${String(f.status)} for ${t}`);const h=await f.json(),m=P(h);return w(t,m,s),m}finally{clearTimeout(c),e.signal?.removeEventListener("abort",l)}},B=(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 o=t["dist-tags"]?.[e];return o!==void 0?o:Object.hasOwn(t.versions,e)?e:j.maxSatisfying(s,e)??void 0};export{x as g,B as r};
@@ -1 +1 @@
1
- import{createRequire as U}from"node:module";import{e as y,$ as O,s as D,a as Y}from"./index-BdMIfGVZ.js";import{withEnhancedPath as z,collectNodeModulesBinDirs as G}from"@visulima/task-runner";import{s as $}from"./index-B4AjSxHU.js";import{detectPackageManager as H,resolveAdd as J,resolveRemove as V,whichBin as X,resolveUnlink as K,resolveInstall as Q,execPmCommandInteractive as Z,resolveDlx as ee,resolveExec as ne,resolveDedupe as re,resolveWhy as se,resolveLink as ae,resolvePmCommand as ie}from"#native";import{y as j}from"./isAccessibleSync-DYKTrrvc-BwaMhQs0.js";let W;const x=e=>(W??=U(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[n,r]=k.versions.node.split(".").map(Number);if(n>22||n===22&&r>=3||n===20&&r>=16)return k.getBuiltinModule(e)}return x(e)},{spawn:F,spawnSync:E}=q("node:child_process"),d=(e,n,r,s)=>{for(const a of n)e.push("--filter",a);r&&e.push("--recursive"),s&&e.push("--workspace-root")},te=e=>{const n=[],r=[];return d(n,e.filter,e.recursive,e.workspaceRoot),e.silent&&n.push("--silent"),e.frozenLockfile&&n.push("--frozen-lockfile"),n.push("install"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.force&&n.push("--force"),e.ignoreScripts&&n.push("--ignore-scripts"),e.lockfileOnly&&n.push("--lockfile-only"),e.noOptional&&n.push("--no-optional"),e.offline&&n.push("--offline"),{args:n,bin:"aube",warnings:r}},oe=e=>{const n=[],r=[];return d(n,e.filter,!1,!1),n.push("add"),e.saveDev&&n.push("--save-dev"),e.exact&&n.push("--save-exact"),e.global&&n.push("--global"),e.optional&&n.push("--save-optional"),e.peer&&n.push("--save-peer"),e.workspace&&r.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},ue=e=>{const n=[];return d(n,e.filter,e.recursive,!1),n.push("remove"),e.saveDev&&n.push("--save-dev"),e.global&&n.push("--global"),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:[]}},ce=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},le=e=>{const n=[],r=[];d(n,e.filter,e.recursive,!1),n.push("why"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.json&&n.push("--json"),e.long&&n.push("--long"),e.parseable&&n.push("--parseable"),e.depth!==void 0&&r.push("aube why does not accept --depth; ignoring."),e.noOptional&&r.push("aube why does not accept --no-optional; ignoring."),e.global&&r.push("aube why does not accept --global; ignoring.");const[s,...a]=e.packages;return s===void 0?r.push("aube why requires a package name; none provided."):(a.length>0&&r.push("aube why takes a single package; using the first."),n.push(s)),{args:n,bin:"aube",warnings:r}},fe=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const r of e.additionalPackages)n.push("--package",r);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},pe=e=>{const n=[];return d(n,e.filter,e.recursive,e.workspaceRoot),n.push("exec"),e.parallel&&n.push("--parallel"),e.reverse&&n.push("--reverse"),e.shellMode&&n.push("--shell-mode"),n.push(e.command),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},he=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},de=(e,n)=>{const r=[],s=[];return n&&r.push("--recursive"),r.push("unlink"),e.length>1&&s.push("aube unlink takes a single package; using the first."),e.length>0&&r.push(e[0]),{args:r,bin:"aube",warnings:s}},ge=e=>{const n=["view","--",e.package],r=[],[s,...a]=e.fields;return s!==void 0?(a.length>0&&r.push("aube view only supports a single field; using the first."),e.json&&r.push("aube view does not support --json with a field selector; printing the field without --json."),n.push(s)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:r}},ze=e=>{const n=[],r=[];return d(n,e.filters,e.recursive,e.workspaceRoot),n.push("update"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.global&&n.push("--global"),e.interactive&&n.push("--interactive"),e.latest&&n.push("--latest"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},be=new Set(["fund","ping","search","token"]),ke=(e,n)=>be.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},w=256*1024,we=e=>{const n=e?{...process.env,...e}:{...process.env};return process.stderr.isTTY&&n.FORCE_COLOR===void 0&&n.NO_COLOR===void 0&&(n.FORCE_COLOR="1"),n},P=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,ve=async(e,n,r)=>new Promise((s,a)=>{const i=process.platform==="win32",t=F(i?P(e):e,i?n.map(o=>P(o)):[...n],{cwd:r.cwd,env:we(r.env),shell:i,stdio:["inherit","pipe","pipe"],windowsHide:!0});let c=[],f=0;const p=o=>{if(c.push(o),f+=o.length,!(f<=w)){for(;c.length>1&&f-c[0].length>w;)f-=c.shift().length;if(c.length===1&&f>w){const h=c[0];c[0]=h.subarray(h.length-w),f=w}}},b=()=>Buffer.concat(c).toString("utf8");t.stdout?.on("data",o=>{process.stdout.write(o),p(o)}),t.stderr?.on("data",o=>{process.stderr.write(o),p(o)}),t.on("error",a),t.on("close",o=>{const h=b();c=[],s({code:o??1,output:h})})}),v=e=>{const n=$.coerce(e);return n?$.gte(n,"11.0.0"):!1},l=e=>e.name==="yarn"&&!e.version.startsWith("1."),R=e=>e.name==="yarn"&&e.version.startsWith("1."),ye=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,me=(e,n,r)=>{switch(n){case"audit":return l(e)?{args:["npm","audit",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(l(e)){const[s,...a]=r;return s==="delete"?{args:["config","unset",...a],bin:"yarn",kind:"rewrite",warning:"yarn berry uses `config unset`, not `config delete`."}:{kind:"passthrough"}}return e.name==="bun"?{kind:"skip",warning:"bun has no `config` CLI. Edit bunfig.toml or .npmrc directly."}:{kind:"passthrough"}}case"dist-tag":return R(e)?{args:["tag",...r],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:l(e)?{args:["npm","tag",...ye(r)],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{kind:"skip",warning:`${e.name} has no \`dist-tag\`. Use \`npm dist-tag\` instead.`}:{kind:"passthrough"};case"login":case"logout":return l(e)?{args:["npm",n,...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...r],bin:"npm",kind:"rewrite",warning:`bun has no \`${n}\`; falling back to \`npm ${n}\` (writes ~/.npmrc, which bun reads).`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&v(e.version)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:l(e)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"bun has no `owner`; falling back to `npm owner`."}:{kind:"passthrough"};case"ping":return e.name==="pnpm"&&v(e.version)?{args:["ping",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"pkg":return e.name==="bun"?{args:["pm","pkg",...r],bin:"bun",kind:"rewrite"}:e.name==="yarn"?{args:["pkg",...r],bin:"npm",kind:"rewrite",warning:`${e.name} has no \`pkg\` command; falling back to \`npm pkg\`.`}:{kind:"passthrough"};case"plugin":return l(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return R(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:l(e)?{kind:"skip",warning:"yarn berry has no `prune`. Use `yarn workspaces focus --production` instead."}:e.name==="bun"?{kind:"skip",warning:`${e.name} has no \`prune\`. Pruning happens automatically on install.`}:{kind:"passthrough"};case"publish":return l(e)?{args:["npm","publish",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return R(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."}:{kind:"passthrough"};case"search":return e.name==="pnpm"&&v(e.version)?{args:["search",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&v(e.version)?{args:["token",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&v(e.version)?{args:["whoami",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:l(e)?{args:["npm","whoami",...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...r],bin:"bun",kind:"rewrite"}:{kind:"passthrough"};default:return{kind:"passthrough"}}},A=e=>X(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"]];let r=e;for(;;){for(const[a,i]of n)if(j(y(r,a)))return i;const s=O(r);if(s===r||D(r).root===r)return;r=s}},Ge=(e,n)=>{if(n.name!=="aube")return;const r=$e(e);if(r!==void 0)return`Resolved installer is aube but the workspace has a ${r} lockfile. Aube reads and writes ${r}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},C=e=>{if(j(e))try{return JSON.parse(Y(e,{buffer:!1}))}catch{return}},je=e=>{let n=e;for(;;){const r=y(n,"package.json"),s=C(r);if(s&&typeof s.packageManager=="string"&&s.packageManager.length>0)return s.packageManager;const a=O(n);if(a===n||D(n).root===n)return;n=a}},I=new Set(["npm","pnpm","yarn"]),M=(e,n,r)=>r===!1||!I.has(n)||!A("corepack")?!1:r===!0?!0:je(e)!==void 0,He=(e,n)=>{const r=n.backend,s=process.env.VIS_INSTALLER,a=r??s??n.configBackend,i=n.configCorepack??"auto";if(a&&a!=="auto"){if(a==="aube"&&!A("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:a,useCorepack:M(e,a,i),version:"latest"}}if(A("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const t=Re(e);return{...t,useCorepack:M(e,t.name,i)}},Re=e=>{if(!j(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const n=H(e);return{name:n.name,version:n.version||"latest"}},L=(e,n)=>n.useCorepack!==!0||!I.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},Ae=(e,n,r)=>{if(r===void 0)return Z(e.bin,e.args,n);const s=E(e.bin,e.args,{cwd:n,env:{...process.env,...r},stdio:"inherit"});if(s.error)throw s.error;return s.status??1},u=(e,n,r,s,a={})=>{const i=L(n,e);for(const t of i.warnings)s.warn(`warning: ${t}`);return a.dry?(s.log(`[dry-run] ${i.bin} ${i.args.join(" ")}`),0):Ae(i,r,a.env)},g=(e,n,r,s,a={})=>u(e,n(),r,s,a),Oe=(e,n)=>n==="aube"?e:{...e,args:[...e.args,"--prefer-offline"]},De=(e,n,r)=>n!=="yarn"||r.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},N=(e,n,r)=>{let s=e.name==="aube"?te(n):Q(e.name,e.version,{...n,silent:n.silent||r.silent===!0});return r.preferOffline&&(s=Oe(s,e.name)),r.ciMode&&(s=De(s,e.name,e.version)),s},Je=(e,n,r,s,a={})=>{const i=N(e,n,a);return S(e,i,r,s,{dry:a.dry,env:a.env})},Ve=async(e,n,r,s,a={})=>{const i=L(N(e,n,a),e);for(const t of i.warnings)s.warn(`warning: ${t}`);return a.dry?(s.log(`[dry-run] ${i.bin} ${i.args.join(" ")}`),{code:0,output:""}):ve(i.bin,i.args,{cwd:r,env:a.env?{...process.env,...a.env}:process.env})},B=e=>({...e,args:[...e.args,"--silent"]}),Ce=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},S=(e,n,r,s,a)=>{if(a.dry!==!0)return u(e,n,r,s,a);const i=Ce(n,e.name);return i===null?u(e,n,r,s,a):u(e,i,r,s,{env:a.env})},Se=e=>({...e,args:[...e.args,"--ignore-scripts"]}),_e=(e,n,r,s,a={})=>{let i=e.name==="aube"?oe(n):J(e.name,e.version,n);a.ignoreScripts&&(i=Se(i)),a.silent&&(i=B(i));const t=S(e,i,r,s,{dry:a.dry,env:a.env});return t===0&&a.autoInstallPeers&&Ie(e,n,r,s,a),t},Pe=e=>{if(e.startsWith("@")){const r=e.indexOf("/");if(r===-1)return e;const s=e.indexOf("@",r);return s===-1?e:e.slice(0,s)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},Me=(e,n)=>{let r=e;for(;;){const s=y(r,"node_modules",n,"package.json"),a=C(s);if(a)return a;const i=O(r);if(i===r||D(r).root===r)return;r=i}},Ee=e=>{const n=C(y(e,"package.json")),r=new Set;if(!n)return r;for(const s of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const a=n[s];if(a)for(const i of Object.keys(a))r.add(i)}return r},Ie=(e,n,r,s,a)=>{const i=Ee(r),t=new Map;for(const p of n.packages){const b=Pe(p),o=Me(r,b);if(!o?.peerDependencies)continue;const h=o.peerDependenciesMeta??{};for(const[m,T]of Object.entries(o.peerDependencies))h[m]?.optional||i.has(m)||t.has(m)||t.set(m,T)}if(t.size===0)return;const c=[...t.entries()].map(([p,b])=>`${p}@${b}`);s.log(`auto-installing peer dependencies: ${c.join(", ")}`);const f={exact:!1,filter:n.filter,global:!1,optional:!1,packages:c,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};_e(e,f,r,s,{ignoreScripts:a.ignoreScripts})},Xe=(e,n,r,s,a={})=>{let i=e.name==="aube"?ue(n):V(e.name,e.version,n);return a.silent&&(i=B(i)),S(e,i,r,s,{dry:a.dry,env:a.env})},Ke=(e,n,r,s,a={})=>e.name==="aube"?u(e,ce(n),r,s,a):g(e,()=>re(e.name,e.version,n),r,s,a),Qe=(e,n,r,s,a={})=>e.name==="aube"?u(e,le(n),r,s,a):g(e,()=>se(e.name,e.version,n),r,s,a),Le=(e,n)=>{if(e.name==="aube")return ge(n);const r=[],s=[],a=e.name;switch(e.name){case"bun":{const i=$.coerce(e.version);i&&$.lt(i,"1.3.0")&&s.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),r.push("pm","view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"npm":case"pnpm":{r.push("view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){r.push("info","--",n.package);const[i,...t]=n.fields;i!==void 0&&(t.length>0&&s.push("yarn v1 only supports querying one field at a time; using the first."),r.push(i)),n.json&&r.push("--json")}else r.push("npm","info","--",n.package),n.fields.length>0&&s.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&r.push("--json");break}default:{const i=e.name;throw new Error(`Unsupported package manager: ${i}`)}}return{args:r,bin:a,warnings:s}},Ze=(e,n,r,s,a={})=>u(e,Le(e,n),r,s,a),en=(e,n,r,s,a={})=>e.name==="aube"?u(e,he(n),r,s,a):g(e,()=>ae(e.name,e.version,n),r,s,a),nn=(e,n,r,s,a,i={})=>e.name==="aube"?u(e,de(n,r),s,a,i):g(e,()=>K(e.name,e.version,n,r),s,a,i),Ne=(e,n,r)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const s=(a,i)=>{const t=[...e.args];return t.splice(i,0,a),{...e,args:t}};switch(n){case"aube":case"pnpm":return s("--offline",1);case"bun":return{...e,warnings:[...e.warnings,"bun x does not support --offline. Pre-install the package via `vis install` so bun x resolves from the local cache."]};case"npm":return s("--offline",1);case"yarn":return r.startsWith("1.")?s("--offline",0):{...e,warnings:[...e.warnings,"yarn berry has no --offline flag for dlx. Configure `enableNetwork: false` in .yarnrc.yml or set `enableMirror: true` for offline-first behavior."]};default:{const a=n;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(a)}`]}}}},rn=(e,n,r,s,a={})=>{let i=e.name==="aube"?fe(n):ee(e.name,e.version,n);return a.offline&&(i=Ne(i,e.name,e.version)),u(e,i,r,s,{dry:a.dry,env:a.env})},_=process.platform==="win32",Be=_?[".exe",".cmd",".bat",".ps1",""]:[""],Te=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const r of G(n))for(const s of Be){const a=y(r,`${e}${s}`);if(j(a))return _?a.replaceAll("/","\\"):a}},sn=(e,n,r)=>{const s=Te(e,r);if(s===void 0||_&&!s.toLowerCase().endsWith(".exe"))return null;const a=E(s,n,{cwd:r,env:z({...process.env},r),stdio:"inherit"});if(a.error)throw a.error;return a.status??1},an=(e,n,r,s,a={})=>e.name==="aube"?u(e,pe(n),r,s,a):g(e,()=>ne(e.name,e.version,n),r,s,a),tn=(e,n,r,s,a,i={})=>{if(e.name==="aube")return u(e,ke(n,r),s,a,i);const t=me(e,n,r);return t.kind==="skip"?(a.warn(`warning: ${t.warning}`),0):t.kind==="rewrite"?u(e,{args:t.args,bin:t.bin,warnings:t.warning?[t.warning]:[]},s,a,i):g(e,()=>ie(e.name,e.version,n,r),s,a,i)};export{He as a,an as b,_e as c,Re as d,Ke as e,Ze as f,Ge as g,Ve as h,en as i,tn as j,Xe as k,nn as l,Qe as m,Je as n,rn as o,ze as p,sn as r,ve as s};
1
+ import{createRequire as U}from"node:module";import{e as y,m as O,b as D,z as Y}from"./index-BzhrR_iC.js";import{withEnhancedPath as z,collectNodeModulesBinDirs as G}from"@visulima/task-runner";import{s as $}from"./index-B4AjSxHU.js";import{detectPackageManager as H,resolveAdd as J,resolveRemove as V,whichBin as X,resolveUnlink as K,resolveInstall as Q,execPmCommandInteractive as Z,resolveDlx as ee,resolveExec as ne,resolveDedupe as re,resolveWhy as se,resolveLink as ie,resolvePmCommand as ae}from"#native";import{y as j}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";let W;const x=e=>(W??=U(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[n,r]=k.versions.node.split(".").map(Number);if(n>22||n===22&&r>=3||n===20&&r>=16)return k.getBuiltinModule(e)}return x(e)},{spawn:F,spawnSync:E}=q("node:child_process"),d=(e,n,r,s)=>{for(const i of n)e.push("--filter",i);r&&e.push("--recursive"),s&&e.push("--workspace-root")},te=e=>{const n=[],r=[];return d(n,e.filter,e.recursive,e.workspaceRoot),e.silent&&n.push("--silent"),e.frozenLockfile&&n.push("--frozen-lockfile"),n.push("install"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.force&&n.push("--force"),e.ignoreScripts&&n.push("--ignore-scripts"),e.lockfileOnly&&n.push("--lockfile-only"),e.noOptional&&n.push("--no-optional"),e.offline&&n.push("--offline"),{args:n,bin:"aube",warnings:r}},oe=e=>{const n=[],r=[];return d(n,e.filter,!1,!1),n.push("add"),e.saveDev&&n.push("--save-dev"),e.exact&&n.push("--save-exact"),e.global&&n.push("--global"),e.optional&&n.push("--save-optional"),e.peer&&n.push("--save-peer"),e.workspace&&r.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},ue=e=>{const n=[];return d(n,e.filter,e.recursive,!1),n.push("remove"),e.saveDev&&n.push("--save-dev"),e.global&&n.push("--global"),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:[]}},ce=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},le=e=>{const n=[],r=[];d(n,e.filter,e.recursive,!1),n.push("why"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.json&&n.push("--json"),e.long&&n.push("--long"),e.parseable&&n.push("--parseable"),e.depth!==void 0&&r.push("aube why does not accept --depth; ignoring."),e.noOptional&&r.push("aube why does not accept --no-optional; ignoring."),e.global&&r.push("aube why does not accept --global; ignoring.");const[s,...i]=e.packages;return s===void 0?r.push("aube why requires a package name; none provided."):(i.length>0&&r.push("aube why takes a single package; using the first."),n.push(s)),{args:n,bin:"aube",warnings:r}},fe=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const r of e.additionalPackages)n.push("--package",r);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},pe=e=>{const n=[];return d(n,e.filter,e.recursive,e.workspaceRoot),n.push("exec"),e.parallel&&n.push("--parallel"),e.reverse&&n.push("--reverse"),e.shellMode&&n.push("--shell-mode"),n.push(e.command),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},he=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},de=(e,n)=>{const r=[],s=[];return n&&r.push("--recursive"),r.push("unlink"),e.length>1&&s.push("aube unlink takes a single package; using the first."),e.length>0&&r.push(e[0]),{args:r,bin:"aube",warnings:s}},ge=e=>{const n=["view","--",e.package],r=[],[s,...i]=e.fields;return s!==void 0?(i.length>0&&r.push("aube view only supports a single field; using the first."),e.json&&r.push("aube view does not support --json with a field selector; printing the field without --json."),n.push(s)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:r}},ze=e=>{const n=[],r=[];return d(n,e.filters,e.recursive,e.workspaceRoot),n.push("update"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.global&&n.push("--global"),e.interactive&&n.push("--interactive"),e.latest&&n.push("--latest"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},be=new Set(["fund","ping","search","token"]),ke=(e,n)=>be.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},w=256*1024,we=e=>{const n=e?{...process.env,...e}:{...process.env};return process.stderr.isTTY&&n.FORCE_COLOR===void 0&&n.NO_COLOR===void 0&&(n.FORCE_COLOR="1"),n},P=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,ve=async(e,n,r)=>new Promise((s,i)=>{const a=process.platform==="win32",t=F(a?P(e):e,a?n.map(o=>P(o)):[...n],{cwd:r.cwd,env:we(r.env),shell:a,stdio:["inherit","pipe","pipe"],windowsHide:!0});let c=[],f=0;const p=o=>{if(c.push(o),f+=o.length,!(f<=w)){for(;c.length>1&&f-c[0].length>w;)f-=c.shift().length;if(c.length===1&&f>w){const h=c[0];c[0]=h.subarray(h.length-w),f=w}}},b=()=>Buffer.concat(c).toString("utf8");t.stdout?.on("data",o=>{process.stdout.write(o),p(o)}),t.stderr?.on("data",o=>{process.stderr.write(o),p(o)}),t.on("error",i),t.on("close",o=>{const h=b();c=[],s({code:o??1,output:h})})}),v=e=>{const n=$.coerce(e);return n?$.gte(n,"11.0.0"):!1},l=e=>e.name==="yarn"&&!e.version.startsWith("1."),R=e=>e.name==="yarn"&&e.version.startsWith("1."),ye=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,me=(e,n,r)=>{switch(n){case"audit":return l(e)?{args:["npm","audit",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(l(e)){const[s,...i]=r;return s==="delete"?{args:["config","unset",...i],bin:"yarn",kind:"rewrite",warning:"yarn berry uses `config unset`, not `config delete`."}:{kind:"passthrough"}}return e.name==="bun"?{kind:"skip",warning:"bun has no `config` CLI. Edit bunfig.toml or .npmrc directly."}:{kind:"passthrough"}}case"dist-tag":return R(e)?{args:["tag",...r],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:l(e)?{args:["npm","tag",...ye(r)],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{kind:"skip",warning:`${e.name} has no \`dist-tag\`. Use \`npm dist-tag\` instead.`}:{kind:"passthrough"};case"login":case"logout":return l(e)?{args:["npm",n,...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...r],bin:"npm",kind:"rewrite",warning:`bun has no \`${n}\`; falling back to \`npm ${n}\` (writes ~/.npmrc, which bun reads).`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&v(e.version)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:l(e)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"bun has no `owner`; falling back to `npm owner`."}:{kind:"passthrough"};case"ping":return e.name==="pnpm"&&v(e.version)?{args:["ping",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"pkg":return e.name==="bun"?{args:["pm","pkg",...r],bin:"bun",kind:"rewrite"}:e.name==="yarn"?{args:["pkg",...r],bin:"npm",kind:"rewrite",warning:`${e.name} has no \`pkg\` command; falling back to \`npm pkg\`.`}:{kind:"passthrough"};case"plugin":return l(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return R(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:l(e)?{kind:"skip",warning:"yarn berry has no `prune`. Use `yarn workspaces focus --production` instead."}:e.name==="bun"?{kind:"skip",warning:`${e.name} has no \`prune\`. Pruning happens automatically on install.`}:{kind:"passthrough"};case"publish":return l(e)?{args:["npm","publish",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return R(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."}:{kind:"passthrough"};case"search":return e.name==="pnpm"&&v(e.version)?{args:["search",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&v(e.version)?{args:["token",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&v(e.version)?{args:["whoami",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:l(e)?{args:["npm","whoami",...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...r],bin:"bun",kind:"rewrite"}:{kind:"passthrough"};default:return{kind:"passthrough"}}},A=e=>X(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"]];let r=e;for(;;){for(const[i,a]of n)if(j(y(r,i)))return a;const s=O(r);if(s===r||D(r).root===r)return;r=s}},Ge=(e,n)=>{if(n.name!=="aube")return;const r=$e(e);if(r!==void 0)return`Resolved installer is aube but the workspace has a ${r} lockfile. Aube reads and writes ${r}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},C=e=>{if(j(e))try{return JSON.parse(Y(e,{buffer:!1}))}catch{return}},je=e=>{let n=e;for(;;){const r=y(n,"package.json"),s=C(r);if(s&&typeof s.packageManager=="string"&&s.packageManager.length>0)return s.packageManager;const i=O(n);if(i===n||D(n).root===n)return;n=i}},I=new Set(["npm","pnpm","yarn"]),M=(e,n,r)=>r===!1||!I.has(n)||!A("corepack")?!1:r===!0?!0:je(e)!==void 0,He=(e,n)=>{const r=n.backend,s=process.env.VIS_INSTALLER,i=r??s??n.configBackend,a=n.configCorepack??"auto";if(i&&i!=="auto"){if(i==="aube"&&!A("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:i,useCorepack:M(e,i,a),version:"latest"}}if(A("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const t=Re(e);return{...t,useCorepack:M(e,t.name,a)}},Re=e=>{if(!j(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const n=H(e);return{name:n.name,version:n.version||"latest"}},L=(e,n)=>n.useCorepack!==!0||!I.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},Ae=(e,n,r)=>{if(r===void 0)return Z(e.bin,e.args,n);const s=E(e.bin,e.args,{cwd:n,env:{...process.env,...r},stdio:"inherit"});if(s.error)throw s.error;return s.status??1},u=(e,n,r,s,i={})=>{const a=L(n,e);for(const t of a.warnings)s.warn(`warning: ${t}`);return i.dry?(s.log(`[dry-run] ${a.bin} ${a.args.join(" ")}`),0):Ae(a,r,i.env)},g=(e,n,r,s,i={})=>u(e,n(),r,s,i),Oe=(e,n)=>n==="aube"?e:{...e,args:[...e.args,"--prefer-offline"]},De=(e,n,r)=>n!=="yarn"||r.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},N=(e,n,r)=>{let s=e.name==="aube"?te(n):Q(e.name,e.version,{...n,silent:n.silent||r.silent===!0});return r.preferOffline&&(s=Oe(s,e.name)),r.ciMode&&(s=De(s,e.name,e.version)),s},Je=(e,n,r,s,i={})=>{const a=N(e,n,i);return S(e,a,r,s,{dry:i.dry,env:i.env})},Ve=async(e,n,r,s,i={})=>{const a=L(N(e,n,i),e);for(const t of a.warnings)s.warn(`warning: ${t}`);return i.dry?(s.log(`[dry-run] ${a.bin} ${a.args.join(" ")}`),{code:0,output:""}):ve(a.bin,a.args,{cwd:r,env:i.env?{...process.env,...i.env}:process.env})},B=e=>({...e,args:[...e.args,"--silent"]}),Ce=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},S=(e,n,r,s,i)=>{if(i.dry!==!0)return u(e,n,r,s,i);const a=Ce(n,e.name);return a===null?u(e,n,r,s,i):u(e,a,r,s,{env:i.env})},Se=e=>({...e,args:[...e.args,"--ignore-scripts"]}),_e=(e,n,r,s,i={})=>{let a=e.name==="aube"?oe(n):J(e.name,e.version,n);i.ignoreScripts&&(a=Se(a)),i.silent&&(a=B(a));const t=S(e,a,r,s,{dry:i.dry,env:i.env});return t===0&&i.autoInstallPeers&&Ie(e,n,r,s,i),t},Pe=e=>{if(e.startsWith("@")){const r=e.indexOf("/");if(r===-1)return e;const s=e.indexOf("@",r);return s===-1?e:e.slice(0,s)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},Me=(e,n)=>{let r=e;for(;;){const s=y(r,"node_modules",n,"package.json"),i=C(s);if(i)return i;const a=O(r);if(a===r||D(r).root===r)return;r=a}},Ee=e=>{const n=C(y(e,"package.json")),r=new Set;if(!n)return r;for(const s of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const i=n[s];if(i)for(const a of Object.keys(i))r.add(a)}return r},Ie=(e,n,r,s,i)=>{const a=Ee(r),t=new Map;for(const p of n.packages){const b=Pe(p),o=Me(r,b);if(!o?.peerDependencies)continue;const h=o.peerDependenciesMeta??{};for(const[m,T]of Object.entries(o.peerDependencies))h[m]?.optional||a.has(m)||t.has(m)||t.set(m,T)}if(t.size===0)return;const c=[...t.entries()].map(([p,b])=>`${p}@${b}`);s.log(`auto-installing peer dependencies: ${c.join(", ")}`);const f={exact:!1,filter:n.filter,global:!1,optional:!1,packages:c,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};_e(e,f,r,s,{ignoreScripts:i.ignoreScripts})},Xe=(e,n,r,s,i={})=>{let a=e.name==="aube"?ue(n):V(e.name,e.version,n);return i.silent&&(a=B(a)),S(e,a,r,s,{dry:i.dry,env:i.env})},Ke=(e,n,r,s,i={})=>e.name==="aube"?u(e,ce(n),r,s,i):g(e,()=>re(e.name,e.version,n),r,s,i),Qe=(e,n,r,s,i={})=>e.name==="aube"?u(e,le(n),r,s,i):g(e,()=>se(e.name,e.version,n),r,s,i),Le=(e,n)=>{if(e.name==="aube")return ge(n);const r=[],s=[],i=e.name;switch(e.name){case"bun":{const a=$.coerce(e.version);a&&$.lt(a,"1.3.0")&&s.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),r.push("pm","view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"npm":case"pnpm":{r.push("view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){r.push("info","--",n.package);const[a,...t]=n.fields;a!==void 0&&(t.length>0&&s.push("yarn v1 only supports querying one field at a time; using the first."),r.push(a)),n.json&&r.push("--json")}else r.push("npm","info","--",n.package),n.fields.length>0&&s.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&r.push("--json");break}default:{const a=e.name;throw new Error(`Unsupported package manager: ${a}`)}}return{args:r,bin:i,warnings:s}},Ze=(e,n,r,s,i={})=>u(e,Le(e,n),r,s,i),en=(e,n,r,s,i={})=>e.name==="aube"?u(e,he(n),r,s,i):g(e,()=>ie(e.name,e.version,n),r,s,i),nn=(e,n,r,s,i,a={})=>e.name==="aube"?u(e,de(n,r),s,i,a):g(e,()=>K(e.name,e.version,n,r),s,i,a),Ne=(e,n,r)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const s=(i,a)=>{const t=[...e.args];return t.splice(a,0,i),{...e,args:t}};switch(n){case"aube":case"pnpm":return s("--offline",1);case"bun":return{...e,warnings:[...e.warnings,"bun x does not support --offline. Pre-install the package via `vis install` so bun x resolves from the local cache."]};case"npm":return s("--offline",1);case"yarn":return r.startsWith("1.")?s("--offline",0):{...e,warnings:[...e.warnings,"yarn berry has no --offline flag for dlx. Configure `enableNetwork: false` in .yarnrc.yml or set `enableMirror: true` for offline-first behavior."]};default:{const i=n;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(i)}`]}}}},rn=(e,n,r,s,i={})=>{let a=e.name==="aube"?fe(n):ee(e.name,e.version,n);return i.offline&&(a=Ne(a,e.name,e.version)),u(e,a,r,s,{dry:i.dry,env:i.env})},_=process.platform==="win32",Be=_?[".exe",".cmd",".bat",".ps1",""]:[""],Te=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const r of G(n))for(const s of Be){const i=y(r,`${e}${s}`);if(j(i))return _?i.replaceAll("/","\\"):i}},sn=(e,n,r)=>{const s=Te(e,r);if(s===void 0||_&&!s.toLowerCase().endsWith(".exe"))return null;const i=E(s,n,{cwd:r,env:z({...process.env},r),stdio:"inherit"});if(i.error)throw i.error;return i.status??1},an=(e,n,r,s,i={})=>e.name==="aube"?u(e,pe(n),r,s,i):g(e,()=>ne(e.name,e.version,n),r,s,i),tn=(e,n,r,s,i,a={})=>{if(e.name==="aube")return u(e,ke(n,r),s,i,a);const t=me(e,n,r);return t.kind==="skip"?(i.warn(`warning: ${t.warning}`),0):t.kind==="rewrite"?u(e,{args:t.args,bin:t.bin,warnings:t.warning?[t.warning]:[]},s,i,a):g(e,()=>ae(e.name,e.version,n,r),s,i,a)};export{He as a,an as b,_e as c,Re as d,Ke as e,Ze as f,Ge as g,Ve as h,en as i,tn as j,Xe as k,nn as l,Qe as m,Je as n,rn as o,ze as p,sn as r,ve as s};
@@ -1,4 +1,4 @@
1
- import{createRequire as p}from"node:module";import{V as l}from"./vis-user-error-k7CLTpA4.js";let g;const m=e=>(g??=p(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,n]=c.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return c.getBuiltinModule(e)}return m(e)},{createInterface:j}=h("node:readline"),y=e=>{const s=new Set;for(const n of Object.values(e.projects))for(const t of Object.keys(n.targets??{}))s.add(t);return[...s].sort()},b=e=>{const s=new Map;for(const n of e.values())for(const[t,o]of Object.entries(n))for(const r of o.aliases??[])s.has(r)||s.set(r,t);return s},$=(e,s)=>s.get(e)??e,w=(e,s)=>{if(e.length===0)return s.length;if(s.length===0)return e.length;const n=[];for(let t=0;t<=s.length;t++)n[t]=[t];for(let t=0;t<=e.length;t++)n[0][t]=t;for(let t=1;t<=s.length;t++)for(let o=1;o<=e.length;o++){const r=s[t-1]===e[o-1]?0:1;n[t][o]=Math.min(n[t-1][o]+1,n[t][o-1]+1,n[t-1][o-1]+r)}return n[s.length][e.length]},v=(e,s,n=3)=>f(e,s,1,n)[0],f=(e,s,n=3,t=3)=>{const o=[];for(const r of s){const i=w(e.toLowerCase(),r.toLowerCase());i<=t&&o.push({distance:i,name:r})}return o.sort((r,i)=>r.distance-i.distance||r.name.localeCompare(i.name)),o.slice(0,n).map(r=>r.name)},M=e=>e.length===0?" (no targets found)":e.map(s=>` - ${s}`).join(`
1
+ import{createRequire as p}from"node:module";import{V as l}from"./vis-user-error-S0Fesz5y.js";let g;const m=e=>(g??=p(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,n]=c.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return c.getBuiltinModule(e)}return m(e)},{createInterface:j}=h("node:readline"),y=e=>{const s=new Set;for(const n of Object.values(e.projects))for(const t of Object.keys(n.targets??{}))s.add(t);return[...s].sort()},b=e=>{const s=new Map;for(const n of e.values())for(const[t,o]of Object.entries(n))for(const r of o.aliases??[])s.has(r)||s.set(r,t);return s},$=(e,s)=>s.get(e)??e,w=(e,s)=>{if(e.length===0)return s.length;if(s.length===0)return e.length;const n=[];for(let t=0;t<=s.length;t++)n[t]=[t];for(let t=0;t<=e.length;t++)n[0][t]=t;for(let t=1;t<=s.length;t++)for(let o=1;o<=e.length;o++){const r=s[t-1]===e[o-1]?0:1;n[t][o]=Math.min(n[t-1][o]+1,n[t][o-1]+1,n[t-1][o-1]+r)}return n[s.length][e.length]},v=(e,s,n=3)=>f(e,s,1,n)[0],f=(e,s,n=3,t=3)=>{const o=[];for(const r of s){const i=w(e.toLowerCase(),r.toLowerCase());i<=t&&o.push({distance:i,name:r})}return o.sort((r,i)=>r.distance-i.distance||r.name.localeCompare(i.name)),o.slice(0,n).map(r=>r.name)},M=e=>e.length===0?" (no targets found)":e.map(s=>` - ${s}`).join(`
2
2
  `),S=async e=>{if(e.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,i]of e.entries())process.stdout.write(` ${String(r+1).padStart(2," ")}. ${i}
4
4
  `);process.stdout.write(`
@@ -1 +1 @@
1
- import{s as i}from"./index-B4AjSxHU.js";import{g as u}from"./packument-C9nRiBJf.js";import{c as d}from"../packem_chunks/cli-main.js";const v=8,h=async(r,e,o)=>{if(r.length===0)return[];const t=Math.max(1,Math.min(e,r.length)),s=Array.from({length:r.length});let n=0;const c=async()=>{for(;n<r.length;){const a=n;n+=1;const l=r[a];s[a]=await o(l,a)}};return await Promise.all(Array.from({length:t},()=>c())),s},f=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,p=(r,e)=>i.valid(e)?Object.keys(r.versions).filter(t=>i.valid(t)!==null&&i.lt(t,e)).filter(t=>i.satisfies(t,"*",{includePrerelease:!1})).filter(t=>f(r,t)).sort((t,s)=>i.lt(t,s)?1:-1)[0]:void 0,m=async(r,e={})=>{if(d("provenance"))return[];const o=new Set(e.allowlist),t=e.concurrency??v;return(await h(r,t,async({name:n,version:c})=>{if(o.has(n))return;const a=await u(n,{workspaceRoot:e.workspaceRoot});if(a===void 0||f(a,c))return;const l=p(a,c);if(l!==void 0)return{packageName:n,priorVersionWithProvenance:l,version:c}})).filter(n=>n!==void 0)};export{v as D,p as f,h as m,m as r};
1
+ import{s as i}from"./index-B4AjSxHU.js";import{g as u}from"./packument-zb18Jnlw.js";import{c as d}from"../packem_chunks/cli-main.js";const v=8,h=async(r,e,o)=>{if(r.length===0)return[];const t=Math.max(1,Math.min(e,r.length)),s=Array.from({length:r.length});let n=0;const c=async()=>{for(;n<r.length;){const a=n;n+=1;const l=r[a];s[a]=await o(l,a)}};return await Promise.all(Array.from({length:t},()=>c())),s},f=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,p=(r,e)=>i.valid(e)?Object.keys(r.versions).filter(t=>i.valid(t)!==null&&i.lt(t,e)).filter(t=>i.satisfies(t,"*",{includePrerelease:!1})).filter(t=>f(r,t)).sort((t,s)=>i.lt(t,s)?1:-1)[0]:void 0,m=async(r,e={})=>{if(d("provenance"))return[];const o=new Set(e.allowlist),t=e.concurrency??v;return(await h(r,t,async({name:n,version:c})=>{if(o.has(n))return;const a=await u(n,{workspaceRoot:e.workspaceRoot});if(a===void 0||f(a,c))return;const l=p(a,c);if(l!==void 0)return{packageName:n,priorVersionWithProvenance:l,version:c}})).filter(n=>n!==void 0)};export{v as D,p as f,h as m,m as r};
@@ -1 +1 @@
1
- import{r as u,c as a,T as l,a as f,C as d}from"./index-BdMIfGVZ.js";const m=e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,p=(e,r,c)=>l(e,{start:r},{tabWidth:!1,...c}),g=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,N=(e,r)=>{const c=g.exec(r);if(!c)return;const[,i,t,n]=c;if(t&&n)return{column:Number(n),line:Number(t)};let o=Number(i);return o===e.length&&(o=e.length-1),a(e,o)},b=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,h=e=>e.replace(b,(r,c,i)=>`"${i}"(${m(i)})`);function $(e,r,c,i){let t;try{return JSON.parse(e,r)}catch(s){t=s.message}let n;e?(n=N(e,t),t=h(t)):t+=" while parsing empty string";const o=new u(t);throw o.fileName=c,n&&(o.codeFrame=p(e,n,i)),o}function x(e,r,c){const i=f(e,{buffer:!0,encoding:void 0});let t=new TextDecoder().decode(i);const{beforeParse:n,color:o}={};return typeof n=="function"&&(t=n(t)),$(t,r,d(e),{color:o})}export{$ as N,x as p};
1
+ import{r as u,c as a,T as l,z as f,C as d}from"./index-BzhrR_iC.js";const m=e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,p=(e,r,c)=>l(e,{start:r},{tabWidth:!1,...c}),g=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,N=(e,r)=>{const c=g.exec(r);if(!c)return;const[,i,t,n]=c;if(t&&n)return{column:Number(n),line:Number(t)};let o=Number(i);return o===e.length&&(o=e.length-1),a(e,o)},b=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,h=e=>e.replace(b,(r,c,i)=>`"${i}"(${m(i)})`);function $(e,r,c,i){let t;try{return JSON.parse(e,r)}catch(s){t=s.message}let n;e?(n=N(e,t),t=h(t)):t+=" while parsing empty string";const o=new u(t);throw o.fileName=c,n&&(o.codeFrame=p(e,n,i)),o}function x(e,r,c){const i=f(e,{buffer:!0,encoding:void 0});let t=new TextDecoder().decode(i);const{beforeParse:n,color:o}={};return typeof n=="function"&&(t=n(t)),$(t,r,d(e),{color:o})}export{$ as N,x as p};
@@ -1 +1 @@
1
- import{createRequire as _}from"node:module";import{e as l}from"./index-BdMIfGVZ.js";import{g as T}from"./formatBytes-BHAzNIrn-DRcKvqnb.js";import{y as d}from"./isAccessibleSync-DYKTrrvc-BwaMhQs0.js";import{p as b}from"./readJsonSync-CbryXYxN-Bm5i10UW.js";import{h as j}from"./writeFileSync-DJoHk3Ks-Dhem3Uof.js";let p;const g=e=>(p??=_(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return g(e)},{rmSync:f,writeFileSync:k}=v("node:fs"),C=1440*60*1e3,A=15e3,E="https://registry.npmjs.org/-/npm/v1/keys",m=()=>l(T(),"registry-keys"),c=()=>l(m(),"npmjs.json"),L=()=>{const e=c();if(d(e))try{const t=b(e),r=Date.now()-t.createdAt>t.ttlMs;return{entry:t,expired:r}}catch{f(e,{force:!0});return}},M=(e,t)=>{j(m());const r={createdAt:Date.now(),keys:e,ttlMs:t};k(c(),JSON.stringify(r),"utf8")},F=async(e={})=>{const t=e.ttlMs??C,r=e.keysUrl??process.env.VIS_NPM_KEYS_URL??E,s=L();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,h=setTimeout(()=>{n.abort()},A),i=()=>{n.abort()};e.signal?.addEventListener("abort",i,{once:!0});try{const a=await fetch(r,{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 u=await a.json(),y=Array.isArray(u.keys)?u.keys:[];return M(y,t),{fromCache:!1,keys:y}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(h),e.signal?.removeEventListener("abort",i)}},P=()=>{const e=c();return d(e)?(f(e,{force:!0}),!0):!1};export{P as c,F as f};
1
+ import{createRequire as _}from"node:module";import{e as l}from"./index-BzhrR_iC.js";import{g as T}from"./formatBytes-_HvjOy8a-B_qQr4Hw.js";import{y as d}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as b}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as j}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let p;const g=e=>(p??=_(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return g(e)},{rmSync:f,writeFileSync:k}=v("node:fs"),C=1440*60*1e3,A=15e3,E="https://registry.npmjs.org/-/npm/v1/keys",m=()=>l(T(),"registry-keys"),c=()=>l(m(),"npmjs.json"),L=()=>{const e=c();if(d(e))try{const t=b(e),r=Date.now()-t.createdAt>t.ttlMs;return{entry:t,expired:r}}catch{f(e,{force:!0});return}},M=(e,t)=>{j(m());const r={createdAt:Date.now(),keys:e,ttlMs:t};k(c(),JSON.stringify(r),"utf8")},F=async(e={})=>{const t=e.ttlMs??C,r=e.keysUrl??process.env.VIS_NPM_KEYS_URL??E,s=L();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,h=setTimeout(()=>{n.abort()},A),i=()=>{n.abort()};e.signal?.addEventListener("abort",i,{once:!0});try{const a=await fetch(r,{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 u=await a.json(),y=Array.isArray(u.keys)?u.keys:[];return M(y,t),{fromCache:!1,keys:y}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(h),e.signal?.removeEventListener("abort",i)}},P=()=>{const e=c();return d(e)?(f(e,{force:!0}),!0):!1};export{P as c,F as f};
@@ -1,4 +1,4 @@
1
- import{i as R}from"./index-BjdW45xX.js";import{k as A}from"./formatBytes-BHAzNIrn-DRcKvqnb.js";import{d as M,p as k}from"./prompt-DMzaQEVa.js";import{h as S,M as T,r as E,a as P,b as C,c as x,d as O,e as V,f as F}from"./s1ngularity-UCZN7skW.js";import{D as h,m as g,r as L}from"./provenance-DF-ypZj3.js";import{g as y}from"./packument-C9nRiBJf.js";import{c as N,p as w}from"../packem_chunks/cli-main.js";import{r as _}from"./signatures-CicxPHN4.js";import{s as I}from"./index-B4AjSxHU.js";import{p as U}from"./utils-DQFHJn72.js";const j=15,B=e=>{const a=(e.TERM??"").toLowerCase();return a!=="dumb"&&a!=="unknown"&&a!==""},W=async(e,a,t,r)=>new Promise(d=>{if(r?.aborted){d(!1);return}const o=B(t)&&a.isTTY!==!1;let s=e;const c=()=>{o?a.write(`\rContinuing in ${String(s)}s... press Ctrl-C to abort. `):s===e&&a.write(`Warnings present; proceeding in ${String(e)}s.
1
+ import{i as R}from"./index-BjdW45xX.js";import{k as A}from"./formatBytes-_HvjOy8a-B_qQr4Hw.js";import{d as M,p as k}from"./prompt-DMzaQEVa.js";import{h as S,M as T,r as E,a as P,b as C,c as x,d as O,e as V,f as F}from"./s1ngularity-CO5GkkqX.js";import{D as h,m as g,r as L}from"./provenance-L1M2FPy_.js";import{g as y}from"./packument-zb18Jnlw.js";import{c as N,p as w}from"../packem_chunks/cli-main.js";import{r as _}from"./signatures-DIqFUOfs.js";import{s as I}from"./index-B4AjSxHU.js";import{p as U}from"./utils-DQFHJn72.js";const j=15,B=e=>{const a=(e.TERM??"").toLowerCase();return a!=="dumb"&&a!=="unknown"&&a!==""},W=async(e,a,t,r)=>new Promise(d=>{if(r?.aborted){d(!1);return}const o=B(t)&&a.isTTY!==!1;let s=e;const c=()=>{o?a.write(`\rContinuing in ${String(s)}s... press Ctrl-C to abort. `):s===e&&a.write(`Warnings present; proceeding in ${String(e)}s.
2
2
  `)};c();const u=setInterval(()=>{if(s-=1,s<=0){clearInterval(u),r?.removeEventListener("abort",i),o&&a.write(`\rContinuing now.
3
3
  `),d(!0);return}c()},1e3),i=()=>{clearInterval(u),o&&a.write(`\rAborted.
4
4
  `),d(!1)};r?.addEventListener("abort",i,{once:!0})}),Y=async(e,a={})=>{if(e.length===0)return{proceed:!0};const t=a.env??process.env,r=a.isTty??!!process.stdin.isTTY,d=a.isCi??R,o=a.strict??!1,s=a.readline??M,c=a.output??{isTTY:!!process.stdout.isTTY,write:p=>process.stdout.write(p)},u=A(t.VIS_DISABLE_AUTO_CONTINUE),i=Number.parseInt(t.VIS_AUTO_CONTINUE_SECONDS??"",10),l=a.countdownSeconds??(Number.isFinite(i)&&i>0?i:j);return e.some(p=>p.severity==="error")?o?{proceed:!1,reason:"errors-present"}:d?{proceed:!1,reason:"errors-present"}:r?await k("Proceed despite errors? [y/N] ",s)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!1,reason:"non-tty"}:o?{proceed:!1,reason:"ci-strict"}:r?u?await k("Proceed despite warnings? [y/N] ",s)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:await W(l,c,t,a.signal)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!0}},Ne=async(e,a={})=>{if(e.isEmpty())return!0;const t=e.all(),r=a.output??{isTTY:!!process.stdout.isTTY,write:o=>process.stdout.write(o)};for(const o of S(t))r.write(`${o}
@@ -1 +1 @@
1
- import{e as d,$ as p,s as m}from"./index-BdMIfGVZ.js";import{y as k}from"./isAccessibleSync-DYKTrrvc-BwaMhQs0.js";const E={id:"bun",label:"Bun",lockfiles:["bun.lock","bun.lockb"]},b={id:"node",label:"Node.js",lockfiles:["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json"]},f=["bun","node"],g=o=>f.includes(o),l={bun:E,node:b},a=f,I=a.flatMap(o=>l[o].lockfiles.map(n=>[n,o])),c=(o,n)=>{if(g(o))return o;throw new Error(`${n} requested unknown runtime "${o}". Supported: ${a.join(", ")}.`)},R=o=>{let n=o;for(;;){for(const[t,e]of I)if(k(d(n,t)))return e;const r=p(n);if(r===n||m(n).root===n)return;n=r}},M=(o,n={})=>{const r=n.env??process.env,t=(i,u)=>({adapter:l[i],runtime:i,source:u});if(n.flag!==void 0&&n.flag!=="")return t(c(n.flag,"--runtime"),"flag");const e=r.VIS_RUNTIME;if(e!==void 0&&e!=="")return t(c(e,"VIS_RUNTIME"),"env");if(n.config!==void 0)return t(c(n.config,"config runtime:"),"config");const s=R(o);return s!==void 0?t(s,"lockfile"):t("node","default")};export{M as r};
1
+ import{e as d,m as p,b as m}from"./index-BzhrR_iC.js";import{y as k}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const b={id:"bun",label:"Bun",lockfiles:["bun.lock","bun.lockb"]},E={id:"node",label:"Node.js",lockfiles:["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json"]},f=["bun","node"],g=o=>f.includes(o),l={bun:b,node:E},a=f,I=a.flatMap(o=>l[o].lockfiles.map(n=>[n,o])),c=(o,n)=>{if(g(o))return o;throw new Error(`${n} requested unknown runtime "${o}". Supported: ${a.join(", ")}.`)},R=o=>{let n=o;for(;;){for(const[t,e]of I)if(k(d(n,t)))return e;const r=p(n);if(r===n||m(n).root===n)return;n=r}},M=(o,n={})=>{const r=n.env??process.env,t=(i,u)=>({adapter:l[i],runtime:i,source:u});if(n.flag!==void 0&&n.flag!=="")return t(c(n.flag,"--runtime"),"flag");const e=r.VIS_RUNTIME;if(e!==void 0&&e!=="")return t(c(e,"VIS_RUNTIME"),"env");if(n.config!==void 0)return t(c(n.config,"config runtime:"),"config");const s=R(o);return s!==void 0?t(s,"lockfile"):t("node","default")};export{M as r};
@@ -1 +1 @@
1
- import{createRequire as O}from"node:module";import{e as i,$ as p}from"./index-BdMIfGVZ.js";import{p as E}from"./augment-CxUPE8KX.js";let h;const y=s=>(h??=O(import.meta.url))(s),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=s=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[e,r]=c.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return c.getBuiltinModule(s)}return y(s)},{spawnSync:u}=m("node:child_process"),{existsSync:l}=m("node:fs"),b=s=>{let e=s;for(;;){const r=i(e,".pnp.cjs");if(l(r)){const o=i(e,".pnp.loader.mjs");return{esmLoader:l(o)?o:void 0,pnpCjs:r}}const t=p(e);if(t===e)return;e=t}},x=s=>{const e=b(s);if(e===void 0)return[];const r=["--require",e.pnpCjs];return e.esmLoader!==void 0&&r.push("--import",e.esmLoader),r},I=[{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]}],P=[22,4],j=s=>{const[e,r]=s.split(".").map(t=>Number.parseInt(t,10));return[e??0,r??0]},f=(s,e)=>s[0]>e[0]||s[0]===e[0]&&s[1]>=e[1],T=(s,e)=>s[0]<e[0]||s[0]===e[0]&&s[1]<=e[1],L=(s,e)=>f(s,e.min)&&(e.max===void 0||T(s,e.max)),A=s=>{const e=s.trim().toLowerCase();return e===""||e==="all"||e==="1"||e==="true"},d=(s,e)=>A(s)||s.split(",").some(r=>r.trim().toLowerCase()===e),g=(s,e,r)=>{const t=j(e),o=[];for(const n of I)d(s,n.key)&&L(t,n)&&o.push(n.flag);return d(s,"localstorage")&&f(t,P)&&(o.includes("--experimental-webstorage")||o.push("--experimental-webstorage"),o.push(`--localstorage-file=${r}`)),o},v="VIS_X_REEXEC",C=(s,e,r)=>{const t={...process.env},o=i(p(process.argv[1]),"runtime","preload.js");if(t.NODE_OPTIONS){const a=t.NODE_OPTIONS.replace(`--import ${JSON.stringify(o)}`,"").replace(`--import ${o}`,"").replaceAll(/\s+/gu," ").trim();a===""?delete t.NODE_OPTIONS:t.NODE_OPTIONS=a}delete t.VIS_AUGMENT_SUBPROCESS,delete t.VIS_UNFLAG,delete t.VIS_POLYFILL;const n=u(process.execPath,[s,...e],{cwd:r,env:t,stdio:"inherit"});if(n.error)throw n.error;return n.status??(n.signal===null?0:1)},_=s=>{let e=s;for(;;){if(l(i(e,"package.json"))||l(i(e,".pnp.cjs")))return i(e,".vis","localstorage");const r=p(e);if(r===e)return i(s,".vis","localstorage");e=r}},R=s=>{const e=process.env.VIS_UNFLAG;return[...e===void 0?[]:g(e,process.versions.node,_(s)),...x(s)]},U=(s,e,r)=>{const t=u("bun",["run",s,...e],{cwd:r,stdio:"inherit"});if(t.error)throw t.error.code==="ENOENT"?new Error("Runtime is set to bun but the `bun` binary is not on PATH. Install it from https://bun.sh."):t.error;return t.status??(t.signal===null?0:1)},k=(s,e,r,t)=>{const o=u(process.execPath,[...s,process.argv[1],"x",e,...r],{cwd:t,env:{...process.env,[v]:"1"},stdio:"inherit"});return o.status??(o.signal===null?0:1)},w=async(s,e,r)=>{if(process.env[v]===void 0){const n=R(r);if(n.length>0)return k(n,s,e,r)}if(process.env.VIS_AUGMENT_SUBPROCESS!==void 0){const n=i(p(process.argv[1]),"runtime","preload.js"),a=process.env.VIS_UNFLAG,N=a===void 0?[]:g(a,process.versions.node,_(r)),S=[process.env.NODE_OPTIONS??"",...N,`--import ${JSON.stringify(n)}`].filter(Boolean);process.env.NODE_OPTIONS=S.join(" ").trim()}const{importTs:t}=await import("../packem_chunks/ts-loader.js").then(n=>n.t);await E(r);const o=process.argv;process.argv=[process.execPath,s,...e];try{await t(s)}finally{process.argv=o}return typeof process.exitCode=="number"?process.exitCode:0},B=async(s,e,r,t,o={})=>o.node?C(s,e,t):r==="bun"?U(s,e,t):w(s,e,t);export{B as r};
1
+ import{createRequire as O}from"node:module";import{e as i,m as p}from"./index-BzhrR_iC.js";import{p as E}from"./augment-B9kSZuvW.js";let h;const y=s=>(h??=O(import.meta.url))(s),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=s=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[e,r]=c.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return c.getBuiltinModule(s)}return y(s)},{spawnSync:u}=d("node:child_process"),{existsSync:l}=d("node:fs"),b=s=>{let e=s;for(;;){const r=i(e,".pnp.cjs");if(l(r)){const o=i(e,".pnp.loader.mjs");return{esmLoader:l(o)?o:void 0,pnpCjs:r}}const t=p(e);if(t===e)return;e=t}},x=s=>{const e=b(s);if(e===void 0)return[];const r=["--require",e.pnpCjs];return e.esmLoader!==void 0&&r.push("--import",e.esmLoader),r},I=[{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]}],P=[22,4],j=s=>{const[e,r]=s.split(".").map(t=>Number.parseInt(t,10));return[e??0,r??0]},f=(s,e)=>s[0]>e[0]||s[0]===e[0]&&s[1]>=e[1],T=(s,e)=>s[0]<e[0]||s[0]===e[0]&&s[1]<=e[1],L=(s,e)=>f(s,e.min)&&(e.max===void 0||T(s,e.max)),A=s=>{const e=s.trim().toLowerCase();return e===""||e==="all"||e==="1"||e==="true"},m=(s,e)=>A(s)||s.split(",").some(r=>r.trim().toLowerCase()===e),g=(s,e,r)=>{const t=j(e),o=[];for(const n of I)m(s,n.key)&&L(t,n)&&o.push(n.flag);return m(s,"localstorage")&&f(t,P)&&(o.includes("--experimental-webstorage")||o.push("--experimental-webstorage"),o.push(`--localstorage-file=${r}`)),o},v="VIS_X_REEXEC",C=(s,e,r)=>{const t={...process.env},o=i(p(process.argv[1]),"runtime","preload.js");if(t.NODE_OPTIONS){const a=t.NODE_OPTIONS.replace(`--import ${JSON.stringify(o)}`,"").replace(`--import ${o}`,"").replaceAll(/\s+/gu," ").trim();a===""?delete t.NODE_OPTIONS:t.NODE_OPTIONS=a}delete t.VIS_AUGMENT_SUBPROCESS,delete t.VIS_UNFLAG,delete t.VIS_POLYFILL;const n=u(process.execPath,[s,...e],{cwd:r,env:t,stdio:"inherit"});if(n.error)throw n.error;return n.status??(n.signal===null?0:1)},_=s=>{let e=s;for(;;){if(l(i(e,"package.json"))||l(i(e,".pnp.cjs")))return i(e,".vis","localstorage");const r=p(e);if(r===e)return i(s,".vis","localstorage");e=r}},R=s=>{const e=process.env.VIS_UNFLAG;return[...e===void 0?[]:g(e,process.versions.node,_(s)),...x(s)]},U=(s,e,r)=>{const t=u("bun",["run",s,...e],{cwd:r,stdio:"inherit"});if(t.error)throw t.error.code==="ENOENT"?new Error("Runtime is set to bun but the `bun` binary is not on PATH. Install it from https://bun.sh."):t.error;return t.status??(t.signal===null?0:1)},k=(s,e,r,t)=>{const o=u(process.execPath,[...s,process.argv[1],"x",e,...r],{cwd:t,env:{...process.env,[v]:"1"},stdio:"inherit"});return o.status??(o.signal===null?0:1)},w=async(s,e,r)=>{if(process.env[v]===void 0){const n=R(r);if(n.length>0)return k(n,s,e,r)}if(process.env.VIS_AUGMENT_SUBPROCESS!==void 0){const n=i(p(process.argv[1]),"runtime","preload.js"),a=process.env.VIS_UNFLAG,N=a===void 0?[]:g(a,process.versions.node,_(r)),S=[process.env.NODE_OPTIONS??"",...N,`--import ${JSON.stringify(n)}`].filter(Boolean);process.env.NODE_OPTIONS=S.join(" ").trim()}const{importTs:t}=await import("../packem_chunks/ts-loader.js").then(n=>n.t);await E(r);const o=process.argv;process.argv=[process.execPath,s,...e];try{await t(s)}finally{process.argv=o}return typeof process.exitCode=="number"?process.exitCode:0},B=async(s,e,r,t,o={})=>o.node?C(s,e,t):r==="bun"?U(s,e,t):w(s,e,t);export{B as r};
@@ -1 +1 @@
1
- import{e as f,a as d}from"./index-BdMIfGVZ.js";import{whichBin as m}from"#native";import{p as h}from"./readJsonSync-CbryXYxN-Bm5i10UW.js";import{y as k}from"./isAccessibleSync-DYKTrrvc-BwaMhQs0.js";const v=s=>{for(const r of[".nvmrc",".node-version"]){const o=f(s,r);if(k(o))try{return d(o).trim().replace(/^v/,"")}catch{}}},l=(s,r)=>{const o=s.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),a=r.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),e=Math.max(o.length,a.length);for(let n=0;n<e;n++){const t=o[n]??0,i=a[n]??0;if(t!==i)return t-i}return 0},b=(s,r)=>{const o=r.trim();if(o===""||o==="*")return!0;const a=o.split(/\s+/).filter(Boolean);for(const e of a)if(e.startsWith(">=")){if(l(s,e.slice(2).trim())<0)return!1}else if(e.startsWith("<=")){if(l(s,e.slice(2).trim())>0)return!1}else if(e.startsWith(">")){if(l(s,e.slice(1).trim())<=0)return!1}else if(e.startsWith("<")){if(l(s,e.slice(1).trim())>=0)return!1}else if(/^\d/.test(e)){const n=s.split("."),t=e.split(".");for(const[i,c]of t.entries())if(c!==n[i])return!1}return!0},x=s=>{const r=[],o=f(s,"package.json");let a;try{a=h(o)}catch{return r}const e=process.versions.node;if(a.engines?.node){const t=a.engines.node;b(e,t)||r.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(s);if(n){const[t,i]=n.split("."),[c,p]=e.split(".");(t!==c||i!==void 0&&i!==p)&&r.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(a.packageManager){const[t,i]=a.packageManager.split("@"),c=(process.env.npm_config_user_agent??"").split(" ")[0]??"",[p,u]=c.split("/"),g=t==="aube"&&m("aube")!==null;p&&t&&p!==t?r.push({actual:p,expected:t,kind:"packageManager",message:`package.json packageManager pins ${a.packageManager} but the current invocation is ${c}. Install the correct package manager.`,severity:g?"warning":"error"}):u&&i&&u!==i&&r.push({actual:u,expected:i,kind:"packageManager",message:`package.json packageManager pins ${t}@${i} but the current invocation uses ${t}@${u}.`,severity:"warning"})}return r};export{x as c};
1
+ import{e as f,z as d}from"./index-BzhrR_iC.js";import{whichBin as m}from"#native";import{p as h}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{y as k}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const v=s=>{for(const r of[".nvmrc",".node-version"]){const o=f(s,r);if(k(o))try{return d(o).trim().replace(/^v/,"")}catch{}}},l=(s,r)=>{const o=s.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),a=r.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),e=Math.max(o.length,a.length);for(let n=0;n<e;n++){const t=o[n]??0,i=a[n]??0;if(t!==i)return t-i}return 0},b=(s,r)=>{const o=r.trim();if(o===""||o==="*")return!0;const a=o.split(/\s+/).filter(Boolean);for(const e of a)if(e.startsWith(">=")){if(l(s,e.slice(2).trim())<0)return!1}else if(e.startsWith("<=")){if(l(s,e.slice(2).trim())>0)return!1}else if(e.startsWith(">")){if(l(s,e.slice(1).trim())<=0)return!1}else if(e.startsWith("<")){if(l(s,e.slice(1).trim())>=0)return!1}else if(/^\d/.test(e)){const n=s.split("."),t=e.split(".");for(const[i,c]of t.entries())if(c!==n[i])return!1}return!0},x=s=>{const r=[],o=f(s,"package.json");let a;try{a=h(o)}catch{return r}const e=process.versions.node;if(a.engines?.node){const t=a.engines.node;b(e,t)||r.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(s);if(n){const[t,i]=n.split("."),[c,p]=e.split(".");(t!==c||i!==void 0&&i!==p)&&r.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(a.packageManager){const[t,i]=a.packageManager.split("@"),c=(process.env.npm_config_user_agent??"").split(" ")[0]??"",[p,u]=c.split("/"),g=t==="aube"&&m("aube")!==null;p&&t&&p!==t?r.push({actual:p,expected:t,kind:"packageManager",message:`package.json packageManager pins ${a.packageManager} but the current invocation is ${c}. Install the correct package manager.`,severity:g?"warning":"error"}):u&&i&&u!==i&&r.push({actual:u,expected:i,kind:"packageManager",message:`package.json packageManager pins ${t}@${i} but the current invocation uses ${t}@${u}.`,severity:"warning"})}return r};export{x as c};
@@ -1 +1 @@
1
- import{createRequire as X}from"node:module";import{X as j,b as T}from"./index.server-D8BLnYZO.js";import{e as A}from"./index-BdMIfGVZ.js";import{g as L}from"./formatBytes-BHAzNIrn-DRcKvqnb.js";import{D as m,m as y}from"./provenance-DF-ypZj3.js";import{g as E}from"./packument-C9nRiBJf.js";import{c as w}from"../packem_chunks/cli-main.js";import{y as U}from"./isAccessibleSync-DYKTrrvc-BwaMhQs0.js";import{p as O}from"./readJsonSync-CbryXYxN-Bm5i10UW.js";import{h as C}from"./writeFileSync-DJoHk3Ks-Dhem3Uof.js";import{s as p}from"./index-B4AjSxHU.js";let Y;const Q=r=>(Y??=X(import.meta.url))(r),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=r=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,t]=b.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return b.getBuiltinModule(r)}return Q(r)},{rmSync:D,writeFileSync:P}=$("node:fs"),{createHash:Z}=$("node:crypto"),{Resolver:ee}=$("node:dns/promises");class rr{entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const tr=r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(j(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${j("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(T(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${T("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}return e},nr=r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),re=1440*60*1e3,te=15e3,ne="https://api.github.com/repos",W=()=>A(L(),"archived-repo"),q=(r,e)=>A(W(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),se=(r,e)=>{const t=q(r,e);if(U(t))try{const n=O(t);if(Date.now()-n.createdAt>n.ttlMs){D(t,{force:!0});return}return n}catch{D(t,{force:!0});return}},B=(r,e,t,n)=>{C(W());const s={createdAt:Date.now(),ttlMs:n,...t};P(q(r,e),JSON.stringify(s),"utf8")},oe=r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},ie=async(r,e,t,n)=>{const s=`${ne}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,l=new AbortController,o=setTimeout(()=>{l.abort()},te),i=()=>{l.abort()};n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const c=await fetch(s,{headers:a,signal:l.signal});if(c.status===404)return{kind:"missing"};if(!c.ok)return{kind:"transient-error"};const d=await c.json(),u=d.archived===!0,f=typeof d.archived_at=="string"?d.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},ae=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),sr=async(r,e={})=>{if(w("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??re,s=e.githubToken??process.env.GITHUB_TOKEN,l=e.concurrency??m,o=new Map,i=async(c,d)=>{const u=`${c}/${d}`;let f=o.get(u);return f===void 0&&(f=(async()=>{const h=se(c,d);if(h!==void 0)return h.missing===!0?{archived:!1,kind:"missing"}:{archived:h.archived,archivedAt:h.archivedAt,kind:"ok"};const v=await ie(c,d,s,e.signal);return v.kind==="missing"?B(c,d,{archived:!1,missing:!0},n):v.kind==="ok"&&B(c,d,{archived:v.archived===!0,archivedAt:v.archivedAt},n),v})(),o.set(u,f)),f};return(await y(r,l,async({name:c,version:d})=>{if(t.has(c))return;const u=await E(c,{workspaceRoot:e.workspaceRoot});if(u===void 0)return;const f=u.versions[d]??u.versions[ae(Object.keys(u.versions),u["dist-tags"]?.latest)??""];if(f===void 0)return;const h=oe(f.repository?.url);if(h===void 0)return;const v=await i(h.owner,h.repo);if(v.kind!=="transient-error"){if(v.kind==="missing")return{kind:"missing-repo",owner:h.owner,packageName:c,repo:h.repo};if(v.archived===!0)return{...v.archivedAt===void 0?{}:{archivedAt:v.archivedAt},kind:"archived",owner:h.owner,packageName:c,repo:h.repo}}})).filter(c=>c!==void 0)},ce={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},de=1440*60*1e3,F=(r,e)=>(r-e)/de,_=r=>{if(r!==void 0)return r.email??r.name},ue=(r,e,t,n,s)=>{const l=r.time?.[t];if(l===void 0)return;const o=new Date(l).getTime();if(!Number.isFinite(o))return;const i=F(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},le=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const a=Object.keys(r.versions).filter(h=>p.valid(h)!==null).filter(h=>p.lt(h,t));if(a.length===0||a.some(h=>_(r.versions[h]?._npmUser)===o))return;const d=r.time?.[a[0]??""];if(d===void 0)return;const u=new Date(d).getTime();if(!Number.isFinite(u))return;const f=F(n,u);if(!(f<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${f.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},fe=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const i=[];for(const[d,u]of Object.entries(r.versions)){if(d===t||_(u._npmUser)!==o)continue;const f=r.time?.[d];if(f===void 0)continue;const h=new Date(f).getTime();Number.isFinite(h)&&i.push(h)}if(i.length===0)return;const a=Math.max(...i),c=F(n,a);if(c>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(c>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},or=async(r,e={})=>{if(w("author"))return[];const t=new Set(e.allowlist),n={...ce,...e.thresholds},s=e.now??(()=>Date.now()),l=e.concurrency??m;return(await y(r,l,async({name:i,version:a})=>{if(t.has(i))return[];const c=await E(i,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(c===void 0)return[];const d=s(),u=[],f=ue(c,i,a,d,n);f!==void 0&&u.push(f);const h=le(c,i,a,d,n);h!==void 0&&u.push(h);const v=fe(c,i,a,d,n);return v!==void 0&&u.push(v),u})).flat()},he=1440*60*1e3,ve=15e3,ge=20,pe=1e4,me="https://api.npmjs.org/downloads/point/last-month",G=()=>A(L(),"downloads"),J=r=>A(G(),`${encodeURIComponent(r)}.json`),ye=r=>{const e=J(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t.downloads}catch{D(e,{force:!0});return}},we=(r,e,t)=>{C(G());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};P(J(r),JSON.stringify(n),"utf8")},ke=async(r,e)=>{const t=`${me}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},ve),l=()=>{n.abort()};e?.addEventListener("abort",l,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",l)}},ir=async(r,e={})=>{if(w("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??ge,s=e.warnThreshold??pe,l=e.cacheTtlMs??he,o=e.concurrency??m;return(await y(r,o,async a=>{if(t.has(a))return;let d=ye(a);if(d===void 0){const u=await ke(a,e.signal);if(u.kind==="no-data"||u.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:a,severity:"warning"};d=u.downloads??0,we(a,d,l)}if(d<n)return{downloadsLastMonth:d,kind:"below-error",packageName:a,severity:"error"};if(d<s)return{downloadsLastMonth:d,kind:"below-warning",packageName:a,severity:"warning"}})).filter(a=>a!==void 0)},De=1440*60*1e3,Ae=4e3,Ee=["1.1.1.1","8.8.8.8"],K=()=>A(L(),"expired-domains"),z=r=>{const e=Z("sha256").update(r).digest("hex").slice(0,12);return A(K(),`${e}.json`)},be=r=>{const e=z(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t}catch{D(e,{force:!0});return}},Re=(r,e,t)=>{C(K());const n={createdAt:Date.now(),outcome:e,ttlMs:t};P(z(r),JSON.stringify(n),"utf8")},Te=r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},_e=(r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},Me=async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},Se=r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},$e=async(r,e,t)=>{try{const n=await Me(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Se(n)?{kind:"expired"}:{kind:"transient-error"}}},Pe=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),ar=async(r,e={})=>{if(w("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(f=>f.toLowerCase())),s=e.cacheTtlMs??De,l=e.perDomainTimeoutMs??Ae,o=e.dnsServers??Ee,i=e.concurrency??m,a=e.createResolver===void 0?new ee:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const c=new Map,d=async f=>{let h=c.get(f);return h===void 0&&(h=(async()=>{const v=be(f);if(v!==void 0)return{kind:v.outcome==="ok"?"ok":"expired"};const g=await $e(a,f,l);return g.kind!=="transient-error"&&Re(f,g.kind,s),g})(),c.set(f,h)),h};return(await y(r,i,async({name:f,version:h})=>{if(t.has(f))return[];const v=await E(f,{workspaceRoot:e.workspaceRoot});if(v===void 0)return[];const g=v.versions[h]??v.versions[Pe(Object.keys(v.versions),v["dist-tags"]?.latest)??""];if(g===void 0)return[];const M=_e(g.maintainers,g._npmUser),N=new Set,S=[];for(const R of M){const k=Te(R.email);if(k===void 0||n.has(k))continue;const I=`${k}:${R.email??""}`;if(N.has(I))continue;N.add(I);const x=await d(k);x.kind==="expired"?S.push({domain:k,kind:"expired",maintainer:R.email??"",packageName:f,severity:"error"}):x.kind==="transient-error"&&S.push({domain:k,kind:"unresolved",maintainer:R.email??"",packageName:f,severity:"warning"})}return S})).flat()},Le=["readme","license","repo"],Ue=["ERROR: No README data found!","# Security holding package"],Oe=r=>{const e=r.trim();return e===""?!0:Ue.some(t=>e.startsWith(t))},Ce=(r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},Fe=(r,e)=>{const t=Ce(r,e);if(t===void 0)return"missing-readme";if(Oe(t))return"placeholder-readme"},Ne=r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},Ie=r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},xe=r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},cr=async(r,e={})=>{if(w("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??Le),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i]??a.versions[xe(a)??""];if(c===void 0||c.private===!0)return;const d=[];if(n.has("readme")){const u=Fe(a,c);u!==void 0&&d.push(u)}if(n.has("license")){const u=Ne(c);u!==void 0&&d.push(u)}if(n.has("repo")){const u=Ie(c);u!==void 0&&d.push(u)}if(d.length!==0)return{issues:d,packageName:o,version:i}})).filter(o=>o!==void 0)},H=(r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},je=(r,e)=>p.valid(e)?Object.keys(r.versions).filter(n=>p.valid(n)!==null&&p.lt(n,e)).sort((n,s)=>p.lt(n,s)?1:-1)[0]:void 0,dr=async(r,e={})=>{if(w("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i];if(c===void 0)return;const d=je(a,i);if(d===void 0)return;const u=a.versions[d];if(u===void 0)return;const f=H(c.bin,o),h=H(u.bin,o),v=Object.entries(f).filter(([g])=>!(g in h)).filter(([g])=>!n.has(g)).map(([g,M])=>({command:M,name:g}));if(v.length!==0)return{fromVersion:d,newBins:v,packageName:o,toVersion:i}})).filter(o=>o!==void 0)},Be=["preinstall","install","postinstall"],V=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,He=(r,e)=>{if(p.valid(e)!==null)return Object.keys(r.versions).filter(t=>p.valid(t)!==null&&p.prerelease(t)===null&&p.lt(t,e)).sort((t,n)=>p.lt(t,n)?1:-1)[0]},Ve=(r,e)=>{const t=r??{},n=e??{},s=[];for(const l of Be){const o=t[l];if(o===void 0||o==="")continue;const i=n[l];i===void 0||i===""?s.push({command:o,hook:l,kind:"introduced"}):i!==o&&s.push({command:o,hook:l,kind:"changed"})}return s},ur=async(r,e={})=>{if(w("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??m;return(await y(r,n,async({name:l,version:o})=>{if(t.has(l))return;const i=await E(l,{workspaceRoot:e.workspaceRoot});if(i?.versions[o]===void 0)return;const a=He(i,o);if(a===void 0||!V(i,a)||V(i,o))return;const c=Ve(i.versions[o]?.scripts,i.versions[a]?.scripts);if(c.length!==0)return{hookChanges:c,packageName:l,priorVersion:a,trustSignal:"provenance-dropped",version:o}})).filter(l=>l!==void 0)};export{rr as M,ur as a,dr as b,cr as c,ir as d,ar as e,sr as f,nr as g,tr as h,or as r};
1
+ import{createRequire as X}from"node:module";import{X as j,b as T}from"./index.server-Ca_EEVfw.js";import{e as A}from"./index-BzhrR_iC.js";import{g as L}from"./formatBytes-_HvjOy8a-B_qQr4Hw.js";import{D as m,m as y}from"./provenance-L1M2FPy_.js";import{g as E}from"./packument-zb18Jnlw.js";import{c as w}from"../packem_chunks/cli-main.js";import{y as U}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as O}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as C}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";import{s as p}from"./index-B4AjSxHU.js";let Y;const Q=r=>(Y??=X(import.meta.url))(r),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=r=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,t]=b.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return b.getBuiltinModule(r)}return Q(r)},{rmSync:D,writeFileSync:P}=$("node:fs"),{createHash:Z}=$("node:crypto"),{Resolver:ee}=$("node:dns/promises");class rr{entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const tr=r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(j(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${j("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(T(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${T("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}return e},nr=r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),re=1440*60*1e3,te=15e3,ne="https://api.github.com/repos",W=()=>A(L(),"archived-repo"),q=(r,e)=>A(W(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),se=(r,e)=>{const t=q(r,e);if(U(t))try{const n=O(t);if(Date.now()-n.createdAt>n.ttlMs){D(t,{force:!0});return}return n}catch{D(t,{force:!0});return}},B=(r,e,t,n)=>{C(W());const s={createdAt:Date.now(),ttlMs:n,...t};P(q(r,e),JSON.stringify(s),"utf8")},oe=r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},ie=async(r,e,t,n)=>{const s=`${ne}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,l=new AbortController,o=setTimeout(()=>{l.abort()},te),i=()=>{l.abort()};n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const c=await fetch(s,{headers:a,signal:l.signal});if(c.status===404)return{kind:"missing"};if(!c.ok)return{kind:"transient-error"};const d=await c.json(),u=d.archived===!0,f=typeof d.archived_at=="string"?d.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},ae=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),sr=async(r,e={})=>{if(w("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??re,s=e.githubToken??process.env.GITHUB_TOKEN,l=e.concurrency??m,o=new Map,i=async(c,d)=>{const u=`${c}/${d}`;let f=o.get(u);return f===void 0&&(f=(async()=>{const h=se(c,d);if(h!==void 0)return h.missing===!0?{archived:!1,kind:"missing"}:{archived:h.archived,archivedAt:h.archivedAt,kind:"ok"};const v=await ie(c,d,s,e.signal);return v.kind==="missing"?B(c,d,{archived:!1,missing:!0},n):v.kind==="ok"&&B(c,d,{archived:v.archived===!0,archivedAt:v.archivedAt},n),v})(),o.set(u,f)),f};return(await y(r,l,async({name:c,version:d})=>{if(t.has(c))return;const u=await E(c,{workspaceRoot:e.workspaceRoot});if(u===void 0)return;const f=u.versions[d]??u.versions[ae(Object.keys(u.versions),u["dist-tags"]?.latest)??""];if(f===void 0)return;const h=oe(f.repository?.url);if(h===void 0)return;const v=await i(h.owner,h.repo);if(v.kind!=="transient-error"){if(v.kind==="missing")return{kind:"missing-repo",owner:h.owner,packageName:c,repo:h.repo};if(v.archived===!0)return{...v.archivedAt===void 0?{}:{archivedAt:v.archivedAt},kind:"archived",owner:h.owner,packageName:c,repo:h.repo}}})).filter(c=>c!==void 0)},ce={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},de=1440*60*1e3,F=(r,e)=>(r-e)/de,_=r=>{if(r!==void 0)return r.email??r.name},ue=(r,e,t,n,s)=>{const l=r.time?.[t];if(l===void 0)return;const o=new Date(l).getTime();if(!Number.isFinite(o))return;const i=F(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},le=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const a=Object.keys(r.versions).filter(h=>p.valid(h)!==null).filter(h=>p.lt(h,t));if(a.length===0||a.some(h=>_(r.versions[h]?._npmUser)===o))return;const d=r.time?.[a[0]??""];if(d===void 0)return;const u=new Date(d).getTime();if(!Number.isFinite(u))return;const f=F(n,u);if(!(f<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${f.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},fe=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const i=[];for(const[d,u]of Object.entries(r.versions)){if(d===t||_(u._npmUser)!==o)continue;const f=r.time?.[d];if(f===void 0)continue;const h=new Date(f).getTime();Number.isFinite(h)&&i.push(h)}if(i.length===0)return;const a=Math.max(...i),c=F(n,a);if(c>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(c>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},or=async(r,e={})=>{if(w("author"))return[];const t=new Set(e.allowlist),n={...ce,...e.thresholds},s=e.now??(()=>Date.now()),l=e.concurrency??m;return(await y(r,l,async({name:i,version:a})=>{if(t.has(i))return[];const c=await E(i,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(c===void 0)return[];const d=s(),u=[],f=ue(c,i,a,d,n);f!==void 0&&u.push(f);const h=le(c,i,a,d,n);h!==void 0&&u.push(h);const v=fe(c,i,a,d,n);return v!==void 0&&u.push(v),u})).flat()},he=1440*60*1e3,ve=15e3,ge=20,pe=1e4,me="https://api.npmjs.org/downloads/point/last-month",G=()=>A(L(),"downloads"),J=r=>A(G(),`${encodeURIComponent(r)}.json`),ye=r=>{const e=J(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t.downloads}catch{D(e,{force:!0});return}},we=(r,e,t)=>{C(G());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};P(J(r),JSON.stringify(n),"utf8")},ke=async(r,e)=>{const t=`${me}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},ve),l=()=>{n.abort()};e?.addEventListener("abort",l,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",l)}},ir=async(r,e={})=>{if(w("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??ge,s=e.warnThreshold??pe,l=e.cacheTtlMs??he,o=e.concurrency??m;return(await y(r,o,async a=>{if(t.has(a))return;let d=ye(a);if(d===void 0){const u=await ke(a,e.signal);if(u.kind==="no-data"||u.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:a,severity:"warning"};d=u.downloads??0,we(a,d,l)}if(d<n)return{downloadsLastMonth:d,kind:"below-error",packageName:a,severity:"error"};if(d<s)return{downloadsLastMonth:d,kind:"below-warning",packageName:a,severity:"warning"}})).filter(a=>a!==void 0)},De=1440*60*1e3,Ae=4e3,Ee=["1.1.1.1","8.8.8.8"],K=()=>A(L(),"expired-domains"),z=r=>{const e=Z("sha256").update(r).digest("hex").slice(0,12);return A(K(),`${e}.json`)},be=r=>{const e=z(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t}catch{D(e,{force:!0});return}},Re=(r,e,t)=>{C(K());const n={createdAt:Date.now(),outcome:e,ttlMs:t};P(z(r),JSON.stringify(n),"utf8")},Te=r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},_e=(r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},Me=async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},Se=r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},$e=async(r,e,t)=>{try{const n=await Me(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Se(n)?{kind:"expired"}:{kind:"transient-error"}}},Pe=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),ar=async(r,e={})=>{if(w("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(f=>f.toLowerCase())),s=e.cacheTtlMs??De,l=e.perDomainTimeoutMs??Ae,o=e.dnsServers??Ee,i=e.concurrency??m,a=e.createResolver===void 0?new ee:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const c=new Map,d=async f=>{let h=c.get(f);return h===void 0&&(h=(async()=>{const v=be(f);if(v!==void 0)return{kind:v.outcome==="ok"?"ok":"expired"};const g=await $e(a,f,l);return g.kind!=="transient-error"&&Re(f,g.kind,s),g})(),c.set(f,h)),h};return(await y(r,i,async({name:f,version:h})=>{if(t.has(f))return[];const v=await E(f,{workspaceRoot:e.workspaceRoot});if(v===void 0)return[];const g=v.versions[h]??v.versions[Pe(Object.keys(v.versions),v["dist-tags"]?.latest)??""];if(g===void 0)return[];const M=_e(g.maintainers,g._npmUser),N=new Set,S=[];for(const R of M){const k=Te(R.email);if(k===void 0||n.has(k))continue;const I=`${k}:${R.email??""}`;if(N.has(I))continue;N.add(I);const x=await d(k);x.kind==="expired"?S.push({domain:k,kind:"expired",maintainer:R.email??"",packageName:f,severity:"error"}):x.kind==="transient-error"&&S.push({domain:k,kind:"unresolved",maintainer:R.email??"",packageName:f,severity:"warning"})}return S})).flat()},Le=["readme","license","repo"],Ue=["ERROR: No README data found!","# Security holding package"],Oe=r=>{const e=r.trim();return e===""?!0:Ue.some(t=>e.startsWith(t))},Ce=(r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},Fe=(r,e)=>{const t=Ce(r,e);if(t===void 0)return"missing-readme";if(Oe(t))return"placeholder-readme"},Ne=r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},Ie=r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},xe=r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},cr=async(r,e={})=>{if(w("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??Le),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i]??a.versions[xe(a)??""];if(c===void 0||c.private===!0)return;const d=[];if(n.has("readme")){const u=Fe(a,c);u!==void 0&&d.push(u)}if(n.has("license")){const u=Ne(c);u!==void 0&&d.push(u)}if(n.has("repo")){const u=Ie(c);u!==void 0&&d.push(u)}if(d.length!==0)return{issues:d,packageName:o,version:i}})).filter(o=>o!==void 0)},H=(r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},je=(r,e)=>p.valid(e)?Object.keys(r.versions).filter(n=>p.valid(n)!==null&&p.lt(n,e)).sort((n,s)=>p.lt(n,s)?1:-1)[0]:void 0,dr=async(r,e={})=>{if(w("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i];if(c===void 0)return;const d=je(a,i);if(d===void 0)return;const u=a.versions[d];if(u===void 0)return;const f=H(c.bin,o),h=H(u.bin,o),v=Object.entries(f).filter(([g])=>!(g in h)).filter(([g])=>!n.has(g)).map(([g,M])=>({command:M,name:g}));if(v.length!==0)return{fromVersion:d,newBins:v,packageName:o,toVersion:i}})).filter(o=>o!==void 0)},Be=["preinstall","install","postinstall"],V=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,He=(r,e)=>{if(p.valid(e)!==null)return Object.keys(r.versions).filter(t=>p.valid(t)!==null&&p.prerelease(t)===null&&p.lt(t,e)).sort((t,n)=>p.lt(t,n)?1:-1)[0]},Ve=(r,e)=>{const t=r??{},n=e??{},s=[];for(const l of Be){const o=t[l];if(o===void 0||o==="")continue;const i=n[l];i===void 0||i===""?s.push({command:o,hook:l,kind:"introduced"}):i!==o&&s.push({command:o,hook:l,kind:"changed"})}return s},ur=async(r,e={})=>{if(w("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??m;return(await y(r,n,async({name:l,version:o})=>{if(t.has(l))return;const i=await E(l,{workspaceRoot:e.workspaceRoot});if(i?.versions[o]===void 0)return;const a=He(i,o);if(a===void 0||!V(i,a)||V(i,o))return;const c=Ve(i.versions[o]?.scripts,i.versions[a]?.scripts);if(c.length!==0)return{hookChanges:c,packageName:l,priorVersion:a,trustSignal:"provenance-dropped",version:o}})).filter(l=>l!==void 0)};export{rr as M,ur as a,dr as b,cr as c,ir as d,ar as e,sr as f,nr as g,tr as h,or as r};
@@ -1,2 +1,2 @@
1
- import{F as h,b as T,J as C,X as k}from"./index.server-D8BLnYZO.js";import{q as R,S as l}from"../packem_chunks/cli-main.js";import{i as $}from"./index-BjdW45xX.js";import{F as s,X as d,o as a,R as g}from"../packem_chunks/catalog.js";import{l as v}from"./spinner-ukDEdGvp.js";import{D as j,W as y,T as A,C as D}from"./symbols-BXDZ_sKt.js";const b=({rows:i})=>s.jsx(d,{flexDirection:"column",children:i.map(r=>{let t;switch(r.status){case"error":{t=s.jsx(a,{color:"red",children:D});break}case"ok":{t=s.jsx(a,{color:"green",children:A});break}case"running":{t=s.jsx(a,{color:"white",children:s.jsx(v,{type:"dots"})});break}case"warn":{t=s.jsx(a,{color:"yellow",children:y});break}default:{t=s.jsx(a,{dimColor:!0,children:j});break}}return s.jsxs(d,{children:[s.jsx(d,{width:3,children:t}),s.jsx(d,{flexGrow:1,children:s.jsx(a,{children:r.label})}),r.summary?s.jsx(d,{children:s.jsxs(a,{dimColor:!0,children:[j," ",r.summary]})}):null]},r.id)})}),I={error:k(l.failure),ok:C(l.success),pending:h(l.dash),skip:h(l.dash),warn:T(l.warning)},Y=(i,r,t)=>{const p=t?`${i} ${h(`— ${t}`)}`:i;return` ${I[r]} ${p}
1
+ import{F as h,b as T,J as C,X as k}from"./index.server-Ca_EEVfw.js";import{q as R,S as l}from"../packem_chunks/cli-main.js";import{i as $}from"./index-BjdW45xX.js";import{F as s,X as d,o as a,R as g}from"../packem_chunks/catalog.js";import{l as v}from"./spinner-BJjbNl1F.js";import{D as j,W as y,T as A,C as D}from"./symbols-BXDZ_sKt.js";const b=({rows:i})=>s.jsx(d,{flexDirection:"column",children:i.map(r=>{let t;switch(r.status){case"error":{t=s.jsx(a,{color:"red",children:D});break}case"ok":{t=s.jsx(a,{color:"green",children:A});break}case"running":{t=s.jsx(a,{color:"white",children:s.jsx(v,{type:"dots"})});break}case"warn":{t=s.jsx(a,{color:"yellow",children:y});break}default:{t=s.jsx(a,{dimColor:!0,children:j});break}}return s.jsxs(d,{children:[s.jsx(d,{width:3,children:t}),s.jsx(d,{flexGrow:1,children:s.jsx(a,{children:r.label})}),r.summary?s.jsx(d,{children:s.jsxs(a,{dimColor:!0,children:[j," ",r.summary]})}):null]},r.id)})}),I={error:k(l.failure),ok:C(l.success),pending:h(l.dash),skip:h(l.dash),warn:T(l.warning)},Y=(i,r,t)=>{const p=t?`${i} ${h(`— ${t}`)}`:i;return` ${I[r]} ${p}
2
2
  `},F=(i,r={})=>{const t=r.stream??process.stderr,w=typeof t.isTTY=="boolean"&&t.isTTY&&!$,S=r.live??w,n=new Map;for(const e of i)n.set(e.id,{id:e.id,label:e.label,status:"pending"});if(!S||i.length===0)return{finish:(e,o,f)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:f}),t.write(Y(c.label,o,f)))},start:e=>{const o=n.get(e);o&&n.set(e,{...o,status:"running"})},stop:()=>{}};const x=()=>i.map(e=>n.get(e.id));let u=R(g.createElement(b,{rows:x()}),{interactive:!0,patchConsole:!1});const m=()=>{u?.rerender(g.createElement(b,{rows:x()}))};return{finish:(e,o,f)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:f}),m())},start:e=>{const o=n.get(e);o&&(n.set(e,{...o,status:"running"}),m())},stop:()=>{u&&(m(),u.unmount(),u=void 0)}}};export{F as s};
@@ -1,3 +1,3 @@
1
- import{createRequire as m}from"node:module";import{b as E}from"./index-BdMIfGVZ.js";let _;const w=t=>(_??=m(import.meta.url))(t),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=t=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[r,e]=g.versions.node.split(".").map(Number);if(r>22||r===22&&e>=3||r===20&&e>=16)return g.getBuiltinModule(t)}return w(t)},{createInterface:v}=y("node:readline"),T=/^#([\w\-/]+):(.+)$/,b=/^([@\w\-/]+):(.+)$/,$=t=>{if(t==="")return;if(t.startsWith(":"))return{kind:"all",target:t.slice(1)};if(t.startsWith("~:"))return{kind:"closest",target:t.slice(2)};const r=T.exec(t);if(r?.[1]&&r[2])return{kind:"tag",tag:r[1],target:r[2]};const e=b.exec(t);return e?.[1]&&e[2]&&(e[1].startsWith("@")||e[1].includes("/")||e[1].includes("-"))?{kind:"project",projects:[e[1]],target:e[2]}:{kind:"all",target:t}},x=async(t,r,e,a)=>{const s=$(t);if(!s)throw new Error(`Invalid target selector: "${t}"`);const o=Object.keys(r.projects);if(s.kind==="all")return{projects:o,target:s.target};if(s.kind==="project")return{projects:s.projects??[],target:s.target};if(s.kind==="tag"){const c=s.tag;return{projects:o.filter(l=>r.projects[l]?.tags?.includes(c)??!1),target:s.target}}const n=E(a,e)||".";let u,f=-1;for(const[c,i]of Object.entries(r.projects)){const l=i.root;if(!l)continue;(n===l||n.startsWith(`${l}/`))&&l.length>f&&(f=l.length,u=c)}if(!u){if(process.stdout.isTTY){const c=v({input:process.stdin,output:process.stderr}),i=Object.keys(r.projects).sort();process.stderr.write(`No project found at ${n}. Pick one:
1
+ import{createRequire as m}from"node:module";import{a as E}from"./index-BzhrR_iC.js";let _;const w=t=>(_??=m(import.meta.url))(t),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=t=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[r,e]=g.versions.node.split(".").map(Number);if(r>22||r===22&&e>=3||r===20&&e>=16)return g.getBuiltinModule(t)}return w(t)},{createInterface:v}=y("node:readline"),T=/^#([\w\-/]+):(.+)$/,$=/^([@\w\-/]+):(.+)$/,b=t=>{if(t==="")return;if(t.startsWith(":"))return{kind:"all",target:t.slice(1)};if(t.startsWith("~:"))return{kind:"closest",target:t.slice(2)};const r=T.exec(t);if(r?.[1]&&r[2])return{kind:"tag",tag:r[1],target:r[2]};const e=$.exec(t);return e?.[1]&&e[2]&&(e[1].startsWith("@")||e[1].includes("/")||e[1].includes("-"))?{kind:"project",projects:[e[1]],target:e[2]}:{kind:"all",target:t}},x=async(t,r,e,a)=>{const s=b(t);if(!s)throw new Error(`Invalid target selector: "${t}"`);const o=Object.keys(r.projects);if(s.kind==="all")return{projects:o,target:s.target};if(s.kind==="project")return{projects:s.projects??[],target:s.target};if(s.kind==="tag"){const c=s.tag;return{projects:o.filter(l=>r.projects[l]?.tags?.includes(c)??!1),target:s.target}}const n=E(a,e)||".";let u,f=-1;for(const[c,i]of Object.entries(r.projects)){const l=i.root;if(!l)continue;(n===l||n.startsWith(`${l}/`))&&l.length>f&&(f=l.length,u=c)}if(!u){if(process.stdout.isTTY){const c=v({input:process.stdin,output:process.stderr}),i=Object.keys(r.projects).sort();process.stderr.write(`No project found at ${n}. Pick one:
2
2
  `);for(const[d,h]of i.entries())process.stderr.write(` ${String(d+1)}) ${h}
3
- `);const l=await new Promise(d=>{c.question("> ",d)});c.close();const p=Number.parseInt(l,10)-1;if(p>=0&&p<i.length)return{projects:[i[p]],target:s.target}}throw new Error(`No project found at or above ${n} for selector "${t}".`)}return{projects:[u],target:s.target}},P=/^(\w+)\s*(!?=)\s*(.+)$/,R=t=>{const r=t.trim();if(r==="")return;const e=r.split("&&").map(c=>c.trim()),a=r.split("||").map(c=>c.trim()),s=e.length>1,o=a.length>1;if(s&&o)throw new Error("Query language does not support mixed && / || — split into multiple --query flags or simplify.");const n=o?a:e,u=o?"||":"&&",f=[];for(const c of n){const i=P.exec(c);if(!i)throw new Error(`Invalid query clause: "${c}". Expected <field>=<value> or <field>!=<value>.`);const[,l,p,d]=i;f.push({field:l,op:p==="!="?"!=":"=",value:d.trim().replaceAll(/^["']|["']$/g,"")})}return{clauses:f,op:u}},j=(t,r,e)=>{const{field:a,op:s,value:o}=t,n=f=>{const c=f===o;return s==="="?c:!c},u=f=>{const i=(f??[]).includes(o);return s==="="?i:!i};switch(a){case"id":case"project":return n(r);case"language":return n(e.language);case"layer":return n(e.layer);case"projectType":case"type":return n(e.projectType);case"stack":return n(e.stack);case"tag":case"tags":return u(e.tags);default:return!1}},A=(t,r,e)=>{const a=(e??[]).flatMap(o=>o.split(",")).map(o=>o.trim()).filter(Boolean);if(a.length===0)return t;const s=new Set(a);return t.filter(o=>{const n=r.projects[o]?.tags;return Array.isArray(n)&&n.some(u=>s.has(u))})},O=(t,r,e)=>{if(!e||e.trim()==="")return t;const a=R(e);return a?t.filter(s=>{const o=r.projects[s];return o?a.op==="&&"?a.clauses.every(n=>j(n,s,o)):a.clauses.some(n=>j(n,s,o)):!1}):t};export{A as a,O as f,$ as p,x as r};
3
+ `);const l=await new Promise(d=>{c.question("> ",d)});c.close();const p=Number.parseInt(l,10)-1;if(p>=0&&p<i.length)return{projects:[i[p]],target:s.target}}throw new Error(`No project found at or above ${n} for selector "${t}".`)}return{projects:[u],target:s.target}},P=/^(\w+)\s*(!?=)\s*(.+)$/,R=t=>{const r=t.trim();if(r==="")return;const e=r.split("&&").map(c=>c.trim()),a=r.split("||").map(c=>c.trim()),s=e.length>1,o=a.length>1;if(s&&o)throw new Error("Query language does not support mixed && / || — split into multiple --query flags or simplify.");const n=o?a:e,u=o?"||":"&&",f=[];for(const c of n){const i=P.exec(c);if(!i)throw new Error(`Invalid query clause: "${c}". Expected <field>=<value> or <field>!=<value>.`);const[,l,p,d]=i;f.push({field:l,op:p==="!="?"!=":"=",value:d.trim().replaceAll(/^["']|["']$/g,"")})}return{clauses:f,op:u}},j=(t,r,e)=>{const{field:a,op:s,value:o}=t,n=f=>{const c=f===o;return s==="="?c:!c},u=f=>{const i=(f??[]).includes(o);return s==="="?i:!i};switch(a){case"id":case"project":return n(r);case"language":return n(e.language);case"layer":return n(e.layer);case"projectType":case"type":return n(e.projectType);case"stack":return n(e.stack);case"tag":case"tags":return u(e.tags);default:return!1}},A=(t,r,e)=>{const a=(e??[]).flatMap(o=>o.split(",")).map(o=>o.trim()).filter(Boolean);if(a.length===0)return t;const s=new Set(a);return t.filter(o=>{const n=r.projects[o]?.tags;return Array.isArray(n)&&n.some(u=>s.has(u))})},O=(t,r,e)=>{if(!e||e.trim()==="")return t;const a=R(e);return a?t.filter(s=>{const o=r.projects[s];return o?a.op==="&&"?a.clauses.every(n=>j(n,s,o)):a.clauses.some(n=>j(n,s,o)):!1}):t};export{A as a,O as f,b as p,x as r};
@@ -1,2 +1,2 @@
1
- import{createRequire as w}from"node:module";import{D as N,m as x}from"./provenance-DF-ypZj3.js";import{g as P}from"./packument-C9nRiBJf.js";import{c as b}from"../packem_chunks/cli-main.js";import{f as E}from"./registry-keys-BLuHOyZu.js";let _;const $=s=>(_??=w(import.meta.url))(s),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=s=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,r]=u.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return u.getBuiltinModule(s)}return $(s)},{createPublicKey:M,createVerify:R}=v("node:crypto"),B=s=>{const e=["-----BEGIN PUBLIC KEY-----"],r=s.replaceAll(/\s+/g,"");for(let n=0;n<r.length;n+=64)e.push(r.slice(n,n+64));return e.push("-----END PUBLIC KEY-----"),e.join(`
1
+ import{createRequire as w}from"node:module";import{D as N,m as x}from"./provenance-L1M2FPy_.js";import{g as P}from"./packument-zb18Jnlw.js";import{c as b}from"../packem_chunks/cli-main.js";import{f as E}from"./registry-keys-DxdqMzyp.js";let _;const $=s=>(_??=w(import.meta.url))(s),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=s=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,r]=u.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return u.getBuiltinModule(s)}return $(s)},{createPublicKey:M,createVerify:R}=v("node:crypto"),B=s=>{const e=["-----BEGIN PUBLIC KEY-----"],r=s.replaceAll(/\s+/g,"");for(let n=0;n<r.length;n+=64)e.push(r.slice(n,n+64));return e.push("-----END PUBLIC KEY-----"),e.join(`
2
2
  `)},j=({keyBase64:s,message:e,signatureBase64:r})=>{try{const n=M({format:"pem",key:B(s)}),c=R("SHA256");return c.update(e),c.end(),c.verify(n,Buffer.from(r,"base64"))}catch{return!1}},A=(s,e)=>{if(s.expires===void 0||s.expires==="")return!1;const r=Date.parse(s.expires);return Number.isNaN(r)?!1:r<=e},C=(s,e,r)=>`${s}@${e}:${r}`,S=(s,e)=>e!==void 0&&s.includes(e)?e:s.at(-1),Y=async(s,e={})=>{if(b("signatures"))return[];const r=new Set(e.allowlist),n=e.treatExpiredAs??"warning",c=e.concurrency??N,p=await E({keysUrl:e.keysUrl,signal:e.signal,ttlMs:e.keysTtlMs});if(p===void 0)return s.filter(({name:t})=>!r.has(t)).map(({name:t,version:i})=>({code:"fetch-failed",message:"Could not fetch registry signing keys.",packageName:t,severity:"warning",version:i}));const k=new Map;for(const t of p.keys)k.set(t.keyid,t);const m=Date.now();return(await x(s,c,async({name:t,version:i})=>{if(r.has(t))return[];const o=await P(t,{workspaceRoot:e.workspaceRoot});if(o===void 0)return[];const y=o.versions[i]??o.versions[S(Object.keys(o.versions),o["dist-tags"]?.latest)??""];if(y===void 0)return[];const f=y.dist?.signatures,l=y.dist?.integrity;if(f===void 0||f.length===0)return[{code:"missing-signature",message:`Package ${t}@${i} has no dist.signatures from the registry.`,packageName:t,severity:"warning",version:i}];if(typeof l!="string"||l==="")return[{code:"missing-signature",message:`Package ${t}@${i} has signatures but no dist.integrity to verify against.`,packageName:t,severity:"warning",version:i}];const h=C(t,i,l),g=[];for(const a of f){const d=k.get(a.keyid);if(d===void 0){g.push({code:"unknown-keyid",keyid:a.keyid,message:`Package ${t}@${i} was signed with an unrecognized keyid (${a.keyid}).`,packageName:t,severity:"error",version:i});continue}if(A(d,m)){g.push({code:"expired-key",keyid:a.keyid,message:`Package ${t}@${i} was signed with an expired key (${a.keyid}, expired ${d.expires??"unknown"}).`,packageName:t,severity:n,version:i});continue}j({keyBase64:d.key,message:h,signatureBase64:a.sig})||g.push({code:"invalid-signature",keyid:a.keyid,message:`Package ${t}@${i} signature did not verify against ${a.keyid}.`,packageName:t,severity:"error",version:i})}return g})).flat()};export{Y as r};
@@ -0,0 +1 @@
1
+ import{x as r,F as C,o as K}from"../packem_chunks/catalog.js";import{A}from"./getRandomSpinner-DX11qCB2-CoIsn7ZU.js";import{k as S}from"../packem_chunks/cli-main.js";const h=100,T=2147483647,m={delta:0,frame:0,time:0};function j(s){const{interval:i=h,isActive:e=!0}=s??{},t=F(i),{renderThrottleMs:c,subscribe:v}=r.useContext(S),[n,M]=r.useState(0),[R,p]=r.useState(m),o=r.useRef(0),f=r.useRef(0),x=r.useRef({isActive:e,resetKey:n,safeInterval:t}),l=x.current,E=e&&(t!==l.safeInterval||!l.isActive||n!==l.resetKey),b=r.useCallback(()=>{M(u=>u+1)},[]);return r.useLayoutEffect(()=>{if(!e)return;p(m);let u=0;const{startTime:d,unsubscribe:I}=v(a=>{if(c>0&&a<o.current)return;const y=a-u,k=a-f.current;f.current=a,o.current=a+c,p({delta:k,frame:Math.floor(y/t),time:y})},t);return u=d,f.current=d,o.current=u+c,I},[t,e,v,c,n]),r.useLayoutEffect(()=>{x.current={isActive:e,resetKey:n,safeInterval:t}},[e,t,n]),E?{...m,reset:b}:{...R,reset:b}}function F(s){return Number.isFinite(s)?Math.min(T,Math.max(1,s)):h}function D({type:s="dots"}){const i=A(s)??A("dots"),e=i?.frames??[" "],{frame:t}=j({interval:i?.interval??80});return C.jsx(K,{children:e[t%e.length]})}export{D as l};