@powerlines/plugin-env 0.15.13 → 0.15.14

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 (267) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +4 -0
  2. package/dist/_virtual/rolldown_runtime.mjs +33 -0
  3. package/dist/babel/plugin.cjs +16 -16
  4. package/dist/babel/plugin.d.mts +2 -2
  5. package/dist/babel/plugin.mjs +7 -7
  6. package/dist/components/docs.cjs +8 -8
  7. package/dist/components/docs.mjs +5 -5
  8. package/dist/components/env.cjs +38 -39
  9. package/dist/components/env.d.mts +2 -2
  10. package/dist/components/env.mjs +11 -11
  11. package/dist/helpers/automd-generator.cjs +4 -4
  12. package/dist/helpers/automd-generator.d.mts +1 -1
  13. package/dist/helpers/automd-generator.mjs +3 -3
  14. package/dist/helpers/load.cjs +12 -13
  15. package/dist/helpers/load.d.mts +2 -2
  16. package/dist/helpers/load.mjs +10 -10
  17. package/dist/helpers/persistence.cjs +23 -23
  18. package/dist/helpers/persistence.d.mts +1 -1
  19. package/dist/helpers/persistence.mjs +7 -7
  20. package/dist/helpers/reflect.cjs +9 -9
  21. package/dist/helpers/reflect.mjs +5 -5
  22. package/dist/helpers/source-file-env.cjs +1 -1
  23. package/dist/helpers/source-file-env.mjs +1 -1
  24. package/dist/index.cjs +28 -26
  25. package/dist/index.d.mts +1 -1
  26. package/dist/index.mjs +25 -25
  27. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/parse-type-definition.cjs +31 -0
  28. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/parse-type-definition.mjs +31 -0
  29. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/to-array.cjs +8 -0
  30. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/to-array.mjs +7 -0
  31. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.cjs +6 -0
  32. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs +5 -0
  33. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/index.cjs +3 -0
  34. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/index.mjs +5 -0
  35. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.cjs +6 -0
  36. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs +6 -0
  37. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-collection.cjs +1 -0
  38. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-collection.mjs +3 -0
  39. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-object.cjs +13 -0
  40. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs +13 -0
  41. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.cjs +13 -0
  42. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs +13 -0
  43. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-string.cjs +12 -0
  44. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs +11 -0
  45. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/type-detect.cjs +11 -0
  46. package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs +12 -0
  47. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/is-parent-path.cjs +10 -0
  48. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/is-parent-path.mjs +10 -0
  49. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/is-type.cjs +13 -0
  50. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/is-type.mjs +13 -0
  51. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/join-paths.cjs +49 -0
  52. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/join-paths.mjs +49 -0
  53. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/regex.cjs +9 -0
  54. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/regex.mjs +5 -0
  55. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/slash.cjs +8 -0
  56. package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/slash.mjs +7 -0
  57. package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.cjs +346 -0
  58. package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs +346 -0
  59. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.cjs +786 -0
  60. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.mjs +786 -0
  61. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.cjs +3 -0
  62. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.mjs +3 -0
  63. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs +23 -0
  64. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs +22 -0
  65. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs +405 -0
  66. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs +404 -0
  67. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.cjs +657 -0
  68. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.mjs +657 -0
  69. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.cjs +1054 -0
  70. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.mjs +1054 -0
  71. package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +43 -0
  72. package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +42 -0
  73. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +46 -0
  74. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +45 -0
  75. package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.cjs +288 -0
  76. package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.mjs +285 -0
  77. package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.cjs +71 -0
  78. package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.mjs +68 -0
  79. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +1013 -0
  80. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +1007 -0
  81. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +23 -0
  82. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +13 -0
  83. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +2698 -0
  84. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +2685 -0
  85. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs +4457 -0
  86. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs +4454 -0
  87. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +29 -0
  88. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +29 -0
  89. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +181 -0
  90. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +176 -0
  91. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +22 -0
  92. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +17 -0
  93. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +3967 -0
  94. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +3962 -0
  95. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +11768 -0
  96. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +11763 -0
  97. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +25 -0
  98. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +20 -0
  99. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +20 -0
  100. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +17 -0
  101. package/dist/node_modules/.pnpm/nypm@0.6.2/node_modules/nypm/dist/shared/nypm.CLjaS_sz.cjs +174 -0
  102. package/dist/node_modules/.pnpm/nypm@0.6.2/node_modules/nypm/dist/shared/nypm.CLjaS_sz.mjs +172 -0
  103. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs +13 -0
  104. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs +12 -0
  105. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.cjs +3 -0
  106. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs +3 -0
  107. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +145 -0
  108. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +138 -0
  109. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +127 -0
  110. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +125 -0
  111. package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +138 -0
  112. package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +136 -0
  113. package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +629 -0
  114. package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +627 -0
  115. package/dist/{plugin-alloy → packages/plugin-alloy}/src/types/components.d.mts +1 -1
  116. package/dist/{plugin-alloy → packages/plugin-alloy}/src/typescript/components/typescript-file.d.mts +1 -1
  117. package/dist/{plugin-alloy → packages/plugin-alloy}/src/typescript/components/typescript-interface.d.mts +1 -1
  118. package/dist/{powerlines → packages/powerlines}/src/types/build.d.mts +6 -6
  119. package/dist/{powerlines → packages/powerlines}/src/types/config.d.mts +1 -2
  120. package/dist/{powerlines → packages/powerlines}/src/types/tsconfig.d.mts +1 -1
  121. package/dist/types/plugin.cjs +19 -18
  122. package/dist/types/plugin.d.mts +6 -6
  123. package/dist/types/plugin.mjs +4 -4
  124. package/dist/types/runtime.cjs +3 -2
  125. package/dist/types/runtime.d.mts +1 -1
  126. package/dist/types/runtime.mjs +1 -1
  127. package/package.json +10 -10
  128. package/dist/deepkit/schemas/reflection.cjs +0 -5368
  129. package/dist/deepkit/schemas/reflection.mjs +0 -5365
  130. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  131. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  132. package/dist/deepkit/src/capnp.cjs +0 -1692
  133. package/dist/deepkit/src/capnp.mjs +0 -1690
  134. package/dist/deepkit/src/esbuild-plugin.cjs +0 -99
  135. package/dist/deepkit/src/esbuild-plugin.mjs +0 -98
  136. package/dist/deepkit/src/reflect-type.cjs +0 -40
  137. package/dist/deepkit/src/reflect-type.mjs +0 -38
  138. package/dist/deepkit/src/resolve-reflections.cjs +0 -23
  139. package/dist/deepkit/src/resolve-reflections.mjs +0 -22
  140. package/dist/deepkit/src/transformer.cjs +0 -92
  141. package/dist/deepkit/src/transformer.mjs +0 -89
  142. package/dist/deepkit/src/transpile.cjs +0 -39
  143. package/dist/deepkit/src/transpile.mjs +0 -37
  144. package/dist/deepkit/src/types.cjs +0 -22
  145. package/dist/deepkit/src/types.mjs +0 -21
  146. package/dist/deepkit/src/utilities.cjs +0 -182
  147. package/dist/deepkit/src/utilities.mjs +0 -181
  148. package/dist/plugin-alloy/src/core/components/output.cjs +0 -45
  149. package/dist/plugin-alloy/src/core/components/output.mjs +0 -44
  150. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
  151. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
  152. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
  153. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
  154. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -136
  155. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -128
  156. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  157. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  158. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -110
  159. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -101
  160. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -23
  161. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -22
  162. package/dist/plugin-alloy/src/index.cjs +0 -106
  163. package/dist/plugin-alloy/src/index.mjs +0 -104
  164. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
  165. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
  166. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
  167. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
  168. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -72
  169. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -71
  170. package/dist/plugin-alloy/src/types/components.cjs +0 -22
  171. package/dist/plugin-alloy/src/types/components.mjs +0 -21
  172. package/dist/plugin-alloy/src/types/plugin.cjs +0 -55
  173. package/dist/plugin-alloy/src/types/plugin.mjs +0 -52
  174. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -57
  175. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -56
  176. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -126
  177. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -124
  178. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -442
  179. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -433
  180. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -212
  181. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -209
  182. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -68
  183. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -67
  184. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
  185. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
  186. package/dist/plugin-automd/src/index.cjs +0 -127
  187. package/dist/plugin-automd/src/index.mjs +0 -124
  188. package/dist/plugin-automd/src/types/plugin.cjs +0 -47
  189. package/dist/plugin-automd/src/types/plugin.mjs +0 -47
  190. package/dist/plugin-automd/src/types/toc.cjs +0 -26
  191. package/dist/plugin-automd/src/types/toc.mjs +0 -25
  192. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -74
  193. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -70
  194. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -71
  195. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -69
  196. package/dist/plugin-babel/src/helpers/filters.cjs +0 -158
  197. package/dist/plugin-babel/src/helpers/filters.mjs +0 -154
  198. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  199. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  200. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -200
  201. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -192
  202. package/dist/plugin-babel/src/helpers/options.cjs +0 -74
  203. package/dist/plugin-babel/src/helpers/options.mjs +0 -71
  204. package/dist/plugin-babel/src/index.cjs +0 -131
  205. package/dist/plugin-babel/src/index.mjs +0 -129
  206. package/dist/plugin-babel/src/types/plugin.cjs +0 -42
  207. package/dist/plugin-babel/src/types/plugin.mjs +0 -39
  208. package/dist/powerlines/src/internal/helpers/hooks.cjs +0 -137
  209. package/dist/powerlines/src/internal/helpers/hooks.mjs +0 -135
  210. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -161
  211. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -159
  212. package/dist/powerlines/src/lib/entry.cjs +0 -203
  213. package/dist/powerlines/src/lib/entry.mjs +0 -201
  214. package/dist/powerlines/src/lib/logger.cjs +0 -108
  215. package/dist/powerlines/src/lib/logger.mjs +0 -106
  216. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -67
  217. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -66
  218. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -49
  219. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -48
  220. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -46
  221. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -45
  222. package/dist/powerlines/src/types/api.cjs +0 -62
  223. package/dist/powerlines/src/types/api.mjs +0 -62
  224. package/dist/powerlines/src/types/babel.cjs +0 -156
  225. package/dist/powerlines/src/types/babel.mjs +0 -147
  226. package/dist/powerlines/src/types/build.cjs +0 -127
  227. package/dist/powerlines/src/types/build.mjs +0 -121
  228. package/dist/powerlines/src/types/commands.cjs +0 -16
  229. package/dist/powerlines/src/types/commands.mjs +0 -15
  230. package/dist/powerlines/src/types/config.cjs +0 -413
  231. package/dist/powerlines/src/types/config.mjs +0 -391
  232. package/dist/powerlines/src/types/context.cjs +0 -381
  233. package/dist/powerlines/src/types/context.mjs +0 -364
  234. package/dist/powerlines/src/types/fs.cjs +0 -78
  235. package/dist/powerlines/src/types/fs.mjs +0 -75
  236. package/dist/powerlines/src/types/hooks.cjs +0 -71
  237. package/dist/powerlines/src/types/hooks.mjs +0 -68
  238. package/dist/powerlines/src/types/index.cjs +0 -11
  239. package/dist/powerlines/src/types/index.mjs +0 -13
  240. package/dist/powerlines/src/types/plugin.cjs +0 -184
  241. package/dist/powerlines/src/types/plugin.mjs +0 -178
  242. package/dist/powerlines/src/types/resolved.cjs +0 -153
  243. package/dist/powerlines/src/types/resolved.mjs +0 -148
  244. package/dist/powerlines/src/types/unplugin.cjs +0 -47
  245. package/dist/powerlines/src/types/unplugin.mjs +0 -46
  246. /package/dist/{deepkit → packages/deepkit}/schemas/reflection.d.mts +0 -0
  247. /package/dist/{deepkit → packages/deepkit}/src/types.d.mts +0 -0
  248. /package/dist/{plugin-alloy → packages/plugin-alloy}/src/core/components/source-file.d.mts +0 -0
  249. /package/dist/{plugin-alloy → packages/plugin-alloy}/src/types/index.d.mts +0 -0
  250. /package/dist/{plugin-alloy → packages/plugin-alloy}/src/types/plugin.d.mts +0 -0
  251. /package/dist/{plugin-alloy → packages/plugin-alloy}/src/typescript/components/builtin-file.d.mts +0 -0
  252. /package/dist/{plugin-alloy → packages/plugin-alloy}/src/typescript/components/tsdoc.d.mts +0 -0
  253. /package/dist/{plugin-automd → packages/plugin-automd}/src/types/plugin.d.mts +0 -0
  254. /package/dist/{plugin-automd → packages/plugin-automd}/src/types/toc.d.mts +0 -0
  255. /package/dist/{plugin-babel → packages/plugin-babel}/src/types/index.d.mts +0 -0
  256. /package/dist/{plugin-babel → packages/plugin-babel}/src/types/plugin.d.mts +0 -0
  257. /package/dist/{powerlines → packages/powerlines}/src/internal/helpers/hooks.d.mts +0 -0
  258. /package/dist/{powerlines → packages/powerlines}/src/types/api.d.mts +0 -0
  259. /package/dist/{powerlines → packages/powerlines}/src/types/babel.d.mts +0 -0
  260. /package/dist/{powerlines → packages/powerlines}/src/types/commands.d.mts +0 -0
  261. /package/dist/{powerlines → packages/powerlines}/src/types/context.d.mts +0 -0
  262. /package/dist/{powerlines → packages/powerlines}/src/types/fs.d.mts +0 -0
  263. /package/dist/{powerlines → packages/powerlines}/src/types/hooks.d.mts +0 -0
  264. /package/dist/{powerlines → packages/powerlines}/src/types/index.d.mts +0 -0
  265. /package/dist/{powerlines → packages/powerlines}/src/types/plugin.d.mts +0 -0
  266. /package/dist/{powerlines → packages/powerlines}/src/types/resolved.d.mts +0 -0
  267. /package/dist/{powerlines → packages/powerlines}/src/types/unplugin.d.mts +0 -0
@@ -0,0 +1,2698 @@
1
+ const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_pathe_M_eThtNZ = require('../../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs');
3
+ const require_defu = require('../../../../../defu@6.1.4/node_modules/defu/dist/defu.cjs');
4
+ const require_nypm_CLjaS_sz = require('../../../../../nypm@0.6.2/node_modules/nypm/dist/shared/nypm.CLjaS_sz.cjs');
5
+ const require_proxy$1 = require('../../../../../node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs');
6
+ let node_fs = require("node:fs");
7
+ node_fs = require_rolldown_runtime.__toESM(node_fs);
8
+ let node_path = require("node:path");
9
+ node_path = require_rolldown_runtime.__toESM(node_path);
10
+ let node_os = require("node:os");
11
+ let node_crypto = require("node:crypto");
12
+ node_crypto = require_rolldown_runtime.__toESM(node_crypto);
13
+ let node_fs_promises = require("node:fs/promises");
14
+ let node_assert = require("node:assert");
15
+ node_assert = require_rolldown_runtime.__toESM(node_assert);
16
+ let node_process = require("node:process");
17
+ node_process = require_rolldown_runtime.__toESM(node_process);
18
+ let node_util = require("node:util");
19
+ node_util = require_rolldown_runtime.__toESM(node_util);
20
+ let node_events = require("node:events");
21
+ node_events = require_rolldown_runtime.__toESM(node_events);
22
+ let node_stream = require("node:stream");
23
+ node_stream = require_rolldown_runtime.__toESM(node_stream);
24
+ let node_string_decoder = require("node:string_decoder");
25
+ node_string_decoder = require_rolldown_runtime.__toESM(node_string_decoder);
26
+ let node_buffer = require("node:buffer");
27
+ node_buffer = require_rolldown_runtime.__toESM(node_buffer);
28
+ let node_zlib = require("node:zlib");
29
+ node_zlib = require_rolldown_runtime.__toESM(node_zlib);
30
+ let node_child_process = require("node:child_process");
31
+
32
+ //#region ../../node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs
33
+ var import_proxy = require_proxy$1.default;
34
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
35
+ function getDefaultExportFromCjs(x) {
36
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
37
+ }
38
+ var i$6, t$5;
39
+ function s$6() {
40
+ if (t$5) return i$6;
41
+ t$5 = 1;
42
+ const n$4 = new Map([
43
+ ["C", "cwd"],
44
+ ["f", "file"],
45
+ ["z", "gzip"],
46
+ ["P", "preservePaths"],
47
+ ["U", "unlink"],
48
+ ["strip-components", "strip"],
49
+ ["stripComponents", "strip"],
50
+ ["keep-newer", "newer"],
51
+ ["keepNewer", "newer"],
52
+ ["keep-newer-files", "newer"],
53
+ ["keepNewerFiles", "newer"],
54
+ ["k", "keep"],
55
+ ["keep-existing", "keep"],
56
+ ["keepExisting", "keep"],
57
+ ["m", "noMtime"],
58
+ ["no-mtime", "noMtime"],
59
+ ["p", "preserveOwner"],
60
+ ["L", "follow"],
61
+ ["h", "follow"]
62
+ ]);
63
+ return i$6 = (r) => r ? Object.keys(r).map((e$6) => [n$4.has(e$6) ? n$4.get(e$6) : e$6, r[e$6]]).reduce((e$6, p$1) => (e$6[p$1[0]] = p$1[1], e$6), Object.create(null)) : {}, i$6;
64
+ }
65
+ var e$5, t$4;
66
+ function c$4() {
67
+ return t$4 || (t$4 = 1, e$5 = (o$5) => class extends o$5 {
68
+ warn(n$4, i$7, r = {}) {
69
+ this.file && (r.file = this.file), this.cwd && (r.cwd = this.cwd), r.code = i$7 instanceof Error && i$7.code || n$4, r.tarCode = n$4, !this.strict && r.recoverable !== false ? (i$7 instanceof Error && (r = Object.assign(i$7, r), i$7 = i$7.message), this.emit("warn", r.tarCode, i$7, r)) : i$7 instanceof Error ? this.emit("error", Object.assign(i$7, r)) : this.emit("error", Object.assign(/* @__PURE__ */ new Error(`${n$4}: ${i$7}`), r));
70
+ }
71
+ }), e$5;
72
+ }
73
+ var e$4 = {};
74
+ var a$9;
75
+ function n$3() {
76
+ return a$9 ? e$4 : (a$9 = 1, function(e$6) {
77
+ e$6.name = new Map([
78
+ ["0", "File"],
79
+ ["", "OldFile"],
80
+ ["1", "Link"],
81
+ ["2", "SymbolicLink"],
82
+ ["3", "CharacterDevice"],
83
+ ["4", "BlockDevice"],
84
+ ["5", "Directory"],
85
+ ["6", "FIFO"],
86
+ ["7", "ContiguousFile"],
87
+ ["g", "GlobalExtendedHeader"],
88
+ ["x", "ExtendedHeader"],
89
+ ["A", "SolarisACL"],
90
+ ["D", "GNUDumpDir"],
91
+ ["I", "Inode"],
92
+ ["K", "NextFileHasLongLinkpath"],
93
+ ["L", "NextFileHasLongPath"],
94
+ ["M", "ContinuationFile"],
95
+ ["N", "OldGnuLongPath"],
96
+ ["S", "SparseFile"],
97
+ ["V", "TapeVolumeHeader"],
98
+ ["X", "OldExtendedHeader"]
99
+ ]), e$6.code = new Map(Array.from(e$6.name).map((i$7) => [i$7[1], i$7[0]]));
100
+ }(e$4), e$4);
101
+ }
102
+ var f$3, i$5;
103
+ function w$1() {
104
+ if (i$5) return f$3;
105
+ i$5 = 1;
106
+ const v$2 = (e$6, r) => {
107
+ if (Number.isSafeInteger(e$6)) e$6 < 0 ? g(e$6, r) : p$1(e$6, r);
108
+ else throw Error("cannot encode number outside of javascript safe integer range");
109
+ return r;
110
+ }, p$1 = (e$6, r) => {
111
+ r[0] = 128;
112
+ for (var o$5 = r.length; o$5 > 1; o$5--) r[o$5 - 1] = e$6 & 255, e$6 = Math.floor(e$6 / 256);
113
+ }, g = (e$6, r) => {
114
+ r[0] = 255;
115
+ var o$5 = false;
116
+ e$6 = e$6 * -1;
117
+ for (var s$7 = r.length; s$7 > 1; s$7--) {
118
+ var a$10 = e$6 & 255;
119
+ e$6 = Math.floor(e$6 / 256), o$5 ? r[s$7 - 1] = l$1(a$10) : a$10 === 0 ? r[s$7 - 1] = 0 : (o$5 = true, r[s$7 - 1] = c$5(a$10));
120
+ }
121
+ }, h = (e$6) => {
122
+ const r = e$6[0], o$5 = r === 128 ? d(e$6.slice(1, e$6.length)) : r === 255 ? x(e$6) : null;
123
+ if (o$5 === null) throw Error("invalid base256 encoding");
124
+ if (!Number.isSafeInteger(o$5)) throw Error("parsed number outside of javascript safe integer range");
125
+ return o$5;
126
+ }, x = (e$6) => {
127
+ for (var r = e$6.length, o$5 = 0, s$7 = false, a$10 = r - 1; a$10 > -1; a$10--) {
128
+ var n$4 = e$6[a$10], t$6;
129
+ s$7 ? t$6 = l$1(n$4) : n$4 === 0 ? t$6 = n$4 : (s$7 = true, t$6 = c$5(n$4)), t$6 !== 0 && (o$5 -= t$6 * Math.pow(256, r - a$10 - 1));
130
+ }
131
+ return o$5;
132
+ }, d = (e$6) => {
133
+ for (var r = e$6.length, o$5 = 0, s$7 = r - 1; s$7 > -1; s$7--) {
134
+ var a$10 = e$6[s$7];
135
+ a$10 !== 0 && (o$5 += a$10 * Math.pow(256, r - s$7 - 1));
136
+ }
137
+ return o$5;
138
+ }, l$1 = (e$6) => (255 ^ e$6) & 255, c$5 = (e$6) => (255 ^ e$6) + 1 & 255;
139
+ return f$3 = {
140
+ encode: v$2,
141
+ parse: h
142
+ }, f$3;
143
+ }
144
+ var k, w;
145
+ function E() {
146
+ if (w) return k;
147
+ w = 1;
148
+ const u$5 = n$3(), x = node_path.default.posix, y$3 = w$1(), P$1 = Symbol("slurp"), a$10 = Symbol("type");
149
+ class B {
150
+ constructor(e$6, t$6, i$7, h) {
151
+ this.cksumValid = false, this.needPax = false, this.nullBlock = false, this.block = null, this.path = null, this.mode = null, this.uid = null, this.gid = null, this.size = null, this.mtime = null, this.cksum = null, this[a$10] = "0", this.linkpath = null, this.uname = null, this.gname = null, this.devmaj = 0, this.devmin = 0, this.atime = null, this.ctime = null, Buffer.isBuffer(e$6) ? this.decode(e$6, t$6 || 0, i$7, h) : e$6 && this.set(e$6);
152
+ }
153
+ decode(e$6, t$6, i$7, h) {
154
+ if (t$6 || (t$6 = 0), !e$6 || !(e$6.length >= t$6 + 512)) throw new Error("need 512 bytes for header");
155
+ if (this.path = d(e$6, t$6, 100), this.mode = r(e$6, t$6 + 100, 8), this.uid = r(e$6, t$6 + 108, 8), this.gid = r(e$6, t$6 + 116, 8), this.size = r(e$6, t$6 + 124, 12), this.mtime = o$5(e$6, t$6 + 136, 12), this.cksum = r(e$6, t$6 + 148, 12), this[P$1](i$7), this[P$1](h, true), this[a$10] = d(e$6, t$6 + 156, 1), this[a$10] === "" && (this[a$10] = "0"), this[a$10] === "0" && this.path.slice(-1) === "/" && (this[a$10] = "5"), this[a$10] === "5" && (this.size = 0), this.linkpath = d(e$6, t$6 + 157, 100), e$6.slice(t$6 + 257, t$6 + 265).toString() === "ustar\x0000") if (this.uname = d(e$6, t$6 + 265, 32), this.gname = d(e$6, t$6 + 297, 32), this.devmaj = r(e$6, t$6 + 329, 8), this.devmin = r(e$6, t$6 + 337, 8), e$6[t$6 + 475] !== 0) this.path = d(e$6, t$6 + 345, 155) + "/" + this.path;
156
+ else {
157
+ const n$4 = d(e$6, t$6 + 345, 130);
158
+ n$4 && (this.path = n$4 + "/" + this.path), this.atime = o$5(e$6, t$6 + 476, 12), this.ctime = o$5(e$6, t$6 + 488, 12);
159
+ }
160
+ let l$1 = 256;
161
+ for (let n$4 = t$6; n$4 < t$6 + 148; n$4++) l$1 += e$6[n$4];
162
+ for (let n$4 = t$6 + 156; n$4 < t$6 + 512; n$4++) l$1 += e$6[n$4];
163
+ this.cksumValid = l$1 === this.cksum, this.cksum === null && l$1 === 256 && (this.nullBlock = true);
164
+ }
165
+ [P$1](e$6, t$6) {
166
+ for (const i$7 in e$6) e$6[i$7] !== null && e$6[i$7] !== void 0 && !(t$6 && i$7 === "path") && (this[i$7] = e$6[i$7]);
167
+ }
168
+ encode(e$6, t$6) {
169
+ if (e$6 || (e$6 = this.block = Buffer.alloc(512), t$6 = 0), t$6 || (t$6 = 0), !(e$6.length >= t$6 + 512)) throw new Error("need 512 bytes for header");
170
+ const i$7 = this.ctime || this.atime ? 130 : 155, h = L(this.path || "", i$7), l$1 = h[0], n$4 = h[1];
171
+ this.needPax = h[2], this.needPax = m$3(e$6, t$6, 100, l$1) || this.needPax, this.needPax = c$5(e$6, t$6 + 100, 8, this.mode) || this.needPax, this.needPax = c$5(e$6, t$6 + 108, 8, this.uid) || this.needPax, this.needPax = c$5(e$6, t$6 + 116, 8, this.gid) || this.needPax, this.needPax = c$5(e$6, t$6 + 124, 12, this.size) || this.needPax, this.needPax = g(e$6, t$6 + 136, 12, this.mtime) || this.needPax, e$6[t$6 + 156] = this[a$10].charCodeAt(0), this.needPax = m$3(e$6, t$6 + 157, 100, this.linkpath) || this.needPax, e$6.write("ustar\x0000", t$6 + 257, 8), this.needPax = m$3(e$6, t$6 + 265, 32, this.uname) || this.needPax, this.needPax = m$3(e$6, t$6 + 297, 32, this.gname) || this.needPax, this.needPax = c$5(e$6, t$6 + 329, 8, this.devmaj) || this.needPax, this.needPax = c$5(e$6, t$6 + 337, 8, this.devmin) || this.needPax, this.needPax = m$3(e$6, t$6 + 345, i$7, n$4) || this.needPax, e$6[t$6 + 475] !== 0 ? this.needPax = m$3(e$6, t$6 + 345, 155, n$4) || this.needPax : (this.needPax = m$3(e$6, t$6 + 345, 130, n$4) || this.needPax, this.needPax = g(e$6, t$6 + 476, 12, this.atime) || this.needPax, this.needPax = g(e$6, t$6 + 488, 12, this.ctime) || this.needPax);
172
+ let S$1 = 256;
173
+ for (let p$1 = t$6; p$1 < t$6 + 148; p$1++) S$1 += e$6[p$1];
174
+ for (let p$1 = t$6 + 156; p$1 < t$6 + 512; p$1++) S$1 += e$6[p$1];
175
+ return this.cksum = S$1, c$5(e$6, t$6 + 148, 8, this.cksum), this.cksumValid = true, this.needPax;
176
+ }
177
+ set(e$6) {
178
+ for (const t$6 in e$6) e$6[t$6] !== null && e$6[t$6] !== void 0 && (this[t$6] = e$6[t$6]);
179
+ }
180
+ get type() {
181
+ return u$5.name.get(this[a$10]) || this[a$10];
182
+ }
183
+ get typeKey() {
184
+ return this[a$10];
185
+ }
186
+ set type(e$6) {
187
+ u$5.code.has(e$6) ? this[a$10] = u$5.code.get(e$6) : this[a$10] = e$6;
188
+ }
189
+ }
190
+ const L = (s$7, e$6) => {
191
+ let i$7 = s$7, h = "", l$1;
192
+ const n$4 = x.parse(s$7).root || ".";
193
+ if (Buffer.byteLength(i$7) < 100) l$1 = [
194
+ i$7,
195
+ h,
196
+ false
197
+ ];
198
+ else {
199
+ h = x.dirname(i$7), i$7 = x.basename(i$7);
200
+ do
201
+ Buffer.byteLength(i$7) <= 100 && Buffer.byteLength(h) <= e$6 ? l$1 = [
202
+ i$7,
203
+ h,
204
+ false
205
+ ] : Buffer.byteLength(i$7) > 100 && Buffer.byteLength(h) <= e$6 ? l$1 = [
206
+ i$7.slice(0, 99),
207
+ h,
208
+ true
209
+ ] : (i$7 = x.join(x.basename(h), i$7), h = x.dirname(h));
210
+ while (h !== n$4 && !l$1);
211
+ l$1 || (l$1 = [
212
+ s$7.slice(0, 99),
213
+ "",
214
+ true
215
+ ]);
216
+ }
217
+ return l$1;
218
+ }, d = (s$7, e$6, t$6) => s$7.slice(e$6, e$6 + t$6).toString("utf8").replace(/\0.*/, ""), o$5 = (s$7, e$6, t$6) => N(r(s$7, e$6, t$6)), N = (s$7) => s$7 === null ? null : /* @__PURE__ */ new Date(s$7 * 1e3), r = (s$7, e$6, t$6) => s$7[e$6] & 128 ? y$3.parse(s$7.slice(e$6, e$6 + t$6)) : j$2(s$7, e$6, t$6), q$1 = (s$7) => isNaN(s$7) ? null : s$7, j$2 = (s$7, e$6, t$6) => q$1(parseInt(s$7.slice(e$6, e$6 + t$6).toString("utf8").replace(/\0.*$/, "").trim(), 8)), v$2 = {
219
+ 12: 8589934591,
220
+ 8: 2097151
221
+ }, c$5 = (s$7, e$6, t$6, i$7) => i$7 === null ? false : i$7 > v$2[t$6] || i$7 < 0 ? (y$3.encode(i$7, s$7.slice(e$6, e$6 + t$6)), true) : ($(s$7, e$6, t$6, i$7), false), $ = (s$7, e$6, t$6, i$7) => s$7.write(_$1(i$7, t$6), e$6, t$6, "ascii"), _$1 = (s$7, e$6) => z$1(Math.floor(s$7).toString(8), e$6), z$1 = (s$7, e$6) => (s$7.length === e$6 - 1 ? s$7 : new Array(e$6 - s$7.length - 1).join("0") + s$7 + " ") + "\0", g = (s$7, e$6, t$6, i$7) => i$7 === null ? false : c$5(s$7, e$6, t$6, i$7.getTime() / 1e3), A = new Array(156).join("\0"), m$3 = (s$7, e$6, t$6, i$7) => i$7 === null ? false : (s$7.write(i$7 + A, e$6, t$6, "utf8"), i$7.length !== Buffer.byteLength(i$7) || i$7.length > t$6);
222
+ return k = B, k;
223
+ }
224
+ var e$3, t$3;
225
+ function i$4() {
226
+ return t$3 || (t$3 = 1, e$3 = function(o$5) {
227
+ o$5.prototype[Symbol.iterator] = function* () {
228
+ for (let r = this.head; r; r = r.next) yield r.value;
229
+ };
230
+ }), e$3;
231
+ }
232
+ var u$4, a$8;
233
+ function c$3() {
234
+ if (a$8) return u$4;
235
+ a$8 = 1, u$4 = r, r.Node = s$7, r.create = r;
236
+ function r(t$6) {
237
+ var i$7 = this;
238
+ if (i$7 instanceof r || (i$7 = new r()), i$7.tail = null, i$7.head = null, i$7.length = 0, t$6 && typeof t$6.forEach == "function") t$6.forEach(function(n$4) {
239
+ i$7.push(n$4);
240
+ });
241
+ else if (arguments.length > 0) for (var e$6 = 0, h = arguments.length; e$6 < h; e$6++) i$7.push(arguments[e$6]);
242
+ return i$7;
243
+ }
244
+ r.prototype.removeNode = function(t$6) {
245
+ if (t$6.list !== this) throw new Error("removing node which does not belong to this list");
246
+ var i$7 = t$6.next, e$6 = t$6.prev;
247
+ return i$7 && (i$7.prev = e$6), e$6 && (e$6.next = i$7), t$6 === this.head && (this.head = i$7), t$6 === this.tail && (this.tail = e$6), t$6.list.length--, t$6.next = null, t$6.prev = null, t$6.list = null, i$7;
248
+ }, r.prototype.unshiftNode = function(t$6) {
249
+ if (t$6 !== this.head) {
250
+ t$6.list && t$6.list.removeNode(t$6);
251
+ var i$7 = this.head;
252
+ t$6.list = this, t$6.next = i$7, i$7 && (i$7.prev = t$6), this.head = t$6, this.tail || (this.tail = t$6), this.length++;
253
+ }
254
+ }, r.prototype.pushNode = function(t$6) {
255
+ if (t$6 !== this.tail) {
256
+ t$6.list && t$6.list.removeNode(t$6);
257
+ var i$7 = this.tail;
258
+ t$6.list = this, t$6.prev = i$7, i$7 && (i$7.next = t$6), this.tail = t$6, this.head || (this.head = t$6), this.length++;
259
+ }
260
+ }, r.prototype.push = function() {
261
+ for (var t$6 = 0, i$7 = arguments.length; t$6 < i$7; t$6++) f$4(this, arguments[t$6]);
262
+ return this.length;
263
+ }, r.prototype.unshift = function() {
264
+ for (var t$6 = 0, i$7 = arguments.length; t$6 < i$7; t$6++) o$5(this, arguments[t$6]);
265
+ return this.length;
266
+ }, r.prototype.pop = function() {
267
+ if (this.tail) {
268
+ var t$6 = this.tail.value;
269
+ return this.tail = this.tail.prev, this.tail ? this.tail.next = null : this.head = null, this.length--, t$6;
270
+ }
271
+ }, r.prototype.shift = function() {
272
+ if (this.head) {
273
+ var t$6 = this.head.value;
274
+ return this.head = this.head.next, this.head ? this.head.prev = null : this.tail = null, this.length--, t$6;
275
+ }
276
+ }, r.prototype.forEach = function(t$6, i$7) {
277
+ i$7 = i$7 || this;
278
+ for (var e$6 = this.head, h = 0; e$6 !== null; h++) t$6.call(i$7, e$6.value, h, this), e$6 = e$6.next;
279
+ }, r.prototype.forEachReverse = function(t$6, i$7) {
280
+ i$7 = i$7 || this;
281
+ for (var e$6 = this.tail, h = this.length - 1; e$6 !== null; h--) t$6.call(i$7, e$6.value, h, this), e$6 = e$6.prev;
282
+ }, r.prototype.get = function(t$6) {
283
+ for (var i$7 = 0, e$6 = this.head; e$6 !== null && i$7 < t$6; i$7++) e$6 = e$6.next;
284
+ if (i$7 === t$6 && e$6 !== null) return e$6.value;
285
+ }, r.prototype.getReverse = function(t$6) {
286
+ for (var i$7 = 0, e$6 = this.tail; e$6 !== null && i$7 < t$6; i$7++) e$6 = e$6.prev;
287
+ if (i$7 === t$6 && e$6 !== null) return e$6.value;
288
+ }, r.prototype.map = function(t$6, i$7) {
289
+ i$7 = i$7 || this;
290
+ for (var e$6 = new r(), h = this.head; h !== null;) e$6.push(t$6.call(i$7, h.value, this)), h = h.next;
291
+ return e$6;
292
+ }, r.prototype.mapReverse = function(t$6, i$7) {
293
+ i$7 = i$7 || this;
294
+ for (var e$6 = new r(), h = this.tail; h !== null;) e$6.push(t$6.call(i$7, h.value, this)), h = h.prev;
295
+ return e$6;
296
+ }, r.prototype.reduce = function(t$6, i$7) {
297
+ var e$6, h = this.head;
298
+ if (arguments.length > 1) e$6 = i$7;
299
+ else if (this.head) h = this.head.next, e$6 = this.head.value;
300
+ else throw new TypeError("Reduce of empty list with no initial value");
301
+ for (var n$4 = 0; h !== null; n$4++) e$6 = t$6(e$6, h.value, n$4), h = h.next;
302
+ return e$6;
303
+ }, r.prototype.reduceReverse = function(t$6, i$7) {
304
+ var e$6, h = this.tail;
305
+ if (arguments.length > 1) e$6 = i$7;
306
+ else if (this.tail) h = this.tail.prev, e$6 = this.tail.value;
307
+ else throw new TypeError("Reduce of empty list with no initial value");
308
+ for (var n$4 = this.length - 1; h !== null; n$4--) e$6 = t$6(e$6, h.value, n$4), h = h.prev;
309
+ return e$6;
310
+ }, r.prototype.toArray = function() {
311
+ for (var t$6 = new Array(this.length), i$7 = 0, e$6 = this.head; e$6 !== null; i$7++) t$6[i$7] = e$6.value, e$6 = e$6.next;
312
+ return t$6;
313
+ }, r.prototype.toArrayReverse = function() {
314
+ for (var t$6 = new Array(this.length), i$7 = 0, e$6 = this.tail; e$6 !== null; i$7++) t$6[i$7] = e$6.value, e$6 = e$6.prev;
315
+ return t$6;
316
+ }, r.prototype.slice = function(t$6, i$7) {
317
+ i$7 = i$7 || this.length, i$7 < 0 && (i$7 += this.length), t$6 = t$6 || 0, t$6 < 0 && (t$6 += this.length);
318
+ var e$6 = new r();
319
+ if (i$7 < t$6 || i$7 < 0) return e$6;
320
+ t$6 < 0 && (t$6 = 0), i$7 > this.length && (i$7 = this.length);
321
+ for (var h = 0, n$4 = this.head; n$4 !== null && h < t$6; h++) n$4 = n$4.next;
322
+ for (; n$4 !== null && h < i$7; h++, n$4 = n$4.next) e$6.push(n$4.value);
323
+ return e$6;
324
+ }, r.prototype.sliceReverse = function(t$6, i$7) {
325
+ i$7 = i$7 || this.length, i$7 < 0 && (i$7 += this.length), t$6 = t$6 || 0, t$6 < 0 && (t$6 += this.length);
326
+ var e$6 = new r();
327
+ if (i$7 < t$6 || i$7 < 0) return e$6;
328
+ t$6 < 0 && (t$6 = 0), i$7 > this.length && (i$7 = this.length);
329
+ for (var h = this.length, n$4 = this.tail; n$4 !== null && h > i$7; h--) n$4 = n$4.prev;
330
+ for (; n$4 !== null && h > t$6; h--, n$4 = n$4.prev) e$6.push(n$4.value);
331
+ return e$6;
332
+ }, r.prototype.splice = function(t$6, i$7, ...e$6) {
333
+ t$6 > this.length && (t$6 = this.length - 1), t$6 < 0 && (t$6 = this.length + t$6);
334
+ for (var h = 0, n$4 = this.head; n$4 !== null && h < t$6; h++) n$4 = n$4.next;
335
+ for (var l$1 = [], h = 0; n$4 && h < i$7; h++) l$1.push(n$4.value), n$4 = this.removeNode(n$4);
336
+ n$4 === null && (n$4 = this.tail), n$4 !== this.head && n$4 !== this.tail && (n$4 = n$4.prev);
337
+ for (var h = 0; h < e$6.length; h++) n$4 = v$2(this, n$4, e$6[h]);
338
+ return l$1;
339
+ }, r.prototype.reverse = function() {
340
+ for (var t$6 = this.head, i$7 = this.tail, e$6 = t$6; e$6 !== null; e$6 = e$6.prev) {
341
+ var h = e$6.prev;
342
+ e$6.prev = e$6.next, e$6.next = h;
343
+ }
344
+ return this.head = i$7, this.tail = t$6, this;
345
+ };
346
+ function v$2(t$6, i$7, e$6) {
347
+ var h = i$7 === t$6.head ? new s$7(e$6, null, i$7, t$6) : new s$7(e$6, i$7, i$7.next, t$6);
348
+ return h.next === null && (t$6.tail = h), h.prev === null && (t$6.head = h), t$6.length++, h;
349
+ }
350
+ function f$4(t$6, i$7) {
351
+ t$6.tail = new s$7(i$7, t$6.tail, null, t$6), t$6.head || (t$6.head = t$6.tail), t$6.length++;
352
+ }
353
+ function o$5(t$6, i$7) {
354
+ t$6.head = new s$7(i$7, null, t$6.head, t$6), t$6.tail || (t$6.tail = t$6.head), t$6.length++;
355
+ }
356
+ function s$7(t$6, i$7, e$6, h) {
357
+ if (!(this instanceof s$7)) return new s$7(t$6, i$7, e$6, h);
358
+ this.list = h, this.value = t$6, i$7 ? (i$7.next = this, this.prev = i$7) : this.prev = null, e$6 ? (e$6.prev = this, this.next = e$6) : this.next = null;
359
+ }
360
+ try {
361
+ i$4()(r);
362
+ } catch {}
363
+ return u$4;
364
+ }
365
+ var s$5 = {};
366
+ var X$1;
367
+ function ft() {
368
+ if (X$1) return s$5;
369
+ X$1 = 1;
370
+ const H$3 = typeof process == "object" && process ? process : {
371
+ stdout: null,
372
+ stderr: null
373
+ }, Z = node_events.default, q$1 = node_stream.default, G$1 = node_string_decoder.default.StringDecoder, m$3 = Symbol("EOF"), d = Symbol("maybeEmitEnd"), y$3 = Symbol("emittedEnd"), R$2 = Symbol("emittingEnd"), g = Symbol("emittedError"), B = Symbol("closed"), Y = Symbol("read"), T$1 = Symbol("flush"), $ = Symbol("flushChunk"), f$4 = Symbol("encoding"), c$5 = Symbol("decoder"), M = Symbol("flowing"), S$1 = Symbol("paused"), b = Symbol("resume"), i$7 = Symbol("buffer"), a$10 = Symbol("pipes"), n$4 = Symbol("bufferLength"), j$2 = Symbol("bufferPush"), I = Symbol("bufferShift"), o$5 = Symbol("objectMode"), r = Symbol("destroyed"), P$1 = Symbol("error"), x = Symbol("emitData"), V$1 = Symbol("emitEnd"), N = Symbol("emitEnd2"), p$1 = Symbol("async"), _$1 = Symbol("abort"), O$3 = Symbol("aborted"), E$1 = Symbol("signal"), w$2 = (h) => Promise.resolve().then(h), J$1 = commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", K = J$1 && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), W = J$1 && Symbol.iterator || Symbol("iterator not implemented"), k$1 = (h) => h === "end" || h === "finish" || h === "prefinish", tt$1 = (h) => h instanceof ArrayBuffer || typeof h == "object" && h.constructor && h.constructor.name === "ArrayBuffer" && h.byteLength >= 0, et = (h) => !Buffer.isBuffer(h) && ArrayBuffer.isView(h);
374
+ class z$1 {
375
+ constructor(t$6, e$6, s$7) {
376
+ this.src = t$6, this.dest = e$6, this.opts = s$7, this.ondrain = () => t$6[b](), e$6.on("drain", this.ondrain);
377
+ }
378
+ unpipe() {
379
+ this.dest.removeListener("drain", this.ondrain);
380
+ }
381
+ proxyErrors() {}
382
+ end() {
383
+ this.unpipe(), this.opts.end && this.dest.end();
384
+ }
385
+ }
386
+ class st extends z$1 {
387
+ unpipe() {
388
+ this.src.removeListener("error", this.proxyErrors), super.unpipe();
389
+ }
390
+ constructor(t$6, e$6, s$7) {
391
+ super(t$6, e$6, s$7), this.proxyErrors = (l$1) => e$6.emit("error", l$1), t$6.on("error", this.proxyErrors);
392
+ }
393
+ }
394
+ class F$3 extends q$1 {
395
+ constructor(t$6) {
396
+ super(), this[M] = false, this[S$1] = false, this[a$10] = [], this[i$7] = [], this[o$5] = t$6 && t$6.objectMode || false, this[o$5] ? this[f$4] = null : this[f$4] = t$6 && t$6.encoding || null, this[f$4] === "buffer" && (this[f$4] = null), this[p$1] = t$6 && !!t$6.async || false, this[c$5] = this[f$4] ? new G$1(this[f$4]) : null, this[m$3] = false, this[y$3] = false, this[R$2] = false, this[B] = false, this[g] = null, this.writable = true, this.readable = true, this[n$4] = 0, this[r] = false, t$6 && t$6.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[i$7] }), t$6 && t$6.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[a$10] }), this[E$1] = t$6 && t$6.signal, this[O$3] = false, this[E$1] && (this[E$1].addEventListener("abort", () => this[_$1]()), this[E$1].aborted && this[_$1]());
397
+ }
398
+ get bufferLength() {
399
+ return this[n$4];
400
+ }
401
+ get encoding() {
402
+ return this[f$4];
403
+ }
404
+ set encoding(t$6) {
405
+ if (this[o$5]) throw new Error("cannot set encoding in objectMode");
406
+ if (this[f$4] && t$6 !== this[f$4] && (this[c$5] && this[c$5].lastNeed || this[n$4])) throw new Error("cannot change encoding");
407
+ this[f$4] !== t$6 && (this[c$5] = t$6 ? new G$1(t$6) : null, this[i$7].length && (this[i$7] = this[i$7].map((e$6) => this[c$5].write(e$6)))), this[f$4] = t$6;
408
+ }
409
+ setEncoding(t$6) {
410
+ this.encoding = t$6;
411
+ }
412
+ get objectMode() {
413
+ return this[o$5];
414
+ }
415
+ set objectMode(t$6) {
416
+ this[o$5] = this[o$5] || !!t$6;
417
+ }
418
+ get async() {
419
+ return this[p$1];
420
+ }
421
+ set async(t$6) {
422
+ this[p$1] = this[p$1] || !!t$6;
423
+ }
424
+ [_$1]() {
425
+ this[O$3] = true, this.emit("abort", this[E$1].reason), this.destroy(this[E$1].reason);
426
+ }
427
+ get aborted() {
428
+ return this[O$3];
429
+ }
430
+ set aborted(t$6) {}
431
+ write(t$6, e$6, s$7) {
432
+ if (this[O$3]) return false;
433
+ if (this[m$3]) throw new Error("write after end");
434
+ if (this[r]) return this.emit("error", Object.assign(/* @__PURE__ */ new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
435
+ typeof e$6 == "function" && (s$7 = e$6, e$6 = "utf8"), e$6 || (e$6 = "utf8");
436
+ const l$1 = this[p$1] ? w$2 : (u$5) => u$5();
437
+ return !this[o$5] && !Buffer.isBuffer(t$6) && (et(t$6) ? t$6 = Buffer.from(t$6.buffer, t$6.byteOffset, t$6.byteLength) : tt$1(t$6) ? t$6 = Buffer.from(t$6) : typeof t$6 != "string" && (this.objectMode = true)), this[o$5] ? (this.flowing && this[n$4] !== 0 && this[T$1](true), this.flowing ? this.emit("data", t$6) : this[j$2](t$6), this[n$4] !== 0 && this.emit("readable"), s$7 && l$1(s$7), this.flowing) : t$6.length ? (typeof t$6 == "string" && !(e$6 === this[f$4] && !this[c$5].lastNeed) && (t$6 = Buffer.from(t$6, e$6)), Buffer.isBuffer(t$6) && this[f$4] && (t$6 = this[c$5].write(t$6)), this.flowing && this[n$4] !== 0 && this[T$1](true), this.flowing ? this.emit("data", t$6) : this[j$2](t$6), this[n$4] !== 0 && this.emit("readable"), s$7 && l$1(s$7), this.flowing) : (this[n$4] !== 0 && this.emit("readable"), s$7 && l$1(s$7), this.flowing);
438
+ }
439
+ read(t$6) {
440
+ if (this[r]) return null;
441
+ if (this[n$4] === 0 || t$6 === 0 || t$6 > this[n$4]) return this[d](), null;
442
+ this[o$5] && (t$6 = null), this[i$7].length > 1 && !this[o$5] && (this.encoding ? this[i$7] = [this[i$7].join("")] : this[i$7] = [Buffer.concat(this[i$7], this[n$4])]);
443
+ const e$6 = this[Y](t$6 || null, this[i$7][0]);
444
+ return this[d](), e$6;
445
+ }
446
+ [Y](t$6, e$6) {
447
+ return t$6 === e$6.length || t$6 === null ? this[I]() : (this[i$7][0] = e$6.slice(t$6), e$6 = e$6.slice(0, t$6), this[n$4] -= t$6), this.emit("data", e$6), !this[i$7].length && !this[m$3] && this.emit("drain"), e$6;
448
+ }
449
+ end(t$6, e$6, s$7) {
450
+ return typeof t$6 == "function" && (s$7 = t$6, t$6 = null), typeof e$6 == "function" && (s$7 = e$6, e$6 = "utf8"), t$6 && this.write(t$6, e$6), s$7 && this.once("end", s$7), this[m$3] = true, this.writable = false, (this.flowing || !this[S$1]) && this[d](), this;
451
+ }
452
+ [b]() {
453
+ this[r] || (this[S$1] = false, this[M] = true, this.emit("resume"), this[i$7].length ? this[T$1]() : this[m$3] ? this[d]() : this.emit("drain"));
454
+ }
455
+ resume() {
456
+ return this[b]();
457
+ }
458
+ pause() {
459
+ this[M] = false, this[S$1] = true;
460
+ }
461
+ get destroyed() {
462
+ return this[r];
463
+ }
464
+ get flowing() {
465
+ return this[M];
466
+ }
467
+ get paused() {
468
+ return this[S$1];
469
+ }
470
+ [j$2](t$6) {
471
+ this[o$5] ? this[n$4] += 1 : this[n$4] += t$6.length, this[i$7].push(t$6);
472
+ }
473
+ [I]() {
474
+ return this[o$5] ? this[n$4] -= 1 : this[n$4] -= this[i$7][0].length, this[i$7].shift();
475
+ }
476
+ [T$1](t$6) {
477
+ do ;
478
+ while (this[$](this[I]()) && this[i$7].length);
479
+ !t$6 && !this[i$7].length && !this[m$3] && this.emit("drain");
480
+ }
481
+ [$](t$6) {
482
+ return this.emit("data", t$6), this.flowing;
483
+ }
484
+ pipe(t$6, e$6) {
485
+ if (this[r]) return;
486
+ const s$7 = this[y$3];
487
+ return e$6 = e$6 || {}, t$6 === H$3.stdout || t$6 === H$3.stderr ? e$6.end = false : e$6.end = e$6.end !== false, e$6.proxyErrors = !!e$6.proxyErrors, s$7 ? e$6.end && t$6.end() : (this[a$10].push(e$6.proxyErrors ? new st(this, t$6, e$6) : new z$1(this, t$6, e$6)), this[p$1] ? w$2(() => this[b]()) : this[b]()), t$6;
488
+ }
489
+ unpipe(t$6) {
490
+ const e$6 = this[a$10].find((s$7) => s$7.dest === t$6);
491
+ e$6 && (this[a$10].splice(this[a$10].indexOf(e$6), 1), e$6.unpipe());
492
+ }
493
+ addListener(t$6, e$6) {
494
+ return this.on(t$6, e$6);
495
+ }
496
+ on(t$6, e$6) {
497
+ const s$7 = super.on(t$6, e$6);
498
+ return t$6 === "data" && !this[a$10].length && !this.flowing ? this[b]() : t$6 === "readable" && this[n$4] !== 0 ? super.emit("readable") : k$1(t$6) && this[y$3] ? (super.emit(t$6), this.removeAllListeners(t$6)) : t$6 === "error" && this[g] && (this[p$1] ? w$2(() => e$6.call(this, this[g])) : e$6.call(this, this[g])), s$7;
499
+ }
500
+ get emittedEnd() {
501
+ return this[y$3];
502
+ }
503
+ [d]() {
504
+ !this[R$2] && !this[y$3] && !this[r] && this[i$7].length === 0 && this[m$3] && (this[R$2] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[B] && this.emit("close"), this[R$2] = false);
505
+ }
506
+ emit(t$6, e$6, ...s$7) {
507
+ if (t$6 !== "error" && t$6 !== "close" && t$6 !== r && this[r]) return;
508
+ if (t$6 === "data") return !this[o$5] && !e$6 ? false : this[p$1] ? w$2(() => this[x](e$6)) : this[x](e$6);
509
+ if (t$6 === "end") return this[V$1]();
510
+ if (t$6 === "close") {
511
+ if (this[B] = true, !this[y$3] && !this[r]) return;
512
+ const u$5 = super.emit("close");
513
+ return this.removeAllListeners("close"), u$5;
514
+ } else if (t$6 === "error") {
515
+ this[g] = e$6, super.emit(P$1, e$6);
516
+ const u$5 = !this[E$1] || this.listeners("error").length ? super.emit("error", e$6) : false;
517
+ return this[d](), u$5;
518
+ } else if (t$6 === "resume") {
519
+ const u$5 = super.emit("resume");
520
+ return this[d](), u$5;
521
+ } else if (t$6 === "finish" || t$6 === "prefinish") {
522
+ const u$5 = super.emit(t$6);
523
+ return this.removeAllListeners(t$6), u$5;
524
+ }
525
+ const l$1 = super.emit(t$6, e$6, ...s$7);
526
+ return this[d](), l$1;
527
+ }
528
+ [x](t$6) {
529
+ for (const s$7 of this[a$10]) s$7.dest.write(t$6) === false && this.pause();
530
+ const e$6 = super.emit("data", t$6);
531
+ return this[d](), e$6;
532
+ }
533
+ [V$1]() {
534
+ this[y$3] || (this[y$3] = true, this.readable = false, this[p$1] ? w$2(() => this[N]()) : this[N]());
535
+ }
536
+ [N]() {
537
+ if (this[c$5]) {
538
+ const e$6 = this[c$5].end();
539
+ if (e$6) {
540
+ for (const s$7 of this[a$10]) s$7.dest.write(e$6);
541
+ super.emit("data", e$6);
542
+ }
543
+ }
544
+ for (const e$6 of this[a$10]) e$6.end();
545
+ const t$6 = super.emit("end");
546
+ return this.removeAllListeners("end"), t$6;
547
+ }
548
+ collect() {
549
+ const t$6 = [];
550
+ this[o$5] || (t$6.dataLength = 0);
551
+ const e$6 = this.promise();
552
+ return this.on("data", (s$7) => {
553
+ t$6.push(s$7), this[o$5] || (t$6.dataLength += s$7.length);
554
+ }), e$6.then(() => t$6);
555
+ }
556
+ concat() {
557
+ return this[o$5] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this.collect().then((t$6) => this[o$5] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this[f$4] ? t$6.join("") : Buffer.concat(t$6, t$6.dataLength));
558
+ }
559
+ promise() {
560
+ return new Promise((t$6, e$6) => {
561
+ this.on(r, () => e$6(/* @__PURE__ */ new Error("stream destroyed"))), this.on("error", (s$7) => e$6(s$7)), this.on("end", () => t$6());
562
+ });
563
+ }
564
+ [K]() {
565
+ let t$6 = false;
566
+ const e$6 = () => (this.pause(), t$6 = true, Promise.resolve({ done: true }));
567
+ return {
568
+ next: () => {
569
+ if (t$6) return e$6();
570
+ const l$1 = this.read();
571
+ if (l$1 !== null) return Promise.resolve({
572
+ done: false,
573
+ value: l$1
574
+ });
575
+ if (this[m$3]) return e$6();
576
+ let u$5 = null, Q = null;
577
+ const A = (L) => {
578
+ this.removeListener("data", U), this.removeListener("end", C$1), this.removeListener(r, D), e$6(), Q(L);
579
+ }, U = (L) => {
580
+ this.removeListener("error", A), this.removeListener("end", C$1), this.removeListener(r, D), this.pause(), u$5({
581
+ value: L,
582
+ done: !!this[m$3]
583
+ });
584
+ }, C$1 = () => {
585
+ this.removeListener("error", A), this.removeListener("data", U), this.removeListener(r, D), e$6(), u$5({ done: true });
586
+ }, D = () => A(/* @__PURE__ */ new Error("stream destroyed"));
587
+ return new Promise((L, it) => {
588
+ Q = it, u$5 = L, this.once(r, D), this.once("error", A), this.once("end", C$1), this.once("data", U);
589
+ });
590
+ },
591
+ throw: e$6,
592
+ return: e$6,
593
+ [K]() {
594
+ return this;
595
+ }
596
+ };
597
+ }
598
+ [W]() {
599
+ let t$6 = false;
600
+ const e$6 = () => (this.pause(), this.removeListener(P$1, e$6), this.removeListener(r, e$6), this.removeListener("end", e$6), t$6 = true, { done: true }), s$7 = () => {
601
+ if (t$6) return e$6();
602
+ const l$1 = this.read();
603
+ return l$1 === null ? e$6() : { value: l$1 };
604
+ };
605
+ return this.once("end", e$6), this.once(P$1, e$6), this.once(r, e$6), {
606
+ next: s$7,
607
+ throw: e$6,
608
+ return: e$6,
609
+ [W]() {
610
+ return this;
611
+ }
612
+ };
613
+ }
614
+ destroy(t$6) {
615
+ return this[r] ? (t$6 ? this.emit("error", t$6) : this.emit(r), this) : (this[r] = true, this[i$7].length = 0, this[n$4] = 0, typeof this.close == "function" && !this[B] && this.close(), t$6 ? this.emit("error", t$6) : this.emit(r), this);
616
+ }
617
+ static isStream(t$6) {
618
+ return !!t$6 && (t$6 instanceof F$3 || t$6 instanceof q$1 || t$6 instanceof Z && (typeof t$6.pipe == "function" || typeof t$6.write == "function" && typeof t$6.end == "function"));
619
+ }
620
+ }
621
+ return s$5.Minipass = F$3, s$5;
622
+ }
623
+ var e$2, o$4;
624
+ function a$7() {
625
+ return o$4 || (o$4 = 1, e$2 = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) !== "win32" ? (r) => r : (r) => r && r.replace(/\\/g, "/")), e$2;
626
+ }
627
+ var n$2, a$6;
628
+ function u$3() {
629
+ if (a$6) return n$2;
630
+ a$6 = 1;
631
+ const { Minipass: o$5 } = ft(), s$7 = a$7(), r = Symbol("slurp");
632
+ return n$2 = class extends o$5 {
633
+ constructor(t$6, e$6, i$7) {
634
+ switch (super(), this.pause(), this.extended = e$6, this.globalExtended = i$7, this.header = t$6, this.startBlockSize = 512 * Math.ceil(t$6.size / 512), this.blockRemain = this.startBlockSize, this.remain = t$6.size, this.type = t$6.type, this.meta = false, this.ignore = false, this.type) {
635
+ case "File":
636
+ case "OldFile":
637
+ case "Link":
638
+ case "SymbolicLink":
639
+ case "CharacterDevice":
640
+ case "BlockDevice":
641
+ case "Directory":
642
+ case "FIFO":
643
+ case "ContiguousFile":
644
+ case "GNUDumpDir": break;
645
+ case "NextFileHasLongLinkpath":
646
+ case "NextFileHasLongPath":
647
+ case "OldGnuLongPath":
648
+ case "GlobalExtendedHeader":
649
+ case "ExtendedHeader":
650
+ case "OldExtendedHeader":
651
+ this.meta = true;
652
+ break;
653
+ default: this.ignore = true;
654
+ }
655
+ this.path = s$7(t$6.path), this.mode = t$6.mode, this.mode && (this.mode = this.mode & 4095), this.uid = t$6.uid, this.gid = t$6.gid, this.uname = t$6.uname, this.gname = t$6.gname, this.size = t$6.size, this.mtime = t$6.mtime, this.atime = t$6.atime, this.ctime = t$6.ctime, this.linkpath = s$7(t$6.linkpath), this.uname = t$6.uname, this.gname = t$6.gname, e$6 && this[r](e$6), i$7 && this[r](i$7, true);
656
+ }
657
+ write(t$6) {
658
+ const e$6 = t$6.length;
659
+ if (e$6 > this.blockRemain) throw new Error("writing more to entry than is appropriate");
660
+ const i$7 = this.remain, c$5 = this.blockRemain;
661
+ return this.remain = Math.max(0, i$7 - e$6), this.blockRemain = Math.max(0, c$5 - e$6), this.ignore ? true : i$7 >= e$6 ? super.write(t$6) : super.write(t$6.slice(0, i$7));
662
+ }
663
+ [r](t$6, e$6) {
664
+ for (const i$7 in t$6) t$6[i$7] !== null && t$6[i$7] !== void 0 && !(e$6 && i$7 === "path") && (this[i$7] = i$7 === "path" || i$7 === "linkpath" ? s$7(t$6[i$7]) : t$6[i$7]);
665
+ }
666
+ }, n$2;
667
+ }
668
+ var r$2, a$5;
669
+ function f$2() {
670
+ if (a$5) return r$2;
671
+ a$5 = 1;
672
+ const c$5 = E(), d = node_path.default;
673
+ class h {
674
+ constructor(e$6, n$4) {
675
+ this.atime = e$6.atime || null, this.charset = e$6.charset || null, this.comment = e$6.comment || null, this.ctime = e$6.ctime || null, this.gid = e$6.gid || null, this.gname = e$6.gname || null, this.linkpath = e$6.linkpath || null, this.mtime = e$6.mtime || null, this.path = e$6.path || null, this.size = e$6.size || null, this.uid = e$6.uid || null, this.uname = e$6.uname || null, this.dev = e$6.dev || null, this.ino = e$6.ino || null, this.nlink = e$6.nlink || null, this.global = n$4 || false;
676
+ }
677
+ encode() {
678
+ const e$6 = this.encodeBody();
679
+ if (e$6 === "") return null;
680
+ const n$4 = Buffer.byteLength(e$6), l$1 = 512 * Math.ceil(1 + n$4 / 512), i$7 = Buffer.allocUnsafe(l$1);
681
+ for (let t$6 = 0; t$6 < 512; t$6++) i$7[t$6] = 0;
682
+ new c$5({
683
+ path: ("PaxHeader/" + d.basename(this.path)).slice(0, 99),
684
+ mode: this.mode || 420,
685
+ uid: this.uid || null,
686
+ gid: this.gid || null,
687
+ size: n$4,
688
+ mtime: this.mtime || null,
689
+ type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader",
690
+ linkpath: "",
691
+ uname: this.uname || "",
692
+ gname: this.gname || "",
693
+ devmaj: 0,
694
+ devmin: 0,
695
+ atime: this.atime || null,
696
+ ctime: this.ctime || null
697
+ }).encode(i$7), i$7.write(e$6, 512, n$4, "utf8");
698
+ for (let t$6 = n$4 + 512; t$6 < i$7.length; t$6++) i$7[t$6] = 0;
699
+ return i$7;
700
+ }
701
+ encodeBody() {
702
+ 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");
703
+ }
704
+ encodeField(e$6) {
705
+ if (this[e$6] === null || this[e$6] === void 0) return "";
706
+ const n$4 = this[e$6] instanceof Date ? this[e$6].getTime() / 1e3 : this[e$6], l$1 = " " + (e$6 === "dev" || e$6 === "ino" || e$6 === "nlink" ? "SCHILY." : "") + e$6 + "=" + n$4 + `
707
+ `, i$7 = Buffer.byteLength(l$1);
708
+ let t$6 = Math.floor(Math.log(i$7) / Math.log(10)) + 1;
709
+ return i$7 + t$6 >= Math.pow(10, t$6) && (t$6 += 1), t$6 + i$7 + l$1;
710
+ }
711
+ }
712
+ h.parse = (s$7, e$6, n$4) => new h(o$5(u$5(s$7), e$6), n$4);
713
+ const o$5 = (s$7, e$6) => e$6 ? Object.keys(s$7).reduce((n$4, l$1) => (n$4[l$1] = s$7[l$1], n$4), e$6) : s$7, u$5 = (s$7) => s$7.replace(/\n$/, "").split(`
714
+ `).reduce(m$3, Object.create(null)), m$3 = (s$7, e$6) => {
715
+ const n$4 = parseInt(e$6, 10);
716
+ if (n$4 !== Buffer.byteLength(e$6) + 1) return s$7;
717
+ e$6 = e$6.slice((n$4 + " ").length);
718
+ const l$1 = e$6.split("="), i$7 = l$1.shift().replace(/^SCHILY\.(dev|ino|nlink)/, "$1");
719
+ if (!i$7) return s$7;
720
+ const t$6 = l$1.join("=");
721
+ return s$7[i$7] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i$7) ? /* @__PURE__ */ new Date(t$6 * 1e3) : /^[0-9]+$/.test(t$6) ? +t$6 : t$6, s$7;
722
+ };
723
+ return r$2 = h, r$2;
724
+ }
725
+ var i$3 = {};
726
+ var _, R$1;
727
+ function T() {
728
+ if (R$1) return _;
729
+ R$1 = 1;
730
+ const E$1 = node_zlib.default.constants || { ZLIB_VERNUM: 4736 };
731
+ return _ = Object.freeze(Object.assign(Object.create(null), {
732
+ Z_NO_FLUSH: 0,
733
+ Z_PARTIAL_FLUSH: 1,
734
+ Z_SYNC_FLUSH: 2,
735
+ Z_FULL_FLUSH: 3,
736
+ Z_FINISH: 4,
737
+ Z_BLOCK: 5,
738
+ Z_OK: 0,
739
+ Z_STREAM_END: 1,
740
+ Z_NEED_DICT: 2,
741
+ Z_ERRNO: -1,
742
+ Z_STREAM_ERROR: -2,
743
+ Z_DATA_ERROR: -3,
744
+ Z_MEM_ERROR: -4,
745
+ Z_BUF_ERROR: -5,
746
+ Z_VERSION_ERROR: -6,
747
+ Z_NO_COMPRESSION: 0,
748
+ Z_BEST_SPEED: 1,
749
+ Z_BEST_COMPRESSION: 9,
750
+ Z_DEFAULT_COMPRESSION: -1,
751
+ Z_FILTERED: 1,
752
+ Z_HUFFMAN_ONLY: 2,
753
+ Z_RLE: 3,
754
+ Z_FIXED: 4,
755
+ Z_DEFAULT_STRATEGY: 0,
756
+ DEFLATE: 1,
757
+ INFLATE: 2,
758
+ GZIP: 3,
759
+ GUNZIP: 4,
760
+ DEFLATERAW: 5,
761
+ INFLATERAW: 6,
762
+ UNZIP: 7,
763
+ BROTLI_DECODE: 8,
764
+ BROTLI_ENCODE: 9,
765
+ Z_MIN_WINDOWBITS: 8,
766
+ Z_MAX_WINDOWBITS: 15,
767
+ Z_DEFAULT_WINDOWBITS: 15,
768
+ Z_MIN_CHUNK: 64,
769
+ Z_MAX_CHUNK: Infinity,
770
+ Z_DEFAULT_CHUNK: 16384,
771
+ Z_MIN_MEMLEVEL: 1,
772
+ Z_MAX_MEMLEVEL: 9,
773
+ Z_DEFAULT_MEMLEVEL: 8,
774
+ Z_MIN_LEVEL: -1,
775
+ Z_MAX_LEVEL: 9,
776
+ Z_DEFAULT_LEVEL: -1,
777
+ BROTLI_OPERATION_PROCESS: 0,
778
+ BROTLI_OPERATION_FLUSH: 1,
779
+ BROTLI_OPERATION_FINISH: 2,
780
+ BROTLI_OPERATION_EMIT_METADATA: 3,
781
+ BROTLI_MODE_GENERIC: 0,
782
+ BROTLI_MODE_TEXT: 1,
783
+ BROTLI_MODE_FONT: 2,
784
+ BROTLI_DEFAULT_MODE: 0,
785
+ BROTLI_MIN_QUALITY: 0,
786
+ BROTLI_MAX_QUALITY: 11,
787
+ BROTLI_DEFAULT_QUALITY: 11,
788
+ BROTLI_MIN_WINDOW_BITS: 10,
789
+ BROTLI_MAX_WINDOW_BITS: 24,
790
+ BROTLI_LARGE_MAX_WINDOW_BITS: 30,
791
+ BROTLI_DEFAULT_WINDOW: 22,
792
+ BROTLI_MIN_INPUT_BLOCK_BITS: 16,
793
+ BROTLI_MAX_INPUT_BLOCK_BITS: 24,
794
+ BROTLI_PARAM_MODE: 0,
795
+ BROTLI_PARAM_QUALITY: 1,
796
+ BROTLI_PARAM_LGWIN: 2,
797
+ BROTLI_PARAM_LGBLOCK: 3,
798
+ BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4,
799
+ BROTLI_PARAM_SIZE_HINT: 5,
800
+ BROTLI_PARAM_LARGE_WINDOW: 6,
801
+ BROTLI_PARAM_NPOSTFIX: 7,
802
+ BROTLI_PARAM_NDIRECT: 8,
803
+ BROTLI_DECODER_RESULT_ERROR: 0,
804
+ BROTLI_DECODER_RESULT_SUCCESS: 1,
805
+ BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2,
806
+ BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3,
807
+ BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0,
808
+ BROTLI_DECODER_PARAM_LARGE_WINDOW: 1,
809
+ BROTLI_DECODER_NO_ERROR: 0,
810
+ BROTLI_DECODER_SUCCESS: 1,
811
+ BROTLI_DECODER_NEEDS_MORE_INPUT: 2,
812
+ BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3,
813
+ BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1,
814
+ BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2,
815
+ BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3,
816
+ BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4,
817
+ BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5,
818
+ BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6,
819
+ BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7,
820
+ BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8,
821
+ BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9,
822
+ BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10,
823
+ BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11,
824
+ BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12,
825
+ BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13,
826
+ BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14,
827
+ BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15,
828
+ BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16,
829
+ BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19,
830
+ BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20,
831
+ BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21,
832
+ BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22,
833
+ BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25,
834
+ BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26,
835
+ BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27,
836
+ BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30,
837
+ BROTLI_DECODER_ERROR_UNREACHABLE: -31
838
+ }, E$1)), _;
839
+ }
840
+ var j, H$1;
841
+ function tt() {
842
+ if (H$1) return j;
843
+ H$1 = 1;
844
+ const I = typeof process == "object" && process ? process : {
845
+ stdout: null,
846
+ stderr: null
847
+ }, Y = node_events.default, x = node_stream.default, N = node_string_decoder.default.StringDecoder, u$5 = Symbol("EOF"), a$10 = Symbol("maybeEmitEnd"), c$5 = Symbol("emittedEnd"), S$1 = Symbol("emittingEnd"), E$1 = Symbol("emittedError"), w$2 = Symbol("closed"), P$1 = Symbol("read"), L = Symbol("flush"), _$1 = Symbol("flushChunk"), h = Symbol("encoding"), m$3 = Symbol("decoder"), M = Symbol("flowing"), y$3 = Symbol("paused"), p$1 = Symbol("resume"), s$7 = Symbol("bufferLength"), T$1 = Symbol("bufferPush"), B = Symbol("bufferShift"), r = Symbol("objectMode"), n$4 = Symbol("destroyed"), D = Symbol("emitData"), F$3 = Symbol("emitEnd"), R$2 = Symbol("emitEnd2"), d = Symbol("async"), b = (o$5) => Promise.resolve().then(o$5), C$1 = commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", $ = C$1 && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), G$1 = C$1 && Symbol.iterator || Symbol("iterator not implemented"), V$1 = (o$5) => o$5 === "end" || o$5 === "finish" || o$5 === "prefinish", v$2 = (o$5) => o$5 instanceof ArrayBuffer || typeof o$5 == "object" && o$5.constructor && o$5.constructor.name === "ArrayBuffer" && o$5.byteLength >= 0, J$1 = (o$5) => !Buffer.isBuffer(o$5) && ArrayBuffer.isView(o$5);
848
+ class U {
849
+ constructor(t$6, e$6, i$7) {
850
+ this.src = t$6, this.dest = e$6, this.opts = i$7, this.ondrain = () => t$6[p$1](), e$6.on("drain", this.ondrain);
851
+ }
852
+ unpipe() {
853
+ this.dest.removeListener("drain", this.ondrain);
854
+ }
855
+ proxyErrors() {}
856
+ end() {
857
+ this.unpipe(), this.opts.end && this.dest.end();
858
+ }
859
+ }
860
+ class K extends U {
861
+ unpipe() {
862
+ this.src.removeListener("error", this.proxyErrors), super.unpipe();
863
+ }
864
+ constructor(t$6, e$6, i$7) {
865
+ super(t$6, e$6, i$7), this.proxyErrors = (l$1) => e$6.emit("error", l$1), t$6.on("error", this.proxyErrors);
866
+ }
867
+ }
868
+ return j = class q$1 extends x {
869
+ constructor(t$6) {
870
+ super(), this[M] = false, this[y$3] = false, this.pipes = [], this.buffer = [], this[r] = t$6 && t$6.objectMode || false, this[r] ? this[h] = null : this[h] = t$6 && t$6.encoding || null, this[h] === "buffer" && (this[h] = null), this[d] = t$6 && !!t$6.async || false, this[m$3] = this[h] ? new N(this[h]) : null, this[u$5] = false, this[c$5] = false, this[S$1] = false, this[w$2] = false, this[E$1] = null, this.writable = true, this.readable = true, this[s$7] = 0, this[n$4] = false;
871
+ }
872
+ get bufferLength() {
873
+ return this[s$7];
874
+ }
875
+ get encoding() {
876
+ return this[h];
877
+ }
878
+ set encoding(t$6) {
879
+ if (this[r]) throw new Error("cannot set encoding in objectMode");
880
+ if (this[h] && t$6 !== this[h] && (this[m$3] && this[m$3].lastNeed || this[s$7])) throw new Error("cannot change encoding");
881
+ this[h] !== t$6 && (this[m$3] = t$6 ? new N(t$6) : null, this.buffer.length && (this.buffer = this.buffer.map((e$6) => this[m$3].write(e$6)))), this[h] = t$6;
882
+ }
883
+ setEncoding(t$6) {
884
+ this.encoding = t$6;
885
+ }
886
+ get objectMode() {
887
+ return this[r];
888
+ }
889
+ set objectMode(t$6) {
890
+ this[r] = this[r] || !!t$6;
891
+ }
892
+ get async() {
893
+ return this[d];
894
+ }
895
+ set async(t$6) {
896
+ this[d] = this[d] || !!t$6;
897
+ }
898
+ write(t$6, e$6, i$7) {
899
+ if (this[u$5]) throw new Error("write after end");
900
+ if (this[n$4]) return this.emit("error", Object.assign(/* @__PURE__ */ new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
901
+ typeof e$6 == "function" && (i$7 = e$6, e$6 = "utf8"), e$6 || (e$6 = "utf8");
902
+ const l$1 = this[d] ? b : (f$4) => f$4();
903
+ return !this[r] && !Buffer.isBuffer(t$6) && (J$1(t$6) ? t$6 = Buffer.from(t$6.buffer, t$6.byteOffset, t$6.byteLength) : v$2(t$6) ? t$6 = Buffer.from(t$6) : typeof t$6 != "string" && (this.objectMode = true)), this[r] ? (this.flowing && this[s$7] !== 0 && this[L](true), this.flowing ? this.emit("data", t$6) : this[T$1](t$6), this[s$7] !== 0 && this.emit("readable"), i$7 && l$1(i$7), this.flowing) : t$6.length ? (typeof t$6 == "string" && !(e$6 === this[h] && !this[m$3].lastNeed) && (t$6 = Buffer.from(t$6, e$6)), Buffer.isBuffer(t$6) && this[h] && (t$6 = this[m$3].write(t$6)), this.flowing && this[s$7] !== 0 && this[L](true), this.flowing ? this.emit("data", t$6) : this[T$1](t$6), this[s$7] !== 0 && this.emit("readable"), i$7 && l$1(i$7), this.flowing) : (this[s$7] !== 0 && this.emit("readable"), i$7 && l$1(i$7), this.flowing);
904
+ }
905
+ read(t$6) {
906
+ if (this[n$4]) return null;
907
+ if (this[s$7] === 0 || t$6 === 0 || t$6 > this[s$7]) return this[a$10](), null;
908
+ this[r] && (t$6 = null), this.buffer.length > 1 && !this[r] && (this.encoding ? this.buffer = [this.buffer.join("")] : this.buffer = [Buffer.concat(this.buffer, this[s$7])]);
909
+ const e$6 = this[P$1](t$6 || null, this.buffer[0]);
910
+ return this[a$10](), e$6;
911
+ }
912
+ [P$1](t$6, e$6) {
913
+ return t$6 === e$6.length || t$6 === null ? this[B]() : (this.buffer[0] = e$6.slice(t$6), e$6 = e$6.slice(0, t$6), this[s$7] -= t$6), this.emit("data", e$6), !this.buffer.length && !this[u$5] && this.emit("drain"), e$6;
914
+ }
915
+ end(t$6, e$6, i$7) {
916
+ return typeof t$6 == "function" && (i$7 = t$6, t$6 = null), typeof e$6 == "function" && (i$7 = e$6, e$6 = "utf8"), t$6 && this.write(t$6, e$6), i$7 && this.once("end", i$7), this[u$5] = true, this.writable = false, (this.flowing || !this[y$3]) && this[a$10](), this;
917
+ }
918
+ [p$1]() {
919
+ this[n$4] || (this[y$3] = false, this[M] = true, this.emit("resume"), this.buffer.length ? this[L]() : this[u$5] ? this[a$10]() : this.emit("drain"));
920
+ }
921
+ resume() {
922
+ return this[p$1]();
923
+ }
924
+ pause() {
925
+ this[M] = false, this[y$3] = true;
926
+ }
927
+ get destroyed() {
928
+ return this[n$4];
929
+ }
930
+ get flowing() {
931
+ return this[M];
932
+ }
933
+ get paused() {
934
+ return this[y$3];
935
+ }
936
+ [T$1](t$6) {
937
+ this[r] ? this[s$7] += 1 : this[s$7] += t$6.length, this.buffer.push(t$6);
938
+ }
939
+ [B]() {
940
+ return this.buffer.length && (this[r] ? this[s$7] -= 1 : this[s$7] -= this.buffer[0].length), this.buffer.shift();
941
+ }
942
+ [L](t$6) {
943
+ do ;
944
+ while (this[_$1](this[B]()));
945
+ !t$6 && !this.buffer.length && !this[u$5] && this.emit("drain");
946
+ }
947
+ [_$1](t$6) {
948
+ return t$6 ? (this.emit("data", t$6), this.flowing) : false;
949
+ }
950
+ pipe(t$6, e$6) {
951
+ if (this[n$4]) return;
952
+ const i$7 = this[c$5];
953
+ return e$6 = e$6 || {}, t$6 === I.stdout || t$6 === I.stderr ? e$6.end = false : e$6.end = e$6.end !== false, e$6.proxyErrors = !!e$6.proxyErrors, i$7 ? e$6.end && t$6.end() : (this.pipes.push(e$6.proxyErrors ? new K(this, t$6, e$6) : new U(this, t$6, e$6)), this[d] ? b(() => this[p$1]()) : this[p$1]()), t$6;
954
+ }
955
+ unpipe(t$6) {
956
+ const e$6 = this.pipes.find((i$7) => i$7.dest === t$6);
957
+ e$6 && (this.pipes.splice(this.pipes.indexOf(e$6), 1), e$6.unpipe());
958
+ }
959
+ addListener(t$6, e$6) {
960
+ return this.on(t$6, e$6);
961
+ }
962
+ on(t$6, e$6) {
963
+ const i$7 = super.on(t$6, e$6);
964
+ return t$6 === "data" && !this.pipes.length && !this.flowing ? this[p$1]() : t$6 === "readable" && this[s$7] !== 0 ? super.emit("readable") : V$1(t$6) && this[c$5] ? (super.emit(t$6), this.removeAllListeners(t$6)) : t$6 === "error" && this[E$1] && (this[d] ? b(() => e$6.call(this, this[E$1])) : e$6.call(this, this[E$1])), i$7;
965
+ }
966
+ get emittedEnd() {
967
+ return this[c$5];
968
+ }
969
+ [a$10]() {
970
+ !this[S$1] && !this[c$5] && !this[n$4] && this.buffer.length === 0 && this[u$5] && (this[S$1] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[w$2] && this.emit("close"), this[S$1] = false);
971
+ }
972
+ emit(t$6, e$6, ...i$7) {
973
+ if (t$6 !== "error" && t$6 !== "close" && t$6 !== n$4 && this[n$4]) return;
974
+ if (t$6 === "data") return e$6 ? this[d] ? b(() => this[D](e$6)) : this[D](e$6) : false;
975
+ if (t$6 === "end") return this[F$3]();
976
+ if (t$6 === "close") {
977
+ if (this[w$2] = true, !this[c$5] && !this[n$4]) return;
978
+ const f$4 = super.emit("close");
979
+ return this.removeAllListeners("close"), f$4;
980
+ } else if (t$6 === "error") {
981
+ this[E$1] = e$6;
982
+ const f$4 = super.emit("error", e$6);
983
+ return this[a$10](), f$4;
984
+ } else if (t$6 === "resume") {
985
+ const f$4 = super.emit("resume");
986
+ return this[a$10](), f$4;
987
+ } else if (t$6 === "finish" || t$6 === "prefinish") {
988
+ const f$4 = super.emit(t$6);
989
+ return this.removeAllListeners(t$6), f$4;
990
+ }
991
+ const l$1 = super.emit(t$6, e$6, ...i$7);
992
+ return this[a$10](), l$1;
993
+ }
994
+ [D](t$6) {
995
+ for (const i$7 of this.pipes) i$7.dest.write(t$6) === false && this.pause();
996
+ const e$6 = super.emit("data", t$6);
997
+ return this[a$10](), e$6;
998
+ }
999
+ [F$3]() {
1000
+ this[c$5] || (this[c$5] = true, this.readable = false, this[d] ? b(() => this[R$2]()) : this[R$2]());
1001
+ }
1002
+ [R$2]() {
1003
+ if (this[m$3]) {
1004
+ const e$6 = this[m$3].end();
1005
+ if (e$6) {
1006
+ for (const i$7 of this.pipes) i$7.dest.write(e$6);
1007
+ super.emit("data", e$6);
1008
+ }
1009
+ }
1010
+ for (const e$6 of this.pipes) e$6.end();
1011
+ const t$6 = super.emit("end");
1012
+ return this.removeAllListeners("end"), t$6;
1013
+ }
1014
+ collect() {
1015
+ const t$6 = [];
1016
+ this[r] || (t$6.dataLength = 0);
1017
+ const e$6 = this.promise();
1018
+ return this.on("data", (i$7) => {
1019
+ t$6.push(i$7), this[r] || (t$6.dataLength += i$7.length);
1020
+ }), e$6.then(() => t$6);
1021
+ }
1022
+ concat() {
1023
+ return this[r] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this.collect().then((t$6) => this[r] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this[h] ? t$6.join("") : Buffer.concat(t$6, t$6.dataLength));
1024
+ }
1025
+ promise() {
1026
+ return new Promise((t$6, e$6) => {
1027
+ this.on(n$4, () => e$6(/* @__PURE__ */ new Error("stream destroyed"))), this.on("error", (i$7) => e$6(i$7)), this.on("end", () => t$6());
1028
+ });
1029
+ }
1030
+ [$]() {
1031
+ return { next: () => {
1032
+ const e$6 = this.read();
1033
+ if (e$6 !== null) return Promise.resolve({
1034
+ done: false,
1035
+ value: e$6
1036
+ });
1037
+ if (this[u$5]) return Promise.resolve({ done: true });
1038
+ let i$7 = null, l$1 = null;
1039
+ const f$4 = (g) => {
1040
+ this.removeListener("data", A), this.removeListener("end", O$3), l$1(g);
1041
+ }, A = (g) => {
1042
+ this.removeListener("error", f$4), this.removeListener("end", O$3), this.pause(), i$7({
1043
+ value: g,
1044
+ done: !!this[u$5]
1045
+ });
1046
+ }, O$3 = () => {
1047
+ this.removeListener("error", f$4), this.removeListener("data", A), i$7({ done: true });
1048
+ }, W = () => f$4(/* @__PURE__ */ new Error("stream destroyed"));
1049
+ return new Promise((g, z$1) => {
1050
+ l$1 = z$1, i$7 = g, this.once(n$4, W), this.once("error", f$4), this.once("end", O$3), this.once("data", A);
1051
+ });
1052
+ } };
1053
+ }
1054
+ [G$1]() {
1055
+ return { next: () => {
1056
+ const e$6 = this.read();
1057
+ return {
1058
+ value: e$6,
1059
+ done: e$6 === null
1060
+ };
1061
+ } };
1062
+ }
1063
+ destroy(t$6) {
1064
+ return this[n$4] ? (t$6 ? this.emit("error", t$6) : this.emit(n$4), this) : (this[n$4] = true, this.buffer.length = 0, this[s$7] = 0, typeof this.close == "function" && !this[w$2] && this.close(), t$6 ? this.emit("error", t$6) : this.emit(n$4), this);
1065
+ }
1066
+ static isStream(t$6) {
1067
+ return !!t$6 && (t$6 instanceof q$1 || t$6 instanceof x || t$6 instanceof Y && (typeof t$6.pipe == "function" || typeof t$6.write == "function" && typeof t$6.end == "function"));
1068
+ }
1069
+ }, j;
1070
+ }
1071
+ var C;
1072
+ function J() {
1073
+ if (C) return i$3;
1074
+ C = 1;
1075
+ const w$2 = node_assert.default, n$4 = node_buffer.default.Buffer, z$1 = node_zlib.default, u$5 = i$3.constants = T(), L = tt(), E$1 = n$4.concat, c$5 = Symbol("_superWrite");
1076
+ class d extends Error {
1077
+ constructor(s$7) {
1078
+ super("zlib: " + s$7.message), this.code = s$7.code, this.errno = s$7.errno, this.code || (this.code = "ZLIB_ERROR"), this.message = "zlib: " + s$7.message, Error.captureStackTrace(this, this.constructor);
1079
+ }
1080
+ get name() {
1081
+ return "ZlibError";
1082
+ }
1083
+ }
1084
+ const Z = Symbol("opts"), p$1 = Symbol("flushFlag"), I = Symbol("finishFlushFlag"), y$3 = Symbol("fullFlushFlag"), t$6 = Symbol("handle"), _$1 = Symbol("onError"), f$4 = Symbol("sawError"), F$3 = Symbol("level"), S$1 = Symbol("strategy"), g = Symbol("ended");
1085
+ class x extends L {
1086
+ constructor(s$7, e$6) {
1087
+ if (!s$7 || typeof s$7 != "object") throw new TypeError("invalid options for ZlibBase constructor");
1088
+ super(s$7), this[f$4] = false, this[g] = false, this[Z] = s$7, this[p$1] = s$7.flush, this[I] = s$7.finishFlush;
1089
+ try {
1090
+ this[t$6] = new z$1[e$6](s$7);
1091
+ } catch (i$7) {
1092
+ throw new d(i$7);
1093
+ }
1094
+ this[_$1] = (i$7) => {
1095
+ this[f$4] || (this[f$4] = true, this.close(), this.emit("error", i$7));
1096
+ }, this[t$6].on("error", (i$7) => this[_$1](new d(i$7))), this.once("end", () => this.close);
1097
+ }
1098
+ close() {
1099
+ this[t$6] && (this[t$6].close(), this[t$6] = null, this.emit("close"));
1100
+ }
1101
+ reset() {
1102
+ if (!this[f$4]) return w$2(this[t$6], "zlib binding closed"), this[t$6].reset();
1103
+ }
1104
+ flush(s$7) {
1105
+ this.ended || (typeof s$7 != "number" && (s$7 = this[y$3]), this.write(Object.assign(n$4.alloc(0), { [p$1]: s$7 })));
1106
+ }
1107
+ end(s$7, e$6, i$7) {
1108
+ return s$7 && this.write(s$7, e$6), this.flush(this[I]), this[g] = true, super.end(null, null, i$7);
1109
+ }
1110
+ get ended() {
1111
+ return this[g];
1112
+ }
1113
+ write(s$7, e$6, i$7) {
1114
+ if (typeof e$6 == "function" && (i$7 = e$6, e$6 = "utf8"), typeof s$7 == "string" && (s$7 = n$4.from(s$7, e$6)), this[f$4]) return;
1115
+ w$2(this[t$6], "zlib binding closed");
1116
+ const m$3 = this[t$6]._handle, R$2 = m$3.close;
1117
+ m$3.close = () => {};
1118
+ const G$1 = this[t$6].close;
1119
+ this[t$6].close = () => {}, n$4.concat = (l$1) => l$1;
1120
+ let h;
1121
+ try {
1122
+ const l$1 = typeof s$7[p$1] == "number" ? s$7[p$1] : this[p$1];
1123
+ h = this[t$6]._processChunk(s$7, l$1), n$4.concat = E$1;
1124
+ } catch (l$1) {
1125
+ n$4.concat = E$1, this[_$1](new d(l$1));
1126
+ } finally {
1127
+ this[t$6] && (this[t$6]._handle = m$3, m$3.close = R$2, this[t$6].close = G$1, this[t$6].removeAllListeners("error"));
1128
+ }
1129
+ this[t$6] && this[t$6].on("error", (l$1) => this[_$1](new d(l$1)));
1130
+ let b;
1131
+ if (h) if (Array.isArray(h) && h.length > 0) {
1132
+ b = this[c$5](n$4.from(h[0]));
1133
+ for (let l$1 = 1; l$1 < h.length; l$1++) b = this[c$5](h[l$1]);
1134
+ } else b = this[c$5](n$4.from(h));
1135
+ return i$7 && i$7(), b;
1136
+ }
1137
+ [c$5](s$7) {
1138
+ return super.write(s$7);
1139
+ }
1140
+ }
1141
+ class a$10 extends x {
1142
+ constructor(s$7, e$6) {
1143
+ s$7 = s$7 || {}, s$7.flush = s$7.flush || u$5.Z_NO_FLUSH, s$7.finishFlush = s$7.finishFlush || u$5.Z_FINISH, super(s$7, e$6), this[y$3] = u$5.Z_FULL_FLUSH, this[F$3] = s$7.level, this[S$1] = s$7.strategy;
1144
+ }
1145
+ params(s$7, e$6) {
1146
+ if (!this[f$4]) {
1147
+ if (!this[t$6]) throw new Error("cannot switch params when binding is closed");
1148
+ if (!this[t$6].params) throw new Error("not supported in this implementation");
1149
+ if (this[F$3] !== s$7 || this[S$1] !== e$6) {
1150
+ this.flush(u$5.Z_SYNC_FLUSH), w$2(this[t$6], "zlib binding closed");
1151
+ const i$7 = this[t$6].flush;
1152
+ this[t$6].flush = (m$3, R$2) => {
1153
+ this.flush(m$3), R$2();
1154
+ };
1155
+ try {
1156
+ this[t$6].params(s$7, e$6);
1157
+ } finally {
1158
+ this[t$6].flush = i$7;
1159
+ }
1160
+ this[t$6] && (this[F$3] = s$7, this[S$1] = e$6);
1161
+ }
1162
+ }
1163
+ }
1164
+ }
1165
+ class q$1 extends a$10 {
1166
+ constructor(s$7) {
1167
+ super(s$7, "Deflate");
1168
+ }
1169
+ }
1170
+ class D extends a$10 {
1171
+ constructor(s$7) {
1172
+ super(s$7, "Inflate");
1173
+ }
1174
+ }
1175
+ const B = Symbol("_portable");
1176
+ class $ extends a$10 {
1177
+ constructor(s$7) {
1178
+ super(s$7, "Gzip"), this[B] = s$7 && !!s$7.portable;
1179
+ }
1180
+ [c$5](s$7) {
1181
+ return this[B] ? (this[B] = false, s$7[9] = 255, super[c$5](s$7)) : super[c$5](s$7);
1182
+ }
1183
+ }
1184
+ class N extends a$10 {
1185
+ constructor(s$7) {
1186
+ super(s$7, "Gunzip");
1187
+ }
1188
+ }
1189
+ class H$3 extends a$10 {
1190
+ constructor(s$7) {
1191
+ super(s$7, "DeflateRaw");
1192
+ }
1193
+ }
1194
+ let T$1 = class T$2 extends a$10 {
1195
+ constructor(s$7) {
1196
+ super(s$7, "InflateRaw");
1197
+ }
1198
+ };
1199
+ class U extends a$10 {
1200
+ constructor(s$7) {
1201
+ super(s$7, "Unzip");
1202
+ }
1203
+ }
1204
+ class O$3 extends x {
1205
+ constructor(s$7, e$6) {
1206
+ s$7 = s$7 || {}, s$7.flush = s$7.flush || u$5.BROTLI_OPERATION_PROCESS, s$7.finishFlush = s$7.finishFlush || u$5.BROTLI_OPERATION_FINISH, super(s$7, e$6), this[y$3] = u$5.BROTLI_OPERATION_FLUSH;
1207
+ }
1208
+ }
1209
+ class v$2 extends O$3 {
1210
+ constructor(s$7) {
1211
+ super(s$7, "BrotliCompress");
1212
+ }
1213
+ }
1214
+ class A extends O$3 {
1215
+ constructor(s$7) {
1216
+ super(s$7, "BrotliDecompress");
1217
+ }
1218
+ }
1219
+ return i$3.Deflate = q$1, i$3.Inflate = D, i$3.Gzip = $, i$3.Gunzip = N, i$3.DeflateRaw = H$3, i$3.InflateRaw = T$1, i$3.Unzip = U, typeof z$1.BrotliCompress == "function" ? (i$3.BrotliCompress = v$2, i$3.BrotliDecompress = A) : i$3.BrotliCompress = i$3.BrotliDecompress = class {
1220
+ constructor() {
1221
+ throw new Error("Brotli is not supported in this version of Node.js");
1222
+ }
1223
+ }, i$3;
1224
+ }
1225
+ var O$1, F$2;
1226
+ function rt() {
1227
+ if (F$2) return O$1;
1228
+ F$2 = 1;
1229
+ const P$1 = c$4(), $ = E(), v$2 = node_events.default, W = c$3(), G$1 = 1024 * 1024, k$1 = u$3(), C$1 = f$2(), x = J(), { nextTick: j$2 } = node_process.default, B = Buffer.from([31, 139]), h = Symbol("state"), d = Symbol("writeEntry"), a$10 = Symbol("readEntry"), I = Symbol("nextEntry"), U = Symbol("processEntry"), l$1 = Symbol("extendedHeader"), y$3 = Symbol("globalExtendedHeader"), c$5 = Symbol("meta"), H$3 = Symbol("emitMeta"), n$4 = Symbol("buffer"), f$4 = Symbol("queue"), u$5 = Symbol("ended"), L = Symbol("emittedEnd"), b = Symbol("emit"), r = Symbol("unzip"), _$1 = Symbol("consumeChunk"), g = Symbol("consumeChunkSub"), q$1 = Symbol("consumeBody"), z$1 = Symbol("consumeMeta"), Y = Symbol("consumeHeader"), N = Symbol("consuming"), D = Symbol("bufferConcat"), M = Symbol("maybeEnd"), S$1 = Symbol("writing"), m$3 = Symbol("aborted"), T$1 = Symbol("onDone"), E$1 = Symbol("sawValidEntry"), R$2 = Symbol("sawNullBlock"), A = Symbol("sawEOF"), V$1 = Symbol("closeStream"), K = (X$2) => true;
1230
+ return O$1 = P$1(class extends v$2 {
1231
+ constructor(t$6) {
1232
+ t$6 = t$6 || {}, super(t$6), this.file = t$6.file || "", this[E$1] = null, this.on(T$1, (s$7) => {
1233
+ (this[h] === "begin" || this[E$1] === false) && this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
1234
+ }), t$6.ondone ? this.on(T$1, t$6.ondone) : this.on(T$1, (s$7) => {
1235
+ this.emit("prefinish"), this.emit("finish"), this.emit("end");
1236
+ }), this.strict = !!t$6.strict, this.maxMetaEntrySize = t$6.maxMetaEntrySize || G$1, this.filter = typeof t$6.filter == "function" ? t$6.filter : K;
1237
+ const i$7 = t$6.file && (t$6.file.endsWith(".tar.br") || t$6.file.endsWith(".tbr"));
1238
+ this.brotli = !t$6.gzip && t$6.brotli !== void 0 ? t$6.brotli : i$7 ? void 0 : false, this.writable = true, this.readable = false, this[f$4] = new W(), this[n$4] = null, this[a$10] = null, this[d] = null, this[h] = "begin", this[c$5] = "", this[l$1] = null, this[y$3] = null, this[u$5] = false, this[r] = null, this[m$3] = false, this[R$2] = false, this[A] = false, this.on("end", () => this[V$1]()), typeof t$6.onwarn == "function" && this.on("warn", t$6.onwarn), typeof t$6.onentry == "function" && this.on("entry", t$6.onentry);
1239
+ }
1240
+ [Y](t$6, i$7) {
1241
+ this[E$1] === null && (this[E$1] = false);
1242
+ let s$7;
1243
+ try {
1244
+ s$7 = new $(t$6, i$7, this[l$1], this[y$3]);
1245
+ } catch (o$5) {
1246
+ return this.warn("TAR_ENTRY_INVALID", o$5);
1247
+ }
1248
+ if (s$7.nullBlock) this[R$2] ? (this[A] = true, this[h] === "begin" && (this[h] = "header"), this[b]("eof")) : (this[R$2] = true, this[b]("nullBlock"));
1249
+ else if (this[R$2] = false, !s$7.cksumValid) this.warn("TAR_ENTRY_INVALID", "checksum failure", { header: s$7 });
1250
+ else if (!s$7.path) this.warn("TAR_ENTRY_INVALID", "path is required", { header: s$7 });
1251
+ else {
1252
+ const o$5 = s$7.type;
1253
+ if (/^(Symbolic)?Link$/.test(o$5) && !s$7.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath required", { header: s$7 });
1254
+ else if (!/^(Symbolic)?Link$/.test(o$5) && s$7.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { header: s$7 });
1255
+ else {
1256
+ const e$6 = this[d] = new k$1(s$7, this[l$1], this[y$3]);
1257
+ if (!this[E$1]) if (e$6.remain) {
1258
+ const w$2 = () => {
1259
+ e$6.invalid || (this[E$1] = true);
1260
+ };
1261
+ e$6.on("end", w$2);
1262
+ } else this[E$1] = true;
1263
+ e$6.meta ? e$6.size > this.maxMetaEntrySize ? (e$6.ignore = true, this[b]("ignoredEntry", e$6), this[h] = "ignore", e$6.resume()) : e$6.size > 0 && (this[c$5] = "", e$6.on("data", (w$2) => this[c$5] += w$2), this[h] = "meta") : (this[l$1] = null, e$6.ignore = e$6.ignore || !this.filter(e$6.path, e$6), e$6.ignore ? (this[b]("ignoredEntry", e$6), this[h] = e$6.remain ? "ignore" : "header", e$6.resume()) : (e$6.remain ? this[h] = "body" : (this[h] = "header", e$6.end()), this[a$10] ? this[f$4].push(e$6) : (this[f$4].push(e$6), this[I]())));
1264
+ }
1265
+ }
1266
+ }
1267
+ [V$1]() {
1268
+ j$2(() => this.emit("close"));
1269
+ }
1270
+ [U](t$6) {
1271
+ let i$7 = true;
1272
+ return t$6 ? Array.isArray(t$6) ? this.emit.apply(this, t$6) : (this[a$10] = t$6, this.emit("entry", t$6), t$6.emittedEnd || (t$6.on("end", (s$7) => this[I]()), i$7 = false)) : (this[a$10] = null, i$7 = false), i$7;
1273
+ }
1274
+ [I]() {
1275
+ do ;
1276
+ while (this[U](this[f$4].shift()));
1277
+ if (!this[f$4].length) {
1278
+ const t$6 = this[a$10];
1279
+ !t$6 || t$6.flowing || t$6.size === t$6.remain ? this[S$1] || this.emit("drain") : t$6.once("drain", (s$7) => this.emit("drain"));
1280
+ }
1281
+ }
1282
+ [q$1](t$6, i$7) {
1283
+ const s$7 = this[d], o$5 = s$7.blockRemain, e$6 = o$5 >= t$6.length && i$7 === 0 ? t$6 : t$6.slice(i$7, i$7 + o$5);
1284
+ return s$7.write(e$6), s$7.blockRemain || (this[h] = "header", this[d] = null, s$7.end()), e$6.length;
1285
+ }
1286
+ [z$1](t$6, i$7) {
1287
+ const s$7 = this[d], o$5 = this[q$1](t$6, i$7);
1288
+ return this[d] || this[H$3](s$7), o$5;
1289
+ }
1290
+ [b](t$6, i$7, s$7) {
1291
+ !this[f$4].length && !this[a$10] ? this.emit(t$6, i$7, s$7) : this[f$4].push([
1292
+ t$6,
1293
+ i$7,
1294
+ s$7
1295
+ ]);
1296
+ }
1297
+ [H$3](t$6) {
1298
+ switch (this[b]("meta", this[c$5]), t$6.type) {
1299
+ case "ExtendedHeader":
1300
+ case "OldExtendedHeader":
1301
+ this[l$1] = C$1.parse(this[c$5], this[l$1], false);
1302
+ break;
1303
+ case "GlobalExtendedHeader":
1304
+ this[y$3] = C$1.parse(this[c$5], this[y$3], true);
1305
+ break;
1306
+ case "NextFileHasLongPath":
1307
+ case "OldGnuLongPath":
1308
+ this[l$1] = this[l$1] || Object.create(null), this[l$1].path = this[c$5].replace(/\0.*/, "");
1309
+ break;
1310
+ case "NextFileHasLongLinkpath":
1311
+ this[l$1] = this[l$1] || Object.create(null), this[l$1].linkpath = this[c$5].replace(/\0.*/, "");
1312
+ break;
1313
+ default: throw new Error("unknown meta: " + t$6.type);
1314
+ }
1315
+ }
1316
+ abort(t$6) {
1317
+ this[m$3] = true, this.emit("abort", t$6), this.warn("TAR_ABORT", t$6, { recoverable: false });
1318
+ }
1319
+ write(t$6) {
1320
+ if (this[m$3]) return;
1321
+ if ((this[r] === null || this.brotli === void 0 && this[r] === false) && t$6) {
1322
+ if (this[n$4] && (t$6 = Buffer.concat([this[n$4], t$6]), this[n$4] = null), t$6.length < B.length) return this[n$4] = t$6, true;
1323
+ for (let e$6 = 0; this[r] === null && e$6 < B.length; e$6++) t$6[e$6] !== B[e$6] && (this[r] = false);
1324
+ const o$5 = this.brotli === void 0;
1325
+ if (this[r] === false && o$5) if (t$6.length < 512) if (this[u$5]) this.brotli = true;
1326
+ else return this[n$4] = t$6, true;
1327
+ else try {
1328
+ new $(t$6.slice(0, 512)), this.brotli = !1;
1329
+ } catch {
1330
+ this.brotli = true;
1331
+ }
1332
+ if (this[r] === null || this[r] === false && this.brotli) {
1333
+ const e$6 = this[u$5];
1334
+ this[u$5] = false, this[r] = this[r] === null ? new x.Unzip() : new x.BrotliDecompress(), this[r].on("data", (p$1) => this[_$1](p$1)), this[r].on("error", (p$1) => this.abort(p$1)), this[r].on("end", (p$1) => {
1335
+ this[u$5] = true, this[_$1]();
1336
+ }), this[S$1] = true;
1337
+ const w$2 = this[r][e$6 ? "end" : "write"](t$6);
1338
+ return this[S$1] = false, w$2;
1339
+ }
1340
+ }
1341
+ this[S$1] = true, this[r] ? this[r].write(t$6) : this[_$1](t$6), this[S$1] = false;
1342
+ const s$7 = this[f$4].length ? false : this[a$10] ? this[a$10].flowing : true;
1343
+ return !s$7 && !this[f$4].length && this[a$10].once("drain", (o$5) => this.emit("drain")), s$7;
1344
+ }
1345
+ [D](t$6) {
1346
+ t$6 && !this[m$3] && (this[n$4] = this[n$4] ? Buffer.concat([this[n$4], t$6]) : t$6);
1347
+ }
1348
+ [M]() {
1349
+ if (this[u$5] && !this[L] && !this[m$3] && !this[N]) {
1350
+ this[L] = true;
1351
+ const t$6 = this[d];
1352
+ if (t$6 && t$6.blockRemain) {
1353
+ const i$7 = this[n$4] ? this[n$4].length : 0;
1354
+ this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${t$6.blockRemain} more bytes, only ${i$7} available)`, { entry: t$6 }), this[n$4] && t$6.write(this[n$4]), t$6.end();
1355
+ }
1356
+ this[b](T$1);
1357
+ }
1358
+ }
1359
+ [_$1](t$6) {
1360
+ if (this[N]) this[D](t$6);
1361
+ else if (!t$6 && !this[n$4]) this[M]();
1362
+ else {
1363
+ if (this[N] = true, this[n$4]) {
1364
+ this[D](t$6);
1365
+ const i$7 = this[n$4];
1366
+ this[n$4] = null, this[g](i$7);
1367
+ } else this[g](t$6);
1368
+ for (; this[n$4] && this[n$4].length >= 512 && !this[m$3] && !this[A];) {
1369
+ const i$7 = this[n$4];
1370
+ this[n$4] = null, this[g](i$7);
1371
+ }
1372
+ this[N] = false;
1373
+ }
1374
+ (!this[n$4] || this[u$5]) && this[M]();
1375
+ }
1376
+ [g](t$6) {
1377
+ let i$7 = 0;
1378
+ const s$7 = t$6.length;
1379
+ for (; i$7 + 512 <= s$7 && !this[m$3] && !this[A];) switch (this[h]) {
1380
+ case "begin":
1381
+ case "header":
1382
+ this[Y](t$6, i$7), i$7 += 512;
1383
+ break;
1384
+ case "ignore":
1385
+ case "body":
1386
+ i$7 += this[q$1](t$6, i$7);
1387
+ break;
1388
+ case "meta":
1389
+ i$7 += this[z$1](t$6, i$7);
1390
+ break;
1391
+ default: throw new Error("invalid state: " + this[h]);
1392
+ }
1393
+ i$7 < s$7 && (this[n$4] ? this[n$4] = Buffer.concat([t$6.slice(i$7), this[n$4]]) : this[n$4] = t$6.slice(i$7));
1394
+ }
1395
+ end(t$6) {
1396
+ this[m$3] || (this[r] ? this[r].end(t$6) : (this[u$5] = true, this.brotli === void 0 && (t$6 = t$6 || Buffer.alloc(0)), this.write(t$6)));
1397
+ }
1398
+ }), O$1;
1399
+ }
1400
+ var s$4 = {};
1401
+ var v$1;
1402
+ function X() {
1403
+ if (v$1) return s$4;
1404
+ v$1 = 1;
1405
+ const H$3 = tt(), I = node_events.default.EventEmitter, r = node_fs.default;
1406
+ let R$2 = r.writev;
1407
+ if (!R$2) {
1408
+ const c$5 = process.binding("fs"), t$6 = c$5.FSReqWrap || c$5.FSReqCallback;
1409
+ R$2 = (e$6, i$7, $, A) => {
1410
+ const G$1 = (J$1, K) => A(J$1, K, i$7), j$2 = new t$6();
1411
+ j$2.oncomplete = G$1, c$5.writeBuffers(e$6, i$7, $, j$2);
1412
+ };
1413
+ }
1414
+ const m$3 = Symbol("_autoClose"), h = Symbol("_close"), g = Symbol("_ended"), s$7 = Symbol("_fd"), B = Symbol("_finished"), o$5 = Symbol("_flags"), x = Symbol("_flush"), z$1 = Symbol("_handleChunk"), T$1 = Symbol("_makeBuf"), q$1 = Symbol("_mode"), E$1 = Symbol("_needDrain"), d = Symbol("_onerror"), y$3 = Symbol("_onopen"), W = Symbol("_onread"), _$1 = Symbol("_onwrite"), a$10 = Symbol("_open"), l$1 = Symbol("_path"), u$5 = Symbol("_pos"), n$4 = Symbol("_queue"), S$1 = Symbol("_read"), M = Symbol("_readSize"), f$4 = Symbol("_reading"), k$1 = Symbol("_remain"), N = Symbol("_size"), C$1 = Symbol("_write"), b = Symbol("_writing"), F$3 = Symbol("_defaultFlag"), p$1 = Symbol("_errored");
1415
+ class D extends H$3 {
1416
+ constructor(t$6, e$6) {
1417
+ if (e$6 = e$6 || {}, super(e$6), this.readable = true, this.writable = false, typeof t$6 != "string") throw new TypeError("path must be a string");
1418
+ this[p$1] = false, this[s$7] = typeof e$6.fd == "number" ? e$6.fd : null, this[l$1] = t$6, this[M] = e$6.readSize || 16 * 1024 * 1024, this[f$4] = false, this[N] = typeof e$6.size == "number" ? e$6.size : Infinity, this[k$1] = this[N], this[m$3] = typeof e$6.autoClose == "boolean" ? e$6.autoClose : true, typeof this[s$7] == "number" ? this[S$1]() : this[a$10]();
1419
+ }
1420
+ get fd() {
1421
+ return this[s$7];
1422
+ }
1423
+ get path() {
1424
+ return this[l$1];
1425
+ }
1426
+ write() {
1427
+ throw new TypeError("this is a readable stream");
1428
+ }
1429
+ end() {
1430
+ throw new TypeError("this is a readable stream");
1431
+ }
1432
+ [a$10]() {
1433
+ r.open(this[l$1], "r", (t$6, e$6) => this[y$3](t$6, e$6));
1434
+ }
1435
+ [y$3](t$6, e$6) {
1436
+ t$6 ? this[d](t$6) : (this[s$7] = e$6, this.emit("open", e$6), this[S$1]());
1437
+ }
1438
+ [T$1]() {
1439
+ return Buffer.allocUnsafe(Math.min(this[M], this[k$1]));
1440
+ }
1441
+ [S$1]() {
1442
+ if (!this[f$4]) {
1443
+ this[f$4] = true;
1444
+ const t$6 = this[T$1]();
1445
+ if (t$6.length === 0) return process.nextTick(() => this[W](null, 0, t$6));
1446
+ r.read(this[s$7], t$6, 0, t$6.length, null, (e$6, i$7, $) => this[W](e$6, i$7, $));
1447
+ }
1448
+ }
1449
+ [W](t$6, e$6, i$7) {
1450
+ this[f$4] = false, t$6 ? this[d](t$6) : this[z$1](e$6, i$7) && this[S$1]();
1451
+ }
1452
+ [h]() {
1453
+ if (this[m$3] && typeof this[s$7] == "number") {
1454
+ const t$6 = this[s$7];
1455
+ this[s$7] = null, r.close(t$6, (e$6) => e$6 ? this.emit("error", e$6) : this.emit("close"));
1456
+ }
1457
+ }
1458
+ [d](t$6) {
1459
+ this[f$4] = true, this[h](), this.emit("error", t$6);
1460
+ }
1461
+ [z$1](t$6, e$6) {
1462
+ let i$7 = false;
1463
+ return this[k$1] -= t$6, t$6 > 0 && (i$7 = super.write(t$6 < e$6.length ? e$6.slice(0, t$6) : e$6)), (t$6 === 0 || this[k$1] <= 0) && (i$7 = false, this[h](), super.end()), i$7;
1464
+ }
1465
+ emit(t$6, e$6) {
1466
+ switch (t$6) {
1467
+ case "prefinish":
1468
+ case "finish": break;
1469
+ case "drain":
1470
+ typeof this[s$7] == "number" && this[S$1]();
1471
+ break;
1472
+ case "error": return this[p$1] ? void 0 : (this[p$1] = true, super.emit(t$6, e$6));
1473
+ default: return super.emit(t$6, e$6);
1474
+ }
1475
+ }
1476
+ }
1477
+ class P$1 extends D {
1478
+ [a$10]() {
1479
+ let t$6 = true;
1480
+ try {
1481
+ this[y$3](null, r.openSync(this[l$1], "r")), t$6 = !1;
1482
+ } finally {
1483
+ t$6 && this[h]();
1484
+ }
1485
+ }
1486
+ [S$1]() {
1487
+ let t$6 = true;
1488
+ try {
1489
+ if (!this[f$4]) {
1490
+ this[f$4] = !0;
1491
+ do {
1492
+ const e$6 = this[T$1](), i$7 = e$6.length === 0 ? 0 : r.readSync(this[s$7], e$6, 0, e$6.length, null);
1493
+ if (!this[z$1](i$7, e$6)) break;
1494
+ } while (!0);
1495
+ this[f$4] = !1;
1496
+ }
1497
+ t$6 = !1;
1498
+ } finally {
1499
+ t$6 && this[h]();
1500
+ }
1501
+ }
1502
+ [h]() {
1503
+ if (this[m$3] && typeof this[s$7] == "number") {
1504
+ const t$6 = this[s$7];
1505
+ this[s$7] = null, r.closeSync(t$6), this.emit("close");
1506
+ }
1507
+ }
1508
+ }
1509
+ class O$3 extends I {
1510
+ constructor(t$6, e$6) {
1511
+ e$6 = e$6 || {}, super(e$6), this.readable = false, this.writable = true, this[p$1] = false, this[b] = false, this[g] = false, this[E$1] = false, this[n$4] = [], this[l$1] = t$6, this[s$7] = typeof e$6.fd == "number" ? e$6.fd : null, this[q$1] = e$6.mode === void 0 ? 438 : e$6.mode, this[u$5] = typeof e$6.start == "number" ? e$6.start : null, this[m$3] = typeof e$6.autoClose == "boolean" ? e$6.autoClose : true;
1512
+ const i$7 = this[u$5] !== null ? "r+" : "w";
1513
+ this[F$3] = e$6.flags === void 0, this[o$5] = this[F$3] ? i$7 : e$6.flags, this[s$7] === null && this[a$10]();
1514
+ }
1515
+ emit(t$6, e$6) {
1516
+ if (t$6 === "error") {
1517
+ if (this[p$1]) return;
1518
+ this[p$1] = true;
1519
+ }
1520
+ return super.emit(t$6, e$6);
1521
+ }
1522
+ get fd() {
1523
+ return this[s$7];
1524
+ }
1525
+ get path() {
1526
+ return this[l$1];
1527
+ }
1528
+ [d](t$6) {
1529
+ this[h](), this[b] = true, this.emit("error", t$6);
1530
+ }
1531
+ [a$10]() {
1532
+ r.open(this[l$1], this[o$5], this[q$1], (t$6, e$6) => this[y$3](t$6, e$6));
1533
+ }
1534
+ [y$3](t$6, e$6) {
1535
+ this[F$3] && this[o$5] === "r+" && t$6 && t$6.code === "ENOENT" ? (this[o$5] = "w", this[a$10]()) : t$6 ? this[d](t$6) : (this[s$7] = e$6, this.emit("open", e$6), this[x]());
1536
+ }
1537
+ end(t$6, e$6) {
1538
+ return t$6 && this.write(t$6, e$6), this[g] = true, !this[b] && !this[n$4].length && typeof this[s$7] == "number" && this[_$1](null, 0), this;
1539
+ }
1540
+ write(t$6, e$6) {
1541
+ return typeof t$6 == "string" && (t$6 = Buffer.from(t$6, e$6)), this[g] ? (this.emit("error", /* @__PURE__ */ new Error("write() after end()")), false) : this[s$7] === null || this[b] || this[n$4].length ? (this[n$4].push(t$6), this[E$1] = true, false) : (this[b] = true, this[C$1](t$6), true);
1542
+ }
1543
+ [C$1](t$6) {
1544
+ r.write(this[s$7], t$6, 0, t$6.length, this[u$5], (e$6, i$7) => this[_$1](e$6, i$7));
1545
+ }
1546
+ [_$1](t$6, e$6) {
1547
+ t$6 ? this[d](t$6) : (this[u$5] !== null && (this[u$5] += e$6), this[n$4].length ? this[x]() : (this[b] = false, this[g] && !this[B] ? (this[B] = true, this[h](), this.emit("finish")) : this[E$1] && (this[E$1] = false, this.emit("drain"))));
1548
+ }
1549
+ [x]() {
1550
+ if (this[n$4].length === 0) this[g] && this[_$1](null, 0);
1551
+ else if (this[n$4].length === 1) this[C$1](this[n$4].pop());
1552
+ else {
1553
+ const t$6 = this[n$4];
1554
+ this[n$4] = [], R$2(this[s$7], t$6, this[u$5], (e$6, i$7) => this[_$1](e$6, i$7));
1555
+ }
1556
+ }
1557
+ [h]() {
1558
+ if (this[m$3] && typeof this[s$7] == "number") {
1559
+ const t$6 = this[s$7];
1560
+ this[s$7] = null, r.close(t$6, (e$6) => e$6 ? this.emit("error", e$6) : this.emit("close"));
1561
+ }
1562
+ }
1563
+ }
1564
+ class U extends O$3 {
1565
+ [a$10]() {
1566
+ let t$6;
1567
+ if (this[F$3] && this[o$5] === "r+") try {
1568
+ t$6 = r.openSync(this[l$1], this[o$5], this[q$1]);
1569
+ } catch (e$6) {
1570
+ if (e$6.code === "ENOENT") return this[o$5] = "w", this[a$10]();
1571
+ throw e$6;
1572
+ }
1573
+ else t$6 = r.openSync(this[l$1], this[o$5], this[q$1]);
1574
+ this[y$3](null, t$6);
1575
+ }
1576
+ [h]() {
1577
+ if (this[m$3] && typeof this[s$7] == "number") {
1578
+ const t$6 = this[s$7];
1579
+ this[s$7] = null, r.closeSync(t$6), this.emit("close");
1580
+ }
1581
+ }
1582
+ [C$1](t$6) {
1583
+ let e$6 = true;
1584
+ try {
1585
+ this[_$1](null, r.writeSync(this[s$7], t$6, 0, t$6.length, this[u$5])), e$6 = !1;
1586
+ } finally {
1587
+ if (e$6) try {
1588
+ this[h]();
1589
+ } catch {}
1590
+ }
1591
+ }
1592
+ }
1593
+ return s$4.ReadStream = D, s$4.ReadStreamSync = P$1, s$4.WriteStream = O$3, s$4.WriteStreamSync = U, s$4;
1594
+ }
1595
+ var r$1 = { exports: {} };
1596
+ var i$2, m$2;
1597
+ function t$2() {
1598
+ if (m$2) return i$2;
1599
+ m$2 = 1;
1600
+ const { promisify: n$4 } = node_util.default, e$6 = node_fs.default;
1601
+ return i$2 = (r) => {
1602
+ if (!r) r = {
1603
+ mode: 511,
1604
+ fs: e$6
1605
+ };
1606
+ else if (typeof r == "object") r = {
1607
+ mode: 511,
1608
+ fs: e$6,
1609
+ ...r
1610
+ };
1611
+ else if (typeof r == "number") r = {
1612
+ mode: r,
1613
+ fs: e$6
1614
+ };
1615
+ else if (typeof r == "string") r = {
1616
+ mode: parseInt(r, 8),
1617
+ fs: e$6
1618
+ };
1619
+ else throw new TypeError("invalid options argument");
1620
+ return r.mkdir = r.mkdir || r.fs.mkdir || e$6.mkdir, r.mkdirAsync = n$4(r.mkdir), r.stat = r.stat || r.fs.stat || e$6.stat, r.statAsync = n$4(r.stat), r.statSync = r.statSync || r.fs.statSync || e$6.statSync, r.mkdirSync = r.mkdirSync || r.fs.mkdirSync || e$6.mkdirSync, r;
1621
+ }, i$2;
1622
+ }
1623
+ var e$1, t$1;
1624
+ function u$2() {
1625
+ if (t$1) return e$1;
1626
+ t$1 = 1;
1627
+ const s$7 = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform, { resolve: o$5, parse: n$4 } = node_path.default;
1628
+ return e$1 = (r) => {
1629
+ if (/\0/.test(r)) throw Object.assign(/* @__PURE__ */ new TypeError("path must be a string without null bytes"), {
1630
+ path: r,
1631
+ code: "ERR_INVALID_ARG_VALUE"
1632
+ });
1633
+ if (r = o$5(r), s$7 === "win32") {
1634
+ const i$7 = /[*|"<>?:]/, { root: a$10 } = n$4(r);
1635
+ if (i$7.test(r.substr(a$10.length))) throw Object.assign(/* @__PURE__ */ new Error("Illegal characters in path."), {
1636
+ path: r,
1637
+ code: "EINVAL"
1638
+ });
1639
+ }
1640
+ return r;
1641
+ }, e$1;
1642
+ }
1643
+ var i$1, c$2;
1644
+ function t() {
1645
+ if (c$2) return i$1;
1646
+ c$2 = 1;
1647
+ const { dirname: u$5 } = node_path.default, f$4 = (r, e$6, n$4 = void 0) => n$4 === e$6 ? Promise.resolve() : r.statAsync(e$6).then((d) => d.isDirectory() ? n$4 : void 0, (d) => d.code === "ENOENT" ? f$4(r, u$5(e$6), e$6) : void 0), o$5 = (r, e$6, n$4 = void 0) => {
1648
+ if (n$4 !== e$6) try {
1649
+ return r.statSync(e$6).isDirectory() ? n$4 : void 0;
1650
+ } catch (d) {
1651
+ return d.code === "ENOENT" ? o$5(r, u$5(e$6), e$6) : void 0;
1652
+ }
1653
+ };
1654
+ return i$1 = {
1655
+ findMade: f$4,
1656
+ findMadeSync: o$5
1657
+ }, i$1;
1658
+ }
1659
+ var o$3, a$4;
1660
+ function y$2() {
1661
+ if (a$4) return o$3;
1662
+ a$4 = 1;
1663
+ const { dirname: f$4 } = node_path.default, t$6 = (n$4, e$6, c$5) => {
1664
+ e$6.recursive = false;
1665
+ const i$7 = f$4(n$4);
1666
+ return i$7 === n$4 ? e$6.mkdirAsync(n$4, e$6).catch((r) => {
1667
+ if (r.code !== "EISDIR") throw r;
1668
+ }) : e$6.mkdirAsync(n$4, e$6).then(() => c$5 || n$4, (r) => {
1669
+ if (r.code === "ENOENT") return t$6(i$7, e$6).then((u$5) => t$6(n$4, e$6, u$5));
1670
+ if (r.code !== "EEXIST" && r.code !== "EROFS") throw r;
1671
+ return e$6.statAsync(n$4).then((u$5) => {
1672
+ if (u$5.isDirectory()) return c$5;
1673
+ throw r;
1674
+ }, () => {
1675
+ throw r;
1676
+ });
1677
+ });
1678
+ }, d = (n$4, e$6, c$5) => {
1679
+ const i$7 = f$4(n$4);
1680
+ if (e$6.recursive = false, i$7 === n$4) try {
1681
+ return e$6.mkdirSync(n$4, e$6);
1682
+ } catch (r) {
1683
+ if (r.code !== "EISDIR") throw r;
1684
+ return;
1685
+ }
1686
+ try {
1687
+ return e$6.mkdirSync(n$4, e$6), c$5 || n$4;
1688
+ } catch (r) {
1689
+ if (r.code === "ENOENT") return d(n$4, e$6, d(i$7, e$6, c$5));
1690
+ if (r.code !== "EEXIST" && r.code !== "EROFS") throw r;
1691
+ try {
1692
+ if (!e$6.statSync(n$4).isDirectory()) throw r;
1693
+ } catch {
1694
+ throw r;
1695
+ }
1696
+ }
1697
+ };
1698
+ return o$3 = {
1699
+ mkdirpManual: t$6,
1700
+ mkdirpManualSync: d
1701
+ }, o$3;
1702
+ }
1703
+ var c$1, m$1;
1704
+ function s$3() {
1705
+ if (m$1) return c$1;
1706
+ m$1 = 1;
1707
+ const { dirname: u$5 } = node_path.default, { findMade: d, findMadeSync: t$1$1 } = t(), { mkdirpManual: a$10, mkdirpManualSync: k$1 } = y$2();
1708
+ return c$1 = {
1709
+ mkdirpNative: (e$6, r) => (r.recursive = true, u$5(e$6) === e$6 ? r.mkdirAsync(e$6, r) : d(r, e$6).then((n$4) => r.mkdirAsync(e$6, r).then(() => n$4).catch((i$7) => {
1710
+ if (i$7.code === "ENOENT") return a$10(e$6, r);
1711
+ throw i$7;
1712
+ }))),
1713
+ mkdirpNativeSync: (e$6, r) => {
1714
+ if (r.recursive = true, u$5(e$6) === e$6) return r.mkdirSync(e$6, r);
1715
+ const n$4 = t$1$1(r, e$6);
1716
+ try {
1717
+ return r.mkdirSync(e$6, r), n$4;
1718
+ } catch (i$7) {
1719
+ if (i$7.code === "ENOENT") return k$1(e$6, r);
1720
+ throw i$7;
1721
+ }
1722
+ }
1723
+ }, c$1;
1724
+ }
1725
+ var s$2, n$1;
1726
+ function a$3() {
1727
+ if (n$1) return s$2;
1728
+ n$1 = 1;
1729
+ const i$7 = node_fs.default, e$6 = (process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version).replace(/^v/, "").split("."), t$6 = +e$6[0] > 10 || +e$6[0] == 10 && +e$6[1] >= 12;
1730
+ return s$2 = {
1731
+ useNative: t$6 ? (r) => r.mkdir === i$7.mkdir : () => false,
1732
+ useNativeSync: t$6 ? (r) => r.mkdirSync === i$7.mkdirSync : () => false
1733
+ }, s$2;
1734
+ }
1735
+ var m, s$1;
1736
+ function S() {
1737
+ if (s$1) return m;
1738
+ s$1 = 1;
1739
+ const i$7 = t$2(), u$5 = u$2(), { mkdirpNative: a$10, mkdirpNativeSync: c$5 } = s$3(), { mkdirpManual: o$5, mkdirpManualSync: q$1 } = y$2(), { useNative: t$6, useNativeSync: _$1 } = a$3(), n$4 = (e$6, r) => (e$6 = u$5(e$6), r = i$7(r), t$6(r) ? a$10(e$6, r) : o$5(e$6, r)), d = (e$6, r) => (e$6 = u$5(e$6), r = i$7(r), _$1(r) ? c$5(e$6, r) : q$1(e$6, r));
1740
+ return n$4.sync = d, n$4.native = (e$6, r) => a$10(u$5(e$6), i$7(r)), n$4.manual = (e$6, r) => o$5(u$5(e$6), i$7(r)), n$4.nativeSync = (e$6, r) => c$5(u$5(e$6), i$7(r)), n$4.manualSync = (e$6, r) => q$1(u$5(e$6), i$7(r)), m = n$4, m;
1741
+ }
1742
+ var y$1, O;
1743
+ function F$1() {
1744
+ if (O) return y$1;
1745
+ O = 1;
1746
+ const c$5 = node_fs.default, a$10 = node_path.default, T$1 = c$5.lchown ? "lchown" : "chown", I = c$5.lchownSync ? "lchownSync" : "chownSync", i$7 = c$5.lchown && !process.version.match(/v1[1-9]+\./) && !process.version.match(/v10\.[6-9]/), u$5 = (r, e$6, n$4) => {
1747
+ try {
1748
+ return c$5[I](r, e$6, n$4);
1749
+ } catch (t$6) {
1750
+ if (t$6.code !== "ENOENT") throw t$6;
1751
+ }
1752
+ }, D = (r, e$6, n$4) => {
1753
+ try {
1754
+ return c$5.chownSync(r, e$6, n$4);
1755
+ } catch (t$6) {
1756
+ if (t$6.code !== "ENOENT") throw t$6;
1757
+ }
1758
+ }, _$1 = i$7 ? (r, e$6, n$4, t$6) => (o$5) => {
1759
+ !o$5 || o$5.code !== "EISDIR" ? t$6(o$5) : c$5.chown(r, e$6, n$4, t$6);
1760
+ } : (r, e$6, n$4, t$6) => t$6, w$2 = i$7 ? (r, e$6, n$4) => {
1761
+ try {
1762
+ return u$5(r, e$6, n$4);
1763
+ } catch (t$6) {
1764
+ if (t$6.code !== "EISDIR") throw t$6;
1765
+ D(r, e$6, n$4);
1766
+ }
1767
+ } : (r, e$6, n$4) => u$5(r, e$6, n$4), R$2 = process.version;
1768
+ let N = (r, e$6, n$4) => c$5.readdir(r, e$6, n$4), q$1 = (r, e$6) => c$5.readdirSync(r, e$6);
1769
+ /^v4\./.test(R$2) && (N = (r, e$6, n$4) => c$5.readdir(r, n$4));
1770
+ const h = (r, e$6, n$4, t$6) => {
1771
+ c$5[T$1](r, e$6, n$4, _$1(r, e$6, n$4, (o$5) => {
1772
+ t$6(o$5 && o$5.code !== "ENOENT" ? o$5 : null);
1773
+ }));
1774
+ }, S$1 = (r, e$6, n$4, t$6, o$5) => {
1775
+ if (typeof e$6 == "string") return c$5.lstat(a$10.resolve(r, e$6), (s$7, f$4) => {
1776
+ if (s$7) return o$5(s$7.code !== "ENOENT" ? s$7 : null);
1777
+ f$4.name = e$6, S$1(r, f$4, n$4, t$6, o$5);
1778
+ });
1779
+ if (e$6.isDirectory()) E$1(a$10.resolve(r, e$6.name), n$4, t$6, (s$7) => {
1780
+ if (s$7) return o$5(s$7);
1781
+ h(a$10.resolve(r, e$6.name), n$4, t$6, o$5);
1782
+ });
1783
+ else h(a$10.resolve(r, e$6.name), n$4, t$6, o$5);
1784
+ }, E$1 = (r, e$6, n$4, t$6) => {
1785
+ N(r, { withFileTypes: true }, (o$5, s$7) => {
1786
+ if (o$5) {
1787
+ if (o$5.code === "ENOENT") return t$6();
1788
+ if (o$5.code !== "ENOTDIR" && o$5.code !== "ENOTSUP") return t$6(o$5);
1789
+ }
1790
+ if (o$5 || !s$7.length) return h(r, e$6, n$4, t$6);
1791
+ let f$4 = s$7.length, v$2 = null;
1792
+ const H$3 = (l$1) => {
1793
+ if (!v$2) {
1794
+ if (l$1) return t$6(v$2 = l$1);
1795
+ if (--f$4 === 0) return h(r, e$6, n$4, t$6);
1796
+ }
1797
+ };
1798
+ s$7.forEach((l$1) => S$1(r, l$1, e$6, n$4, H$3));
1799
+ });
1800
+ }, C$1 = (r, e$6, n$4, t$6) => {
1801
+ if (typeof e$6 == "string") try {
1802
+ const o$5 = c$5.lstatSync(a$10.resolve(r, e$6));
1803
+ o$5.name = e$6, e$6 = o$5;
1804
+ } catch (o$5) {
1805
+ if (o$5.code === "ENOENT") return;
1806
+ throw o$5;
1807
+ }
1808
+ e$6.isDirectory() && m$3(a$10.resolve(r, e$6.name), n$4, t$6), w$2(a$10.resolve(r, e$6.name), n$4, t$6);
1809
+ }, m$3 = (r, e$6, n$4) => {
1810
+ let t$6;
1811
+ try {
1812
+ t$6 = q$1(r, { withFileTypes: !0 });
1813
+ } catch (o$5) {
1814
+ if (o$5.code === "ENOENT") return;
1815
+ if (o$5.code === "ENOTDIR" || o$5.code === "ENOTSUP") return w$2(r, e$6, n$4);
1816
+ throw o$5;
1817
+ }
1818
+ return t$6 && t$6.length && t$6.forEach((o$5) => C$1(r, o$5, e$6, n$4)), w$2(r, e$6, n$4);
1819
+ };
1820
+ return y$1 = E$1, E$1.sync = m$3, y$1;
1821
+ }
1822
+ var R;
1823
+ function H() {
1824
+ if (R) return r$1.exports;
1825
+ R = 1;
1826
+ const g = S(), l$1 = node_fs.default, p$1 = node_path.default, x = F$1(), y$3 = a$7();
1827
+ class D extends Error {
1828
+ constructor(e$6, s$7) {
1829
+ super("Cannot extract through symbolic link"), this.path = s$7, this.symlink = e$6;
1830
+ }
1831
+ get name() {
1832
+ return "SylinkError";
1833
+ }
1834
+ }
1835
+ class E$1 extends Error {
1836
+ constructor(e$6, s$7) {
1837
+ super(s$7 + ": Cannot cd into '" + e$6 + "'"), this.path = e$6, this.code = s$7;
1838
+ }
1839
+ get name() {
1840
+ return "CwdError";
1841
+ }
1842
+ }
1843
+ const v$2 = (n$4, e$6) => n$4.get(y$3(e$6)), q$1 = (n$4, e$6, s$7) => n$4.set(y$3(e$6), s$7), I = (n$4, e$6) => {
1844
+ l$1.stat(n$4, (s$7, r) => {
1845
+ (s$7 || !r.isDirectory()) && (s$7 = new E$1(n$4, s$7 && s$7.code || "ENOTDIR")), e$6(s$7);
1846
+ });
1847
+ };
1848
+ r$1.exports = (n$4, e$6, s$7) => {
1849
+ n$4 = y$3(n$4);
1850
+ const r = e$6.umask, c$5 = e$6.mode | 448, f$4 = (c$5 & r) !== 0, t$6 = e$6.uid, i$7 = e$6.gid, a$10 = typeof t$6 == "number" && typeof i$7 == "number" && (t$6 !== e$6.processUid || i$7 !== e$6.processGid), u$5 = e$6.preserve, m$3 = e$6.unlink, h = e$6.cache, d = y$3(e$6.cwd), w$2 = (k$1, o$5) => {
1851
+ k$1 ? s$7(k$1) : (q$1(h, n$4, true), o$5 && a$10 ? x(o$5, t$6, i$7, (G$1) => w$2(G$1)) : f$4 ? l$1.chmod(n$4, c$5, s$7) : s$7());
1852
+ };
1853
+ if (h && v$2(h, n$4) === true) return w$2();
1854
+ if (n$4 === d) return I(n$4, w$2);
1855
+ if (u$5) return g(n$4, { mode: c$5 }).then((k$1) => w$2(null, k$1), w$2);
1856
+ C$1(d, y$3(p$1.relative(d, n$4)).split("/"), c$5, h, m$3, d, null, w$2);
1857
+ };
1858
+ const C$1 = (n$4, e$6, s$7, r, c$5, f$4, t$6, i$7) => {
1859
+ if (!e$6.length) return i$7(null, t$6);
1860
+ const a$10 = e$6.shift(), u$5 = y$3(p$1.resolve(n$4 + "/" + a$10));
1861
+ if (v$2(r, u$5)) return C$1(u$5, e$6, s$7, r, c$5, f$4, t$6, i$7);
1862
+ l$1.mkdir(u$5, s$7, j$2(u$5, e$6, s$7, r, c$5, f$4, t$6, i$7));
1863
+ }, j$2 = (n$4, e$6, s$7, r, c$5, f$4, t$6, i$7) => (a$10) => {
1864
+ a$10 ? l$1.lstat(n$4, (u$5, m$3) => {
1865
+ if (u$5) u$5.path = u$5.path && y$3(u$5.path), i$7(u$5);
1866
+ else if (m$3.isDirectory()) C$1(n$4, e$6, s$7, r, c$5, f$4, t$6, i$7);
1867
+ else if (c$5) l$1.unlink(n$4, (h) => {
1868
+ if (h) return i$7(h);
1869
+ l$1.mkdir(n$4, s$7, j$2(n$4, e$6, s$7, r, c$5, f$4, t$6, i$7));
1870
+ });
1871
+ else {
1872
+ if (m$3.isSymbolicLink()) return i$7(new D(n$4, n$4 + "/" + e$6.join("/")));
1873
+ i$7(a$10);
1874
+ }
1875
+ }) : (t$6 = t$6 || n$4, C$1(n$4, e$6, s$7, r, c$5, f$4, t$6, i$7));
1876
+ }, L = (n$4) => {
1877
+ let e$6 = false, s$7 = "ENOTDIR";
1878
+ try {
1879
+ e$6 = l$1.statSync(n$4).isDirectory();
1880
+ } catch (r) {
1881
+ s$7 = r.code;
1882
+ } finally {
1883
+ if (!e$6) throw new E$1(n$4, s$7);
1884
+ }
1885
+ };
1886
+ return r$1.exports.sync = (n$4, e$6) => {
1887
+ n$4 = y$3(n$4);
1888
+ const s$7 = e$6.umask, r = e$6.mode | 448, c$5 = (r & s$7) !== 0, f$4 = e$6.uid, t$6 = e$6.gid, i$7 = typeof f$4 == "number" && typeof t$6 == "number" && (f$4 !== e$6.processUid || t$6 !== e$6.processGid), a$10 = e$6.preserve, u$5 = e$6.unlink, m$3 = e$6.cache, h = y$3(e$6.cwd), d = (k$1) => {
1889
+ q$1(m$3, n$4, true), k$1 && i$7 && x.sync(k$1, f$4, t$6), c$5 && l$1.chmodSync(n$4, r);
1890
+ };
1891
+ if (m$3 && v$2(m$3, n$4) === true) return d();
1892
+ if (n$4 === h) return L(h), d();
1893
+ if (a$10) return d(g.sync(n$4, r));
1894
+ const $ = y$3(p$1.relative(h, n$4)).split("/");
1895
+ let S$1 = null;
1896
+ for (let k$1 = $.shift(), o$5 = h; k$1 && (o$5 += "/" + k$1); k$1 = $.shift()) if (o$5 = y$3(p$1.resolve(o$5)), !v$2(m$3, o$5)) try {
1897
+ l$1.mkdirSync(o$5, r), S$1 = S$1 || o$5, q$1(m$3, o$5, !0);
1898
+ } catch {
1899
+ const M = l$1.lstatSync(o$5);
1900
+ if (M.isDirectory()) {
1901
+ q$1(m$3, o$5, true);
1902
+ continue;
1903
+ } else if (u$5) {
1904
+ l$1.unlinkSync(o$5), l$1.mkdirSync(o$5, r), S$1 = S$1 || o$5, q$1(m$3, o$5, true);
1905
+ continue;
1906
+ } else if (M.isSymbolicLink()) return new D(o$5, o$5 + "/" + $.join("/"));
1907
+ }
1908
+ return d(S$1);
1909
+ }, r$1.exports;
1910
+ }
1911
+ var a$2, i;
1912
+ function p() {
1913
+ if (i) return a$2;
1914
+ i = 1;
1915
+ const o$5 = [
1916
+ "|",
1917
+ "<",
1918
+ ">",
1919
+ "?",
1920
+ ":"
1921
+ ], t$6 = o$5.map((e$6) => String.fromCharCode(61440 + e$6.charCodeAt(0))), s$7 = new Map(o$5.map((e$6, r) => [e$6, t$6[r]])), c$5 = new Map(t$6.map((e$6, r) => [e$6, o$5[r]]));
1922
+ return a$2 = {
1923
+ encode: (e$6) => o$5.reduce((r, n$4) => r.split(n$4).join(s$7.get(n$4)), e$6),
1924
+ decode: (e$6) => t$6.reduce((r, n$4) => r.split(n$4).join(c$5.get(n$4)), e$6)
1925
+ }, a$2;
1926
+ }
1927
+ var o$2, n;
1928
+ function a$1() {
1929
+ if (n) return o$2;
1930
+ n = 1;
1931
+ const r = Object.create(null), { hasOwnProperty: i$7 } = Object.prototype;
1932
+ return o$2 = (e$6) => (i$7.call(r, e$6) || (r[e$6] = e$6.normalize("NFD")), r[e$6]), o$2;
1933
+ }
1934
+ var a, l;
1935
+ function s() {
1936
+ return l || (l = 1, a = (r) => {
1937
+ let e$6 = r.length - 1, i$7 = -1;
1938
+ for (; e$6 > -1 && r.charAt(e$6) === "/";) i$7 = e$6, e$6--;
1939
+ return i$7 === -1 ? r : r.slice(0, i$7);
1940
+ }), a;
1941
+ }
1942
+ var u$1, f$1;
1943
+ function z() {
1944
+ if (f$1) return u$1;
1945
+ f$1 = 1;
1946
+ const l$1 = node_assert.default, m$3 = a$1(), g = s(), { join: d } = node_path.default, q$1 = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32";
1947
+ return u$1 = () => {
1948
+ const i$7 = /* @__PURE__ */ new Map(), c$5 = /* @__PURE__ */ new Map(), v$2 = (e$6) => e$6.split("/").slice(0, -1).reduce((o$5, r) => (o$5.length && (r = d(o$5[o$5.length - 1], r)), o$5.push(r || "/"), o$5), []), a$10 = /* @__PURE__ */ new Set(), w$2 = (e$6) => {
1949
+ const s$7 = c$5.get(e$6);
1950
+ if (!s$7) throw new Error("function does not have any path reservations");
1951
+ return {
1952
+ paths: s$7.paths.map((o$5) => i$7.get(o$5)),
1953
+ dirs: [...s$7.dirs].map((o$5) => i$7.get(o$5))
1954
+ };
1955
+ }, h = (e$6) => {
1956
+ const { paths: s$7, dirs: o$5 } = w$2(e$6);
1957
+ return s$7.every((r) => r[0] === e$6) && o$5.every((r) => r[0] instanceof Set && r[0].has(e$6));
1958
+ }, p$1 = (e$6) => a$10.has(e$6) || !h(e$6) ? false : (a$10.add(e$6), e$6(() => S$1(e$6)), true), S$1 = (e$6) => {
1959
+ if (!a$10.has(e$6)) return false;
1960
+ const { paths: s$7, dirs: o$5 } = c$5.get(e$6), r = /* @__PURE__ */ new Set();
1961
+ return s$7.forEach((t$6) => {
1962
+ const n$4 = i$7.get(t$6);
1963
+ l$1.equal(n$4[0], e$6), n$4.length === 1 ? i$7.delete(t$6) : (n$4.shift(), typeof n$4[0] == "function" ? r.add(n$4[0]) : n$4[0].forEach((E$1) => r.add(E$1)));
1964
+ }), o$5.forEach((t$6) => {
1965
+ const n$4 = i$7.get(t$6);
1966
+ l$1(n$4[0] instanceof Set), n$4[0].size === 1 && n$4.length === 1 ? i$7.delete(t$6) : n$4[0].size === 1 ? (n$4.shift(), r.add(n$4[0])) : n$4[0].delete(e$6);
1967
+ }), a$10.delete(e$6), r.forEach((t$6) => p$1(t$6)), true;
1968
+ };
1969
+ return {
1970
+ check: h,
1971
+ reserve: (e$6, s$7) => {
1972
+ e$6 = q$1 ? ["win32 parallelization disabled"] : e$6.map((r) => g(d(m$3(r))).toLowerCase());
1973
+ const o$5 = new Set(e$6.map((r) => v$2(r)).reduce((r, t$6) => r.concat(t$6)));
1974
+ return c$5.set(s$7, {
1975
+ dirs: o$5,
1976
+ paths: e$6
1977
+ }), e$6.forEach((r) => {
1978
+ const t$6 = i$7.get(r);
1979
+ t$6 ? t$6.push(s$7) : i$7.set(r, [s$7]);
1980
+ }), o$5.forEach((r) => {
1981
+ const t$6 = i$7.get(r);
1982
+ t$6 ? t$6[t$6.length - 1] instanceof Set ? t$6[t$6.length - 1].add(s$7) : t$6.push(new Set([s$7])) : i$7.set(r, [new Set([s$7])]);
1983
+ }), p$1(s$7);
1984
+ }
1985
+ };
1986
+ }, u$1;
1987
+ }
1988
+ var o$1, u;
1989
+ function c() {
1990
+ if (u) return o$1;
1991
+ u = 1;
1992
+ const { isAbsolute: l$1, parse: t$6 } = node_path.default.win32;
1993
+ return o$1 = (r) => {
1994
+ let s$7 = "", e$6 = t$6(r);
1995
+ for (; l$1(r) || e$6.root;) {
1996
+ const i$7 = r.charAt(0) === "/" && r.slice(0, 4) !== "//?/" ? "/" : e$6.root;
1997
+ r = r.slice(i$7.length), s$7 += i$7, e$6 = t$6(r);
1998
+ }
1999
+ return [s$7, r];
2000
+ }, o$1;
2001
+ }
2002
+ var e, o;
2003
+ function F() {
2004
+ if (o) return e;
2005
+ o = 1;
2006
+ const t$6 = process.env.__FAKE_PLATFORM__ || process.platform, s$7 = typeof Bun < "u" ? false : t$6 === "win32", { O_CREAT: _$1, O_TRUNC: a$10, O_WRONLY: i$7, UV_FS_O_FILEMAP: r = 0 } = (commonjsGlobal.__FAKE_TESTING_FS__ || node_fs.default).constants, c$5 = s$7 && !!r, f$4 = 512 * 1024, p$1 = r | a$10 | _$1 | i$7;
2007
+ return e = c$5 ? (l$1) => l$1 < f$4 ? p$1 : "w" : () => "w", e;
2008
+ }
2009
+ var G, y;
2010
+ function Os() {
2011
+ if (y) return G;
2012
+ y = 1;
2013
+ const ss = node_assert.default, is = rt(), r = node_fs.default, es = X(), w$2 = node_path.default, M = H(), K = p(), ts = z(), os = c(), l$1 = a$7(), rs = s(), hs = a$1(), H$1$1 = Symbol("onEntry"), q$1 = Symbol("checkFs"), Y = Symbol("checkFs2"), v$2 = Symbol("pruneCache"), N = Symbol("isReusable"), d = Symbol("makeFs"), U = Symbol("file"), F$1$1 = Symbol("directory"), O$3 = Symbol("link"), B = Symbol("symlink"), z$1 = Symbol("hardlink"), W = Symbol("unsupported"), j$2 = Symbol("checkPath"), b = Symbol("mkdir"), m$3 = Symbol("onError"), $ = Symbol("pending"), V$1 = Symbol("pend"), S$1 = Symbol("unpend"), P$1 = Symbol("ended"), A = Symbol("maybeClose"), x = Symbol("skip"), E$1 = Symbol("doChown"), R$2 = Symbol("uid"), _$1 = Symbol("gid"), g = Symbol("checkedCwd"), X$1$1 = node_crypto.default, J$1 = F(), C$1 = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32", cs = 1024, as = (a$10, s$7) => {
2014
+ if (!C$1) return r.unlink(a$10, s$7);
2015
+ const i$7 = a$10 + ".DELETE." + X$1$1.randomBytes(16).toString("hex");
2016
+ r.rename(a$10, i$7, (e$6) => {
2017
+ if (e$6) return s$7(e$6);
2018
+ r.unlink(i$7, s$7);
2019
+ });
2020
+ }, us = (a$10) => {
2021
+ if (!C$1) return r.unlinkSync(a$10);
2022
+ const s$7 = a$10 + ".DELETE." + X$1$1.randomBytes(16).toString("hex");
2023
+ r.renameSync(a$10, s$7), r.unlinkSync(s$7);
2024
+ }, Q = (a$10, s$7, i$7) => a$10 === a$10 >>> 0 ? a$10 : s$7 === s$7 >>> 0 ? s$7 : i$7, Z = (a$10) => rs(l$1(hs(a$10))).toLowerCase(), ns = (a$10, s$7) => {
2025
+ s$7 = Z(s$7);
2026
+ for (const i$7 of a$10.keys()) {
2027
+ const e$6 = Z(i$7);
2028
+ (e$6 === s$7 || e$6.indexOf(s$7 + "/") === 0) && a$10.delete(i$7);
2029
+ }
2030
+ }, ms = (a$10) => {
2031
+ for (const s$7 of a$10.keys()) a$10.delete(s$7);
2032
+ };
2033
+ class L extends is {
2034
+ constructor(s$7) {
2035
+ if (s$7 || (s$7 = {}), s$7.ondone = (i$7) => {
2036
+ this[P$1] = true, this[A]();
2037
+ }, super(s$7), this[g] = false, this.reservations = ts(), this.transform = typeof s$7.transform == "function" ? s$7.transform : null, this.writable = true, this.readable = false, this[$] = 0, this[P$1] = false, this.dirCache = s$7.dirCache || /* @__PURE__ */ new Map(), typeof s$7.uid == "number" || typeof s$7.gid == "number") {
2038
+ if (typeof s$7.uid != "number" || typeof s$7.gid != "number") throw new TypeError("cannot set owner without number uid and gid");
2039
+ if (s$7.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
2040
+ this.uid = s$7.uid, this.gid = s$7.gid, this.setOwner = true;
2041
+ } else this.uid = null, this.gid = null, this.setOwner = false;
2042
+ s$7.preserveOwner === void 0 && typeof s$7.uid != "number" ? this.preserveOwner = process.getuid && process.getuid() === 0 : this.preserveOwner = !!s$7.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : null, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : null, this.maxDepth = typeof s$7.maxDepth == "number" ? s$7.maxDepth : cs, this.forceChown = s$7.forceChown === true, this.win32 = !!s$7.win32 || C$1, this.newer = !!s$7.newer, this.keep = !!s$7.keep, this.noMtime = !!s$7.noMtime, this.preservePaths = !!s$7.preservePaths, this.unlink = !!s$7.unlink, this.cwd = l$1(w$2.resolve(s$7.cwd || process.cwd())), this.strip = +s$7.strip || 0, this.processUmask = s$7.noChmod ? 0 : process.umask(), this.umask = typeof s$7.umask == "number" ? s$7.umask : this.processUmask, this.dmode = s$7.dmode || 511 & ~this.umask, this.fmode = s$7.fmode || 438 & ~this.umask, this.on("entry", (i$7) => this[H$1$1](i$7));
2043
+ }
2044
+ warn(s$7, i$7, e$6 = {}) {
2045
+ return (s$7 === "TAR_BAD_ARCHIVE" || s$7 === "TAR_ABORT") && (e$6.recoverable = false), super.warn(s$7, i$7, e$6);
2046
+ }
2047
+ [A]() {
2048
+ this[P$1] && this[$] === 0 && (this.emit("prefinish"), this.emit("finish"), this.emit("end"));
2049
+ }
2050
+ [j$2](s$7) {
2051
+ const i$7 = l$1(s$7.path), e$6 = i$7.split("/");
2052
+ if (this.strip) {
2053
+ if (e$6.length < this.strip) return false;
2054
+ if (s$7.type === "Link") {
2055
+ const t$6 = l$1(s$7.linkpath).split("/");
2056
+ if (t$6.length >= this.strip) s$7.linkpath = t$6.slice(this.strip).join("/");
2057
+ else return false;
2058
+ }
2059
+ e$6.splice(0, this.strip), s$7.path = e$6.join("/");
2060
+ }
2061
+ if (isFinite(this.maxDepth) && e$6.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", {
2062
+ entry: s$7,
2063
+ path: i$7,
2064
+ depth: e$6.length,
2065
+ maxDepth: this.maxDepth
2066
+ }), false;
2067
+ if (!this.preservePaths) {
2068
+ if (e$6.includes("..") || C$1 && /^[a-z]:\.\.$/i.test(e$6[0])) return this.warn("TAR_ENTRY_ERROR", "path contains '..'", {
2069
+ entry: s$7,
2070
+ path: i$7
2071
+ }), false;
2072
+ const [t$6, o$5] = os(i$7);
2073
+ t$6 && (s$7.path = o$5, this.warn("TAR_ENTRY_INFO", `stripping ${t$6} from absolute path`, {
2074
+ entry: s$7,
2075
+ path: i$7
2076
+ }));
2077
+ }
2078
+ if (w$2.isAbsolute(s$7.path) ? s$7.absolute = l$1(w$2.resolve(s$7.path)) : s$7.absolute = l$1(w$2.resolve(this.cwd, s$7.path)), !this.preservePaths && s$7.absolute.indexOf(this.cwd + "/") !== 0 && s$7.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", {
2079
+ entry: s$7,
2080
+ path: l$1(s$7.path),
2081
+ resolvedPath: s$7.absolute,
2082
+ cwd: this.cwd
2083
+ }), false;
2084
+ if (s$7.absolute === this.cwd && s$7.type !== "Directory" && s$7.type !== "GNUDumpDir") return false;
2085
+ if (this.win32) {
2086
+ const { root: t$6 } = w$2.win32.parse(s$7.absolute);
2087
+ s$7.absolute = t$6 + K.encode(s$7.absolute.slice(t$6.length));
2088
+ const { root: o$5 } = w$2.win32.parse(s$7.path);
2089
+ s$7.path = o$5 + K.encode(s$7.path.slice(o$5.length));
2090
+ }
2091
+ return true;
2092
+ }
2093
+ [H$1$1](s$7) {
2094
+ if (!this[j$2](s$7)) return s$7.resume();
2095
+ switch (ss.equal(typeof s$7.absolute, "string"), s$7.type) {
2096
+ case "Directory":
2097
+ case "GNUDumpDir": s$7.mode && (s$7.mode = s$7.mode | 448);
2098
+ case "File":
2099
+ case "OldFile":
2100
+ case "ContiguousFile":
2101
+ case "Link":
2102
+ case "SymbolicLink": return this[q$1](s$7);
2103
+ case "CharacterDevice":
2104
+ case "BlockDevice":
2105
+ case "FIFO":
2106
+ default: return this[W](s$7);
2107
+ }
2108
+ }
2109
+ [m$3](s$7, i$7) {
2110
+ s$7.name === "CwdError" ? this.emit("error", s$7) : (this.warn("TAR_ENTRY_ERROR", s$7, { entry: i$7 }), this[S$1](), i$7.resume());
2111
+ }
2112
+ [b](s$7, i$7, e$6) {
2113
+ M(l$1(s$7), {
2114
+ uid: this.uid,
2115
+ gid: this.gid,
2116
+ processUid: this.processUid,
2117
+ processGid: this.processGid,
2118
+ umask: this.processUmask,
2119
+ preserve: this.preservePaths,
2120
+ unlink: this.unlink,
2121
+ cache: this.dirCache,
2122
+ cwd: this.cwd,
2123
+ mode: i$7,
2124
+ noChmod: this.noChmod
2125
+ }, e$6);
2126
+ }
2127
+ [E$1](s$7) {
2128
+ return this.forceChown || this.preserveOwner && (typeof s$7.uid == "number" && s$7.uid !== this.processUid || typeof s$7.gid == "number" && s$7.gid !== this.processGid) || typeof this.uid == "number" && this.uid !== this.processUid || typeof this.gid == "number" && this.gid !== this.processGid;
2129
+ }
2130
+ [R$2](s$7) {
2131
+ return Q(this.uid, s$7.uid, this.processUid);
2132
+ }
2133
+ [_$1](s$7) {
2134
+ return Q(this.gid, s$7.gid, this.processGid);
2135
+ }
2136
+ [U](s$7, i$7) {
2137
+ const e$6 = s$7.mode & 4095 || this.fmode, t$6 = new es.WriteStream(s$7.absolute, {
2138
+ flags: J$1(s$7.size),
2139
+ mode: e$6,
2140
+ autoClose: false
2141
+ });
2142
+ t$6.on("error", (c$5) => {
2143
+ t$6.fd && r.close(t$6.fd, () => {}), t$6.write = () => true, this[m$3](c$5, s$7), i$7();
2144
+ });
2145
+ let o$5 = 1;
2146
+ const u$5 = (c$5) => {
2147
+ if (c$5) {
2148
+ t$6.fd && r.close(t$6.fd, () => {}), this[m$3](c$5, s$7), i$7();
2149
+ return;
2150
+ }
2151
+ --o$5 === 0 && r.close(t$6.fd, (n$4) => {
2152
+ n$4 ? this[m$3](n$4, s$7) : this[S$1](), i$7();
2153
+ });
2154
+ };
2155
+ t$6.on("finish", (c$5) => {
2156
+ const n$4 = s$7.absolute, p$1 = t$6.fd;
2157
+ if (s$7.mtime && !this.noMtime) {
2158
+ o$5++;
2159
+ const f$4 = s$7.atime || /* @__PURE__ */ new Date(), k$1 = s$7.mtime;
2160
+ r.futimes(p$1, f$4, k$1, (D) => D ? r.utimes(n$4, f$4, k$1, (I) => u$5(I && D)) : u$5());
2161
+ }
2162
+ if (this[E$1](s$7)) {
2163
+ o$5++;
2164
+ const f$4 = this[R$2](s$7), k$1 = this[_$1](s$7);
2165
+ r.fchown(p$1, f$4, k$1, (D) => D ? r.chown(n$4, f$4, k$1, (I) => u$5(I && D)) : u$5());
2166
+ }
2167
+ u$5();
2168
+ });
2169
+ const h = this.transform && this.transform(s$7) || s$7;
2170
+ h !== s$7 && (h.on("error", (c$5) => {
2171
+ this[m$3](c$5, s$7), i$7();
2172
+ }), s$7.pipe(h)), h.pipe(t$6);
2173
+ }
2174
+ [F$1$1](s$7, i$7) {
2175
+ const e$6 = s$7.mode & 4095 || this.dmode;
2176
+ this[b](s$7.absolute, e$6, (t$6) => {
2177
+ if (t$6) {
2178
+ this[m$3](t$6, s$7), i$7();
2179
+ return;
2180
+ }
2181
+ let o$5 = 1;
2182
+ const u$5 = (h) => {
2183
+ --o$5 === 0 && (i$7(), this[S$1](), s$7.resume());
2184
+ };
2185
+ s$7.mtime && !this.noMtime && (o$5++, r.utimes(s$7.absolute, s$7.atime || /* @__PURE__ */ new Date(), s$7.mtime, u$5)), this[E$1](s$7) && (o$5++, r.chown(s$7.absolute, this[R$2](s$7), this[_$1](s$7), u$5)), u$5();
2186
+ });
2187
+ }
2188
+ [W](s$7) {
2189
+ s$7.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${s$7.type}`, { entry: s$7 }), s$7.resume();
2190
+ }
2191
+ [B](s$7, i$7) {
2192
+ this[O$3](s$7, s$7.linkpath, "symlink", i$7);
2193
+ }
2194
+ [z$1](s$7, i$7) {
2195
+ const e$6 = l$1(w$2.resolve(this.cwd, s$7.linkpath));
2196
+ this[O$3](s$7, e$6, "link", i$7);
2197
+ }
2198
+ [V$1]() {
2199
+ this[$]++;
2200
+ }
2201
+ [S$1]() {
2202
+ this[$]--, this[A]();
2203
+ }
2204
+ [x](s$7) {
2205
+ this[S$1](), s$7.resume();
2206
+ }
2207
+ [N](s$7, i$7) {
2208
+ return s$7.type === "File" && !this.unlink && i$7.isFile() && i$7.nlink <= 1 && !C$1;
2209
+ }
2210
+ [q$1](s$7) {
2211
+ this[V$1]();
2212
+ const i$7 = [s$7.path];
2213
+ s$7.linkpath && i$7.push(s$7.linkpath), this.reservations.reserve(i$7, (e$6) => this[Y](s$7, e$6));
2214
+ }
2215
+ [v$2](s$7) {
2216
+ s$7.type === "SymbolicLink" ? ms(this.dirCache) : s$7.type !== "Directory" && ns(this.dirCache, s$7.absolute);
2217
+ }
2218
+ [Y](s$7, i$7) {
2219
+ this[v$2](s$7);
2220
+ const e$6 = (h) => {
2221
+ this[v$2](s$7), i$7(h);
2222
+ }, t$6 = () => {
2223
+ this[b](this.cwd, this.dmode, (h) => {
2224
+ if (h) {
2225
+ this[m$3](h, s$7), e$6();
2226
+ return;
2227
+ }
2228
+ this[g] = true, o$5();
2229
+ });
2230
+ }, o$5 = () => {
2231
+ if (s$7.absolute !== this.cwd) {
2232
+ const h = l$1(w$2.dirname(s$7.absolute));
2233
+ if (h !== this.cwd) return this[b](h, this.dmode, (c$5) => {
2234
+ if (c$5) {
2235
+ this[m$3](c$5, s$7), e$6();
2236
+ return;
2237
+ }
2238
+ u$5();
2239
+ });
2240
+ }
2241
+ u$5();
2242
+ }, u$5 = () => {
2243
+ r.lstat(s$7.absolute, (h, c$5) => {
2244
+ if (c$5 && (this.keep || this.newer && c$5.mtime > s$7.mtime)) {
2245
+ this[x](s$7), e$6();
2246
+ return;
2247
+ }
2248
+ if (h || this[N](s$7, c$5)) return this[d](null, s$7, e$6);
2249
+ if (c$5.isDirectory()) {
2250
+ if (s$7.type === "Directory") {
2251
+ const n$4 = !this.noChmod && s$7.mode && (c$5.mode & 4095) !== s$7.mode, p$1 = (f$4) => this[d](f$4, s$7, e$6);
2252
+ return n$4 ? r.chmod(s$7.absolute, s$7.mode, p$1) : p$1();
2253
+ }
2254
+ if (s$7.absolute !== this.cwd) return r.rmdir(s$7.absolute, (n$4) => this[d](n$4, s$7, e$6));
2255
+ }
2256
+ if (s$7.absolute === this.cwd) return this[d](null, s$7, e$6);
2257
+ as(s$7.absolute, (n$4) => this[d](n$4, s$7, e$6));
2258
+ });
2259
+ };
2260
+ this[g] ? o$5() : t$6();
2261
+ }
2262
+ [d](s$7, i$7, e$6) {
2263
+ if (s$7) {
2264
+ this[m$3](s$7, i$7), e$6();
2265
+ return;
2266
+ }
2267
+ switch (i$7.type) {
2268
+ case "File":
2269
+ case "OldFile":
2270
+ case "ContiguousFile": return this[U](i$7, e$6);
2271
+ case "Link": return this[z$1](i$7, e$6);
2272
+ case "SymbolicLink": return this[B](i$7, e$6);
2273
+ case "Directory":
2274
+ case "GNUDumpDir": return this[F$1$1](i$7, e$6);
2275
+ }
2276
+ }
2277
+ [O$3](s$7, i$7, e$6, t$6) {
2278
+ r[e$6](i$7, s$7.absolute, (o$5) => {
2279
+ o$5 ? this[m$3](o$5, s$7) : (this[S$1](), s$7.resume()), t$6();
2280
+ });
2281
+ }
2282
+ }
2283
+ const T$1 = (a$10) => {
2284
+ try {
2285
+ return [null, a$10()];
2286
+ } catch (s$7) {
2287
+ return [s$7, null];
2288
+ }
2289
+ };
2290
+ class ls extends L {
2291
+ [d](s$7, i$7) {
2292
+ return super[d](s$7, i$7, () => {});
2293
+ }
2294
+ [q$1](s$7) {
2295
+ if (this[v$2](s$7), !this[g]) {
2296
+ const o$5 = this[b](this.cwd, this.dmode);
2297
+ if (o$5) return this[m$3](o$5, s$7);
2298
+ this[g] = true;
2299
+ }
2300
+ if (s$7.absolute !== this.cwd) {
2301
+ const o$5 = l$1(w$2.dirname(s$7.absolute));
2302
+ if (o$5 !== this.cwd) {
2303
+ const u$5 = this[b](o$5, this.dmode);
2304
+ if (u$5) return this[m$3](u$5, s$7);
2305
+ }
2306
+ }
2307
+ const [i$7, e$6] = T$1(() => r.lstatSync(s$7.absolute));
2308
+ if (e$6 && (this.keep || this.newer && e$6.mtime > s$7.mtime)) return this[x](s$7);
2309
+ if (i$7 || this[N](s$7, e$6)) return this[d](null, s$7);
2310
+ if (e$6.isDirectory()) {
2311
+ if (s$7.type === "Directory") {
2312
+ const [h] = !this.noChmod && s$7.mode && (e$6.mode & 4095) !== s$7.mode ? T$1(() => {
2313
+ r.chmodSync(s$7.absolute, s$7.mode);
2314
+ }) : [];
2315
+ return this[d](h, s$7);
2316
+ }
2317
+ const [o$5] = T$1(() => r.rmdirSync(s$7.absolute));
2318
+ this[d](o$5, s$7);
2319
+ }
2320
+ const [t$6] = s$7.absolute === this.cwd ? [] : T$1(() => us(s$7.absolute));
2321
+ this[d](t$6, s$7);
2322
+ }
2323
+ [U](s$7, i$7) {
2324
+ const e$6 = s$7.mode & 4095 || this.fmode, t$6 = (h) => {
2325
+ let c$5;
2326
+ try {
2327
+ r.closeSync(o$5);
2328
+ } catch (n$4) {
2329
+ c$5 = n$4;
2330
+ }
2331
+ (h || c$5) && this[m$3](h || c$5, s$7), i$7();
2332
+ };
2333
+ let o$5;
2334
+ try {
2335
+ o$5 = r.openSync(s$7.absolute, J$1(s$7.size), e$6);
2336
+ } catch (h) {
2337
+ return t$6(h);
2338
+ }
2339
+ const u$5 = this.transform && this.transform(s$7) || s$7;
2340
+ u$5 !== s$7 && (u$5.on("error", (h) => this[m$3](h, s$7)), s$7.pipe(u$5)), u$5.on("data", (h) => {
2341
+ try {
2342
+ r.writeSync(o$5, h, 0, h.length);
2343
+ } catch (c$5) {
2344
+ t$6(c$5);
2345
+ }
2346
+ }), u$5.on("end", (h) => {
2347
+ let c$5 = null;
2348
+ if (s$7.mtime && !this.noMtime) {
2349
+ const n$4 = s$7.atime || /* @__PURE__ */ new Date(), p$1 = s$7.mtime;
2350
+ try {
2351
+ r.futimesSync(o$5, n$4, p$1);
2352
+ } catch (f$4) {
2353
+ try {
2354
+ r.utimesSync(s$7.absolute, n$4, p$1);
2355
+ } catch {
2356
+ c$5 = f$4;
2357
+ }
2358
+ }
2359
+ }
2360
+ if (this[E$1](s$7)) {
2361
+ const n$4 = this[R$2](s$7), p$1 = this[_$1](s$7);
2362
+ try {
2363
+ r.fchownSync(o$5, n$4, p$1);
2364
+ } catch (f$4) {
2365
+ try {
2366
+ r.chownSync(s$7.absolute, n$4, p$1);
2367
+ } catch {
2368
+ c$5 = c$5 || f$4;
2369
+ }
2370
+ }
2371
+ }
2372
+ t$6(c$5);
2373
+ });
2374
+ }
2375
+ [F$1$1](s$7, i$7) {
2376
+ const e$6 = s$7.mode & 4095 || this.dmode, t$6 = this[b](s$7.absolute, e$6);
2377
+ if (t$6) {
2378
+ this[m$3](t$6, s$7), i$7();
2379
+ return;
2380
+ }
2381
+ if (s$7.mtime && !this.noMtime) try {
2382
+ r.utimesSync(s$7.absolute, s$7.atime || /* @__PURE__ */ new Date(), s$7.mtime);
2383
+ } catch {}
2384
+ if (this[E$1](s$7)) try {
2385
+ r.chownSync(s$7.absolute, this[R$2](s$7), this[_$1](s$7));
2386
+ } catch {}
2387
+ i$7(), s$7.resume();
2388
+ }
2389
+ [b](s$7, i$7) {
2390
+ try {
2391
+ return M.sync(l$1(s$7), {
2392
+ uid: this.uid,
2393
+ gid: this.gid,
2394
+ processUid: this.processUid,
2395
+ processGid: this.processGid,
2396
+ umask: this.processUmask,
2397
+ preserve: this.preservePaths,
2398
+ unlink: this.unlink,
2399
+ cache: this.dirCache,
2400
+ cwd: this.cwd,
2401
+ mode: i$7
2402
+ });
2403
+ } catch (e$6) {
2404
+ return e$6;
2405
+ }
2406
+ }
2407
+ [O$3](s$7, i$7, e$6, t$6) {
2408
+ try {
2409
+ r[e$6 + "Sync"](i$7, s$7.absolute), t$6(), s$7.resume();
2410
+ } catch (o$5) {
2411
+ return this[m$3](o$5, s$7);
2412
+ }
2413
+ }
2414
+ }
2415
+ return L.Sync = ls, G = L, G;
2416
+ }
2417
+ var f, q;
2418
+ function v() {
2419
+ if (q) return f;
2420
+ q = 1;
2421
+ const w$2 = s$6(), u$5 = Os(), p$1 = node_fs.default, y$3 = X(), l$1 = node_path.default, m$3 = s();
2422
+ f = (r, e$6, o$5) => {
2423
+ typeof r == "function" ? (o$5 = r, e$6 = null, r = {}) : Array.isArray(r) && (e$6 = r, r = {}), typeof e$6 == "function" && (o$5 = e$6, e$6 = null), e$6 ? e$6 = Array.from(e$6) : e$6 = [];
2424
+ const t$6 = w$2(r);
2425
+ if (t$6.sync && typeof o$5 == "function") throw new TypeError("callback not supported for sync tar functions");
2426
+ if (!t$6.file && typeof o$5 == "function") throw new TypeError("callback only supported with file option");
2427
+ return e$6.length && d(t$6, e$6), t$6.file && t$6.sync ? $(t$6) : t$6.file ? h(t$6, o$5) : t$6.sync ? x(t$6) : z$1(t$6);
2428
+ };
2429
+ const d = (r, e$6) => {
2430
+ const o$5 = new Map(e$6.map((n$4) => [m$3(n$4), true])), t$6 = r.filter, s$7 = (n$4, i$7) => {
2431
+ const a$10 = i$7 || l$1.parse(n$4).root || ".", c$5 = n$4 === a$10 ? false : o$5.has(n$4) ? o$5.get(n$4) : s$7(l$1.dirname(n$4), a$10);
2432
+ return o$5.set(n$4, c$5), c$5;
2433
+ };
2434
+ r.filter = t$6 ? (n$4, i$7) => t$6(n$4, i$7) && s$7(m$3(n$4)) : (n$4) => s$7(m$3(n$4));
2435
+ }, $ = (r) => {
2436
+ const e$6 = new u$5.Sync(r), o$5 = r.file, t$6 = p$1.statSync(o$5), s$7 = r.maxReadSize || 16 * 1024 * 1024;
2437
+ new y$3.ReadStreamSync(o$5, {
2438
+ readSize: s$7,
2439
+ size: t$6.size
2440
+ }).pipe(e$6);
2441
+ }, h = (r, e$6) => {
2442
+ const o$5 = new u$5(r), t$6 = r.maxReadSize || 16 * 1024 * 1024, s$7 = r.file, n$4 = new Promise((i$7, a$10) => {
2443
+ o$5.on("error", a$10), o$5.on("close", i$7), p$1.stat(s$7, (c$5, R$2) => {
2444
+ if (c$5) a$10(c$5);
2445
+ else {
2446
+ const S$1 = new y$3.ReadStream(s$7, {
2447
+ readSize: t$6,
2448
+ size: R$2.size
2449
+ });
2450
+ S$1.on("error", a$10), S$1.pipe(o$5);
2451
+ }
2452
+ });
2453
+ });
2454
+ return e$6 ? n$4.then(e$6, e$6) : n$4;
2455
+ }, x = (r) => new u$5.Sync(r), z$1 = (r) => new u$5(r);
2456
+ return f;
2457
+ }
2458
+ const tarExtract = getDefaultExportFromCjs(v());
2459
+ async function download(url, filePath, options = {}) {
2460
+ const infoPath = filePath + ".json";
2461
+ const info = JSON.parse(await (0, node_fs_promises.readFile)(infoPath, "utf8").catch(() => "{}"));
2462
+ const etag = (await sendFetch(url, {
2463
+ method: "HEAD",
2464
+ headers: options.headers
2465
+ }).catch(() => void 0))?.headers.get("etag");
2466
+ if (info.etag === etag && (0, node_fs.existsSync)(filePath)) return;
2467
+ if (typeof etag === "string") info.etag = etag;
2468
+ const response = await sendFetch(url, { headers: options.headers });
2469
+ if (response.status >= 400) throw new Error(`Failed to download ${url}: ${response.status} ${response.statusText}`);
2470
+ const stream = (0, node_fs.createWriteStream)(filePath);
2471
+ await (0, node_util.promisify)(node_stream.pipeline)(response.body, stream);
2472
+ await (0, node_fs_promises.writeFile)(infoPath, JSON.stringify(info), "utf8");
2473
+ }
2474
+ const inputRegex = /^(?<repo>[\w.-]+\/[\w.-]+)(?<subdir>[^#]+)?(?<ref>#[\w./@-]+)?/;
2475
+ function parseGitURI(input) {
2476
+ const m$3 = input.match(inputRegex)?.groups || {};
2477
+ return {
2478
+ repo: m$3.repo,
2479
+ subdir: m$3.subdir || "/",
2480
+ ref: m$3.ref ? m$3.ref.slice(1) : "main"
2481
+ };
2482
+ }
2483
+ function debug(...args) {
2484
+ if (process.env.DEBUG) console.debug("[giget]", ...args);
2485
+ }
2486
+ async function sendFetch(url, options = {}) {
2487
+ if (options.headers?.["sec-fetch-mode"]) options.mode = options.headers["sec-fetch-mode"];
2488
+ const res = await (0, import_proxy.fetch)(url, {
2489
+ ...options,
2490
+ headers: normalizeHeaders(options.headers)
2491
+ }).catch((error) => {
2492
+ throw new Error(`Failed to download ${url}: ${error}`, { cause: error });
2493
+ });
2494
+ if (options.validateStatus && res.status >= 400) throw new Error(`Failed to fetch ${url}: ${res.status} ${res.statusText}`);
2495
+ return res;
2496
+ }
2497
+ function cacheDirectory() {
2498
+ const cacheDir = process.env.XDG_CACHE_HOME ? require_pathe_M_eThtNZ.resolve(process.env.XDG_CACHE_HOME, "giget") : require_pathe_M_eThtNZ.resolve((0, node_os.homedir)(), ".cache/giget");
2499
+ if (process.platform === "win32") {
2500
+ const windowsCacheDir = require_pathe_M_eThtNZ.resolve((0, node_os.tmpdir)(), "giget");
2501
+ if (!(0, node_fs.existsSync)(windowsCacheDir) && (0, node_fs.existsSync)(cacheDir)) try {
2502
+ (0, node_fs.renameSync)(cacheDir, windowsCacheDir);
2503
+ } catch {}
2504
+ return windowsCacheDir;
2505
+ }
2506
+ return cacheDir;
2507
+ }
2508
+ function normalizeHeaders(headers = {}) {
2509
+ const normalized = {};
2510
+ for (const [key, value] of Object.entries(headers)) {
2511
+ if (!value) continue;
2512
+ normalized[key.toLowerCase()] = value;
2513
+ }
2514
+ return normalized;
2515
+ }
2516
+ const http = async (input, options) => {
2517
+ if (input.endsWith(".json")) return await _httpJSON(input, options);
2518
+ const url = new URL(input);
2519
+ let name = require_pathe_M_eThtNZ.basename(url.pathname);
2520
+ try {
2521
+ const head = await sendFetch(url.href, {
2522
+ method: "HEAD",
2523
+ validateStatus: true,
2524
+ headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 }
2525
+ });
2526
+ if ((head.headers.get("content-type") || "").includes("application/json")) return await _httpJSON(input, options);
2527
+ const filename = head.headers.get("content-disposition")?.match(/filename="?(.+)"?/)?.[1];
2528
+ if (filename) name = filename.split(".")[0];
2529
+ } catch (error) {
2530
+ debug(`Failed to fetch HEAD for ${url.href}:`, error);
2531
+ }
2532
+ return {
2533
+ name: `${name}-${url.href.slice(0, 8)}`,
2534
+ version: "",
2535
+ subdir: "",
2536
+ tar: url.href,
2537
+ defaultDir: name,
2538
+ headers: { Authorization: options.auth ? `Bearer ${options.auth}` : void 0 }
2539
+ };
2540
+ };
2541
+ const _httpJSON = async (input, options) => {
2542
+ const info = await (await sendFetch(input, {
2543
+ validateStatus: true,
2544
+ headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 }
2545
+ })).json();
2546
+ if (!info.tar || !info.name) throw new Error(`Invalid template info from ${input}. name or tar fields are missing!`);
2547
+ return info;
2548
+ };
2549
+ const github = (input, options) => {
2550
+ const parsed = parseGitURI(input);
2551
+ const githubAPIURL = process.env.GIGET_GITHUB_URL || "https://api.github.com";
2552
+ return {
2553
+ name: parsed.repo.replace("/", "-"),
2554
+ version: parsed.ref,
2555
+ subdir: parsed.subdir,
2556
+ headers: {
2557
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
2558
+ Accept: "application/vnd.github+json",
2559
+ "X-GitHub-Api-Version": "2022-11-28"
2560
+ },
2561
+ url: `${githubAPIURL.replace("api.github.com", "github.com")}/${parsed.repo}/tree/${parsed.ref}${parsed.subdir}`,
2562
+ tar: `${githubAPIURL}/repos/${parsed.repo}/tarball/${parsed.ref}`
2563
+ };
2564
+ };
2565
+ const gitlab = (input, options) => {
2566
+ const parsed = parseGitURI(input);
2567
+ const gitlab2 = process.env.GIGET_GITLAB_URL || "https://gitlab.com";
2568
+ return {
2569
+ name: parsed.repo.replace("/", "-"),
2570
+ version: parsed.ref,
2571
+ subdir: parsed.subdir,
2572
+ headers: {
2573
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0,
2574
+ "sec-fetch-mode": "same-origin"
2575
+ },
2576
+ url: `${gitlab2}/${parsed.repo}/tree/${parsed.ref}${parsed.subdir}`,
2577
+ tar: `${gitlab2}/${parsed.repo}/-/archive/${parsed.ref}.tar.gz`
2578
+ };
2579
+ };
2580
+ const bitbucket = (input, options) => {
2581
+ const parsed = parseGitURI(input);
2582
+ return {
2583
+ name: parsed.repo.replace("/", "-"),
2584
+ version: parsed.ref,
2585
+ subdir: parsed.subdir,
2586
+ headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 },
2587
+ url: `https://bitbucket.com/${parsed.repo}/src/${parsed.ref}${parsed.subdir}`,
2588
+ tar: `https://bitbucket.org/${parsed.repo}/get/${parsed.ref}.tar.gz`
2589
+ };
2590
+ };
2591
+ const sourcehut = (input, options) => {
2592
+ const parsed = parseGitURI(input);
2593
+ return {
2594
+ name: parsed.repo.replace("/", "-"),
2595
+ version: parsed.ref,
2596
+ subdir: parsed.subdir,
2597
+ headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 },
2598
+ url: `https://git.sr.ht/~${parsed.repo}/tree/${parsed.ref}/item${parsed.subdir}`,
2599
+ tar: `https://git.sr.ht/~${parsed.repo}/archive/${parsed.ref}.tar.gz`
2600
+ };
2601
+ };
2602
+ const providers = {
2603
+ http,
2604
+ https: http,
2605
+ github,
2606
+ gh: github,
2607
+ gitlab,
2608
+ bitbucket,
2609
+ sourcehut
2610
+ };
2611
+ const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/unjs/giget/main/templates";
2612
+ const registryProvider = (registryEndpoint = DEFAULT_REGISTRY, options = {}) => {
2613
+ return async (input) => {
2614
+ const start = Date.now();
2615
+ const registryURL = `${registryEndpoint}/${input}.json`;
2616
+ const result = await sendFetch(registryURL, { headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 } });
2617
+ if (result.status >= 400) throw new Error(`Failed to download ${input} template info from ${registryURL}: ${result.status} ${result.statusText}`);
2618
+ const info = await result.json();
2619
+ if (!info.tar || !info.name) throw new Error(`Invalid template info from ${registryURL}. name or tar fields are missing!`);
2620
+ debug(`Fetched ${input} template info from ${registryURL} in ${Date.now() - start}ms`);
2621
+ return info;
2622
+ };
2623
+ };
2624
+ const sourceProtoRe = /^([\w-.]+):/;
2625
+ async function downloadTemplate(input, options = {}) {
2626
+ options = require_defu.defu({
2627
+ registry: process.env.GIGET_REGISTRY,
2628
+ auth: process.env.GIGET_AUTH
2629
+ }, options);
2630
+ const registry = options.registry === false ? void 0 : registryProvider(options.registry, { auth: options.auth });
2631
+ let providerName = options.provider || (registry ? "registry" : "github");
2632
+ let source = input;
2633
+ const sourceProviderMatch = input.match(sourceProtoRe);
2634
+ if (sourceProviderMatch) {
2635
+ providerName = sourceProviderMatch[1];
2636
+ source = input.slice(sourceProviderMatch[0].length);
2637
+ if (providerName === "http" || providerName === "https") source = input;
2638
+ }
2639
+ const provider = options.providers?.[providerName] || providers[providerName] || registry;
2640
+ if (!provider) throw new Error(`Unsupported provider: ${providerName}`);
2641
+ const template = await Promise.resolve().then(() => provider(source, { auth: options.auth })).catch((error) => {
2642
+ throw new Error(`Failed to download template from ${providerName}: ${error.message}`);
2643
+ });
2644
+ if (!template) throw new Error(`Failed to resolve template from ${providerName}`);
2645
+ template.name = (template.name || "template").replace(/[^\da-z-]/gi, "-");
2646
+ template.defaultDir = (template.defaultDir || template.name).replace(/[^\da-z-]/gi, "-");
2647
+ const tarPath = require_pathe_M_eThtNZ.resolve(require_pathe_M_eThtNZ.resolve(cacheDirectory(), providerName, template.name), (template.version || template.name) + ".tar.gz");
2648
+ if (options.preferOffline && (0, node_fs.existsSync)(tarPath)) options.offline = true;
2649
+ if (!options.offline) {
2650
+ await (0, node_fs_promises.mkdir)(require_pathe_M_eThtNZ.dirname(tarPath), { recursive: true });
2651
+ const s2 = Date.now();
2652
+ await download(template.tar, tarPath, { headers: {
2653
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
2654
+ ...normalizeHeaders(template.headers)
2655
+ } }).catch((error) => {
2656
+ if (!(0, node_fs.existsSync)(tarPath)) throw error;
2657
+ debug("Download error. Using cached version:", error);
2658
+ options.offline = true;
2659
+ });
2660
+ debug(`Downloaded ${template.tar} to ${tarPath} in ${Date.now() - s2}ms`);
2661
+ }
2662
+ if (!(0, node_fs.existsSync)(tarPath)) throw new Error(`Tarball not found: ${tarPath} (offline: ${options.offline})`);
2663
+ const extractPath = require_pathe_M_eThtNZ.resolve(require_pathe_M_eThtNZ.resolve(options.cwd || "."), options.dir || template.defaultDir);
2664
+ if (options.forceClean) await (0, node_fs_promises.rm)(extractPath, {
2665
+ recursive: true,
2666
+ force: true
2667
+ });
2668
+ if (!options.force && (0, node_fs.existsSync)(extractPath) && (0, node_fs.readdirSync)(extractPath).length > 0) throw new Error(`Destination ${extractPath} already exists.`);
2669
+ await (0, node_fs_promises.mkdir)(extractPath, { recursive: true });
2670
+ const s$7 = Date.now();
2671
+ const subdir = template.subdir?.replace(/^\//, "") || "";
2672
+ await tarExtract({
2673
+ file: tarPath,
2674
+ cwd: extractPath,
2675
+ onentry(entry) {
2676
+ entry.path = entry.path.split("/").splice(1).join("/");
2677
+ if (subdir) if (entry.path.startsWith(subdir + "/")) entry.path = entry.path.slice(subdir.length);
2678
+ else entry.path = "";
2679
+ }
2680
+ });
2681
+ debug(`Extracted to ${extractPath} in ${Date.now() - s$7}ms`);
2682
+ if (options.install) {
2683
+ debug("Installing dependencies...");
2684
+ await require_nypm_CLjaS_sz.installDependencies({
2685
+ cwd: extractPath,
2686
+ silent: options.silent
2687
+ });
2688
+ }
2689
+ return {
2690
+ ...template,
2691
+ source,
2692
+ dir: extractPath
2693
+ };
2694
+ }
2695
+
2696
+ //#endregion
2697
+ exports.downloadTemplate = downloadTemplate;
2698
+ exports.registryProvider = registryProvider;