@visulima/vis 3.0.0 → 3.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 (305) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE.md +5307 -4249
  3. package/dist/bin.js +1 -1
  4. package/dist/binx.js +2 -2
  5. package/dist/config/index.js +1 -1
  6. package/dist/packem_chunks/CONFIG_FILES.js +6 -6
  7. package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -1
  8. package/dist/packem_chunks/agent-instructions.js +7 -7
  9. package/dist/packem_chunks/bloom-status.js +2 -2
  10. package/dist/packem_chunks/bloom-sync.js +2 -2
  11. package/dist/packem_chunks/cache-attestation.js +1 -1
  12. package/dist/packem_chunks/catalog-detector.js +1 -1
  13. package/dist/packem_chunks/catalog.js +87 -111
  14. package/dist/packem_chunks/cli-exec.js +1 -1
  15. package/dist/packem_chunks/cli-main.js +192 -217
  16. package/dist/packem_chunks/defineReleasePlugin.js +3 -3
  17. package/dist/packem_chunks/detect.js +8 -3
  18. package/dist/packem_chunks/devtools.js +1 -1
  19. package/dist/packem_chunks/discord.js +4 -4
  20. package/dist/packem_chunks/dispatch.js +4 -4
  21. package/dist/packem_chunks/doctor-probe.js +2 -2
  22. package/dist/packem_chunks/extra-files.js +3 -3
  23. package/dist/packem_chunks/fix.js +11 -11
  24. package/dist/packem_chunks/git.js +3 -3
  25. package/dist/packem_chunks/group-tags.js +1 -1
  26. package/dist/packem_chunks/handler.js +1 -1
  27. package/dist/packem_chunks/handler10.js +5 -5
  28. package/dist/packem_chunks/handler11.js +1 -1
  29. package/dist/packem_chunks/handler12.js +16 -16
  30. package/dist/packem_chunks/handler13.js +5 -5
  31. package/dist/packem_chunks/handler14.js +1 -1
  32. package/dist/packem_chunks/handler15.js +1 -1
  33. package/dist/packem_chunks/handler16.js +1 -1
  34. package/dist/packem_chunks/handler17.js +1 -1
  35. package/dist/packem_chunks/handler18.js +1 -1
  36. package/dist/packem_chunks/handler19.js +5 -5
  37. package/dist/packem_chunks/handler2.js +1 -1
  38. package/dist/packem_chunks/handler20.js +2 -2
  39. package/dist/packem_chunks/handler21.js +2 -2
  40. package/dist/packem_chunks/handler22.js +8 -8
  41. package/dist/packem_chunks/handler23.js +1 -1
  42. package/dist/packem_chunks/handler24.js +1 -1
  43. package/dist/packem_chunks/handler25.js +1 -1
  44. package/dist/packem_chunks/handler26.js +5 -5
  45. package/dist/packem_chunks/handler27.js +1 -1
  46. package/dist/packem_chunks/handler28.js +3 -3
  47. package/dist/packem_chunks/handler29.js +1 -1
  48. package/dist/packem_chunks/handler3.js +2 -2
  49. package/dist/packem_chunks/handler30.js +1 -1
  50. package/dist/packem_chunks/handler31.js +2 -2
  51. package/dist/packem_chunks/handler32.js +2 -2
  52. package/dist/packem_chunks/handler33.js +2 -2
  53. package/dist/packem_chunks/handler34.js +3 -3
  54. package/dist/packem_chunks/handler35.js +5 -5
  55. package/dist/packem_chunks/handler36.js +1 -1
  56. package/dist/packem_chunks/handler37.js +2 -2
  57. package/dist/packem_chunks/handler38.js +6 -6
  58. package/dist/packem_chunks/handler39.js +8 -8
  59. package/dist/packem_chunks/handler4.js +4 -4
  60. package/dist/packem_chunks/handler40.js +34 -34
  61. package/dist/packem_chunks/handler41.js +5 -5
  62. package/dist/packem_chunks/handler42.js +4 -4
  63. package/dist/packem_chunks/handler43.js +3 -3
  64. package/dist/packem_chunks/handler44.js +2 -2
  65. package/dist/packem_chunks/handler45.js +1 -1
  66. package/dist/packem_chunks/handler46.js +1 -1
  67. package/dist/packem_chunks/handler47.js +1 -1
  68. package/dist/packem_chunks/handler48.js +3 -3
  69. package/dist/packem_chunks/handler49.js +1 -1
  70. package/dist/packem_chunks/handler5.js +6 -6
  71. package/dist/packem_chunks/handler50.js +6 -6
  72. package/dist/packem_chunks/handler51.js +13 -13
  73. package/dist/packem_chunks/handler52.js +3 -3
  74. package/dist/packem_chunks/handler53.js +5 -5
  75. package/dist/packem_chunks/handler54.js +2 -2
  76. package/dist/packem_chunks/handler55.js +1 -1
  77. package/dist/packem_chunks/handler56.js +4 -4
  78. package/dist/packem_chunks/handler57.js +5 -5
  79. package/dist/packem_chunks/handler58.js +5 -5
  80. package/dist/packem_chunks/handler59.js +8 -8
  81. package/dist/packem_chunks/handler6.js +7 -7
  82. package/dist/packem_chunks/handler60.js +3 -3
  83. package/dist/packem_chunks/handler61.js +21 -21
  84. package/dist/packem_chunks/handler62.js +12 -12
  85. package/dist/packem_chunks/handler63.js +3 -3
  86. package/dist/packem_chunks/handler64.js +5 -5
  87. package/dist/packem_chunks/handler65.js +8 -8
  88. package/dist/packem_chunks/handler66.js +2 -2
  89. package/dist/packem_chunks/handler67.js +21 -21
  90. package/dist/packem_chunks/handler68.js +21 -21
  91. package/dist/packem_chunks/handler69.js +30 -30
  92. package/dist/packem_chunks/handler7.js +1 -1
  93. package/dist/packem_chunks/handler70.js +9 -9
  94. package/dist/packem_chunks/handler71.js +17 -17
  95. package/dist/packem_chunks/handler72.js +104 -104
  96. package/dist/packem_chunks/handler73.js +20 -20
  97. package/dist/packem_chunks/handler74.js +45 -45
  98. package/dist/packem_chunks/handler75.js +27 -3
  99. package/dist/packem_chunks/handler76.js +3 -27
  100. package/dist/packem_chunks/handler77.js +68 -68
  101. package/dist/packem_chunks/handler78.js +30 -30
  102. package/dist/packem_chunks/handler8.js +1 -1
  103. package/dist/packem_chunks/handler9.js +1 -1
  104. package/dist/packem_chunks/heal-accept.js +9 -9
  105. package/dist/packem_chunks/heal.js +11 -11
  106. package/dist/packem_chunks/help-command.js +7 -63
  107. package/dist/packem_chunks/index.js +1 -1
  108. package/dist/packem_chunks/index2.js +48 -804
  109. package/dist/packem_chunks/index3.js +3 -7
  110. package/dist/packem_chunks/index4.js +803 -134
  111. package/dist/packem_chunks/index5.js +7 -73
  112. package/dist/packem_chunks/index6.js +73 -0
  113. package/dist/packem_chunks/index7.js +135 -0
  114. package/dist/packem_chunks/interface.js +2 -2
  115. package/dist/packem_chunks/keys-refresh.js +4 -4
  116. package/dist/packem_chunks/lean.js +3 -3
  117. package/dist/packem_chunks/list.js +3 -3
  118. package/dist/packem_chunks/loader.js +4 -4
  119. package/dist/packem_chunks/loader2.js +1 -1
  120. package/dist/packem_chunks/orchestrator.js +27 -27
  121. package/dist/packem_chunks/pre-mode.js +2 -2
  122. package/dist/packem_chunks/print-config.js +1 -1
  123. package/dist/packem_chunks/prompts.js +7 -7
  124. package/dist/packem_chunks/prune.js +3 -3
  125. package/dist/packem_chunks/publish-guards.js +1 -1
  126. package/dist/packem_chunks/resolveFormatter.js +5 -5
  127. package/dist/packem_chunks/run.js +1 -1
  128. package/dist/packem_chunks/security.js +1 -1
  129. package/dist/packem_chunks/shell-runner.js +1 -1
  130. package/dist/packem_chunks/slack.js +2 -2
  131. package/dist/packem_chunks/snapshot.js +2 -2
  132. package/dist/packem_chunks/stage-publisher.js +1 -1
  133. package/dist/packem_chunks/staged-registry.js +2 -2
  134. package/dist/packem_chunks/state.js +3 -3
  135. package/dist/packem_chunks/status.js +2 -2
  136. package/dist/packem_chunks/success-walk.js +4 -4
  137. package/dist/packem_chunks/sync.js +2 -2
  138. package/dist/packem_chunks/sync2.js +2 -2
  139. package/dist/packem_chunks/tar.js +3 -3
  140. package/dist/packem_chunks/tripwire.js +2 -2
  141. package/dist/packem_chunks/ts-loader.js +5 -9
  142. package/dist/packem_chunks/verify-lockfile.js +2 -2
  143. package/dist/packem_chunks/version-resolver.js +2 -2
  144. package/dist/packem_chunks/webhook.js +1 -1
  145. package/dist/packem_chunks/workflow-templates.js +5 -5
  146. package/dist/packem_chunks/workspace.js +2 -2
  147. package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +1 -0
  148. package/dist/packem_shared/Table-DyORjLji-CC9cYgCG.js +11 -0
  149. package/dist/packem_shared/{VisReleaseError-DMGRBTNO.js → VisReleaseError-DZtgcKf8.js} +1 -1
  150. package/dist/packem_shared/_commonjsHelpers-DTfxOvZk.js +1 -0
  151. package/dist/packem_shared/advisories-CyDqzi5j.js +1 -0
  152. package/dist/packem_shared/affected-selection-DPQR-Bd3.js +1 -0
  153. package/dist/packem_shared/affected-shas-Dd0P7fGD.js +1 -0
  154. package/dist/packem_shared/ai-analysis-DSQQDFU9.js +68 -0
  155. package/dist/packem_shared/ai-fix-6nXZbecQ.js +43 -0
  156. package/dist/packem_shared/augment-COAiXSIx.js +4 -0
  157. package/dist/packem_shared/bin-wafzkjaB.js +1 -0
  158. package/dist/packem_shared/build-scripts-pdVmqXRm.js +1 -0
  159. package/dist/packem_shared/clean-DRiLimTx.js +1 -0
  160. package/dist/packem_shared/command-runtime-CiLVo4ED.js +1 -0
  161. package/dist/packem_shared/{compile-cache-B_Vf_WxT.js → compile-cache-DoMHRsRZ.js} +1 -1
  162. package/dist/packem_shared/createAdapter-F7GidOzU.js +1 -0
  163. package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +1 -0
  164. package/dist/packem_shared/cyclonedx-C_ezHg8b.js +4 -0
  165. package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +1 -0
  166. package/dist/packem_shared/docker-Br_iFmI-.js +59 -0
  167. package/dist/packem_shared/failure-log-D92tM0ie.js +2 -0
  168. package/dist/packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js +4 -0
  169. package/dist/packem_shared/getRandomSpinner-4ZEcbTYv-DCyIuj19.js +1 -0
  170. package/dist/packem_shared/giget-CVyyR7x8.js +2 -0
  171. package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +1 -0
  172. package/dist/packem_shared/index-B4AjSxHU.js +1 -0
  173. package/dist/packem_shared/index-BisalDCf.js +39 -0
  174. package/dist/packem_shared/{index-BWl4DbMp.js → index-BjdW45xX.js} +1 -1
  175. package/dist/packem_shared/index-DHD8wb6Z.js +22 -0
  176. package/dist/packem_shared/index-DXPSWMbG.js +1 -0
  177. package/dist/packem_shared/index.server-CwSgbeN7.js +2 -0
  178. package/dist/packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js +1 -0
  179. package/dist/packem_shared/license-DvlYdo6T.js +1 -0
  180. package/dist/packem_shared/lifecycle-CfTZQHOG.js +2 -0
  181. package/dist/packem_shared/lockfile-35RFsJDs.js +1 -0
  182. package/dist/packem_shared/lockfile-DhHAaHN5.js +1 -0
  183. package/dist/packem_shared/main-BjJN8kWj.js +1 -0
  184. package/dist/packem_shared/manifests-BNSmpPF_.js +1 -0
  185. package/dist/packem_shared/min-release-age-ChzTC7_I.js +34 -0
  186. package/dist/packem_shared/missing-package-json-C0keIt78.js +1 -0
  187. package/dist/packem_shared/native-config-sync-BSzU4qUO.js +21 -0
  188. package/dist/packem_shared/osv-bloom-5wDAoZ1e.js +2 -0
  189. package/dist/packem_shared/otelPlugin-D8LL2-4L.js +1 -0
  190. package/dist/packem_shared/package-version-BJkg7-6H.js +4 -0
  191. package/dist/packem_shared/packument-C55kVxcQ.js +1 -0
  192. package/dist/packem_shared/{peer-warnings-BXAzXqY3.js → peer-warnings-CmYSxvql.js} +1 -1
  193. package/dist/packem_shared/pm-runner-de-jCq8q.js +1 -0
  194. package/dist/packem_shared/project-name-filter-BeREbPMI.js +7 -0
  195. package/dist/packem_shared/{prompt-BSAy8SMH.js → prompt-DMzaQEVa.js} +1 -1
  196. package/dist/packem_shared/provenance-CvfQEJPQ.js +1 -0
  197. package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +1 -0
  198. package/dist/packem_shared/registry-keys-DmBrAlhg.js +1 -0
  199. package/dist/packem_shared/resolve-explicit-COmP7eqr.js +5 -0
  200. package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +1 -0
  201. package/dist/packem_shared/run-file-jMngGQhs.js +1 -0
  202. package/dist/packem_shared/runtime-check-BklgEMkC.js +1 -0
  203. package/dist/packem_shared/s1ngularity-RZOHbGrE.js +1 -0
  204. package/dist/packem_shared/scan-progress-C9nMDLis.js +2 -0
  205. package/dist/packem_shared/selectors-B7lSFz7l.js +3 -0
  206. package/dist/packem_shared/signatures-oZ_2IneN.js +2 -0
  207. package/dist/packem_shared/{slug-DoueYuLo.js → slug-OBHcH7wV.js} +1 -1
  208. package/dist/packem_shared/spinner-CbJfWYwB.js +1 -0
  209. package/dist/packem_shared/sticky-comment-DjhyCIZt.js +1 -0
  210. package/dist/packem_shared/subtree-DtmcKAJK.js +2 -0
  211. package/dist/packem_shared/symbols-BXDZ_sKt.js +1 -0
  212. package/dist/packem_shared/tabs-BilwonkM.js +1 -0
  213. package/dist/packem_shared/target-merge-D1xbylFw.js +4 -0
  214. package/dist/packem_shared/target-options-d_rIrLyq.js +1 -0
  215. package/dist/packem_shared/toolchain-DY11tPCw.js +5 -0
  216. package/dist/packem_shared/typosquats-D8ppc5kr.js +1 -0
  217. package/dist/packem_shared/use-measured-height-BPQg2q_p.js +1 -0
  218. package/dist/packem_shared/utils-DQFHJn72.js +1 -0
  219. package/dist/packem_shared/verify-D8wYvB85.js +1 -0
  220. package/dist/packem_shared/vis-update-app-ngwL2mRv.js +1 -0
  221. package/dist/packem_shared/vis-user-error-jhNwmkZp.js +30 -0
  222. package/dist/packem_shared/watch-Dswvj6Zp.js +1 -0
  223. package/dist/packem_shared/watch-loop-COWvvSbR.js +11 -0
  224. package/dist/packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js +1 -0
  225. package/dist/release/core/changelog/index.d.ts +62 -2
  226. package/dist/release/core/package-managers/index.d.ts +25 -1
  227. package/dist/release/core/package-managers/index.js +1 -1
  228. package/dist/release/core/version-actions/index.d.ts +47 -2
  229. package/dist/release/core/version-actions/index.js +1 -1
  230. package/dist/release/index.d.ts +100 -1
  231. package/dist/release/index.js +1 -1
  232. package/dist/release/plugin-sdk.d.ts +16 -1
  233. package/dist/release/plugin-sdk.js +1 -1
  234. package/dist/release/presets.js +1 -1
  235. package/dist/release/types.js +1 -1
  236. package/dist/runtime/preload.js +1 -1
  237. package/index.js +26 -26
  238. package/package.json +9 -9
  239. package/dist/packem_chunks/detect2.js +0 -8
  240. package/dist/packem_chunks/registry.js +0 -48
  241. package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +0 -1
  242. package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +0 -1
  243. package/dist/packem_shared/advisories-DsXRmIA5.js +0 -1
  244. package/dist/packem_shared/affected-selection-BE6VFCDV.js +0 -1
  245. package/dist/packem_shared/affected-shas-BKEu4RZc.js +0 -1
  246. package/dist/packem_shared/ai-analysis-DikAj6rX.js +0 -68
  247. package/dist/packem_shared/ai-fix-bfWo0cZX.js +0 -43
  248. package/dist/packem_shared/augment-BkJxi_GW.js +0 -4
  249. package/dist/packem_shared/bin-B-TytgzW.js +0 -1
  250. package/dist/packem_shared/build-scripts-DWypBQ--.js +0 -1
  251. package/dist/packem_shared/clean-DWjQl14S.js +0 -1
  252. package/dist/packem_shared/command-runtime-DQ7ZpLYL.js +0 -1
  253. package/dist/packem_shared/createAdapter-bU4DIP3F.js +0 -1
  254. package/dist/packem_shared/createVersionActions-BK43SNDH.js +0 -1
  255. package/dist/packem_shared/cyclonedx-DLBi65MV.js +0 -4
  256. package/dist/packem_shared/dependency-scan-ZLOuLkGN.js +0 -1
  257. package/dist/packem_shared/docker-B4zAZCZG.js +0 -59
  258. package/dist/packem_shared/en-BDYMmM2_.js +0 -27
  259. package/dist/packem_shared/failure-log-DyhWPqno.js +0 -2
  260. package/dist/packem_shared/giget-CAxjpwew.js +0 -2
  261. package/dist/packem_shared/glob-BUjyjdE8-Dp_QcayW.js +0 -1
  262. package/dist/packem_shared/index-BAe6e0XE.js +0 -1
  263. package/dist/packem_shared/index-BLtnel38.js +0 -35
  264. package/dist/packem_shared/index-CuKDxOCI.js +0 -1
  265. package/dist/packem_shared/index-tNFGWxc0.js +0 -39
  266. package/dist/packem_shared/index.server-CusjRLCh.js +0 -2
  267. package/dist/packem_shared/license-t5KnNX6v.js +0 -1
  268. package/dist/packem_shared/lifecycle-KY9umOg6.js +0 -2
  269. package/dist/packem_shared/lockfile-YAuZf1gh.js +0 -1
  270. package/dist/packem_shared/main-D_cam4hv.js +0 -1
  271. package/dist/packem_shared/manifests-BwTn_1ad.js +0 -1
  272. package/dist/packem_shared/min-release-age-6avfn81h.js +0 -34
  273. package/dist/packem_shared/missing-package-json-Cl0vdz6K.js +0 -1
  274. package/dist/packem_shared/native-config-sync-CHMCJx7H.js +0 -21
  275. package/dist/packem_shared/osv-bloom-DdqDnLCt.js +0 -2
  276. package/dist/packem_shared/otelPlugin-DmKDBaPo.js +0 -1
  277. package/dist/packem_shared/package-version-BNRJ3o9C.js +0 -4
  278. package/dist/packem_shared/packument-B9-WqReu.js +0 -1
  279. package/dist/packem_shared/pm-runner-DRybtzOV.js +0 -1
  280. package/dist/packem_shared/project-name-filter-Dw0fC6IO.js +0 -7
  281. package/dist/packem_shared/provenance-CLxuqCfL.js +0 -1
  282. package/dist/packem_shared/readJsonSync-DweZd5ZA-CtrDlqpb.js +0 -1
  283. package/dist/packem_shared/registry-keys-cTN24144.js +0 -1
  284. package/dist/packem_shared/resolve-explicit-Uw6WQl9R.js +0 -5
  285. package/dist/packem_shared/resolve-runtime-DztanwkZ.js +0 -1
  286. package/dist/packem_shared/run-file-CaE5_xBY.js +0 -1
  287. package/dist/packem_shared/runtime-check-C32yE57I.js +0 -1
  288. package/dist/packem_shared/s1ngularity-BIYhg82u.js +0 -1
  289. package/dist/packem_shared/scan-progress-DWfY4zkp.js +0 -2
  290. package/dist/packem_shared/selectors-D2j4M9Ul.js +0 -3
  291. package/dist/packem_shared/signatures-C8iQ5fUq.js +0 -2
  292. package/dist/packem_shared/sticky-comment-D6_7-w8T.js +0 -1
  293. package/dist/packem_shared/subtree-DSm0QEoE.js +0 -2
  294. package/dist/packem_shared/symbols-DPTlrJ3B.js +0 -1
  295. package/dist/packem_shared/target-merge-DLxJTcxn.js +0 -11
  296. package/dist/packem_shared/target-options-3t4-2F-F.js +0 -1
  297. package/dist/packem_shared/toolchain-BPzbahcQ.js +0 -5
  298. package/dist/packem_shared/typosquats-BWrmhh36.js +0 -1
  299. package/dist/packem_shared/use-measured-height-BwAwGHjw.js +0 -1
  300. package/dist/packem_shared/utils-CRueU43T.js +0 -1
  301. package/dist/packem_shared/verify-CzUPT6Uk.js +0 -1
  302. package/dist/packem_shared/vis-update-app-D6Wq8ZHM.js +0 -1
  303. package/dist/packem_shared/vis-user-error-CfM4_ORo.js +0 -30
  304. package/dist/packem_shared/watch-D_oAxW_Z.js +0 -1
  305. package/dist/packem_shared/watch-loop-BrjblOz5.js +0 -11
@@ -1,11 +0,0 @@
1
- import{createRequire as to}from"node:module";let oo;const ro=e=>(oo??=to(import.meta.url))(e),ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,so=e=>{if(typeof ve<"u"&&ve.versions&&ve.versions.node){const[t,o]=ve.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ve.getBuiltinModule(e)}return ro(e)},{createRequire:no}=so("node:module");let uo;const io=e=>(uo??=no(import.meta.url))(e),ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jt=e=>{if(typeof ye<"u"&&ye.versions&&ye.versions.node){const[t,o]=ye.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ye.getBuiltinModule(e)}return io(e)},{homedir:lo,tmpdir:at}=jt("node:os"),{env:et,cwd:ao,platform:Tt}=ye,{createRequire:w}=jt("node:module"),po=0,Kt=2,co=Symbol("findUpStop"),fo=/^[A-Z]:\//i,be=(e="")=>e&&e.replaceAll("\\","/").replace(fo,t=>t.toUpperCase()),go=/^[/\\]{2}/,ho=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,At=/^[A-Z]:$/i,bo=/[^/](\.[^./]+)$/,yo=/^[/\\]|^[a-z]:[/\\]/i,mo=/\/$/,vo=()=>{if(typeof process.cwd=="function")try{const e=process.cwd();if(typeof e=="string")return be(e)}catch{}return"/"},pt="/",Xt=(e,t)=>{let o="",g=0,p=-1,r=0,l;for(let a=0;a<=e.length;++a){if(a<e.length)l=e[a];else{if(l==="/")break;l="/"}if(l==="/"){if(!(p===a-1||r===1))if(r===2){if(o.length<2||g!==2||!o.endsWith(".")||o.at(-2)!=="."){if(o.length>2){const c=o.lastIndexOf("/");c===-1?(o="",g=0):(o=o.slice(0,c),g=o.length-1-o.lastIndexOf("/")),p=a,r=0;continue}else if(o.length>0){o="",g=0,p=a,r=0;continue}}t&&(o+=o.length>0?"/..":"..",g=2)}else o.length>0?o+=`/${e.slice(p+1,a)}`:o=e.slice(p+1,a),g=a-p-1;p=a,r=0}else l==="."&&r!==-1?++r:r=-1}return o},de=e=>ho.test(e),Ao=function(e){if(e.length===0)return".";e=be(e);const t=go.exec(e),o=de(e),g=e.at(-1)==="/";return e=Xt(e,!o),e.length===0?o?"/":g?"./":".":(g&&(e+="/"),At.test(e)&&(e+="/"),t?o?`//${e}`:`//./${e}`:o&&!de(e)?`/${e}`:e)},se=(...e)=>{let t="";for(const o of e)if(o)if(t.length>0){const g=t.at(-1)==="/",p=o[0]==="/";g&&p?t+=o.slice(1):t+=g||p?o:`/${o}`}else t+=o;return Ao(t)},nt=function(...e){e=e.map(g=>be(g));let t="",o=!1;for(let g=e.length-1;g>=-1&&!o;g--){const p=g>=0?e[g]:vo();!p||p.length===0||(t=`${p}/${t}`,o=de(p))}return t=Xt(t,!o),At.test(t)?`${t}/`:o&&!de(t)?`/${t}`:t.length>0?t:"."},_o=function(e){return bo.exec(be(e))?.[1]??""},_t=e=>{const t=be(e).replace(mo,""),o=t.lastIndexOf("/");if(o===-1)return de(e)?"/":".";const g=t.slice(0,o);return At.test(g)?`${g}/`:g||(de(e)?"/":".")},Ro=(e,t)=>{const o=be(e);return o.slice(o.lastIndexOf("/")+1)},xo=function(e){const t=yo.exec(e)?.[0]?.replaceAll("\\","/")??"",o=Ro(e),g=_o(o);return{base:o,dir:_t(e),ext:g,name:o.slice(0,o.length-g.length),root:t}};let To;const Eo=e=>(To??=w(import.meta.url))(e),Ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Co=e=>{if(typeof Ae<"u"&&Ae.versions&&Ae.versions.node){const[t,o]=Ae.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ae.getBuiltinModule(e)}return Eo(e)},{fileURLToPath:So}=Co("node:url");function $o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Et,Ct;function Oo(){return Ct||(Ct=1,Et=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Et}var wo=Oo();const ko=$o(wo);new Set(ko);const me=e=>be(e instanceof URL?So(e):e),zt=e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")};let No;const Ho=e=>(No??=w(import.meta.url))(e),_e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lo=e=>{if(typeof _e<"u"&&_e.versions&&_e.versions.node){const[t,o]=_e.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return _e.getBuiltinModule(e)}return Ho(e)};Lo("node:fs/promises");let Bo;const Io=e=>(Bo??=w(import.meta.url))(e),Re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mo=e=>{if(typeof Re<"u"&&Re.versions&&Re.versions.node){const[t,o]=Re.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Re.getBuiltinModule(e)}return Io(e)};Mo("node:fs");const St=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let Do;const Go=e=>(Do??=w(import.meta.url))(e),xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Po=e=>{if(typeof xe<"u"&&xe.versions&&xe.versions.node){const[t,o]=xe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return xe.getBuiltinModule(e)}return Go(e)};Po("node:fs/promises");let Uo;const Fo=e=>(Uo??=w(import.meta.url))(e),Te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jo=e=>{if(typeof Te<"u"&&Te.versions&&Te.versions.node){const[t,o]=Te.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Te.getBuiltinModule(e)}return Fo(e)},{lstatSync:$t,mkdirSync:Ko}=jo("node:fs"),Ee=e=>{zt(e);try{const t=$t(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(St(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{Ko(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const o=$t(e);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(St(o))}'`,{cause:t})}};let Xo;const zo=e=>(Xo??=w(import.meta.url))(e),Ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wo=e=>{if(typeof Ce<"u"&&Ce.versions&&Ce.versions.node){const[t,o]=Ce.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ce.getBuiltinModule(e)}return zo(e)};Wo("node:fs/promises");let Qo;const qo=e=>(Qo??=w(import.meta.url))(e),Se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zo=e=>{if(typeof Se<"u"&&Se.versions&&Se.versions.node){const[t,o]=Se.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Se.getBuiltinModule(e)}return qo(e)};Zo("node:fs");let Yo;const Vo=e=>(Yo??=w(import.meta.url))(e),$e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jo=e=>{if(typeof $e<"u"&&$e.versions&&$e.versions.node){const[t,o]=$e.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return $e.getBuiltinModule(e)}return Vo(e)};Jo("node:fs/promises");let er;const tr=e=>(er??=w(import.meta.url))(e),Oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,or=e=>{if(typeof Oe<"u"&&Oe.versions&&Oe.versions.node){const[t,o]=Oe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Oe.getBuiltinModule(e)}return tr(e)};or("node:fs");let rr;const sr=e=>(rr??=w(import.meta.url))(e),we=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nr=e=>{if(typeof we<"u"&&we.versions&&we.versions.node){const[t,o]=we.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return we.getBuiltinModule(e)}return sr(e)};nr("node:fs/promises");let ur;const ir=e=>(ur??=w(import.meta.url))(e),ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lr=e=>{if(typeof ke<"u"&&ke.versions&&ke.versions.node){const[t,o]=ke.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ke.getBuiltinModule(e)}return ir(e)};lr("node:fs");let ar;const pr=e=>(ar??=w(import.meta.url))(e),Ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cr=e=>{if(typeof Ne<"u"&&Ne.versions&&Ne.versions.node){const[t,o]=Ne.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ne.getBuiltinModule(e)}return pr(e)};cr("node:fs/promises");let fr;const gr=e=>(fr??=w(import.meta.url))(e),He=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hr=e=>{if(typeof He<"u"&&He.versions&&He.versions.node){const[t,o]=He.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return He.getBuiltinModule(e)}return gr(e)};hr("node:fs");let dr;const br=e=>(dr??=w(import.meta.url))(e),Le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yr=e=>{if(typeof Le<"u"&&Le.versions&&Le.versions.node){const[t,o]=Le.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Le.getBuiltinModule(e)}return br(e)};yr("node:fs/promises");let mr;const vr=e=>(mr??=w(import.meta.url))(e),Be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ar=e=>{if(typeof Be<"u"&&Be.versions&&Be.versions.node){const[t,o]=Be.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Be.getBuiltinModule(e)}return vr(e)},{statSync:_r,lstatSync:Rr}=Ar("node:fs"),xr=(e,t={})=>{const o=t.cwd?me(t.cwd):process.cwd();let g=nt(o);const{root:p}=xo(g),r=me(t.stopAt??p),l=nt(g,r),a=t.type??"file",c=function(h){return[e]};t.allowSymlinks??=!0;const A=t.allowSymlinks?_r:Rr;for(;g;){for(let h of c()){if(h===co)return;if(h===void 0)continue;Buffer.isBuffer(h)?h=h.toString():h instanceof URL&&(h=me(h));const T=de(h)?h:nt(g,h);try{const C=A(T);if(a==="file"&&C.isFile()||a==="directory"&&C.isDirectory())return T}catch{}}if(g===l||g===p)break;g=_t(g)}};function Rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ot={},ct,wt;function it(){if(wt)return ct;wt=1;const e="[^\\\\/]",t=Symbol("unignore"),o="\\.",g="\\+",p="\\?",r="\\/",l="(?=.)",a="[^/]",c=`(?:${r}|$)`,A=`(?:^|${r})`,h=`${o}{1,2}${c}`,T=`(?!${o})`,C=`(?!${A}${h})`,E=`(?!${o}{0,1}${c})`,L=`(?!${h})`,te=`[^.${r}]`,q=`${a}*?`,Z="/",B={DOT_LITERAL:o,PLUS_LITERAL:g,QMARK_LITERAL:p,SLASH_LITERAL:r,ONE_CHAR:l,QMARK:a,END_ANCHOR:c,DOTS_SLASH:h,NO_DOT:T,NO_DOTS:C,NO_DOT_SLASH:E,NO_DOTS_SLASH:L,QMARK_NO_DOT:te,STAR:q,START_ANCHOR:A,SEP:Z},b={...B,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${o}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[\\\\/])${o}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},y={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return ct={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:y,UNIGNORE:t,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(s){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${s.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(s){return s===!0?b:B}},ct}var kt;function lt(){return kt||(kt=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:g,REGEX_SPECIAL_CHARS_GLOBAL:p}=it();e.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),e.hasRegexChars=r=>g.test(r),e.isRegexChar=r=>r.length===1&&e.hasRegexChars(r),e.escapeRegex=r=>r.replace(p,"\\$1"),e.toPosixSlashes=r=>r.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const r=navigator.platform.toLowerCase();return r==="win32"||r==="windows"}return process.platform?process.platform==="win32":!1},e.removeBackslashes=r=>r.replace(o,l=>l==="\\"?"":l),e.escapeLast=(r,l,a)=>{const c=r.lastIndexOf(l,a);return c===-1?r:r[c-1]==="\\"?e.escapeLast(r,l,c-1):`${r.slice(0,c)}\\${r.slice(c)}`},e.removePrefix=(r,l={})=>{let a=r;return a.startsWith("./")&&(a=a.slice(2),l.prefix="./"),a},e.wrapOutput=(r,l={},a={})=>{const c=a.contains?"":"^",A=a.contains?"":"$";let h=`${c}(?:${r})${A}`;return l.negated===!0&&(h=`(?:^(?!${h}).*$)`),h},e.basename=(r,{windows:l}={})=>{const a=r.split(l?/[\\/]/:"/"),c=a[a.length-1];return c===""?a[a.length-2]:c}})(Ot)),Ot}var ft,Nt;function Tr(){if(Nt)return ft;Nt=1;const e=lt(),{CHAR_ASTERISK:t,CHAR_AT:o,CHAR_BACKWARD_SLASH:g,CHAR_COMMA:p,CHAR_DOT:r,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:A,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:T,CHAR_QUESTION_MARK:C,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:L,CHAR_RIGHT_SQUARE_BRACKET:te}=it(),q=B=>B===a||B===g,Z=B=>{B.isPrefix!==!0&&(B.depth=B.isGlobstar?1/0:1)};return ft=(B,b)=>{const y=b||{},s=B.length-1,R=y.parts===!0||y.scanToEnd===!0,O=[],m=[],x=[];let v=B,K=-1,U=0,V=0,pe=!1,J=!1,F=!1,ee=!1,ce=!1,ne=!1,oe=!1,G=!1,ue=!1,z=!1,fe=0,W,_,N={value:"",depth:0,isGlob:!1};const X=()=>K>=s,i=()=>v.charCodeAt(K+1),M=()=>(W=_,v.charCodeAt(++K));for(;K<s;){_=M();let Q;if(_===g){oe=N.backslashes=!0,_=M(),_===c&&(ne=!0);continue}if(ne===!0||_===c){for(fe++;X()!==!0&&(_=M());){if(_===g){oe=N.backslashes=!0,M();continue}if(_===c){fe++;continue}if(ne!==!0&&_===r&&(_=M())===r){if(pe=N.isBrace=!0,F=N.isGlob=!0,z=!0,R===!0)continue;break}if(ne!==!0&&_===p){if(pe=N.isBrace=!0,F=N.isGlob=!0,z=!0,R===!0)continue;break}if(_===E&&(fe--,fe===0)){ne=!1,pe=N.isBrace=!0,z=!0;break}}if(R===!0)continue;break}if(_===a){if(O.push(K),m.push(N),N={value:"",depth:0,isGlob:!1},z===!0)continue;if(W===r&&K===U+1){U+=2;continue}V=K+1;continue}if(y.noext!==!0&&(_===T||_===o||_===t||_===C||_===l)&&i()===A){if(F=N.isGlob=!0,ee=N.isExtglob=!0,z=!0,_===l&&K===U&&(ue=!0),R===!0){for(;X()!==!0&&(_=M());){if(_===g){oe=N.backslashes=!0,_=M();continue}if(_===L){F=N.isGlob=!0,z=!0;break}}continue}break}if(_===t){if(W===t&&(ce=N.isGlobstar=!0),F=N.isGlob=!0,z=!0,R===!0)continue;break}if(_===C){if(F=N.isGlob=!0,z=!0,R===!0)continue;break}if(_===h){for(;X()!==!0&&(Q=M());){if(Q===g){oe=N.backslashes=!0,M();continue}if(Q===te){J=N.isBracket=!0,F=N.isGlob=!0,z=!0;break}}if(R===!0)continue;break}if(y.nonegate!==!0&&_===l&&K===U){G=N.negated=!0,U++;continue}if(y.noparen!==!0&&_===A){if(F=N.isGlob=!0,R===!0){for(;X()!==!0&&(_=M());){if(_===A){oe=N.backslashes=!0,_=M();continue}if(_===L){z=!0;break}}continue}break}if(F===!0){if(z=!0,R===!0)continue;break}}y.noext===!0&&(ee=!1,F=!1);let I=v,ge="",n="";U>0&&(ge=v.slice(0,U),v=v.slice(U),V-=U),I&&F===!0&&V>0?(I=v.slice(0,V),n=v.slice(V)):F===!0?(I="",n=v):I=v,I&&I!==""&&I!=="/"&&I!==v&&q(I.charCodeAt(I.length-1))&&(I=I.slice(0,-1)),y.unescape===!0&&(n&&(n=e.removeBackslashes(n)),I&&oe===!0&&(I=e.removeBackslashes(I)));const u={prefix:ge,input:B,start:U,base:I,glob:n,isBrace:pe,isBracket:J,isGlob:F,isExtglob:ee,isGlobstar:ce,negated:G,negatedExtglob:ue};if(y.tokens===!0&&(u.maxDepth=0,q(_)||m.push(N),u.tokens=m),y.parts===!0||y.tokens===!0){let Q;for(let k=0;k<O.length;k++){const re=Q?Q+1:U,ie=O[k],Y=B.slice(re,ie);y.tokens&&(k===0&&U!==0?(m[k].isPrefix=!0,m[k].value=ge):m[k].value=Y,Z(m[k]),u.maxDepth+=m[k].depth),(k!==0||Y!=="")&&x.push(Y),Q=ie}if(Q&&Q+1<B.length){const k=B.slice(Q+1);x.push(k),y.tokens&&(m[m.length-1].value=k,Z(m[m.length-1]),u.maxDepth+=m[m.length-1].depth)}u.slashes=O,u.parts=x}return u},ft}var gt,Ht;function Er(){if(Ht)return gt;Ht=1;const e=it(),t=lt(),{MAX_LENGTH:o,POSIX_REGEX_SOURCE:g,REGEX_NON_SPECIAL_CHARS:p,REGEX_SPECIAL_CHARS_BACKREF:r,REPLACEMENTS:l}=e,a=(b,y)=>typeof y.expandRange=="function"?y.expandRange(...b,y):(b.sort(),`[${b.join("-")}]`),c=(b,y)=>`Missing ${b}: "${y}" - use "\\\\${y}" to match literal characters`,A=b=>{const y=[];let s=0,R=0,O=0,m="",x=!1;for(const v of b){if(x===!0){m+=v,x=!1;continue}if(v==="\\"){m+=v,x=!0;continue}if(v==='"'){O=O===1?0:1,m+=v;continue}if(O===0){if(v==="[")s++;else if(v==="]"&&s>0)s--;else if(s===0){if(v==="(")R++;else if(v===")"&&R>0)R--;else if(v==="|"&&R===0){y.push(m),m="";continue}}}m+=v}return y.push(m),y},h=b=>{let y=!1;for(const s of b){if(y===!0){y=!1;continue}if(s==="\\"){y=!0;continue}if(/[?*+@!()[\]{}]/.test(s))return!1}return!0},T=b=>{let y=b.trim(),s=!0;for(;s===!0;)s=!1,/^@\([^\\()[\]{}|]+\)$/.test(y)&&(y=y.slice(2,-1),s=!0);if(h(y))return y.replace(/\\(.)/g,"$1")},C=b=>{const y=b.map(T).filter(Boolean);for(let s=0;s<y.length;s++)for(let R=s+1;R<y.length;R++){const O=y[s],m=y[R],x=O[0];if(!(!x||O!==x.repeat(O.length)||m!==x.repeat(m.length))&&(O===m||O.startsWith(m)||m.startsWith(O)))return!0}return!1},E=(b,y=!0)=>{if(b[0]!=="+"&&b[0]!=="*"||b[1]!=="(")return;let s=0,R=0,O=0,m=!1;for(let x=1;x<b.length;x++){const v=b[x];if(m===!0){m=!1;continue}if(v==="\\"){m=!0;continue}if(v==='"'){O=O===1?0:1;continue}if(O!==1){if(v==="["){s++;continue}if(v==="]"&&s>0){s--;continue}if(!(s>0)){if(v==="("){R++;continue}if(v===")"&&(R--,R===0))return y===!0&&x!==b.length-1?void 0:{type:b[0],body:b.slice(2,x),end:x}}}}},L=b=>`${b.length===1?t.escapeRegex(b[0]):`[${b.map(y=>t.escapeRegex(y)).join("")}]`}*`,te=b=>{let y=0;const s=[];for(;y<b.length;){const R=E(b.slice(y),!1);if(!R||R.type!=="*")return;const O=A(R.body).map(x=>x.trim());if(O.length!==1)return;const m=T(O[0]);if(!m||m.length!==1)return;s.push(m),y+=R.end+1}if(!(s.length<1))return s},q=b=>{let y=0,s=b.trim(),R=E(s);for(;R;)y++,s=R.body.trim(),R=E(s);return y},Z=(b,y)=>{if(y.maxExtglobRecursion===!1)return{risky:!1};const s=typeof y.maxExtglobRecursion=="number"?y.maxExtglobRecursion:e.DEFAULT_MAX_EXTGLOB_RECURSION,R=A(b).map(v=>v.trim());if(R.length>1&&(R.some(v=>v==="")||R.some(v=>/^[*?]+$/.test(v))||C(R)))return{risky:!0};const O=[];let m=!1,x=!0;for(const v of R){const K=te(v);if(K){m=!0,O.push(...K);continue}const U=T(v);if(U&&U.length===1){O.push(U);continue}if(x=!1,q(v)>s)return{risky:!0}}return m?x?{risky:!0,safeOutput:L([...new Set(O)])}:{risky:!0}:{risky:!1}},B=(b,y)=>{if(typeof b!="string")throw new TypeError("Expected a string");b=l[b]||b;const s={...y},R=typeof s.maxLength=="number"?Math.min(o,s.maxLength):o;let O=b.length;if(O>R)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${R}`);const m={type:"bos",value:"",output:s.prepend||""},x=[m],v=s.capture?"":"?:",K=e.globChars(s.windows),U=e.extglobChars(K),{DOT_LITERAL:V,PLUS_LITERAL:pe,SLASH_LITERAL:J,ONE_CHAR:F,DOTS_SLASH:ee,NO_DOT:ce,NO_DOT_SLASH:ne,NO_DOTS_SLASH:oe,QMARK:G,QMARK_NO_DOT:ue,STAR:z,START_ANCHOR:fe}=K,W=d=>`(${v}(?:(?!${fe}${d.dot?ee:V}).)*?)`,_=s.dot?"":ce,N=s.dot?G:ue;let X=s.bash===!0?W(s):z;s.capture&&(X=`(${X})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const i={input:b,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:x};b=t.removePrefix(b,i),O=b.length;const M=[],I=[],ge=[];let n=m,u;const Q=()=>i.index===O-1,k=i.peek=(d=1)=>b[i.index+d],re=i.advance=()=>b[++i.index]||"",ie=()=>b.slice(i.index+1),Y=(d="",D=0)=>{i.consumed+=d,i.index+=D},ot=d=>{i.output+=d.output!=null?d.output:d.value,Y(d.value)},Jt=()=>{let d=1;for(;k()==="!"&&(k(2)!=="("||k(3)==="?");)re(),i.start++,d++;return d%2===0?!1:(i.negated=!0,i.start++,!0)},rt=d=>{i[d]++,ge.push(d)},he=d=>{i[d]--,ge.pop()},S=d=>{if(n.type==="globstar"){const D=i.braces>0&&(d.type==="comma"||d.type==="brace"),f=d.extglob===!0||M.length&&(d.type==="pipe"||d.type==="paren");d.type!=="slash"&&d.type!=="paren"&&!D&&!f&&(i.output=i.output.slice(0,-n.output.length),n.type="star",n.value="*",n.output=X,i.output+=n.output)}if(M.length&&d.type!=="paren"&&(M[M.length-1].inner+=d.value),(d.value||d.output)&&ot(d),n&&n.type==="text"&&d.type==="text"){n.output=(n.output||n.value)+d.value,n.value+=d.value;return}d.prev=n,x.push(d),n=d},st=(d,D)=>{const f={...U[D],conditions:1,inner:""};f.prev=n,f.parens=i.parens,f.output=i.output,f.startIndex=i.index,f.tokensIndex=x.length;const $=(s.capture?"(":"")+f.open;rt("parens"),S({type:d,value:D,output:i.output?"":F}),S({type:"paren",extglob:!0,value:re(),output:$}),M.push(f)},eo=d=>{const D=b.slice(d.startIndex,i.index+1),f=b.slice(d.startIndex+2,i.index),$=Z(f,s);if((d.type==="plus"||d.type==="star")&&$.risky){const H=$.safeOutput?(d.output?"":F)+(s.capture?`(${$.safeOutput})`:$.safeOutput):void 0,le=x[d.tokensIndex];le.type="text",le.value=D,le.output=H||t.escapeRegex(D);for(let ae=d.tokensIndex+1;ae<x.length;ae++)x[ae].value="",x[ae].output="",delete x[ae].suffix;i.output=d.output+le.output,i.backtrack=!0,S({type:"paren",extglob:!0,value:u,output:""}),he("parens");return}let P=d.close+(s.capture?")":""),j;if(d.type==="negate"){let H=X;if(d.inner&&d.inner.length>1&&d.inner.includes("/")&&(H=W(s)),(H!==X||Q()||/^\)+$/.test(ie()))&&(P=d.close=`)$))${H}`),d.inner.includes("*")&&(j=ie())&&/^\.[^\\/.]+$/.test(j)){const le=B(j,{...y,fastpaths:!1}).output;P=d.close=`)${le})${H})`}d.prev.type==="bos"&&(i.negatedExtglob=!0)}S({type:"paren",extglob:!0,value:u,output:P}),he("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(b)){let d=!1,D=b.replace(r,(f,$,P,j,H,le)=>j==="\\"?(d=!0,f):j==="?"?$?$+j+(H?G.repeat(H.length):""):le===0?N+(H?G.repeat(H.length):""):G.repeat(P.length):j==="."?V.repeat(P.length):j==="*"?$?$+j+(H?X:""):X:$?f:`\\${f}`);return d===!0&&(s.unescape===!0?D=D.replace(/\\/g,""):D=D.replace(/\\+/g,f=>f.length%2===0?"\\\\":f?"\\":"")),D===b&&s.contains===!0?(i.output=b,i):(i.output=t.wrapOutput(D,i,y),i)}for(;!Q();){if(u=re(),u==="\0")continue;if(u==="\\"){const f=k();if(f==="/"&&s.bash!==!0||f==="."||f===";")continue;if(!f){u+="\\",S({type:"text",value:u});continue}const $=/^\\+/.exec(ie());let P=0;if($&&$[0].length>2&&(P=$[0].length,i.index+=P,P%2!==0&&(u+="\\")),s.unescape===!0?u=re():u+=re(),i.brackets===0){S({type:"text",value:u});continue}}if(i.brackets>0&&(u!=="]"||n.value==="["||n.value==="[^")){if(s.posix!==!1&&u===":"){const f=n.value.slice(1);if(f.includes("[")&&(n.posix=!0,f.includes(":"))){const $=n.value.lastIndexOf("["),P=n.value.slice(0,$),j=n.value.slice($+2),H=g[j];if(H){n.value=P+H,i.backtrack=!0,re(),!m.output&&x.indexOf(n)===1&&(m.output=F);continue}}}(u==="["&&k()!==":"||u==="-"&&k()==="]")&&(u=`\\${u}`),u==="]"&&(n.value==="["||n.value==="[^")&&(u=`\\${u}`),s.posix===!0&&u==="!"&&n.value==="["&&(u="^"),n.value+=u,ot({value:u});continue}if(i.quotes===1&&u!=='"'){u=t.escapeRegex(u),n.value+=u,ot({value:u});continue}if(u==='"'){i.quotes=i.quotes===1?0:1,s.keepQuotes===!0&&S({type:"text",value:u});continue}if(u==="("){rt("parens"),S({type:"paren",value:u});continue}if(u===")"){if(i.parens===0&&s.strictBrackets===!0)throw new SyntaxError(c("opening","("));const f=M[M.length-1];if(f&&i.parens===f.parens+1){eo(M.pop());continue}S({type:"paren",value:u,output:i.parens?")":"\\)"}),he("parens");continue}if(u==="["){if(s.nobracket===!0||!ie().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(c("closing","]"));u=`\\${u}`}else rt("brackets");S({type:"bracket",value:u});continue}if(u==="]"){if(s.nobracket===!0||n&&n.type==="bracket"&&n.value.length===1){S({type:"text",value:u,output:`\\${u}`});continue}if(i.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(c("opening","["));S({type:"text",value:u,output:`\\${u}`});continue}he("brackets");const f=n.value.slice(1);if(n.posix!==!0&&f[0]==="^"&&!f.includes("/")&&(u=`/${u}`),n.value+=u,ot({value:u}),s.literalBrackets===!1||t.hasRegexChars(f))continue;const $=t.escapeRegex(n.value);if(i.output=i.output.slice(0,-n.value.length),s.literalBrackets===!0){i.output+=$,n.value=$;continue}n.value=`(${v}${$}|${n.value})`,i.output+=n.value;continue}if(u==="{"&&s.nobrace!==!0){rt("braces");const f={type:"brace",value:u,output:"(",outputIndex:i.output.length,tokensIndex:i.tokens.length};I.push(f),S(f);continue}if(u==="}"){const f=I[I.length-1];if(s.nobrace===!0||!f){S({type:"text",value:u,output:u});continue}let $=")";if(f.dots===!0){const P=x.slice(),j=[];for(let H=P.length-1;H>=0&&(x.pop(),P[H].type!=="brace");H--)P[H].type!=="dots"&&j.unshift(P[H].value);$=a(j,s),i.backtrack=!0}if(f.comma!==!0&&f.dots!==!0){const P=i.output.slice(0,f.outputIndex),j=i.tokens.slice(f.tokensIndex);f.value=f.output="\\{",u=$="\\}",i.output=P;for(const H of j)i.output+=H.output||H.value}S({type:"brace",value:u,output:$}),he("braces"),I.pop();continue}if(u==="|"){M.length>0&&M[M.length-1].conditions++,S({type:"text",value:u});continue}if(u===","){let f=u;const $=I[I.length-1];$&&ge[ge.length-1]==="braces"&&($.comma=!0,f="|"),S({type:"comma",value:u,output:f});continue}if(u==="/"){if(n.type==="dot"&&i.index===i.start+1){i.start=i.index+1,i.consumed="",i.output="",x.pop(),n=m;continue}S({type:"slash",value:u,output:J});continue}if(u==="."){if(i.braces>0&&n.type==="dot"){n.value==="."&&(n.output=V);const f=I[I.length-1];n.type="dots",n.output+=u,n.value+=u,f.dots=!0;continue}if(i.braces+i.parens===0&&n.type!=="bos"&&n.type!=="slash"){S({type:"text",value:u,output:V});continue}S({type:"dot",value:u,output:V});continue}if(u==="?"){if(!(n&&n.value==="(")&&s.noextglob!==!0&&k()==="("&&k(2)!=="?"){st("qmark",u);continue}if(n&&n.type==="paren"){const f=k();let $=u;(n.value==="("&&!/[!=<:]/.test(f)||f==="<"&&!/<([!=]|\w+>)/.test(ie()))&&($=`\\${u}`),S({type:"text",value:u,output:$});continue}if(s.dot!==!0&&(n.type==="slash"||n.type==="bos")){S({type:"qmark",value:u,output:ue});continue}S({type:"qmark",value:u,output:G});continue}if(u==="!"){if(s.noextglob!==!0&&k()==="("&&(k(2)!=="?"||!/[!=<:]/.test(k(3)))){st("negate",u);continue}if(s.nonegate!==!0&&i.index===0){Jt();continue}}if(u==="+"){if(s.noextglob!==!0&&k()==="("&&k(2)!=="?"){st("plus",u);continue}if(n&&n.value==="("||s.regex===!1){S({type:"plus",value:u,output:pe});continue}if(n&&(n.type==="bracket"||n.type==="paren"||n.type==="brace")||i.parens>0){S({type:"plus",value:u});continue}S({type:"plus",value:pe});continue}if(u==="@"){if(s.noextglob!==!0&&k()==="("&&k(2)!=="?"){S({type:"at",extglob:!0,value:u,output:""});continue}S({type:"text",value:u});continue}if(u!=="*"){(u==="$"||u==="^")&&(u=`\\${u}`);const f=p.exec(ie());f&&(u+=f[0],i.index+=f[0].length),S({type:"text",value:u});continue}if(n&&(n.type==="globstar"||n.star===!0)){n.type="star",n.star=!0,n.value+=u,n.output=X,i.backtrack=!0,i.globstar=!0,Y(u);continue}let d=ie();if(s.noextglob!==!0&&/^\([^?]/.test(d)){st("star",u);continue}if(n.type==="star"){if(s.noglobstar===!0){Y(u);continue}const f=n.prev,$=f.prev,P=f.type==="slash"||f.type==="bos",j=$&&($.type==="star"||$.type==="globstar");if(s.bash===!0&&(!P||d[0]&&d[0]!=="/")){S({type:"star",value:u,output:""});continue}const H=i.braces>0&&(f.type==="comma"||f.type==="brace"),le=M.length&&(f.type==="pipe"||f.type==="paren");if(!P&&f.type!=="paren"&&!H&&!le){S({type:"star",value:u,output:""});continue}for(;d.slice(0,3)==="/**";){const ae=b[i.index+4];if(ae&&ae!=="/")break;d=d.slice(3),Y("/**",3)}if(f.type==="bos"&&Q()){n.type="globstar",n.value+=u,n.output=W(s),i.output=n.output,i.globstar=!0,Y(u);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&!j&&Q()){i.output=i.output.slice(0,-(f.output+n.output).length),f.output=`(?:${f.output}`,n.type="globstar",n.output=W(s)+(s.strictSlashes?")":"|$)"),n.value+=u,i.globstar=!0,i.output+=f.output+n.output,Y(u);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&d[0]==="/"){const ae=d[1]!==void 0?"|$":"";i.output=i.output.slice(0,-(f.output+n.output).length),f.output=`(?:${f.output}`,n.type="globstar",n.output=`${W(s)}${J}|${J}${ae})`,n.value+=u,i.output+=f.output+n.output,i.globstar=!0,Y(u+re()),S({type:"slash",value:"/",output:""});continue}if(f.type==="bos"&&d[0]==="/"){n.type="globstar",n.value+=u,n.output=`(?:^|${J}|${W(s)}${J})`,i.output=n.output,i.globstar=!0,Y(u+re()),S({type:"slash",value:"/",output:""});continue}if(H&&d[0]==="/"){n.type="globstar",n.value+=u,n.output=`(?:^|${J}|${W(s)}${J})`,i.output+=n.output,i.globstar=!0,Y(u+re()),S({type:"slash",value:"/",output:""});continue}i.output=i.output.slice(0,-n.output.length),n.type="globstar",n.output=W(s),n.value+=u,i.output+=n.output,i.globstar=!0,Y(u);continue}const D={type:"star",value:u,output:X};if(s.bash===!0){D.output=".*?",(n.type==="bos"||n.type==="slash")&&(D.output=_+D.output),S(D);continue}if(n&&(n.type==="bracket"||n.type==="paren")&&s.regex===!0){D.output=u,S(D);continue}(i.index===i.start||n.type==="slash"||n.type==="dot")&&(n.type==="dot"?(i.output+=ne,n.output+=ne):s.dot===!0?(i.output+=oe,n.output+=oe):(i.output+=_,n.output+=_),k()!=="*"&&(i.output+=F,n.output+=F)),S(D)}for(;i.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(c("closing","]"));i.output=t.escapeLast(i.output,"["),he("brackets")}for(;i.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(c("closing",")"));i.output=t.escapeLast(i.output,"("),he("parens")}for(;i.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(c("closing","}"));i.output=t.escapeLast(i.output,"{"),he("braces")}if(s.strictSlashes!==!0&&(n.type==="star"||n.type==="bracket")&&S({type:"maybe_slash",value:"",output:`${J}?`}),i.backtrack===!0){i.output="";for(const d of i.tokens)i.output+=d.output!=null?d.output:d.value,d.suffix&&(i.output+=d.suffix)}return i};return B.fastpaths=(b,y)=>{const s={...y},R=typeof s.maxLength=="number"?Math.min(o,s.maxLength):o,O=b.length;if(O>R)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${R}`);b=l[b]||b;const{DOT_LITERAL:m,SLASH_LITERAL:x,ONE_CHAR:v,DOTS_SLASH:K,NO_DOT:U,NO_DOTS:V,NO_DOTS_SLASH:pe,STAR:J,START_ANCHOR:F}=e.globChars(s.windows),ee=s.dot?V:U,ce=s.dot?pe:U,ne=s.capture?"":"?:",oe={negated:!1,prefix:""};let G=s.bash===!0?".*?":J;s.capture&&(G=`(${G})`);const ue=_=>_.noglobstar===!0?G:`(${ne}(?:(?!${F}${_.dot?K:m}).)*?)`,z=_=>{switch(_){case"*":return`${ee}${v}${G}`;case".*":return`${m}${v}${G}`;case"*.*":return`${ee}${G}${m}${v}${G}`;case"*/*":return`${ee}${G}${x}${v}${ce}${G}`;case"**":return ee+ue(s);case"**/*":return`(?:${ee}${ue(s)}${x})?${ce}${v}${G}`;case"**/*.*":return`(?:${ee}${ue(s)}${x})?${ce}${G}${m}${v}${G}`;case"**/.*":return`(?:${ee}${ue(s)}${x})?${m}${v}${G}`;default:{const N=/^(.*?)\.(\w+)$/.exec(_);if(!N)return;const X=z(N[1]);return X?X+m+N[2]:void 0}}},fe=t.removePrefix(b,oe);let W=z(fe);return W&&s.strictSlashes!==!0&&(W+=`${x}?`),W},gt=B,gt}var ht,Lt;function Cr(){if(Lt)return ht;Lt=1;const e=Tr(),t=Er(),o=lt(),g=it(),p=l=>l&&typeof l=="object"&&!Array.isArray(l),r=(l,a,c=!1)=>{if(Array.isArray(l)){const q=l.map(Z=>r(Z,a,c));return Z=>{for(const B of q){const b=B(Z);if(b)return b}return!1}}const A=p(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!A)throw new TypeError("Expected pattern to be a non-empty string");const h=a||{},T=h.windows,C=A?r.compileRe(l,a):r.makeRe(l,a,!1,!0),E=C.state;delete C.state;let L=()=>!1;if(h.ignore){const q={...a,ignore:null,onMatch:null,onResult:null};L=r(h.ignore,q,c)}const te=(q,Z=!1)=>{const{isMatch:B,match:b,output:y}=r.test(q,C,a,{glob:l,posix:T}),s={glob:l,state:E,regex:C,posix:T,input:q,output:y,match:b,isMatch:B};if(typeof h.onResult=="function"&&h.onResult(s),B===!1)return s.isMatch=!1,Z?s:!1;e:if(L(q)){if(typeof h.onIgnore=="function"&&h.onIgnore(s)===g.UNIGNORE){s.isMatch=!0;break e}return s.isMatch=!1,Z?s:!1}return typeof h.onMatch=="function"&&h.onMatch(s),Z?s:!0};return c&&(te.state=E),te};return r.test=(l,a,c,{glob:A,posix:h}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const T=c||{},C=T.format||(h?o.toPosixSlashes:null);let E=l===A,L=E&&C?C(l):l;return E===!1&&(L=C?C(l):l,E=L===A),(E===!1||T.capture===!0)&&(T.matchBase===!0||T.basename===!0?E=r.matchBase(l,a,c,h):E=a.exec(L)),{isMatch:!!E,match:E,output:L}},r.matchBase=(l,a,c,A=c&&c.windows)=>(a instanceof RegExp?a:r.makeRe(a,c)).test(o.basename(l,{windows:A})),r.isMatch=(l,a,c)=>r(a,c)(l),r.parse=(l,a)=>Array.isArray(l)?l.map(c=>r.parse(c,a)):t(l,{...a,fastpaths:!1}),r.scan=(l,a)=>e(l,a),r.compileRe=(l,a,c=!1,A=!1)=>{if(c===!0)return l.output;const h=a||{},T=h.contains?"":"^",C=h.contains?"":"$";let E=`${T}(?:${l.output})${C}`;l&&l.negated===!0&&(E=`^(?!${E}).*$`);const L=r.toRegex(E,a);return A===!0&&(L.state=l),L},r.makeRe=(l,a={},c=!1,A=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let h={negated:!1,fastpaths:!0};return a.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(h.output=t.fastpaths(l,a)),h.output||(h=t(l,a)),r.compileRe(h,a,c,A)},r.toRegex=(l,a)=>{try{const c=a||{};return new RegExp(l,c.flags||(c.nocase?"i":""))}catch(c){if(a&&a.debug===!0)throw c;return/$^/}},r.constants=g,ht=r,ht}var dt,Bt;function Sr(){if(Bt)return dt;Bt=1;const e=Cr(),t=lt();function o(g,p,r=!1){return p&&(p.windows===null||p.windows===void 0)&&(p={...p,windows:t.isWindows()}),e(g,p,r)}return Object.assign(o,e),dt=o,dt}var $r=Sr();Rt($r);let Or;const wr=e=>(Or??=w(import.meta.url))(e),Ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tt=e=>{if(typeof Ie<"u"&&Ie.versions&&Ie.versions.node){const[t,o]=Ie.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ie.getBuiltinModule(e)}return wr(e)};tt("fs");tt("fs");tt("path");tt("url");const{createRequire:kr}=tt("module");var It=kr(import.meta.url);try{It.resolve("picomatch"),It("picomatch")}catch{}var bt,Mt;function Nr(){if(Mt)return bt;Mt=1;/*!
2
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
3
- *
4
- * Copyright (c) 2014-2016, Jon Schlinkert.
5
- * Licensed under the MIT License.
6
- */return bt=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1},bt}var yt,Dt;function Wt(){if(Dt)return yt;Dt=1;/*!
7
- * is-glob <https://github.com/jonschlinkert/is-glob>
8
- *
9
- * Copyright (c) 2014-2017, Jon Schlinkert.
10
- * Released under the MIT License.
11
- */var e=Nr(),t={"{":"}","(":")","[":"]"},o=function(p){if(p[0]==="!")return!0;for(var r=0,l=-2,a=-2,c=-2,A=-2,h=-2;r<p.length;){if(p[r]==="*"||p[r+1]==="?"&&/[\].+)]/.test(p[r])||a!==-1&&p[r]==="["&&p[r+1]!=="]"&&(a<r&&(a=p.indexOf("]",r)),a>r&&(h===-1||h>a||(h=p.indexOf("\\",r),h===-1||h>a)))||c!==-1&&p[r]==="{"&&p[r+1]!=="}"&&(c=p.indexOf("}",r),c>r&&(h=p.indexOf("\\",r),h===-1||h>c))||A!==-1&&p[r]==="("&&p[r+1]==="?"&&/[:!=]/.test(p[r+2])&&p[r+3]!==")"&&(A=p.indexOf(")",r),A>r&&(h=p.indexOf("\\",r),h===-1||h>A))||l!==-1&&p[r]==="("&&p[r+1]!=="|"&&(l<r&&(l=p.indexOf("|",r)),l!==-1&&p[l+1]!==")"&&(A=p.indexOf(")",l),A>l&&(h=p.indexOf("\\",l),h===-1||h>A))))return!0;if(p[r]==="\\"){var T=p[r+1];r+=2;var C=t[T];if(C){var E=p.indexOf(C,r);E!==-1&&(r=E+1)}if(p[r]==="!")return!0}else r++}return!1},g=function(p){if(p[0]==="!")return!0;for(var r=0;r<p.length;){if(/[*?{}()[\]]/.test(p[r]))return!0;if(p[r]==="\\"){var l=p[r+1];r+=2;var a=t[l];if(a){var c=p.indexOf(a,r);c!==-1&&(r=c+1)}if(p[r]==="!")return!0}else r++}return!1};return yt=function(p,r){if(typeof p!="string"||p==="")return!1;if(e(p))return!0;var l=o;return r&&r.strict===!1&&(l=g),l(p)},yt}let Hr;const Lr=e=>(Hr??=w(import.meta.url))(e),Me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qt=e=>{if(typeof Me<"u"&&Me.versions&&Me.versions.node){const[t,o]=Me.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Me.getBuiltinModule(e)}return Lr(e)},Br=Qt("path"),Ir=Qt("os");var mt,Gt;function Mr(){if(Gt)return mt;Gt=1;var e=Wt(),t=Br.posix.dirname,o=Ir.platform()==="win32",g="/",p=/\\/g,r=/\\([!*?|[\](){}])/g;mt=function(c,A){var h=Object.assign({flipBackslashes:!0},A);h.flipBackslashes&&o&&c.indexOf(g)<0&&(c=c.replace(p,g)),l(c)&&(c+=g),c+="a";do c=t(c);while(a(c));return c.replace(r,"$1")};function l(c){var A=c.slice(-1),h;switch(A){case"}":h="{";break;case"]":h="[";break;default:return!1}var T=c.indexOf(h);return T<0?!1:c.slice(T+1,-1).includes(g)}function a(c){return/\([^()]+$/.test(c)||c[0]==="{"||c[0]==="["||/[^\\][{[]/.test(c)?!0:e(c)}return mt}var Dr=Mr();Rt(Dr);let Gr;const Pr=e=>(Gr??=w(import.meta.url))(e),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ur=e=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[t,o]=De.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return De.getBuiltinModule(e)}return Pr(e)};Ur("node:fs/promises");let Fr;const jr=e=>(Fr??=w(import.meta.url))(e),Ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Kr=e=>{if(typeof Ge<"u"&&Ge.versions&&Ge.versions.node){const[t,o]=Ge.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ge.getBuiltinModule(e)}return jr(e)},{accessSync:Xr}=Kr("node:fs");function ut(e,t=po){zt(e),e=me(e);try{return Xr(e,t),!0}catch{return!1}}var zr=Wt();Rt(zr);let Wr;const Qr=e=>(Wr??=w(import.meta.url))(e),Pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qt=e=>{if(typeof Pe<"u"&&Pe.versions&&Pe.versions.node){const[t,o]=Pe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Pe.getBuiltinModule(e)}return Qr(e)};qt("node:fs/promises");qt("node:fs");let qr=class extends Error{constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}},Zr;const Yr=e=>(Zr??=w(import.meta.url))(e),Ue=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zt=e=>{if(typeof Ue<"u"&&Ue.versions&&Ue.versions.node){const[t,o]=Ue.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ue.getBuiltinModule(e)}return Yr(e)};Zt("node:fs/promises");Zt("node:zlib");let Vr;const Jr=e=>(Vr??=w(import.meta.url))(e),Fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yt=e=>{if(typeof Fe<"u"&&Fe.versions&&Fe.versions.node){const[t,o]=Fe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Fe.getBuiltinModule(e)}return Jr(e)};Yt("node:fs");Yt("node:zlib");let es;const ts=e=>(es??=w(import.meta.url))(e),je=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vt=e=>{if(typeof je<"u"&&je.versions&&je.versions.node){const[t,o]=je.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return je.getBuiltinModule(e)}return ts(e)};Vt("node:fs");Vt("node:fs/promises");let os;const rs=e=>(os??=w(import.meta.url))(e),Ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ss=e=>{if(typeof Ke<"u"&&Ke.versions&&Ke.versions.node){const[t,o]=Ke.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ke.getBuiltinModule(e)}return rs(e)};ss("node:fs");let ns;const us=e=>(ns??=w(import.meta.url))(e),Xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,is=e=>{if(typeof Xe<"u"&&Xe.versions&&Xe.versions.node){const[t,o]=Xe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Xe.getBuiltinModule(e)}return us(e)};is("node:fs/promises");let ls;const as=e=>(ls??=w(import.meta.url))(e),ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ps=e=>{if(typeof ze<"u"&&ze.versions&&ze.versions.node){const[t,o]=ze.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ze.getBuiltinModule(e)}return as(e)};ps("node:fs");let cs;const fs=e=>(cs??=w(import.meta.url))(e),We=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gs=e=>{if(typeof We<"u"&&We.versions&&We.versions.node){const[t,o]=We.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return We.getBuiltinModule(e)}return fs(e)};gs("node:crypto");new TextEncoder;let hs;const ds=e=>(hs??=w(import.meta.url))(e),Qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bs=e=>{if(typeof Qe<"u"&&Qe.versions&&Qe.versions.node){const[t,o]=Qe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Qe.getBuiltinModule(e)}return ds(e)};bs("node:fs/promises");let ys;const ms=e=>(ys??=w(import.meta.url))(e),qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vs=e=>{if(typeof qe<"u"&&qe.versions&&qe.versions.node){const[t,o]=qe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return qe.getBuiltinModule(e)}return ms(e)};vs("node:fs");let As;const _s=e=>(As??=w(import.meta.url))(e),Ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rs=e=>{if(typeof Ze<"u"&&Ze.versions&&Ze.versions.node){const[t,o]=Ze.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ze.getBuiltinModule(e)}return _s(e)};Rs("node:fs/promises");let xs;const Ts=e=>(xs??=w(import.meta.url))(e),Ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Es=e=>{if(typeof Ye<"u"&&Ye.versions&&Ye.versions.node){const[t,o]=Ye.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ye.getBuiltinModule(e)}return Ts(e)};Es("node:fs");let Cs;const Ss=e=>(Cs??=w(import.meta.url))(e),Ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xt=e=>{if(typeof Ve<"u"&&Ve.versions&&Ve.versions.node){const[t,o]=Ve.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ve.getBuiltinModule(e)}return Ss(e)},$s=xt("fs"),Os=xt("os"),ws=xt("path");var vt={},Pt;function ks(){if(Pt)return vt;Pt=1;var e=Object.defineProperty,t=(h,T)=>e(h,"name",{value:T,configurable:!0}),o=$s,g=Os,p=ws;const r=t(h=>{let T="";for(let C=0;C<h.length;C+=1){const E=h[C],L=E.toUpperCase();T+=E===L?E.toLowerCase():L}return T},"invertCase"),l=new Map,a=t((h,T)=>{const C=p.join(h,`.is-fs-case-sensitive-test-${process.pid}`);try{return T.writeFileSync(C,""),!T.existsSync(r(C))}finally{try{T.unlinkSync(C)}catch{}}},"checkDirectoryCaseWithWrite"),c=t((h,T,C)=>{try{return a(h,C)}catch(E){if(T===void 0)return a(g.tmpdir(),C);throw E}},"checkDirectoryCaseWithFallback"),A=t((h,T=o,C=!0)=>{const E=h??process.cwd();if(C&&l.has(E))return l.get(E);let L;const te=r(E);return te!==E&&T.existsSync(E)?L=!T.existsSync(te):L=c(E,h,T),C&&l.set(E,L),L},"isFsCaseSensitive");return vt.isFsCaseSensitive=A,vt}ks();const Ut=e=>{const t=lo();if(Tt==="win32"){const r=et.LOCALAPPDATA,l=t?se(t,"AppData","Local"):at(),a=r&&r.length>0?r:l;return se(a,e,"Cache")}if(Tt==="darwin"){const r=t?se(t,"Library","Caches"):at();return se(r,e)}const o=et.XDG_CACHE_HOME,g=t?se(t,".cache"):at(),p=o&&o.length>0?o:g;return se(p,e)},Ns=e=>{if(e.length===0)return;const t=e.map(r=>nt(me(r)).split(pt));let o=Number.POSITIVE_INFINITY;for(const r of t)r.length<o&&(o=r.length);const g=[];for(let r=0;r<o;r+=1){const l=t[0][r];if(t.every(a=>a[r]===l))g.push(l);else break}const p=g.join(pt);return p===""?pt:p},Je=(e,t)=>{if(e!==void 0)return t?(...o)=>se(e,...o):e},Hs=e=>{if(e?.files&&e.files.length>0){const t=Ns(e.files);if(t!==void 0)return t}return e?.cwd??ao()},Ls=e=>new qr(`No package.json found searching upwards from '${me(e)}'.`),Bs=e=>!ut(e,Kt)&&ut(e),Is=(e,t)=>{if(et.CACHE_DIR&&!["0","1","false","true"].includes(et.CACHE_DIR)){const A=se(et.CACHE_DIR,e);return t?.create&&Ee(A),Je(A,t?.thunk)}const o=Hs(t),g=xr("package.json",{cwd:o,type:"file"});if(!g){if(t?.useGlobalCacheFallback){const A=Ut(e);return t.create&&Ee(A),Je(A,t.thunk)}if(t?.throwError)throw Ls(o);return}const p=_t(g),r=se(p,"node_modules"),l=se(r,".cache"),a=se(l,e);if(ut(a,Kt))return t?.create&&Ee(a),Je(a,t?.thunk);const c=[a,l,r];if(ut(r)||c.push(p),c.some(A=>Bs(A))){if(t?.useGlobalCacheFallback){const A=Ut(e);return t.create&&Ee(A),Je(A,t.thunk)}return}return t?.create&&Ee(a),Je(a,t?.thunk)},Ps=Is,Ft="@inherit",Ms=["aliases","dependsOn","inputs","outputs"],Ds=(e,t)=>{if(t===void 0)return e===void 0?void 0:[...e];if(!t.includes(Ft))return[...t];const o=[];for(const g of t){if(g===Ft){e!==void 0&&o.push(...e);continue}o.push(g)}return o},Us=(e,t)=>{const o={...e,...t};for(const g of Ms){const p=e?.[g],r=t?.[g],l=Ds(p,r);l===void 0?delete o[g]:o[g]=l}return o};export{Ps as K,Us as m};
@@ -1 +0,0 @@
1
- import{createRequire as _}from"node:module";import{v as m,w as v,l as I,z as j}from"./index-BLtnel38.js";let y;const b=e=>(y??=_(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[s,r]=h.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return h.getBuiltinModule(e)}return b(e)},{platform:C}=T("node:os"),x={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},q=e=>{const s=e.preset??e.options?.preset;if(!s)return e;const r=x[s];if(!r)return e;const{cache:n,...t}=r;return{...e,cache:e.cache??n,options:{...t,...e.options}}},$=()=>{const e=C();return e==="darwin"?"macos":e==="win32"?"windows":"linux"},k=(e,s)=>{if(!s||s.size===0)return!0;const r=e?.runnerTags;return!r||r.length===0?!0:r.some(n=>s.has(n))},A=(e,s,r=!0)=>{const n=e?.runInCI??!0;return n===!0||n==="always"?!0:n===!1?!s:n==="affected"?!s||r:!0},z=(e,s,r)=>r||!s?e:m(s)?s:v(e,s),B=(e,s)=>{if(s===!1)return{};const r=s===!0?O("production"):Array.isArray(s)?s:[s],n={};for(const t of r)Object.assign(n,R(e,t,n));return n},g=(e,s)=>{const r=t=>{const c=s[t];return c!==void 0?c:process.env[t]??""};let n="";for(let t=0;t<e.length;t+=1){const c=e[t];if(c==="\\"&&e[t+1]==="$"){n+="$",t+=1;continue}if(c!=="$"){n+=c;continue}const a=e[t+1];if(a==="{"){let o=1,l=t+2;for(;l<e.length;){const d=e[l];if(d==="}"){if(o-=1,o===0)break}else d==="{"&&e[l-1]==="$"&&(o+=1);l+=1}if(o!==0){n+=e.slice(t);break}const f=l,i=e.slice(t+2,f),u=i.indexOf(":-");if(u===-1)n+=r(i);else{const d=i.slice(0,u),w=i.slice(u+2),p=s[d]??process.env[d];n+=p!==void 0&&p!==""?p:g(w,s)}t=f;continue}if(a!==void 0&&/[A-Z_]/i.test(a)){let o=t+1;for(;o<e.length&&/\w/.test(e[o]);)o+=1;n+=r(e.slice(t+1,o)),t=o-1;continue}n+=c}return n},O=e=>{const s=[".env"];return e&&s.push(`.env.${e}`),e!=="test"&&s.push(".env.local"),e&&e!=="test"&&s.push(`.env.${e}.local`),s},R=(e,s,r={})=>{const n=m(s)?s:v(e,s);if(!I(n))return{};let t;try{t=j(n)}catch{return{}}const c={};for(const a of t.split(/\r?\n/)){const o=a.trim();if(o===""||o.startsWith("#"))continue;const l=o.indexOf("=");if(l===-1)continue;const f=o.slice(0,l).trim();if(f==="")continue;let i=o.slice(l+1).trim();const u=i.length>=2&&i.startsWith("'")&&i.endsWith("'");(i.startsWith('"')&&i.endsWith('"')||u)&&(i=i.slice(1,-1)),u||(i=g(i,{...r,...c})),c[f]=i}return c},F=(e,s=$())=>{if(e)return s==="windows"&&e.windowsShell?e.windowsShell:(s==="linux"||s==="macos")&&e.unixShell?e.unixShell:e.shell},M=e=>{if(e==="run")return!1;if(e==="build"||e==="test")return!0};export{F as a,M as b,q as c,$ as d,B as l,k as m,z as r,A as s};
@@ -1,5 +0,0 @@
1
- import{createRequire as F}from"node:module";import{w as v,l as m,c as J,z as y}from"./index-BLtnel38.js";import{a as W}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";let D;const q=o=>(D??=F(import.meta.url))(o),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=o=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,n]=w.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return w.getBuiltinModule(o)}return q(o)},{execFileSync:x}=M("node:child_process"),{randomBytes:B}=M("node:crypto"),{writeFileSync:I,renameSync:R,unlinkSync:U}=M("node:fs"),{delimiter:z}=M("node:path"),H=["proto","mise","fnm","volta","asdf","nvm","corepack"],Z={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["aube","bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},X=["proto","mise","fnm","volta","asdf","nvm","corepack"],A={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},b=new Map,h=o=>{const e=b.get(o);if(e!==void 0||b.has(o))return e;const n=process.env.PATH;if(!n){b.set(o,void 0);return}const t=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const r of n.split(z)){const i=r.replaceAll(/^["']|["']$/g,"").trim();if(i!=="")for(const l of t){const s=`${i}${J}${o}${l}`;if(m(s))return b.set(o,s),s}}b.set(o,void 0)},S=(o,e=["--version"])=>{try{const n=x(o,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),t=/\d+\.\d+(?:\.\d+)?/.exec(n);return t?t[0]:n.trim()||void 0}catch{return}},T=(o,e)=>{const n=v(o,"package.json");if(!m(n))return[];try{const t=W(n)[e];if(e==="volta"&&typeof t=="object"&&t!==null&&Object.keys(t).length>0)return["package.json"];if(e==="packageManager"&&typeof t=="string"&&t.length>0)return["package.json"]}catch{}return[]},G=(o,e)=>o==="volta"?T(e,"volta"):o==="corepack"?T(e,"packageManager"):A[o].filter(n=>m(v(e,n))),_=new Map,L=()=>{_.clear(),b.clear()},O=(o,e)=>{{const i=_.get(o);if(i)return i}const n=[],t=!!h("pnpm")||!!h("yarn");for(const i of X){const l=i==="nvm"?void 0:h(i),s=i==="nvm"&&!!process.env.NVM_DIR,c=G(i,o),a=!!l||s;i==="corepack"&&!a&&(!(c.length>0)||t)||!a&&c.length===0||n.push({binPath:l,configFiles:c,installed:a,name:i,version:l?S(l):void 0})}const r=Object.freeze(n);return _.set(o,r),r},de=(o,e,n)=>{const t=O(o);return e?.preferredManager&&e.preferredManager!=="none"?t.find(r=>r.name===e.preferredManager)??{configFiles:[],installed:!1,name:e.preferredManager}:t.find(r=>r.installed&&r.configFiles.length>0)??t.find(r=>r.installed)??t.find(r=>r.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},V=(o,e)=>{for(const n of e){const t=v(o,n);if(m(t))try{const r=y(t).trim();if(r!=="")return{name:n,value:r.replace(/^v/,"")}}catch{}}},K=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,Y=o=>{const e=v(o,".prototools");if(!m(e))return[];const n=y(e),t=[];let r=!1;for(const i of n.split(/\r?\n/)){const l=i.trim();if(l===""||l.startsWith("#"))continue;if(l.startsWith("[")){r=!0;continue}if(r)continue;const s=K.exec(l);if(!s)continue;const[,c,a]=s,p=g(c);p&&t.push({source:".prototools",tool:p,version:a.trim()})}return t},Q=/^\[tools\]\s*$/i,ee=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,oe=o=>{for(const e of A.mise){const n=v(o,e);if(!m(n))continue;const t=[],r=y(n);let i=!1;for(const l of r.split(/\r?\n/)){const s=l.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=Q.test(s);continue}if(!i)continue;const c=ee.exec(s);if(!c)continue;const[,a,p]=c,d=g(a);d&&t.push({source:".mise.toml",tool:d,version:p.trim()})}if(t.length>0)return t}return[]},ne=o=>{const e=v(o,".tool-versions");if(!m(e))return[];const n=y(e),t=[];for(const r of n.split(/\r?\n/)){const i=r.trim();if(i===""||i.startsWith("#"))continue;const l=i.split(/\s+/);if(l.length<2)continue;const[s,...c]=l,a=g(s);a&&c[0]&&t.push({source:".tool-versions",tool:a,version:c[0]})}return t},g=o=>{switch(o.toLowerCase()){case"aube":return"aube";case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},te=o=>{const[e]=o.split("+",1),n=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(e??"");if(!n)return;const t=g(n[1]);if(t)return{source:"packageManager",tool:t,version:n[2]}},re=(o,e)=>{const n=new Map,t=s=>{n.set(s.tool,s)},r=v(o,"package.json");let i={};try{m(r)&&(i=W(r))}catch{}if(i.engines)for(const[s,c]of Object.entries(i.engines)){const a=g(s);a&&typeof c=="string"&&t({source:"engines",tool:a,version:c})}if(i.packageManager){const s=te(i.packageManager);s&&t(s)}if(i.volta)for(const[s,c]of Object.entries(i.volta)){const a=g(s);a&&typeof c=="string"&&t({source:"volta",tool:a,version:c})}const l=V(o,[".nvmrc",".node-version"]);l&&t({source:l.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:l.value});for(const s of ne(o))t(s);for(const s of oe(o))t(s);for(const s of Y(o))t(s);if(e?.tools)for(const[s,c]of Object.entries(e.tools)){const a=g(s);a&&typeof c=="string"&&t({source:"vis.config.ts",tool:a,version:c})}return[...n.values()]},P={aube:{args:["--version"],binaries:["aube"]},bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},E=o=>{const e=P[o];for(const n of e.binaries){const t=h(n);if(t)return S(t,e.args)}if(o==="node")return process.versions.node},N=(o,e)=>{const n=e.trim();if(n===""||n==="*"||n==="latest")return!0;if(/^\d[\d.]*$/.test(n))return o===n||o.startsWith(`${n}.`);const t=s=>s.split(/[.\-+]/).map(c=>Number.parseInt(c,10)||0),r=(s,c)=>{const a=t(s),p=t(c),d=Math.max(a.length,p.length);for(let f=0;f<d;f++){const $=a[f]??0,u=p[f]??0;if($!==u)return $-u}return 0},i=s=>{for(const c of s)if(c.startsWith(">=")){if(r(o,c.slice(2).trim())<0)return!1}else if(c.startsWith("<=")){if(r(o,c.slice(2).trim())>0)return!1}else if(c.startsWith(">")){if(r(o,c.slice(1).trim())<=0)return!1}else if(c.startsWith("<")){if(r(o,c.slice(1).trim())>=0)return!1}else if(c.startsWith("^")||c.startsWith("~")){const a=c.slice(1).trim(),[p,d]=t(a),[f,$]=t(o);if(f!==p||c.startsWith("~")&&$!==d||r(o,a)<0)return!1}return!0},l=n.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return l.length===0?!0:l.some(s=>i(s))},se=(o,e)=>{switch(o){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return e==="pnpm"||e==="yarn"?["self-activate","volta","proto","mise","corepack"]:e==="npm"?["volta","proto","mise","asdf","corepack"]:e==="aube"?["mise"]:e==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},ie=(o,e,n)=>{if(n?.preferredManager&&n.preferredManager!=="none"&&j(n.preferredManager,o.tool)){const r=e.find(i=>i.name===n.preferredManager);return r?{installed:r.installed,name:r.name}:{installed:!1,name:n.preferredManager,note:`${n.preferredManager} is the preferred manager but isn't on PATH`}}const t=se(o.source,o.tool);for(const r of t){if(r==="self-activate"){if((o.tool==="pnpm"||o.tool==="yarn")&&h(o.tool))return{installed:!0,name:"self-activate",note:`${o.tool} will activate ${o.version} from the packageManager field on next invocation`};continue}if(j(r,o.tool)&&e.find(i=>i.name===r)?.installed)return{installed:!0,name:r}}for(const r of t)if(!(r==="self-activate"||!j(r,o.tool)))return{installed:!1,name:r,note:`${r} can install ${o.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},j=(o,e)=>o==="none"?!1:o==="self-activate"?e==="pnpm"||e==="yarn":Z[o].includes(e),ae=(o,e)=>{const n=O(o),t=re(o,e).map(r=>{const i=E(r.tool),l=i!==void 0&&N(i,r.version),s=ie(r,n,e);return{actual:i,expected:r,manager:s,matches:l}});return{detected:n,tools:t}},ce=(o,e)=>{switch(o){case"asdf":return e?{args:["install",e.tool,e.version],bin:"asdf"}:void 0;case"corepack":return e?{args:["prepare",`${e.tool}@${e.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return e?.tool!=="node"?void 0:{args:["install",e.version],bin:"fnm"};case"mise":return e?{args:["install",`${e.tool}@${e.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return e?{args:["install",e.tool,e.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:e?.tool??"pnpm",hint:`${e?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return e?{args:["install",`${e.tool}@${e.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},ge=(o,e)=>{switch(o){case"asdf":return{args:["local",e.tool,e.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${e.tool} ${e.version}`}};case"corepack":return e.tool!=="npm"&&e.tool!=="pnpm"&&e.tool!=="yarn"?void 0:{args:["use",`${e.tool}@${e.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${e.tool}@${e.version}"`}};case"fnm":return e.tool==="node"?{args:["use",e.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${e.tool}@${e.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${e.tool} ${e.version}`}};case"none":return;case"nvm":return e.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",e.tool,e.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${e.tool} ${e.version}`}};case"self-activate":return{args:[],bin:e.tool,configChange:{file:"package.json",hint:`Set packageManager: "${e.tool}@${e.version}" — ${e.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${e.tool}@${e.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${e.tool}`}};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},he=o=>{for(const e of P[o].binaries){const n=h(e);if(n)return n}},$e=(o,e)=>{const n=P[e].binaries;if(o.installed&&o.binPath&&(o.name==="proto"||o.name==="mise"||o.name==="asdf"||o.name==="volta"||o.name==="fnm"))for(const t of n)try{const r=x(o.binPath,["which",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(r)return r}catch{}for(const t of n){const r=h(t);if(r)return r}},C=(o,e)=>{const n=`${o}.${process.pid}.${B(6).toString("hex")}.tmp`;I(n,e);try{R(n,o)}catch(t){try{U(n)}catch{}throw t}},le=(o,e)=>{if("packageManager"in o)return o.packageManager=e,o;const n={};let t=!1;for(const[r,i]of Object.entries(o))!t&&(r==="dependencies"||r==="devDependencies"||r==="peerDependencies"||r==="optionalDependencies")&&(n.packageManager=e,t=!0),n[r]=i;return t||(n.packageManager=e),n},be=(o,e)=>{if(e.tool!=="pnpm"&&e.tool!=="yarn"&&e.tool!=="npm"&&e.tool!=="bun")return;const n=v(o,"package.json");if(!m(n))throw new Error(`Cannot pin ${e.tool}: ${n} does not exist.`);const t=y(n),r=/\n([ \t]+)/.exec(t)?.[1]??" ";let i;try{i=JSON.parse(t)}catch(a){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}const l=`${e.tool}@${e.version}`,s=le(i,l),c=t.endsWith(`
2
- `)?`
3
- `:"";return C(n,`${JSON.stringify(s,void 0,r)}${c}`),l},ye=(o,e)=>{const n=v(o,"package.json");if(!m(n))return;const t=y(n);let r;try{r=JSON.parse(t)}catch(s){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${s.message}`,{cause:s})}if(r.engines?.[e.tool]===void 0||r.engines[e.tool]===e.version)return;r.engines[e.tool]=e.version;const i=/\n([ \t]+)/.exec(t)?.[1]??" ",l=t.endsWith(`
4
- `)?`
5
- `:"";return C(n,`${JSON.stringify(r,void 0,i)}${l}`),e.version},ke=o=>{const e=/^([a-z][\w-]*)@(.+)$/i.exec(o.trim());if(!e)return;const n=g(e[1]);if(n)return{source:"vis.config.ts",tool:n,version:e[2]}},fe=async(o,e,n)=>{const t=ae(o,e),r=t.tools.filter(a=>!a.matches);if(r.length===0)return{attempted:[],failed:[],upToDate:!0};const i=t.detected.some(a=>a.installed);if(!(e?.autoInstall??i))return{attempted:[],failed:[],upToDate:!1};const l=[],s=[],c=new Map;for(const a of r){const p=c.get(a.manager.name);p?p.push(a):c.set(a.manager.name,[a])}for(const[a,p]of c){if(a==="self-activate"){for(const{expected:f}of p)n.info(`toolchain: ${f.tool} ${f.version} will self-activate on next ${f.tool} invocation`),l.push(f);continue}if(a==="none"){for(const{expected:f}of p)s.push({error:`no manager can install ${f.tool} — install one of ${H.join(", ")}`,spec:f});continue}if(!t.detected.find(f=>f.name===a)?.installed){for(const{expected:f}of p)s.push({error:`${a} is not on PATH`,spec:f});continue}const d=p.map(f=>({invocation:ce(a,f.expected),tool:f})).filter(f=>f.invocation!==void 0);for(const{invocation:f,tool:$}of d){const{expected:u}=$;if(f.bin==="nvm"&&f.args.length===0){const k=E(u.tool);if(k!==void 0&&N(k,u.version)){n.info(`toolchain: ${u.tool} ${k} already satisfies ${u.version}; skipping nvm shell activation`),l.push(u);continue}n.warn(`toolchain: nvm requires a shell-side activation for ${u.tool} ${u.version}. Run \`nvm install\` / \`nvm use\` manually.`),s.push({error:"nvm requires shell-side activation",spec:u});continue}n.info(`toolchain: $ ${f.bin} ${f.args.join(" ")}`);try{x(f.bin,f.args,{cwd:o,stdio:"inherit"}),l.push(u),a==="fnm"&&pe(f.bin,n)}catch(k){s.push({error:k.message,spec:u});break}}}return L(),{attempted:l,failed:s,upToDate:!1}},we=async(o,e,n,t=!1)=>{if(t)return;const r=await fe(o,e,n);for(const i of r.failed)n.warn(`toolchain: ${i.spec.tool} ${i.spec.version} — ${i.error}`)},pe=(o,e)=>{const n=process.platform==="win32"?"powershell":"bash";try{const t=x(o,["env","--shell",n],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3});for(const r of t.split(/\r?\n/)){const i=r.trim();if(i==="")continue;const l=/^\$env:([A-Z_]\w*)\s*=\s*(.+)$/i.exec(i);if(l){const[,a,p]=l;process.env[a]=p.replaceAll(/^["']|["']$/g,"");continue}const s=/^set\s+"?([A-Z_]\w*)=(.*?)"?$/i.exec(i);if(s){const[,a,p]=s;process.env[a]=p;continue}const c=/^(?:export\s+)?([A-Z_]\w*)=(.+)$/i.exec(i);if(c){const[,a,p]=c;process.env[a]=p.replaceAll(/^["']|["']$/g,"")}}}catch(t){e.warn(`toolchain: could not activate fnm env (${t.message}). Subsequent tasks may use the previous Node version.`)}};export{H as S,ke as a,ce as b,ie as c,ge as d,$e as e,O as f,ae as g,he as h,de as p,we as r,ye as u,be as w};
@@ -1 +0,0 @@
1
- import{createRequire as q}from"node:module";import{V as j,s as b}from"./index.server-CusjRLCh.js";import{w as T,l as A}from"./index-BLtnel38.js";import{g as C}from"./_commonjsHelpers-B5Y90VFO.js";import{i as g,p as c}from"../packem_chunks/cli-main.js";import{a as D}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";let $;const _=e=>($??=q(import.meta.url))(e),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,z=e=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[s,r]=d.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return d.getBuiltinModule(e)}return _(e)},{createInterface:M}=z("node:readline");var O=["aj","aju","av","avj","ejv","jav","jv"],R=["angula","angular-node","angularjs"],N=["auto-prefixer"],S=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],B=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],F=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],P=["bcryptjs-node","dcryptjs"],W=["bunan","bunya","bunyan-node","buynan"],E=["cai","cha","chaijs","chal","chi","chia","hai"],L=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],U=["cheero","cherio"],V=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],I=["ccolors","colors-node","colorss","colorz","colrs","coolors"],Y=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],G=["cor","corss","cos","cosr","cros","crs","ors"],H=["days"],J=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],K=["dot-env","dotenv-node","dotenvjs","dotevn"],Q=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],X=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],Z=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],ee=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],oe=["astify"],se=["firebasejs"],re=["form1dable"],ae=["glb","glo","glob-js","globjs","gob","golb","lob"],te=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],ne=["helmetjs","helnet"],ce=["homo","hon","hoo","hoon","ohno","ono"],ie=["inquire","inquirer-js","nquirer"],de=["iredis"],me=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],le=["imp","jim","jip","jmp"],pe=["ji","jio","jo","joii","jol","oi","oji"],ue=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],ve=["jsonwebtoken-js","jsonwebtoken-node"],he=["ka","kao","ko","koaa","koajs","koe","oa","oka"],je=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],be=["luca","luci","lucie"],ke=["luon","luxo","luxon-js"],ge=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],fe=["minimath"],ye=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],xe=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],we=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],qe=["moran","organ"],$e=["muler","multer-js","muter"],_e=["mysql"],ze=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],Me=["node-mailer","nodemailer-js"],Te=["nodemo","nodemonjs","nodmeon"],Ae=["oar","or","ora-node","ore","ra","roa"],Ce=["arcel","parce","parceljs"],De=["passport-js"],Oe=["phase","phaser-node"],Re=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Ne=["playright","playwright-js"],Se=["postcss-js","postcss-node","potscss"],Be=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Fe=["prima","prism","prisma-js","prismajs","prizma"],Pe=["pupeteer"],We=["rada","rama","ramd","randa"],Ee=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],Le=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Ue=["resen","rsend"],Ve=["ollup","rollup-js","rollup-node"],Ie=["ass","asss","sas","sass-node","sess","ssas","sss"],Ye=["emver","seemver","semver-node","semvre","senver","sever"],Ge=["sequelize-js","sequelize-node"],He=["harp","shap","shar","sharp-js","sharpjs"],Je=["stipe","strip","stripe-node","tripe"],Ke=["supabase-js"],Qe=["suelte","svelt3","svelte-js","sveltejs","velte"],Xe=["tailwindcss-js"],Ze=["auri","taui"],eo=["hree","htree","thee","there","three-js","three-node","tree"],oo=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],so=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],ro=["udnerscore","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],ao=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],to=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],no=["itest","uitest","vitestjs","vitezt","vittest","vtest"],co=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],io=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],mo=["winson","winston-js","winstoon"],lo=["up","uyp","yp","yu","yupjs","yupp"],po=["od","zd","zdo","zo","zob","zod-js","zodjs"];const uo={ajv:O,angular:R,autoprefixer:N,"aws-sdk":["awssdk","ews-sdk"],axios:S,babel:B,bcrypt:F,bcryptjs:P,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:W,chai:E,chalk:L,cheerio:U,color:V,colors:I,commander:Y,"cookie-parser":["cookie-parse","cookieparser"],cors:G,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:H,debug:J,dotenv:K,electron:Q,esbuild:X,eslint:Z,express:ee,fastify:oe,firebase:se,formidable:re,glob:ae,got:te,helmet:ne,hono:ce,inquirer:ie,ioredis:de,jest:me,jimp:le,joi:pe,jsdom:ue,jsonwebtoken:ve,koa:he,lodash:je,lucia:be,luxon:ke,micromatch:ge,minimatch:fe,mocha:ye,moment:xe,mongoose:we,morgan:qe,multer:$e,mysql2:_e,next:ze,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:Me,nodemon:Te,ora:Ae,parcel:Ce,passport:De,phaser:Oe,pino:Re,playwright:Ne,postcss:Se,prettier:Be,prisma:Fe,puppeteer:Pe,ramda:We,react:Ee,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:Le,resend:Ue,rollup:Ve,sass:Ie,semver:Ye,sequelize:Ge,sharp:He,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:Je,supabase:Ke,svelte:Qe,tailwindcss:Xe,tauri:Ze,three:eo,"ts-node":["tts-node"],tsx:oo,typescript:so,underscore:ro,uuid:ao,vite:to,vitest:no,vue:co,webpack:io,winston:mo,yup:lo,zod:po};var u,k;function vo(){return k||(k=1,u={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),u}var ho=vo();const jo=C(ho),bo={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},ko=["app","cli","core","kit","lib","pkg","sdk"],go=e=>{const s=new Set;if(e.length<3)return s;for(let o=0;o<e.length;o++){const a=e[o],t=a==="-"||a==="."||a==="_";if(t||s.add(e.slice(0,o)+e.slice(o+1)),t||s.add(e.slice(0,o)+a+e.slice(o)),o<e.length-1&&e[o]!==e[o+1]){const p=e[o+1]==="-"||e[o+1]==="."||e[o+1]==="_";if(!t&&!p){const i=[...e];[i[o],i[o+1]]=[i[o+1],i[o]],s.add(i.join(""))}}const n=e[o].toLowerCase(),h=bo[n];if(h)for(const p of h)s.add(e.slice(0,o)+p+e.slice(o+1))}const r=/[-._]/g;if(r.test(e))s.add(e.replaceAll(r,"")),s.add(e.replaceAll(r,"-")),s.add(e.replaceAll(r,".")),s.add(e.replaceAll(r,"_"));else if(e.length>5)for(let o=2;o<e.length-2;o++)s.add(`${e.slice(0,o)}-${e.slice(o)}`),s.add(`${e.slice(0,o)}.${e.slice(o)}`),s.add(`${e.slice(0,o)}_${e.slice(o)}`);if(e.startsWith("@")||(s.add(`${e}-js`),s.add(`${e}js`),s.add(`${e}-node`)),e.startsWith("@")){const o=e.indexOf("/");if(o>1&&o<e.length-1){const a=e.slice(1,o),t=e.slice(o+1);a.length>=3&&s.add(a);for(const n of["","-",".","_"])s.add(`${a}${n}${t}`),s.add(`${t}${n}${a}`);for(const n of ko)s.add(`${a}-${n}`),s.add(`${t}-${a}-${n}`),s.add(`${n}-${a}-${t}`)}}return s.delete(e),s};let v,l,m;const f=()=>{if(!v){const e={};for(const s of[uo,jo])for(const[r,o]of Object.entries(s)){const a=e[r]??(e[r]=[]);for(const t of o)a.includes(t)||a.push(t)}v=e}return v},fo=()=>{if(!l){l=new Map;for(const[e,s]of Object.entries(f()))for(const r of s)l.set(r,e)}return l},yo=()=>{if(!m){m=new Map;for(const e of Object.keys(f()))for(const s of go(e))m.has(s)||m.set(s,e)}return m},xo=e=>e.startsWith("@")?e.split("/")[1]??e:e,wo=e=>{const s=xo(e),r=fo().get(s);if(r)return{input:e,legitimate:r,method:"blocklist"};const o=yo().get(s);if(o)return{input:e,legitimate:o,method:"heuristic"}},y=(e,s)=>{const r=s?new Set(s):void 0,o=[];for(const a of e){if(r?.has(a))continue;const t=wo(a);t&&o.push(t)}return o},x=(e,s)=>{c.warn(""),c.warn(j(`Possible typosquat${e.length===1?"":"s"} ${s}:`));for(const r of e){const o=r.method==="blocklist"?"known typosquat":"similar name";c.warn(` ${b("⚠")} ${j(r.input)} — did you mean ${b(r.legitimate)}? (${o})`)}c.warn("")},w=async e=>{if(!process.stdin.isTTY){c.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const s=M({input:process.stdin,output:process.stdout}),r=await new Promise(o=>{s.question(e,a=>{o(a.trim().toLowerCase())})});return s.close(),r},Oo=async(e,s)=>{if(g("typosquats"))return{ok:!0,packages:e};const r=y(e,s);if(r.length===0)return{ok:!0,packages:e};x(r,"detected");const o=await w(`Use suggested package${r.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(o===void 0)return{ok:!1,packages:e};if(o==="s"||o==="suggested"){const a=new Map(r.map(t=>[t.input,t.legitimate]));return{ok:!0,packages:e.map(t=>a.get(t)??t)}}return o==="y"||o==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},qo=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,$o=e=>qo.exec(e)?.[1],_o=e=>{if(!A(e))return[];const s=D(e),r={...s.dependencies,...s.devDependencies,...s.optionalDependencies,...s.peerDependencies},o=new Set;for(const[a,t]of Object.entries(r)){o.add(a);const n=$o(t);n&&o.add(n)}return[...o]},Ro=async(e,s)=>{if(g("typosquats"))return!0;const r=T(e,"package.json"),o=_o(r);if(o.length===0)return!0;const a=y(o,s);if(a.length===0)return!0;x(a,"in package.json dependencies"),c.warn("Fix the package name in package.json before proceeding.");const t=await w("Continue anyway? [y/N] ");return t==="y"||t==="yes"};export{Oo as r,Ro as s};
@@ -1 +0,0 @@
1
- import{r,Y as a}from"../packem_chunks/catalog.js";import"./en-BDYMmM2_.js";const f=(s,o)=>{const t=r.useRef(null),[u,n]=r.useState(s);return r.useLayoutEffect(()=>{if(!t.current)return;const{height:e}=a(t.current);e>0&&e!==u&&(n(e),o?.(e))}),{measuredHeight:u,ref:t}};export{f as u};
@@ -1 +0,0 @@
1
- const o=e=>e?Array.isArray(e)?e:[e]:[],a=(e,r)=>{const c=r??[];return c[0]==="--"?[...e??[]]:[...e??[],...c]},p=e=>e instanceof Error?e.message:typeof e=="string"?e:String(e),n=e=>e.replace(/^\.\//,"").replace(/\/+$/,""),t=/[\u0000-\u001F\u007F ~^:?*[\\]/g,u=e=>{const r=e.replaceAll("@{","-").replaceAll("..","-").replaceAll(t,"-").replace(/\.lock$/i,"").replace(/^[./-]+/,"").replace(/[./-]+$/,"");return r.length>0?r:"split"},l=/^(.+?)(?:@(.+))?$/,v=e=>{if(e.startsWith("@")){const c=e.indexOf("/");if(c===-1)return{name:e,versionSpec:void 0};const s=e.slice(c+1),i=s.indexOf("@");return i===-1?{name:e,versionSpec:void 0}:{name:e.slice(0,c+1+i),versionSpec:s.slice(i+1)}}const r=l.exec(e);return r?{name:r[1]??e,versionSpec:r[2]}:{name:e,versionSpec:void 0}};export{n as a,a as c,u as d,v as f,o as i,p as o};
@@ -1 +0,0 @@
1
- import{createRequire as g}from"node:module";import{w as i,l as a,z as d,a as b}from"./index-BLtnel38.js";import"./index-tNFGWxc0.js";let h;const u=n=>(h??=g(import.meta.url))(n),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=n=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[s,e]=p.versions.node.split(".").map(Number);if(s>22||s===22&&e>=3||s===20&&e>=16)return p.getBuiltinModule(n)}return u(n)},{readdirSync:j}=m("node:fs"),v=[".husky/pre-commit",".vis/hooks/pre-commit",".git/hooks/pre-commit"],w=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],$=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],_=n=>{const s=i(n,"package.json");if(!a(s))return[];let e;try{e=JSON.parse(d(s))}catch{return[]}const o=[];if(e.scripts)for(const[t,c]of Object.entries(e.scripts))typeof c=="string"&&(/\bgitleaks\b/.test(c)&&o.push({detail:`Script "${t}" still invokes gitleaks: ${c}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(c)&&o.push({detail:`Script "${t}" still invokes secretlint: ${c}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(c)&&o.push({detail:`Script "${t}" still invokes syncpack: ${c}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(c)&&o.push({detail:`Script "${t}" still invokes sherif: ${c}`,kind:"script",location:"package.json",tool:"sherif"}));if(e.devDependencies)for(const t of Object.keys(e.devDependencies))(t==="gitleaks"||t==="@gitleaks/cli")&&o.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(t==="secretlint"||t.startsWith("@secretlint/"))&&o.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),t==="syncpack"&&o.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),t==="sherif"&&o.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return e.sherif&&o.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),o},D=n=>{const s=[];for(const e of v){const o=i(n,e);if(!a(o))continue;const t=d(o);/\bgitleaks\b/.test(t)&&s.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:e,tool:"gitleaks"}),/\bsecretlint\b/.test(t)&&s.push({detail:"secretlint invocation still present in hook",kind:"hook",location:e,tool:"secretlint"}),/\bsyncpack\b/.test(t)&&s.push({detail:"syncpack invocation still present in hook",kind:"hook",location:e,tool:"syncpack"}),/\bsherif\b/.test(t)&&s.push({detail:"sherif invocation still present in hook",kind:"hook",location:e,tool:"sherif"})}return s},S=n=>{const s=[];for(const e of w)a(i(n,e))&&s.push({detail:"secretlint config should be removed after migration",kind:"config",location:e,tool:"secretlint"});for(const e of $)a(i(n,e))&&s.push({detail:"syncpack config should be removed after migration",kind:"config",location:e,tool:"syncpack"});return s},O=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],q=n=>{const s=[],e=o=>{const t=i(n,o);if(!a(t))return;const c=d(t);/\bsyncpack\b/.test(c)&&s.push({detail:"syncpack invocation still present in CI",kind:"ci",location:o,tool:"syncpack"}),/\bsherif\b/.test(c)&&s.push({detail:"sherif invocation still present in CI",kind:"ci",location:o,tool:"sherif"})};for(const o of O){const t=i(n,o);if(a(t)){if(o===".github/workflows"){try{for(const c of j(t))(c.endsWith(".yml")||c.endsWith(".yaml"))&&e(`.github/workflows/${c}`)}catch{}continue}e(o)}}return s},M=n=>{const s=[],e=i(n,"pnpm-workspace.yaml");if(a(e)){let t;try{t=b(e)}catch{t=void 0}if(t&&typeof t=="object"){const c=t.catalog;c&&typeof c.syncpack=="string"&&s.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const l=t.catalogs;if(l&&typeof l=="object")for(const[k,r]of Object.entries(l))r&&typeof r.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${k}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const o=i(n,"package.json");if(a(o)){let t;try{t=JSON.parse(d(o))}catch{return s}const c=t.workspaces;if(c&&typeof c=="object"&&!Array.isArray(c)){const k=c.catalog;k&&typeof k.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const r=c.catalogs;if(r&&typeof r=="object")for(const[y,f]of Object.entries(r))f&&typeof f.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${y}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const l=t.catalog;l&&typeof l.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return s},N=n=>[..._(n),...D(n),...S(n),...q(n),...M(n)],W=(n,s)=>{const e=N(n);if(e.length===0)return s.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];s.warn(`Found ${String(e.length)} unmigrated reference(s):`);for(const o of e)s.warn(` [${o.kind}] ${o.location} — ${o.detail}`);return e};export{N as s,W as v};
@@ -1 +0,0 @@
1
- import{l as e,m as l,i as r,r as g}from"../packem_chunks/catalog.js";import{I as ae,J as je,K as ge,M as ne}from"../packem_chunks/cli-main.js";import{Spinner as me}from"@visulima/tui-kit/spinner";import{Dialog as J}from"@visulima/tui-kit/dialog";import{ScrollView as fe}from"@visulima/tui-kit/scroll-view";import{B as ue}from"./en-BDYMmM2_.js";import{ScrollBar as ye}from"@visulima/tui-kit/scroll-bar";import{Tab as we}from"@visulima/tui-kit/tab";import{Tabs as Ce}from"@visulima/tui-kit/tabs";import{u as ke}from"./use-measured-height-BwAwGHjw.js";const We=({current:a,total:t})=>{const{columns:i}=ae(),s=i||80,d=t>0?Math.min(1,a/t):0,h=`${String(Math.round(d*100)).padStart(3)}%`,f=`${String(a)}/${String(t)}`,y=Math.max(10,s-2-h.length-1),p=Math.round(y*d),j=y-p;return e.jsxs(l,{flexDirection:"column",paddingX:1,children:[e.jsxs(l,{children:[e.jsx(me,{type:"dots"}),e.jsx(r,{children:" Checking catalog dependencies "}),e.jsx(r,{dimColor:!0,children:f})]}),e.jsxs(l,{children:[e.jsx(r,{color:"cyan",children:"━".repeat(p)}),e.jsx(r,{dimColor:!0,children:"─".repeat(j)}),e.jsxs(r,{dimColor:!0,children:[" ",h]})]})]})},_=["default","name","updateType","severity"],ce=a=>{const t=a.vulnerabilities?.map(i=>i.severity)??[];return t.includes("CRITICAL")?4:t.includes("HIGH")?3:t.includes("MODERATE")?2:t.includes("LOW")?1:0},de={digest:0,major:3,minor:2,patch:1,pin:0,unknown:0},he=(a,t)=>{if(t==="default")return a;const i=[...a];return t==="name"?i.sort((s,d)=>s.packageName.localeCompare(d.packageName)):t==="updateType"?i.sort((s,d)=>(de[d.updateType]??0)-(de[s.updateType]??0)||s.packageName.localeCompare(d.packageName)):i.sort((s,d)=>ce(d)-ce(s)||s.packageName.localeCompare(d.packageName)),i},Z=a=>`${a.ecosystem}|${a.file}:${String(a.line)}|${a.name}`,A=a=>`${a.catalogName} ${a.packageName}`,Y=a=>{const t=new Map;for(const i of a){const s=t.get(i.catalogName);s?s.push(i):t.set(i.catalogName,[i])}return t},G=(a,t,i)=>{let s=a;if(t!=="all"&&(s=t==="security"?s.filter(d=>d.vulnerabilities&&d.vulnerabilities.length>0||d.socketReport&&d.socketReport.alerts.length>0):s.filter(d=>d.updateType===t)),i){const d=i.toLowerCase();s=s.filter(h=>h.packageName.toLowerCase().includes(d))}return s};class ze{#e;#l=new Set;#t;#s;#i=null;constructor(t,i=null,s=[]){this.#t=t,this.#s=s,i&&(this.#i=new Map(i.recommendations.map(d=>[d.package,d]))),this.#e={aiResult:i,allChecked:!0,applyProgress:null,checkedEcosystemKeys:new Set(s.map(d=>Z(d))),checkedEntries:new Set(t.map(d=>A(d))),ecosystemEntries:s,entries:t,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",groupedByCatalog:Y(t),phase:"browsing",selectedIndex:0,sortMode:"default"}}getSnapshot=()=>this.#e;subscribe=t=>(this.#l.add(t),()=>{this.#l.delete(t)});getFilteredEntries(){return he(G(this.#t,this.#e.filterType,this.#e.filterText),this.#e.sortMode)}setSortMode(t){if(t===this.#e.sortMode)return;const i=this.getFilteredEntries()[this.#e.selectedIndex]?.packageName,s=he(G(this.#t,this.#e.filterType,this.#e.filterText),t),d=i?Math.max(0,s.findIndex(h=>h.packageName===i)):0;this.#r({...this.#e,selectedIndex:d,sortMode:t})}cycleSortMode(){const t=_.indexOf(this.#e.sortMode),i=_[(t+1)%_.length]??"default";this.setSortMode(i)}getRecommendation(t){return this.#i?.get(t)}getCheckedEntries(){return this.#t.filter(t=>this.#e.checkedEntries.has(A(t)))}getCheckedEcosystemEntries(){return this.#s.filter(t=>this.#e.checkedEcosystemKeys.has(Z(t)))}toggleEcosystemCheck(t){const i=new Set(this.#e.checkedEcosystemKeys);i.has(t)?i.delete(t):i.add(t),this.#r({...this.#e,checkedEcosystemKeys:i})}checkAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set(this.#s.map(t=>Z(t)))})}uncheckAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set})}setSelectedIndex(t){const i=this.getFilteredEntries(),s=Math.max(0,Math.min(t,i.length-1));s!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:s})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:t})}setFilterType(t){if(t!==this.#e.filterType){const i=G(this.#t,t,this.#e.filterText);this.#r({...this.#e,entries:i,filterType:t,groupedByCatalog:Y(i),selectedIndex:0})}}setFilter(t){const i=G(this.#t,this.#e.filterType,t);this.#r({...this.#e,entries:i,filterText:t,groupedByCatalog:Y(i),selectedIndex:0})}setFilterActive(t){if(t!==this.#e.filterActive)if(t)this.#r({...this.#e,filterActive:!0});else{const i=G(this.#t,this.#e.filterType,"");this.#r({...this.#e,entries:i,filterActive:!1,filterText:"",groupedByCatalog:Y(i),selectedIndex:0})}}toggleCheck(t){const i=A(t),s=new Set(this.#e.checkedEntries);s.has(i)?s.delete(i):s.add(i),this.#r({...this.#e,allChecked:s.size===this.#t.length,checkedEntries:s})}checkAll(){this.#r({...this.#e,allChecked:!0,checkedEntries:new Set(this.#t.map(t=>A(t)))})}uncheckAll(){this.#r({...this.#e,allChecked:!1,checkedEntries:new Set})}toggleAll(){this.#e.allChecked?this.uncheckAll():this.checkAll()}startApply(){const t=this.getCheckedEntries();this.#r({...this.#e,applyProgress:{current:0,total:t.length},phase:"applying"})}updateApplyProgress(t){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:t}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(t){this.#r({...this.#e,error:t,phase:"error"})}#r(t){this.#e=t;for(const i of this.#l)try{i()}catch{}}}const be={major:"red",minor:"yellow",patch:"green"},Te={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},Se={critical:"red",high:"red",low:"gray",medium:"yellow"},Ee={critical:"red",high:"red",low:"green",medium:"yellow"},ve={defer:"gray",review:"yellow",skip:"red",update:"green"},Re=({changelogUrl:a,entry:t,focused:i,recommendation:s,scrollRef:d})=>{const h=i?"white":"gray";if(!t)return e.jsx(l,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:e.jsx(r,{dimColor:!0,children:"No package selected"})});const f=be[t.updateType]??"white",y=t.vulnerabilities&&t.vulnerabilities.length>0,p=t.socketReport?.score.overall??0,j=t.socketReport?ue(p):"gray";return e.jsxs(l,{borderColor:h,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsx(l,{flexShrink:0,paddingTop:1,paddingX:2,children:e.jsx(r,{bold:!0,color:"white",children:t.displayName??t.packageName})}),e.jsxs(fe,{flexGrow:1,flexShrink:1,paddingX:2,ref:d,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[e.jsx(r,{}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:"Current:"})}),e.jsx(r,{children:t.currentRange})]}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:"Target:"})}),e.jsx(r,{children:t.newRange}),e.jsxs(r,{bold:!0,color:f,children:[" ","(",t.updateType,")"]})]}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:"Version:"})}),e.jsx(r,{children:t.targetVersion})]}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:t.kind==="ecosystem"?"Source:":"Catalog:"})}),e.jsx(r,{color:t.kind==="ecosystem"?"cyan":void 0,children:t.catalogName})]}),t.acceptedRisk&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{color:"gray",children:"── "}),e.jsx(r,{bold:!0,color:"gray",children:"ACKNOWLEDGED RISK"}),e.jsxs(l,{flexDirection:"column",paddingLeft:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Reason: "}),e.jsx(r,{children:t.acceptedRisk.reason})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Accepted: "}),e.jsx(r,{children:t.acceptedRisk.acceptedAt.slice(0,10)})]})]})]}),y&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"red",children:"SECURITY"}),e.jsx(r,{}),t.vulnerabilities.map(n=>e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{gap:1,children:[e.jsxs(r,{bold:!0,color:Te[n.severity]??"gray",children:["⚠"," ",n.severity]}),e.jsx(r,{bold:!0,children:n.id})]}),e.jsx(l,{paddingLeft:2,children:e.jsx(r,{children:n.summary})}),e.jsxs(l,{gap:2,paddingLeft:2,children:[n.cvssScore!==void 0&&e.jsxs(r,{dimColor:!0,children:["CVSS:",String(n.cvssScore)]}),n.fixedVersions.length>0&&e.jsxs(r,{dimColor:!0,children:["Fixed in:",n.fixedVersions.join(", ")]})]})]},n.id))]}),t.socketReport&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"cyan",children:"SOCKET.DEV"}),e.jsx(r,{}),e.jsxs(l,{gap:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Overall: "}),e.jsxs(r,{bold:!0,color:j,children:[String(Math.round(p*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Supply Chain: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.supplyChain*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Quality: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.quality*100)),"%"]})]})]}),e.jsxs(l,{gap:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Maintenance: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.maintenance*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Vulnerability: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.vulnerability*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"License: "}),e.jsxs(r,{children:[t.socketReport.license||"unknown"," ","(",String(Math.round(t.socketReport.score.license*100)),"%)"]})]})]}),t.socketReport.alerts.length>0&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsxs(r,{bold:!0,color:"yellow",children:["⚠"," ",String(t.socketReport.alerts.length)," ","alert",t.socketReport.alerts.length===1?"":"s",":"]}),t.socketReport.alerts.map(n=>e.jsxs(l,{gap:1,paddingLeft:2,children:[e.jsxs(r,{bold:!0,color:Se[n.severity]??"gray",children:["[",n.severity.toUpperCase(),"]"]}),e.jsx(r,{children:n.type}),e.jsxs(r,{dimColor:!0,children:["(",n.category,")"]})]},n.key))]})]}),s&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"AI ANALYSIS"}),e.jsx(r,{}),e.jsxs(l,{gap:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Action: "}),e.jsx(r,{bold:!0,color:ve[s.action]??"white",children:s.action})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Risk: "}),e.jsx(r,{bold:!0,color:Ee[s.riskLevel]??"white",children:s.riskLevel})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Effort: "}),e.jsx(r,{bold:!0,children:s.effort})]})]}),s.reason&&e.jsx(l,{marginTop:1,paddingLeft:2,children:e.jsx(r,{children:s.reason})}),s.breakingChanges.length>0&&e.jsxs(l,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[e.jsx(r,{bold:!0,color:"yellow",children:"Breaking changes:"}),s.breakingChanges.map((n,I)=>e.jsxs(r,{children:[" ","•"," ",n]},String(I)))]})]}),a&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"CHANGELOG"}),e.jsx(l,{marginTop:1,paddingLeft:2,children:e.jsx(r,{color:"cyan",underline:!0,children:a})})]}),e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"LINKS"}),e.jsx(l,{flexDirection:"column",marginTop:1,paddingLeft:2,children:t.kind==="ecosystem"?e.jsx(r,{color:"cyan",underline:!0,children:t.detailUrl??t.displayName??t.packageName}):e.jsxs(r,{color:"cyan",underline:!0,children:["https://npmx.dev/",t.packageName]})})]}),!s&&t.kind!=="ecosystem"&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"GUIDANCE"}),e.jsxs(l,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[t.updateType==="major"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"red",children:["⚠"," ","Major update — likely contains breaking changes."]}),e.jsx(r,{dimColor:!0,children:" Review the changelog before updating."}),e.jsx(r,{dimColor:!0,children:" Use --changelog to fetch release URLs."})]}),t.updateType==="minor"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"yellow",children:["ℹ"," ","Minor update — new features, backward compatible."]}),e.jsx(r,{dimColor:!0,children:" Generally safe to update."})]}),t.updateType==="patch"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"green",children:["✓"," ","Patch update — bug fixes only."]}),e.jsx(r,{dimColor:!0,children:" Safe to update."})]}),!s&&e.jsx(r,{dimColor:!0,children:" Use --ai to get AI-powered analysis."})]})]})]})]})},Ae={major:"red",minor:"yellow",patch:"green"},Ie=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],De=({checked:a,entry:t,isSelected:i})=>{const s=Ae[t.updateType]??"white",d=t.vulnerabilities&&t.vulnerabilities.length>0,h=t.socketReport&&t.socketReport.alerts.length>0,f=!!t.acceptedRisk,y=a?"☑":"☐",p=t.socketReport?`${String(Math.round(t.socketReport.score.overall*100))}%`:"",j=t.socketReport?ue(t.socketReport.score.overall):"gray";return e.jsxs(l,{flexShrink:0,height:1,children:[e.jsx(r,{children:i?">":" "}),e.jsxs(r,{color:a?"white":"gray",children:[" ",y," "]}),d||h?e.jsx(r,{color:f?"gray":"red",children:f?"✓ ":"⚠ "}):e.jsx(r,{children:" "}),e.jsx(l,{flexGrow:1,children:e.jsxs(r,{bold:i,inverse:i,wrap:"truncate",children:[t.displayName??t.packageName,f?" [ack]":""]})}),p&&e.jsxs(r,{color:j,children:[" ",p]}),e.jsxs(r,{dimColor:!0,children:[" ",t.currentRange]}),e.jsxs(r,{dimColor:!0,children:[" ","→"," "]}),e.jsxs(r,{children:[t.newRange," "]}),e.jsx(r,{bold:!0,color:s,children:t.updateType})]})},Me=({count:a,ecosystem:t=!1,name:i})=>e.jsxs(l,{flexShrink:0,height:1,marginTop:1,children:[e.jsxs(r,{color:t?"cyan":void 0,dimColor:!t,children:[t?"◈":"▼"," "]}),e.jsx(r,{bold:!0,color:t?"cyan":"white",children:i.toUpperCase()}),e.jsxs(r,{dimColor:!0,children:[" ","(",a,")"]}),t&&e.jsxs(r,{color:"cyan",dimColor:!0,children:[" ","ci/cd refs"]})]}),Ne=({checkedEntries:a,entries:t,filterActive:i,filteredOutCount:s,filterText:d,filterType:h,focused:f,groupedByCatalog:y,isDryRun:p,onViewportHeightChange:j,scrollOffset:n,selectedIndex:I,totalCatalogEntries:D,totalChecked:E,totalEntries:H,viewportHeight:L})=>{const P=f?"white":"gray",{measuredHeight:m,ref:v}=ke(L,j);let F=0,S=0,M=0,R=0;for(const x of t)x.updateType==="major"?F++:x.updateType==="minor"?S++:M++,(x.vulnerabilities&&x.vulnerabilities.length>0||x.socketReport&&x.socketReport.alerts.length>0)&&R++;const C=[];F>0&&C.push(`${F} major`),S>0&&C.push(`${S} minor`),M>0&&C.push(`${M} patch`),R>0&&C.push(`${R} vulnerable`);const N=C.length>0?` (${C.join(", ")})`:"",w=t.filter(x=>x.kind==="ecosystem").length,k=t.length-w;let O=0;for(const x of t)a.has(A(x))&&O++;const U=[];let $=0;for(const[x,b]of y){U.push(e.jsx(Me,{count:b.length,ecosystem:b[0]?.kind==="ecosystem",name:x},`hdr-${x}`));for(const T of b){const W=$;U.push(e.jsx(De,{checked:a.has(A(T)),entry:T,isSelected:W===I},A(T))),$++}}let B=0;for(const[,x]of y)B+=2+x.length;const V=B>m&&m>0;return e.jsxs(l,{borderColor:P,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsxs(l,{flexShrink:0,gap:1,paddingX:1,children:[e.jsx(r,{bold:!0,inverse:!0,children:" VIS "}),e.jsxs(r,{wrap:"truncate",children:[w>0?k:H,E>0?`/${E}`:""," ",w>0?"pkgs":"outdated",N,D>E?` · ${D-E} dupes`:""]}),w>0&&e.jsxs(r,{color:"cyan",children:[" ","◈",w," ","ci/cd"]}),!p&&O>0&&e.jsxs(r,{dimColor:!0,children:[" ","—",O," ","selected"]})]}),e.jsx(l,{flexShrink:0,paddingX:1,paddingY:1,children:e.jsx(Ce,{isFocused:f,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:()=>{},showIndex:!1,value:h,children:Ie.map(({id:x,label:b})=>e.jsx(we,{name:x,children:b},x))})}),i&&e.jsxs(l,{flexShrink:0,paddingX:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/ "}),e.jsx(r,{children:d}),e.jsx(r,{inverse:!0,children:" "})]}),s>0&&e.jsx(l,{flexShrink:0,paddingX:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",s," ","package",s===1?"":"s"," ","filtered out by target constraint — press"," ",e.jsx(r,{bold:!0,color:"white",children:"f"})," ","to view"]})}),e.jsxs(l,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:v,children:[e.jsx(l,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:e.jsx(l,{flexDirection:"column",marginTop:-n,children:U})}),V&&e.jsx(l,{flexShrink:0,marginLeft:1,marginRight:1,children:e.jsx(ye,{contentHeight:B,placement:"inset",scrollOffset:n,style:"block",viewportHeight:m})})]},`list-${h}-${d}`)]})},Be=100,Le=40,Pe=10,Fe=[],K=["all","major","minor","patch","security"],Qe=({autoExitSeconds:a=0,changelogUrls:t,checkedCount:i=0,filteredOutEntries:s=Fe,isDryRun:d,store:h,totalCatalogEntries:f=0})=>{const{exit:y}=je(),{columns:p,rows:j}=ae(),n=g.useSyncExternalStore(h.subscribe,h.getSnapshot),[I,D]=g.useState(!1),[E,H]=g.useState(!1),L=g.useRef(null),P=g.useRef(null),m=g.useRef(null),v=g.useRef(null),[F,S]=g.useState(0),[M,R]=g.useState(!1),[C,N]=g.useState(!1),w=g.useMemo(()=>h.getFilteredEntries(),[n.entries,n.filterType,n.filterText,n.sortMode]),k=w[n.selectedIndex]??null,O=k?h.getRecommendation(k.packageName):void 0,U=k&&t?t.get(k.packageName):void 0,$=g.useCallback(o=>{let c=0,u=0;for(const[,Q]of n.groupedByCatalog){c+=2;for(let oe=0;oe<Q.length;oe++){if(u===o)return c;c+=1,u++}}return c},[n.groupedByCatalog]),B=Math.max(1,j-8-(n.filterActive?1:0)),[V,x]=g.useState(B),b=V>0?V:B,T=g.useCallback(o=>{const c=$(o);S(u=>c>u+b-2?Math.max(0,c-b+2):c<u+1?Math.max(0,c-1):u)},[$,b]);if(g.useEffect(()=>{m.current?.scrollToTop()},[k?.packageName]),ge((o,c)=>{if(o==="c"&&c.ctrl){y();return}if(!C){if(E){c.escape||o==="f"||o==="q"?H(!1):c.downArrow||o==="j"?P.current?.scrollBy(1):(c.upArrow||o==="k")&&P.current?.scrollBy(-1);return}if(M){o==="u"||c.return?(R(!1),h.startApply(),y(h.getCheckedEntries())):c.escape||o==="q"?R(!1):c.downArrow||o==="j"?v.current?.scrollBy(1):c.upArrow||o==="k"?v.current?.scrollBy(-1):c.pageDown?v.current?.scrollBy(5):c.pageUp&&v.current?.scrollBy(-5);return}if(I){c.escape||o==="?"?D(!1):o==="q"?(D(!1),N(!0)):c.downArrow||o==="j"?L.current?.scrollBy(1):(c.upArrow||o==="k")&&L.current?.scrollBy(-1);return}if(o==="?"){D(!0);return}if(o==="q"){N(!0);return}if(c.tab){h.setFocusedPanel(n.focusedPanel==="list"?"detail":"list");return}if(n.focusedPanel==="list"&&(c.leftArrow||c.rightArrow)){const u=K.indexOf(n.filterType),Q=c.rightArrow?(u+1)%K.length:(u-1+K.length)%K.length;S(0),m.current?.scrollToTop(),h.setFilterType(K[Q]);return}if(o==="f"&&s.length>0){H(u=>!u);return}if(n.filterActive){if(c.escape){h.setFilterActive(!1);return}if(c.return){h.setFilterActive(!1);return}if(c.backspace){S(0),h.setFilter(n.filterText.slice(0,-1));return}if(o&&!c.ctrl&&!c.meta){S(0),h.setFilter(n.filterText+o);return}return}if(n.focusedPanel==="list"){if(c.downArrow||o==="j"){const u=Math.min(n.selectedIndex+1,w.length-1);h.setSelectedIndex(u),T(u);return}if(c.upArrow||o==="k"){const u=Math.max(n.selectedIndex-1,0);h.setSelectedIndex(u),T(u);return}if(c.pageDown){const u=Math.min(n.selectedIndex+10,w.length-1);h.setSelectedIndex(u),T(u);return}if(c.pageUp){const u=Math.max(n.selectedIndex-10,0);h.setSelectedIndex(u),T(u);return}if(c.home){h.setSelectedIndex(0),S(0);return}if(c.end){const u=w.length-1;h.setSelectedIndex(u),T(u);return}if(o===" "||c.return){k&&h.toggleCheck(k);return}if(o==="a"){h.toggleAll();return}if(o==="s"){h.cycleSortMode(),T(h.getSnapshot().selectedIndex);return}if(o==="/"){h.setFilterActive(!0);return}if(o==="u"&&!d&&n.checkedEntries.size>0){R(!0);return}if(c.rightArrow){h.setFocusedPanel("detail");return}return}if(n.focusedPanel==="detail"){if(c.escape||c.leftArrow){h.setFocusedPanel("list");return}if(c.downArrow||o==="j"){m.current?.scrollBy(1);return}if(c.upArrow||o==="k"){m.current?.scrollBy(-1);return}if(c.pageDown){m.current?.scrollBy(10);return}if(c.pageUp){m.current?.scrollBy(-10);return}if(c.home){m.current?.scrollToTop();return}c.end&&m.current?.scrollToBottom()}}},{isActive:!0}),p<Le||j<Pe)return e.jsx(l,{alignItems:"center",height:j,justifyContent:"center",width:p,children:e.jsxs(r,{color:"yellow",children:["Terminal too small (",p,"x",j,")"]})});const W=p>=Be,q=[e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"q"}),e.jsx(r,{dimColor:!0,children:"QUIT"})]},"q"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"?"}),e.jsx(r,{dimColor:!0,children:"HELP"})]},"?"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"}),e.jsx(r,{dimColor:!0,children:"NAV"})]},"nav"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Space"}),e.jsx(r,{dimColor:!0,children:"CHECK"})]},"sp"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"a"}),e.jsx(r,{dimColor:!0,children:"ALL"})]},"a")];!d&&n.checkedEntries.size>0&&q.push(e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"green",children:"u"}),e.jsx(r,{dimColor:!0,children:"APPLY"})]},"u")),s.length>0&&q.push(e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"yellow",children:"f"}),e.jsxs(r,{dimColor:!0,children:["FILTERED (",s.length,")"]})]},"fo")),q.push(e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"←→"}),e.jsx(r,{dimColor:!0,children:"FILTER"})]},"lr"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/"}),e.jsx(r,{dimColor:!0,children:"SEARCH"})]},"f"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Tab"}),e.jsx(r,{dimColor:!0,children:"PANEL"})]},"t"));const ee=e.jsx(l,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:e.jsx(l,{flexWrap:"wrap",gap:2,paddingX:1,children:q})}),re=e.jsxs(J,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"?"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:L,title:"KEYBOARD SHORTCUTS",visible:I,width:52,children:[e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),e.jsxs(l,{children:[e.jsx(l,{width:24,children:e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↑","/k"]}),e.jsx(r,{dimColor:!0,children:" Move up"})]})}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↓","/j"]}),e.jsx(r,{dimColor:!0,children:" Move down"})]})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Tab"]}),e.jsx(r,{dimColor:!0,children:" Switch panel"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","→","/","←"]}),e.jsx(r,{dimColor:!0,children:" Focus detail/list"})]})]}),e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"SELECTION"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Space"]}),e.jsx(r,{dimColor:!0,children:" Toggle check on package"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","a"]}),e.jsx(r,{dimColor:!0,children:" Toggle check all"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","s"]}),e.jsx(r,{dimColor:!0,children:" Cycle sort (default / name / type / severity)"})]})]}),e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"FILTERS"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","←→"]}),e.jsx(r,{dimColor:!0,children:" Switch filter tab"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","/"]}),e.jsx(r,{dimColor:!0,children:" Text filter"})]}),s.length>0&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","f"]}),e.jsx(r,{dimColor:!0,children:" View filtered-out packages"})]})]}),e.jsxs(l,{flexDirection:"column",children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"ACTIONS"})]}),!d&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","u"]}),e.jsx(r,{dimColor:!0,children:" Apply selected updates"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","q"]}),e.jsx(r,{dimColor:!0,children:" Quit"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","?"]}),e.jsx(r,{dimColor:!0,children:" Toggle help"})]})]})]}),X=h.getCheckedEntries(),z=X.filter(o=>o.updateType==="major").length,xe=e.jsxs(l,{alignItems:"center",flexDirection:"column",children:[z>0&&e.jsx(l,{marginBottom:1,marginTop:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",z," ","major update",z===1?"":"s"," ","— review breaking changes"]})}),e.jsxs(r,{dimColor:!0,children:["Press"," ",e.jsx(r,{bold:!0,color:"white",children:"u"})," ","or"," ",e.jsx(r,{bold:!0,color:"white",children:"Enter"})," ","to confirm,"," ",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","to cancel"]})]}),te=e.jsx(J,{footer:xe,scrollRef:v,title:`Apply ${X.length} update${X.length===1?"":"s"}?`,visible:M,width:70,children:X.map(o=>e.jsxs(l,{gap:1,children:[e.jsxs(r,{children:[" ",o.displayName??o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))}),le=s.length>0?e.jsx(J,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"f"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:P,title:`${s.length} PACKAGE${s.length===1?"":"S"} FILTERED BY TARGET`,visible:E,width:70,children:e.jsxs(l,{flexDirection:"column",children:[e.jsx(l,{marginBottom:1,children:e.jsxs(r,{dimColor:!0,children:["These packages have newer versions available but are excluded by the current target constraint. Use"," ",e.jsx(r,{bold:!0,color:"white",children:"--target latest"})," ","to include them."]})}),s.map(o=>e.jsxs(l,{gap:1,children:[e.jsxs(r,{children:[" ",o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))]})}):null,se=e.jsx(Ne,{checkedEntries:n.checkedEntries,entries:w,filterActive:n.filterActive,filteredOutCount:s.length,filterText:n.filterText,filterType:n.filterType,focused:n.focusedPanel==="list",groupedByCatalog:n.groupedByCatalog,isDryRun:d,onViewportHeightChange:x,scrollOffset:F,selectedIndex:n.selectedIndex,totalCatalogEntries:f,totalChecked:i,totalEntries:w.length,viewportHeight:b}),ie=e.jsx(Re,{changelogUrl:U,entry:k,focused:n.focusedPanel==="detail",recommendation:O,scrollRef:m});if(W){const o=Math.floor(p*.35);return e.jsxs(l,{flexDirection:"column",height:j,width:p,children:[e.jsxs(l,{flexDirection:"row",flexGrow:1,children:[e.jsx(l,{flexGrow:1,children:se}),e.jsx(l,{width:o,children:ie})]}),ee,te,le,e.jsx(ne,{autoExitSeconds:a||3,onCancel:()=>{N(!1)},visible:C}),re]})}const pe=Math.floor(j*.55);return e.jsxs(l,{flexDirection:"column",height:j,width:p,children:[e.jsx(l,{height:pe,children:se}),e.jsx(l,{flexGrow:1,children:ie}),ee,te,le,e.jsx(ne,{autoExitSeconds:a||3,onCancel:()=>{N(!1)},visible:C}),re]})};export{ze as U,Qe as b,Z as e,We as u};
@@ -1,30 +0,0 @@
1
- import{createRequire as Ot}from"node:module";import{a as he,g as Mt,u as W,b as Ut,t as Ae,l as Vt,h as jt,c as Dt,v as Oe}from"./package-version-BNRJ3o9C.js";let It;const Lt=t=>(It??=Ot(import.meta.url))(t),ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,St=t=>{if(typeof ne<"u"&&ne.versions&&ne.versions.node){const[e,n]=ne.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ne.getBuiltinModule(t)}return Lt(t)},{createRequire:Pt}=St("node:module"),Tt=16,fe=32,Rt=64,T=128,le="positionals";class te extends Error{loc;title;hint;type="VisulimaError";constructor({cause:e,hint:n,location:i,message:s,name:o,stack:c,title:a}){super(s,{cause:e}),this.title=a,this.name=o,this.stack=c??this.stack,this.loc=i,this.hint=n}setLocation(e){this.loc=e}setName(e){this.name=e}setMessage(e){this.message=e}setHint(e){this.hint=e}}class A extends te{code;context;constructor(e,n,i){super({message:e,name:"CerebroError"}),this.code=n,this.context=i}}const tt=String.raw,Ie=tt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Bt=()=>new RegExp(tt`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Ie}(?:\u200D${Ie})*`,"gu");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const Go=/^[ \t]*(?:\r\n|\r|\n)/,Ho=/(?:\r\n|\r|\n)[ \t]*$/,Jo=/^(?:[\r\n]|$)/,Ko=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,Zo=/^[ \t]*[\r\n][ \t\r\n]*$/,Xo=/\r\n|\n|\r/g,Yo=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Qo=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,F=Bt(),zt=/[-_./\s]+/g,ce=/(\u001B\[[0-9;]*[a-z])/i,Le=new RegExp("\\p{Script=Arabic}","u"),Wt=new RegExp("\\p{Script=Bengali}","u"),Y=new RegExp("\\p{Script=Cyrillic}","u"),Ft=new RegExp("\\p{Script=Devanagari}","u"),qt=new RegExp("\\p{Script=Ethiopic}","u"),me=new RegExp("\\p{Script=Greek}","u"),Se=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),Gt=new RegExp("\\p{Script=Gujarati}","u"),Ht=new RegExp("\\p{Script=Gurmukhi}","u"),Pe=new RegExp("\\p{Script=Hangul}","u"),Me=new RegExp("\\p{Script=Hebrew}","u"),Jt=new RegExp("\\p{Script=Hiragana}","u"),Ue=new RegExp("\\p{Script=Han}","u"),Kt=new RegExp("\\p{Script=Kannada}","u"),Zt=new RegExp("\\p{Script=Katakana}","u"),Xt=new RegExp("\\p{Script=Khmer}","u"),Yt=new RegExp("\\p{Script=Lao}","u"),S=new RegExp("\\p{Script=Latin}","u"),Qt=new RegExp("\\p{Script=Malayalam}","u"),en=new RegExp("\\p{Script=Myanmar}","u"),tn=new RegExp("\\p{Script=Oriya}","u"),nn=new RegExp("\\p{Script=Sinhala}","u"),on=new RegExp("\\p{Script=Tamil}","u"),sn=new RegExp("\\p{Script=Telugu}","u"),rn=new RegExp("\\p{Script=Thai}","u"),an=new RegExp("\\p{Script=Tibetan}","u"),Ve=/[\u02BB\u02BC\u0027]/u,ln=t=>t.replace(F,"");let cn=class{capacity;cache;constructor(e){this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}has(e){return this.cache.has(e)}set(e,n){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){const i=this.cache.keys().next().value;i!==void 0&&this.cache.delete(i)}this.cache.set(e,n)}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}size(){return this.cache.size}};const un=new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","g"),hn=t=>{if(typeof t!="string")throw new TypeError(`The "value" argument must be of type string. Received ${typeof t}`);return t.replaceAll(un,"")},ge=new cn(1e3),pn=/[.*+?^${}()|[\]\\]/g,dn=t=>{const e=t.join("");if(ge.has(e)){const s=ge.get(e);return s.lastIndex=0,s}const n=t.map(s=>s.replaceAll(pn,String.raw`\$&`)).join("|"),i=new RegExp(n,"g");return ge.set(e,i),i},fn=t=>{const e=[];let n=0,i;for(F.lastIndex=0;(i=F.exec(t))!==null;)i.index>n&&e.push(t.slice(n,i.index)),e.push(i[0]),n=F.lastIndex;return n<t.length&&e.push(t.slice(n)),e.filter(Boolean)},mn=/[ČŠŽĐ]/i,nt=new Uint8Array(128),it=new Uint8Array(128),ot=new Uint8Array(128);for(let t=0;t<128;t++)nt[t]=t>=65&&t<=90?1:0,it[t]=t>=97&&t<=122?1:0,ot[t]=t>=48&&t<=57?1:0;const we=t=>nt[t],je=t=>it[t],ye=t=>ot[t],B=(t,e,n,i,s)=>{if(t.length===0)return[];let o=!1;const c=Object.values(e);for(const f of c)if(f(t[0])){o=!0;break}if(!o&&!n)return[t];const a=[...t],u=[];let r=a[0],l="other";const d=Object.entries(e);for(const f of d){const[p,w]=f;if(w(a[0])){l=p;break}}let h=n&&i?a[0]===a[0].toLocaleUpperCase(i):!1;for(let f=1;f<a.length;f++){const p=a[f];let w="other";for(const v of d){const[b,C]=v;if(C(p)){w=b;break}}const $=n&&i?p===p.toLocaleUpperCase(i):!1;let m=!1;s?m=s(l,w,h,$,p,f,a):(l!==w&&l!=="other"&&w!=="other"&&(m=!0),n&&w!=="other"&&!h&&$&&(m=!0)),m?(u.push(r),r=p):r+=p,l=w,n&&(h=$)}return r&&r.length>0&&u.push(r),u.length>0?u:[t]},gn=(t,e,n,i)=>{if(n.size===0)return e;for(const s of n)if(t.startsWith(s,e))return i.push(s),e+s.length;return e},st=(t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let n=0;const i=[],s=t.length;for(let o=1;o<s;o++){const c=gn(t,n,e,i);if(c!==n){n=c,o=n-1;continue}const a=t.codePointAt(o-1),u=t.codePointAt(o),r=a&&a<128&&we(a),l=u&&u<128&&we(u),d=a&&a<128&&je(a),h=a&&a<128&&ye(a),f=u&&u<128&&ye(u);if(d&&l){i.push(t.slice(n,o)),n=o;continue}if(h&&!f||!h&&f){i.push(t.slice(n,o)),n=o;continue}if(f&&!h){let p=!1,w=!1;if(o+1<s){const $=t.codePointAt(o+1);p=$&&$<128&&we($),w=$&&$<128&&ye($)}if(!w&&p){i.push(t.slice(n,o),t.slice(o,o+1)),n=o+1;continue}}if(o+1<s){const p=t.codePointAt(o+1),w=p&&p<128&&je(p);if(r&&l&&w){const $=t.slice(n,o+1);e.has($)||(i.push(t.slice(n,o)),n=o)}}}return n<s&&i.push(t.slice(n)),i.filter(o=>o!=="")},rt=(t,e,n)=>{if(t.length===0)return[];const i=t===t.toLocaleUpperCase(e);if(e.startsWith("de")){if(!i&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(e))return[t];const r=[...t],l=r.length,d=[];let h=r[0],f=r[0]===r[0].toLocaleUpperCase(e),p=f,w=f?0:-1;for(let $=1;$<l;$++){const m=r[$],v=m===m.toLocaleUpperCase(e);if(v===f)h+=m;else if(v)h&&h.length>0&&(d.push(h),h=m),p=!0,w=$;else{if(p&&$-w>1){const b=r[$-1],C=h.slice(0,-1);C&&C.length>0&&d.push(C),h=b+m}else h+=m;p=!1,w=-1}f=v}return h&&h.length>0&&d.push(h),d}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!Y.test(t)&&!S.test(t))return[t];const r=[...t],l=r.length,d=[];let h=r[0];const f=r[0];let p;Y.test(f)?p=1:S.test(f)?p=2:p=0;let w=f===f.toLocaleUpperCase(e);for(let m=1;m<l;m++){const v=r[m];let b;Y.test(v)?b=1:S.test(v)?b=2:b=0;const C=v===v.toLocaleUpperCase(e);p!==b&&(p===1||p===2)&&(b===1||b===2)||b===p&&!w&&C?(d.push(h),h=v):h+=v,p=b,w=C}h&&h.length>0&&d.push(h);const $=[];for(let m=0;m<d.length;m++)m<d.length-1&&d[m].length===1&&S.test(d[m])&&Y.test(d[m+1][0])?($.push(d[m]+d[m+1]),m+=1):$.push(d[m]);return $}if(e.startsWith("el")){if(!me.test(t)&&!S.test(t))return[t];const r=[];Se.lastIndex=0;let l;for(;(l=Se.exec(t))!==null;)r.push(l[0]);r.length===0&&r.push(t);const d=[];if(r.length===1){const h=r[0];if(!h||!me.test(h[0])||h.length===1)return[h??t]}for(const h of r){if(!h)continue;if(!me.test(h[0])||h.length===1){d.push(h);continue}const f=h.length;let p=h[0],w=h[0]===h[0].toLocaleUpperCase(e);for(let $=1;$<f;$++){const m=h[$],v=m===m.toLocaleUpperCase(e);!w&&v?(d.push(p),p=m):p+=m,w=v}p&&d.push(p)}return d}if(e.startsWith("ja")||e.startsWith("ko")){const r=e.startsWith("ja"),l=r?{hiragana:h=>Jt.test(h),kanji:h=>Ue.test(h),katakana:h=>Zt.test(h),latin:h=>S.test(h)}:{hangul:h=>Pe.test(h),latin:h=>S.test(h)},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(r){const h=B(t,l,!1,e,(p,w)=>p==="hiragana"&&w==="katakana"||p==="katakana"&&w==="hiragana"||p==="hiragana"&&w==="latin"||p==="katakana"&&w==="latin"||p==="kanji"&&w==="latin"||p==="latin"&&(w==="hiragana"||w==="katakana"||w==="kanji")),f=[];for(const p of h){const w=p;w.length===1&&d.has(w)&&f.length>0?f[f.length-1]=f.at(-1)+w:f.push(w)}return f.length>0?f:[t]}return B(t,l,!1,e,(h,f)=>h==="hangul"&&f==="latin"||h==="latin"&&f==="hangul")}if(e.startsWith("sl")){const r=[...t],l=r.length,d=[];let h=r[0],f=r[0]===r[0].toLocaleUpperCase(e);for(let p=1;p<l;p++){const w=r[p],$=w===w.toLocaleUpperCase(e),m=mn.test(w),v=p<l-1&&r[p+1]===r[p+1].toLocaleUpperCase(e);!f&&$||m&&v?(d.push(h),h=w,m&&v&&(d.push(h),h="")):h+=w,f=$}return h&&h.length>0&&d.push(h),d}if(e.startsWith("zh"))return B(t,{han:r=>Ue.test(r),latin:r=>S.test(r)},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const r=l=>Me.test(l)||Le.test(l);return B(t,{latin:l=>S.test(l),rtl:l=>r(l)},!1,e)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(e.split("-")[0])){const r=l=>Ft.test(l)||Wt.test(l)||Gt.test(l)||Ht.test(l)||Kt.test(l)||on.test(l)||sn.test(l)||Qt.test(l)||nn.test(l)||rn.test(l)||Yt.test(l)||an.test(l)||en.test(l)||qt.test(l)||Xt.test(l)||tn.test(l);return B(t,{indic:l=>r(l),latin:l=>S.test(l)},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return B(t,{cyrillic:r=>Y.test(r),latin:r=>S.test(r)},!0,e);if(["ar","fa","he"].includes(e))return B(t,{latin:r=>S.test(r),rtl:r=>Me.test(r)||Le.test(r)},!1,e);if(e.startsWith("ko"))return B(t,{hangul:r=>Pe.test(r),latin:r=>S.test(r)},!1,e);if(e.startsWith("uz")){if(!Y.test(t)&&!S.test(t))return[t];const r=[...t],l=r.length,d=[];let h=r[0],f=r[0]===r[0].toLocaleUpperCase(e);for(let p=1;p<l;p++){const w=r[p],$=w===w.toLocaleUpperCase(e);if(Ve.test(w)||Ve.test(r[p-1])){h+=w;continue}!f&&$?(d.push(h),h=w):h+=w,f=$}return h&&h.length>0&&d.push(h),d}const s=[...t],o=s.length,c=[];let a=s[0],u=s[0]===s[0].toLocaleUpperCase(e);for(const r of n)if(t.startsWith(r)){c.push(r),a=s[r.length],u=a===a.toLocaleUpperCase(e);break}for(let r=1;r<o;r++){const l=s[r],d=l===l.toLocaleUpperCase(e);let h=0;for(const f of n)if(t.startsWith(f,r)){c.push(a,f),h=f.length,a="";const p=f.at(-1);p&&(u=p===p.toLocaleUpperCase(e));break}if(h>0){r+=h-1;continue}!u&&d?(c.push(a),a=l):a+=l,u=d}return a&&c.push(a),c},wn=(t,e,n)=>{const i=[],s=ce.test(t)?t.split(ce).filter(Boolean):[t];for(const o of s){const c=o;if(ce.test(c))i.push(c);else{F.lastIndex=0;const a=F.test(c)?fn(c).filter(Boolean):[c];for(const u of a)if(F.lastIndex=0,F.test(u))i.push(u);else if(e){const r=e.toLowerCase().split("-")[0];i.push(...rt(u,r,n))}else i.push(...st(u,n))}}return i},yn=(t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:n=!1,handleEmoji:i=!1,knownAcronyms:s=[],locale:o,normalize:c=!1,separators:a,stripAnsi:u=!1,stripEmoji:r=!1}=e,l=new Set([...s].toSorted((m,v)=>v.length-m.length));let d=t;u&&(d=hn(d)),r&&(d=ln(d));let h;Array.isArray(a)?h=dn(a):a instanceof RegExp?h=a:h=zt;const f=[];let p=d;const w=h.flags.includes("g")?h:new RegExp(h.source,`${h.flags}g`);for(;p.length>0;){const m=w.exec(p);if(!m){p===".."?f.push(".."):p==="."?f.push("."):p.length>0&&f.push(p);break}const v=m.index,b=m[0],C=b.length,k=p.slice(0,v),V=p.slice(v+C);if(b.startsWith("../"))f.push(".."),p=p.slice(v+3);else if(b.startsWith("./"))f.push("."),p=p.slice(v+2);else if(v===0&&b==="..")f.push(".."),p=p.slice(2);else if(v===0&&b===".")f.push("."),p=p.slice(1);else{k.length>0&&f.push(k);let O=0;for(;(O=b.indexOf("../",O))!==-1;)f.push(".."),O+=3;for(O=0;(O=b.indexOf("./",O))!==-1;)(O===0||b[O-1]!==".")&&f.push("."),O+=2;let g=V;for(;g.startsWith("../");)f.push(".."),g=g.slice(3);for(;g.startsWith("./");)f.push("."),g=g.slice(2);if(g===".."){f.push("..");break}else if(g==="."){f.push(".");break}else p=g}w.lastIndex=0}if(f.length===0){const m=d.split(h).filter(Boolean);f.push(...m)}let $=[];for(const m of f)n||i?$.push(...wn(m,o,l)):o?$.push(...rt(m,o,l)):$.push(...st(m,l));return c&&($=$.map(m=>l.has(m)?m:o&&m===m.toLocaleUpperCase(o)?m[0]+m.slice(1).toLocaleLowerCase(o):m.toUpperCase()===m&&!l.has(m)?m.slice(0,1)+m.slice(1).toLowerCase():m)),$},R=new Uint32Array(65536),vn=(t,e)=>{const n=t.length,i=e.length,s=1<<n-1;let o=-1,c=0,a=n,u=n;for(;u--;)R[t.charCodeAt(u)]|=1<<u;for(u=0;u<i;u++){let r=R[e.charCodeAt(u)];const l=r|c;r|=(r&o)+o^o,c|=~(r|o),o&=r,c&s&&a++,o&s&&a--,c=c<<1|1,o=o<<1|~(l|c),c&=l}for(u=n;u--;)R[t.charCodeAt(u)]=0;return a},$n=(t,e)=>{const n=e.length,i=t.length,s=[],o=[],c=Math.ceil(n/32),a=Math.ceil(i/32);for(let p=0;p<c;p++)o[p]=-1,s[p]=0;let u=0;for(;u<a-1;u++){let p=0,w=-1;const $=u*32,m=Math.min(32,i)+$;for(let v=$;v<m;v++)R[t.charCodeAt(v)]|=1<<v;for(let v=0;v<n;v++){const b=R[e.charCodeAt(v)],C=o[v/32|0]>>>v&1,k=s[v/32|0]>>>v&1,V=b|p,O=((b|k)&w)+w^w|b|k;let g=p|~(O|w),y=w&O;g>>>31^C&&(o[v/32|0]^=1<<v),y>>>31^k&&(s[v/32|0]^=1<<v),g=g<<1|C,y=y<<1|k,w=y|~(V|g),p=g&V}for(let v=$;v<m;v++)R[t.charCodeAt(v)]=0}let r=0,l=-1;const d=u*32,h=Math.min(32,i-d)+d;for(let p=d;p<h;p++)R[t.charCodeAt(p)]|=1<<p;let f=i;for(let p=0;p<n;p++){const w=R[e.charCodeAt(p)],$=o[p/32|0]>>>p&1,m=s[p/32|0]>>>p&1,v=w|r,b=((w|m)&l)+l^l|w|m;let C=r|~(b|l),k=l&b;f+=C>>>i-1&1,f-=k>>>i-1&1,C>>>31^$&&(o[p/32|0]^=1<<p),k>>>31^m&&(s[p/32|0]^=1<<p),C=C<<1|$,k=k<<1|m,l=k|~(v|C),r=C&v}for(let p=d;p<h;p++)R[t.charCodeAt(p)]=0;return f},xn=(t,e)=>{if(t.length<e.length){const n=e;e=t,t=n}return e.length===0?t.length:t.length<=32?vn(t,e):$n(t,e)};let bn;const Nn=t=>(bn??=Pt(import.meta.url))(t),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,An=t=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,n]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ie.getBuiltinModule(t)}return Nn(t)},{writeFile:kn,stat:Cn,rm:En,readFile:De,readdir:_n,mkdir:On,access:In}=An("node:fs/promises"),re=[{alias:"v",description:"Turn on verbose output",group:"global",name:"verbose",type:Boolean},{description:"Turn on debugging output",group:"global",name:"debug",type:Boolean},{alias:"h",description:"Print out helpful usage information",group:"global",name:"help",type:Boolean},{alias:"q",description:"Silence output",group:"global",name:"quiet",type:Boolean},{alias:"V",description:"Print version info",group:"global",name:"version",type:Boolean},{description:"Turn off colored output",group:"global",name:"no-color",type:Boolean},{description:"Force colored output",group:"global",name:"color",type:Boolean}];let G=class extends A{commandName;constructor(e,n=[]){const i=`Command "${e}" not found${n.length>0?`. Did you mean: ${n.join(", ")}?`:""}`;super(i,"COMMAND_NOT_FOUND",{commandName:e,suggestions:n}),this.name="CommandNotFoundError",this.commandName=e,n.length>0&&(this.hint=`Try one of these commands: ${n.join(", ")}`)}},at=class extends A{option1;option2;constructor(t,e){super(`Options "${t}" and "${e}" cannot be used together`,"CONFLICTING_OPTIONS",{option1:t,option2:e}),this.name="ConflictingOptionsError",this.option1=t,this.option2=e,this.hint=`Remove either --${t} or --${e}`}},Ln=class extends A{unknownOptions;constructor(t,e){const n=t.join(", "),i=`Found unknown ${t.length===1?"option":"options"}: ${n}`;super(i,"UNKNOWN_OPTION",{suggestions:e,unknownOptions:t}),this.name="UnknownOptionError",this.unknownOptions=t,e&&e.length>0&&(this.hint=`Did you mean: ${e.join(", ")}?`)}},Sn=class extends A{pluginName;constructor(t,e,n){super(`Plugin "${t}" error: ${e}`,"PLUGIN_ERROR",{originalError:n,pluginName:t}),this.name="PluginError",this.pluginName=t,n&&(this.cause=n)}},Pn=class{logger;plugins=new Map;initialized=!1;cachedDependencyOrder=void 0;constructor(t){this.logger=t}hasPlugins(){return this.plugins.size>0}register(t){if(this.initialized)throw new Error(`Cannot register plugin "${t.name}" after initialization`);if(this.plugins.has(t.name))throw new Error(`Plugin "${t.name}" is already registered`);he().CEREBRO_OUTPUT_LEVEL===String(T)&&this.logger.debug(`registering plugin: ${t.name}`),this.plugins.set(t.name,t),this.cachedDependencyOrder=void 0}async init(t){if(this.initialized)throw new Error("PluginManager already initialized");if(this.plugins.size===0){this.logger.debug("no plugins registered, skipping initialization"),this.initialized=!0;return}this.validateDependencies();const e=this.getDependencyOrder();this.logger.debug(`initializing ${String(e.length)} plugin(s)...`);for(const n of e)if(typeof n.init=="function"){this.logger.debug(`initializing plugin: ${n.name}`);try{await n.init(t)}catch(i){const s=new Sn(n.name,`Failed to initialize: ${i instanceof Error?i.message:String(i)}`,i instanceof Error?i:void 0);throw this.logger.error(s.message),s}}this.initialized=!0}async executeLifecycle(t,e,n){if(!this.initialized)throw new Error("PluginManager not initialized");if(this.plugins.size===0)return;const i=this.getDependencyOrder();for(const s of i){const o=s[t];if(typeof o=="function"){this.logger.debug(`executing ${t} hook for plugin: ${s.name}`);try{await(t==="afterCommand"?o(e,n):o(e))}catch(c){throw this.logger.error(`Error in ${t} hook for plugin "${s.name}":`,c),c}}}}async executeErrorHandlers(t,e){if(!this.initialized||this.plugins.size===0)return;const n=this.getDependencyOrder();for(const i of n)if(typeof i.onError=="function"){this.logger.debug(`executing error handler for plugin: ${i.name}`);try{await i.onError(t,e)}catch(s){this.logger.error(`Error in error handler for plugin "${i.name}":`,s)}}}getDependencyOrder(){if(this.cachedDependencyOrder!==void 0)return this.cachedDependencyOrder;const t=[],e=new Set,n=new Set,i=s=>{if(e.has(s))return;if(n.has(s))throw new Error(`Circular dependency detected involving plugin "${s}"`);const o=this.plugins.get(s);if(!o)throw new Error(`Plugin "${s}" not found`);if(n.add(s),o.dependencies)for(const c of o.dependencies)i(c);n.delete(s),e.add(s),t.push(o)};for(const s of this.plugins.keys())i(s);return this.cachedDependencyOrder=t,t}validateDependencies(){for(const t of this.plugins.values())if(t.dependencies){for(const e of t.dependencies)if(!this.plugins.has(e))throw new Error(`Plugin "${t.name}" depends on "${e}" which is not registered`)}}};const oe=t=>t.type?.name==="Boolean",Mn=t=>{let e=t.type?t.type.name.toLowerCase():"string";const n=t.multiple??t.lazyMultiple?"[]":"";return e&&(e=e==="boolean"?"":`{underline ${e}${n}}`),e},Te=t=>(oe(t)||(t.typeLabel=t.typeLabel??Mn(t),t.defaultOption&&(t.typeLabel=`${t.typeLabel} (D)`),t.required&&(t.typeLabel=`${t.typeLabel} (R)`)),t),Un=new RegExp(/^-([^\d-])$/),Vn=new RegExp(/^--(\S+)/),jn=new RegExp(/^-([^\d-]{2,})$/),Dn=t=>Un.test(t)||Vn.test(t)||jn.test(t),Tn=(t,e)=>{const n=e[0]&&Dn(e[0])||e.length===0?null:e.shift()??null;if(!t.includes(n)){const i=new Error(`Command not recognised: ${String(n)}`);throw i.command=n,i.name="INVALID_COMMAND",i}return{argv:e,command:n}};let Rn=class lt extends te{optionName;value;constructor(e,n,i){super({hint:`Pass a valid ${i} value for '${e}'.`,message:`Invalid ${i} value '${n}' for option '${e}'`,name:"INVALID_VALUE",title:"Invalid Value"}),this.optionName=e,this.value=n,Object.setPrototypeOf(this,lt.prototype)}},Bn=class ct extends te{optionName;constructor(e){super({cause:void 0,hint:`Remove the duplicate option '${e}' from your command line arguments.`,location:void 0,message:`Option '${e}' is already set`,name:"ALREADY_SET",stack:void 0,title:"Option Already Set"}),this.optionName=e,Object.setPrototypeOf(this,ct.prototype)}},Re=class ut extends te{optionName;constructor(e){super({cause:void 0,hint:`Check your option definitions or remove the unknown option '${e}' from your command line arguments.`,location:void 0,message:`Unknown option: --${e}`,name:"UNKNOWN_OPTION",stack:void 0,title:"Unknown Option"}),this.optionName=`--${e}`,Object.setPrototypeOf(this,ut.prototype)}},zn=class ht extends te{value;constructor(e){super({hint:"Use a defined option or add a defaultOption to capture this value.",message:`Unknown value: ${e}`,name:"UNKNOWN_VALUE",title:"Unknown Value"}),this.value=e,Object.setPrototypeOf(this,ht.prototype)}},P=class pt extends te{constructor(e,n){super({cause:void 0,hint:n,location:void 0,message:e,name:"INVALID_DEFINITIONS",stack:void 0,title:"Invalid Option Definition"}),Object.setPrototypeOf(this,pt.prototype)}};const J=t=>t===Boolean||typeof t=="function"&&t.name==="Boolean",ke=t=>t===Number||typeof t=="function"&&t.name==="Number",Be=t=>t===String||typeof t=="function"&&t.name==="String",ze=(t,e,n)=>{const i=Number(t);if(e&&Number.isNaN(i)&&String(t).trim().toLowerCase()!=="nan")throw new Rn(n??"",String(t),"Number");return i},Wn=(t,e,n={})=>{const{optionName:i,strictTypes:s}=n;return Array.isArray(t)?J(e)?t.map(Boolean):ke(e)?t.map(o=>ze(o,s,i)):Be(e)?t.map(String):t.map(o=>e(String(o))):t===null?null:J(e)?!!t:ke(e)?ze(t,s,i):Be(e)?typeof t=="string"?t:String(t):e(typeof t=="string"?t:String(t))},_=(t,e,n,...i)=>{t&&console.debug(`[command-line-args:${n}] ${e}`,...i)},Fn=/-([a-z])/g,qn=/^\d+$/,Gn=t=>t.codePointAt(0)===95,We=(t,e)=>Array.isArray(t)?[...t,...e]:[t,...e],Fe=t=>t==="__proto__"||t==="constructor"||t==="prototype",ve=(t,e,n,i=!1)=>{t[e]===void 0?t[e]=i?[n]:n:i&&Array.isArray(t[e])?t[e].push(n):t[e]=[t[e],n]},qe=(t,e,n,i,s)=>{let o=e.get(t)??n.get(t);if(!o&&i){const c=t.toLowerCase();o=i.get(c)??s?.get(c)}return o},Hn=(t,e,n,i)=>{const s=n.debug??!1;_(s,"resolveArgs called with options:","resolver",{partial:n.partial,stopAtFirstUnknown:n.stopAtFirstUnknown}),_(s,"Starting argument resolution","resolver"),_(s,"Tokens:","resolver",t),_(s,"Definitions:","resolver",e),_(s,"Processing tokens...","resolver");const o=new Map,c=new Map,a=n.caseInsensitive?new Map:void 0,u=n.caseInsensitive?new Map:void 0,r=n.camelCase?new Map:void 0,l=n.camelCase?new Map:void 0;for(const g of e)if(o.set(g.name,g),g.alias&&c.set(g.alias,g),n.caseInsensitive&&a&&(a.set(g.name.toLowerCase(),g),g.alias&&u&&u.set(g.alias.toLowerCase(),g)),n.camelCase&&r&&l){const y=g.name.replaceAll(Fn,(x,I)=>I.toUpperCase());r.set(g.name,y),l.set(y,g.name)}const d=Object.create(null),h=Object.create(null),f=[],p=[],w=new Set;let $=!1;const m=e.find(g=>g.defaultOption),v=e.some(g=>g.group),b=e.find(g=>ke(g.type));for(let g=0;g<t.length;g++){const y=t[g];if(y.kind==="option-terminator"){d._unknown=i.slice(y.index),$=!0;break}if(y.kind==="option"&&y.name){let x=qe(y.name,o,c,a,u);!x&&y.value===void 0&&b&&qn.test(y.name)&&(x=b,y.value=y.name,y.name=b.name);let I=!1;if(!x&&n.negation&&y.value===void 0&&y.name.startsWith("no-")){const E=y.name.slice(3),U=qe(E,o,c,a,u);U?.type&&J(U.type)&&(x=U,I=!0)}const N=x?x.name:y.name,L=x?.multiple,M=x?.lazyMultiple;if(Object.hasOwn(h,N)&&h[N]!==void 0&&!L&&!M&&!n.partial)throw new Bn(N);if(!x&&n.partial){const E=y.rawName??`--${y.name}${y.value!==void 0&&y.inlineValue?`=${y.value}`:""}`;f.push({index:y.index,value:E});continue}if(!x&&n.stopAtFirstUnknown){d._unknown=i.slice(y.index);break}if(!x&&!n.partial)throw new Re(y.name);if(y.value===void 0){const E=t[g+1],U=E?.kind==="option"&&!("name"in E)&&E.value!==void 0,j=E&&x&&!(x.type&&J(x.type))&&(E.kind==="positional"||U),_t=x&&x.defaultOption&&!x.multiple&&!x.lazyMultiple;if(j&&(!x?.defaultOption||_t))if(L){let D=g+1;const de=[];for(;D<t.length&&(t[D].kind==="positional"||t[D].kind==="option"&&!("name"in t[D])&&t[D].value!==void 0);)de.push(t[D].value),w.add(t[D].index),D++;h[N]=h[N]===void 0?de:We(h[N],de),g=D-1}else M?(ve(h,N,E.value,!0),w.add(E.index),g++):(h[N]=E.value,w.add(E.index),g++);else x?.type&&J(x.type)?ve(h,N,!I,L):(L||M)&&h[N]!==void 0?ve(h,N,null,!0):h[N]=L?[]:null}else{let{value:E}=y;if(x?.type&&J(x.type))switch(E){case"":{if(n.partial){const j=`${y.rawName??`--${y.name}`}${y.value?`=${y.value}`:""}`;p.push({index:y.index,value:j}),E=!0}else throw new Re(y.name);break}case"false":{E=!1;break}case"true":{E=!0;break}default:E=!0}const U=[E];if(L){let j=g+1;for(;j<t.length&&t[j].kind==="positional";)U.push(t[j].value),w.add(t[j].index),j++;g=j-1}h[N]===void 0?h[N]=L||M?U:E:L||M?h[N]=We(h[N],U):h[N]=E}}else if(y.kind==="positional"&&n.stopAtFirstUnknown&&!w.has(y.index)&&!m){_(s,`Found unconsumed positional token at index ${String(y.index)}, stopping processing`,"resolver"),d._unknown=i.slice(y.index);break}}for(const[g,y]of Object.entries(h)){const x=o.get(g);x&&(x.multiple||x.lazyMultiple)&&!Array.isArray(y)&&(h[g]=[y])}const C=g=>g.kind==="option"&&!o.has(g.name??"")&&!c.has(g.name??"")&&(!n.caseInsensitive||!a?.has(g.name?.toLowerCase()??"")&&!u?.has(g.name?.toLowerCase()??""));let k=-1,V=Number.POSITIVE_INFINITY;if(n.stopAtFirstUnknown&&!$&&(k=t.findIndex(g=>C(g)),k!==-1&&(V=t[k].index)),m){const g=[],y=[];for(const x of t)x.kind==="positional"&&!w.has(x.index)&&x.index<V&&(g.push(x.value),y.push(x));if(g.length>0){const x=h[m.name],I=m.multiple??m.lazyMultiple;x===void 0?I?(y.forEach(N=>w.add(N.index)),h[m.name]=g):(w.add(y[0].index),h[m.name]=g[0]):I&&(y.forEach(N=>w.add(N.index)),h[m.name]=Array.isArray(x)?[...g,...x]:[...g,x])}}if(!n.partial){for(const g of t)if(g.kind==="positional"&&!w.has(g.index))throw new zn(i[g.index])}if(n.partial&&!n.stopAtFirstUnknown){const g=[...f];for(const y of p)g.push({index:y.index,value:y.value});for(const y of t)y.kind==="positional"&&!w.has(y.index)&&g.push({index:y.index,value:i[y.index]});g.length>0&&(g.sort((y,x)=>y.index-x.index),d._unknown=g.map(y=>y.value))}if(n.stopAtFirstUnknown&&!$){const g=t.findIndex(x=>x.kind==="positional"&&!w.has(x.index));let y=-1;if(k!==-1&&g!==-1?y=Math.min(k,g):k!==-1?y=k:g!==-1&&(y=g),y>=0){const x=t[y].index;d._unknown=i.slice(x)}}for(const[g,y]of Object.entries(h)){const x=n.camelCase?r?.get(g)??g:g,I=o.get(g);I?.type?d[x]=Wn(y,I.type,{optionName:I.name,strictTypes:n.strictTypes}):d[x]=y===void 0?null:y}for(const g of e){const y=n.camelCase?r?.get(g.name)??g.name:g.name;!(y in d)&&g.defaultValue!==void 0&&(g.multiple??g.lazyMultiple?d[y]=Array.isArray(g.defaultValue)?[...g.defaultValue]:[g.defaultValue]:d[y]=g.defaultValue)}if(v){const g={},y={},x={};for(const N of e)if(N.group){const L=Array.isArray(N.group)?N.group:[N.group];for(const M of L)Fe(M)||(g[M]??={})}for(const N of Object.keys(d))if(!Gn(N)){y[N]=d[N];let L=N;n.camelCase&&(L=l?.get(N)??N);const M=o.get(L);if(M?.group){const E=Array.isArray(M.group)?M.group:[M.group];for(const U of E)Fe(U)||g[U]&&(g[U][N]=d[N])}else x[N]=d[N]}const I={_all:y};for(const[N,L]of Object.entries(g))I[N]=L;Object.keys(x).length>0&&(I._none=x),d._unknown&&(I._unknown=d._unknown),Object.keys(d).forEach(N=>delete d[N]),Object.assign(d,I)}const O=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));return _(s,"Final parsed result:","resolver",O),O},ee="-".codePointAt(0),K="=",Jn=K.codePointAt(0),Kn="--",Zn="-",Xn="--",dt=t=>t.length>2&&t.startsWith(Xn),Yn=t=>dt(t)&&!t.includes(K,3),Qn=t=>dt(t)&&t.includes(K,3),ei=t=>{if(t.length!==2||t.codePointAt(0)!==ee||t.codePointAt(1)===ee)return!1;const e=t.codePointAt(1);return e!==void 0&&(e<48||e>57)},ti=t=>{if(t.length<=2||t.codePointAt(0)!==ee||t.codePointAt(1)===ee)return!1;const e=t.codePointAt(1);return!(e!==void 0&&e>=48&&e<=57)},ni=t=>{const e=[];let n=0,i=[],s=0,o=-1,c=0;for(;s<i.length||n<t.length;){let a;if(s<i.length?(a=i[s],s++):(a=t[n],n++),c>0?c--:o++,a===Kn){e.push({index:o,kind:"option-terminator"});const u=[...i.slice(s),...t.slice(n)],r=u.map((l,d)=>({index:o+d+1,kind:"positional",value:l}));e.push(...r),o+=u.length;break}if(ei(a)){const u=a.charAt(1);e.push({index:o,kind:"option",name:u,rawName:a});continue}if(ti(a)&&!a.includes(K)){const u=[];let r="",l=!1;for(let d=1;d<a.length;d++){const h=a.charAt(d);l?r+=h:h.codePointAt(0)===Jn?l=!0:u.push(`${Zn}${h}`)}if(l)if(u.length>0){const d=u.pop();u.push(`${d}=${r}`)}else u.push(r);i=s<i.length?[...u,...i.slice(s)]:u,s=0,c=u.length;continue}if(Yn(a)){const u=a.slice(2);e.push({index:o,kind:"option",name:u,rawName:a});continue}if(Qn(a)){const u=a.indexOf(K),r=a.slice(2,u),l=a.slice(u+1);e.push({index:o,inlineValue:!0,kind:"option",name:r,rawName:a,value:l});continue}if(a.length>2&&a.codePointAt(0)===ee&&a.codePointAt(1)!==ee&&a.includes(K)){const u=a.indexOf(K),r=a.charAt(1),l=a.slice(u+1);e.push({index:o,inlineValue:!0,kind:"option",name:r,rawName:a,value:l});continue}e.push({index:o,kind:"positional",value:a})}return e},ii=/\d/,oi=t=>typeof t=="function",si=(t,e,n)=>{const i=n?.debug??!1;_(i,"Validating definitions:","validation",t,"caseInsensitive:",e);const s=new Set,o=new Set,c=new Set,a=new Set;let u=0;for(const r of t){if(_(i,"Checking definition:","validation",r),!r.name)throw _(i,"Validation failed: name is required","validation"),new P("Invalid option definition: name is required");if(typeof r.name!="string")throw new P("Invalid option definition: name must be a string");if(r.name.trim()==="")throw new P("Invalid option definition: name cannot be empty");const l=e?r.name.toLowerCase():"";if(s.has(r.name)||e&&c.has(l))throw new P(`Invalid option definition: duplicate name '${r.name}'`);if(o.has(r.name)||e&&a.has(l))throw new P(`Invalid option definition: name '${r.name}' conflicts with an existing alias`);if(s.add(r.name),e&&c.add(l),r.alias!==void 0){if(typeof r.alias!="string")throw new P("Invalid option definition: alias must be a string");if(r.alias.length!==1)throw new P("Invalid option definition: alias must be a single character");if(ii.test(r.alias))throw new P("Invalid option definition: alias cannot be numeric");if(r.alias==="-")throw new P('Invalid option definition: alias cannot be "-"');const d=e?r.alias.toLowerCase():"";if(o.has(r.alias)||e&&a.has(d))throw new P(`Invalid option definition: duplicate alias '${r.alias}'`);if(s.has(r.alias)||e&&c.has(d))throw new P(`Invalid option definition: alias '${r.alias}' conflicts with an existing option name`);o.add(r.alias),e&&a.add(d)}if(r.defaultOption&&(u++,r.type!==void 0&&J(r.type)))throw new P("Invalid option definition: defaultOption cannot be Boolean type");if(r.type!==void 0&&!(r.type===Boolean||r.type===Number||r.type===String||typeof r.type=="function"&&oi(r.type)))throw new P("Invalid option definition: invalid type")}if(u>1)throw _(i,"Validation failed: multiple defaultOptions not allowed","validation"),new P("Invalid option definition: multiple defaultOptions not allowed");_(i,"Validation completed successfully","validation")};function ri(t,e={}){const n=e.debug??!1;_(n,"Starting command-line-args parsing","index"),_(n,"Options:","index",e);const i={...e};i.stopAtFirstUnknown&&(i.partial=!0);const s=Array.isArray(t)?t:[t];_(n,"Normalized definitions:","index",s),si(s,i.caseInsensitive,n?i:void 0);let{argv:o}=i;o??=process.argv.slice(2),_(n,"Using argv:","index",o);let c=o;i.caseInsensitive&&(c=o.map(r=>{if(r.startsWith("--")){const l=r.indexOf("="),d=(l===-1?r.slice(2):r.slice(2,l)).toLowerCase();return l===-1?`--${d}`:`--${d}${r.slice(l)}`}if(r.startsWith("-")&&!r.startsWith("--")&&r.length>1){const l=r.indexOf("="),d=l===-1?r.slice(1):r.slice(1,l);if(!d)return r;const h=d.toLowerCase();return l===-1?`-${h}`:`-${h}${r.slice(l)}`}return r}));const a=ni(c.map(String));_(n,"Tokenized arguments:","index",a);const u=Hn(a,s,i,o);return _(n,"Command-line-args parsing completed","index"),u}class ai{result;argv;options;argument;command;commandName;env;logger;console;fs;process;runtime;rawUnknown;constructor(e,n){this.commandName=e,this.command=n}}let $e=class extends A{commandName;constructor(e,n,i){super(`Failed to load command "${e}": ${n}`,"COMMAND_LOADER_ERROR",{commandName:e,reason:n}),this.name="CommandLoaderError",this.commandName=e,this.hint="Ensure the loader resolves to a module with a default export that is the command handler function.",i!==void 0&&(this.cause=i)}};const li=/^-{1,2}(\w+)(=(.+))?$/,ft=(t,e,n,i)=>{const s=li.exec(t);if(s===null)return{};const o=s[1];if(!o)return{};const c=n&&i?n.get(o)??i.get(o):e.find(a=>a.name===o||a.alias===o);return c!==void 0?{argName:c.name,argValue:s[3],option:c}:{}},Ge=(t,e)=>{if(e.type===void 0)return t;if(e.type.name==="Boolean"){if(t==="true"||t==="1")return e.type(!0);if(t==="false"||t==="0")return e.type(!1)}return e.type(t)},ci=new Set(["0","1","false","true"]),ui=(t,e,n,i)=>{if(e.length===0||t.length===0)return{};const s=(o,c)=>{const{argName:a,argValue:u,option:r}=ft(c,e,n,i),{lastOption:l}=o;return r&&oe(r)&&u&&a?o.partial[a]=Ge(u,r):o.lastName&&l&&oe(l)&&ci.has(c)&&(o.partial[o.lastName]=Ge(c,l)),{lastName:a,lastOption:r,partial:o.partial}};return t.reduce(s,{partial:{}}).partial},hi=new Set(["0","1","false","true"]),pi=(t,e,n,i)=>{if(e.length===0||t.length===0)return t;const s=(o,c)=>{const{argValue:a,option:u}=ft(c,e,n,i),{lastOption:r}=o;if(r&&oe(r)&&hi.has(c)){const{args:l}=o;return{args:l.slice(0,-1)}}return u&&oe(u)&&a?{args:o.args}:{args:[...o.args,c],lastOption:u}};return t.reduce(s,{args:[]}).args},di=t=>{const e=new Map;for(const n of t){const i=e.get(n.name);i?e.set(n.name,{...i,...n}):e.set(n.name,n)}return[...e.values()]},fi=t=>{if(t===void 0)return;const e=t.toLowerCase().trim();return e==="true"||e==="1"||e==="yes"||e==="on"},mi=(t,e)=>{if(!t.type)return e;if(e!==void 0){if(t.type===Boolean||typeof t.type=="function"&&t.type.name==="Boolean")return fi(e);if(t.type===Number||typeof t.type=="function"&&t.type.name==="Number"){const n=Number.parseFloat(e);return Number.isNaN(n)?void 0:n}return t.type===String||typeof t.type=="function"&&t.type.name==="String"?e:t.type(e)}},gi=/_./g,wi=/^[A-Z]/,yi=t=>t.toLowerCase().replaceAll(gi,e=>e[1]?.toUpperCase()??e).replace(wi,e=>e.toLowerCase()),vi=(t,e=he())=>{if(!t||t.length===0)return{};const n={};for(const i of t){const s=e[i.name],o=mi(i,s),c=o===void 0?i.defaultValue:o,a=yi(i.name);n[a]=c}return n},$i=t=>{const e=new Map,n=new Map;for(const i of t)if(e.set(i.name,i),i.alias){const s=Array.isArray(i.alias)?i.alias:[i.alias];for(const o of s)n.set(o,i)}return{optionMapByAlias:n,optionMapByName:e}},mt=async t=>{if(typeof t.__resolvedExecute__=="function")return t.__resolvedExecute__;if(typeof t.loader!="function")throw new $e(t.name,"no execute or loader defined");let e;try{e=await t.loader()}catch(i){throw new $e(t.name,i instanceof Error?i.message:String(i),i)}const n=e.default;if(typeof n!="function")throw new $e(t.name,"loader did not return a module with a default-exported handler function");return t.__resolvedExecute__=n,n},xi=(t,e,n,i,s)=>{const o=new ai(t.name,t),{_all:c,_unknown:a,positionals:u}=e,r=Object.keys(n).length>0?{...c,...n}:c;le in r&&delete r[le],o.argument=u?.[le]??[],o.rawUnknown=[...a??[]];const l=Object.keys(i).length>0;return o.options=l?{...r,...i}:r,o.env=vi(t.env,s),o},bi=(t,e,n)=>{const i=t.options??[],s=i.length>0;let o=di(s?[...i,...n]:n);if(o.length>0){for(const r of o)if(r.multiple&&r.lazyMultiple)throw new Error(`Argument "${r.name}" cannot have both multiple and lazyMultiple options, please choose one.`)}t.argument&&(o=[{defaultOption:!0,description:t.argument.description,group:"positionals",multiple:!0,name:le,type:t.argument.type,typeLabel:t.argument.typeLabel},...o]);let c,a;if(s){const{optionMapByAlias:r,optionMapByName:l}=$i(i);c=pi(e,i,l,r),a=ui(e,i,l,r)}else c=e,a={};const u=ri(o,{argv:c,camelCase:!0,partial:!0,stopAtFirstUnknown:!0});return{arguments_:o,booleanValues:a,parsedArgs:u}},xe=async(t,e,n)=>typeof t.execute=="function"?t.execute(e):(await mt(t))(e),Ni=(t,e)=>typeof t!="string"||t===""?"":t[0].toLowerCase()+t.slice(1),Ai=(t,e)=>typeof t!="string"||t===""?"":t[0].toUpperCase()+t.slice(1),ki=(t,e)=>{const{length:n}=t;if(n===0)return"";if(n===1)return t[0];const i=[];let s="",o="";for(let c=0;c<n;c++){const a=t[c];if(ce.test(a)){s?(i.push(s+o+a),s="",o=""):(i.length>0&&i.push(e),s=a);continue}s?(o&&(o+=e),o+=a):(i.length>0&&i.push(e),i.push(a))}return i.join("")},Q=(t,e)=>{if(typeof t!="string"||!t)return"";let n=!0;return ki(yn(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(i=>{const s=i,o=s.toLowerCase();return n?(n=!1,Ni(o)):Ai(o)}),"")};let Ci=class extends A{commandName;missingOptions;constructor(t,e){super(`Command "${t}" is missing required options: ${e.join(", ")}`,"COMMAND_VALIDATION_ERROR",{commandName:t,missingOptions:e}),this.name="CommandValidationError",this.commandName=t,this.missingOptions=e,this.hint=`Provide the following required options: ${e.join(", ")}`}},Ei=class extends A{choices;option;value;constructor(t,e,n){super(`Invalid value "${e}" for option "${t}". Allowed values: ${n.join(", ")}`,"INVALID_CHOICE",{choices:n,option:t,value:e}),this.name="InvalidChoiceError",this.option=t,this.value=e,this.choices=n,this.hint=`Use one of: ${n.map(i=>`--${t} ${i}`).join(", ")}`}};const He=(t,e,n=!1)=>{const i=[],s=e._all??e;for(const o of t){if(!n&&!o.required)continue;const c=o.__camelCaseName__??o.name;if(s[c]===void 0){if(o.type?.name==="Boolean"){e[c]=!1;continue}i.push(o)}}return i},_i=(t,e)=>e.includes(t)?!0:Math.abs(t.length-e.length)>t.length/2?!1:xn(t,e)<=t.length/3,z=(t,e)=>{const n=t.toLowerCase();return e.filter(i=>_i(i.toLowerCase(),n))},Oi=(t,e)=>{const n=[];if(t._unknown&&t._unknown.forEach(i=>{const s=i.startsWith("--");let o=`Found unknown ${s?"option":"argument"} "${i}"`;if(s){const c=z(i.replace("--",""),(e.options??[]).map(a=>a.name));if(c.length>0){const[a,...u]=c.map(r=>`--${r}`);o+=u.length>0?`, did you mean ${a??""} or ${u.join(", ")}?`:`, did you mean ${a??""}?`}}n.push(o)}),n.length>0)throw new Error(n.join(`
2
- `))},Ii=(t,e,n)=>{const i=n.__requiredOptions__,s=i?He(i,e,!0):He(t,e,!1);if(s.length>0)throw new Ci(n.name,s.map(o=>o.name));e._unknown&&e._unknown.length>0&&!n.argument&&Oi(e,n)},Li=(t,e,n)=>{const i=n.__conflictingOptions__??t.filter(s=>s.conflicts!==void 0);if(i.length>0){const s=i.find(o=>{const c=o.__camelCaseName__??Q(o.name);return Array.isArray(o.conflicts)?o.conflicts.some(a=>e[Q(a)]!==void 0)&&e[c]!==void 0:e[Q(o.conflicts)]!==void 0&&e[c]!==void 0});if(s)throw new at(s.name,typeof s.conflicts=="string"?s.conflicts:s.conflicts?.[0]??"unknown")}},Si=(t,e)=>{const n=e.options;if(n)for(const i of n){if(!i.choices||i.choices.length===0)continue;const s=i.__camelCaseName__??Q(i.name),o=t[s];if(o==null)continue;const c=Array.isArray(o)?o:[o];for(const a of c){const u=String(a);if(!i.choices.includes(u))throw new Ei(i.name,u,i.choices)}}},Pi=t=>{if(!Array.isArray(t.options))return;const e=new Map,n=new Map;for(const s of t.options){if(s.name){const o=e.get(s.name)??[];o.push(s),e.set(s.name,o)}if(typeof s.alias=="string"&&s.alias.length>0){const o=n.get(s.alias)??[];o.push(s),n.set(s.alias,o)}else if(Array.isArray(s.alias)){for(const o of s.alias)if(o.length>0){const c=n.get(o)??[];c.push(s),n.set(o,c)}}}const i=[];for(const[s,o]of e)o.length>1&&i.push(`Duplicate option name "${s}" in command "${t.name}": ${JSON.stringify(o)}`);for(const[s,o]of n)o.length>1&&i.push(`Duplicate option alias "-${s}" used by options ${o.map(c=>`"${c.name}"`).join(", ")} in command "${t.name}"`);if(i.length>0)throw new Error(i.join(`
3
- `))},Mi=(t,e)=>{if(e.length===0)return{argv:[],commandPath:void 0};const n=[];let i;for(let s=1;s<=e.length;s+=1){const o=e[s-1];if(o===void 0||o.startsWith("-"))break;n.push(o);const c=n.join(" ");t.has(c)&&(i={commandPath:[...n],depth:s})}return i?{argv:e.slice(i.depth),commandPath:i.commandPath}:{argv:e,commandPath:void 0}},H=t=>t.join(" "),Je=(t,e)=>e&&e.length>0?[...e,t]:[t],Ui=/^no-/,Vi=t=>{t.options?.forEach(e=>{e.__camelCaseName__=Q(e.name)})},ji=t=>{if(!Array.isArray(t.options)||t.options.length===0)return;const e=new Set;for(const i of t.options)e.add(i.name);const n=[];for(const i of t.options)if(i.name.startsWith("no-")){const s=i.name.replace(Ui,"");if(!e.has(s)){if(i.type!==Boolean)throw new Error(`Cannot add negated option "${i.name}" to command "${t.name}" because it is not a boolean.`);const o={...i,defaultValue:i.defaultValue===void 0?!0:!i.defaultValue,name:s};n.push(o),e.add(s)}}n.length>0&&t.options.push(...n)},Di=(t,e)=>{if(!e.options||e.options.length===0)return;const{options:n}=t,i=new Map;for(const o of e.options)if(o.name.startsWith("no-")){const c=Q(o.name);i.set(c,o)}const s=Object.keys(n).filter(o=>i.has(o));if(s.length!==0)for(const o of s){const c=o.charAt(2);if(!c)continue;const a=c.toLowerCase()+o.slice(3),u=i.get(o);u&&(u.__negated__=!0),n[a]=!n[o],Reflect.deleteProperty(n,o)}},Ti=(t,e)=>{if(!e.options||e.options.length===0)return;const n=new Map;for(const s of e.options)s.__camelCaseName__&&s.__negated__===void 0&&s.implies!==void 0&&n.set(s.__camelCaseName__,s);if(n.size===0)return;const{options:i}=t;for(const s of Object.keys(i)){const o=n.get(s);if(o?.implies){const{implies:c}=o;for(const[a,u]of Object.entries(c))i[a]===void 0&&(i[a]=u)}}},Ri=()=>!!process.versions.electron,Bi=()=>Ri()&&!process.defaultApp,zi=()=>Bi()?0:1,Wi=t=>t.slice(zi()+1),Fi=" ",qi=(t,e)=>t===e?!0:t.length!==e.length?!1:t.every((n,i)=>n===e[i]),Gi=t=>{if(typeof t=="string")return t.split(Fi);const e=Ae();return qi(t,e)?Wi(t):t},Hi=t=>{const e=o=>{t.error(`Uncaught exception: ${o.message||o}`),o.stack&&t.error(o.stack),W(1)},n=(o,c)=>{if(o instanceof Error)t.error(`Promise rejection: ${o.message||o}`),o.stack&&t.error(o.stack);else{let a;if(typeof o=="string")a=o;else try{a=JSON.stringify(o)}catch{a=String(o)}t.error(`Promise rejection: ${a}`)}W(1)},i=Oe("uncaughtException",e),s=Oe("unhandledRejection",n);return()=>{i(),s()}},Ke=100,Ji=/^[a-z][\w-]*$/i,Ce=(t,e)=>{if(typeof t!="string"||t.trim().length===0)throw new A(`${e} must be a non-empty string`,"INVALID_INPUT",{fieldName:e,value:t});return t.trim()},Ze=(t,e)=>{if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new A(`${e} must be an array of strings`,"INVALID_INPUT",{fieldName:e,value:t});return t},be=(t,e)=>{if(typeof t!="object"||t===null)throw new A(`${e} must be an object`,"INVALID_INPUT",{fieldName:e,value:t});return t},ae=t=>{const e=Ce(t,"Command name");if(e.length>Ke)throw new A(`Command name is too long (maximum ${String(Ke)} characters)`,"INVALID_COMMAND_NAME",{commandName:e,length:e.length});if(e.includes("..")||e.includes("/")||e.includes("\\")||e.includes(";")||e.includes("|")||e.includes("&"))throw new A(`Command name "${e}" contains invalid characters`,"INVALID_COMMAND_NAME",{commandName:e});if(!Ji.test(e))throw new A(`Command name "${e}" must start with a letter and contain only letters, numbers, hyphens, and underscores`,"INVALID_COMMAND_NAME",{commandName:e});return e},Ki=new Set([`
4
- `,"\r"," ","\0",'"',"$","&","'","(",")",";","<",">","[","\\","]","`","{","|","}"]),Zi=(t,e={})=>{if(typeof t!="string")throw new TypeError("Argument must be a string");const n=typeof e=="boolean"?{checkDangerousChars:e}:e,i=n.maxArgumentLength??1e6;if(Number.isFinite(i)&&i>0&&t.length>i)throw new Error(`Argument is too long (maximum ${String(i)} characters)`);if(n.checkDangerousChars){for(const s of t)if(Ki.has(s))throw new Error(`Argument contains dangerous character: ${s}`)}return n.trim?t.trim():t},Xe=(t,e={})=>{if(!Array.isArray(t))throw new TypeError("Arguments must be an array");const n=typeof e=="boolean"?{checkDangerousChars:e}:e,i=n.maxArguments??1e5;if(Number.isFinite(i)&&i>0&&t.length>i)throw new Error(`Too many arguments (maximum ${String(i)})`);return t.map(s=>Zi(s,n))},Xi=/^-([^\d-])$/,Yi=/^--(\S+)/,Qi=/^-([^\d-]{2,})$/,Ne=t=>Xi.test(t)||Yi.test(t)||Qi.test(t),eo={access:(t,e)=>In(t,e),mkdir:(t,e)=>On(t,e),readdir:t=>_n(t),readFile:(async(t,e)=>e===void 0?De(t):De(t,e)),rm:(t,e)=>En(t,e),stat:t=>Cn(t),writeFile:(t,e,n)=>kn(t,e,n)},to=(t,e,n)=>{const i=e.indexOf("--"),s=i===-1?new Set:new Set(e.slice(i+1)),o=n.filter(u=>u.startsWith("--")&&u!=="--"&&!s.has(u));if(o.length===0)return;const c=(t.options??[]).map(u=>u.name),a=o.flatMap(u=>z(u.slice(2),c).map(r=>`--${r}`));throw new Ln(o,a)};let no=class gt{#t;#e;#u;#p;#d;#f;#A;#k;#C;#$;#E;#x;#_;#b=fe;#h;#n;#i;#o;#s;#r;#O=!1;#I;#L=!1;#m;#g;#w;#l=[];#j(){return this.#m===void 0&&(this.#m=[...this.#i.keys()]),this.#m}#S(){return this.#g===void 0&&(this.#g=[...this.#n.keys()]),this.#g}#a(){return this.#w===void 0&&(this.#w=[...this.#j(),...this.#S()]),this.#w}#P(){return this.#l.length===0?re:[...re,...this.#l]}#M(){this.#m=void 0,this.#g=void 0,this.#w=void 0}#N(){if(this.#u===void 0){const e=Gi(this.#e.argv);this.#u=Xe(e,{maxArguments:this.#x}),this.#D()}return this.#u}#y(){return this.#$??he()}#v(e){this.#b=e,this.#y().CEREBRO_OUTPUT_LEVEL=String(e)}#c(){return this.#b}#D(){if(!this.#u)return;let e=!1;for(const n of this.#u){if(n==="--quiet"||n==="-q"){this.#v(Tt),e=!0;break}if(n==="--verbose"||n==="-v"){this.#v(Rt),e=!0;break}if(n==="--debug"){this.#v(T),e=!0;break}}e||this.#v(Object.hasOwn(this.#y(),"DEBUG")?T:fe)}#T(){this.#L||(this.#I=Hi(this.#t),this.#L=!0)}#R(){return{arch:Ut(),argv:this.#N(),cwd:this.#p,env:this.#$??he(),exit:this.#C??(e=>W(e??0)),platform:Mt(),stdin:this.#E}}#U(e,n,i,s){this.#c()===T&&this.#t.debug(`command '${s}' found, parsing command args: ${n.join(", ")}`);const{arguments_:o,booleanValues:c,parsedArgs:a}=bi(e,n,this.#P()),u=Object.keys(c).length>0;let r=a;u&&(r={...a,_all:{...a._all,...c}}),Ii(o,r,e);const l=xi(e,a,c,i,this.#y());l.runtime=this,l.argv=this.#N(),l.fs=this.#k??eo,l.process=this.#R(),l.console=this.#t;const d=e.options&&e.options.length>0;if(d&&e.options){const h=e.options.filter(f=>f.name.startsWith("no-"));for(const f of h){const p=f.name.slice(3),w=`--${f.name}`,$=`--${p}`,m=n.includes(w),v=n.includes($);if(m&&v)throw new at(p,f.name)}}return d&&(Di(l,e),Ti(l,e)),Li(o,l.options,e),Si(l.options,e),this.#_&&to(e,n,l.rawUnknown),this.#c()===T&&(this.#t.debug("command options parsed from options:"),this.#t.debug(JSON.stringify(l.options,null,2)),this.#t.debug("command argument parsed from argument:"),this.#t.debug(JSON.stringify(l.argument,null,2))),{arguments_:o,booleanValues:c,commandArgs:r,parsedArgs:a,toolbox:l}}async#V(e,n,i){const s=this.getPluginManager();try{!this.#O&&s.hasPlugins()&&(await s.init({cli:this,cwd:this.#p,logger:this.#t}),this.#O=!0),await s.executeLifecycle("execute",n),await s.executeLifecycle("beforeCommand",n);let o;const c=i.global;if(c?.help){const a=this.#n.get("help");if(!a)throw new A("Help command not found","COMMAND_NOT_FOUND");o=await xe(a,n)}else if(c?.version??c?.V){const a=this.#n.get("version");if(!a)throw new A("Version command not found","COMMAND_NOT_FOUND");o=await xe(a,n)}else o=await xe(e,n);return await s.executeLifecycle("afterCommand",n,o),o}catch(o){throw await s.executeErrorHandlers(o,n),o}}constructor(e,n={}){if(typeof e!="string"||e.trim().length===0)throw new A("CLI name must be a non-empty string","INVALID_INPUT",{cliName:e});this.#d=e.trim();const i=n.argv??Ae(),s=n.cwd??Vt();if(this.#e={...n,argv:i,cwd:s},this.#e.argv&&!Array.isArray(this.#e.argv))throw new A("CLI argv option must be an array of strings","INVALID_INPUT",{argv:this.#e.argv});if(this.#e.cwd&&typeof this.#e.cwd!="string")throw new A("CLI cwd option must be a string","INVALID_INPUT",{cwd:this.#e.cwd});if(this.#e.packageName&&typeof this.#e.packageName!="string")throw new A("CLI packageName option must be a string","INVALID_INPUT",{packageName:this.#e.packageName});if(this.#e.packageVersion&&typeof this.#e.packageVersion!="string")throw new A("CLI packageVersion option must be a string","INVALID_INPUT",{packageVersion:this.#e.packageVersion});if(typeof this.#e.logger=="object"){const d=["debug","error","info","log","warn"],h=[],f=this.#e.logger;for(const p of d)typeof f[p]!="function"&&h.push(p);if(h.length>0)throw new A(`Logger object is missing required methods: ${h.join(", ")}`,"INVALID_INPUT",{logger:this.#e.logger,missingMethods:h});this.#t=this.#e.logger}else this.#t={...console,debug:(...d)=>{this.#c()===T&&console.debug(...d)}};this.#f=this.#e.packageVersion,this.#A=this.#e.packageName,this.#p=this.#e.cwd,this.#s="help",this.#r={};const o=n.fs;if(o!==void 0&&(typeof o!="object"||o===null))throw new A("CLI fs option must be an object implementing the CerebroFs interface","INVALID_INPUT",{fs:n.fs});const c=n.exit;if(c!==void 0&&typeof c!="function")throw new A("CLI exit option must be a function","INVALID_INPUT",{exit:n.exit});const a=n.env;if(a!==void 0&&(typeof a!="object"||a===null))throw new A("CLI env option must be a record of string keys","INVALID_INPUT",{env:n.env});const u=n.stdin;if(u!==void 0&&typeof u!="string")throw new A("CLI stdin option must be a string","INVALID_INPUT",{stdin:n.stdin});this.#k=n.fs,this.#C=n.exit,this.#$=n.env,this.#E=n.stdin??"",this.#x=n.maxArguments,this.#_=n.strictOptions??!1;const r=this.#y().CEREBRO_OUTPUT_LEVEL,l=r===void 0?Number.NaN:Number(r);this.#b=Number.isNaN(l)?fe:l,this.#n=new Map,this.#i=new Map,this.#o=new Map}setCommandSection(e){return this.#r=e,this}getCommandSection(){return this.#r.header||(this.#r.header=`${this.#d}${this.#f?` v${this.#f}`:""}`),this.#r}setDefaultCommand(e){return this.#s=e,this}get defaultCommand(){return this.#s}addCommand(e){be(e,"Command"),ae(e.name);const n=typeof e.execute=="function",i=typeof e.loader=="function";if(n&&i)throw new A(`Command "${e.name}" cannot define both "execute" and "loader" — choose one`,"INVALID_COMMAND",{commandName:e.name});if(!n&&!i)throw new A(`Command "${e.name}" must define either "execute" or "loader"`,"INVALID_COMMAND",{commandName:e.name});e.alias&&(typeof e.alias=="string"?ae(e.alias):Ze(e.alias,"Command alias").forEach(r=>ae(r))),e.argument&&be(e.argument,"Command argument"),e.options&&be(e.options,"Command options"),e.commandPath&&(Ze(e.commandPath,"Command commandPath"),e.commandPath.forEach(r=>{ae(r)}));const s=Je(e.name,e.commandPath),o=H(s);if(this.#i.has(o))throw new A(`Command with path "${o}" already exists`,"DUPLICATE_COMMAND",{commandName:e.name,commandPath:e.commandPath});const c=Array.isArray(e.commandPath)&&e.commandPath.length>0,a=this.#n.get(e.name),u=a!==void 0&&(a.commandPath===void 0||a.commandPath.length===0);if(!c&&u)throw new A(`Command with name "${e.name}" already exists`,"DUPLICATE_COMMAND",{commandName:e.name});if(e.options)for(const r of e.options)Te(r);if(Pi(e),ji(e),Vi(e),e.options&&(e.__conflictingOptions__=e.options.filter(r=>r.conflicts!==void 0),e.__requiredOptions__=e.options.filter(r=>r.required===!0)),c&&a!==void 0)this.#n.set(o,e);else{if(!c&&a!==void 0&&!u){const r=Je(a.name,a.commandPath);this.#n.set(H(r),a)}this.#n.set(e.name,e)}if(this.#i.set(o,s),this.#o.set(o,e),this.#M(),e.alias!==void 0){const r=typeof e.alias=="string"?[e.alias]:e.alias;for(const l of r){if(this.#c()===T&&this.#t.debug("adding alias",l),this.#n.has(l))throw new A(`Command alias "${l}" conflicts with existing command`,"DUPLICATE_COMMAND",{alias:l,commandName:e.name});this.#n.set(l,e)}}return this}addGlobalOption(e){const n=e,i=new Set(re.map(o=>o.name)),s=new Set(re.map(o=>o.alias).filter(Boolean));if(i.has(n.name))throw new A(`Cannot add global option "--${n.name}": it conflicts with a built-in global option`,"DUPLICATE_OPTION",{optionName:n.name});if(n.alias&&s.has(n.alias))throw new A(`Cannot add global option with alias "-${n.alias}": it conflicts with a built-in global option alias`,"DUPLICATE_OPTION",{alias:n.alias,optionName:n.name});if(new Set(this.#l.map(o=>o.name)).has(n.name))throw new A(`Global option "--${n.name}" has already been added`,"DUPLICATE_OPTION",{optionName:n.name});return n.group="global",Te(n),this.#l.push(n),this}getGlobalOptions(){return this.#P()}addPlugin(e){return this.getPluginManager().register(e),this}getPluginManager(){return this.#h?this.#h:(this.#h=new Pn(this.#t),this.#h.register({description:"Attaches the logger to the toolbox",execute:e=>{e.logger=this.#t,e.console=e.logger},name:"logger"}),this.#h)}getCliName(){return this.#d}getPackageVersion(){return this.#f}getPackageName(){return this.#A}getCommands(){return this.#n}getCwd(){return this.#p}dispose(){this.#I?.()}async run(e={}){const{autoDispose:n=!0,shouldExitProcess:i=!0,...s}=e;if(!this.#n.has("help")){const{default:m}=await import("../packem_chunks/help-command.js");this.addCommand(new m(this.#n))}const o=this.#S(),c=this.#i;this.#T();const a=this.#N();let u,r=[...a];this.#c()===T&&(this.#t.debug(`process.execPath: ${jt()}`),this.#t.debug(`process.execArgv: ${Dt().join(" ")}`),this.#t.debug(`process.argv: ${Ae().join(" ")}`));const l=Mi(c,[...a]);if(l.commandPath)u=l.commandPath,r=l.argv;else{if(a.length>1&&a[0]&&a[1]&&!Ne(a[0])&&!Ne(a[1])){const v=[];let b=0;for(;b<a.length;){const k=a[b];if(!k||Ne(k))break;v.push(k),b+=1}const C=H(v);if(v[0]&&!o.includes(v[0])){const k=this.#a(),V=z(C,k);throw new G(C,V)}}let m;try{m=Tn([null,...o],[...a])}catch(v){if(v instanceof Error&&v.name==="INVALID_COMMAND"&&"command"in v){const b=v.command,C=this.#a(),k=z(b,C);throw new G(b,k)}throw v}m.command&&(u=[m.command],r=m.argv)}if(!u)if(this.#s)u=[this.#s];else{const m=this.#a();throw new G("",m)}const d=H(u),h=this.#i.get(d);let f;if(h){if(f=this.#o.get(d),!f||H(h)!==d){const m=this.#a(),v=z(d,m);throw new G(d,v)}}else{const m=u.at(-1);if(f=m?this.#n.get(m):void 0,!f){const v=this.#a(),b=z(d,v);throw new G(d,b)}}if(typeof f.execute!="function"&&typeof f.loader!="function")return this.#t.error(`Command "${f.name}" has no function to execute.`),i?W(1):void 0;const p=r;let w,$;try{({commandArgs:w,toolbox:$}=this.#U(f,p,s,d))}catch(m){if(this.#t.error(m),i)return W(1);throw m}try{return await this.#V(f,$,w),i?W(0):void 0}catch(m){if(i)return this.#t.error(m),W(1);throw m}finally{n&&this.dispose()}}async runCommand(e,n={}){const{argv:i=[],...s}=n;Ce(e,"Command name");const o=e.split(" ").filter(Boolean),c=H(o),a=this.#i.get(c)?this.#o.get(c):this.#n.get(e);if(!a){const d=this.#a(),h=z(c||e,d);throw new G(e,h)}if(typeof a.execute!="function"&&typeof a.loader!="function")throw new A(`Command "${a.name}" has no function to execute`,"INVALID_COMMAND",{commandName:a.name});const u=[...Xe(i,{maxArguments:this.#x})];this.#c()===T&&this.#t.debug(`running command '${e}' programmatically with args: ${u.join(", ")}`);const{commandArgs:r,toolbox:l}=this.#U(a,u,s,c||e);return this.#V(a,l,r)}clone(e){const n={...this.#e,...e},i=new gt(this.#d,n);for(const[s,o]of this.#n)i.#n.set(s,o);for(const[s,o]of this.#i)i.#i.set(s,[...o]);for(const[s,o]of this.#o)i.#o.set(s,o);for(const s of this.#l)i.#l.push(s);return i.#s=this.#s,i.#r={...this.#r},i.#M(),i}async getAction(e){Ce(e,"Command name");const n=e.split(" ").filter(Boolean),i=H(n),s=this.#i.get(i)?this.#o.get(i):this.#n.get(e);if(!s){const o=this.#a(),c=z(i||e,o);throw new G(e,c)}if(typeof s.execute=="function")return s.execute;if(typeof s.loader=="function")return mt(s);throw new A(`Command "${s.name}" has no execute or loader defined`,"INVALID_COMMAND",{commandName:s.name})}};const is=(t,e)=>new no(t,e),io=globalThis.process??Object.create(null),Ye={versions:{}},se=new Proxy(io,{get(t,e){if(e in t)return t[e];if(e in Ye)return Ye[e]}}),oo=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
5
- `),so=(t,e,n,i)=>{const s={column:0,line:-1,...t.start},o={...s,...t.end},c=s.line,a=s.column,u=o.line,r=o.column;let l=Math.max(c-(n+1),0),d=Math.min(e.length,u+i);c===-1&&(l=0),u===-1&&(d=e.length);const h=u-c,f={};if(h)for(let p=0;p<=h;p++){const w=p+c;if(!a)f[w]=!0;else if(p===0){const $=e[w-1]?.length;f[w]=[a,($??0)-a+1]}else if(p===h)f[w]=[0,r];else{const $=e[w-p]?.length;f[w]=[0,$]}}else a===r?f[c]=a?[a,0]:!0:f[c]=[a,(r??0)-(a??0)];return{end:d,markerLines:f,start:l}},ro=se.platform==="win32"&&!se.env?.WT_SESSION?">":"❯",ao=(t,e,n)=>{const i={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:p=>p,marker:p=>p,message:p=>p,...n?.color}},s=typeof e.start.column=="number";let o=(t.includes("\r")?oo(t):t).split(`
6
- `);typeof i.tabWidth=="number"&&t.includes(" ")&&(o=o.map(p=>p.replaceAll(" "," ".repeat(i.tabWidth))));const{end:c,markerLines:a,start:u}=so(e,o,i.linesAbove,i.linesBelow),r=String(c).length,{gutter:l,marker:d,message:h}=i.color;let f=o.slice(u,c).map((p,w)=>{const $=u+1+w,m=a[$],v=String($).padStart(r),b=!a[$+1],C=` ${v}${i.showGutter?" |":""}`;if(m){let k="";if(Array.isArray(m)){const V=p.replaceAll(/[^\t]/g," ").slice(0,Math.max(m[0]-1,0)),O=m[1]||1;k=[`
7
- `,i.prefix+l(C.replaceAll(/\d/g," "))," ",V,d("^").repeat(O)].join(""),b&&i.message&&(k+=` ${h(i.message)}`)}return[i.prefix+d(ro),l(C),p.length>0?` ${p}`:"",k].join("")}return`${i.prefix} ${l(C)}${p.length>0?` ${p}`:""}`}).join(`
8
- `);return i.message&&!s&&(f=`${i.prefix+" ".repeat(r+1)+i.message}
9
- ${f}`),f},pe=t=>{let e;return()=>{if(e===void 0){if(typeof se.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${t}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);e=se.getBuiltinModule(t)}return e}},lo=()=>se.env?.DEBUG==="true",Z=(t,...e)=>{if(lo()){const n=e.map(i=>typeof i=="function"?i():i);console.debug(`error:parse-stacktrace: ${t}`,...n)}},X="<unknown>",co=/^(?:node:internal\/|node:|internal\/)/,uo=t=>t!==void 0&&co.test(t),ho=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,po=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,fo=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,mo=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,go=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,wo=/in\s(.*)\s\(at\s(.+)\)\sat/,yo=/^(?:.*@)?(.*):(\d+):(\d+)$/,vo=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$o=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,xo=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Qe=/\(error: ([^)]*)\)/,bo=/at\s/,No=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Ao=/Error: |AggregateError:/,wt=/^Anonymous function$/,ko=/^\s*in\s.*/,Co=/^.*?\s*at\s.*/,Eo=/^.*?\s*@.*|\[native code\]/,yt=(t,e)=>{const n=t.includes("safari-extension"),i=t.includes("safari-web-extension");return n||i?[t.includes("@")?t.split("@")[0]:X,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},vt=(t,e)=>{const n=fo.exec(e);n&&(t.file=n[1],t.line=+n[2],t.column=+n[3])},_o=t=>{const e=wo.exec(t);if(e){Z(`parse nested node error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const i=e[2].split(":");return{column:i[2]?+i[2]:void 0,file:i[0],line:i[1]?+i[1]:void 0,methodName:e[1]??X,raw:t,type:void 0}}const n=go.exec(t);if(n){Z(`parse node error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const i={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(bo,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??X,raw:t,type:t.startsWith("internal")?"internal":void 0};return vt(i,`${n[2]}:${n[3]}:${n[4]}`),i}},Oo=t=>{const e=ho.exec(t);if(e){Z(`parse chrome error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),i=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let s,o;if(i){const r=po.exec(t);if(r){const l=No.exec(r[1]);l?(e[2]=l[4]??l[1],e[3]=l[5]??l[2],e[4]=l[3]):r[2]&&(e[2]=r[1]),r[2]&&(s={column:r[4]?+r[4]:void 0,file:r[2],line:r[3]?+r[3]:void 0,methodName:"eval",raw:t,type:"eval"})}else{const l=mo.exec(t);l&&(o={column:l[4]?+l[4]:void 0,file:l[2],line:l[3]?+l[3]:void 0},s={column:l[6]?+l[6]:void 0,file:l[1],line:l[5]?+l[5]:void 0,methodName:"eval",raw:l[0],type:"eval"})}}const[c,a]=yt(e[1]?e[1].replace(wt,"<anonymous>"):X,e[2]),u={column:e[4]?+e[4]:void 0,evalOrigin:s,file:a,line:e[3]?+e[3]:void 0,methodName:c,raw:t,type:i?"eval":n?"native":uo(a)?"internal":void 0};return o?(u.column=o.column,u.file=o.file,u.line=o.line):vt(u,`${a}:${e[3]}:${e[4]}`),u}},Io=(t,e)=>{const n=vo.exec(t);if(n){Z(`parse gecko error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const i=n[3]?.includes(" > eval"),s=i&&n[3]&&$o.exec(n[3]);let o;i&&s&&(n[3]=s[1],o={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:t,type:"eval"},n[4]=s[2]);const[c,a]=yt(n[1]?n[1].replace(wt,"<anonymous>"):X,n[3]);let u;(e?.type==="safari"||!i&&e?.type==="firefox")&&e.column?u=e.column:!i&&n[5]&&(u=+n[5]);let r;return(e?.type==="safari"||!i&&e?.type==="firefox")&&e.line?r=e.line:n[4]&&(r=+n[4]),{column:u,evalOrigin:o,file:a,line:r,methodName:c,raw:t,type:i?"eval":a.includes("[native code]")?"native":void 0}}},Lo=(t,e)=>{const n=xo.exec(t);if(!(n&&n[2].includes(" > eval"))&&n)return Z(`parse firefox error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||X,raw:t,type:void 0}},So=t=>{const e=yo.exec(t);if(e)return Z(`parse react android native error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:X,raw:t,type:void 0}},$t=(t,{filter:e,frameLimit:n=50}={})=>{const i=t;let s=(typeof i.stacktrace=="string"?i.stacktrace:t.stack??"").split(`
10
- `).map(o=>(Qe.test(o)?o.replace(Qe,"$1"):o).trim()).filter(o=>!Ao.test(o)&&o!=="eval code");return e&&(s=s.filter(o=>e(o))),s=s.slice(0,n),s.reduce((o,c,a)=>{if(!c||c.length>1024)return o;let u;if(ko.test(c))u=_o(c);else if(Co.test(c))u=Oo(c);else if(Eo.test(c)){let r;if(a===0){const l=t,d=l.columnNumber,h=l.lineNumber,f=l.line,p=l.column;d||h?r={column:d,line:h,type:"firefox"}:(f||p)&&(r={column:p,line:f,type:"safari"})}u=Lo(c,r)??Io(c,r)}else u=So(c);return u?o.push(u):Z(`parse error stack line: "${c}"`,"not parser found"),o},[])},et=pe("node:fs"),ue=pe("node:path"),Po=pe("node:process"),Mo=pe("node:url"),q=(t,e,n)=>n===0?t:e===" "?t+" ".repeat(n):t+" ".repeat(e*n),xt=t=>t.replaceAll("\\","/"),Uo=t=>{if(!t.startsWith("file:"))return t;try{return Mo().fileURLToPath(t)}catch{return t}},Vo=(t,e)=>{const n=t.replace("async file:","file:");return xt(ue().relative(e,Uo(n)))},jo=(t,e,n)=>{if(e)return n.title(t.message);const i=t.message?`: ${t.message}`:"";return n.title(t.name+i)},bt=(t,{color:e,hideErrorTitle:n,indentation:i,prefix:s},o)=>`${q(s,i,o)}${jo(t,n,e)}
11
- `,Nt=(t,{color:e,indentation:n,prefix:i},s)=>{if(t.hint===void 0)return;const o=q(i,n,s);let c="";if(Array.isArray(t.hint))for(const a of t.hint)c+=`${o+a}
12
- `;else c+=o+t.hint;return e.hint(c)},Ee=(t,e)=>{if(!e||t.file===void 0||t.line===void 0)return{trace:t};try{const n=e({column:t.column,file:t.file,line:t.line});return n?{source:n.source,trace:{...t,column:n.column??t.column,file:n.file??t.file,line:n.line??t.line}}:{trace:t}}catch{return{trace:t}}},_e=(t,e,n=0)=>{const{color:i,cwd:s,displayShortPath:o,indentation:c,prefix:a}=e,{trace:u}=t;let r;u.file===void 0?r="<unknown>":r=o?Vo(u.file,s):xt(u.file);const{fileLine:l,method:d}=i;return`${q(a,c,n)}at ${u.methodName?`${d(u.methodName)} `:""}${l(r)}:${l(u.line?.toString()??"")}`},Do=(t,e)=>{if(e.allowAllFilePaths)return!0;const n=ue().resolve(e.cwd),i=ue().resolve(n,t);return i===n||i.startsWith(n+ue().sep)},To=t=>{try{return et().existsSync(t)?et().readFileSync(t,"utf8"):void 0}catch{return}},At=(t,e,n)=>{const{color:i,indentation:s,linesAbove:o,linesBelow:c,prefix:a,showGutter:u,showLineNumbers:r,tabWidth:l}=e,{source:d,trace:h}=t;if(h.file===void 0)return;let f;if(d===void 0){const p=h.file.replace("file://","");if(!Do(p,e))return;const w=To(p);if(w===void 0)return;f=w}else f=d;return ao(f,{start:{column:h.column,line:h.line}},{color:i,linesAbove:o,linesBelow:c,prefix:q(a,s,n),showGutter:u,showLineNumbers:r,tabWidth:l})},kt=(t,e,n)=>{if(t.errors.length===0)return;let i=`${q(e.prefix,e.indentation,n)}Errors:
13
-
14
- `,s=!0;for(const o of t.errors)s?s=!1:i+=`
15
-
16
- `,i+=Et(o,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},n+1);return`
17
- ${i}`},Ro=t=>{if(typeof t=="object"&&t!==null)try{return JSON.stringify(t)}catch{return Object.prototype.toString.call(t)}return String(t)},Ct=(t,e,n,i=new Set)=>{i.add(t);let s=`${q(e.prefix,e.indentation,n)}Caused by:
18
-
19
- `;const{cause:o}=t;if(!(o instanceof Error)){const u=Ro(o);return s+=`${q(e.prefix,e.indentation,n)}${e.color.title(u)}
20
- `,`
21
- ${s}`}s+=bt(o,e,n);const c=$t(o).shift(),a=Nt(o,e,n);if(a&&(s+=`${a}
22
- `),c){const u=Ee(c,e.sourceMap);if(s+=_e(u,e,n),!e.hideErrorCauseCodeView){const r=At(u,e,n);r!==void 0&&(s+=`
23
- ${r}`)}}if(o instanceof AggregateError){const u=kt(o,e,n);u!==void 0&&(s+=`
24
- ${u}`)}return o.cause&&(s+=i.has(o)?`
25
- ${q(e.prefix,e.indentation,n+1)}Caused by: [Circular]`:`
26
- ${Ct(o,e,n+1,i)}`),`
27
- ${s}`},Bo=(t,e)=>(t.length>0?`
28
- `:"")+t.map(n=>_e(Ee(n,e.sourceMap),e)).join(`
29
- `),Et=(t,e,n)=>{const i={allowAllFilePaths:!1,cwd:Po().cwd(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:a=>a,gutter:a=>a,hint:a=>a,marker:a=>a,message:a=>a,method:a=>a,title:a=>a,...e.color}},s=$t(t,{filter:e.filterStacktrace,frameLimit:i.framesMaxLimit}),o=s.shift(),c=o?Ee(o,i.sourceMap):void 0;return[e.hideMessage?void 0:bt(t,i,n),Nt(t,i,n),c?_e(c,i,n):void 0,c&&!i.hideErrorCodeView?At(c,i,n):void 0,t instanceof AggregateError?kt(t,i,n):void 0,t.cause===void 0||t.cause===null?void 0:Ct(t,i,n),s.length>0?Bo(s,i):void 0].filter(Boolean).join(`
30
- `)},zo=(t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Et(t,e,0)},os=(t={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:(e,n)=>{const{logger:i,runtime:s}=n,{concise:o,detailed:c=!1,exitOnError:a=!0,formatter:u,logErrors:r=!0,renderOptions:l={}}=t;if(r)if(u)i.error(u(e));else if(!c&&o?.(e))i.error(e.message);else if(c){const d=s.getCwd(),h=zo(e,{cwd:d,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...l});i.error(h)}else i.error(e);a&&W(1)},version:"1.0.0"}),ss=async t=>{try{await t.run({shouldExitProcess:!1})}catch{process.exitCode=process.exitCode||1}finally{process.exit(process.exitCode??0)}},rs={argument:{description:"Package to execute (optionally with @version)",name:"package",type:String},description:"Execute a remote package without permanent installation",examples:[["vis dlx create-vite my-app","Scaffold a new project"],["vis dlx typescript@5.5.4 tsc --version","Run specific version"],["vis dlx -p cowsay -p lolcatjs -c 'echo hi | cowsay | lolcatjs'","Multiple packages with shell"],["vis install && vis dlx --offline typescript tsc --version","Hardened: pre-install + offline (no registry fetch on dlx)"],["vis dlx --info create-vite","Always show the first-run panel (size, score, permissions, changelog)"],["vis dlx --yes create-vite my-app","Skip the first-run panel and confirmation"]],group:"Run & Execute",loader:()=>import("../packem_chunks/handler66.js"),name:"dlx",options:[{alias:"p",description:"Additional packages to install (repeatable)",multiple:!0,name:"package",type:String},{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output except command results",name:"silent",type:Boolean},{defaultValue:!1,description:"Resolve from local store only — fail rather than fetch from the registry. Pair with `vis install` for hardened npx-style workflows.",name:"offline",type:Boolean},{alias:"y",defaultValue:!1,description:"Skip the first-run info panel and confirmation prompt (also via VIS_DLX_YES — note this auto-approves every package)",name:"yes",type:Boolean},{defaultValue:!1,description:"Always show the first-run info panel (size, security score, permissions, changelog), even for an approved package",name:"info",type:Boolean},{defaultValue:!1,description:"Disable the first-run info panel entirely (also via VIS_DLX_NO_INFO)",name:"no-info",type:Boolean}]};class Wo extends Error{isVisUserError=!0;constructor(e,n){super(e,n),this.name="VisUserError"}}const as=t=>t instanceof Wo||t instanceof Error&&t.isVisUserError===!0;export{Go as N,Ho as Q,F as U,is as V,Ko as X,Zo as Y,Wo as a,Yo as b,Jo as c,rs as e,as as i,Qo as n,os as p,ss as r,A as s,Xo as t};
@@ -1 +0,0 @@
1
- import{createRequire as b}from"node:module";import{P as v,J as j,b as W}from"./index-BLtnel38.js";import{p as h}from"../packem_chunks/cli-main.js";let $;const y=o=>($??=b(import.meta.url))(o),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=o=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[c,r]=m.versions.node.split(".").map(Number);if(c>22||c===22&&r>=3||c===20&&r>=16)return m.getBuiltinModule(o)}return y(o)},{watch:T}=p("node:fs"),{execFileSync:S}=p("node:child_process"),{createRequire:k}=p("node:module"),g=k(import.meta.url);let w;const q=()=>{if(w!==void 0)return w;try{g.resolve("fb-watchman")}catch{return w=!1,!1}try{S("watchman",["--version"],{stdio:"ignore",timeout:2e3})}catch{return w=!1,!1}return w=!0,!0},R=(o,c)=>{if(!q())return;let r;try{r=g("fb-watchman")}catch(s){h.warn(`[vis watch] fb-watchman failed to load, using native watcher: ${s.message}`);return}const a=new r.Client;a.on("error",s=>{h.warn(`[vis watch] watchman error: ${s.message}`)}),a.on("subscription",s=>{const t=s;if(!t.is_fresh_instance)for(const e of t.files??[])c(e)});for(const[s,t]of o.entries()){const e=v(t),i=`vis-watch-${s}-${process.pid}`;a.command(["watch-project",e],(l,f)=>{if(l){h.warn(`[vis watch] watchman could not watch ${t}: ${l.message}`);return}const u={expression:["allof",["type","f"]],fields:["name"]};f.relative_path&&(u.relative_root=f.relative_path),a.command(["subscribe",f.watch,i,u],n=>{n&&h.warn(`[vis watch] watchman subscribe failed for ${t}: ${n.message}`)})})}return{close:()=>{try{a.end()}catch{}}}},x=[/node_modules(?:\/|$)/,/\.git(?:\/|$)/,/\.vis(?:\/|$)/],B=(o,c)=>{const r=new Set,a=new Set;for(const[,e]of o){const i=e.task.hashDetails?.nodes;if(i)for(const l of Object.keys(i))r.add(l),a.add(j(v(c,l)))}const s=[...a].sort(),t=[];for(const e of s)t.some(i=>e===i||e.startsWith(`${i}/`))||t.push(e);return{directories:t,files:r}},D=(o,c,r)=>{const a=new Set;for(const s of o){const t=v(c,s);for(const e of r)if(t===e||t.startsWith(`${e}/`)){const i=W(e,t);i.length>0&&a.add(i)}}return s=>{const t=s.replaceAll("\\","/");return a.has(t)}},A=o=>{const c=o.replaceAll("\\","/");return x.some(r=>r.test(c))},J=o=>{const{debounceMs:c=150,filter:r,onChange:a,paths:s}=o;let t=new Set,e;const i=()=>{e=void 0;const n=[...t];t=new Set,n.length!==0&&Promise.resolve(a(n)).catch(d=>{h.error("[vis watch] onChange handler failed:",d)})},l=n=>{A(n)||r&&!r(n)||(t.add(n),e&&clearTimeout(e),e=setTimeout(i,c))},f=R(s,l);if(f)return{close:()=>{e&&clearTimeout(e),f.close()}};const u=[];for(const n of s)try{const d=T(n,{recursive:!0},(C,_)=>{_&&l(_)});u.push(d)}catch(d){h.warn(`[vis watch] unable to watch ${n}: ${d.message}`)}return{close:()=>{e&&clearTimeout(e);for(const n of u)try{n.close()}catch{}}}};export{D as a,B as c,J as s};