@visulima/vis 1.0.0-alpha.9 → 1.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 (278) hide show
  1. package/CHANGELOG.md +1854 -3
  2. package/LICENSE.md +13515 -10
  3. package/README.md +215 -39
  4. package/bin/resolve-binary.mjs +85 -0
  5. package/bin/vis.mjs +76 -0
  6. package/dashboard/dist/index.html +152 -0
  7. package/dist/bin.d.ts +1 -0
  8. package/dist/bin.js +1 -2
  9. package/dist/binx.js +3 -0
  10. package/dist/config/index.d.ts +3276 -0
  11. package/dist/config/index.js +1 -0
  12. package/dist/generate/index.d.ts +1 -1
  13. package/dist/generate/index.js +1 -1
  14. package/dist/packem_chunks/CONFIG_FILES.js +8 -0
  15. package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -0
  16. package/dist/packem_chunks/agent-instructions.js +11 -0
  17. package/dist/packem_chunks/bloom-status.js +2 -0
  18. package/dist/packem_chunks/bloom-sync.js +2 -0
  19. package/dist/packem_chunks/cache-attestation.js +1 -0
  20. package/dist/packem_chunks/catalog-detector.js +1 -0
  21. package/dist/packem_chunks/catalog.js +114 -0
  22. package/dist/packem_chunks/cli-exec.js +1 -0
  23. package/dist/packem_chunks/cli-main.js +268 -0
  24. package/dist/packem_chunks/defineReleasePlugin.js +3 -0
  25. package/dist/packem_chunks/detect.js +3 -0
  26. package/dist/packem_chunks/detect2.js +8 -0
  27. package/dist/packem_chunks/devtools.js +4 -0
  28. package/dist/packem_chunks/discord.js +4 -0
  29. package/dist/packem_chunks/dispatch.js +4 -0
  30. package/dist/packem_chunks/doctor-probe.js +2 -0
  31. package/dist/packem_chunks/dynamic-import.js +1 -0
  32. package/dist/packem_chunks/extra-files.js +3 -0
  33. package/dist/packem_chunks/fix.js +11 -0
  34. package/dist/packem_chunks/git.js +3 -0
  35. package/dist/packem_chunks/group-tags.js +1 -0
  36. package/dist/packem_chunks/handler.js +1 -1
  37. package/dist/packem_chunks/handler10.js +5 -1
  38. package/dist/packem_chunks/handler11.js +1 -1
  39. package/dist/packem_chunks/handler12.js +26 -152
  40. package/dist/packem_chunks/handler13.js +5 -1
  41. package/dist/packem_chunks/handler14.js +1 -3
  42. package/dist/packem_chunks/handler15.js +1 -1
  43. package/dist/packem_chunks/handler16.js +1 -2
  44. package/dist/packem_chunks/handler17.js +1 -7
  45. package/dist/packem_chunks/handler18.js +1 -1
  46. package/dist/packem_chunks/handler19.js +5 -19
  47. package/dist/packem_chunks/handler2.js +1 -1
  48. package/dist/packem_chunks/handler20.js +2 -428
  49. package/dist/packem_chunks/handler21.js +2 -22
  50. package/dist/packem_chunks/handler22.js +14 -3
  51. package/dist/packem_chunks/handler23.js +1 -5
  52. package/dist/packem_chunks/handler24.js +1 -1
  53. package/dist/packem_chunks/handler25.js +1 -20
  54. package/dist/packem_chunks/handler26.js +5 -1
  55. package/dist/packem_chunks/handler27.js +1 -1
  56. package/dist/packem_chunks/handler28.js +3 -1
  57. package/dist/packem_chunks/handler29.js +1 -2
  58. package/dist/packem_chunks/handler3.js +4 -2
  59. package/dist/packem_chunks/handler30.js +1 -22
  60. package/dist/packem_chunks/handler31.js +2 -1
  61. package/dist/packem_chunks/handler32.js +2 -1
  62. package/dist/packem_chunks/handler33.js +2 -37
  63. package/dist/packem_chunks/handler34.js +3 -3
  64. package/dist/packem_chunks/handler35.js +6 -23
  65. package/dist/packem_chunks/handler36.js +1 -5
  66. package/dist/packem_chunks/handler37.js +36 -21
  67. package/dist/packem_chunks/handler38.js +8 -1
  68. package/dist/packem_chunks/handler39.js +9 -2
  69. package/dist/packem_chunks/handler4.js +4 -5
  70. package/dist/packem_chunks/handler40.js +75 -1
  71. package/dist/packem_chunks/handler41.js +5 -5
  72. package/dist/packem_chunks/handler42.js +4 -1
  73. package/dist/packem_chunks/handler43.js +3 -24
  74. package/dist/packem_chunks/handler44.js +2 -3
  75. package/dist/packem_chunks/handler45.js +1 -1
  76. package/dist/packem_chunks/handler46.js +1 -0
  77. package/dist/packem_chunks/handler47.js +1 -0
  78. package/dist/packem_chunks/handler48.js +3 -0
  79. package/dist/packem_chunks/handler49.js +1 -0
  80. package/dist/packem_chunks/handler5.js +6 -4
  81. package/dist/packem_chunks/handler50.js +7 -0
  82. package/dist/packem_chunks/handler51.js +33 -0
  83. package/dist/packem_chunks/handler52.js +3 -0
  84. package/dist/packem_chunks/handler53.js +8 -0
  85. package/dist/packem_chunks/handler54.js +4 -0
  86. package/dist/packem_chunks/handler55.js +1 -0
  87. package/dist/packem_chunks/handler56.js +12 -0
  88. package/dist/packem_chunks/handler57.js +11 -0
  89. package/dist/packem_chunks/handler58.js +5 -0
  90. package/dist/packem_chunks/handler59.js +11 -0
  91. package/dist/packem_chunks/handler6.js +8 -2
  92. package/dist/packem_chunks/handler60.js +3 -0
  93. package/dist/packem_chunks/handler61.js +22 -0
  94. package/dist/packem_chunks/handler62.js +61 -0
  95. package/dist/packem_chunks/handler63.js +3 -0
  96. package/dist/packem_chunks/handler64.js +6 -0
  97. package/dist/packem_chunks/handler65.js +9 -0
  98. package/dist/packem_chunks/handler66.js +2 -0
  99. package/dist/packem_chunks/handler67.js +24 -0
  100. package/dist/packem_chunks/handler68.js +25 -0
  101. package/dist/packem_chunks/handler69.js +153 -0
  102. package/dist/packem_chunks/handler7.js +1 -24
  103. package/dist/packem_chunks/handler70.js +10 -0
  104. package/dist/packem_chunks/handler71.js +23 -0
  105. package/dist/packem_chunks/handler72.js +322 -0
  106. package/dist/packem_chunks/handler73.js +708 -0
  107. package/dist/packem_chunks/handler74.js +48 -0
  108. package/dist/packem_chunks/handler75.js +27 -0
  109. package/dist/packem_chunks/handler76.js +3 -0
  110. package/dist/packem_chunks/handler77.js +190 -0
  111. package/dist/packem_chunks/handler78.js +38 -0
  112. package/dist/packem_chunks/handler8.js +1 -6
  113. package/dist/packem_chunks/handler9.js +1 -8
  114. package/dist/packem_chunks/heal-accept.js +10 -0
  115. package/dist/packem_chunks/heal.js +14 -0
  116. package/dist/packem_chunks/help-command.js +31 -0
  117. package/dist/packem_chunks/index.js +1 -7
  118. package/dist/packem_chunks/index2.js +802 -0
  119. package/dist/packem_chunks/index3.js +7 -0
  120. package/dist/packem_chunks/index4.js +135 -0
  121. package/dist/packem_chunks/index5.js +73 -0
  122. package/dist/packem_chunks/interface.js +2 -0
  123. package/dist/packem_chunks/keys-refresh.js +4 -0
  124. package/dist/packem_chunks/lean.js +4 -0
  125. package/dist/packem_chunks/list.js +3 -0
  126. package/dist/packem_chunks/loader.js +4 -1
  127. package/dist/packem_chunks/loader2.js +1 -0
  128. package/dist/packem_chunks/orchestrator.js +42 -0
  129. package/dist/packem_chunks/pre-mode.js +2 -0
  130. package/dist/packem_chunks/print-config.js +2 -0
  131. package/dist/packem_chunks/prompts.js +7 -0
  132. package/dist/packem_chunks/prune.js +3 -0
  133. package/dist/packem_chunks/publish-guards.js +1 -0
  134. package/dist/packem_chunks/registry.js +48 -0
  135. package/dist/packem_chunks/resolveFormatter.js +9 -0
  136. package/dist/packem_chunks/run.js +1 -0
  137. package/dist/packem_chunks/security.js +1 -0
  138. package/dist/packem_chunks/shell-runner.js +1 -0
  139. package/dist/packem_chunks/slack.js +2 -0
  140. package/dist/packem_chunks/snapshot.js +2 -0
  141. package/dist/packem_chunks/stage-publisher.js +1 -0
  142. package/dist/packem_chunks/staged-registry.js +2 -0
  143. package/dist/packem_chunks/state.js +3 -0
  144. package/dist/packem_chunks/status.js +2 -0
  145. package/dist/packem_chunks/success-walk.js +8 -0
  146. package/dist/packem_chunks/sync.js +2 -0
  147. package/dist/packem_chunks/sync2.js +2 -0
  148. package/dist/packem_chunks/tar.js +3 -0
  149. package/dist/packem_chunks/tripwire.js +2 -0
  150. package/dist/packem_chunks/ts-loader.js +22 -0
  151. package/dist/packem_chunks/verify-lockfile.js +2 -0
  152. package/dist/packem_chunks/version-resolver.js +2 -0
  153. package/dist/packem_chunks/webhook.js +1 -0
  154. package/dist/packem_chunks/workflow-templates.js +167 -0
  155. package/dist/packem_chunks/workspace.js +2 -0
  156. package/dist/packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js +1 -0
  157. package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +3 -0
  158. package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +1 -0
  159. package/dist/packem_shared/Table-BGIHvenQ-D2oJtNQj.js +34 -0
  160. package/dist/packem_shared/VisReleaseError-DMGRBTNO.js +1 -0
  161. package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +1 -0
  162. package/dist/packem_shared/advisories-CaP4uNhD.js +1 -0
  163. package/dist/packem_shared/affected-shas-BfO3PDJq.js +1 -0
  164. package/dist/packem_shared/ai-analysis-CO7No4rt.js +68 -0
  165. package/dist/packem_shared/ai-fix-B4u2zlVG.js +43 -0
  166. package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
  167. package/dist/packem_shared/api.d-BPftyU9r.d.ts +27 -0
  168. package/dist/packem_shared/augment-8z86AwtF.js +4 -0
  169. package/dist/packem_shared/bin-Cv8vsMEo.js +1 -0
  170. package/dist/packem_shared/build-scripts-D477Ou-x.js +1 -0
  171. package/dist/packem_shared/command-runtime-EWjmSxPj.js +1 -0
  172. package/dist/packem_shared/compile-cache-B_Vf_WxT.js +3 -0
  173. package/dist/packem_shared/createAdapter-bU4DIP3F.js +1 -0
  174. package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
  175. package/dist/packem_shared/cyclonedx-CDWHbD9s.js +4 -0
  176. package/dist/packem_shared/defineFormatter-D5dCp6Kv.js +1 -0
  177. package/dist/packem_shared/definePlugin-DoUcoYSy.js +1 -0
  178. package/dist/packem_shared/dependency-scan-P52jY0pU.js +1 -0
  179. package/dist/packem_shared/docker-CD7o1D1o.js +59 -0
  180. package/dist/packem_shared/env-Cpxa_7UE.js +27 -0
  181. package/dist/packem_shared/failure-log-MOhz-TBv.js +2 -0
  182. package/dist/packem_shared/giget-DVTFJlbR.js +2 -0
  183. package/dist/packem_shared/glob-DMbPwGSj-uzODoE-1.js +1 -0
  184. package/dist/packem_shared/index-B0EsgdzO.js +1 -0
  185. package/dist/packem_shared/index-BAUIIRZJ.js +1 -0
  186. package/dist/packem_shared/index-BVuCxe14.js +22 -0
  187. package/dist/packem_shared/index-CdTXvj-V.js +1 -0
  188. package/dist/packem_shared/index-CgXLAAVI.js +28 -0
  189. package/dist/packem_shared/index-DjTWo3sH.js +1 -0
  190. package/dist/packem_shared/index.server-J83sowC4.js +2 -0
  191. package/dist/packem_shared/interface.d-B7VK2rcH.d.ts +148 -0
  192. package/dist/packem_shared/interface.d-Cezzifoh.d.ts +106 -0
  193. package/dist/packem_shared/license-t5KnNX6v.js +1 -0
  194. package/dist/packem_shared/lifecycle-hzwghh5a.js +2 -0
  195. package/dist/packem_shared/lockfile-CWcVTdRc.js +1 -0
  196. package/dist/packem_shared/main-B3juSU5z.js +1 -0
  197. package/dist/packem_shared/manifests-CaPqgQxW.js +1 -0
  198. package/dist/packem_shared/min-release-age-skpcnlpk.js +34 -0
  199. package/dist/packem_shared/missing-package-json-_hOp4AW5.js +1 -0
  200. package/dist/packem_shared/native-config-sync-CFi1iQNG.js +21 -0
  201. package/dist/packem_shared/osv-bloom-BAyJUnRx.js +2 -0
  202. package/dist/packem_shared/otelPlugin-DmKDBaPo.js +1 -0
  203. package/dist/packem_shared/packument-CYxvm590.js +1 -0
  204. package/dist/packem_shared/peer-warnings-BXAzXqY3.js +1 -0
  205. package/dist/packem_shared/plugins.d-ND23R9I3.d.ts +4 -0
  206. package/dist/packem_shared/pm-runner-mVFjedM6.js +1 -0
  207. package/dist/packem_shared/prompt-DjXHVgYU.js +1 -0
  208. package/dist/packem_shared/provenance-CI_WQx7G.js +1 -0
  209. package/dist/packem_shared/public-api-WqUCiyIe.js +131 -0
  210. package/dist/packem_shared/readJsonSync-DuMMeB3s-Cx08VBQg.js +1 -0
  211. package/dist/packem_shared/registry-keys-AGlSEY6R.js +1 -0
  212. package/dist/packem_shared/resolve-explicit-DVE9cfkm.js +5 -0
  213. package/dist/packem_shared/resolve-runtime-CGHf-wHz.js +1 -0
  214. package/dist/packem_shared/run-file-Bs_E9O6O.js +1 -0
  215. package/dist/packem_shared/runtime-check-pS2XH4BO.js +1 -0
  216. package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +1 -0
  217. package/dist/packem_shared/s1ngularity-xmrq5T5r.js +1 -0
  218. package/dist/packem_shared/scan-progress-DQ4TMXcb.js +2 -0
  219. package/dist/packem_shared/selectors-CRgS4bU9.js +3 -0
  220. package/dist/packem_shared/signatures-Dp3th1DB.js +2 -0
  221. package/dist/packem_shared/slug-DoueYuLo.js +1 -0
  222. package/dist/packem_shared/spinner-DuJJvFTl.js +1 -0
  223. package/dist/packem_shared/sticky-comment-D6_7-w8T.js +1 -0
  224. package/dist/packem_shared/subtree-C7bZuiSQ.js +2 -0
  225. package/dist/packem_shared/symbols-DPTlrJ3B.js +1 -0
  226. package/dist/packem_shared/tabs-CgxCvjCY.js +1 -0
  227. package/dist/packem_shared/target-merge-D2eTghgd.js +11 -0
  228. package/dist/packem_shared/target-options-TM6ETDAS.js +1 -0
  229. package/dist/packem_shared/toolchain-B5KwUZfq.js +5 -0
  230. package/dist/packem_shared/typosquats-C0layQsP.js +1 -0
  231. package/dist/packem_shared/use-measured-height-Drobr4fe.js +1 -0
  232. package/dist/packem_shared/utils-CRueU43T.js +1 -0
  233. package/dist/packem_shared/verify-Cjo4EBFZ.js +1 -0
  234. package/dist/packem_shared/vis-update-app-qIkyvrd1.js +1 -0
  235. package/dist/packem_shared/watch-BnE1TzYn.js +1 -0
  236. package/dist/packem_shared/watch-loop-Irf3Pm-1.js +11 -0
  237. package/dist/release/core/changelog/index.d.ts +5 -0
  238. package/dist/release/core/changelog/index.js +1 -0
  239. package/dist/release/core/package-managers/index.d.ts +6 -0
  240. package/dist/release/core/package-managers/index.js +1 -0
  241. package/dist/release/core/version-actions/index.d.ts +14 -0
  242. package/dist/release/core/version-actions/index.js +1 -0
  243. package/dist/release/index.d.ts +233 -0
  244. package/dist/release/index.js +1 -0
  245. package/dist/release/plugin-sdk.d.ts +128 -0
  246. package/dist/release/plugin-sdk.js +1 -0
  247. package/dist/release/presets.d.ts +225 -0
  248. package/dist/release/presets.js +1 -0
  249. package/dist/release/types.d.ts +1493 -0
  250. package/dist/release/types.js +1 -0
  251. package/dist/runtime/preload.d.ts +1 -0
  252. package/dist/runtime/preload.js +1 -0
  253. package/index.d.ts +450 -0
  254. package/index.js +663 -556
  255. package/package.json +105 -62
  256. package/schemas/project.schema.json +872 -225
  257. package/schemas/vis-config.schema.json +6309 -264
  258. package/schemas/vis-release-config.schema.json +1423 -0
  259. package/skills/vis/SKILL.md +96 -0
  260. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  261. package/templates/buildkite-ci/template.yml +20 -0
  262. package/dist/config.d.ts +0 -1087
  263. package/dist/config.js +0 -1
  264. package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +0 -1
  265. package/dist/packem_shared/ai-analysis-DDqXRFxY.js +0 -67
  266. package/dist/packem_shared/bin-BaZZ32BK.js +0 -93
  267. package/dist/packem_shared/cache-directory-DL8hfXeG.js +0 -1
  268. package/dist/packem_shared/catalog-CuSpuB_R.js +0 -12
  269. package/dist/packem_shared/dependency-scan-BoLG2Fez.js +0 -1
  270. package/dist/packem_shared/docker-BcfqH4Av.js +0 -2
  271. package/dist/packem_shared/flakiness-DSIHZGBT.js +0 -1
  272. package/dist/packem_shared/otelPlugin-DxyvBcXO.js +0 -1
  273. package/dist/packem_shared/runtime-check-CGHal8SO.js +0 -1
  274. package/dist/packem_shared/selectors-CfH9ZY08.js +0 -3
  275. package/dist/packem_shared/symbols-CIMw60-G.js +0 -1
  276. package/dist/packem_shared/toolchain-C3ZG0o_X.js +0 -5
  277. package/dist/packem_shared/typosquats-Bpq4zcWL.js +0 -1
  278. package/dist/packem_shared/utils-DrNg0XTR.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{createRequire as m}from"node:module";import{m as _}from"./index-BVuCxe14.js";import{a as F}from"./env-Cpxa_7UE.js";const p=m(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,e]=o.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return o.getBuiltinModule(r)}return p(r)},{mkdirSync:f,writeFileSync:h,readdirSync:g}=c("node:fs"),{readFile:y}=c("node:fs/promises"),n=r=>F(r),a=(r,t)=>_(n(r),`${encodeURIComponent(t)}.json`);class S{#t;#e;constructor(t,e){this.#t=t,this.#e=e}printTaskTerminalOutput(t,e,s){if(e!=="failure")return;const i=n(this.#t);try{f(i,{recursive:!0})}catch{return}const u=t.overrides.command,d=t.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:t.hash,runId:this.#e,status:e,taskId:t.id,terminalOutput:s,timestamp:new Date().toISOString()};try{h(a(this.#t,t.id),`${JSON.stringify(l,void 0,2)}
2
+ `,"utf8")}catch{}}}const I=async(r,t)=>{const e=a(r,t);try{const s=await y(e,"utf8");return JSON.parse(s)}catch{return}},O=r=>{const t=n(r);let e;try{e=g(t)}catch{return[]}const s=[];for(const i of e)if(i.endsWith(".json"))try{s.push(decodeURIComponent(i.slice(0,-5)))}catch{}return s};export{S as F,I as a,O as l};
@@ -0,0 +1,2 @@
1
+ import{createRequire as ce}from"node:module";const le=ce(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=r=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[e,t]=y.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return y.getBuiltinModule(r)}return le(r)},{existsSync:m,openSync:ue,readSync:de,closeSync:pe,statSync:he,createWriteStream:X,readdirSync:fe,renameSync:me}=w("node:fs"),{readFile:q,mkdir:S,rm:x,writeFile:ge,mkdtemp:we}=w("node:fs/promises"),{PassThrough:V,Readable:z,pipeline:$e}=w("node:stream"),{pipeline:J}=w("node:stream/promises"),{spawn:Y}=w("node:child_process"),{basename:ve,normalize:be,delimiter:C,resolve:Z,dirname:F,join:I}=w("node:path"),{cwd:K}=y,_e=w("node:readline"),{homedir:ye,tmpdir:Q}=w("node:os"),{promisify:ke}=w("node:util");var G=Object.defineProperty,Ee=(r,e)=>{let t={};for(var n in r)G(t,n,{get:r[n],enumerable:!0});return G(t,Symbol.toStringTag,{value:"Module"}),t};const xe=/^[A-Za-z]:\//;function T(r=""){return r&&r.replace(/\\/g,"/").replace(xe,e=>e.toUpperCase())}const Ce=/^[/\\]{2}/,Te=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,ee=/^[A-Za-z]:$/,te=function(r){if(r.length===0)return".";r=T(r);let e=r.match(Ce),t=k(r),n=r[r.length-1]==="/";return r=re(r,!t),r.length===0?t?"/":n?"./":".":(n&&(r+="/"),ee.test(r)&&(r+="/"),e?t?`//${r}`:`//./${r}`:t&&!k(r)?`/${r}`:r)},M=function(...r){let e="";for(let t of r)if(t)if(e.length>0){let n=e[e.length-1]==="/",o=t[0]==="/";n&&o?e+=t.slice(1):e+=n||o?t:`/${t}`}else e+=t;return te(e)};function Oe(){return typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}const f=function(...r){r=r.map(n=>T(n));let e="",t=!1;for(let n=r.length-1;n>=-1&&!t;n--){let o=n>=0?r[n]:Oe();!o||o.length===0||(e=`${o}/${e}`,t=k(o))}return e=re(e,!t),t&&!k(e)?`/${e}`:e.length>0?e:"."};function re(r,e){let t="",n=0,o=-1,s=0,i=null;for(let a=0;a<=r.length;++a){if(a<r.length)i=r[a];else{if(i==="/")break;i="/"}if(i==="/"){if(!(o===a-1||s===1))if(s===2){if(t.length<2||n!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let c=t.lastIndexOf("/");c===-1?(t="",n=0):(t=t.slice(0,c),n=t.length-1-t.lastIndexOf("/")),o=a,s=0;continue}else if(t.length>0){t="",n=0,o=a,s=0;continue}}e&&(t+=t.length>0?"/..":"..",n=2)}else t.length>0?t+=`/${r.slice(o+1,a)}`:t=r.slice(o+1,a),n=a-o-1;o=a,s=0}else i==="."&&s!==-1?++s:s=-1}return t}const k=function(r){return Te.test(r)},ne=function(r){let e=T(r).replace(/\/$/,"").split("/").slice(0,-1);return e.length===1&&ee.test(e[0])&&(e[0]+="/"),e.join("/")||(k(r)?"/":".")},oe=function(r,e){let t=T(r).split("/"),n="";for(let o=t.length-1;o>=0;o--){let s=t[o];if(s){n=s;break}}return n},Ae=/^path$/i,D={key:"PATH",value:""};function se(r){for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e)||!Ae.test(e))continue;let t=r[e];return t?{key:e,value:t}:D}return D}function Se(r,e){let t=e.value.split(C),n=[],o=r,s;do n.push(Z(o,"node_modules",".bin")),s=o,o=F(o);while(o!==s);n.push(F(process.execPath));let i=n.concat(t).join(C);return{key:e.key,value:i}}function je(r,e,t=!0){let n={...process.env,...e};if(!t)return n;let o=Se(r,se(n));return n[o.key]=o.value,n}const ze=r=>{let e=r.length,t=new V,n=()=>{--e===0&&t.end()};for(let o of r)J(o,t,{end:!1}).then(n).catch(n);return t},A=/([()\][%!^"`<>&|;, *?])/g,Fe=/^#!\s*(.+)/,Ie=/\.(?:com|exe)$/i,Ge=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,Me=process.platform==="win32",De=[".EXE",".CMD",".BAT",".COM"];function Pe(r,e=[],t={}){if(t.shell===!0||!Me)return{command:r,args:e,options:t};let n=P(r,t),o=null;if(n!==null){let s=Buffer.alloc(150),i=null;try{i=ue(n,"r"),de(i,s,0,150,0)}catch{}finally{i!==null&&pe(i)}let a=s.toString().match(Fe);if(a!==null){let c=a[1].trim(),d=c.indexOf(" "),l=d===-1?c:c.slice(0,d),h=d===-1?"":c.slice(d+1),p=ve(l);o=p==="env"?h||null:p}}if(o!==null&&n!==null&&(e=[n,...e],r=o,n=P(r,t)),n===null||!Ie.test(n)){let s=n!==null&&Ge.test(n);r=be(r),r=r.replace(A,"^$1"),e=e.map(i=>(i=i.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),i=i.replace(/(?=(\\+?)?)\1$/,"$1$1"),i=`"${i}"`,i=i.replace(A,"^$1"),s&&(i=i.replace(A,"^$1")),i)),e=["/d","/s","/c",`"${[r,...e].join(" ")}"`],r=t.env?.comspec??"cmd.exe",t={...t,windowsVerbatimArguments:!0}}return{command:r,args:e,options:t}}function P(r,e){let t=(e.cwd??K()).toString(),n=e.env??process.env,o=se(n).value,s=r.includes("/")||r.includes("\\")?[""]:[t,...o.split(C)],i=n.PATHEXT?n.PATHEXT.split(C):De;r.includes(".")&&i[0]!==""&&i.unshift("");for(let a of s){let c=Z(t,a.startsWith('"')&&a.endsWith('"')&&a.length>1?a.slice(1,-1):a,r);for(let d of i){let l=c+d;try{if(he(l).isFile())return l}catch{}}}return null}var B=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(e,t){super(`Process exited with non-zero status (${e.exitCode})`),this.result=e,this.output=t}};const Be={timeout:void 0,persist:!1},He={windowsHide:!0};function Ne(r){let e=new AbortController;for(let t of r){if(t.aborted)return e.abort(),t;t.addEventListener("abort",()=>{e.abort(t.reason)},{signal:e.signal})}return e.signal}async function H(r){let e="";try{for await(let t of r)e+=t.toString()}catch{}return e}var Re=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(e,t,n){this._options={...Be,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(o=>{this._resolveClose=o})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return Ue(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=ze(t),o=_e.createInterface({input:n});for await(let s of o)yield s.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new B(this)}async _waitForOutput(){let e=this._process;if(!e)throw Error("No process was started");let[t,n]=await Promise.all([this._streamOut?H(this._streamOut):"",this._streamErr?H(this._streamErr):""]);await this._processClosed;let{stdin:o}=this._options;if(o&&typeof o!="string"&&await o,e.removeAllListeners(),this._thrownError)throw this._thrownError;let s={stderr:n,stdout:t,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new B(this,s);return s}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=K(),t=this._options,n={...He,...t.nodeOptions},o=[];this._resetState(),t.timeout!==void 0&&o.push(AbortSignal.timeout(t.timeout)),t.signal!==void 0&&o.push(t.signal),t.persist===!0&&(n.detached=!0),o.length>0&&(n.signal=Ne(o)),n.env=je(e,n.env,t.nodePath);let s=Pe(this._command,this._args,n),i=Y(s.command,s.args,s.options);if(i.stderr&&(this._streamErr=i.stderr),i.stdout&&(this._streamOut=i.stdout),this._process=i,i.once("error",this._onError),i.once("close",this._onClose),i.stdin){let{stdin:a}=t;typeof a=="string"?i.stdin.end(a):a?.process?.stdout?.pipe(i.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{if(e.name==="AbortError"&&(!(e.cause instanceof Error)||e.cause.name!=="TimeoutError")){this._aborted=!0;return}this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}};const j=(r,e,t)=>{let n=new Re(r,e,t);return n.spawn(),n},Ue=j;var Le=Ee({detectPackageManager:()=>ie,installDependencies:()=>Ze,packageManagers:()=>v});async function We(r,e,t={}){let n=te(r).split("/");for(;n.length>0;){let o=await e(n.join("/")||"/");if(o||!t.includeParentDirs)return o;n.pop()}}function Xe(r){let e;return()=>(e===void 0&&(e=r().then(t=>(e=t,e))),e)}const qe=Xe(async()=>{if(globalThis.process?.versions?.webcontainer)return!1;try{let{exitCode:r}=await j("corepack",["--version"]);return r===0}catch{return!1}});async function Ve(r,e,t={}){let n=r!=="npm"&&r!=="bun"&&r!=="deno"&&t.corepack!==!1&&await qe()?["corepack",[r,...e]]:[r,e],{exitCode:o,stdout:s,stderr:i}=await j(n[0],n[1],{nodeOptions:{cwd:f(t.cwd||process.cwd()),env:t.env,stdio:t.silent?"pipe":"inherit"}});if(o!==0)throw Error(`\`${n.flat().join(" ")}\` failed.${t.silent?["",s,i].join(`
2
+ `):""}`)}async function Je(r={}){let e=r.cwd||process.cwd(),t={...process.env,...r.env},n=(typeof r.packageManager=="string"?v.find(o=>o.name===r.packageManager):r.packageManager)||await ie(r.cwd||process.cwd());if(!n)throw Error("No package manager auto-detected.");return{cwd:e,env:t,silent:r.silent??!1,packageManager:n,dev:r.dev??!1,workspace:r.workspace,global:r.global??!1,dry:r.dry??!1,corepack:r.corepack??!0}}function Ye(r){let[e,t]=(r||"").split("@"),[n,o]=t?.split("+")||[];if(e&&e!=="-"&&/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(e))return{name:e,version:n,buildMeta:o};let s=(e||"").replace(/\W+/g,"");return{name:s,version:n,buildMeta:o,warnings:[`Abnormal characters found in \`packageManager\` field, sanitizing from \`${e}\` to \`${s}\``]}}const v=[{name:"npm",command:"npm",lockFile:"package-lock.json"},{name:"pnpm",command:"pnpm",lockFile:"pnpm-lock.yaml",files:["pnpm-workspace.yaml"]},{name:"bun",command:"bun",lockFile:["bun.lockb","bun.lock"]},{name:"yarn",command:"yarn",lockFile:"yarn.lock",files:[".yarnrc.yml"]},{name:"deno",command:"deno",lockFile:"deno.lock",files:["deno.json"]}];async function ie(r,e={}){let t=await We(f(r||"."),async n=>{if(!e.ignorePackageJSON){let o=M(n,"package.json");if(m(o)){let s=JSON.parse(await q(o,"utf8"));if(s?.packageManager){let{name:i,version:a="0.0.0",buildMeta:c,warnings:d}=Ye(s.packageManager);if(i){let l=a.split(".")[0],h=v.find(p=>p.name===i&&p.majorVersion===l)||v.find(p=>p.name===i);return{name:i,command:i,version:a,majorVersion:l,buildMeta:c,warnings:d,files:h?.files,lockFile:h?.lockFile}}}}if(m(M(n,"deno.json")))return v.find(s=>s.name==="deno")}if(!e.ignoreLockFile){for(let o of v)if([o.lockFile,o.files].flat().filter(Boolean).some(s=>m(f(n,s))))return{...o}}},{includeParentDirs:e.includeParentDirs??!0});if(!t&&!e.ignoreArgv){let n=process.argv[1];if(n){for(let o of v)if(RegExp(`[/\\\\]\\.?${o.command}`).test(n))return o}}return t}async function Ze(r={}){let e=await Je(r),t=r.frozenLockFile?{npm:["ci"],yarn:["install","--immutable"],bun:["install","--frozen-lockfile"],pnpm:["install","--frozen-lockfile"],deno:["install","--frozen"]}[e.packageManager.name]:["install"];return r.ignoreWorkspace&&e.packageManager.name==="pnpm"&&t.push("--ignore-workspace"),e.dry||await Ve(e.packageManager.command,t,{cwd:e.cwd,silent:e.silent,corepack:e.corepack}),{exec:{command:e.packageManager.command,args:t}}}const Ke=Object.defineProperty({__proto__:null,basename:oe,dirname:ne,dist_exports:Le,resolve:f},Symbol.toStringTag,{value:"Module"});async function Qe(r,e,t={}){const n=e+".json",o=JSON.parse(await q(n,"utf8").catch(()=>"{}")),s=(await E(r,{method:"HEAD",headers:t.headers}).catch(()=>{}))?.headers.get("etag");if(o.etag===s&&m(e))return;typeof s=="string"&&(o.etag=s);const i=await E(r,{headers:t.headers});if(i.status>=400)throw new Error(`Failed to download ${r}: ${i.status} ${i.statusText}`);const a=X(e);await ke($e)(i.body,a),await ge(n,JSON.stringify(o),"utf8")}const et=/^(?<repo>[-\w.]+\/[-\w.]+)(?<subdir>[^#]+)?(?<ref>#[-\w./@]+)?/,tt=/^(?<repo>[-\w.]+(?:\/[-\w.]+)+?)(?:::(?<subdir>[^#]*))?(?<ref>#[-\w./@]+)?$/;function O(r,e){const t=e?.expandRepo||r.includes("::"),n=r.match(t?tt:et)?.groups||{},o=t?n.subdir?"/"+n.subdir:"/":n.subdir||"/";return{repo:n.repo||"",subdir:o,ref:n.ref?n.ref.slice(1):"main"}}function $(...r){process.env.DEBUG&&console.debug("[giget]",...r)}async function E(r,e={}){e.headers?.["sec-fetch-mode"]&&(e.mode=e.headers["sec-fetch-mode"]);const t=await fetch(r,{...e,headers:ae(e.headers)}).catch(n=>{throw new Error(`Failed to download ${r}: ${n}`,{cause:n})});if(e.validateStatus&&t.status>=400)throw new Error(`Failed to fetch ${r}: ${t.status} ${t.statusText}`);return t}function rt(){const r=process.env.XDG_CACHE_HOME?f(process.env.XDG_CACHE_HOME,"giget"):f(ye(),".cache/giget");if(process.platform==="win32"){const e=f(Q(),"giget");if(!m(e)&&m(r))try{me(r,e)}catch{}return e}return r}function ae(r={}){const e={};for(const[t,n]of Object.entries(r))n&&(e[t.toLowerCase()]=n);return e}const nt=(r,e)=>{const t=ot(r);return{name:t.name,version:t.subdir?`${t.version||"default"}-${t.subdir.replaceAll("/","-")}`:t.version,tar:({auth:n}={})=>st(t,n??e.auth)}};function ot(r,e={}){const t=e.cwd??process.cwd();let n=r.replace(/#.*$/,""),o;if(/^[./]/.test(r))n=f(t,n);else if(/^https?:\/\//.test(n)){const l=/^(https?:\/\/[^/]+)\/([\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(l){const[,h,p,g]=l;n=`${h}/${p}`,g&&(o=g)}}else if(n.includes("@")){const l=/^(.*?:[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(l){const[,h,p]=l;n=h,p&&(o=p)}}else{const l={"github:":"https://github.com/","gh:":"https://github.com/","gitlab:":"https://gitlab.com/","bitbucket:":"https://bitbucket.org/","sourcehut:":"https://git.sr.ht/~"},h=/^(.+?:)/.exec(n)?.at(1);h&&l[h]?n=n.replace(h,l[h]):h||(n=`${(process.env.GIGET_GIT_HOST||"https://github.com/").replace(/\/$/,"")}/${n}`);const p=/^(https?:\/\/[^/]+\/~?[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(p){const[,g,u]=p;n=g,u&&(o=u)}}const s=n.replace(/^https?:\/\//,"").replace(/^.+@/,"").replace(/(\.git)?(#.*)?$/,"").replace(/^\W+/,"").replaceAll(/[:/]/g,"-"),[i,a]=/#(.+)$/.exec(r)?.at(1)?.split(":")??[],c=i||void 0,d=a||o;return{uri:n,name:s,...c&&{version:c},...d&&{subdir:d}}}async function st(r,e){const t=await we(I(Q(),"giget-git-"));if(e&&/[\r\n]/.test(e))throw new Error("Auth token must not contain newline characters");const n={...process.env,GIT_TERMINAL_PROMPT:"0"};e&&(n.GIT_CONFIG_COUNT="1",n.GIT_CONFIG_KEY_0="http.extraHeader",n.GIT_CONFIG_VALUE_0=`Authorization: Bearer ${e}`);const o={env:n,timeout:6e4},s=it(),i=c=>R(c,o,s),a=c=>R(c,{...o,cwd:t},s);try{const c=["clone","--progress","--depth","1"];r.subdir&&c.push("--filter=blob:none","--sparse","--no-checkout"),r.version&&c.push("--branch",r.version),c.push("--",r.uri,t);try{s.update("Cloning..."),await i(c),s.update("Cloned.")}catch(u){if(!r.version)throw u;$("Shallow clone failed, falling back to full clone:",u),s.update("Shallow clone failed, cloning..."),await x(t,{recursive:!0,force:!0}),await S(t,{recursive:!0}),await a(["init"]),await a(["remote","add","origin",r.uri]),await a(["fetch","origin"]),await a(["checkout",r.version]),s.update("Fetched.")}r.subdir&&(s.update(`Sparse checkout ${r.subdir}...`),await a(["sparse-checkout","set",r.subdir]),await a(["checkout"])),s.update("Packing...");const d=r.subdir?I(t,r.subdir):t,{create:l}=await import("../packem_chunks/tar.js").then(u=>u.index_min_exports);s.done();const h=l({gzip:!0,cwd:d,filter:u=>!u.startsWith(".git/")&&u!==".git"&&!u.startsWith("./.git/")&&u!=="./.git"},["."]).pipe(new V);let p=!1;const g=()=>{p||(p=!0,x(t,{recursive:!0,force:!0}))};return h.on("end",g),h.on("error",g),h.on("close",g),h}catch(c){throw s.done(),await x(t,{recursive:!0,force:!0}),c}}const N=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function R(r,e,t){return new Promise((n,o)=>{const s=Y("git",r,{...e,stdio:["ignore","pipe","pipe"]});s.stdout.resume();let i="";s.stderr?.on("data",a=>{const c=a.toString();for(const d of c.split(/[\r\n]/)){const l=d.trim();l&&(i=l)}t&&t.update(i)}),s.on("close",a=>{a===0?n(i):o(new Error(`git ${r[0]} exited with code ${a}. Is git installed?`))}),s.on("error",a=>{a.code==="ENOENT"?o(new Error("git is not installed or not found in PATH")):o(a)})})}function it(){if(!process.stderr.isTTY)return{update(o){},done(){}};let r="",e=0;const t=()=>{const o=N[e%N.length];e++,process.stderr.write(`\x1B[2K\r\x1B[2m${o} ${r}\x1B[0m`)},n=setInterval(t,80);return{update(o){r=o,t()},done(){clearInterval(n),process.stderr.write("\x1B[2K\r")}}}const U=async(r,e)=>{if(r.endsWith(".json"))return await L(r,e);const t=new URL(r);let n=oe(t.pathname);try{const o=await E(t.href,{method:"HEAD",validateStatus:!0,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}});if((o.headers.get("content-type")||"").includes("application/json"))return await L(r,e);const s=o.headers.get("content-disposition")?.match(/filename="?(.+)"?/)?.[1];s&&(n=s.split(".")[0])}catch(o){$(`Failed to fetch HEAD for ${t.href}:`,o)}return{name:`${n}-${t.href.slice(0,8)}`,version:"",subdir:"",tar:t.href,defaultDir:n,headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0}}},L=async(r,e)=>{const t=await(await E(r,{validateStatus:!0,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}})).json();if(!t.tar||!t.name)throw new Error(`Invalid template info from ${r}. name or tar fields are missing!`);return t},W=(r,e)=>{const t=O(r),n=process.env.GIGET_GITHUB_URL||"https://api.github.com";return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},url:`${n.replace("api.github.com","github.com")}/${t.repo}/tree/${t.ref}${t.subdir}`,tar:`${n}/repos/${t.repo}/tarball/${t.ref}`}},at=(r,e)=>{const t=O(r,{expandRepo:!0}),n=process.env.GIGET_GITLAB_URL||"https://gitlab.com";return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0,"sec-fetch-mode":"same-origin"},url:`${n}/${t.repo}/tree/${t.ref}${t.subdir}`,tar:`${n}/${t.repo}/-/archive/${t.ref}.tar.gz`}},ct=(r,e)=>{const t=O(r);return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0},url:`https://bitbucket.com/${t.repo}/src/${t.ref}${t.subdir}`,tar:`https://bitbucket.org/${t.repo}/get/${t.ref}.tar.gz`}},lt=(r,e)=>{const t=O(r);return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0},url:`https://git.sr.ht/~${t.repo}/tree/${t.ref}/item${t.subdir}`,tar:`https://git.sr.ht/~${t.repo}/archive/${t.ref}.tar.gz`}},ut={http:U,https:U,git:nt,github:W,gh:W,gitlab:at,bitbucket:ct,sourcehut:lt},dt="https://raw.githubusercontent.com/unjs/giget/main/templates",pt=(r=dt,e={})=>(async t=>{const n=Date.now(),o=`${r}/${t}.json`,s=await E(o,{headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}});if(s.status>=400)throw new Error(`Failed to download ${t} template info from ${o}: ${s.status} ${s.statusText}`);const i=await s.json();if(!i.tar||!i.name)throw new Error(`Invalid template info from ${o}. name or tar fields are missing!`);return $(`Fetched ${t} template info from ${o} in ${Date.now()-n}ms`),i}),ht=/^([\w+-.]+):/;function ft(r){if(!r)return;if(typeof r=="function")return r;const e=globalThis.process.getBuiltinModule?.("node:path")?.matchesGlob;if(typeof e!="function")throw new TypeError("Ignore patterns require `path.matchesGlob` which is supported in Node.js v22.5.0, v20.17.0 or later.");return t=>r.some(n=>e(t,n))}async function $t(r,e={}){const t=ft(e.ignore);e.registry=process.env.GIGET_REGISTRY??e.registry,e.auth=process.env.GIGET_AUTH??e.auth;const n=e.registry===!1?void 0:pt(e.registry,{auth:e.auth});let o=e.provider||(n?"registry":"github"),s=r;const i=r.match(ht);i&&(o=i[1],s=r.slice(i[0].length),(o==="http"||o==="https")&&(s=r)),o.endsWith("+git")&&(s=`${o.slice(0,-4)}:${s}`,o="git");const a=e.providers?.[o]||ut[o]||n;if(!a)throw new Error(`Unsupported provider: ${o}`);const c=await Promise.resolve().then(()=>a(s,{auth:e.auth})).catch(u=>{throw new Error(`Failed to download template from ${o}: ${u.message}`)});if(!c)throw new Error(`Failed to resolve template from ${o}`);c.name=(c.name||"template").replace(/[^\da-z-]/gi,"-"),c.defaultDir=(c.defaultDir||c.name).replace(/[^\da-z-]/gi,"-");const d=f(f(rt(),o,c.name),(c.version||c.name)+".tar.gz");if(e.preferOffline&&m(d)&&(e.offline=!0),!e.offline){await S(ne(d),{recursive:!0});const u=Date.now();if(typeof c.tar=="function"){const b=c.tar;await(async()=>{const _=await b({auth:e.auth});await J(_ instanceof z?_:z.fromWeb(_),X(d))})().catch(_=>{if(!m(d))throw _;$("Download error. Using cached version:",_),e.offline=!0})}else await Qe(c.tar,d,{headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0,...ae(c.headers)}}).catch(b=>{if(!m(d))throw b;$("Download error. Using cached version:",b),e.offline=!0});$(`Downloaded to ${d} in ${Date.now()-u}ms`)}if(!m(d))throw new Error(`Tarball not found: ${d} (offline: ${e.offline})`);const l=f(f(e.cwd||"."),e.dir||c.defaultDir);if(e.forceClean&&await x(l,{recursive:!0,force:!0}),!e.force&&m(l)&&fe(l).length>0)throw new Error(`Destination ${l} already exists.`);await S(l,{recursive:!0});const h=Date.now(),p=c.subdir?.replace(/^\//,"")||"",{extract:g}=await import("../packem_chunks/tar.js").then(u=>u.index_min_exports);if(await g({file:d,cwd:l,onReadEntry(u){u.path=u.path.split("/").splice(1).join("/"),p&&(u.path.startsWith(p+"/")?u.path=u.path.slice(p.length):u.path=""),t&&u.path&&t(u.path.replace(/^\//,""))&&(u.path="")}}),$(`Extracted to ${l} in ${Date.now()-h}ms`),e.install){$("Installing dependencies...");const{installDependencies:u}=await Promise.resolve().then(()=>Ke).then(b=>b.dist_exports);await u({cwd:l,silent:e.silent,...typeof e.install=="object"?e.install:{}})}return{...c,source:s,dir:l}}export{$t as f,Ee as l};
@@ -0,0 +1 @@
1
+ import{W as o}from"./index-BVuCxe14.js";const r=async(s,a)=>await o(s,a);export{r as s};
@@ -0,0 +1 @@
1
+ import{createRequire as r}from"node:module";const i=r(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{env:s}=t,o=e=>e in s&&s[e]!=="0"&&s[e]!=="false",_=o("CI")||o("CONTINUOUS_INTEGRATION");export{_ as I};
@@ -0,0 +1 @@
1
+ import{g as Zr}from"./_commonjsHelpers-B5Y90VFO.js";var k={exports:{}},se,er;function x(){return er||(er=1,se={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}),se}var ie,rr;function H(){return rr||(rr=1,ie=process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...l)=>console.error("SEMVER",...l):()=>{}),ie}var tr;function B(){return tr||(tr=1,(function(a,l){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:t,MAX_LENGTH:s}=x(),E=H();l=a.exports={};const o=l.re=[],p=l.safeRe=[],r=l.src=[],R=l.safeSrc=[],e=l.t={};let i=0;const u="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",s],[u,t]],L=S=>{for(const[w,M]of m)S=S.split(`${w}*`).join(`${w}{0,${M}}`).split(`${w}+`).join(`${w}{1,${M}}`);return S},h=(S,w,M)=>{const y=L(w),D=i++;E(S,D,w),e[S]=D,r[D]=w,R[D]=y,o[D]=new RegExp(w,M?"g":void 0),p[D]=new RegExp(y,M?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),h("MAINVERSION",`(${r[e.NUMERICIDENTIFIER]})\\.(${r[e.NUMERICIDENTIFIER]})\\.(${r[e.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${r[e.NUMERICIDENTIFIERLOOSE]})\\.(${r[e.NUMERICIDENTIFIERLOOSE]})\\.(${r[e.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${r[e.NONNUMERICIDENTIFIER]}|${r[e.NUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${r[e.NONNUMERICIDENTIFIER]}|${r[e.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASE",`(?:-(${r[e.PRERELEASEIDENTIFIER]}(?:\\.${r[e.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${r[e.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${r[e.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${u}+`),h("BUILD",`(?:\\+(${r[e.BUILDIDENTIFIER]}(?:\\.${r[e.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${r[e.MAINVERSION]}${r[e.PRERELEASE]}?${r[e.BUILD]}?`),h("FULL",`^${r[e.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${r[e.MAINVERSIONLOOSE]}${r[e.PRERELEASELOOSE]}?${r[e.BUILD]}?`),h("LOOSE",`^${r[e.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${r[e.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${r[e.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${r[e.XRANGEIDENTIFIER]})(?:\\.(${r[e.XRANGEIDENTIFIER]})(?:\\.(${r[e.XRANGEIDENTIFIER]})(?:${r[e.PRERELEASE]})?${r[e.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${r[e.XRANGEIDENTIFIERLOOSE]})(?:\\.(${r[e.XRANGEIDENTIFIERLOOSE]})(?:\\.(${r[e.XRANGEIDENTIFIERLOOSE]})(?:${r[e.PRERELEASELOOSE]})?${r[e.BUILD]}?)?)?`),h("XRANGE",`^${r[e.GTLT]}\\s*${r[e.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${r[e.GTLT]}\\s*${r[e.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h("COERCE",`${r[e.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",r[e.COERCEPLAIN]+`(?:${r[e.PRERELEASE]})?(?:${r[e.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",r[e.COERCE],!0),h("COERCERTLFULL",r[e.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${r[e.LONETILDE]}\\s+`,!0),l.tildeTrimReplace="$1~",h("TILDE",`^${r[e.LONETILDE]}${r[e.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${r[e.LONETILDE]}${r[e.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${r[e.LONECARET]}\\s+`,!0),l.caretTrimReplace="$1^",h("CARET",`^${r[e.LONECARET]}${r[e.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${r[e.LONECARET]}${r[e.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${r[e.GTLT]}\\s*(${r[e.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${r[e.GTLT]}\\s*(${r[e.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${r[e.GTLT]}\\s*(${r[e.LOOSEPLAIN]}|${r[e.XRANGEPLAIN]})`,!0),l.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${r[e.XRANGEPLAIN]})\\s+-\\s+(${r[e.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${r[e.XRANGEPLAINLOOSE]})\\s+-\\s+(${r[e.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(k,k.exports)),k.exports}var ne,sr;function We(){if(sr)return ne;sr=1;const a=Object.freeze({loose:!0}),l=Object.freeze({});return ne=t=>t?typeof t!="object"?a:t:l,ne}var ae,ir;function Hr(){if(ir)return ae;ir=1;const a=/^[0-9]+$/,l=(t,s)=>{if(typeof t=="number"&&typeof s=="number")return t===s?0:t<s?-1:1;const E=a.test(t),o=a.test(s);return E&&o&&(t=+t,s=+s),t===s?0:E&&!o?-1:o&&!E?1:t<s?-1:1};return ae={compareIdentifiers:l,rcompareIdentifiers:(t,s)=>l(s,t)},ae}var oe,nr;function G(){if(nr)return oe;nr=1;const a=H(),{MAX_LENGTH:l,MAX_SAFE_INTEGER:n}=x(),{safeRe:t,t:s}=B(),E=We(),{compareIdentifiers:o}=Hr(),p=(R,e)=>{const i=e.split(".");if(i.length>R.length)return!1;for(let u=0;u<i.length;u++)if(o(R[u],i[u])!==0)return!1;return!0};class r{constructor(e,i){if(i=E(i),e instanceof r){if(e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>l)throw new TypeError(`version is longer than ${l} characters`);a("SemVer",e,i),this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease;const u=e.trim().match(i.loose?t[s.LOOSE]:t[s.FULL]);if(!u)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");u[4]?this.prerelease=u[4].split(".").map(m=>{if(/^[0-9]+$/.test(m)){const L=+m;if(L>=0&&L<n)return L}return m}):this.prerelease=[],this.build=u[5]?u[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let i=0;do{const u=this.prerelease[i],m=e.prerelease[i];if(a("prerelease compare",i,u,m),u===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(u===void 0)return-1;if(u!==m)return o(u,m)}while(++i)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let i=0;do{const u=this.build[i],m=e.build[i];if(a("build compare",i,u,m),u===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(u===void 0)return-1;if(u!==m)return o(u,m)}while(++i)}inc(e,i,u){if(e.startsWith("pre")){if(!i&&u===!1)throw new Error("invalid increment argument: identifier is empty");if(i){const m=`-${i}`.match(this.options.loose?t[s.PRERELEASELOOSE]:t[s.PRERELEASE]);if(!m||m[1]!==i)throw new Error(`invalid identifier: ${i}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",i,u);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",i,u);break;case"prepatch":this.prerelease.length=0,this.inc("patch",i,u),this.inc("pre",i,u);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",i,u),this.inc("pre",i,u);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const m=Number(u)?1:0;if(this.prerelease.length===0)this.prerelease=[m];else{let L=this.prerelease.length;for(;--L>=0;)typeof this.prerelease[L]=="number"&&(this.prerelease[L]++,L=-2);if(L===-1){if(i===this.prerelease.join(".")&&u===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(m)}}if(i){let L=[i,m];if(u===!1&&(L=[i]),p(this.prerelease,i)){const h=this.prerelease[i.split(".").length];isNaN(h)&&(this.prerelease=L)}else this.prerelease=L}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return oe=r,oe}var ue,ar;function j(){if(ar)return ue;ar=1;const a=G();return ue=(n,t,s=!1)=>{if(n instanceof a)return n;try{return new a(n,t)}catch(E){if(!s)return null;throw E}},ue}var le,or;function Jr(){if(or)return le;or=1;const a=j();return le=(n,t)=>{const s=a(n,t);return s?s.version:null},le}var ce,ur;function Kr(){if(ur)return ce;ur=1;const a=j();return ce=(n,t)=>{const s=a(n.trim().replace(/^[=v]+/,""),t);return s?s.version:null},ce}var pe,lr;function Qr(){if(lr)return pe;lr=1;const a=G();return pe=(n,t,s,E,o)=>{typeof s=="string"&&(o=E,E=s,s=void 0);try{return new a(n instanceof a?n.version:n,s).inc(t,E,o).version}catch{return null}},pe}var he,cr;function et(){if(cr)return he;cr=1;const a=j();return he=(n,t)=>{const s=a(n,null,!0),E=a(t,null,!0),o=s.compare(E);if(o===0)return null;const p=o>0,r=p?s:E,R=p?E:s,e=!!r.prerelease.length;if(R.prerelease.length&&!e){if(!R.patch&&!R.minor)return"major";if(R.compareMain(r)===0)return R.minor&&!R.patch?"minor":"patch"}const i=e?"pre":"";return s.major!==E.major?i+"major":s.minor!==E.minor?i+"minor":s.patch!==E.patch?i+"patch":"prerelease"},he}var Ee,pr;function rt(){if(pr)return Ee;pr=1;const a=G();return Ee=(n,t)=>new a(n,t).major,Ee}var fe,hr;function tt(){if(hr)return fe;hr=1;const a=G();return fe=(n,t)=>new a(n,t).minor,fe}var me,Er;function st(){if(Er)return me;Er=1;const a=G();return me=(n,t)=>new a(n,t).patch,me}var Re,fr;function it(){if(fr)return Re;fr=1;const a=j();return Re=(n,t)=>{const s=a(n,t);return s&&s.prerelease.length?s.prerelease:null},Re}var ve,mr;function F(){if(mr)return ve;mr=1;const a=G();return ve=(n,t,s)=>new a(n,s).compare(new a(t,s)),ve}var $e,Rr;function nt(){if(Rr)return $e;Rr=1;const a=F();return $e=(n,t,s)=>a(t,n,s),$e}var de,vr;function at(){if(vr)return de;vr=1;const a=F();return de=(n,t)=>a(n,t,!0),de}var Ie,$r;function ze(){if($r)return Ie;$r=1;const a=G();return Ie=(n,t,s)=>{const E=new a(n,s),o=new a(t,s);return E.compare(o)||E.compareBuild(o)},Ie}var Le,dr;function ot(){if(dr)return Le;dr=1;const a=ze();return Le=(n,t)=>n.sort((s,E)=>a(s,E,t)),Le}var ge,Ir;function ut(){if(Ir)return ge;Ir=1;const a=ze();return ge=(n,t)=>n.sort((s,E)=>a(E,s,t)),ge}var Ne,Lr;function Y(){if(Lr)return Ne;Lr=1;const a=F();return Ne=(n,t,s)=>a(n,t,s)>0,Ne}var Se,gr;function Ze(){if(gr)return Se;gr=1;const a=F();return Se=(n,t,s)=>a(n,t,s)<0,Se}var Oe,Nr;function Yr(){if(Nr)return Oe;Nr=1;const a=F();return Oe=(n,t,s)=>a(n,t,s)===0,Oe}var Ae,Sr;function Wr(){if(Sr)return Ae;Sr=1;const a=F();return Ae=(n,t,s)=>a(n,t,s)!==0,Ae}var Te,Or;function Je(){if(Or)return Te;Or=1;const a=F();return Te=(n,t,s)=>a(n,t,s)>=0,Te}var qe,Ar;function Ke(){if(Ar)return qe;Ar=1;const a=F();return qe=(n,t,s)=>a(n,t,s)<=0,qe}var we,Tr;function zr(){if(Tr)return we;Tr=1;const a=Yr(),l=Wr(),n=Y(),t=Je(),s=Ze(),E=Ke();return we=(p,r,R,e)=>{switch(r){case"===":return typeof p=="object"&&(p=p.version),typeof R=="object"&&(R=R.version),p===R;case"!==":return typeof p=="object"&&(p=p.version),typeof R=="object"&&(R=R.version),p!==R;case"":case"=":case"==":return a(p,R,e);case"!=":return l(p,R,e);case">":return n(p,R,e);case">=":return t(p,R,e);case"<":return s(p,R,e);case"<=":return E(p,R,e);default:throw new TypeError(`Invalid operator: ${r}`)}},we}var Pe,qr;function lt(){if(qr)return Pe;qr=1;const a=G(),l=j(),{safeRe:n,t}=B();return Pe=(E,o)=>{if(E instanceof a)return E;if(typeof E=="number"&&(E=String(E)),typeof E!="string")return null;o=o||{};let p=null;if(!o.rtl)p=E.match(o.includePrerelease?n[t.COERCEFULL]:n[t.COERCE]);else{const m=o.includePrerelease?n[t.COERCERTLFULL]:n[t.COERCERTL];let L;for(;(L=m.exec(E))&&(!p||p.index+p[0].length!==E.length);)(!p||L.index+L[0].length!==p.index+p[0].length)&&(p=L),m.lastIndex=L.index+L[1].length+L[2].length;m.lastIndex=-1}if(p===null)return null;const r=p[2],R=p[3]||"0",e=p[4]||"0",i=o.includePrerelease&&p[5]?`-${p[5]}`:"",u=o.includePrerelease&&p[6]?`+${p[6]}`:"";return l(`${r}.${R}.${e}${i}${u}`,o)},Pe}var Ce,wr;function ct(){if(wr)return Ce;wr=1;const a=j(),l=x(),n=G(),t=(p,r,R)=>{if(!l.RELEASE_TYPES.includes(r))return null;const e=s(p,R);return e&&E(e,r)},s=(p,r)=>{const R=p instanceof n?p.version:p;return a(R,r)},E=(p,r)=>{if(o(r))return p.version;switch(p.prerelease=[],r){case"major":p.minor=0,p.patch=0;break;case"minor":p.patch=0;break}return p.format()},o=p=>p.startsWith("pre");return Ce=t,Ce}var _e,Pr;function pt(){if(Pr)return _e;Pr=1;class a{constructor(){this.max=1e3,this.map=new Map}get(n){const t=this.map.get(n);if(t!==void 0)return this.map.delete(n),this.map.set(n,t),t}delete(n){return this.map.delete(n)}set(n,t){if(!this.delete(n)&&t!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,t)}return this}}return _e=a,_e}var Me,Cr;function b(){if(Cr)return Me;Cr=1;const a=/\s+/g;class l{constructor(c,$){if($=s($),c instanceof l)return c.loose===!!$.loose&&c.includePrerelease===!!$.includePrerelease?c:new l(c.raw,$);if(c instanceof E)return this.raw=c.value,this.set=[[c]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=c.trim().replace(a," "),this.set=this.raw.split("||").map(d=>this.parseRange(d.trim())).filter(d=>d.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const d=this.set[0];if(this.set=this.set.filter(N=>!w(N[0])),this.set.length===0)this.set=[d];else if(this.set.length>1){for(const N of this.set)if(N.length===1&&M(N[0])){this.set=[N];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let c=0;c<this.set.length;c++){c>0&&(this.formatted+="||");const $=this.set[c];for(let d=0;d<$.length;d++)d>0&&(this.formatted+=" "),this.formatted+=$[d].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(c){c=c.replace(S,"");const $=((this.options.includePrerelease&&L)|(this.options.loose&&h))+":"+c,d=t.get($);if(d)return d;const N=this.options.loose,v=N?r[e.HYPHENRANGELOOSE]:r[e.HYPHENRANGE];c=c.replace(v,re(this.options.includePrerelease)),o("hyphen replace",c),c=c.replace(r[e.COMPARATORTRIM],i),o("comparator trim",c),c=c.replace(r[e.TILDETRIM],u),o("tilde trim",c),c=c.replace(r[e.CARETTRIM],m),o("caret trim",c);let I=c.split(" ").map(C=>D(C,this.options)).join(" ").split(/\s+/).map(C=>ee(C,this.options));N&&(I=I.filter(C=>(o("loose invalid filter",C,this.options),!!C.match(r[e.COMPARATORLOOSE])))),o("range list",I);const A=new Map,q=I.map(C=>new E(C,this.options));for(const C of q){if(w(C))return[C];A.set(C.value,C)}A.size>1&&A.has("")&&A.delete("");const T=[...A.values()];return t.set($,T),T}intersects(c,$){if(!(c instanceof l))throw new TypeError("a Range is required");return this.set.some(d=>y(d,$)&&c.set.some(N=>y(N,$)&&d.every(v=>N.every(I=>v.intersects(I,$)))))}test(c){if(!c)return!1;if(typeof c=="string")try{c=new p(c,this.options)}catch{return!1}for(let $=0;$<this.set.length;$++)if(te(this.set[$],c,this.options))return!0;return!1}}Me=l;const n=pt(),t=new n,s=We(),E=W(),o=H(),p=G(),{safeRe:r,src:R,t:e,comparatorTrimReplace:i,tildeTrimReplace:u,caretTrimReplace:m}=B(),{FLAG_INCLUDE_PRERELEASE:L,FLAG_LOOSE:h}=x(),S=new RegExp(R[e.BUILD],"g"),w=f=>f.value==="<0.0.0-0",M=f=>f.value==="",y=(f,c)=>{let $=!0;const d=f.slice();let N=d.pop();for(;$&&d.length;)$=d.every(v=>N.intersects(v,c)),N=d.pop();return $},D=(f,c)=>(f=f.replace(r[e.BUILD],""),o("comp",f,c),f=X(f,c),o("caret",f),f=_(f,c),o("tildes",f),f=J(f,c),o("xrange",f),f=Q(f,c),o("stars",f),f),O=f=>!f||f.toLowerCase()==="x"||f==="*",P=(f,c,$)=>O(f)&&!O(c)||O(c)&&$&&!O($),_=(f,c)=>f.trim().split(/\s+/).map($=>g($,c)).join(" "),g=(f,c)=>{const $=c.loose?r[e.TILDELOOSE]:r[e.TILDE],d=c.includePrerelease?"-0":"";return f.replace($,(N,v,I,A,q)=>{o("tilde",f,N,v,I,A,q);let T;return O(v)?T="":O(I)?T=`>=${v}.0.0${d} <${+v+1}.0.0-0`:O(A)?T=`>=${v}.${I}.0${d} <${v}.${+I+1}.0-0`:q?(o("replaceTilde pr",q),T=`>=${v}.${I}.${A}-${q} <${v}.${+I+1}.0-0`):T=`>=${v}.${I}.${A} <${v}.${+I+1}.0-0`,o("tilde return",T),T})},X=(f,c)=>f.trim().split(/\s+/).map($=>Z($,c)).join(" "),Z=(f,c)=>{o("caret",f,c);const $=c.loose?r[e.CARETLOOSE]:r[e.CARET],d=c.includePrerelease?"-0":"";return f.replace($,(N,v,I,A,q)=>{o("caret",f,N,v,I,A,q);let T;return O(v)?T="":O(I)?T=`>=${v}.0.0${d} <${+v+1}.0.0-0`:O(A)?v==="0"?T=`>=${v}.${I}.0${d} <${v}.${+I+1}.0-0`:T=`>=${v}.${I}.0${d} <${+v+1}.0.0-0`:q?(o("replaceCaret pr",q),v==="0"?I==="0"?T=`>=${v}.${I}.${A}-${q} <${v}.${I}.${+A+1}-0`:T=`>=${v}.${I}.${A}-${q} <${v}.${+I+1}.0-0`:T=`>=${v}.${I}.${A}-${q} <${+v+1}.0.0-0`):(o("no pr"),v==="0"?I==="0"?T=`>=${v}.${I}.${A} <${v}.${I}.${+A+1}-0`:T=`>=${v}.${I}.${A} <${v}.${+I+1}.0-0`:T=`>=${v}.${I}.${A} <${+v+1}.0.0-0`),o("caret return",T),T})},J=(f,c)=>(o("replaceXRanges",f,c),f.split(/\s+/).map($=>K($,c)).join(" ")),K=(f,c)=>{f=f.trim();const $=c.loose?r[e.XRANGELOOSE]:r[e.XRANGE];return f.replace($,(d,N,v,I,A,q)=>{if(o("xRange",f,d,N,v,I,A,q),P(v,I,A))return f;const T=O(v),C=T||O(I),U=C||O(A),V=U;return N==="="&&V&&(N=""),q=c.includePrerelease?"-0":"",T?N===">"||N==="<"?d="<0.0.0-0":d="*":N&&V?(C&&(I=0),A=0,N===">"?(N=">=",C?(v=+v+1,I=0,A=0):(I=+I+1,A=0)):N==="<="&&(N="<",C?v=+v+1:I=+I+1),N==="<"&&(q="-0"),d=`${N+v}.${I}.${A}${q}`):C?d=`>=${v}.0.0${q} <${+v+1}.0.0-0`:U&&(d=`>=${v}.${I}.0${q} <${v}.${+I+1}.0-0`),o("xRange return",d),d})},Q=(f,c)=>(o("replaceStars",f,c),f.trim().replace(r[e.STAR],"")),ee=(f,c)=>(o("replaceGTE0",f,c),f.trim().replace(r[c.includePrerelease?e.GTE0PRE:e.GTE0],"")),re=f=>(c,$,d,N,v,I,A,q,T,C,U,V)=>(O(d)?$="":O(N)?$=`>=${d}.0.0${f?"-0":""}`:O(v)?$=`>=${d}.${N}.0${f?"-0":""}`:I?$=`>=${$}`:$=`>=${$}${f?"-0":""}`,O(T)?q="":O(C)?q=`<${+T+1}.0.0-0`:O(U)?q=`<${T}.${+C+1}.0-0`:V?q=`<=${T}.${C}.${U}-${V}`:f?q=`<${T}.${C}.${+U+1}-0`:q=`<=${q}`,`${$} ${q}`.trim()),te=(f,c,$)=>{for(let d=0;d<f.length;d++)if(!f[d].test(c))return!1;if(c.prerelease.length&&!$.includePrerelease){for(let d=0;d<f.length;d++)if(o(f[d].semver),f[d].semver!==E.ANY&&f[d].semver.prerelease.length>0){const N=f[d].semver;if(N.major===c.major&&N.minor===c.minor&&N.patch===c.patch)return!0}return!1}return!0};return Me}var De,_r;function W(){if(_r)return De;_r=1;const a=Symbol("SemVer ANY");class l{static get ANY(){return a}constructor(e,i){if(i=n(i),e instanceof l){if(e.loose===!!i.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),o("comparator",e,i),this.options=i,this.loose=!!i.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(e){const i=this.options.loose?t[s.COMPARATORLOOSE]:t[s.COMPARATOR],u=e.match(i);if(!u)throw new TypeError(`Invalid comparator: ${e}`);this.operator=u[1]!==void 0?u[1]:"",this.operator==="="&&(this.operator=""),u[2]?this.semver=new p(u[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(o("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if(typeof e=="string")try{e=new p(e,this.options)}catch{return!1}return E(e,this.operator,this.semver,this.options)}intersects(e,i){if(!(e instanceof l))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new r(e.value,i).test(this.value):e.operator===""?e.value===""?!0:new r(this.value,i).test(e.semver):(i=n(i),i.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!i.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||E(this.semver,"<",e.semver,i)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||E(this.semver,">",e.semver,i)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}De=l;const n=We(),{safeRe:t,t:s}=B(),E=zr(),o=H(),p=G(),r=b();return De}var Ge,Mr;function z(){if(Mr)return Ge;Mr=1;const a=b();return Ge=(n,t,s)=>{try{t=new a(t,s)}catch{return!1}return t.test(n)},Ge}var ye,Dr;function ht(){if(Dr)return ye;Dr=1;const a=b();return ye=(n,t)=>new a(n,t).set.map(s=>s.map(E=>E.value).join(" ").trim().split(" ")),ye}var Fe,Gr;function Et(){if(Gr)return Fe;Gr=1;const a=G(),l=b();return Fe=(t,s,E)=>{let o=null,p=null,r=null;try{r=new l(s,E)}catch{return null}return t.forEach(R=>{r.test(R)&&(!o||p.compare(R)===-1)&&(o=R,p=new a(o,E))}),o},Fe}var be,yr;function ft(){if(yr)return be;yr=1;const a=G(),l=b();return be=(t,s,E)=>{let o=null,p=null,r=null;try{r=new l(s,E)}catch{return null}return t.forEach(R=>{r.test(R)&&(!o||p.compare(R)===1)&&(o=R,p=new a(o,E))}),o},be}var je,Fr;function mt(){if(Fr)return je;Fr=1;const a=G(),l=b(),n=Y();return je=(s,E)=>{s=new l(s,E);let o=new a("0.0.0");if(s.test(o)||(o=new a("0.0.0-0"),s.test(o)))return o;o=null;for(let p=0;p<s.set.length;++p){const r=s.set[p];let R=null;r.forEach(e=>{const i=new a(e.semver.version);switch(e.operator){case">":i.prerelease.length===0?i.patch++:i.prerelease.push(0),i.raw=i.format();case"":case">=":(!R||n(i,R))&&(R=i);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),R&&(!o||n(o,R))&&(o=R)}return o&&s.test(o)?o:null},je}var Ue,br;function Rt(){if(br)return Ue;br=1;const a=b();return Ue=(n,t)=>{try{return new a(n,t).range||"*"}catch{return null}},Ue}var Xe,jr;function Qe(){if(jr)return Xe;jr=1;const a=G(),l=W(),{ANY:n}=l,t=b(),s=z(),E=Y(),o=Ze(),p=Ke(),r=Je();return Xe=(e,i,u,m)=>{e=new a(e,m),i=new t(i,m);let L,h,S,w,M;switch(u){case">":L=E,h=p,S=o,w=">",M=">=";break;case"<":L=o,h=r,S=E,w="<",M="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,i,m))return!1;for(let y=0;y<i.set.length;++y){const D=i.set[y];let O=null,P=null;if(D.forEach(_=>{_.semver===n&&(_=new l(">=0.0.0")),O=O||_,P=P||_,L(_.semver,O.semver,m)?O=_:S(_.semver,P.semver,m)&&(P=_)}),O.operator===w||O.operator===M||(!P.operator||P.operator===w)&&h(e,P.semver)||P.operator===M&&S(e,P.semver))return!1}return!0},Xe}var Ve,Ur;function vt(){if(Ur)return Ve;Ur=1;const a=Qe();return Ve=(n,t,s)=>a(n,t,">",s),Ve}var xe,Xr;function $t(){if(Xr)return xe;Xr=1;const a=Qe();return xe=(n,t,s)=>a(n,t,"<",s),xe}var Be,Vr;function dt(){if(Vr)return Be;Vr=1;const a=b();return Be=(n,t,s)=>(n=new a(n,s),t=new a(t,s),n.intersects(t,s)),Be}var ke,xr;function It(){if(xr)return ke;xr=1;const a=z(),l=F();return ke=(n,t,s)=>{const E=[];let o=null,p=null;const r=n.sort((u,m)=>l(u,m,s));for(const u of r)a(u,t,s)?(p=u,o||(o=u)):(p&&E.push([o,p]),p=null,o=null);o&&E.push([o,null]);const R=[];for(const[u,m]of E)u===m?R.push(u):!m&&u===r[0]?R.push("*"):m?u===r[0]?R.push(`<=${m}`):R.push(`${u} - ${m}`):R.push(`>=${u}`);const e=R.join(" || "),i=typeof t.raw=="string"?t.raw:String(t);return e.length<i.length?e:t},ke}var He,Br;function Lt(){if(Br)return He;Br=1;const a=b(),l=W(),{ANY:n}=l,t=z(),s=F(),E=(i,u,m={})=>{if(i===u)return!0;i=new a(i,m),u=new a(u,m);let L=!1;e:for(const h of i.set){for(const S of u.set){const w=r(h,S,m);if(L=L||w!==null,w)continue e}if(L)return!1}return!0},o=[new l(">=0.0.0-0")],p=[new l(">=0.0.0")],r=(i,u,m)=>{if(i===u)return!0;if(i.length===1&&i[0].semver===n){if(u.length===1&&u[0].semver===n)return!0;m.includePrerelease?i=o:i=p}if(u.length===1&&u[0].semver===n){if(m.includePrerelease)return!0;u=p}const L=new Set;let h,S;for(const g of i)g.operator===">"||g.operator===">="?h=R(h,g,m):g.operator==="<"||g.operator==="<="?S=e(S,g,m):L.add(g.semver);if(L.size>1)return null;let w;if(h&&S&&(w=s(h.semver,S.semver,m),w>0||w===0&&(h.operator!==">="||S.operator!=="<=")))return null;for(const g of L){if(h&&!t(g,String(h),m)||S&&!t(g,String(S),m))return null;for(const X of u)if(!t(g,String(X),m))return!1;return!0}let M,y,D,O,P=S&&!m.includePrerelease&&S.semver.prerelease.length?S.semver:!1,_=h&&!m.includePrerelease&&h.semver.prerelease.length?h.semver:!1;P&&P.prerelease.length===1&&S.operator==="<"&&P.prerelease[0]===0&&(P=!1);for(const g of u){if(O=O||g.operator===">"||g.operator===">=",D=D||g.operator==="<"||g.operator==="<=",h){if(_&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===_.major&&g.semver.minor===_.minor&&g.semver.patch===_.patch&&(_=!1),g.operator===">"||g.operator===">="){if(M=R(h,g,m),M===g&&M!==h)return!1}else if(h.operator===">="&&!g.test(h.semver))return!1}if(S){if(P&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===P.major&&g.semver.minor===P.minor&&g.semver.patch===P.patch&&(P=!1),g.operator==="<"||g.operator==="<="){if(y=e(S,g,m),y===g&&y!==S)return!1}else if(S.operator==="<="&&!g.test(S.semver))return!1}if(!g.operator&&(S||h)&&w!==0)return!1}return!(h&&D&&!S&&w!==0||S&&O&&!h&&w!==0||_||P)},R=(i,u,m)=>{if(!i)return u;const L=s(i.semver,u.semver,m);return L>0?i:L<0||u.operator===">"&&i.operator===">="?u:i},e=(i,u,m)=>{if(!i)return u;const L=s(i.semver,u.semver,m);return L<0?i:L>0||u.operator==="<"&&i.operator==="<="?u:i};return He=E,He}var Ye,kr;function gt(){if(kr)return Ye;kr=1;const a=B(),l=x(),n=G(),t=Hr(),s=j(),E=Jr(),o=Kr(),p=Qr(),r=et(),R=rt(),e=tt(),i=st(),u=it(),m=F(),L=nt(),h=at(),S=ze(),w=ot(),M=ut(),y=Y(),D=Ze(),O=Yr(),P=Wr(),_=Je(),g=Ke(),X=zr(),Z=lt(),J=ct(),K=W(),Q=b(),ee=z(),re=ht(),te=Et(),f=ft(),c=mt(),$=Rt(),d=Qe(),N=vt(),v=$t(),I=dt(),A=It(),q=Lt();return Ye={parse:s,valid:E,clean:o,inc:p,diff:r,major:R,minor:e,patch:i,prerelease:u,compare:m,rcompare:L,compareLoose:h,compareBuild:S,sort:w,rsort:M,gt:y,lt:D,eq:O,neq:P,gte:_,lte:g,cmp:X,coerce:Z,truncate:J,Comparator:K,Range:Q,satisfies:ee,toComparators:re,maxSatisfying:te,minSatisfying:f,minVersion:c,validRange:$,outside:d,gtr:N,ltr:v,intersects:I,simplifyRange:A,subset:q,SemVer:n,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:l.SEMVER_SPEC_VERSION,RELEASE_TYPES:l.RELEASE_TYPES,compareIdentifiers:t.compareIdentifiers,rcompareIdentifiers:t.rcompareIdentifiers},Ye}var Nt=gt();const Ot=Zr(Nt);export{Kr as a,Jr as r,Nt as s,Ot as u};
@@ -0,0 +1,22 @@
1
+ import{createRequire as Pr}from"node:module";const Ir=Pr(import.meta.url),Et=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fr=t=>{if(typeof Et<"u"&&Et.versions&&Et.versions.node){const[e,r]=Et.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Et.getBuiltinModule(t)}return Ir(t)},{createRequire:B}=Fr("node:module"),ke=0,Gr=4,Ur=Symbol("findUpStop"),eu=/"(?:[^"\\]|\\.)*"|\/\/[^\r\n]*|\/\*[\s\S]*?\*\//g,jr=/^[A-Z]:\//i,$t=(t="")=>t&&t.replaceAll("\\","/").replace(jr,e=>e.toUpperCase()),zr=/^[/\\]{2}/,Wr=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,pr=/^[A-Z]:$/i,He=/^\/([A-Z]:)?$/i,qr=/.(\.[^./]+)$/,Xr=/^[/\\]|^[a-z]:[/\\]/i,Kr=/\/$/,Qr=()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/",ru="/",fr=(t,e)=>{let r="",o=0,n=-1,s=0,i;for(let u=0;u<=t.length;++u){if(u<t.length)i=t[u];else{if(i==="/")break;i="/"}if(i==="/"){if(!(n===u-1||s===1))if(s===2){if(r.length<2||o!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const a=r.lastIndexOf("/");a===-1?(r="",o=0):(r=r.slice(0,a),o=r.length-1-r.lastIndexOf("/")),n=u,s=0;continue}else if(r.length>0){r="",o=0,n=u,s=0;continue}}e&&(r+=r.length>0?"/..":"..",o=2)}else r.length>0?r+=`/${t.slice(n+1,u)}`:r=t.slice(n+1,u),o=u-n-1;n=u,s=0}else i==="."&&s!==-1?++s:s=-1}return r},bt=t=>Wr.test(t),ce=function(t){if(t.length===0)return".";t=$t(t);const e=zr.exec(t),r=bt(t),o=t.at(-1)==="/";return t=fr(t,!r),t.length===0?r?"/":o?"./":".":(o&&(t+="/"),pr.test(t)&&(t+="/"),e?r?`//${t}`:`//./${t}`:r&&!bt(t)?`/${t}`:t)},Zr=(...t)=>{let e="";for(const r of t)if(r)if(e.length>0){const o=e.at(-1)==="/",n=r[0]==="/";o&&n?e+=r.slice(1):e+=o||n?r:`/${r}`}else e+=r;return ce(e)},vt=function(...t){t=t.map(o=>$t(o));let e="",r=!1;for(let o=t.length-1;o>=-1&&!r;o--){const n=o>=0?t[o]:Qr();!n||n.length===0||(e=`${n}/${e}`,r=bt(n))}return e=fr(e,!r),r&&!bt(e)?`/${e}`:e.length>0?e:"."},su=function(t){return $t(t)},Vr=function(t){return qr.exec($t(t))?.[1]??""},ou=function(t,e){const r=vt(t).replace(He,"$1").split("/"),o=vt(e).replace(He,"$1").split("/");if(o[0][1]===":"&&r[0][1]===":"&&r[0]!==o[0])return o.join("/");const n=Math.min(r.length,o.length);let s=0;for(;s<n&&r[s]===o[s];)s+=1;const i=r.length-s;return[...Array.from({length:i}).fill(".."),...o.slice(s)].join("/")},Ce=t=>{const e=$t(t).replace(Kr,""),r=e.lastIndexOf("/");if(r===-1)return bt(t)?"/":".";const o=e.slice(0,r);return pr.test(o)?`${o}/`:o||(bt(t)?"/":".")},hr=(t,e)=>{const r=$t(t),o=r.slice(r.lastIndexOf("/")+1);if(e&&o.endsWith(e)){if(e===r)return"";const n=o.slice(0,-e.length);if(n.length>0)return n}return o},Yr=function(t){const e=Xr.exec(t)?.[0]?.replaceAll("\\","/")??"",r=hr(t),o=Vr(r);return{base:r,dir:Ce(t),ext:o,name:r.slice(0,r.length-o.length),root:e}},Jr=B(import.meta.url),At=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ts=t=>{if(typeof At<"u"&&At.versions&&At.versions.node){const[e,r]=At.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return At.getBuiltinModule(t)}return Jr(t)},{fileURLToPath:es}=ts("node:url");function rs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Be,Me;function ss(){return Me||(Me=1,Be=["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"]),Be}var os=ss();const ns=rs(os);new Set(ns);const is=/^(?:\.?\.[/\\]|\.\.\B)/,nu=t=>is.test(t)||t==="..",ct=t=>$t(t instanceof URL?es(t):t);let us=class extends Error{constructor(e){super(`EEXIST: ${e}`)}get code(){return"EEXIST"}set code(e){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(e){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const pt=t=>{if(!t||!(t instanceof URL)&&typeof t!="string")throw new TypeError("Path must be a non-empty string or URL.")},ls=B(import.meta.url),xt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,as=t=>{if(typeof xt<"u"&&xt.versions&&xt.versions.node){const[e,r]=xt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return xt.getBuiltinModule(t)}return ls(t)};as("node:fs/promises");const cs=B(import.meta.url),St=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ps=t=>{if(typeof St<"u"&&St.versions&&St.versions.node){const[e,r]=St.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return St.getBuiltinModule(t)}return cs(t)};ps("node:fs");const pe=t=>{if(t.isFile())return"file";if(t.isDirectory())return"dir";if(t.isSymbolicLink())return"symlink"},fs=B(import.meta.url),wt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hs=t=>{if(typeof wt<"u"&&wt.versions&&wt.versions.node){const[e,r]=wt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return wt.getBuiltinModule(t)}return fs(t)},{lstat:De,mkdir:gs}=hs("node:fs/promises"),uu=async t=>{pt(t);try{const e=await De(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(pe(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await gs(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const r=await De(t);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(pe(r))}'`,{cause:e})}},ds=B(import.meta.url),Tt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ys=t=>{if(typeof Tt<"u"&&Tt.versions&&Tt.versions.node){const[e,r]=Tt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Tt.getBuiltinModule(t)}return ds(t)},{lstatSync:Pe,mkdirSync:ms}=ys("node:fs"),lu=t=>{pt(t);try{const e=Pe(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(pe(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{ms(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const r=Pe(t);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(pe(r))}'`,{cause:e})}},bs=B(import.meta.url),Rt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$s=t=>{if(typeof Rt<"u"&&Rt.versions&&Rt.versions.node){const[e,r]=Rt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Rt.getBuiltinModule(t)}return bs(t)};$s("node:fs/promises");const vs=B(import.meta.url),_t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Es=t=>{if(typeof _t<"u"&&_t.versions&&_t.versions.node){const[e,r]=_t.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return _t.getBuiltinModule(t)}return vs(t)};Es("node:fs");const As=B(import.meta.url),kt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xs=t=>{if(typeof kt<"u"&&kt.versions&&kt.versions.node){const[e,r]=kt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return kt.getBuiltinModule(t)}return As(t)};xs("node:fs/promises");const Ss=B(import.meta.url),Ct=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ws=t=>{if(typeof Ct<"u"&&Ct.versions&&Ct.versions.node){const[e,r]=Ct.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ct.getBuiltinModule(t)}return Ss(t)};ws("node:fs");const Ts=B(import.meta.url),Ot=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rs=t=>{if(typeof Ot<"u"&&Ot.versions&&Ot.versions.node){const[e,r]=Ot.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ot.getBuiltinModule(t)}return Ts(t)};Rs("node:fs/promises");const _s=B(import.meta.url),Nt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ks=t=>{if(typeof Nt<"u"&&Nt.versions&&Nt.versions.node){const[e,r]=Nt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Nt.getBuiltinModule(t)}return _s(t)};ks("node:fs");B(import.meta.url);let Ie=class extends Error{root;constructor(e,r){super(`${e instanceof Error?e.message:String(e)} for path "${r}"`),this.cause=e,this.root=r}get name(){return"WalkError"}set name(e){throw new Error("Cannot overwrite name of WalkError")}};const Fe=t=>{const e=t.replace(/[$()+\\^]/g,String.raw`\$&`).replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`).replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");try{return new RegExp(`^${e}$`)}catch(r){throw new Error(`Invalid glob pattern: ${t}`,{cause:r})}};let Cs=class{name;path;#t;constructor(e,r,o){this.#t=e,this.name=r,this.path=o}isDirectory(){return this.#t.isDirectory()}isFile(){return this.#t.isFile()}isSymbolicLink(){return this.#t.isSymbolicLink()}};const Te=(t,e,r)=>new Cs(t,e,r),ae=(t,e,r,o)=>{if(Array.isArray(e)&&e.length>0&&!e.some(s=>t.endsWith(s)))return!1;const n=t.includes("\\")?t.replaceAll("\\","/"):t;return r&&!r.some(s=>s.test(n))?!1:!o?.some(s=>s.test(n))},Os=B(import.meta.url),Lt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ns=t=>{if(typeof Lt<"u"&&Lt.versions&&Lt.versions.node){const[e,r]=Lt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Lt.getBuiltinModule(t)}return Os(t)};Ns("node:fs/promises");const Ls=B(import.meta.url),Ht=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Hs=t=>{if(typeof Ht<"u"&&Ht.versions&&Ht.versions.node){const[e,r]=Ht.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ht.getBuiltinModule(t)}return Ls(t)},{readdirSync:Bs,realpathSync:Ms,statSync:gr}=Hs("node:fs"),Ds=t=>{const e=ce(t),r=gr(e);return Te(r,hr(e),e)};function*Ps(t,e={}){const{extensions:r,followSymlinks:o=!1,includeDirs:n=!0,includeFiles:s=!0,includeSymlinks:i=!0,match:u,maxDepth:a=Number.POSITIVE_INFINITY,skip:m}=e;if(pt(t),a<0)return;const h=e.visited??new Set,y=u?u.map(g=>typeof g=="string"?Fe(g):g):void 0,A=m?m.map(g=>typeof g=="string"?Fe(g):g):void 0;if(t=vt(ct(t)),n&&ae(t,r,y,A)&&(yield Ds(t)),!(a<1||!ae(t,void 0,void 0,A)))try{const g=Bs(t,{withFileTypes:!0});for(const $ of g){let _=Zr(t,$.name),R=$.isDirectory(),L=$.isFile();if($.isSymbolicLink())if(o){const H=Ms(_);if(h.has(H))continue;_=H;const d=gr(H);R=d.isDirectory(),L=d.isFile()}else if(i&&ae(_,r,y,A)){yield Te($,$.name,ce(_));continue}else continue;R?(o&&h.add(_),yield*Ps(_,{extensions:r,followSymlinks:o,includeDirs:n,includeFiles:s,includeSymlinks:i,match:y,maxDepth:a-1,skip:A,visited:h})):L&&s&&ae(_,r,y,A)&&(yield Te($,$.name,ce(_)))}}catch(g){throw g instanceof Ie?g:new Ie(g,t)}}const Is=B(import.meta.url),Bt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fs=t=>{if(typeof Bt<"u"&&Bt.versions&&Bt.versions.node){const[e,r]=Bt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Bt.getBuiltinModule(t)}return Is(t)};Fs("node:fs/promises");const Gs=B(import.meta.url),Mt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Us=t=>{if(typeof Mt<"u"&&Mt.versions&&Mt.versions.node){const[e,r]=Mt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Mt.getBuiltinModule(t)}return Gs(t)},{statSync:js,lstatSync:zs}=Us("node:fs"),pu=(t,e={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=e.cwd?ct(e.cwd):process.cwd();let o=vt(r);const{root:n}=Yr(o),s=ct(e.stopAt??n),i=vt(o,s),u=e.type??"file",a=function(h){return typeof t=="function"?[t(h)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]};e.allowSymlinks??=!0;const m=e.allowSymlinks?js:zs;for(;o&&o!==i&&o!==n;){for(let h of a(o)){if(h===Ur)return;if(h===void 0)continue;Buffer.isBuffer(h)?h=h.toString():h instanceof URL&&(h=ct(h));const y=bt(h)?h:vt(o,h);try{const A=m(y);if(u==="file"&&A.isFile()||u==="directory"&&A.isDirectory())return y}catch{}}o=Ce(o)}};function Oe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ge={},de,Ue;function fe(){if(Ue)return de;Ue=1;const t="[^\\\\/]",e=Symbol("unignore"),r="\\.",o="\\+",n="\\?",s="\\/",i="(?=.)",u="[^/]",a=`(?:${s}|$)`,m=`(?:^|${s})`,h=`${r}{1,2}${a}`,y=`(?!${r})`,A=`(?!${m}${h})`,g=`(?!${r}{0,1}${a})`,$=`(?!${h})`,_=`[^.${s}]`,R=`${u}*?`,L="/",H={DOT_LITERAL:r,PLUS_LITERAL:o,QMARK_LITERAL:n,SLASH_LITERAL:s,ONE_CHAR:i,QMARK:u,END_ANCHOR:a,DOTS_SLASH:h,NO_DOT:y,NO_DOTS:A,NO_DOT_SLASH:g,NO_DOTS_SLASH:$,QMARK_NO_DOT:_,STAR:R,START_ANCHOR:m,SEP:L},d={...H,SLASH_LITERAL:"[\\\\/]",QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},E={__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 de={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:E,UNIGNORE:e,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(l){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${l.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(l){return l===!0?d:H}},de}var je;function he(){return je||(je=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:n}=fe();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>o.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(n,"\\$1"),t.toPosixSlashes=s=>s.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(r,i=>i==="\\"?"":i),t.escapeLast=(s,i,u)=>{const a=s.lastIndexOf(i,u);return a===-1?s:s[a-1]==="\\"?t.escapeLast(s,i,a-1):`${s.slice(0,a)}\\${s.slice(a)}`},t.removePrefix=(s,i={})=>{let u=s;return u.startsWith("./")&&(u=u.slice(2),i.prefix="./"),u},t.wrapOutput=(s,i={},u={})=>{const a=u.contains?"":"^",m=u.contains?"":"$";let h=`${a}(?:${s})${m}`;return i.negated===!0&&(h=`(?:^(?!${h}).*$)`),h},t.basename=(s,{windows:i}={})=>{const u=s.split(i?/[\\/]/:"/"),a=u[u.length-1];return a===""?u[u.length-2]:a}})(Ge)),Ge}var ye,ze;function Ws(){if(ze)return ye;ze=1;const t=he(),{CHAR_ASTERISK:e,CHAR_AT:r,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:n,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:a,CHAR_LEFT_PARENTHESES:m,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:y,CHAR_QUESTION_MARK:A,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:$,CHAR_RIGHT_SQUARE_BRACKET:_}=fe(),R=H=>H===u||H===o,L=H=>{H.isPrefix!==!0&&(H.depth=H.isGlobstar?1/0:1)};return ye=(H,d)=>{const E=d||{},l=H.length-1,T=E.parts===!0||E.scanToEnd===!0,C=[],S=[],w=[];let x=H,D=-1,G=0,J=0,at=!1,tt=!1,q=!1,et=!1,ft=!1,ot=!1,rt=!1,z=!1,nt=!1,Q=!1,ht=0,Z,k,P={value:"",depth:0,isGlob:!1};const K=()=>D>=l,f=()=>x.charCodeAt(D+1),U=()=>(Z=k,x.charCodeAt(++D));for(;D<l;){k=U();let V;if(k===o){rt=P.backslashes=!0,k=U(),k===a&&(ot=!0);continue}if(ot===!0||k===a){for(ht++;K()!==!0&&(k=U());){if(k===o){rt=P.backslashes=!0,U();continue}if(k===a){ht++;continue}if(ot!==!0&&k===s&&(k=U())===s){if(at=P.isBrace=!0,q=P.isGlob=!0,Q=!0,T===!0)continue;break}if(ot!==!0&&k===n){if(at=P.isBrace=!0,q=P.isGlob=!0,Q=!0,T===!0)continue;break}if(k===g&&(ht--,ht===0)){ot=!1,at=P.isBrace=!0,Q=!0;break}}if(T===!0)continue;break}if(k===u){if(C.push(D),S.push(P),P={value:"",depth:0,isGlob:!1},Q===!0)continue;if(Z===s&&D===G+1){G+=2;continue}J=D+1;continue}if(E.noext!==!0&&(k===y||k===r||k===e||k===A||k===i)&&f()===m){if(q=P.isGlob=!0,et=P.isExtglob=!0,Q=!0,k===i&&D===G&&(nt=!0),T===!0){for(;K()!==!0&&(k=U());){if(k===o){rt=P.backslashes=!0,k=U();continue}if(k===$){q=P.isGlob=!0,Q=!0;break}}continue}break}if(k===e){if(Z===e&&(ft=P.isGlobstar=!0),q=P.isGlob=!0,Q=!0,T===!0)continue;break}if(k===A){if(q=P.isGlob=!0,Q=!0,T===!0)continue;break}if(k===h){for(;K()!==!0&&(V=U());){if(V===o){rt=P.backslashes=!0,U();continue}if(V===_){tt=P.isBracket=!0,q=P.isGlob=!0,Q=!0;break}}if(T===!0)continue;break}if(E.nonegate!==!0&&k===i&&D===G){z=P.negated=!0,G++;continue}if(E.noparen!==!0&&k===m){if(q=P.isGlob=!0,T===!0){for(;K()!==!0&&(k=U());){if(k===m){rt=P.backslashes=!0,k=U();continue}if(k===$){Q=!0;break}}continue}break}if(q===!0){if(Q=!0,T===!0)continue;break}}E.noext===!0&&(et=!1,q=!1);let F=x,gt="",c="";G>0&&(gt=x.slice(0,G),x=x.slice(G),J-=G),F&&q===!0&&J>0?(F=x.slice(0,J),c=x.slice(J)):q===!0?(F="",c=x):F=x,F&&F!==""&&F!=="/"&&F!==x&&R(F.charCodeAt(F.length-1))&&(F=F.slice(0,-1)),E.unescape===!0&&(c&&(c=t.removeBackslashes(c)),F&&rt===!0&&(F=t.removeBackslashes(F)));const p={prefix:gt,input:H,start:G,base:F,glob:c,isBrace:at,isBracket:tt,isGlob:q,isExtglob:et,isGlobstar:ft,negated:z,negatedExtglob:nt};if(E.tokens===!0&&(p.maxDepth=0,R(k)||S.push(P),p.tokens=S),E.parts===!0||E.tokens===!0){let V;for(let M=0;M<C.length;M++){const st=V?V+1:G,it=C[M],Y=H.slice(st,it);E.tokens&&(M===0&&G!==0?(S[M].isPrefix=!0,S[M].value=gt):S[M].value=Y,L(S[M]),p.maxDepth+=S[M].depth),(M!==0||Y!=="")&&w.push(Y),V=it}if(V&&V+1<H.length){const M=H.slice(V+1);w.push(M),E.tokens&&(S[S.length-1].value=M,L(S[S.length-1]),p.maxDepth+=S[S.length-1].depth)}p.slashes=C,p.parts=w}return p},ye}var me,We;function qs(){if(We)return me;We=1;const t=fe(),e=he(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:i}=t,u=(d,E)=>typeof E.expandRange=="function"?E.expandRange(...d,E):(d.sort(),`[${d.join("-")}]`),a=(d,E)=>`Missing ${d}: "${E}" - use "\\\\${E}" to match literal characters`,m=d=>{const E=[];let l=0,T=0,C=0,S="",w=!1;for(const x of d){if(w===!0){S+=x,w=!1;continue}if(x==="\\"){S+=x,w=!0;continue}if(x==='"'){C=C===1?0:1,S+=x;continue}if(C===0){if(x==="[")l++;else if(x==="]"&&l>0)l--;else if(l===0){if(x==="(")T++;else if(x===")"&&T>0)T--;else if(x==="|"&&T===0){E.push(S),S="";continue}}}S+=x}return E.push(S),E},h=d=>{let E=!1;for(const l of d){if(E===!0){E=!1;continue}if(l==="\\"){E=!0;continue}if(/[?*+@!()[\]{}]/.test(l))return!1}return!0},y=d=>{let E=d.trim(),l=!0;for(;l===!0;)l=!1,/^@\([^\\()[\]{}|]+\)$/.test(E)&&(E=E.slice(2,-1),l=!0);if(h(E))return E.replace(/\\(.)/g,"$1")},A=d=>{const E=d.map(y).filter(Boolean);for(let l=0;l<E.length;l++)for(let T=l+1;T<E.length;T++){const C=E[l],S=E[T],w=C[0];if(!(!w||C!==w.repeat(C.length)||S!==w.repeat(S.length))&&(C===S||C.startsWith(S)||S.startsWith(C)))return!0}return!1},g=(d,E=!0)=>{if(d[0]!=="+"&&d[0]!=="*"||d[1]!=="(")return;let l=0,T=0,C=0,S=!1;for(let w=1;w<d.length;w++){const x=d[w];if(S===!0){S=!1;continue}if(x==="\\"){S=!0;continue}if(x==='"'){C=C===1?0:1;continue}if(C!==1){if(x==="["){l++;continue}if(x==="]"&&l>0){l--;continue}if(!(l>0)){if(x==="("){T++;continue}if(x===")"&&(T--,T===0))return E===!0&&w!==d.length-1?void 0:{type:d[0],body:d.slice(2,w),end:w}}}}},$=d=>`${d.length===1?e.escapeRegex(d[0]):`[${d.map(E=>e.escapeRegex(E)).join("")}]`}*`,_=d=>{let E=0;const l=[];for(;E<d.length;){const T=g(d.slice(E),!1);if(!T||T.type!=="*")return;const C=m(T.body).map(w=>w.trim());if(C.length!==1)return;const S=y(C[0]);if(!S||S.length!==1)return;l.push(S),E+=T.end+1}if(!(l.length<1))return l},R=d=>{let E=0,l=d.trim(),T=g(l);for(;T;)E++,l=T.body.trim(),T=g(l);return E},L=(d,E)=>{if(E.maxExtglobRecursion===!1)return{risky:!1};const l=typeof E.maxExtglobRecursion=="number"?E.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,T=m(d).map(x=>x.trim());if(T.length>1&&(T.some(x=>x==="")||T.some(x=>/^[*?]+$/.test(x))||A(T)))return{risky:!0};const C=[];let S=!1,w=!0;for(const x of T){const D=_(x);if(D){S=!0,C.push(...D);continue}const G=y(x);if(G&&G.length===1){C.push(G);continue}if(w=!1,R(x)>l)return{risky:!0}}return S?w?{risky:!0,safeOutput:$([...new Set(C)])}:{risky:!0}:{risky:!1}},H=(d,E)=>{if(typeof d!="string")throw new TypeError("Expected a string");d=i[d]||d;const l={...E},T=typeof l.maxLength=="number"?Math.min(r,l.maxLength):r;let C=d.length;if(C>T)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${T}`);const S={type:"bos",value:"",output:l.prepend||""},w=[S],x=l.capture?"":"?:",D=t.globChars(l.windows),G=t.extglobChars(D),{DOT_LITERAL:J,PLUS_LITERAL:at,SLASH_LITERAL:tt,ONE_CHAR:q,DOTS_SLASH:et,NO_DOT:ft,NO_DOT_SLASH:ot,NO_DOTS_SLASH:rt,QMARK:z,QMARK_NO_DOT:nt,STAR:Q,START_ANCHOR:ht}=D,Z=v=>`(${x}(?:(?!${ht}${v.dot?et:J}).)*?)`,k=l.dot?"":ft,P=l.dot?z:nt;let K=l.bash===!0?Z(l):Q;l.capture&&(K=`(${K})`),typeof l.noext=="boolean"&&(l.noextglob=l.noext);const f={input:d,index:-1,start:0,dot:l.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:w};d=e.removePrefix(d,f),C=d.length;const U=[],F=[],gt=[];let c=S,p;const V=()=>f.index===C-1,M=f.peek=(v=1)=>d[f.index+v],st=f.advance=()=>d[++f.index]||"",it=()=>d.slice(f.index+1),Y=(v="",j=0)=>{f.consumed+=v,f.index+=j},ie=v=>{f.output+=v.output!=null?v.output:v.value,Y(v.value)},Mr=()=>{let v=1;for(;M()==="!"&&(M(2)!=="("||M(3)==="?");)st(),f.start++,v++;return v%2===0?!1:(f.negated=!0,f.start++,!0)},ue=v=>{f[v]++,gt.push(v)},dt=v=>{f[v]--,gt.pop()},O=v=>{if(c.type==="globstar"){const j=f.braces>0&&(v.type==="comma"||v.type==="brace"),b=v.extglob===!0||U.length&&(v.type==="pipe"||v.type==="paren");v.type!=="slash"&&v.type!=="paren"&&!j&&!b&&(f.output=f.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=K,f.output+=c.output)}if(U.length&&v.type!=="paren"&&(U[U.length-1].inner+=v.value),(v.value||v.output)&&ie(v),c&&c.type==="text"&&v.type==="text"){c.output=(c.output||c.value)+v.value,c.value+=v.value;return}v.prev=c,w.push(v),c=v},le=(v,j)=>{const b={...G[j],conditions:1,inner:""};b.prev=c,b.parens=f.parens,b.output=f.output,b.startIndex=f.index,b.tokensIndex=w.length;const N=(l.capture?"(":"")+b.open;ue("parens"),O({type:v,value:j,output:f.output?"":q}),O({type:"paren",extglob:!0,value:st(),output:N}),U.push(b)},Dr=v=>{const j=d.slice(v.startIndex,f.index+1),b=d.slice(v.startIndex+2,f.index),N=L(b,l);if((v.type==="plus"||v.type==="star")&&N.risky){const I=N.safeOutput?(v.output?"":q)+(l.capture?`(${N.safeOutput})`:N.safeOutput):void 0,ut=w[v.tokensIndex];ut.type="text",ut.value=j,ut.output=I||e.escapeRegex(j);for(let lt=v.tokensIndex+1;lt<w.length;lt++)w[lt].value="",w[lt].output="",delete w[lt].suffix;f.output=v.output+ut.output,f.backtrack=!0,O({type:"paren",extglob:!0,value:p,output:""}),dt("parens");return}let W=v.close+(l.capture?")":""),X;if(v.type==="negate"){let I=K;if(v.inner&&v.inner.length>1&&v.inner.includes("/")&&(I=Z(l)),(I!==K||V()||/^\)+$/.test(it()))&&(W=v.close=`)$))${I}`),v.inner.includes("*")&&(X=it())&&/^\.[^\\/.]+$/.test(X)){const ut=H(X,{...E,fastpaths:!1}).output;W=v.close=`)${ut})${I})`}v.prev.type==="bos"&&(f.negatedExtglob=!0)}O({type:"paren",extglob:!0,value:p,output:W}),dt("parens")};if(l.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(d)){let v=!1,j=d.replace(s,(b,N,W,X,I,ut)=>X==="\\"?(v=!0,b):X==="?"?N?N+X+(I?z.repeat(I.length):""):ut===0?P+(I?z.repeat(I.length):""):z.repeat(W.length):X==="."?J.repeat(W.length):X==="*"?N?N+X+(I?K:""):K:N?b:`\\${b}`);return v===!0&&(l.unescape===!0?j=j.replace(/\\/g,""):j=j.replace(/\\+/g,b=>b.length%2===0?"\\\\":b?"\\":"")),j===d&&l.contains===!0?(f.output=d,f):(f.output=e.wrapOutput(j,f,E),f)}for(;!V();){if(p=st(),p==="\0")continue;if(p==="\\"){const b=M();if(b==="/"&&l.bash!==!0||b==="."||b===";")continue;if(!b){p+="\\",O({type:"text",value:p});continue}const N=/^\\+/.exec(it());let W=0;if(N&&N[0].length>2&&(W=N[0].length,f.index+=W,W%2!==0&&(p+="\\")),l.unescape===!0?p=st():p+=st(),f.brackets===0){O({type:"text",value:p});continue}}if(f.brackets>0&&(p!=="]"||c.value==="["||c.value==="[^")){if(l.posix!==!1&&p===":"){const b=c.value.slice(1);if(b.includes("[")&&(c.posix=!0,b.includes(":"))){const N=c.value.lastIndexOf("["),W=c.value.slice(0,N),X=c.value.slice(N+2),I=o[X];if(I){c.value=W+I,f.backtrack=!0,st(),!S.output&&w.indexOf(c)===1&&(S.output=q);continue}}}(p==="["&&M()!==":"||p==="-"&&M()==="]")&&(p=`\\${p}`),p==="]"&&(c.value==="["||c.value==="[^")&&(p=`\\${p}`),l.posix===!0&&p==="!"&&c.value==="["&&(p="^"),c.value+=p,ie({value:p});continue}if(f.quotes===1&&p!=='"'){p=e.escapeRegex(p),c.value+=p,ie({value:p});continue}if(p==='"'){f.quotes=f.quotes===1?0:1,l.keepQuotes===!0&&O({type:"text",value:p});continue}if(p==="("){ue("parens"),O({type:"paren",value:p});continue}if(p===")"){if(f.parens===0&&l.strictBrackets===!0)throw new SyntaxError(a("opening","("));const b=U[U.length-1];if(b&&f.parens===b.parens+1){Dr(U.pop());continue}O({type:"paren",value:p,output:f.parens?")":"\\)"}),dt("parens");continue}if(p==="["){if(l.nobracket===!0||!it().includes("]")){if(l.nobracket!==!0&&l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));p=`\\${p}`}else ue("brackets");O({type:"bracket",value:p});continue}if(p==="]"){if(l.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){O({type:"text",value:p,output:`\\${p}`});continue}if(f.brackets===0){if(l.strictBrackets===!0)throw new SyntaxError(a("opening","["));O({type:"text",value:p,output:`\\${p}`});continue}dt("brackets");const b=c.value.slice(1);if(c.posix!==!0&&b[0]==="^"&&!b.includes("/")&&(p=`/${p}`),c.value+=p,ie({value:p}),l.literalBrackets===!1||e.hasRegexChars(b))continue;const N=e.escapeRegex(c.value);if(f.output=f.output.slice(0,-c.value.length),l.literalBrackets===!0){f.output+=N,c.value=N;continue}c.value=`(${x}${N}|${c.value})`,f.output+=c.value;continue}if(p==="{"&&l.nobrace!==!0){ue("braces");const b={type:"brace",value:p,output:"(",outputIndex:f.output.length,tokensIndex:f.tokens.length};F.push(b),O(b);continue}if(p==="}"){const b=F[F.length-1];if(l.nobrace===!0||!b){O({type:"text",value:p,output:p});continue}let N=")";if(b.dots===!0){const W=w.slice(),X=[];for(let I=W.length-1;I>=0&&(w.pop(),W[I].type!=="brace");I--)W[I].type!=="dots"&&X.unshift(W[I].value);N=u(X,l),f.backtrack=!0}if(b.comma!==!0&&b.dots!==!0){const W=f.output.slice(0,b.outputIndex),X=f.tokens.slice(b.tokensIndex);b.value=b.output="\\{",p=N="\\}",f.output=W;for(const I of X)f.output+=I.output||I.value}O({type:"brace",value:p,output:N}),dt("braces"),F.pop();continue}if(p==="|"){U.length>0&&U[U.length-1].conditions++,O({type:"text",value:p});continue}if(p===","){let b=p;const N=F[F.length-1];N&&gt[gt.length-1]==="braces"&&(N.comma=!0,b="|"),O({type:"comma",value:p,output:b});continue}if(p==="/"){if(c.type==="dot"&&f.index===f.start+1){f.start=f.index+1,f.consumed="",f.output="",w.pop(),c=S;continue}O({type:"slash",value:p,output:tt});continue}if(p==="."){if(f.braces>0&&c.type==="dot"){c.value==="."&&(c.output=J);const b=F[F.length-1];c.type="dots",c.output+=p,c.value+=p,b.dots=!0;continue}if(f.braces+f.parens===0&&c.type!=="bos"&&c.type!=="slash"){O({type:"text",value:p,output:J});continue}O({type:"dot",value:p,output:J});continue}if(p==="?"){if(!(c&&c.value==="(")&&l.noextglob!==!0&&M()==="("&&M(2)!=="?"){le("qmark",p);continue}if(c&&c.type==="paren"){const b=M();let N=p;(c.value==="("&&!/[!=<:]/.test(b)||b==="<"&&!/<([!=]|\w+>)/.test(it()))&&(N=`\\${p}`),O({type:"text",value:p,output:N});continue}if(l.dot!==!0&&(c.type==="slash"||c.type==="bos")){O({type:"qmark",value:p,output:nt});continue}O({type:"qmark",value:p,output:z});continue}if(p==="!"){if(l.noextglob!==!0&&M()==="("&&(M(2)!=="?"||!/[!=<:]/.test(M(3)))){le("negate",p);continue}if(l.nonegate!==!0&&f.index===0){Mr();continue}}if(p==="+"){if(l.noextglob!==!0&&M()==="("&&M(2)!=="?"){le("plus",p);continue}if(c&&c.value==="("||l.regex===!1){O({type:"plus",value:p,output:at});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||f.parens>0){O({type:"plus",value:p});continue}O({type:"plus",value:at});continue}if(p==="@"){if(l.noextglob!==!0&&M()==="("&&M(2)!=="?"){O({type:"at",extglob:!0,value:p,output:""});continue}O({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);const b=n.exec(it());b&&(p+=b[0],f.index+=b[0].length),O({type:"text",value:p});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=p,c.output=K,f.backtrack=!0,f.globstar=!0,Y(p);continue}let v=it();if(l.noextglob!==!0&&/^\([^?]/.test(v)){le("star",p);continue}if(c.type==="star"){if(l.noglobstar===!0){Y(p);continue}const b=c.prev,N=b.prev,W=b.type==="slash"||b.type==="bos",X=N&&(N.type==="star"||N.type==="globstar");if(l.bash===!0&&(!W||v[0]&&v[0]!=="/")){O({type:"star",value:p,output:""});continue}const I=f.braces>0&&(b.type==="comma"||b.type==="brace"),ut=U.length&&(b.type==="pipe"||b.type==="paren");if(!W&&b.type!=="paren"&&!I&&!ut){O({type:"star",value:p,output:""});continue}for(;v.slice(0,3)==="/**";){const lt=d[f.index+4];if(lt&&lt!=="/")break;v=v.slice(3),Y("/**",3)}if(b.type==="bos"&&V()){c.type="globstar",c.value+=p,c.output=Z(l),f.output=c.output,f.globstar=!0,Y(p);continue}if(b.type==="slash"&&b.prev.type!=="bos"&&!X&&V()){f.output=f.output.slice(0,-(b.output+c.output).length),b.output=`(?:${b.output}`,c.type="globstar",c.output=Z(l)+(l.strictSlashes?")":"|$)"),c.value+=p,f.globstar=!0,f.output+=b.output+c.output,Y(p);continue}if(b.type==="slash"&&b.prev.type!=="bos"&&v[0]==="/"){const lt=v[1]!==void 0?"|$":"";f.output=f.output.slice(0,-(b.output+c.output).length),b.output=`(?:${b.output}`,c.type="globstar",c.output=`${Z(l)}${tt}|${tt}${lt})`,c.value+=p,f.output+=b.output+c.output,f.globstar=!0,Y(p+st()),O({type:"slash",value:"/",output:""});continue}if(b.type==="bos"&&v[0]==="/"){c.type="globstar",c.value+=p,c.output=`(?:^|${tt}|${Z(l)}${tt})`,f.output=c.output,f.globstar=!0,Y(p+st()),O({type:"slash",value:"/",output:""});continue}if(I&&v[0]==="/"){c.type="globstar",c.value+=p,c.output=`(?:^|${tt}|${Z(l)}${tt})`,f.output+=c.output,f.globstar=!0,Y(p+st()),O({type:"slash",value:"/",output:""});continue}f.output=f.output.slice(0,-c.output.length),c.type="globstar",c.output=Z(l),c.value+=p,f.output+=c.output,f.globstar=!0,Y(p);continue}const j={type:"star",value:p,output:K};if(l.bash===!0){j.output=".*?",(c.type==="bos"||c.type==="slash")&&(j.output=k+j.output),O(j);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&l.regex===!0){j.output=p,O(j);continue}(f.index===f.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(f.output+=ot,c.output+=ot):l.dot===!0?(f.output+=rt,c.output+=rt):(f.output+=k,c.output+=k),M()!=="*"&&(f.output+=q,c.output+=q)),O(j)}for(;f.brackets>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));f.output=e.escapeLast(f.output,"["),dt("brackets")}for(;f.parens>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing",")"));f.output=e.escapeLast(f.output,"("),dt("parens")}for(;f.braces>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","}"));f.output=e.escapeLast(f.output,"{"),dt("braces")}if(l.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&O({type:"maybe_slash",value:"",output:`${tt}?`}),f.backtrack===!0){f.output="";for(const v of f.tokens)f.output+=v.output!=null?v.output:v.value,v.suffix&&(f.output+=v.suffix)}return f};return H.fastpaths=(d,E)=>{const l={...E},T=typeof l.maxLength=="number"?Math.min(r,l.maxLength):r,C=d.length;if(C>T)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${T}`);d=i[d]||d;const{DOT_LITERAL:S,SLASH_LITERAL:w,ONE_CHAR:x,DOTS_SLASH:D,NO_DOT:G,NO_DOTS:J,NO_DOTS_SLASH:at,STAR:tt,START_ANCHOR:q}=t.globChars(l.windows),et=l.dot?J:G,ft=l.dot?at:G,ot=l.capture?"":"?:",rt={negated:!1,prefix:""};let z=l.bash===!0?".*?":tt;l.capture&&(z=`(${z})`);const nt=k=>k.noglobstar===!0?z:`(${ot}(?:(?!${q}${k.dot?D:S}).)*?)`,Q=k=>{switch(k){case"*":return`${et}${x}${z}`;case".*":return`${S}${x}${z}`;case"*.*":return`${et}${z}${S}${x}${z}`;case"*/*":return`${et}${z}${w}${x}${ft}${z}`;case"**":return et+nt(l);case"**/*":return`(?:${et}${nt(l)}${w})?${ft}${x}${z}`;case"**/*.*":return`(?:${et}${nt(l)}${w})?${ft}${z}${S}${x}${z}`;case"**/.*":return`(?:${et}${nt(l)}${w})?${S}${x}${z}`;default:{const P=/^(.*?)\.(\w+)$/.exec(k);if(!P)return;const K=Q(P[1]);return K?K+S+P[2]:void 0}}},ht=e.removePrefix(d,rt);let Z=Q(ht);return Z&&l.strictSlashes!==!0&&(Z+=`${w}?`),Z},me=H,me}var be,qe;function Xs(){if(qe)return be;qe=1;const t=Ws(),e=qs(),r=he(),o=fe(),n=i=>i&&typeof i=="object"&&!Array.isArray(i),s=(i,u,a=!1)=>{if(Array.isArray(i)){const R=i.map(L=>s(L,u,a));return L=>{for(const H of R){const d=H(L);if(d)return d}return!1}}const m=n(i)&&i.tokens&&i.input;if(i===""||typeof i!="string"&&!m)throw new TypeError("Expected pattern to be a non-empty string");const h=u||{},y=h.windows,A=m?s.compileRe(i,u):s.makeRe(i,u,!1,!0),g=A.state;delete A.state;let $=()=>!1;if(h.ignore){const R={...u,ignore:null,onMatch:null,onResult:null};$=s(h.ignore,R,a)}const _=(R,L=!1)=>{const{isMatch:H,match:d,output:E}=s.test(R,A,u,{glob:i,posix:y}),l={glob:i,state:g,regex:A,posix:y,input:R,output:E,match:d,isMatch:H};if(typeof h.onResult=="function"&&h.onResult(l),H===!1)return l.isMatch=!1,L?l:!1;t:if($(R)){if(typeof h.onIgnore=="function"&&h.onIgnore(l)===o.UNIGNORE){l.isMatch=!0;break t}return l.isMatch=!1,L?l:!1}return typeof h.onMatch=="function"&&h.onMatch(l),L?l:!0};return a&&(_.state=g),_};return s.test=(i,u,a,{glob:m,posix:h}={})=>{if(typeof i!="string")throw new TypeError("Expected input to be a string");if(i==="")return{isMatch:!1,output:""};const y=a||{},A=y.format||(h?r.toPosixSlashes:null);let g=i===m,$=g&&A?A(i):i;return g===!1&&($=A?A(i):i,g=$===m),(g===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?g=s.matchBase(i,u,a,h):g=u.exec($)),{isMatch:!!g,match:g,output:$}},s.matchBase=(i,u,a,m=a&&a.windows)=>(u instanceof RegExp?u:s.makeRe(u,a)).test(r.basename(i,{windows:m})),s.isMatch=(i,u,a)=>s(u,a)(i),s.parse=(i,u)=>Array.isArray(i)?i.map(a=>s.parse(a,u)):e(i,{...u,fastpaths:!1}),s.scan=(i,u)=>t(i,u),s.compileRe=(i,u,a=!1,m=!1)=>{if(a===!0)return i.output;const h=u||{},y=h.contains?"":"^",A=h.contains?"":"$";let g=`${y}(?:${i.output})${A}`;i&&i.negated===!0&&(g=`^(?!${g}).*$`);const $=s.toRegex(g,u);return m===!0&&($.state=i),$},s.makeRe=(i,u={},a=!1,m=!1)=>{if(!i||typeof i!="string")throw new TypeError("Expected a non-empty string");let h={negated:!1,fastpaths:!0};return u.fastpaths!==!1&&(i[0]==="."||i[0]==="*")&&(h.output=e.fastpaths(i,u)),h.output||(h=e(i,u)),s.compileRe(h,u,a,m)},s.toRegex=(i,u)=>{try{const a=u||{};return new RegExp(i,a.flags||(a.nocase?"i":""))}catch(a){if(u&&u.debug===!0)throw a;return/$^/}},s.constants=o,be=s,be}var $e,Xe;function Ks(){if(Xe)return $e;Xe=1;const t=Xs(),e=he();function r(o,n,s=!1){return n&&(n.windows===null||n.windows===void 0)&&(n={...n,windows:e.isWindows()}),t(o,n,s)}return Object.assign(r,t),$e=r,$e}var Qs=Ks();const yt=Oe(Qs),Zs=B(import.meta.url),Dt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,oe=t=>{if(typeof Dt<"u"&&Dt.versions&&Dt.versions.node){const[e,r]=Dt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Dt.getBuiltinModule(t)}return Zs(t)},Ke=oe("fs"),Vs={...Ke,default:Ke},{statSync:Ys,stat:Js,realpathSync:to,realpath:eo,readdirSync:ro,readdir:so}=oe("fs"),{sep:dr,basename:oo,dirname:Re,resolve:yr,normalize:no,relative:io,posix:mt,isAbsolute:uo}=oe("path"),{fileURLToPath:lo}=oe("url"),{createRequire:ao}=oe("module");var Qe=ao(import.meta.url);function co(t){let e=no(t);return e.length>1&&e[e.length-1]===dr&&(e=e.substring(0,e.length-1)),e}const po=/[\\/]/g;function mr(t,e){return t.replace(po,e)}const fo=/^[a-z]:[\\/]$/i;function ho(t){return t==="/"||fo.test(t)}function ve(t,e){const{resolvePaths:r,normalizePath:o,pathSeparator:n}=e,s=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=yr(t)),(o||s)&&(t=co(t)),t===".")return"";const i=t[t.length-1]!==n;return mr(i?t+n:t,n)}function br(t,e){return e+t}function go(t,e){return function(r,o){return o.startsWith(t)?o.slice(t.length)+r:mr(io(t,o),e.pathSeparator)+e.pathSeparator+r}}function yo(t){return t}function mo(t,e,r){return e+t+r}function bo(t,e){const{relativePaths:r,includeBasePath:o}=e;return r&&t?go(t,e):o?br:yo}function $o(t){return function(e,r){r.push(e.substring(t.length)||".")}}function vo(t){return function(e,r,o){const n=e.substring(t.length)||".";o.every(s=>s(n,!0))&&r.push(n)}}const Eo=(t,e)=>{e.push(t||".")},Ao=(t,e,r)=>{const o=t||".";r.every(n=>n(o,!0))&&e.push(o)},xo=()=>{};function So(t,e){const{includeDirs:r,filters:o,relativePaths:n}=e;return r?n?o&&o.length?vo(t):$o(t):o&&o.length?Ao:Eo:xo}const wo=(t,e,r,o)=>{o.every(n=>n(t,!1))&&r.files++},To=(t,e,r,o)=>{o.every(n=>n(t,!1))&&e.push(t)},Ro=(t,e,r,o)=>{r.files++},_o=(t,e)=>{e.push(t)},ko=()=>{};function Co(t){const{excludeFiles:e,filters:r,onlyCounts:o}=t;return e?ko:r&&r.length?o?wo:To:o?Ro:_o}const Oo=t=>t,No=()=>[""].slice(0,0);function Lo(t){return t.group?No:Oo}const Ho=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},Bo=()=>{};function Mo(t){return t.group?Ho:Bo}const Do=function(t,e,r){const{queue:o,fs:n,options:{suppressErrors:s}}=e;o.enqueue(),n.realpath(t,(i,u)=>{if(i)return o.dequeue(s?null:i,e);n.stat(u,(a,m)=>{if(a)return o.dequeue(s?null:a,e);if(m.isDirectory()&&$r(t,u,e))return o.dequeue(null,e);r(m,u),o.dequeue(null,e)})})},Po=function(t,e,r){const{queue:o,fs:n,options:{suppressErrors:s}}=e;o.enqueue();try{const i=n.realpathSync(t),u=n.statSync(i);if(u.isDirectory()&&$r(t,i,e))return;r(u,i)}catch(i){if(!s)throw i}};function Io(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Po:Do}function $r(t,e,r){if(r.options.useRealPaths)return Fo(e,r);let o=Re(t),n=1;for(;o!==r.root&&n<2;){const s=r.symlinks.get(o);s&&(s===e||s.startsWith(e)||e.startsWith(s))?n++:o=Re(o)}return r.symlinks.set(t,e),n>1}function Fo(t,e){return e.visited.includes(t+e.options.pathSeparator)}const Go=t=>t.counts,Uo=t=>t.groups,jo=t=>t.paths,zo=t=>t.paths.slice(0,t.options.maxFiles),Wo=(t,e,r)=>(ge(e,r,t.counts,t.options.suppressErrors),null),qo=(t,e,r)=>(ge(e,r,t.paths,t.options.suppressErrors),null),Xo=(t,e,r)=>(ge(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),Ko=(t,e,r)=>(ge(e,r,t.groups,t.options.suppressErrors),null);function ge(t,e,r,o){e(t&&!o?t:null,r)}function Qo(t,e){const{onlyCounts:r,group:o,maxFiles:n}=t;return r?e?Go:Wo:o?e?Uo:Ko:n?e?zo:Xo:e?jo:qo}const vr={withFileTypes:!0},Zo=(t,e,r,o,n)=>{if(t.queue.enqueue(),o<0)return t.queue.dequeue(null,t);const{fs:s}=t;t.visited.push(e),t.counts.directories++,s.readdir(e||".",vr,(i,u=[])=>{n(u,r,o),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},Vo=(t,e,r,o,n)=>{const{fs:s}=t;if(o<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=s.readdirSync(e||".",vr)}catch(u){if(!t.options.suppressErrors)throw u}n(i,r,o)};function Yo(t){return t?Vo:Zo}var Jo=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},tn=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},en=class{aborted=!1;abort(){this.aborted=!0}},Er=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,r,o){this.isSynchronous=!o,this.callbackInvoker=Qo(r,this.isSynchronous),this.root=ve(e,r),this.state={root:ho(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new tn,options:r,queue:new Jo((n,s)=>this.callbackInvoker(s,n,o)),symlinks:new Map,visited:[""].slice(0,0),controller:new en,fs:r.fs||Vs},this.joinPath=bo(this.root,r),this.pushDirectory=So(this.root,r),this.pushFile=Co(r),this.getArray=Lo(r),this.groupFiles=Mo(r),this.resolveSymlink=Io(r,this.isSynchronous),this.walkDirectory=Yo(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,r,o)=>{const{paths:n,options:{filters:s,resolveSymlinks:i,excludeSymlinks:u,exclude:a,maxFiles:m,signal:h,useRealPaths:y,pathSeparator:A},controller:g}=this.state;if(g.aborted||h&&h.aborted||m&&n.length>m)return;const $=this.getArray(this.state.paths);for(let _=0;_<e.length;++_){const R=e[_];if(R.isFile()||R.isSymbolicLink()&&!i&&!u){const L=this.joinPath(R.name,r);this.pushFile(L,$,this.state.counts,s)}else if(R.isDirectory()){let L=mo(R.name,r,this.state.options.pathSeparator);if(a&&a(R.name,L))continue;this.pushDirectory(L,n,s),this.walkDirectory(this.state,L,L,o-1,this.walk)}else if(this.resolveSymlink&&R.isSymbolicLink()){let L=br(R.name,r);this.resolveSymlink(L,this.state,(H,d)=>{if(H.isDirectory()){if(d=ve(d,this.state.options),a&&a(R.name,y?d:L+A))return;this.walkDirectory(this.state,d,y?d:L+A,o-1,this.walk)}else{d=y?d:L;const E=oo(d),l=ve(Re(d),this.state.options);d=this.joinPath(E,l),this.pushFile(d,$,this.state.counts,s)}})}}this.groupFiles(this.state.groups,r,$)}};function rn(t,e){return new Promise((r,o)=>{Ar(t,e,(n,s)=>{if(n)return o(n);r(s)})})}function Ar(t,e,r){new Er(t,e,r).start()}function sn(t,e){return new Er(t,e).start()}var Ze=class{constructor(e,r){this.root=e,this.options=r}withPromise(){return rn(this.root,this.options)}withCallback(e){Ar(this.root,this.options,e)}sync(){return sn(this.root,this.options)}};let xr=null;try{Qe.resolve("picomatch"),xr=Qe("picomatch")}catch{}var on=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:dr,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Ze(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Ze(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const r=this.globFunction||xr;if(!r)throw new Error("Please specify a glob function to use glob matching.");var o=this.globCache[t.join("\0")];return o||(o=r(t,...e),this.globCache[t.join("\0")]=o),this.options.filters.push(n=>o(n)),this}};const nn=Array.isArray,Sr=/\\/g,un=/^[A-Za-z]:$/,wr=process.platform==="win32",ln=/^(\/?\.\.)+$/;function Ve(t,e={}){const r=t.length,o=Array(r),n=Array(r);let s,i;for(s=0;s<r;s++){const u=Tr(t[s]);o[s]=u;const a=u.length,m=Array(a);for(i=0;i<a;i++)m[i]=yt(u[i],e);n[s]=m}return u=>{const a=u.split("/");if(a[0]===".."&&ln.test(u))return!0;for(s=0;s<r;s++){const m=o[s],h=n[s],y=a.length,A=Math.min(y,m.length);for(i=0;i<A;){const g=m[i];if(g.includes("/"))return!0;if(!h[i](a[i]))break;if(!e.noglobstar&&g==="**")return!0;i++}if(i===y)return!0}return!1}}const an=/^[A-Z]:\/$/i,cn=wr?t=>an.test(t):t=>t==="/";function Ye(t,e,r){if(t===e||e.startsWith(`${t}/`)){if(r){const n=t.length+ +!cn(t);return(s,i)=>s.slice(n,i?-1:void 0)||"."}const o=e.slice(t.length+1);return o?(n,s)=>{if(n===".")return o;const i=`${o}/${n}`;return s?i.slice(0,-1):i}:(n,s)=>s&&n!=="."?n.slice(0,-1):n}return r?o=>mt.relative(t,o)||".":o=>mt.relative(t,`${e}/${o}`)||"."}function pn(t,e){if(e.startsWith(`${t}/`)){const r=e.slice(t.length+1);return o=>`${r}/${o}`}return r=>{const o=mt.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&o!==""?`${o}/`:o||"."}}function Je(t){return t.replace(un,e=>`${e}/`)}const fn={parts:!0};function Tr(t){var e;const r=yt.scan(t,fn);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}const hn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,gn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,dn=t=>t.replace(hn,"\\$&"),yn=t=>t.replace(gn,"\\$&"),mn=wr?yn:dn;function bn(t,e){const r=yt.scan(t);return r.isGlob||r.negated}function se(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function Rr(t){return typeof t=="string"?[t]:t??[]}const $n=/^(\/?\.\.)+/,vn=/\\(?=[()[\]{}!*+?@|])/g;function Ee(t,e,r,o){var n;const s=e.cwd;let i=t;t[t.length-1]==="/"&&(i=t.slice(0,-1));const u=i.lastIndexOf("/"),a=(u===-1?i:i.slice(u+1)).startsWith("!(");i[i.length-1]!=="*"&&!a&&e.expandDirectories&&(i+="/**");const m=mn(s);i=uo(i.replace(vn,""))?mt.relative(m,i):mt.normalize(i);const h=(n=$n.exec(i))===null||n===void 0?void 0:n[0],y=Tr(i);if(h){const g=(h.length+1)/3;let $=0;const _=m.split("/");for(;$<g&&y[$+g]===_[_.length+$-g];)i=i.slice(0,(g-$-1)*3)+i.slice((g-$)*3+y[$+g].length+1)||".",$++;const R=mt.join(s,h.slice($*3));R[0]!=="."&&r.root.length>R.length&&(r.root=Je(R),r.depthOffset=-g+$)}if(!o&&r.depthOffset>=0){var A;(A=r.commonPath)!==null&&A!==void 0||(r.commonPath=y);const g=[],$=Math.min(r.commonPath.length,y.length);for(let _=0;_<$;_++){const R=y[_];if(R==="**"&&!y[_+1]){g.pop();break}if(_===y.length-1||R!==r.commonPath[_]||bn(R))break;g.push(R)}r.depthOffset=g.length,r.commonPath=g,r.root=Je(g.length>0?mt.join(s,...g):s)}return i}function En(t,e,r){const o=[],n=[],s=[];for(const i of t.ignore)i&&(i[0]!=="!"||i[1]==="("?n.push(Ee(i,t,r,!0)):s.push(i.slice(1)));for(const i of e)i&&(i[0]!=="!"||i[1]==="("?o.push(Ee(i,t,r,!1)):(i[1]!=="!"||i[2]==="(")&&n.push(Ee(i.slice(1),t,r,!0)));return{match:o,ignore:n,unignore:s}}function An(t,e){const r=t.cwd,o={root:r,depthOffset:0},n=En(t,e,o);t.debug&&se("internal processing patterns:",n);const{absolute:s,caseSensitiveMatch:i,debug:u,dot:a,followSymbolicLinks:m,onlyDirectories:h}=t,y=o.root.replace(Sr,""),A={dot:a,nobrace:t.braceExpansion===!1,nocase:!i,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},g=n.unignore.length>0,$=g?yt(n.unignore,A):void 0,_=g?Ve(n.unignore,A):void 0,R=yt(n.match,{...A,ignore:n.ignore,onIgnore:$?w=>$(w.output)&&yt.constants.UNIGNORE:void 0}),L=yt(n.ignore,A),H=Ve(n.match,A),d=Ye(r,y,s),E=s?d:Ye(r,y,!0),l=n.match.length>0&&n.match.every(w=>w==="**"||w==="**/*"),T=n.ignore.length>0||g||!l?(w,x)=>{const D=E(x,!0);return D==="."||_&&_(D)?!1:!H(D)||L(D)}:void 0;let C;t.deep!==void 0&&(C=Math.round(t.deep-o.depthOffset));const S=new on({filters:[u?(w,x)=>{const D=d(w,x),G=R(D);return G&&se(`matched ${D}`),G}:(w,x)=>{const D=d(w,x);return R(D)}],exclude:u&&T?(w,x)=>{const D=T(w,x);return se(`${D?"skipped":"crawling"} ${x}`),D}:T,fs:t.fs,pathSeparator:"/",relativePaths:!s,resolvePaths:s,includeBasePath:s,resolveSymlinks:m,excludeSymlinks:!m,excludeFiles:h,includeDirs:h||!t.onlyFiles,maxDepth:C,signal:t.signal}).crawl(y);return t.debug&&se("internal properties:",{...o,root:y}),[S,r!==y&&!s&&pn(r,y)]}function xn(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}const tr={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Sn(t){const e=Object.assign({},t);for(const r in tr)e[r]===void 0&&Object.assign(e,{[r]:tr[r]});return e.cwd=(e.cwd instanceof URL?lo(e.cwd):yr(e.cwd||process.cwd())).replace(Sr,"/"),e.ignore=Rr(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||so,readdirSync:e.fs.readdirSync||ro,realpath:e.fs.realpath||eo,realpathSync:e.fs.realpathSync||to,stat:e.fs.stat||Js,statSync:e.fs.statSync||Ys}),e.debug&&se("globbing with options:",e),e}function wn(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const o=nn(t)||typeof t=="string",n=Rr((r=o?t:t.patterns)!==null&&r!==void 0?r:"**/*"),s=Sn(o?e:t);return n.length>0?An(s,n):[]}async function gu(t,e){const[r,o]=wn(t,e);return r?xn(await r.withPromise(),o):[]}var Ae,er;function Tn(){if(er)return Ae;er=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 Ae=function(t){if(typeof t!="string"||t==="")return!1;for(var e;e=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(e[2])return!0;t=t.slice(e.index+e[0].length)}return!1},Ae}var xe,rr;function _r(){if(rr)return xe;rr=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 t=Tn(),e={"{":"}","(":")","[":"]"},r=function(n){if(n[0]==="!")return!0;for(var s=0,i=-2,u=-2,a=-2,m=-2,h=-2;s<n.length;){if(n[s]==="*"||n[s+1]==="?"&&/[\].+)]/.test(n[s])||u!==-1&&n[s]==="["&&n[s+1]!=="]"&&(u<s&&(u=n.indexOf("]",s)),u>s&&(h===-1||h>u||(h=n.indexOf("\\",s),h===-1||h>u)))||a!==-1&&n[s]==="{"&&n[s+1]!=="}"&&(a=n.indexOf("}",s),a>s&&(h=n.indexOf("\\",s),h===-1||h>a))||m!==-1&&n[s]==="("&&n[s+1]==="?"&&/[:!=]/.test(n[s+2])&&n[s+3]!==")"&&(m=n.indexOf(")",s),m>s&&(h=n.indexOf("\\",s),h===-1||h>m))||i!==-1&&n[s]==="("&&n[s+1]!=="|"&&(i<s&&(i=n.indexOf("|",s)),i!==-1&&n[i+1]!==")"&&(m=n.indexOf(")",i),m>i&&(h=n.indexOf("\\",i),h===-1||h>m))))return!0;if(n[s]==="\\"){var y=n[s+1];s+=2;var A=e[y];if(A){var g=n.indexOf(A,s);g!==-1&&(s=g+1)}if(n[s]==="!")return!0}else s++}return!1},o=function(n){if(n[0]==="!")return!0;for(var s=0;s<n.length;){if(/[*?{}()[\]]/.test(n[s]))return!0;if(n[s]==="\\"){var i=n[s+1];s+=2;var u=e[i];if(u){var a=n.indexOf(u,s);a!==-1&&(s=a+1)}if(n[s]==="!")return!0}else s++}return!1};return xe=function(n,s){if(typeof n!="string"||n==="")return!1;if(t(n))return!0;var i=r;return s&&s.strict===!1&&(i=o),i(n)},xe}const Rn=B(import.meta.url),Pt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kr=t=>{if(typeof Pt<"u"&&Pt.versions&&Pt.versions.node){const[e,r]=Pt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Pt.getBuiltinModule(t)}return Rn(t)},_n=kr("path"),kn=kr("os");var Se,sr;function Cn(){if(sr)return Se;sr=1;var t=_r(),e=_n.posix.dirname,r=kn.platform()==="win32",o="/",n=/\\/g,s=/\\([!*?|[\](){}])/g;Se=function(a,m){var h=Object.assign({flipBackslashes:!0},m);h.flipBackslashes&&r&&a.indexOf(o)<0&&(a=a.replace(n,o)),i(a)&&(a+=o),a+="a";do a=e(a);while(u(a));return a.replace(s,"$1")};function i(a){var m=a.slice(-1),h;switch(m){case"}":h="{";break;case"]":h="[";break;default:return!1}var y=a.indexOf(h);return y<0?!1:a.slice(y+1,-1).includes(o)}function u(a){return/\([^()]+$/.test(a)||a[0]==="{"||a[0]==="["||/[^\\][{[]/.test(a)?!0:t(a)}return Se}var On=Cn();Oe(On);const Nn=B(import.meta.url),It=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ln=t=>{if(typeof It<"u"&&It.versions&&It.versions.node){const[e,r]=It.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return It.getBuiltinModule(t)}return Nn(t)},{access:Hn}=Ln("node:fs/promises");async function du(t,e=ke){pt(t),t=ct(t);try{return await Hn(t,e),!0}catch{return!1}}const Bn=B(import.meta.url),Ft=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mn=t=>{if(typeof Ft<"u"&&Ft.versions&&Ft.versions.node){const[e,r]=Ft.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ft.getBuiltinModule(t)}return Bn(t)},{accessSync:Dn}=Mn("node:fs");function _e(t,e=ke){pt(t),t=ct(t);try{return Dn(t,e),!0}catch{return!1}}var Pn=_r();Oe(Pn);const In=B(import.meta.url),Gt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Cr=t=>{if(typeof Gt<"u"&&Gt.versions&&Gt.versions.node){const[e,r]=Gt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Gt.getBuiltinModule(t)}return In(t)};Cr("node:fs/promises");Cr("node:fs");let Fn=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")}},Gn=class extends Error{constructor(e){super(`EPERM: Operation not permitted, ${e}`)}get code(){return"EPERM"}set code(e){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(e){throw new Error("Cannot overwrite name of PermissionError")}};const Or=(t,e)=>{const r=t?.code;return r==="ENOENT"?new Fn(`no such file or directory, open '${e}'`):r==="EACCES"||r==="EPERM"?new Gn(`unable to read the non-readable file: ${e}`):t},Un=B(import.meta.url),Ut=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nr=t=>{if(typeof Ut<"u"&&Ut.versions&&Ut.versions.node){const[e,r]=Ut.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ut.getBuiltinModule(t)}return Un(t)},{readFile:jn}=Nr("node:fs/promises"),{unzip:zn,brotliDecompress:Wn}=Nr("node:zlib"),qn={brotli:Wn,gzip:zn,none:(t,e)=>{e(null,t)}},bu=async(t,e)=>{pt(t),t=ct(t);const{buffer:r,compression:o,encoding:n,flag:s}=e??{};let i;try{i=await jn(t,s?{flag:s}:{})}catch(u){throw Or(u,t)}return await new Promise((u,a)=>{qn[o??"none"](i,(m,h)=>{m?a(m):u(r?h:h.toString(n??"utf8"))})})},Xn=B(import.meta.url),jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lr=t=>{if(typeof jt<"u"&&jt.versions&&jt.versions.node){const[e,r]=jt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return jt.getBuiltinModule(t)}return Xn(t)},{readFileSync:Kn}=Lr("node:fs"),{unzipSync:Qn,brotliDecompressSync:Zn}=Lr("node:zlib"),Vn={brotli:Zn,gzip:Qn,none:t=>t},$u=(t,e)=>{pt(t),t=ct(t);const{buffer:r,compression:o,encoding:n,flag:s}=e??{};let i;try{i=Kn(t,s?{flag:s}:{})}catch(m){throw Or(m,t)}const u=Vn[o??"none"],a=u(i);return r?a:a.toString(n??"utf8")},Yn=B(import.meta.url),zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jn=t=>{if(typeof zt<"u"&&zt.versions&&zt.versions.node){const[e,r]=zt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return zt.getBuiltinModule(t)}return Yn(t)},{createRequire:Hr}=Jn("node:module"),ti=globalThis.process??Object.create(null),or={versions:{}},nr=new Proxy(ti,{get(t,e){if(e in t)return t[e];if(e in or)return or[e]}}),ei=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
12
+ `),ri=(t,e,r,o)=>{const n={column:0,line:-1,...t.start},s={...n,...t.end},i=n.line,u=n.column,a=s.line,m=s.column;let h=Math.max(i-(r+1),0),y=Math.min(e.length,a+o);i===-1&&(h=0),a===-1&&(y=e.length);const A=a-i,g={};if(A)for(let $=0;$<=A;$++){const _=$+i;if(!u)g[_]=!0;else if($===0){const R=e[_-1]?.length;g[_]=[u,(R??0)-u+1]}else if($===A)g[_]=[0,m];else{const R=e[_-$]?.length;g[_]=[0,R]}}else u===m?g[i]=u?[u,0]:!0:g[i]=[u,(m??0)-(u??0)];return{end:y,markerLines:g,start:h}},si=nr.platform==="win32"&&!nr.env?.WT_SESSION?">":"❯",vu=(t,e,r)=>{const o={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:$=>$,marker:$=>$,message:$=>$,...r?.color}},n=typeof e.start.column=="number";let s=(t.includes("\r")?ei(t):t).split(`
13
+ `);typeof o.tabWidth=="number"&&t.includes(" ")&&(s=s.map($=>$.replaceAll(" "," ".repeat(o.tabWidth))));const{end:i,markerLines:u,start:a}=ri(e,s,o.linesAbove,o.linesBelow),m=String(i).length,{gutter:h,marker:y,message:A}=o.color;let g=s.slice(a,i).map(($,_)=>{const R=a+1+_,L=u[R],H=String(R).padStart(m),d=!u[R+1],E=` ${H}${o.showGutter?" |":""}`;if(L){let l="";if(Array.isArray(L)){const T=$.replaceAll(/[^\t]/g," ").slice(0,Math.max(L[0]-1,0)),C=L[1]||1;l=[`
14
+ `,o.prefix+h(E.replaceAll(/\d/g," "))," ",T,y("^").repeat(C)].join(""),d&&o.message&&(l+=` ${A(o.message)}`)}return[o.prefix+y(si),h(E),$.length>0?` ${$}`:"",l].join("")}return`${o.prefix} ${h(E)}${$.length>0?` ${$}`:""}`}).join(`
15
+ `);return o.message&&!n&&(g=`${o.prefix+" ".repeat(m+1)+o.message}
16
+ ${g}`),g},ir=(t,e)=>{let r=0,o=e.length-2;for(;r<o;){const n=r+(o-r>>1);if(t<e[n])o=n-1;else if(t>=e[n+1])r=n+1;else{r=n;break}}return r},oi=/\n|\r(?!\n)/,ni=t=>t.split(oi).reduce((e,r)=>(e.push(e.at(-1)+r.length+1),e),[0]),Eu=(t,e,r)=>{if(!Array.isArray(t)&&typeof t!="string"||(typeof t=="string"||Array.isArray(t))&&t.length===0)return{column:0,line:0};if(typeof e!="number"||typeof t=="string"&&e>=t.length||Array.isArray(t)&&e+1>=t.at(-1))return{column:0,line:0};if(typeof t=="string"){const n=ni(t),s=ir(e,n);return{column:e-n[s]+1,line:s+1}}const o=ir(e,t);return{column:e-t[o]+1,line:o+1}},ii=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&ii.set("AggregateError",AggregateError);const ui=Hr(import.meta.url),Wt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,li=t=>{if(typeof Wt<"u"&&Wt.versions&&Wt.versions.node){const[e,r]=Wt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Wt.getBuiltinModule(t)}return ui(t)};li("node:util");const ai=Hr(import.meta.url),qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=t=>{if(typeof qt<"u"&&qt.versions&&qt.versions.node){const[e,r]=qt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return qt.getBuiltinModule(t)}return ai(t)};Ne("node:fs");Ne("node:path");Ne("node:url");let Au=class extends Error{fileName;codeFrame;name="JSONError";#t;constructor(e){super(),this.#t=e}get message(){return`${this.#t}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
17
+
18
+ ${this.codeFrame}
19
+ `:""}`}set message(e){this.#t=e}};const ci=t=>{const e={force:!0,recursive:!0};return t?.maxRetries!==void 0&&(e.maxRetries=t.maxRetries),t?.retryDelay!==void 0&&(e.retryDelay=t.retryDelay),e},pi=B(import.meta.url),Xt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Br=t=>{if(typeof Xt<"u"&&Xt.versions&&Xt.versions.node){const[e,r]=Xt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Xt.getBuiltinModule(t)}return pi(t)};Br("node:fs");Br("node:fs/promises");const fi=B(import.meta.url),Kt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hi=t=>{if(typeof Kt<"u"&&Kt.versions&&Kt.versions.node){const[e,r]=Kt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Kt.getBuiltinModule(t)}return fi(t)};hi("node:fs");const gi=B(import.meta.url),Qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,di=t=>{if(typeof Qt<"u"&&Qt.versions&&Qt.versions.node){const[e,r]=Qt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Qt.getBuiltinModule(t)}return gi(t)};di("node:fs/promises");const yi=B(import.meta.url),Zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mi=t=>{if(typeof Zt<"u"&&Zt.versions&&Zt.versions.node){const[e,r]=Zt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Zt.getBuiltinModule(t)}return yi(t)},{rmSync:bi}=mi("node:fs"),Su=(t,e={})=>{pt(t),bi(t,ci(e))};B(import.meta.url);const $i=t=>{if(typeof t!="string"&&!(t instanceof ArrayBuffer)&&!ArrayBuffer.isView(t))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},vi=B(import.meta.url),Vt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ei=t=>{if(typeof Vt<"u"&&Vt.versions&&Vt.versions.node){const[e,r]=Vt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Vt.getBuiltinModule(t)}return vi(t)},{randomBytes:Ai}=Ei("node:crypto"),xi=t=>`${t}.${process.pid.toString(36)}.${Ai(6).toString("hex")}.tmp`,Si=new TextEncoder,wi=t=>{if(t instanceof Uint8Array)return t;if(typeof t=="string")return Si.encode(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t)){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(e)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},Ti=B(import.meta.url),Yt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ri=t=>{if(typeof Yt<"u"&&Yt.versions&&Yt.versions.node){const[e,r]=Yt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Yt.getBuiltinModule(t)}return Ti(t)};Ri("node:fs/promises");const _i=B(import.meta.url),Jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ki=t=>{if(typeof Jt<"u"&&Jt.versions&&Jt.versions.node){const[e,r]=Jt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Jt.getBuiltinModule(t)}return _i(t)},{mkdirSync:Ci,writeFileSync:Oi,statSync:Ni,renameSync:ur,chownSync:Li,chmodSync:Hi,unlinkSync:Bi}=ki("node:fs"),Mi=(t,e,r)=>{r={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},pt(t),$i(e),t=ct(t);const o=_e(t,ke);if(o&&!r.overwrite)throw new us(`file already exists, open '${t}'`);const n=xi(t);try{!o&&r.recursive&&Ci(Ce(t),{recursive:!0});let s;if(Oi(n,typeof e=="string"?Buffer.from(e,r.encoding??"utf8"):wi(e),{flag:"wx"}),o&&r.backup&&(s=Ni(t),r.chown??={gid:s.gid,uid:s.uid},ur(t,`${t}.bak`)),r.chown)try{Li(n,r.chown.uid,r.chown.gid)}catch{}Hi(n,s&&!r.mode?s.mode:r.mode??438),ur(n,t)}catch(s){throw new Error(`Failed to write file at: ${t} - ${s.message}`,{cause:s})}finally{_e(n)&&Bi(n)}},Di=/^(?:( )+|\t+)/,ne="space";function lr(t,e,r){return t&&e===ne&&r===1}function ar(t,e){const r=new Map;let o=0,n,s;for(const i of t.split(/\n/g)){if(!i)continue;const u=i.match(Di);if(u===null)o=0,n="";else{const a=u[0].length,m=u[1]?ne:"tab";if(lr(e,m,a))continue;m!==n&&(o=0),n=m;let h=1,y=0;const A=a-o;if(o=a,A===0)h=0,y=1;else{const $=Math.abs(A);if(lr(e,m,$))continue;s=Pi(m,$)}const g=r.get(s);r.set(s,g===void 0?[1,0]:[g[0]+h,g[1]+y])}}return r}function Pi(t,e){return(t===ne?"s":"t")+String(e)}function Ii(t){const e=t[0]==="s"?ne:"tab",r=Number(t.slice(1));return{type:e,amount:r}}function Fi(t){let e,r=0,o=0;for(const[n,[s,i]]of t)(s>r||s===r&&i>o)&&(r=s,o=i,e=n);return e}function Gi(t,e){return(t===ne?" ":" ").repeat(e)}function Ui(t){if(typeof t!="string")throw new TypeError("Expected a string");let e=ar(t,!0);e.size===0&&(e=ar(t,!1));const r=Fi(e);let o,n=0,s="";return r!==void 0&&({type:o,amount:n}=Ii(r),s=Gi(o,n)),{amount:n,type:o,indent:s}}const ji=B(import.meta.url),te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zi=t=>{if(typeof te<"u"&&te.versions&&te.versions.node){const[e,r]=te.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return te.getBuiltinModule(t)}return ji(t)};zi("node:fs/promises");const Wi=B(import.meta.url),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qi=t=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[e,r]=ee.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ee.getBuiltinModule(t)}return Wi(t)},{readFileSync:Xi}=qi("node:fs"),wu=(t,e,r={})=>{const{detectIndent:o,indent:n,replacer:s,stringify:i=JSON.stringify,...u}={indent:" ",...r};let a=n,m=`
20
+ `;if(_e(t,Gr))try{const y=Xi(t,"utf8");if(o){const{indent:A}=Ui(y);a=A}m=y.endsWith(`
21
+ `)?`
22
+ `:""}catch(y){if(y.code!=="ENOENT")throw y}const h=i(e,s,a);Mi(t,`${h}${m}`,u)},Ki=B(import.meta.url),re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Le=t=>{if(typeof re<"u"&&re.versions&&re.versions.node){const[e,r]=re.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return re.getBuiltinModule(t)}return Ki(t)},Qi=Le("fs"),Zi=Le("os"),Vi=Le("path");var we={},cr;function Yi(){if(cr)return we;cr=1;var t=Object.defineProperty,e=(h,y)=>t(h,"name",{value:y,configurable:!0}),r=Qi,o=Zi,n=Vi;const s=e(h=>{let y="";for(let A=0;A<h.length;A+=1){const g=h[A],$=g.toUpperCase();y+=g===$?g.toLowerCase():$}return y},"invertCase"),i=new Map,u=e((h,y)=>{const A=n.join(h,`.is-fs-case-sensitive-test-${process.pid}`);try{return y.writeFileSync(A,""),!y.existsSync(s(A))}finally{try{y.unlinkSync(A)}catch{}}},"checkDirectoryCaseWithWrite"),a=e((h,y,A)=>{try{return u(h,A)}catch(g){if(y===void 0)return u(o.tmpdir(),A);throw g}},"checkDirectoryCaseWithFallback"),m=e((h,y=r,A=!0)=>{const g=h??process.cwd();if(A&&i.has(g))return i.get(g);let $;const _=s(g);return _!==g&&y.existsSync(g)?$=!y.existsSync(_):$=a(g,h,y),A&&i.set(g,$),$},"isFsCaseSensitive");return we.isFsCaseSensitive=m,we}var Ji=Yi();const Tu=Ji.isFsCaseSensitive;export{bt as A,vt as B,pu as F,Ce as H,Ps as I,hr as J,ct as L,wu as O,Mi as T,vu as U,gu as W,lu as a,du as b,bu as c,uu as d,Fn as e,_e as f,ce as g,nu as h,eu as i,Yr as j,Tu as k,Su as l,Zr as m,ru as o,Au as s,$u as v,su as w,ou as y,Eu as z};
@@ -0,0 +1 @@
1
+ import{m as h,D as k,f as S}from"./provenance-CI_WQx7G.js";import{g as $}from"./packument-CYxvm590.js";import{H as d}from"./env-Cpxa_7UE.js";import{W as N}from"./build-scripts-D477Ou-x.js";import{n as v}from"./license-t5KnNX6v.js";import{A as R,B as L,v as D}from"./index-BVuCxe14.js";import{D as A}from"../packem_chunks/cli-main.js";import"./public-api-WqUCiyIe.js";import{L as w}from"./dependency-scan-P52jY0pU.js";const m={CRITICAL:0,HIGH:1,LOW:3,MODERATE:2,UNKNOWN:4},oe=(t,e)=>{const n=m[(t.vulnerability.severity??"UNKNOWN").toUpperCase()]??4,s=m[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??4;return n-s||t.packageName.localeCompare(e.packageName)||t.packageVersion.localeCompare(e.packageVersion)},P=(t,e)=>{const n=m[e.toUpperCase()]??2;return(m[t.toUpperCase()]??4)<=n},b=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],g=6e4,W=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},x=async(t,e)=>{const n=e.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:s}=n,a=n.exclude??[],r=e.security?.acceptedRisks,c=s*g,i=Date.now();return(await h(t.packages,k,async o=>{if(W(o.name,o.version,a))return;const l=await $(o.name,{workspaceRoot:t.workspaceRoot});if(l===void 0)return;const p=l.time?.[o.version];if(p===void 0)return;const u=Date.parse(p);if(Number.isNaN(u))return;const f=i-u;if(f>=c)return;const y=Math.max(0,Math.floor(f/g));return{acceptedRisk:d(o.name,o.version,r,"firstSeen"),data:{ageMinutes:y,minimumMinutes:s,publishedAt:p},packageName:o.name,policy:"firstSeen",reason:`${o.name}@${o.version} was published ${String(y)} min ago — below the ${String(s)} min firstSeen cooldown.`,severity:"block",version:o.version}})).filter(o=>o!==void 0)},O=(t,e)=>{const n=e.security?.policies?.installScripts;if(!n)return[];const s=n.allow??{},a=n.strict===!0;if(!a&&Object.keys(s).length===0)return[];const r=N(t.workspaceRoot,s,{pinVersions:e.security?.pinVersions===!0});if(r.unapproved.length===0)return[];const c=e.security?.acceptedRisks,i=a?"block":"warn";return r.unapproved.map(o=>({acceptedRisk:d(o.name,o.version??"*",c,"installScripts"),data:{hooks:o.hooks},packageName:o.name,policy:"installScripts",reason:`${o.name}${o.version?`@${o.version}`:""} declares unapproved build script(s): ${o.hooks.join(", ")}`,severity:i,version:o.version??"*"}))},U=new Set(["AND","OR"]),E=t=>{const e=t.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(a=>a.trim()).filter(a=>a.length>0),n=[];let s=!1;for(const a of e){const r=a.toUpperCase();if(s){s=!1;continue}if(r==="WITH"){s=!0;continue}if(U.has(r))continue;const c=a.endsWith("+"),i=c?a.slice(0,-1):a,o=v(i)??i;n.push(o),c&&n.push(`${o}-or-later`)}return n},F=t=>{if(typeof t.license=="string"){const e=t.license.trim();return e.length>0?e:void 0}if(t.license&&typeof t.license=="object"&&typeof t.license.type=="string"){const e=t.license.type.trim();if(e.length>0)return e}if(Array.isArray(t.licenses)&&t.licenses.length>0){const e=t.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},I=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(n.has(s.toLowerCase()))return s},M=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(!n.has(s.toLowerCase()))return s},V=(t,e)=>{const n=e.security?.policies?.license;if(!n)return[];const s=n.allow??[],a=n.deny??[];if(s.length===0&&a.length===0)return[];const r=e.security?.acceptedRisks,c=[];for(const i of t.packages){const o=t.manifestData?.get(`${i.name}@${i.version}`),l=o?F(o):void 0;if(!l){s.length>0&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:null},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} declares no license; allow-list mode requires one of: ${s.join(", ")}`,severity:"block",version:i.version});continue}const p=E(l),u=I(p,a);if(u){c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:i.version});continue}const f=M(p,s);f&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{allowList:s,declaredLicense:l,unallowedLicense:f},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses license '${f}' which is not on the allow-list (declared: ${l})`,severity:"block",version:i.version})}return c},j=6e4,_=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},H=async(t,e)=>{const n=e.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const s=n.exclude??[],a=typeof n.ignoreAfter=="number"?n.ignoreAfter*j:void 0,r=e.security?.acceptedRisks,c=Date.now();return(await h(t.packages,k,async i=>{if(_(i.name,i.version,s))return;const o=await $(i.name,{workspaceRoot:t.workspaceRoot});if(o===void 0)return;if(a!==void 0){const p=o.time?.[i.version],u=p===void 0?Number.NaN:Date.parse(p);if(!Number.isNaN(u)&&c-u>a)return}if(o.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const l=S(o,i.version);if(l!==void 0)return{acceptedRisk:d(i.name,i.version,r,"publisherChange"),data:{priorVersionWithProvenance:l},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${l} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},T=t=>{for(const e of Object.values(w))for(const n of[e.file,...e.aliases??[]])if(t===n||t.endsWith(`/${n}`)||t.endsWith(`.${n}`))return e.type},K=(t,e,n)=>{const s=R(e)?e:L(t,e);let a;try{a=D(s)}catch{return}const r=T(s)??w[n]?.type;if(!r)return;const c=A(a,r);if(c.length===0)return;const i=new Set;for(const o of c)i.add(`${o.name}@${o.version}`);return i},z=(t,e)=>{for(const n of e)if(n===t||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},Y=(t,e)=>{const n=e.security?.policies?.unexpectedDeps;if(!n)return[];const s=n.allow??[],a=n.baselineLockfile;if(s.length===0&&!a)return[];const r=a?K(t.workspaceRoot,a,t.packageManager):void 0,c=e.security?.acceptedRisks,i=[];for(const o of t.packages){const l=s.length===0||z(o.name,s),p=r?r.has(`${o.name}@${o.version}`):!0;if(l&&p)continue;const u=[],f={};l||(u.push(`not on allow-list (${s.length} entr${s.length===1?"y":"ies"})`),f.allowList=s),!p&&r&&(u.push(`not present in baseline lockfile (${a})`),f.baselineLockfile=a),i.push({acceptedRisk:d(o.name,o.version,c,"unexpectedDeps"),data:f,packageName:o.name,policy:"unexpectedDeps",reason:`${o.name}@${o.version} is unexpected: ${u.join("; ")}`,severity:"block",version:o.version})}return i},q=(t,e)=>{if(!t.osvFindings||t.osvFindings.size===0)return[];const n=e.security?.policies?.vulnerability?.failOn,s=e.security?.acceptedRisks,a=[];for(const r of t.packages){const c=t.osvFindings.get(r.name);if(!(!c||c.length===0))for(const i of c){const o=n?P(i.severity,n)?"block":"warn":"info";a.push({acceptedRisk:d(r.name,r.version,s,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:r.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${r.name}@${r.version}: ${i.summary}`,severity:o,version:r.version})}}return a},C=[{evaluate:q,isConfigured:t=>t.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:V,isConfigured:t=>{const e=t.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:O,isConfigured:t=>{const e=t.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:t=>{const e=t.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:x,isConfigured:t=>{const e=t.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:H,isConfigured:t=>t.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],B=(t,e,n)=>C.filter(s=>s.surfaces.includes(t)?n!==void 0?n.has(s.name):s.isConfigured(e):!1),re=async(t,e,n)=>{const s=B(e,n.visConfig,n.enabledPolicies),a=[];for(const r of s){if(t.offline&&!r.offlineSupported){a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await r.evaluate(t,n.visConfig);a.push(...c)}catch(c){const i=c instanceof Error?c.message:String(c);a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} failed: ${i}`,severity:"info",version:"*"})}}return a},G=(()=>{const t=new Map;for(const e of b)t.set(e.toLowerCase(),e);return t})(),ae=()=>C.map(t=>t.name),ce=(t,e)=>{if(t===void 0)return;const n=t.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(b);const s=new Set;for(const a of t.split(",").map(r=>r.trim()).filter(r=>r.length>0)){const r=a.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(i,o)=>o.toUpperCase()),c=G.get(r.toLowerCase());c===void 0?e?.(a):s.add(c)}return s};export{oe as c,re as e,ae as g,ce as p,P as s};