@wix/cli 1.1.87 → 1.1.88

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 (198) hide show
  1. package/build/DevCommand-4HINBFWU.js +103975 -0
  2. package/build/DevCommand-4HINBFWU.js.map +1 -0
  3. package/build/{DevCommand-NPY7LRXR.js → DevCommand-FFXBYLFS.js} +32 -26
  4. package/build/{DevCommand-NPY7LRXR.js.map → DevCommand-FFXBYLFS.js.map} +1 -1
  5. package/build/{DevCommand-LK2J4SHX.js → DevCommand-PUJFPAHB.js} +23 -20
  6. package/build/{DevCommand-LK2J4SHX.js.map → DevCommand-PUJFPAHB.js.map} +1 -1
  7. package/build/EnvPullCommand-H2NK2LZS.js +467 -0
  8. package/build/EnvPullCommand-H2NK2LZS.js.map +1 -0
  9. package/build/EnvRemoveCommand-2LQGQ7J3.js +83 -0
  10. package/build/EnvRemoveCommand-2LQGQ7J3.js.map +1 -0
  11. package/build/EnvSetCommand-NGJYYHGO.js +85 -0
  12. package/build/EnvSetCommand-NGJYYHGO.js.map +1 -0
  13. package/build/{InstallCommand-HETKQTOF.js → InstallCommand-KYNDZCDN.js} +24 -21
  14. package/build/{InstallCommand-HETKQTOF.js.map → InstallCommand-KYNDZCDN.js.map} +1 -1
  15. package/build/{LoginCommand-6L33EWLY.js → LoginCommand-6D4MUZAQ.js} +14 -12
  16. package/build/{LoginCommand-6L33EWLY.js.map → LoginCommand-6D4MUZAQ.js.map} +1 -1
  17. package/build/{LogoutCommand-LKLIYJ4J.js → LogoutCommand-7R5FPYOM.js} +10 -8
  18. package/build/{LogoutCommand-LKLIYJ4J.js.map → LogoutCommand-7R5FPYOM.js.map} +1 -1
  19. package/build/{PreviewCommand-3BMR7D7L.js → PreviewCommand-JOLUOQVW.js} +28 -25
  20. package/build/{PreviewCommand-3BMR7D7L.js.map → PreviewCommand-JOLUOQVW.js.map} +1 -1
  21. package/build/{PreviewCommand-C4T25Z3E.js → PreviewCommand-JR4LJXI2.js} +22 -19
  22. package/build/{PreviewCommand-C4T25Z3E.js.map → PreviewCommand-JR4LJXI2.js.map} +1 -1
  23. package/build/PreviewCommand-STITNXGG.js +32 -0
  24. package/build/{PublishCommand-O5NP2HRQ.js → PublishCommand-XYOTQFZB.js} +22 -19
  25. package/build/{PublishCommand-O5NP2HRQ.js.map → PublishCommand-XYOTQFZB.js.map} +1 -1
  26. package/build/ReleaseCommand-5VNRVOUP.js +41 -0
  27. package/build/ReleaseCommand-5VNRVOUP.js.map +1 -0
  28. package/build/{UninstallCommand-CBFAJV2F.js → UninstallCommand-5XOY2RI4.js} +24 -21
  29. package/build/{UninstallCommand-CBFAJV2F.js.map → UninstallCommand-5XOY2RI4.js.map} +1 -1
  30. package/build/{WhoamiCommand-LPJGYXSP.js → WhoamiCommand-JN32SHH5.js} +5 -4
  31. package/build/{WhoamiCommand-LPJGYXSP.js.map → WhoamiCommand-JN32SHH5.js.map} +1 -1
  32. package/build/{chunk-RVGOK65D.js → chunk-2EVNRLYY.js} +13 -9
  33. package/build/{chunk-RVGOK65D.js.map → chunk-2EVNRLYY.js.map} +1 -1
  34. package/build/chunk-2PNYIXMP.js +653 -0
  35. package/build/chunk-2PNYIXMP.js.map +1 -0
  36. package/build/{chunk-FTL2KYZQ.js → chunk-3A3KLMDB.js} +2 -2
  37. package/build/{chunk-T5F7W3A3.js → chunk-3NC6D6VA.js} +11 -11
  38. package/build/{chunk-E2POOOG2.js → chunk-3OG3PDAA.js} +51 -2
  39. package/build/{chunk-E2POOOG2.js.map → chunk-3OG3PDAA.js.map} +1 -1
  40. package/build/{chunk-QQCYRUA6.js → chunk-3WOTB46G.js} +43 -7
  41. package/build/{chunk-QQCYRUA6.js.map → chunk-3WOTB46G.js.map} +1 -1
  42. package/build/chunk-4NN2C4CS.js +3207 -0
  43. package/build/chunk-4NN2C4CS.js.map +1 -0
  44. package/build/{chunk-JUZMIMAT.js → chunk-56VD6Y4X.js} +6 -4
  45. package/build/{chunk-JUZMIMAT.js.map → chunk-56VD6Y4X.js.map} +1 -1
  46. package/build/chunk-65JTHDMM.js +3782 -0
  47. package/build/chunk-65JTHDMM.js.map +1 -0
  48. package/build/{chunk-4EBW6Y52.js → chunk-6EQYJQAS.js} +4 -4
  49. package/build/{chunk-4EBW6Y52.js.map → chunk-6EQYJQAS.js.map} +1 -1
  50. package/build/chunk-6VPGAPW3.js +72 -0
  51. package/build/chunk-6VPGAPW3.js.map +1 -0
  52. package/build/{chunk-7Y2EFSBJ.js → chunk-6Y53QK4T.js} +9 -7
  53. package/build/{chunk-7Y2EFSBJ.js.map → chunk-6Y53QK4T.js.map} +1 -1
  54. package/build/chunk-7HULOMX3.js +4760 -0
  55. package/build/chunk-7HULOMX3.js.map +1 -0
  56. package/build/chunk-7ICFZQAL.js +14 -0
  57. package/build/chunk-7ICFZQAL.js.map +1 -0
  58. package/build/{chunk-YLK75XXM.js → chunk-7ZP5YH44.js} +2 -2
  59. package/build/chunk-AFVZOQLU.js +122 -0
  60. package/build/chunk-AFVZOQLU.js.map +1 -0
  61. package/build/{chunk-UIA2B5XZ.js → chunk-AKKEMPVY.js} +4 -4
  62. package/build/{chunk-NOH6CVSC.js → chunk-BTGGUTXE.js} +8 -8
  63. package/build/{chunk-P5ZYMUV4.js → chunk-CEA5QOGH.js} +5 -5
  64. package/build/chunk-COXRYL76.js +21 -0
  65. package/build/chunk-COXRYL76.js.map +1 -0
  66. package/build/{chunk-N4QBC52K.js → chunk-CQILISSC.js} +4 -27
  67. package/build/chunk-CQILISSC.js.map +1 -0
  68. package/build/{chunk-Q35JN7B7.js → chunk-DN2XHTKB.js} +4 -4
  69. package/build/{chunk-RVMEYUY7.js → chunk-E4DQ4CV7.js} +2 -2
  70. package/build/{chunk-46OKYX3T.js → chunk-E5NGKLMX.js} +6 -6
  71. package/build/{chunk-LUAAKCVP.js → chunk-GRNUBSF6.js} +13 -13
  72. package/build/chunk-GT3LT63J.js +911 -0
  73. package/build/chunk-GT3LT63J.js.map +1 -0
  74. package/build/chunk-I5FDTDYQ.js +34 -0
  75. package/build/chunk-I5FDTDYQ.js.map +1 -0
  76. package/build/{chunk-OVWRYWLC.js → chunk-JVB5YDKN.js} +5 -5
  77. package/build/{chunk-74KZJOZH.js → chunk-L6RIG3CB.js} +15 -15
  78. package/build/chunk-LDZEOWUV.js +1623 -0
  79. package/build/chunk-LDZEOWUV.js.map +1 -0
  80. package/build/{chunk-K4AB7LGX.js → chunk-LNV5QH54.js} +2 -2
  81. package/build/{chunk-JHHGNLIV.js → chunk-LPD4XGYD.js} +4 -13
  82. package/build/chunk-LPD4XGYD.js.map +1 -0
  83. package/build/{chunk-YMJB5UO3.js → chunk-LX7XE5RU.js} +6 -6
  84. package/build/chunk-LXXFDRYM.js +92 -0
  85. package/build/chunk-LXXFDRYM.js.map +1 -0
  86. package/build/{chunk-UF2OSZ32.js → chunk-MIQ6XUKB.js} +17 -13
  87. package/build/{chunk-UF2OSZ32.js.map → chunk-MIQ6XUKB.js.map} +1 -1
  88. package/build/{chunk-Z4YQ7YWC.js → chunk-MVF7XNIR.js} +4 -4
  89. package/build/chunk-MWHZITF4.js +59 -0
  90. package/build/chunk-MWHZITF4.js.map +1 -0
  91. package/build/chunk-N2SIUTTQ.js +20 -0
  92. package/build/chunk-N2SIUTTQ.js.map +1 -0
  93. package/build/{chunk-GYIDIRSX.js → chunk-N6QOJTN4.js} +2 -2
  94. package/build/{chunk-KT2FHEZR.js → chunk-O7ATXO65.js} +3 -3
  95. package/build/{chunk-Z7JQD6EN.js → chunk-QHSB6VG6.js} +61 -20
  96. package/build/chunk-QHSB6VG6.js.map +1 -0
  97. package/build/{chunk-XBFMXGMY.js → chunk-QKHIYABF.js} +193 -142
  98. package/build/chunk-QKHIYABF.js.map +1 -0
  99. package/build/{chunk-6VFQIFXS.js → chunk-QMOKPF6L.js} +5 -5
  100. package/build/{chunk-O2XYQA7P.js → chunk-RLO4PTKH.js} +95 -991
  101. package/build/chunk-RLO4PTKH.js.map +1 -0
  102. package/build/{chunk-GO2GZJCK.js → chunk-SF2XPDVG.js} +2 -51
  103. package/build/chunk-SF2XPDVG.js.map +1 -0
  104. package/build/{chunk-UTFSE4KU.js → chunk-VLSMAOUU.js} +3 -3
  105. package/build/{chunk-QEBMMR2W.js → chunk-Y3LK6RU3.js} +3 -3
  106. package/build/{chunk-MXAPWPGN.js → chunk-YEJSNYOF.js} +2 -2
  107. package/build/{chunk-APJVRHWV.js → chunk-YFYFHJE6.js} +2 -2
  108. package/build/{chunk-J3OSZVAR.js → chunk-YOOITXIO.js} +4 -4
  109. package/build/{chunk-RA6PTMIG.js → chunk-YQGCHGIX.js} +5 -5
  110. package/build/{chunk-CJHPYBMK.js → chunk-Z7H3PAZ6.js} +2 -2
  111. package/build/{chunk-M3K72MEX.js → chunk-ZKCONC7A.js} +9 -3
  112. package/build/{chunk-M3K72MEX.js.map → chunk-ZKCONC7A.js.map} +1 -1
  113. package/build/{chunk-6RXRVNVZ.js → chunk-ZU656JEZ.js} +2 -1
  114. package/build/{dev-XNYFRZT2.js → dev-45ZJIDEB.js} +45 -39
  115. package/build/{dev-XNYFRZT2.js.map → dev-45ZJIDEB.js.map} +1 -1
  116. package/build/execa-KAGZAUR3.js +21 -0
  117. package/build/index.js +411 -4174
  118. package/build/index.js.map +1 -1
  119. package/build/{install-T2VL2EW7.js → install-Q5MSHIUE.js} +25 -23
  120. package/build/{install-T2VL2EW7.js.map → install-Q5MSHIUE.js.map} +1 -1
  121. package/build/preview-QJNHO37L.js +63 -0
  122. package/build/preview-QJNHO37L.js.map +1 -0
  123. package/build/{publish-X4C2MV4G.js → publish-GU77GYHO.js} +33 -31
  124. package/build/{publish-X4C2MV4G.js.map → publish-GU77GYHO.js.map} +1 -1
  125. package/build/release-5X3AWGDM.js +74 -0
  126. package/build/release-5X3AWGDM.js.map +1 -0
  127. package/build/render-command-74EMINJ2.js +31 -0
  128. package/build/{render-command-6ZOFWK7J.js → render-command-CDNKBZGT.js} +18 -16
  129. package/build/{render-command-6ZOFWK7J.js.map → render-command-CDNKBZGT.js.map} +1 -1
  130. package/build/{render-command-UIJELJ22.js → render-command-EX7WIAL6.js} +13 -11
  131. package/build/{render-command-UIJELJ22.js.map → render-command-EX7WIAL6.js.map} +1 -1
  132. package/build/{render-command-3IKISL4W.js → render-command-FXWYI3JH.js} +14 -12
  133. package/build/{render-command-3IKISL4W.js.map → render-command-FXWYI3JH.js.map} +1 -1
  134. package/build/{render-command-XJNWHPDB.js → render-command-UCUAHYDD.js} +17 -15
  135. package/build/{render-command-XJNWHPDB.js.map → render-command-UCUAHYDD.js.map} +1 -1
  136. package/build/run-command-YWXKESR5.js +23 -0
  137. package/build/src-4XDLKJ2O.js +29 -0
  138. package/build/{src-OISHTUJS.js → src-5YDYDX7K.js} +9 -8
  139. package/build/{src-OISHTUJS.js.map → src-5YDYDX7K.js.map} +1 -1
  140. package/build/{src-BTBURERG.js → src-676RR5RU.js} +17 -16
  141. package/build/{src-BTBURERG.js.map → src-676RR5RU.js.map} +1 -1
  142. package/build/src-75E36S6D.js +18 -0
  143. package/build/src-75E36S6D.js.map +1 -0
  144. package/build/src-CRLV3UTK.js +259 -0
  145. package/build/src-CRLV3UTK.js.map +1 -0
  146. package/build/{src-IM374B5V.js → src-GJHLNFJ3.js} +10 -8
  147. package/build/src-GJHLNFJ3.js.map +1 -0
  148. package/build/{src-XPBBV4BR.js → src-KLB3VOCG.js} +20 -19
  149. package/build/{src-XPBBV4BR.js.map → src-KLB3VOCG.js.map} +1 -1
  150. package/build/{src-SRRWPZCM.js → src-YH6G7Q5Z.js} +2 -2
  151. package/build/src-YH6G7Q5Z.js.map +1 -0
  152. package/build/sync-types-MB2TQNHN.js +34 -0
  153. package/build/sync-types-MB2TQNHN.js.map +1 -0
  154. package/build/{uninstall-TTKVW5BW.js → uninstall-TKOBVVM2.js} +25 -23
  155. package/build/{uninstall-TTKVW5BW.js.map → uninstall-TKOBVVM2.js.map} +1 -1
  156. package/package.json +2 -2
  157. package/build/chunk-GO2GZJCK.js.map +0 -1
  158. package/build/chunk-JHHGNLIV.js.map +0 -1
  159. package/build/chunk-N4QBC52K.js.map +0 -1
  160. package/build/chunk-O2XYQA7P.js.map +0 -1
  161. package/build/chunk-XBFMXGMY.js.map +0 -1
  162. package/build/chunk-Z7JQD6EN.js.map +0 -1
  163. package/build/run-command-3YWR7KR7.js +0 -21
  164. package/build/src-5V4GOPPO.js +0 -21
  165. package/build/src-5V4GOPPO.js.map +0 -1
  166. package/build/src-WA6BLDHT.js +0 -16
  167. package/build/sync-types-KIFWC5MO.js +0 -32
  168. /package/build/{run-command-3YWR7KR7.js.map → PreviewCommand-STITNXGG.js.map} +0 -0
  169. /package/build/{chunk-FTL2KYZQ.js.map → chunk-3A3KLMDB.js.map} +0 -0
  170. /package/build/{chunk-T5F7W3A3.js.map → chunk-3NC6D6VA.js.map} +0 -0
  171. /package/build/{chunk-YLK75XXM.js.map → chunk-7ZP5YH44.js.map} +0 -0
  172. /package/build/{chunk-UIA2B5XZ.js.map → chunk-AKKEMPVY.js.map} +0 -0
  173. /package/build/{chunk-NOH6CVSC.js.map → chunk-BTGGUTXE.js.map} +0 -0
  174. /package/build/{chunk-P5ZYMUV4.js.map → chunk-CEA5QOGH.js.map} +0 -0
  175. /package/build/{chunk-Q35JN7B7.js.map → chunk-DN2XHTKB.js.map} +0 -0
  176. /package/build/{chunk-RVMEYUY7.js.map → chunk-E4DQ4CV7.js.map} +0 -0
  177. /package/build/{chunk-46OKYX3T.js.map → chunk-E5NGKLMX.js.map} +0 -0
  178. /package/build/{chunk-LUAAKCVP.js.map → chunk-GRNUBSF6.js.map} +0 -0
  179. /package/build/{chunk-OVWRYWLC.js.map → chunk-JVB5YDKN.js.map} +0 -0
  180. /package/build/{chunk-74KZJOZH.js.map → chunk-L6RIG3CB.js.map} +0 -0
  181. /package/build/{chunk-K4AB7LGX.js.map → chunk-LNV5QH54.js.map} +0 -0
  182. /package/build/{chunk-YMJB5UO3.js.map → chunk-LX7XE5RU.js.map} +0 -0
  183. /package/build/{chunk-Z4YQ7YWC.js.map → chunk-MVF7XNIR.js.map} +0 -0
  184. /package/build/{chunk-GYIDIRSX.js.map → chunk-N6QOJTN4.js.map} +0 -0
  185. /package/build/{chunk-KT2FHEZR.js.map → chunk-O7ATXO65.js.map} +0 -0
  186. /package/build/{chunk-6VFQIFXS.js.map → chunk-QMOKPF6L.js.map} +0 -0
  187. /package/build/{chunk-UTFSE4KU.js.map → chunk-VLSMAOUU.js.map} +0 -0
  188. /package/build/{chunk-QEBMMR2W.js.map → chunk-Y3LK6RU3.js.map} +0 -0
  189. /package/build/{chunk-MXAPWPGN.js.map → chunk-YEJSNYOF.js.map} +0 -0
  190. /package/build/{chunk-APJVRHWV.js.map → chunk-YFYFHJE6.js.map} +0 -0
  191. /package/build/{chunk-J3OSZVAR.js.map → chunk-YOOITXIO.js.map} +0 -0
  192. /package/build/{chunk-RA6PTMIG.js.map → chunk-YQGCHGIX.js.map} +0 -0
  193. /package/build/{chunk-CJHPYBMK.js.map → chunk-Z7H3PAZ6.js.map} +0 -0
  194. /package/build/{chunk-6RXRVNVZ.js.map → chunk-ZU656JEZ.js.map} +0 -0
  195. /package/build/{src-IM374B5V.js.map → execa-KAGZAUR3.js.map} +0 -0
  196. /package/build/{src-SRRWPZCM.js.map → render-command-74EMINJ2.js.map} +0 -0
  197. /package/build/{src-WA6BLDHT.js.map → run-command-YWXKESR5.js.map} +0 -0
  198. /package/build/{sync-types-KIFWC5MO.js.map → src-4XDLKJ2O.js.map} +0 -0
@@ -0,0 +1,1623 @@
1
+ import { createRequire as _createRequire } from 'node:module';
2
+ const require = _createRequire(import.meta.url);
3
+ import {
4
+ PlatformLink,
5
+ readAppManifest,
6
+ useARMClient,
7
+ useUpdateDeploymentTopology,
8
+ useUpdateManifest
9
+ } from "./chunk-4NN2C4CS.js";
10
+ import {
11
+ useWixstroClient
12
+ } from "./chunk-2PNYIXMP.js";
13
+ import {
14
+ buildMetadataSchema,
15
+ getBuildManifestPath,
16
+ useProjectModel
17
+ } from "./chunk-AFVZOQLU.js";
18
+ import {
19
+ globby
20
+ } from "./chunk-65JTHDMM.js";
21
+ import {
22
+ SiteAuthProvider,
23
+ pLimit
24
+ } from "./chunk-2EVNRLYY.js";
25
+ import {
26
+ Alert,
27
+ Box_default,
28
+ Spinner,
29
+ Text,
30
+ useAsync,
31
+ useAsyncCallback
32
+ } from "./chunk-QKHIYABF.js";
33
+ import {
34
+ require_react
35
+ } from "./chunk-SO6EZMEL.js";
36
+ import {
37
+ pathExists,
38
+ readJson
39
+ } from "./chunk-LPD4XGYD.js";
40
+ import {
41
+ CliError,
42
+ CliErrorCode,
43
+ require_lib
44
+ } from "./chunk-ZKCONC7A.js";
45
+ import {
46
+ __toESM,
47
+ init_esm_shims
48
+ } from "./chunk-PYIAC2GK.js";
49
+
50
+ // ../cli-astro-commands/src/components/PreviewCommand/index.ts
51
+ init_esm_shims();
52
+
53
+ // ../cli-astro-commands/src/components/PreviewCommand/PreviewCommand.tsx
54
+ init_esm_shims();
55
+ var import_react3 = __toESM(require_react(), 1);
56
+
57
+ // ../cli-astro-commands/src/components/PreviewCommand/Preview.tsx
58
+ init_esm_shims();
59
+ var import_react2 = __toESM(require_react(), 1);
60
+ var import_variant2 = __toESM(require_lib(), 1);
61
+
62
+ // ../cli-astro-commands/src/files/assert-build-output-exists.ts
63
+ init_esm_shims();
64
+
65
+ // ../cli-astro-commands/src/files/build.config.ts
66
+ init_esm_shims();
67
+ async function readBuildManifest(projectFolder) {
68
+ const buildManifestPath = getBuildManifestPath(projectFolder);
69
+ if (!await pathExists(buildManifestPath)) {
70
+ throw new CliError({
71
+ code: CliErrorCode.BuildOutputMissing({
72
+ reason: `"${buildManifestPath}" build output file is missing.`
73
+ }),
74
+ cause: null
75
+ });
76
+ }
77
+ const buildManifestJson = await readJson(buildManifestPath);
78
+ const parseResult = buildMetadataSchema.safeParse(buildManifestJson);
79
+ if (parseResult.success) {
80
+ return parseResult.data;
81
+ }
82
+ throw new CliError({
83
+ code: CliErrorCode.BuildOutputMissing({
84
+ reason: `"${buildManifestPath}" cannot be read.`
85
+ }),
86
+ cause: parseResult.error
87
+ });
88
+ }
89
+
90
+ // ../cli-astro-commands/src/files/assert-build-output-exists.ts
91
+ async function assertBuildOutputExists(projectFolder) {
92
+ const buildManifest = await readBuildManifest(projectFolder);
93
+ const targets = [
94
+ buildManifest.appManifestPath,
95
+ buildManifest.outDir,
96
+ buildManifest.clientDir,
97
+ buildManifest.serverDir
98
+ ];
99
+ for (const target of targets) {
100
+ if (!await pathExists(target)) {
101
+ throw new CliError({
102
+ code: CliErrorCode.BuildOutputMissing({
103
+ reason: `"${target}" build output file is missing.`
104
+ }),
105
+ cause: null
106
+ });
107
+ }
108
+ }
109
+ }
110
+
111
+ // ../cli-astro-commands/src/components/PreviewCommand/ActionStatus.tsx
112
+ init_esm_shims();
113
+ var import_react = __toESM(require_react(), 1);
114
+ var import_variant = __toESM(require_lib(), 1);
115
+ var ActionStatus = ({ status, loadingText, successText }) => (0, import_variant.match)(status, {
116
+ NotRequested: () => null,
117
+ Loading: () => /* @__PURE__ */ import_react.default.createElement(Spinner, { text: loadingText }),
118
+ Error: () => null,
119
+ Success: () => /* @__PURE__ */ import_react.default.createElement(Alert, { type: "success" }, successText)
120
+ });
121
+
122
+ // ../cli-astro-commands/src/app-manifest/file.ts
123
+ init_esm_shims();
124
+ async function readAppManifestFile(projectFolder) {
125
+ const buildManifest = await readBuildManifest(projectFolder);
126
+ return readAppManifest(buildManifest.appManifestPath);
127
+ }
128
+
129
+ // ../cli-astro-commands/src/components/PreviewCommand/hooks/useLoadBuildFiles.ts
130
+ init_esm_shims();
131
+ import { join } from "node:path";
132
+ function useLoadBuildFiles() {
133
+ const {
134
+ model: { projectFolder }
135
+ } = useProjectModel();
136
+ return useAsyncCallback(async () => {
137
+ const buildManifest = await readBuildManifest(projectFolder);
138
+ const client = (await loadFiles(buildManifest.clientDir)).filter(
139
+ ({ relativePath, path }) => {
140
+ if (relativePath.startsWith("_wix")) {
141
+ return false;
142
+ }
143
+ if (path.startsWith(buildManifest.serverDir)) {
144
+ return false;
145
+ }
146
+ return true;
147
+ }
148
+ );
149
+ const server = await loadFiles(buildManifest.serverDir);
150
+ if (client.length + server.length === 0) {
151
+ throw new CliError({
152
+ code: CliErrorCode.BuildOutputMissing({
153
+ reason: "Could't find neither client nor server build output files."
154
+ }),
155
+ cause: null
156
+ });
157
+ }
158
+ return { client, server };
159
+ });
160
+ }
161
+ async function loadFiles(cwd) {
162
+ return globby("**/*", { cwd, onlyFiles: true }).then(
163
+ (files) => files.map((relativePath) => {
164
+ return {
165
+ path: join(cwd, relativePath),
166
+ relativePath
167
+ };
168
+ })
169
+ );
170
+ }
171
+
172
+ // ../cli-astro-commands/src/components/PreviewCommand/hooks/useUploadClientFiles.ts
173
+ init_esm_shims();
174
+ import crypto from "node:crypto";
175
+ import fs from "node:fs";
176
+
177
+ // ../../node_modules/mime/dist/src/index.js
178
+ init_esm_shims();
179
+
180
+ // ../../node_modules/mime/dist/types/other.js
181
+ init_esm_shims();
182
+ var types = {
183
+ "application/prs.cww": ["cww"],
184
+ "application/prs.xsf+xml": ["xsf"],
185
+ "application/vnd.1000minds.decision-model+xml": ["1km"],
186
+ "application/vnd.3gpp.pic-bw-large": ["plb"],
187
+ "application/vnd.3gpp.pic-bw-small": ["psb"],
188
+ "application/vnd.3gpp.pic-bw-var": ["pvb"],
189
+ "application/vnd.3gpp2.tcap": ["tcap"],
190
+ "application/vnd.3m.post-it-notes": ["pwn"],
191
+ "application/vnd.accpac.simply.aso": ["aso"],
192
+ "application/vnd.accpac.simply.imp": ["imp"],
193
+ "application/vnd.acucobol": ["acu"],
194
+ "application/vnd.acucorp": ["atc", "acutc"],
195
+ "application/vnd.adobe.air-application-installer-package+zip": ["air"],
196
+ "application/vnd.adobe.formscentral.fcdt": ["fcdt"],
197
+ "application/vnd.adobe.fxp": ["fxp", "fxpl"],
198
+ "application/vnd.adobe.xdp+xml": ["xdp"],
199
+ "application/vnd.adobe.xfdf": ["*xfdf"],
200
+ "application/vnd.age": ["age"],
201
+ "application/vnd.ahead.space": ["ahead"],
202
+ "application/vnd.airzip.filesecure.azf": ["azf"],
203
+ "application/vnd.airzip.filesecure.azs": ["azs"],
204
+ "application/vnd.amazon.ebook": ["azw"],
205
+ "application/vnd.americandynamics.acc": ["acc"],
206
+ "application/vnd.amiga.ami": ["ami"],
207
+ "application/vnd.android.package-archive": ["apk"],
208
+ "application/vnd.anser-web-certificate-issue-initiation": ["cii"],
209
+ "application/vnd.anser-web-funds-transfer-initiation": ["fti"],
210
+ "application/vnd.antix.game-component": ["atx"],
211
+ "application/vnd.apple.installer+xml": ["mpkg"],
212
+ "application/vnd.apple.keynote": ["key"],
213
+ "application/vnd.apple.mpegurl": ["m3u8"],
214
+ "application/vnd.apple.numbers": ["numbers"],
215
+ "application/vnd.apple.pages": ["pages"],
216
+ "application/vnd.apple.pkpass": ["pkpass"],
217
+ "application/vnd.aristanetworks.swi": ["swi"],
218
+ "application/vnd.astraea-software.iota": ["iota"],
219
+ "application/vnd.audiograph": ["aep"],
220
+ "application/vnd.autodesk.fbx": ["fbx"],
221
+ "application/vnd.balsamiq.bmml+xml": ["bmml"],
222
+ "application/vnd.blueice.multipass": ["mpm"],
223
+ "application/vnd.bmi": ["bmi"],
224
+ "application/vnd.businessobjects": ["rep"],
225
+ "application/vnd.chemdraw+xml": ["cdxml"],
226
+ "application/vnd.chipnuts.karaoke-mmd": ["mmd"],
227
+ "application/vnd.cinderella": ["cdy"],
228
+ "application/vnd.citationstyles.style+xml": ["csl"],
229
+ "application/vnd.claymore": ["cla"],
230
+ "application/vnd.cloanto.rp9": ["rp9"],
231
+ "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"],
232
+ "application/vnd.cluetrust.cartomobile-config": ["c11amc"],
233
+ "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"],
234
+ "application/vnd.commonspace": ["csp"],
235
+ "application/vnd.contact.cmsg": ["cdbcmsg"],
236
+ "application/vnd.cosmocaller": ["cmc"],
237
+ "application/vnd.crick.clicker": ["clkx"],
238
+ "application/vnd.crick.clicker.keyboard": ["clkk"],
239
+ "application/vnd.crick.clicker.palette": ["clkp"],
240
+ "application/vnd.crick.clicker.template": ["clkt"],
241
+ "application/vnd.crick.clicker.wordbank": ["clkw"],
242
+ "application/vnd.criticaltools.wbs+xml": ["wbs"],
243
+ "application/vnd.ctc-posml": ["pml"],
244
+ "application/vnd.cups-ppd": ["ppd"],
245
+ "application/vnd.curl.car": ["car"],
246
+ "application/vnd.curl.pcurl": ["pcurl"],
247
+ "application/vnd.dart": ["dart"],
248
+ "application/vnd.data-vision.rdz": ["rdz"],
249
+ "application/vnd.dbf": ["dbf"],
250
+ "application/vnd.dcmp+xml": ["dcmp"],
251
+ "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"],
252
+ "application/vnd.dece.ttml+xml": ["uvt", "uvvt"],
253
+ "application/vnd.dece.unspecified": ["uvx", "uvvx"],
254
+ "application/vnd.dece.zip": ["uvz", "uvvz"],
255
+ "application/vnd.denovo.fcselayout-link": ["fe_launch"],
256
+ "application/vnd.dna": ["dna"],
257
+ "application/vnd.dolby.mlp": ["mlp"],
258
+ "application/vnd.dpgraph": ["dpg"],
259
+ "application/vnd.dreamfactory": ["dfac"],
260
+ "application/vnd.ds-keypoint": ["kpxx"],
261
+ "application/vnd.dvb.ait": ["ait"],
262
+ "application/vnd.dvb.service": ["svc"],
263
+ "application/vnd.dynageo": ["geo"],
264
+ "application/vnd.ecowin.chart": ["mag"],
265
+ "application/vnd.enliven": ["nml"],
266
+ "application/vnd.epson.esf": ["esf"],
267
+ "application/vnd.epson.msf": ["msf"],
268
+ "application/vnd.epson.quickanime": ["qam"],
269
+ "application/vnd.epson.salt": ["slt"],
270
+ "application/vnd.epson.ssf": ["ssf"],
271
+ "application/vnd.eszigno3+xml": ["es3", "et3"],
272
+ "application/vnd.ezpix-album": ["ez2"],
273
+ "application/vnd.ezpix-package": ["ez3"],
274
+ "application/vnd.fdf": ["*fdf"],
275
+ "application/vnd.fdsn.mseed": ["mseed"],
276
+ "application/vnd.fdsn.seed": ["seed", "dataless"],
277
+ "application/vnd.flographit": ["gph"],
278
+ "application/vnd.fluxtime.clip": ["ftc"],
279
+ "application/vnd.framemaker": ["fm", "frame", "maker", "book"],
280
+ "application/vnd.frogans.fnc": ["fnc"],
281
+ "application/vnd.frogans.ltf": ["ltf"],
282
+ "application/vnd.fsc.weblaunch": ["fsc"],
283
+ "application/vnd.fujitsu.oasys": ["oas"],
284
+ "application/vnd.fujitsu.oasys2": ["oa2"],
285
+ "application/vnd.fujitsu.oasys3": ["oa3"],
286
+ "application/vnd.fujitsu.oasysgp": ["fg5"],
287
+ "application/vnd.fujitsu.oasysprs": ["bh2"],
288
+ "application/vnd.fujixerox.ddd": ["ddd"],
289
+ "application/vnd.fujixerox.docuworks": ["xdw"],
290
+ "application/vnd.fujixerox.docuworks.binder": ["xbd"],
291
+ "application/vnd.fuzzysheet": ["fzs"],
292
+ "application/vnd.genomatix.tuxedo": ["txd"],
293
+ "application/vnd.geogebra.file": ["ggb"],
294
+ "application/vnd.geogebra.slides": ["ggs"],
295
+ "application/vnd.geogebra.tool": ["ggt"],
296
+ "application/vnd.geometry-explorer": ["gex", "gre"],
297
+ "application/vnd.geonext": ["gxt"],
298
+ "application/vnd.geoplan": ["g2w"],
299
+ "application/vnd.geospace": ["g3w"],
300
+ "application/vnd.gmx": ["gmx"],
301
+ "application/vnd.google-apps.document": ["gdoc"],
302
+ "application/vnd.google-apps.drawing": ["gdraw"],
303
+ "application/vnd.google-apps.form": ["gform"],
304
+ "application/vnd.google-apps.jam": ["gjam"],
305
+ "application/vnd.google-apps.map": ["gmap"],
306
+ "application/vnd.google-apps.presentation": ["gslides"],
307
+ "application/vnd.google-apps.script": ["gscript"],
308
+ "application/vnd.google-apps.site": ["gsite"],
309
+ "application/vnd.google-apps.spreadsheet": ["gsheet"],
310
+ "application/vnd.google-earth.kml+xml": ["kml"],
311
+ "application/vnd.google-earth.kmz": ["kmz"],
312
+ "application/vnd.gov.sk.xmldatacontainer+xml": ["xdcf"],
313
+ "application/vnd.grafeq": ["gqf", "gqs"],
314
+ "application/vnd.groove-account": ["gac"],
315
+ "application/vnd.groove-help": ["ghf"],
316
+ "application/vnd.groove-identity-message": ["gim"],
317
+ "application/vnd.groove-injector": ["grv"],
318
+ "application/vnd.groove-tool-message": ["gtm"],
319
+ "application/vnd.groove-tool-template": ["tpl"],
320
+ "application/vnd.groove-vcard": ["vcg"],
321
+ "application/vnd.hal+xml": ["hal"],
322
+ "application/vnd.handheld-entertainment+xml": ["zmm"],
323
+ "application/vnd.hbci": ["hbci"],
324
+ "application/vnd.hhe.lesson-player": ["les"],
325
+ "application/vnd.hp-hpgl": ["hpgl"],
326
+ "application/vnd.hp-hpid": ["hpid"],
327
+ "application/vnd.hp-hps": ["hps"],
328
+ "application/vnd.hp-jlyt": ["jlt"],
329
+ "application/vnd.hp-pcl": ["pcl"],
330
+ "application/vnd.hp-pclxl": ["pclxl"],
331
+ "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"],
332
+ "application/vnd.ibm.minipay": ["mpy"],
333
+ "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"],
334
+ "application/vnd.ibm.rights-management": ["irm"],
335
+ "application/vnd.ibm.secure-container": ["sc"],
336
+ "application/vnd.iccprofile": ["icc", "icm"],
337
+ "application/vnd.igloader": ["igl"],
338
+ "application/vnd.immervision-ivp": ["ivp"],
339
+ "application/vnd.immervision-ivu": ["ivu"],
340
+ "application/vnd.insors.igm": ["igm"],
341
+ "application/vnd.intercon.formnet": ["xpw", "xpx"],
342
+ "application/vnd.intergeo": ["i2g"],
343
+ "application/vnd.intu.qbo": ["qbo"],
344
+ "application/vnd.intu.qfx": ["qfx"],
345
+ "application/vnd.ipunplugged.rcprofile": ["rcprofile"],
346
+ "application/vnd.irepository.package+xml": ["irp"],
347
+ "application/vnd.is-xpr": ["xpr"],
348
+ "application/vnd.isac.fcs": ["fcs"],
349
+ "application/vnd.jam": ["jam"],
350
+ "application/vnd.jcp.javame.midlet-rms": ["rms"],
351
+ "application/vnd.jisp": ["jisp"],
352
+ "application/vnd.joost.joda-archive": ["joda"],
353
+ "application/vnd.kahootz": ["ktz", "ktr"],
354
+ "application/vnd.kde.karbon": ["karbon"],
355
+ "application/vnd.kde.kchart": ["chrt"],
356
+ "application/vnd.kde.kformula": ["kfo"],
357
+ "application/vnd.kde.kivio": ["flw"],
358
+ "application/vnd.kde.kontour": ["kon"],
359
+ "application/vnd.kde.kpresenter": ["kpr", "kpt"],
360
+ "application/vnd.kde.kspread": ["ksp"],
361
+ "application/vnd.kde.kword": ["kwd", "kwt"],
362
+ "application/vnd.kenameaapp": ["htke"],
363
+ "application/vnd.kidspiration": ["kia"],
364
+ "application/vnd.kinar": ["kne", "knp"],
365
+ "application/vnd.koan": ["skp", "skd", "skt", "skm"],
366
+ "application/vnd.kodak-descriptor": ["sse"],
367
+ "application/vnd.las.las+xml": ["lasxml"],
368
+ "application/vnd.llamagraphics.life-balance.desktop": ["lbd"],
369
+ "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"],
370
+ "application/vnd.lotus-1-2-3": ["123"],
371
+ "application/vnd.lotus-approach": ["apr"],
372
+ "application/vnd.lotus-freelance": ["pre"],
373
+ "application/vnd.lotus-notes": ["nsf"],
374
+ "application/vnd.lotus-organizer": ["org"],
375
+ "application/vnd.lotus-screencam": ["scm"],
376
+ "application/vnd.lotus-wordpro": ["lwp"],
377
+ "application/vnd.macports.portpkg": ["portpkg"],
378
+ "application/vnd.mapbox-vector-tile": ["mvt"],
379
+ "application/vnd.mcd": ["mcd"],
380
+ "application/vnd.medcalcdata": ["mc1"],
381
+ "application/vnd.mediastation.cdkey": ["cdkey"],
382
+ "application/vnd.mfer": ["mwf"],
383
+ "application/vnd.mfmp": ["mfm"],
384
+ "application/vnd.micrografx.flo": ["flo"],
385
+ "application/vnd.micrografx.igx": ["igx"],
386
+ "application/vnd.mif": ["mif"],
387
+ "application/vnd.mobius.daf": ["daf"],
388
+ "application/vnd.mobius.dis": ["dis"],
389
+ "application/vnd.mobius.mbk": ["mbk"],
390
+ "application/vnd.mobius.mqy": ["mqy"],
391
+ "application/vnd.mobius.msl": ["msl"],
392
+ "application/vnd.mobius.plc": ["plc"],
393
+ "application/vnd.mobius.txf": ["txf"],
394
+ "application/vnd.mophun.application": ["mpn"],
395
+ "application/vnd.mophun.certificate": ["mpc"],
396
+ "application/vnd.mozilla.xul+xml": ["xul"],
397
+ "application/vnd.ms-artgalry": ["cil"],
398
+ "application/vnd.ms-cab-compressed": ["cab"],
399
+ "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"],
400
+ "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"],
401
+ "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"],
402
+ "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"],
403
+ "application/vnd.ms-excel.template.macroenabled.12": ["xltm"],
404
+ "application/vnd.ms-fontobject": ["eot"],
405
+ "application/vnd.ms-htmlhelp": ["chm"],
406
+ "application/vnd.ms-ims": ["ims"],
407
+ "application/vnd.ms-lrm": ["lrm"],
408
+ "application/vnd.ms-officetheme": ["thmx"],
409
+ "application/vnd.ms-outlook": ["msg"],
410
+ "application/vnd.ms-pki.seccat": ["cat"],
411
+ "application/vnd.ms-pki.stl": ["*stl"],
412
+ "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"],
413
+ "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"],
414
+ "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"],
415
+ "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"],
416
+ "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"],
417
+ "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"],
418
+ "application/vnd.ms-project": ["*mpp", "mpt"],
419
+ "application/vnd.ms-visio.viewer": ["vdx"],
420
+ "application/vnd.ms-word.document.macroenabled.12": ["docm"],
421
+ "application/vnd.ms-word.template.macroenabled.12": ["dotm"],
422
+ "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"],
423
+ "application/vnd.ms-wpl": ["wpl"],
424
+ "application/vnd.ms-xpsdocument": ["xps"],
425
+ "application/vnd.mseq": ["mseq"],
426
+ "application/vnd.musician": ["mus"],
427
+ "application/vnd.muvee.style": ["msty"],
428
+ "application/vnd.mynfc": ["taglet"],
429
+ "application/vnd.nato.bindingdataobject+xml": ["bdo"],
430
+ "application/vnd.neurolanguage.nlu": ["nlu"],
431
+ "application/vnd.nitf": ["ntf", "nitf"],
432
+ "application/vnd.noblenet-directory": ["nnd"],
433
+ "application/vnd.noblenet-sealer": ["nns"],
434
+ "application/vnd.noblenet-web": ["nnw"],
435
+ "application/vnd.nokia.n-gage.ac+xml": ["*ac"],
436
+ "application/vnd.nokia.n-gage.data": ["ngdat"],
437
+ "application/vnd.nokia.n-gage.symbian.install": ["n-gage"],
438
+ "application/vnd.nokia.radio-preset": ["rpst"],
439
+ "application/vnd.nokia.radio-presets": ["rpss"],
440
+ "application/vnd.novadigm.edm": ["edm"],
441
+ "application/vnd.novadigm.edx": ["edx"],
442
+ "application/vnd.novadigm.ext": ["ext"],
443
+ "application/vnd.oasis.opendocument.chart": ["odc"],
444
+ "application/vnd.oasis.opendocument.chart-template": ["otc"],
445
+ "application/vnd.oasis.opendocument.database": ["odb"],
446
+ "application/vnd.oasis.opendocument.formula": ["odf"],
447
+ "application/vnd.oasis.opendocument.formula-template": ["odft"],
448
+ "application/vnd.oasis.opendocument.graphics": ["odg"],
449
+ "application/vnd.oasis.opendocument.graphics-template": ["otg"],
450
+ "application/vnd.oasis.opendocument.image": ["odi"],
451
+ "application/vnd.oasis.opendocument.image-template": ["oti"],
452
+ "application/vnd.oasis.opendocument.presentation": ["odp"],
453
+ "application/vnd.oasis.opendocument.presentation-template": ["otp"],
454
+ "application/vnd.oasis.opendocument.spreadsheet": ["ods"],
455
+ "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"],
456
+ "application/vnd.oasis.opendocument.text": ["odt"],
457
+ "application/vnd.oasis.opendocument.text-master": ["odm"],
458
+ "application/vnd.oasis.opendocument.text-template": ["ott"],
459
+ "application/vnd.oasis.opendocument.text-web": ["oth"],
460
+ "application/vnd.olpc-sugar": ["xo"],
461
+ "application/vnd.oma.dd2+xml": ["dd2"],
462
+ "application/vnd.openblox.game+xml": ["obgx"],
463
+ "application/vnd.openofficeorg.extension": ["oxt"],
464
+ "application/vnd.openstreetmap.data+xml": ["osm"],
465
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": [
466
+ "pptx"
467
+ ],
468
+ "application/vnd.openxmlformats-officedocument.presentationml.slide": [
469
+ "sldx"
470
+ ],
471
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow": [
472
+ "ppsx"
473
+ ],
474
+ "application/vnd.openxmlformats-officedocument.presentationml.template": [
475
+ "potx"
476
+ ],
477
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"],
478
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template": [
479
+ "xltx"
480
+ ],
481
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [
482
+ "docx"
483
+ ],
484
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template": [
485
+ "dotx"
486
+ ],
487
+ "application/vnd.osgeo.mapguide.package": ["mgp"],
488
+ "application/vnd.osgi.dp": ["dp"],
489
+ "application/vnd.osgi.subsystem": ["esa"],
490
+ "application/vnd.palm": ["pdb", "pqa", "oprc"],
491
+ "application/vnd.pawaafile": ["paw"],
492
+ "application/vnd.pg.format": ["str"],
493
+ "application/vnd.pg.osasli": ["ei6"],
494
+ "application/vnd.picsel": ["efif"],
495
+ "application/vnd.pmi.widget": ["wg"],
496
+ "application/vnd.pocketlearn": ["plf"],
497
+ "application/vnd.powerbuilder6": ["pbd"],
498
+ "application/vnd.previewsystems.box": ["box"],
499
+ "application/vnd.procrate.brushset": ["brushset"],
500
+ "application/vnd.procreate.brush": ["brush"],
501
+ "application/vnd.procreate.dream": ["drm"],
502
+ "application/vnd.proteus.magazine": ["mgz"],
503
+ "application/vnd.publishare-delta-tree": ["qps"],
504
+ "application/vnd.pvi.ptid1": ["ptid"],
505
+ "application/vnd.pwg-xhtml-print+xml": ["xhtm"],
506
+ "application/vnd.quark.quarkxpress": [
507
+ "qxd",
508
+ "qxt",
509
+ "qwd",
510
+ "qwt",
511
+ "qxl",
512
+ "qxb"
513
+ ],
514
+ "application/vnd.rar": ["rar"],
515
+ "application/vnd.realvnc.bed": ["bed"],
516
+ "application/vnd.recordare.musicxml": ["mxl"],
517
+ "application/vnd.recordare.musicxml+xml": ["musicxml"],
518
+ "application/vnd.rig.cryptonote": ["cryptonote"],
519
+ "application/vnd.rim.cod": ["cod"],
520
+ "application/vnd.rn-realmedia": ["rm"],
521
+ "application/vnd.rn-realmedia-vbr": ["rmvb"],
522
+ "application/vnd.route66.link66+xml": ["link66"],
523
+ "application/vnd.sailingtracker.track": ["st"],
524
+ "application/vnd.seemail": ["see"],
525
+ "application/vnd.sema": ["sema"],
526
+ "application/vnd.semd": ["semd"],
527
+ "application/vnd.semf": ["semf"],
528
+ "application/vnd.shana.informed.formdata": ["ifm"],
529
+ "application/vnd.shana.informed.formtemplate": ["itp"],
530
+ "application/vnd.shana.informed.interchange": ["iif"],
531
+ "application/vnd.shana.informed.package": ["ipk"],
532
+ "application/vnd.simtech-mindmapper": ["twd", "twds"],
533
+ "application/vnd.smaf": ["mmf"],
534
+ "application/vnd.smart.teacher": ["teacher"],
535
+ "application/vnd.software602.filler.form+xml": ["fo"],
536
+ "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"],
537
+ "application/vnd.spotfire.dxp": ["dxp"],
538
+ "application/vnd.spotfire.sfs": ["sfs"],
539
+ "application/vnd.stardivision.calc": ["sdc"],
540
+ "application/vnd.stardivision.draw": ["sda"],
541
+ "application/vnd.stardivision.impress": ["sdd"],
542
+ "application/vnd.stardivision.math": ["smf"],
543
+ "application/vnd.stardivision.writer": ["sdw", "vor"],
544
+ "application/vnd.stardivision.writer-global": ["sgl"],
545
+ "application/vnd.stepmania.package": ["smzip"],
546
+ "application/vnd.stepmania.stepchart": ["sm"],
547
+ "application/vnd.sun.wadl+xml": ["wadl"],
548
+ "application/vnd.sun.xml.calc": ["sxc"],
549
+ "application/vnd.sun.xml.calc.template": ["stc"],
550
+ "application/vnd.sun.xml.draw": ["sxd"],
551
+ "application/vnd.sun.xml.draw.template": ["std"],
552
+ "application/vnd.sun.xml.impress": ["sxi"],
553
+ "application/vnd.sun.xml.impress.template": ["sti"],
554
+ "application/vnd.sun.xml.math": ["sxm"],
555
+ "application/vnd.sun.xml.writer": ["sxw"],
556
+ "application/vnd.sun.xml.writer.global": ["sxg"],
557
+ "application/vnd.sun.xml.writer.template": ["stw"],
558
+ "application/vnd.sus-calendar": ["sus", "susp"],
559
+ "application/vnd.svd": ["svd"],
560
+ "application/vnd.symbian.install": ["sis", "sisx"],
561
+ "application/vnd.syncml+xml": ["xsm"],
562
+ "application/vnd.syncml.dm+wbxml": ["bdm"],
563
+ "application/vnd.syncml.dm+xml": ["xdm"],
564
+ "application/vnd.syncml.dmddf+xml": ["ddf"],
565
+ "application/vnd.tao.intent-module-archive": ["tao"],
566
+ "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"],
567
+ "application/vnd.tmobile-livetv": ["tmo"],
568
+ "application/vnd.trid.tpt": ["tpt"],
569
+ "application/vnd.triscape.mxs": ["mxs"],
570
+ "application/vnd.trueapp": ["tra"],
571
+ "application/vnd.ufdl": ["ufd", "ufdl"],
572
+ "application/vnd.uiq.theme": ["utz"],
573
+ "application/vnd.umajin": ["umj"],
574
+ "application/vnd.unity": ["unityweb"],
575
+ "application/vnd.uoml+xml": ["uoml", "uo"],
576
+ "application/vnd.vcx": ["vcx"],
577
+ "application/vnd.visio": ["vsd", "vst", "vss", "vsw", "vsdx", "vtx"],
578
+ "application/vnd.visionary": ["vis"],
579
+ "application/vnd.vsf": ["vsf"],
580
+ "application/vnd.wap.wbxml": ["wbxml"],
581
+ "application/vnd.wap.wmlc": ["wmlc"],
582
+ "application/vnd.wap.wmlscriptc": ["wmlsc"],
583
+ "application/vnd.webturbo": ["wtb"],
584
+ "application/vnd.wolfram.player": ["nbp"],
585
+ "application/vnd.wordperfect": ["wpd"],
586
+ "application/vnd.wqd": ["wqd"],
587
+ "application/vnd.wt.stf": ["stf"],
588
+ "application/vnd.xara": ["xar"],
589
+ "application/vnd.xfdl": ["xfdl"],
590
+ "application/vnd.yamaha.hv-dic": ["hvd"],
591
+ "application/vnd.yamaha.hv-script": ["hvs"],
592
+ "application/vnd.yamaha.hv-voice": ["hvp"],
593
+ "application/vnd.yamaha.openscoreformat": ["osf"],
594
+ "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"],
595
+ "application/vnd.yamaha.smaf-audio": ["saf"],
596
+ "application/vnd.yamaha.smaf-phrase": ["spf"],
597
+ "application/vnd.yellowriver-custom-menu": ["cmp"],
598
+ "application/vnd.zul": ["zir", "zirz"],
599
+ "application/vnd.zzazz.deck+xml": ["zaz"],
600
+ "application/x-7z-compressed": ["7z"],
601
+ "application/x-abiword": ["abw"],
602
+ "application/x-ace-compressed": ["ace"],
603
+ "application/x-apple-diskimage": ["*dmg"],
604
+ "application/x-arj": ["arj"],
605
+ "application/x-authorware-bin": ["aab", "x32", "u32", "vox"],
606
+ "application/x-authorware-map": ["aam"],
607
+ "application/x-authorware-seg": ["aas"],
608
+ "application/x-bcpio": ["bcpio"],
609
+ "application/x-bdoc": ["*bdoc"],
610
+ "application/x-bittorrent": ["torrent"],
611
+ "application/x-blender": ["blend"],
612
+ "application/x-blorb": ["blb", "blorb"],
613
+ "application/x-bzip": ["bz"],
614
+ "application/x-bzip2": ["bz2", "boz"],
615
+ "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"],
616
+ "application/x-cdlink": ["vcd"],
617
+ "application/x-cfs-compressed": ["cfs"],
618
+ "application/x-chat": ["chat"],
619
+ "application/x-chess-pgn": ["pgn"],
620
+ "application/x-chrome-extension": ["crx"],
621
+ "application/x-cocoa": ["cco"],
622
+ "application/x-compressed": ["*rar"],
623
+ "application/x-conference": ["nsc"],
624
+ "application/x-cpio": ["cpio"],
625
+ "application/x-csh": ["csh"],
626
+ "application/x-debian-package": ["*deb", "udeb"],
627
+ "application/x-dgc-compressed": ["dgc"],
628
+ "application/x-director": [
629
+ "dir",
630
+ "dcr",
631
+ "dxr",
632
+ "cst",
633
+ "cct",
634
+ "cxt",
635
+ "w3d",
636
+ "fgd",
637
+ "swa"
638
+ ],
639
+ "application/x-doom": ["wad"],
640
+ "application/x-dtbncx+xml": ["ncx"],
641
+ "application/x-dtbook+xml": ["dtb"],
642
+ "application/x-dtbresource+xml": ["res"],
643
+ "application/x-dvi": ["dvi"],
644
+ "application/x-envoy": ["evy"],
645
+ "application/x-eva": ["eva"],
646
+ "application/x-font-bdf": ["bdf"],
647
+ "application/x-font-ghostscript": ["gsf"],
648
+ "application/x-font-linux-psf": ["psf"],
649
+ "application/x-font-pcf": ["pcf"],
650
+ "application/x-font-snf": ["snf"],
651
+ "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"],
652
+ "application/x-freearc": ["arc"],
653
+ "application/x-futuresplash": ["spl"],
654
+ "application/x-gca-compressed": ["gca"],
655
+ "application/x-glulx": ["ulx"],
656
+ "application/x-gnumeric": ["gnumeric"],
657
+ "application/x-gramps-xml": ["gramps"],
658
+ "application/x-gtar": ["gtar"],
659
+ "application/x-hdf": ["hdf"],
660
+ "application/x-httpd-php": ["php"],
661
+ "application/x-install-instructions": ["install"],
662
+ "application/x-ipynb+json": ["ipynb"],
663
+ "application/x-iso9660-image": ["*iso"],
664
+ "application/x-iwork-keynote-sffkey": ["*key"],
665
+ "application/x-iwork-numbers-sffnumbers": ["*numbers"],
666
+ "application/x-iwork-pages-sffpages": ["*pages"],
667
+ "application/x-java-archive-diff": ["jardiff"],
668
+ "application/x-java-jnlp-file": ["jnlp"],
669
+ "application/x-keepass2": ["kdbx"],
670
+ "application/x-latex": ["latex"],
671
+ "application/x-lua-bytecode": ["luac"],
672
+ "application/x-lzh-compressed": ["lzh", "lha"],
673
+ "application/x-makeself": ["run"],
674
+ "application/x-mie": ["mie"],
675
+ "application/x-mobipocket-ebook": ["*prc", "mobi"],
676
+ "application/x-ms-application": ["application"],
677
+ "application/x-ms-shortcut": ["lnk"],
678
+ "application/x-ms-wmd": ["wmd"],
679
+ "application/x-ms-wmz": ["wmz"],
680
+ "application/x-ms-xbap": ["xbap"],
681
+ "application/x-msaccess": ["mdb"],
682
+ "application/x-msbinder": ["obd"],
683
+ "application/x-mscardfile": ["crd"],
684
+ "application/x-msclip": ["clp"],
685
+ "application/x-msdos-program": ["*exe"],
686
+ "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"],
687
+ "application/x-msmediaview": ["mvb", "m13", "m14"],
688
+ "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"],
689
+ "application/x-msmoney": ["mny"],
690
+ "application/x-mspublisher": ["pub"],
691
+ "application/x-msschedule": ["scd"],
692
+ "application/x-msterminal": ["trm"],
693
+ "application/x-mswrite": ["wri"],
694
+ "application/x-netcdf": ["nc", "cdf"],
695
+ "application/x-ns-proxy-autoconfig": ["pac"],
696
+ "application/x-nzb": ["nzb"],
697
+ "application/x-perl": ["pl", "pm"],
698
+ "application/x-pilot": ["*prc", "*pdb"],
699
+ "application/x-pkcs12": ["p12", "pfx"],
700
+ "application/x-pkcs7-certificates": ["p7b", "spc"],
701
+ "application/x-pkcs7-certreqresp": ["p7r"],
702
+ "application/x-rar-compressed": ["*rar"],
703
+ "application/x-redhat-package-manager": ["rpm"],
704
+ "application/x-research-info-systems": ["ris"],
705
+ "application/x-sea": ["sea"],
706
+ "application/x-sh": ["sh"],
707
+ "application/x-shar": ["shar"],
708
+ "application/x-shockwave-flash": ["swf"],
709
+ "application/x-silverlight-app": ["xap"],
710
+ "application/x-sql": ["*sql"],
711
+ "application/x-stuffit": ["sit"],
712
+ "application/x-stuffitx": ["sitx"],
713
+ "application/x-subrip": ["srt"],
714
+ "application/x-sv4cpio": ["sv4cpio"],
715
+ "application/x-sv4crc": ["sv4crc"],
716
+ "application/x-t3vm-image": ["t3"],
717
+ "application/x-tads": ["gam"],
718
+ "application/x-tar": ["tar"],
719
+ "application/x-tcl": ["tcl", "tk"],
720
+ "application/x-tex": ["tex"],
721
+ "application/x-tex-tfm": ["tfm"],
722
+ "application/x-texinfo": ["texinfo", "texi"],
723
+ "application/x-tgif": ["*obj"],
724
+ "application/x-ustar": ["ustar"],
725
+ "application/x-virtualbox-hdd": ["hdd"],
726
+ "application/x-virtualbox-ova": ["ova"],
727
+ "application/x-virtualbox-ovf": ["ovf"],
728
+ "application/x-virtualbox-vbox": ["vbox"],
729
+ "application/x-virtualbox-vbox-extpack": ["vbox-extpack"],
730
+ "application/x-virtualbox-vdi": ["vdi"],
731
+ "application/x-virtualbox-vhd": ["vhd"],
732
+ "application/x-virtualbox-vmdk": ["vmdk"],
733
+ "application/x-wais-source": ["src"],
734
+ "application/x-web-app-manifest+json": ["webapp"],
735
+ "application/x-x509-ca-cert": ["der", "crt", "pem"],
736
+ "application/x-xfig": ["fig"],
737
+ "application/x-xliff+xml": ["*xlf"],
738
+ "application/x-xpinstall": ["xpi"],
739
+ "application/x-xz": ["xz"],
740
+ "application/x-zip-compressed": ["*zip"],
741
+ "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"],
742
+ "audio/vnd.dece.audio": ["uva", "uvva"],
743
+ "audio/vnd.digital-winds": ["eol"],
744
+ "audio/vnd.dra": ["dra"],
745
+ "audio/vnd.dts": ["dts"],
746
+ "audio/vnd.dts.hd": ["dtshd"],
747
+ "audio/vnd.lucent.voice": ["lvp"],
748
+ "audio/vnd.ms-playready.media.pya": ["pya"],
749
+ "audio/vnd.nuera.ecelp4800": ["ecelp4800"],
750
+ "audio/vnd.nuera.ecelp7470": ["ecelp7470"],
751
+ "audio/vnd.nuera.ecelp9600": ["ecelp9600"],
752
+ "audio/vnd.rip": ["rip"],
753
+ "audio/x-aac": ["*aac"],
754
+ "audio/x-aiff": ["aif", "aiff", "aifc"],
755
+ "audio/x-caf": ["caf"],
756
+ "audio/x-flac": ["flac"],
757
+ "audio/x-m4a": ["*m4a"],
758
+ "audio/x-matroska": ["mka"],
759
+ "audio/x-mpegurl": ["m3u"],
760
+ "audio/x-ms-wax": ["wax"],
761
+ "audio/x-ms-wma": ["wma"],
762
+ "audio/x-pn-realaudio": ["ram", "ra"],
763
+ "audio/x-pn-realaudio-plugin": ["rmp"],
764
+ "audio/x-realaudio": ["*ra"],
765
+ "audio/x-wav": ["*wav"],
766
+ "chemical/x-cdx": ["cdx"],
767
+ "chemical/x-cif": ["cif"],
768
+ "chemical/x-cmdf": ["cmdf"],
769
+ "chemical/x-cml": ["cml"],
770
+ "chemical/x-csml": ["csml"],
771
+ "chemical/x-xyz": ["xyz"],
772
+ "image/prs.btif": ["btif", "btf"],
773
+ "image/prs.pti": ["pti"],
774
+ "image/vnd.adobe.photoshop": ["psd"],
775
+ "image/vnd.airzip.accelerator.azv": ["azv"],
776
+ "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"],
777
+ "image/vnd.djvu": ["djvu", "djv"],
778
+ "image/vnd.dvb.subtitle": ["*sub"],
779
+ "image/vnd.dwg": ["dwg"],
780
+ "image/vnd.dxf": ["dxf"],
781
+ "image/vnd.fastbidsheet": ["fbs"],
782
+ "image/vnd.fpx": ["fpx"],
783
+ "image/vnd.fst": ["fst"],
784
+ "image/vnd.fujixerox.edmics-mmr": ["mmr"],
785
+ "image/vnd.fujixerox.edmics-rlc": ["rlc"],
786
+ "image/vnd.microsoft.icon": ["ico"],
787
+ "image/vnd.ms-dds": ["dds"],
788
+ "image/vnd.ms-modi": ["mdi"],
789
+ "image/vnd.ms-photo": ["wdp"],
790
+ "image/vnd.net-fpx": ["npx"],
791
+ "image/vnd.pco.b16": ["b16"],
792
+ "image/vnd.tencent.tap": ["tap"],
793
+ "image/vnd.valve.source.texture": ["vtf"],
794
+ "image/vnd.wap.wbmp": ["wbmp"],
795
+ "image/vnd.xiff": ["xif"],
796
+ "image/vnd.zbrush.pcx": ["pcx"],
797
+ "image/x-3ds": ["3ds"],
798
+ "image/x-adobe-dng": ["dng"],
799
+ "image/x-cmu-raster": ["ras"],
800
+ "image/x-cmx": ["cmx"],
801
+ "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"],
802
+ "image/x-icon": ["*ico"],
803
+ "image/x-jng": ["jng"],
804
+ "image/x-mrsid-image": ["sid"],
805
+ "image/x-ms-bmp": ["*bmp"],
806
+ "image/x-pcx": ["*pcx"],
807
+ "image/x-pict": ["pic", "pct"],
808
+ "image/x-portable-anymap": ["pnm"],
809
+ "image/x-portable-bitmap": ["pbm"],
810
+ "image/x-portable-graymap": ["pgm"],
811
+ "image/x-portable-pixmap": ["ppm"],
812
+ "image/x-rgb": ["rgb"],
813
+ "image/x-tga": ["tga"],
814
+ "image/x-xbitmap": ["xbm"],
815
+ "image/x-xpixmap": ["xpm"],
816
+ "image/x-xwindowdump": ["xwd"],
817
+ "message/vnd.wfa.wsc": ["wsc"],
818
+ "model/vnd.bary": ["bary"],
819
+ "model/vnd.cld": ["cld"],
820
+ "model/vnd.collada+xml": ["dae"],
821
+ "model/vnd.dwf": ["dwf"],
822
+ "model/vnd.gdl": ["gdl"],
823
+ "model/vnd.gtw": ["gtw"],
824
+ "model/vnd.mts": ["*mts"],
825
+ "model/vnd.opengex": ["ogex"],
826
+ "model/vnd.parasolid.transmit.binary": ["x_b"],
827
+ "model/vnd.parasolid.transmit.text": ["x_t"],
828
+ "model/vnd.pytha.pyox": ["pyo", "pyox"],
829
+ "model/vnd.sap.vds": ["vds"],
830
+ "model/vnd.usda": ["usda"],
831
+ "model/vnd.usdz+zip": ["usdz"],
832
+ "model/vnd.valve.source.compiled-map": ["bsp"],
833
+ "model/vnd.vtu": ["vtu"],
834
+ "text/prs.lines.tag": ["dsc"],
835
+ "text/vnd.curl": ["curl"],
836
+ "text/vnd.curl.dcurl": ["dcurl"],
837
+ "text/vnd.curl.mcurl": ["mcurl"],
838
+ "text/vnd.curl.scurl": ["scurl"],
839
+ "text/vnd.dvb.subtitle": ["sub"],
840
+ "text/vnd.familysearch.gedcom": ["ged"],
841
+ "text/vnd.fly": ["fly"],
842
+ "text/vnd.fmi.flexstor": ["flx"],
843
+ "text/vnd.graphviz": ["gv"],
844
+ "text/vnd.in3d.3dml": ["3dml"],
845
+ "text/vnd.in3d.spot": ["spot"],
846
+ "text/vnd.sun.j2me.app-descriptor": ["jad"],
847
+ "text/vnd.wap.wml": ["wml"],
848
+ "text/vnd.wap.wmlscript": ["wmls"],
849
+ "text/x-asm": ["s", "asm"],
850
+ "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"],
851
+ "text/x-component": ["htc"],
852
+ "text/x-fortran": ["f", "for", "f77", "f90"],
853
+ "text/x-handlebars-template": ["hbs"],
854
+ "text/x-java-source": ["java"],
855
+ "text/x-lua": ["lua"],
856
+ "text/x-markdown": ["mkd"],
857
+ "text/x-nfo": ["nfo"],
858
+ "text/x-opml": ["opml"],
859
+ "text/x-org": ["*org"],
860
+ "text/x-pascal": ["p", "pas"],
861
+ "text/x-processing": ["pde"],
862
+ "text/x-sass": ["sass"],
863
+ "text/x-scss": ["scss"],
864
+ "text/x-setext": ["etx"],
865
+ "text/x-sfv": ["sfv"],
866
+ "text/x-suse-ymp": ["ymp"],
867
+ "text/x-uuencode": ["uu"],
868
+ "text/x-vcalendar": ["vcs"],
869
+ "text/x-vcard": ["vcf"],
870
+ "video/vnd.dece.hd": ["uvh", "uvvh"],
871
+ "video/vnd.dece.mobile": ["uvm", "uvvm"],
872
+ "video/vnd.dece.pd": ["uvp", "uvvp"],
873
+ "video/vnd.dece.sd": ["uvs", "uvvs"],
874
+ "video/vnd.dece.video": ["uvv", "uvvv"],
875
+ "video/vnd.dvb.file": ["dvb"],
876
+ "video/vnd.fvt": ["fvt"],
877
+ "video/vnd.mpegurl": ["mxu", "m4u"],
878
+ "video/vnd.ms-playready.media.pyv": ["pyv"],
879
+ "video/vnd.uvvu.mp4": ["uvu", "uvvu"],
880
+ "video/vnd.vivo": ["viv"],
881
+ "video/x-f4v": ["f4v"],
882
+ "video/x-fli": ["fli"],
883
+ "video/x-flv": ["flv"],
884
+ "video/x-m4v": ["m4v"],
885
+ "video/x-matroska": ["mkv", "mk3d", "mks"],
886
+ "video/x-mng": ["mng"],
887
+ "video/x-ms-asf": ["asf", "asx"],
888
+ "video/x-ms-vob": ["vob"],
889
+ "video/x-ms-wm": ["wm"],
890
+ "video/x-ms-wmv": ["wmv"],
891
+ "video/x-ms-wmx": ["wmx"],
892
+ "video/x-ms-wvx": ["wvx"],
893
+ "video/x-msvideo": ["avi"],
894
+ "video/x-sgi-movie": ["movie"],
895
+ "video/x-smv": ["smv"],
896
+ "x-conference/x-cooltalk": ["ice"]
897
+ };
898
+ Object.freeze(types);
899
+ var other_default = types;
900
+
901
+ // ../../node_modules/mime/dist/types/standard.js
902
+ init_esm_shims();
903
+ var types2 = {
904
+ "application/andrew-inset": ["ez"],
905
+ "application/appinstaller": ["appinstaller"],
906
+ "application/applixware": ["aw"],
907
+ "application/appx": ["appx"],
908
+ "application/appxbundle": ["appxbundle"],
909
+ "application/atom+xml": ["atom"],
910
+ "application/atomcat+xml": ["atomcat"],
911
+ "application/atomdeleted+xml": ["atomdeleted"],
912
+ "application/atomsvc+xml": ["atomsvc"],
913
+ "application/atsc-dwd+xml": ["dwd"],
914
+ "application/atsc-held+xml": ["held"],
915
+ "application/atsc-rsat+xml": ["rsat"],
916
+ "application/automationml-aml+xml": ["aml"],
917
+ "application/automationml-amlx+zip": ["amlx"],
918
+ "application/bdoc": ["bdoc"],
919
+ "application/calendar+xml": ["xcs"],
920
+ "application/ccxml+xml": ["ccxml"],
921
+ "application/cdfx+xml": ["cdfx"],
922
+ "application/cdmi-capability": ["cdmia"],
923
+ "application/cdmi-container": ["cdmic"],
924
+ "application/cdmi-domain": ["cdmid"],
925
+ "application/cdmi-object": ["cdmio"],
926
+ "application/cdmi-queue": ["cdmiq"],
927
+ "application/cpl+xml": ["cpl"],
928
+ "application/cu-seeme": ["cu"],
929
+ "application/cwl": ["cwl"],
930
+ "application/dash+xml": ["mpd"],
931
+ "application/dash-patch+xml": ["mpp"],
932
+ "application/davmount+xml": ["davmount"],
933
+ "application/dicom": ["dcm"],
934
+ "application/docbook+xml": ["dbk"],
935
+ "application/dssc+der": ["dssc"],
936
+ "application/dssc+xml": ["xdssc"],
937
+ "application/ecmascript": ["ecma"],
938
+ "application/emma+xml": ["emma"],
939
+ "application/emotionml+xml": ["emotionml"],
940
+ "application/epub+zip": ["epub"],
941
+ "application/exi": ["exi"],
942
+ "application/express": ["exp"],
943
+ "application/fdf": ["fdf"],
944
+ "application/fdt+xml": ["fdt"],
945
+ "application/font-tdpfr": ["pfr"],
946
+ "application/geo+json": ["geojson"],
947
+ "application/gml+xml": ["gml"],
948
+ "application/gpx+xml": ["gpx"],
949
+ "application/gxf": ["gxf"],
950
+ "application/gzip": ["gz"],
951
+ "application/hjson": ["hjson"],
952
+ "application/hyperstudio": ["stk"],
953
+ "application/inkml+xml": ["ink", "inkml"],
954
+ "application/ipfix": ["ipfix"],
955
+ "application/its+xml": ["its"],
956
+ "application/java-archive": ["jar", "war", "ear"],
957
+ "application/java-serialized-object": ["ser"],
958
+ "application/java-vm": ["class"],
959
+ "application/javascript": ["*js"],
960
+ "application/json": ["json", "map"],
961
+ "application/json5": ["json5"],
962
+ "application/jsonml+json": ["jsonml"],
963
+ "application/ld+json": ["jsonld"],
964
+ "application/lgr+xml": ["lgr"],
965
+ "application/lost+xml": ["lostxml"],
966
+ "application/mac-binhex40": ["hqx"],
967
+ "application/mac-compactpro": ["cpt"],
968
+ "application/mads+xml": ["mads"],
969
+ "application/manifest+json": ["webmanifest"],
970
+ "application/marc": ["mrc"],
971
+ "application/marcxml+xml": ["mrcx"],
972
+ "application/mathematica": ["ma", "nb", "mb"],
973
+ "application/mathml+xml": ["mathml"],
974
+ "application/mbox": ["mbox"],
975
+ "application/media-policy-dataset+xml": ["mpf"],
976
+ "application/mediaservercontrol+xml": ["mscml"],
977
+ "application/metalink+xml": ["metalink"],
978
+ "application/metalink4+xml": ["meta4"],
979
+ "application/mets+xml": ["mets"],
980
+ "application/mmt-aei+xml": ["maei"],
981
+ "application/mmt-usd+xml": ["musd"],
982
+ "application/mods+xml": ["mods"],
983
+ "application/mp21": ["m21", "mp21"],
984
+ "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"],
985
+ "application/msix": ["msix"],
986
+ "application/msixbundle": ["msixbundle"],
987
+ "application/msword": ["doc", "dot"],
988
+ "application/mxf": ["mxf"],
989
+ "application/n-quads": ["nq"],
990
+ "application/n-triples": ["nt"],
991
+ "application/node": ["cjs"],
992
+ "application/octet-stream": [
993
+ "bin",
994
+ "dms",
995
+ "lrf",
996
+ "mar",
997
+ "so",
998
+ "dist",
999
+ "distz",
1000
+ "pkg",
1001
+ "bpk",
1002
+ "dump",
1003
+ "elc",
1004
+ "deploy",
1005
+ "exe",
1006
+ "dll",
1007
+ "deb",
1008
+ "dmg",
1009
+ "iso",
1010
+ "img",
1011
+ "msi",
1012
+ "msp",
1013
+ "msm",
1014
+ "buffer"
1015
+ ],
1016
+ "application/oda": ["oda"],
1017
+ "application/oebps-package+xml": ["opf"],
1018
+ "application/ogg": ["ogx"],
1019
+ "application/omdoc+xml": ["omdoc"],
1020
+ "application/onenote": [
1021
+ "onetoc",
1022
+ "onetoc2",
1023
+ "onetmp",
1024
+ "onepkg",
1025
+ "one",
1026
+ "onea"
1027
+ ],
1028
+ "application/oxps": ["oxps"],
1029
+ "application/p2p-overlay+xml": ["relo"],
1030
+ "application/patch-ops-error+xml": ["xer"],
1031
+ "application/pdf": ["pdf"],
1032
+ "application/pgp-encrypted": ["pgp"],
1033
+ "application/pgp-keys": ["asc"],
1034
+ "application/pgp-signature": ["sig", "*asc"],
1035
+ "application/pics-rules": ["prf"],
1036
+ "application/pkcs10": ["p10"],
1037
+ "application/pkcs7-mime": ["p7m", "p7c"],
1038
+ "application/pkcs7-signature": ["p7s"],
1039
+ "application/pkcs8": ["p8"],
1040
+ "application/pkix-attr-cert": ["ac"],
1041
+ "application/pkix-cert": ["cer"],
1042
+ "application/pkix-crl": ["crl"],
1043
+ "application/pkix-pkipath": ["pkipath"],
1044
+ "application/pkixcmp": ["pki"],
1045
+ "application/pls+xml": ["pls"],
1046
+ "application/postscript": ["ai", "eps", "ps"],
1047
+ "application/provenance+xml": ["provx"],
1048
+ "application/pskc+xml": ["pskcxml"],
1049
+ "application/raml+yaml": ["raml"],
1050
+ "application/rdf+xml": ["rdf", "owl"],
1051
+ "application/reginfo+xml": ["rif"],
1052
+ "application/relax-ng-compact-syntax": ["rnc"],
1053
+ "application/resource-lists+xml": ["rl"],
1054
+ "application/resource-lists-diff+xml": ["rld"],
1055
+ "application/rls-services+xml": ["rs"],
1056
+ "application/route-apd+xml": ["rapd"],
1057
+ "application/route-s-tsid+xml": ["sls"],
1058
+ "application/route-usd+xml": ["rusd"],
1059
+ "application/rpki-ghostbusters": ["gbr"],
1060
+ "application/rpki-manifest": ["mft"],
1061
+ "application/rpki-roa": ["roa"],
1062
+ "application/rsd+xml": ["rsd"],
1063
+ "application/rss+xml": ["rss"],
1064
+ "application/rtf": ["rtf"],
1065
+ "application/sbml+xml": ["sbml"],
1066
+ "application/scvp-cv-request": ["scq"],
1067
+ "application/scvp-cv-response": ["scs"],
1068
+ "application/scvp-vp-request": ["spq"],
1069
+ "application/scvp-vp-response": ["spp"],
1070
+ "application/sdp": ["sdp"],
1071
+ "application/senml+xml": ["senmlx"],
1072
+ "application/sensml+xml": ["sensmlx"],
1073
+ "application/set-payment-initiation": ["setpay"],
1074
+ "application/set-registration-initiation": ["setreg"],
1075
+ "application/shf+xml": ["shf"],
1076
+ "application/sieve": ["siv", "sieve"],
1077
+ "application/smil+xml": ["smi", "smil"],
1078
+ "application/sparql-query": ["rq"],
1079
+ "application/sparql-results+xml": ["srx"],
1080
+ "application/sql": ["sql"],
1081
+ "application/srgs": ["gram"],
1082
+ "application/srgs+xml": ["grxml"],
1083
+ "application/sru+xml": ["sru"],
1084
+ "application/ssdl+xml": ["ssdl"],
1085
+ "application/ssml+xml": ["ssml"],
1086
+ "application/swid+xml": ["swidtag"],
1087
+ "application/tei+xml": ["tei", "teicorpus"],
1088
+ "application/thraud+xml": ["tfi"],
1089
+ "application/timestamped-data": ["tsd"],
1090
+ "application/toml": ["toml"],
1091
+ "application/trig": ["trig"],
1092
+ "application/ttml+xml": ["ttml"],
1093
+ "application/ubjson": ["ubj"],
1094
+ "application/urc-ressheet+xml": ["rsheet"],
1095
+ "application/urc-targetdesc+xml": ["td"],
1096
+ "application/voicexml+xml": ["vxml"],
1097
+ "application/wasm": ["wasm"],
1098
+ "application/watcherinfo+xml": ["wif"],
1099
+ "application/widget": ["wgt"],
1100
+ "application/winhlp": ["hlp"],
1101
+ "application/wsdl+xml": ["wsdl"],
1102
+ "application/wspolicy+xml": ["wspolicy"],
1103
+ "application/xaml+xml": ["xaml"],
1104
+ "application/xcap-att+xml": ["xav"],
1105
+ "application/xcap-caps+xml": ["xca"],
1106
+ "application/xcap-diff+xml": ["xdf"],
1107
+ "application/xcap-el+xml": ["xel"],
1108
+ "application/xcap-ns+xml": ["xns"],
1109
+ "application/xenc+xml": ["xenc"],
1110
+ "application/xfdf": ["xfdf"],
1111
+ "application/xhtml+xml": ["xhtml", "xht"],
1112
+ "application/xliff+xml": ["xlf"],
1113
+ "application/xml": ["xml", "xsl", "xsd", "rng"],
1114
+ "application/xml-dtd": ["dtd"],
1115
+ "application/xop+xml": ["xop"],
1116
+ "application/xproc+xml": ["xpl"],
1117
+ "application/xslt+xml": ["*xsl", "xslt"],
1118
+ "application/xspf+xml": ["xspf"],
1119
+ "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"],
1120
+ "application/yang": ["yang"],
1121
+ "application/yin+xml": ["yin"],
1122
+ "application/zip": ["zip"],
1123
+ "application/zip+dotlottie": ["lottie"],
1124
+ "audio/3gpp": ["*3gpp"],
1125
+ "audio/aac": ["adts", "aac"],
1126
+ "audio/adpcm": ["adp"],
1127
+ "audio/amr": ["amr"],
1128
+ "audio/basic": ["au", "snd"],
1129
+ "audio/midi": ["mid", "midi", "kar", "rmi"],
1130
+ "audio/mobile-xmf": ["mxmf"],
1131
+ "audio/mp3": ["*mp3"],
1132
+ "audio/mp4": ["m4a", "mp4a", "m4b"],
1133
+ "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"],
1134
+ "audio/ogg": ["oga", "ogg", "spx", "opus"],
1135
+ "audio/s3m": ["s3m"],
1136
+ "audio/silk": ["sil"],
1137
+ "audio/wav": ["wav"],
1138
+ "audio/wave": ["*wav"],
1139
+ "audio/webm": ["weba"],
1140
+ "audio/xm": ["xm"],
1141
+ "font/collection": ["ttc"],
1142
+ "font/otf": ["otf"],
1143
+ "font/ttf": ["ttf"],
1144
+ "font/woff": ["woff"],
1145
+ "font/woff2": ["woff2"],
1146
+ "image/aces": ["exr"],
1147
+ "image/apng": ["apng"],
1148
+ "image/avci": ["avci"],
1149
+ "image/avcs": ["avcs"],
1150
+ "image/avif": ["avif"],
1151
+ "image/bmp": ["bmp", "dib"],
1152
+ "image/cgm": ["cgm"],
1153
+ "image/dicom-rle": ["drle"],
1154
+ "image/dpx": ["dpx"],
1155
+ "image/emf": ["emf"],
1156
+ "image/fits": ["fits"],
1157
+ "image/g3fax": ["g3"],
1158
+ "image/gif": ["gif"],
1159
+ "image/heic": ["heic"],
1160
+ "image/heic-sequence": ["heics"],
1161
+ "image/heif": ["heif"],
1162
+ "image/heif-sequence": ["heifs"],
1163
+ "image/hej2k": ["hej2"],
1164
+ "image/ief": ["ief"],
1165
+ "image/jaii": ["jaii"],
1166
+ "image/jais": ["jais"],
1167
+ "image/jls": ["jls"],
1168
+ "image/jp2": ["jp2", "jpg2"],
1169
+ "image/jpeg": ["jpg", "jpeg", "jpe"],
1170
+ "image/jph": ["jph"],
1171
+ "image/jphc": ["jhc"],
1172
+ "image/jpm": ["jpm", "jpgm"],
1173
+ "image/jpx": ["jpx", "jpf"],
1174
+ "image/jxl": ["jxl"],
1175
+ "image/jxr": ["jxr"],
1176
+ "image/jxra": ["jxra"],
1177
+ "image/jxrs": ["jxrs"],
1178
+ "image/jxs": ["jxs"],
1179
+ "image/jxsc": ["jxsc"],
1180
+ "image/jxsi": ["jxsi"],
1181
+ "image/jxss": ["jxss"],
1182
+ "image/ktx": ["ktx"],
1183
+ "image/ktx2": ["ktx2"],
1184
+ "image/pjpeg": ["jfif"],
1185
+ "image/png": ["png"],
1186
+ "image/sgi": ["sgi"],
1187
+ "image/svg+xml": ["svg", "svgz"],
1188
+ "image/t38": ["t38"],
1189
+ "image/tiff": ["tif", "tiff"],
1190
+ "image/tiff-fx": ["tfx"],
1191
+ "image/webp": ["webp"],
1192
+ "image/wmf": ["wmf"],
1193
+ "message/disposition-notification": ["disposition-notification"],
1194
+ "message/global": ["u8msg"],
1195
+ "message/global-delivery-status": ["u8dsn"],
1196
+ "message/global-disposition-notification": ["u8mdn"],
1197
+ "message/global-headers": ["u8hdr"],
1198
+ "message/rfc822": ["eml", "mime", "mht", "mhtml"],
1199
+ "model/3mf": ["3mf"],
1200
+ "model/gltf+json": ["gltf"],
1201
+ "model/gltf-binary": ["glb"],
1202
+ "model/iges": ["igs", "iges"],
1203
+ "model/jt": ["jt"],
1204
+ "model/mesh": ["msh", "mesh", "silo"],
1205
+ "model/mtl": ["mtl"],
1206
+ "model/obj": ["obj"],
1207
+ "model/prc": ["prc"],
1208
+ "model/step": ["step", "stp", "stpnc", "p21", "210"],
1209
+ "model/step+xml": ["stpx"],
1210
+ "model/step+zip": ["stpz"],
1211
+ "model/step-xml+zip": ["stpxz"],
1212
+ "model/stl": ["stl"],
1213
+ "model/u3d": ["u3d"],
1214
+ "model/vrml": ["wrl", "vrml"],
1215
+ "model/x3d+binary": ["*x3db", "x3dbz"],
1216
+ "model/x3d+fastinfoset": ["x3db"],
1217
+ "model/x3d+vrml": ["*x3dv", "x3dvz"],
1218
+ "model/x3d+xml": ["x3d", "x3dz"],
1219
+ "model/x3d-vrml": ["x3dv"],
1220
+ "text/cache-manifest": ["appcache", "manifest"],
1221
+ "text/calendar": ["ics", "ifb"],
1222
+ "text/coffeescript": ["coffee", "litcoffee"],
1223
+ "text/css": ["css"],
1224
+ "text/csv": ["csv"],
1225
+ "text/html": ["html", "htm", "shtml"],
1226
+ "text/jade": ["jade"],
1227
+ "text/javascript": ["js", "mjs"],
1228
+ "text/jsx": ["jsx"],
1229
+ "text/less": ["less"],
1230
+ "text/markdown": ["md", "markdown"],
1231
+ "text/mathml": ["mml"],
1232
+ "text/mdx": ["mdx"],
1233
+ "text/n3": ["n3"],
1234
+ "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"],
1235
+ "text/richtext": ["rtx"],
1236
+ "text/rtf": ["*rtf"],
1237
+ "text/sgml": ["sgml", "sgm"],
1238
+ "text/shex": ["shex"],
1239
+ "text/slim": ["slim", "slm"],
1240
+ "text/spdx": ["spdx"],
1241
+ "text/stylus": ["stylus", "styl"],
1242
+ "text/tab-separated-values": ["tsv"],
1243
+ "text/troff": ["t", "tr", "roff", "man", "me", "ms"],
1244
+ "text/turtle": ["ttl"],
1245
+ "text/uri-list": ["uri", "uris", "urls"],
1246
+ "text/vcard": ["vcard"],
1247
+ "text/vtt": ["vtt"],
1248
+ "text/wgsl": ["wgsl"],
1249
+ "text/xml": ["*xml"],
1250
+ "text/yaml": ["yaml", "yml"],
1251
+ "video/3gpp": ["3gp", "3gpp"],
1252
+ "video/3gpp2": ["3g2"],
1253
+ "video/h261": ["h261"],
1254
+ "video/h263": ["h263"],
1255
+ "video/h264": ["h264"],
1256
+ "video/iso.segment": ["m4s"],
1257
+ "video/jpeg": ["jpgv"],
1258
+ "video/jpm": ["*jpm", "*jpgm"],
1259
+ "video/mj2": ["mj2", "mjp2"],
1260
+ "video/mp2t": ["ts", "m2t", "m2ts", "mts"],
1261
+ "video/mp4": ["mp4", "mp4v", "mpg4"],
1262
+ "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"],
1263
+ "video/ogg": ["ogv"],
1264
+ "video/quicktime": ["qt", "mov"],
1265
+ "video/webm": ["webm"]
1266
+ };
1267
+ Object.freeze(types2);
1268
+ var standard_default = types2;
1269
+
1270
+ // ../../node_modules/mime/dist/src/Mime.js
1271
+ init_esm_shims();
1272
+ var __classPrivateFieldGet = function(receiver, state, kind, f) {
1273
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
1274
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1275
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1276
+ };
1277
+ var _Mime_extensionToType;
1278
+ var _Mime_typeToExtension;
1279
+ var _Mime_typeToExtensions;
1280
+ var Mime = class {
1281
+ constructor(...args) {
1282
+ _Mime_extensionToType.set(this, /* @__PURE__ */ new Map());
1283
+ _Mime_typeToExtension.set(this, /* @__PURE__ */ new Map());
1284
+ _Mime_typeToExtensions.set(this, /* @__PURE__ */ new Map());
1285
+ for (const arg of args) {
1286
+ this.define(arg);
1287
+ }
1288
+ }
1289
+ define(typeMap, force = false) {
1290
+ for (let [type, extensions] of Object.entries(typeMap)) {
1291
+ type = type.toLowerCase();
1292
+ extensions = extensions.map((ext) => ext.toLowerCase());
1293
+ if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").has(type)) {
1294
+ __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").set(type, /* @__PURE__ */ new Set());
1295
+ }
1296
+ const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type);
1297
+ let first = true;
1298
+ for (let extension of extensions) {
1299
+ const starred = extension.startsWith("*");
1300
+ extension = starred ? extension.slice(1) : extension;
1301
+ allExtensions?.add(extension);
1302
+ if (first) {
1303
+ __classPrivateFieldGet(this, _Mime_typeToExtension, "f").set(type, extension);
1304
+ }
1305
+ first = false;
1306
+ if (starred)
1307
+ continue;
1308
+ const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(extension);
1309
+ if (currentType && currentType != type && !force) {
1310
+ throw new Error(`"${type} -> ${extension}" conflicts with "${currentType} -> ${extension}". Pass \`force=true\` to override this definition.`);
1311
+ }
1312
+ __classPrivateFieldGet(this, _Mime_extensionToType, "f").set(extension, type);
1313
+ }
1314
+ }
1315
+ return this;
1316
+ }
1317
+ getType(path) {
1318
+ if (typeof path !== "string")
1319
+ return null;
1320
+ const last = path.replace(/^.*[/\\]/s, "").toLowerCase();
1321
+ const ext = last.replace(/^.*\./s, "").toLowerCase();
1322
+ const hasPath = last.length < path.length;
1323
+ const hasDot = ext.length < last.length - 1;
1324
+ if (!hasDot && hasPath)
1325
+ return null;
1326
+ return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
1327
+ }
1328
+ getExtension(type) {
1329
+ if (typeof type !== "string")
1330
+ return null;
1331
+ type = type?.split?.(";")[0];
1332
+ return (type && __classPrivateFieldGet(this, _Mime_typeToExtension, "f").get(type.trim().toLowerCase())) ?? null;
1333
+ }
1334
+ getAllExtensions(type) {
1335
+ if (typeof type !== "string")
1336
+ return null;
1337
+ return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type.toLowerCase()) ?? null;
1338
+ }
1339
+ _freeze() {
1340
+ this.define = () => {
1341
+ throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
1342
+ };
1343
+ Object.freeze(this);
1344
+ for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").values()) {
1345
+ Object.freeze(extensions);
1346
+ }
1347
+ return this;
1348
+ }
1349
+ _getTestState() {
1350
+ return {
1351
+ types: __classPrivateFieldGet(this, _Mime_extensionToType, "f"),
1352
+ extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, "f")
1353
+ };
1354
+ }
1355
+ };
1356
+ _Mime_extensionToType = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtension = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtensions = /* @__PURE__ */ new WeakMap();
1357
+ var Mime_default = Mime;
1358
+
1359
+ // ../../node_modules/mime/dist/src/index.js
1360
+ var src_default = new Mime_default(standard_default, other_default)._freeze();
1361
+
1362
+ // ../cli-astro-commands/src/components/PreviewCommand/hooks/useUploadClientFiles.ts
1363
+ function useUploadClientFiles() {
1364
+ const {
1365
+ model: {
1366
+ config: { projectId }
1367
+ }
1368
+ } = useProjectModel();
1369
+ const wixtro = useWixstroClient();
1370
+ return useAsyncCallback(
1371
+ async (_, files) => {
1372
+ const filesWithHash = await Promise.all(
1373
+ files.map(async (file) => {
1374
+ const { hash, size } = await getFileMD5AndSize(file.path);
1375
+ return { ...file, hash, size };
1376
+ })
1377
+ );
1378
+ const result = await wixtro.createUploadManifest({
1379
+ projectId,
1380
+ manifest: Object.fromEntries(
1381
+ filesWithHash.map(({ hash, size, relativePath }) => [
1382
+ `/${relativePath}`,
1383
+ { hash, size }
1384
+ ])
1385
+ )
1386
+ });
1387
+ if (result.buckets.length === 0) {
1388
+ return {
1389
+ deploymentToken: result.deploymentToken,
1390
+ completionToken: result.jwt
1391
+ };
1392
+ }
1393
+ const hashToFileMap = Object.fromEntries(
1394
+ filesWithHash.map(({ hash, relativePath, path }) => [
1395
+ hash,
1396
+ { relativePath, path }
1397
+ ])
1398
+ );
1399
+ let lastBucketResult;
1400
+ const limit = pLimit(3);
1401
+ const uploadPromises = result.buckets.map(
1402
+ (bucket) => limit(async () => {
1403
+ const bucketResult = await uploadSingleBucket(
1404
+ result.jwt,
1405
+ result.uploadEndpointURL,
1406
+ bucket.map(({ serverHash, clientHash }) => {
1407
+ const file = hashToFileMap[clientHash];
1408
+ if (!file) {
1409
+ throw new Error(`Unknown client file hash: ${clientHash}`);
1410
+ }
1411
+ return {
1412
+ fileAbsolutePath: file.path,
1413
+ fileHash: serverHash,
1414
+ fileMime: src_default.getType(file.relativePath) ?? "application/octet-stream"
1415
+ };
1416
+ })
1417
+ );
1418
+ if (bucketResult) {
1419
+ lastBucketResult = bucketResult;
1420
+ }
1421
+ return bucketResult;
1422
+ })
1423
+ );
1424
+ await Promise.all(uploadPromises);
1425
+ if (!lastBucketResult) {
1426
+ throw new Error("Failed to upload assets to completion");
1427
+ }
1428
+ return {
1429
+ completionToken: lastBucketResult,
1430
+ deploymentToken: result.deploymentToken
1431
+ };
1432
+ }
1433
+ );
1434
+ }
1435
+ async function getFileMD5AndSize(filePath) {
1436
+ return new Promise((resolve, reject) => {
1437
+ const hash = crypto.createHash("md5");
1438
+ const stream = fs.createReadStream(filePath);
1439
+ let size = 0;
1440
+ stream.on("data", (chunk) => {
1441
+ hash.update(chunk);
1442
+ size += chunk.length;
1443
+ });
1444
+ stream.on("end", () => resolve({ hash: hash.digest("hex"), size }));
1445
+ stream.on("error", reject);
1446
+ });
1447
+ }
1448
+ async function uploadSingleBucket(jwt, uploadEndpoint, bucket) {
1449
+ const form = new FormData();
1450
+ for (const file of bucket) {
1451
+ const fileContents = await fs.promises.readFile(file.fileAbsolutePath);
1452
+ form.append(
1453
+ file.fileHash,
1454
+ new File([fileContents.toString("base64")], file.fileHash, {
1455
+ type: file.fileMime
1456
+ // Modify Content-Type header based on type of file
1457
+ }),
1458
+ file.fileHash
1459
+ );
1460
+ }
1461
+ const response = await fetch(uploadEndpoint, {
1462
+ method: "POST",
1463
+ headers: {
1464
+ Authorization: `Bearer ${jwt}`
1465
+ },
1466
+ body: form
1467
+ });
1468
+ if (!response.ok) {
1469
+ throw new Error(
1470
+ `Failed to upload bucket: ${response.status} - ${response.statusText} ${await response.text()}`
1471
+ );
1472
+ }
1473
+ const data = await response.json();
1474
+ if (data.result.jwt) {
1475
+ return data.result.jwt;
1476
+ }
1477
+ }
1478
+
1479
+ // ../cli-astro-commands/src/components/PreviewCommand/hooks/useUploadServerFiles.ts
1480
+ init_esm_shims();
1481
+ import fs2 from "node:fs/promises";
1482
+ function useUploadServerFiles() {
1483
+ const {
1484
+ model: {
1485
+ config: { projectId }
1486
+ }
1487
+ } = useProjectModel();
1488
+ const wixstroClient = useWixstroClient();
1489
+ return useAsyncCallback(
1490
+ async (_, files, tokens, environment) => {
1491
+ const toBlob = (buffer, mimeType) => new Blob([buffer], { type: mimeType });
1492
+ const filesWithBuffer = await Promise.all(
1493
+ files.map(async (file) => {
1494
+ const buffer = await fs2.readFile(file.path);
1495
+ return { ...file, buffer };
1496
+ })
1497
+ );
1498
+ const formData = new FormData();
1499
+ const metadataBlob = new Blob(
1500
+ [
1501
+ JSON.stringify({
1502
+ environment,
1503
+ deploymentToken: tokens.deploymentToken,
1504
+ jwtCompletionToken: tokens.completionToken
1505
+ })
1506
+ ],
1507
+ { type: "application/json" }
1508
+ );
1509
+ formData.append("metadata", metadataBlob);
1510
+ for (const file of filesWithBuffer) {
1511
+ formData.append(
1512
+ `worker/${file.relativePath}`,
1513
+ toBlob(
1514
+ file.buffer,
1515
+ src_default.getType(file.path) ?? "application/octet-stream"
1516
+ )
1517
+ );
1518
+ }
1519
+ const deployResult = await wixstroClient.deployV2({
1520
+ projectId,
1521
+ formData
1522
+ });
1523
+ return deployResult;
1524
+ }
1525
+ );
1526
+ }
1527
+
1528
+ // ../cli-astro-commands/src/components/PreviewCommand/Preview.tsx
1529
+ var Preview = ({ environment, baseUrl, onPreviewCreated }) => {
1530
+ const { model } = useProjectModel();
1531
+ const arm = useARMClient();
1532
+ const loadBuildFiles = useLoadBuildFiles();
1533
+ const uploadClientFiles = useUploadClientFiles();
1534
+ const uploadServerFiles = useUploadServerFiles();
1535
+ const updateDeploymentTopology = useUpdateDeploymentTopology();
1536
+ const updateManifest = useUpdateManifest();
1537
+ const uploadApplicationAction = useAsyncCallback(
1538
+ async (_, baseUrl2) => {
1539
+ const buildFiles = await loadBuildFiles.execute();
1540
+ const { deploymentToken, completionToken } = await uploadClientFiles.execute(buildFiles.client);
1541
+ const result = await uploadServerFiles.execute(
1542
+ buildFiles.server,
1543
+ { deploymentToken, completionToken },
1544
+ environment
1545
+ );
1546
+ return baseUrl2 ?? `https://${result.domain}/`;
1547
+ }
1548
+ );
1549
+ const createPreviewTagAction = useAsyncCallback(
1550
+ async (_, serverUrl) => {
1551
+ const manifest = await readAppManifestFile(model.projectFolder);
1552
+ const updatedManifest = updateManifest(manifest, serverUrl);
1553
+ return arm.createAppRelease(updatedManifest, model.config.projectId);
1554
+ }
1555
+ );
1556
+ const { status: createPreviewStatus } = useAsync(async () => {
1557
+ await assertBuildOutputExists(model.projectFolder);
1558
+ const serverUrl = await uploadApplicationAction.execute(baseUrl);
1559
+ const armTag = await createPreviewTagAction.execute(serverUrl);
1560
+ await updateDeploymentTopology.execute({
1561
+ serverUrl,
1562
+ armTag,
1563
+ environment
1564
+ });
1565
+ onPreviewCreated?.({ armTag, serverUrl });
1566
+ return { armTag, serverUrl };
1567
+ }, []);
1568
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement(
1569
+ ActionStatus,
1570
+ {
1571
+ status: uploadApplicationAction.status,
1572
+ loadingText: "Uploading your application files...",
1573
+ successText: "Uploaded successfully!"
1574
+ }
1575
+ ), /* @__PURE__ */ import_react2.default.createElement(
1576
+ ActionStatus,
1577
+ {
1578
+ status: createPreviewTagAction.status,
1579
+ loadingText: "Creating a preview...",
1580
+ successText: "Preview created successfully!"
1581
+ }
1582
+ ), /* @__PURE__ */ import_react2.default.createElement(
1583
+ ActionStatus,
1584
+ {
1585
+ status: updateDeploymentTopology.status,
1586
+ loadingText: "Updating deployment topology manifest...",
1587
+ successText: "Deployment topology manifest updated successfully!"
1588
+ }
1589
+ ), (0, import_variant2.match)(createPreviewStatus, {
1590
+ Error: () => null,
1591
+ Loading: () => null,
1592
+ Success: ({ result: { armTag, serverUrl } }) => /* @__PURE__ */ import_react2.default.createElement(Box_default, { rowGap: 1, marginY: 1, flexDirection: "column" }, /* @__PURE__ */ import_react2.default.createElement(Text, null, "Open the preview on:"), /* @__PURE__ */ import_react2.default.createElement(Box_default, { paddingLeft: 2, flexDirection: "column" }, /* @__PURE__ */ import_react2.default.createElement(PlatformLink, { url: serverUrl, label: "Site" }), /* @__PURE__ */ import_react2.default.createElement(
1593
+ PlatformLink,
1594
+ {
1595
+ url: `https://manage.wix.com/dashboard/${model.config.siteId}?apps-override=${armTag}`,
1596
+ label: "Dashboard"
1597
+ }
1598
+ )))
1599
+ }));
1600
+ };
1601
+
1602
+ // ../cli-astro-commands/src/components/PreviewCommand/PreviewCommand.tsx
1603
+ var PreviewCommand = ({ environment, baseUrl, onPreviewCreated }) => {
1604
+ const {
1605
+ model: {
1606
+ config: { siteId }
1607
+ }
1608
+ } = useProjectModel();
1609
+ return /* @__PURE__ */ import_react3.default.createElement(SiteAuthProvider, { siteId }, /* @__PURE__ */ import_react3.default.createElement(
1610
+ Preview,
1611
+ {
1612
+ baseUrl,
1613
+ onPreviewCreated,
1614
+ environment
1615
+ }
1616
+ ));
1617
+ };
1618
+
1619
+ export {
1620
+ assertBuildOutputExists,
1621
+ PreviewCommand
1622
+ };
1623
+ //# sourceMappingURL=chunk-LDZEOWUV.js.map