@powerlines/plugin-env 0.15.121 → 0.15.122

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