storybook 9.0.0-alpha.0 → 9.0.0-alpha.2

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 (211) hide show
  1. package/README.md +31 -29
  2. package/assets/browser/favicon.svg +1 -0
  3. package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
  4. package/assets/browser/nunito-sans-bold.woff2 +0 -0
  5. package/assets/browser/nunito-sans-italic.woff2 +0 -0
  6. package/assets/browser/nunito-sans-regular.woff2 +0 -0
  7. package/assets/docs/message-reference.png +0 -0
  8. package/assets/server/addon.tsconfig.json +6 -0
  9. package/assets/server/base-preview-body.html +119 -0
  10. package/assets/server/base-preview-head.html +451 -0
  11. package/assets/server/template.ejs +87 -0
  12. package/bin/index.cjs +1 -1
  13. package/dist/babel/index.cjs +54034 -0
  14. package/dist/babel/index.d.ts +7488 -0
  15. package/dist/babel/index.js +54044 -0
  16. package/dist/bin/index.cjs +124 -0
  17. package/dist/bin/index.js +118 -0
  18. package/dist/builder-manager/index.cjs +2167 -0
  19. package/dist/builder-manager/index.d.ts +19 -0
  20. package/dist/builder-manager/index.js +2189 -0
  21. package/dist/channels/index.cjs +1938 -0
  22. package/dist/channels/index.d.ts +108 -0
  23. package/dist/channels/index.js +1885 -0
  24. package/dist/cli/bin/index.cjs +2687 -0
  25. package/dist/cli/bin/index.d.ts +2 -0
  26. package/dist/cli/bin/index.js +2707 -0
  27. package/dist/cli/index.cjs +17327 -0
  28. package/dist/cli/index.d.ts +209 -0
  29. package/dist/cli/index.js +17349 -0
  30. package/dist/client-logger/index.cjs +112 -0
  31. package/dist/client-logger/index.d.ts +29 -0
  32. package/dist/client-logger/index.js +70 -0
  33. package/dist/common/index.cjs +20558 -0
  34. package/dist/common/index.d.ts +955 -0
  35. package/dist/common/index.js +20643 -0
  36. package/dist/components/index.cjs +30056 -0
  37. package/dist/components/index.d.ts +1423 -0
  38. package/dist/components/index.js +25416 -0
  39. package/dist/core-events/index.cjs +167 -0
  40. package/dist/core-events/index.d.ts +313 -0
  41. package/dist/core-events/index.js +149 -0
  42. package/dist/core-server/index.cjs +37872 -0
  43. package/dist/core-server/index.d.ts +462 -0
  44. package/dist/core-server/index.js +37966 -0
  45. package/dist/core-server/presets/common-manager.js +28 -0
  46. package/dist/core-server/presets/common-override-preset.cjs +4824 -0
  47. package/dist/core-server/presets/common-override-preset.js +4829 -0
  48. package/dist/core-server/presets/common-preset.cjs +10228 -0
  49. package/dist/core-server/presets/common-preset.js +10306 -0
  50. package/dist/csf/index.cjs +223 -0
  51. package/dist/csf/index.d.ts +752 -0
  52. package/dist/csf/index.js +216 -0
  53. package/dist/csf-tools/index.cjs +1422 -0
  54. package/dist/csf-tools/index.d.ts +250 -0
  55. package/dist/csf-tools/index.js +1439 -0
  56. package/dist/docs-tools/index.cjs +923 -0
  57. package/dist/docs-tools/index.d.ts +162 -0
  58. package/dist/docs-tools/index.js +909 -0
  59. package/dist/index.cjs +17 -1
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +2 -7
  62. package/dist/instrumenter/index.cjs +3273 -0
  63. package/dist/instrumenter/index.d.ts +104 -0
  64. package/dist/instrumenter/index.js +4800 -0
  65. package/dist/manager/globals-module-info.cjs +666 -0
  66. package/dist/manager/globals-module-info.d.ts +36 -0
  67. package/dist/manager/globals-module-info.js +653 -0
  68. package/dist/manager/globals-runtime.js +41567 -0
  69. package/dist/manager/globals.cjs +43 -0
  70. package/dist/manager/globals.d.ts +21 -0
  71. package/dist/manager/globals.js +30 -0
  72. package/dist/manager/runtime.js +12043 -0
  73. package/dist/manager-api/index.cjs +10772 -0
  74. package/dist/manager-api/index.d.ts +1211 -0
  75. package/dist/manager-api/index.js +4547 -0
  76. package/dist/manager-errors.d.ts +65 -0
  77. package/dist/manager-errors.js +83 -0
  78. package/dist/node-logger/index.cjs +1642 -0
  79. package/dist/node-logger/index.d.ts +117 -0
  80. package/dist/node-logger/index.js +1652 -0
  81. package/dist/preview/globals.cjs +34 -0
  82. package/dist/preview/globals.d.ts +12 -0
  83. package/dist/preview/globals.js +21 -0
  84. package/dist/preview/runtime.js +7723 -0
  85. package/dist/preview-api/index.cjs +5658 -0
  86. package/dist/preview-api/index.d.ts +1356 -0
  87. package/dist/preview-api/index.js +5665 -0
  88. package/dist/preview-errors.cjs +486 -0
  89. package/dist/preview-errors.d.ts +188 -0
  90. package/dist/preview-errors.js +433 -0
  91. package/dist/router/index.cjs +3320 -0
  92. package/dist/router/index.d.ts +385 -0
  93. package/dist/router/index.js +1849 -0
  94. package/dist/server-errors.cjs +710 -0
  95. package/dist/server-errors.d.ts +272 -0
  96. package/dist/server-errors.js +711 -0
  97. package/dist/telemetry/index.cjs +3683 -0
  98. package/dist/telemetry/index.d.ts +112 -0
  99. package/dist/telemetry/index.js +3720 -0
  100. package/dist/theming/create.cjs +2422 -0
  101. package/dist/theming/create.d.ts +50 -0
  102. package/dist/theming/create.js +990 -0
  103. package/dist/theming/index.cjs +4832 -0
  104. package/dist/theming/index.d.ts +11939 -0
  105. package/dist/theming/index.js +3253 -0
  106. package/dist/types/index.cjs +27 -0
  107. package/dist/types/index.d.ts +2541 -0
  108. package/dist/types/index.js +7 -0
  109. package/package.json +308 -212
  110. package/.eslintrc.cjs +0 -31
  111. package/__mocks__/@aw-web-design/x-default-browser.js +0 -2
  112. package/core/babel/index.cjs +0 -1
  113. package/core/babel/index.d.ts +0 -2
  114. package/core/babel/index.js +0 -1
  115. package/core/builder-manager/index.cjs +0 -1
  116. package/core/builder-manager/index.d.ts +0 -2
  117. package/core/builder-manager/index.js +0 -1
  118. package/core/channels/index.cjs +0 -1
  119. package/core/channels/index.d.ts +0 -2
  120. package/core/channels/index.js +0 -1
  121. package/core/cli/bin/index.cjs +0 -1
  122. package/core/cli/bin/index.d.ts +0 -2
  123. package/core/cli/bin/index.js +0 -1
  124. package/core/cli/index.cjs +0 -1
  125. package/core/cli/index.d.ts +0 -2
  126. package/core/cli/index.js +0 -1
  127. package/core/client-logger/index.cjs +0 -1
  128. package/core/client-logger/index.d.ts +0 -2
  129. package/core/client-logger/index.js +0 -1
  130. package/core/common/index.cjs +0 -1
  131. package/core/common/index.d.ts +0 -2
  132. package/core/common/index.js +0 -1
  133. package/core/components/index.cjs +0 -1
  134. package/core/components/index.d.ts +0 -2
  135. package/core/components/index.js +0 -1
  136. package/core/core-events/index.cjs +0 -1
  137. package/core/core-events/index.d.ts +0 -2
  138. package/core/core-events/index.js +0 -1
  139. package/core/core-server/index.cjs +0 -1
  140. package/core/core-server/index.d.ts +0 -2
  141. package/core/core-server/index.js +0 -1
  142. package/core/core-server/presets/common-manager.js +0 -1
  143. package/core/core-server/presets/common-override-preset.cjs +0 -1
  144. package/core/core-server/presets/common-override-preset.js +0 -1
  145. package/core/core-server/presets/common-preset.cjs +0 -1
  146. package/core/core-server/presets/common-preset.js +0 -1
  147. package/core/csf/index.cjs +0 -1
  148. package/core/csf/index.d.ts +0 -2
  149. package/core/csf/index.js +0 -1
  150. package/core/csf-tools/index.cjs +0 -1
  151. package/core/csf-tools/index.d.ts +0 -2
  152. package/core/csf-tools/index.js +0 -1
  153. package/core/docs-tools/index.cjs +0 -1
  154. package/core/docs-tools/index.d.ts +0 -2
  155. package/core/docs-tools/index.js +0 -1
  156. package/core/index.cjs +0 -1
  157. package/core/index.d.ts +0 -2
  158. package/core/index.js +0 -1
  159. package/core/manager/globals-module-info.cjs +0 -1
  160. package/core/manager/globals-module-info.d.ts +0 -2
  161. package/core/manager/globals-module-info.js +0 -1
  162. package/core/manager/globals-runtime.js +0 -1
  163. package/core/manager/globals.cjs +0 -1
  164. package/core/manager/globals.d.ts +0 -2
  165. package/core/manager/globals.js +0 -1
  166. package/core/manager-api/index.cjs +0 -1
  167. package/core/manager-api/index.d.ts +0 -2
  168. package/core/manager-api/index.js +0 -1
  169. package/core/manager-errors.d.ts +0 -2
  170. package/core/manager-errors.js +0 -1
  171. package/core/node-logger/index.cjs +0 -1
  172. package/core/node-logger/index.d.ts +0 -2
  173. package/core/node-logger/index.js +0 -1
  174. package/core/preview/globals.cjs +0 -1
  175. package/core/preview/globals.d.ts +0 -2
  176. package/core/preview/globals.js +0 -1
  177. package/core/preview/runtime.js +0 -1
  178. package/core/preview-api/index.cjs +0 -1
  179. package/core/preview-api/index.d.ts +0 -2
  180. package/core/preview-api/index.js +0 -1
  181. package/core/preview-errors.cjs +0 -1
  182. package/core/preview-errors.d.ts +0 -2
  183. package/core/preview-errors.js +0 -1
  184. package/core/router/index.cjs +0 -1
  185. package/core/router/index.d.ts +0 -2
  186. package/core/router/index.js +0 -1
  187. package/core/server-errors.cjs +0 -1
  188. package/core/server-errors.d.ts +0 -2
  189. package/core/server-errors.js +0 -1
  190. package/core/telemetry/index.cjs +0 -1
  191. package/core/telemetry/index.d.ts +0 -2
  192. package/core/telemetry/index.js +0 -1
  193. package/core/theming/create.cjs +0 -1
  194. package/core/theming/create.d.ts +0 -2
  195. package/core/theming/create.js +0 -1
  196. package/core/theming/index.cjs +0 -1
  197. package/core/theming/index.d.ts +0 -2
  198. package/core/theming/index.js +0 -1
  199. package/core/types/index.cjs +0 -1
  200. package/core/types/index.d.ts +0 -2
  201. package/core/types/index.js +0 -1
  202. package/core.cjs +0 -0
  203. package/core.d.ts +0 -0
  204. package/core.js +0 -1
  205. package/dist/chunk-OWLSIX54.js +0 -8
  206. package/dist/core-path.cjs +0 -1
  207. package/dist/core-path.d.ts +0 -3
  208. package/dist/core-path.js +0 -9
  209. package/dist/proxy.cjs +0 -1
  210. package/dist/proxy.d.ts +0 -2
  211. package/dist/proxy.js +0 -9
@@ -0,0 +1,3720 @@
1
+ import ESM_COMPAT_Module from "node:module";
2
+ import { fileURLToPath as ESM_COMPAT_fileURLToPath } from 'node:url';
3
+ import { dirname as ESM_COMPAT_dirname } from 'node:path';
4
+ const __filename = ESM_COMPAT_fileURLToPath(import.meta.url);
5
+ const __dirname = ESM_COMPAT_dirname(__filename);
6
+ const require = ESM_COMPAT_Module.createRequire(import.meta.url);
7
+ var $i = Object.create;
8
+ var et = Object.defineProperty;
9
+ var qi = Object.getOwnPropertyDescriptor;
10
+ var Wi = Object.getOwnPropertyNames;
11
+ var Hi = Object.getPrototypeOf, Vi = Object.prototype.hasOwnProperty;
12
+ var o = (e, t) => et(e, "name", { value: t, configurable: !0 }), b = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
13
+ "u" ? new Proxy(e, {
14
+ get: (t, r) => (typeof require < "u" ? require : t)[r]
15
+ }) : e)(function(e) {
16
+ if (typeof require < "u") return require.apply(this, arguments);
17
+ throw Error('Dynamic require of "' + e + '" is not supported');
18
+ });
19
+ var p = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
20
+ var zi = (e, t, r, n) => {
21
+ if (t && typeof t == "object" || typeof t == "function")
22
+ for (let i of Wi(t))
23
+ !Vi.call(e, i) && i !== r && et(e, i, { get: () => t[i], enumerable: !(n = qi(t, i)) || n.enumerable });
24
+ return e;
25
+ };
26
+ var R = (e, t, r) => (r = e != null ? $i(Hi(e)) : {}, zi(
27
+ // If the importer is in node compatibility mode or this is not an ESM
28
+ // file that has been converted to a CommonJS file using a Babel-
29
+ // compatible transform (i.e. "__esModule" has not been set), then set
30
+ // "default" to the CommonJS "module.exports" for node compatibility.
31
+ t || !e || !e.__esModule ? et(r, "default", { value: e, enumerable: !0 }) : r,
32
+ e
33
+ ));
34
+
35
+ // ../node_modules/picocolors/picocolors.js
36
+ var dr = p((Dl, tt) => {
37
+ var ue = process || {}, fr = ue.argv || [], ce = ue.env || {}, Ji = !(ce.NO_COLOR || fr.includes("--no-color")) && (!!ce.FORCE_COLOR || fr.
38
+ includes("--color") || ue.platform === "win32" || (ue.stdout || {}).isTTY && ce.TERM !== "dumb" || !!ce.CI), Ki = /* @__PURE__ */ o((e, t, r = e) => (n) => {
39
+ let i = "" + n, s = i.indexOf(t, e.length);
40
+ return ~s ? e + Yi(i, t, r, s) + t : e + i + t;
41
+ }, "formatter"), Yi = /* @__PURE__ */ o((e, t, r, n) => {
42
+ let i = "", s = 0;
43
+ do
44
+ i += e.substring(s, n) + r, s = n + t.length, n = e.indexOf(t, s);
45
+ while (~n);
46
+ return i + e.substring(s);
47
+ }, "replaceClose"), pr = /* @__PURE__ */ o((e = Ji) => {
48
+ let t = e ? Ki : () => String;
49
+ return {
50
+ isColorSupported: e,
51
+ reset: t("\x1B[0m", "\x1B[0m"),
52
+ bold: t("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
53
+ dim: t("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
54
+ italic: t("\x1B[3m", "\x1B[23m"),
55
+ underline: t("\x1B[4m", "\x1B[24m"),
56
+ inverse: t("\x1B[7m", "\x1B[27m"),
57
+ hidden: t("\x1B[8m", "\x1B[28m"),
58
+ strikethrough: t("\x1B[9m", "\x1B[29m"),
59
+ black: t("\x1B[30m", "\x1B[39m"),
60
+ red: t("\x1B[31m", "\x1B[39m"),
61
+ green: t("\x1B[32m", "\x1B[39m"),
62
+ yellow: t("\x1B[33m", "\x1B[39m"),
63
+ blue: t("\x1B[34m", "\x1B[39m"),
64
+ magenta: t("\x1B[35m", "\x1B[39m"),
65
+ cyan: t("\x1B[36m", "\x1B[39m"),
66
+ white: t("\x1B[37m", "\x1B[39m"),
67
+ gray: t("\x1B[90m", "\x1B[39m"),
68
+ bgBlack: t("\x1B[40m", "\x1B[49m"),
69
+ bgRed: t("\x1B[41m", "\x1B[49m"),
70
+ bgGreen: t("\x1B[42m", "\x1B[49m"),
71
+ bgYellow: t("\x1B[43m", "\x1B[49m"),
72
+ bgBlue: t("\x1B[44m", "\x1B[49m"),
73
+ bgMagenta: t("\x1B[45m", "\x1B[49m"),
74
+ bgCyan: t("\x1B[46m", "\x1B[49m"),
75
+ bgWhite: t("\x1B[47m", "\x1B[49m"),
76
+ blackBright: t("\x1B[90m", "\x1B[39m"),
77
+ redBright: t("\x1B[91m", "\x1B[39m"),
78
+ greenBright: t("\x1B[92m", "\x1B[39m"),
79
+ yellowBright: t("\x1B[93m", "\x1B[39m"),
80
+ blueBright: t("\x1B[94m", "\x1B[39m"),
81
+ magentaBright: t("\x1B[95m", "\x1B[39m"),
82
+ cyanBright: t("\x1B[96m", "\x1B[39m"),
83
+ whiteBright: t("\x1B[97m", "\x1B[39m"),
84
+ bgBlackBright: t("\x1B[100m", "\x1B[49m"),
85
+ bgRedBright: t("\x1B[101m", "\x1B[49m"),
86
+ bgGreenBright: t("\x1B[102m", "\x1B[49m"),
87
+ bgYellowBright: t("\x1B[103m", "\x1B[49m"),
88
+ bgBlueBright: t("\x1B[104m", "\x1B[49m"),
89
+ bgMagentaBright: t("\x1B[105m", "\x1B[49m"),
90
+ bgCyanBright: t("\x1B[106m", "\x1B[49m"),
91
+ bgWhiteBright: t("\x1B[107m", "\x1B[49m")
92
+ };
93
+ }, "createColors");
94
+ tt.exports = pr();
95
+ tt.exports.createColors = pr;
96
+ });
97
+
98
+ // ../node_modules/isexe/windows.js
99
+ var Er = p((Hl, Pr) => {
100
+ Pr.exports = vr;
101
+ vr.sync = Qi;
102
+ var Sr = b("fs");
103
+ function Xi(e, t) {
104
+ var r = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
105
+ if (!r || (r = r.split(";"), r.indexOf("") !== -1))
106
+ return !0;
107
+ for (var n = 0; n < r.length; n++) {
108
+ var i = r[n].toLowerCase();
109
+ if (i && e.substr(-i.length).toLowerCase() === i)
110
+ return !0;
111
+ }
112
+ return !1;
113
+ }
114
+ o(Xi, "checkPathExt");
115
+ function wr(e, t, r) {
116
+ return !e.isSymbolicLink() && !e.isFile() ? !1 : Xi(t, r);
117
+ }
118
+ o(wr, "checkStat");
119
+ function vr(e, t, r) {
120
+ Sr.stat(e, function(n, i) {
121
+ r(n, n ? !1 : wr(i, e, t));
122
+ });
123
+ }
124
+ o(vr, "isexe");
125
+ function Qi(e, t) {
126
+ return wr(Sr.statSync(e), e, t);
127
+ }
128
+ o(Qi, "sync");
129
+ });
130
+
131
+ // ../node_modules/isexe/mode.js
132
+ var Or = p((zl, Cr) => {
133
+ Cr.exports = kr;
134
+ kr.sync = Zi;
135
+ var Tr = b("fs");
136
+ function kr(e, t, r) {
137
+ Tr.stat(e, function(n, i) {
138
+ r(n, n ? !1 : Ir(i, t));
139
+ });
140
+ }
141
+ o(kr, "isexe");
142
+ function Zi(e, t) {
143
+ return Ir(Tr.statSync(e), t);
144
+ }
145
+ o(Zi, "sync");
146
+ function Ir(e, t) {
147
+ return e.isFile() && es(e, t);
148
+ }
149
+ o(Ir, "checkStat");
150
+ function es(e, t) {
151
+ var r = e.mode, n = e.uid, i = e.gid, s = t.uid !== void 0 ? t.uid : process.getuid && process.getuid(), a = t.gid !== void 0 ? t.gid : process.
152
+ getgid && process.getgid(), c = parseInt("100", 8), u = parseInt("010", 8), l = parseInt("001", 8), f = c | u, x = r & l || r & u && i ===
153
+ a || r & c && n === s || r & f && s === 0;
154
+ return x;
155
+ }
156
+ o(es, "checkMode");
157
+ });
158
+
159
+ // ../node_modules/isexe/index.js
160
+ var Rr = p((Yl, Ar) => {
161
+ var Kl = b("fs"), pe;
162
+ process.platform === "win32" || global.TESTING_WINDOWS ? pe = Er() : pe = Or();
163
+ Ar.exports = rt;
164
+ rt.sync = ts;
165
+ function rt(e, t, r) {
166
+ if (typeof t == "function" && (r = t, t = {}), !r) {
167
+ if (typeof Promise != "function")
168
+ throw new TypeError("callback not provided");
169
+ return new Promise(function(n, i) {
170
+ rt(e, t || {}, function(s, a) {
171
+ s ? i(s) : n(a);
172
+ });
173
+ });
174
+ }
175
+ pe(e, t || {}, function(n, i) {
176
+ n && (n.code === "EACCES" || t && t.ignoreErrors) && (n = null, i = !1), r(n, i);
177
+ });
178
+ }
179
+ o(rt, "isexe");
180
+ function ts(e, t) {
181
+ try {
182
+ return pe.sync(e, t || {});
183
+ } catch (r) {
184
+ if (t && t.ignoreErrors || r.code === "EACCES")
185
+ return !1;
186
+ throw r;
187
+ }
188
+ }
189
+ o(ts, "sync");
190
+ });
191
+
192
+ // ../node_modules/cross-spawn/node_modules/which/which.js
193
+ var Mr = p((Ql, Dr) => {
194
+ var M = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", _r = b("path"), rs = M ? ";" : "\
195
+ :", Gr = Rr(), jr = /* @__PURE__ */ o((e) => Object.assign(new Error(`not found: ${e}`), { code: "ENOENT" }), "getNotFoundError"), Nr = /* @__PURE__ */ o(
196
+ (e, t) => {
197
+ let r = t.colon || rs, n = e.match(/\//) || M && e.match(/\\/) ? [""] : [
198
+ // windows always checks the cwd first
199
+ ...M ? [process.cwd()] : [],
200
+ ...(t.path || process.env.PATH || /* istanbul ignore next: very unusual */
201
+ "").split(r)
202
+ ], i = M ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", s = M ? i.split(r) : [""];
203
+ return M && e.indexOf(".") !== -1 && s[0] !== "" && s.unshift(""), {
204
+ pathEnv: n,
205
+ pathExt: s,
206
+ pathExtExe: i
207
+ };
208
+ }, "getPathInfo"), Br = /* @__PURE__ */ o((e, t, r) => {
209
+ typeof t == "function" && (r = t, t = {}), t || (t = {});
210
+ let { pathEnv: n, pathExt: i, pathExtExe: s } = Nr(e, t), a = [], c = /* @__PURE__ */ o((l) => new Promise((f, x) => {
211
+ if (l === n.length)
212
+ return t.all && a.length ? f(a) : x(jr(e));
213
+ let g = n[l], m = /^".*"$/.test(g) ? g.slice(1, -1) : g, y = _r.join(m, e), h = !m && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + y : y;
214
+ f(u(h, l, 0));
215
+ }), "step"), u = /* @__PURE__ */ o((l, f, x) => new Promise((g, m) => {
216
+ if (x === i.length)
217
+ return g(c(f + 1));
218
+ let y = i[x];
219
+ Gr(l + y, { pathExt: s }, (h, S) => {
220
+ if (!h && S)
221
+ if (t.all)
222
+ a.push(l + y);
223
+ else
224
+ return g(l + y);
225
+ return g(u(l, f, x + 1));
226
+ });
227
+ }), "subStep");
228
+ return r ? c(0).then((l) => r(null, l), r) : c(0);
229
+ }, "which"), ns = /* @__PURE__ */ o((e, t) => {
230
+ t = t || {};
231
+ let { pathEnv: r, pathExt: n, pathExtExe: i } = Nr(e, t), s = [];
232
+ for (let a = 0; a < r.length; a++) {
233
+ let c = r[a], u = /^".*"$/.test(c) ? c.slice(1, -1) : c, l = _r.join(u, e), f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + l : l;
234
+ for (let x = 0; x < n.length; x++) {
235
+ let g = f + n[x];
236
+ try {
237
+ if (Gr.sync(g, { pathExt: i }))
238
+ if (t.all)
239
+ s.push(g);
240
+ else
241
+ return g;
242
+ } catch {
243
+ }
244
+ }
245
+ }
246
+ if (t.all && s.length)
247
+ return s;
248
+ if (t.nothrow)
249
+ return null;
250
+ throw jr(e);
251
+ }, "whichSync");
252
+ Dr.exports = Br;
253
+ Br.sync = ns;
254
+ });
255
+
256
+ // ../node_modules/path-key/index.js
257
+ var ot = p((ef, nt) => {
258
+ "use strict";
259
+ var Lr = /* @__PURE__ */ o((e = {}) => {
260
+ let t = e.env || process.env;
261
+ return (e.platform || process.platform) !== "win32" ? "PATH" : Object.keys(t).reverse().find((n) => n.toUpperCase() === "PATH") || "Path";
262
+ }, "pathKey");
263
+ nt.exports = Lr;
264
+ nt.exports.default = Lr;
265
+ });
266
+
267
+ // ../node_modules/cross-spawn/lib/util/resolveCommand.js
268
+ var qr = p((rf, $r) => {
269
+ "use strict";
270
+ var Fr = b("path"), os = Mr(), is = ot();
271
+ function Ur(e, t) {
272
+ let r = e.options.env || process.env, n = process.cwd(), i = e.options.cwd != null, s = i && process.chdir !== void 0 && !process.chdir.
273
+ disabled;
274
+ if (s)
275
+ try {
276
+ process.chdir(e.options.cwd);
277
+ } catch {
278
+ }
279
+ let a;
280
+ try {
281
+ a = os.sync(e.command, {
282
+ path: r[is({ env: r })],
283
+ pathExt: t ? Fr.delimiter : void 0
284
+ });
285
+ } catch {
286
+ } finally {
287
+ s && process.chdir(n);
288
+ }
289
+ return a && (a = Fr.resolve(i ? e.options.cwd : "", a)), a;
290
+ }
291
+ o(Ur, "resolveCommandAttempt");
292
+ function ss(e) {
293
+ return Ur(e) || Ur(e, !0);
294
+ }
295
+ o(ss, "resolveCommand");
296
+ $r.exports = ss;
297
+ });
298
+
299
+ // ../node_modules/cross-spawn/lib/util/escape.js
300
+ var Wr = p((of, st) => {
301
+ "use strict";
302
+ var it = /([()\][%!^"`<>&|;, *?])/g;
303
+ function as(e) {
304
+ return e = e.replace(it, "^$1"), e;
305
+ }
306
+ o(as, "escapeCommand");
307
+ function cs(e, t) {
308
+ return e = `${e}`, e = e.replace(/(\\*)"/g, '$1$1\\"'), e = e.replace(/(\\*)$/, "$1$1"), e = `"${e}"`, e = e.replace(it, "^$1"), t && (e =
309
+ e.replace(it, "^$1")), e;
310
+ }
311
+ o(cs, "escapeArgument");
312
+ st.exports.command = as;
313
+ st.exports.argument = cs;
314
+ });
315
+
316
+ // ../node_modules/shebang-regex/index.js
317
+ var Vr = p((af, Hr) => {
318
+ "use strict";
319
+ Hr.exports = /^#!(.*)/;
320
+ });
321
+
322
+ // ../node_modules/shebang-command/index.js
323
+ var Jr = p((cf, zr) => {
324
+ "use strict";
325
+ var us = Vr();
326
+ zr.exports = (e = "") => {
327
+ let t = e.match(us);
328
+ if (!t)
329
+ return null;
330
+ let [r, n] = t[0].replace(/#! ?/, "").split(" "), i = r.split("/").pop();
331
+ return i === "env" ? n : n ? `${i} ${n}` : i;
332
+ };
333
+ });
334
+
335
+ // ../node_modules/cross-spawn/lib/util/readShebang.js
336
+ var Yr = p((uf, Kr) => {
337
+ "use strict";
338
+ var at = b("fs"), ls = Jr();
339
+ function fs(e) {
340
+ let r = Buffer.alloc(150), n;
341
+ try {
342
+ n = at.openSync(e, "r"), at.readSync(n, r, 0, 150, 0), at.closeSync(n);
343
+ } catch {
344
+ }
345
+ return ls(r.toString());
346
+ }
347
+ o(fs, "readShebang");
348
+ Kr.exports = fs;
349
+ });
350
+
351
+ // ../node_modules/cross-spawn/lib/parse.js
352
+ var en = p((ff, Zr) => {
353
+ "use strict";
354
+ var ps = b("path"), Xr = qr(), Qr = Wr(), ds = Yr(), ms = process.platform === "win32", hs = /\.(?:com|exe)$/i, ys = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
355
+ function gs(e) {
356
+ e.file = Xr(e);
357
+ let t = e.file && ds(e.file);
358
+ return t ? (e.args.unshift(e.file), e.command = t, Xr(e)) : e.file;
359
+ }
360
+ o(gs, "detectShebang");
361
+ function bs(e) {
362
+ if (!ms)
363
+ return e;
364
+ let t = gs(e), r = !hs.test(t);
365
+ if (e.options.forceShell || r) {
366
+ let n = ys.test(t);
367
+ e.command = ps.normalize(e.command), e.command = Qr.command(e.command), e.args = e.args.map((s) => Qr.argument(s, n));
368
+ let i = [e.command].concat(e.args).join(" ");
369
+ e.args = ["/d", "/s", "/c", `"${i}"`], e.command = process.env.comspec || "cmd.exe", e.options.windowsVerbatimArguments = !0;
370
+ }
371
+ return e;
372
+ }
373
+ o(bs, "parseNonShell");
374
+ function xs(e, t, r) {
375
+ t && !Array.isArray(t) && (r = t, t = null), t = t ? t.slice(0) : [], r = Object.assign({}, r);
376
+ let n = {
377
+ command: e,
378
+ args: t,
379
+ options: r,
380
+ file: void 0,
381
+ original: {
382
+ command: e,
383
+ args: t
384
+ }
385
+ };
386
+ return r.shell ? n : bs(n);
387
+ }
388
+ o(xs, "parse");
389
+ Zr.exports = xs;
390
+ });
391
+
392
+ // ../node_modules/cross-spawn/lib/enoent.js
393
+ var nn = p((df, rn) => {
394
+ "use strict";
395
+ var ct = process.platform === "win32";
396
+ function ut(e, t) {
397
+ return Object.assign(new Error(`${t} ${e.command} ENOENT`), {
398
+ code: "ENOENT",
399
+ errno: "ENOENT",
400
+ syscall: `${t} ${e.command}`,
401
+ path: e.command,
402
+ spawnargs: e.args
403
+ });
404
+ }
405
+ o(ut, "notFoundError");
406
+ function Ss(e, t) {
407
+ if (!ct)
408
+ return;
409
+ let r = e.emit;
410
+ e.emit = function(n, i) {
411
+ if (n === "exit") {
412
+ let s = tn(i, t, "spawn");
413
+ if (s)
414
+ return r.call(e, "error", s);
415
+ }
416
+ return r.apply(e, arguments);
417
+ };
418
+ }
419
+ o(Ss, "hookChildProcess");
420
+ function tn(e, t) {
421
+ return ct && e === 1 && !t.file ? ut(t.original, "spawn") : null;
422
+ }
423
+ o(tn, "verifyENOENT");
424
+ function ws(e, t) {
425
+ return ct && e === 1 && !t.file ? ut(t.original, "spawnSync") : null;
426
+ }
427
+ o(ws, "verifyENOENTSync");
428
+ rn.exports = {
429
+ hookChildProcess: Ss,
430
+ verifyENOENT: tn,
431
+ verifyENOENTSync: ws,
432
+ notFoundError: ut
433
+ };
434
+ });
435
+
436
+ // ../node_modules/cross-spawn/index.js
437
+ var pt = p((hf, L) => {
438
+ "use strict";
439
+ var on = b("child_process"), lt = en(), ft = nn();
440
+ function sn(e, t, r) {
441
+ let n = lt(e, t, r), i = on.spawn(n.command, n.args, n.options);
442
+ return ft.hookChildProcess(i, n), i;
443
+ }
444
+ o(sn, "spawn");
445
+ function vs(e, t, r) {
446
+ let n = lt(e, t, r), i = on.spawnSync(n.command, n.args, n.options);
447
+ return i.error = i.error || ft.verifyENOENTSync(i.status, n), i;
448
+ }
449
+ o(vs, "spawnSync");
450
+ L.exports = sn;
451
+ L.exports.spawn = sn;
452
+ L.exports.sync = vs;
453
+ L.exports._parse = lt;
454
+ L.exports._enoent = ft;
455
+ });
456
+
457
+ // ../node_modules/execa/node_modules/strip-final-newline/index.js
458
+ var cn = p((gf, an) => {
459
+ "use strict";
460
+ an.exports = (e) => {
461
+ let t = typeof e == "string" ? `
462
+ ` : 10, r = typeof e == "string" ? "\r" : 13;
463
+ return e[e.length - 1] === t && (e = e.slice(0, e.length - 1)), e[e.length - 1] === r && (e = e.slice(0, e.length - 1)), e;
464
+ };
465
+ });
466
+
467
+ // ../node_modules/npm-run-path/index.js
468
+ var fn = p((bf, K) => {
469
+ "use strict";
470
+ var J = b("path"), un = ot(), ln = /* @__PURE__ */ o((e) => {
471
+ e = {
472
+ cwd: process.cwd(),
473
+ path: process.env[un()],
474
+ execPath: process.execPath,
475
+ ...e
476
+ };
477
+ let t, r = J.resolve(e.cwd), n = [];
478
+ for (; t !== r; )
479
+ n.push(J.join(r, "node_modules/.bin")), t = r, r = J.resolve(r, "..");
480
+ let i = J.resolve(e.cwd, e.execPath, "..");
481
+ return n.push(i), n.concat(e.path).join(J.delimiter);
482
+ }, "npmRunPath");
483
+ K.exports = ln;
484
+ K.exports.default = ln;
485
+ K.exports.env = (e) => {
486
+ e = {
487
+ env: process.env,
488
+ ...e
489
+ };
490
+ let t = { ...e.env }, r = un({ env: t });
491
+ return e.path = t[r], t[r] = K.exports(e), t;
492
+ };
493
+ });
494
+
495
+ // ../node_modules/mimic-fn/index.js
496
+ var dn = p((Sf, dt) => {
497
+ "use strict";
498
+ var pn = /* @__PURE__ */ o((e, t) => {
499
+ for (let r of Reflect.ownKeys(t))
500
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
501
+ return e;
502
+ }, "mimicFn");
503
+ dt.exports = pn;
504
+ dt.exports.default = pn;
505
+ });
506
+
507
+ // ../node_modules/onetime/index.js
508
+ var hn = p((vf, me) => {
509
+ "use strict";
510
+ var Ps = dn(), de = /* @__PURE__ */ new WeakMap(), mn = /* @__PURE__ */ o((e, t = {}) => {
511
+ if (typeof e != "function")
512
+ throw new TypeError("Expected a function");
513
+ let r, n = 0, i = e.displayName || e.name || "<anonymous>", s = /* @__PURE__ */ o(function(...a) {
514
+ if (de.set(s, ++n), n === 1)
515
+ r = e.apply(this, a), e = null;
516
+ else if (t.throw === !0)
517
+ throw new Error(`Function \`${i}\` can only be called once`);
518
+ return r;
519
+ }, "onetime");
520
+ return Ps(s, e), de.set(s, n), s;
521
+ }, "onetime");
522
+ me.exports = mn;
523
+ me.exports.default = mn;
524
+ me.exports.callCount = (e) => {
525
+ if (!de.has(e))
526
+ throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);
527
+ return de.get(e);
528
+ };
529
+ });
530
+
531
+ // ../node_modules/execa/node_modules/human-signals/build/src/core.js
532
+ var yn = p((he) => {
533
+ "use strict";
534
+ Object.defineProperty(he, "__esModule", { value: !0 });
535
+ he.SIGNALS = void 0;
536
+ var Es = [
537
+ {
538
+ name: "SIGHUP",
539
+ number: 1,
540
+ action: "terminate",
541
+ description: "Terminal closed",
542
+ standard: "posix"
543
+ },
544
+ {
545
+ name: "SIGINT",
546
+ number: 2,
547
+ action: "terminate",
548
+ description: "User interruption with CTRL-C",
549
+ standard: "ansi"
550
+ },
551
+ {
552
+ name: "SIGQUIT",
553
+ number: 3,
554
+ action: "core",
555
+ description: "User interruption with CTRL-\\",
556
+ standard: "posix"
557
+ },
558
+ {
559
+ name: "SIGILL",
560
+ number: 4,
561
+ action: "core",
562
+ description: "Invalid machine instruction",
563
+ standard: "ansi"
564
+ },
565
+ {
566
+ name: "SIGTRAP",
567
+ number: 5,
568
+ action: "core",
569
+ description: "Debugger breakpoint",
570
+ standard: "posix"
571
+ },
572
+ {
573
+ name: "SIGABRT",
574
+ number: 6,
575
+ action: "core",
576
+ description: "Aborted",
577
+ standard: "ansi"
578
+ },
579
+ {
580
+ name: "SIGIOT",
581
+ number: 6,
582
+ action: "core",
583
+ description: "Aborted",
584
+ standard: "bsd"
585
+ },
586
+ {
587
+ name: "SIGBUS",
588
+ number: 7,
589
+ action: "core",
590
+ description: "Bus error due to misaligned, non-existing address or paging error",
591
+ standard: "bsd"
592
+ },
593
+ {
594
+ name: "SIGEMT",
595
+ number: 7,
596
+ action: "terminate",
597
+ description: "Command should be emulated but is not implemented",
598
+ standard: "other"
599
+ },
600
+ {
601
+ name: "SIGFPE",
602
+ number: 8,
603
+ action: "core",
604
+ description: "Floating point arithmetic error",
605
+ standard: "ansi"
606
+ },
607
+ {
608
+ name: "SIGKILL",
609
+ number: 9,
610
+ action: "terminate",
611
+ description: "Forced termination",
612
+ standard: "posix",
613
+ forced: !0
614
+ },
615
+ {
616
+ name: "SIGUSR1",
617
+ number: 10,
618
+ action: "terminate",
619
+ description: "Application-specific signal",
620
+ standard: "posix"
621
+ },
622
+ {
623
+ name: "SIGSEGV",
624
+ number: 11,
625
+ action: "core",
626
+ description: "Segmentation fault",
627
+ standard: "ansi"
628
+ },
629
+ {
630
+ name: "SIGUSR2",
631
+ number: 12,
632
+ action: "terminate",
633
+ description: "Application-specific signal",
634
+ standard: "posix"
635
+ },
636
+ {
637
+ name: "SIGPIPE",
638
+ number: 13,
639
+ action: "terminate",
640
+ description: "Broken pipe or socket",
641
+ standard: "posix"
642
+ },
643
+ {
644
+ name: "SIGALRM",
645
+ number: 14,
646
+ action: "terminate",
647
+ description: "Timeout or timer",
648
+ standard: "posix"
649
+ },
650
+ {
651
+ name: "SIGTERM",
652
+ number: 15,
653
+ action: "terminate",
654
+ description: "Termination",
655
+ standard: "ansi"
656
+ },
657
+ {
658
+ name: "SIGSTKFLT",
659
+ number: 16,
660
+ action: "terminate",
661
+ description: "Stack is empty or overflowed",
662
+ standard: "other"
663
+ },
664
+ {
665
+ name: "SIGCHLD",
666
+ number: 17,
667
+ action: "ignore",
668
+ description: "Child process terminated, paused or unpaused",
669
+ standard: "posix"
670
+ },
671
+ {
672
+ name: "SIGCLD",
673
+ number: 17,
674
+ action: "ignore",
675
+ description: "Child process terminated, paused or unpaused",
676
+ standard: "other"
677
+ },
678
+ {
679
+ name: "SIGCONT",
680
+ number: 18,
681
+ action: "unpause",
682
+ description: "Unpaused",
683
+ standard: "posix",
684
+ forced: !0
685
+ },
686
+ {
687
+ name: "SIGSTOP",
688
+ number: 19,
689
+ action: "pause",
690
+ description: "Paused",
691
+ standard: "posix",
692
+ forced: !0
693
+ },
694
+ {
695
+ name: "SIGTSTP",
696
+ number: 20,
697
+ action: "pause",
698
+ description: 'Paused using CTRL-Z or "suspend"',
699
+ standard: "posix"
700
+ },
701
+ {
702
+ name: "SIGTTIN",
703
+ number: 21,
704
+ action: "pause",
705
+ description: "Background process cannot read terminal input",
706
+ standard: "posix"
707
+ },
708
+ {
709
+ name: "SIGBREAK",
710
+ number: 21,
711
+ action: "terminate",
712
+ description: "User interruption with CTRL-BREAK",
713
+ standard: "other"
714
+ },
715
+ {
716
+ name: "SIGTTOU",
717
+ number: 22,
718
+ action: "pause",
719
+ description: "Background process cannot write to terminal output",
720
+ standard: "posix"
721
+ },
722
+ {
723
+ name: "SIGURG",
724
+ number: 23,
725
+ action: "ignore",
726
+ description: "Socket received out-of-band data",
727
+ standard: "bsd"
728
+ },
729
+ {
730
+ name: "SIGXCPU",
731
+ number: 24,
732
+ action: "core",
733
+ description: "Process timed out",
734
+ standard: "bsd"
735
+ },
736
+ {
737
+ name: "SIGXFSZ",
738
+ number: 25,
739
+ action: "core",
740
+ description: "File too big",
741
+ standard: "bsd"
742
+ },
743
+ {
744
+ name: "SIGVTALRM",
745
+ number: 26,
746
+ action: "terminate",
747
+ description: "Timeout or timer",
748
+ standard: "bsd"
749
+ },
750
+ {
751
+ name: "SIGPROF",
752
+ number: 27,
753
+ action: "terminate",
754
+ description: "Timeout or timer",
755
+ standard: "bsd"
756
+ },
757
+ {
758
+ name: "SIGWINCH",
759
+ number: 28,
760
+ action: "ignore",
761
+ description: "Terminal window size changed",
762
+ standard: "bsd"
763
+ },
764
+ {
765
+ name: "SIGIO",
766
+ number: 29,
767
+ action: "terminate",
768
+ description: "I/O is available",
769
+ standard: "other"
770
+ },
771
+ {
772
+ name: "SIGPOLL",
773
+ number: 29,
774
+ action: "terminate",
775
+ description: "Watched event",
776
+ standard: "other"
777
+ },
778
+ {
779
+ name: "SIGINFO",
780
+ number: 29,
781
+ action: "ignore",
782
+ description: "Request for process information",
783
+ standard: "other"
784
+ },
785
+ {
786
+ name: "SIGPWR",
787
+ number: 30,
788
+ action: "terminate",
789
+ description: "Device running out of power",
790
+ standard: "systemv"
791
+ },
792
+ {
793
+ name: "SIGSYS",
794
+ number: 31,
795
+ action: "core",
796
+ description: "Invalid system call",
797
+ standard: "other"
798
+ },
799
+ {
800
+ name: "SIGUNUSED",
801
+ number: 31,
802
+ action: "terminate",
803
+ description: "Invalid system call",
804
+ standard: "other"
805
+ }
806
+ ];
807
+ he.SIGNALS = Es;
808
+ });
809
+
810
+ // ../node_modules/execa/node_modules/human-signals/build/src/realtime.js
811
+ var mt = p((F) => {
812
+ "use strict";
813
+ Object.defineProperty(F, "__esModule", { value: !0 });
814
+ F.SIGRTMAX = F.getRealtimeSignals = void 0;
815
+ var Ts = /* @__PURE__ */ o(function() {
816
+ let e = bn - gn + 1;
817
+ return Array.from({ length: e }, ks);
818
+ }, "getRealtimeSignals");
819
+ F.getRealtimeSignals = Ts;
820
+ var ks = /* @__PURE__ */ o(function(e, t) {
821
+ return {
822
+ name: `SIGRT${t + 1}`,
823
+ number: gn + t,
824
+ action: "terminate",
825
+ description: "Application-specific signal (realtime)",
826
+ standard: "posix"
827
+ };
828
+ }, "getRealtimeSignal"), gn = 34, bn = 64;
829
+ F.SIGRTMAX = bn;
830
+ });
831
+
832
+ // ../node_modules/execa/node_modules/human-signals/build/src/signals.js
833
+ var xn = p((ye) => {
834
+ "use strict";
835
+ Object.defineProperty(ye, "__esModule", { value: !0 });
836
+ ye.getSignals = void 0;
837
+ var Is = b("os"), Cs = yn(), Os = mt(), As = /* @__PURE__ */ o(function() {
838
+ let e = (0, Os.getRealtimeSignals)();
839
+ return [...Cs.SIGNALS, ...e].map(Rs);
840
+ }, "getSignals");
841
+ ye.getSignals = As;
842
+ var Rs = /* @__PURE__ */ o(function({
843
+ name: e,
844
+ number: t,
845
+ description: r,
846
+ action: n,
847
+ forced: i = !1,
848
+ standard: s
849
+ }) {
850
+ let {
851
+ signals: { [e]: a }
852
+ } = Is.constants, c = a !== void 0;
853
+ return { name: e, number: c ? a : t, description: r, supported: c, action: n, forced: i, standard: s };
854
+ }, "normalizeSignal");
855
+ });
856
+
857
+ // ../node_modules/execa/node_modules/human-signals/build/src/main.js
858
+ var wn = p((U) => {
859
+ "use strict";
860
+ Object.defineProperty(U, "__esModule", { value: !0 });
861
+ U.signalsByNumber = U.signalsByName = void 0;
862
+ var _s = b("os"), Sn = xn(), Gs = mt(), js = /* @__PURE__ */ o(function() {
863
+ return (0, Sn.getSignals)().reduce(Ns, {});
864
+ }, "getSignalsByName"), Ns = /* @__PURE__ */ o(function(e, { name: t, number: r, description: n, supported: i, action: s, forced: a, standard: c }) {
865
+ return {
866
+ ...e,
867
+ [t]: { name: t, number: r, description: n, supported: i, action: s, forced: a, standard: c }
868
+ };
869
+ }, "getSignalByName"), Bs = js();
870
+ U.signalsByName = Bs;
871
+ var Ds = /* @__PURE__ */ o(function() {
872
+ let e = (0, Sn.getSignals)(), t = Gs.SIGRTMAX + 1, r = Array.from({ length: t }, (n, i) => Ms(i, e));
873
+ return Object.assign({}, ...r);
874
+ }, "getSignalsByNumber"), Ms = /* @__PURE__ */ o(function(e, t) {
875
+ let r = Ls(e, t);
876
+ if (r === void 0)
877
+ return {};
878
+ let { name: n, description: i, supported: s, action: a, forced: c, standard: u } = r;
879
+ return {
880
+ [e]: {
881
+ name: n,
882
+ number: e,
883
+ description: i,
884
+ supported: s,
885
+ action: a,
886
+ forced: c,
887
+ standard: u
888
+ }
889
+ };
890
+ }, "getSignalByNumber"), Ls = /* @__PURE__ */ o(function(e, t) {
891
+ let r = t.find(({ name: n }) => _s.constants.signals[n] === e);
892
+ return r !== void 0 ? r : t.find((n) => n.number === e);
893
+ }, "findSignalByNumber"), Fs = Ds();
894
+ U.signalsByNumber = Fs;
895
+ });
896
+
897
+ // ../node_modules/execa/lib/error.js
898
+ var Pn = p((Rf, vn) => {
899
+ "use strict";
900
+ var { signalsByName: Us } = wn(), $s = /* @__PURE__ */ o(({ timedOut: e, timeout: t, errorCode: r, signal: n, signalDescription: i, exitCode: s,
901
+ isCanceled: a }) => e ? `timed out after ${t} milliseconds` : a ? "was canceled" : r !== void 0 ? `failed with ${r}` : n !== void 0 ? `was\
902
+ killed with ${n} (${i})` : s !== void 0 ? `failed with exit code ${s}` : "failed", "getErrorPrefix"), qs = /* @__PURE__ */ o(({
903
+ stdout: e,
904
+ stderr: t,
905
+ all: r,
906
+ error: n,
907
+ signal: i,
908
+ exitCode: s,
909
+ command: a,
910
+ escapedCommand: c,
911
+ timedOut: u,
912
+ isCanceled: l,
913
+ killed: f,
914
+ parsed: { options: { timeout: x } }
915
+ }) => {
916
+ s = s === null ? void 0 : s, i = i === null ? void 0 : i;
917
+ let g = i === void 0 ? void 0 : Us[i].description, m = n && n.code, h = `Command ${$s({ timedOut: u, timeout: x, errorCode: m, signal: i,
918
+ signalDescription: g, exitCode: s, isCanceled: l })}: ${a}`, S = Object.prototype.toString.call(n) === "[object Error]", T = S ? `${h}
919
+ ${n.message}` : h, E = [T, t, e].filter(Boolean).join(`
920
+ `);
921
+ return S ? (n.originalMessage = n.message, n.message = E) : n = new Error(E), n.shortMessage = T, n.command = a, n.escapedCommand = c, n.
922
+ exitCode = s, n.signal = i, n.signalDescription = g, n.stdout = e, n.stderr = t, r !== void 0 && (n.all = r), "bufferedData" in n && delete n.
923
+ bufferedData, n.failed = !0, n.timedOut = !!u, n.isCanceled = l, n.killed = f && !u, n;
924
+ }, "makeError");
925
+ vn.exports = qs;
926
+ });
927
+
928
+ // ../node_modules/execa/lib/stdio.js
929
+ var Tn = p((Gf, ht) => {
930
+ "use strict";
931
+ var ge = ["stdin", "stdout", "stderr"], Ws = /* @__PURE__ */ o((e) => ge.some((t) => e[t] !== void 0), "hasAlias"), En = /* @__PURE__ */ o(
932
+ (e) => {
933
+ if (!e)
934
+ return;
935
+ let { stdio: t } = e;
936
+ if (t === void 0)
937
+ return ge.map((n) => e[n]);
938
+ if (Ws(e))
939
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ge.map((n) => `\`${n}\``).join(", ")}`);
940
+ if (typeof t == "string")
941
+ return t;
942
+ if (!Array.isArray(t))
943
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);
944
+ let r = Math.max(t.length, ge.length);
945
+ return Array.from({ length: r }, (n, i) => t[i]);
946
+ }, "normalizeStdio");
947
+ ht.exports = En;
948
+ ht.exports.node = (e) => {
949
+ let t = En(e);
950
+ return t === "ipc" ? "ipc" : t === void 0 || typeof t == "string" ? [t, t, t, "ipc"] : t.includes("ipc") ? t : [...t, "ipc"];
951
+ };
952
+ });
953
+
954
+ // ../node_modules/signal-exit/signals.js
955
+ var kn = p((Nf, be) => {
956
+ be.exports = [
957
+ "SIGABRT",
958
+ "SIGALRM",
959
+ "SIGHUP",
960
+ "SIGINT",
961
+ "SIGTERM"
962
+ ];
963
+ process.platform !== "win32" && be.exports.push(
964
+ "SIGVTALRM",
965
+ "SIGXCPU",
966
+ "SIGXFSZ",
967
+ "SIGUSR2",
968
+ "SIGTRAP",
969
+ "SIGSYS",
970
+ "SIGQUIT",
971
+ "SIGIOT"
972
+ // should detect profiler and enable/disable accordingly.
973
+ // see #21
974
+ // 'SIGPROF'
975
+ );
976
+ process.platform === "linux" && be.exports.push(
977
+ "SIGIO",
978
+ "SIGPOLL",
979
+ "SIGPWR",
980
+ "SIGSTKFLT",
981
+ "SIGUNUSED"
982
+ );
983
+ });
984
+
985
+ // ../node_modules/signal-exit/index.js
986
+ var Rn = p((Bf, W) => {
987
+ var w = global.process, _ = /* @__PURE__ */ o(function(e) {
988
+ return e && typeof e == "object" && typeof e.removeListener == "function" && typeof e.emit == "function" && typeof e.reallyExit == "func\
989
+ tion" && typeof e.listeners == "function" && typeof e.kill == "function" && typeof e.pid == "number" && typeof e.on == "function";
990
+ }, "processOk");
991
+ _(w) ? (In = b("assert"), $ = kn(), Cn = /^win/i.test(w.platform), Y = b("events"), typeof Y != "function" && (Y = Y.EventEmitter), w.__signal_exit_emitter__ ?
992
+ P = w.__signal_exit_emitter__ : (P = w.__signal_exit_emitter__ = new Y(), P.count = 0, P.emitted = {}), P.infinite || (P.setMaxListeners(1 / 0),
993
+ P.infinite = !0), W.exports = function(e, t) {
994
+ if (!_(global.process))
995
+ return function() {
996
+ };
997
+ In.equal(typeof e, "function", "a callback must be provided for exit handler"), q === !1 && yt();
998
+ var r = "exit";
999
+ t && t.alwaysLast && (r = "afterexit");
1000
+ var n = /* @__PURE__ */ o(function() {
1001
+ P.removeListener(r, e), P.listeners("exit").length === 0 && P.listeners("afterexit").length === 0 && xe();
1002
+ }, "remove");
1003
+ return P.on(r, e), n;
1004
+ }, xe = /* @__PURE__ */ o(function() {
1005
+ !q || !_(global.process) || (q = !1, $.forEach(function(t) {
1006
+ try {
1007
+ w.removeListener(t, Se[t]);
1008
+ } catch {
1009
+ }
1010
+ }), w.emit = we, w.reallyExit = gt, P.count -= 1);
1011
+ }, "unload"), W.exports.unload = xe, G = /* @__PURE__ */ o(function(t, r, n) {
1012
+ P.emitted[t] || (P.emitted[t] = !0, P.emit(t, r, n));
1013
+ }, "emit"), Se = {}, $.forEach(function(e) {
1014
+ Se[e] = /* @__PURE__ */ o(function() {
1015
+ if (_(global.process)) {
1016
+ var r = w.listeners(e);
1017
+ r.length === P.count && (xe(), G("exit", null, e), G("afterexit", null, e), Cn && e === "SIGHUP" && (e = "SIGINT"), w.kill(w.pid, e));
1018
+ }
1019
+ }, "listener");
1020
+ }), W.exports.signals = function() {
1021
+ return $;
1022
+ }, q = !1, yt = /* @__PURE__ */ o(function() {
1023
+ q || !_(global.process) || (q = !0, P.count += 1, $ = $.filter(function(t) {
1024
+ try {
1025
+ return w.on(t, Se[t]), !0;
1026
+ } catch {
1027
+ return !1;
1028
+ }
1029
+ }), w.emit = An, w.reallyExit = On);
1030
+ }, "load"), W.exports.load = yt, gt = w.reallyExit, On = /* @__PURE__ */ o(function(t) {
1031
+ _(global.process) && (w.exitCode = t || /* istanbul ignore next */
1032
+ 0, G("exit", w.exitCode, null), G("afterexit", w.exitCode, null), gt.call(w, w.exitCode));
1033
+ }, "processReallyExit"), we = w.emit, An = /* @__PURE__ */ o(function(t, r) {
1034
+ if (t === "exit" && _(global.process)) {
1035
+ r !== void 0 && (w.exitCode = r);
1036
+ var n = we.apply(this, arguments);
1037
+ return G("exit", w.exitCode, null), G("afterexit", w.exitCode, null), n;
1038
+ } else
1039
+ return we.apply(this, arguments);
1040
+ }, "processEmit")) : W.exports = function() {
1041
+ return function() {
1042
+ };
1043
+ };
1044
+ var In, $, Cn, Y, P, xe, G, Se, q, yt, gt, On, we, An;
1045
+ });
1046
+
1047
+ // ../node_modules/execa/lib/kill.js
1048
+ var Gn = p((Mf, _n) => {
1049
+ "use strict";
1050
+ var Hs = b("os"), Vs = Rn(), zs = 1e3 * 5, Js = /* @__PURE__ */ o((e, t = "SIGTERM", r = {}) => {
1051
+ let n = e(t);
1052
+ return Ks(e, t, r, n), n;
1053
+ }, "spawnedKill"), Ks = /* @__PURE__ */ o((e, t, r, n) => {
1054
+ if (!Ys(t, r, n))
1055
+ return;
1056
+ let i = Qs(r), s = setTimeout(() => {
1057
+ e("SIGKILL");
1058
+ }, i);
1059
+ s.unref && s.unref();
1060
+ }, "setKillTimeout"), Ys = /* @__PURE__ */ o((e, { forceKillAfterTimeout: t }, r) => Xs(e) && t !== !1 && r, "shouldForceKill"), Xs = /* @__PURE__ */ o(
1061
+ (e) => e === Hs.constants.signals.SIGTERM || typeof e == "string" && e.toUpperCase() === "SIGTERM", "isSigterm"), Qs = /* @__PURE__ */ o(({
1062
+ forceKillAfterTimeout: e = !0 }) => {
1063
+ if (e === !0)
1064
+ return zs;
1065
+ if (!Number.isFinite(e) || e < 0)
1066
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
1067
+ return e;
1068
+ }, "getForceKillAfterTimeout"), Zs = /* @__PURE__ */ o((e, t) => {
1069
+ e.kill() && (t.isCanceled = !0);
1070
+ }, "spawnedCancel"), ea = /* @__PURE__ */ o((e, t, r) => {
1071
+ e.kill(t), r(Object.assign(new Error("Timed out"), { timedOut: !0, signal: t }));
1072
+ }, "timeoutKill"), ta = /* @__PURE__ */ o((e, { timeout: t, killSignal: r = "SIGTERM" }, n) => {
1073
+ if (t === 0 || t === void 0)
1074
+ return n;
1075
+ let i, s = new Promise((c, u) => {
1076
+ i = setTimeout(() => {
1077
+ ea(e, r, u);
1078
+ }, t);
1079
+ }), a = n.finally(() => {
1080
+ clearTimeout(i);
1081
+ });
1082
+ return Promise.race([s, a]);
1083
+ }, "setupTimeout"), ra = /* @__PURE__ */ o(({ timeout: e }) => {
1084
+ if (e !== void 0 && (!Number.isFinite(e) || e < 0))
1085
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
1086
+ }, "validateTimeout"), na = /* @__PURE__ */ o(async (e, { cleanup: t, detached: r }, n) => {
1087
+ if (!t || r)
1088
+ return n;
1089
+ let i = Vs(() => {
1090
+ e.kill();
1091
+ });
1092
+ return n.finally(() => {
1093
+ i();
1094
+ });
1095
+ }, "setExitHandler");
1096
+ _n.exports = {
1097
+ spawnedKill: Js,
1098
+ spawnedCancel: Zs,
1099
+ setupTimeout: ta,
1100
+ validateTimeout: ra,
1101
+ setExitHandler: na
1102
+ };
1103
+ });
1104
+
1105
+ // ../node_modules/is-stream/index.js
1106
+ var Nn = p((Ff, jn) => {
1107
+ "use strict";
1108
+ var k = /* @__PURE__ */ o((e) => e !== null && typeof e == "object" && typeof e.pipe == "function", "isStream");
1109
+ k.writable = (e) => k(e) && e.writable !== !1 && typeof e._write == "function" && typeof e._writableState == "object";
1110
+ k.readable = (e) => k(e) && e.readable !== !1 && typeof e._read == "function" && typeof e._readableState == "object";
1111
+ k.duplex = (e) => k.writable(e) && k.readable(e);
1112
+ k.transform = (e) => k.duplex(e) && typeof e._transform == "function";
1113
+ jn.exports = k;
1114
+ });
1115
+
1116
+ // ../node_modules/get-stream/buffer-stream.js
1117
+ var Dn = p(($f, Bn) => {
1118
+ "use strict";
1119
+ var { PassThrough: oa } = b("stream");
1120
+ Bn.exports = (e) => {
1121
+ e = { ...e };
1122
+ let { array: t } = e, { encoding: r } = e, n = r === "buffer", i = !1;
1123
+ t ? i = !(r || n) : r = r || "utf8", n && (r = null);
1124
+ let s = new oa({ objectMode: i });
1125
+ r && s.setEncoding(r);
1126
+ let a = 0, c = [];
1127
+ return s.on("data", (u) => {
1128
+ c.push(u), i ? a = c.length : a += u.length;
1129
+ }), s.getBufferedValue = () => t ? c : n ? Buffer.concat(c, a) : c.join(""), s.getBufferedLength = () => a, s;
1130
+ };
1131
+ });
1132
+
1133
+ // ../node_modules/get-stream/index.js
1134
+ var Mn = p((qf, X) => {
1135
+ "use strict";
1136
+ var { constants: ia } = b("buffer"), sa = b("stream"), { promisify: aa } = b("util"), ca = Dn(), ua = aa(sa.pipeline), ve = class extends Error {
1137
+ static {
1138
+ o(this, "MaxBufferError");
1139
+ }
1140
+ constructor() {
1141
+ super("maxBuffer exceeded"), this.name = "MaxBufferError";
1142
+ }
1143
+ };
1144
+ async function bt(e, t) {
1145
+ if (!e)
1146
+ throw new Error("Expected a stream");
1147
+ t = {
1148
+ maxBuffer: 1 / 0,
1149
+ ...t
1150
+ };
1151
+ let { maxBuffer: r } = t, n = ca(t);
1152
+ return await new Promise((i, s) => {
1153
+ let a = /* @__PURE__ */ o((c) => {
1154
+ c && n.getBufferedLength() <= ia.MAX_LENGTH && (c.bufferedData = n.getBufferedValue()), s(c);
1155
+ }, "rejectPromise");
1156
+ (async () => {
1157
+ try {
1158
+ await ua(e, n), i();
1159
+ } catch (c) {
1160
+ a(c);
1161
+ }
1162
+ })(), n.on("data", () => {
1163
+ n.getBufferedLength() > r && a(new ve());
1164
+ });
1165
+ }), n.getBufferedValue();
1166
+ }
1167
+ o(bt, "getStream");
1168
+ X.exports = bt;
1169
+ X.exports.buffer = (e, t) => bt(e, { ...t, encoding: "buffer" });
1170
+ X.exports.array = (e, t) => bt(e, { ...t, array: !0 });
1171
+ X.exports.MaxBufferError = ve;
1172
+ });
1173
+
1174
+ // ../node_modules/merge-stream/index.js
1175
+ var xt = p((Hf, Ln) => {
1176
+ "use strict";
1177
+ var { PassThrough: la } = b("stream");
1178
+ Ln.exports = function() {
1179
+ var e = [], t = new la({ objectMode: !0 });
1180
+ return t.setMaxListeners(0), t.add = r, t.isEmpty = n, t.on("unpipe", i), Array.prototype.slice.call(arguments).forEach(r), t;
1181
+ function r(s) {
1182
+ return Array.isArray(s) ? (s.forEach(r), this) : (e.push(s), s.once("end", i.bind(null, s)), s.once("error", t.emit.bind(t, "error")),
1183
+ s.pipe(t, { end: !1 }), this);
1184
+ }
1185
+ o(r, "add");
1186
+ function n() {
1187
+ return e.length == 0;
1188
+ }
1189
+ o(n, "isEmpty");
1190
+ function i(s) {
1191
+ e = e.filter(function(a) {
1192
+ return a !== s;
1193
+ }), !e.length && t.readable && t.end();
1194
+ }
1195
+ o(i, "remove");
1196
+ };
1197
+ });
1198
+
1199
+ // ../node_modules/execa/lib/stream.js
1200
+ var qn = p((zf, $n) => {
1201
+ "use strict";
1202
+ var Un = Nn(), Fn = Mn(), fa = xt(), pa = /* @__PURE__ */ o((e, t) => {
1203
+ t === void 0 || e.stdin === void 0 || (Un(t) ? t.pipe(e.stdin) : e.stdin.end(t));
1204
+ }, "handleInput"), da = /* @__PURE__ */ o((e, { all: t }) => {
1205
+ if (!t || !e.stdout && !e.stderr)
1206
+ return;
1207
+ let r = fa();
1208
+ return e.stdout && r.add(e.stdout), e.stderr && r.add(e.stderr), r;
1209
+ }, "makeAllStream"), St = /* @__PURE__ */ o(async (e, t) => {
1210
+ if (e) {
1211
+ e.destroy();
1212
+ try {
1213
+ return await t;
1214
+ } catch (r) {
1215
+ return r.bufferedData;
1216
+ }
1217
+ }
1218
+ }, "getBufferedData"), wt = /* @__PURE__ */ o((e, { encoding: t, buffer: r, maxBuffer: n }) => {
1219
+ if (!(!e || !r))
1220
+ return t ? Fn(e, { encoding: t, maxBuffer: n }) : Fn.buffer(e, { maxBuffer: n });
1221
+ }, "getStreamPromise"), ma = /* @__PURE__ */ o(async ({ stdout: e, stderr: t, all: r }, { encoding: n, buffer: i, maxBuffer: s }, a) => {
1222
+ let c = wt(e, { encoding: n, buffer: i, maxBuffer: s }), u = wt(t, { encoding: n, buffer: i, maxBuffer: s }), l = wt(r, { encoding: n, buffer: i,
1223
+ maxBuffer: s * 2 });
1224
+ try {
1225
+ return await Promise.all([a, c, u, l]);
1226
+ } catch (f) {
1227
+ return Promise.all([
1228
+ { error: f, signal: f.signal, timedOut: f.timedOut },
1229
+ St(e, c),
1230
+ St(t, u),
1231
+ St(r, l)
1232
+ ]);
1233
+ }
1234
+ }, "getSpawnedResult"), ha = /* @__PURE__ */ o(({ input: e }) => {
1235
+ if (Un(e))
1236
+ throw new TypeError("The `input` option cannot be a stream in sync mode");
1237
+ }, "validateInputSync");
1238
+ $n.exports = {
1239
+ handleInput: pa,
1240
+ makeAllStream: da,
1241
+ getSpawnedResult: ma,
1242
+ validateInputSync: ha
1243
+ };
1244
+ });
1245
+
1246
+ // ../node_modules/execa/lib/promise.js
1247
+ var Hn = p((Kf, Wn) => {
1248
+ "use strict";
1249
+ var ya = (async () => {
1250
+ })().constructor.prototype, ga = ["then", "catch", "finally"].map((e) => [
1251
+ e,
1252
+ Reflect.getOwnPropertyDescriptor(ya, e)
1253
+ ]), ba = /* @__PURE__ */ o((e, t) => {
1254
+ for (let [r, n] of ga) {
1255
+ let i = typeof t == "function" ? (...s) => Reflect.apply(n.value, t(), s) : n.value.bind(t);
1256
+ Reflect.defineProperty(e, r, { ...n, value: i });
1257
+ }
1258
+ return e;
1259
+ }, "mergePromise"), xa = /* @__PURE__ */ o((e) => new Promise((t, r) => {
1260
+ e.on("exit", (n, i) => {
1261
+ t({ exitCode: n, signal: i });
1262
+ }), e.on("error", (n) => {
1263
+ r(n);
1264
+ }), e.stdin && e.stdin.on("error", (n) => {
1265
+ r(n);
1266
+ });
1267
+ }), "getSpawnedPromise");
1268
+ Wn.exports = {
1269
+ mergePromise: ba,
1270
+ getSpawnedPromise: xa
1271
+ };
1272
+ });
1273
+
1274
+ // ../node_modules/execa/lib/command.js
1275
+ var Jn = p((Xf, zn) => {
1276
+ "use strict";
1277
+ var Vn = /* @__PURE__ */ o((e, t = []) => Array.isArray(t) ? [e, ...t] : [e], "normalizeArgs"), Sa = /^[\w.-]+$/, wa = /"/g, va = /* @__PURE__ */ o(
1278
+ (e) => typeof e != "string" || Sa.test(e) ? e : `"${e.replace(wa, '\\"')}"`, "escapeArg"), Pa = /* @__PURE__ */ o((e, t) => Vn(e, t).join(
1279
+ " "), "joinCommand"), Ea = /* @__PURE__ */ o((e, t) => Vn(e, t).map((r) => va(r)).join(" "), "getEscapedCommand"), Ta = / +/g, ka = /* @__PURE__ */ o(
1280
+ (e) => {
1281
+ let t = [];
1282
+ for (let r of e.trim().split(Ta)) {
1283
+ let n = t[t.length - 1];
1284
+ n && n.endsWith("\\") ? t[t.length - 1] = `${n.slice(0, -1)} ${r}` : t.push(r);
1285
+ }
1286
+ return t;
1287
+ }, "parseCommand");
1288
+ zn.exports = {
1289
+ joinCommand: Pa,
1290
+ getEscapedCommand: Ea,
1291
+ parseCommand: ka
1292
+ };
1293
+ });
1294
+
1295
+ // ../node_modules/execa/index.js
1296
+ var to = p((Zf, H) => {
1297
+ "use strict";
1298
+ var Ia = b("path"), vt = b("child_process"), Ca = pt(), Oa = cn(), Aa = fn(), Ra = hn(), Pe = Pn(), Yn = Tn(), { spawnedKill: _a, spawnedCancel: Ga,
1299
+ setupTimeout: ja, validateTimeout: Na, setExitHandler: Ba } = Gn(), { handleInput: Da, getSpawnedResult: Ma, makeAllStream: La, validateInputSync: Fa } = qn(),
1300
+ { mergePromise: Kn, getSpawnedPromise: Ua } = Hn(), { joinCommand: Xn, parseCommand: Qn, getEscapedCommand: Zn } = Jn(), $a = 1e3 * 1e3 * 100,
1301
+ qa = /* @__PURE__ */ o(({ env: e, extendEnv: t, preferLocal: r, localDir: n, execPath: i }) => {
1302
+ let s = t ? { ...process.env, ...e } : e;
1303
+ return r ? Aa.env({ env: s, cwd: n, execPath: i }) : s;
1304
+ }, "getEnv"), eo = /* @__PURE__ */ o((e, t, r = {}) => {
1305
+ let n = Ca._parse(e, t, r);
1306
+ return e = n.command, t = n.args, r = n.options, r = {
1307
+ maxBuffer: $a,
1308
+ buffer: !0,
1309
+ stripFinalNewline: !0,
1310
+ extendEnv: !0,
1311
+ preferLocal: !1,
1312
+ localDir: r.cwd || process.cwd(),
1313
+ execPath: process.execPath,
1314
+ encoding: "utf8",
1315
+ reject: !0,
1316
+ cleanup: !0,
1317
+ all: !1,
1318
+ windowsHide: !0,
1319
+ ...r
1320
+ }, r.env = qa(r), r.stdio = Yn(r), process.platform === "win32" && Ia.basename(e, ".exe") === "cmd" && t.unshift("/q"), { file: e, args: t,
1321
+ options: r, parsed: n };
1322
+ }, "handleArguments"), Q = /* @__PURE__ */ o((e, t, r) => typeof t != "string" && !Buffer.isBuffer(t) ? r === void 0 ? void 0 : "" : e.stripFinalNewline ?
1323
+ Oa(t) : t, "handleOutput"), Ee = /* @__PURE__ */ o((e, t, r) => {
1324
+ let n = eo(e, t, r), i = Xn(e, t), s = Zn(e, t);
1325
+ Na(n.options);
1326
+ let a;
1327
+ try {
1328
+ a = vt.spawn(n.file, n.args, n.options);
1329
+ } catch (m) {
1330
+ let y = new vt.ChildProcess(), h = Promise.reject(Pe({
1331
+ error: m,
1332
+ stdout: "",
1333
+ stderr: "",
1334
+ all: "",
1335
+ command: i,
1336
+ escapedCommand: s,
1337
+ parsed: n,
1338
+ timedOut: !1,
1339
+ isCanceled: !1,
1340
+ killed: !1
1341
+ }));
1342
+ return Kn(y, h);
1343
+ }
1344
+ let c = Ua(a), u = ja(a, n.options, c), l = Ba(a, n.options, u), f = { isCanceled: !1 };
1345
+ a.kill = _a.bind(null, a.kill.bind(a)), a.cancel = Ga.bind(null, a, f);
1346
+ let g = Ra(/* @__PURE__ */ o(async () => {
1347
+ let [{ error: m, exitCode: y, signal: h, timedOut: S }, T, E, I] = await Ma(a, n.options, l), O = Q(n.options, T), A = Q(n.options, E),
1348
+ d = Q(n.options, I);
1349
+ if (m || y !== 0 || h !== null) {
1350
+ let v = Pe({
1351
+ error: m,
1352
+ exitCode: y,
1353
+ signal: h,
1354
+ stdout: O,
1355
+ stderr: A,
1356
+ all: d,
1357
+ command: i,
1358
+ escapedCommand: s,
1359
+ parsed: n,
1360
+ timedOut: S,
1361
+ isCanceled: f.isCanceled,
1362
+ killed: a.killed
1363
+ });
1364
+ if (!n.options.reject)
1365
+ return v;
1366
+ throw v;
1367
+ }
1368
+ return {
1369
+ command: i,
1370
+ escapedCommand: s,
1371
+ exitCode: 0,
1372
+ stdout: O,
1373
+ stderr: A,
1374
+ all: d,
1375
+ failed: !1,
1376
+ timedOut: !1,
1377
+ isCanceled: !1,
1378
+ killed: !1
1379
+ };
1380
+ }, "handlePromise"));
1381
+ return Da(a, n.options.input), a.all = La(a, n.options), Kn(a, g);
1382
+ }, "execa");
1383
+ H.exports = Ee;
1384
+ H.exports.sync = (e, t, r) => {
1385
+ let n = eo(e, t, r), i = Xn(e, t), s = Zn(e, t);
1386
+ Fa(n.options);
1387
+ let a;
1388
+ try {
1389
+ a = vt.spawnSync(n.file, n.args, n.options);
1390
+ } catch (l) {
1391
+ throw Pe({
1392
+ error: l,
1393
+ stdout: "",
1394
+ stderr: "",
1395
+ all: "",
1396
+ command: i,
1397
+ escapedCommand: s,
1398
+ parsed: n,
1399
+ timedOut: !1,
1400
+ isCanceled: !1,
1401
+ killed: !1
1402
+ });
1403
+ }
1404
+ let c = Q(n.options, a.stdout, a.error), u = Q(n.options, a.stderr, a.error);
1405
+ if (a.error || a.status !== 0 || a.signal !== null) {
1406
+ let l = Pe({
1407
+ stdout: c,
1408
+ stderr: u,
1409
+ error: a.error,
1410
+ signal: a.signal,
1411
+ exitCode: a.status,
1412
+ command: i,
1413
+ escapedCommand: s,
1414
+ parsed: n,
1415
+ timedOut: a.error && a.error.code === "ETIMEDOUT",
1416
+ isCanceled: !1,
1417
+ killed: a.signal !== null
1418
+ });
1419
+ if (!n.options.reject)
1420
+ return l;
1421
+ throw l;
1422
+ }
1423
+ return {
1424
+ command: i,
1425
+ escapedCommand: s,
1426
+ exitCode: 0,
1427
+ stdout: c,
1428
+ stderr: u,
1429
+ failed: !1,
1430
+ timedOut: !1,
1431
+ isCanceled: !1,
1432
+ killed: !1
1433
+ };
1434
+ };
1435
+ H.exports.command = (e, t) => {
1436
+ let [r, ...n] = Qn(e);
1437
+ return Ee(r, n, t);
1438
+ };
1439
+ H.exports.commandSync = (e, t) => {
1440
+ let [r, ...n] = Qn(e);
1441
+ return Ee.sync(r, n, t);
1442
+ };
1443
+ H.exports.node = (e, t, r = {}) => {
1444
+ t && !Array.isArray(t) && typeof t == "object" && (r = t, t = []);
1445
+ let n = Yn.node(r), i = process.execArgv.filter((c) => !c.startsWith("--inspect")), {
1446
+ nodePath: s = process.execPath,
1447
+ nodeOptions: a = i
1448
+ } = r;
1449
+ return Ee(
1450
+ s,
1451
+ [
1452
+ ...a,
1453
+ e,
1454
+ ...Array.isArray(t) ? t : []
1455
+ ],
1456
+ {
1457
+ ...r,
1458
+ stdin: void 0,
1459
+ stdout: void 0,
1460
+ stderr: void 0,
1461
+ stdio: n,
1462
+ shell: !1
1463
+ }
1464
+ );
1465
+ };
1466
+ });
1467
+
1468
+ // ../node_modules/detect-package-manager/dist/index.js
1469
+ var io = p((oo) => {
1470
+ var Wa = Object.create, Ie = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor, Va = Object.getOwnPropertyNames, za = Object.getPrototypeOf,
1471
+ Ja = Object.prototype.hasOwnProperty, ro = /* @__PURE__ */ o((e) => Ie(e, "__esModule", { value: !0 }), "__markAsModule"), Ka = /* @__PURE__ */ o(
1472
+ (e, t) => {
1473
+ ro(e);
1474
+ for (var r in t)
1475
+ Ie(e, r, { get: t[r], enumerable: !0 });
1476
+ }, "__export"), Ya = /* @__PURE__ */ o((e, t, r) => {
1477
+ if (t && typeof t == "object" || typeof t == "function")
1478
+ for (let n of Va(t))
1479
+ !Ja.call(e, n) && n !== "default" && Ie(e, n, { get: /* @__PURE__ */ o(() => t[n], "get"), enumerable: !(r = Ha(t, n)) || r.enumerable });
1480
+ return e;
1481
+ }, "__reExport"), Et = /* @__PURE__ */ o((e) => Ya(ro(Ie(e != null ? Wa(za(e)) : {}, "default", e && e.__esModule && "default" in e ? { get: /* @__PURE__ */ o(
1482
+ () => e.default, "get"), enumerable: !0 } : { value: e, enumerable: !0 })), e), "__toModule");
1483
+ Ka(oo, {
1484
+ clearCache: /* @__PURE__ */ o(() => tc, "clearCache"),
1485
+ detect: /* @__PURE__ */ o(() => Za, "detect"),
1486
+ getNpmVersion: /* @__PURE__ */ o(() => ec, "getNpmVersion")
1487
+ });
1488
+ var Xa = Et(b("fs")), Te = Et(b("path")), no = Et(to());
1489
+ async function ke(e) {
1490
+ try {
1491
+ return await Xa.promises.access(e), !0;
1492
+ } catch {
1493
+ return !1;
1494
+ }
1495
+ }
1496
+ o(ke, "pathExists");
1497
+ var j = /* @__PURE__ */ new Map();
1498
+ function Pt(e) {
1499
+ let t = `has_global_${e}`;
1500
+ return j.has(t) ? Promise.resolve(j.get(t)) : (0, no.default)(e, ["--version"]).then((r) => /^\d+.\d+.\d+$/.test(r.stdout)).then((r) => (j.
1501
+ set(t, r), r)).catch(() => !1);
1502
+ }
1503
+ o(Pt, "hasGlobalInstallation");
1504
+ function Qa(e = ".") {
1505
+ let t = `lockfile_${e}`;
1506
+ return j.has(t) ? Promise.resolve(j.get(t)) : Promise.all([
1507
+ ke((0, Te.resolve)(e, "yarn.lock")),
1508
+ ke((0, Te.resolve)(e, "package-lock.json")),
1509
+ ke((0, Te.resolve)(e, "pnpm-lock.yaml")),
1510
+ ke((0, Te.resolve)(e, "bun.lockb"))
1511
+ ]).then(([r, n, i, s]) => {
1512
+ let a = null;
1513
+ return r ? a = "yarn" : i ? a = "pnpm" : s ? a = "bun" : n && (a = "npm"), j.set(t, a), a;
1514
+ });
1515
+ }
1516
+ o(Qa, "getTypeofLockFile");
1517
+ var Za = /* @__PURE__ */ o(async ({
1518
+ cwd: e,
1519
+ includeGlobalBun: t
1520
+ } = {}) => {
1521
+ let r = await Qa(e);
1522
+ if (r)
1523
+ return r;
1524
+ let [n, i, s] = await Promise.all([
1525
+ Pt("yarn"),
1526
+ Pt("pnpm"),
1527
+ t && Pt("bun")
1528
+ ]);
1529
+ return n ? "yarn" : i ? "pnpm" : s ? "bun" : "npm";
1530
+ }, "detect");
1531
+ function ec(e) {
1532
+ return (0, no.default)(e || "npm", ["--version"]).then((t) => t.stdout);
1533
+ }
1534
+ o(ec, "getNpmVersion");
1535
+ function tc() {
1536
+ return j.clear();
1537
+ }
1538
+ o(tc, "clearCache");
1539
+ });
1540
+
1541
+ // ../node_modules/walk-up-path/dist/cjs/index.js
1542
+ var ao = p((Ce) => {
1543
+ "use strict";
1544
+ Object.defineProperty(Ce, "__esModule", { value: !0 });
1545
+ Ce.walkUp = void 0;
1546
+ var so = b("path"), rc = /* @__PURE__ */ o(function* (e) {
1547
+ for (e = (0, so.resolve)(e); e; ) {
1548
+ yield e;
1549
+ let t = (0, so.dirname)(e);
1550
+ if (t === e)
1551
+ break;
1552
+ e = t;
1553
+ }
1554
+ }, "walkUp");
1555
+ Ce.walkUp = rc;
1556
+ });
1557
+
1558
+ // ../node_modules/common-path-prefix/index.js
1559
+ var si = p((Am, ii) => {
1560
+ "use strict";
1561
+ var { sep: _u } = b("path"), Gu = /* @__PURE__ */ o((e) => {
1562
+ for (let t of e) {
1563
+ let r = /(\/|\\)/.exec(t);
1564
+ if (r !== null) return r[0];
1565
+ }
1566
+ return _u;
1567
+ }, "determineSeparator");
1568
+ ii.exports = /* @__PURE__ */ o(function(t, r = Gu(t)) {
1569
+ let [n = "", ...i] = t;
1570
+ if (n === "" || i.length === 0) return "";
1571
+ let s = n.split(r), a = s.length;
1572
+ for (let u of i) {
1573
+ let l = u.split(r);
1574
+ for (let f = 0; f < a; f++)
1575
+ l[f] !== s[f] && (a = f);
1576
+ if (a === 0) return "";
1577
+ }
1578
+ let c = s.slice(0, a).join(r);
1579
+ return c.endsWith(r) ? c : c + r;
1580
+ }, "commonPathPrefix");
1581
+ });
1582
+
1583
+ // ../node_modules/fetch-retry/index.js
1584
+ var Ai = p((rg, Oi) => {
1585
+ "use strict";
1586
+ Oi.exports = function(e, t) {
1587
+ if (t = t || {}, typeof e != "function")
1588
+ throw new C("fetch must be a function");
1589
+ if (typeof t != "object")
1590
+ throw new C("defaults must be an object");
1591
+ if (t.retries !== void 0 && !Xe(t.retries))
1592
+ throw new C("retries must be a positive integer");
1593
+ if (t.retryDelay !== void 0 && !Xe(t.retryDelay) && typeof t.retryDelay != "function")
1594
+ throw new C("retryDelay must be a positive integer or a function returning a positive integer");
1595
+ if (t.retryOn !== void 0 && !Array.isArray(t.retryOn) && typeof t.retryOn != "function")
1596
+ throw new C("retryOn property expects an array or function");
1597
+ var r = {
1598
+ retries: 3,
1599
+ retryDelay: 1e3,
1600
+ retryOn: []
1601
+ };
1602
+ return t = Object.assign(r, t), /* @__PURE__ */ o(function(i, s) {
1603
+ var a = t.retries, c = t.retryDelay, u = t.retryOn;
1604
+ if (s && s.retries !== void 0)
1605
+ if (Xe(s.retries))
1606
+ a = s.retries;
1607
+ else
1608
+ throw new C("retries must be a positive integer");
1609
+ if (s && s.retryDelay !== void 0)
1610
+ if (Xe(s.retryDelay) || typeof s.retryDelay == "function")
1611
+ c = s.retryDelay;
1612
+ else
1613
+ throw new C("retryDelay must be a positive integer or a function returning a positive integer");
1614
+ if (s && s.retryOn)
1615
+ if (Array.isArray(s.retryOn) || typeof s.retryOn == "function")
1616
+ u = s.retryOn;
1617
+ else
1618
+ throw new C("retryOn property expects an array or function");
1619
+ return new Promise(function(l, f) {
1620
+ var x = /* @__PURE__ */ o(function(m) {
1621
+ var y = typeof Request < "u" && i instanceof Request ? i.clone() : i;
1622
+ e(y, s).then(function(h) {
1623
+ if (Array.isArray(u) && u.indexOf(h.status) === -1)
1624
+ l(h);
1625
+ else if (typeof u == "function")
1626
+ try {
1627
+ return Promise.resolve(u(m, null, h)).then(function(S) {
1628
+ S ? g(m, null, h) : l(h);
1629
+ }).catch(f);
1630
+ } catch (S) {
1631
+ f(S);
1632
+ }
1633
+ else
1634
+ m < a ? g(m, null, h) : l(h);
1635
+ }).catch(function(h) {
1636
+ if (typeof u == "function")
1637
+ try {
1638
+ Promise.resolve(u(m, h, null)).then(function(S) {
1639
+ S ? g(m, h, null) : f(h);
1640
+ }).catch(function(S) {
1641
+ f(S);
1642
+ });
1643
+ } catch (S) {
1644
+ f(S);
1645
+ }
1646
+ else m < a ? g(m, h, null) : f(h);
1647
+ });
1648
+ }, "wrappedFetch");
1649
+ function g(m, y, h) {
1650
+ var S = typeof c == "function" ? c(m, y, h) : c;
1651
+ setTimeout(function() {
1652
+ x(++m);
1653
+ }, S);
1654
+ }
1655
+ o(g, "retry"), x(0);
1656
+ });
1657
+ }, "fetchRetry");
1658
+ };
1659
+ function Xe(e) {
1660
+ return Number.isInteger(e) && e >= 0;
1661
+ }
1662
+ o(Xe, "isPositiveInteger");
1663
+ function C(e) {
1664
+ this.name = "ArgumentError", this.message = e;
1665
+ }
1666
+ o(C, "ArgumentError");
1667
+ });
1668
+
1669
+ // src/telemetry/index.ts
1670
+ import { logger as Ui } from "storybook/internal/node-logger";
1671
+
1672
+ // src/telemetry/notify.ts
1673
+ var le = R(dr(), 1);
1674
+ import { cache as mr } from "storybook/internal/common";
1675
+ var hr = "telemetry-notification-date", D = console, yr = /* @__PURE__ */ o(async () => {
1676
+ await mr.get(hr, null) || (mr.set(hr, Date.now()), D.log(), D.log(
1677
+ `${le.default.magenta(
1678
+ le.default.bold("attention")
1679
+ )} => Storybook now collects completely anonymous telemetry regarding usage.`
1680
+ ), D.log("This information is used to shape Storybook's roadmap and prioritize features."), D.log(
1681
+ "You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"
1682
+ ), D.log(le.default.cyan("https://storybook.js.org/telemetry")), D.log());
1683
+ }, "notify");
1684
+
1685
+ // src/telemetry/sanitize.ts
1686
+ import xr from "node:path";
1687
+ function gr(e) {
1688
+ return e.replace(/[-[/{}()*+?.\\^$|]/g, "\\$&");
1689
+ }
1690
+ o(gr, "regexpEscape");
1691
+ function br(e = "") {
1692
+ return e.replace(/\u001B\[[0-9;]*m/g, "");
1693
+ }
1694
+ o(br, "removeAnsiEscapeCodes");
1695
+ function z(e, t = xr.sep) {
1696
+ if (!e)
1697
+ return e;
1698
+ let r = process.cwd().split(t);
1699
+ for (; r.length > 1; ) {
1700
+ let n = r.join(t), i = new RegExp(gr(n), "gi");
1701
+ e = e.replace(i, "$SNIP");
1702
+ let s = r.join(t + t), a = new RegExp(gr(s), "gi");
1703
+ e = e.replace(a, "$SNIP"), r.pop();
1704
+ }
1705
+ return e;
1706
+ }
1707
+ o(z, "cleanPaths");
1708
+ function fe(e, t = xr.sep) {
1709
+ try {
1710
+ e = {
1711
+ ...JSON.parse(JSON.stringify(e)),
1712
+ message: br(e.message),
1713
+ stack: br(e.stack),
1714
+ cause: e.cause,
1715
+ name: e.name
1716
+ };
1717
+ let r = z(JSON.stringify(e), t);
1718
+ return JSON.parse(r);
1719
+ } catch (r) {
1720
+ return `Sanitization error: ${r?.message}`;
1721
+ }
1722
+ }
1723
+ o(fe, "sanitizeError");
1724
+
1725
+ // src/telemetry/storybook-metadata.ts
1726
+ var Ye = R(io(), 1);
1727
+ import { dirname as ul } from "node:path";
1728
+ import {
1729
+ getProjectRoot as ll,
1730
+ getStorybookConfiguration as fl,
1731
+ getStorybookInfo as pl,
1732
+ loadMainConfig as dl
1733
+ } from "storybook/internal/common";
1734
+ import { readConfig as ml } from "storybook/internal/csf-tools";
1735
+
1736
+ // ../node_modules/fd-package-json/dist/esm/main.js
1737
+ var co = R(ao(), 1);
1738
+ import { resolve as nc } from "node:path";
1739
+ import { stat as oc, readFile as ic } from "node:fs/promises";
1740
+ import { statSync as cp, readFileSync as up } from "node:fs";
1741
+ async function sc(e) {
1742
+ try {
1743
+ return (await oc(e)).isFile();
1744
+ } catch {
1745
+ return !1;
1746
+ }
1747
+ }
1748
+ o(sc, "fileExists");
1749
+ async function Tt(e) {
1750
+ for (let t of (0, co.walkUp)(e)) {
1751
+ let r = nc(t, "package.json");
1752
+ if (await sc(r))
1753
+ return r;
1754
+ }
1755
+ return null;
1756
+ }
1757
+ o(Tt, "findPackagePath");
1758
+ async function uo(e) {
1759
+ let t = await Tt(e);
1760
+ if (!t)
1761
+ return null;
1762
+ try {
1763
+ let r = await ic(t, { encoding: "utf8" });
1764
+ return JSON.parse(r);
1765
+ } catch {
1766
+ return null;
1767
+ }
1768
+ }
1769
+ o(uo, "findPackage");
1770
+
1771
+ // src/telemetry/get-application-file-count.ts
1772
+ import { sep as Ju } from "node:path";
1773
+
1774
+ // src/telemetry/exec-command-count-lines.ts
1775
+ import { createInterface as Tu } from "node:readline";
1776
+
1777
+ // node_modules/execa/index.js
1778
+ var Ko = R(pt(), 1);
1779
+ import { Buffer as xu } from "node:buffer";
1780
+ import Su from "node:path";
1781
+ import Yt from "node:child_process";
1782
+ import $e from "node:process";
1783
+
1784
+ // ../node_modules/strip-final-newline/index.js
1785
+ function kt(e) {
1786
+ let t = typeof e == "string" ? `
1787
+ ` : 10, r = typeof e == "string" ? "\r" : 13;
1788
+ return e[e.length - 1] === t && (e = e.slice(0, -1)), e[e.length - 1] === r && (e = e.slice(0, -1)), e;
1789
+ }
1790
+ o(kt, "stripFinalNewline");
1791
+
1792
+ // node_modules/npm-run-path/index.js
1793
+ import Ae from "node:process";
1794
+ import Z from "node:path";
1795
+ import ac from "node:url";
1796
+
1797
+ // node_modules/path-key/index.js
1798
+ function Oe(e = {}) {
1799
+ let {
1800
+ env: t = process.env,
1801
+ platform: r = process.platform
1802
+ } = e;
1803
+ return r !== "win32" ? "PATH" : Object.keys(t).reverse().find((n) => n.toUpperCase() === "PATH") || "Path";
1804
+ }
1805
+ o(Oe, "pathKey");
1806
+
1807
+ // node_modules/npm-run-path/index.js
1808
+ function cc(e = {}) {
1809
+ let {
1810
+ cwd: t = Ae.cwd(),
1811
+ path: r = Ae.env[Oe()],
1812
+ execPath: n = Ae.execPath
1813
+ } = e, i, s = t instanceof URL ? ac.fileURLToPath(t) : t, a = Z.resolve(s), c = [];
1814
+ for (; i !== a; )
1815
+ c.push(Z.join(a, "node_modules/.bin")), i = a, a = Z.resolve(a, "..");
1816
+ return c.push(Z.resolve(s, n, "..")), [...c, r].join(Z.delimiter);
1817
+ }
1818
+ o(cc, "npmRunPath");
1819
+ function lo({ env: e = Ae.env, ...t } = {}) {
1820
+ e = { ...e };
1821
+ let r = Oe({ env: e });
1822
+ return t.path = e[r], e[r] = cc(t), e;
1823
+ }
1824
+ o(lo, "npmRunPathEnv");
1825
+
1826
+ // node_modules/mimic-fn/index.js
1827
+ var uc = /* @__PURE__ */ o((e, t, r, n) => {
1828
+ if (r === "length" || r === "prototype" || r === "arguments" || r === "caller")
1829
+ return;
1830
+ let i = Object.getOwnPropertyDescriptor(e, r), s = Object.getOwnPropertyDescriptor(t, r);
1831
+ !lc(i, s) && n || Object.defineProperty(e, r, s);
1832
+ }, "copyProperty"), lc = /* @__PURE__ */ o(function(e, t) {
1833
+ return e === void 0 || e.configurable || e.writable === t.writable && e.enumerable === t.enumerable && e.configurable === t.configurable &&
1834
+ (e.writable || e.value === t.value);
1835
+ }, "canCopyProperty"), fc = /* @__PURE__ */ o((e, t) => {
1836
+ let r = Object.getPrototypeOf(t);
1837
+ r !== Object.getPrototypeOf(e) && Object.setPrototypeOf(e, r);
1838
+ }, "changePrototype"), pc = /* @__PURE__ */ o((e, t) => `/* Wrapped ${e}*/
1839
+ ${t}`, "wrappedToString"), dc = Object.getOwnPropertyDescriptor(Function.prototype, "toString"), mc = Object.getOwnPropertyDescriptor(Function.
1840
+ prototype.toString, "name"), hc = /* @__PURE__ */ o((e, t, r) => {
1841
+ let n = r === "" ? "" : `with ${r.trim()}() `, i = pc.bind(null, n, t.toString());
1842
+ Object.defineProperty(i, "name", mc), Object.defineProperty(e, "toString", { ...dc, value: i });
1843
+ }, "changeToString");
1844
+ function It(e, t, { ignoreNonConfigurable: r = !1 } = {}) {
1845
+ let { name: n } = e;
1846
+ for (let i of Reflect.ownKeys(t))
1847
+ uc(e, t, i, r);
1848
+ return fc(e, t), hc(e, t, n), e;
1849
+ }
1850
+ o(It, "mimicFunction");
1851
+
1852
+ // node_modules/onetime/index.js
1853
+ var Re = /* @__PURE__ */ new WeakMap(), fo = /* @__PURE__ */ o((e, t = {}) => {
1854
+ if (typeof e != "function")
1855
+ throw new TypeError("Expected a function");
1856
+ let r, n = 0, i = e.displayName || e.name || "<anonymous>", s = /* @__PURE__ */ o(function(...a) {
1857
+ if (Re.set(s, ++n), n === 1)
1858
+ r = e.apply(this, a), e = null;
1859
+ else if (t.throw === !0)
1860
+ throw new Error(`Function \`${i}\` can only be called once`);
1861
+ return r;
1862
+ }, "onetime");
1863
+ return It(s, e), Re.set(s, n), s;
1864
+ }, "onetime");
1865
+ fo.callCount = (e) => {
1866
+ if (!Re.has(e))
1867
+ throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);
1868
+ return Re.get(e);
1869
+ };
1870
+ var po = fo;
1871
+
1872
+ // node_modules/execa/lib/error.js
1873
+ import Tc from "node:process";
1874
+
1875
+ // node_modules/human-signals/build/src/main.js
1876
+ import { constants as xc } from "node:os";
1877
+
1878
+ // node_modules/human-signals/build/src/realtime.js
1879
+ var mo = /* @__PURE__ */ o(() => {
1880
+ let e = Ct - ho + 1;
1881
+ return Array.from({ length: e }, yc);
1882
+ }, "getRealtimeSignals"), yc = /* @__PURE__ */ o((e, t) => ({
1883
+ name: `SIGRT${t + 1}`,
1884
+ number: ho + t,
1885
+ action: "terminate",
1886
+ description: "Application-specific signal (realtime)",
1887
+ standard: "posix"
1888
+ }), "getRealtimeSignal"), ho = 34, Ct = 64;
1889
+
1890
+ // node_modules/human-signals/build/src/signals.js
1891
+ import { constants as gc } from "node:os";
1892
+
1893
+ // node_modules/human-signals/build/src/core.js
1894
+ var yo = [
1895
+ {
1896
+ name: "SIGHUP",
1897
+ number: 1,
1898
+ action: "terminate",
1899
+ description: "Terminal closed",
1900
+ standard: "posix"
1901
+ },
1902
+ {
1903
+ name: "SIGINT",
1904
+ number: 2,
1905
+ action: "terminate",
1906
+ description: "User interruption with CTRL-C",
1907
+ standard: "ansi"
1908
+ },
1909
+ {
1910
+ name: "SIGQUIT",
1911
+ number: 3,
1912
+ action: "core",
1913
+ description: "User interruption with CTRL-\\",
1914
+ standard: "posix"
1915
+ },
1916
+ {
1917
+ name: "SIGILL",
1918
+ number: 4,
1919
+ action: "core",
1920
+ description: "Invalid machine instruction",
1921
+ standard: "ansi"
1922
+ },
1923
+ {
1924
+ name: "SIGTRAP",
1925
+ number: 5,
1926
+ action: "core",
1927
+ description: "Debugger breakpoint",
1928
+ standard: "posix"
1929
+ },
1930
+ {
1931
+ name: "SIGABRT",
1932
+ number: 6,
1933
+ action: "core",
1934
+ description: "Aborted",
1935
+ standard: "ansi"
1936
+ },
1937
+ {
1938
+ name: "SIGIOT",
1939
+ number: 6,
1940
+ action: "core",
1941
+ description: "Aborted",
1942
+ standard: "bsd"
1943
+ },
1944
+ {
1945
+ name: "SIGBUS",
1946
+ number: 7,
1947
+ action: "core",
1948
+ description: "Bus error due to misaligned, non-existing address or paging error",
1949
+ standard: "bsd"
1950
+ },
1951
+ {
1952
+ name: "SIGEMT",
1953
+ number: 7,
1954
+ action: "terminate",
1955
+ description: "Command should be emulated but is not implemented",
1956
+ standard: "other"
1957
+ },
1958
+ {
1959
+ name: "SIGFPE",
1960
+ number: 8,
1961
+ action: "core",
1962
+ description: "Floating point arithmetic error",
1963
+ standard: "ansi"
1964
+ },
1965
+ {
1966
+ name: "SIGKILL",
1967
+ number: 9,
1968
+ action: "terminate",
1969
+ description: "Forced termination",
1970
+ standard: "posix",
1971
+ forced: !0
1972
+ },
1973
+ {
1974
+ name: "SIGUSR1",
1975
+ number: 10,
1976
+ action: "terminate",
1977
+ description: "Application-specific signal",
1978
+ standard: "posix"
1979
+ },
1980
+ {
1981
+ name: "SIGSEGV",
1982
+ number: 11,
1983
+ action: "core",
1984
+ description: "Segmentation fault",
1985
+ standard: "ansi"
1986
+ },
1987
+ {
1988
+ name: "SIGUSR2",
1989
+ number: 12,
1990
+ action: "terminate",
1991
+ description: "Application-specific signal",
1992
+ standard: "posix"
1993
+ },
1994
+ {
1995
+ name: "SIGPIPE",
1996
+ number: 13,
1997
+ action: "terminate",
1998
+ description: "Broken pipe or socket",
1999
+ standard: "posix"
2000
+ },
2001
+ {
2002
+ name: "SIGALRM",
2003
+ number: 14,
2004
+ action: "terminate",
2005
+ description: "Timeout or timer",
2006
+ standard: "posix"
2007
+ },
2008
+ {
2009
+ name: "SIGTERM",
2010
+ number: 15,
2011
+ action: "terminate",
2012
+ description: "Termination",
2013
+ standard: "ansi"
2014
+ },
2015
+ {
2016
+ name: "SIGSTKFLT",
2017
+ number: 16,
2018
+ action: "terminate",
2019
+ description: "Stack is empty or overflowed",
2020
+ standard: "other"
2021
+ },
2022
+ {
2023
+ name: "SIGCHLD",
2024
+ number: 17,
2025
+ action: "ignore",
2026
+ description: "Child process terminated, paused or unpaused",
2027
+ standard: "posix"
2028
+ },
2029
+ {
2030
+ name: "SIGCLD",
2031
+ number: 17,
2032
+ action: "ignore",
2033
+ description: "Child process terminated, paused or unpaused",
2034
+ standard: "other"
2035
+ },
2036
+ {
2037
+ name: "SIGCONT",
2038
+ number: 18,
2039
+ action: "unpause",
2040
+ description: "Unpaused",
2041
+ standard: "posix",
2042
+ forced: !0
2043
+ },
2044
+ {
2045
+ name: "SIGSTOP",
2046
+ number: 19,
2047
+ action: "pause",
2048
+ description: "Paused",
2049
+ standard: "posix",
2050
+ forced: !0
2051
+ },
2052
+ {
2053
+ name: "SIGTSTP",
2054
+ number: 20,
2055
+ action: "pause",
2056
+ description: 'Paused using CTRL-Z or "suspend"',
2057
+ standard: "posix"
2058
+ },
2059
+ {
2060
+ name: "SIGTTIN",
2061
+ number: 21,
2062
+ action: "pause",
2063
+ description: "Background process cannot read terminal input",
2064
+ standard: "posix"
2065
+ },
2066
+ {
2067
+ name: "SIGBREAK",
2068
+ number: 21,
2069
+ action: "terminate",
2070
+ description: "User interruption with CTRL-BREAK",
2071
+ standard: "other"
2072
+ },
2073
+ {
2074
+ name: "SIGTTOU",
2075
+ number: 22,
2076
+ action: "pause",
2077
+ description: "Background process cannot write to terminal output",
2078
+ standard: "posix"
2079
+ },
2080
+ {
2081
+ name: "SIGURG",
2082
+ number: 23,
2083
+ action: "ignore",
2084
+ description: "Socket received out-of-band data",
2085
+ standard: "bsd"
2086
+ },
2087
+ {
2088
+ name: "SIGXCPU",
2089
+ number: 24,
2090
+ action: "core",
2091
+ description: "Process timed out",
2092
+ standard: "bsd"
2093
+ },
2094
+ {
2095
+ name: "SIGXFSZ",
2096
+ number: 25,
2097
+ action: "core",
2098
+ description: "File too big",
2099
+ standard: "bsd"
2100
+ },
2101
+ {
2102
+ name: "SIGVTALRM",
2103
+ number: 26,
2104
+ action: "terminate",
2105
+ description: "Timeout or timer",
2106
+ standard: "bsd"
2107
+ },
2108
+ {
2109
+ name: "SIGPROF",
2110
+ number: 27,
2111
+ action: "terminate",
2112
+ description: "Timeout or timer",
2113
+ standard: "bsd"
2114
+ },
2115
+ {
2116
+ name: "SIGWINCH",
2117
+ number: 28,
2118
+ action: "ignore",
2119
+ description: "Terminal window size changed",
2120
+ standard: "bsd"
2121
+ },
2122
+ {
2123
+ name: "SIGIO",
2124
+ number: 29,
2125
+ action: "terminate",
2126
+ description: "I/O is available",
2127
+ standard: "other"
2128
+ },
2129
+ {
2130
+ name: "SIGPOLL",
2131
+ number: 29,
2132
+ action: "terminate",
2133
+ description: "Watched event",
2134
+ standard: "other"
2135
+ },
2136
+ {
2137
+ name: "SIGINFO",
2138
+ number: 29,
2139
+ action: "ignore",
2140
+ description: "Request for process information",
2141
+ standard: "other"
2142
+ },
2143
+ {
2144
+ name: "SIGPWR",
2145
+ number: 30,
2146
+ action: "terminate",
2147
+ description: "Device running out of power",
2148
+ standard: "systemv"
2149
+ },
2150
+ {
2151
+ name: "SIGSYS",
2152
+ number: 31,
2153
+ action: "core",
2154
+ description: "Invalid system call",
2155
+ standard: "other"
2156
+ },
2157
+ {
2158
+ name: "SIGUNUSED",
2159
+ number: 31,
2160
+ action: "terminate",
2161
+ description: "Invalid system call",
2162
+ standard: "other"
2163
+ }
2164
+ ];
2165
+
2166
+ // node_modules/human-signals/build/src/signals.js
2167
+ var Ot = /* @__PURE__ */ o(() => {
2168
+ let e = mo();
2169
+ return [...yo, ...e].map(bc);
2170
+ }, "getSignals"), bc = /* @__PURE__ */ o(({
2171
+ name: e,
2172
+ number: t,
2173
+ description: r,
2174
+ action: n,
2175
+ forced: i = !1,
2176
+ standard: s
2177
+ }) => {
2178
+ let {
2179
+ signals: { [e]: a }
2180
+ } = gc, c = a !== void 0;
2181
+ return { name: e, number: c ? a : t, description: r, supported: c, action: n, forced: i, standard: s };
2182
+ }, "normalizeSignal");
2183
+
2184
+ // node_modules/human-signals/build/src/main.js
2185
+ var Sc = /* @__PURE__ */ o(() => {
2186
+ let e = Ot();
2187
+ return Object.fromEntries(e.map(wc));
2188
+ }, "getSignalsByName"), wc = /* @__PURE__ */ o(({
2189
+ name: e,
2190
+ number: t,
2191
+ description: r,
2192
+ supported: n,
2193
+ action: i,
2194
+ forced: s,
2195
+ standard: a
2196
+ }) => [e, { name: e, number: t, description: r, supported: n, action: i, forced: s, standard: a }], "getSignalByName"), go = Sc(), vc = /* @__PURE__ */ o(
2197
+ () => {
2198
+ let e = Ot(), t = Ct + 1, r = Array.from(
2199
+ { length: t },
2200
+ (n, i) => Pc(i, e)
2201
+ );
2202
+ return Object.assign({}, ...r);
2203
+ }, "getSignalsByNumber"), Pc = /* @__PURE__ */ o((e, t) => {
2204
+ let r = Ec(e, t);
2205
+ if (r === void 0)
2206
+ return {};
2207
+ let { name: n, description: i, supported: s, action: a, forced: c, standard: u } = r;
2208
+ return {
2209
+ [e]: {
2210
+ name: n,
2211
+ number: e,
2212
+ description: i,
2213
+ supported: s,
2214
+ action: a,
2215
+ forced: c,
2216
+ standard: u
2217
+ }
2218
+ };
2219
+ }, "getSignalByNumber"), Ec = /* @__PURE__ */ o((e, t) => {
2220
+ let r = t.find(({ name: n }) => xc.signals[n] === e);
2221
+ return r !== void 0 ? r : t.find((n) => n.number === e);
2222
+ }, "findSignalByNumber"), Mp = vc();
2223
+
2224
+ // node_modules/execa/lib/error.js
2225
+ var kc = /* @__PURE__ */ o(({ timedOut: e, timeout: t, errorCode: r, signal: n, signalDescription: i, exitCode: s, isCanceled: a }) => e ? `\
2226
+ timed out after ${t} milliseconds` : a ? "was canceled" : r !== void 0 ? `failed with ${r}` : n !== void 0 ? `was killed with ${n} (${i})` :
2227
+ s !== void 0 ? `failed with exit code ${s}` : "failed", "getErrorPrefix"), ee = /* @__PURE__ */ o(({
2228
+ stdout: e,
2229
+ stderr: t,
2230
+ all: r,
2231
+ error: n,
2232
+ signal: i,
2233
+ exitCode: s,
2234
+ command: a,
2235
+ escapedCommand: c,
2236
+ timedOut: u,
2237
+ isCanceled: l,
2238
+ killed: f,
2239
+ parsed: { options: { timeout: x, cwd: g = Tc.cwd() } }
2240
+ }) => {
2241
+ s = s === null ? void 0 : s, i = i === null ? void 0 : i;
2242
+ let m = i === void 0 ? void 0 : go[i].description, y = n && n.code, S = `Command ${kc({ timedOut: u, timeout: x, errorCode: y, signal: i, signalDescription: m,
2243
+ exitCode: s, isCanceled: l })}: ${a}`, T = Object.prototype.toString.call(n) === "[object Error]", E = T ? `${S}
2244
+ ${n.message}` : S, I = [E, t, e].filter(Boolean).join(`
2245
+ `);
2246
+ return T ? (n.originalMessage = n.message, n.message = I) : n = new Error(I), n.shortMessage = E, n.command = a, n.escapedCommand = c, n.exitCode =
2247
+ s, n.signal = i, n.signalDescription = m, n.stdout = e, n.stderr = t, n.cwd = g, r !== void 0 && (n.all = r), "bufferedData" in n && delete n.
2248
+ bufferedData, n.failed = !0, n.timedOut = !!u, n.isCanceled = l, n.killed = f && !u, n;
2249
+ }, "makeError");
2250
+
2251
+ // node_modules/execa/lib/stdio.js
2252
+ var _e = ["stdin", "stdout", "stderr"], Ic = /* @__PURE__ */ o((e) => _e.some((t) => e[t] !== void 0), "hasAlias"), bo = /* @__PURE__ */ o((e) => {
2253
+ if (!e)
2254
+ return;
2255
+ let { stdio: t } = e;
2256
+ if (t === void 0)
2257
+ return _e.map((n) => e[n]);
2258
+ if (Ic(e))
2259
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${_e.map((n) => `\`${n}\``).join(", ")}`);
2260
+ if (typeof t == "string")
2261
+ return t;
2262
+ if (!Array.isArray(t))
2263
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);
2264
+ let r = Math.max(t.length, _e.length);
2265
+ return Array.from({ length: r }, (n, i) => t[i]);
2266
+ }, "normalizeStdio");
2267
+
2268
+ // node_modules/execa/lib/kill.js
2269
+ import Ac from "node:os";
2270
+
2271
+ // node_modules/signal-exit/dist/mjs/signals.js
2272
+ var N = [];
2273
+ N.push("SIGHUP", "SIGINT", "SIGTERM");
2274
+ process.platform !== "win32" && N.push(
2275
+ "SIGALRM",
2276
+ "SIGABRT",
2277
+ "SIGVTALRM",
2278
+ "SIGXCPU",
2279
+ "SIGXFSZ",
2280
+ "SIGUSR2",
2281
+ "SIGTRAP",
2282
+ "SIGSYS",
2283
+ "SIGQUIT",
2284
+ "SIGIOT"
2285
+ // should detect profiler and enable/disable accordingly.
2286
+ // see #21
2287
+ // 'SIGPROF'
2288
+ );
2289
+ process.platform === "linux" && N.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
2290
+
2291
+ // node_modules/signal-exit/dist/mjs/index.js
2292
+ var Ge = /* @__PURE__ */ o((e) => !!e && typeof e == "object" && typeof e.removeListener == "function" && typeof e.emit == "function" && typeof e.
2293
+ reallyExit == "function" && typeof e.listeners == "function" && typeof e.kill == "function" && typeof e.pid == "number" && typeof e.on == "f\
2294
+ unction", "processOk"), At = Symbol.for("signal-exit emitter"), Rt = globalThis, Cc = Object.defineProperty.bind(Object), _t = class {
2295
+ static {
2296
+ o(this, "Emitter");
2297
+ }
2298
+ emitted = {
2299
+ afterExit: !1,
2300
+ exit: !1
2301
+ };
2302
+ listeners = {
2303
+ afterExit: [],
2304
+ exit: []
2305
+ };
2306
+ count = 0;
2307
+ id = Math.random();
2308
+ constructor() {
2309
+ if (Rt[At])
2310
+ return Rt[At];
2311
+ Cc(Rt, At, {
2312
+ value: this,
2313
+ writable: !1,
2314
+ enumerable: !1,
2315
+ configurable: !1
2316
+ });
2317
+ }
2318
+ on(t, r) {
2319
+ this.listeners[t].push(r);
2320
+ }
2321
+ removeListener(t, r) {
2322
+ let n = this.listeners[t], i = n.indexOf(r);
2323
+ i !== -1 && (i === 0 && n.length === 1 ? n.length = 0 : n.splice(i, 1));
2324
+ }
2325
+ emit(t, r, n) {
2326
+ if (this.emitted[t])
2327
+ return !1;
2328
+ this.emitted[t] = !0;
2329
+ let i = !1;
2330
+ for (let s of this.listeners[t])
2331
+ i = s(r, n) === !0 || i;
2332
+ return t === "exit" && (i = this.emit("afterExit", r, n) || i), i;
2333
+ }
2334
+ }, je = class {
2335
+ static {
2336
+ o(this, "SignalExitBase");
2337
+ }
2338
+ }, Oc = /* @__PURE__ */ o((e) => ({
2339
+ onExit(t, r) {
2340
+ return e.onExit(t, r);
2341
+ },
2342
+ load() {
2343
+ return e.load();
2344
+ },
2345
+ unload() {
2346
+ return e.unload();
2347
+ }
2348
+ }), "signalExitWrap"), Gt = class extends je {
2349
+ static {
2350
+ o(this, "SignalExitFallback");
2351
+ }
2352
+ onExit() {
2353
+ return () => {
2354
+ };
2355
+ }
2356
+ load() {
2357
+ }
2358
+ unload() {
2359
+ }
2360
+ }, jt = class extends je {
2361
+ static {
2362
+ o(this, "SignalExit");
2363
+ }
2364
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
2365
+ // so use a supported signal instead
2366
+ /* c8 ignore start */
2367
+ #s = Nt.platform === "win32" ? "SIGINT" : "SIGHUP";
2368
+ /* c8 ignore stop */
2369
+ #t = new _t();
2370
+ #e;
2371
+ #o;
2372
+ #i;
2373
+ #n = {};
2374
+ #r = !1;
2375
+ constructor(t) {
2376
+ super(), this.#e = t, this.#n = {};
2377
+ for (let r of N)
2378
+ this.#n[r] = () => {
2379
+ let n = this.#e.listeners(r), { count: i } = this.#t, s = t;
2380
+ if (typeof s.__signal_exit_emitter__ == "object" && typeof s.__signal_exit_emitter__.count == "number" && (i += s.__signal_exit_emitter__.
2381
+ count), n.length === i) {
2382
+ this.unload();
2383
+ let a = this.#t.emit("exit", null, r), c = r === "SIGHUP" ? this.#s : r;
2384
+ a || t.kill(t.pid, c);
2385
+ }
2386
+ };
2387
+ this.#i = t.reallyExit, this.#o = t.emit;
2388
+ }
2389
+ onExit(t, r) {
2390
+ if (!Ge(this.#e))
2391
+ return () => {
2392
+ };
2393
+ this.#r === !1 && this.load();
2394
+ let n = r?.alwaysLast ? "afterExit" : "exit";
2395
+ return this.#t.on(n, t), () => {
2396
+ this.#t.removeListener(n, t), this.#t.listeners.exit.length === 0 && this.#t.listeners.afterExit.length === 0 && this.unload();
2397
+ };
2398
+ }
2399
+ load() {
2400
+ if (!this.#r) {
2401
+ this.#r = !0, this.#t.count += 1;
2402
+ for (let t of N)
2403
+ try {
2404
+ let r = this.#n[t];
2405
+ r && this.#e.on(t, r);
2406
+ } catch {
2407
+ }
2408
+ this.#e.emit = (t, ...r) => this.#c(t, ...r), this.#e.reallyExit = (t) => this.#a(t);
2409
+ }
2410
+ }
2411
+ unload() {
2412
+ this.#r && (this.#r = !1, N.forEach((t) => {
2413
+ let r = this.#n[t];
2414
+ if (!r)
2415
+ throw new Error("Listener not defined for signal: " + t);
2416
+ try {
2417
+ this.#e.removeListener(t, r);
2418
+ } catch {
2419
+ }
2420
+ }), this.#e.emit = this.#o, this.#e.reallyExit = this.#i, this.#t.count -= 1);
2421
+ }
2422
+ #a(t) {
2423
+ return Ge(this.#e) ? (this.#e.exitCode = t || 0, this.#t.emit("exit", this.#e.exitCode, null), this.#i.call(this.#e, this.#e.exitCode)) :
2424
+ 0;
2425
+ }
2426
+ #c(t, ...r) {
2427
+ let n = this.#o;
2428
+ if (t === "exit" && Ge(this.#e)) {
2429
+ typeof r[0] == "number" && (this.#e.exitCode = r[0]);
2430
+ let i = n.call(this.#e, t, ...r);
2431
+ return this.#t.emit("exit", this.#e.exitCode, null), i;
2432
+ } else
2433
+ return n.call(this.#e, t, ...r);
2434
+ }
2435
+ }, Nt = globalThis.process, {
2436
+ /**
2437
+ * Called when the process is exiting, whether via signal, explicit
2438
+ * exit, or running out of stuff to do.
2439
+ *
2440
+ * If the global process object is not suitable for instrumentation,
2441
+ * then this will be a no-op.
2442
+ *
2443
+ * Returns a function that may be used to unload signal-exit.
2444
+ */
2445
+ onExit: xo,
2446
+ /**
2447
+ * Load the listeners. Likely you never need to call this, unless
2448
+ * doing a rather deep integration with signal-exit functionality.
2449
+ * Mostly exposed for the benefit of testing.
2450
+ *
2451
+ * @internal
2452
+ */
2453
+ load: Kp,
2454
+ /**
2455
+ * Unload the listeners. Likely you never need to call this, unless
2456
+ * doing a rather deep integration with signal-exit functionality.
2457
+ * Mostly exposed for the benefit of testing.
2458
+ *
2459
+ * @internal
2460
+ */
2461
+ unload: Yp
2462
+ } = Oc(Ge(Nt) ? new jt(Nt) : new Gt());
2463
+
2464
+ // node_modules/execa/lib/kill.js
2465
+ var Rc = 1e3 * 5, So = /* @__PURE__ */ o((e, t = "SIGTERM", r = {}) => {
2466
+ let n = e(t);
2467
+ return _c(e, t, r, n), n;
2468
+ }, "spawnedKill"), _c = /* @__PURE__ */ o((e, t, r, n) => {
2469
+ if (!Gc(t, r, n))
2470
+ return;
2471
+ let i = Nc(r), s = setTimeout(() => {
2472
+ e("SIGKILL");
2473
+ }, i);
2474
+ s.unref && s.unref();
2475
+ }, "setKillTimeout"), Gc = /* @__PURE__ */ o((e, { forceKillAfterTimeout: t }, r) => jc(e) && t !== !1 && r, "shouldForceKill"), jc = /* @__PURE__ */ o(
2476
+ (e) => e === Ac.constants.signals.SIGTERM || typeof e == "string" && e.toUpperCase() === "SIGTERM", "isSigterm"), Nc = /* @__PURE__ */ o(({ forceKillAfterTimeout: e = !0 }) => {
2477
+ if (e === !0)
2478
+ return Rc;
2479
+ if (!Number.isFinite(e) || e < 0)
2480
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
2481
+ return e;
2482
+ }, "getForceKillAfterTimeout"), wo = /* @__PURE__ */ o((e, t) => {
2483
+ e.kill() && (t.isCanceled = !0);
2484
+ }, "spawnedCancel"), Bc = /* @__PURE__ */ o((e, t, r) => {
2485
+ e.kill(t), r(Object.assign(new Error("Timed out"), { timedOut: !0, signal: t }));
2486
+ }, "timeoutKill"), vo = /* @__PURE__ */ o((e, { timeout: t, killSignal: r = "SIGTERM" }, n) => {
2487
+ if (t === 0 || t === void 0)
2488
+ return n;
2489
+ let i, s = new Promise((c, u) => {
2490
+ i = setTimeout(() => {
2491
+ Bc(e, r, u);
2492
+ }, t);
2493
+ }), a = n.finally(() => {
2494
+ clearTimeout(i);
2495
+ });
2496
+ return Promise.race([s, a]);
2497
+ }, "setupTimeout"), Po = /* @__PURE__ */ o(({ timeout: e }) => {
2498
+ if (e !== void 0 && (!Number.isFinite(e) || e < 0))
2499
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
2500
+ }, "validateTimeout"), Eo = /* @__PURE__ */ o(async (e, { cleanup: t, detached: r }, n) => {
2501
+ if (!t || r)
2502
+ return n;
2503
+ let i = xo(() => {
2504
+ e.kill();
2505
+ });
2506
+ return n.finally(() => {
2507
+ i();
2508
+ });
2509
+ }, "setExitHandler");
2510
+
2511
+ // node_modules/execa/lib/pipe.js
2512
+ import { createWriteStream as Dc } from "node:fs";
2513
+ import { ChildProcess as Mc } from "node:child_process";
2514
+
2515
+ // node_modules/is-stream/index.js
2516
+ function Ne(e) {
2517
+ return e !== null && typeof e == "object" && typeof e.pipe == "function";
2518
+ }
2519
+ o(Ne, "isStream");
2520
+ function Bt(e) {
2521
+ return Ne(e) && e.writable !== !1 && typeof e._write == "function" && typeof e._writableState == "object";
2522
+ }
2523
+ o(Bt, "isWritableStream");
2524
+
2525
+ // node_modules/execa/lib/pipe.js
2526
+ var Lc = /* @__PURE__ */ o((e) => e instanceof Mc && typeof e.then == "function", "isExecaChildProcess"), Dt = /* @__PURE__ */ o((e, t, r) => {
2527
+ if (typeof r == "string")
2528
+ return e[t].pipe(Dc(r)), e;
2529
+ if (Bt(r))
2530
+ return e[t].pipe(r), e;
2531
+ if (!Lc(r))
2532
+ throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
2533
+ if (!Bt(r.stdin))
2534
+ throw new TypeError("The target child process's stdin must be available.");
2535
+ return e[t].pipe(r.stdin), r;
2536
+ }, "pipeToTarget"), To = /* @__PURE__ */ o((e) => {
2537
+ e.stdout !== null && (e.pipeStdout = Dt.bind(void 0, e, "stdout")), e.stderr !== null && (e.pipeStderr = Dt.bind(void 0, e, "stderr")), e.
2538
+ all !== void 0 && (e.pipeAll = Dt.bind(void 0, e, "all"));
2539
+ }, "addPipeMethods");
2540
+
2541
+ // node_modules/execa/lib/stream.js
2542
+ import { createReadStream as nu, readFileSync as ou } from "node:fs";
2543
+ import { setTimeout as iu } from "node:timers/promises";
2544
+
2545
+ // node_modules/get-stream/source/contents.js
2546
+ var te = /* @__PURE__ */ o(async (e, { init: t, convertChunk: r, getSize: n, truncateChunk: i, addChunk: s, getFinalChunk: a, finalize: c }, {
2547
+ maxBuffer: u = Number.POSITIVE_INFINITY } = {}) => {
2548
+ if (!Uc(e))
2549
+ throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
2550
+ let l = t();
2551
+ l.length = 0;
2552
+ try {
2553
+ for await (let f of e) {
2554
+ let x = $c(f), g = r[x](f, l);
2555
+ Co({ convertedChunk: g, state: l, getSize: n, truncateChunk: i, addChunk: s, maxBuffer: u });
2556
+ }
2557
+ return Fc({ state: l, convertChunk: r, getSize: n, truncateChunk: i, addChunk: s, getFinalChunk: a, maxBuffer: u }), c(l);
2558
+ } catch (f) {
2559
+ throw f.bufferedData = c(l), f;
2560
+ }
2561
+ }, "getStreamContents"), Fc = /* @__PURE__ */ o(({ state: e, getSize: t, truncateChunk: r, addChunk: n, getFinalChunk: i, maxBuffer: s }) => {
2562
+ let a = i(e);
2563
+ a !== void 0 && Co({ convertedChunk: a, state: e, getSize: t, truncateChunk: r, addChunk: n, maxBuffer: s });
2564
+ }, "appendFinalChunk"), Co = /* @__PURE__ */ o(({ convertedChunk: e, state: t, getSize: r, truncateChunk: n, addChunk: i, maxBuffer: s }) => {
2565
+ let a = r(e), c = t.length + a;
2566
+ if (c <= s) {
2567
+ ko(e, t, i, c);
2568
+ return;
2569
+ }
2570
+ let u = n(e, s - t.length);
2571
+ throw u !== void 0 && ko(u, t, i, s), new Be();
2572
+ }, "appendChunk"), ko = /* @__PURE__ */ o((e, t, r, n) => {
2573
+ t.contents = r(e, t, n), t.length = n;
2574
+ }, "addNewChunk"), Uc = /* @__PURE__ */ o((e) => typeof e == "object" && e !== null && typeof e[Symbol.asyncIterator] == "function", "isAsyn\
2575
+ cIterable"), $c = /* @__PURE__ */ o((e) => {
2576
+ let t = typeof e;
2577
+ if (t === "string")
2578
+ return "string";
2579
+ if (t !== "object" || e === null)
2580
+ return "others";
2581
+ if (globalThis.Buffer?.isBuffer(e))
2582
+ return "buffer";
2583
+ let r = Io.call(e);
2584
+ return r === "[object ArrayBuffer]" ? "arrayBuffer" : r === "[object DataView]" ? "dataView" : Number.isInteger(e.byteLength) && Number.isInteger(
2585
+ e.byteOffset) && Io.call(e.buffer) === "[object ArrayBuffer]" ? "typedArray" : "others";
2586
+ }, "getChunkType"), { toString: Io } = Object.prototype, Be = class extends Error {
2587
+ static {
2588
+ o(this, "MaxBufferError");
2589
+ }
2590
+ name = "MaxBufferError";
2591
+ constructor() {
2592
+ super("maxBuffer exceeded");
2593
+ }
2594
+ };
2595
+
2596
+ // node_modules/get-stream/source/utils.js
2597
+ var Mt = /* @__PURE__ */ o((e) => e, "identity"), Lt = /* @__PURE__ */ o(() => {
2598
+ }, "noop"), Ft = /* @__PURE__ */ o(({ contents: e }) => e, "getContentsProp"), De = /* @__PURE__ */ o((e) => {
2599
+ throw new Error(`Streams in object mode are not supported: ${String(e)}`);
2600
+ }, "throwObjectStream"), Me = /* @__PURE__ */ o((e) => e.length, "getLengthProp");
2601
+
2602
+ // node_modules/get-stream/source/array-buffer.js
2603
+ async function Ut(e, t) {
2604
+ return te(e, Xc, t);
2605
+ }
2606
+ o(Ut, "getStreamAsArrayBuffer");
2607
+ var qc = /* @__PURE__ */ o(() => ({ contents: new ArrayBuffer(0) }), "initArrayBuffer"), Wc = /* @__PURE__ */ o((e) => Hc.encode(e), "useTex\
2608
+ tEncoder"), Hc = new TextEncoder(), Oo = /* @__PURE__ */ o((e) => new Uint8Array(e), "useUint8Array"), Ao = /* @__PURE__ */ o((e) => new Uint8Array(
2609
+ e.buffer, e.byteOffset, e.byteLength), "useUint8ArrayWithOffset"), Vc = /* @__PURE__ */ o((e, t) => e.slice(0, t), "truncateArrayBufferChunk"),
2610
+ zc = /* @__PURE__ */ o((e, { contents: t, length: r }, n) => {
2611
+ let i = Go() ? Kc(t, n) : Jc(t, n);
2612
+ return new Uint8Array(i).set(e, r), i;
2613
+ }, "addArrayBufferChunk"), Jc = /* @__PURE__ */ o((e, t) => {
2614
+ if (t <= e.byteLength)
2615
+ return e;
2616
+ let r = new ArrayBuffer(_o(t));
2617
+ return new Uint8Array(r).set(new Uint8Array(e), 0), r;
2618
+ }, "resizeArrayBufferSlow"), Kc = /* @__PURE__ */ o((e, t) => {
2619
+ if (t <= e.maxByteLength)
2620
+ return e.resize(t), e;
2621
+ let r = new ArrayBuffer(t, { maxByteLength: _o(t) });
2622
+ return new Uint8Array(r).set(new Uint8Array(e), 0), r;
2623
+ }, "resizeArrayBuffer"), _o = /* @__PURE__ */ o((e) => Ro ** Math.ceil(Math.log(e) / Math.log(Ro)), "getNewContentsLength"), Ro = 2, Yc = /* @__PURE__ */ o(
2624
+ ({ contents: e, length: t }) => Go() ? e : e.slice(0, t), "finalizeArrayBuffer"), Go = /* @__PURE__ */ o(() => "resize" in ArrayBuffer.prototype,
2625
+ "hasArrayBufferResize"), Xc = {
2626
+ init: qc,
2627
+ convertChunk: {
2628
+ string: Wc,
2629
+ buffer: Oo,
2630
+ arrayBuffer: Oo,
2631
+ dataView: Ao,
2632
+ typedArray: Ao,
2633
+ others: De
2634
+ },
2635
+ getSize: Me,
2636
+ truncateChunk: Vc,
2637
+ addChunk: zc,
2638
+ getFinalChunk: Lt,
2639
+ finalize: Yc
2640
+ };
2641
+
2642
+ // node_modules/get-stream/source/buffer.js
2643
+ async function Le(e, t) {
2644
+ if (!("Buffer" in globalThis))
2645
+ throw new Error("getStreamAsBuffer() is only supported in Node.js");
2646
+ try {
2647
+ return jo(await Ut(e, t));
2648
+ } catch (r) {
2649
+ throw r.bufferedData !== void 0 && (r.bufferedData = jo(r.bufferedData)), r;
2650
+ }
2651
+ }
2652
+ o(Le, "getStreamAsBuffer");
2653
+ var jo = /* @__PURE__ */ o((e) => globalThis.Buffer.from(e), "arrayBufferToNodeBuffer");
2654
+
2655
+ // node_modules/get-stream/source/string.js
2656
+ async function $t(e, t) {
2657
+ return te(e, ru, t);
2658
+ }
2659
+ o($t, "getStreamAsString");
2660
+ var Qc = /* @__PURE__ */ o(() => ({ contents: "", textDecoder: new TextDecoder() }), "initString"), Fe = /* @__PURE__ */ o((e, { textDecoder: t }) => t.
2661
+ decode(e, { stream: !0 }), "useTextDecoder"), Zc = /* @__PURE__ */ o((e, { contents: t }) => t + e, "addStringChunk"), eu = /* @__PURE__ */ o(
2662
+ (e, t) => e.slice(0, t), "truncateStringChunk"), tu = /* @__PURE__ */ o(({ textDecoder: e }) => {
2663
+ let t = e.decode();
2664
+ return t === "" ? void 0 : t;
2665
+ }, "getFinalStringChunk"), ru = {
2666
+ init: Qc,
2667
+ convertChunk: {
2668
+ string: Mt,
2669
+ buffer: Fe,
2670
+ arrayBuffer: Fe,
2671
+ dataView: Fe,
2672
+ typedArray: Fe,
2673
+ others: De
2674
+ },
2675
+ getSize: Me,
2676
+ truncateChunk: eu,
2677
+ addChunk: Zc,
2678
+ getFinalChunk: tu,
2679
+ finalize: Ft
2680
+ };
2681
+
2682
+ // node_modules/execa/lib/stream.js
2683
+ var No = R(xt(), 1);
2684
+ var Bo = /* @__PURE__ */ o((e) => {
2685
+ if (e !== void 0)
2686
+ throw new TypeError("The `input` and `inputFile` options cannot be both set.");
2687
+ }, "validateInputOptions"), su = /* @__PURE__ */ o(({ input: e, inputFile: t }) => typeof t != "string" ? e : (Bo(e), ou(t)), "getInputSync"),
2688
+ Do = /* @__PURE__ */ o((e) => {
2689
+ let t = su(e);
2690
+ if (Ne(t))
2691
+ throw new TypeError("The `input` option cannot be a stream in sync mode");
2692
+ return t;
2693
+ }, "handleInputSync"), au = /* @__PURE__ */ o(({ input: e, inputFile: t }) => typeof t != "string" ? e : (Bo(e), nu(t)), "getInput"), Mo = /* @__PURE__ */ o(
2694
+ (e, t) => {
2695
+ let r = au(t);
2696
+ r !== void 0 && (Ne(r) ? r.pipe(e.stdin) : e.stdin.end(r));
2697
+ }, "handleInput"), Lo = /* @__PURE__ */ o((e, { all: t }) => {
2698
+ if (!t || !e.stdout && !e.stderr)
2699
+ return;
2700
+ let r = (0, No.default)();
2701
+ return e.stdout && r.add(e.stdout), e.stderr && r.add(e.stderr), r;
2702
+ }, "makeAllStream"), qt = /* @__PURE__ */ o(async (e, t) => {
2703
+ if (!(!e || t === void 0)) {
2704
+ await iu(0), e.destroy();
2705
+ try {
2706
+ return await t;
2707
+ } catch (r) {
2708
+ return r.bufferedData;
2709
+ }
2710
+ }
2711
+ }, "getBufferedData"), Wt = /* @__PURE__ */ o((e, { encoding: t, buffer: r, maxBuffer: n }) => {
2712
+ if (!(!e || !r))
2713
+ return t === "utf8" || t === "utf-8" ? $t(e, { maxBuffer: n }) : t === null || t === "buffer" ? Le(e, { maxBuffer: n }) : cu(e, n, t);
2714
+ }, "getStreamPromise"), cu = /* @__PURE__ */ o(async (e, t, r) => (await Le(e, { maxBuffer: t })).toString(r), "applyEncoding"), Fo = /* @__PURE__ */ o(
2715
+ async ({ stdout: e, stderr: t, all: r }, { encoding: n, buffer: i, maxBuffer: s }, a) => {
2716
+ let c = Wt(e, { encoding: n, buffer: i, maxBuffer: s }), u = Wt(t, { encoding: n, buffer: i, maxBuffer: s }), l = Wt(r, { encoding: n, buffer: i,
2717
+ maxBuffer: s * 2 });
2718
+ try {
2719
+ return await Promise.all([a, c, u, l]);
2720
+ } catch (f) {
2721
+ return Promise.all([
2722
+ { error: f, signal: f.signal, timedOut: f.timedOut },
2723
+ qt(e, c),
2724
+ qt(t, u),
2725
+ qt(r, l)
2726
+ ]);
2727
+ }
2728
+ }, "getSpawnedResult");
2729
+
2730
+ // node_modules/execa/lib/promise.js
2731
+ var uu = (async () => {
2732
+ })().constructor.prototype, lu = ["then", "catch", "finally"].map((e) => [
2733
+ e,
2734
+ Reflect.getOwnPropertyDescriptor(uu, e)
2735
+ ]), Ht = /* @__PURE__ */ o((e, t) => {
2736
+ for (let [r, n] of lu) {
2737
+ let i = typeof t == "function" ? (...s) => Reflect.apply(n.value, t(), s) : n.value.bind(t);
2738
+ Reflect.defineProperty(e, r, { ...n, value: i });
2739
+ }
2740
+ }, "mergePromise"), Uo = /* @__PURE__ */ o((e) => new Promise((t, r) => {
2741
+ e.on("exit", (n, i) => {
2742
+ t({ exitCode: n, signal: i });
2743
+ }), e.on("error", (n) => {
2744
+ r(n);
2745
+ }), e.stdin && e.stdin.on("error", (n) => {
2746
+ r(n);
2747
+ });
2748
+ }), "getSpawnedPromise");
2749
+
2750
+ // node_modules/execa/lib/command.js
2751
+ import { Buffer as fu } from "node:buffer";
2752
+ import { ChildProcess as pu } from "node:child_process";
2753
+ var Wo = /* @__PURE__ */ o((e, t = []) => Array.isArray(t) ? [e, ...t] : [e], "normalizeArgs"), du = /^[\w.-]+$/, mu = /* @__PURE__ */ o((e) => typeof e !=
2754
+ "string" || du.test(e) ? e : `"${e.replaceAll('"', '\\"')}"`, "escapeArg"), Vt = /* @__PURE__ */ o((e, t) => Wo(e, t).join(" "), "joinComman\
2755
+ d"), zt = /* @__PURE__ */ o((e, t) => Wo(e, t).map((r) => mu(r)).join(" "), "getEscapedCommand"), Ho = / +/g, Vo = /* @__PURE__ */ o((e) => {
2756
+ let t = [];
2757
+ for (let r of e.trim().split(Ho)) {
2758
+ let n = t.at(-1);
2759
+ n && n.endsWith("\\") ? t[t.length - 1] = `${n.slice(0, -1)} ${r}` : t.push(r);
2760
+ }
2761
+ return t;
2762
+ }, "parseCommand"), $o = /* @__PURE__ */ o((e) => {
2763
+ let t = typeof e;
2764
+ if (t === "string")
2765
+ return e;
2766
+ if (t === "number")
2767
+ return String(e);
2768
+ if (t === "object" && e !== null && !(e instanceof pu) && "stdout" in e) {
2769
+ let r = typeof e.stdout;
2770
+ if (r === "string")
2771
+ return e.stdout;
2772
+ if (fu.isBuffer(e.stdout))
2773
+ return e.stdout.toString();
2774
+ throw new TypeError(`Unexpected "${r}" stdout in template expression`);
2775
+ }
2776
+ throw new TypeError(`Unexpected "${t}" in template expression`);
2777
+ }, "parseExpression"), qo = /* @__PURE__ */ o((e, t, r) => r || e.length === 0 || t.length === 0 ? [...e, ...t] : [
2778
+ ...e.slice(0, -1),
2779
+ `${e.at(-1)}${t[0]}`,
2780
+ ...t.slice(1)
2781
+ ], "concatTokens"), hu = /* @__PURE__ */ o(({ templates: e, expressions: t, tokens: r, index: n, template: i }) => {
2782
+ let s = i ?? e.raw[n], a = s.split(Ho).filter(Boolean), c = qo(
2783
+ r,
2784
+ a,
2785
+ s.startsWith(" ")
2786
+ );
2787
+ if (n === t.length)
2788
+ return c;
2789
+ let u = t[n], l = Array.isArray(u) ? u.map((f) => $o(f)) : [$o(u)];
2790
+ return qo(
2791
+ c,
2792
+ l,
2793
+ s.endsWith(" ")
2794
+ );
2795
+ }, "parseTemplate"), Jt = /* @__PURE__ */ o((e, t) => {
2796
+ let r = [];
2797
+ for (let [n, i] of e.entries())
2798
+ r = hu({ templates: e, expressions: t, tokens: r, index: n, template: i });
2799
+ return r;
2800
+ }, "parseTemplates");
2801
+
2802
+ // node_modules/execa/lib/verbose.js
2803
+ import { debuglog as yu } from "node:util";
2804
+ import gu from "node:process";
2805
+ var zo = yu("execa").enabled, Ue = /* @__PURE__ */ o((e, t) => String(e).padStart(t, "0"), "padField"), bu = /* @__PURE__ */ o(() => {
2806
+ let e = /* @__PURE__ */ new Date();
2807
+ return `${Ue(e.getHours(), 2)}:${Ue(e.getMinutes(), 2)}:${Ue(e.getSeconds(), 2)}.${Ue(e.getMilliseconds(), 3)}`;
2808
+ }, "getTimestamp"), Kt = /* @__PURE__ */ o((e, { verbose: t }) => {
2809
+ t && gu.stderr.write(`[${bu()}] ${e}
2810
+ `);
2811
+ }, "logCommand");
2812
+
2813
+ // node_modules/execa/index.js
2814
+ var wu = 1e3 * 1e3 * 100, vu = /* @__PURE__ */ o(({ env: e, extendEnv: t, preferLocal: r, localDir: n, execPath: i }) => {
2815
+ let s = t ? { ...$e.env, ...e } : e;
2816
+ return r ? lo({ env: s, cwd: n, execPath: i }) : s;
2817
+ }, "getEnv"), Yo = /* @__PURE__ */ o((e, t, r = {}) => {
2818
+ let n = Ko.default._parse(e, t, r);
2819
+ return e = n.command, t = n.args, r = n.options, r = {
2820
+ maxBuffer: wu,
2821
+ buffer: !0,
2822
+ stripFinalNewline: !0,
2823
+ extendEnv: !0,
2824
+ preferLocal: !1,
2825
+ localDir: r.cwd || $e.cwd(),
2826
+ execPath: $e.execPath,
2827
+ encoding: "utf8",
2828
+ reject: !0,
2829
+ cleanup: !0,
2830
+ all: !1,
2831
+ windowsHide: !0,
2832
+ verbose: zo,
2833
+ ...r
2834
+ }, r.env = vu(r), r.stdio = bo(r), $e.platform === "win32" && Su.basename(e, ".exe") === "cmd" && t.unshift("/q"), { file: e, args: t, options: r,
2835
+ parsed: n };
2836
+ }, "handleArguments"), re = /* @__PURE__ */ o((e, t, r) => typeof t != "string" && !xu.isBuffer(t) ? r === void 0 ? void 0 : "" : e.stripFinalNewline ?
2837
+ kt(t) : t, "handleOutput");
2838
+ function Xo(e, t, r) {
2839
+ let n = Yo(e, t, r), i = Vt(e, t), s = zt(e, t);
2840
+ Kt(s, n.options), Po(n.options);
2841
+ let a;
2842
+ try {
2843
+ a = Yt.spawn(n.file, n.args, n.options);
2844
+ } catch (m) {
2845
+ let y = new Yt.ChildProcess(), h = Promise.reject(ee({
2846
+ error: m,
2847
+ stdout: "",
2848
+ stderr: "",
2849
+ all: "",
2850
+ command: i,
2851
+ escapedCommand: s,
2852
+ parsed: n,
2853
+ timedOut: !1,
2854
+ isCanceled: !1,
2855
+ killed: !1
2856
+ }));
2857
+ return Ht(y, h), y;
2858
+ }
2859
+ let c = Uo(a), u = vo(a, n.options, c), l = Eo(a, n.options, u), f = { isCanceled: !1 };
2860
+ a.kill = So.bind(null, a.kill.bind(a)), a.cancel = wo.bind(null, a, f);
2861
+ let g = po(/* @__PURE__ */ o(async () => {
2862
+ let [{ error: m, exitCode: y, signal: h, timedOut: S }, T, E, I] = await Fo(a, n.options, l), O = re(n.options, T), A = re(n.options, E),
2863
+ d = re(n.options, I);
2864
+ if (m || y !== 0 || h !== null) {
2865
+ let v = ee({
2866
+ error: m,
2867
+ exitCode: y,
2868
+ signal: h,
2869
+ stdout: O,
2870
+ stderr: A,
2871
+ all: d,
2872
+ command: i,
2873
+ escapedCommand: s,
2874
+ parsed: n,
2875
+ timedOut: S,
2876
+ isCanceled: f.isCanceled || (n.options.signal ? n.options.signal.aborted : !1),
2877
+ killed: a.killed
2878
+ });
2879
+ if (!n.options.reject)
2880
+ return v;
2881
+ throw v;
2882
+ }
2883
+ return {
2884
+ command: i,
2885
+ escapedCommand: s,
2886
+ exitCode: 0,
2887
+ stdout: O,
2888
+ stderr: A,
2889
+ all: d,
2890
+ failed: !1,
2891
+ timedOut: !1,
2892
+ isCanceled: !1,
2893
+ killed: !1
2894
+ };
2895
+ }, "handlePromise"));
2896
+ return Mo(a, n.options), a.all = Lo(a, n.options), To(a), Ht(a, g), a;
2897
+ }
2898
+ o(Xo, "execa");
2899
+ function Pu(e, t, r) {
2900
+ let n = Yo(e, t, r), i = Vt(e, t), s = zt(e, t);
2901
+ Kt(s, n.options);
2902
+ let a = Do(n.options), c;
2903
+ try {
2904
+ c = Yt.spawnSync(n.file, n.args, { ...n.options, input: a });
2905
+ } catch (f) {
2906
+ throw ee({
2907
+ error: f,
2908
+ stdout: "",
2909
+ stderr: "",
2910
+ all: "",
2911
+ command: i,
2912
+ escapedCommand: s,
2913
+ parsed: n,
2914
+ timedOut: !1,
2915
+ isCanceled: !1,
2916
+ killed: !1
2917
+ });
2918
+ }
2919
+ let u = re(n.options, c.stdout, c.error), l = re(n.options, c.stderr, c.error);
2920
+ if (c.error || c.status !== 0 || c.signal !== null) {
2921
+ let f = ee({
2922
+ stdout: u,
2923
+ stderr: l,
2924
+ error: c.error,
2925
+ signal: c.signal,
2926
+ exitCode: c.status,
2927
+ command: i,
2928
+ escapedCommand: s,
2929
+ parsed: n,
2930
+ timedOut: c.error && c.error.code === "ETIMEDOUT",
2931
+ isCanceled: !1,
2932
+ killed: c.signal !== null
2933
+ });
2934
+ if (!n.options.reject)
2935
+ return f;
2936
+ throw f;
2937
+ }
2938
+ return {
2939
+ command: i,
2940
+ escapedCommand: s,
2941
+ exitCode: 0,
2942
+ stdout: u,
2943
+ stderr: l,
2944
+ failed: !1,
2945
+ timedOut: !1,
2946
+ isCanceled: !1,
2947
+ killed: !1
2948
+ };
2949
+ }
2950
+ o(Pu, "execaSync");
2951
+ var Eu = /* @__PURE__ */ o(({ input: e, inputFile: t, stdio: r }) => e === void 0 && t === void 0 && r === void 0 ? { stdin: "inherit" } : {},
2952
+ "normalizeScriptStdin"), Jo = /* @__PURE__ */ o((e = {}) => ({
2953
+ preferLocal: !0,
2954
+ ...Eu(e),
2955
+ ...e
2956
+ }), "normalizeScriptOptions");
2957
+ function Qo(e) {
2958
+ function t(r, ...n) {
2959
+ if (!Array.isArray(r))
2960
+ return Qo({ ...e, ...r });
2961
+ let [i, ...s] = Jt(r, n);
2962
+ return Xo(i, s, Jo(e));
2963
+ }
2964
+ return o(t, "$"), t.sync = (r, ...n) => {
2965
+ if (!Array.isArray(r))
2966
+ throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
2967
+ let [i, ...s] = Jt(r, n);
2968
+ return Pu(i, s, Jo(e));
2969
+ }, t;
2970
+ }
2971
+ o(Qo, "create$");
2972
+ var mm = Qo();
2973
+ function Zo(e, t) {
2974
+ let [r, ...n] = Vo(e);
2975
+ return Xo(r, n, t);
2976
+ }
2977
+ o(Zo, "execaCommand");
2978
+
2979
+ // src/telemetry/exec-command-count-lines.ts
2980
+ async function qe(e, t) {
2981
+ let r = Zo(e, { shell: !0, buffer: !1, ...t });
2982
+ if (!r.stdout)
2983
+ throw new Error("Unexpected missing stdout");
2984
+ let n = 0, i = Tu(r.stdout);
2985
+ return i.on("line", () => {
2986
+ n += 1;
2987
+ }), await r, i.close(), n;
2988
+ }
2989
+ o(qe, "execCommandCountLines");
2990
+
2991
+ // ../node_modules/slash/index.js
2992
+ function Xt(e) {
2993
+ return e.startsWith("\\\\?\\") ? e : e.replace(/\\/g, "/");
2994
+ }
2995
+ o(Xt, "slash");
2996
+
2997
+ // src/common/utils/file-cache.ts
2998
+ import { createHash as ei, randomBytes as ku } from "node:crypto";
2999
+ import { mkdirSync as Qt, readFileSync as Iu, readdirSync as Cu, rmSync as ti, writeFileSync as Ou } from "node:fs";
3000
+ import { readFile as ri, readdir as ni, rm as oi, writeFile as Au } from "node:fs/promises";
3001
+ import { tmpdir as Ru } from "node:os";
3002
+ import { join as ne } from "node:path";
3003
+ var We = class {
3004
+ static {
3005
+ o(this, "FileSystemCache");
3006
+ }
3007
+ constructor(t = {}) {
3008
+ this.prefix = (t.ns || t.prefix || "") + "-", this.hash_alg = t.hash_alg || "md5", this.cache_dir = t.basePath || ne(Ru(), ku(15).toString(
3009
+ "base64").replace(/\//g, "-")), this.ttl = t.ttl || 0, ei(this.hash_alg), Qt(this.cache_dir, { recursive: !0 });
3010
+ }
3011
+ generateHash(t) {
3012
+ return ne(this.cache_dir, this.prefix + ei(this.hash_alg).update(t).digest("hex"));
3013
+ }
3014
+ isExpired(t, r) {
3015
+ return t.ttl != null && r > t.ttl;
3016
+ }
3017
+ parseCacheData(t, r) {
3018
+ let n = JSON.parse(t);
3019
+ return this.isExpired(n, Date.now()) ? r : n.content;
3020
+ }
3021
+ parseSetData(t, r, n = {}) {
3022
+ let i = n.ttl ?? this.ttl;
3023
+ return JSON.stringify({ key: t, content: r, ...i && { ttl: Date.now() + i * 1e3 } });
3024
+ }
3025
+ async get(t, r) {
3026
+ try {
3027
+ let n = await ri(this.generateHash(t), "utf8");
3028
+ return this.parseCacheData(n, r);
3029
+ } catch {
3030
+ return r;
3031
+ }
3032
+ }
3033
+ getSync(t, r) {
3034
+ try {
3035
+ let n = Iu(this.generateHash(t), "utf8");
3036
+ return this.parseCacheData(n, r);
3037
+ } catch {
3038
+ return r;
3039
+ }
3040
+ }
3041
+ async set(t, r, n = {}) {
3042
+ let i = typeof n == "number" ? { ttl: n } : n;
3043
+ Qt(this.cache_dir, { recursive: !0 }), await Au(this.generateHash(t), this.parseSetData(t, r, i), {
3044
+ encoding: i.encoding || "utf8"
3045
+ });
3046
+ }
3047
+ setSync(t, r, n = {}) {
3048
+ let i = typeof n == "number" ? { ttl: n } : n;
3049
+ Qt(this.cache_dir, { recursive: !0 }), Ou(this.generateHash(t), this.parseSetData(t, r, i), {
3050
+ encoding: i.encoding || "utf8"
3051
+ });
3052
+ }
3053
+ async setMany(t, r) {
3054
+ await Promise.all(t.map((n) => this.set(n.key, n.content ?? n.value, r)));
3055
+ }
3056
+ setManySync(t, r) {
3057
+ t.forEach((n) => this.setSync(n.key, n.content ?? n.value, r));
3058
+ }
3059
+ async remove(t) {
3060
+ await oi(this.generateHash(t), { force: !0 });
3061
+ }
3062
+ removeSync(t) {
3063
+ ti(this.generateHash(t), { force: !0 });
3064
+ }
3065
+ async clear() {
3066
+ let t = await ni(this.cache_dir);
3067
+ await Promise.all(
3068
+ t.filter((r) => r.startsWith(this.prefix)).map((r) => oi(ne(this.cache_dir, r), { force: !0 }))
3069
+ );
3070
+ }
3071
+ clearSync() {
3072
+ Cu(this.cache_dir).filter((t) => t.startsWith(this.prefix)).forEach((t) => ti(ne(this.cache_dir, t), { force: !0 }));
3073
+ }
3074
+ async getAll() {
3075
+ let t = Date.now(), r = await ni(this.cache_dir);
3076
+ return (await Promise.all(
3077
+ r.filter((i) => i.startsWith(this.prefix)).map((i) => ri(ne(this.cache_dir, i), "utf8"))
3078
+ )).map((i) => JSON.parse(i)).filter((i) => i.content && !this.isExpired(i, t));
3079
+ }
3080
+ async load() {
3081
+ return {
3082
+ files: (await this.getAll()).map((r) => ({
3083
+ path: this.generateHash(r.key),
3084
+ value: r.content,
3085
+ key: r.key
3086
+ }))
3087
+ };
3088
+ }
3089
+ };
3090
+ function Zt(e) {
3091
+ return new We(e);
3092
+ }
3093
+ o(Zt, "createFileSystemCache");
3094
+
3095
+ // src/common/utils/resolve-path-in-sb-cache.ts
3096
+ import { join as mi } from "node:path";
3097
+
3098
+ // ../node_modules/find-cache-dir/index.js
3099
+ var di = R(si(), 1);
3100
+ import Hu from "node:process";
3101
+ import oe from "node:path";
3102
+ import Ve from "node:fs";
3103
+
3104
+ // ../node_modules/pkg-dir/index.js
3105
+ import Wu from "node:path";
3106
+
3107
+ // ../node_modules/pkg-dir/node_modules/find-up/index.js
3108
+ import He from "node:path";
3109
+ import { fileURLToPath as Fu } from "node:url";
3110
+
3111
+ // ../node_modules/locate-path/index.js
3112
+ import ju from "node:process";
3113
+ import Nu from "node:path";
3114
+ import ai, { promises as $m } from "node:fs";
3115
+ import { fileURLToPath as Bu } from "node:url";
3116
+ var ci = {
3117
+ directory: "isDirectory",
3118
+ file: "isFile"
3119
+ };
3120
+ function Du(e) {
3121
+ if (!Object.hasOwnProperty.call(ci, e))
3122
+ throw new Error(`Invalid type specified: ${e}`);
3123
+ }
3124
+ o(Du, "checkType");
3125
+ var Mu = /* @__PURE__ */ o((e, t) => t[ci[e]](), "matchType"), Lu = /* @__PURE__ */ o((e) => e instanceof URL ? Bu(e) : e, "toPath");
3126
+ function er(e, {
3127
+ cwd: t = ju.cwd(),
3128
+ type: r = "file",
3129
+ allowSymlinks: n = !0
3130
+ } = {}) {
3131
+ Du(r), t = Lu(t);
3132
+ let i = n ? ai.statSync : ai.lstatSync;
3133
+ for (let s of e)
3134
+ try {
3135
+ let a = i(Nu.resolve(t, s), {
3136
+ throwIfNoEntry: !1
3137
+ });
3138
+ if (!a)
3139
+ continue;
3140
+ if (Mu(r, a))
3141
+ return s;
3142
+ } catch {
3143
+ }
3144
+ }
3145
+ o(er, "locatePathSync");
3146
+
3147
+ // ../node_modules/pkg-dir/node_modules/path-exists/index.js
3148
+ import Jm, { promises as Km } from "node:fs";
3149
+
3150
+ // ../node_modules/pkg-dir/node_modules/find-up/index.js
3151
+ var Uu = /* @__PURE__ */ o((e) => e instanceof URL ? Fu(e) : e, "toPath"), $u = Symbol("findUpStop");
3152
+ function qu(e, t = {}) {
3153
+ let r = He.resolve(Uu(t.cwd) || ""), { root: n } = He.parse(r), i = t.stopAt || n, s = t.limit || Number.POSITIVE_INFINITY, a = [e].flat(),
3154
+ c = /* @__PURE__ */ o((l) => {
3155
+ if (typeof e != "function")
3156
+ return er(a, l);
3157
+ let f = e(l.cwd);
3158
+ return typeof f == "string" ? er([f], l) : f;
3159
+ }, "runMatcher"), u = [];
3160
+ for (; ; ) {
3161
+ let l = c({ ...t, cwd: r });
3162
+ if (l === $u || (l && u.push(He.resolve(r, l)), r === i || u.length >= s))
3163
+ break;
3164
+ r = He.dirname(r);
3165
+ }
3166
+ return u;
3167
+ }
3168
+ o(qu, "findUpMultipleSync");
3169
+ function ui(e, t = {}) {
3170
+ return qu(e, { ...t, limit: 1 })[0];
3171
+ }
3172
+ o(ui, "findUpSync");
3173
+
3174
+ // ../node_modules/pkg-dir/index.js
3175
+ function li({ cwd: e } = {}) {
3176
+ let t = ui("package.json", { cwd: e });
3177
+ return t && Wu.dirname(t);
3178
+ }
3179
+ o(li, "packageDirectorySync");
3180
+
3181
+ // ../node_modules/find-cache-dir/index.js
3182
+ var { env: tr, cwd: Vu } = Hu, fi = /* @__PURE__ */ o((e) => {
3183
+ try {
3184
+ return Ve.accessSync(e, Ve.constants.W_OK), !0;
3185
+ } catch {
3186
+ return !1;
3187
+ }
3188
+ }, "isWritable");
3189
+ function pi(e, t) {
3190
+ return t.create && Ve.mkdirSync(e, { recursive: !0 }), e;
3191
+ }
3192
+ o(pi, "useDirectory");
3193
+ function zu(e) {
3194
+ let t = oe.join(e, "node_modules");
3195
+ if (!(!fi(t) && (Ve.existsSync(t) || !fi(oe.join(e)))))
3196
+ return t;
3197
+ }
3198
+ o(zu, "getNodeModuleDirectory");
3199
+ function rr(e = {}) {
3200
+ if (tr.CACHE_DIR && !["true", "false", "1", "0"].includes(tr.CACHE_DIR))
3201
+ return pi(oe.join(tr.CACHE_DIR, e.name), e);
3202
+ let { cwd: t = Vu(), files: r } = e;
3203
+ if (r) {
3204
+ if (!Array.isArray(r))
3205
+ throw new TypeError(`Expected \`files\` option to be an array, got \`${typeof r}\`.`);
3206
+ t = (0, di.default)(r.map((i) => oe.resolve(t, i)));
3207
+ }
3208
+ if (t = li({ cwd: t }), !(!t || !zu(t)))
3209
+ return pi(oe.join(t, "node_modules", ".cache", e.name), e);
3210
+ }
3211
+ o(rr, "findCacheDirectory");
3212
+
3213
+ // src/common/utils/resolve-path-in-sb-cache.ts
3214
+ function hi(e, t = "default") {
3215
+ let r = rr({ name: "storybook" });
3216
+ return r ||= mi(process.cwd(), "node_modules", ".cache", "storybook"), mi(r, t, e);
3217
+ }
3218
+ o(hi, "resolvePathInStorybookCache");
3219
+
3220
+ // src/telemetry/run-telemetry-operation.ts
3221
+ var yi = Zt({
3222
+ basePath: hi("telemetry"),
3223
+ ns: "storybook",
3224
+ ttl: 24 * 60 * 60 * 1e3
3225
+ // 24h
3226
+ }), ze = /* @__PURE__ */ o(async (e, t) => {
3227
+ let r = await yi.get(e);
3228
+ return r === void 0 && (r = await t(), r !== void 0 && await yi.set(e, r)), r;
3229
+ }, "runTelemetryOperation");
3230
+
3231
+ // src/telemetry/get-application-file-count.ts
3232
+ var Ku = ["page", "screen"], Yu = ["js", "jsx", "ts", "tsx"], Xu = /* @__PURE__ */ o(async (e) => {
3233
+ let r = Ku.flatMap((n) => [
3234
+ n,
3235
+ [n[0].toUpperCase(), ...n.slice(1)].join("")
3236
+ ]).flatMap(
3237
+ (n) => Yu.map((i) => `"${e}${Ju}*${n}*.${i}"`)
3238
+ );
3239
+ try {
3240
+ let n = `git ls-files -- ${r.join(" ")}`;
3241
+ return await qe(n);
3242
+ } catch {
3243
+ return;
3244
+ }
3245
+ }, "getApplicationFilesCountUncached"), gi = /* @__PURE__ */ o(async (e) => ze(
3246
+ "applicationFiles",
3247
+ async () => Xu(e)
3248
+ ), "getApplicationFileCount");
3249
+
3250
+ // src/telemetry/get-chromatic-version.ts
3251
+ function bi(e) {
3252
+ let t = e.dependencies?.chromatic || e.devDependencies?.chromatic || e.peerDependencies?.chromatic;
3253
+ return t || (e.scripts && Object.values(e.scripts).find((r) => r?.match(/chromatic/)) ? "latest" : void 0);
3254
+ }
3255
+ o(bi, "getChromaticVersionSpecifier");
3256
+
3257
+ // src/telemetry/get-framework-info.ts
3258
+ import { normalize as el } from "node:path";
3259
+ import { frameworkPackages as tl } from "storybook/internal/common";
3260
+
3261
+ // src/telemetry/package-json.ts
3262
+ import { readFile as Qu } from "node:fs/promises";
3263
+ import { join as Zu } from "node:path";
3264
+ var nr = /* @__PURE__ */ o(async (e) => {
3265
+ let t = Object.keys(e);
3266
+ return Promise.all(t.map(Je));
3267
+ }, "getActualPackageVersions"), Je = /* @__PURE__ */ o(async (e) => {
3268
+ try {
3269
+ let t = await or(e);
3270
+ return {
3271
+ name: e,
3272
+ version: t.version
3273
+ };
3274
+ } catch {
3275
+ return { name: e, version: null };
3276
+ }
3277
+ }, "getActualPackageVersion"), or = /* @__PURE__ */ o(async (e) => {
3278
+ let t = b.resolve(Zu(e, "package.json"), {
3279
+ paths: [process.cwd()]
3280
+ });
3281
+ return JSON.parse(await Qu(t, { encoding: "utf8" }));
3282
+ }, "getActualPackageJson");
3283
+
3284
+ // src/telemetry/get-framework-info.ts
3285
+ var rl = [
3286
+ "html",
3287
+ "react",
3288
+ "svelte",
3289
+ "vue3",
3290
+ "preact",
3291
+ "server",
3292
+ "vue",
3293
+ "web-components",
3294
+ "angular",
3295
+ "ember"
3296
+ ], nl = ["builder-webpack5", "builder-vite"];
3297
+ function xi(e, t) {
3298
+ let { name: r = "", version: n, dependencies: i, devDependencies: s, peerDependencies: a } = e, c = {
3299
+ // We include the framework itself because it may be a renderer too (e.g. angular)
3300
+ [r]: n,
3301
+ ...i,
3302
+ ...s,
3303
+ ...a
3304
+ };
3305
+ return t.map((u) => `@storybook/${u}`).find((u) => c[u]);
3306
+ }
3307
+ o(xi, "findMatchingPackage");
3308
+ var ol = /* @__PURE__ */ o((e) => {
3309
+ let t = el(e).replace(new RegExp(/\\/, "g"), "/");
3310
+ return Object.keys(tl).find((n) => t.endsWith(n)) || z(e).replace(/.*node_modules[\\/]/, "");
3311
+ }, "getFrameworkPackageName");
3312
+ async function Si(e) {
3313
+ if (!e?.framework)
3314
+ return {};
3315
+ let t = typeof e.framework == "string" ? e.framework : e.framework?.name;
3316
+ if (!t)
3317
+ return {};
3318
+ let r = await or(t);
3319
+ if (!r)
3320
+ return {};
3321
+ let n = xi(r, nl), i = xi(r, rl), s = ol(t), a = typeof e.framework == "object" ? e.framework.options : {};
3322
+ return {
3323
+ framework: {
3324
+ name: s,
3325
+ options: a
3326
+ },
3327
+ builder: n,
3328
+ renderer: i
3329
+ };
3330
+ }
3331
+ o(Si, "getFrameworkInfo");
3332
+
3333
+ // src/telemetry/get-has-router-package.ts
3334
+ var il = /* @__PURE__ */ new Set([
3335
+ "react-router",
3336
+ "react-router-dom",
3337
+ "remix",
3338
+ "@tanstack/react-router",
3339
+ "expo-router",
3340
+ "@reach/router",
3341
+ "react-easy-router",
3342
+ "@remix-run/router",
3343
+ "wouter",
3344
+ "wouter-preact",
3345
+ "preact-router",
3346
+ "vue-router",
3347
+ "unplugin-vue-router",
3348
+ "@angular/router",
3349
+ "@solidjs/router",
3350
+ // metaframeworks that imply routing
3351
+ "next",
3352
+ "react-scripts",
3353
+ "gatsby",
3354
+ "nuxt",
3355
+ "@sveltejs/kit"
3356
+ ]);
3357
+ function wi(e) {
3358
+ return Object.keys(e?.dependencies ?? {}).some(
3359
+ (t) => il.has(t)
3360
+ );
3361
+ }
3362
+ o(wi, "getHasRouterPackage");
3363
+
3364
+ // src/telemetry/get-monorepo-type.ts
3365
+ import { existsSync as vi, readFileSync as sl } from "node:fs";
3366
+ import { join as ir } from "node:path";
3367
+ import { getProjectRoot as al } from "storybook/internal/common";
3368
+ var Pi = {
3369
+ Nx: "nx.json",
3370
+ Turborepo: "turbo.json",
3371
+ Lerna: "lerna.json",
3372
+ Rush: "rush.json",
3373
+ Lage: "lage.config.json"
3374
+ }, Ei = /* @__PURE__ */ o(() => {
3375
+ let e = al();
3376
+ if (!e)
3377
+ return;
3378
+ let r = Object.keys(Pi).find((i) => {
3379
+ let s = ir(e, Pi[i]);
3380
+ return vi(s);
3381
+ });
3382
+ if (r)
3383
+ return r;
3384
+ if (!vi(ir(e, "package.json")))
3385
+ return;
3386
+ if (JSON.parse(
3387
+ sl(ir(e, "package.json"), { encoding: "utf8" })
3388
+ )?.workspaces)
3389
+ return "Workspaces";
3390
+ }, "getMonorepoType");
3391
+
3392
+ // src/telemetry/get-portable-stories-usage.ts
3393
+ var cl = /* @__PURE__ */ o(async (e) => {
3394
+ try {
3395
+ let t = "git grep -l composeStor" + (e ? ` -- ${e}` : "");
3396
+ return await qe(t);
3397
+ } catch (t) {
3398
+ return t.exitCode === 1 ? 0 : void 0;
3399
+ }
3400
+ }, "getPortableStoriesFileCountUncached"), Ti = /* @__PURE__ */ o(async (e) => ze(
3401
+ "portableStories",
3402
+ async () => cl(e)
3403
+ ), "getPortableStoriesFileCount");
3404
+
3405
+ // src/telemetry/storybook-metadata.ts
3406
+ var ki = {
3407
+ next: "Next",
3408
+ "react-scripts": "CRA",
3409
+ gatsby: "Gatsby",
3410
+ "@nuxtjs/storybook": "nuxt",
3411
+ "@nrwl/storybook": "nx",
3412
+ "@vue/cli-service": "vue-cli",
3413
+ "@sveltejs/kit": "sveltekit"
3414
+ }, Ii = /* @__PURE__ */ o((e) => z(e).replace(/\/dist\/.*/, "").replace(/\.[mc]?[tj]?s[x]?$/, "").replace(/\/register$/, "").replace(/\/manager$/,
3415
+ "").replace(/\/preset$/, ""), "sanitizeAddonName"), hl = /* @__PURE__ */ o(async ({
3416
+ packageJsonPath: e,
3417
+ packageJson: t,
3418
+ mainConfig: r
3419
+ }) => {
3420
+ let n = {
3421
+ generatedAt: (/* @__PURE__ */ new Date()).getTime(),
3422
+ hasCustomBabel: !1,
3423
+ hasCustomWebpack: !1,
3424
+ hasStaticDirs: !1,
3425
+ hasStorybookEslint: !1,
3426
+ refCount: 0
3427
+ }, i = {
3428
+ ...t?.dependencies,
3429
+ ...t?.devDependencies,
3430
+ ...t?.peerDependencies
3431
+ }, s = Object.keys(i).find((d) => !!ki[d]);
3432
+ if (s) {
3433
+ let { version: d } = await Je(s);
3434
+ n.metaFramework = {
3435
+ name: ki[s],
3436
+ packageName: s,
3437
+ version: d
3438
+ };
3439
+ }
3440
+ let a = [
3441
+ "playwright",
3442
+ "vitest",
3443
+ "jest",
3444
+ "cypress",
3445
+ "nightwatch",
3446
+ "webdriver",
3447
+ "@web/test-runner",
3448
+ "puppeteer",
3449
+ "karma",
3450
+ "jasmine",
3451
+ "chai",
3452
+ "testing-library",
3453
+ "@ngneat/spectator",
3454
+ "wdio",
3455
+ "msw",
3456
+ "miragejs",
3457
+ "sinon"
3458
+ ], c = Object.keys(i).filter(
3459
+ (d) => a.find((v) => d.includes(v))
3460
+ );
3461
+ n.testPackages = Object.fromEntries(
3462
+ await Promise.all(
3463
+ c.map(async (d) => [d, (await Je(d))?.version])
3464
+ )
3465
+ ), n.hasRouterPackage = wi(t);
3466
+ let u = Ei();
3467
+ u && (n.monorepo = u);
3468
+ try {
3469
+ let d = await (0, Ye.detect)({ cwd: ll() }), v = await (0, Ye.getNpmVersion)(d);
3470
+ n.packageManager = {
3471
+ type: d,
3472
+ version: v
3473
+ };
3474
+ } catch {
3475
+ }
3476
+ n.hasCustomBabel = !!r.babel, n.hasCustomWebpack = !!r.webpackFinal, n.hasStaticDirs = !!r.staticDirs, typeof r.typescript == "object" && (n.
3477
+ typescriptOptions = r.typescript);
3478
+ let l = await Si(r);
3479
+ typeof r.refs == "object" && (n.refCount = Object.keys(r.refs).length), typeof r.features == "object" && (n.features = r.features);
3480
+ let f = {};
3481
+ r.addons && r.addons.forEach((d) => {
3482
+ let v, ae;
3483
+ typeof d == "string" ? v = Ii(d) : (d.name.includes("addon-essentials") && (ae = d.options), v = Ii(d.name)), f[v] = {
3484
+ options: ae,
3485
+ version: void 0
3486
+ };
3487
+ });
3488
+ let x = bi(t);
3489
+ x && (f.chromatic = {
3490
+ version: void 0,
3491
+ versionSpecifier: x,
3492
+ options: void 0
3493
+ }), (await nr(f)).forEach(({ name: d, version: v }) => {
3494
+ f[d].version = v;
3495
+ });
3496
+ let m = Object.keys(f), y = Object.keys(i).filter((d) => d.includes("storybook") && !m.includes(d)).reduce((d, v) => ({
3497
+ ...d,
3498
+ [v]: { version: void 0 }
3499
+ }), {});
3500
+ (await nr(y)).forEach(({ name: d, version: v }) => {
3501
+ y[d].version = v;
3502
+ });
3503
+ let S = i.typescript ? "typescript" : "javascript", T = !!i["eslint-plugin-storybook"], E = pl(t);
3504
+ try {
3505
+ let { previewConfig: d } = E;
3506
+ if (d) {
3507
+ let v = await ml(d), ae = !!(v.getFieldNode(["globals"]) || v.getFieldNode(["globalTypes"]));
3508
+ n.preview = { ...n.preview, usesGlobals: ae };
3509
+ }
3510
+ } catch {
3511
+ }
3512
+ let I = y[E.frameworkPackage]?.version, O = await Ti(), A = await gi(ul(e));
3513
+ return {
3514
+ ...n,
3515
+ ...l,
3516
+ portableStoriesFileCount: O,
3517
+ applicationFileCount: A,
3518
+ storybookVersion: I,
3519
+ storybookVersionSpecifier: E.version,
3520
+ language: S,
3521
+ storybookPackages: y,
3522
+ addons: f,
3523
+ hasStorybookEslint: T
3524
+ };
3525
+ }, "computeStorybookMetadata");
3526
+ async function yl() {
3527
+ let e = await Tt(process.cwd());
3528
+ return e ? {
3529
+ packageJsonPath: e,
3530
+ packageJson: await uo(e) || {}
3531
+ } : {
3532
+ packageJsonPath: process.cwd(),
3533
+ packageJson: {}
3534
+ };
3535
+ }
3536
+ o(yl, "getPackageJsonDetails");
3537
+ var Ke, Ci = /* @__PURE__ */ o(async (e) => {
3538
+ if (Ke)
3539
+ return Ke;
3540
+ let { packageJson: t, packageJsonPath: r } = await yl(), n = (e || fl(
3541
+ String(t?.scripts?.storybook || ""),
3542
+ "-c",
3543
+ "--config-dir"
3544
+ )) ?? ".storybook", i = await dl({ configDir: n });
3545
+ return Ke = await hl({ mainConfig: i, packageJson: t, packageJsonPath: r }), Ke;
3546
+ }, "getStorybookMetadata");
3547
+
3548
+ // src/telemetry/telemetry.ts
3549
+ var Li = R(Ai(), 1);
3550
+ import * as Mi from "node:os";
3551
+
3552
+ // ../node_modules/nanoid/index.js
3553
+ import { randomFillSync as _i } from "crypto";
3554
+
3555
+ // ../node_modules/nanoid/url-alphabet/index.js
3556
+ var Ri = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3557
+
3558
+ // ../node_modules/nanoid/index.js
3559
+ var gl = 128, B, V, bl = /* @__PURE__ */ o((e) => {
3560
+ !B || B.length < e ? (B = Buffer.allocUnsafe(e * gl), _i(B), V = 0) : V + e > B.length && (_i(B), V = 0), V += e;
3561
+ }, "fillPool");
3562
+ var ie = /* @__PURE__ */ o((e = 21) => {
3563
+ bl(e -= 0);
3564
+ let t = "";
3565
+ for (let r = V - e; r < V; r++)
3566
+ t += Ri[B[r] & 63];
3567
+ return t;
3568
+ }, "nanoid");
3569
+
3570
+ // src/telemetry/anonymous-id.ts
3571
+ import { relative as Sl } from "node:path";
3572
+ import { getProjectRoot as wl } from "storybook/internal/common";
3573
+ import { execSync as vl } from "child_process";
3574
+
3575
+ // src/telemetry/one-way-hash.ts
3576
+ import { createHash as xl } from "crypto";
3577
+ var sr = /* @__PURE__ */ o((e) => {
3578
+ let t = xl("sha256");
3579
+ return t.update("storybook-telemetry-salt"), t.update(e), t.digest("hex");
3580
+ }, "oneWayHash");
3581
+
3582
+ // src/telemetry/anonymous-id.ts
3583
+ function Pl(e) {
3584
+ let n = e.trim().replace(/#.*$/, "").replace(/^.*@/, "").replace(/^.*\/\//, "");
3585
+ return (n.endsWith(".git") ? n : `${n}.git`).replace(":", "/");
3586
+ }
3587
+ o(Pl, "normalizeGitUrl");
3588
+ function El(e, t) {
3589
+ return `${Pl(e)}${Xt(t)}`;
3590
+ }
3591
+ o(El, "unhashedProjectId");
3592
+ var Qe, Gi = /* @__PURE__ */ o(() => {
3593
+ if (Qe)
3594
+ return Qe;
3595
+ try {
3596
+ let e = wl(), t = Sl(e, process.cwd()), r = vl("git config --local --get remote.origin.url", {
3597
+ timeout: 1e3,
3598
+ stdio: "pipe"
3599
+ });
3600
+ Qe = sr(El(String(r), t));
3601
+ } catch {
3602
+ }
3603
+ return Qe;
3604
+ }, "getAnonymousProjectId");
3605
+
3606
+ // src/telemetry/event-cache.ts
3607
+ import { cache as cr } from "storybook/internal/common";
3608
+ var ar = Promise.resolve(), Tl = /* @__PURE__ */ o(async (e, t) => {
3609
+ let r = await cr.get("lastEvents") || {};
3610
+ r[e] = { body: t, timestamp: Date.now() }, await cr.set("lastEvents", r);
3611
+ }, "setHelper"), Ni = /* @__PURE__ */ o(async (e, t) => (await ar, ar = Tl(e, t), ar), "set");
3612
+ var kl = /* @__PURE__ */ o((e) => {
3613
+ let { body: t, timestamp: r } = e;
3614
+ return {
3615
+ timestamp: r,
3616
+ eventType: t?.eventType,
3617
+ eventId: t?.eventId,
3618
+ sessionId: t?.sessionId
3619
+ };
3620
+ }, "upgradeFields"), Il = ["init", "upgrade"], Cl = ["build", "dev", "error"], ji = /* @__PURE__ */ o((e, t) => {
3621
+ let r = t.map((n) => e?.[n]).filter(Boolean).sort((n, i) => i.timestamp - n.timestamp);
3622
+ return r.length > 0 ? r[0] : void 0;
3623
+ }, "lastEvent"), Ol = /* @__PURE__ */ o(async (e = void 0) => {
3624
+ let t = e || await cr.get("lastEvents") || {}, r = ji(t, Il), n = ji(t, Cl);
3625
+ if (r)
3626
+ return !n?.timestamp || r.timestamp > n.timestamp ? kl(r) : void 0;
3627
+ }, "getPrecedingUpgrade");
3628
+
3629
+ // src/telemetry/fetch.ts
3630
+ var Bi = global.fetch;
3631
+
3632
+ // src/telemetry/session-id.ts
3633
+ import { cache as Di } from "storybook/internal/common";
3634
+ var Al = 1e3 * 60 * 60 * 2, se;
3635
+ var ur = /* @__PURE__ */ o(async () => {
3636
+ let e = Date.now();
3637
+ if (!se) {
3638
+ let t = await Di.get("session");
3639
+ t && t.lastUsed >= e - Al ? se = t.id : se = ie();
3640
+ }
3641
+ return await Di.set("session", { id: se, lastUsed: e }), se;
3642
+ }, "getSessionId");
3643
+
3644
+ // src/telemetry/telemetry.ts
3645
+ var Rl = (0, Li.default)(Bi), _l = process.env.STORYBOOK_TELEMETRY_URL || "https://storybook.js.org/event-log", Ze = [], Gl = /* @__PURE__ */ o(
3646
+ (e, t) => {
3647
+ lr[e] = t;
3648
+ }, "addToGlobalContext"), jl = /* @__PURE__ */ o(() => {
3649
+ try {
3650
+ let e = Mi.platform();
3651
+ return e === "win32" ? "Windows" : e === "darwin" ? "macOS" : e === "linux" ? "Linux" : `Other: ${e}`;
3652
+ } catch {
3653
+ return "Unknown";
3654
+ }
3655
+ }, "getOperatingSystem"), lr = {
3656
+ inCI: !!process.env.CI,
3657
+ isTTY: process.stdout.isTTY,
3658
+ platform: jl(),
3659
+ nodeVersion: process.versions.node
3660
+ }, Nl = /* @__PURE__ */ o(async (e, t, r) => {
3661
+ let { eventType: n, payload: i, metadata: s, ...a } = e, c = await ur(), u = ie(), l = { ...a, eventType: n, eventId: u, sessionId: c, metadata: s,
3662
+ payload: i, context: t };
3663
+ return Rl(_l, {
3664
+ method: "post",
3665
+ body: JSON.stringify(l),
3666
+ headers: { "Content-Type": "application/json" },
3667
+ retries: 3,
3668
+ retryOn: [503, 504],
3669
+ retryDelay: /* @__PURE__ */ o((f) => 2 ** f * (typeof r?.retryDelay == "number" && !Number.isNaN(r?.retryDelay) ? r.retryDelay : 1e3), "\
3670
+ retryDelay")
3671
+ });
3672
+ }, "prepareRequest");
3673
+ async function Fi(e, t = { retryDelay: 1e3, immediate: !1 }) {
3674
+ let { eventType: r, payload: n, metadata: i, ...s } = e, a = t.stripMetadata ? lr : {
3675
+ ...lr,
3676
+ anonymousId: Gi()
3677
+ }, c;
3678
+ try {
3679
+ c = Nl(e, a, t), Ze.push(c), t.immediate ? await Promise.all(Ze) : await c;
3680
+ let u = await ur(), l = ie(), f = { ...s, eventType: r, eventId: l, sessionId: u, metadata: i, payload: n, context: a };
3681
+ await Ni(r, f);
3682
+ } catch {
3683
+ } finally {
3684
+ Ze = Ze.filter((u) => u !== c);
3685
+ }
3686
+ }
3687
+ o(Fi, "sendTelemetry");
3688
+
3689
+ // src/telemetry/index.ts
3690
+ var Lg = /* @__PURE__ */ o((e) => e.startsWith("example-button--") || e.startsWith("example-header--") || e.startsWith("example-page--"), "i\
3691
+ sExampleStoryId"), Fg = /* @__PURE__ */ o(async (e, t = {}, r = {}) => {
3692
+ e !== "boot" && r.notify !== !1 && await yr();
3693
+ let n = {
3694
+ eventType: e,
3695
+ payload: t
3696
+ };
3697
+ try {
3698
+ r?.stripMetadata || (n.metadata = await Ci(r?.configDir));
3699
+ } catch (i) {
3700
+ n.payload.metadataErrorMessage = fe(i).message, r?.enableCrashReports && (n.payload.metadataError = fe(i));
3701
+ } finally {
3702
+ let { error: i } = n.payload;
3703
+ i && (n.payload.error = fe(i)), (!n.payload.error || r?.enableCrashReports) && (process.env?.STORYBOOK_TELEMETRY_DEBUG && (Ui.info(`
3704
+ [telemetry]`), Ui.info(JSON.stringify(n, null, 2))), await Fi(n, r));
3705
+ }
3706
+ }, "telemetry");
3707
+ export {
3708
+ Gl as addToGlobalContext,
3709
+ z as cleanPaths,
3710
+ hl as computeStorybookMetadata,
3711
+ Ol as getPrecedingUpgrade,
3712
+ Ci as getStorybookMetadata,
3713
+ Lg as isExampleStoryId,
3714
+ ki as metaFrameworks,
3715
+ sr as oneWayHash,
3716
+ br as removeAnsiEscapeCodes,
3717
+ Ii as sanitizeAddonName,
3718
+ fe as sanitizeError,
3719
+ Fg as telemetry
3720
+ };