@runfusion/fusion 0.43.1 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/README.md +2 -1
  2. package/dist/automation-store-EKXXEE2S.js +10 -0
  3. package/dist/automation-store-PLNG3X72.js +10 -0
  4. package/dist/automation-store-RDDYZFUJ.js +10 -0
  5. package/dist/bin.js +14420 -3360
  6. package/dist/chunk-2JI3F6MG.js +948 -0
  7. package/dist/chunk-4L6CLWJC.js +8345 -0
  8. package/dist/chunk-4VNS5WPM.js +42 -0
  9. package/dist/chunk-5RGECGQL.js +1139 -0
  10. package/dist/chunk-6JDLN7IL.js +409 -0
  11. package/dist/chunk-AICJATVW.js +948 -0
  12. package/dist/chunk-AWKNRUOR.js +1148 -0
  13. package/dist/chunk-BHM3UYWS.js +4651 -0
  14. package/dist/chunk-BMUXDSBF.js +4647 -0
  15. package/dist/chunk-GETECT6V.js +353 -0
  16. package/dist/chunk-GUV4QQT3.js +1143 -0
  17. package/dist/chunk-JKQO7YYZ.js +8369 -0
  18. package/dist/chunk-LYZVU6UV.js +409 -0
  19. package/dist/chunk-MAN4WYHO.js +353 -0
  20. package/dist/chunk-MCUG2Z7M.js +4651 -0
  21. package/dist/chunk-PSDYB45U.js +948 -0
  22. package/dist/chunk-RR2HM46R.js +8345 -0
  23. package/dist/chunk-RXMQ5OMY.js +9226 -0
  24. package/dist/chunk-S2EVJUY3.js +353 -0
  25. package/dist/chunk-UXR5XZFZ.js +409 -0
  26. package/dist/client/.vite/manifest.json +1138 -340
  27. package/dist/client/assets/AgentDetailView-CgbB51Iw.css +1 -0
  28. package/dist/client/assets/AgentDetailView-DJTi6hKC.js +18 -0
  29. package/dist/client/assets/{AgentPermissionPolicyEditor-BiY1a4KR.js → AgentPermissionPolicyEditor-C5DR9dUS.js} +2 -2
  30. package/dist/client/assets/AgentsView-BNd90PSx.js +29 -0
  31. package/dist/client/assets/AgentsView-CzMa5Olf.css +1 -0
  32. package/dist/client/assets/ChatView-B7JaZCL_.js +19 -0
  33. package/dist/client/assets/ChatView-BtjkE0V7.css +1 -0
  34. package/dist/client/assets/CommandCenter-CHO21xEW.js +74 -0
  35. package/dist/client/assets/CommandCenter-Xs5Ftv8s.css +1 -0
  36. package/dist/client/assets/DevServerView-B_p91Mj_.css +1 -0
  37. package/dist/client/assets/DevServerView-H9OkT1ld.js +1 -0
  38. package/dist/client/assets/{DirectoryPicker-DTKtd8L2.css → DirectoryPicker-0rspvcMz.css} +1 -1
  39. package/dist/client/assets/DirectoryPicker-DegxT8ia.js +1 -0
  40. package/dist/client/assets/DocumentsView-kVVQYISc.js +1 -0
  41. package/dist/client/assets/EvalsView-C9-iTSat.js +1 -0
  42. package/dist/client/assets/EvalsView-CTbgPUne.css +1 -0
  43. package/dist/client/assets/ExperimentalAgentOnboardingModal-3ZEFv8sr.css +1 -0
  44. package/dist/client/assets/ExperimentalAgentOnboardingModal-DjP_xNkc.js +1 -0
  45. package/dist/client/assets/GoalsView-CUh8JBnJ.css +1 -0
  46. package/dist/client/assets/GoalsView-VoIHJJ5l.js +2 -0
  47. package/dist/client/assets/InsightsView-BIZaUcpd.js +11 -0
  48. package/dist/client/assets/InsightsView-C7yRTMPn.css +1 -0
  49. package/dist/client/assets/MemoryView-7v7rv6ns.js +2 -0
  50. package/dist/client/assets/MemoryView-CBDUr2Jy.css +1 -0
  51. package/dist/client/assets/PiExtensionsManager-CB89rV4U.js +11 -0
  52. package/dist/client/assets/PluginManager-BNSuW_R4.js +1 -0
  53. package/dist/client/assets/PluginManager-DSiHizRD.css +1 -0
  54. package/dist/client/assets/PullRequestView-CI5jdKBL.js +6 -0
  55. package/dist/client/assets/PullRequestView-CpdE3Yo_.css +1 -0
  56. package/dist/client/assets/ResearchView-BT5dR_m8.js +1 -0
  57. package/dist/client/assets/ResearchView-DIVNQF4_.css +1 -0
  58. package/dist/client/assets/SecretsView-CvFioX7R.css +1 -0
  59. package/dist/client/assets/SecretsView-WPYI58Uo.js +1 -0
  60. package/dist/client/assets/SessionTerminal-C6gyOWLt.js +2 -0
  61. package/dist/client/assets/SessionTerminal-D4R3ScvQ.css +1 -0
  62. package/dist/client/assets/SettingsModal-BESN59Ao.css +1 -0
  63. package/dist/client/assets/SettingsModal-BZokaNyx.css +1 -0
  64. package/dist/client/assets/SettingsModal-Bq_3AbaB.js +1 -0
  65. package/dist/client/assets/SettingsModal-JHACoQJe.js +21 -0
  66. package/dist/client/assets/SetupWizardModal-CrgbnR_d.js +2 -0
  67. package/dist/client/assets/ShadcnColorPicker-1icHuwhC.js +11 -0
  68. package/dist/client/assets/ShadcnColorPicker-pqVWCC5-.css +1 -0
  69. package/dist/client/assets/SkillsView-CJ8snrma.css +1 -0
  70. package/dist/client/assets/SkillsView-byuSe3e0.js +1 -0
  71. package/dist/client/assets/TodoView-CIsL_uvQ.css +1 -0
  72. package/dist/client/assets/TodoView-CQ9GjYBg.js +6 -0
  73. package/dist/client/assets/WorkflowNodeEditor-DW7sJZUX.js +8 -0
  74. package/dist/client/assets/WorkflowNodeEditor-f_XPV5Jd.css +1 -0
  75. package/dist/client/assets/{addon-fit-B4jkcKk4.js → addon-fit-C1WQXRvu.js} +1 -1
  76. package/dist/client/assets/{addon-unicode11-Cdne2Sj4.js → addon-unicode11-BVmNDUBM.js} +1 -1
  77. package/dist/client/assets/{addon-web-links-CRNLzj7m.js → addon-web-links-CkVew5xs.js} +1 -1
  78. package/dist/client/assets/{addon-webgl-CeCSULF1.js → addon-webgl-uLc0RKcC.js} +1 -1
  79. package/dist/client/assets/agentSkills-CeytXLHF.js +1 -0
  80. package/dist/client/assets/agentSkills-bQJ4X1gH.css +1 -0
  81. package/dist/client/assets/agentsOrgChartLayout-BMvyuaLA.js +1 -0
  82. package/dist/client/assets/app-3wbZ08YC.js +13 -0
  83. package/dist/client/assets/app-7-5DWLtg.js +13 -0
  84. package/dist/client/assets/app-CSvE5Noc.js +13 -0
  85. package/dist/client/assets/app-CZ2LTFce.js +13 -0
  86. package/dist/client/assets/app-Cv9xEnll.js +13 -0
  87. package/dist/client/assets/app-x_yPcO5Y.js +13 -0
  88. package/dist/client/assets/arc-cxkkNsnK.js +1 -0
  89. package/dist/client/assets/architectureDiagram-3BPJPVTR-BRI0QwDf.js +36 -0
  90. package/dist/client/assets/band-CquvqAHh.js +1 -0
  91. package/dist/client/assets/blockDiagram-GPEHLZMM-BXkN8Hv_.js +132 -0
  92. package/dist/client/assets/c4Diagram-AAUBKEIU-C_Kcokep.js +10 -0
  93. package/dist/client/assets/channel-Clzpzu32.js +1 -0
  94. package/dist/client/assets/chunk-2J33WTMH-BGeuCz9C.js +1 -0
  95. package/dist/client/assets/chunk-4BX2VUAB-DcVdctr0.js +1 -0
  96. package/dist/client/assets/chunk-55IACEB6-Dg6gDigQ.js +1 -0
  97. package/dist/client/assets/chunk-727SXJPM-B9B-vlEb.js +206 -0
  98. package/dist/client/assets/chunk-AQP2D5EJ-LrWQ-2yi.js +231 -0
  99. package/dist/client/assets/chunk-FMBD7UC4-Bnd6hAED.js +15 -0
  100. package/dist/client/assets/chunk-ND2GUHAM-nAw93UB5.js +1 -0
  101. package/dist/client/assets/chunk-QZHKN3VN-CgprKcZo.js +1 -0
  102. package/dist/client/assets/classDiagram-4FO5ZUOK-CzYHP-af.js +1 -0
  103. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CzYHP-af.js +1 -0
  104. package/dist/client/assets/common-BDp2y6CF.js +1 -0
  105. package/dist/client/assets/common-BnEo5fLN.js +1 -0
  106. package/dist/client/assets/common-Bzr_Y8h4.js +1 -0
  107. package/dist/client/assets/common-CvwyFzfv.js +1 -0
  108. package/dist/client/assets/common-CztCXRkz.js +1 -0
  109. package/dist/client/assets/common-DPe2mbb7.js +1 -0
  110. package/dist/client/assets/cose-bilkent-S5V4N54A-Bhn0g_iK.js +1 -0
  111. package/dist/client/assets/cytoscape.esm-OyMbaexL.js +331 -0
  112. package/dist/client/assets/dagre-BM42HDAG-CP4kfwqd.js +4 -0
  113. package/dist/client/assets/{dashboard-view-C3SsjXo1.js → dashboard-view-CM6Xin_H.js} +1680 -1620
  114. package/dist/client/assets/dashboard-view-DV1nEhh9.js +1 -0
  115. package/dist/client/assets/dashboard-view-D_zsA-kz.css +1 -0
  116. package/dist/client/assets/defaultLocale-DX6XiGOO.js +1 -0
  117. package/dist/client/assets/diagram-2AECGRRQ-DPhzVEUf.js +43 -0
  118. package/dist/client/assets/diagram-5GNKFQAL-8QOC3K_L.js +10 -0
  119. package/dist/client/assets/diagram-KO2AKTUF-C1twgEch.js +3 -0
  120. package/dist/client/assets/diagram-LMA3HP47-3bEegSuf.js +24 -0
  121. package/dist/client/assets/diagram-OG6HWLK6-BJ_x0rm6.js +24 -0
  122. package/dist/client/assets/erDiagram-TEJ5UH35-DNiiS5q6.js +85 -0
  123. package/dist/client/assets/flowDiagram-I6XJVG4X-DoouPklt.js +162 -0
  124. package/dist/client/assets/{folder-open-Bw1mxVfa.js → folder-open-CuUs2W7f.js} +1 -1
  125. package/dist/client/assets/ganttDiagram-6RSMTGT7-BrR6VnP5.js +292 -0
  126. package/dist/client/assets/gitGraphDiagram-PVQCEYII-BV8_J6Ee.js +106 -0
  127. package/dist/client/assets/graph--OzhPTMs.js +1 -0
  128. package/dist/client/assets/index-BZBQ_KsL.css +1 -0
  129. package/dist/client/assets/index-CZcWjLAb.js +1459 -0
  130. package/dist/client/assets/infoDiagram-5YYISTIA-DGwIIFkR.js +2 -0
  131. package/dist/client/assets/init-Dmth1JHB.js +1 -0
  132. package/dist/client/assets/ishikawaDiagram-YF4QCWOH-D5dEH4RE.js +70 -0
  133. package/dist/client/assets/journeyDiagram-JHISSGLW-BuuSWPw5.js +139 -0
  134. package/dist/client/assets/kanban-definition-UN3LZRKU-DA34uUla.js +89 -0
  135. package/dist/client/assets/katex-HP8lGamR.js +257 -0
  136. package/dist/client/assets/layout-SsrduOYp.js +1 -0
  137. package/dist/client/assets/linear-dXivciGL.js +1 -0
  138. package/dist/client/assets/mermaid.core-Ch4HatqA.js +309 -0
  139. package/dist/client/assets/mindmap-definition-RKZ34NQL-DUCG-qD3.js +96 -0
  140. package/dist/client/assets/ordinal-DILIJJjt.js +1 -0
  141. package/dist/client/assets/pieDiagram-4H26LBE5-DWvFGiLa.js +30 -0
  142. package/dist/client/assets/quadrantDiagram-W4KKPZXB-OPTVW3WT.js +7 -0
  143. package/dist/client/assets/requirementDiagram-4Y6WPE33-D7feZvlU.js +84 -0
  144. package/dist/client/assets/sankeyDiagram-5OEKKPKP-AtnSsEX1.js +40 -0
  145. package/dist/client/assets/sequenceDiagram-3UESZ5HK-BZjHUeI5.js +162 -0
  146. package/dist/client/assets/shield-alert-CzaF9ROV.js +6 -0
  147. package/dist/client/assets/stateDiagram-AJRCARHV-C8j23Pvn.js +1 -0
  148. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-CiZR_S5-.js +1 -0
  149. package/dist/client/assets/step-yuy0qJer.js +1 -0
  150. package/dist/client/assets/time-DoDTxsna.js +1 -0
  151. package/dist/client/assets/timeline-definition-PNZ67QCA-DvfNz25n.js +120 -0
  152. package/dist/client/assets/{upload-BCmd-1I0.js → upload-DTsYywhN.js} +1 -1
  153. package/dist/client/assets/{users-DO_t3V1p.js → users-yAd09tKP.js} +1 -1
  154. package/dist/client/assets/{vendor-i18n-CV0mwX_-.js → vendor-i18n-GF3RlKbq.js} +2 -2
  155. package/dist/client/assets/vendor-react-SZ_qB27O.js +49 -0
  156. package/dist/client/assets/vendor-reactflow-Bg-Qjzh8.js +15 -0
  157. package/dist/client/assets/{vendor-xterm-tcedd2Jt.js → vendor-xterm-BNq00GSj.js} +1 -1
  158. package/dist/client/assets/vennDiagram-CIIHVFJN-CG2aMt3v.js +34 -0
  159. package/dist/client/assets/wardley-L42UT6IY-BnhBteen.js +173 -0
  160. package/dist/client/assets/wardleyDiagram-YWT4CUSO-DwqTzM3T.js +78 -0
  161. package/dist/client/assets/xychartDiagram-2RQKCTM6-5Cv2ZKMV.js +7 -0
  162. package/dist/client/assets/zoom-out-NWbVkreR.js +41 -0
  163. package/dist/client/icons/icon-192.png +0 -0
  164. package/dist/client/icons/icon-512.png +0 -0
  165. package/dist/client/index.html +30 -10
  166. package/dist/client/sw.js +1 -1
  167. package/dist/client/theme-data.css +3348 -469
  168. package/dist/client/version.json +1 -1
  169. package/dist/droid-cli/index.ts +56 -40
  170. package/dist/droid-cli/package.json +1 -1
  171. package/dist/droid-cli/src/__tests__/execsync-guard.test.ts +17 -0
  172. package/dist/droid-cli/src/__tests__/index.test.ts +47 -21
  173. package/dist/droid-cli/src/__tests__/process-manager.test.ts +51 -78
  174. package/dist/extension.js +9651 -1556
  175. package/dist/extract-zip-WL55Z3AU.js +2497 -0
  176. package/dist/index.min-CHQ3ABYJ.js +2926 -0
  177. package/dist/memory-dreams-7USISKVE.js +32 -0
  178. package/dist/memory-dreams-PBPISUDD.js +32 -0
  179. package/dist/memory-dreams-XNO2B2QF.js +32 -0
  180. package/dist/migration-EH2YOCYQ.js +15 -0
  181. package/dist/migration-PLGTTKL5.js +15 -0
  182. package/dist/migration-WZEZK22R.js +15 -0
  183. package/dist/pi-claude-cli/index.ts +47 -8
  184. package/dist/pi-claude-cli/package.json +4 -1
  185. package/dist/pi-claude-cli/src/__tests__/acp-dispatch.test.ts +80 -0
  186. package/dist/pi-claude-cli/src/__tests__/acp-driver.test.ts +423 -0
  187. package/dist/pi-claude-cli/src/__tests__/execsync-guard.test.ts +14 -0
  188. package/dist/pi-claude-cli/src/__tests__/process-manager.test.ts +26 -45
  189. package/dist/pi-claude-cli/src/__tests__/provider.test.ts +0 -1
  190. package/dist/pi-claude-cli/src/acp-driver.ts +585 -0
  191. package/dist/pi-claude-cli/src/event-bridge.ts +7 -0
  192. package/dist/pi-claude-cli/src/mcp-config.ts +29 -0
  193. package/dist/pi-claude-cli/src/process-manager.ts +17 -39
  194. package/dist/plugin-sdk/index.d.ts +5305 -5148
  195. package/dist/plugins/fusion-plugin-acp-runtime/bundled.js +263 -19
  196. package/dist/plugins/fusion-plugin-acp-runtime/package.json +1 -1
  197. package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
  198. package/dist/plugins/fusion-plugin-compound-engineering/bundled.js +37 -7
  199. package/dist/plugins/fusion-plugin-compound-engineering/manifest.json +4 -4
  200. package/dist/plugins/fusion-plugin-compound-engineering/package.json +1 -1
  201. package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
  202. package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
  203. package/dist/plugins/fusion-plugin-droid-runtime/bundled.js +69 -45
  204. package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
  205. package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
  206. package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
  207. package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
  208. package/dist/plugins/fusion-plugin-reports/package.json +1 -1
  209. package/dist/plugins/fusion-plugin-roadmap/bundled.js +5 -11
  210. package/dist/plugins/fusion-plugin-roadmap/manifest.json +1 -11
  211. package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
  212. package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
  213. package/dist/plugins/fusion-plugin-whatsapp-chat/src/__tests__/index.test.ts +5 -1
  214. package/dist/routine-store-GIJ6MXWY.js +10 -0
  215. package/dist/routine-store-HTVC2PUQ.js +10 -0
  216. package/dist/routine-store-KGHZBPDF.js +10 -0
  217. package/package.json +3 -3
  218. package/skill/fusion/SKILL.md +1 -1
  219. package/skill/fusion/references/cli-commands.md +2 -1
  220. package/skill/fusion/references/engine-tools.md +6 -4
  221. package/skill/fusion/references/extension-tools.md +10 -0
  222. package/skill/fusion/references/fusion-capabilities.md +3 -1
  223. package/dist/client/assets/AgentDetailView-BGN03dyz.css +0 -1
  224. package/dist/client/assets/AgentDetailView-DKMz3r04.js +0 -18
  225. package/dist/client/assets/AgentsView-Co-k4vjh.js +0 -29
  226. package/dist/client/assets/AgentsView-DfznJDek.css +0 -1
  227. package/dist/client/assets/ChatView-BkAG99bj.js +0 -6
  228. package/dist/client/assets/ChatView-DwJAd5G1.css +0 -1
  229. package/dist/client/assets/DevServerView-C6DC0URX.js +0 -1
  230. package/dist/client/assets/DevServerView-VTQY28P7.css +0 -1
  231. package/dist/client/assets/DirectoryPicker-CkcGjyv0.js +0 -1
  232. package/dist/client/assets/DocumentsView-OCK1Vsw_.js +0 -1
  233. package/dist/client/assets/DocumentsView-WfVoTZt8.css +0 -1
  234. package/dist/client/assets/EvalsView-CUNJ1TLc.css +0 -1
  235. package/dist/client/assets/EvalsView-CUfyj5GW.js +0 -1
  236. package/dist/client/assets/ExperimentalAgentOnboardingModal-BNpveCEk.css +0 -1
  237. package/dist/client/assets/ExperimentalAgentOnboardingModal-Dau9RTU_.js +0 -499
  238. package/dist/client/assets/GoalsView-CNLTn0rX.js +0 -2
  239. package/dist/client/assets/GoalsView-DI66UsjT.css +0 -1
  240. package/dist/client/assets/InsightsView-BQPxHxKI.js +0 -11
  241. package/dist/client/assets/InsightsView-C9-mqVvf.css +0 -1
  242. package/dist/client/assets/MemoryView-D3xQIFjj.js +0 -2
  243. package/dist/client/assets/MemoryView-zaXewZzi.css +0 -1
  244. package/dist/client/assets/NodesView-7VInxyf_.css +0 -1
  245. package/dist/client/assets/NodesView-CSMvGwDU.js +0 -14
  246. package/dist/client/assets/PiExtensionsManager-BtqXF3fl.js +0 -11
  247. package/dist/client/assets/PluginManager-CSSDb3VO.js +0 -1
  248. package/dist/client/assets/PluginManager-UHVLvWWl.css +0 -1
  249. package/dist/client/assets/PullRequestView-Bjyfffdu.js +0 -6
  250. package/dist/client/assets/PullRequestView-WQIS0zUC.css +0 -1
  251. package/dist/client/assets/ReliabilityView-QKMUDebT.js +0 -1
  252. package/dist/client/assets/ReliabilityView-eoKBhBc4.css +0 -1
  253. package/dist/client/assets/ResearchView-CRU_NPho.js +0 -1
  254. package/dist/client/assets/ResearchView-DTh8FLUm.css +0 -1
  255. package/dist/client/assets/SecretsView-Bs8ySyC5.js +0 -1
  256. package/dist/client/assets/SecretsView-Djo1rahi.css +0 -1
  257. package/dist/client/assets/SessionTerminal-BiigPP2l.css +0 -1
  258. package/dist/client/assets/SessionTerminal-Dk1NgmN2.js +0 -2
  259. package/dist/client/assets/SettingsModal-DpAxDq6M.css +0 -1
  260. package/dist/client/assets/SettingsModal-JCaNvdAb.js +0 -31
  261. package/dist/client/assets/SettingsModal-Nw5cTKAK.js +0 -1
  262. package/dist/client/assets/SettingsModal-nF_GaeeK.css +0 -1
  263. package/dist/client/assets/SetupWizardModal-CE79myEy.js +0 -1
  264. package/dist/client/assets/SetupWizardModal-CIqFbkrD.css +0 -1
  265. package/dist/client/assets/SkillsView-3bhGyWs1.css +0 -1
  266. package/dist/client/assets/SkillsView-Dc8YskAX.js +0 -1
  267. package/dist/client/assets/StashRecoveryView-B_8WIQEo.css +0 -1
  268. package/dist/client/assets/StashRecoveryView-CqKOFiXT.js +0 -1
  269. package/dist/client/assets/TodoView-7xIh-Fmi.css +0 -1
  270. package/dist/client/assets/TodoView-BqIRwcZw.js +0 -6
  271. package/dist/client/assets/WorkflowNodeEditor-2jDuk2FR.js +0 -8
  272. package/dist/client/assets/WorkflowNodeEditor-BokhW3de.css +0 -1
  273. package/dist/client/assets/app-B2ZxMfJT.js +0 -13
  274. package/dist/client/assets/app-BffGU_HQ.js +0 -13
  275. package/dist/client/assets/app-C8AHhs5N.js +0 -13
  276. package/dist/client/assets/app-CUu1sm3x.js +0 -13
  277. package/dist/client/assets/app-Ri9Te2Dv.js +0 -13
  278. package/dist/client/assets/app-sEkTyT-w.js +0 -13
  279. package/dist/client/assets/common-BRyX4VxB.js +0 -1
  280. package/dist/client/assets/common-CN9QPI2d.js +0 -1
  281. package/dist/client/assets/common-CNbjPELi.js +0 -1
  282. package/dist/client/assets/common-DFDqu_n0.js +0 -1
  283. package/dist/client/assets/common-DgWWKG8Z.js +0 -1
  284. package/dist/client/assets/common-X6PzBnVA.js +0 -1
  285. package/dist/client/assets/createLucideIcon-BYvOGRiO.js +0 -21
  286. package/dist/client/assets/dashboard-view-BhbN8LPh.js +0 -1
  287. package/dist/client/assets/dashboard-view-DdGlfuu-.css +0 -1
  288. package/dist/client/assets/dashboard-view-DlKsVySD.js +0 -3
  289. package/dist/client/assets/dashboard-view-Du53JbmQ.css +0 -1
  290. package/dist/client/assets/index-CpTBp1RG.js +0 -793
  291. package/dist/client/assets/index-DqhCiU35.css +0 -1
  292. package/dist/client/assets/vendor-react-D37HfzIf.js +0 -49
  293. package/dist/client/assets/vendor-reactflow-CRZcPCXF.js +0 -15
  294. package/dist/client/assets/x-CqNX_9E2.js +0 -61
  295. package/dist/client/assets/zoom-out-CSTHbJgD.js +0 -21
@@ -0,0 +1,2497 @@
1
+ import {
2
+ __commonJS,
3
+ __require
4
+ } from "./chunk-4VNS5WPM.js";
5
+
6
+ // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
7
+ var require_ms = __commonJS({
8
+ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
9
+ "use strict";
10
+ var s = 1e3;
11
+ var m = s * 60;
12
+ var h = m * 60;
13
+ var d = h * 24;
14
+ var w = d * 7;
15
+ var y = d * 365.25;
16
+ module.exports = function(val, options) {
17
+ options = options || {};
18
+ var type = typeof val;
19
+ if (type === "string" && val.length > 0) {
20
+ return parse(val);
21
+ } else if (type === "number" && isFinite(val)) {
22
+ return options.long ? fmtLong(val) : fmtShort(val);
23
+ }
24
+ throw new Error(
25
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
26
+ );
27
+ };
28
+ function parse(str) {
29
+ str = String(str);
30
+ if (str.length > 100) {
31
+ return;
32
+ }
33
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
34
+ str
35
+ );
36
+ if (!match) {
37
+ return;
38
+ }
39
+ var n = parseFloat(match[1]);
40
+ var type = (match[2] || "ms").toLowerCase();
41
+ switch (type) {
42
+ case "years":
43
+ case "year":
44
+ case "yrs":
45
+ case "yr":
46
+ case "y":
47
+ return n * y;
48
+ case "weeks":
49
+ case "week":
50
+ case "w":
51
+ return n * w;
52
+ case "days":
53
+ case "day":
54
+ case "d":
55
+ return n * d;
56
+ case "hours":
57
+ case "hour":
58
+ case "hrs":
59
+ case "hr":
60
+ case "h":
61
+ return n * h;
62
+ case "minutes":
63
+ case "minute":
64
+ case "mins":
65
+ case "min":
66
+ case "m":
67
+ return n * m;
68
+ case "seconds":
69
+ case "second":
70
+ case "secs":
71
+ case "sec":
72
+ case "s":
73
+ return n * s;
74
+ case "milliseconds":
75
+ case "millisecond":
76
+ case "msecs":
77
+ case "msec":
78
+ case "ms":
79
+ return n;
80
+ default:
81
+ return void 0;
82
+ }
83
+ }
84
+ function fmtShort(ms) {
85
+ var msAbs = Math.abs(ms);
86
+ if (msAbs >= d) {
87
+ return Math.round(ms / d) + "d";
88
+ }
89
+ if (msAbs >= h) {
90
+ return Math.round(ms / h) + "h";
91
+ }
92
+ if (msAbs >= m) {
93
+ return Math.round(ms / m) + "m";
94
+ }
95
+ if (msAbs >= s) {
96
+ return Math.round(ms / s) + "s";
97
+ }
98
+ return ms + "ms";
99
+ }
100
+ function fmtLong(ms) {
101
+ var msAbs = Math.abs(ms);
102
+ if (msAbs >= d) {
103
+ return plural(ms, msAbs, d, "day");
104
+ }
105
+ if (msAbs >= h) {
106
+ return plural(ms, msAbs, h, "hour");
107
+ }
108
+ if (msAbs >= m) {
109
+ return plural(ms, msAbs, m, "minute");
110
+ }
111
+ if (msAbs >= s) {
112
+ return plural(ms, msAbs, s, "second");
113
+ }
114
+ return ms + " ms";
115
+ }
116
+ function plural(ms, msAbs, n, name) {
117
+ var isPlural = msAbs >= n * 1.5;
118
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
119
+ }
120
+ }
121
+ });
122
+
123
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
124
+ var require_common = __commonJS({
125
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports, module) {
126
+ "use strict";
127
+ function setup(env) {
128
+ createDebug.debug = createDebug;
129
+ createDebug.default = createDebug;
130
+ createDebug.coerce = coerce;
131
+ createDebug.disable = disable;
132
+ createDebug.enable = enable;
133
+ createDebug.enabled = enabled;
134
+ createDebug.humanize = require_ms();
135
+ createDebug.destroy = destroy;
136
+ Object.keys(env).forEach((key) => {
137
+ createDebug[key] = env[key];
138
+ });
139
+ createDebug.names = [];
140
+ createDebug.skips = [];
141
+ createDebug.formatters = {};
142
+ function selectColor(namespace) {
143
+ let hash = 0;
144
+ for (let i = 0; i < namespace.length; i++) {
145
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
146
+ hash |= 0;
147
+ }
148
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
149
+ }
150
+ createDebug.selectColor = selectColor;
151
+ function createDebug(namespace) {
152
+ let prevTime;
153
+ let enableOverride = null;
154
+ let namespacesCache;
155
+ let enabledCache;
156
+ function debug(...args) {
157
+ if (!debug.enabled) {
158
+ return;
159
+ }
160
+ const self = debug;
161
+ const curr = Number(/* @__PURE__ */ new Date());
162
+ const ms = curr - (prevTime || curr);
163
+ self.diff = ms;
164
+ self.prev = prevTime;
165
+ self.curr = curr;
166
+ prevTime = curr;
167
+ args[0] = createDebug.coerce(args[0]);
168
+ if (typeof args[0] !== "string") {
169
+ args.unshift("%O");
170
+ }
171
+ let index = 0;
172
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
173
+ if (match === "%%") {
174
+ return "%";
175
+ }
176
+ index++;
177
+ const formatter = createDebug.formatters[format];
178
+ if (typeof formatter === "function") {
179
+ const val = args[index];
180
+ match = formatter.call(self, val);
181
+ args.splice(index, 1);
182
+ index--;
183
+ }
184
+ return match;
185
+ });
186
+ createDebug.formatArgs.call(self, args);
187
+ const logFn = self.log || createDebug.log;
188
+ logFn.apply(self, args);
189
+ }
190
+ debug.namespace = namespace;
191
+ debug.useColors = createDebug.useColors();
192
+ debug.color = createDebug.selectColor(namespace);
193
+ debug.extend = extend;
194
+ debug.destroy = createDebug.destroy;
195
+ Object.defineProperty(debug, "enabled", {
196
+ enumerable: true,
197
+ configurable: false,
198
+ get: () => {
199
+ if (enableOverride !== null) {
200
+ return enableOverride;
201
+ }
202
+ if (namespacesCache !== createDebug.namespaces) {
203
+ namespacesCache = createDebug.namespaces;
204
+ enabledCache = createDebug.enabled(namespace);
205
+ }
206
+ return enabledCache;
207
+ },
208
+ set: (v) => {
209
+ enableOverride = v;
210
+ }
211
+ });
212
+ if (typeof createDebug.init === "function") {
213
+ createDebug.init(debug);
214
+ }
215
+ return debug;
216
+ }
217
+ function extend(namespace, delimiter) {
218
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
219
+ newDebug.log = this.log;
220
+ return newDebug;
221
+ }
222
+ function enable(namespaces) {
223
+ createDebug.save(namespaces);
224
+ createDebug.namespaces = namespaces;
225
+ createDebug.names = [];
226
+ createDebug.skips = [];
227
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
228
+ for (const ns of split) {
229
+ if (ns[0] === "-") {
230
+ createDebug.skips.push(ns.slice(1));
231
+ } else {
232
+ createDebug.names.push(ns);
233
+ }
234
+ }
235
+ }
236
+ function matchesTemplate(search, template) {
237
+ let searchIndex = 0;
238
+ let templateIndex = 0;
239
+ let starIndex = -1;
240
+ let matchIndex = 0;
241
+ while (searchIndex < search.length) {
242
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
243
+ if (template[templateIndex] === "*") {
244
+ starIndex = templateIndex;
245
+ matchIndex = searchIndex;
246
+ templateIndex++;
247
+ } else {
248
+ searchIndex++;
249
+ templateIndex++;
250
+ }
251
+ } else if (starIndex !== -1) {
252
+ templateIndex = starIndex + 1;
253
+ matchIndex++;
254
+ searchIndex = matchIndex;
255
+ } else {
256
+ return false;
257
+ }
258
+ }
259
+ while (templateIndex < template.length && template[templateIndex] === "*") {
260
+ templateIndex++;
261
+ }
262
+ return templateIndex === template.length;
263
+ }
264
+ function disable() {
265
+ const namespaces = [
266
+ ...createDebug.names,
267
+ ...createDebug.skips.map((namespace) => "-" + namespace)
268
+ ].join(",");
269
+ createDebug.enable("");
270
+ return namespaces;
271
+ }
272
+ function enabled(name) {
273
+ for (const skip of createDebug.skips) {
274
+ if (matchesTemplate(name, skip)) {
275
+ return false;
276
+ }
277
+ }
278
+ for (const ns of createDebug.names) {
279
+ if (matchesTemplate(name, ns)) {
280
+ return true;
281
+ }
282
+ }
283
+ return false;
284
+ }
285
+ function coerce(val) {
286
+ if (val instanceof Error) {
287
+ return val.stack || val.message;
288
+ }
289
+ return val;
290
+ }
291
+ function destroy() {
292
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
293
+ }
294
+ createDebug.enable(createDebug.load());
295
+ return createDebug;
296
+ }
297
+ module.exports = setup;
298
+ }
299
+ });
300
+
301
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
302
+ var require_browser = __commonJS({
303
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports, module) {
304
+ "use strict";
305
+ exports.formatArgs = formatArgs;
306
+ exports.save = save;
307
+ exports.load = load;
308
+ exports.useColors = useColors;
309
+ exports.storage = localstorage();
310
+ exports.destroy = /* @__PURE__ */ (() => {
311
+ let warned = false;
312
+ return () => {
313
+ if (!warned) {
314
+ warned = true;
315
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
316
+ }
317
+ };
318
+ })();
319
+ exports.colors = [
320
+ "#0000CC",
321
+ "#0000FF",
322
+ "#0033CC",
323
+ "#0033FF",
324
+ "#0066CC",
325
+ "#0066FF",
326
+ "#0099CC",
327
+ "#0099FF",
328
+ "#00CC00",
329
+ "#00CC33",
330
+ "#00CC66",
331
+ "#00CC99",
332
+ "#00CCCC",
333
+ "#00CCFF",
334
+ "#3300CC",
335
+ "#3300FF",
336
+ "#3333CC",
337
+ "#3333FF",
338
+ "#3366CC",
339
+ "#3366FF",
340
+ "#3399CC",
341
+ "#3399FF",
342
+ "#33CC00",
343
+ "#33CC33",
344
+ "#33CC66",
345
+ "#33CC99",
346
+ "#33CCCC",
347
+ "#33CCFF",
348
+ "#6600CC",
349
+ "#6600FF",
350
+ "#6633CC",
351
+ "#6633FF",
352
+ "#66CC00",
353
+ "#66CC33",
354
+ "#9900CC",
355
+ "#9900FF",
356
+ "#9933CC",
357
+ "#9933FF",
358
+ "#99CC00",
359
+ "#99CC33",
360
+ "#CC0000",
361
+ "#CC0033",
362
+ "#CC0066",
363
+ "#CC0099",
364
+ "#CC00CC",
365
+ "#CC00FF",
366
+ "#CC3300",
367
+ "#CC3333",
368
+ "#CC3366",
369
+ "#CC3399",
370
+ "#CC33CC",
371
+ "#CC33FF",
372
+ "#CC6600",
373
+ "#CC6633",
374
+ "#CC9900",
375
+ "#CC9933",
376
+ "#CCCC00",
377
+ "#CCCC33",
378
+ "#FF0000",
379
+ "#FF0033",
380
+ "#FF0066",
381
+ "#FF0099",
382
+ "#FF00CC",
383
+ "#FF00FF",
384
+ "#FF3300",
385
+ "#FF3333",
386
+ "#FF3366",
387
+ "#FF3399",
388
+ "#FF33CC",
389
+ "#FF33FF",
390
+ "#FF6600",
391
+ "#FF6633",
392
+ "#FF9900",
393
+ "#FF9933",
394
+ "#FFCC00",
395
+ "#FFCC33"
396
+ ];
397
+ function useColors() {
398
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
399
+ return true;
400
+ }
401
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
402
+ return false;
403
+ }
404
+ let m;
405
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
406
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
407
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
408
+ typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
409
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
410
+ }
411
+ function formatArgs(args) {
412
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
413
+ if (!this.useColors) {
414
+ return;
415
+ }
416
+ const c = "color: " + this.color;
417
+ args.splice(1, 0, c, "color: inherit");
418
+ let index = 0;
419
+ let lastC = 0;
420
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
421
+ if (match === "%%") {
422
+ return;
423
+ }
424
+ index++;
425
+ if (match === "%c") {
426
+ lastC = index;
427
+ }
428
+ });
429
+ args.splice(lastC, 0, c);
430
+ }
431
+ exports.log = console.debug || console.log || (() => {
432
+ });
433
+ function save(namespaces) {
434
+ try {
435
+ if (namespaces) {
436
+ exports.storage.setItem("debug", namespaces);
437
+ } else {
438
+ exports.storage.removeItem("debug");
439
+ }
440
+ } catch (error) {
441
+ }
442
+ }
443
+ function load() {
444
+ let r;
445
+ try {
446
+ r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
447
+ } catch (error) {
448
+ }
449
+ if (!r && typeof process !== "undefined" && "env" in process) {
450
+ r = process.env.DEBUG;
451
+ }
452
+ return r;
453
+ }
454
+ function localstorage() {
455
+ try {
456
+ return localStorage;
457
+ } catch (error) {
458
+ }
459
+ }
460
+ module.exports = require_common()(exports);
461
+ var { formatters } = module.exports;
462
+ formatters.j = function(v) {
463
+ try {
464
+ return JSON.stringify(v);
465
+ } catch (error) {
466
+ return "[UnexpectedJSONParseError]: " + error.message;
467
+ }
468
+ };
469
+ }
470
+ });
471
+
472
+ // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
473
+ var require_has_flag = __commonJS({
474
+ "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
475
+ "use strict";
476
+ module.exports = (flag, argv = process.argv) => {
477
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
478
+ const position = argv.indexOf(prefix + flag);
479
+ const terminatorPosition = argv.indexOf("--");
480
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
481
+ };
482
+ }
483
+ });
484
+
485
+ // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
486
+ var require_supports_color = __commonJS({
487
+ "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
488
+ "use strict";
489
+ var os = __require("os");
490
+ var tty = __require("tty");
491
+ var hasFlag = require_has_flag();
492
+ var { env } = process;
493
+ var forceColor;
494
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
495
+ forceColor = 0;
496
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
497
+ forceColor = 1;
498
+ }
499
+ if ("FORCE_COLOR" in env) {
500
+ if (env.FORCE_COLOR === "true") {
501
+ forceColor = 1;
502
+ } else if (env.FORCE_COLOR === "false") {
503
+ forceColor = 0;
504
+ } else {
505
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
506
+ }
507
+ }
508
+ function translateLevel(level) {
509
+ if (level === 0) {
510
+ return false;
511
+ }
512
+ return {
513
+ level,
514
+ hasBasic: true,
515
+ has256: level >= 2,
516
+ has16m: level >= 3
517
+ };
518
+ }
519
+ function supportsColor(haveStream, streamIsTTY) {
520
+ if (forceColor === 0) {
521
+ return 0;
522
+ }
523
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
524
+ return 3;
525
+ }
526
+ if (hasFlag("color=256")) {
527
+ return 2;
528
+ }
529
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
530
+ return 0;
531
+ }
532
+ const min = forceColor || 0;
533
+ if (env.TERM === "dumb") {
534
+ return min;
535
+ }
536
+ if (process.platform === "win32") {
537
+ const osRelease = os.release().split(".");
538
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
539
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
540
+ }
541
+ return 1;
542
+ }
543
+ if ("CI" in env) {
544
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
545
+ return 1;
546
+ }
547
+ return min;
548
+ }
549
+ if ("TEAMCITY_VERSION" in env) {
550
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
551
+ }
552
+ if (env.COLORTERM === "truecolor") {
553
+ return 3;
554
+ }
555
+ if ("TERM_PROGRAM" in env) {
556
+ const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
557
+ switch (env.TERM_PROGRAM) {
558
+ case "iTerm.app":
559
+ return version >= 3 ? 3 : 2;
560
+ case "Apple_Terminal":
561
+ return 2;
562
+ }
563
+ }
564
+ if (/-256(color)?$/i.test(env.TERM)) {
565
+ return 2;
566
+ }
567
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
568
+ return 1;
569
+ }
570
+ if ("COLORTERM" in env) {
571
+ return 1;
572
+ }
573
+ return min;
574
+ }
575
+ function getSupportLevel(stream) {
576
+ const level = supportsColor(stream, stream && stream.isTTY);
577
+ return translateLevel(level);
578
+ }
579
+ module.exports = {
580
+ supportsColor: getSupportLevel,
581
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
582
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
583
+ };
584
+ }
585
+ });
586
+
587
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js
588
+ var require_node = __commonJS({
589
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports, module) {
590
+ "use strict";
591
+ var tty = __require("tty");
592
+ var util = __require("util");
593
+ exports.init = init;
594
+ exports.log = log;
595
+ exports.formatArgs = formatArgs;
596
+ exports.save = save;
597
+ exports.load = load;
598
+ exports.useColors = useColors;
599
+ exports.destroy = util.deprecate(
600
+ () => {
601
+ },
602
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
603
+ );
604
+ exports.colors = [6, 2, 3, 4, 5, 1];
605
+ try {
606
+ const supportsColor = require_supports_color();
607
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
608
+ exports.colors = [
609
+ 20,
610
+ 21,
611
+ 26,
612
+ 27,
613
+ 32,
614
+ 33,
615
+ 38,
616
+ 39,
617
+ 40,
618
+ 41,
619
+ 42,
620
+ 43,
621
+ 44,
622
+ 45,
623
+ 56,
624
+ 57,
625
+ 62,
626
+ 63,
627
+ 68,
628
+ 69,
629
+ 74,
630
+ 75,
631
+ 76,
632
+ 77,
633
+ 78,
634
+ 79,
635
+ 80,
636
+ 81,
637
+ 92,
638
+ 93,
639
+ 98,
640
+ 99,
641
+ 112,
642
+ 113,
643
+ 128,
644
+ 129,
645
+ 134,
646
+ 135,
647
+ 148,
648
+ 149,
649
+ 160,
650
+ 161,
651
+ 162,
652
+ 163,
653
+ 164,
654
+ 165,
655
+ 166,
656
+ 167,
657
+ 168,
658
+ 169,
659
+ 170,
660
+ 171,
661
+ 172,
662
+ 173,
663
+ 178,
664
+ 179,
665
+ 184,
666
+ 185,
667
+ 196,
668
+ 197,
669
+ 198,
670
+ 199,
671
+ 200,
672
+ 201,
673
+ 202,
674
+ 203,
675
+ 204,
676
+ 205,
677
+ 206,
678
+ 207,
679
+ 208,
680
+ 209,
681
+ 214,
682
+ 215,
683
+ 220,
684
+ 221
685
+ ];
686
+ }
687
+ } catch (error) {
688
+ }
689
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
690
+ return /^debug_/i.test(key);
691
+ }).reduce((obj, key) => {
692
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
693
+ return k.toUpperCase();
694
+ });
695
+ let val = process.env[key];
696
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
697
+ val = true;
698
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
699
+ val = false;
700
+ } else if (val === "null") {
701
+ val = null;
702
+ } else {
703
+ val = Number(val);
704
+ }
705
+ obj[prop] = val;
706
+ return obj;
707
+ }, {});
708
+ function useColors() {
709
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
710
+ }
711
+ function formatArgs(args) {
712
+ const { namespace: name, useColors: useColors2 } = this;
713
+ if (useColors2) {
714
+ const c = this.color;
715
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
716
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
717
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
718
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
719
+ } else {
720
+ args[0] = getDate() + name + " " + args[0];
721
+ }
722
+ }
723
+ function getDate() {
724
+ if (exports.inspectOpts.hideDate) {
725
+ return "";
726
+ }
727
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
728
+ }
729
+ function log(...args) {
730
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
731
+ }
732
+ function save(namespaces) {
733
+ if (namespaces) {
734
+ process.env.DEBUG = namespaces;
735
+ } else {
736
+ delete process.env.DEBUG;
737
+ }
738
+ }
739
+ function load() {
740
+ return process.env.DEBUG;
741
+ }
742
+ function init(debug) {
743
+ debug.inspectOpts = {};
744
+ const keys = Object.keys(exports.inspectOpts);
745
+ for (let i = 0; i < keys.length; i++) {
746
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
747
+ }
748
+ }
749
+ module.exports = require_common()(exports);
750
+ var { formatters } = module.exports;
751
+ formatters.o = function(v) {
752
+ this.inspectOpts.colors = this.useColors;
753
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
754
+ };
755
+ formatters.O = function(v) {
756
+ this.inspectOpts.colors = this.useColors;
757
+ return util.inspect(v, this.inspectOpts);
758
+ };
759
+ }
760
+ });
761
+
762
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js
763
+ var require_src = __commonJS({
764
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports, module) {
765
+ "use strict";
766
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
767
+ module.exports = require_browser();
768
+ } else {
769
+ module.exports = require_node();
770
+ }
771
+ }
772
+ });
773
+
774
+ // ../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
775
+ var require_wrappy = __commonJS({
776
+ "../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports, module) {
777
+ "use strict";
778
+ module.exports = wrappy;
779
+ function wrappy(fn, cb) {
780
+ if (fn && cb) return wrappy(fn)(cb);
781
+ if (typeof fn !== "function")
782
+ throw new TypeError("need wrapper function");
783
+ Object.keys(fn).forEach(function(k) {
784
+ wrapper[k] = fn[k];
785
+ });
786
+ return wrapper;
787
+ function wrapper() {
788
+ var args = new Array(arguments.length);
789
+ for (var i = 0; i < args.length; i++) {
790
+ args[i] = arguments[i];
791
+ }
792
+ var ret = fn.apply(this, args);
793
+ var cb2 = args[args.length - 1];
794
+ if (typeof ret === "function" && ret !== cb2) {
795
+ Object.keys(cb2).forEach(function(k) {
796
+ ret[k] = cb2[k];
797
+ });
798
+ }
799
+ return ret;
800
+ }
801
+ }
802
+ }
803
+ });
804
+
805
+ // ../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
806
+ var require_once = __commonJS({
807
+ "../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports, module) {
808
+ "use strict";
809
+ var wrappy = require_wrappy();
810
+ module.exports = wrappy(once);
811
+ module.exports.strict = wrappy(onceStrict);
812
+ once.proto = once(function() {
813
+ Object.defineProperty(Function.prototype, "once", {
814
+ value: function() {
815
+ return once(this);
816
+ },
817
+ configurable: true
818
+ });
819
+ Object.defineProperty(Function.prototype, "onceStrict", {
820
+ value: function() {
821
+ return onceStrict(this);
822
+ },
823
+ configurable: true
824
+ });
825
+ });
826
+ function once(fn) {
827
+ var f = function() {
828
+ if (f.called) return f.value;
829
+ f.called = true;
830
+ return f.value = fn.apply(this, arguments);
831
+ };
832
+ f.called = false;
833
+ return f;
834
+ }
835
+ function onceStrict(fn) {
836
+ var f = function() {
837
+ if (f.called)
838
+ throw new Error(f.onceError);
839
+ f.called = true;
840
+ return f.value = fn.apply(this, arguments);
841
+ };
842
+ var name = fn.name || "Function wrapped with `once`";
843
+ f.onceError = name + " shouldn't be called more than once";
844
+ f.called = false;
845
+ return f;
846
+ }
847
+ }
848
+ });
849
+
850
+ // ../../node_modules/.pnpm/end-of-stream@1.4.5/node_modules/end-of-stream/index.js
851
+ var require_end_of_stream = __commonJS({
852
+ "../../node_modules/.pnpm/end-of-stream@1.4.5/node_modules/end-of-stream/index.js"(exports, module) {
853
+ "use strict";
854
+ var once = require_once();
855
+ var noop = function() {
856
+ };
857
+ var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process);
858
+ var isRequest = function(stream) {
859
+ return stream.setHeader && typeof stream.abort === "function";
860
+ };
861
+ var isChildProcess = function(stream) {
862
+ return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3;
863
+ };
864
+ var eos = function(stream, opts, callback) {
865
+ if (typeof opts === "function") return eos(stream, null, opts);
866
+ if (!opts) opts = {};
867
+ callback = once(callback || noop);
868
+ var ws = stream._writableState;
869
+ var rs = stream._readableState;
870
+ var readable = opts.readable || opts.readable !== false && stream.readable;
871
+ var writable = opts.writable || opts.writable !== false && stream.writable;
872
+ var cancelled = false;
873
+ var onlegacyfinish = function() {
874
+ if (!stream.writable) onfinish();
875
+ };
876
+ var onfinish = function() {
877
+ writable = false;
878
+ if (!readable) callback.call(stream);
879
+ };
880
+ var onend = function() {
881
+ readable = false;
882
+ if (!writable) callback.call(stream);
883
+ };
884
+ var onexit = function(exitCode) {
885
+ callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null);
886
+ };
887
+ var onerror = function(err) {
888
+ callback.call(stream, err);
889
+ };
890
+ var onclose = function() {
891
+ qnt(onclosenexttick);
892
+ };
893
+ var onclosenexttick = function() {
894
+ if (cancelled) return;
895
+ if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error("premature close"));
896
+ if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error("premature close"));
897
+ };
898
+ var onrequest = function() {
899
+ stream.req.on("finish", onfinish);
900
+ };
901
+ if (isRequest(stream)) {
902
+ stream.on("complete", onfinish);
903
+ stream.on("abort", onclose);
904
+ if (stream.req) onrequest();
905
+ else stream.on("request", onrequest);
906
+ } else if (writable && !ws) {
907
+ stream.on("end", onlegacyfinish);
908
+ stream.on("close", onlegacyfinish);
909
+ }
910
+ if (isChildProcess(stream)) stream.on("exit", onexit);
911
+ stream.on("end", onend);
912
+ stream.on("finish", onfinish);
913
+ if (opts.error !== false) stream.on("error", onerror);
914
+ stream.on("close", onclose);
915
+ return function() {
916
+ cancelled = true;
917
+ stream.removeListener("complete", onfinish);
918
+ stream.removeListener("abort", onclose);
919
+ stream.removeListener("request", onrequest);
920
+ if (stream.req) stream.req.removeListener("finish", onfinish);
921
+ stream.removeListener("end", onlegacyfinish);
922
+ stream.removeListener("close", onlegacyfinish);
923
+ stream.removeListener("finish", onfinish);
924
+ stream.removeListener("exit", onexit);
925
+ stream.removeListener("end", onend);
926
+ stream.removeListener("error", onerror);
927
+ stream.removeListener("close", onclose);
928
+ };
929
+ };
930
+ module.exports = eos;
931
+ }
932
+ });
933
+
934
+ // ../../node_modules/.pnpm/pump@3.0.4/node_modules/pump/index.js
935
+ var require_pump = __commonJS({
936
+ "../../node_modules/.pnpm/pump@3.0.4/node_modules/pump/index.js"(exports, module) {
937
+ "use strict";
938
+ var once = require_once();
939
+ var eos = require_end_of_stream();
940
+ var fs;
941
+ try {
942
+ fs = __require("fs");
943
+ } catch (e) {
944
+ }
945
+ var noop = function() {
946
+ };
947
+ var ancient = typeof process === "undefined" ? false : /^v?\.0/.test(process.version);
948
+ var isFn = function(fn) {
949
+ return typeof fn === "function";
950
+ };
951
+ var isFS = function(stream) {
952
+ if (!ancient) return false;
953
+ if (!fs) return false;
954
+ return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close);
955
+ };
956
+ var isRequest = function(stream) {
957
+ return stream.setHeader && isFn(stream.abort);
958
+ };
959
+ var destroyer = function(stream, reading, writing, callback) {
960
+ callback = once(callback);
961
+ var closed = false;
962
+ stream.on("close", function() {
963
+ closed = true;
964
+ });
965
+ eos(stream, { readable: reading, writable: writing }, function(err) {
966
+ if (err) return callback(err);
967
+ closed = true;
968
+ callback();
969
+ });
970
+ var destroyed = false;
971
+ return function(err) {
972
+ if (closed) return;
973
+ if (destroyed) return;
974
+ destroyed = true;
975
+ if (isFS(stream)) return stream.close(noop);
976
+ if (isRequest(stream)) return stream.abort();
977
+ if (isFn(stream.destroy)) return stream.destroy();
978
+ callback(err || new Error("stream was destroyed"));
979
+ };
980
+ };
981
+ var call = function(fn) {
982
+ fn();
983
+ };
984
+ var pipe = function(from, to) {
985
+ return from.pipe(to);
986
+ };
987
+ var pump = function() {
988
+ var streams = Array.prototype.slice.call(arguments);
989
+ var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop;
990
+ if (Array.isArray(streams[0])) streams = streams[0];
991
+ if (streams.length < 2) throw new Error("pump requires two streams per minimum");
992
+ var error;
993
+ var destroys = streams.map(function(stream, i) {
994
+ var reading = i < streams.length - 1;
995
+ var writing = i > 0;
996
+ return destroyer(stream, reading, writing, function(err) {
997
+ if (!error) error = err;
998
+ if (err) destroys.forEach(call);
999
+ if (reading) return;
1000
+ destroys.forEach(call);
1001
+ callback(error);
1002
+ });
1003
+ });
1004
+ return streams.reduce(pipe);
1005
+ };
1006
+ module.exports = pump;
1007
+ }
1008
+ });
1009
+
1010
+ // ../../node_modules/.pnpm/get-stream@5.2.0/node_modules/get-stream/buffer-stream.js
1011
+ var require_buffer_stream = __commonJS({
1012
+ "../../node_modules/.pnpm/get-stream@5.2.0/node_modules/get-stream/buffer-stream.js"(exports, module) {
1013
+ "use strict";
1014
+ var { PassThrough: PassThroughStream } = __require("stream");
1015
+ module.exports = (options) => {
1016
+ options = { ...options };
1017
+ const { array } = options;
1018
+ let { encoding } = options;
1019
+ const isBuffer = encoding === "buffer";
1020
+ let objectMode = false;
1021
+ if (array) {
1022
+ objectMode = !(encoding || isBuffer);
1023
+ } else {
1024
+ encoding = encoding || "utf8";
1025
+ }
1026
+ if (isBuffer) {
1027
+ encoding = null;
1028
+ }
1029
+ const stream = new PassThroughStream({ objectMode });
1030
+ if (encoding) {
1031
+ stream.setEncoding(encoding);
1032
+ }
1033
+ let length = 0;
1034
+ const chunks = [];
1035
+ stream.on("data", (chunk) => {
1036
+ chunks.push(chunk);
1037
+ if (objectMode) {
1038
+ length = chunks.length;
1039
+ } else {
1040
+ length += chunk.length;
1041
+ }
1042
+ });
1043
+ stream.getBufferedValue = () => {
1044
+ if (array) {
1045
+ return chunks;
1046
+ }
1047
+ return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
1048
+ };
1049
+ stream.getBufferedLength = () => length;
1050
+ return stream;
1051
+ };
1052
+ }
1053
+ });
1054
+
1055
+ // ../../node_modules/.pnpm/get-stream@5.2.0/node_modules/get-stream/index.js
1056
+ var require_get_stream = __commonJS({
1057
+ "../../node_modules/.pnpm/get-stream@5.2.0/node_modules/get-stream/index.js"(exports, module) {
1058
+ "use strict";
1059
+ var { constants: BufferConstants } = __require("buffer");
1060
+ var pump = require_pump();
1061
+ var bufferStream = require_buffer_stream();
1062
+ var MaxBufferError = class extends Error {
1063
+ constructor() {
1064
+ super("maxBuffer exceeded");
1065
+ this.name = "MaxBufferError";
1066
+ }
1067
+ };
1068
+ async function getStream(inputStream, options) {
1069
+ if (!inputStream) {
1070
+ return Promise.reject(new Error("Expected a stream"));
1071
+ }
1072
+ options = {
1073
+ maxBuffer: Infinity,
1074
+ ...options
1075
+ };
1076
+ const { maxBuffer } = options;
1077
+ let stream;
1078
+ await new Promise((resolve, reject) => {
1079
+ const rejectPromise = (error) => {
1080
+ if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
1081
+ error.bufferedData = stream.getBufferedValue();
1082
+ }
1083
+ reject(error);
1084
+ };
1085
+ stream = pump(inputStream, bufferStream(options), (error) => {
1086
+ if (error) {
1087
+ rejectPromise(error);
1088
+ return;
1089
+ }
1090
+ resolve();
1091
+ });
1092
+ stream.on("data", () => {
1093
+ if (stream.getBufferedLength() > maxBuffer) {
1094
+ rejectPromise(new MaxBufferError());
1095
+ }
1096
+ });
1097
+ });
1098
+ return stream.getBufferedValue();
1099
+ }
1100
+ module.exports = getStream;
1101
+ module.exports.default = getStream;
1102
+ module.exports.buffer = (stream, options) => getStream(stream, { ...options, encoding: "buffer" });
1103
+ module.exports.array = (stream, options) => getStream(stream, { ...options, array: true });
1104
+ module.exports.MaxBufferError = MaxBufferError;
1105
+ }
1106
+ });
1107
+
1108
+ // ../../node_modules/.pnpm/pend@1.2.0/node_modules/pend/index.js
1109
+ var require_pend = __commonJS({
1110
+ "../../node_modules/.pnpm/pend@1.2.0/node_modules/pend/index.js"(exports, module) {
1111
+ "use strict";
1112
+ module.exports = Pend;
1113
+ function Pend() {
1114
+ this.pending = 0;
1115
+ this.max = Infinity;
1116
+ this.listeners = [];
1117
+ this.waiting = [];
1118
+ this.error = null;
1119
+ }
1120
+ Pend.prototype.go = function(fn) {
1121
+ if (this.pending < this.max) {
1122
+ pendGo(this, fn);
1123
+ } else {
1124
+ this.waiting.push(fn);
1125
+ }
1126
+ };
1127
+ Pend.prototype.wait = function(cb) {
1128
+ if (this.pending === 0) {
1129
+ cb(this.error);
1130
+ } else {
1131
+ this.listeners.push(cb);
1132
+ }
1133
+ };
1134
+ Pend.prototype.hold = function() {
1135
+ return pendHold(this);
1136
+ };
1137
+ function pendHold(self) {
1138
+ self.pending += 1;
1139
+ var called = false;
1140
+ return onCb;
1141
+ function onCb(err) {
1142
+ if (called) throw new Error("callback called twice");
1143
+ called = true;
1144
+ self.error = self.error || err;
1145
+ self.pending -= 1;
1146
+ if (self.waiting.length > 0 && self.pending < self.max) {
1147
+ pendGo(self, self.waiting.shift());
1148
+ } else if (self.pending === 0) {
1149
+ var listeners = self.listeners;
1150
+ self.listeners = [];
1151
+ listeners.forEach(cbListener);
1152
+ }
1153
+ }
1154
+ function cbListener(listener) {
1155
+ listener(self.error);
1156
+ }
1157
+ }
1158
+ function pendGo(self, fn) {
1159
+ fn(pendHold(self));
1160
+ }
1161
+ }
1162
+ });
1163
+
1164
+ // ../../node_modules/.pnpm/fd-slicer@1.1.0/node_modules/fd-slicer/index.js
1165
+ var require_fd_slicer = __commonJS({
1166
+ "../../node_modules/.pnpm/fd-slicer@1.1.0/node_modules/fd-slicer/index.js"(exports) {
1167
+ "use strict";
1168
+ var fs = __require("fs");
1169
+ var util = __require("util");
1170
+ var stream = __require("stream");
1171
+ var Readable = stream.Readable;
1172
+ var Writable = stream.Writable;
1173
+ var PassThrough = stream.PassThrough;
1174
+ var Pend = require_pend();
1175
+ var EventEmitter = __require("events").EventEmitter;
1176
+ exports.createFromBuffer = createFromBuffer;
1177
+ exports.createFromFd = createFromFd;
1178
+ exports.BufferSlicer = BufferSlicer;
1179
+ exports.FdSlicer = FdSlicer;
1180
+ util.inherits(FdSlicer, EventEmitter);
1181
+ function FdSlicer(fd, options) {
1182
+ options = options || {};
1183
+ EventEmitter.call(this);
1184
+ this.fd = fd;
1185
+ this.pend = new Pend();
1186
+ this.pend.max = 1;
1187
+ this.refCount = 0;
1188
+ this.autoClose = !!options.autoClose;
1189
+ }
1190
+ FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
1191
+ var self = this;
1192
+ self.pend.go(function(cb) {
1193
+ fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
1194
+ cb();
1195
+ callback(err, bytesRead, buffer2);
1196
+ });
1197
+ });
1198
+ };
1199
+ FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
1200
+ var self = this;
1201
+ self.pend.go(function(cb) {
1202
+ fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer2) {
1203
+ cb();
1204
+ callback(err, written, buffer2);
1205
+ });
1206
+ });
1207
+ };
1208
+ FdSlicer.prototype.createReadStream = function(options) {
1209
+ return new ReadStream(this, options);
1210
+ };
1211
+ FdSlicer.prototype.createWriteStream = function(options) {
1212
+ return new WriteStream(this, options);
1213
+ };
1214
+ FdSlicer.prototype.ref = function() {
1215
+ this.refCount += 1;
1216
+ };
1217
+ FdSlicer.prototype.unref = function() {
1218
+ var self = this;
1219
+ self.refCount -= 1;
1220
+ if (self.refCount > 0) return;
1221
+ if (self.refCount < 0) throw new Error("invalid unref");
1222
+ if (self.autoClose) {
1223
+ fs.close(self.fd, onCloseDone);
1224
+ }
1225
+ function onCloseDone(err) {
1226
+ if (err) {
1227
+ self.emit("error", err);
1228
+ } else {
1229
+ self.emit("close");
1230
+ }
1231
+ }
1232
+ };
1233
+ util.inherits(ReadStream, Readable);
1234
+ function ReadStream(context, options) {
1235
+ options = options || {};
1236
+ Readable.call(this, options);
1237
+ this.context = context;
1238
+ this.context.ref();
1239
+ this.start = options.start || 0;
1240
+ this.endOffset = options.end;
1241
+ this.pos = this.start;
1242
+ this.destroyed = false;
1243
+ }
1244
+ ReadStream.prototype._read = function(n) {
1245
+ var self = this;
1246
+ if (self.destroyed) return;
1247
+ var toRead = Math.min(self._readableState.highWaterMark, n);
1248
+ if (self.endOffset != null) {
1249
+ toRead = Math.min(toRead, self.endOffset - self.pos);
1250
+ }
1251
+ if (toRead <= 0) {
1252
+ self.destroyed = true;
1253
+ self.push(null);
1254
+ self.context.unref();
1255
+ return;
1256
+ }
1257
+ self.context.pend.go(function(cb) {
1258
+ if (self.destroyed) return cb();
1259
+ var buffer = new Buffer(toRead);
1260
+ fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
1261
+ if (err) {
1262
+ self.destroy(err);
1263
+ } else if (bytesRead === 0) {
1264
+ self.destroyed = true;
1265
+ self.push(null);
1266
+ self.context.unref();
1267
+ } else {
1268
+ self.pos += bytesRead;
1269
+ self.push(buffer.slice(0, bytesRead));
1270
+ }
1271
+ cb();
1272
+ });
1273
+ });
1274
+ };
1275
+ ReadStream.prototype.destroy = function(err) {
1276
+ if (this.destroyed) return;
1277
+ err = err || new Error("stream destroyed");
1278
+ this.destroyed = true;
1279
+ this.emit("error", err);
1280
+ this.context.unref();
1281
+ };
1282
+ util.inherits(WriteStream, Writable);
1283
+ function WriteStream(context, options) {
1284
+ options = options || {};
1285
+ Writable.call(this, options);
1286
+ this.context = context;
1287
+ this.context.ref();
1288
+ this.start = options.start || 0;
1289
+ this.endOffset = options.end == null ? Infinity : +options.end;
1290
+ this.bytesWritten = 0;
1291
+ this.pos = this.start;
1292
+ this.destroyed = false;
1293
+ this.on("finish", this.destroy.bind(this));
1294
+ }
1295
+ WriteStream.prototype._write = function(buffer, encoding, callback) {
1296
+ var self = this;
1297
+ if (self.destroyed) return;
1298
+ if (self.pos + buffer.length > self.endOffset) {
1299
+ var err = new Error("maximum file length exceeded");
1300
+ err.code = "ETOOBIG";
1301
+ self.destroy();
1302
+ callback(err);
1303
+ return;
1304
+ }
1305
+ self.context.pend.go(function(cb) {
1306
+ if (self.destroyed) return cb();
1307
+ fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err2, bytes) {
1308
+ if (err2) {
1309
+ self.destroy();
1310
+ cb();
1311
+ callback(err2);
1312
+ } else {
1313
+ self.bytesWritten += bytes;
1314
+ self.pos += bytes;
1315
+ self.emit("progress");
1316
+ cb();
1317
+ callback();
1318
+ }
1319
+ });
1320
+ });
1321
+ };
1322
+ WriteStream.prototype.destroy = function() {
1323
+ if (this.destroyed) return;
1324
+ this.destroyed = true;
1325
+ this.context.unref();
1326
+ };
1327
+ util.inherits(BufferSlicer, EventEmitter);
1328
+ function BufferSlicer(buffer, options) {
1329
+ EventEmitter.call(this);
1330
+ options = options || {};
1331
+ this.refCount = 0;
1332
+ this.buffer = buffer;
1333
+ this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER;
1334
+ }
1335
+ BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {
1336
+ var end = position + length;
1337
+ var delta = end - this.buffer.length;
1338
+ var written = delta > 0 ? delta : length;
1339
+ this.buffer.copy(buffer, offset, position, end);
1340
+ setImmediate(function() {
1341
+ callback(null, written);
1342
+ });
1343
+ };
1344
+ BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) {
1345
+ buffer.copy(this.buffer, position, offset, offset + length);
1346
+ setImmediate(function() {
1347
+ callback(null, length, buffer);
1348
+ });
1349
+ };
1350
+ BufferSlicer.prototype.createReadStream = function(options) {
1351
+ options = options || {};
1352
+ var readStream = new PassThrough(options);
1353
+ readStream.destroyed = false;
1354
+ readStream.start = options.start || 0;
1355
+ readStream.endOffset = options.end;
1356
+ readStream.pos = readStream.endOffset || this.buffer.length;
1357
+ var entireSlice = this.buffer.slice(readStream.start, readStream.pos);
1358
+ var offset = 0;
1359
+ while (true) {
1360
+ var nextOffset = offset + this.maxChunkSize;
1361
+ if (nextOffset >= entireSlice.length) {
1362
+ if (offset < entireSlice.length) {
1363
+ readStream.write(entireSlice.slice(offset, entireSlice.length));
1364
+ }
1365
+ break;
1366
+ }
1367
+ readStream.write(entireSlice.slice(offset, nextOffset));
1368
+ offset = nextOffset;
1369
+ }
1370
+ readStream.end();
1371
+ readStream.destroy = function() {
1372
+ readStream.destroyed = true;
1373
+ };
1374
+ return readStream;
1375
+ };
1376
+ BufferSlicer.prototype.createWriteStream = function(options) {
1377
+ var bufferSlicer = this;
1378
+ options = options || {};
1379
+ var writeStream = new Writable(options);
1380
+ writeStream.start = options.start || 0;
1381
+ writeStream.endOffset = options.end == null ? this.buffer.length : +options.end;
1382
+ writeStream.bytesWritten = 0;
1383
+ writeStream.pos = writeStream.start;
1384
+ writeStream.destroyed = false;
1385
+ writeStream._write = function(buffer, encoding, callback) {
1386
+ if (writeStream.destroyed) return;
1387
+ var end = writeStream.pos + buffer.length;
1388
+ if (end > writeStream.endOffset) {
1389
+ var err = new Error("maximum file length exceeded");
1390
+ err.code = "ETOOBIG";
1391
+ writeStream.destroyed = true;
1392
+ callback(err);
1393
+ return;
1394
+ }
1395
+ buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length);
1396
+ writeStream.bytesWritten += buffer.length;
1397
+ writeStream.pos = end;
1398
+ writeStream.emit("progress");
1399
+ callback();
1400
+ };
1401
+ writeStream.destroy = function() {
1402
+ writeStream.destroyed = true;
1403
+ };
1404
+ return writeStream;
1405
+ };
1406
+ BufferSlicer.prototype.ref = function() {
1407
+ this.refCount += 1;
1408
+ };
1409
+ BufferSlicer.prototype.unref = function() {
1410
+ this.refCount -= 1;
1411
+ if (this.refCount < 0) {
1412
+ throw new Error("invalid unref");
1413
+ }
1414
+ };
1415
+ function createFromBuffer(buffer, options) {
1416
+ return new BufferSlicer(buffer, options);
1417
+ }
1418
+ function createFromFd(fd, options) {
1419
+ return new FdSlicer(fd, options);
1420
+ }
1421
+ }
1422
+ });
1423
+
1424
+ // ../../node_modules/.pnpm/buffer-crc32@0.2.13/node_modules/buffer-crc32/index.js
1425
+ var require_buffer_crc32 = __commonJS({
1426
+ "../../node_modules/.pnpm/buffer-crc32@0.2.13/node_modules/buffer-crc32/index.js"(exports, module) {
1427
+ "use strict";
1428
+ var Buffer2 = __require("buffer").Buffer;
1429
+ var CRC_TABLE = [
1430
+ 0,
1431
+ 1996959894,
1432
+ 3993919788,
1433
+ 2567524794,
1434
+ 124634137,
1435
+ 1886057615,
1436
+ 3915621685,
1437
+ 2657392035,
1438
+ 249268274,
1439
+ 2044508324,
1440
+ 3772115230,
1441
+ 2547177864,
1442
+ 162941995,
1443
+ 2125561021,
1444
+ 3887607047,
1445
+ 2428444049,
1446
+ 498536548,
1447
+ 1789927666,
1448
+ 4089016648,
1449
+ 2227061214,
1450
+ 450548861,
1451
+ 1843258603,
1452
+ 4107580753,
1453
+ 2211677639,
1454
+ 325883990,
1455
+ 1684777152,
1456
+ 4251122042,
1457
+ 2321926636,
1458
+ 335633487,
1459
+ 1661365465,
1460
+ 4195302755,
1461
+ 2366115317,
1462
+ 997073096,
1463
+ 1281953886,
1464
+ 3579855332,
1465
+ 2724688242,
1466
+ 1006888145,
1467
+ 1258607687,
1468
+ 3524101629,
1469
+ 2768942443,
1470
+ 901097722,
1471
+ 1119000684,
1472
+ 3686517206,
1473
+ 2898065728,
1474
+ 853044451,
1475
+ 1172266101,
1476
+ 3705015759,
1477
+ 2882616665,
1478
+ 651767980,
1479
+ 1373503546,
1480
+ 3369554304,
1481
+ 3218104598,
1482
+ 565507253,
1483
+ 1454621731,
1484
+ 3485111705,
1485
+ 3099436303,
1486
+ 671266974,
1487
+ 1594198024,
1488
+ 3322730930,
1489
+ 2970347812,
1490
+ 795835527,
1491
+ 1483230225,
1492
+ 3244367275,
1493
+ 3060149565,
1494
+ 1994146192,
1495
+ 31158534,
1496
+ 2563907772,
1497
+ 4023717930,
1498
+ 1907459465,
1499
+ 112637215,
1500
+ 2680153253,
1501
+ 3904427059,
1502
+ 2013776290,
1503
+ 251722036,
1504
+ 2517215374,
1505
+ 3775830040,
1506
+ 2137656763,
1507
+ 141376813,
1508
+ 2439277719,
1509
+ 3865271297,
1510
+ 1802195444,
1511
+ 476864866,
1512
+ 2238001368,
1513
+ 4066508878,
1514
+ 1812370925,
1515
+ 453092731,
1516
+ 2181625025,
1517
+ 4111451223,
1518
+ 1706088902,
1519
+ 314042704,
1520
+ 2344532202,
1521
+ 4240017532,
1522
+ 1658658271,
1523
+ 366619977,
1524
+ 2362670323,
1525
+ 4224994405,
1526
+ 1303535960,
1527
+ 984961486,
1528
+ 2747007092,
1529
+ 3569037538,
1530
+ 1256170817,
1531
+ 1037604311,
1532
+ 2765210733,
1533
+ 3554079995,
1534
+ 1131014506,
1535
+ 879679996,
1536
+ 2909243462,
1537
+ 3663771856,
1538
+ 1141124467,
1539
+ 855842277,
1540
+ 2852801631,
1541
+ 3708648649,
1542
+ 1342533948,
1543
+ 654459306,
1544
+ 3188396048,
1545
+ 3373015174,
1546
+ 1466479909,
1547
+ 544179635,
1548
+ 3110523913,
1549
+ 3462522015,
1550
+ 1591671054,
1551
+ 702138776,
1552
+ 2966460450,
1553
+ 3352799412,
1554
+ 1504918807,
1555
+ 783551873,
1556
+ 3082640443,
1557
+ 3233442989,
1558
+ 3988292384,
1559
+ 2596254646,
1560
+ 62317068,
1561
+ 1957810842,
1562
+ 3939845945,
1563
+ 2647816111,
1564
+ 81470997,
1565
+ 1943803523,
1566
+ 3814918930,
1567
+ 2489596804,
1568
+ 225274430,
1569
+ 2053790376,
1570
+ 3826175755,
1571
+ 2466906013,
1572
+ 167816743,
1573
+ 2097651377,
1574
+ 4027552580,
1575
+ 2265490386,
1576
+ 503444072,
1577
+ 1762050814,
1578
+ 4150417245,
1579
+ 2154129355,
1580
+ 426522225,
1581
+ 1852507879,
1582
+ 4275313526,
1583
+ 2312317920,
1584
+ 282753626,
1585
+ 1742555852,
1586
+ 4189708143,
1587
+ 2394877945,
1588
+ 397917763,
1589
+ 1622183637,
1590
+ 3604390888,
1591
+ 2714866558,
1592
+ 953729732,
1593
+ 1340076626,
1594
+ 3518719985,
1595
+ 2797360999,
1596
+ 1068828381,
1597
+ 1219638859,
1598
+ 3624741850,
1599
+ 2936675148,
1600
+ 906185462,
1601
+ 1090812512,
1602
+ 3747672003,
1603
+ 2825379669,
1604
+ 829329135,
1605
+ 1181335161,
1606
+ 3412177804,
1607
+ 3160834842,
1608
+ 628085408,
1609
+ 1382605366,
1610
+ 3423369109,
1611
+ 3138078467,
1612
+ 570562233,
1613
+ 1426400815,
1614
+ 3317316542,
1615
+ 2998733608,
1616
+ 733239954,
1617
+ 1555261956,
1618
+ 3268935591,
1619
+ 3050360625,
1620
+ 752459403,
1621
+ 1541320221,
1622
+ 2607071920,
1623
+ 3965973030,
1624
+ 1969922972,
1625
+ 40735498,
1626
+ 2617837225,
1627
+ 3943577151,
1628
+ 1913087877,
1629
+ 83908371,
1630
+ 2512341634,
1631
+ 3803740692,
1632
+ 2075208622,
1633
+ 213261112,
1634
+ 2463272603,
1635
+ 3855990285,
1636
+ 2094854071,
1637
+ 198958881,
1638
+ 2262029012,
1639
+ 4057260610,
1640
+ 1759359992,
1641
+ 534414190,
1642
+ 2176718541,
1643
+ 4139329115,
1644
+ 1873836001,
1645
+ 414664567,
1646
+ 2282248934,
1647
+ 4279200368,
1648
+ 1711684554,
1649
+ 285281116,
1650
+ 2405801727,
1651
+ 4167216745,
1652
+ 1634467795,
1653
+ 376229701,
1654
+ 2685067896,
1655
+ 3608007406,
1656
+ 1308918612,
1657
+ 956543938,
1658
+ 2808555105,
1659
+ 3495958263,
1660
+ 1231636301,
1661
+ 1047427035,
1662
+ 2932959818,
1663
+ 3654703836,
1664
+ 1088359270,
1665
+ 936918e3,
1666
+ 2847714899,
1667
+ 3736837829,
1668
+ 1202900863,
1669
+ 817233897,
1670
+ 3183342108,
1671
+ 3401237130,
1672
+ 1404277552,
1673
+ 615818150,
1674
+ 3134207493,
1675
+ 3453421203,
1676
+ 1423857449,
1677
+ 601450431,
1678
+ 3009837614,
1679
+ 3294710456,
1680
+ 1567103746,
1681
+ 711928724,
1682
+ 3020668471,
1683
+ 3272380065,
1684
+ 1510334235,
1685
+ 755167117
1686
+ ];
1687
+ if (typeof Int32Array !== "undefined") {
1688
+ CRC_TABLE = new Int32Array(CRC_TABLE);
1689
+ }
1690
+ function ensureBuffer(input) {
1691
+ if (Buffer2.isBuffer(input)) {
1692
+ return input;
1693
+ }
1694
+ var hasNewBufferAPI = typeof Buffer2.alloc === "function" && typeof Buffer2.from === "function";
1695
+ if (typeof input === "number") {
1696
+ return hasNewBufferAPI ? Buffer2.alloc(input) : new Buffer2(input);
1697
+ } else if (typeof input === "string") {
1698
+ return hasNewBufferAPI ? Buffer2.from(input) : new Buffer2(input);
1699
+ } else {
1700
+ throw new Error("input must be buffer, number, or string, received " + typeof input);
1701
+ }
1702
+ }
1703
+ function bufferizeInt(num) {
1704
+ var tmp = ensureBuffer(4);
1705
+ tmp.writeInt32BE(num, 0);
1706
+ return tmp;
1707
+ }
1708
+ function _crc32(buf, previous) {
1709
+ buf = ensureBuffer(buf);
1710
+ if (Buffer2.isBuffer(previous)) {
1711
+ previous = previous.readUInt32BE(0);
1712
+ }
1713
+ var crc = ~~previous ^ -1;
1714
+ for (var n = 0; n < buf.length; n++) {
1715
+ crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
1716
+ }
1717
+ return crc ^ -1;
1718
+ }
1719
+ function crc32() {
1720
+ return bufferizeInt(_crc32.apply(null, arguments));
1721
+ }
1722
+ crc32.signed = function() {
1723
+ return _crc32.apply(null, arguments);
1724
+ };
1725
+ crc32.unsigned = function() {
1726
+ return _crc32.apply(null, arguments) >>> 0;
1727
+ };
1728
+ module.exports = crc32;
1729
+ }
1730
+ });
1731
+
1732
+ // ../../node_modules/.pnpm/yauzl@2.10.0/node_modules/yauzl/index.js
1733
+ var require_yauzl = __commonJS({
1734
+ "../../node_modules/.pnpm/yauzl@2.10.0/node_modules/yauzl/index.js"(exports) {
1735
+ "use strict";
1736
+ var fs = __require("fs");
1737
+ var zlib = __require("zlib");
1738
+ var fd_slicer = require_fd_slicer();
1739
+ var crc32 = require_buffer_crc32();
1740
+ var util = __require("util");
1741
+ var EventEmitter = __require("events").EventEmitter;
1742
+ var Transform = __require("stream").Transform;
1743
+ var PassThrough = __require("stream").PassThrough;
1744
+ var Writable = __require("stream").Writable;
1745
+ exports.open = open;
1746
+ exports.fromFd = fromFd;
1747
+ exports.fromBuffer = fromBuffer;
1748
+ exports.fromRandomAccessReader = fromRandomAccessReader;
1749
+ exports.dosDateTimeToDate = dosDateTimeToDate;
1750
+ exports.validateFileName = validateFileName;
1751
+ exports.ZipFile = ZipFile;
1752
+ exports.Entry = Entry;
1753
+ exports.RandomAccessReader = RandomAccessReader;
1754
+ function open(path, options, callback) {
1755
+ if (typeof options === "function") {
1756
+ callback = options;
1757
+ options = null;
1758
+ }
1759
+ if (options == null) options = {};
1760
+ if (options.autoClose == null) options.autoClose = true;
1761
+ if (options.lazyEntries == null) options.lazyEntries = false;
1762
+ if (options.decodeStrings == null) options.decodeStrings = true;
1763
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
1764
+ if (options.strictFileNames == null) options.strictFileNames = false;
1765
+ if (callback == null) callback = defaultCallback;
1766
+ fs.open(path, "r", function(err, fd) {
1767
+ if (err) return callback(err);
1768
+ fromFd(fd, options, function(err2, zipfile) {
1769
+ if (err2) fs.close(fd, defaultCallback);
1770
+ callback(err2, zipfile);
1771
+ });
1772
+ });
1773
+ }
1774
+ function fromFd(fd, options, callback) {
1775
+ if (typeof options === "function") {
1776
+ callback = options;
1777
+ options = null;
1778
+ }
1779
+ if (options == null) options = {};
1780
+ if (options.autoClose == null) options.autoClose = false;
1781
+ if (options.lazyEntries == null) options.lazyEntries = false;
1782
+ if (options.decodeStrings == null) options.decodeStrings = true;
1783
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
1784
+ if (options.strictFileNames == null) options.strictFileNames = false;
1785
+ if (callback == null) callback = defaultCallback;
1786
+ fs.fstat(fd, function(err, stats) {
1787
+ if (err) return callback(err);
1788
+ var reader = fd_slicer.createFromFd(fd, { autoClose: true });
1789
+ fromRandomAccessReader(reader, stats.size, options, callback);
1790
+ });
1791
+ }
1792
+ function fromBuffer(buffer, options, callback) {
1793
+ if (typeof options === "function") {
1794
+ callback = options;
1795
+ options = null;
1796
+ }
1797
+ if (options == null) options = {};
1798
+ options.autoClose = false;
1799
+ if (options.lazyEntries == null) options.lazyEntries = false;
1800
+ if (options.decodeStrings == null) options.decodeStrings = true;
1801
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
1802
+ if (options.strictFileNames == null) options.strictFileNames = false;
1803
+ var reader = fd_slicer.createFromBuffer(buffer, { maxChunkSize: 65536 });
1804
+ fromRandomAccessReader(reader, buffer.length, options, callback);
1805
+ }
1806
+ function fromRandomAccessReader(reader, totalSize, options, callback) {
1807
+ if (typeof options === "function") {
1808
+ callback = options;
1809
+ options = null;
1810
+ }
1811
+ if (options == null) options = {};
1812
+ if (options.autoClose == null) options.autoClose = true;
1813
+ if (options.lazyEntries == null) options.lazyEntries = false;
1814
+ if (options.decodeStrings == null) options.decodeStrings = true;
1815
+ var decodeStrings = !!options.decodeStrings;
1816
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
1817
+ if (options.strictFileNames == null) options.strictFileNames = false;
1818
+ if (callback == null) callback = defaultCallback;
1819
+ if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number");
1820
+ if (totalSize > Number.MAX_SAFE_INTEGER) {
1821
+ throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");
1822
+ }
1823
+ reader.ref();
1824
+ var eocdrWithoutCommentSize = 22;
1825
+ var maxCommentSize = 65535;
1826
+ var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize);
1827
+ var buffer = newBuffer(bufferSize);
1828
+ var bufferReadStart = totalSize - buffer.length;
1829
+ readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) {
1830
+ if (err) return callback(err);
1831
+ for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) {
1832
+ if (buffer.readUInt32LE(i) !== 101010256) continue;
1833
+ var eocdrBuffer = buffer.slice(i);
1834
+ var diskNumber = eocdrBuffer.readUInt16LE(4);
1835
+ if (diskNumber !== 0) {
1836
+ return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
1837
+ }
1838
+ var entryCount = eocdrBuffer.readUInt16LE(10);
1839
+ var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);
1840
+ var commentLength = eocdrBuffer.readUInt16LE(20);
1841
+ var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;
1842
+ if (commentLength !== expectedCommentLength) {
1843
+ return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength));
1844
+ }
1845
+ var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false) : eocdrBuffer.slice(22);
1846
+ if (!(entryCount === 65535 || centralDirectoryOffset === 4294967295)) {
1847
+ return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
1848
+ }
1849
+ var zip64EocdlBuffer = newBuffer(20);
1850
+ var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length;
1851
+ readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err2) {
1852
+ if (err2) return callback(err2);
1853
+ if (zip64EocdlBuffer.readUInt32LE(0) !== 117853008) {
1854
+ return callback(new Error("invalid zip64 end of central directory locator signature"));
1855
+ }
1856
+ var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);
1857
+ var zip64EocdrBuffer = newBuffer(56);
1858
+ readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err3) {
1859
+ if (err3) return callback(err3);
1860
+ if (zip64EocdrBuffer.readUInt32LE(0) !== 101075792) {
1861
+ return callback(new Error("invalid zip64 end of central directory record signature"));
1862
+ }
1863
+ entryCount = readUInt64LE(zip64EocdrBuffer, 32);
1864
+ centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
1865
+ return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
1866
+ });
1867
+ });
1868
+ return;
1869
+ }
1870
+ callback(new Error("end of central directory record signature not found"));
1871
+ });
1872
+ }
1873
+ util.inherits(ZipFile, EventEmitter);
1874
+ function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
1875
+ var self = this;
1876
+ EventEmitter.call(self);
1877
+ self.reader = reader;
1878
+ self.reader.on("error", function(err) {
1879
+ emitError(self, err);
1880
+ });
1881
+ self.reader.once("close", function() {
1882
+ self.emit("close");
1883
+ });
1884
+ self.readEntryCursor = centralDirectoryOffset;
1885
+ self.fileSize = fileSize;
1886
+ self.entryCount = entryCount;
1887
+ self.comment = comment;
1888
+ self.entriesRead = 0;
1889
+ self.autoClose = !!autoClose;
1890
+ self.lazyEntries = !!lazyEntries;
1891
+ self.decodeStrings = !!decodeStrings;
1892
+ self.validateEntrySizes = !!validateEntrySizes;
1893
+ self.strictFileNames = !!strictFileNames;
1894
+ self.isOpen = true;
1895
+ self.emittedError = false;
1896
+ if (!self.lazyEntries) self._readEntry();
1897
+ }
1898
+ ZipFile.prototype.close = function() {
1899
+ if (!this.isOpen) return;
1900
+ this.isOpen = false;
1901
+ this.reader.unref();
1902
+ };
1903
+ function emitErrorAndAutoClose(self, err) {
1904
+ if (self.autoClose) self.close();
1905
+ emitError(self, err);
1906
+ }
1907
+ function emitError(self, err) {
1908
+ if (self.emittedError) return;
1909
+ self.emittedError = true;
1910
+ self.emit("error", err);
1911
+ }
1912
+ ZipFile.prototype.readEntry = function() {
1913
+ if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
1914
+ this._readEntry();
1915
+ };
1916
+ ZipFile.prototype._readEntry = function() {
1917
+ var self = this;
1918
+ if (self.entryCount === self.entriesRead) {
1919
+ setImmediate(function() {
1920
+ if (self.autoClose) self.close();
1921
+ if (self.emittedError) return;
1922
+ self.emit("end");
1923
+ });
1924
+ return;
1925
+ }
1926
+ if (self.emittedError) return;
1927
+ var buffer = newBuffer(46);
1928
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
1929
+ if (err) return emitErrorAndAutoClose(self, err);
1930
+ if (self.emittedError) return;
1931
+ var entry = new Entry();
1932
+ var signature = buffer.readUInt32LE(0);
1933
+ if (signature !== 33639248) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16)));
1934
+ entry.versionMadeBy = buffer.readUInt16LE(4);
1935
+ entry.versionNeededToExtract = buffer.readUInt16LE(6);
1936
+ entry.generalPurposeBitFlag = buffer.readUInt16LE(8);
1937
+ entry.compressionMethod = buffer.readUInt16LE(10);
1938
+ entry.lastModFileTime = buffer.readUInt16LE(12);
1939
+ entry.lastModFileDate = buffer.readUInt16LE(14);
1940
+ entry.crc32 = buffer.readUInt32LE(16);
1941
+ entry.compressedSize = buffer.readUInt32LE(20);
1942
+ entry.uncompressedSize = buffer.readUInt32LE(24);
1943
+ entry.fileNameLength = buffer.readUInt16LE(28);
1944
+ entry.extraFieldLength = buffer.readUInt16LE(30);
1945
+ entry.fileCommentLength = buffer.readUInt16LE(32);
1946
+ entry.internalFileAttributes = buffer.readUInt16LE(36);
1947
+ entry.externalFileAttributes = buffer.readUInt32LE(38);
1948
+ entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);
1949
+ if (entry.generalPurposeBitFlag & 64) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported"));
1950
+ self.readEntryCursor += 46;
1951
+ buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);
1952
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err2) {
1953
+ if (err2) return emitErrorAndAutoClose(self, err2);
1954
+ if (self.emittedError) return;
1955
+ var isUtf8 = (entry.generalPurposeBitFlag & 2048) !== 0;
1956
+ entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8) : buffer.slice(0, entry.fileNameLength);
1957
+ var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;
1958
+ var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart);
1959
+ entry.extraFields = [];
1960
+ var i = 0;
1961
+ while (i < extraFieldBuffer.length - 3) {
1962
+ var headerId = extraFieldBuffer.readUInt16LE(i + 0);
1963
+ var dataSize = extraFieldBuffer.readUInt16LE(i + 2);
1964
+ var dataStart = i + 4;
1965
+ var dataEnd = dataStart + dataSize;
1966
+ if (dataEnd > extraFieldBuffer.length) return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size"));
1967
+ var dataBuffer = newBuffer(dataSize);
1968
+ extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd);
1969
+ entry.extraFields.push({
1970
+ id: headerId,
1971
+ data: dataBuffer
1972
+ });
1973
+ i = dataEnd;
1974
+ }
1975
+ entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8) : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength);
1976
+ entry.comment = entry.fileComment;
1977
+ self.readEntryCursor += buffer.length;
1978
+ self.entriesRead += 1;
1979
+ if (entry.uncompressedSize === 4294967295 || entry.compressedSize === 4294967295 || entry.relativeOffsetOfLocalHeader === 4294967295) {
1980
+ var zip64EiefBuffer = null;
1981
+ for (var i = 0; i < entry.extraFields.length; i++) {
1982
+ var extraField = entry.extraFields[i];
1983
+ if (extraField.id === 1) {
1984
+ zip64EiefBuffer = extraField.data;
1985
+ break;
1986
+ }
1987
+ }
1988
+ if (zip64EiefBuffer == null) {
1989
+ return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field"));
1990
+ }
1991
+ var index = 0;
1992
+ if (entry.uncompressedSize === 4294967295) {
1993
+ if (index + 8 > zip64EiefBuffer.length) {
1994
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size"));
1995
+ }
1996
+ entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);
1997
+ index += 8;
1998
+ }
1999
+ if (entry.compressedSize === 4294967295) {
2000
+ if (index + 8 > zip64EiefBuffer.length) {
2001
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size"));
2002
+ }
2003
+ entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);
2004
+ index += 8;
2005
+ }
2006
+ if (entry.relativeOffsetOfLocalHeader === 4294967295) {
2007
+ if (index + 8 > zip64EiefBuffer.length) {
2008
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset"));
2009
+ }
2010
+ entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);
2011
+ index += 8;
2012
+ }
2013
+ }
2014
+ if (self.decodeStrings) {
2015
+ for (var i = 0; i < entry.extraFields.length; i++) {
2016
+ var extraField = entry.extraFields[i];
2017
+ if (extraField.id === 28789) {
2018
+ if (extraField.data.length < 6) {
2019
+ continue;
2020
+ }
2021
+ if (extraField.data.readUInt8(0) !== 1) {
2022
+ continue;
2023
+ }
2024
+ var oldNameCrc32 = extraField.data.readUInt32LE(1);
2025
+ if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) {
2026
+ continue;
2027
+ }
2028
+ entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true);
2029
+ break;
2030
+ }
2031
+ }
2032
+ }
2033
+ if (self.validateEntrySizes && entry.compressionMethod === 0) {
2034
+ var expectedCompressedSize = entry.uncompressedSize;
2035
+ if (entry.isEncrypted()) {
2036
+ expectedCompressedSize += 12;
2037
+ }
2038
+ if (entry.compressedSize !== expectedCompressedSize) {
2039
+ var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize;
2040
+ return emitErrorAndAutoClose(self, new Error(msg));
2041
+ }
2042
+ }
2043
+ if (self.decodeStrings) {
2044
+ if (!self.strictFileNames) {
2045
+ entry.fileName = entry.fileName.replace(/\\/g, "/");
2046
+ }
2047
+ var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions);
2048
+ if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage));
2049
+ }
2050
+ self.emit("entry", entry);
2051
+ if (!self.lazyEntries) self._readEntry();
2052
+ });
2053
+ });
2054
+ };
2055
+ ZipFile.prototype.openReadStream = function(entry, options, callback) {
2056
+ var self = this;
2057
+ var relativeStart = 0;
2058
+ var relativeEnd = entry.compressedSize;
2059
+ if (callback == null) {
2060
+ callback = options;
2061
+ options = {};
2062
+ } else {
2063
+ if (options.decrypt != null) {
2064
+ if (!entry.isEncrypted()) {
2065
+ throw new Error("options.decrypt can only be specified for encrypted entries");
2066
+ }
2067
+ if (options.decrypt !== false) throw new Error("invalid options.decrypt value: " + options.decrypt);
2068
+ if (entry.isCompressed()) {
2069
+ if (options.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false");
2070
+ }
2071
+ }
2072
+ if (options.decompress != null) {
2073
+ if (!entry.isCompressed()) {
2074
+ throw new Error("options.decompress can only be specified for compressed entries");
2075
+ }
2076
+ if (!(options.decompress === false || options.decompress === true)) {
2077
+ throw new Error("invalid options.decompress value: " + options.decompress);
2078
+ }
2079
+ }
2080
+ if (options.start != null || options.end != null) {
2081
+ if (entry.isCompressed() && options.decompress !== false) {
2082
+ throw new Error("start/end range not allowed for compressed entry without options.decompress === false");
2083
+ }
2084
+ if (entry.isEncrypted() && options.decrypt !== false) {
2085
+ throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false");
2086
+ }
2087
+ }
2088
+ if (options.start != null) {
2089
+ relativeStart = options.start;
2090
+ if (relativeStart < 0) throw new Error("options.start < 0");
2091
+ if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize");
2092
+ }
2093
+ if (options.end != null) {
2094
+ relativeEnd = options.end;
2095
+ if (relativeEnd < 0) throw new Error("options.end < 0");
2096
+ if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize");
2097
+ if (relativeEnd < relativeStart) throw new Error("options.end < options.start");
2098
+ }
2099
+ }
2100
+ if (!self.isOpen) return callback(new Error("closed"));
2101
+ if (entry.isEncrypted()) {
2102
+ if (options.decrypt !== false) return callback(new Error("entry is encrypted, and options.decrypt !== false"));
2103
+ }
2104
+ self.reader.ref();
2105
+ var buffer = newBuffer(30);
2106
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) {
2107
+ try {
2108
+ if (err) return callback(err);
2109
+ var signature = buffer.readUInt32LE(0);
2110
+ if (signature !== 67324752) {
2111
+ return callback(new Error("invalid local file header signature: 0x" + signature.toString(16)));
2112
+ }
2113
+ var fileNameLength = buffer.readUInt16LE(26);
2114
+ var extraFieldLength = buffer.readUInt16LE(28);
2115
+ var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength;
2116
+ var decompress;
2117
+ if (entry.compressionMethod === 0) {
2118
+ decompress = false;
2119
+ } else if (entry.compressionMethod === 8) {
2120
+ decompress = options.decompress != null ? options.decompress : true;
2121
+ } else {
2122
+ return callback(new Error("unsupported compression method: " + entry.compressionMethod));
2123
+ }
2124
+ var fileDataStart = localFileHeaderEnd;
2125
+ var fileDataEnd = fileDataStart + entry.compressedSize;
2126
+ if (entry.compressedSize !== 0) {
2127
+ if (fileDataEnd > self.fileSize) {
2128
+ return callback(new Error("file data overflows file bounds: " + fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize));
2129
+ }
2130
+ }
2131
+ var readStream = self.reader.createReadStream({
2132
+ start: fileDataStart + relativeStart,
2133
+ end: fileDataStart + relativeEnd
2134
+ });
2135
+ var endpointStream = readStream;
2136
+ if (decompress) {
2137
+ var destroyed = false;
2138
+ var inflateFilter = zlib.createInflateRaw();
2139
+ readStream.on("error", function(err2) {
2140
+ setImmediate(function() {
2141
+ if (!destroyed) inflateFilter.emit("error", err2);
2142
+ });
2143
+ });
2144
+ readStream.pipe(inflateFilter);
2145
+ if (self.validateEntrySizes) {
2146
+ endpointStream = new AssertByteCountStream(entry.uncompressedSize);
2147
+ inflateFilter.on("error", function(err2) {
2148
+ setImmediate(function() {
2149
+ if (!destroyed) endpointStream.emit("error", err2);
2150
+ });
2151
+ });
2152
+ inflateFilter.pipe(endpointStream);
2153
+ } else {
2154
+ endpointStream = inflateFilter;
2155
+ }
2156
+ endpointStream.destroy = function() {
2157
+ destroyed = true;
2158
+ if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream);
2159
+ readStream.unpipe(inflateFilter);
2160
+ readStream.destroy();
2161
+ };
2162
+ }
2163
+ callback(null, endpointStream);
2164
+ } finally {
2165
+ self.reader.unref();
2166
+ }
2167
+ });
2168
+ };
2169
+ function Entry() {
2170
+ }
2171
+ Entry.prototype.getLastModDate = function() {
2172
+ return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);
2173
+ };
2174
+ Entry.prototype.isEncrypted = function() {
2175
+ return (this.generalPurposeBitFlag & 1) !== 0;
2176
+ };
2177
+ Entry.prototype.isCompressed = function() {
2178
+ return this.compressionMethod === 8;
2179
+ };
2180
+ function dosDateTimeToDate(date, time) {
2181
+ var day = date & 31;
2182
+ var month = (date >> 5 & 15) - 1;
2183
+ var year = (date >> 9 & 127) + 1980;
2184
+ var millisecond = 0;
2185
+ var second = (time & 31) * 2;
2186
+ var minute = time >> 5 & 63;
2187
+ var hour = time >> 11 & 31;
2188
+ return new Date(year, month, day, hour, minute, second, millisecond);
2189
+ }
2190
+ function validateFileName(fileName) {
2191
+ if (fileName.indexOf("\\") !== -1) {
2192
+ return "invalid characters in fileName: " + fileName;
2193
+ }
2194
+ if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
2195
+ return "absolute path: " + fileName;
2196
+ }
2197
+ if (fileName.split("/").indexOf("..") !== -1) {
2198
+ return "invalid relative path: " + fileName;
2199
+ }
2200
+ return null;
2201
+ }
2202
+ function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
2203
+ if (length === 0) {
2204
+ return setImmediate(function() {
2205
+ callback(null, newBuffer(0));
2206
+ });
2207
+ }
2208
+ reader.read(buffer, offset, length, position, function(err, bytesRead) {
2209
+ if (err) return callback(err);
2210
+ if (bytesRead < length) {
2211
+ return callback(new Error("unexpected EOF"));
2212
+ }
2213
+ callback();
2214
+ });
2215
+ }
2216
+ util.inherits(AssertByteCountStream, Transform);
2217
+ function AssertByteCountStream(byteCount) {
2218
+ Transform.call(this);
2219
+ this.actualByteCount = 0;
2220
+ this.expectedByteCount = byteCount;
2221
+ }
2222
+ AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {
2223
+ this.actualByteCount += chunk.length;
2224
+ if (this.actualByteCount > this.expectedByteCount) {
2225
+ var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount;
2226
+ return cb(new Error(msg));
2227
+ }
2228
+ cb(null, chunk);
2229
+ };
2230
+ AssertByteCountStream.prototype._flush = function(cb) {
2231
+ if (this.actualByteCount < this.expectedByteCount) {
2232
+ var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount;
2233
+ return cb(new Error(msg));
2234
+ }
2235
+ cb();
2236
+ };
2237
+ util.inherits(RandomAccessReader, EventEmitter);
2238
+ function RandomAccessReader() {
2239
+ EventEmitter.call(this);
2240
+ this.refCount = 0;
2241
+ }
2242
+ RandomAccessReader.prototype.ref = function() {
2243
+ this.refCount += 1;
2244
+ };
2245
+ RandomAccessReader.prototype.unref = function() {
2246
+ var self = this;
2247
+ self.refCount -= 1;
2248
+ if (self.refCount > 0) return;
2249
+ if (self.refCount < 0) throw new Error("invalid unref");
2250
+ self.close(onCloseDone);
2251
+ function onCloseDone(err) {
2252
+ if (err) return self.emit("error", err);
2253
+ self.emit("close");
2254
+ }
2255
+ };
2256
+ RandomAccessReader.prototype.createReadStream = function(options) {
2257
+ var start = options.start;
2258
+ var end = options.end;
2259
+ if (start === end) {
2260
+ var emptyStream = new PassThrough();
2261
+ setImmediate(function() {
2262
+ emptyStream.end();
2263
+ });
2264
+ return emptyStream;
2265
+ }
2266
+ var stream = this._readStreamForRange(start, end);
2267
+ var destroyed = false;
2268
+ var refUnrefFilter = new RefUnrefFilter(this);
2269
+ stream.on("error", function(err) {
2270
+ setImmediate(function() {
2271
+ if (!destroyed) refUnrefFilter.emit("error", err);
2272
+ });
2273
+ });
2274
+ refUnrefFilter.destroy = function() {
2275
+ stream.unpipe(refUnrefFilter);
2276
+ refUnrefFilter.unref();
2277
+ stream.destroy();
2278
+ };
2279
+ var byteCounter = new AssertByteCountStream(end - start);
2280
+ refUnrefFilter.on("error", function(err) {
2281
+ setImmediate(function() {
2282
+ if (!destroyed) byteCounter.emit("error", err);
2283
+ });
2284
+ });
2285
+ byteCounter.destroy = function() {
2286
+ destroyed = true;
2287
+ refUnrefFilter.unpipe(byteCounter);
2288
+ refUnrefFilter.destroy();
2289
+ };
2290
+ return stream.pipe(refUnrefFilter).pipe(byteCounter);
2291
+ };
2292
+ RandomAccessReader.prototype._readStreamForRange = function(start, end) {
2293
+ throw new Error("not implemented");
2294
+ };
2295
+ RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {
2296
+ var readStream = this.createReadStream({ start: position, end: position + length });
2297
+ var writeStream = new Writable();
2298
+ var written = 0;
2299
+ writeStream._write = function(chunk, encoding, cb) {
2300
+ chunk.copy(buffer, offset + written, 0, chunk.length);
2301
+ written += chunk.length;
2302
+ cb();
2303
+ };
2304
+ writeStream.on("finish", callback);
2305
+ readStream.on("error", function(error) {
2306
+ callback(error);
2307
+ });
2308
+ readStream.pipe(writeStream);
2309
+ };
2310
+ RandomAccessReader.prototype.close = function(callback) {
2311
+ setImmediate(callback);
2312
+ };
2313
+ util.inherits(RefUnrefFilter, PassThrough);
2314
+ function RefUnrefFilter(context) {
2315
+ PassThrough.call(this);
2316
+ this.context = context;
2317
+ this.context.ref();
2318
+ this.unreffedYet = false;
2319
+ }
2320
+ RefUnrefFilter.prototype._flush = function(cb) {
2321
+ this.unref();
2322
+ cb();
2323
+ };
2324
+ RefUnrefFilter.prototype.unref = function(cb) {
2325
+ if (this.unreffedYet) return;
2326
+ this.unreffedYet = true;
2327
+ this.context.unref();
2328
+ };
2329
+ var cp437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";
2330
+ function decodeBuffer(buffer, start, end, isUtf8) {
2331
+ if (isUtf8) {
2332
+ return buffer.toString("utf8", start, end);
2333
+ } else {
2334
+ var result = "";
2335
+ for (var i = start; i < end; i++) {
2336
+ result += cp437[buffer[i]];
2337
+ }
2338
+ return result;
2339
+ }
2340
+ }
2341
+ function readUInt64LE(buffer, offset) {
2342
+ var lower32 = buffer.readUInt32LE(offset);
2343
+ var upper32 = buffer.readUInt32LE(offset + 4);
2344
+ return upper32 * 4294967296 + lower32;
2345
+ }
2346
+ var newBuffer;
2347
+ if (typeof Buffer.allocUnsafe === "function") {
2348
+ newBuffer = function(len) {
2349
+ return Buffer.allocUnsafe(len);
2350
+ };
2351
+ } else {
2352
+ newBuffer = function(len) {
2353
+ return new Buffer(len);
2354
+ };
2355
+ }
2356
+ function defaultCallback(err) {
2357
+ if (err) throw err;
2358
+ }
2359
+ }
2360
+ });
2361
+
2362
+ // ../../node_modules/.pnpm/extract-zip@2.0.1/node_modules/extract-zip/index.js
2363
+ var require_extract_zip = __commonJS({
2364
+ "../../node_modules/.pnpm/extract-zip@2.0.1/node_modules/extract-zip/index.js"(exports, module) {
2365
+ var debug = require_src()("extract-zip");
2366
+ var { createWriteStream, promises: fs } = __require("fs");
2367
+ var getStream = require_get_stream();
2368
+ var path = __require("path");
2369
+ var { promisify } = __require("util");
2370
+ var stream = __require("stream");
2371
+ var yauzl = require_yauzl();
2372
+ var openZip = promisify(yauzl.open);
2373
+ var pipeline = promisify(stream.pipeline);
2374
+ var Extractor = class {
2375
+ constructor(zipPath, opts) {
2376
+ this.zipPath = zipPath;
2377
+ this.opts = opts;
2378
+ }
2379
+ async extract() {
2380
+ debug("opening", this.zipPath, "with opts", this.opts);
2381
+ this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
2382
+ this.canceled = false;
2383
+ return new Promise((resolve, reject) => {
2384
+ this.zipfile.on("error", (err) => {
2385
+ this.canceled = true;
2386
+ reject(err);
2387
+ });
2388
+ this.zipfile.readEntry();
2389
+ this.zipfile.on("close", () => {
2390
+ if (!this.canceled) {
2391
+ debug("zip extraction complete");
2392
+ resolve();
2393
+ }
2394
+ });
2395
+ this.zipfile.on("entry", async (entry) => {
2396
+ if (this.canceled) {
2397
+ debug("skipping entry", entry.fileName, { cancelled: this.canceled });
2398
+ return;
2399
+ }
2400
+ debug("zipfile entry", entry.fileName);
2401
+ if (entry.fileName.startsWith("__MACOSX/")) {
2402
+ this.zipfile.readEntry();
2403
+ return;
2404
+ }
2405
+ const destDir = path.dirname(path.join(this.opts.dir, entry.fileName));
2406
+ try {
2407
+ await fs.mkdir(destDir, { recursive: true });
2408
+ const canonicalDestDir = await fs.realpath(destDir);
2409
+ const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir);
2410
+ if (relativeDestDir.split(path.sep).includes("..")) {
2411
+ throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
2412
+ }
2413
+ await this.extractEntry(entry);
2414
+ debug("finished processing", entry.fileName);
2415
+ this.zipfile.readEntry();
2416
+ } catch (err) {
2417
+ this.canceled = true;
2418
+ this.zipfile.close();
2419
+ reject(err);
2420
+ }
2421
+ });
2422
+ });
2423
+ }
2424
+ async extractEntry(entry) {
2425
+ if (this.canceled) {
2426
+ debug("skipping entry extraction", entry.fileName, { cancelled: this.canceled });
2427
+ return;
2428
+ }
2429
+ if (this.opts.onEntry) {
2430
+ this.opts.onEntry(entry, this.zipfile);
2431
+ }
2432
+ const dest = path.join(this.opts.dir, entry.fileName);
2433
+ const mode = entry.externalFileAttributes >> 16 & 65535;
2434
+ const IFMT = 61440;
2435
+ const IFDIR = 16384;
2436
+ const IFLNK = 40960;
2437
+ const symlink = (mode & IFMT) === IFLNK;
2438
+ let isDir = (mode & IFMT) === IFDIR;
2439
+ if (!isDir && entry.fileName.endsWith("/")) {
2440
+ isDir = true;
2441
+ }
2442
+ const madeBy = entry.versionMadeBy >> 8;
2443
+ if (!isDir) isDir = madeBy === 0 && entry.externalFileAttributes === 16;
2444
+ debug("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink });
2445
+ const procMode = this.getExtractedMode(mode, isDir) & 511;
2446
+ const destDir = isDir ? dest : path.dirname(dest);
2447
+ const mkdirOptions = { recursive: true };
2448
+ if (isDir) {
2449
+ mkdirOptions.mode = procMode;
2450
+ }
2451
+ debug("mkdir", { dir: destDir, ...mkdirOptions });
2452
+ await fs.mkdir(destDir, mkdirOptions);
2453
+ if (isDir) return;
2454
+ debug("opening read stream", dest);
2455
+ const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry);
2456
+ if (symlink) {
2457
+ const link = await getStream(readStream);
2458
+ debug("creating symlink", link, dest);
2459
+ await fs.symlink(link, dest);
2460
+ } else {
2461
+ await pipeline(readStream, createWriteStream(dest, { mode: procMode }));
2462
+ }
2463
+ }
2464
+ getExtractedMode(entryMode, isDir) {
2465
+ let mode = entryMode;
2466
+ if (mode === 0) {
2467
+ if (isDir) {
2468
+ if (this.opts.defaultDirMode) {
2469
+ mode = parseInt(this.opts.defaultDirMode, 10);
2470
+ }
2471
+ if (!mode) {
2472
+ mode = 493;
2473
+ }
2474
+ } else {
2475
+ if (this.opts.defaultFileMode) {
2476
+ mode = parseInt(this.opts.defaultFileMode, 10);
2477
+ }
2478
+ if (!mode) {
2479
+ mode = 420;
2480
+ }
2481
+ }
2482
+ }
2483
+ return mode;
2484
+ }
2485
+ };
2486
+ module.exports = async function(zipPath, opts) {
2487
+ debug("creating target directory", opts.dir);
2488
+ if (!path.isAbsolute(opts.dir)) {
2489
+ throw new Error("Target directory is expected to be absolute");
2490
+ }
2491
+ await fs.mkdir(opts.dir, { recursive: true });
2492
+ opts.dir = await fs.realpath(opts.dir);
2493
+ return new Extractor(zipPath, opts).extract();
2494
+ };
2495
+ }
2496
+ });
2497
+ export default require_extract_zip();