@pnpm/exe 11.0.0-dev.1005 → 11.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (584) hide show
  1. package/dist/node-gyp-bin/node-gyp +6 -0
  2. package/dist/node-gyp-bin/node-gyp.cmd +5 -0
  3. package/dist/node_modules/@gar/promise-retry/LICENSE +20 -0
  4. package/dist/node_modules/@gar/promise-retry/lib/index.js +62 -0
  5. package/dist/node_modules/@gar/promise-retry/lib/retry.js +109 -0
  6. package/dist/node_modules/@gar/promise-retry/package.json +45 -0
  7. package/dist/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
  8. package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
  9. package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
  10. package/dist/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
  11. package/dist/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
  12. package/dist/node_modules/@isaacs/fs-minipass/package.json +72 -0
  13. package/dist/node_modules/@npmcli/agent/lib/agents.js +206 -0
  14. package/dist/node_modules/@npmcli/agent/lib/dns.js +53 -0
  15. package/dist/node_modules/@npmcli/agent/lib/errors.js +61 -0
  16. package/dist/node_modules/@npmcli/agent/lib/index.js +56 -0
  17. package/dist/node_modules/@npmcli/agent/lib/options.js +86 -0
  18. package/dist/node_modules/@npmcli/agent/lib/proxy.js +88 -0
  19. package/dist/node_modules/@npmcli/agent/package.json +60 -0
  20. package/dist/node_modules/@npmcli/fs/lib/common/get-options.js +20 -0
  21. package/dist/node_modules/@npmcli/fs/lib/common/node.js +9 -0
  22. package/dist/node_modules/@npmcli/fs/lib/cp/LICENSE +15 -0
  23. package/dist/node_modules/@npmcli/fs/lib/cp/errors.js +129 -0
  24. package/dist/node_modules/@npmcli/fs/lib/cp/index.js +22 -0
  25. package/dist/node_modules/@npmcli/fs/lib/cp/polyfill.js +428 -0
  26. package/dist/node_modules/@npmcli/fs/lib/index.js +13 -0
  27. package/dist/node_modules/@npmcli/fs/lib/move-file.js +78 -0
  28. package/dist/node_modules/@npmcli/fs/lib/readdir-scoped.js +20 -0
  29. package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +39 -0
  30. package/dist/node_modules/@npmcli/fs/package.json +54 -0
  31. package/dist/node_modules/@npmcli/redact/LICENSE +21 -0
  32. package/dist/node_modules/@npmcli/redact/lib/deep-map.js +71 -0
  33. package/dist/node_modules/@npmcli/redact/lib/error.js +28 -0
  34. package/dist/node_modules/@npmcli/redact/lib/index.js +44 -0
  35. package/dist/node_modules/@npmcli/redact/lib/matchers.js +88 -0
  36. package/dist/node_modules/@npmcli/redact/lib/server.js +59 -0
  37. package/dist/node_modules/@npmcli/redact/lib/utils.js +202 -0
  38. package/dist/node_modules/@npmcli/redact/package.json +52 -0
  39. package/dist/node_modules/abbrev/LICENSE +46 -0
  40. package/dist/node_modules/abbrev/lib/index.js +53 -0
  41. package/dist/node_modules/abbrev/package.json +41 -0
  42. package/dist/node_modules/agent-base/LICENSE +22 -0
  43. package/dist/node_modules/agent-base/dist/helpers.js +66 -0
  44. package/dist/node_modules/agent-base/dist/index.js +178 -0
  45. package/dist/node_modules/agent-base/package.json +46 -0
  46. package/dist/node_modules/balanced-match/dist/commonjs/index.js +59 -0
  47. package/dist/node_modules/balanced-match/dist/commonjs/package.json +3 -0
  48. package/dist/node_modules/balanced-match/dist/esm/index.js +54 -0
  49. package/dist/node_modules/balanced-match/dist/esm/package.json +3 -0
  50. package/dist/node_modules/balanced-match/package.json +68 -0
  51. package/dist/node_modules/brace-expansion/LICENSE +23 -0
  52. package/dist/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
  53. package/dist/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
  54. package/dist/node_modules/brace-expansion/dist/esm/index.js +197 -0
  55. package/dist/node_modules/brace-expansion/dist/esm/package.json +3 -0
  56. package/dist/node_modules/brace-expansion/package.json +64 -0
  57. package/dist/node_modules/cacache/lib/content/path.js +29 -0
  58. package/dist/node_modules/cacache/lib/content/read.js +165 -0
  59. package/dist/node_modules/cacache/lib/content/rm.js +18 -0
  60. package/dist/node_modules/cacache/lib/content/write.js +206 -0
  61. package/dist/node_modules/cacache/lib/entry-index.js +336 -0
  62. package/dist/node_modules/cacache/lib/get.js +170 -0
  63. package/dist/node_modules/cacache/lib/index.js +42 -0
  64. package/dist/node_modules/cacache/lib/memoization.js +72 -0
  65. package/dist/node_modules/cacache/lib/put.js +80 -0
  66. package/dist/node_modules/cacache/lib/rm.js +31 -0
  67. package/dist/node_modules/cacache/lib/util/glob.js +7 -0
  68. package/dist/node_modules/cacache/lib/util/hash-to-segments.js +7 -0
  69. package/dist/node_modules/cacache/lib/util/tmp.js +32 -0
  70. package/dist/node_modules/cacache/lib/verify.js +258 -0
  71. package/dist/node_modules/cacache/package.json +81 -0
  72. package/dist/node_modules/chownr/dist/commonjs/index.js +93 -0
  73. package/dist/node_modules/chownr/dist/commonjs/package.json +3 -0
  74. package/dist/node_modules/chownr/dist/esm/index.js +85 -0
  75. package/dist/node_modules/chownr/dist/esm/package.json +3 -0
  76. package/dist/node_modules/chownr/package.json +69 -0
  77. package/dist/node_modules/debug/LICENSE +20 -0
  78. package/dist/node_modules/debug/package.json +64 -0
  79. package/dist/node_modules/debug/src/browser.js +272 -0
  80. package/dist/node_modules/debug/src/common.js +292 -0
  81. package/dist/node_modules/debug/src/index.js +10 -0
  82. package/dist/node_modules/debug/src/node.js +263 -0
  83. package/dist/node_modules/env-paths/index.js +74 -0
  84. package/dist/node_modules/env-paths/license +9 -0
  85. package/dist/node_modules/env-paths/package.json +45 -0
  86. package/dist/node_modules/exponential-backoff/LICENSE +202 -0
  87. package/dist/node_modules/exponential-backoff/dist/backoff.js +124 -0
  88. package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +25 -0
  89. package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +45 -0
  90. package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +17 -0
  91. package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +3 -0
  92. package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +82 -0
  93. package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +8 -0
  94. package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +15 -0
  95. package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +7 -0
  96. package/dist/node_modules/exponential-backoff/dist/options.js +31 -0
  97. package/dist/node_modules/exponential-backoff/package.json +62 -0
  98. package/dist/node_modules/fdir/LICENSE +7 -0
  99. package/dist/node_modules/fdir/dist/index.cjs +588 -0
  100. package/dist/node_modules/fdir/dist/index.d.cts +155 -0
  101. package/dist/node_modules/fdir/dist/index.d.mts +155 -0
  102. package/dist/node_modules/fdir/dist/index.mjs +570 -0
  103. package/dist/node_modules/fdir/package.json +103 -0
  104. package/dist/node_modules/fs-minipass/LICENSE +15 -0
  105. package/dist/node_modules/fs-minipass/lib/index.js +443 -0
  106. package/dist/node_modules/fs-minipass/package.json +54 -0
  107. package/dist/node_modules/glob/dist/commonjs/glob.js +248 -0
  108. package/dist/node_modules/glob/dist/commonjs/has-magic.js +27 -0
  109. package/dist/node_modules/glob/dist/commonjs/ignore.js +119 -0
  110. package/dist/node_modules/glob/dist/commonjs/index.js +68 -0
  111. package/dist/node_modules/glob/dist/commonjs/index.min.js +4 -0
  112. package/dist/node_modules/glob/dist/commonjs/package.json +3 -0
  113. package/dist/node_modules/glob/dist/commonjs/pattern.js +223 -0
  114. package/dist/node_modules/glob/dist/commonjs/processor.js +301 -0
  115. package/dist/node_modules/glob/dist/commonjs/walker.js +387 -0
  116. package/dist/node_modules/glob/dist/esm/glob.js +244 -0
  117. package/dist/node_modules/glob/dist/esm/has-magic.js +23 -0
  118. package/dist/node_modules/glob/dist/esm/ignore.js +115 -0
  119. package/dist/node_modules/glob/dist/esm/index.js +55 -0
  120. package/dist/node_modules/glob/dist/esm/index.min.js +4 -0
  121. package/dist/node_modules/glob/dist/esm/package.json +3 -0
  122. package/dist/node_modules/glob/dist/esm/pattern.js +219 -0
  123. package/dist/node_modules/glob/dist/esm/processor.js +294 -0
  124. package/dist/node_modules/glob/dist/esm/walker.js +381 -0
  125. package/dist/node_modules/glob/package.json +98 -0
  126. package/dist/node_modules/graceful-fs/LICENSE +15 -0
  127. package/dist/node_modules/graceful-fs/clone.js +23 -0
  128. package/dist/node_modules/graceful-fs/graceful-fs.js +448 -0
  129. package/dist/node_modules/graceful-fs/legacy-streams.js +118 -0
  130. package/dist/node_modules/graceful-fs/package.json +53 -0
  131. package/dist/node_modules/graceful-fs/polyfills.js +355 -0
  132. package/dist/node_modules/http-cache-semantics/LICENSE +9 -0
  133. package/dist/node_modules/http-cache-semantics/index.js +928 -0
  134. package/dist/node_modules/http-cache-semantics/package.json +22 -0
  135. package/dist/node_modules/http-proxy-agent/LICENSE +22 -0
  136. package/dist/node_modules/http-proxy-agent/dist/index.js +148 -0
  137. package/dist/node_modules/http-proxy-agent/package.json +47 -0
  138. package/dist/node_modules/https-proxy-agent/LICENSE +22 -0
  139. package/dist/node_modules/https-proxy-agent/dist/index.js +180 -0
  140. package/dist/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
  141. package/dist/node_modules/https-proxy-agent/package.json +50 -0
  142. package/dist/node_modules/iconv-lite/LICENSE +21 -0
  143. package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
  144. package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
  145. package/dist/node_modules/iconv-lite/encodings/index.js +23 -0
  146. package/dist/node_modules/iconv-lite/encodings/internal.js +218 -0
  147. package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
  148. package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  149. package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
  150. package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  151. package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  152. package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  153. package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  154. package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  155. package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  156. package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  157. package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  158. package/dist/node_modules/iconv-lite/encodings/utf16.js +187 -0
  159. package/dist/node_modules/iconv-lite/encodings/utf32.js +307 -0
  160. package/dist/node_modules/iconv-lite/encodings/utf7.js +283 -0
  161. package/dist/node_modules/iconv-lite/lib/bom-handling.js +48 -0
  162. package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  163. package/dist/node_modules/iconv-lite/lib/index.js +182 -0
  164. package/dist/node_modules/iconv-lite/lib/streams.js +105 -0
  165. package/dist/node_modules/iconv-lite/package.json +70 -0
  166. package/dist/node_modules/ip-address/LICENSE +19 -0
  167. package/dist/node_modules/ip-address/dist/address-error.js +12 -0
  168. package/dist/node_modules/ip-address/dist/common.js +46 -0
  169. package/dist/node_modules/ip-address/dist/ip-address.js +35 -0
  170. package/dist/node_modules/ip-address/dist/ipv4.js +360 -0
  171. package/dist/node_modules/ip-address/dist/ipv6.js +1003 -0
  172. package/dist/node_modules/ip-address/dist/v4/constants.js +8 -0
  173. package/dist/node_modules/ip-address/dist/v6/constants.js +76 -0
  174. package/dist/node_modules/ip-address/dist/v6/helpers.js +45 -0
  175. package/dist/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
  176. package/dist/node_modules/ip-address/package.json +78 -0
  177. package/dist/node_modules/isexe/dist/commonjs/index.js +56 -0
  178. package/dist/node_modules/isexe/dist/commonjs/index.min.js +2 -0
  179. package/dist/node_modules/isexe/dist/commonjs/options.js +3 -0
  180. package/dist/node_modules/isexe/dist/commonjs/package.json +3 -0
  181. package/dist/node_modules/isexe/dist/commonjs/posix.js +67 -0
  182. package/dist/node_modules/isexe/dist/commonjs/win32.js +63 -0
  183. package/dist/node_modules/isexe/dist/esm/index.js +16 -0
  184. package/dist/node_modules/isexe/dist/esm/index.min.js +2 -0
  185. package/dist/node_modules/isexe/dist/esm/options.js +2 -0
  186. package/dist/node_modules/isexe/dist/esm/package.json +3 -0
  187. package/dist/node_modules/isexe/dist/esm/posix.js +62 -0
  188. package/dist/node_modules/isexe/dist/esm/win32.js +58 -0
  189. package/dist/node_modules/isexe/package.json +78 -0
  190. package/dist/node_modules/lru-cache/dist/commonjs/index.js +1595 -0
  191. package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  192. package/dist/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  193. package/dist/node_modules/lru-cache/dist/esm/index.js +1591 -0
  194. package/dist/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  195. package/dist/node_modules/lru-cache/dist/esm/package.json +3 -0
  196. package/dist/node_modules/lru-cache/package.json +93 -0
  197. package/dist/node_modules/make-fetch-happen/LICENSE +16 -0
  198. package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +471 -0
  199. package/dist/node_modules/make-fetch-happen/lib/cache/errors.js +11 -0
  200. package/dist/node_modules/make-fetch-happen/lib/cache/index.js +49 -0
  201. package/dist/node_modules/make-fetch-happen/lib/cache/key.js +17 -0
  202. package/dist/node_modules/make-fetch-happen/lib/cache/policy.js +161 -0
  203. package/dist/node_modules/make-fetch-happen/lib/fetch.js +118 -0
  204. package/dist/node_modules/make-fetch-happen/lib/index.js +41 -0
  205. package/dist/node_modules/make-fetch-happen/lib/options.js +59 -0
  206. package/dist/node_modules/make-fetch-happen/lib/pipeline.js +41 -0
  207. package/dist/node_modules/make-fetch-happen/lib/remote.js +134 -0
  208. package/dist/node_modules/make-fetch-happen/package.json +75 -0
  209. package/dist/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  210. package/dist/node_modules/minimatch/dist/commonjs/ast.js +846 -0
  211. package/dist/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
  212. package/dist/node_modules/minimatch/dist/commonjs/escape.js +30 -0
  213. package/dist/node_modules/minimatch/dist/commonjs/index.js +1121 -0
  214. package/dist/node_modules/minimatch/dist/commonjs/package.json +3 -0
  215. package/dist/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
  216. package/dist/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  217. package/dist/node_modules/minimatch/dist/esm/ast.js +842 -0
  218. package/dist/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
  219. package/dist/node_modules/minimatch/dist/esm/escape.js +26 -0
  220. package/dist/node_modules/minimatch/dist/esm/index.js +1108 -0
  221. package/dist/node_modules/minimatch/dist/esm/package.json +3 -0
  222. package/dist/node_modules/minimatch/dist/esm/unescape.js +34 -0
  223. package/dist/node_modules/minimatch/package.json +67 -0
  224. package/dist/node_modules/minipass/dist/commonjs/index.js +1038 -0
  225. package/dist/node_modules/minipass/dist/commonjs/package.json +3 -0
  226. package/dist/node_modules/minipass/dist/esm/index.js +1020 -0
  227. package/dist/node_modules/minipass/dist/esm/package.json +3 -0
  228. package/dist/node_modules/minipass/package.json +77 -0
  229. package/dist/node_modules/minipass-collect/LICENSE +15 -0
  230. package/dist/node_modules/minipass-collect/index.js +71 -0
  231. package/dist/node_modules/minipass-collect/package.json +30 -0
  232. package/dist/node_modules/minipass-fetch/LICENSE +28 -0
  233. package/dist/node_modules/minipass-fetch/lib/abort-error.js +17 -0
  234. package/dist/node_modules/minipass-fetch/lib/blob.js +97 -0
  235. package/dist/node_modules/minipass-fetch/lib/body.js +360 -0
  236. package/dist/node_modules/minipass-fetch/lib/fetch-error.js +32 -0
  237. package/dist/node_modules/minipass-fetch/lib/headers.js +267 -0
  238. package/dist/node_modules/minipass-fetch/lib/index.js +376 -0
  239. package/dist/node_modules/minipass-fetch/lib/request.js +282 -0
  240. package/dist/node_modules/minipass-fetch/lib/response.js +90 -0
  241. package/dist/node_modules/minipass-fetch/package.json +70 -0
  242. package/dist/node_modules/minipass-flush/LICENSE +15 -0
  243. package/dist/node_modules/minipass-flush/index.js +39 -0
  244. package/dist/node_modules/minipass-flush/node_modules/minipass/LICENSE +15 -0
  245. package/dist/node_modules/minipass-flush/node_modules/minipass/index.js +649 -0
  246. package/dist/node_modules/minipass-flush/node_modules/minipass/package.json +56 -0
  247. package/dist/node_modules/minipass-flush/package.json +39 -0
  248. package/dist/node_modules/minipass-pipeline/LICENSE +15 -0
  249. package/dist/node_modules/minipass-pipeline/index.js +128 -0
  250. package/dist/node_modules/minipass-pipeline/node_modules/minipass/LICENSE +15 -0
  251. package/dist/node_modules/minipass-pipeline/node_modules/minipass/index.js +649 -0
  252. package/dist/node_modules/minipass-pipeline/node_modules/minipass/package.json +56 -0
  253. package/dist/node_modules/minipass-pipeline/package.json +29 -0
  254. package/dist/node_modules/minipass-sized/LICENSE +15 -0
  255. package/dist/node_modules/minipass-sized/dist/commonjs/index.js +69 -0
  256. package/dist/node_modules/minipass-sized/dist/commonjs/package.json +3 -0
  257. package/dist/node_modules/minipass-sized/dist/esm/index.js +64 -0
  258. package/dist/node_modules/minipass-sized/dist/esm/package.json +3 -0
  259. package/dist/node_modules/minipass-sized/package.json +69 -0
  260. package/dist/node_modules/minizlib/LICENSE +26 -0
  261. package/dist/node_modules/minizlib/dist/commonjs/constants.js +123 -0
  262. package/dist/node_modules/minizlib/dist/commonjs/index.js +416 -0
  263. package/dist/node_modules/minizlib/dist/commonjs/package.json +3 -0
  264. package/dist/node_modules/minizlib/dist/esm/constants.js +117 -0
  265. package/dist/node_modules/minizlib/dist/esm/index.js +363 -0
  266. package/dist/node_modules/minizlib/dist/esm/package.json +3 -0
  267. package/dist/node_modules/minizlib/package.json +80 -0
  268. package/dist/node_modules/ms/index.js +162 -0
  269. package/dist/node_modules/ms/package.json +38 -0
  270. package/dist/node_modules/negotiator/LICENSE +24 -0
  271. package/dist/node_modules/negotiator/index.js +83 -0
  272. package/dist/node_modules/negotiator/lib/charset.js +169 -0
  273. package/dist/node_modules/negotiator/lib/encoding.js +205 -0
  274. package/dist/node_modules/negotiator/lib/language.js +179 -0
  275. package/dist/node_modules/negotiator/lib/mediaType.js +294 -0
  276. package/dist/node_modules/negotiator/package.json +43 -0
  277. package/dist/node_modules/node-gyp/.release-please-manifest.json +3 -0
  278. package/dist/node_modules/node-gyp/LICENSE +24 -0
  279. package/dist/node_modules/node-gyp/addon.gypi +204 -0
  280. package/dist/node_modules/node-gyp/bin/node-gyp.js +145 -0
  281. package/dist/node_modules/node-gyp/eslint.config.js +3 -0
  282. package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +3 -0
  283. package/dist/node_modules/node-gyp/gyp/LICENSE +28 -0
  284. package/dist/node_modules/node-gyp/gyp/data/ninja/build.ninja +4 -0
  285. package/dist/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +12 -0
  286. package/dist/node_modules/node-gyp/gyp/gyp +8 -0
  287. package/dist/node_modules/node-gyp/gyp/gyp.bat +5 -0
  288. package/dist/node_modules/node-gyp/gyp/gyp_main.py +45 -0
  289. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +365 -0
  290. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +206 -0
  291. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1283 -0
  292. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1545 -0
  293. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +59 -0
  294. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +152 -0
  295. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +270 -0
  296. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +599 -0
  297. package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +707 -0
  298. package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +725 -0
  299. package/dist/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +186 -0
  300. package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +170 -0
  301. package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +113 -0
  302. package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +55 -0
  303. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  304. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +805 -0
  305. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1169 -0
  306. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +1316 -0
  307. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +128 -0
  308. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +104 -0
  309. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +461 -0
  310. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +88 -0
  311. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +55 -0
  312. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2755 -0
  313. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3970 -0
  314. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +44 -0
  315. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2956 -0
  316. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +67 -0
  317. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1389 -0
  318. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +26 -0
  319. package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +3097 -0
  320. package/dist/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +99 -0
  321. package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +765 -0
  322. package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1255 -0
  323. package/dist/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +174 -0
  324. package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +61 -0
  325. package/dist/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +371 -0
  326. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1936 -0
  327. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +54 -0
  328. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +301 -0
  329. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +3180 -0
  330. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +64 -0
  331. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE +3 -0
  332. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +177 -0
  333. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.BSD +23 -0
  334. package/dist/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +15 -0
  335. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +107 -0
  336. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +252 -0
  337. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +83 -0
  338. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +359 -0
  339. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +61 -0
  340. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +192 -0
  341. package/dist/node_modules/node-gyp/gyp/pylib/packaging/markers.py +251 -0
  342. package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +824 -0
  343. package/dist/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
  344. package/dist/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +90 -0
  345. package/dist/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +1030 -0
  346. package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +553 -0
  347. package/dist/node_modules/node-gyp/gyp/pylib/packaging/utils.py +172 -0
  348. package/dist/node_modules/node-gyp/gyp/pylib/packaging/version.py +563 -0
  349. package/dist/node_modules/node-gyp/gyp/pyproject.toml +114 -0
  350. package/dist/node_modules/node-gyp/gyp/release-please-config.json +11 -0
  351. package/dist/node_modules/node-gyp/gyp/test_gyp.py +260 -0
  352. package/dist/node_modules/node-gyp/lib/Find-VisualStudio.cs +250 -0
  353. package/dist/node_modules/node-gyp/lib/build.js +230 -0
  354. package/dist/node_modules/node-gyp/lib/clean.js +15 -0
  355. package/dist/node_modules/node-gyp/lib/configure.js +328 -0
  356. package/dist/node_modules/node-gyp/lib/create-config-gypi.js +153 -0
  357. package/dist/node_modules/node-gyp/lib/download.js +39 -0
  358. package/dist/node_modules/node-gyp/lib/find-node-directory.js +63 -0
  359. package/dist/node_modules/node-gyp/lib/find-python.js +304 -0
  360. package/dist/node_modules/node-gyp/lib/find-visualstudio.js +606 -0
  361. package/dist/node_modules/node-gyp/lib/install.js +411 -0
  362. package/dist/node_modules/node-gyp/lib/list.js +26 -0
  363. package/dist/node_modules/node-gyp/lib/log.js +168 -0
  364. package/dist/node_modules/node-gyp/lib/node-gyp.js +199 -0
  365. package/dist/node_modules/node-gyp/lib/process-release.js +146 -0
  366. package/dist/node_modules/node-gyp/lib/rebuild.js +12 -0
  367. package/dist/node_modules/node-gyp/lib/remove.js +43 -0
  368. package/dist/node_modules/node-gyp/lib/util.js +81 -0
  369. package/dist/node_modules/node-gyp/macOS_Catalina_acid_test.sh +21 -0
  370. package/dist/node_modules/node-gyp/package.json +52 -0
  371. package/dist/node_modules/node-gyp/release-please-config.json +40 -0
  372. package/dist/node_modules/node-gyp/src/win_delay_load_hook.cc +41 -0
  373. package/dist/node_modules/nopt/LICENSE +15 -0
  374. package/dist/node_modules/nopt/bin/nopt.js +29 -0
  375. package/dist/node_modules/nopt/lib/debug.js +5 -0
  376. package/dist/node_modules/nopt/lib/nopt-lib.js +514 -0
  377. package/dist/node_modules/nopt/lib/nopt.js +34 -0
  378. package/dist/node_modules/nopt/lib/type-defs.js +91 -0
  379. package/dist/node_modules/nopt/package.json +52 -0
  380. package/dist/node_modules/p-map/index.js +283 -0
  381. package/dist/node_modules/p-map/license +9 -0
  382. package/dist/node_modules/p-map/package.json +57 -0
  383. package/dist/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
  384. package/dist/node_modules/path-scurry/dist/commonjs/package.json +3 -0
  385. package/dist/node_modules/path-scurry/dist/esm/index.js +1983 -0
  386. package/dist/node_modules/path-scurry/dist/esm/package.json +3 -0
  387. package/dist/node_modules/path-scurry/package.json +72 -0
  388. package/dist/node_modules/picomatch/LICENSE +21 -0
  389. package/dist/node_modules/picomatch/index.js +17 -0
  390. package/dist/node_modules/picomatch/lib/constants.js +184 -0
  391. package/dist/node_modules/picomatch/lib/parse.js +1386 -0
  392. package/dist/node_modules/picomatch/lib/picomatch.js +349 -0
  393. package/dist/node_modules/picomatch/lib/scan.js +391 -0
  394. package/dist/node_modules/picomatch/lib/utils.js +72 -0
  395. package/dist/node_modules/picomatch/package.json +82 -0
  396. package/dist/node_modules/picomatch/posix.js +3 -0
  397. package/dist/node_modules/proc-log/LICENSE +15 -0
  398. package/dist/node_modules/proc-log/lib/index.js +158 -0
  399. package/dist/node_modules/proc-log/package.json +46 -0
  400. package/dist/node_modules/safer-buffer/LICENSE +21 -0
  401. package/dist/node_modules/safer-buffer/dangerous.js +58 -0
  402. package/dist/node_modules/safer-buffer/package.json +34 -0
  403. package/dist/node_modules/safer-buffer/safer.js +77 -0
  404. package/dist/node_modules/safer-buffer/tests.js +406 -0
  405. package/dist/node_modules/semver/LICENSE +15 -0
  406. package/dist/node_modules/semver/bin/semver.js +191 -0
  407. package/dist/node_modules/semver/classes/comparator.js +143 -0
  408. package/dist/node_modules/semver/classes/index.js +7 -0
  409. package/dist/node_modules/semver/classes/range.js +557 -0
  410. package/dist/node_modules/semver/classes/semver.js +333 -0
  411. package/dist/node_modules/semver/functions/clean.js +8 -0
  412. package/dist/node_modules/semver/functions/cmp.js +54 -0
  413. package/dist/node_modules/semver/functions/coerce.js +62 -0
  414. package/dist/node_modules/semver/functions/compare-build.js +9 -0
  415. package/dist/node_modules/semver/functions/compare-loose.js +5 -0
  416. package/dist/node_modules/semver/functions/compare.js +7 -0
  417. package/dist/node_modules/semver/functions/diff.js +60 -0
  418. package/dist/node_modules/semver/functions/eq.js +5 -0
  419. package/dist/node_modules/semver/functions/gt.js +5 -0
  420. package/dist/node_modules/semver/functions/gte.js +5 -0
  421. package/dist/node_modules/semver/functions/inc.js +21 -0
  422. package/dist/node_modules/semver/functions/lt.js +5 -0
  423. package/dist/node_modules/semver/functions/lte.js +5 -0
  424. package/dist/node_modules/semver/functions/major.js +5 -0
  425. package/dist/node_modules/semver/functions/minor.js +5 -0
  426. package/dist/node_modules/semver/functions/neq.js +5 -0
  427. package/dist/node_modules/semver/functions/parse.js +18 -0
  428. package/dist/node_modules/semver/functions/patch.js +5 -0
  429. package/dist/node_modules/semver/functions/prerelease.js +8 -0
  430. package/dist/node_modules/semver/functions/rcompare.js +5 -0
  431. package/dist/node_modules/semver/functions/rsort.js +5 -0
  432. package/dist/node_modules/semver/functions/satisfies.js +12 -0
  433. package/dist/node_modules/semver/functions/sort.js +5 -0
  434. package/dist/node_modules/semver/functions/valid.js +8 -0
  435. package/dist/node_modules/semver/index.js +91 -0
  436. package/dist/node_modules/semver/internal/constants.js +37 -0
  437. package/dist/node_modules/semver/internal/debug.js +11 -0
  438. package/dist/node_modules/semver/internal/identifiers.js +29 -0
  439. package/dist/node_modules/semver/internal/lrucache.js +42 -0
  440. package/dist/node_modules/semver/internal/parse-options.js +17 -0
  441. package/dist/node_modules/semver/internal/re.js +223 -0
  442. package/dist/node_modules/semver/package.json +78 -0
  443. package/dist/node_modules/semver/preload.js +4 -0
  444. package/dist/node_modules/semver/range.bnf +16 -0
  445. package/dist/node_modules/semver/ranges/gtr.js +6 -0
  446. package/dist/node_modules/semver/ranges/intersects.js +9 -0
  447. package/dist/node_modules/semver/ranges/ltr.js +6 -0
  448. package/dist/node_modules/semver/ranges/max-satisfying.js +27 -0
  449. package/dist/node_modules/semver/ranges/min-satisfying.js +26 -0
  450. package/dist/node_modules/semver/ranges/min-version.js +63 -0
  451. package/dist/node_modules/semver/ranges/outside.js +82 -0
  452. package/dist/node_modules/semver/ranges/simplify.js +49 -0
  453. package/dist/node_modules/semver/ranges/subset.js +249 -0
  454. package/dist/node_modules/semver/ranges/to-comparators.js +10 -0
  455. package/dist/node_modules/semver/ranges/valid.js +13 -0
  456. package/dist/node_modules/smart-buffer/.prettierrc.yaml +5 -0
  457. package/dist/node_modules/smart-buffer/LICENSE +20 -0
  458. package/dist/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
  459. package/dist/node_modules/smart-buffer/build/utils.js +108 -0
  460. package/dist/node_modules/smart-buffer/package.json +79 -0
  461. package/dist/node_modules/socks/.eslintrc.cjs +11 -0
  462. package/dist/node_modules/socks/.prettierrc.yaml +7 -0
  463. package/dist/node_modules/socks/LICENSE +20 -0
  464. package/dist/node_modules/socks/build/client/socksclient.js +793 -0
  465. package/dist/node_modules/socks/build/common/constants.js +108 -0
  466. package/dist/node_modules/socks/build/common/helpers.js +167 -0
  467. package/dist/node_modules/socks/build/common/receivebuffer.js +43 -0
  468. package/dist/node_modules/socks/build/common/util.js +25 -0
  469. package/dist/node_modules/socks/build/index.js +18 -0
  470. package/dist/node_modules/socks/package.json +58 -0
  471. package/dist/node_modules/socks-proxy-agent/LICENSE +22 -0
  472. package/dist/node_modules/socks-proxy-agent/dist/index.js +195 -0
  473. package/dist/node_modules/socks-proxy-agent/package.json +142 -0
  474. package/dist/node_modules/ssri/lib/index.js +550 -0
  475. package/dist/node_modules/ssri/package.json +66 -0
  476. package/dist/node_modules/tar/dist/commonjs/create.js +82 -0
  477. package/dist/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
  478. package/dist/node_modules/tar/dist/commonjs/extract.js +88 -0
  479. package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
  480. package/dist/node_modules/tar/dist/commonjs/header.js +312 -0
  481. package/dist/node_modules/tar/dist/commonjs/index.js +64 -0
  482. package/dist/node_modules/tar/dist/commonjs/index.min.js +4 -0
  483. package/dist/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
  484. package/dist/node_modules/tar/dist/commonjs/list.js +145 -0
  485. package/dist/node_modules/tar/dist/commonjs/make-command.js +52 -0
  486. package/dist/node_modules/tar/dist/commonjs/mkdir.js +187 -0
  487. package/dist/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
  488. package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
  489. package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
  490. package/dist/node_modules/tar/dist/commonjs/options.js +66 -0
  491. package/dist/node_modules/tar/dist/commonjs/pack.js +511 -0
  492. package/dist/node_modules/tar/dist/commonjs/package.json +3 -0
  493. package/dist/node_modules/tar/dist/commonjs/parse.js +610 -0
  494. package/dist/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
  495. package/dist/node_modules/tar/dist/commonjs/pax.js +158 -0
  496. package/dist/node_modules/tar/dist/commonjs/process-umask.js +7 -0
  497. package/dist/node_modules/tar/dist/commonjs/read-entry.js +136 -0
  498. package/dist/node_modules/tar/dist/commonjs/replace.js +227 -0
  499. package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
  500. package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
  501. package/dist/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
  502. package/dist/node_modules/tar/dist/commonjs/types.js +50 -0
  503. package/dist/node_modules/tar/dist/commonjs/unpack.js +932 -0
  504. package/dist/node_modules/tar/dist/commonjs/update.js +33 -0
  505. package/dist/node_modules/tar/dist/commonjs/warn-method.js +31 -0
  506. package/dist/node_modules/tar/dist/commonjs/winchars.js +14 -0
  507. package/dist/node_modules/tar/dist/commonjs/write-entry.js +698 -0
  508. package/dist/node_modules/tar/dist/esm/create.js +76 -0
  509. package/dist/node_modules/tar/dist/esm/cwd-error.js +14 -0
  510. package/dist/node_modules/tar/dist/esm/extract.js +49 -0
  511. package/dist/node_modules/tar/dist/esm/get-write-flag.js +26 -0
  512. package/dist/node_modules/tar/dist/esm/header.js +275 -0
  513. package/dist/node_modules/tar/dist/esm/index.js +20 -0
  514. package/dist/node_modules/tar/dist/esm/index.min.js +4 -0
  515. package/dist/node_modules/tar/dist/esm/large-numbers.js +94 -0
  516. package/dist/node_modules/tar/dist/esm/list.js +105 -0
  517. package/dist/node_modules/tar/dist/esm/make-command.js +48 -0
  518. package/dist/node_modules/tar/dist/esm/mkdir.js +179 -0
  519. package/dist/node_modules/tar/dist/esm/mode-fix.js +25 -0
  520. package/dist/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
  521. package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
  522. package/dist/node_modules/tar/dist/esm/options.js +54 -0
  523. package/dist/node_modules/tar/dist/esm/pack.js +469 -0
  524. package/dist/node_modules/tar/dist/esm/package.json +3 -0
  525. package/dist/node_modules/tar/dist/esm/parse.js +606 -0
  526. package/dist/node_modules/tar/dist/esm/path-reservations.js +166 -0
  527. package/dist/node_modules/tar/dist/esm/pax.js +154 -0
  528. package/dist/node_modules/tar/dist/esm/process-umask.js +3 -0
  529. package/dist/node_modules/tar/dist/esm/read-entry.js +132 -0
  530. package/dist/node_modules/tar/dist/esm/replace.js +221 -0
  531. package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
  532. package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
  533. package/dist/node_modules/tar/dist/esm/symlink-error.js +15 -0
  534. package/dist/node_modules/tar/dist/esm/types.js +45 -0
  535. package/dist/node_modules/tar/dist/esm/unpack.js +891 -0
  536. package/dist/node_modules/tar/dist/esm/update.js +30 -0
  537. package/dist/node_modules/tar/dist/esm/warn-method.js +27 -0
  538. package/dist/node_modules/tar/dist/esm/winchars.js +9 -0
  539. package/dist/node_modules/tar/dist/esm/write-entry.js +656 -0
  540. package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.js +384 -0
  541. package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +3 -0
  542. package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.js +379 -0
  543. package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +3 -0
  544. package/dist/node_modules/tar/node_modules/yallist/package.json +68 -0
  545. package/dist/node_modules/tar/package.json +297 -0
  546. package/dist/node_modules/tinyglobby/LICENSE +21 -0
  547. package/dist/node_modules/tinyglobby/dist/index.cjs +350 -0
  548. package/dist/node_modules/tinyglobby/dist/index.d.cts +147 -0
  549. package/dist/node_modules/tinyglobby/dist/index.d.mts +147 -0
  550. package/dist/node_modules/tinyglobby/dist/index.mjs +318 -0
  551. package/dist/node_modules/tinyglobby/package.json +73 -0
  552. package/{LICENSE → dist/node_modules/v8-compile-cache/LICENSE} +1 -2
  553. package/dist/node_modules/v8-compile-cache/package.json +34 -0
  554. package/dist/node_modules/v8-compile-cache/v8-compile-cache.js +373 -0
  555. package/dist/node_modules/which/LICENSE +15 -0
  556. package/dist/node_modules/which/bin/which.js +52 -0
  557. package/dist/node_modules/which/lib/index.js +111 -0
  558. package/dist/node_modules/which/package.json +52 -0
  559. package/dist/node_modules/yallist/LICENSE +15 -0
  560. package/dist/node_modules/yallist/iterator.js +8 -0
  561. package/dist/node_modules/yallist/package.json +29 -0
  562. package/dist/node_modules/yallist/yallist.js +426 -0
  563. package/dist/pnpm.mjs +266382 -0
  564. package/dist/pnpmrc +2 -0
  565. package/dist/templates/completion.bash +31 -0
  566. package/dist/templates/completion.fish +22 -0
  567. package/dist/templates/completion.ps1 +193 -0
  568. package/dist/templates/completion.zsh +27 -0
  569. package/dist/vendor/fastlist-0.3.0-x64.exe +0 -0
  570. package/dist/vendor/fastlist-0.3.0-x86.exe +0 -0
  571. package/dist/worker.js +10958 -0
  572. package/package.json +34 -11
  573. package/pn +2 -0
  574. package/pn.cmd +2 -0
  575. package/pn.ps1 +1 -0
  576. package/pnpx +2 -0
  577. package/pnpx.cmd +2 -0
  578. package/pnpx.ps1 +1 -0
  579. package/pnx +2 -0
  580. package/pnx.cmd +2 -0
  581. package/pnx.ps1 +1 -0
  582. package/prepare.js +26 -3
  583. package/setup.js +22 -11
  584. package/CHANGELOG.md +0 -15
@@ -0,0 +1,4 @@
1
+ var kr=Object.defineProperty;var vr=(s,t)=>{for(var e in t)kr(s,e,{get:t[e],enumerable:!0})};import Kr from"events";import I from"fs";import{EventEmitter as Ti}from"node:events";import Ns from"node:stream";import{StringDecoder as Mr}from"node:string_decoder";var Os=typeof process=="object"&&process?process:{stdout:null,stderr:null},Br=s=>!!s&&typeof s=="object"&&(s instanceof D||s instanceof Ns||Pr(s)||zr(s)),Pr=s=>!!s&&typeof s=="object"&&s instanceof Ti&&typeof s.pipe=="function"&&s.pipe!==Ns.Writable.prototype.pipe,zr=s=>!!s&&typeof s=="object"&&s instanceof Ti&&typeof s.write=="function"&&typeof s.end=="function",q=Symbol("EOF"),j=Symbol("maybeEmitEnd"),rt=Symbol("emittedEnd"),Le=Symbol("emittingEnd"),jt=Symbol("emittedError"),Ne=Symbol("closed"),Ts=Symbol("read"),Ae=Symbol("flush"),xs=Symbol("flushChunk"),z=Symbol("encoding"),Mt=Symbol("decoder"),b=Symbol("flowing"),Qt=Symbol("paused"),Bt=Symbol("resume"),_=Symbol("buffer"),A=Symbol("pipes"),g=Symbol("bufferLength"),yi=Symbol("bufferPush"),De=Symbol("bufferShift"),L=Symbol("objectMode"),w=Symbol("destroyed"),Ri=Symbol("error"),bi=Symbol("emitData"),Ls=Symbol("emitEnd"),_i=Symbol("emitEnd2"),Z=Symbol("async"),gi=Symbol("abort"),Ie=Symbol("aborted"),Jt=Symbol("signal"),yt=Symbol("dataListeners"),C=Symbol("discarded"),te=s=>Promise.resolve().then(s),Ur=s=>s(),Hr=s=>s==="end"||s==="finish"||s==="prefinish",Wr=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,Gr=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),Ce=class{src;dest;opts;ondrain;constructor(t,e,i){this.src=t,this.dest=e,this.opts=i,this.ondrain=()=>t[Bt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Oi=class extends Ce{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,i){super(t,e,i),this.proxyErrors=r=>this.dest.emit("error",r),t.on("error",this.proxyErrors)}},Zr=s=>!!s.objectMode,Yr=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",D=class extends Ti{[b]=!1;[Qt]=!1;[A]=[];[_]=[];[L];[z];[Z];[Mt];[q]=!1;[rt]=!1;[Le]=!1;[Ne]=!1;[jt]=null;[g]=0;[w]=!1;[Jt];[Ie]=!1;[yt]=0;[C]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Zr(e)?(this[L]=!0,this[z]=null):Yr(e)?(this[z]=e.encoding,this[L]=!1):(this[L]=!1,this[z]=null),this[Z]=!!e.async,this[Mt]=this[z]?new Mr(this[z]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[_]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[A]});let{signal:i}=e;i&&(this[Jt]=i,i.aborted?this[gi]():i.addEventListener("abort",()=>this[gi]()))}get bufferLength(){return this[g]}get encoding(){return this[z]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[L]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Z]}set async(t){this[Z]=this[Z]||!!t}[gi](){this[Ie]=!0,this.emit("abort",this[Jt]?.reason),this.destroy(this[Jt]?.reason)}get aborted(){return this[Ie]}set aborted(t){}write(t,e,i){if(this[Ie])return!1;if(this[q])throw new Error("write after end");if(this[w])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(i=e,e="utf8"),e||(e="utf8");let r=this[Z]?te:Ur;if(!this[L]&&!Buffer.isBuffer(t)){if(Gr(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(Wr(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[L]?(this[b]&&this[g]!==0&&this[Ae](!0),this[b]?this.emit("data",t):this[yi](t),this[g]!==0&&this.emit("readable"),i&&r(i),this[b]):t.length?(typeof t=="string"&&!(e===this[z]&&!this[Mt]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[z]&&(t=this[Mt].write(t)),this[b]&&this[g]!==0&&this[Ae](!0),this[b]?this.emit("data",t):this[yi](t),this[g]!==0&&this.emit("readable"),i&&r(i),this[b]):(this[g]!==0&&this.emit("readable"),i&&r(i),this[b])}read(t){if(this[w])return null;if(this[C]=!1,this[g]===0||t===0||t&&t>this[g])return this[j](),null;this[L]&&(t=null),this[_].length>1&&!this[L]&&(this[_]=[this[z]?this[_].join(""):Buffer.concat(this[_],this[g])]);let e=this[Ts](t||null,this[_][0]);return this[j](),e}[Ts](t,e){if(this[L])this[De]();else{let i=e;t===i.length||t===null?this[De]():typeof i=="string"?(this[_][0]=i.slice(t),e=i.slice(0,t),this[g]-=t):(this[_][0]=i.subarray(t),e=i.subarray(0,t),this[g]-=t)}return this.emit("data",e),!this[_].length&&!this[q]&&this.emit("drain"),e}end(t,e,i){return typeof t=="function"&&(i=t,t=void 0),typeof e=="function"&&(i=e,e="utf8"),t!==void 0&&this.write(t,e),i&&this.once("end",i),this[q]=!0,this.writable=!1,(this[b]||!this[Qt])&&this[j](),this}[Bt](){this[w]||(!this[yt]&&!this[A].length&&(this[C]=!0),this[Qt]=!1,this[b]=!0,this.emit("resume"),this[_].length?this[Ae]():this[q]?this[j]():this.emit("drain"))}resume(){return this[Bt]()}pause(){this[b]=!1,this[Qt]=!0,this[C]=!1}get destroyed(){return this[w]}get flowing(){return this[b]}get paused(){return this[Qt]}[yi](t){this[L]?this[g]+=1:this[g]+=t.length,this[_].push(t)}[De](){return this[L]?this[g]-=1:this[g]-=this[_][0].length,this[_].shift()}[Ae](t=!1){do;while(this[xs](this[De]())&&this[_].length);!t&&!this[_].length&&!this[q]&&this.emit("drain")}[xs](t){return this.emit("data",t),this[b]}pipe(t,e){if(this[w])return t;this[C]=!1;let i=this[rt];return e=e||{},t===Os.stdout||t===Os.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,i?e.end&&t.end():(this[A].push(e.proxyErrors?new Oi(this,t,e):new Ce(this,t,e)),this[Z]?te(()=>this[Bt]()):this[Bt]()),t}unpipe(t){let e=this[A].find(i=>i.dest===t);e&&(this[A].length===1?(this[b]&&this[yt]===0&&(this[b]=!1),this[A]=[]):this[A].splice(this[A].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let i=super.on(t,e);if(t==="data")this[C]=!1,this[yt]++,!this[A].length&&!this[b]&&this[Bt]();else if(t==="readable"&&this[g]!==0)super.emit("readable");else if(Hr(t)&&this[rt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[jt]){let r=e;this[Z]?te(()=>r.call(this,this[jt])):r.call(this,this[jt])}return i}removeListener(t,e){return this.off(t,e)}off(t,e){let i=super.off(t,e);return t==="data"&&(this[yt]=this.listeners("data").length,this[yt]===0&&!this[C]&&!this[A].length&&(this[b]=!1)),i}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[yt]=0,!this[C]&&!this[A].length&&(this[b]=!1)),e}get emittedEnd(){return this[rt]}[j](){!this[Le]&&!this[rt]&&!this[w]&&this[_].length===0&&this[q]&&(this[Le]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ne]&&this.emit("close"),this[Le]=!1)}emit(t,...e){let i=e[0];if(t!=="error"&&t!=="close"&&t!==w&&this[w])return!1;if(t==="data")return!this[L]&&!i?!1:this[Z]?(te(()=>this[bi](i)),!0):this[bi](i);if(t==="end")return this[Ls]();if(t==="close"){if(this[Ne]=!0,!this[rt]&&!this[w])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[jt]=i,super.emit(Ri,i);let n=!this[Jt]||this.listeners("error").length?super.emit("error",i):!1;return this[j](),n}else if(t==="resume"){let n=super.emit("resume");return this[j](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let r=super.emit(t,...e);return this[j](),r}[bi](t){for(let i of this[A])i.dest.write(t)===!1&&this.pause();let e=this[C]?!1:super.emit("data",t);return this[j](),e}[Ls](){return this[rt]?!1:(this[rt]=!0,this.readable=!1,this[Z]?(te(()=>this[_i]()),!0):this[_i]())}[_i](){if(this[Mt]){let e=this[Mt].end();if(e){for(let i of this[A])i.dest.write(e);this[C]||super.emit("data",e)}}for(let e of this[A])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[L]||(t.dataLength=0);let e=this.promise();return this.on("data",i=>{t.push(i),this[L]||(t.dataLength+=i.length)}),await e,t}async concat(){if(this[L])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[z]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(w,()=>e(new Error("stream destroyed"))),this.on("error",i=>e(i)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[C]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[q])return e();let n,o,h=d=>{this.off("data",a),this.off("end",l),this.off(w,c),e(),o(d)},a=d=>{this.off("error",h),this.off("end",l),this.off(w,c),this.pause(),n({value:d,done:!!this[q]})},l=()=>{this.off("error",h),this.off("data",a),this.off(w,c),e(),n({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise((d,S)=>{o=S,n=d,this.once(w,c),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[C]=!1;let t=!1,e=()=>(this.pause(),this.off(Ri,e),this.off(w,e),this.off("end",e),t=!0,{done:!0,value:void 0}),i=()=>{if(t)return e();let r=this.read();return r===null?e():{done:!1,value:r}};return this.once("end",e),this.once(Ri,e),this.once(w,e),{next:i,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[w])return t?this.emit("error",t):this.emit(w),this;this[w]=!0,this[C]=!0,this[_].length=0,this[g]=0;let e=this;return typeof e.close=="function"&&!this[Ne]&&e.close(),t?this.emit("error",t):this.emit(w),this}static get isStream(){return Br}};var Vr=I.writev,ot=Symbol("_autoClose"),H=Symbol("_close"),ee=Symbol("_ended"),m=Symbol("_fd"),xi=Symbol("_finished"),J=Symbol("_flags"),Li=Symbol("_flush"),Ii=Symbol("_handleChunk"),Ci=Symbol("_makeBuf"),se=Symbol("_mode"),Fe=Symbol("_needDrain"),Ut=Symbol("_onerror"),Ht=Symbol("_onopen"),Ni=Symbol("_onread"),Pt=Symbol("_onwrite"),ht=Symbol("_open"),U=Symbol("_path"),nt=Symbol("_pos"),Y=Symbol("_queue"),zt=Symbol("_read"),Ai=Symbol("_readSize"),Q=Symbol("_reading"),ie=Symbol("_remain"),Di=Symbol("_size"),ke=Symbol("_write"),Rt=Symbol("_writing"),ve=Symbol("_defaultFlag"),bt=Symbol("_errored"),_t=class extends D{[bt]=!1;[m];[U];[Ai];[Q]=!1;[Di];[ie];[ot];constructor(t,e){if(e=e||{},super(e),this.readable=!0,this.writable=!1,typeof t!="string")throw new TypeError("path must be a string");this[bt]=!1,this[m]=typeof e.fd=="number"?e.fd:void 0,this[U]=t,this[Ai]=e.readSize||16*1024*1024,this[Q]=!1,this[Di]=typeof e.size=="number"?e.size:1/0,this[ie]=this[Di],this[ot]=typeof e.autoClose=="boolean"?e.autoClose:!0,typeof this[m]=="number"?this[zt]():this[ht]()}get fd(){return this[m]}get path(){return this[U]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[ht](){I.open(this[U],"r",(t,e)=>this[Ht](t,e))}[Ht](t,e){t?this[Ut](t):(this[m]=e,this.emit("open",e),this[zt]())}[Ci](){return Buffer.allocUnsafe(Math.min(this[Ai],this[ie]))}[zt](){if(!this[Q]){this[Q]=!0;let t=this[Ci]();if(t.length===0)return process.nextTick(()=>this[Ni](null,0,t));I.read(this[m],t,0,t.length,null,(e,i,r)=>this[Ni](e,i,r))}}[Ni](t,e,i){this[Q]=!1,t?this[Ut](t):this[Ii](e,i)&&this[zt]()}[H](){if(this[ot]&&typeof this[m]=="number"){let t=this[m];this[m]=void 0,I.close(t,e=>e?this.emit("error",e):this.emit("close"))}}[Ut](t){this[Q]=!0,this[H](),this.emit("error",t)}[Ii](t,e){let i=!1;return this[ie]-=t,t>0&&(i=super.write(t<e.length?e.subarray(0,t):e)),(t===0||this[ie]<=0)&&(i=!1,this[H](),super.end()),i}emit(t,...e){switch(t){case"prefinish":case"finish":return!1;case"drain":return typeof this[m]=="number"&&this[zt](),!1;case"error":return this[bt]?!1:(this[bt]=!0,super.emit(t,...e));default:return super.emit(t,...e)}}},Me=class extends _t{[ht](){let t=!0;try{this[Ht](null,I.openSync(this[U],"r")),t=!1}finally{t&&this[H]()}}[zt](){let t=!0;try{if(!this[Q]){this[Q]=!0;do{let e=this[Ci](),i=e.length===0?0:I.readSync(this[m],e,0,e.length,null);if(!this[Ii](i,e))break}while(!0);this[Q]=!1}t=!1}finally{t&&this[H]()}}[H](){if(this[ot]&&typeof this[m]=="number"){let t=this[m];this[m]=void 0,I.closeSync(t),this.emit("close")}}},tt=class extends Kr{readable=!1;writable=!0;[bt]=!1;[Rt]=!1;[ee]=!1;[Y]=[];[Fe]=!1;[U];[se];[ot];[m];[ve];[J];[xi]=!1;[nt];constructor(t,e){e=e||{},super(e),this[U]=t,this[m]=typeof e.fd=="number"?e.fd:void 0,this[se]=e.mode===void 0?438:e.mode,this[nt]=typeof e.start=="number"?e.start:void 0,this[ot]=typeof e.autoClose=="boolean"?e.autoClose:!0;let i=this[nt]!==void 0?"r+":"w";this[ve]=e.flags===void 0,this[J]=e.flags===void 0?i:e.flags,this[m]===void 0&&this[ht]()}emit(t,...e){if(t==="error"){if(this[bt])return!1;this[bt]=!0}return super.emit(t,...e)}get fd(){return this[m]}get path(){return this[U]}[Ut](t){this[H](),this[Rt]=!0,this.emit("error",t)}[ht](){I.open(this[U],this[J],this[se],(t,e)=>this[Ht](t,e))}[Ht](t,e){this[ve]&&this[J]==="r+"&&t&&t.code==="ENOENT"?(this[J]="w",this[ht]()):t?this[Ut](t):(this[m]=e,this.emit("open",e),this[Rt]||this[Li]())}end(t,e){return t&&this.write(t,e),this[ee]=!0,!this[Rt]&&!this[Y].length&&typeof this[m]=="number"&&this[Pt](null,0),this}write(t,e){return typeof t=="string"&&(t=Buffer.from(t,e)),this[ee]?(this.emit("error",new Error("write() after end()")),!1):this[m]===void 0||this[Rt]||this[Y].length?(this[Y].push(t),this[Fe]=!0,!1):(this[Rt]=!0,this[ke](t),!0)}[ke](t){I.write(this[m],t,0,t.length,this[nt],(e,i)=>this[Pt](e,i))}[Pt](t,e){t?this[Ut](t):(this[nt]!==void 0&&typeof e=="number"&&(this[nt]+=e),this[Y].length?this[Li]():(this[Rt]=!1,this[ee]&&!this[xi]?(this[xi]=!0,this[H](),this.emit("finish")):this[Fe]&&(this[Fe]=!1,this.emit("drain"))))}[Li](){if(this[Y].length===0)this[ee]&&this[Pt](null,0);else if(this[Y].length===1)this[ke](this[Y].pop());else{let t=this[Y];this[Y]=[],Vr(this[m],t,this[nt],(e,i)=>this[Pt](e,i))}}[H](){if(this[ot]&&typeof this[m]=="number"){let t=this[m];this[m]=void 0,I.close(t,e=>e?this.emit("error",e):this.emit("close"))}}},Wt=class extends tt{[ht](){let t;if(this[ve]&&this[J]==="r+")try{t=I.openSync(this[U],this[J],this[se])}catch(e){if(e?.code==="ENOENT")return this[J]="w",this[ht]();throw e}else t=I.openSync(this[U],this[J],this[se]);this[Ht](null,t)}[H](){if(this[ot]&&typeof this[m]=="number"){let t=this[m];this[m]=void 0,I.closeSync(t),this.emit("close")}}[ke](t){let e=!0;try{this[Pt](null,I.writeSync(this[m],t,0,t.length,this[nt])),e=!1}finally{if(e)try{this[H]()}catch{}}}};import nr from"node:path";import Vt from"node:fs";import{dirname as xn,parse as Ln}from"path";var $r=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),As=s=>!!s.sync&&!!s.file,Ds=s=>!s.sync&&!!s.file,Is=s=>!!s.sync&&!s.file,Cs=s=>!s.sync&&!s.file;var Fs=s=>!!s.file;var Xr=s=>{let t=$r.get(s);return t||s},re=(s={})=>{if(!s)return{};let t={};for(let[e,i]of Object.entries(s)){let r=Xr(e);t[r]=i}return t.chmod===void 0&&t.noChmod===!1&&(t.chmod=!0),delete t.noChmod,t};var K=(s,t,e,i,r)=>Object.assign((n=[],o,h)=>{Array.isArray(n)&&(o=n,n={}),typeof o=="function"&&(h=o,o=void 0),o=o?Array.from(o):[];let a=re(n);if(r?.(a,o),As(a)){if(typeof h=="function")throw new TypeError("callback not supported for sync tar functions");return s(a,o)}else if(Ds(a)){let l=t(a,o);return h?l.then(()=>h(),h):l}else if(Is(a)){if(typeof h=="function")throw new TypeError("callback not supported for sync tar functions");return e(a,o)}else if(Cs(a)){if(typeof h=="function")throw new TypeError("callback only supported with file option");return i(a,o)}throw new Error("impossible options??")},{syncFile:s,asyncFile:t,syncNoFile:e,asyncNoFile:i,validate:r});import{EventEmitter as _n}from"events";import Mi from"assert";import{Buffer as gt}from"buffer";import*as ks from"zlib";import qr from"zlib";var jr=qr.constants||{ZLIB_VERNUM:4736},M=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},jr));var Qr=gt.concat,vs=Object.getOwnPropertyDescriptor(gt,"concat"),Jr=s=>s,ki=vs?.writable===!0||vs?.set!==void 0?s=>{gt.concat=s?Jr:Qr}:s=>{},Ot=Symbol("_superWrite"),Gt=class extends Error{code;errno;constructor(t,e){super("zlib: "+t.message,{cause:t}),this.code=t.code,this.errno=t.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+t.message,Error.captureStackTrace(this,e??this.constructor)}get name(){return"ZlibError"}},vi=Symbol("flushFlag"),ne=class extends D{#t=!1;#i=!1;#s;#n;#r;#e;#o;get sawError(){return this.#t}get handle(){return this.#e}get flushFlag(){return this.#s}constructor(t,e){if(!t||typeof t!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(t),this.#s=t.flush??0,this.#n=t.finishFlush??0,this.#r=t.fullFlushFlag??0,typeof ks[e]!="function")throw new TypeError("Compression method not supported: "+e);try{this.#e=new ks[e](t)}catch(i){throw new Gt(i,this.constructor)}this.#o=i=>{this.#t||(this.#t=!0,this.close(),this.emit("error",i))},this.#e?.on("error",i=>this.#o(new Gt(i))),this.once("end",()=>this.close)}close(){this.#e&&(this.#e.close(),this.#e=void 0,this.emit("close"))}reset(){if(!this.#t)return Mi(this.#e,"zlib binding closed"),this.#e.reset?.()}flush(t){this.ended||(typeof t!="number"&&(t=this.#r),this.write(Object.assign(gt.alloc(0),{[vi]:t})))}end(t,e,i){return typeof t=="function"&&(i=t,e=void 0,t=void 0),typeof e=="function"&&(i=e,e=void 0),t&&(e?this.write(t,e):this.write(t)),this.flush(this.#n),this.#i=!0,super.end(i)}get ended(){return this.#i}[Ot](t){return super.write(t)}write(t,e,i){if(typeof e=="function"&&(i=e,e="utf8"),typeof t=="string"&&(t=gt.from(t,e)),this.#t)return;Mi(this.#e,"zlib binding closed");let r=this.#e._handle,n=r.close;r.close=()=>{};let o=this.#e.close;this.#e.close=()=>{},ki(!0);let h;try{let l=typeof t[vi]=="number"?t[vi]:this.#s;h=this.#e._processChunk(t,l),ki(!1)}catch(l){ki(!1),this.#o(new Gt(l,this.write))}finally{this.#e&&(this.#e._handle=r,r.close=n,this.#e.close=o,this.#e.removeAllListeners("error"))}this.#e&&this.#e.on("error",l=>this.#o(new Gt(l,this.write)));let a;if(h)if(Array.isArray(h)&&h.length>0){let l=h[0];a=this[Ot](gt.from(l));for(let c=1;c<h.length;c++)a=this[Ot](h[c])}else a=this[Ot](gt.from(h));return i&&i(),a}},Be=class extends ne{#t;#i;constructor(t,e){t=t||{},t.flush=t.flush||M.Z_NO_FLUSH,t.finishFlush=t.finishFlush||M.Z_FINISH,t.fullFlushFlag=M.Z_FULL_FLUSH,super(t,e),this.#t=t.level,this.#i=t.strategy}params(t,e){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#t!==t||this.#i!==e){this.flush(M.Z_SYNC_FLUSH),Mi(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(r,n)=>{typeof r=="function"&&(n=r,r=this.flushFlag),this.flush(r),n?.()};try{this.handle.params(t,e)}finally{this.handle.flush=i}this.handle&&(this.#t=t,this.#i=e)}}}};var Pe=class extends Be{#t;constructor(t){super(t,"Gzip"),this.#t=t&&!!t.portable}[Ot](t){return this.#t?(this.#t=!1,t[9]=255,super[Ot](t)):super[Ot](t)}};var ze=class extends Be{constructor(t){super(t,"Unzip")}},Ue=class extends ne{constructor(t,e){t=t||{},t.flush=t.flush||M.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||M.BROTLI_OPERATION_FINISH,t.fullFlushFlag=M.BROTLI_OPERATION_FLUSH,super(t,e)}},He=class extends Ue{constructor(t){super(t,"BrotliCompress")}},We=class extends Ue{constructor(t){super(t,"BrotliDecompress")}},Ge=class extends ne{constructor(t,e){t=t||{},t.flush=t.flush||M.ZSTD_e_continue,t.finishFlush=t.finishFlush||M.ZSTD_e_end,t.fullFlushFlag=M.ZSTD_e_flush,super(t,e)}},Ze=class extends Ge{constructor(t){super(t,"ZstdCompress")}},Ye=class extends Ge{constructor(t){super(t,"ZstdDecompress")}};import{posix as Zt}from"node:path";var Ms=(s,t)=>{if(Number.isSafeInteger(s))s<0?sn(s,t):en(s,t);else throw Error("cannot encode number outside of javascript safe integer range");return t},en=(s,t)=>{t[0]=128;for(var e=t.length;e>1;e--)t[e-1]=s&255,s=Math.floor(s/256)},sn=(s,t)=>{t[0]=255;var e=!1;s=s*-1;for(var i=t.length;i>1;i--){var r=s&255;s=Math.floor(s/256),e?t[i-1]=Ps(r):r===0?t[i-1]=0:(e=!0,t[i-1]=zs(r))}},Bs=s=>{let t=s[0],e=t===128?nn(s.subarray(1,s.length)):t===255?rn(s):null;if(e===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(e))throw Error("parsed number outside of javascript safe integer range");return e},rn=s=>{for(var t=s.length,e=0,i=!1,r=t-1;r>-1;r--){var n=Number(s[r]),o;i?o=Ps(n):n===0?o=n:(i=!0,o=zs(n)),o!==0&&(e-=o*Math.pow(256,t-r-1))}return e},nn=s=>{for(var t=s.length,e=0,i=t-1;i>-1;i--){var r=Number(s[i]);r!==0&&(e+=r*Math.pow(256,t-i-1))}return e},Ps=s=>(255^s)&255,zs=s=>(255^s)+1&255;var Bi={};vr(Bi,{code:()=>Ke,isCode:()=>oe,isName:()=>hn,name:()=>he});var oe=s=>he.has(s),hn=s=>Ke.has(s),he=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),Ke=new Map(Array.from(he).map(s=>[s[1],s[0]]));var F=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#t="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(t,e=0,i,r){Buffer.isBuffer(t)?this.decode(t,e||0,i,r):t&&this.#i(t)}decode(t,e,i,r){if(e||(e=0),!t||!(t.length>=e+512))throw new Error("need 512 bytes for header");this.path=i?.path??Tt(t,e,100),this.mode=i?.mode??r?.mode??at(t,e+100,8),this.uid=i?.uid??r?.uid??at(t,e+108,8),this.gid=i?.gid??r?.gid??at(t,e+116,8),this.size=i?.size??r?.size??at(t,e+124,12),this.mtime=i?.mtime??r?.mtime??Pi(t,e+136,12),this.cksum=at(t,e+148,12),r&&this.#i(r,!0),i&&this.#i(i);let n=Tt(t,e+156,1);if(oe(n)&&(this.#t=n||"0"),this.#t==="0"&&this.path.slice(-1)==="/"&&(this.#t="5"),this.#t==="5"&&(this.size=0),this.linkpath=Tt(t,e+157,100),t.subarray(e+257,e+265).toString()==="ustar\x0000")if(this.uname=i?.uname??r?.uname??Tt(t,e+265,32),this.gname=i?.gname??r?.gname??Tt(t,e+297,32),this.devmaj=i?.devmaj??r?.devmaj??at(t,e+329,8)??0,this.devmin=i?.devmin??r?.devmin??at(t,e+337,8)??0,t[e+475]!==0){let h=Tt(t,e+345,155);this.path=h+"/"+this.path}else{let h=Tt(t,e+345,130);h&&(this.path=h+"/"+this.path),this.atime=i?.atime??r?.atime??Pi(t,e+476,12),this.ctime=i?.ctime??r?.ctime??Pi(t,e+488,12)}let o=256;for(let h=e;h<e+148;h++)o+=t[h];for(let h=e+156;h<e+512;h++)o+=t[h];this.cksumValid=o===this.cksum,this.cksum===void 0&&o===256&&(this.nullBlock=!0)}#i(t,e=!1){Object.assign(this,Object.fromEntries(Object.entries(t).filter(([i,r])=>!(r==null||i==="path"&&e||i==="linkpath"&&e||i==="global"))))}encode(t,e=0){if(t||(t=this.block=Buffer.alloc(512)),this.#t==="Unsupported"&&(this.#t="0"),!(t.length>=e+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,r=an(this.path||"",i),n=r[0],o=r[1];this.needPax=!!r[2],this.needPax=xt(t,e,100,n)||this.needPax,this.needPax=lt(t,e+100,8,this.mode)||this.needPax,this.needPax=lt(t,e+108,8,this.uid)||this.needPax,this.needPax=lt(t,e+116,8,this.gid)||this.needPax,this.needPax=lt(t,e+124,12,this.size)||this.needPax,this.needPax=zi(t,e+136,12,this.mtime)||this.needPax,t[e+156]=Number(this.#t.codePointAt(0)),this.needPax=xt(t,e+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",e+257,8),this.needPax=xt(t,e+265,32,this.uname)||this.needPax,this.needPax=xt(t,e+297,32,this.gname)||this.needPax,this.needPax=lt(t,e+329,8,this.devmaj)||this.needPax,this.needPax=lt(t,e+337,8,this.devmin)||this.needPax,this.needPax=xt(t,e+345,i,o)||this.needPax,t[e+475]!==0?this.needPax=xt(t,e+345,155,o)||this.needPax:(this.needPax=xt(t,e+345,130,o)||this.needPax,this.needPax=zi(t,e+476,12,this.atime)||this.needPax,this.needPax=zi(t,e+488,12,this.ctime)||this.needPax);let h=256;for(let a=e;a<e+148;a++)h+=t[a];for(let a=e+156;a<e+512;a++)h+=t[a];return this.cksum=h,lt(t,e+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#t==="Unsupported"?this.#t:he.get(this.#t)}get typeKey(){return this.#t}set type(t){let e=String(Ke.get(t));if(oe(e)||e==="Unsupported")this.#t=e;else if(oe(t))this.#t=t;else throw new TypeError("invalid entry type: "+t)}},an=(s,t)=>{let i=s,r="",n,o=Zt.parse(s).root||".";if(Buffer.byteLength(i)<100)n=[i,r,!1];else{r=Zt.dirname(i),i=Zt.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(r)<=t?n=[i,r,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(r)<=t?n=[i.slice(0,99),r,!0]:(i=Zt.join(Zt.basename(r),i),r=Zt.dirname(r));while(r!==o&&n===void 0);n||(n=[s.slice(0,99),"",!0])}return n},Tt=(s,t,e)=>s.subarray(t,t+e).toString("utf8").replace(/\0.*/,""),Pi=(s,t,e)=>ln(at(s,t,e)),ln=s=>s===void 0?void 0:new Date(s*1e3),at=(s,t,e)=>Number(s[t])&128?Bs(s.subarray(t,t+e)):fn(s,t,e),cn=s=>isNaN(s)?void 0:s,fn=(s,t,e)=>cn(parseInt(s.subarray(t,t+e).toString("utf8").replace(/\0.*$/,"").trim(),8)),dn={12:8589934591,8:2097151},lt=(s,t,e,i)=>i===void 0?!1:i>dn[e]||i<0?(Ms(i,s.subarray(t,t+e)),!0):(un(s,t,e,i),!1),un=(s,t,e,i)=>s.write(mn(i,e),t,e,"ascii"),mn=(s,t)=>pn(Math.floor(s).toString(8),t),pn=(s,t)=>(s.length===t-1?s:new Array(t-s.length-1).join("0")+s+" ")+"\0",zi=(s,t,e,i)=>i===void 0?!1:lt(s,t,e,i.getTime()/1e3),En=new Array(156).join("\0"),xt=(s,t,e,i)=>i===void 0?!1:(s.write(i+En,t,e,"utf8"),i.length!==Buffer.byteLength(i)||i.length>e);import{basename as wn}from"node:path";var ct=class s{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(t,e=!1){this.atime=t.atime,this.charset=t.charset,this.comment=t.comment,this.ctime=t.ctime,this.dev=t.dev,this.gid=t.gid,this.global=e,this.gname=t.gname,this.ino=t.ino,this.linkpath=t.linkpath,this.mtime=t.mtime,this.nlink=t.nlink,this.path=t.path,this.size=t.size,this.uid=t.uid,this.uname=t.uname}encode(){let t=this.encodeBody();if(t==="")return Buffer.allocUnsafe(0);let e=Buffer.byteLength(t),i=512*Math.ceil(1+e/512),r=Buffer.allocUnsafe(i);for(let n=0;n<512;n++)r[n]=0;new F({path:("PaxHeader/"+wn(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:e,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(r),r.write(t,512,e,"utf8");for(let n=e+512;n<r.length;n++)r[n]=0;return r}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(this[t]===void 0)return"";let e=this[t],i=e instanceof Date?e.getTime()/1e3:e,r=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+i+`
2
+ `,n=Buffer.byteLength(r),o=Math.floor(Math.log(n)/Math.log(10))+1;return n+o>=Math.pow(10,o)&&(o+=1),o+n+r}static parse(t,e,i=!1){return new s(Sn(yn(t),e),i)}},Sn=(s,t)=>t?Object.assign({},t,s):s,yn=s=>s.replace(/\n$/,"").split(`
3
+ `).reduce(Rn,Object.create(null)),Rn=(s,t)=>{let e=parseInt(t,10);if(e!==Buffer.byteLength(t)+1)return s;t=t.slice((e+" ").length);let i=t.split("="),r=i.shift();if(!r)return s;let n=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=i.join("=");return s[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(o)*1e3):/^[0-9]+$/.test(o)?+o:o,s};var bn=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,f=bn!=="win32"?s=>s:s=>s&&s.replaceAll(/\\/g,"/");var Yt=class extends D{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(t,e,i){switch(super({}),this.pause(),this.extended=e,this.globalExtended=i,this.header=t,this.remain=t.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=t.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!t.path)throw new Error("no path provided for tar.ReadEntry");this.path=f(t.path),this.mode=t.mode,this.mode&&(this.mode=this.mode&4095),this.uid=t.uid,this.gid=t.gid,this.uname=t.uname,this.gname=t.gname,this.size=this.remain,this.mtime=t.mtime,this.atime=t.atime,this.ctime=t.ctime,this.linkpath=t.linkpath?f(t.linkpath):void 0,this.uname=t.uname,this.gname=t.gname,e&&this.#t(e),i&&this.#t(i,!0)}write(t){let e=t.length;if(e>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,r=this.blockRemain;return this.remain=Math.max(0,i-e),this.blockRemain=Math.max(0,r-e),this.ignore?!0:i>=e?super.write(t):super.write(t.subarray(0,i))}#t(t,e=!1){t.path&&(t.path=f(t.path)),t.linkpath&&(t.linkpath=f(t.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(t).filter(([i,r])=>!(r==null||i==="path"&&e))))}};var Lt=(s,t,e,i={})=>{s.file&&(i.file=s.file),s.cwd&&(i.cwd=s.cwd),i.code=e instanceof Error&&e.code||t,i.tarCode=t,!s.strict&&i.recoverable!==!1?(e instanceof Error&&(i=Object.assign(e,i),e=e.message),s.emit("warn",t,e,i)):e instanceof Error?s.emit("error",Object.assign(e,i)):s.emit("error",Object.assign(new Error(`${t}: ${e}`),i))};var gn=1024*1024,Zi=Buffer.from([31,139]),Yi=Buffer.from([40,181,47,253]),On=Math.max(Zi.length,Yi.length),B=Symbol("state"),Nt=Symbol("writeEntry"),et=Symbol("readEntry"),Ui=Symbol("nextEntry"),Us=Symbol("processEntry"),V=Symbol("extendedHeader"),ae=Symbol("globalExtendedHeader"),ft=Symbol("meta"),Hs=Symbol("emitMeta"),p=Symbol("buffer"),it=Symbol("queue"),dt=Symbol("ended"),Hi=Symbol("emittedEnd"),At=Symbol("emit"),y=Symbol("unzip"),Ve=Symbol("consumeChunk"),$e=Symbol("consumeChunkSub"),Wi=Symbol("consumeBody"),Ws=Symbol("consumeMeta"),Gs=Symbol("consumeHeader"),le=Symbol("consuming"),Gi=Symbol("bufferConcat"),Xe=Symbol("maybeEnd"),Kt=Symbol("writing"),ut=Symbol("aborted"),qe=Symbol("onDone"),Dt=Symbol("sawValidEntry"),je=Symbol("sawNullBlock"),Qe=Symbol("sawEOF"),Zs=Symbol("closeStream"),Tn=()=>!0,st=class extends _n{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[it]=[];[p];[et];[Nt];[B]="begin";[ft]="";[V];[ae];[dt]=!1;[y];[ut]=!1;[Dt];[je]=!1;[Qe]=!1;[Kt]=!1;[le]=!1;[Hi]=!1;constructor(t={}){super(),this.file=t.file||"",this.on(qe,()=>{(this[B]==="begin"||this[Dt]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),t.ondone?this.on(qe,t.ondone):this.on(qe,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!t.strict,this.maxMetaEntrySize=t.maxMetaEntrySize||gn,this.filter=typeof t.filter=="function"?t.filter:Tn;let e=t.file&&(t.file.endsWith(".tar.br")||t.file.endsWith(".tbr"));this.brotli=!(t.gzip||t.zstd)&&t.brotli!==void 0?t.brotli:e?void 0:!1;let i=t.file&&(t.file.endsWith(".tar.zst")||t.file.endsWith(".tzst"));this.zstd=!(t.gzip||t.brotli)&&t.zstd!==void 0?t.zstd:i?!0:void 0,this.on("end",()=>this[Zs]()),typeof t.onwarn=="function"&&this.on("warn",t.onwarn),typeof t.onReadEntry=="function"&&this.on("entry",t.onReadEntry)}warn(t,e,i={}){Lt(this,t,e,i)}[Gs](t,e){this[Dt]===void 0&&(this[Dt]=!1);let i;try{i=new F(t,e,this[V],this[ae])}catch(r){return this.warn("TAR_ENTRY_INVALID",r)}if(i.nullBlock)this[je]?(this[Qe]=!0,this[B]==="begin"&&(this[B]="header"),this[At]("eof")):(this[je]=!0,this[At]("nullBlock"));else if(this[je]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let r=i.type;if(/^(Symbolic)?Link$/.test(r)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(r)&&!/^(Global)?ExtendedHeader$/.test(r)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let n=this[Nt]=new Yt(i,this[V],this[ae]);if(!this[Dt])if(n.remain){let o=()=>{n.invalid||(this[Dt]=!0)};n.on("end",o)}else this[Dt]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[At]("ignoredEntry",n),this[B]="ignore",n.resume()):n.size>0&&(this[ft]="",n.on("data",o=>this[ft]+=o),this[B]="meta"):(this[V]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[At]("ignoredEntry",n),this[B]=n.remain?"ignore":"header",n.resume()):(n.remain?this[B]="body":(this[B]="header",n.end()),this[et]?this[it].push(n):(this[it].push(n),this[Ui]())))}}}[Zs](){queueMicrotask(()=>this.emit("close"))}[Us](t){let e=!0;if(!t)this[et]=void 0,e=!1;else if(Array.isArray(t)){let[i,...r]=t;this.emit(i,...r)}else this[et]=t,this.emit("entry",t),t.emittedEnd||(t.on("end",()=>this[Ui]()),e=!1);return e}[Ui](){do;while(this[Us](this[it].shift()));if(this[it].length===0){let t=this[et];!t||t.flowing||t.size===t.remain?this[Kt]||this.emit("drain"):t.once("drain",()=>this.emit("drain"))}}[Wi](t,e){let i=this[Nt];if(!i)throw new Error("attempt to consume body without entry??");let r=i.blockRemain??0,n=r>=t.length&&e===0?t:t.subarray(e,e+r);return i.write(n),i.blockRemain||(this[B]="header",this[Nt]=void 0,i.end()),n.length}[Ws](t,e){let i=this[Nt],r=this[Wi](t,e);return!this[Nt]&&i&&this[Hs](i),r}[At](t,e,i){this[it].length===0&&!this[et]?this.emit(t,e,i):this[it].push([t,e,i])}[Hs](t){switch(this[At]("meta",this[ft]),t.type){case"ExtendedHeader":case"OldExtendedHeader":this[V]=ct.parse(this[ft],this[V],!1);break;case"GlobalExtendedHeader":this[ae]=ct.parse(this[ft],this[ae],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let e=this[V]??Object.create(null);this[V]=e,e.path=this[ft].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let e=this[V]||Object.create(null);this[V]=e,e.linkpath=this[ft].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+t.type)}}abort(t){this[ut]=!0,this.emit("abort",t),this.warn("TAR_ABORT",t,{recoverable:!1})}write(t,e,i){if(typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof e=="string"?e:"utf8")),this[ut])return i?.(),!1;if((this[y]===void 0||this.brotli===void 0&&this[y]===!1)&&t){if(this[p]&&(t=Buffer.concat([this[p],t]),this[p]=void 0),t.length<On)return this[p]=t,i?.(),!0;for(let a=0;this[y]===void 0&&a<Zi.length;a++)t[a]!==Zi[a]&&(this[y]=!1);let o=!1;if(this[y]===!1&&this.zstd!==!1){o=!0;for(let a=0;a<Yi.length;a++)if(t[a]!==Yi[a]){o=!1;break}}let h=this.brotli===void 0&&!o;if(this[y]===!1&&h)if(t.length<512)if(this[dt])this.brotli=!0;else return this[p]=t,i?.(),!0;else try{new F(t.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[y]===void 0||this[y]===!1&&(this.brotli||o)){let a=this[dt];this[dt]=!1,this[y]=this[y]===void 0?new ze({}):o?new Ye({}):new We({}),this[y].on("data",c=>this[Ve](c)),this[y].on("error",c=>this.abort(c)),this[y].on("end",()=>{this[dt]=!0,this[Ve]()}),this[Kt]=!0;let l=!!this[y][a?"end":"write"](t);return this[Kt]=!1,i?.(),l}}this[Kt]=!0,this[y]?this[y].write(t):this[Ve](t),this[Kt]=!1;let n=this[it].length>0?!1:this[et]?this[et].flowing:!0;return!n&&this[it].length===0&&this[et]?.once("drain",()=>this.emit("drain")),i?.(),n}[Gi](t){t&&!this[ut]&&(this[p]=this[p]?Buffer.concat([this[p],t]):t)}[Xe](){if(this[dt]&&!this[Hi]&&!this[ut]&&!this[le]){this[Hi]=!0;let t=this[Nt];if(t&&t.blockRemain){let e=this[p]?this[p].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${e} available)`,{entry:t}),this[p]&&t.write(this[p]),t.end()}this[At](qe)}}[Ve](t){if(this[le]&&t)this[Gi](t);else if(!t&&!this[p])this[Xe]();else if(t){if(this[le]=!0,this[p]){this[Gi](t);let e=this[p];this[p]=void 0,this[$e](e)}else this[$e](t);for(;this[p]&&this[p]?.length>=512&&!this[ut]&&!this[Qe];){let e=this[p];this[p]=void 0,this[$e](e)}this[le]=!1}(!this[p]||this[dt])&&this[Xe]()}[$e](t){let e=0,i=t.length;for(;e+512<=i&&!this[ut]&&!this[Qe];)switch(this[B]){case"begin":case"header":this[Gs](t,e),e+=512;break;case"ignore":case"body":e+=this[Wi](t,e);break;case"meta":e+=this[Ws](t,e);break;default:throw new Error("invalid state: "+this[B])}e<i&&(this[p]=this[p]?Buffer.concat([t.subarray(e),this[p]]):t.subarray(e))}end(t,e,i){return typeof t=="function"&&(i=t,e=void 0,t=void 0),typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,e)),i&&this.once("finish",i),this[ut]||(this[y]?(t&&this[y].write(t),this[y].end()):(this[dt]=!0,(this.brotli===void 0||this.zstd===void 0)&&(t=t||Buffer.alloc(0)),t&&this.write(t),this[Xe]())),this}};var mt=s=>{let t=s.length-1,e=-1;for(;t>-1&&s.charAt(t)==="/";)e=t,t--;return e===-1?s:s.slice(0,e)};var Nn=s=>{let t=s.onReadEntry;s.onReadEntry=t?e=>{t(e),e.resume()}:e=>e.resume()},Ki=(s,t)=>{let e=new Map(t.map(n=>[mt(n),!0])),i=s.filter,r=(n,o="")=>{let h=o||Ln(n).root||".",a;if(n===h)a=!1;else{let l=e.get(n);a=l!==void 0?l:r(xn(n),h)}return e.set(n,a),a};s.filter=i?(n,o)=>i(n,o)&&r(mt(n)):n=>r(mt(n))},An=s=>{let t=new st(s),e=s.file,i;try{i=Vt.openSync(e,"r");let r=Vt.fstatSync(i),n=s.maxReadSize||16*1024*1024;if(r.size<n){let o=Buffer.allocUnsafe(r.size),h=Vt.readSync(i,o,0,r.size,0);t.end(h===o.byteLength?o:o.subarray(0,h))}else{let o=0,h=Buffer.allocUnsafe(n);for(;o<r.size;){let a=Vt.readSync(i,h,0,n,o);if(a===0)break;o+=a,t.write(h.subarray(0,a))}t.end()}}finally{if(typeof i=="number")try{Vt.closeSync(i)}catch{}}},Dn=(s,t)=>{let e=new st(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,h)=>{e.on("error",h),e.on("end",o),Vt.stat(r,(a,l)=>{if(a)h(a);else{let c=new _t(r,{readSize:i,size:l.size});c.on("error",h),c.pipe(e)}})})},It=K(An,Dn,s=>new st(s),s=>new st(s),(s,t)=>{t?.length&&Ki(s,t),s.noResume||Nn(s)});import fi from"fs";import $ from"fs";import $s from"path";var Vi=(s,t,e)=>(s&=4095,e&&(s=(s|384)&-19),t&&(s&256&&(s|=64),s&32&&(s|=8),s&4&&(s|=1)),s);import{win32 as In}from"node:path";var{isAbsolute:Cn,parse:Ys}=In,ce=s=>{let t="",e=Ys(s);for(;Cn(s)||e.root;){let i=s.charAt(0)==="/"&&s.slice(0,4)!=="//?/"?"/":e.root;s=s.slice(i.length),t+=i,e=Ys(s)}return[t,s]};var Je=["|","<",">","?",":"],$i=Je.map(s=>String.fromCodePoint(61440+Number(s.codePointAt(0)))),Fn=new Map(Je.map((s,t)=>[s,$i[t]])),kn=new Map($i.map((s,t)=>[s,Je[t]])),Xi=s=>Je.reduce((t,e)=>t.split(e).join(Fn.get(e)),s),Ks=s=>$i.reduce((t,e)=>t.split(e).join(kn.get(e)),s);var Js=(s,t)=>t?(s=f(s).replace(/^\.(\/|$)/,""),mt(t)+"/"+s):f(s),vn=16*1024*1024,Xs=Symbol("process"),qs=Symbol("file"),js=Symbol("directory"),ji=Symbol("symlink"),Qs=Symbol("hardlink"),fe=Symbol("header"),ti=Symbol("read"),Qi=Symbol("lstat"),ei=Symbol("onlstat"),Ji=Symbol("onread"),ts=Symbol("onreadlink"),es=Symbol("openfile"),is=Symbol("onopenfile"),pt=Symbol("close"),ii=Symbol("mode"),ss=Symbol("awaitDrain"),qi=Symbol("ondrain"),X=Symbol("prefix"),de=class extends D{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#t=!1;constructor(t,e={}){let i=re(e);super(),this.path=f(t),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||vn,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=f(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?f(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[o,h]=ce(this.path);o&&typeof h=="string"&&(this.path=h,r=o)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=Ks(this.path.replaceAll(/\\/g,"/")),t=t.replaceAll(/\\/g,"/")),this.absolute=f(i.absolute||$s.resolve(this.cwd,t)),this.path===""&&(this.path="./"),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path});let n=this.statCache.get(this.absolute);n?this[ei](n):this[Qi]()}warn(t,e,i={}){return Lt(this,t,e,i)}emit(t,...e){return t==="error"&&(this.#t=!0),super.emit(t,...e)}[Qi](){$.lstat(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[ei](e)})}[ei](t){this.statCache.set(this.absolute,t),this.stat=t,t.isFile()||(t.size=0),this.type=Mn(t),this.emit("stat",t),this[Xs]()}[Xs](){switch(this.type){case"File":return this[qs]();case"Directory":return this[js]();case"SymbolicLink":return this[ji]();default:return this.end()}}[ii](t){return Vi(t,this.type==="Directory",this.portable)}[X](t){return Js(t,this.prefix)}[fe](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new F({path:this[X](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[X](this.linkpath):this.linkpath,mode:this[ii](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new ct({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[X](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[X](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let t=this.header?.block;if(!t)throw new Error("failed to encode header");super.write(t)}[js](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[fe](),this.end()}[ji](){$.readlink(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[ts](e)})}[ts](t){this.linkpath=f(t),this[fe](),this.end()}[Qs](t){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=f($s.relative(this.cwd,t)),this.stat.size=0,this[fe](),this.end()}[qs](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let t=`${this.stat.dev}:${this.stat.ino}`,e=this.linkCache.get(t);if(e?.indexOf(this.cwd)===0)return this[Qs](e);this.linkCache.set(t,this.absolute)}if(this[fe](),this.stat.size===0)return this.end();this[es]()}[es](){$.open(this.absolute,"r",(t,e)=>{if(t)return this.emit("error",t);this[is](e)})}[is](t){if(this.fd=t,this.#t)return this[pt]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let e=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(e),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[ti]()}[ti](){let{fd:t,buf:e,offset:i,length:r,pos:n}=this;if(t===void 0||e===void 0)throw new Error("cannot read file without first opening");$.read(t,e,i,r,n,(o,h)=>{if(o)return this[pt](()=>this.emit("error",o));this[Ji](h)})}[pt](t=()=>{}){this.fd!==void 0&&$.close(this.fd,t)}[Ji](t){if(t<=0&&this.remain>0){let r=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[pt](()=>this.emit("error",r))}if(t>this.remain){let r=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[pt](()=>this.emit("error",r))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(t===this.remain)for(let r=t;r<this.length&&t<this.blockRemain;r++)this.buf[r+this.offset]=0,t++,this.remain++;let e=this.offset===0&&t===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+t);this.write(e)?this[qi]():this[ss](()=>this[qi]())}[ss](t){this.once("drain",t)}write(t,e,i){if(typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof e=="string"?e:"utf8")),this.blockRemain<t.length){let r=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",r)}return this.remain-=t.length,this.blockRemain-=t.length,this.pos+=t.length,this.offset+=t.length,super.write(t,null,i)}[qi](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[pt](t=>t?this.emit("error",t):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[ti]()}},si=class extends de{sync=!0;[Qi](){this[ei]($.lstatSync(this.absolute))}[ji](){this[ts]($.readlinkSync(this.absolute))}[es](){this[is]($.openSync(this.absolute,"r"))}[ti](){let t=!0;try{let{fd:e,buf:i,offset:r,length:n,pos:o}=this;if(e===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let h=$.readSync(e,i,r,n,o);this[Ji](h),t=!1}finally{if(t)try{this[pt](()=>{})}catch{}}}[ss](t){t()}[pt](t=()=>{}){this.fd!==void 0&&$.closeSync(this.fd),t()}},ri=class extends D{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(t,e,i={}){return Lt(this,t,e,i)}constructor(t,e={}){let i=re(e);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=t;let{type:r}=t;if(r==="Unsupported")throw new Error("writing entry that should be ignored");this.type=r,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=f(t.path),this.mode=t.mode!==void 0?this[ii](t.mode):void 0,this.uid=this.portable?void 0:t.uid,this.gid=this.portable?void 0:t.gid,this.uname=this.portable?void 0:t.uname,this.gname=this.portable?void 0:t.gname,this.size=t.size,this.mtime=this.noMtime?void 0:i.mtime||t.mtime,this.atime=this.portable?void 0:t.atime,this.ctime=this.portable?void 0:t.ctime,this.linkpath=t.linkpath!==void 0?f(t.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[h,a]=ce(this.path);h&&typeof a=="string"&&(this.path=a,n=h)}this.remain=t.size,this.blockRemain=t.startBlockSize,this.onWriteEntry?.(this),this.header=new F({path:this[X](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[X](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new ct({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[X](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[X](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let o=this.header?.block;if(!o)throw new Error("failed to encode header");super.write(o),t.pipe(this)}[X](t){return Js(t,this.prefix)}[ii](t){return Vi(t,this.type==="Directory",this.portable)}write(t,e,i){typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof e=="string"?e:"utf8"));let r=t.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(t,i)}end(t,e,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof t=="function"&&(i=t,e=void 0,t=void 0),typeof e=="function"&&(i=e,e=void 0),typeof t=="string"&&(t=Buffer.from(t,e??"utf8")),i&&this.once("finish",i),t?super.end(t,i):super.end(i),this}},Mn=s=>s.isFile()?"File":s.isDirectory()?"Directory":s.isSymbolicLink()?"SymbolicLink":"Unsupported";var ni=class s{tail;head;length=0;static create(t=[]){return new s(t)}constructor(t=[]){for(let e of t)this.push(e)}*[Symbol.iterator](){for(let t=this.head;t;t=t.next)yield t.value}removeNode(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");let e=t.next,i=t.prev;return e&&(e.prev=i),i&&(i.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=i),this.length--,t.next=void 0,t.prev=void 0,t.list=void 0,e}unshiftNode(t){if(t===this.head)return;t.list&&t.list.removeNode(t);let e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}pushNode(t){if(t===this.tail)return;t.list&&t.list.removeNode(t);let e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}push(...t){for(let e=0,i=t.length;e<i;e++)Pn(this,t[e]);return this.length}unshift(...t){for(var e=0,i=t.length;e<i;e++)zn(this,t[e]);return this.length}pop(){if(!this.tail)return;let t=this.tail.value,e=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,e.list=void 0,this.length--,t}shift(){if(!this.head)return;let t=this.head.value,e=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,e.list=void 0,this.length--,t}forEach(t,e){e=e||this;for(let i=this.head,r=0;i;r++)t.call(e,i.value,r,this),i=i.next}forEachReverse(t,e){e=e||this;for(let i=this.tail,r=this.length-1;i;r--)t.call(e,i.value,r,this),i=i.prev}get(t){let e=0,i=this.head;for(;i&&e<t;e++)i=i.next;if(e===t&&i)return i.value}getReverse(t){let e=0,i=this.tail;for(;i&&e<t;e++)i=i.prev;if(e===t&&i)return i.value}map(t,e){e=e||this;let i=new s;for(let r=this.head;r;)i.push(t.call(e,r.value,this)),r=r.next;return i}mapReverse(t,e){e=e||this;var i=new s;for(let r=this.tail;r;)i.push(t.call(e,r.value,this)),r=r.prev;return i}reduce(t,e){let i,r=this.head;if(arguments.length>1)i=e;else if(this.head)r=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;r;n++)i=t(i,r.value,n),r=r.next;return i}reduceReverse(t,e){let i,r=this.tail;if(arguments.length>1)i=e;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;r;n--)i=t(i,r.value,n),r=r.prev;return i}toArray(){let t=new Array(this.length);for(let e=0,i=this.head;i;e++)t[e]=i.value,i=i.next;return t}toArrayReverse(){let t=new Array(this.length);for(let e=0,i=this.tail;i;e++)t[e]=i.value,i=i.prev;return t}slice(t=0,e=this.length){e<0&&(e+=this.length),t<0&&(t+=this.length);let i=new s;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);let r=this.head,n=0;for(n=0;r&&n<t;n++)r=r.next;for(;r&&n<e;n++,r=r.next)i.push(r.value);return i}sliceReverse(t=0,e=this.length){e<0&&(e+=this.length),t<0&&(t+=this.length);let i=new s;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);let r=this.length,n=this.tail;for(;n&&r>e;r--)n=n.prev;for(;n&&r>t;r--,n=n.prev)i.push(n.value);return i}splice(t,e=0,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);let r=this.head;for(let o=0;r&&o<t;o++)r=r.next;let n=[];for(let o=0;r&&o<e;o++)n.push(r.value),r=this.removeNode(r);r?r!==this.tail&&(r=r.prev):r=this.tail;for(let o of i)r=Bn(this,r,o);return n}reverse(){let t=this.head,e=this.tail;for(let i=t;i;i=i.prev){let r=i.prev;i.prev=i.next,i.next=r}return this.head=e,this.tail=t,this}};function Bn(s,t,e){let i=t,r=t?t.next:s.head,n=new ue(e,i,r,s);return n.next===void 0&&(s.tail=n),n.prev===void 0&&(s.head=n),s.length++,n}function Pn(s,t){s.tail=new ue(t,s.tail,void 0,s),s.head||(s.head=s.tail),s.length++}function zn(s,t){s.head=new ue(t,void 0,s.head,s),s.tail||(s.tail=s.head),s.length++}var ue=class{list;next;prev;value;constructor(t,e,i,r){this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}};import sr from"path";var di=class{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(t,e){this.path=t||"./",this.absolute=e}},tr=Buffer.alloc(1024),oi=Symbol("onStat"),me=Symbol("ended"),W=Symbol("queue"),Ct=Symbol("current"),Ft=Symbol("process"),pe=Symbol("processing"),rs=Symbol("processJob"),G=Symbol("jobs"),ns=Symbol("jobDone"),hi=Symbol("addFSEntry"),er=Symbol("addTarEntry"),as=Symbol("stat"),ls=Symbol("readdir"),ai=Symbol("onreaddir"),li=Symbol("pipe"),ir=Symbol("entry"),os=Symbol("entryOpt"),ci=Symbol("writeEntryClass"),rr=Symbol("write"),hs=Symbol("ondrain"),Et=class extends D{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[ci];onWriteEntry;[W];[G]=0;[pe]=!1;[me]=!1;constructor(t={}){if(super(),this.opt=t,this.file=t.file||"",this.cwd=t.cwd||process.cwd(),this.maxReadSize=t.maxReadSize,this.preservePaths=!!t.preservePaths,this.strict=!!t.strict,this.noPax=!!t.noPax,this.prefix=f(t.prefix||""),this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.readdirCache=t.readdirCache||new Map,this.onWriteEntry=t.onWriteEntry,this[ci]=de,typeof t.onwarn=="function"&&this.on("warn",t.onwarn),this.portable=!!t.portable,t.gzip||t.brotli||t.zstd){if((t.gzip?1:0)+(t.brotli?1:0)+(t.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(t.gzip&&(typeof t.gzip!="object"&&(t.gzip={}),this.portable&&(t.gzip.portable=!0),this.zip=new Pe(t.gzip)),t.brotli&&(typeof t.brotli!="object"&&(t.brotli={}),this.zip=new He(t.brotli)),t.zstd&&(typeof t.zstd!="object"&&(t.zstd={}),this.zip=new Ze(t.zstd)),!this.zip)throw new Error("impossible");let e=this.zip;e.on("data",i=>super.write(i)),e.on("end",()=>super.end()),e.on("drain",()=>this[hs]()),this.on("resume",()=>e.resume())}else this.on("drain",this[hs]);this.noDirRecurse=!!t.noDirRecurse,this.follow=!!t.follow,this.noMtime=!!t.noMtime,t.mtime&&(this.mtime=t.mtime),this.filter=typeof t.filter=="function"?t.filter:()=>!0,this[W]=new ni,this[G]=0,this.jobs=Number(t.jobs)||4,this[pe]=!1,this[me]=!1}[rr](t){return super.write(t)}add(t){return this.write(t),this}end(t,e,i){return typeof t=="function"&&(i=t,t=void 0),typeof e=="function"&&(i=e,e=void 0),t&&this.add(t),this[me]=!0,this[Ft](),i&&i(),this}write(t){if(this[me])throw new Error("write after end");return t instanceof Yt?this[er](t):this[hi](t),this.flowing}[er](t){let e=f(sr.resolve(this.cwd,t.path));if(!this.filter(t.path,t))t.resume();else{let i=new di(t.path,e);i.entry=new ri(t,this[os](i)),i.entry.on("end",()=>this[ns](i)),this[G]+=1,this[W].push(i)}this[Ft]()}[hi](t){let e=f(sr.resolve(this.cwd,t));this[W].push(new di(t,e)),this[Ft]()}[as](t){t.pending=!0,this[G]+=1;let e=this.follow?"stat":"lstat";fi[e](t.absolute,(i,r)=>{t.pending=!1,this[G]-=1,i?this.emit("error",i):this[oi](t,r)})}[oi](t,e){this.statCache.set(t.absolute,e),t.stat=e,this.filter(t.path,e)?e.isFile()&&e.nlink>1&&t===this[Ct]&&!this.linkCache.get(`${e.dev}:${e.ino}`)&&!this.sync&&this[rs](t):t.ignore=!0,this[Ft]()}[ls](t){t.pending=!0,this[G]+=1,fi.readdir(t.absolute,(e,i)=>{if(t.pending=!1,this[G]-=1,e)return this.emit("error",e);this[ai](t,i)})}[ai](t,e){this.readdirCache.set(t.absolute,e),t.readdir=e,this[Ft]()}[Ft](){if(!this[pe]){this[pe]=!0;for(let t=this[W].head;t&&this[G]<this.jobs;t=t.next)if(this[rs](t.value),t.value.ignore){let e=t.next;this[W].removeNode(t),t.next=e}this[pe]=!1,this[me]&&this[W].length===0&&this[G]===0&&(this.zip?this.zip.end(tr):(super.write(tr),super.end()))}}get[Ct](){return this[W]&&this[W].head&&this[W].head.value}[ns](t){this[W].shift(),this[G]-=1,this[Ft]()}[rs](t){if(!t.pending){if(t.entry){t===this[Ct]&&!t.piped&&this[li](t);return}if(!t.stat){let e=this.statCache.get(t.absolute);e?this[oi](t,e):this[as](t)}if(t.stat&&!t.ignore){if(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir){let e=this.readdirCache.get(t.absolute);if(e?this[ai](t,e):this[ls](t),!t.readdir)return}if(t.entry=this[ir](t),!t.entry){t.ignore=!0;return}t===this[Ct]&&!t.piped&&this[li](t)}}}[os](t){return{onwarn:(e,i,r)=>this.warn(e,i,r),noPax:this.noPax,cwd:this.cwd,absolute:t.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[ir](t){this[G]+=1;try{return new this[ci](t.path,this[os](t)).on("end",()=>this[ns](t)).on("error",i=>this.emit("error",i))}catch(e){this.emit("error",e)}}[hs](){this[Ct]&&this[Ct].entry&&this[Ct].entry.resume()}[li](t){t.piped=!0,t.readdir&&t.readdir.forEach(r=>{let n=t.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[hi](o+r)});let e=t.entry,i=this.zip;if(!e)throw new Error("cannot pipe without source");i?e.on("data",r=>{i.write(r)||e.pause()}):e.on("data",r=>{super.write(r)||e.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(t,e,i={}){Lt(this,t,e,i)}},kt=class extends Et{sync=!0;constructor(t){super(t),this[ci]=si}pause(){}resume(){}[as](t){let e=this.follow?"statSync":"lstatSync";this[oi](t,fi[e](t.absolute))}[ls](t){this[ai](t,fi.readdirSync(t.absolute))}[li](t){let e=t.entry,i=this.zip;if(t.readdir&&t.readdir.forEach(r=>{let n=t.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[hi](o+r)}),!e)throw new Error("Cannot pipe without source");i?e.on("data",r=>{i.write(r)}):e.on("data",r=>{super[rr](r)})}};var Un=(s,t)=>{let e=new kt(s),i=new Wt(s.file,{mode:s.mode||438});e.pipe(i),or(e,t)},Hn=(s,t)=>{let e=new Et(s),i=new tt(s.file,{mode:s.mode||438});e.pipe(i);let r=new Promise((n,o)=>{i.on("error",o),i.on("close",n),e.on("error",o)});return hr(e,t).catch(n=>e.emit("error",n)),r},or=(s,t)=>{t.forEach(e=>{e.charAt(0)==="@"?It({file:nr.resolve(s.cwd,e.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(e)}),s.end()},hr=async(s,t)=>{for(let e of t)e.charAt(0)==="@"?await It({file:nr.resolve(String(s.cwd),e.slice(1)),noResume:!0,onReadEntry:i=>{s.add(i)}}):s.add(e);s.end()},Wn=(s,t)=>{let e=new kt(s);return or(e,t),e},Gn=(s,t)=>{let e=new Et(s);return hr(e,t).catch(i=>e.emit("error",i)),e},Zn=K(Un,Hn,Wn,Gn,(s,t)=>{if(!t?.length)throw new TypeError("no paths specified to add to archive")});import Cr from"node:fs";import so from"node:assert";import{randomBytes as Ir}from"node:crypto";import u from"node:fs";import R from"node:path";import cr from"fs";var Yn=process.env.__FAKE_PLATFORM__||process.platform,fr=Yn==="win32",{O_CREAT:dr,O_NOFOLLOW:ar,O_TRUNC:ur,O_WRONLY:mr}=cr.constants,pr=Number(process.env.__FAKE_FS_O_FILENAME__)||cr.constants.UV_FS_O_FILEMAP||0,Kn=fr&&!!pr,Vn=512*1024,$n=pr|ur|dr|mr,lr=!fr&&typeof ar=="number"?ar|ur|dr|mr:null,cs=lr!==null?()=>lr:Kn?s=>s<Vn?$n:"w":()=>"w";import mi from"node:fs";import Ee from"node:path";var fs=(s,t,e)=>{try{return mi.lchownSync(s,t,e)}catch(i){if(i?.code!=="ENOENT")throw i}},ui=(s,t,e,i)=>{mi.lchown(s,t,e,r=>{i(r&&r?.code!=="ENOENT"?r:null)})},Xn=(s,t,e,i,r)=>{if(t.isDirectory())ds(Ee.resolve(s,t.name),e,i,n=>{if(n)return r(n);let o=Ee.resolve(s,t.name);ui(o,e,i,r)});else{let n=Ee.resolve(s,t.name);ui(n,e,i,r)}},ds=(s,t,e,i)=>{mi.readdir(s,{withFileTypes:!0},(r,n)=>{if(r){if(r.code==="ENOENT")return i();if(r.code!=="ENOTDIR"&&r.code!=="ENOTSUP")return i(r)}if(r||!n.length)return ui(s,t,e,i);let o=n.length,h=null,a=l=>{if(!h){if(l)return i(h=l);if(--o===0)return ui(s,t,e,i)}};for(let l of n)Xn(s,l,t,e,a)})},qn=(s,t,e,i)=>{t.isDirectory()&&us(Ee.resolve(s,t.name),e,i),fs(Ee.resolve(s,t.name),e,i)},us=(s,t,e)=>{let i;try{i=mi.readdirSync(s,{withFileTypes:!0})}catch(r){let n=r;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return fs(s,t,e);throw n}for(let r of i)qn(s,r,t,e);return fs(s,t,e)};import k from"node:fs";import jn from"node:fs/promises";import pi from"node:path";var we=class extends Error{path;code;syscall="chdir";constructor(t,e){super(`${e}: Cannot cd into '${t}'`),this.path=t,this.code=e}get name(){return"CwdError"}};var wt=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(t,e){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=t,this.path=e}get name(){return"SymlinkError"}};var Qn=(s,t)=>{k.stat(s,(e,i)=>{(e||!i.isDirectory())&&(e=new we(s,e?.code||"ENOTDIR")),t(e)})},Er=(s,t,e)=>{s=f(s);let i=t.umask??18,r=t.mode|448,n=(r&i)!==0,o=t.uid,h=t.gid,a=typeof o=="number"&&typeof h=="number"&&(o!==t.processUid||h!==t.processGid),l=t.preserve,c=t.unlink,d=f(t.cwd),S=(E,x)=>{E?e(E):x&&a?ds(x,o,h,xe=>S(xe)):n?k.chmod(s,r,e):e()};if(s===d)return Qn(s,S);if(l)return jn.mkdir(s,{mode:r,recursive:!0}).then(E=>S(null,E??void 0),S);let N=f(pi.relative(d,s)).split("/");ms(d,N,r,c,d,void 0,S)},ms=(s,t,e,i,r,n,o)=>{if(t.length===0)return o(null,n);let h=t.shift(),a=f(pi.resolve(s+"/"+h));k.mkdir(a,e,wr(a,t,e,i,r,n,o))},wr=(s,t,e,i,r,n,o)=>h=>{h?k.lstat(s,(a,l)=>{if(a)a.path=a.path&&f(a.path),o(a);else if(l.isDirectory())ms(s,t,e,i,r,n,o);else if(i)k.unlink(s,c=>{if(c)return o(c);k.mkdir(s,e,wr(s,t,e,i,r,n,o))});else{if(l.isSymbolicLink())return o(new wt(s,s+"/"+t.join("/")));o(h)}}):(n=n||s,ms(s,t,e,i,r,n,o))},Jn=s=>{let t=!1,e;try{t=k.statSync(s).isDirectory()}catch(i){e=i?.code}finally{if(!t)throw new we(s,e??"ENOTDIR")}},Sr=(s,t)=>{s=f(s);let e=t.umask??18,i=t.mode|448,r=(i&e)!==0,n=t.uid,o=t.gid,h=typeof n=="number"&&typeof o=="number"&&(n!==t.processUid||o!==t.processGid),a=t.preserve,l=t.unlink,c=f(t.cwd),d=E=>{E&&h&&us(E,n,o),r&&k.chmodSync(s,i)};if(s===c)return Jn(c),d();if(a)return d(k.mkdirSync(s,{mode:i,recursive:!0})??void 0);let T=f(pi.relative(c,s)).split("/"),N;for(let E=T.shift(),x=c;E&&(x+="/"+E);E=T.shift()){x=f(pi.resolve(x));try{k.mkdirSync(x,i),N=N||x}catch{let xe=k.lstatSync(x);if(xe.isDirectory())continue;if(l){k.unlinkSync(x),k.mkdirSync(x,i),N=N||x;continue}else if(xe.isSymbolicLink())return new wt(x,x+"/"+T.join("/"))}}return d(N)};import{join as br}from"node:path";var ps=Object.create(null),yr=1e4,$t=new Set,Rr=s=>{$t.has(s)?$t.delete(s):ps[s]=s.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),$t.add(s);let t=ps[s],e=$t.size-yr;if(e>yr/10){for(let i of $t)if($t.delete(i),delete ps[i],--e<=0)break}return t};var to=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,eo=to==="win32",io=s=>s.split("/").slice(0,-1).reduce((e,i)=>{let r=e.at(-1);return r!==void 0&&(i=br(r,i)),e.push(i||"/"),e},[]),Ei=class{#t=new Map;#i=new Map;#s=new Set;reserve(t,e){t=eo?["win32 parallelization disabled"]:t.map(r=>mt(br(Rr(r))));let i=new Set(t.map(r=>io(r)).reduce((r,n)=>r.concat(n)));this.#i.set(e,{dirs:i,paths:t});for(let r of t){let n=this.#t.get(r);n?n.push(e):this.#t.set(r,[e])}for(let r of i){let n=this.#t.get(r);if(!n)this.#t.set(r,[new Set([e])]);else{let o=n.at(-1);o instanceof Set?o.add(e):n.push(new Set([e]))}}return this.#r(e)}#n(t){let e=this.#i.get(t);if(!e)throw new Error("function does not have any path reservations");return{paths:e.paths.map(i=>this.#t.get(i)),dirs:[...e.dirs].map(i=>this.#t.get(i))}}check(t){let{paths:e,dirs:i}=this.#n(t);return e.every(r=>r&&r[0]===t)&&i.every(r=>r&&r[0]instanceof Set&&r[0].has(t))}#r(t){return this.#s.has(t)||!this.check(t)?!1:(this.#s.add(t),t(()=>this.#e(t)),!0)}#e(t){if(!this.#s.has(t))return!1;let e=this.#i.get(t);if(!e)throw new Error("invalid reservation");let{paths:i,dirs:r}=e,n=new Set;for(let o of i){let h=this.#t.get(o);if(!h||h?.[0]!==t)continue;let a=h[1];if(!a){this.#t.delete(o);continue}if(h.shift(),typeof a=="function")n.add(a);else for(let l of a)n.add(l)}for(let o of r){let h=this.#t.get(o),a=h?.[0];if(!(!h||!(a instanceof Set)))if(a.size===1&&h.length===1){this.#t.delete(o);continue}else if(a.size===1){h.shift();let l=h[0];typeof l=="function"&&n.add(l)}else a.delete(t)}return this.#s.delete(t),n.forEach(o=>this.#r(o)),!0}};var _r=()=>process.umask();var gr=Symbol("onEntry"),ys=Symbol("checkFs"),Or=Symbol("checkFs2"),Rs=Symbol("isReusable"),P=Symbol("makeFs"),bs=Symbol("file"),_s=Symbol("directory"),Si=Symbol("link"),Tr=Symbol("symlink"),xr=Symbol("hardlink"),ye=Symbol("ensureNoSymlink"),Lr=Symbol("unsupported"),Nr=Symbol("checkPath"),Es=Symbol("stripAbsolutePath"),St=Symbol("mkdir"),O=Symbol("onError"),wi=Symbol("pending"),Ar=Symbol("pend"),Xt=Symbol("unpend"),ws=Symbol("ended"),Ss=Symbol("maybeClose"),gs=Symbol("skip"),Re=Symbol("doChown"),be=Symbol("uid"),_e=Symbol("gid"),ge=Symbol("checkedCwd"),ro=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Oe=ro==="win32",no=1024,oo=(s,t)=>{if(!Oe)return u.unlink(s,t);let e=s+".DELETE."+Ir(16).toString("hex");u.rename(s,e,i=>{if(i)return t(i);u.unlink(e,t)})},ho=s=>{if(!Oe)return u.unlinkSync(s);let t=s+".DELETE."+Ir(16).toString("hex");u.renameSync(s,t),u.unlinkSync(t)},Dr=(s,t,e)=>s!==void 0&&s===s>>>0?s:t!==void 0&&t===t>>>0?t:e,qt=class extends st{[ws]=!1;[ge]=!1;[wi]=0;reservations=new Ei;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(t={}){if(t.ondone=()=>{this[ws]=!0,this[Ss]()},super(t),this.transform=t.transform,this.chmod=!!t.chmod,typeof t.uid=="number"||typeof t.gid=="number"){if(typeof t.uid!="number"||typeof t.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(t.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=t.uid,this.gid=t.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;this.preserveOwner=t.preserveOwner===void 0&&typeof t.uid!="number"?!!(process.getuid&&process.getuid()===0):!!t.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:no,this.forceChown=t.forceChown===!0,this.win32=!!t.win32||Oe,this.newer=!!t.newer,this.keep=!!t.keep,this.noMtime=!!t.noMtime,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.cwd=f(R.resolve(t.cwd||process.cwd())),this.strip=Number(t.strip)||0,this.processUmask=this.chmod?typeof t.processUmask=="number"?t.processUmask:_r():0,this.umask=typeof t.umask=="number"?t.umask:this.processUmask,this.dmode=t.dmode||511&~this.umask,this.fmode=t.fmode||438&~this.umask,this.on("entry",e=>this[gr](e))}warn(t,e,i={}){return(t==="TAR_BAD_ARCHIVE"||t==="TAR_ABORT")&&(i.recoverable=!1),super.warn(t,e,i)}[Ss](){this[ws]&&this[wi]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Es](t,e){let i=t[e],{type:r}=t;if(!i||this.preservePaths)return!0;let[n,o]=ce(i),h=o.replaceAll(/\\/g,"/").split("/");if(h.includes("..")||Oe&&/^[a-z]:\.\.$/i.test(h[0]??"")){if(e==="path"||r==="Link")return this.warn("TAR_ENTRY_ERROR",`${e} contains '..'`,{entry:t,[e]:i}),!1;let a=R.posix.dirname(t.path),l=R.posix.normalize(R.posix.join(a,h.join("/")));if(l.startsWith("../")||l==="..")return this.warn("TAR_ENTRY_ERROR",`${e} escapes extraction directory`,{entry:t,[e]:i}),!1}return n&&(t[e]=String(o),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute ${e}`,{entry:t,[e]:i})),!0}[Nr](t){let e=f(t.path),i=e.split("/");if(this.strip){if(i.length<this.strip)return!1;if(t.type==="Link"){let r=f(String(t.linkpath)).split("/");if(r.length>=this.strip)t.linkpath=r.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),t.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:t,path:e,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this[Es](t,"path")||!this[Es](t,"linkpath"))return!1;if(t.absolute=R.isAbsolute(t.path)?f(R.resolve(t.path)):f(R.resolve(this.cwd,t.path)),!this.preservePaths&&typeof t.absolute=="string"&&t.absolute.indexOf(this.cwd+"/")!==0&&t.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:f(t.path),resolvedPath:t.absolute,cwd:this.cwd}),!1;if(t.absolute===this.cwd&&t.type!=="Directory"&&t.type!=="GNUDumpDir")return!1;if(this.win32){let{root:r}=R.win32.parse(String(t.absolute));t.absolute=r+Xi(String(t.absolute).slice(r.length));let{root:n}=R.win32.parse(t.path);t.path=n+Xi(t.path.slice(n.length))}return!0}[gr](t){if(!this[Nr](t))return t.resume();switch(so.equal(typeof t.absolute,"string"),t.type){case"Directory":case"GNUDumpDir":t.mode&&(t.mode=t.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[ys](t);default:return this[Lr](t)}}[O](t,e){t.name==="CwdError"?this.emit("error",t):(this.warn("TAR_ENTRY_ERROR",t,{entry:e}),this[Xt](),e.resume())}[St](t,e,i){Er(f(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:e},i)}[Re](t){return this.forceChown||this.preserveOwner&&(typeof t.uid=="number"&&t.uid!==this.processUid||typeof t.gid=="number"&&t.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[be](t){return Dr(this.uid,t.uid,this.processUid)}[_e](t){return Dr(this.gid,t.gid,this.processGid)}[bs](t,e){let i=typeof t.mode=="number"?t.mode&4095:this.fmode,r=new tt(String(t.absolute),{flags:cs(t.size),mode:i,autoClose:!1});r.on("error",a=>{r.fd&&u.close(r.fd,()=>{}),r.write=()=>!0,this[O](a,t),e()});let n=1,o=a=>{if(a){r.fd&&u.close(r.fd,()=>{}),this[O](a,t),e();return}--n===0&&r.fd!==void 0&&u.close(r.fd,l=>{l?this[O](l,t):this[Xt](),e()})};r.on("finish",()=>{let a=String(t.absolute),l=r.fd;if(typeof l=="number"&&t.mtime&&!this.noMtime){n++;let c=t.atime||new Date,d=t.mtime;u.futimes(l,c,d,S=>S?u.utimes(a,c,d,T=>o(T&&S)):o())}if(typeof l=="number"&&this[Re](t)){n++;let c=this[be](t),d=this[_e](t);typeof c=="number"&&typeof d=="number"&&u.fchown(l,c,d,S=>S?u.chown(a,c,d,T=>o(T&&S)):o())}o()});let h=this.transform&&this.transform(t)||t;h!==t&&(h.on("error",a=>{this[O](a,t),e()}),t.pipe(h)),h.pipe(r)}[_s](t,e){let i=typeof t.mode=="number"?t.mode&4095:this.dmode;this[St](String(t.absolute),i,r=>{if(r){this[O](r,t),e();return}let n=1,o=()=>{--n===0&&(e(),this[Xt](),t.resume())};t.mtime&&!this.noMtime&&(n++,u.utimes(String(t.absolute),t.atime||new Date,t.mtime,o)),this[Re](t)&&(n++,u.chown(String(t.absolute),Number(this[be](t)),Number(this[_e](t)),o)),o()})}[Lr](t){t.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t}),t.resume()}[Tr](t,e){let i=f(R.relative(this.cwd,R.resolve(R.dirname(String(t.absolute)),String(t.linkpath)))).split("/");this[ye](t,this.cwd,i,()=>this[Si](t,String(t.linkpath),"symlink",e),r=>{this[O](r,t),e()})}[xr](t,e){let i=f(R.resolve(this.cwd,String(t.linkpath))),r=f(String(t.linkpath)).split("/");this[ye](t,this.cwd,r,()=>this[Si](t,i,"link",e),n=>{this[O](n,t),e()})}[ye](t,e,i,r,n){let o=i.shift();if(this.preservePaths||o===void 0)return r();let h=R.resolve(e,o);u.lstat(h,(a,l)=>{if(a)return r();if(l?.isSymbolicLink())return n(new wt(h,R.resolve(h,i.join("/"))));this[ye](t,h,i,r,n)})}[Ar](){this[wi]++}[Xt](){this[wi]--,this[Ss]()}[gs](t){this[Xt](),t.resume()}[Rs](t,e){return t.type==="File"&&!this.unlink&&e.isFile()&&e.nlink<=1&&!Oe}[ys](t){this[Ar]();let e=[t.path];t.linkpath&&e.push(t.linkpath),this.reservations.reserve(e,i=>this[Or](t,i))}[Or](t,e){let i=h=>{e(h)},r=()=>{this[St](this.cwd,this.dmode,h=>{if(h){this[O](h,t),i();return}this[ge]=!0,n()})},n=()=>{if(t.absolute!==this.cwd){let h=f(R.dirname(String(t.absolute)));if(h!==this.cwd)return this[St](h,this.dmode,a=>{if(a){this[O](a,t),i();return}o()})}o()},o=()=>{u.lstat(String(t.absolute),(h,a)=>{if(a&&(this.keep||this.newer&&a.mtime>(t.mtime??a.mtime))){this[gs](t),i();return}if(h||this[Rs](t,a))return this[P](null,t,i);if(a.isDirectory()){if(t.type==="Directory"){let l=this.chmod&&t.mode&&(a.mode&4095)!==t.mode,c=d=>this[P](d??null,t,i);return l?u.chmod(String(t.absolute),Number(t.mode),c):c()}if(t.absolute!==this.cwd)return u.rmdir(String(t.absolute),l=>this[P](l??null,t,i))}if(t.absolute===this.cwd)return this[P](null,t,i);oo(String(t.absolute),l=>this[P](l??null,t,i))})};this[ge]?n():r()}[P](t,e,i){if(t){this[O](t,e),i();return}switch(e.type){case"File":case"OldFile":case"ContiguousFile":return this[bs](e,i);case"Link":return this[xr](e,i);case"SymbolicLink":return this[Tr](e,i);case"Directory":case"GNUDumpDir":return this[_s](e,i)}}[Si](t,e,i,r){u[i](e,String(t.absolute),n=>{n?this[O](n,t):(this[Xt](),t.resume()),r()})}},Se=s=>{try{return[null,s()]}catch(t){return[t,null]}},Te=class extends qt{sync=!0;[P](t,e){return super[P](t,e,()=>{})}[ys](t){if(!this[ge]){let n=this[St](this.cwd,this.dmode);if(n)return this[O](n,t);this[ge]=!0}if(t.absolute!==this.cwd){let n=f(R.dirname(String(t.absolute)));if(n!==this.cwd){let o=this[St](n,this.dmode);if(o)return this[O](o,t)}}let[e,i]=Se(()=>u.lstatSync(String(t.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(t.mtime??i.mtime)))return this[gs](t);if(e||this[Rs](t,i))return this[P](null,t);if(i.isDirectory()){if(t.type==="Directory"){let o=this.chmod&&t.mode&&(i.mode&4095)!==t.mode,[h]=o?Se(()=>{u.chmodSync(String(t.absolute),Number(t.mode))}):[];return this[P](h,t)}let[n]=Se(()=>u.rmdirSync(String(t.absolute)));this[P](n,t)}let[r]=t.absolute===this.cwd?[]:Se(()=>ho(String(t.absolute)));this[P](r,t)}[bs](t,e){let i=typeof t.mode=="number"?t.mode&4095:this.fmode,r=h=>{let a;try{u.closeSync(n)}catch(l){a=l}(h||a)&&this[O](h||a,t),e()},n;try{n=u.openSync(String(t.absolute),cs(t.size),i)}catch(h){return r(h)}let o=this.transform&&this.transform(t)||t;o!==t&&(o.on("error",h=>this[O](h,t)),t.pipe(o)),o.on("data",h=>{try{u.writeSync(n,h,0,h.length)}catch(a){r(a)}}),o.on("end",()=>{let h=null;if(t.mtime&&!this.noMtime){let a=t.atime||new Date,l=t.mtime;try{u.futimesSync(n,a,l)}catch(c){try{u.utimesSync(String(t.absolute),a,l)}catch{h=c}}}if(this[Re](t)){let a=this[be](t),l=this[_e](t);try{u.fchownSync(n,Number(a),Number(l))}catch(c){try{u.chownSync(String(t.absolute),Number(a),Number(l))}catch{h=h||c}}}r(h)})}[_s](t,e){let i=typeof t.mode=="number"?t.mode&4095:this.dmode,r=this[St](String(t.absolute),i);if(r){this[O](r,t),e();return}if(t.mtime&&!this.noMtime)try{u.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch{}if(this[Re](t))try{u.chownSync(String(t.absolute),Number(this[be](t)),Number(this[_e](t)))}catch{}e(),t.resume()}[St](t,e){try{return Sr(f(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:e})}catch(i){return i}}[ye](t,e,i,r,n){if(this.preservePaths||i.length===0)return r();let o=e;for(let h of i){o=R.resolve(o,h);let[a,l]=Se(()=>u.lstatSync(o));if(a)return r();if(l.isSymbolicLink())return n(new wt(o,R.resolve(e,i.join("/"))))}r()}[Si](t,e,i,r){let n=`${i}Sync`;try{u[n](e,String(t.absolute)),r(),t.resume()}catch(o){return this[O](o,t)}}};var ao=s=>{let t=new Te(s),e=s.file,i=Cr.statSync(e),r=s.maxReadSize||16*1024*1024;new Me(e,{readSize:r,size:i.size}).pipe(t)},lo=(s,t)=>{let e=new qt(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,h)=>{e.on("error",h),e.on("close",o),Cr.stat(r,(a,l)=>{if(a)h(a);else{let c=new _t(r,{readSize:i,size:l.size});c.on("error",h),c.pipe(e)}})})},co=K(ao,lo,s=>new Te(s),s=>new qt(s),(s,t)=>{t?.length&&Ki(s,t)});import v from"node:fs";import Fr from"node:path";var fo=(s,t)=>{let e=new kt(s),i=!0,r,n;try{try{r=v.openSync(s.file,"r+")}catch(a){if(a?.code==="ENOENT")r=v.openSync(s.file,"w+");else throw a}let o=v.fstatSync(r),h=Buffer.alloc(512);t:for(n=0;n<o.size;n+=512){for(let c=0,d=0;c<512;c+=d){if(d=v.readSync(r,h,c,h.length-c,n+c),n===0&&h[0]===31&&h[1]===139)throw new Error("cannot append to compressed archives");if(!d)break t}let a=new F(h);if(!a.cksumValid)break;let l=512*Math.ceil((a.size||0)/512);if(n+l+512>o.size)break;n+=l,s.mtimeCache&&a.mtime&&s.mtimeCache.set(String(a.path),a.mtime)}i=!1,uo(s,e,n,r,t)}finally{if(i)try{v.closeSync(r)}catch{}}},uo=(s,t,e,i,r)=>{let n=new Wt(s.file,{fd:i,start:e});t.pipe(n),po(t,r)},mo=(s,t)=>{t=Array.from(t);let e=new Et(s),i=(n,o,h)=>{let a=(T,N)=>{T?v.close(n,E=>h(T)):h(null,N)},l=0;if(o===0)return a(null,0);let c=0,d=Buffer.alloc(512),S=(T,N)=>{if(T||N===void 0)return a(T);if(c+=N,c<512&&N)return v.read(n,d,c,d.length-c,l+c,S);if(l===0&&d[0]===31&&d[1]===139)return a(new Error("cannot append to compressed archives"));if(c<512)return a(null,l);let E=new F(d);if(!E.cksumValid)return a(null,l);let x=512*Math.ceil((E.size??0)/512);if(l+x+512>o||(l+=x+512,l>=o))return a(null,l);s.mtimeCache&&E.mtime&&s.mtimeCache.set(String(E.path),E.mtime),c=0,v.read(n,d,0,512,l,S)};v.read(n,d,0,512,l,S)};return new Promise((n,o)=>{e.on("error",o);let h="r+",a=(l,c)=>{if(l&&l.code==="ENOENT"&&h==="r+")return h="w+",v.open(s.file,h,a);if(l||!c)return o(l);v.fstat(c,(d,S)=>{if(d)return v.close(c,()=>o(d));i(c,S.size,(T,N)=>{if(T)return o(T);let E=new tt(s.file,{fd:c,start:N});e.pipe(E),E.on("error",o),E.on("close",n),Eo(e,t)})})};v.open(s.file,h,a)})},po=(s,t)=>{t.forEach(e=>{e.charAt(0)==="@"?It({file:Fr.resolve(s.cwd,e.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(e)}),s.end()},Eo=async(s,t)=>{for(let e of t)e.charAt(0)==="@"?await It({file:Fr.resolve(String(s.cwd),e.slice(1)),noResume:!0,onReadEntry:i=>s.add(i)}):s.add(e);s.end()},vt=K(fo,mo,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(s,t)=>{if(!Fs(s))throw new TypeError("file is required");if(s.gzip||s.brotli||s.zstd||s.file.endsWith(".br")||s.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!t?.length)throw new TypeError("no paths specified to add/replace")});var wo=K(vt.syncFile,vt.asyncFile,vt.syncNoFile,vt.asyncNoFile,(s,t=[])=>{vt.validate?.(s,t),So(s)}),So=s=>{let t=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=t?(e,i)=>t(e,i)&&!((s.mtimeCache?.get(e)??i.mtime??0)>(i.mtime??0)):(e,i)=>!((s.mtimeCache?.get(e)??i.mtime??0)>(i.mtime??0))};export{F as Header,Et as Pack,di as PackJob,kt as PackSync,st as Parser,ct as Pax,Yt as ReadEntry,qt as Unpack,Te as UnpackSync,de as WriteEntry,si as WriteEntrySync,ri as WriteEntryTar,Zn as c,Zn as create,co as extract,Ki as filesFilter,It as list,vt as r,vt as replace,It as t,Bi as types,wo as u,wo as update,co as x};
4
+ //# sourceMappingURL=index.min.js.map
@@ -0,0 +1,94 @@
1
+ // Tar can encode large and negative numbers using a leading byte of
2
+ // 0xff for negative, and 0x80 for positive.
3
+ export const encode = (num, buf) => {
4
+ if (!Number.isSafeInteger(num)) {
5
+ // The number is so large that javascript cannot represent it with integer
6
+ // precision.
7
+ throw Error('cannot encode number outside of javascript safe integer range');
8
+ }
9
+ else if (num < 0) {
10
+ encodeNegative(num, buf);
11
+ }
12
+ else {
13
+ encodePositive(num, buf);
14
+ }
15
+ return buf;
16
+ };
17
+ const encodePositive = (num, buf) => {
18
+ buf[0] = 0x80;
19
+ for (var i = buf.length; i > 1; i--) {
20
+ buf[i - 1] = num & 0xff;
21
+ num = Math.floor(num / 0x100);
22
+ }
23
+ };
24
+ const encodeNegative = (num, buf) => {
25
+ buf[0] = 0xff;
26
+ var flipped = false;
27
+ num = num * -1;
28
+ for (var i = buf.length; i > 1; i--) {
29
+ var byte = num & 0xff;
30
+ num = Math.floor(num / 0x100);
31
+ if (flipped) {
32
+ buf[i - 1] = onesComp(byte);
33
+ }
34
+ else if (byte === 0) {
35
+ buf[i - 1] = 0;
36
+ }
37
+ else {
38
+ flipped = true;
39
+ buf[i - 1] = twosComp(byte);
40
+ }
41
+ }
42
+ };
43
+ export const parse = (buf) => {
44
+ const pre = buf[0];
45
+ const value = pre === 0x80 ? pos(buf.subarray(1, buf.length))
46
+ : pre === 0xff ? twos(buf)
47
+ : null;
48
+ if (value === null) {
49
+ throw Error('invalid base256 encoding');
50
+ }
51
+ if (!Number.isSafeInteger(value)) {
52
+ // The number is so large that javascript cannot represent it with integer
53
+ // precision.
54
+ throw Error('parsed number outside of javascript safe integer range');
55
+ }
56
+ return value;
57
+ };
58
+ const twos = (buf) => {
59
+ var len = buf.length;
60
+ var sum = 0;
61
+ var flipped = false;
62
+ for (var i = len - 1; i > -1; i--) {
63
+ var byte = Number(buf[i]);
64
+ var f;
65
+ if (flipped) {
66
+ f = onesComp(byte);
67
+ }
68
+ else if (byte === 0) {
69
+ f = byte;
70
+ }
71
+ else {
72
+ flipped = true;
73
+ f = twosComp(byte);
74
+ }
75
+ if (f !== 0) {
76
+ sum -= f * Math.pow(256, len - i - 1);
77
+ }
78
+ }
79
+ return sum;
80
+ };
81
+ const pos = (buf) => {
82
+ var len = buf.length;
83
+ var sum = 0;
84
+ for (var i = len - 1; i > -1; i--) {
85
+ var byte = Number(buf[i]);
86
+ if (byte !== 0) {
87
+ sum += byte * Math.pow(256, len - i - 1);
88
+ }
89
+ }
90
+ return sum;
91
+ };
92
+ const onesComp = (byte) => (0xff ^ byte) & 0xff;
93
+ const twosComp = (byte) => ((0xff ^ byte) + 1) & 0xff;
94
+ //# sourceMappingURL=large-numbers.js.map
@@ -0,0 +1,105 @@
1
+ // tar -t
2
+ import * as fsm from '@isaacs/fs-minipass';
3
+ import fs from 'node:fs';
4
+ import { dirname, parse } from 'path';
5
+ import { makeCommand } from './make-command.js';
6
+ import { Parser } from './parse.js';
7
+ import { stripTrailingSlashes } from './strip-trailing-slashes.js';
8
+ const onReadEntryFunction = (opt) => {
9
+ const onReadEntry = opt.onReadEntry;
10
+ opt.onReadEntry =
11
+ onReadEntry ?
12
+ e => {
13
+ onReadEntry(e);
14
+ e.resume();
15
+ }
16
+ : e => e.resume();
17
+ };
18
+ // construct a filter that limits the file entries listed
19
+ // include child entries if a dir is included
20
+ export const filesFilter = (opt, files) => {
21
+ const map = new Map(files.map(f => [stripTrailingSlashes(f), true]));
22
+ const filter = opt.filter;
23
+ const mapHas = (file, r = '') => {
24
+ const root = r || parse(file).root || '.';
25
+ let ret;
26
+ if (file === root)
27
+ ret = false;
28
+ else {
29
+ const m = map.get(file);
30
+ ret = m !== undefined ? m : mapHas(dirname(file), root);
31
+ }
32
+ map.set(file, ret);
33
+ return ret;
34
+ };
35
+ opt.filter =
36
+ filter ?
37
+ (file, entry) => filter(file, entry) && mapHas(stripTrailingSlashes(file))
38
+ : file => mapHas(stripTrailingSlashes(file));
39
+ };
40
+ const listFileSync = (opt) => {
41
+ const p = new Parser(opt);
42
+ const file = opt.file;
43
+ let fd;
44
+ try {
45
+ fd = fs.openSync(file, 'r');
46
+ const stat = fs.fstatSync(fd);
47
+ const readSize = opt.maxReadSize || 16 * 1024 * 1024;
48
+ if (stat.size < readSize) {
49
+ const buf = Buffer.allocUnsafe(stat.size);
50
+ const read = fs.readSync(fd, buf, 0, stat.size, 0);
51
+ p.end(read === buf.byteLength ? buf : buf.subarray(0, read));
52
+ }
53
+ else {
54
+ let pos = 0;
55
+ const buf = Buffer.allocUnsafe(readSize);
56
+ while (pos < stat.size) {
57
+ const bytesRead = fs.readSync(fd, buf, 0, readSize, pos);
58
+ if (bytesRead === 0)
59
+ break;
60
+ pos += bytesRead;
61
+ p.write(buf.subarray(0, bytesRead));
62
+ }
63
+ p.end();
64
+ }
65
+ }
66
+ finally {
67
+ if (typeof fd === 'number') {
68
+ try {
69
+ fs.closeSync(fd);
70
+ /* c8 ignore next */
71
+ }
72
+ catch { }
73
+ }
74
+ }
75
+ };
76
+ const listFile = (opt, _files) => {
77
+ const parse = new Parser(opt);
78
+ const readSize = opt.maxReadSize || 16 * 1024 * 1024;
79
+ const file = opt.file;
80
+ const p = new Promise((resolve, reject) => {
81
+ parse.on('error', reject);
82
+ parse.on('end', resolve);
83
+ fs.stat(file, (er, stat) => {
84
+ if (er) {
85
+ reject(er);
86
+ }
87
+ else {
88
+ const stream = new fsm.ReadStream(file, {
89
+ readSize: readSize,
90
+ size: stat.size,
91
+ });
92
+ stream.on('error', reject);
93
+ stream.pipe(parse);
94
+ }
95
+ });
96
+ });
97
+ return p;
98
+ };
99
+ export const list = makeCommand(listFileSync, listFile, opt => new Parser(opt), opt => new Parser(opt), (opt, files) => {
100
+ if (files?.length)
101
+ filesFilter(opt, files);
102
+ if (!opt.noResume)
103
+ onReadEntryFunction(opt);
104
+ });
105
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1,48 @@
1
+ import { dealias, isAsyncFile, isAsyncNoFile, isSyncFile, isSyncNoFile, } from './options.js';
2
+ export const makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) => {
3
+ return Object.assign((opt_ = [], entries, cb) => {
4
+ if (Array.isArray(opt_)) {
5
+ entries = opt_;
6
+ opt_ = {};
7
+ }
8
+ if (typeof entries === 'function') {
9
+ cb = entries;
10
+ entries = undefined;
11
+ }
12
+ entries = !entries ? [] : Array.from(entries);
13
+ const opt = dealias(opt_);
14
+ validate?.(opt, entries);
15
+ if (isSyncFile(opt)) {
16
+ if (typeof cb === 'function') {
17
+ throw new TypeError('callback not supported for sync tar functions');
18
+ }
19
+ return syncFile(opt, entries);
20
+ }
21
+ else if (isAsyncFile(opt)) {
22
+ const p = asyncFile(opt, entries);
23
+ return cb ? p.then(() => cb(), cb) : p;
24
+ }
25
+ else if (isSyncNoFile(opt)) {
26
+ if (typeof cb === 'function') {
27
+ throw new TypeError('callback not supported for sync tar functions');
28
+ }
29
+ return syncNoFile(opt, entries);
30
+ }
31
+ else if (isAsyncNoFile(opt)) {
32
+ if (typeof cb === 'function') {
33
+ throw new TypeError('callback only supported with file option');
34
+ }
35
+ return asyncNoFile(opt, entries);
36
+ /* c8 ignore start */
37
+ }
38
+ throw new Error('impossible options??');
39
+ /* c8 ignore stop */
40
+ }, {
41
+ syncFile,
42
+ asyncFile,
43
+ syncNoFile,
44
+ asyncNoFile,
45
+ validate,
46
+ });
47
+ };
48
+ //# sourceMappingURL=make-command.js.map
@@ -0,0 +1,179 @@
1
+ import { chownr, chownrSync } from 'chownr';
2
+ import fs from 'node:fs';
3
+ import fsp from 'node:fs/promises';
4
+ import path from 'node:path';
5
+ import { CwdError } from './cwd-error.js';
6
+ import { normalizeWindowsPath } from './normalize-windows-path.js';
7
+ import { SymlinkError } from './symlink-error.js';
8
+ const checkCwd = (dir, cb) => {
9
+ fs.stat(dir, (er, st) => {
10
+ if (er || !st.isDirectory()) {
11
+ er = new CwdError(dir, er?.code || 'ENOTDIR');
12
+ }
13
+ cb(er);
14
+ });
15
+ };
16
+ /**
17
+ * Wrapper around fs/promises.mkdir for tar's needs.
18
+ *
19
+ * The main purpose is to avoid creating directories if we know that
20
+ * they already exist (and track which ones exist for this purpose),
21
+ * and prevent entries from being extracted into symlinked folders,
22
+ * if `preservePaths` is not set.
23
+ */
24
+ export const mkdir = (dir, opt, cb) => {
25
+ dir = normalizeWindowsPath(dir);
26
+ // if there's any overlap between mask and mode,
27
+ // then we'll need an explicit chmod
28
+ /* c8 ignore next */
29
+ const umask = opt.umask ?? 0o22;
30
+ const mode = opt.mode | 0o0700;
31
+ const needChmod = (mode & umask) !== 0;
32
+ const uid = opt.uid;
33
+ const gid = opt.gid;
34
+ const doChown = typeof uid === 'number' &&
35
+ typeof gid === 'number' &&
36
+ (uid !== opt.processUid || gid !== opt.processGid);
37
+ const preserve = opt.preserve;
38
+ const unlink = opt.unlink;
39
+ const cwd = normalizeWindowsPath(opt.cwd);
40
+ const done = (er, created) => {
41
+ if (er) {
42
+ cb(er);
43
+ }
44
+ else {
45
+ if (created && doChown) {
46
+ chownr(created, uid, gid, er => done(er));
47
+ }
48
+ else if (needChmod) {
49
+ fs.chmod(dir, mode, cb);
50
+ }
51
+ else {
52
+ cb();
53
+ }
54
+ }
55
+ };
56
+ if (dir === cwd) {
57
+ return checkCwd(dir, done);
58
+ }
59
+ if (preserve) {
60
+ return fsp.mkdir(dir, { mode, recursive: true }).then(made => done(null, made ?? undefined), // oh, ts
61
+ done);
62
+ }
63
+ const sub = normalizeWindowsPath(path.relative(cwd, dir));
64
+ const parts = sub.split('/');
65
+ mkdir_(cwd, parts, mode, unlink, cwd, undefined, done);
66
+ };
67
+ const mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => {
68
+ if (parts.length === 0) {
69
+ return cb(null, created);
70
+ }
71
+ const p = parts.shift();
72
+ const part = normalizeWindowsPath(path.resolve(base + '/' + p));
73
+ fs.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
74
+ };
75
+ const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
76
+ if (er) {
77
+ fs.lstat(part, (statEr, st) => {
78
+ if (statEr) {
79
+ statEr.path = statEr.path && normalizeWindowsPath(statEr.path);
80
+ cb(statEr);
81
+ }
82
+ else if (st.isDirectory()) {
83
+ mkdir_(part, parts, mode, unlink, cwd, created, cb);
84
+ }
85
+ else if (unlink) {
86
+ fs.unlink(part, er => {
87
+ if (er) {
88
+ return cb(er);
89
+ }
90
+ fs.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
91
+ });
92
+ }
93
+ else if (st.isSymbolicLink()) {
94
+ return cb(new SymlinkError(part, part + '/' + parts.join('/')));
95
+ }
96
+ else {
97
+ cb(er);
98
+ }
99
+ });
100
+ }
101
+ else {
102
+ created = created || part;
103
+ mkdir_(part, parts, mode, unlink, cwd, created, cb);
104
+ }
105
+ };
106
+ const checkCwdSync = (dir) => {
107
+ let ok = false;
108
+ let code;
109
+ try {
110
+ ok = fs.statSync(dir).isDirectory();
111
+ }
112
+ catch (er) {
113
+ code = er?.code;
114
+ }
115
+ finally {
116
+ if (!ok) {
117
+ throw new CwdError(dir, code ?? 'ENOTDIR');
118
+ }
119
+ }
120
+ };
121
+ export const mkdirSync = (dir, opt) => {
122
+ dir = normalizeWindowsPath(dir);
123
+ // if there's any overlap between mask and mode,
124
+ // then we'll need an explicit chmod
125
+ /* c8 ignore next */
126
+ const umask = opt.umask ?? 0o22;
127
+ const mode = opt.mode | 0o700;
128
+ const needChmod = (mode & umask) !== 0;
129
+ const uid = opt.uid;
130
+ const gid = opt.gid;
131
+ const doChown = typeof uid === 'number' &&
132
+ typeof gid === 'number' &&
133
+ (uid !== opt.processUid || gid !== opt.processGid);
134
+ const preserve = opt.preserve;
135
+ const unlink = opt.unlink;
136
+ const cwd = normalizeWindowsPath(opt.cwd);
137
+ const done = (created) => {
138
+ if (created && doChown) {
139
+ chownrSync(created, uid, gid);
140
+ }
141
+ if (needChmod) {
142
+ fs.chmodSync(dir, mode);
143
+ }
144
+ };
145
+ if (dir === cwd) {
146
+ checkCwdSync(cwd);
147
+ return done();
148
+ }
149
+ if (preserve) {
150
+ return done(fs.mkdirSync(dir, { mode, recursive: true }) ?? undefined);
151
+ }
152
+ const sub = normalizeWindowsPath(path.relative(cwd, dir));
153
+ const parts = sub.split('/');
154
+ let created;
155
+ for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) {
156
+ part = normalizeWindowsPath(path.resolve(part));
157
+ try {
158
+ fs.mkdirSync(part, mode);
159
+ created = created || part;
160
+ }
161
+ catch {
162
+ const st = fs.lstatSync(part);
163
+ if (st.isDirectory()) {
164
+ continue;
165
+ }
166
+ else if (unlink) {
167
+ fs.unlinkSync(part);
168
+ fs.mkdirSync(part, mode);
169
+ created = created || part;
170
+ continue;
171
+ }
172
+ else if (st.isSymbolicLink()) {
173
+ return new SymlinkError(part, part + '/' + parts.join('/'));
174
+ }
175
+ }
176
+ }
177
+ return done(created);
178
+ };
179
+ //# sourceMappingURL=mkdir.js.map