@maizzle/framework 6.0.0-rc.1 → 6.0.0-rc.11

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 (347) hide show
  1. package/bin/maizzle.mjs +1 -1
  2. package/dist/_virtual/_rolldown/runtime.mjs +32 -0
  3. package/dist/build.mjs +6 -3
  4. package/dist/build.mjs.map +1 -1
  5. package/dist/components/Body.vue +111 -0
  6. package/dist/components/Button.vue +68 -14
  7. package/dist/components/CodeBlock.vue +68 -0
  8. package/dist/components/CodeInline.vue +49 -0
  9. package/dist/components/Column.vue +78 -0
  10. package/dist/components/Container.vue +53 -0
  11. package/dist/components/Divider.vue +28 -0
  12. package/dist/components/Head.vue +30 -0
  13. package/dist/components/Heading.vue +28 -0
  14. package/dist/components/Html.vue +104 -0
  15. package/dist/components/Img.vue +70 -0
  16. package/dist/components/Layout.vue +93 -0
  17. package/dist/components/Link.vue +26 -0
  18. package/dist/components/Markdown.vue +89 -0
  19. package/dist/components/Outlook.vue +36 -0
  20. package/dist/components/Overlap.vue +84 -0
  21. package/dist/components/Preheader.vue +20 -0
  22. package/dist/components/Row.vue +91 -0
  23. package/dist/components/Section.vue +83 -0
  24. package/dist/components/Spacer.vue +50 -7
  25. package/dist/components/Text.vue +29 -0
  26. package/dist/components/Vml.vue +165 -13
  27. package/dist/composables/renderContext.d.mts +5 -0
  28. package/dist/composables/renderContext.d.mts.map +1 -1
  29. package/dist/composables/renderContext.mjs.map +1 -1
  30. package/dist/composables/usePreheader.d.mts +24 -0
  31. package/dist/composables/usePreheader.d.mts.map +1 -0
  32. package/dist/composables/usePreheader.mjs +29 -0
  33. package/dist/composables/usePreheader.mjs.map +1 -0
  34. package/dist/config/defaults.mjs +1 -3
  35. package/dist/config/defaults.mjs.map +1 -1
  36. package/dist/config/index.mjs +7 -0
  37. package/dist/config/index.mjs.map +1 -1
  38. package/dist/index.d.mts +4 -2
  39. package/dist/index.mjs +3 -1
  40. package/dist/node_modules/picomatch/index.mjs +13 -0
  41. package/dist/node_modules/picomatch/index.mjs.map +1 -0
  42. package/dist/node_modules/picomatch/lib/constants.mjs +174 -0
  43. package/dist/node_modules/picomatch/lib/constants.mjs.map +1 -0
  44. package/dist/node_modules/picomatch/lib/parse.mjs +1067 -0
  45. package/dist/node_modules/picomatch/lib/parse.mjs.map +1 -0
  46. package/dist/node_modules/picomatch/lib/picomatch.mjs +304 -0
  47. package/dist/node_modules/picomatch/lib/picomatch.mjs.map +1 -0
  48. package/dist/node_modules/picomatch/lib/scan.mjs +296 -0
  49. package/dist/node_modules/picomatch/lib/scan.mjs.map +1 -0
  50. package/dist/node_modules/picomatch/lib/utils.mjs +53 -0
  51. package/dist/node_modules/picomatch/lib/utils.mjs.map +1 -0
  52. package/dist/plugin.d.mts.map +1 -1
  53. package/dist/plugin.mjs +24 -7
  54. package/dist/plugin.mjs.map +1 -1
  55. package/dist/plugins/postcss/resolveProps.d.mts +8 -0
  56. package/dist/plugins/postcss/resolveProps.d.mts.map +1 -0
  57. package/dist/plugins/postcss/resolveProps.mjs +144 -0
  58. package/dist/plugins/postcss/resolveProps.mjs.map +1 -0
  59. package/dist/plugins/postcss/tailwindCleanup.d.mts.map +1 -1
  60. package/dist/plugins/postcss/tailwindCleanup.mjs +46 -13
  61. package/dist/plugins/postcss/tailwindCleanup.mjs.map +1 -1
  62. package/dist/render/createRenderer.d.mts +8 -3
  63. package/dist/render/createRenderer.d.mts.map +1 -1
  64. package/dist/render/createRenderer.mjs +146 -10
  65. package/dist/render/createRenderer.mjs.map +1 -1
  66. package/dist/render/index.mjs +6 -3
  67. package/dist/render/index.mjs.map +1 -1
  68. package/dist/serve.d.mts.map +1 -1
  69. package/dist/serve.mjs +157 -63
  70. package/dist/serve.mjs.map +1 -1
  71. package/dist/server/compatibility.d.mts +1 -2
  72. package/dist/server/compatibility.d.mts.map +1 -1
  73. package/dist/server/compatibility.mjs +30 -16
  74. package/dist/server/compatibility.mjs.map +1 -1
  75. package/dist/server/email.d.mts +17 -0
  76. package/dist/server/email.d.mts.map +1 -0
  77. package/dist/server/email.mjs +41 -0
  78. package/dist/server/email.mjs.map +1 -0
  79. package/dist/server/linter.d.mts +1 -2
  80. package/dist/server/linter.d.mts.map +1 -1
  81. package/dist/server/linter.mjs +60 -71
  82. package/dist/server/linter.mjs.map +1 -1
  83. package/dist/server/ui/App.vue +206 -70
  84. package/dist/server/ui/components/ui/checkbox/Checkbox.vue +35 -0
  85. package/dist/server/ui/components/ui/checkbox/index.ts +1 -0
  86. package/dist/server/ui/components/ui/command/CommandDialog.vue +1 -1
  87. package/dist/server/ui/components/ui/command/CommandInput.vue +19 -1
  88. package/dist/server/ui/components/ui/command/CommandItem.vue +1 -1
  89. package/dist/server/ui/components/ui/command/CommandList.vue +1 -1
  90. package/dist/server/ui/components/ui/command/CommandShortcut.vue +1 -1
  91. package/dist/server/ui/components/ui/dialog/DialogOverlay.vue +9 -1
  92. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuItem.vue +1 -1
  93. package/dist/server/ui/components/ui/scroll-area/ScrollBar.vue +1 -1
  94. package/dist/server/ui/components/ui/sheet/SheetContent.vue +1 -1
  95. package/dist/server/ui/components/ui/sheet/SheetOverlay.vue +9 -1
  96. package/dist/server/ui/components/ui/sidebar/Sidebar.vue +8 -1
  97. package/dist/server/ui/components/ui/sidebar/SidebarProvider.vue +1 -1
  98. package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +5 -4
  99. package/dist/server/ui/components/ui/tags-input/TagsInput.vue +26 -0
  100. package/dist/server/ui/components/ui/tags-input/TagsInputInput.vue +17 -0
  101. package/dist/server/ui/components/ui/tags-input/TagsInputItem.vue +19 -0
  102. package/dist/server/ui/components/ui/tags-input/TagsInputItemDelete.vue +22 -0
  103. package/dist/server/ui/components/ui/tags-input/TagsInputItemText.vue +17 -0
  104. package/dist/server/ui/components/ui/tags-input/index.ts +5 -0
  105. package/dist/server/ui/components/ui/toggle/index.ts +3 -3
  106. package/dist/server/ui/components/ui/toggle-group/ToggleGroup.vue +1 -1
  107. package/dist/server/ui/components/ui/toggle-group/ToggleGroupItem.vue +2 -2
  108. package/dist/server/ui/main.css +20 -20
  109. package/dist/server/ui/pages/Home.vue +12 -5
  110. package/dist/server/ui/pages/Preview.vue +506 -216
  111. package/dist/transformers/entities.d.mts.map +1 -1
  112. package/dist/transformers/entities.mjs +3 -0
  113. package/dist/transformers/entities.mjs.map +1 -1
  114. package/dist/transformers/filters/defaults.d.mts +6 -0
  115. package/dist/transformers/filters/defaults.d.mts.map +1 -0
  116. package/dist/transformers/filters/defaults.mjs +78 -0
  117. package/dist/transformers/filters/defaults.mjs.map +1 -0
  118. package/dist/transformers/filters/index.d.mts +22 -0
  119. package/dist/transformers/filters/index.d.mts.map +1 -0
  120. package/dist/transformers/filters/index.mjs +67 -0
  121. package/dist/transformers/filters/index.mjs.map +1 -0
  122. package/dist/transformers/index.d.mts +11 -9
  123. package/dist/transformers/index.d.mts.map +1 -1
  124. package/dist/transformers/index.mjs +19 -11
  125. package/dist/transformers/index.mjs.map +1 -1
  126. package/dist/transformers/inlineCSS.d.mts +1 -14
  127. package/dist/transformers/inlineCSS.d.mts.map +1 -1
  128. package/dist/transformers/inlineCSS.mjs +32 -36
  129. package/dist/transformers/inlineCSS.mjs.map +1 -1
  130. package/dist/transformers/purgeCSS.d.mts.map +1 -1
  131. package/dist/transformers/purgeCSS.mjs +67 -1
  132. package/dist/transformers/purgeCSS.mjs.map +1 -1
  133. package/dist/transformers/sixHex.d.mts +16 -0
  134. package/dist/transformers/sixHex.d.mts.map +1 -0
  135. package/dist/transformers/sixHex.mjs +30 -0
  136. package/dist/transformers/sixHex.mjs.map +1 -0
  137. package/dist/transformers/tailwindcss.d.mts +6 -2
  138. package/dist/transformers/tailwindcss.d.mts.map +1 -1
  139. package/dist/transformers/tailwindcss.mjs +54 -30
  140. package/dist/transformers/tailwindcss.mjs.map +1 -1
  141. package/dist/types/config.d.mts +436 -23
  142. package/dist/types/config.d.mts.map +1 -1
  143. package/dist/types/index.d.mts +2 -2
  144. package/dist/utils/ast/serializer.d.mts +3 -2
  145. package/dist/utils/ast/serializer.d.mts.map +1 -1
  146. package/dist/utils/ast/serializer.mjs +24 -0
  147. package/dist/utils/ast/serializer.mjs.map +1 -1
  148. package/dist/utils/detect.d.mts +5 -0
  149. package/dist/utils/detect.d.mts.map +1 -0
  150. package/dist/utils/detect.mjs +11 -0
  151. package/dist/utils/detect.mjs.map +1 -0
  152. package/node_modules/@clack/core/CHANGELOG.md +87 -4
  153. package/node_modules/@clack/core/README.md +1 -1
  154. package/node_modules/@clack/core/dist/index.d.mts +186 -48
  155. package/node_modules/@clack/core/dist/index.mjs +10 -14
  156. package/node_modules/@clack/core/dist/index.mjs.map +1 -1
  157. package/node_modules/@clack/core/package.json +7 -9
  158. package/node_modules/@clack/prompts/CHANGELOG.md +171 -7
  159. package/node_modules/@clack/prompts/README.md +66 -3
  160. package/node_modules/@clack/prompts/dist/index.d.mts +302 -76
  161. package/node_modules/@clack/prompts/dist/index.mjs +134 -84
  162. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
  163. package/node_modules/@clack/prompts/package.json +14 -10
  164. package/node_modules/citty/LICENSE +0 -15
  165. package/node_modules/citty/README.md +166 -69
  166. package/node_modules/citty/dist/index.d.mts +88 -56
  167. package/node_modules/citty/dist/index.mjs +399 -437
  168. package/node_modules/citty/package.json +28 -35
  169. package/node_modules/giget/README.md +59 -11
  170. package/node_modules/giget/dist/THIRD-PARTY-LICENSES.md +205 -0
  171. package/node_modules/giget/dist/_chunks/giget.mjs +508 -0
  172. package/node_modules/giget/dist/_chunks/libs/citty.mjs +269 -0
  173. package/node_modules/giget/dist/_chunks/libs/nypm.d.mts +1 -0
  174. package/node_modules/giget/dist/_chunks/libs/nypm.mjs +669 -0
  175. package/node_modules/giget/dist/_chunks/libs/tar.mjs +2931 -0
  176. package/node_modules/giget/dist/_chunks/rolldown-runtime.mjs +14 -0
  177. package/node_modules/giget/dist/cli.d.mts +1 -0
  178. package/node_modules/giget/dist/cli.mjs +89 -111
  179. package/node_modules/giget/dist/index.d.mts +46 -35
  180. package/node_modules/giget/dist/index.mjs +2 -22
  181. package/node_modules/giget/package.json +32 -45
  182. package/node_modules/maizzle/README.md +140 -0
  183. package/node_modules/maizzle/bin/maizzle.mjs +5 -0
  184. package/node_modules/maizzle/dist/commands/new.d.mts +7 -0
  185. package/node_modules/maizzle/dist/commands/new.mjs +253 -0
  186. package/node_modules/{@maizzle/cli → maizzle}/dist/index.d.mts +1 -1
  187. package/node_modules/maizzle/dist/index.mjs +44 -0
  188. package/node_modules/{commander → maizzle/node_modules/commander}/Readme.md +94 -67
  189. package/node_modules/{commander → maizzle/node_modules/commander}/lib/argument.js +5 -4
  190. package/node_modules/{commander → maizzle/node_modules/commander}/lib/command.js +154 -39
  191. package/node_modules/{commander → maizzle/node_modules/commander}/lib/help.js +77 -39
  192. package/node_modules/{commander → maizzle/node_modules/commander}/lib/option.js +16 -3
  193. package/node_modules/{commander → maizzle/node_modules/commander}/package-support.json +4 -1
  194. package/node_modules/{commander → maizzle/node_modules/commander}/package.json +8 -8
  195. package/node_modules/{commander → maizzle/node_modules/commander}/typings/index.d.ts +71 -3
  196. package/node_modules/{@maizzle/cli → maizzle}/package.json +14 -12
  197. package/node_modules/tinyexec/README.md +49 -3
  198. package/node_modules/tinyexec/dist/main.d.mts +25 -14
  199. package/node_modules/tinyexec/dist/main.mjs +148 -100
  200. package/node_modules/tinyexec/package.json +9 -8
  201. package/package.json +17 -13
  202. package/dist/server/ui/components/ui/resizable/ResizableHandle.vue +0 -30
  203. package/dist/server/ui/components/ui/resizable/ResizablePanel.vue +0 -21
  204. package/dist/server/ui/components/ui/resizable/ResizablePanelGroup.vue +0 -25
  205. package/dist/server/ui/components/ui/resizable/index.ts +0 -3
  206. package/node_modules/@clack/core/dist/index.cjs +0 -15
  207. package/node_modules/@clack/core/dist/index.cjs.map +0 -1
  208. package/node_modules/@clack/core/dist/index.d.cts +0 -211
  209. package/node_modules/@clack/core/dist/index.d.ts +0 -211
  210. package/node_modules/@clack/prompts/dist/index.cjs +0 -87
  211. package/node_modules/@clack/prompts/dist/index.cjs.map +0 -1
  212. package/node_modules/@clack/prompts/dist/index.d.cts +0 -165
  213. package/node_modules/@clack/prompts/dist/index.d.ts +0 -165
  214. package/node_modules/@maizzle/cli/README.md +0 -58
  215. package/node_modules/@maizzle/cli/dist/index.mjs +0 -42
  216. package/node_modules/citty/dist/index.cjs +0 -475
  217. package/node_modules/citty/dist/index.d.cts +0 -80
  218. package/node_modules/citty/dist/index.d.ts +0 -80
  219. package/node_modules/consola/LICENSE +0 -47
  220. package/node_modules/consola/README.md +0 -352
  221. package/node_modules/consola/basic.d.ts +0 -1
  222. package/node_modules/consola/browser.d.ts +0 -1
  223. package/node_modules/consola/core.d.ts +0 -1
  224. package/node_modules/consola/dist/basic.cjs +0 -32
  225. package/node_modules/consola/dist/basic.d.cts +0 -23
  226. package/node_modules/consola/dist/basic.d.mts +0 -21
  227. package/node_modules/consola/dist/basic.d.ts +0 -23
  228. package/node_modules/consola/dist/basic.mjs +0 -24
  229. package/node_modules/consola/dist/browser.cjs +0 -84
  230. package/node_modules/consola/dist/browser.d.cts +0 -23
  231. package/node_modules/consola/dist/browser.d.mts +0 -21
  232. package/node_modules/consola/dist/browser.d.ts +0 -23
  233. package/node_modules/consola/dist/browser.mjs +0 -76
  234. package/node_modules/consola/dist/chunks/prompt.cjs +0 -288
  235. package/node_modules/consola/dist/chunks/prompt.mjs +0 -280
  236. package/node_modules/consola/dist/core.cjs +0 -517
  237. package/node_modules/consola/dist/core.d.cts +0 -459
  238. package/node_modules/consola/dist/core.d.mts +0 -459
  239. package/node_modules/consola/dist/core.d.ts +0 -459
  240. package/node_modules/consola/dist/core.mjs +0 -512
  241. package/node_modules/consola/dist/index.cjs +0 -663
  242. package/node_modules/consola/dist/index.d.cts +0 -24
  243. package/node_modules/consola/dist/index.d.mts +0 -22
  244. package/node_modules/consola/dist/index.d.ts +0 -24
  245. package/node_modules/consola/dist/index.mjs +0 -651
  246. package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +0 -75
  247. package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +0 -72
  248. package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +0 -288
  249. package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +0 -312
  250. package/node_modules/consola/dist/utils.cjs +0 -64
  251. package/node_modules/consola/dist/utils.d.cts +0 -286
  252. package/node_modules/consola/dist/utils.d.mts +0 -286
  253. package/node_modules/consola/dist/utils.d.ts +0 -286
  254. package/node_modules/consola/dist/utils.mjs +0 -54
  255. package/node_modules/consola/lib/index.cjs +0 -10
  256. package/node_modules/consola/package.json +0 -136
  257. package/node_modules/consola/utils.d.ts +0 -1
  258. package/node_modules/create-maizzle/README.md +0 -86
  259. package/node_modules/create-maizzle/bin/create-maizzle.mjs +0 -4
  260. package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +0 -340
  261. package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +0 -9
  262. package/node_modules/create-maizzle/node_modules/@clack/core/README.md +0 -22
  263. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +0 -349
  264. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +0 -11
  265. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +0 -1
  266. package/node_modules/create-maizzle/node_modules/@clack/core/package.json +0 -60
  267. package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +0 -576
  268. package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +0 -9
  269. package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +0 -270
  270. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +0 -391
  271. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +0 -137
  272. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
  273. package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +0 -65
  274. package/node_modules/create-maizzle/package.json +0 -47
  275. package/node_modules/create-maizzle/src/index.js +0 -242
  276. package/node_modules/defu/LICENSE +0 -21
  277. package/node_modules/defu/README.md +0 -171
  278. package/node_modules/defu/dist/defu.cjs +0 -77
  279. package/node_modules/defu/dist/defu.d.cts +0 -31
  280. package/node_modules/defu/dist/defu.d.mts +0 -29
  281. package/node_modules/defu/dist/defu.d.ts +0 -31
  282. package/node_modules/defu/dist/defu.mjs +0 -69
  283. package/node_modules/defu/lib/defu.cjs +0 -10
  284. package/node_modules/defu/lib/defu.d.cts +0 -12
  285. package/node_modules/defu/package.json +0 -48
  286. package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -468
  287. package/node_modules/node-fetch-native/LICENSE +0 -114
  288. package/node_modules/node-fetch-native/README.md +0 -225
  289. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -2
  290. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -2
  291. package/node_modules/node-fetch-native/dist/index.cjs +0 -1
  292. package/node_modules/node-fetch-native/dist/index.mjs +0 -1
  293. package/node_modules/node-fetch-native/dist/native.cjs +0 -1
  294. package/node_modules/node-fetch-native/dist/native.mjs +0 -1
  295. package/node_modules/node-fetch-native/dist/node.cjs +0 -19
  296. package/node_modules/node-fetch-native/dist/node.mjs +0 -19
  297. package/node_modules/node-fetch-native/dist/polyfill.cjs +0 -1
  298. package/node_modules/node-fetch-native/dist/polyfill.mjs +0 -1
  299. package/node_modules/node-fetch-native/dist/proxy-stub.cjs +0 -1
  300. package/node_modules/node-fetch-native/dist/proxy-stub.mjs +0 -1
  301. package/node_modules/node-fetch-native/dist/proxy.cjs +0 -58
  302. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -1
  303. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -1
  304. package/node_modules/node-fetch-native/index.d.ts +0 -1
  305. package/node_modules/node-fetch-native/lib/empty.cjs +0 -0
  306. package/node_modules/node-fetch-native/lib/empty.mjs +0 -0
  307. package/node_modules/node-fetch-native/lib/index.cjs +0 -11
  308. package/node_modules/node-fetch-native/lib/index.d.cts +0 -10
  309. package/node_modules/node-fetch-native/lib/index.d.mts +0 -10
  310. package/node_modules/node-fetch-native/lib/index.d.ts +0 -10
  311. package/node_modules/node-fetch-native/lib/native.cjs +0 -11
  312. package/node_modules/node-fetch-native/lib/polyfill.d.cts +0 -1
  313. package/node_modules/node-fetch-native/lib/polyfill.d.mts +0 -1
  314. package/node_modules/node-fetch-native/lib/polyfill.d.ts +0 -1
  315. package/node_modules/node-fetch-native/lib/proxy.d.ts +0 -32
  316. package/node_modules/node-fetch-native/node.d.ts +0 -1
  317. package/node_modules/node-fetch-native/package.json +0 -138
  318. package/node_modules/node-fetch-native/polyfill.d.ts +0 -1
  319. package/node_modules/node-fetch-native/proxy.d.ts +0 -1
  320. package/node_modules/nypm/node_modules/citty/LICENSE +0 -21
  321. package/node_modules/nypm/node_modules/citty/README.md +0 -231
  322. package/node_modules/nypm/node_modules/citty/dist/index.d.mts +0 -112
  323. package/node_modules/nypm/node_modules/citty/dist/index.mjs +0 -425
  324. package/node_modules/nypm/node_modules/citty/package.json +0 -42
  325. /package/node_modules/{nypm/node_modules/citty → citty}/dist/THIRD-PARTY-LICENSES.md +0 -0
  326. /package/node_modules/{nypm/node_modules/citty → citty}/dist/_chunks/libs/scule.mjs +0 -0
  327. /package/node_modules/{@maizzle/cli → maizzle}/LICENSE +0 -0
  328. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.d.mts +0 -0
  329. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.mjs +0 -0
  330. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.d.mts +0 -0
  331. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.mjs +0 -0
  332. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.d.mts +0 -0
  333. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.mjs +0 -0
  334. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.d.mts +0 -0
  335. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.mjs +0 -0
  336. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/component.vue +0 -0
  337. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/config.ts +0 -0
  338. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/layout.vue +0 -0
  339. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/template.vue +0 -0
  340. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.d.mts +0 -0
  341. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.mjs +0 -0
  342. /package/node_modules/{commander → maizzle/node_modules/commander}/LICENSE +0 -0
  343. /package/node_modules/{commander → maizzle/node_modules/commander}/esm.mjs +0 -0
  344. /package/node_modules/{commander → maizzle/node_modules/commander}/index.js +0 -0
  345. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/error.js +0 -0
  346. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/suggestSimilar.js +0 -0
  347. /package/node_modules/{commander → maizzle/node_modules/commander}/typings/esm.d.mts +0 -0
@@ -0,0 +1,2931 @@
1
+ import { t as e } from "../rolldown-runtime.mjs";
2
+ import t from "node:fs";
3
+ import n from "node:fs/promises";
4
+ import r from "node:stream";
5
+ import i, { basename as a, join as o, posix as s, win32 as c } from "node:path";
6
+ import l, { EventEmitter as u } from "events";
7
+ import d from "fs";
8
+ import { EventEmitter as f } from "node:events";
9
+ import { StringDecoder as ee } from "node:string_decoder";
10
+ import p, { dirname as m, parse as te } from "path";
11
+ import ne from "assert";
12
+ import { Buffer as re } from "buffer";
13
+ import * as ie from "zlib";
14
+ import ae from "zlib";
15
+ import oe from "node:assert";
16
+ import { randomBytes as se } from "node:crypto";
17
+ var ce = e({
18
+ Header: () => I,
19
+ Pack: () => ni,
20
+ PackJob: () => Ir,
21
+ PackSync: () => ri,
22
+ Parser: () => Jn,
23
+ Pax: () => hn,
24
+ ReadEntry: () => yn,
25
+ Unpack: () => _a,
26
+ UnpackSync: () => ya,
27
+ WriteEntry: () => Dr,
28
+ WriteEntrySync: () => Or,
29
+ WriteEntryTar: () => kr,
30
+ c: () => ci,
31
+ create: () => ci,
32
+ extract: () => ba,
33
+ filesFilter: () => Zn,
34
+ list: () => Qn,
35
+ r: () => Ea,
36
+ replace: () => Ea,
37
+ t: () => Qn,
38
+ types: () => Xt,
39
+ x: () => ba
40
+ }), le = Object.defineProperty, ue = (e, t) => {
41
+ for (var n in t) le(e, n, {
42
+ get: t[n],
43
+ enumerable: !0
44
+ });
45
+ }, de = typeof process == `object` && process ? process : {
46
+ stdout: null,
47
+ stderr: null
48
+ }, fe = (e) => !!e && typeof e == `object` && (e instanceof Ue || e instanceof r || pe(e) || me(e)), pe = (e) => !!e && typeof e == `object` && e instanceof f && typeof e.pipe == `function` && e.pipe !== r.Writable.prototype.pipe, me = (e) => !!e && typeof e == `object` && e instanceof f && typeof e.write == `function` && typeof e.end == `function`, h = Symbol(`EOF`), g = Symbol(`maybeEmitEnd`), _ = Symbol(`emittedEnd`), he = Symbol(`emittingEnd`), ge = Symbol(`emittedError`), _e = Symbol(`closed`), ve = Symbol(`read`), ye = Symbol(`flush`), be = Symbol(`flushChunk`), v = Symbol(`encoding`), xe = Symbol(`decoder`), y = Symbol(`flowing`), Se = Symbol(`paused`), Ce = Symbol(`resume`), b = Symbol(`buffer`), x = Symbol(`pipes`), S = Symbol(`bufferLength`), we = Symbol(`bufferPush`), Te = Symbol(`bufferShift`), C = Symbol(`objectMode`), w = Symbol(`destroyed`), Ee = Symbol(`error`), De = Symbol(`emitData`), Oe = Symbol(`emitEnd`), ke = Symbol(`emitEnd2`), T = Symbol(`async`), Ae = Symbol(`abort`), je = Symbol(`aborted`), Me = Symbol(`signal`), Ne = Symbol(`dataListeners`), E = Symbol(`discarded`), Pe = (e) => Promise.resolve().then(e), Fe = (e) => e(), Ie = (e) => e === `end` || e === `finish` || e === `prefinish`, Le = (e) => e instanceof ArrayBuffer || !!e && typeof e == `object` && e.constructor && e.constructor.name === `ArrayBuffer` && e.byteLength >= 0, Re = (e) => !Buffer.isBuffer(e) && ArrayBuffer.isView(e), ze = class {
49
+ src;
50
+ dest;
51
+ opts;
52
+ ondrain;
53
+ constructor(e, t, n) {
54
+ this.src = e, this.dest = t, this.opts = n, this.ondrain = () => e[Ce](), this.dest.on(`drain`, this.ondrain);
55
+ }
56
+ unpipe() {
57
+ this.dest.removeListener(`drain`, this.ondrain);
58
+ }
59
+ proxyErrors(e) {}
60
+ end() {
61
+ this.unpipe(), this.opts.end && this.dest.end();
62
+ }
63
+ }, Be = class extends ze {
64
+ unpipe() {
65
+ this.src.removeListener(`error`, this.proxyErrors), super.unpipe();
66
+ }
67
+ constructor(e, t, n) {
68
+ super(e, t, n), this.proxyErrors = (e) => this.dest.emit(`error`, e), e.on(`error`, this.proxyErrors);
69
+ }
70
+ }, Ve = (e) => !!e.objectMode, He = (e) => !e.objectMode && !!e.encoding && e.encoding !== `buffer`, Ue = class extends f {
71
+ [y] = !1;
72
+ [Se] = !1;
73
+ [x] = [];
74
+ [b] = [];
75
+ [C];
76
+ [v];
77
+ [T];
78
+ [xe];
79
+ [h] = !1;
80
+ [_] = !1;
81
+ [he] = !1;
82
+ [_e] = !1;
83
+ [ge] = null;
84
+ [S] = 0;
85
+ [w] = !1;
86
+ [Me];
87
+ [je] = !1;
88
+ [Ne] = 0;
89
+ [E] = !1;
90
+ writable = !0;
91
+ readable = !0;
92
+ constructor(...e) {
93
+ let t = e[0] || {};
94
+ if (super(), t.objectMode && typeof t.encoding == `string`) throw TypeError(`Encoding and objectMode may not be used together`);
95
+ Ve(t) ? (this[C] = !0, this[v] = null) : He(t) ? (this[v] = t.encoding, this[C] = !1) : (this[C] = !1, this[v] = null), this[T] = !!t.async, this[xe] = this[v] ? new ee(this[v]) : null, t && t.debugExposeBuffer === !0 && Object.defineProperty(this, `buffer`, { get: () => this[b] }), t && t.debugExposePipes === !0 && Object.defineProperty(this, `pipes`, { get: () => this[x] });
96
+ let { signal: n } = t;
97
+ n && (this[Me] = n, n.aborted ? this[Ae]() : n.addEventListener(`abort`, () => this[Ae]()));
98
+ }
99
+ get bufferLength() {
100
+ return this[S];
101
+ }
102
+ get encoding() {
103
+ return this[v];
104
+ }
105
+ set encoding(e) {
106
+ throw Error(`Encoding must be set at instantiation time`);
107
+ }
108
+ setEncoding(e) {
109
+ throw Error(`Encoding must be set at instantiation time`);
110
+ }
111
+ get objectMode() {
112
+ return this[C];
113
+ }
114
+ set objectMode(e) {
115
+ throw Error(`objectMode must be set at instantiation time`);
116
+ }
117
+ get async() {
118
+ return this[T];
119
+ }
120
+ set async(e) {
121
+ this[T] = this[T] || !!e;
122
+ }
123
+ [Ae]() {
124
+ this[je] = !0, this.emit(`abort`, this[Me]?.reason), this.destroy(this[Me]?.reason);
125
+ }
126
+ get aborted() {
127
+ return this[je];
128
+ }
129
+ set aborted(e) {}
130
+ write(e, t, n) {
131
+ if (this[je]) return !1;
132
+ if (this[h]) throw Error(`write after end`);
133
+ if (this[w]) return this.emit(`error`, Object.assign(Error(`Cannot call write after a stream was destroyed`), { code: `ERR_STREAM_DESTROYED` })), !0;
134
+ typeof t == `function` && (n = t, t = `utf8`), t ||= `utf8`;
135
+ let r = this[T] ? Pe : Fe;
136
+ if (!this[C] && !Buffer.isBuffer(e)) {
137
+ if (Re(e)) e = Buffer.from(e.buffer, e.byteOffset, e.byteLength);
138
+ else if (Le(e)) e = Buffer.from(e);
139
+ else if (typeof e != `string`) throw Error(`Non-contiguous data written to non-objectMode stream`);
140
+ }
141
+ return this[C] ? (this[y] && this[S] !== 0 && this[ye](!0), this[y] ? this.emit(`data`, e) : this[we](e), this[S] !== 0 && this.emit(`readable`), n && r(n), this[y]) : e.length ? (typeof e == `string` && !(t === this[v] && !this[xe]?.lastNeed) && (e = Buffer.from(e, t)), Buffer.isBuffer(e) && this[v] && (e = this[xe].write(e)), this[y] && this[S] !== 0 && this[ye](!0), this[y] ? this.emit(`data`, e) : this[we](e), this[S] !== 0 && this.emit(`readable`), n && r(n), this[y]) : (this[S] !== 0 && this.emit(`readable`), n && r(n), this[y]);
142
+ }
143
+ read(e) {
144
+ if (this[w]) return null;
145
+ if (this[E] = !1, this[S] === 0 || e === 0 || e && e > this[S]) return this[g](), null;
146
+ this[C] && (e = null), this[b].length > 1 && !this[C] && (this[b] = [this[v] ? this[b].join(``) : Buffer.concat(this[b], this[S])]);
147
+ let t = this[ve](e || null, this[b][0]);
148
+ return this[g](), t;
149
+ }
150
+ [ve](e, t) {
151
+ if (this[C]) this[Te]();
152
+ else {
153
+ let n = t;
154
+ e === n.length || e === null ? this[Te]() : typeof n == `string` ? (this[b][0] = n.slice(e), t = n.slice(0, e), this[S] -= e) : (this[b][0] = n.subarray(e), t = n.subarray(0, e), this[S] -= e);
155
+ }
156
+ return this.emit(`data`, t), !this[b].length && !this[h] && this.emit(`drain`), t;
157
+ }
158
+ end(e, t, n) {
159
+ return typeof e == `function` && (n = e, e = void 0), typeof t == `function` && (n = t, t = `utf8`), e !== void 0 && this.write(e, t), n && this.once(`end`, n), this[h] = !0, this.writable = !1, (this[y] || !this[Se]) && this[g](), this;
160
+ }
161
+ [Ce]() {
162
+ this[w] || (!this[Ne] && !this[x].length && (this[E] = !0), this[Se] = !1, this[y] = !0, this.emit(`resume`), this[b].length ? this[ye]() : this[h] ? this[g]() : this.emit(`drain`));
163
+ }
164
+ resume() {
165
+ return this[Ce]();
166
+ }
167
+ pause() {
168
+ this[y] = !1, this[Se] = !0, this[E] = !1;
169
+ }
170
+ get destroyed() {
171
+ return this[w];
172
+ }
173
+ get flowing() {
174
+ return this[y];
175
+ }
176
+ get paused() {
177
+ return this[Se];
178
+ }
179
+ [we](e) {
180
+ this[C] ? this[S] += 1 : this[S] += e.length, this[b].push(e);
181
+ }
182
+ [Te]() {
183
+ return this[C] ? --this[S] : this[S] -= this[b][0].length, this[b].shift();
184
+ }
185
+ [ye](e = !1) {
186
+ do ;
187
+ while (this[be](this[Te]()) && this[b].length);
188
+ !e && !this[b].length && !this[h] && this.emit(`drain`);
189
+ }
190
+ [be](e) {
191
+ return this.emit(`data`, e), this[y];
192
+ }
193
+ pipe(e, t) {
194
+ if (this[w]) return e;
195
+ this[E] = !1;
196
+ let n = this[_];
197
+ return t ||= {}, e === de.stdout || e === de.stderr ? t.end = !1 : t.end = t.end !== !1, t.proxyErrors = !!t.proxyErrors, n ? t.end && e.end() : (this[x].push(t.proxyErrors ? new Be(this, e, t) : new ze(this, e, t)), this[T] ? Pe(() => this[Ce]()) : this[Ce]()), e;
198
+ }
199
+ unpipe(e) {
200
+ let t = this[x].find((t) => t.dest === e);
201
+ t && (this[x].length === 1 ? (this[y] && this[Ne] === 0 && (this[y] = !1), this[x] = []) : this[x].splice(this[x].indexOf(t), 1), t.unpipe());
202
+ }
203
+ addListener(e, t) {
204
+ return this.on(e, t);
205
+ }
206
+ on(e, t) {
207
+ let n = super.on(e, t);
208
+ if (e === `data`) this[E] = !1, this[Ne]++, !this[x].length && !this[y] && this[Ce]();
209
+ else if (e === `readable` && this[S] !== 0) super.emit(`readable`);
210
+ else if (Ie(e) && this[_]) super.emit(e), this.removeAllListeners(e);
211
+ else if (e === `error` && this[ge]) {
212
+ let e = t;
213
+ this[T] ? Pe(() => e.call(this, this[ge])) : e.call(this, this[ge]);
214
+ }
215
+ return n;
216
+ }
217
+ removeListener(e, t) {
218
+ return this.off(e, t);
219
+ }
220
+ off(e, t) {
221
+ let n = super.off(e, t);
222
+ return e === `data` && (this[Ne] = this.listeners(`data`).length, this[Ne] === 0 && !this[E] && !this[x].length && (this[y] = !1)), n;
223
+ }
224
+ removeAllListeners(e) {
225
+ let t = super.removeAllListeners(e);
226
+ return (e === `data` || e === void 0) && (this[Ne] = 0, !this[E] && !this[x].length && (this[y] = !1)), t;
227
+ }
228
+ get emittedEnd() {
229
+ return this[_];
230
+ }
231
+ [g]() {
232
+ !this[he] && !this[_] && !this[w] && this[b].length === 0 && this[h] && (this[he] = !0, this.emit(`end`), this.emit(`prefinish`), this.emit(`finish`), this[_e] && this.emit(`close`), this[he] = !1);
233
+ }
234
+ emit(e, ...t) {
235
+ let n = t[0];
236
+ if (e !== `error` && e !== `close` && e !== w && this[w]) return !1;
237
+ if (e === `data`) return !this[C] && !n ? !1 : this[T] ? (Pe(() => this[De](n)), !0) : this[De](n);
238
+ if (e === `end`) return this[Oe]();
239
+ if (e === `close`) {
240
+ if (this[_e] = !0, !this[_] && !this[w]) return !1;
241
+ let e = super.emit(`close`);
242
+ return this.removeAllListeners(`close`), e;
243
+ } else if (e === `error`) {
244
+ this[ge] = n, super.emit(Ee, n);
245
+ let e = !this[Me] || this.listeners(`error`).length ? super.emit(`error`, n) : !1;
246
+ return this[g](), e;
247
+ } else if (e === `resume`) {
248
+ let e = super.emit(`resume`);
249
+ return this[g](), e;
250
+ } else if (e === `finish` || e === `prefinish`) {
251
+ let t = super.emit(e);
252
+ return this.removeAllListeners(e), t;
253
+ }
254
+ let r = super.emit(e, ...t);
255
+ return this[g](), r;
256
+ }
257
+ [De](e) {
258
+ for (let t of this[x]) t.dest.write(e) === !1 && this.pause();
259
+ let t = this[E] ? !1 : super.emit(`data`, e);
260
+ return this[g](), t;
261
+ }
262
+ [Oe]() {
263
+ return this[_] ? !1 : (this[_] = !0, this.readable = !1, this[T] ? (Pe(() => this[ke]()), !0) : this[ke]());
264
+ }
265
+ [ke]() {
266
+ if (this[xe]) {
267
+ let e = this[xe].end();
268
+ if (e) {
269
+ for (let t of this[x]) t.dest.write(e);
270
+ this[E] || super.emit(`data`, e);
271
+ }
272
+ }
273
+ for (let e of this[x]) e.end();
274
+ let e = super.emit(`end`);
275
+ return this.removeAllListeners(`end`), e;
276
+ }
277
+ async collect() {
278
+ let e = Object.assign([], { dataLength: 0 });
279
+ this[C] || (e.dataLength = 0);
280
+ let t = this.promise();
281
+ return this.on(`data`, (t) => {
282
+ e.push(t), this[C] || (e.dataLength += t.length);
283
+ }), await t, e;
284
+ }
285
+ async concat() {
286
+ if (this[C]) throw Error(`cannot concat in objectMode`);
287
+ let e = await this.collect();
288
+ return this[v] ? e.join(``) : Buffer.concat(e, e.dataLength);
289
+ }
290
+ async promise() {
291
+ return new Promise((e, t) => {
292
+ this.on(w, () => t(Error(`stream destroyed`))), this.on(`error`, (e) => t(e)), this.on(`end`, () => e());
293
+ });
294
+ }
295
+ [Symbol.asyncIterator]() {
296
+ this[E] = !1;
297
+ let e = !1, t = async () => (this.pause(), e = !0, {
298
+ value: void 0,
299
+ done: !0
300
+ });
301
+ return {
302
+ next: () => {
303
+ if (e) return t();
304
+ let n = this.read();
305
+ if (n !== null) return Promise.resolve({
306
+ done: !1,
307
+ value: n
308
+ });
309
+ if (this[h]) return t();
310
+ let r, i, a = (e) => {
311
+ this.off(`data`, o), this.off(`end`, s), this.off(w, c), t(), i(e);
312
+ }, o = (e) => {
313
+ this.off(`error`, a), this.off(`end`, s), this.off(w, c), this.pause(), r({
314
+ value: e,
315
+ done: !!this[h]
316
+ });
317
+ }, s = () => {
318
+ this.off(`error`, a), this.off(`data`, o), this.off(w, c), t(), r({
319
+ done: !0,
320
+ value: void 0
321
+ });
322
+ }, c = () => a(Error(`stream destroyed`));
323
+ return new Promise((e, t) => {
324
+ i = t, r = e, this.once(w, c), this.once(`error`, a), this.once(`end`, s), this.once(`data`, o);
325
+ });
326
+ },
327
+ throw: t,
328
+ return: t,
329
+ [Symbol.asyncIterator]() {
330
+ return this;
331
+ },
332
+ [Symbol.asyncDispose]: async () => {}
333
+ };
334
+ }
335
+ [Symbol.iterator]() {
336
+ this[E] = !1;
337
+ let e = !1, t = () => (this.pause(), this.off(Ee, t), this.off(w, t), this.off(`end`, t), e = !0, {
338
+ done: !0,
339
+ value: void 0
340
+ });
341
+ return this.once(`end`, t), this.once(Ee, t), this.once(w, t), {
342
+ next: () => {
343
+ if (e) return t();
344
+ let n = this.read();
345
+ return n === null ? t() : {
346
+ done: !1,
347
+ value: n
348
+ };
349
+ },
350
+ throw: t,
351
+ return: t,
352
+ [Symbol.iterator]() {
353
+ return this;
354
+ },
355
+ [Symbol.dispose]: () => {}
356
+ };
357
+ }
358
+ destroy(e) {
359
+ if (this[w]) return e ? this.emit(`error`, e) : this.emit(w), this;
360
+ this[w] = !0, this[E] = !0, this[b].length = 0, this[S] = 0;
361
+ let t = this;
362
+ return typeof t.close == `function` && !this[_e] && t.close(), e ? this.emit(`error`, e) : this.emit(w), this;
363
+ }
364
+ static get isStream() {
365
+ return fe;
366
+ }
367
+ }, We = d.writev, D = Symbol(`_autoClose`), O = Symbol(`_close`), Ge = Symbol(`_ended`), k = Symbol(`_fd`), Ke = Symbol(`_finished`), A = Symbol(`_flags`), qe = Symbol(`_flush`), Je = Symbol(`_handleChunk`), Ye = Symbol(`_makeBuf`), Xe = Symbol(`_mode`), Ze = Symbol(`_needDrain`), Qe = Symbol(`_onerror`), $e = Symbol(`_onopen`), et = Symbol(`_onread`), tt = Symbol(`_onwrite`), j = Symbol(`_open`), M = Symbol(`_path`), nt = Symbol(`_pos`), N = Symbol(`_queue`), rt = Symbol(`_read`), it = Symbol(`_readSize`), P = Symbol(`_reading`), at = Symbol(`_remain`), ot = Symbol(`_size`), st = Symbol(`_write`), ct = Symbol(`_writing`), lt = Symbol(`_defaultFlag`), ut = Symbol(`_errored`), dt = class extends Ue {
368
+ [ut] = !1;
369
+ [k];
370
+ [M];
371
+ [it];
372
+ [P] = !1;
373
+ [ot];
374
+ [at];
375
+ [D];
376
+ constructor(e, t) {
377
+ if (t ||= {}, super(t), this.readable = !0, this.writable = !1, typeof e != `string`) throw TypeError(`path must be a string`);
378
+ this[ut] = !1, this[k] = typeof t.fd == `number` ? t.fd : void 0, this[M] = e, this[it] = t.readSize || 16 * 1024 * 1024, this[P] = !1, this[ot] = typeof t.size == `number` ? t.size : Infinity, this[at] = this[ot], this[D] = typeof t.autoClose == `boolean` ? t.autoClose : !0, typeof this[k] == `number` ? this[rt]() : this[j]();
379
+ }
380
+ get fd() {
381
+ return this[k];
382
+ }
383
+ get path() {
384
+ return this[M];
385
+ }
386
+ write() {
387
+ throw TypeError(`this is a readable stream`);
388
+ }
389
+ end() {
390
+ throw TypeError(`this is a readable stream`);
391
+ }
392
+ [j]() {
393
+ d.open(this[M], `r`, (e, t) => this[$e](e, t));
394
+ }
395
+ [$e](e, t) {
396
+ e ? this[Qe](e) : (this[k] = t, this.emit(`open`, t), this[rt]());
397
+ }
398
+ [Ye]() {
399
+ return Buffer.allocUnsafe(Math.min(this[it], this[at]));
400
+ }
401
+ [rt]() {
402
+ if (!this[P]) {
403
+ this[P] = !0;
404
+ let e = this[Ye]();
405
+ if (e.length === 0) return process.nextTick(() => this[et](null, 0, e));
406
+ d.read(this[k], e, 0, e.length, null, (e, t, n) => this[et](e, t, n));
407
+ }
408
+ }
409
+ [et](e, t, n) {
410
+ this[P] = !1, e ? this[Qe](e) : this[Je](t, n) && this[rt]();
411
+ }
412
+ [O]() {
413
+ if (this[D] && typeof this[k] == `number`) {
414
+ let e = this[k];
415
+ this[k] = void 0, d.close(e, (e) => e ? this.emit(`error`, e) : this.emit(`close`));
416
+ }
417
+ }
418
+ [Qe](e) {
419
+ this[P] = !0, this[O](), this.emit(`error`, e);
420
+ }
421
+ [Je](e, t) {
422
+ let n = !1;
423
+ return this[at] -= e, e > 0 && (n = super.write(e < t.length ? t.subarray(0, e) : t)), (e === 0 || this[at] <= 0) && (n = !1, this[O](), super.end()), n;
424
+ }
425
+ emit(e, ...t) {
426
+ switch (e) {
427
+ case `prefinish`:
428
+ case `finish`: return !1;
429
+ case `drain`: return typeof this[k] == `number` && this[rt](), !1;
430
+ case `error`: return this[ut] ? !1 : (this[ut] = !0, super.emit(e, ...t));
431
+ default: return super.emit(e, ...t);
432
+ }
433
+ }
434
+ }, ft = class extends dt {
435
+ [j]() {
436
+ let e = !0;
437
+ try {
438
+ this[$e](null, d.openSync(this[M], `r`)), e = !1;
439
+ } finally {
440
+ e && this[O]();
441
+ }
442
+ }
443
+ [rt]() {
444
+ let e = !0;
445
+ try {
446
+ if (!this[P]) {
447
+ this[P] = !0;
448
+ do {
449
+ let e = this[Ye](), t = e.length === 0 ? 0 : d.readSync(this[k], e, 0, e.length, null);
450
+ if (!this[Je](t, e)) break;
451
+ } while (!0);
452
+ this[P] = !1;
453
+ }
454
+ e = !1;
455
+ } finally {
456
+ e && this[O]();
457
+ }
458
+ }
459
+ [O]() {
460
+ if (this[D] && typeof this[k] == `number`) {
461
+ let e = this[k];
462
+ this[k] = void 0, d.closeSync(e), this.emit(`close`);
463
+ }
464
+ }
465
+ }, pt = class extends l {
466
+ readable = !1;
467
+ writable = !0;
468
+ [ut] = !1;
469
+ [ct] = !1;
470
+ [Ge] = !1;
471
+ [N] = [];
472
+ [Ze] = !1;
473
+ [M];
474
+ [Xe];
475
+ [D];
476
+ [k];
477
+ [lt];
478
+ [A];
479
+ [Ke] = !1;
480
+ [nt];
481
+ constructor(e, t) {
482
+ t ||= {}, super(t), this[M] = e, this[k] = typeof t.fd == `number` ? t.fd : void 0, this[Xe] = t.mode === void 0 ? 438 : t.mode, this[nt] = typeof t.start == `number` ? t.start : void 0, this[D] = typeof t.autoClose == `boolean` ? t.autoClose : !0;
483
+ let n = this[nt] === void 0 ? `w` : `r+`;
484
+ this[lt] = t.flags === void 0, this[A] = t.flags === void 0 ? n : t.flags, this[k] === void 0 && this[j]();
485
+ }
486
+ emit(e, ...t) {
487
+ if (e === `error`) {
488
+ if (this[ut]) return !1;
489
+ this[ut] = !0;
490
+ }
491
+ return super.emit(e, ...t);
492
+ }
493
+ get fd() {
494
+ return this[k];
495
+ }
496
+ get path() {
497
+ return this[M];
498
+ }
499
+ [Qe](e) {
500
+ this[O](), this[ct] = !0, this.emit(`error`, e);
501
+ }
502
+ [j]() {
503
+ d.open(this[M], this[A], this[Xe], (e, t) => this[$e](e, t));
504
+ }
505
+ [$e](e, t) {
506
+ this[lt] && this[A] === `r+` && e && e.code === `ENOENT` ? (this[A] = `w`, this[j]()) : e ? this[Qe](e) : (this[k] = t, this.emit(`open`, t), this[ct] || this[qe]());
507
+ }
508
+ end(e, t) {
509
+ return e && this.write(e, t), this[Ge] = !0, !this[ct] && !this[N].length && typeof this[k] == `number` && this[tt](null, 0), this;
510
+ }
511
+ write(e, t) {
512
+ return typeof e == `string` && (e = Buffer.from(e, t)), this[Ge] ? (this.emit(`error`, Error(`write() after end()`)), !1) : this[k] === void 0 || this[ct] || this[N].length ? (this[N].push(e), this[Ze] = !0, !1) : (this[ct] = !0, this[st](e), !0);
513
+ }
514
+ [st](e) {
515
+ d.write(this[k], e, 0, e.length, this[nt], (e, t) => this[tt](e, t));
516
+ }
517
+ [tt](e, t) {
518
+ e ? this[Qe](e) : (this[nt] !== void 0 && typeof t == `number` && (this[nt] += t), this[N].length ? this[qe]() : (this[ct] = !1, this[Ge] && !this[Ke] ? (this[Ke] = !0, this[O](), this.emit(`finish`)) : this[Ze] && (this[Ze] = !1, this.emit(`drain`))));
519
+ }
520
+ [qe]() {
521
+ if (this[N].length === 0) this[Ge] && this[tt](null, 0);
522
+ else if (this[N].length === 1) this[st](this[N].pop());
523
+ else {
524
+ let e = this[N];
525
+ this[N] = [], We(this[k], e, this[nt], (e, t) => this[tt](e, t));
526
+ }
527
+ }
528
+ [O]() {
529
+ if (this[D] && typeof this[k] == `number`) {
530
+ let e = this[k];
531
+ this[k] = void 0, d.close(e, (e) => e ? this.emit(`error`, e) : this.emit(`close`));
532
+ }
533
+ }
534
+ }, mt = class extends pt {
535
+ [j]() {
536
+ let e;
537
+ if (this[lt] && this[A] === `r+`) try {
538
+ e = d.openSync(this[M], this[A], this[Xe]);
539
+ } catch (e) {
540
+ if (e?.code === `ENOENT`) return this[A] = `w`, this[j]();
541
+ throw e;
542
+ }
543
+ else e = d.openSync(this[M], this[A], this[Xe]);
544
+ this[$e](null, e);
545
+ }
546
+ [O]() {
547
+ if (this[D] && typeof this[k] == `number`) {
548
+ let e = this[k];
549
+ this[k] = void 0, d.closeSync(e), this.emit(`close`);
550
+ }
551
+ }
552
+ [st](e) {
553
+ let t = !0;
554
+ try {
555
+ this[tt](null, d.writeSync(this[k], e, 0, e.length, this[nt])), t = !1;
556
+ } finally {
557
+ if (t) try {
558
+ this[O]();
559
+ } catch {}
560
+ }
561
+ }
562
+ }, ht = new Map([
563
+ [`C`, `cwd`],
564
+ [`f`, `file`],
565
+ [`z`, `gzip`],
566
+ [`P`, `preservePaths`],
567
+ [`U`, `unlink`],
568
+ [`strip-components`, `strip`],
569
+ [`stripComponents`, `strip`],
570
+ [`keep-newer`, `newer`],
571
+ [`keepNewer`, `newer`],
572
+ [`keep-newer-files`, `newer`],
573
+ [`keepNewerFiles`, `newer`],
574
+ [`k`, `keep`],
575
+ [`keep-existing`, `keep`],
576
+ [`keepExisting`, `keep`],
577
+ [`m`, `noMtime`],
578
+ [`no-mtime`, `noMtime`],
579
+ [`p`, `preserveOwner`],
580
+ [`L`, `follow`],
581
+ [`h`, `follow`],
582
+ [`onentry`, `onReadEntry`]
583
+ ]), gt = (e) => !!e.sync && !!e.file, _t = (e) => !e.sync && !!e.file, vt = (e) => !!e.sync && !e.file, yt = (e) => !e.sync && !e.file, bt = (e) => !!e.file, xt = (e) => ht.get(e) || e, St = (e = {}) => {
584
+ if (!e) return {};
585
+ let t = {};
586
+ for (let [n, r] of Object.entries(e)) {
587
+ let e = xt(n);
588
+ t[e] = r;
589
+ }
590
+ return t.chmod === void 0 && t.noChmod === !1 && (t.chmod = !0), delete t.noChmod, t;
591
+ }, Ct = (e, t, n, r, i) => Object.assign((a = [], o, s) => {
592
+ Array.isArray(a) && (o = a, a = {}), typeof o == `function` && (s = o, o = void 0), o = o ? Array.from(o) : [];
593
+ let c = St(a);
594
+ if (i?.(c, o), gt(c)) {
595
+ if (typeof s == `function`) throw TypeError(`callback not supported for sync tar functions`);
596
+ return e(c, o);
597
+ } else if (_t(c)) {
598
+ let e = t(c, o);
599
+ return s ? e.then(() => s(), s) : e;
600
+ } else if (vt(c)) {
601
+ if (typeof s == `function`) throw TypeError(`callback not supported for sync tar functions`);
602
+ return n(c, o);
603
+ } else if (yt(c)) {
604
+ if (typeof s == `function`) throw TypeError(`callback only supported with file option`);
605
+ return r(c, o);
606
+ }
607
+ throw Error(`impossible options??`);
608
+ }, {
609
+ syncFile: e,
610
+ asyncFile: t,
611
+ syncNoFile: n,
612
+ asyncNoFile: r,
613
+ validate: i
614
+ }), wt = ae.constants || { ZLIB_VERNUM: 4736 }, F = Object.freeze(Object.assign(Object.create(null), {
615
+ Z_NO_FLUSH: 0,
616
+ Z_PARTIAL_FLUSH: 1,
617
+ Z_SYNC_FLUSH: 2,
618
+ Z_FULL_FLUSH: 3,
619
+ Z_FINISH: 4,
620
+ Z_BLOCK: 5,
621
+ Z_OK: 0,
622
+ Z_STREAM_END: 1,
623
+ Z_NEED_DICT: 2,
624
+ Z_ERRNO: -1,
625
+ Z_STREAM_ERROR: -2,
626
+ Z_DATA_ERROR: -3,
627
+ Z_MEM_ERROR: -4,
628
+ Z_BUF_ERROR: -5,
629
+ Z_VERSION_ERROR: -6,
630
+ Z_NO_COMPRESSION: 0,
631
+ Z_BEST_SPEED: 1,
632
+ Z_BEST_COMPRESSION: 9,
633
+ Z_DEFAULT_COMPRESSION: -1,
634
+ Z_FILTERED: 1,
635
+ Z_HUFFMAN_ONLY: 2,
636
+ Z_RLE: 3,
637
+ Z_FIXED: 4,
638
+ Z_DEFAULT_STRATEGY: 0,
639
+ DEFLATE: 1,
640
+ INFLATE: 2,
641
+ GZIP: 3,
642
+ GUNZIP: 4,
643
+ DEFLATERAW: 5,
644
+ INFLATERAW: 6,
645
+ UNZIP: 7,
646
+ BROTLI_DECODE: 8,
647
+ BROTLI_ENCODE: 9,
648
+ Z_MIN_WINDOWBITS: 8,
649
+ Z_MAX_WINDOWBITS: 15,
650
+ Z_DEFAULT_WINDOWBITS: 15,
651
+ Z_MIN_CHUNK: 64,
652
+ Z_MAX_CHUNK: Infinity,
653
+ Z_DEFAULT_CHUNK: 16384,
654
+ Z_MIN_MEMLEVEL: 1,
655
+ Z_MAX_MEMLEVEL: 9,
656
+ Z_DEFAULT_MEMLEVEL: 8,
657
+ Z_MIN_LEVEL: -1,
658
+ Z_MAX_LEVEL: 9,
659
+ Z_DEFAULT_LEVEL: -1,
660
+ BROTLI_OPERATION_PROCESS: 0,
661
+ BROTLI_OPERATION_FLUSH: 1,
662
+ BROTLI_OPERATION_FINISH: 2,
663
+ BROTLI_OPERATION_EMIT_METADATA: 3,
664
+ BROTLI_MODE_GENERIC: 0,
665
+ BROTLI_MODE_TEXT: 1,
666
+ BROTLI_MODE_FONT: 2,
667
+ BROTLI_DEFAULT_MODE: 0,
668
+ BROTLI_MIN_QUALITY: 0,
669
+ BROTLI_MAX_QUALITY: 11,
670
+ BROTLI_DEFAULT_QUALITY: 11,
671
+ BROTLI_MIN_WINDOW_BITS: 10,
672
+ BROTLI_MAX_WINDOW_BITS: 24,
673
+ BROTLI_LARGE_MAX_WINDOW_BITS: 30,
674
+ BROTLI_DEFAULT_WINDOW: 22,
675
+ BROTLI_MIN_INPUT_BLOCK_BITS: 16,
676
+ BROTLI_MAX_INPUT_BLOCK_BITS: 24,
677
+ BROTLI_PARAM_MODE: 0,
678
+ BROTLI_PARAM_QUALITY: 1,
679
+ BROTLI_PARAM_LGWIN: 2,
680
+ BROTLI_PARAM_LGBLOCK: 3,
681
+ BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4,
682
+ BROTLI_PARAM_SIZE_HINT: 5,
683
+ BROTLI_PARAM_LARGE_WINDOW: 6,
684
+ BROTLI_PARAM_NPOSTFIX: 7,
685
+ BROTLI_PARAM_NDIRECT: 8,
686
+ BROTLI_DECODER_RESULT_ERROR: 0,
687
+ BROTLI_DECODER_RESULT_SUCCESS: 1,
688
+ BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2,
689
+ BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3,
690
+ BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0,
691
+ BROTLI_DECODER_PARAM_LARGE_WINDOW: 1,
692
+ BROTLI_DECODER_NO_ERROR: 0,
693
+ BROTLI_DECODER_SUCCESS: 1,
694
+ BROTLI_DECODER_NEEDS_MORE_INPUT: 2,
695
+ BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3,
696
+ BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1,
697
+ BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2,
698
+ BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3,
699
+ BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4,
700
+ BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5,
701
+ BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6,
702
+ BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7,
703
+ BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8,
704
+ BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9,
705
+ BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10,
706
+ BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11,
707
+ BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12,
708
+ BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13,
709
+ BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14,
710
+ BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15,
711
+ BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16,
712
+ BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19,
713
+ BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20,
714
+ BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21,
715
+ BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22,
716
+ BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25,
717
+ BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26,
718
+ BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27,
719
+ BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30,
720
+ BROTLI_DECODER_ERROR_UNREACHABLE: -31
721
+ }, wt)), Tt = re.concat, Et = Object.getOwnPropertyDescriptor(re, `concat`), Dt = (e) => e, Ot = Et?.writable === !0 || Et?.set !== void 0 ? (e) => {
722
+ re.concat = e ? Dt : Tt;
723
+ } : (e) => {}, kt = Symbol(`_superWrite`), At = class extends Error {
724
+ code;
725
+ errno;
726
+ constructor(e, t) {
727
+ super(`zlib: ` + e.message, { cause: e }), this.code = e.code, this.errno = e.errno, this.code ||= `ZLIB_ERROR`, this.message = `zlib: ` + e.message, Error.captureStackTrace(this, t ?? this.constructor);
728
+ }
729
+ get name() {
730
+ return `ZlibError`;
731
+ }
732
+ }, jt = Symbol(`flushFlag`), Mt = class extends Ue {
733
+ #t = !1;
734
+ #i = !1;
735
+ #s;
736
+ #n;
737
+ #r;
738
+ #e;
739
+ #o;
740
+ get sawError() {
741
+ return this.#t;
742
+ }
743
+ get handle() {
744
+ return this.#e;
745
+ }
746
+ get flushFlag() {
747
+ return this.#s;
748
+ }
749
+ constructor(e, t) {
750
+ if (!e || typeof e != `object`) throw TypeError(`invalid options for ZlibBase constructor`);
751
+ if (super(e), this.#s = e.flush ?? 0, this.#n = e.finishFlush ?? 0, this.#r = e.fullFlushFlag ?? 0, typeof ie[t] != `function`) throw TypeError(`Compression method not supported: ` + t);
752
+ try {
753
+ this.#e = new ie[t](e);
754
+ } catch (e) {
755
+ throw new At(e, this.constructor);
756
+ }
757
+ this.#o = (e) => {
758
+ this.#t || (this.#t = !0, this.close(), this.emit(`error`, e));
759
+ }, this.#e?.on(`error`, (e) => this.#o(new At(e))), this.once(`end`, () => this.close);
760
+ }
761
+ close() {
762
+ this.#e && (this.#e.close(), this.#e = void 0, this.emit(`close`));
763
+ }
764
+ reset() {
765
+ if (!this.#t) return ne(this.#e, `zlib binding closed`), this.#e.reset?.();
766
+ }
767
+ flush(e) {
768
+ this.ended || (typeof e != `number` && (e = this.#r), this.write(Object.assign(re.alloc(0), { [jt]: e })));
769
+ }
770
+ end(e, t, n) {
771
+ return typeof e == `function` && (n = e, t = void 0, e = void 0), typeof t == `function` && (n = t, t = void 0), e && (t ? this.write(e, t) : this.write(e)), this.flush(this.#n), this.#i = !0, super.end(n);
772
+ }
773
+ get ended() {
774
+ return this.#i;
775
+ }
776
+ [kt](e) {
777
+ return super.write(e);
778
+ }
779
+ write(e, t, n) {
780
+ if (typeof t == `function` && (n = t, t = `utf8`), typeof e == `string` && (e = re.from(e, t)), this.#t) return;
781
+ ne(this.#e, `zlib binding closed`);
782
+ let r = this.#e._handle, i = r.close;
783
+ r.close = () => {};
784
+ let a = this.#e.close;
785
+ this.#e.close = () => {}, Ot(!0);
786
+ let o;
787
+ try {
788
+ let t = typeof e[jt] == `number` ? e[jt] : this.#s;
789
+ o = this.#e._processChunk(e, t), Ot(!1);
790
+ } catch (e) {
791
+ Ot(!1), this.#o(new At(e, this.write));
792
+ } finally {
793
+ this.#e && (this.#e._handle = r, r.close = i, this.#e.close = a, this.#e.removeAllListeners(`error`));
794
+ }
795
+ this.#e && this.#e.on(`error`, (e) => this.#o(new At(e, this.write)));
796
+ let s;
797
+ if (o) if (Array.isArray(o) && o.length > 0) {
798
+ let e = o[0];
799
+ s = this[kt](re.from(e));
800
+ for (let e = 1; e < o.length; e++) s = this[kt](o[e]);
801
+ } else s = this[kt](re.from(o));
802
+ return n && n(), s;
803
+ }
804
+ }, Nt = class extends Mt {
805
+ #t;
806
+ #i;
807
+ constructor(e, t) {
808
+ e ||= {}, e.flush = e.flush || F.Z_NO_FLUSH, e.finishFlush = e.finishFlush || F.Z_FINISH, e.fullFlushFlag = F.Z_FULL_FLUSH, super(e, t), this.#t = e.level, this.#i = e.strategy;
809
+ }
810
+ params(e, t) {
811
+ if (!this.sawError) {
812
+ if (!this.handle) throw Error(`cannot switch params when binding is closed`);
813
+ if (!this.handle.params) throw Error(`not supported in this implementation`);
814
+ if (this.#t !== e || this.#i !== t) {
815
+ this.flush(F.Z_SYNC_FLUSH), ne(this.handle, `zlib binding closed`);
816
+ let n = this.handle.flush;
817
+ this.handle.flush = (e, t) => {
818
+ typeof e == `function` && (t = e, e = this.flushFlag), this.flush(e), t?.();
819
+ };
820
+ try {
821
+ this.handle.params(e, t);
822
+ } finally {
823
+ this.handle.flush = n;
824
+ }
825
+ this.handle && (this.#t = e, this.#i = t);
826
+ }
827
+ }
828
+ }
829
+ }, Pt = class extends Nt {
830
+ #t;
831
+ constructor(e) {
832
+ super(e, `Gzip`), this.#t = e && !!e.portable;
833
+ }
834
+ [kt](e) {
835
+ return this.#t ? (this.#t = !1, e[9] = 255, super[kt](e)) : super[kt](e);
836
+ }
837
+ }, Ft = class extends Nt {
838
+ constructor(e) {
839
+ super(e, `Unzip`);
840
+ }
841
+ }, It = class extends Mt {
842
+ constructor(e, t) {
843
+ e ||= {}, e.flush = e.flush || F.BROTLI_OPERATION_PROCESS, e.finishFlush = e.finishFlush || F.BROTLI_OPERATION_FINISH, e.fullFlushFlag = F.BROTLI_OPERATION_FLUSH, super(e, t);
844
+ }
845
+ }, Lt = class extends It {
846
+ constructor(e) {
847
+ super(e, `BrotliCompress`);
848
+ }
849
+ }, Rt = class extends It {
850
+ constructor(e) {
851
+ super(e, `BrotliDecompress`);
852
+ }
853
+ }, zt = class extends Mt {
854
+ constructor(e, t) {
855
+ e ||= {}, e.flush = e.flush || F.ZSTD_e_continue, e.finishFlush = e.finishFlush || F.ZSTD_e_end, e.fullFlushFlag = F.ZSTD_e_flush, super(e, t);
856
+ }
857
+ }, Bt = class extends zt {
858
+ constructor(e) {
859
+ super(e, `ZstdCompress`);
860
+ }
861
+ }, Vt = class extends zt {
862
+ constructor(e) {
863
+ super(e, `ZstdDecompress`);
864
+ }
865
+ }, Ht = (e, t) => {
866
+ if (Number.isSafeInteger(e)) e < 0 ? Wt(e, t) : Ut(e, t);
867
+ else throw Error(`cannot encode number outside of javascript safe integer range`);
868
+ return t;
869
+ }, Ut = (e, t) => {
870
+ t[0] = 128;
871
+ for (var n = t.length; n > 1; n--) t[n - 1] = e & 255, e = Math.floor(e / 256);
872
+ }, Wt = (e, t) => {
873
+ t[0] = 255;
874
+ var n = !1;
875
+ e *= -1;
876
+ for (var r = t.length; r > 1; r--) {
877
+ var i = e & 255;
878
+ e = Math.floor(e / 256), n ? t[r - 1] = Jt(i) : i === 0 ? t[r - 1] = 0 : (n = !0, t[r - 1] = Yt(i));
879
+ }
880
+ }, Gt = (e) => {
881
+ let t = e[0], n = t === 128 ? qt(e.subarray(1, e.length)) : t === 255 ? Kt(e) : null;
882
+ if (n === null) throw Error(`invalid base256 encoding`);
883
+ if (!Number.isSafeInteger(n)) throw Error(`parsed number outside of javascript safe integer range`);
884
+ return n;
885
+ }, Kt = (e) => {
886
+ for (var t = e.length, n = 0, r = !1, i = t - 1; i > -1; i--) {
887
+ var a = Number(e[i]), o;
888
+ r ? o = Jt(a) : a === 0 ? o = a : (r = !0, o = Yt(a)), o !== 0 && (n -= o * 256 ** (t - i - 1));
889
+ }
890
+ return n;
891
+ }, qt = (e) => {
892
+ for (var t = e.length, n = 0, r = t - 1; r > -1; r--) {
893
+ var i = Number(e[r]);
894
+ i !== 0 && (n += i * 256 ** (t - r - 1));
895
+ }
896
+ return n;
897
+ }, Jt = (e) => (255 ^ e) & 255, Yt = (e) => (255 ^ e) + 1 & 255, Xt = {};
898
+ ue(Xt, {
899
+ code: () => en,
900
+ isCode: () => Zt,
901
+ isName: () => Qt,
902
+ name: () => $t
903
+ });
904
+ var Zt = (e) => $t.has(e), Qt = (e) => en.has(e), $t = new Map([
905
+ [`0`, `File`],
906
+ [``, `OldFile`],
907
+ [`1`, `Link`],
908
+ [`2`, `SymbolicLink`],
909
+ [`3`, `CharacterDevice`],
910
+ [`4`, `BlockDevice`],
911
+ [`5`, `Directory`],
912
+ [`6`, `FIFO`],
913
+ [`7`, `ContiguousFile`],
914
+ [`g`, `GlobalExtendedHeader`],
915
+ [`x`, `ExtendedHeader`],
916
+ [`A`, `SolarisACL`],
917
+ [`D`, `GNUDumpDir`],
918
+ [`I`, `Inode`],
919
+ [`K`, `NextFileHasLongLinkpath`],
920
+ [`L`, `NextFileHasLongPath`],
921
+ [`M`, `ContinuationFile`],
922
+ [`N`, `OldGnuLongPath`],
923
+ [`S`, `SparseFile`],
924
+ [`V`, `TapeVolumeHeader`],
925
+ [`X`, `OldExtendedHeader`]
926
+ ]), en = new Map(Array.from($t).map((e) => [e[1], e[0]])), I = class {
927
+ cksumValid = !1;
928
+ needPax = !1;
929
+ nullBlock = !1;
930
+ block;
931
+ path;
932
+ mode;
933
+ uid;
934
+ gid;
935
+ size;
936
+ cksum;
937
+ #t = `Unsupported`;
938
+ linkpath;
939
+ uname;
940
+ gname;
941
+ devmaj = 0;
942
+ devmin = 0;
943
+ atime;
944
+ ctime;
945
+ mtime;
946
+ charset;
947
+ comment;
948
+ constructor(e, t = 0, n, r) {
949
+ Buffer.isBuffer(e) ? this.decode(e, t || 0, n, r) : e && this.#i(e);
950
+ }
951
+ decode(e, t, n, r) {
952
+ if (t ||= 0, !e || !(e.length >= t + 512)) throw Error(`need 512 bytes for header`);
953
+ this.path = n?.path ?? nn(e, t, 100), this.mode = n?.mode ?? r?.mode ?? L(e, t + 100, 8), this.uid = n?.uid ?? r?.uid ?? L(e, t + 108, 8), this.gid = n?.gid ?? r?.gid ?? L(e, t + 116, 8), this.size = n?.size ?? r?.size ?? L(e, t + 124, 12), this.mtime = n?.mtime ?? r?.mtime ?? rn(e, t + 136, 12), this.cksum = L(e, t + 148, 12), r && this.#i(r, !0), n && this.#i(n);
954
+ let i = nn(e, t + 156, 1);
955
+ if (Zt(i) && (this.#t = i || `0`), this.#t === `0` && this.path.slice(-1) === `/` && (this.#t = `5`), this.#t === `5` && (this.size = 0), this.linkpath = nn(e, t + 157, 100), e.subarray(t + 257, t + 265).toString() === `ustar\x0000`) if (this.uname = n?.uname ?? r?.uname ?? nn(e, t + 265, 32), this.gname = n?.gname ?? r?.gname ?? nn(e, t + 297, 32), this.devmaj = n?.devmaj ?? r?.devmaj ?? L(e, t + 329, 8) ?? 0, this.devmin = n?.devmin ?? r?.devmin ?? L(e, t + 337, 8) ?? 0, e[t + 475] !== 0) this.path = nn(e, t + 345, 155) + `/` + this.path;
956
+ else {
957
+ let i = nn(e, t + 345, 130);
958
+ i && (this.path = i + `/` + this.path), this.atime = n?.atime ?? r?.atime ?? rn(e, t + 476, 12), this.ctime = n?.ctime ?? r?.ctime ?? rn(e, t + 488, 12);
959
+ }
960
+ let a = 256;
961
+ for (let n = t; n < t + 148; n++) a += e[n];
962
+ for (let n = t + 156; n < t + 512; n++) a += e[n];
963
+ this.cksumValid = a === this.cksum, this.cksum === void 0 && a === 256 && (this.nullBlock = !0);
964
+ }
965
+ #i(e, t = !1) {
966
+ Object.assign(this, Object.fromEntries(Object.entries(e).filter(([e, n]) => !(n == null || e === `path` && t || e === `linkpath` && t || e === `global`))));
967
+ }
968
+ encode(e, t = 0) {
969
+ if (e ||= this.block = Buffer.alloc(512), this.#t === `Unsupported` && (this.#t = `0`), !(e.length >= t + 512)) throw Error(`need 512 bytes for header`);
970
+ let n = this.ctime || this.atime ? 130 : 155, r = tn(this.path || ``, n), i = r[0], a = r[1];
971
+ this.needPax = !!r[2], this.needPax = mn(e, t, 100, i) || this.needPax, this.needPax = R(e, t + 100, 8, this.mode) || this.needPax, this.needPax = R(e, t + 108, 8, this.uid) || this.needPax, this.needPax = R(e, t + 116, 8, this.gid) || this.needPax, this.needPax = R(e, t + 124, 12, this.size) || this.needPax, this.needPax = fn(e, t + 136, 12, this.mtime) || this.needPax, e[t + 156] = Number(this.#t.codePointAt(0)), this.needPax = mn(e, t + 157, 100, this.linkpath) || this.needPax, e.write(`ustar\x0000`, t + 257, 8), this.needPax = mn(e, t + 265, 32, this.uname) || this.needPax, this.needPax = mn(e, t + 297, 32, this.gname) || this.needPax, this.needPax = R(e, t + 329, 8, this.devmaj) || this.needPax, this.needPax = R(e, t + 337, 8, this.devmin) || this.needPax, this.needPax = mn(e, t + 345, n, a) || this.needPax, e[t + 475] === 0 ? (this.needPax = mn(e, t + 345, 130, a) || this.needPax, this.needPax = fn(e, t + 476, 12, this.atime) || this.needPax, this.needPax = fn(e, t + 488, 12, this.ctime) || this.needPax) : this.needPax = mn(e, t + 345, 155, a) || this.needPax;
972
+ let o = 256;
973
+ for (let n = t; n < t + 148; n++) o += e[n];
974
+ for (let n = t + 156; n < t + 512; n++) o += e[n];
975
+ return this.cksum = o, R(e, t + 148, 8, this.cksum), this.cksumValid = !0, this.needPax;
976
+ }
977
+ get type() {
978
+ return this.#t === `Unsupported` ? this.#t : $t.get(this.#t);
979
+ }
980
+ get typeKey() {
981
+ return this.#t;
982
+ }
983
+ set type(e) {
984
+ let t = String(en.get(e));
985
+ if (Zt(t) || t === `Unsupported`) this.#t = t;
986
+ else if (Zt(e)) this.#t = e;
987
+ else throw TypeError(`invalid entry type: ` + e);
988
+ }
989
+ }, tn = (e, t) => {
990
+ let n = e, r = ``, i, a = s.parse(e).root || `.`;
991
+ if (Buffer.byteLength(n) < 100) i = [
992
+ n,
993
+ r,
994
+ !1
995
+ ];
996
+ else {
997
+ r = s.dirname(n), n = s.basename(n);
998
+ do
999
+ Buffer.byteLength(n) <= 100 && Buffer.byteLength(r) <= t ? i = [
1000
+ n,
1001
+ r,
1002
+ !1
1003
+ ] : Buffer.byteLength(n) > 100 && Buffer.byteLength(r) <= t ? i = [
1004
+ n.slice(0, 99),
1005
+ r,
1006
+ !0
1007
+ ] : (n = s.join(s.basename(r), n), r = s.dirname(r));
1008
+ while (r !== a && i === void 0);
1009
+ i ||= [
1010
+ e.slice(0, 99),
1011
+ ``,
1012
+ !0
1013
+ ];
1014
+ }
1015
+ return i;
1016
+ }, nn = (e, t, n) => e.subarray(t, t + n).toString(`utf8`).replace(/\0.*/, ``), rn = (e, t, n) => an(L(e, t, n)), an = (e) => e === void 0 ? void 0 : /* @__PURE__ */ new Date(e * 1e3), L = (e, t, n) => Number(e[t]) & 128 ? Gt(e.subarray(t, t + n)) : sn(e, t, n), on = (e) => isNaN(e) ? void 0 : e, sn = (e, t, n) => on(parseInt(e.subarray(t, t + n).toString(`utf8`).replace(/\0.*$/, ``).trim(), 8)), cn = {
1017
+ 12: 8589934591,
1018
+ 8: 2097151
1019
+ }, R = (e, t, n, r) => r === void 0 ? !1 : r > cn[n] || r < 0 ? (Ht(r, e.subarray(t, t + n)), !0) : (ln(e, t, n, r), !1), ln = (e, t, n, r) => e.write(un(r, n), t, n, `ascii`), un = (e, t) => dn(Math.floor(e).toString(8), t), dn = (e, t) => (e.length === t - 1 ? e : Array(t - e.length - 1).join(`0`) + e + ` `) + `\0`, fn = (e, t, n, r) => r === void 0 ? !1 : R(e, t, n, r.getTime() / 1e3), pn = Array(156).join(`\0`), mn = (e, t, n, r) => r === void 0 ? !1 : (e.write(r + pn, t, n, `utf8`), r.length !== Buffer.byteLength(r) || r.length > n), hn = class e {
1020
+ atime;
1021
+ mtime;
1022
+ ctime;
1023
+ charset;
1024
+ comment;
1025
+ gid;
1026
+ uid;
1027
+ gname;
1028
+ uname;
1029
+ linkpath;
1030
+ dev;
1031
+ ino;
1032
+ nlink;
1033
+ path;
1034
+ size;
1035
+ mode;
1036
+ global;
1037
+ constructor(e, t = !1) {
1038
+ this.atime = e.atime, this.charset = e.charset, this.comment = e.comment, this.ctime = e.ctime, this.dev = e.dev, this.gid = e.gid, this.global = t, this.gname = e.gname, this.ino = e.ino, this.linkpath = e.linkpath, this.mtime = e.mtime, this.nlink = e.nlink, this.path = e.path, this.size = e.size, this.uid = e.uid, this.uname = e.uname;
1039
+ }
1040
+ encode() {
1041
+ let e = this.encodeBody();
1042
+ if (e === ``) return Buffer.allocUnsafe(0);
1043
+ let t = Buffer.byteLength(e), n = 512 * Math.ceil(1 + t / 512), r = Buffer.allocUnsafe(n);
1044
+ for (let e = 0; e < 512; e++) r[e] = 0;
1045
+ new I({
1046
+ path: (`PaxHeader/` + a(this.path ?? ``)).slice(0, 99),
1047
+ mode: this.mode || 420,
1048
+ uid: this.uid,
1049
+ gid: this.gid,
1050
+ size: t,
1051
+ mtime: this.mtime,
1052
+ type: this.global ? `GlobalExtendedHeader` : `ExtendedHeader`,
1053
+ linkpath: ``,
1054
+ uname: this.uname || ``,
1055
+ gname: this.gname || ``,
1056
+ devmaj: 0,
1057
+ devmin: 0,
1058
+ atime: this.atime,
1059
+ ctime: this.ctime
1060
+ }).encode(r), r.write(e, 512, t, `utf8`);
1061
+ for (let e = t + 512; e < r.length; e++) r[e] = 0;
1062
+ return r;
1063
+ }
1064
+ encodeBody() {
1065
+ 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`);
1066
+ }
1067
+ encodeField(e) {
1068
+ if (this[e] === void 0) return ``;
1069
+ let t = this[e], n = t instanceof Date ? t.getTime() / 1e3 : t, r = ` ` + (e === `dev` || e === `ino` || e === `nlink` ? `SCHILY.` : ``) + e + `=` + n + `
1070
+ `, i = Buffer.byteLength(r), a = Math.floor(Math.log(i) / Math.log(10)) + 1;
1071
+ return i + a >= 10 ** a && (a += 1), a + i + r;
1072
+ }
1073
+ static parse(t, n, r = !1) {
1074
+ return new e(gn(_n(t), n), r);
1075
+ }
1076
+ }, gn = (e, t) => t ? Object.assign({}, t, e) : e, _n = (e) => e.replace(/\n$/, ``).split(`
1077
+ `).reduce(vn, Object.create(null)), vn = (e, t) => {
1078
+ let n = parseInt(t, 10);
1079
+ if (n !== Buffer.byteLength(t) + 1) return e;
1080
+ t = t.slice((n + ` `).length);
1081
+ let r = t.split(`=`), i = r.shift();
1082
+ if (!i) return e;
1083
+ let a = i.replace(/^SCHILY\.(dev|ino|nlink)/, `$1`), o = r.join(`=`);
1084
+ return e[a] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(a) ? /* @__PURE__ */ new Date(Number(o) * 1e3) : /^[0-9]+$/.test(o) ? +o : o, e;
1085
+ }, z = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === `win32` ? (e) => e && e.replaceAll(/\\/g, `/`) : (e) => e, yn = class extends Ue {
1086
+ extended;
1087
+ globalExtended;
1088
+ header;
1089
+ startBlockSize;
1090
+ blockRemain;
1091
+ remain;
1092
+ type;
1093
+ meta = !1;
1094
+ ignore = !1;
1095
+ path;
1096
+ mode;
1097
+ uid;
1098
+ gid;
1099
+ uname;
1100
+ gname;
1101
+ size = 0;
1102
+ mtime;
1103
+ atime;
1104
+ ctime;
1105
+ linkpath;
1106
+ dev;
1107
+ ino;
1108
+ nlink;
1109
+ invalid = !1;
1110
+ absolute;
1111
+ unsupported = !1;
1112
+ constructor(e, t, n) {
1113
+ switch (super({}), this.pause(), this.extended = t, this.globalExtended = n, this.header = e, this.remain = e.size ?? 0, this.startBlockSize = 512 * Math.ceil(this.remain / 512), this.blockRemain = this.startBlockSize, this.type = e.type, this.type) {
1114
+ case `File`:
1115
+ case `OldFile`:
1116
+ case `Link`:
1117
+ case `SymbolicLink`:
1118
+ case `CharacterDevice`:
1119
+ case `BlockDevice`:
1120
+ case `Directory`:
1121
+ case `FIFO`:
1122
+ case `ContiguousFile`:
1123
+ case `GNUDumpDir`: break;
1124
+ case `NextFileHasLongLinkpath`:
1125
+ case `NextFileHasLongPath`:
1126
+ case `OldGnuLongPath`:
1127
+ case `GlobalExtendedHeader`:
1128
+ case `ExtendedHeader`:
1129
+ case `OldExtendedHeader`:
1130
+ this.meta = !0;
1131
+ break;
1132
+ default: this.ignore = !0;
1133
+ }
1134
+ if (!e.path) throw Error(`no path provided for tar.ReadEntry`);
1135
+ this.path = z(e.path), this.mode = e.mode, this.mode && (this.mode &= 4095), this.uid = e.uid, this.gid = e.gid, this.uname = e.uname, this.gname = e.gname, this.size = this.remain, this.mtime = e.mtime, this.atime = e.atime, this.ctime = e.ctime, this.linkpath = e.linkpath ? z(e.linkpath) : void 0, this.uname = e.uname, this.gname = e.gname, t && this.#t(t), n && this.#t(n, !0);
1136
+ }
1137
+ write(e) {
1138
+ let t = e.length;
1139
+ if (t > this.blockRemain) throw Error(`writing more to entry than is appropriate`);
1140
+ let n = this.remain, r = this.blockRemain;
1141
+ return this.remain = Math.max(0, n - t), this.blockRemain = Math.max(0, r - t), this.ignore ? !0 : n >= t ? super.write(e) : super.write(e.subarray(0, n));
1142
+ }
1143
+ #t(e, t = !1) {
1144
+ e.path &&= z(e.path), e.linkpath &&= z(e.linkpath), Object.assign(this, Object.fromEntries(Object.entries(e).filter(([e, n]) => !(n == null || e === `path` && t))));
1145
+ }
1146
+ }, bn = (e, t, n, r = {}) => {
1147
+ e.file && (r.file = e.file), e.cwd && (r.cwd = e.cwd), r.code = n instanceof Error && n.code || t, r.tarCode = t, !e.strict && r.recoverable !== !1 ? (n instanceof Error && (r = Object.assign(n, r), n = n.message), e.emit(`warn`, t, n, r)) : n instanceof Error ? e.emit(`error`, Object.assign(n, r)) : e.emit(`error`, Object.assign(Error(`${t}: ${n}`), r));
1148
+ }, xn = 1024 * 1024, Sn = Buffer.from([31, 139]), Cn = Buffer.from([
1149
+ 40,
1150
+ 181,
1151
+ 47,
1152
+ 253
1153
+ ]), wn = Math.max(Sn.length, Cn.length), B = Symbol(`state`), Tn = Symbol(`writeEntry`), V = Symbol(`readEntry`), En = Symbol(`nextEntry`), Dn = Symbol(`processEntry`), H = Symbol(`extendedHeader`), On = Symbol(`globalExtendedHeader`), kn = Symbol(`meta`), An = Symbol(`emitMeta`), U = Symbol(`buffer`), W = Symbol(`queue`), G = Symbol(`ended`), jn = Symbol(`emittedEnd`), Mn = Symbol(`emit`), K = Symbol(`unzip`), Nn = Symbol(`consumeChunk`), Pn = Symbol(`consumeChunkSub`), Fn = Symbol(`consumeBody`), In = Symbol(`consumeMeta`), Ln = Symbol(`consumeHeader`), Rn = Symbol(`consuming`), zn = Symbol(`bufferConcat`), Bn = Symbol(`maybeEnd`), Vn = Symbol(`writing`), q = Symbol(`aborted`), Hn = Symbol(`onDone`), Un = Symbol(`sawValidEntry`), Wn = Symbol(`sawNullBlock`), Gn = Symbol(`sawEOF`), Kn = Symbol(`closeStream`), qn = () => !0, Jn = class extends u {
1154
+ file;
1155
+ strict;
1156
+ maxMetaEntrySize;
1157
+ filter;
1158
+ brotli;
1159
+ zstd;
1160
+ writable = !0;
1161
+ readable = !1;
1162
+ [W] = [];
1163
+ [U];
1164
+ [V];
1165
+ [Tn];
1166
+ [B] = `begin`;
1167
+ [kn] = ``;
1168
+ [H];
1169
+ [On];
1170
+ [G] = !1;
1171
+ [K];
1172
+ [q] = !1;
1173
+ [Un];
1174
+ [Wn] = !1;
1175
+ [Gn] = !1;
1176
+ [Vn] = !1;
1177
+ [Rn] = !1;
1178
+ [jn] = !1;
1179
+ constructor(e = {}) {
1180
+ super(), this.file = e.file || ``, this.on(Hn, () => {
1181
+ (this[B] === `begin` || this[Un] === !1) && this.warn(`TAR_BAD_ARCHIVE`, `Unrecognized archive format`);
1182
+ }), e.ondone ? this.on(Hn, e.ondone) : this.on(Hn, () => {
1183
+ this.emit(`prefinish`), this.emit(`finish`), this.emit(`end`);
1184
+ }), this.strict = !!e.strict, this.maxMetaEntrySize = e.maxMetaEntrySize || xn, this.filter = typeof e.filter == `function` ? e.filter : qn;
1185
+ let t = e.file && (e.file.endsWith(`.tar.br`) || e.file.endsWith(`.tbr`));
1186
+ this.brotli = !(e.gzip || e.zstd) && e.brotli !== void 0 ? e.brotli : t ? void 0 : !1;
1187
+ let n = e.file && (e.file.endsWith(`.tar.zst`) || e.file.endsWith(`.tzst`));
1188
+ this.zstd = !(e.gzip || e.brotli) && e.zstd !== void 0 ? e.zstd : n ? !0 : void 0, this.on(`end`, () => this[Kn]()), typeof e.onwarn == `function` && this.on(`warn`, e.onwarn), typeof e.onReadEntry == `function` && this.on(`entry`, e.onReadEntry);
1189
+ }
1190
+ warn(e, t, n = {}) {
1191
+ bn(this, e, t, n);
1192
+ }
1193
+ [Ln](e, t) {
1194
+ this[Un] === void 0 && (this[Un] = !1);
1195
+ let n;
1196
+ try {
1197
+ n = new I(e, t, this[H], this[On]);
1198
+ } catch (e) {
1199
+ return this.warn(`TAR_ENTRY_INVALID`, e);
1200
+ }
1201
+ if (n.nullBlock) this[Wn] ? (this[Gn] = !0, this[B] === `begin` && (this[B] = `header`), this[Mn](`eof`)) : (this[Wn] = !0, this[Mn](`nullBlock`));
1202
+ else if (this[Wn] = !1, !n.cksumValid) this.warn(`TAR_ENTRY_INVALID`, `checksum failure`, { header: n });
1203
+ else if (!n.path) this.warn(`TAR_ENTRY_INVALID`, `path is required`, { header: n });
1204
+ else {
1205
+ let e = n.type;
1206
+ if (/^(Symbolic)?Link$/.test(e) && !n.linkpath) this.warn(`TAR_ENTRY_INVALID`, `linkpath required`, { header: n });
1207
+ else if (!/^(Symbolic)?Link$/.test(e) && !/^(Global)?ExtendedHeader$/.test(e) && n.linkpath) this.warn(`TAR_ENTRY_INVALID`, `linkpath forbidden`, { header: n });
1208
+ else {
1209
+ let e = this[Tn] = new yn(n, this[H], this[On]);
1210
+ this[Un] || (e.remain ? e.on(`end`, () => {
1211
+ e.invalid || (this[Un] = !0);
1212
+ }) : this[Un] = !0), e.meta ? e.size > this.maxMetaEntrySize ? (e.ignore = !0, this[Mn](`ignoredEntry`, e), this[B] = `ignore`, e.resume()) : e.size > 0 && (this[kn] = ``, e.on(`data`, (e) => this[kn] += e), this[B] = `meta`) : (this[H] = void 0, e.ignore = e.ignore || !this.filter(e.path, e), e.ignore ? (this[Mn](`ignoredEntry`, e), this[B] = e.remain ? `ignore` : `header`, e.resume()) : (e.remain ? this[B] = `body` : (this[B] = `header`, e.end()), this[V] ? this[W].push(e) : (this[W].push(e), this[En]())));
1213
+ }
1214
+ }
1215
+ }
1216
+ [Kn]() {
1217
+ queueMicrotask(() => this.emit(`close`));
1218
+ }
1219
+ [Dn](e) {
1220
+ let t = !0;
1221
+ if (!e) this[V] = void 0, t = !1;
1222
+ else if (Array.isArray(e)) {
1223
+ let [t, ...n] = e;
1224
+ this.emit(t, ...n);
1225
+ } else this[V] = e, this.emit(`entry`, e), e.emittedEnd || (e.on(`end`, () => this[En]()), t = !1);
1226
+ return t;
1227
+ }
1228
+ [En]() {
1229
+ do ;
1230
+ while (this[Dn](this[W].shift()));
1231
+ if (this[W].length === 0) {
1232
+ let e = this[V];
1233
+ !e || e.flowing || e.size === e.remain ? this[Vn] || this.emit(`drain`) : e.once(`drain`, () => this.emit(`drain`));
1234
+ }
1235
+ }
1236
+ [Fn](e, t) {
1237
+ let n = this[Tn];
1238
+ if (!n) throw Error(`attempt to consume body without entry??`);
1239
+ let r = n.blockRemain ?? 0, i = r >= e.length && t === 0 ? e : e.subarray(t, t + r);
1240
+ return n.write(i), n.blockRemain || (this[B] = `header`, this[Tn] = void 0, n.end()), i.length;
1241
+ }
1242
+ [In](e, t) {
1243
+ let n = this[Tn], r = this[Fn](e, t);
1244
+ return !this[Tn] && n && this[An](n), r;
1245
+ }
1246
+ [Mn](e, t, n) {
1247
+ this[W].length === 0 && !this[V] ? this.emit(e, t, n) : this[W].push([
1248
+ e,
1249
+ t,
1250
+ n
1251
+ ]);
1252
+ }
1253
+ [An](e) {
1254
+ switch (this[Mn](`meta`, this[kn]), e.type) {
1255
+ case `ExtendedHeader`:
1256
+ case `OldExtendedHeader`:
1257
+ this[H] = hn.parse(this[kn], this[H], !1);
1258
+ break;
1259
+ case `GlobalExtendedHeader`:
1260
+ this[On] = hn.parse(this[kn], this[On], !0);
1261
+ break;
1262
+ case `NextFileHasLongPath`:
1263
+ case `OldGnuLongPath`: {
1264
+ let e = this[H] ?? Object.create(null);
1265
+ this[H] = e, e.path = this[kn].replace(/\0.*/, ``);
1266
+ break;
1267
+ }
1268
+ case `NextFileHasLongLinkpath`: {
1269
+ let e = this[H] || Object.create(null);
1270
+ this[H] = e, e.linkpath = this[kn].replace(/\0.*/, ``);
1271
+ break;
1272
+ }
1273
+ default: throw Error(`unknown meta: ` + e.type);
1274
+ }
1275
+ }
1276
+ abort(e) {
1277
+ this[q] = !0, this.emit(`abort`, e), this.warn(`TAR_ABORT`, e, { recoverable: !1 });
1278
+ }
1279
+ write(e, t, n) {
1280
+ if (typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, typeof t == `string` ? t : `utf8`)), this[q]) return n?.(), !1;
1281
+ if ((this[K] === void 0 || this.brotli === void 0 && this[K] === !1) && e) {
1282
+ if (this[U] && (e = Buffer.concat([this[U], e]), this[U] = void 0), e.length < wn) return this[U] = e, n?.(), !0;
1283
+ for (let t = 0; this[K] === void 0 && t < Sn.length; t++) e[t] !== Sn[t] && (this[K] = !1);
1284
+ let t = !1;
1285
+ if (this[K] === !1 && this.zstd !== !1) {
1286
+ t = !0;
1287
+ for (let n = 0; n < Cn.length; n++) if (e[n] !== Cn[n]) {
1288
+ t = !1;
1289
+ break;
1290
+ }
1291
+ }
1292
+ let r = this.brotli === void 0 && !t;
1293
+ if (this[K] === !1 && r) if (e.length < 512) if (this[G]) this.brotli = !0;
1294
+ else return this[U] = e, n?.(), !0;
1295
+ else try {
1296
+ new I(e.subarray(0, 512)), this.brotli = !1;
1297
+ } catch {
1298
+ this.brotli = !0;
1299
+ }
1300
+ if (this[K] === void 0 || this[K] === !1 && (this.brotli || t)) {
1301
+ let r = this[G];
1302
+ this[G] = !1, this[K] = this[K] === void 0 ? new Ft({}) : t ? new Vt({}) : new Rt({}), this[K].on(`data`, (e) => this[Nn](e)), this[K].on(`error`, (e) => this.abort(e)), this[K].on(`end`, () => {
1303
+ this[G] = !0, this[Nn]();
1304
+ }), this[Vn] = !0;
1305
+ let i = !!this[K][r ? `end` : `write`](e);
1306
+ return this[Vn] = !1, n?.(), i;
1307
+ }
1308
+ }
1309
+ this[Vn] = !0, this[K] ? this[K].write(e) : this[Nn](e), this[Vn] = !1;
1310
+ let r = this[W].length > 0 ? !1 : this[V] ? this[V].flowing : !0;
1311
+ return !r && this[W].length === 0 && this[V]?.once(`drain`, () => this.emit(`drain`)), n?.(), r;
1312
+ }
1313
+ [zn](e) {
1314
+ e && !this[q] && (this[U] = this[U] ? Buffer.concat([this[U], e]) : e);
1315
+ }
1316
+ [Bn]() {
1317
+ if (this[G] && !this[jn] && !this[q] && !this[Rn]) {
1318
+ this[jn] = !0;
1319
+ let e = this[Tn];
1320
+ if (e && e.blockRemain) {
1321
+ let t = this[U] ? this[U].length : 0;
1322
+ this.warn(`TAR_BAD_ARCHIVE`, `Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`, { entry: e }), this[U] && e.write(this[U]), e.end();
1323
+ }
1324
+ this[Mn](Hn);
1325
+ }
1326
+ }
1327
+ [Nn](e) {
1328
+ if (this[Rn] && e) this[zn](e);
1329
+ else if (!e && !this[U]) this[Bn]();
1330
+ else if (e) {
1331
+ if (this[Rn] = !0, this[U]) {
1332
+ this[zn](e);
1333
+ let t = this[U];
1334
+ this[U] = void 0, this[Pn](t);
1335
+ } else this[Pn](e);
1336
+ for (; this[U] && this[U]?.length >= 512 && !this[q] && !this[Gn];) {
1337
+ let e = this[U];
1338
+ this[U] = void 0, this[Pn](e);
1339
+ }
1340
+ this[Rn] = !1;
1341
+ }
1342
+ (!this[U] || this[G]) && this[Bn]();
1343
+ }
1344
+ [Pn](e) {
1345
+ let t = 0, n = e.length;
1346
+ for (; t + 512 <= n && !this[q] && !this[Gn];) switch (this[B]) {
1347
+ case `begin`:
1348
+ case `header`:
1349
+ this[Ln](e, t), t += 512;
1350
+ break;
1351
+ case `ignore`:
1352
+ case `body`:
1353
+ t += this[Fn](e, t);
1354
+ break;
1355
+ case `meta`:
1356
+ t += this[In](e, t);
1357
+ break;
1358
+ default: throw Error(`invalid state: ` + this[B]);
1359
+ }
1360
+ t < n && (this[U] = this[U] ? Buffer.concat([e.subarray(t), this[U]]) : e.subarray(t));
1361
+ }
1362
+ end(e, t, n) {
1363
+ return typeof e == `function` && (n = e, t = void 0, e = void 0), typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, t)), n && this.once(`finish`, n), this[q] || (this[K] ? (e && this[K].write(e), this[K].end()) : (this[G] = !0, (this.brotli === void 0 || this.zstd === void 0) && (e ||= Buffer.alloc(0)), e && this.write(e), this[Bn]())), this;
1364
+ }
1365
+ }, Yn = (e) => {
1366
+ let t = e.length - 1, n = -1;
1367
+ for (; t > -1 && e.charAt(t) === `/`;) n = t, t--;
1368
+ return n === -1 ? e : e.slice(0, n);
1369
+ }, Xn = (e) => {
1370
+ let t = e.onReadEntry;
1371
+ e.onReadEntry = t ? (e) => {
1372
+ t(e), e.resume();
1373
+ } : (e) => e.resume();
1374
+ }, Zn = (e, t) => {
1375
+ let n = new Map(t.map((e) => [Yn(e), !0])), r = e.filter, i = (e, t = ``) => {
1376
+ let r = t || te(e).root || `.`, a;
1377
+ if (e === r) a = !1;
1378
+ else {
1379
+ let t = n.get(e);
1380
+ a = t === void 0 ? i(m(e), r) : t;
1381
+ }
1382
+ return n.set(e, a), a;
1383
+ };
1384
+ e.filter = r ? (e, t) => r(e, t) && i(Yn(e)) : (e) => i(Yn(e));
1385
+ }, Qn = Ct((e) => {
1386
+ let n = new Jn(e), r = e.file, i;
1387
+ try {
1388
+ i = t.openSync(r, `r`);
1389
+ let a = t.fstatSync(i), o = e.maxReadSize || 16 * 1024 * 1024;
1390
+ if (a.size < o) {
1391
+ let e = Buffer.allocUnsafe(a.size), r = t.readSync(i, e, 0, a.size, 0);
1392
+ n.end(r === e.byteLength ? e : e.subarray(0, r));
1393
+ } else {
1394
+ let e = 0, r = Buffer.allocUnsafe(o);
1395
+ for (; e < a.size;) {
1396
+ let a = t.readSync(i, r, 0, o, e);
1397
+ if (a === 0) break;
1398
+ e += a, n.write(r.subarray(0, a));
1399
+ }
1400
+ n.end();
1401
+ }
1402
+ } finally {
1403
+ if (typeof i == `number`) try {
1404
+ t.closeSync(i);
1405
+ } catch {}
1406
+ }
1407
+ }, (e, n) => {
1408
+ let r = new Jn(e), i = e.maxReadSize || 16 * 1024 * 1024, a = e.file;
1409
+ return new Promise((e, n) => {
1410
+ r.on(`error`, n), r.on(`end`, e), t.stat(a, (e, t) => {
1411
+ if (e) n(e);
1412
+ else {
1413
+ let e = new dt(a, {
1414
+ readSize: i,
1415
+ size: t.size
1416
+ });
1417
+ e.on(`error`, n), e.pipe(r);
1418
+ }
1419
+ });
1420
+ });
1421
+ }, (e) => new Jn(e), (e) => new Jn(e), (e, t) => {
1422
+ t?.length && Zn(e, t), e.noResume || Xn(e);
1423
+ }), $n = (e, t, n) => (e &= 4095, n && (e = (e | 384) & -19), t && (e & 256 && (e |= 64), e & 32 && (e |= 8), e & 4 && (e |= 1)), e), { isAbsolute: er, parse: tr } = c, nr = (e) => {
1424
+ let t = ``, n = tr(e);
1425
+ for (; er(e) || n.root;) {
1426
+ let r = e.charAt(0) === `/` && e.slice(0, 4) !== `//?/` ? `/` : n.root;
1427
+ e = e.slice(r.length), t += r, n = tr(e);
1428
+ }
1429
+ return [t, e];
1430
+ }, rr = [
1431
+ `|`,
1432
+ `<`,
1433
+ `>`,
1434
+ `?`,
1435
+ `:`
1436
+ ], ir = rr.map((e) => String.fromCodePoint(61440 + Number(e.codePointAt(0)))), ar = new Map(rr.map((e, t) => [e, ir[t]])), or = new Map(ir.map((e, t) => [e, rr[t]])), sr = (e) => rr.reduce((e, t) => e.split(t).join(ar.get(t)), e), cr = (e) => ir.reduce((e, t) => e.split(t).join(or.get(t)), e), lr = (e, t) => t ? (e = z(e).replace(/^\.(\/|$)/, ``), Yn(t) + `/` + e) : z(e), ur = 16 * 1024 * 1024, dr = Symbol(`process`), fr = Symbol(`file`), pr = Symbol(`directory`), mr = Symbol(`symlink`), hr = Symbol(`hardlink`), gr = Symbol(`header`), _r = Symbol(`read`), vr = Symbol(`lstat`), yr = Symbol(`onlstat`), br = Symbol(`onread`), xr = Symbol(`onreadlink`), Sr = Symbol(`openfile`), Cr = Symbol(`onopenfile`), J = Symbol(`close`), wr = Symbol(`mode`), Tr = Symbol(`awaitDrain`), Er = Symbol(`ondrain`), Y = Symbol(`prefix`), Dr = class extends Ue {
1437
+ path;
1438
+ portable;
1439
+ myuid = process.getuid && process.getuid() || 0;
1440
+ myuser = process.env.USER || ``;
1441
+ maxReadSize;
1442
+ linkCache;
1443
+ statCache;
1444
+ preservePaths;
1445
+ cwd;
1446
+ strict;
1447
+ mtime;
1448
+ noPax;
1449
+ noMtime;
1450
+ prefix;
1451
+ fd;
1452
+ blockLen = 0;
1453
+ blockRemain = 0;
1454
+ buf;
1455
+ pos = 0;
1456
+ remain = 0;
1457
+ length = 0;
1458
+ offset = 0;
1459
+ win32;
1460
+ absolute;
1461
+ header;
1462
+ type;
1463
+ linkpath;
1464
+ stat;
1465
+ onWriteEntry;
1466
+ #t = !1;
1467
+ constructor(e, t = {}) {
1468
+ let n = St(t);
1469
+ super(), this.path = z(e), this.portable = !!n.portable, this.maxReadSize = n.maxReadSize || ur, this.linkCache = n.linkCache || /* @__PURE__ */ new Map(), this.statCache = n.statCache || /* @__PURE__ */ new Map(), this.preservePaths = !!n.preservePaths, this.cwd = z(n.cwd || process.cwd()), this.strict = !!n.strict, this.noPax = !!n.noPax, this.noMtime = !!n.noMtime, this.mtime = n.mtime, this.prefix = n.prefix ? z(n.prefix) : void 0, this.onWriteEntry = n.onWriteEntry, typeof n.onwarn == `function` && this.on(`warn`, n.onwarn);
1470
+ let r = !1;
1471
+ if (!this.preservePaths) {
1472
+ let [e, t] = nr(this.path);
1473
+ e && typeof t == `string` && (this.path = t, r = e);
1474
+ }
1475
+ this.win32 = !!n.win32 || process.platform === `win32`, this.win32 && (this.path = cr(this.path.replaceAll(/\\/g, `/`)), e = e.replaceAll(/\\/g, `/`)), this.absolute = z(n.absolute || p.resolve(this.cwd, e)), this.path === `` && (this.path = `./`), r && this.warn(`TAR_ENTRY_INFO`, `stripping ${r} from absolute path`, {
1476
+ entry: this,
1477
+ path: r + this.path
1478
+ });
1479
+ let i = this.statCache.get(this.absolute);
1480
+ i ? this[yr](i) : this[vr]();
1481
+ }
1482
+ warn(e, t, n = {}) {
1483
+ return bn(this, e, t, n);
1484
+ }
1485
+ emit(e, ...t) {
1486
+ return e === `error` && (this.#t = !0), super.emit(e, ...t);
1487
+ }
1488
+ [vr]() {
1489
+ d.lstat(this.absolute, (e, t) => {
1490
+ if (e) return this.emit(`error`, e);
1491
+ this[yr](t);
1492
+ });
1493
+ }
1494
+ [yr](e) {
1495
+ this.statCache.set(this.absolute, e), this.stat = e, e.isFile() || (e.size = 0), this.type = Ar(e), this.emit(`stat`, e), this[dr]();
1496
+ }
1497
+ [dr]() {
1498
+ switch (this.type) {
1499
+ case `File`: return this[fr]();
1500
+ case `Directory`: return this[pr]();
1501
+ case `SymbolicLink`: return this[mr]();
1502
+ default: return this.end();
1503
+ }
1504
+ }
1505
+ [wr](e) {
1506
+ return $n(e, this.type === `Directory`, this.portable);
1507
+ }
1508
+ [Y](e) {
1509
+ return lr(e, this.prefix);
1510
+ }
1511
+ [gr]() {
1512
+ if (!this.stat) throw Error(`cannot write header before stat`);
1513
+ this.type === `Directory` && this.portable && (this.noMtime = !0), this.onWriteEntry?.(this), this.header = new I({
1514
+ path: this[Y](this.path),
1515
+ linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[Y](this.linkpath) : this.linkpath,
1516
+ mode: this[wr](this.stat.mode),
1517
+ uid: this.portable ? void 0 : this.stat.uid,
1518
+ gid: this.portable ? void 0 : this.stat.gid,
1519
+ size: this.stat.size,
1520
+ mtime: this.noMtime ? void 0 : this.mtime || this.stat.mtime,
1521
+ type: this.type === `Unsupported` ? void 0 : this.type,
1522
+ uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : ``,
1523
+ atime: this.portable ? void 0 : this.stat.atime,
1524
+ ctime: this.portable ? void 0 : this.stat.ctime
1525
+ }), this.header.encode() && !this.noPax && super.write(new hn({
1526
+ atime: this.portable ? void 0 : this.header.atime,
1527
+ ctime: this.portable ? void 0 : this.header.ctime,
1528
+ gid: this.portable ? void 0 : this.header.gid,
1529
+ mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime,
1530
+ path: this[Y](this.path),
1531
+ linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[Y](this.linkpath) : this.linkpath,
1532
+ size: this.header.size,
1533
+ uid: this.portable ? void 0 : this.header.uid,
1534
+ uname: this.portable ? void 0 : this.header.uname,
1535
+ dev: this.portable ? void 0 : this.stat.dev,
1536
+ ino: this.portable ? void 0 : this.stat.ino,
1537
+ nlink: this.portable ? void 0 : this.stat.nlink
1538
+ }).encode());
1539
+ let e = this.header?.block;
1540
+ if (!e) throw Error(`failed to encode header`);
1541
+ super.write(e);
1542
+ }
1543
+ [pr]() {
1544
+ if (!this.stat) throw Error(`cannot create directory entry without stat`);
1545
+ this.path.slice(-1) !== `/` && (this.path += `/`), this.stat.size = 0, this[gr](), this.end();
1546
+ }
1547
+ [mr]() {
1548
+ d.readlink(this.absolute, (e, t) => {
1549
+ if (e) return this.emit(`error`, e);
1550
+ this[xr](t);
1551
+ });
1552
+ }
1553
+ [xr](e) {
1554
+ this.linkpath = z(e), this[gr](), this.end();
1555
+ }
1556
+ [hr](e) {
1557
+ if (!this.stat) throw Error(`cannot create link entry without stat`);
1558
+ this.type = `Link`, this.linkpath = z(p.relative(this.cwd, e)), this.stat.size = 0, this[gr](), this.end();
1559
+ }
1560
+ [fr]() {
1561
+ if (!this.stat) throw Error(`cannot create file entry without stat`);
1562
+ if (this.stat.nlink > 1) {
1563
+ let e = `${this.stat.dev}:${this.stat.ino}`, t = this.linkCache.get(e);
1564
+ if (t?.indexOf(this.cwd) === 0) return this[hr](t);
1565
+ this.linkCache.set(e, this.absolute);
1566
+ }
1567
+ if (this[gr](), this.stat.size === 0) return this.end();
1568
+ this[Sr]();
1569
+ }
1570
+ [Sr]() {
1571
+ d.open(this.absolute, `r`, (e, t) => {
1572
+ if (e) return this.emit(`error`, e);
1573
+ this[Cr](t);
1574
+ });
1575
+ }
1576
+ [Cr](e) {
1577
+ if (this.fd = e, this.#t) return this[J]();
1578
+ if (!this.stat) throw Error(`should stat before calling onopenfile`);
1579
+ this.blockLen = 512 * Math.ceil(this.stat.size / 512), this.blockRemain = this.blockLen;
1580
+ let t = Math.min(this.blockLen, this.maxReadSize);
1581
+ this.buf = Buffer.allocUnsafe(t), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[_r]();
1582
+ }
1583
+ [_r]() {
1584
+ let { fd: e, buf: t, offset: n, length: r, pos: i } = this;
1585
+ if (e === void 0 || t === void 0) throw Error(`cannot read file without first opening`);
1586
+ d.read(e, t, n, r, i, (e, t) => {
1587
+ if (e) return this[J](() => this.emit(`error`, e));
1588
+ this[br](t);
1589
+ });
1590
+ }
1591
+ [J](e = () => {}) {
1592
+ this.fd !== void 0 && d.close(this.fd, e);
1593
+ }
1594
+ [br](e) {
1595
+ if (e <= 0 && this.remain > 0) {
1596
+ let e = Object.assign(Error(`encountered unexpected EOF`), {
1597
+ path: this.absolute,
1598
+ syscall: `read`,
1599
+ code: `EOF`
1600
+ });
1601
+ return this[J](() => this.emit(`error`, e));
1602
+ }
1603
+ if (e > this.remain) {
1604
+ let e = Object.assign(Error(`did not encounter expected EOF`), {
1605
+ path: this.absolute,
1606
+ syscall: `read`,
1607
+ code: `EOF`
1608
+ });
1609
+ return this[J](() => this.emit(`error`, e));
1610
+ }
1611
+ if (!this.buf) throw Error(`should have created buffer prior to reading`);
1612
+ if (e === this.remain) for (let t = e; t < this.length && e < this.blockRemain; t++) this.buf[t + this.offset] = 0, e++, this.remain++;
1613
+ let t = this.offset === 0 && e === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + e);
1614
+ this.write(t) ? this[Er]() : this[Tr](() => this[Er]());
1615
+ }
1616
+ [Tr](e) {
1617
+ this.once(`drain`, e);
1618
+ }
1619
+ write(e, t, n) {
1620
+ if (typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, typeof t == `string` ? t : `utf8`)), this.blockRemain < e.length) {
1621
+ let e = Object.assign(Error(`writing more data than expected`), { path: this.absolute });
1622
+ return this.emit(`error`, e);
1623
+ }
1624
+ return this.remain -= e.length, this.blockRemain -= e.length, this.pos += e.length, this.offset += e.length, super.write(e, null, n);
1625
+ }
1626
+ [Er]() {
1627
+ if (!this.remain) return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), this[J]((e) => e ? this.emit(`error`, e) : this.end());
1628
+ if (!this.buf) throw Error(`buffer lost somehow in ONDRAIN`);
1629
+ 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[_r]();
1630
+ }
1631
+ }, Or = class extends Dr {
1632
+ sync = !0;
1633
+ [vr]() {
1634
+ this[yr](d.lstatSync(this.absolute));
1635
+ }
1636
+ [mr]() {
1637
+ this[xr](d.readlinkSync(this.absolute));
1638
+ }
1639
+ [Sr]() {
1640
+ this[Cr](d.openSync(this.absolute, `r`));
1641
+ }
1642
+ [_r]() {
1643
+ let e = !0;
1644
+ try {
1645
+ let { fd: t, buf: n, offset: r, length: i, pos: a } = this;
1646
+ if (t === void 0 || n === void 0) throw Error(`fd and buf must be set in READ method`);
1647
+ let o = d.readSync(t, n, r, i, a);
1648
+ this[br](o), e = !1;
1649
+ } finally {
1650
+ if (e) try {
1651
+ this[J](() => {});
1652
+ } catch {}
1653
+ }
1654
+ }
1655
+ [Tr](e) {
1656
+ e();
1657
+ }
1658
+ [J](e = () => {}) {
1659
+ this.fd !== void 0 && d.closeSync(this.fd), e();
1660
+ }
1661
+ }, kr = class extends Ue {
1662
+ blockLen = 0;
1663
+ blockRemain = 0;
1664
+ buf = 0;
1665
+ pos = 0;
1666
+ remain = 0;
1667
+ length = 0;
1668
+ preservePaths;
1669
+ portable;
1670
+ strict;
1671
+ noPax;
1672
+ noMtime;
1673
+ readEntry;
1674
+ type;
1675
+ prefix;
1676
+ path;
1677
+ mode;
1678
+ uid;
1679
+ gid;
1680
+ uname;
1681
+ gname;
1682
+ header;
1683
+ mtime;
1684
+ atime;
1685
+ ctime;
1686
+ linkpath;
1687
+ size;
1688
+ onWriteEntry;
1689
+ warn(e, t, n = {}) {
1690
+ return bn(this, e, t, n);
1691
+ }
1692
+ constructor(e, t = {}) {
1693
+ let n = St(t);
1694
+ super(), this.preservePaths = !!n.preservePaths, this.portable = !!n.portable, this.strict = !!n.strict, this.noPax = !!n.noPax, this.noMtime = !!n.noMtime, this.onWriteEntry = n.onWriteEntry, this.readEntry = e;
1695
+ let { type: r } = e;
1696
+ if (r === `Unsupported`) throw Error(`writing entry that should be ignored`);
1697
+ this.type = r, this.type === `Directory` && this.portable && (this.noMtime = !0), this.prefix = n.prefix, this.path = z(e.path), this.mode = e.mode === void 0 ? void 0 : this[wr](e.mode), this.uid = this.portable ? void 0 : e.uid, this.gid = this.portable ? void 0 : e.gid, this.uname = this.portable ? void 0 : e.uname, this.gname = this.portable ? void 0 : e.gname, this.size = e.size, this.mtime = this.noMtime ? void 0 : n.mtime || e.mtime, this.atime = this.portable ? void 0 : e.atime, this.ctime = this.portable ? void 0 : e.ctime, this.linkpath = e.linkpath === void 0 ? void 0 : z(e.linkpath), typeof n.onwarn == `function` && this.on(`warn`, n.onwarn);
1698
+ let i = !1;
1699
+ if (!this.preservePaths) {
1700
+ let [e, t] = nr(this.path);
1701
+ e && typeof t == `string` && (this.path = t, i = e);
1702
+ }
1703
+ this.remain = e.size, this.blockRemain = e.startBlockSize, this.onWriteEntry?.(this), this.header = new I({
1704
+ path: this[Y](this.path),
1705
+ linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[Y](this.linkpath) : this.linkpath,
1706
+ mode: this.mode,
1707
+ uid: this.portable ? void 0 : this.uid,
1708
+ gid: this.portable ? void 0 : this.gid,
1709
+ size: this.size,
1710
+ mtime: this.noMtime ? void 0 : this.mtime,
1711
+ type: this.type,
1712
+ uname: this.portable ? void 0 : this.uname,
1713
+ atime: this.portable ? void 0 : this.atime,
1714
+ ctime: this.portable ? void 0 : this.ctime
1715
+ }), i && this.warn(`TAR_ENTRY_INFO`, `stripping ${i} from absolute path`, {
1716
+ entry: this,
1717
+ path: i + this.path
1718
+ }), this.header.encode() && !this.noPax && super.write(new hn({
1719
+ atime: this.portable ? void 0 : this.atime,
1720
+ ctime: this.portable ? void 0 : this.ctime,
1721
+ gid: this.portable ? void 0 : this.gid,
1722
+ mtime: this.noMtime ? void 0 : this.mtime,
1723
+ path: this[Y](this.path),
1724
+ linkpath: this.type === `Link` && this.linkpath !== void 0 ? this[Y](this.linkpath) : this.linkpath,
1725
+ size: this.size,
1726
+ uid: this.portable ? void 0 : this.uid,
1727
+ uname: this.portable ? void 0 : this.uname,
1728
+ dev: this.portable ? void 0 : this.readEntry.dev,
1729
+ ino: this.portable ? void 0 : this.readEntry.ino,
1730
+ nlink: this.portable ? void 0 : this.readEntry.nlink
1731
+ }).encode());
1732
+ let a = this.header?.block;
1733
+ if (!a) throw Error(`failed to encode header`);
1734
+ super.write(a), e.pipe(this);
1735
+ }
1736
+ [Y](e) {
1737
+ return lr(e, this.prefix);
1738
+ }
1739
+ [wr](e) {
1740
+ return $n(e, this.type === `Directory`, this.portable);
1741
+ }
1742
+ write(e, t, n) {
1743
+ typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, typeof t == `string` ? t : `utf8`));
1744
+ let r = e.length;
1745
+ if (r > this.blockRemain) throw Error(`writing more to entry than is appropriate`);
1746
+ return this.blockRemain -= r, super.write(e, n);
1747
+ }
1748
+ end(e, t, n) {
1749
+ return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), typeof e == `function` && (n = e, t = void 0, e = void 0), typeof t == `function` && (n = t, t = void 0), typeof e == `string` && (e = Buffer.from(e, t ?? `utf8`)), n && this.once(`finish`, n), e ? super.end(e, n) : super.end(n), this;
1750
+ }
1751
+ }, Ar = (e) => e.isFile() ? `File` : e.isDirectory() ? `Directory` : e.isSymbolicLink() ? `SymbolicLink` : `Unsupported`, jr = class e {
1752
+ tail;
1753
+ head;
1754
+ length = 0;
1755
+ static create(t = []) {
1756
+ return new e(t);
1757
+ }
1758
+ constructor(e = []) {
1759
+ for (let t of e) this.push(t);
1760
+ }
1761
+ *[Symbol.iterator]() {
1762
+ for (let e = this.head; e; e = e.next) yield e.value;
1763
+ }
1764
+ removeNode(e) {
1765
+ if (e.list !== this) throw Error(`removing node which does not belong to this list`);
1766
+ let t = e.next, n = e.prev;
1767
+ return t && (t.prev = n), n && (n.next = t), e === this.head && (this.head = t), e === this.tail && (this.tail = n), this.length--, e.next = void 0, e.prev = void 0, e.list = void 0, t;
1768
+ }
1769
+ unshiftNode(e) {
1770
+ if (e === this.head) return;
1771
+ e.list && e.list.removeNode(e);
1772
+ let t = this.head;
1773
+ e.list = this, e.next = t, t && (t.prev = e), this.head = e, this.tail ||= e, this.length++;
1774
+ }
1775
+ pushNode(e) {
1776
+ if (e === this.tail) return;
1777
+ e.list && e.list.removeNode(e);
1778
+ let t = this.tail;
1779
+ e.list = this, e.prev = t, t && (t.next = e), this.tail = e, this.head ||= e, this.length++;
1780
+ }
1781
+ push(...e) {
1782
+ for (let t = 0, n = e.length; t < n; t++) Nr(this, e[t]);
1783
+ return this.length;
1784
+ }
1785
+ unshift(...e) {
1786
+ for (var t = 0, n = e.length; t < n; t++) Pr(this, e[t]);
1787
+ return this.length;
1788
+ }
1789
+ pop() {
1790
+ if (!this.tail) return;
1791
+ let e = this.tail.value, t = this.tail;
1792
+ return this.tail = this.tail.prev, this.tail ? this.tail.next = void 0 : this.head = void 0, t.list = void 0, this.length--, e;
1793
+ }
1794
+ shift() {
1795
+ if (!this.head) return;
1796
+ let e = this.head.value, t = this.head;
1797
+ return this.head = this.head.next, this.head ? this.head.prev = void 0 : this.tail = void 0, t.list = void 0, this.length--, e;
1798
+ }
1799
+ forEach(e, t) {
1800
+ t ||= this;
1801
+ for (let n = this.head, r = 0; n; r++) e.call(t, n.value, r, this), n = n.next;
1802
+ }
1803
+ forEachReverse(e, t) {
1804
+ t ||= this;
1805
+ for (let n = this.tail, r = this.length - 1; n; r--) e.call(t, n.value, r, this), n = n.prev;
1806
+ }
1807
+ get(e) {
1808
+ let t = 0, n = this.head;
1809
+ for (; n && t < e; t++) n = n.next;
1810
+ if (t === e && n) return n.value;
1811
+ }
1812
+ getReverse(e) {
1813
+ let t = 0, n = this.tail;
1814
+ for (; n && t < e; t++) n = n.prev;
1815
+ if (t === e && n) return n.value;
1816
+ }
1817
+ map(t, n) {
1818
+ n ||= this;
1819
+ let r = new e();
1820
+ for (let e = this.head; e;) r.push(t.call(n, e.value, this)), e = e.next;
1821
+ return r;
1822
+ }
1823
+ mapReverse(t, n) {
1824
+ n ||= this;
1825
+ var r = new e();
1826
+ for (let e = this.tail; e;) r.push(t.call(n, e.value, this)), e = e.prev;
1827
+ return r;
1828
+ }
1829
+ reduce(e, t) {
1830
+ let n, r = this.head;
1831
+ if (arguments.length > 1) n = t;
1832
+ else if (this.head) r = this.head.next, n = this.head.value;
1833
+ else throw TypeError(`Reduce of empty list with no initial value`);
1834
+ for (var i = 0; r; i++) n = e(n, r.value, i), r = r.next;
1835
+ return n;
1836
+ }
1837
+ reduceReverse(e, t) {
1838
+ let n, r = this.tail;
1839
+ if (arguments.length > 1) n = t;
1840
+ else if (this.tail) r = this.tail.prev, n = this.tail.value;
1841
+ else throw TypeError(`Reduce of empty list with no initial value`);
1842
+ for (let t = this.length - 1; r; t--) n = e(n, r.value, t), r = r.prev;
1843
+ return n;
1844
+ }
1845
+ toArray() {
1846
+ let e = Array(this.length);
1847
+ for (let t = 0, n = this.head; n; t++) e[t] = n.value, n = n.next;
1848
+ return e;
1849
+ }
1850
+ toArrayReverse() {
1851
+ let e = Array(this.length);
1852
+ for (let t = 0, n = this.tail; n; t++) e[t] = n.value, n = n.prev;
1853
+ return e;
1854
+ }
1855
+ slice(t = 0, n = this.length) {
1856
+ n < 0 && (n += this.length), t < 0 && (t += this.length);
1857
+ let r = new e();
1858
+ if (n < t || n < 0) return r;
1859
+ t < 0 && (t = 0), n > this.length && (n = this.length);
1860
+ let i = this.head, a = 0;
1861
+ for (a = 0; i && a < t; a++) i = i.next;
1862
+ for (; i && a < n; a++, i = i.next) r.push(i.value);
1863
+ return r;
1864
+ }
1865
+ sliceReverse(t = 0, n = this.length) {
1866
+ n < 0 && (n += this.length), t < 0 && (t += this.length);
1867
+ let r = new e();
1868
+ if (n < t || n < 0) return r;
1869
+ t < 0 && (t = 0), n > this.length && (n = this.length);
1870
+ let i = this.length, a = this.tail;
1871
+ for (; a && i > n; i--) a = a.prev;
1872
+ for (; a && i > t; i--, a = a.prev) r.push(a.value);
1873
+ return r;
1874
+ }
1875
+ splice(e, t = 0, ...n) {
1876
+ e > this.length && (e = this.length - 1), e < 0 && (e = this.length + e);
1877
+ let r = this.head;
1878
+ for (let t = 0; r && t < e; t++) r = r.next;
1879
+ let i = [];
1880
+ for (let e = 0; r && e < t; e++) i.push(r.value), r = this.removeNode(r);
1881
+ r ? r !== this.tail && (r = r.prev) : r = this.tail;
1882
+ for (let e of n) r = Mr(this, r, e);
1883
+ return i;
1884
+ }
1885
+ reverse() {
1886
+ let e = this.head, t = this.tail;
1887
+ for (let t = e; t; t = t.prev) {
1888
+ let e = t.prev;
1889
+ t.prev = t.next, t.next = e;
1890
+ }
1891
+ return this.head = t, this.tail = e, this;
1892
+ }
1893
+ };
1894
+ function Mr(e, t, n) {
1895
+ let r = new Fr(n, t, t ? t.next : e.head, e);
1896
+ return r.next === void 0 && (e.tail = r), r.prev === void 0 && (e.head = r), e.length++, r;
1897
+ }
1898
+ function Nr(e, t) {
1899
+ e.tail = new Fr(t, e.tail, void 0, e), e.head ||= e.tail, e.length++;
1900
+ }
1901
+ function Pr(e, t) {
1902
+ e.head = new Fr(t, void 0, e.head, e), e.tail ||= e.head, e.length++;
1903
+ }
1904
+ var Fr = class {
1905
+ list;
1906
+ next;
1907
+ prev;
1908
+ value;
1909
+ constructor(e, t, n, r) {
1910
+ this.list = r, this.value = e, t ? (t.next = this, this.prev = t) : this.prev = void 0, n ? (n.prev = this, this.next = n) : this.next = void 0;
1911
+ }
1912
+ }, Ir = class {
1913
+ path;
1914
+ absolute;
1915
+ entry;
1916
+ stat;
1917
+ readdir;
1918
+ pending = !1;
1919
+ ignore = !1;
1920
+ piped = !1;
1921
+ constructor(e, t) {
1922
+ this.path = e || `./`, this.absolute = t;
1923
+ }
1924
+ }, Lr = Buffer.alloc(1024), Rr = Symbol(`onStat`), zr = Symbol(`ended`), X = Symbol(`queue`), Br = Symbol(`current`), Vr = Symbol(`process`), Hr = Symbol(`processing`), Ur = Symbol(`processJob`), Z = Symbol(`jobs`), Wr = Symbol(`jobDone`), Gr = Symbol(`addFSEntry`), Kr = Symbol(`addTarEntry`), qr = Symbol(`stat`), Jr = Symbol(`readdir`), Yr = Symbol(`onreaddir`), Xr = Symbol(`pipe`), Zr = Symbol(`entry`), Qr = Symbol(`entryOpt`), $r = Symbol(`writeEntryClass`), ei = Symbol(`write`), ti = Symbol(`ondrain`), ni = class extends Ue {
1925
+ sync = !1;
1926
+ opt;
1927
+ cwd;
1928
+ maxReadSize;
1929
+ preservePaths;
1930
+ strict;
1931
+ noPax;
1932
+ prefix;
1933
+ linkCache;
1934
+ statCache;
1935
+ file;
1936
+ portable;
1937
+ zip;
1938
+ readdirCache;
1939
+ noDirRecurse;
1940
+ follow;
1941
+ noMtime;
1942
+ mtime;
1943
+ filter;
1944
+ jobs;
1945
+ [$r];
1946
+ onWriteEntry;
1947
+ [X];
1948
+ [Z] = 0;
1949
+ [Hr] = !1;
1950
+ [zr] = !1;
1951
+ constructor(e = {}) {
1952
+ if (super(), this.opt = e, this.file = e.file || ``, this.cwd = e.cwd || process.cwd(), this.maxReadSize = e.maxReadSize, this.preservePaths = !!e.preservePaths, this.strict = !!e.strict, this.noPax = !!e.noPax, this.prefix = z(e.prefix || ``), this.linkCache = e.linkCache || /* @__PURE__ */ new Map(), this.statCache = e.statCache || /* @__PURE__ */ new Map(), this.readdirCache = e.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = e.onWriteEntry, this[$r] = Dr, typeof e.onwarn == `function` && this.on(`warn`, e.onwarn), this.portable = !!e.portable, e.gzip || e.brotli || e.zstd) {
1953
+ if ((e.gzip ? 1 : 0) + (e.brotli ? 1 : 0) + (e.zstd ? 1 : 0) > 1) throw TypeError(`gzip, brotli, zstd are mutually exclusive`);
1954
+ if (e.gzip && (typeof e.gzip != `object` && (e.gzip = {}), this.portable && (e.gzip.portable = !0), this.zip = new Pt(e.gzip)), e.brotli && (typeof e.brotli != `object` && (e.brotli = {}), this.zip = new Lt(e.brotli)), e.zstd && (typeof e.zstd != `object` && (e.zstd = {}), this.zip = new Bt(e.zstd)), !this.zip) throw Error(`impossible`);
1955
+ let t = this.zip;
1956
+ t.on(`data`, (e) => super.write(e)), t.on(`end`, () => super.end()), t.on(`drain`, () => this[ti]()), this.on(`resume`, () => t.resume());
1957
+ } else this.on(`drain`, this[ti]);
1958
+ this.noDirRecurse = !!e.noDirRecurse, this.follow = !!e.follow, this.noMtime = !!e.noMtime, e.mtime && (this.mtime = e.mtime), this.filter = typeof e.filter == `function` ? e.filter : () => !0, this[X] = new jr(), this[Z] = 0, this.jobs = Number(e.jobs) || 4, this[Hr] = !1, this[zr] = !1;
1959
+ }
1960
+ [ei](e) {
1961
+ return super.write(e);
1962
+ }
1963
+ add(e) {
1964
+ return this.write(e), this;
1965
+ }
1966
+ end(e, t, n) {
1967
+ return typeof e == `function` && (n = e, e = void 0), typeof t == `function` && (n = t, t = void 0), e && this.add(e), this[zr] = !0, this[Vr](), n && n(), this;
1968
+ }
1969
+ write(e) {
1970
+ if (this[zr]) throw Error(`write after end`);
1971
+ return e instanceof yn ? this[Kr](e) : this[Gr](e), this.flowing;
1972
+ }
1973
+ [Kr](e) {
1974
+ let t = z(p.resolve(this.cwd, e.path));
1975
+ if (!this.filter(e.path, e)) e.resume();
1976
+ else {
1977
+ let n = new Ir(e.path, t);
1978
+ n.entry = new kr(e, this[Qr](n)), n.entry.on(`end`, () => this[Wr](n)), this[Z] += 1, this[X].push(n);
1979
+ }
1980
+ this[Vr]();
1981
+ }
1982
+ [Gr](e) {
1983
+ let t = z(p.resolve(this.cwd, e));
1984
+ this[X].push(new Ir(e, t)), this[Vr]();
1985
+ }
1986
+ [qr](e) {
1987
+ e.pending = !0, this[Z] += 1, d[this.follow ? `stat` : `lstat`](e.absolute, (t, n) => {
1988
+ e.pending = !1, --this[Z], t ? this.emit(`error`, t) : this[Rr](e, n);
1989
+ });
1990
+ }
1991
+ [Rr](e, t) {
1992
+ this.statCache.set(e.absolute, t), e.stat = t, this.filter(e.path, t) ? t.isFile() && t.nlink > 1 && e === this[Br] && !this.linkCache.get(`${t.dev}:${t.ino}`) && !this.sync && this[Ur](e) : e.ignore = !0, this[Vr]();
1993
+ }
1994
+ [Jr](e) {
1995
+ e.pending = !0, this[Z] += 1, d.readdir(e.absolute, (t, n) => {
1996
+ if (e.pending = !1, --this[Z], t) return this.emit(`error`, t);
1997
+ this[Yr](e, n);
1998
+ });
1999
+ }
2000
+ [Yr](e, t) {
2001
+ this.readdirCache.set(e.absolute, t), e.readdir = t, this[Vr]();
2002
+ }
2003
+ [Vr]() {
2004
+ if (!this[Hr]) {
2005
+ this[Hr] = !0;
2006
+ for (let e = this[X].head; e && this[Z] < this.jobs; e = e.next) if (this[Ur](e.value), e.value.ignore) {
2007
+ let t = e.next;
2008
+ this[X].removeNode(e), e.next = t;
2009
+ }
2010
+ this[Hr] = !1, this[zr] && this[X].length === 0 && this[Z] === 0 && (this.zip ? this.zip.end(Lr) : (super.write(Lr), super.end()));
2011
+ }
2012
+ }
2013
+ get [Br]() {
2014
+ return this[X] && this[X].head && this[X].head.value;
2015
+ }
2016
+ [Wr](e) {
2017
+ this[X].shift(), --this[Z], this[Vr]();
2018
+ }
2019
+ [Ur](e) {
2020
+ if (!e.pending) {
2021
+ if (e.entry) {
2022
+ e === this[Br] && !e.piped && this[Xr](e);
2023
+ return;
2024
+ }
2025
+ if (!e.stat) {
2026
+ let t = this.statCache.get(e.absolute);
2027
+ t ? this[Rr](e, t) : this[qr](e);
2028
+ }
2029
+ if (e.stat && !e.ignore) {
2030
+ if (!this.noDirRecurse && e.stat.isDirectory() && !e.readdir) {
2031
+ let t = this.readdirCache.get(e.absolute);
2032
+ if (t ? this[Yr](e, t) : this[Jr](e), !e.readdir) return;
2033
+ }
2034
+ if (e.entry = this[Zr](e), !e.entry) {
2035
+ e.ignore = !0;
2036
+ return;
2037
+ }
2038
+ e === this[Br] && !e.piped && this[Xr](e);
2039
+ }
2040
+ }
2041
+ }
2042
+ [Qr](e) {
2043
+ return {
2044
+ onwarn: (e, t, n) => this.warn(e, t, n),
2045
+ noPax: this.noPax,
2046
+ cwd: this.cwd,
2047
+ absolute: e.absolute,
2048
+ preservePaths: this.preservePaths,
2049
+ maxReadSize: this.maxReadSize,
2050
+ strict: this.strict,
2051
+ portable: this.portable,
2052
+ linkCache: this.linkCache,
2053
+ statCache: this.statCache,
2054
+ noMtime: this.noMtime,
2055
+ mtime: this.mtime,
2056
+ prefix: this.prefix,
2057
+ onWriteEntry: this.onWriteEntry
2058
+ };
2059
+ }
2060
+ [Zr](e) {
2061
+ this[Z] += 1;
2062
+ try {
2063
+ return new this[$r](e.path, this[Qr](e)).on(`end`, () => this[Wr](e)).on(`error`, (e) => this.emit(`error`, e));
2064
+ } catch (e) {
2065
+ this.emit(`error`, e);
2066
+ }
2067
+ }
2068
+ [ti]() {
2069
+ this[Br] && this[Br].entry && this[Br].entry.resume();
2070
+ }
2071
+ [Xr](e) {
2072
+ e.piped = !0, e.readdir && e.readdir.forEach((t) => {
2073
+ let n = e.path, r = n === `./` ? `` : n.replace(/\/*$/, `/`);
2074
+ this[Gr](r + t);
2075
+ });
2076
+ let t = e.entry, n = this.zip;
2077
+ if (!t) throw Error(`cannot pipe without source`);
2078
+ n ? t.on(`data`, (e) => {
2079
+ n.write(e) || t.pause();
2080
+ }) : t.on(`data`, (e) => {
2081
+ super.write(e) || t.pause();
2082
+ });
2083
+ }
2084
+ pause() {
2085
+ return this.zip && this.zip.pause(), super.pause();
2086
+ }
2087
+ warn(e, t, n = {}) {
2088
+ bn(this, e, t, n);
2089
+ }
2090
+ }, ri = class extends ni {
2091
+ sync = !0;
2092
+ constructor(e) {
2093
+ super(e), this[$r] = Or;
2094
+ }
2095
+ pause() {}
2096
+ resume() {}
2097
+ [qr](e) {
2098
+ let t = this.follow ? `statSync` : `lstatSync`;
2099
+ this[Rr](e, d[t](e.absolute));
2100
+ }
2101
+ [Jr](e) {
2102
+ this[Yr](e, d.readdirSync(e.absolute));
2103
+ }
2104
+ [Xr](e) {
2105
+ let t = e.entry, n = this.zip;
2106
+ if (e.readdir && e.readdir.forEach((t) => {
2107
+ let n = e.path, r = n === `./` ? `` : n.replace(/\/*$/, `/`);
2108
+ this[Gr](r + t);
2109
+ }), !t) throw Error(`Cannot pipe without source`);
2110
+ n ? t.on(`data`, (e) => {
2111
+ n.write(e);
2112
+ }) : t.on(`data`, (e) => {
2113
+ super[ei](e);
2114
+ });
2115
+ }
2116
+ }, ii = (e, t) => {
2117
+ let n = new ri(e), r = new mt(e.file, { mode: e.mode || 438 });
2118
+ n.pipe(r), oi(n, t);
2119
+ }, ai = (e, t) => {
2120
+ let n = new ni(e), r = new pt(e.file, { mode: e.mode || 438 });
2121
+ n.pipe(r);
2122
+ let i = new Promise((e, t) => {
2123
+ r.on(`error`, t), r.on(`close`, e), n.on(`error`, t);
2124
+ });
2125
+ return si(n, t).catch((e) => n.emit(`error`, e)), i;
2126
+ }, oi = (e, t) => {
2127
+ t.forEach((t) => {
2128
+ t.charAt(0) === `@` ? Qn({
2129
+ file: i.resolve(e.cwd, t.slice(1)),
2130
+ sync: !0,
2131
+ noResume: !0,
2132
+ onReadEntry: (t) => e.add(t)
2133
+ }) : e.add(t);
2134
+ }), e.end();
2135
+ }, si = async (e, t) => {
2136
+ for (let n of t) n.charAt(0) === `@` ? await Qn({
2137
+ file: i.resolve(String(e.cwd), n.slice(1)),
2138
+ noResume: !0,
2139
+ onReadEntry: (t) => {
2140
+ e.add(t);
2141
+ }
2142
+ }) : e.add(n);
2143
+ e.end();
2144
+ }, ci = Ct(ii, ai, (e, t) => {
2145
+ let n = new ri(e);
2146
+ return oi(n, t), n;
2147
+ }, (e, t) => {
2148
+ let n = new ni(e);
2149
+ return si(n, t).catch((e) => n.emit(`error`, e)), n;
2150
+ }, (e, t) => {
2151
+ if (!t?.length) throw TypeError(`no paths specified to add to archive`);
2152
+ }), li = (process.env.__FAKE_PLATFORM__ || process.platform) === `win32`, { O_CREAT: ui, O_NOFOLLOW: di, O_TRUNC: fi, O_WRONLY: pi } = d.constants, mi = Number(process.env.__FAKE_FS_O_FILENAME__) || d.constants.UV_FS_O_FILEMAP || 0, hi = li && !!mi, gi = 512 * 1024, _i = mi | fi | ui | pi, vi = !li && typeof di == `number` ? di | fi | ui | pi : null, yi = vi === null ? hi ? (e) => e < gi ? _i : `w` : () => `w` : () => vi, bi = (e, n, r) => {
2153
+ try {
2154
+ return t.lchownSync(e, n, r);
2155
+ } catch (e) {
2156
+ if (e?.code !== `ENOENT`) throw e;
2157
+ }
2158
+ }, xi = (e, n, r, i) => {
2159
+ t.lchown(e, n, r, (e) => {
2160
+ i(e && e?.code !== `ENOENT` ? e : null);
2161
+ });
2162
+ }, Si = (e, t, n, r, a) => {
2163
+ t.isDirectory() ? Ci(i.resolve(e, t.name), n, r, (o) => {
2164
+ if (o) return a(o);
2165
+ xi(i.resolve(e, t.name), n, r, a);
2166
+ }) : xi(i.resolve(e, t.name), n, r, a);
2167
+ }, Ci = (e, n, r, i) => {
2168
+ t.readdir(e, { withFileTypes: !0 }, (t, a) => {
2169
+ if (t) {
2170
+ if (t.code === `ENOENT`) return i();
2171
+ if (t.code !== `ENOTDIR` && t.code !== `ENOTSUP`) return i(t);
2172
+ }
2173
+ if (t || !a.length) return xi(e, n, r, i);
2174
+ let o = a.length, s = null, c = (t) => {
2175
+ if (!s) {
2176
+ if (t) return i(s = t);
2177
+ if (--o === 0) return xi(e, n, r, i);
2178
+ }
2179
+ };
2180
+ for (let t of a) Si(e, t, n, r, c);
2181
+ });
2182
+ }, wi = (e, t, n, r) => {
2183
+ t.isDirectory() && Ti(i.resolve(e, t.name), n, r), bi(i.resolve(e, t.name), n, r);
2184
+ }, Ti = (e, n, r) => {
2185
+ let i;
2186
+ try {
2187
+ i = t.readdirSync(e, { withFileTypes: !0 });
2188
+ } catch (t) {
2189
+ let i = t;
2190
+ if (i?.code === `ENOENT`) return;
2191
+ if (i?.code === `ENOTDIR` || i?.code === `ENOTSUP`) return bi(e, n, r);
2192
+ throw i;
2193
+ }
2194
+ for (let t of i) wi(e, t, n, r);
2195
+ return bi(e, n, r);
2196
+ }, Ei = class extends Error {
2197
+ path;
2198
+ code;
2199
+ syscall = `chdir`;
2200
+ constructor(e, t) {
2201
+ super(`${t}: Cannot cd into '${e}'`), this.path = e, this.code = t;
2202
+ }
2203
+ get name() {
2204
+ return `CwdError`;
2205
+ }
2206
+ }, Di = class extends Error {
2207
+ path;
2208
+ symlink;
2209
+ syscall = `symlink`;
2210
+ code = `TAR_SYMLINK_ERROR`;
2211
+ constructor(e, t) {
2212
+ super(`TAR_SYMLINK_ERROR: Cannot extract through symbolic link`), this.symlink = e, this.path = t;
2213
+ }
2214
+ get name() {
2215
+ return `SymlinkError`;
2216
+ }
2217
+ }, Oi = (e, n) => {
2218
+ t.stat(e, (t, r) => {
2219
+ (t || !r.isDirectory()) && (t = new Ei(e, t?.code || `ENOTDIR`)), n(t);
2220
+ });
2221
+ }, ki = (e, r, a) => {
2222
+ e = z(e);
2223
+ let o = r.umask ?? 18, s = r.mode | 448, c = (s & o) !== 0, l = r.uid, u = r.gid, d = typeof l == `number` && typeof u == `number` && (l !== r.processUid || u !== r.processGid), f = r.preserve, ee = r.unlink, p = z(r.cwd), m = (n, r) => {
2224
+ n ? a(n) : r && d ? Ci(r, l, u, (e) => m(e)) : c ? t.chmod(e, s, a) : a();
2225
+ };
2226
+ if (e === p) return Oi(e, m);
2227
+ if (f) return n.mkdir(e, {
2228
+ mode: s,
2229
+ recursive: !0
2230
+ }).then((e) => m(null, e ?? void 0), m);
2231
+ Ai(p, z(i.relative(p, e)).split(`/`), s, ee, p, void 0, m);
2232
+ }, Ai = (e, n, r, a, o, s, c) => {
2233
+ if (n.length === 0) return c(null, s);
2234
+ let l = n.shift(), u = z(i.resolve(e + `/` + l));
2235
+ t.mkdir(u, r, ji(u, n, r, a, o, s, c));
2236
+ }, ji = (e, n, r, i, a, o, s) => (c) => {
2237
+ c ? t.lstat(e, (l, u) => {
2238
+ if (l) l.path = l.path && z(l.path), s(l);
2239
+ else if (u.isDirectory()) Ai(e, n, r, i, a, o, s);
2240
+ else if (i) t.unlink(e, (c) => {
2241
+ if (c) return s(c);
2242
+ t.mkdir(e, r, ji(e, n, r, i, a, o, s));
2243
+ });
2244
+ else {
2245
+ if (u.isSymbolicLink()) return s(new Di(e, e + `/` + n.join(`/`)));
2246
+ s(c);
2247
+ }
2248
+ }) : (o ||= e, Ai(e, n, r, i, a, o, s));
2249
+ }, Mi = (e) => {
2250
+ let n = !1, r;
2251
+ try {
2252
+ n = t.statSync(e).isDirectory();
2253
+ } catch (e) {
2254
+ r = e?.code;
2255
+ } finally {
2256
+ if (!n) throw new Ei(e, r ?? `ENOTDIR`);
2257
+ }
2258
+ }, Ni = (e, n) => {
2259
+ e = z(e);
2260
+ let r = n.umask ?? 18, a = n.mode | 448, o = (a & r) !== 0, s = n.uid, c = n.gid, l = typeof s == `number` && typeof c == `number` && (s !== n.processUid || c !== n.processGid), u = n.preserve, d = n.unlink, f = z(n.cwd), ee = (n) => {
2261
+ n && l && Ti(n, s, c), o && t.chmodSync(e, a);
2262
+ };
2263
+ if (e === f) return Mi(f), ee();
2264
+ if (u) return ee(t.mkdirSync(e, {
2265
+ mode: a,
2266
+ recursive: !0
2267
+ }) ?? void 0);
2268
+ let p = z(i.relative(f, e)).split(`/`), m;
2269
+ for (let e = p.shift(), n = f; e && (n += `/` + e); e = p.shift()) {
2270
+ n = z(i.resolve(n));
2271
+ try {
2272
+ t.mkdirSync(n, a), m ||= n;
2273
+ } catch {
2274
+ let e = t.lstatSync(n);
2275
+ if (e.isDirectory()) continue;
2276
+ if (d) {
2277
+ t.unlinkSync(n), t.mkdirSync(n, a), m ||= n;
2278
+ continue;
2279
+ } else if (e.isSymbolicLink()) return new Di(n, n + `/` + p.join(`/`));
2280
+ }
2281
+ }
2282
+ return ee(m);
2283
+ }, Pi = Object.create(null), Fi = 1e4, Ii = /* @__PURE__ */ new Set(), Li = (e) => {
2284
+ Ii.has(e) ? Ii.delete(e) : Pi[e] = e.normalize(`NFD`).toLocaleLowerCase(`en`).toLocaleUpperCase(`en`), Ii.add(e);
2285
+ let t = Pi[e], n = Ii.size - Fi;
2286
+ if (n > Fi / 10) {
2287
+ for (let e of Ii) if (Ii.delete(e), delete Pi[e], --n <= 0) break;
2288
+ }
2289
+ return t;
2290
+ }, Ri = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === `win32`, zi = (e) => e.split(`/`).slice(0, -1).reduce((e, t) => {
2291
+ let n = e.at(-1);
2292
+ return n !== void 0 && (t = o(n, t)), e.push(t || `/`), e;
2293
+ }, []), Bi = class {
2294
+ #t = /* @__PURE__ */ new Map();
2295
+ #i = /* @__PURE__ */ new Map();
2296
+ #s = /* @__PURE__ */ new Set();
2297
+ reserve(e, t) {
2298
+ e = Ri ? [`win32 parallelization disabled`] : e.map((e) => Yn(o(Li(e))));
2299
+ let n = new Set(e.map((e) => zi(e)).reduce((e, t) => e.concat(t)));
2300
+ this.#i.set(t, {
2301
+ dirs: n,
2302
+ paths: e
2303
+ });
2304
+ for (let n of e) {
2305
+ let e = this.#t.get(n);
2306
+ e ? e.push(t) : this.#t.set(n, [t]);
2307
+ }
2308
+ for (let e of n) {
2309
+ let n = this.#t.get(e);
2310
+ if (!n) this.#t.set(e, [new Set([t])]);
2311
+ else {
2312
+ let e = n.at(-1);
2313
+ e instanceof Set ? e.add(t) : n.push(new Set([t]));
2314
+ }
2315
+ }
2316
+ return this.#r(t);
2317
+ }
2318
+ #n(e) {
2319
+ let t = this.#i.get(e);
2320
+ if (!t) throw Error(`function does not have any path reservations`);
2321
+ return {
2322
+ paths: t.paths.map((e) => this.#t.get(e)),
2323
+ dirs: [...t.dirs].map((e) => this.#t.get(e))
2324
+ };
2325
+ }
2326
+ check(e) {
2327
+ let { paths: t, dirs: n } = this.#n(e);
2328
+ return t.every((t) => t && t[0] === e) && n.every((t) => t && t[0] instanceof Set && t[0].has(e));
2329
+ }
2330
+ #r(e) {
2331
+ return this.#s.has(e) || !this.check(e) ? !1 : (this.#s.add(e), e(() => this.#e(e)), !0);
2332
+ }
2333
+ #e(e) {
2334
+ if (!this.#s.has(e)) return !1;
2335
+ let t = this.#i.get(e);
2336
+ if (!t) throw Error(`invalid reservation`);
2337
+ let { paths: n, dirs: r } = t, i = /* @__PURE__ */ new Set();
2338
+ for (let t of n) {
2339
+ let n = this.#t.get(t);
2340
+ if (!n || n?.[0] !== e) continue;
2341
+ let r = n[1];
2342
+ if (!r) {
2343
+ this.#t.delete(t);
2344
+ continue;
2345
+ }
2346
+ if (n.shift(), typeof r == `function`) i.add(r);
2347
+ else for (let e of r) i.add(e);
2348
+ }
2349
+ for (let t of r) {
2350
+ let n = this.#t.get(t), r = n?.[0];
2351
+ if (!(!n || !(r instanceof Set))) if (r.size === 1 && n.length === 1) {
2352
+ this.#t.delete(t);
2353
+ continue;
2354
+ } else if (r.size === 1) {
2355
+ n.shift();
2356
+ let e = n[0];
2357
+ typeof e == `function` && i.add(e);
2358
+ } else r.delete(e);
2359
+ }
2360
+ return this.#s.delete(e), i.forEach((e) => this.#r(e)), !0;
2361
+ }
2362
+ }, Vi = () => process.umask(), Hi = Symbol(`onEntry`), Ui = Symbol(`checkFs`), Wi = Symbol(`checkFs2`), Gi = Symbol(`isReusable`), Q = Symbol(`makeFs`), Ki = Symbol(`file`), qi = Symbol(`directory`), Ji = Symbol(`link`), Yi = Symbol(`symlink`), Xi = Symbol(`hardlink`), Zi = Symbol(`ensureNoSymlink`), Qi = Symbol(`unsupported`), $i = Symbol(`checkPath`), ea = Symbol(`stripAbsolutePath`), ta = Symbol(`mkdir`), $ = Symbol(`onError`), na = Symbol(`pending`), ra = Symbol(`pend`), ia = Symbol(`unpend`), aa = Symbol(`ended`), oa = Symbol(`maybeClose`), sa = Symbol(`skip`), ca = Symbol(`doChown`), la = Symbol(`uid`), ua = Symbol(`gid`), da = Symbol(`checkedCwd`), fa = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === `win32`, pa = 1024, ma = (e, n) => {
2363
+ if (!fa) return t.unlink(e, n);
2364
+ let r = e + `.DELETE.` + se(16).toString(`hex`);
2365
+ t.rename(e, r, (e) => {
2366
+ if (e) return n(e);
2367
+ t.unlink(r, n);
2368
+ });
2369
+ }, ha = (e) => {
2370
+ if (!fa) return t.unlinkSync(e);
2371
+ let n = e + `.DELETE.` + se(16).toString(`hex`);
2372
+ t.renameSync(e, n), t.unlinkSync(n);
2373
+ }, ga = (e, t, n) => e !== void 0 && e === e >>> 0 ? e : t !== void 0 && t === t >>> 0 ? t : n, _a = class extends Jn {
2374
+ [aa] = !1;
2375
+ [da] = !1;
2376
+ [na] = 0;
2377
+ reservations = new Bi();
2378
+ transform;
2379
+ writable = !0;
2380
+ readable = !1;
2381
+ uid;
2382
+ gid;
2383
+ setOwner;
2384
+ preserveOwner;
2385
+ processGid;
2386
+ processUid;
2387
+ maxDepth;
2388
+ forceChown;
2389
+ win32;
2390
+ newer;
2391
+ keep;
2392
+ noMtime;
2393
+ preservePaths;
2394
+ unlink;
2395
+ cwd;
2396
+ strip;
2397
+ processUmask;
2398
+ umask;
2399
+ dmode;
2400
+ fmode;
2401
+ chmod;
2402
+ constructor(e = {}) {
2403
+ if (e.ondone = () => {
2404
+ this[aa] = !0, this[oa]();
2405
+ }, super(e), this.transform = e.transform, this.chmod = !!e.chmod, typeof e.uid == `number` || typeof e.gid == `number`) {
2406
+ if (typeof e.uid != `number` || typeof e.gid != `number`) throw TypeError(`cannot set owner without number uid and gid`);
2407
+ if (e.preserveOwner) throw TypeError(`cannot preserve owner in archive and also set owner explicitly`);
2408
+ this.uid = e.uid, this.gid = e.gid, this.setOwner = !0;
2409
+ } else this.uid = void 0, this.gid = void 0, this.setOwner = !1;
2410
+ this.preserveOwner = e.preserveOwner === void 0 && typeof e.uid != `number` ? !!(process.getuid && process.getuid() === 0) : !!e.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 e.maxDepth == `number` ? e.maxDepth : pa, this.forceChown = e.forceChown === !0, this.win32 = !!e.win32 || fa, this.newer = !!e.newer, this.keep = !!e.keep, this.noMtime = !!e.noMtime, this.preservePaths = !!e.preservePaths, this.unlink = !!e.unlink, this.cwd = z(i.resolve(e.cwd || process.cwd())), this.strip = Number(e.strip) || 0, this.processUmask = this.chmod ? typeof e.processUmask == `number` ? e.processUmask : Vi() : 0, this.umask = typeof e.umask == `number` ? e.umask : this.processUmask, this.dmode = e.dmode || 511 & ~this.umask, this.fmode = e.fmode || 438 & ~this.umask, this.on(`entry`, (e) => this[Hi](e));
2411
+ }
2412
+ warn(e, t, n = {}) {
2413
+ return (e === `TAR_BAD_ARCHIVE` || e === `TAR_ABORT`) && (n.recoverable = !1), super.warn(e, t, n);
2414
+ }
2415
+ [oa]() {
2416
+ this[aa] && this[na] === 0 && (this.emit(`prefinish`), this.emit(`finish`), this.emit(`end`));
2417
+ }
2418
+ [ea](e, t) {
2419
+ let n = e[t], { type: r } = e;
2420
+ if (!n || this.preservePaths) return !0;
2421
+ let [a, o] = nr(n), s = o.replaceAll(/\\/g, `/`).split(`/`);
2422
+ if (s.includes(`..`) || fa && /^[a-z]:\.\.$/i.test(s[0] ?? ``)) {
2423
+ if (t === `path` || r === `Link`) return this.warn(`TAR_ENTRY_ERROR`, `${t} contains '..'`, {
2424
+ entry: e,
2425
+ [t]: n
2426
+ }), !1;
2427
+ let a = i.posix.dirname(e.path), o = i.posix.normalize(i.posix.join(a, s.join(`/`)));
2428
+ if (o.startsWith(`../`) || o === `..`) return this.warn(`TAR_ENTRY_ERROR`, `${t} escapes extraction directory`, {
2429
+ entry: e,
2430
+ [t]: n
2431
+ }), !1;
2432
+ }
2433
+ return a && (e[t] = String(o), this.warn(`TAR_ENTRY_INFO`, `stripping ${a} from absolute ${t}`, {
2434
+ entry: e,
2435
+ [t]: n
2436
+ })), !0;
2437
+ }
2438
+ [$i](e) {
2439
+ let t = z(e.path), n = t.split(`/`);
2440
+ if (this.strip) {
2441
+ if (n.length < this.strip) return !1;
2442
+ if (e.type === `Link`) {
2443
+ let t = z(String(e.linkpath)).split(`/`);
2444
+ if (t.length >= this.strip) e.linkpath = t.slice(this.strip).join(`/`);
2445
+ else return !1;
2446
+ }
2447
+ n.splice(0, this.strip), e.path = n.join(`/`);
2448
+ }
2449
+ if (isFinite(this.maxDepth) && n.length > this.maxDepth) return this.warn(`TAR_ENTRY_ERROR`, `path excessively deep`, {
2450
+ entry: e,
2451
+ path: t,
2452
+ depth: n.length,
2453
+ maxDepth: this.maxDepth
2454
+ }), !1;
2455
+ if (!this[ea](e, `path`) || !this[ea](e, `linkpath`)) return !1;
2456
+ if (e.absolute = i.isAbsolute(e.path) ? z(i.resolve(e.path)) : z(i.resolve(this.cwd, e.path)), !this.preservePaths && typeof e.absolute == `string` && e.absolute.indexOf(this.cwd + `/`) !== 0 && e.absolute !== this.cwd) return this.warn(`TAR_ENTRY_ERROR`, `path escaped extraction target`, {
2457
+ entry: e,
2458
+ path: z(e.path),
2459
+ resolvedPath: e.absolute,
2460
+ cwd: this.cwd
2461
+ }), !1;
2462
+ if (e.absolute === this.cwd && e.type !== `Directory` && e.type !== `GNUDumpDir`) return !1;
2463
+ if (this.win32) {
2464
+ let { root: t } = i.win32.parse(String(e.absolute));
2465
+ e.absolute = t + sr(String(e.absolute).slice(t.length));
2466
+ let { root: n } = i.win32.parse(e.path);
2467
+ e.path = n + sr(e.path.slice(n.length));
2468
+ }
2469
+ return !0;
2470
+ }
2471
+ [Hi](e) {
2472
+ if (!this[$i](e)) return e.resume();
2473
+ switch (oe.equal(typeof e.absolute, `string`), e.type) {
2474
+ case `Directory`:
2475
+ case `GNUDumpDir`: e.mode && (e.mode |= 448);
2476
+ case `File`:
2477
+ case `OldFile`:
2478
+ case `ContiguousFile`:
2479
+ case `Link`:
2480
+ case `SymbolicLink`: return this[Ui](e);
2481
+ default: return this[Qi](e);
2482
+ }
2483
+ }
2484
+ [$](e, t) {
2485
+ e.name === `CwdError` ? this.emit(`error`, e) : (this.warn(`TAR_ENTRY_ERROR`, e, { entry: t }), this[ia](), t.resume());
2486
+ }
2487
+ [ta](e, t, n) {
2488
+ ki(z(e), {
2489
+ uid: this.uid,
2490
+ gid: this.gid,
2491
+ processUid: this.processUid,
2492
+ processGid: this.processGid,
2493
+ umask: this.processUmask,
2494
+ preserve: this.preservePaths,
2495
+ unlink: this.unlink,
2496
+ cwd: this.cwd,
2497
+ mode: t
2498
+ }, n);
2499
+ }
2500
+ [ca](e) {
2501
+ return this.forceChown || this.preserveOwner && (typeof e.uid == `number` && e.uid !== this.processUid || typeof e.gid == `number` && e.gid !== this.processGid) || typeof this.uid == `number` && this.uid !== this.processUid || typeof this.gid == `number` && this.gid !== this.processGid;
2502
+ }
2503
+ [la](e) {
2504
+ return ga(this.uid, e.uid, this.processUid);
2505
+ }
2506
+ [ua](e) {
2507
+ return ga(this.gid, e.gid, this.processGid);
2508
+ }
2509
+ [Ki](e, n) {
2510
+ let r = typeof e.mode == `number` ? e.mode & 4095 : this.fmode, i = new pt(String(e.absolute), {
2511
+ flags: yi(e.size),
2512
+ mode: r,
2513
+ autoClose: !1
2514
+ });
2515
+ i.on(`error`, (r) => {
2516
+ i.fd && t.close(i.fd, () => {}), i.write = () => !0, this[$](r, e), n();
2517
+ });
2518
+ let a = 1, o = (r) => {
2519
+ if (r) {
2520
+ i.fd && t.close(i.fd, () => {}), this[$](r, e), n();
2521
+ return;
2522
+ }
2523
+ --a === 0 && i.fd !== void 0 && t.close(i.fd, (t) => {
2524
+ t ? this[$](t, e) : this[ia](), n();
2525
+ });
2526
+ };
2527
+ i.on(`finish`, () => {
2528
+ let n = String(e.absolute), r = i.fd;
2529
+ if (typeof r == `number` && e.mtime && !this.noMtime) {
2530
+ a++;
2531
+ let i = e.atime || /* @__PURE__ */ new Date(), s = e.mtime;
2532
+ t.futimes(r, i, s, (e) => e ? t.utimes(n, i, s, (t) => o(t && e)) : o());
2533
+ }
2534
+ if (typeof r == `number` && this[ca](e)) {
2535
+ a++;
2536
+ let i = this[la](e), s = this[ua](e);
2537
+ typeof i == `number` && typeof s == `number` && t.fchown(r, i, s, (e) => e ? t.chown(n, i, s, (t) => o(t && e)) : o());
2538
+ }
2539
+ o();
2540
+ });
2541
+ let s = this.transform && this.transform(e) || e;
2542
+ s !== e && (s.on(`error`, (t) => {
2543
+ this[$](t, e), n();
2544
+ }), e.pipe(s)), s.pipe(i);
2545
+ }
2546
+ [qi](e, n) {
2547
+ let r = typeof e.mode == `number` ? e.mode & 4095 : this.dmode;
2548
+ this[ta](String(e.absolute), r, (r) => {
2549
+ if (r) {
2550
+ this[$](r, e), n();
2551
+ return;
2552
+ }
2553
+ let i = 1, a = () => {
2554
+ --i === 0 && (n(), this[ia](), e.resume());
2555
+ };
2556
+ e.mtime && !this.noMtime && (i++, t.utimes(String(e.absolute), e.atime || /* @__PURE__ */ new Date(), e.mtime, a)), this[ca](e) && (i++, t.chown(String(e.absolute), Number(this[la](e)), Number(this[ua](e)), a)), a();
2557
+ });
2558
+ }
2559
+ [Qi](e) {
2560
+ e.unsupported = !0, this.warn(`TAR_ENTRY_UNSUPPORTED`, `unsupported entry type: ${e.type}`, { entry: e }), e.resume();
2561
+ }
2562
+ [Yi](e, t) {
2563
+ let n = z(i.relative(this.cwd, i.resolve(i.dirname(String(e.absolute)), String(e.linkpath)))).split(`/`);
2564
+ this[Zi](e, this.cwd, n, () => this[Ji](e, String(e.linkpath), `symlink`, t), (n) => {
2565
+ this[$](n, e), t();
2566
+ });
2567
+ }
2568
+ [Xi](e, t) {
2569
+ let n = z(i.resolve(this.cwd, String(e.linkpath))), r = z(String(e.linkpath)).split(`/`);
2570
+ this[Zi](e, this.cwd, r, () => this[Ji](e, n, `link`, t), (n) => {
2571
+ this[$](n, e), t();
2572
+ });
2573
+ }
2574
+ [Zi](e, n, r, a, o) {
2575
+ let s = r.shift();
2576
+ if (this.preservePaths || s === void 0) return a();
2577
+ let c = i.resolve(n, s);
2578
+ t.lstat(c, (t, n) => {
2579
+ if (t) return a();
2580
+ if (n?.isSymbolicLink()) return o(new Di(c, i.resolve(c, r.join(`/`))));
2581
+ this[Zi](e, c, r, a, o);
2582
+ });
2583
+ }
2584
+ [ra]() {
2585
+ this[na]++;
2586
+ }
2587
+ [ia]() {
2588
+ this[na]--, this[oa]();
2589
+ }
2590
+ [sa](e) {
2591
+ this[ia](), e.resume();
2592
+ }
2593
+ [Gi](e, t) {
2594
+ return e.type === `File` && !this.unlink && t.isFile() && t.nlink <= 1 && !fa;
2595
+ }
2596
+ [Ui](e) {
2597
+ this[ra]();
2598
+ let t = [e.path];
2599
+ e.linkpath && t.push(e.linkpath), this.reservations.reserve(t, (t) => this[Wi](e, t));
2600
+ }
2601
+ [Wi](e, n) {
2602
+ let r = (e) => {
2603
+ n(e);
2604
+ }, a = () => {
2605
+ this[ta](this.cwd, this.dmode, (t) => {
2606
+ if (t) {
2607
+ this[$](t, e), r();
2608
+ return;
2609
+ }
2610
+ this[da] = !0, o();
2611
+ });
2612
+ }, o = () => {
2613
+ if (e.absolute !== this.cwd) {
2614
+ let t = z(i.dirname(String(e.absolute)));
2615
+ if (t !== this.cwd) return this[ta](t, this.dmode, (t) => {
2616
+ if (t) {
2617
+ this[$](t, e), r();
2618
+ return;
2619
+ }
2620
+ s();
2621
+ });
2622
+ }
2623
+ s();
2624
+ }, s = () => {
2625
+ t.lstat(String(e.absolute), (n, i) => {
2626
+ if (i && (this.keep || this.newer && i.mtime > (e.mtime ?? i.mtime))) {
2627
+ this[sa](e), r();
2628
+ return;
2629
+ }
2630
+ if (n || this[Gi](e, i)) return this[Q](null, e, r);
2631
+ if (i.isDirectory()) {
2632
+ if (e.type === `Directory`) {
2633
+ let n = this.chmod && e.mode && (i.mode & 4095) !== e.mode, a = (t) => this[Q](t ?? null, e, r);
2634
+ return n ? t.chmod(String(e.absolute), Number(e.mode), a) : a();
2635
+ }
2636
+ if (e.absolute !== this.cwd) return t.rmdir(String(e.absolute), (t) => this[Q](t ?? null, e, r));
2637
+ }
2638
+ if (e.absolute === this.cwd) return this[Q](null, e, r);
2639
+ ma(String(e.absolute), (t) => this[Q](t ?? null, e, r));
2640
+ });
2641
+ };
2642
+ this[da] ? o() : a();
2643
+ }
2644
+ [Q](e, t, n) {
2645
+ if (e) {
2646
+ this[$](e, t), n();
2647
+ return;
2648
+ }
2649
+ switch (t.type) {
2650
+ case `File`:
2651
+ case `OldFile`:
2652
+ case `ContiguousFile`: return this[Ki](t, n);
2653
+ case `Link`: return this[Xi](t, n);
2654
+ case `SymbolicLink`: return this[Yi](t, n);
2655
+ case `Directory`:
2656
+ case `GNUDumpDir`: return this[qi](t, n);
2657
+ }
2658
+ }
2659
+ [Ji](e, n, r, i) {
2660
+ t[r](n, String(e.absolute), (t) => {
2661
+ t ? this[$](t, e) : (this[ia](), e.resume()), i();
2662
+ });
2663
+ }
2664
+ }, va = (e) => {
2665
+ try {
2666
+ return [null, e()];
2667
+ } catch (e) {
2668
+ return [e, null];
2669
+ }
2670
+ }, ya = class extends _a {
2671
+ sync = !0;
2672
+ [Q](e, t) {
2673
+ return super[Q](e, t, () => {});
2674
+ }
2675
+ [Ui](e) {
2676
+ if (!this[da]) {
2677
+ let t = this[ta](this.cwd, this.dmode);
2678
+ if (t) return this[$](t, e);
2679
+ this[da] = !0;
2680
+ }
2681
+ if (e.absolute !== this.cwd) {
2682
+ let t = z(i.dirname(String(e.absolute)));
2683
+ if (t !== this.cwd) {
2684
+ let n = this[ta](t, this.dmode);
2685
+ if (n) return this[$](n, e);
2686
+ }
2687
+ }
2688
+ let [n, r] = va(() => t.lstatSync(String(e.absolute)));
2689
+ if (r && (this.keep || this.newer && r.mtime > (e.mtime ?? r.mtime))) return this[sa](e);
2690
+ if (n || this[Gi](e, r)) return this[Q](null, e);
2691
+ if (r.isDirectory()) {
2692
+ if (e.type === `Directory`) {
2693
+ let [n] = this.chmod && e.mode && (r.mode & 4095) !== e.mode ? va(() => {
2694
+ t.chmodSync(String(e.absolute), Number(e.mode));
2695
+ }) : [];
2696
+ return this[Q](n, e);
2697
+ }
2698
+ let [n] = va(() => t.rmdirSync(String(e.absolute)));
2699
+ this[Q](n, e);
2700
+ }
2701
+ let [a] = e.absolute === this.cwd ? [] : va(() => ha(String(e.absolute)));
2702
+ this[Q](a, e);
2703
+ }
2704
+ [Ki](e, n) {
2705
+ let r = typeof e.mode == `number` ? e.mode & 4095 : this.fmode, i = (r) => {
2706
+ let i;
2707
+ try {
2708
+ t.closeSync(a);
2709
+ } catch (e) {
2710
+ i = e;
2711
+ }
2712
+ (r || i) && this[$](r || i, e), n();
2713
+ }, a;
2714
+ try {
2715
+ a = t.openSync(String(e.absolute), yi(e.size), r);
2716
+ } catch (e) {
2717
+ return i(e);
2718
+ }
2719
+ let o = this.transform && this.transform(e) || e;
2720
+ o !== e && (o.on(`error`, (t) => this[$](t, e)), e.pipe(o)), o.on(`data`, (e) => {
2721
+ try {
2722
+ t.writeSync(a, e, 0, e.length);
2723
+ } catch (e) {
2724
+ i(e);
2725
+ }
2726
+ }), o.on(`end`, () => {
2727
+ let n = null;
2728
+ if (e.mtime && !this.noMtime) {
2729
+ let r = e.atime || /* @__PURE__ */ new Date(), i = e.mtime;
2730
+ try {
2731
+ t.futimesSync(a, r, i);
2732
+ } catch (a) {
2733
+ try {
2734
+ t.utimesSync(String(e.absolute), r, i);
2735
+ } catch {
2736
+ n = a;
2737
+ }
2738
+ }
2739
+ }
2740
+ if (this[ca](e)) {
2741
+ let r = this[la](e), i = this[ua](e);
2742
+ try {
2743
+ t.fchownSync(a, Number(r), Number(i));
2744
+ } catch (a) {
2745
+ try {
2746
+ t.chownSync(String(e.absolute), Number(r), Number(i));
2747
+ } catch {
2748
+ n ||= a;
2749
+ }
2750
+ }
2751
+ }
2752
+ i(n);
2753
+ });
2754
+ }
2755
+ [qi](e, n) {
2756
+ let r = typeof e.mode == `number` ? e.mode & 4095 : this.dmode, i = this[ta](String(e.absolute), r);
2757
+ if (i) {
2758
+ this[$](i, e), n();
2759
+ return;
2760
+ }
2761
+ if (e.mtime && !this.noMtime) try {
2762
+ t.utimesSync(String(e.absolute), e.atime || /* @__PURE__ */ new Date(), e.mtime);
2763
+ } catch {}
2764
+ if (this[ca](e)) try {
2765
+ t.chownSync(String(e.absolute), Number(this[la](e)), Number(this[ua](e)));
2766
+ } catch {}
2767
+ n(), e.resume();
2768
+ }
2769
+ [ta](e, t) {
2770
+ try {
2771
+ return Ni(z(e), {
2772
+ uid: this.uid,
2773
+ gid: this.gid,
2774
+ processUid: this.processUid,
2775
+ processGid: this.processGid,
2776
+ umask: this.processUmask,
2777
+ preserve: this.preservePaths,
2778
+ unlink: this.unlink,
2779
+ cwd: this.cwd,
2780
+ mode: t
2781
+ });
2782
+ } catch (e) {
2783
+ return e;
2784
+ }
2785
+ }
2786
+ [Zi](e, n, r, a, o) {
2787
+ if (this.preservePaths || r.length === 0) return a();
2788
+ let s = n;
2789
+ for (let e of r) {
2790
+ s = i.resolve(s, e);
2791
+ let [c, l] = va(() => t.lstatSync(s));
2792
+ if (c) return a();
2793
+ if (l.isSymbolicLink()) return o(new Di(s, i.resolve(n, r.join(`/`))));
2794
+ }
2795
+ a();
2796
+ }
2797
+ [Ji](e, n, r, i) {
2798
+ let a = `${r}Sync`;
2799
+ try {
2800
+ t[a](n, String(e.absolute)), i(), e.resume();
2801
+ } catch (t) {
2802
+ return this[$](t, e);
2803
+ }
2804
+ }
2805
+ }, ba = Ct((e) => {
2806
+ let n = new ya(e), r = e.file, i = t.statSync(r);
2807
+ new ft(r, {
2808
+ readSize: e.maxReadSize || 16 * 1024 * 1024,
2809
+ size: i.size
2810
+ }).pipe(n);
2811
+ }, (e, n) => {
2812
+ let r = new _a(e), i = e.maxReadSize || 16 * 1024 * 1024, a = e.file;
2813
+ return new Promise((e, n) => {
2814
+ r.on(`error`, n), r.on(`close`, e), t.stat(a, (e, t) => {
2815
+ if (e) n(e);
2816
+ else {
2817
+ let e = new dt(a, {
2818
+ readSize: i,
2819
+ size: t.size
2820
+ });
2821
+ e.on(`error`, n), e.pipe(r);
2822
+ }
2823
+ });
2824
+ });
2825
+ }, (e) => new ya(e), (e) => new _a(e), (e, t) => {
2826
+ t?.length && Zn(e, t);
2827
+ }), xa = (e, n) => {
2828
+ let r = new ri(e), i = !0, a, o;
2829
+ try {
2830
+ try {
2831
+ a = t.openSync(e.file, `r+`);
2832
+ } catch (n) {
2833
+ if (n?.code === `ENOENT`) a = t.openSync(e.file, `w+`);
2834
+ else throw n;
2835
+ }
2836
+ let s = t.fstatSync(a), c = Buffer.alloc(512);
2837
+ t: for (o = 0; o < s.size; o += 512) {
2838
+ for (let e = 0, n = 0; e < 512; e += n) {
2839
+ if (n = t.readSync(a, c, e, c.length - e, o + e), o === 0 && c[0] === 31 && c[1] === 139) throw Error(`cannot append to compressed archives`);
2840
+ if (!n) break t;
2841
+ }
2842
+ let n = new I(c);
2843
+ if (!n.cksumValid) break;
2844
+ let r = 512 * Math.ceil((n.size || 0) / 512);
2845
+ if (o + r + 512 > s.size) break;
2846
+ o += r, e.mtimeCache && n.mtime && e.mtimeCache.set(String(n.path), n.mtime);
2847
+ }
2848
+ i = !1, Sa(e, r, o, a, n);
2849
+ } finally {
2850
+ if (i) try {
2851
+ t.closeSync(a);
2852
+ } catch {}
2853
+ }
2854
+ }, Sa = (e, t, n, r, i) => {
2855
+ let a = new mt(e.file, {
2856
+ fd: r,
2857
+ start: n
2858
+ });
2859
+ t.pipe(a), wa(t, i);
2860
+ }, Ca = (e, n) => {
2861
+ n = Array.from(n);
2862
+ let r = new ni(e), i = (n, r, i) => {
2863
+ let a = (e, r) => {
2864
+ e ? t.close(n, (t) => i(e)) : i(null, r);
2865
+ }, o = 0;
2866
+ if (r === 0) return a(null, 0);
2867
+ let s = 0, c = Buffer.alloc(512), l = (i, u) => {
2868
+ if (i || u === void 0) return a(i);
2869
+ if (s += u, s < 512 && u) return t.read(n, c, s, c.length - s, o + s, l);
2870
+ if (o === 0 && c[0] === 31 && c[1] === 139) return a(Error(`cannot append to compressed archives`));
2871
+ if (s < 512) return a(null, o);
2872
+ let d = new I(c);
2873
+ if (!d.cksumValid) return a(null, o);
2874
+ let f = 512 * Math.ceil((d.size ?? 0) / 512);
2875
+ if (o + f + 512 > r || (o += f + 512, o >= r)) return a(null, o);
2876
+ e.mtimeCache && d.mtime && e.mtimeCache.set(String(d.path), d.mtime), s = 0, t.read(n, c, 0, 512, o, l);
2877
+ };
2878
+ t.read(n, c, 0, 512, o, l);
2879
+ };
2880
+ return new Promise((a, o) => {
2881
+ r.on(`error`, o);
2882
+ let s = `r+`, c = (l, u) => {
2883
+ if (l && l.code === `ENOENT` && s === `r+`) return s = `w+`, t.open(e.file, s, c);
2884
+ if (l || !u) return o(l);
2885
+ t.fstat(u, (s, c) => {
2886
+ if (s) return t.close(u, () => o(s));
2887
+ i(u, c.size, (t, i) => {
2888
+ if (t) return o(t);
2889
+ let s = new pt(e.file, {
2890
+ fd: u,
2891
+ start: i
2892
+ });
2893
+ r.pipe(s), s.on(`error`, o), s.on(`close`, a), Ta(r, n);
2894
+ });
2895
+ });
2896
+ };
2897
+ t.open(e.file, s, c);
2898
+ });
2899
+ }, wa = (e, t) => {
2900
+ t.forEach((t) => {
2901
+ t.charAt(0) === `@` ? Qn({
2902
+ file: i.resolve(e.cwd, t.slice(1)),
2903
+ sync: !0,
2904
+ noResume: !0,
2905
+ onReadEntry: (t) => e.add(t)
2906
+ }) : e.add(t);
2907
+ }), e.end();
2908
+ }, Ta = async (e, t) => {
2909
+ for (let n of t) n.charAt(0) === `@` ? await Qn({
2910
+ file: i.resolve(String(e.cwd), n.slice(1)),
2911
+ noResume: !0,
2912
+ onReadEntry: (t) => e.add(t)
2913
+ }) : e.add(n);
2914
+ e.end();
2915
+ }, Ea = Ct(xa, Ca, () => {
2916
+ throw TypeError(`file is required`);
2917
+ }, () => {
2918
+ throw TypeError(`file is required`);
2919
+ }, (e, t) => {
2920
+ if (!bt(e)) throw TypeError(`file is required`);
2921
+ if (e.gzip || e.brotli || e.zstd || e.file.endsWith(`.br`) || e.file.endsWith(`.tbr`)) throw TypeError(`cannot append to compressed archives`);
2922
+ if (!t?.length) throw TypeError(`no paths specified to add/replace`);
2923
+ });
2924
+ Ct(Ea.syncFile, Ea.asyncFile, Ea.syncNoFile, Ea.asyncNoFile, (e, t = []) => {
2925
+ Ea.validate?.(e, t), Da(e);
2926
+ });
2927
+ var Da = (e) => {
2928
+ let t = e.filter;
2929
+ e.mtimeCache ||= /* @__PURE__ */ new Map(), e.filter = t ? (n, r) => t(n, r) && !((e.mtimeCache?.get(n) ?? r.mtime ?? 0) > (r.mtime ?? 0)) : (t, n) => !((e.mtimeCache?.get(t) ?? n.mtime ?? 0) > (n.mtime ?? 0));
2930
+ };
2931
+ export { ce as t };