@storybook/react 11.0.0-alpha.7 → 11.0.0-alpha.8

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.
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_80n7jqmgy9x from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_80n7jqmgy9x from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_80n7jqmgy9x from "node:module";
1
+ import CJS_COMPAT_NODE_URL_lya8clainfq from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_lya8clainfq from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_lya8clainfq from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_80n7jqmgy9x.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_80n7jqmgy9x.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_80n7jqmgy9x.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_lya8clainfq.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_lya8clainfq.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_lya8clainfq.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -2203,22 +2203,22 @@ var require_createProject = __commonJS({
2203
2203
  // ../../../node_modules/vscode-uri/lib/umd/index.js
2204
2204
  var require_umd = __commonJS({
2205
2205
  "../../../node_modules/vscode-uri/lib/umd/index.js"(exports, module) {
2206
- (function(t4, e) {
2206
+ (function(t, e) {
2207
2207
  if (typeof exports == "object" && typeof module == "object") module.exports = e();
2208
2208
  else if (typeof define == "function" && define.amd) define([], e);
2209
2209
  else {
2210
2210
  var r = e();
2211
- for (var n in r) (typeof exports == "object" ? exports : t4)[n] = r[n];
2211
+ for (var n in r) (typeof exports == "object" ? exports : t)[n] = r[n];
2212
2212
  }
2213
2213
  })(exports, (() => (() => {
2214
2214
  "use strict";
2215
- var t4 = { 975: (t5) => {
2216
- function e2(t6) {
2217
- if (typeof t6 != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(t6));
2215
+ var t = { 975: (t2) => {
2216
+ function e2(t3) {
2217
+ if (typeof t3 != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(t3));
2218
2218
  }
2219
- function r2(t6, e3) {
2220
- for (var r3, n3 = "", i2 = 0, o = -1, s = 0, a = 0; a <= t6.length; ++a) {
2221
- if (a < t6.length) r3 = t6.charCodeAt(a);
2219
+ function r2(t3, e3) {
2220
+ for (var r3, n3 = "", i2 = 0, o = -1, s = 0, a = 0; a <= t3.length; ++a) {
2221
+ if (a < t3.length) r3 = t3.charCodeAt(a);
2222
2222
  else {
2223
2223
  if (r3 === 47) break;
2224
2224
  r3 = 47;
@@ -2238,70 +2238,70 @@ var require_umd = __commonJS({
2238
2238
  }
2239
2239
  }
2240
2240
  e3 && (n3.length > 0 ? n3 += "/.." : n3 = "..", i2 = 2);
2241
- } else n3.length > 0 ? n3 += "/" + t6.slice(o + 1, a) : n3 = t6.slice(o + 1, a), i2 = a - o - 1;
2241
+ } else n3.length > 0 ? n3 += "/" + t3.slice(o + 1, a) : n3 = t3.slice(o + 1, a), i2 = a - o - 1;
2242
2242
  o = a, s = 0;
2243
2243
  } else r3 === 46 && s !== -1 ? ++s : s = -1;
2244
2244
  }
2245
2245
  return n3;
2246
2246
  }
2247
2247
  var n2 = { resolve: function() {
2248
- for (var t6, n3 = "", i2 = !1, o = arguments.length - 1; o >= -1 && !i2; o--) {
2248
+ for (var t3, n3 = "", i2 = !1, o = arguments.length - 1; o >= -1 && !i2; o--) {
2249
2249
  var s;
2250
- o >= 0 ? s = arguments[o] : (t6 === void 0 && (t6 = process.cwd()), s = t6), e2(s), s.length !== 0 && (n3 = s + "/" + n3, i2 = s.charCodeAt(0) === 47);
2250
+ o >= 0 ? s = arguments[o] : (t3 === void 0 && (t3 = process.cwd()), s = t3), e2(s), s.length !== 0 && (n3 = s + "/" + n3, i2 = s.charCodeAt(0) === 47);
2251
2251
  }
2252
2252
  return n3 = r2(n3, !i2), i2 ? n3.length > 0 ? "/" + n3 : "/" : n3.length > 0 ? n3 : ".";
2253
- }, normalize: function(t6) {
2254
- if (e2(t6), t6.length === 0) return ".";
2255
- var n3 = t6.charCodeAt(0) === 47, i2 = t6.charCodeAt(t6.length - 1) === 47;
2256
- return (t6 = r2(t6, !n3)).length !== 0 || n3 || (t6 = "."), t6.length > 0 && i2 && (t6 += "/"), n3 ? "/" + t6 : t6;
2257
- }, isAbsolute: function(t6) {
2258
- return e2(t6), t6.length > 0 && t6.charCodeAt(0) === 47;
2253
+ }, normalize: function(t3) {
2254
+ if (e2(t3), t3.length === 0) return ".";
2255
+ var n3 = t3.charCodeAt(0) === 47, i2 = t3.charCodeAt(t3.length - 1) === 47;
2256
+ return (t3 = r2(t3, !n3)).length !== 0 || n3 || (t3 = "."), t3.length > 0 && i2 && (t3 += "/"), n3 ? "/" + t3 : t3;
2257
+ }, isAbsolute: function(t3) {
2258
+ return e2(t3), t3.length > 0 && t3.charCodeAt(0) === 47;
2259
2259
  }, join: function() {
2260
2260
  if (arguments.length === 0) return ".";
2261
- for (var t6, r3 = 0; r3 < arguments.length; ++r3) {
2261
+ for (var t3, r3 = 0; r3 < arguments.length; ++r3) {
2262
2262
  var i2 = arguments[r3];
2263
- e2(i2), i2.length > 0 && (t6 === void 0 ? t6 = i2 : t6 += "/" + i2);
2263
+ e2(i2), i2.length > 0 && (t3 === void 0 ? t3 = i2 : t3 += "/" + i2);
2264
2264
  }
2265
- return t6 === void 0 ? "." : n2.normalize(t6);
2266
- }, relative: function(t6, r3) {
2267
- if (e2(t6), e2(r3), t6 === r3 || (t6 = n2.resolve(t6)) === (r3 = n2.resolve(r3))) return "";
2268
- for (var i2 = 1; i2 < t6.length && t6.charCodeAt(i2) === 47; ++i2) ;
2269
- for (var o = t6.length, s = o - i2, a = 1; a < r3.length && r3.charCodeAt(a) === 47; ++a) ;
2265
+ return t3 === void 0 ? "." : n2.normalize(t3);
2266
+ }, relative: function(t3, r3) {
2267
+ if (e2(t3), e2(r3), t3 === r3 || (t3 = n2.resolve(t3)) === (r3 = n2.resolve(r3))) return "";
2268
+ for (var i2 = 1; i2 < t3.length && t3.charCodeAt(i2) === 47; ++i2) ;
2269
+ for (var o = t3.length, s = o - i2, a = 1; a < r3.length && r3.charCodeAt(a) === 47; ++a) ;
2270
2270
  for (var h = r3.length - a, c = s < h ? s : h, f = -1, u = 0; u <= c; ++u) {
2271
2271
  if (u === c) {
2272
2272
  if (h > c) {
2273
2273
  if (r3.charCodeAt(a + u) === 47) return r3.slice(a + u + 1);
2274
2274
  if (u === 0) return r3.slice(a + u);
2275
- } else s > c && (t6.charCodeAt(i2 + u) === 47 ? f = u : u === 0 && (f = 0));
2275
+ } else s > c && (t3.charCodeAt(i2 + u) === 47 ? f = u : u === 0 && (f = 0));
2276
2276
  break;
2277
2277
  }
2278
- var l = t6.charCodeAt(i2 + u);
2278
+ var l = t3.charCodeAt(i2 + u);
2279
2279
  if (l !== r3.charCodeAt(a + u)) break;
2280
2280
  l === 47 && (f = u);
2281
2281
  }
2282
2282
  var d = "";
2283
- for (u = i2 + f + 1; u <= o; ++u) u !== o && t6.charCodeAt(u) !== 47 || (d.length === 0 ? d += ".." : d += "/..");
2283
+ for (u = i2 + f + 1; u <= o; ++u) u !== o && t3.charCodeAt(u) !== 47 || (d.length === 0 ? d += ".." : d += "/..");
2284
2284
  return d.length > 0 ? d + r3.slice(a + f) : (a += f, r3.charCodeAt(a) === 47 && ++a, r3.slice(a));
2285
- }, _makeLong: function(t6) {
2286
- return t6;
2287
- }, dirname: function(t6) {
2288
- if (e2(t6), t6.length === 0) return ".";
2289
- for (var r3 = t6.charCodeAt(0), n3 = r3 === 47, i2 = -1, o = !0, s = t6.length - 1; s >= 1; --s) if ((r3 = t6.charCodeAt(s)) === 47) {
2285
+ }, _makeLong: function(t3) {
2286
+ return t3;
2287
+ }, dirname: function(t3) {
2288
+ if (e2(t3), t3.length === 0) return ".";
2289
+ for (var r3 = t3.charCodeAt(0), n3 = r3 === 47, i2 = -1, o = !0, s = t3.length - 1; s >= 1; --s) if ((r3 = t3.charCodeAt(s)) === 47) {
2290
2290
  if (!o) {
2291
2291
  i2 = s;
2292
2292
  break;
2293
2293
  }
2294
2294
  } else o = !1;
2295
- return i2 === -1 ? n3 ? "/" : "." : n3 && i2 === 1 ? "//" : t6.slice(0, i2);
2296
- }, basename: function(t6, r3) {
2295
+ return i2 === -1 ? n3 ? "/" : "." : n3 && i2 === 1 ? "//" : t3.slice(0, i2);
2296
+ }, basename: function(t3, r3) {
2297
2297
  if (r3 !== void 0 && typeof r3 != "string") throw new TypeError('"ext" argument must be a string');
2298
- e2(t6);
2298
+ e2(t3);
2299
2299
  var n3, i2 = 0, o = -1, s = !0;
2300
- if (r3 !== void 0 && r3.length > 0 && r3.length <= t6.length) {
2301
- if (r3.length === t6.length && r3 === t6) return "";
2300
+ if (r3 !== void 0 && r3.length > 0 && r3.length <= t3.length) {
2301
+ if (r3.length === t3.length && r3 === t3) return "";
2302
2302
  var a = r3.length - 1, h = -1;
2303
- for (n3 = t6.length - 1; n3 >= 0; --n3) {
2304
- var c = t6.charCodeAt(n3);
2303
+ for (n3 = t3.length - 1; n3 >= 0; --n3) {
2304
+ var c = t3.charCodeAt(n3);
2305
2305
  if (c === 47) {
2306
2306
  if (!s) {
2307
2307
  i2 = n3 + 1;
@@ -2309,79 +2309,79 @@ var require_umd = __commonJS({
2309
2309
  }
2310
2310
  } else h === -1 && (s = !1, h = n3 + 1), a >= 0 && (c === r3.charCodeAt(a) ? --a == -1 && (o = n3) : (a = -1, o = h));
2311
2311
  }
2312
- return i2 === o ? o = h : o === -1 && (o = t6.length), t6.slice(i2, o);
2312
+ return i2 === o ? o = h : o === -1 && (o = t3.length), t3.slice(i2, o);
2313
2313
  }
2314
- for (n3 = t6.length - 1; n3 >= 0; --n3) if (t6.charCodeAt(n3) === 47) {
2314
+ for (n3 = t3.length - 1; n3 >= 0; --n3) if (t3.charCodeAt(n3) === 47) {
2315
2315
  if (!s) {
2316
2316
  i2 = n3 + 1;
2317
2317
  break;
2318
2318
  }
2319
2319
  } else o === -1 && (s = !1, o = n3 + 1);
2320
- return o === -1 ? "" : t6.slice(i2, o);
2321
- }, extname: function(t6) {
2322
- e2(t6);
2323
- for (var r3 = -1, n3 = 0, i2 = -1, o = !0, s = 0, a = t6.length - 1; a >= 0; --a) {
2324
- var h = t6.charCodeAt(a);
2320
+ return o === -1 ? "" : t3.slice(i2, o);
2321
+ }, extname: function(t3) {
2322
+ e2(t3);
2323
+ for (var r3 = -1, n3 = 0, i2 = -1, o = !0, s = 0, a = t3.length - 1; a >= 0; --a) {
2324
+ var h = t3.charCodeAt(a);
2325
2325
  if (h !== 47) i2 === -1 && (o = !1, i2 = a + 1), h === 46 ? r3 === -1 ? r3 = a : s !== 1 && (s = 1) : r3 !== -1 && (s = -1);
2326
2326
  else if (!o) {
2327
2327
  n3 = a + 1;
2328
2328
  break;
2329
2329
  }
2330
2330
  }
2331
- return r3 === -1 || i2 === -1 || s === 0 || s === 1 && r3 === i2 - 1 && r3 === n3 + 1 ? "" : t6.slice(r3, i2);
2332
- }, format: function(t6) {
2333
- if (t6 === null || typeof t6 != "object") throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t6);
2334
- return (function(t7, e3) {
2331
+ return r3 === -1 || i2 === -1 || s === 0 || s === 1 && r3 === i2 - 1 && r3 === n3 + 1 ? "" : t3.slice(r3, i2);
2332
+ }, format: function(t3) {
2333
+ if (t3 === null || typeof t3 != "object") throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t3);
2334
+ return (function(t4, e3) {
2335
2335
  var r3 = e3.dir || e3.root, n3 = e3.base || (e3.name || "") + (e3.ext || "");
2336
2336
  return r3 ? r3 === e3.root ? r3 + n3 : r3 + "/" + n3 : n3;
2337
- })(0, t6);
2338
- }, parse: function(t6) {
2339
- e2(t6);
2337
+ })(0, t3);
2338
+ }, parse: function(t3) {
2339
+ e2(t3);
2340
2340
  var r3 = { root: "", dir: "", base: "", ext: "", name: "" };
2341
- if (t6.length === 0) return r3;
2342
- var n3, i2 = t6.charCodeAt(0), o = i2 === 47;
2341
+ if (t3.length === 0) return r3;
2342
+ var n3, i2 = t3.charCodeAt(0), o = i2 === 47;
2343
2343
  o ? (r3.root = "/", n3 = 1) : n3 = 0;
2344
- for (var s = -1, a = 0, h = -1, c = !0, f = t6.length - 1, u = 0; f >= n3; --f) if ((i2 = t6.charCodeAt(f)) !== 47) h === -1 && (c = !1, h = f + 1), i2 === 46 ? s === -1 ? s = f : u !== 1 && (u = 1) : s !== -1 && (u = -1);
2344
+ for (var s = -1, a = 0, h = -1, c = !0, f = t3.length - 1, u = 0; f >= n3; --f) if ((i2 = t3.charCodeAt(f)) !== 47) h === -1 && (c = !1, h = f + 1), i2 === 46 ? s === -1 ? s = f : u !== 1 && (u = 1) : s !== -1 && (u = -1);
2345
2345
  else if (!c) {
2346
2346
  a = f + 1;
2347
2347
  break;
2348
2348
  }
2349
- return s === -1 || h === -1 || u === 0 || u === 1 && s === h - 1 && s === a + 1 ? h !== -1 && (r3.base = r3.name = a === 0 && o ? t6.slice(1, h) : t6.slice(a, h)) : (a === 0 && o ? (r3.name = t6.slice(1, s), r3.base = t6.slice(1, h)) : (r3.name = t6.slice(a, s), r3.base = t6.slice(a, h)), r3.ext = t6.slice(s, h)), a > 0 ? r3.dir = t6.slice(0, a - 1) : o && (r3.dir = "/"), r3;
2349
+ return s === -1 || h === -1 || u === 0 || u === 1 && s === h - 1 && s === a + 1 ? h !== -1 && (r3.base = r3.name = a === 0 && o ? t3.slice(1, h) : t3.slice(a, h)) : (a === 0 && o ? (r3.name = t3.slice(1, s), r3.base = t3.slice(1, h)) : (r3.name = t3.slice(a, s), r3.base = t3.slice(a, h)), r3.ext = t3.slice(s, h)), a > 0 ? r3.dir = t3.slice(0, a - 1) : o && (r3.dir = "/"), r3;
2350
2350
  }, sep: "/", delimiter: ":", win32: null, posix: null };
2351
- n2.posix = n2, t5.exports = n2;
2352
- }, 70: (t5, e2) => {
2351
+ n2.posix = n2, t2.exports = n2;
2352
+ }, 70: (t2, e2) => {
2353
2353
  if (Object.defineProperty(e2, "__esModule", { value: !0 }), e2.isWindows = void 0, typeof process == "object") e2.isWindows = process.platform === "win32";
2354
2354
  else if (typeof navigator == "object") {
2355
- let t6 = navigator.userAgent;
2356
- e2.isWindows = t6.indexOf("Windows") >= 0;
2355
+ let t3 = navigator.userAgent;
2356
+ e2.isWindows = t3.indexOf("Windows") >= 0;
2357
2357
  }
2358
- }, 231: (t5, e2, r2) => {
2358
+ }, 231: (t2, e2, r2) => {
2359
2359
  Object.defineProperty(e2, "__esModule", { value: !0 }), e2.uriToFsPath = e2.URI = void 0;
2360
2360
  let n2 = r2(70), i2 = /^\w[\w\d+.-]*$/, o = /^\//, s = /^\/\//;
2361
- function a(t6, e3) {
2362
- if (!t6.scheme && e3) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t6.authority}", path: "${t6.path}", query: "${t6.query}", fragment: "${t6.fragment}"}`);
2363
- if (t6.scheme && !i2.test(t6.scheme)) throw new Error("[UriError]: Scheme contains illegal characters.");
2364
- if (t6.path) {
2365
- if (t6.authority) {
2366
- if (!o.test(t6.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
2367
- } else if (s.test(t6.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
2361
+ function a(t3, e3) {
2362
+ if (!t3.scheme && e3) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t3.authority}", path: "${t3.path}", query: "${t3.query}", fragment: "${t3.fragment}"}`);
2363
+ if (t3.scheme && !i2.test(t3.scheme)) throw new Error("[UriError]: Scheme contains illegal characters.");
2364
+ if (t3.path) {
2365
+ if (t3.authority) {
2366
+ if (!o.test(t3.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
2367
+ } else if (s.test(t3.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
2368
2368
  }
2369
2369
  }
2370
2370
  let h = "", c = "/", f = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
2371
2371
  class u {
2372
- static isUri(t6) {
2373
- return t6 instanceof u || !!t6 && typeof t6.authority == "string" && typeof t6.fragment == "string" && typeof t6.path == "string" && typeof t6.query == "string" && typeof t6.scheme == "string" && typeof t6.fsPath == "string" && typeof t6.with == "function" && typeof t6.toString == "function";
2372
+ static isUri(t3) {
2373
+ return t3 instanceof u || !!t3 && typeof t3.authority == "string" && typeof t3.fragment == "string" && typeof t3.path == "string" && typeof t3.query == "string" && typeof t3.scheme == "string" && typeof t3.fsPath == "string" && typeof t3.with == "function" && typeof t3.toString == "function";
2374
2374
  }
2375
2375
  scheme;
2376
2376
  authority;
2377
2377
  path;
2378
2378
  query;
2379
2379
  fragment;
2380
- constructor(t6, e3, r3, n3, i3, o2 = !1) {
2381
- typeof t6 == "object" ? (this.scheme = t6.scheme || h, this.authority = t6.authority || h, this.path = t6.path || h, this.query = t6.query || h, this.fragment = t6.fragment || h) : (this.scheme = /* @__PURE__ */ (function(t7, e4) {
2382
- return t7 || e4 ? t7 : "file";
2383
- })(t6, o2), this.authority = e3 || h, this.path = (function(t7, e4) {
2384
- switch (t7) {
2380
+ constructor(t3, e3, r3, n3, i3, o2 = !1) {
2381
+ typeof t3 == "object" ? (this.scheme = t3.scheme || h, this.authority = t3.authority || h, this.path = t3.path || h, this.query = t3.query || h, this.fragment = t3.fragment || h) : (this.scheme = /* @__PURE__ */ (function(t4, e4) {
2382
+ return t4 || e4 ? t4 : "file";
2383
+ })(t3, o2), this.authority = e3 || h, this.path = (function(t4, e4) {
2384
+ switch (t4) {
2385
2385
  case "https":
2386
2386
  case "http":
2387
2387
  case "file":
@@ -2393,42 +2393,42 @@ var require_umd = __commonJS({
2393
2393
  get fsPath() {
2394
2394
  return v(this, !1);
2395
2395
  }
2396
- with(t6) {
2397
- if (!t6) return this;
2398
- let { scheme: e3, authority: r3, path: n3, query: i3, fragment: o2 } = t6;
2396
+ with(t3) {
2397
+ if (!t3) return this;
2398
+ let { scheme: e3, authority: r3, path: n3, query: i3, fragment: o2 } = t3;
2399
2399
  return e3 === void 0 ? e3 = this.scheme : e3 === null && (e3 = h), r3 === void 0 ? r3 = this.authority : r3 === null && (r3 = h), n3 === void 0 ? n3 = this.path : n3 === null && (n3 = h), i3 === void 0 ? i3 = this.query : i3 === null && (i3 = h), o2 === void 0 ? o2 = this.fragment : o2 === null && (o2 = h), e3 === this.scheme && r3 === this.authority && n3 === this.path && i3 === this.query && o2 === this.fragment ? this : new d(e3, r3, n3, i3, o2);
2400
2400
  }
2401
- static parse(t6, e3 = !1) {
2402
- let r3 = f.exec(t6);
2401
+ static parse(t3, e3 = !1) {
2402
+ let r3 = f.exec(t3);
2403
2403
  return r3 ? new d(r3[2] || h, w(r3[4] || h), w(r3[5] || h), w(r3[7] || h), w(r3[9] || h), e3) : new d(h, h, h, h, h);
2404
2404
  }
2405
- static file(t6) {
2405
+ static file(t3) {
2406
2406
  let e3 = h;
2407
- if (n2.isWindows && (t6 = t6.replace(/\\/g, c)), t6[0] === c && t6[1] === c) {
2408
- let r3 = t6.indexOf(c, 2);
2409
- r3 === -1 ? (e3 = t6.substring(2), t6 = c) : (e3 = t6.substring(2, r3), t6 = t6.substring(r3) || c);
2407
+ if (n2.isWindows && (t3 = t3.replace(/\\/g, c)), t3[0] === c && t3[1] === c) {
2408
+ let r3 = t3.indexOf(c, 2);
2409
+ r3 === -1 ? (e3 = t3.substring(2), t3 = c) : (e3 = t3.substring(2, r3), t3 = t3.substring(r3) || c);
2410
2410
  }
2411
- return new d("file", e3, t6, h, h);
2411
+ return new d("file", e3, t3, h, h);
2412
2412
  }
2413
- static from(t6) {
2414
- let e3 = new d(t6.scheme, t6.authority, t6.path, t6.query, t6.fragment);
2413
+ static from(t3) {
2414
+ let e3 = new d(t3.scheme, t3.authority, t3.path, t3.query, t3.fragment);
2415
2415
  return a(e3, !0), e3;
2416
2416
  }
2417
- toString(t6 = !1) {
2418
- return y(this, t6);
2417
+ toString(t3 = !1) {
2418
+ return y(this, t3);
2419
2419
  }
2420
2420
  toJSON() {
2421
2421
  return this;
2422
2422
  }
2423
- static revive(t6) {
2424
- if (t6) {
2425
- if (t6 instanceof u) return t6;
2423
+ static revive(t3) {
2424
+ if (t3) {
2425
+ if (t3 instanceof u) return t3;
2426
2426
  {
2427
- let e3 = new d(t6);
2428
- return e3._formatted = t6.external, e3._fsPath = t6._sep === l ? t6.fsPath : null, e3;
2427
+ let e3 = new d(t3);
2428
+ return e3._formatted = t3.external, e3._fsPath = t3._sep === l ? t3.fsPath : null, e3;
2429
2429
  }
2430
2430
  }
2431
- return t6;
2431
+ return t3;
2432
2432
  }
2433
2433
  }
2434
2434
  e2.URI = u;
@@ -2439,112 +2439,112 @@ var require_umd = __commonJS({
2439
2439
  get fsPath() {
2440
2440
  return this._fsPath || (this._fsPath = v(this, !1)), this._fsPath;
2441
2441
  }
2442
- toString(t6 = !1) {
2443
- return t6 ? y(this, !0) : (this._formatted || (this._formatted = y(this, !1)), this._formatted);
2442
+ toString(t3 = !1) {
2443
+ return t3 ? y(this, !0) : (this._formatted || (this._formatted = y(this, !1)), this._formatted);
2444
2444
  }
2445
2445
  toJSON() {
2446
- let t6 = { $mid: 1 };
2447
- return this._fsPath && (t6.fsPath = this._fsPath, t6._sep = l), this._formatted && (t6.external = this._formatted), this.path && (t6.path = this.path), this.scheme && (t6.scheme = this.scheme), this.authority && (t6.authority = this.authority), this.query && (t6.query = this.query), this.fragment && (t6.fragment = this.fragment), t6;
2446
+ let t3 = { $mid: 1 };
2447
+ return this._fsPath && (t3.fsPath = this._fsPath, t3._sep = l), this._formatted && (t3.external = this._formatted), this.path && (t3.path = this.path), this.scheme && (t3.scheme = this.scheme), this.authority && (t3.authority = this.authority), this.query && (t3.query = this.query), this.fragment && (t3.fragment = this.fragment), t3;
2448
2448
  }
2449
2449
  }
2450
2450
  let p = { 58: "%3A", 47: "%2F", 63: "%3F", 35: "%23", 91: "%5B", 93: "%5D", 64: "%40", 33: "%21", 36: "%24", 38: "%26", 39: "%27", 40: "%28", 41: "%29", 42: "%2A", 43: "%2B", 44: "%2C", 59: "%3B", 61: "%3D", 32: "%20" };
2451
- function g(t6, e3, r3) {
2451
+ function g(t3, e3, r3) {
2452
2452
  let n3, i3 = -1;
2453
- for (let o2 = 0; o2 < t6.length; o2++) {
2454
- let s2 = t6.charCodeAt(o2);
2455
- if (s2 >= 97 && s2 <= 122 || s2 >= 65 && s2 <= 90 || s2 >= 48 && s2 <= 57 || s2 === 45 || s2 === 46 || s2 === 95 || s2 === 126 || e3 && s2 === 47 || r3 && s2 === 91 || r3 && s2 === 93 || r3 && s2 === 58) i3 !== -1 && (n3 += encodeURIComponent(t6.substring(i3, o2)), i3 = -1), n3 !== void 0 && (n3 += t6.charAt(o2));
2453
+ for (let o2 = 0; o2 < t3.length; o2++) {
2454
+ let s2 = t3.charCodeAt(o2);
2455
+ if (s2 >= 97 && s2 <= 122 || s2 >= 65 && s2 <= 90 || s2 >= 48 && s2 <= 57 || s2 === 45 || s2 === 46 || s2 === 95 || s2 === 126 || e3 && s2 === 47 || r3 && s2 === 91 || r3 && s2 === 93 || r3 && s2 === 58) i3 !== -1 && (n3 += encodeURIComponent(t3.substring(i3, o2)), i3 = -1), n3 !== void 0 && (n3 += t3.charAt(o2));
2456
2456
  else {
2457
- n3 === void 0 && (n3 = t6.substr(0, o2));
2457
+ n3 === void 0 && (n3 = t3.substr(0, o2));
2458
2458
  let e4 = p[s2];
2459
- e4 !== void 0 ? (i3 !== -1 && (n3 += encodeURIComponent(t6.substring(i3, o2)), i3 = -1), n3 += e4) : i3 === -1 && (i3 = o2);
2459
+ e4 !== void 0 ? (i3 !== -1 && (n3 += encodeURIComponent(t3.substring(i3, o2)), i3 = -1), n3 += e4) : i3 === -1 && (i3 = o2);
2460
2460
  }
2461
2461
  }
2462
- return i3 !== -1 && (n3 += encodeURIComponent(t6.substring(i3))), n3 !== void 0 ? n3 : t6;
2462
+ return i3 !== -1 && (n3 += encodeURIComponent(t3.substring(i3))), n3 !== void 0 ? n3 : t3;
2463
2463
  }
2464
- function m(t6) {
2464
+ function m(t3) {
2465
2465
  let e3;
2466
- for (let r3 = 0; r3 < t6.length; r3++) {
2467
- let n3 = t6.charCodeAt(r3);
2468
- n3 === 35 || n3 === 63 ? (e3 === void 0 && (e3 = t6.substr(0, r3)), e3 += p[n3]) : e3 !== void 0 && (e3 += t6[r3]);
2466
+ for (let r3 = 0; r3 < t3.length; r3++) {
2467
+ let n3 = t3.charCodeAt(r3);
2468
+ n3 === 35 || n3 === 63 ? (e3 === void 0 && (e3 = t3.substr(0, r3)), e3 += p[n3]) : e3 !== void 0 && (e3 += t3[r3]);
2469
2469
  }
2470
- return e3 !== void 0 ? e3 : t6;
2470
+ return e3 !== void 0 ? e3 : t3;
2471
2471
  }
2472
- function v(t6, e3) {
2472
+ function v(t3, e3) {
2473
2473
  let r3;
2474
- return r3 = t6.authority && t6.path.length > 1 && t6.scheme === "file" ? `//${t6.authority}${t6.path}` : t6.path.charCodeAt(0) === 47 && (t6.path.charCodeAt(1) >= 65 && t6.path.charCodeAt(1) <= 90 || t6.path.charCodeAt(1) >= 97 && t6.path.charCodeAt(1) <= 122) && t6.path.charCodeAt(2) === 58 ? e3 ? t6.path.substr(1) : t6.path[1].toLowerCase() + t6.path.substr(2) : t6.path, n2.isWindows && (r3 = r3.replace(/\//g, "\\")), r3;
2474
+ return r3 = t3.authority && t3.path.length > 1 && t3.scheme === "file" ? `//${t3.authority}${t3.path}` : t3.path.charCodeAt(0) === 47 && (t3.path.charCodeAt(1) >= 65 && t3.path.charCodeAt(1) <= 90 || t3.path.charCodeAt(1) >= 97 && t3.path.charCodeAt(1) <= 122) && t3.path.charCodeAt(2) === 58 ? e3 ? t3.path.substr(1) : t3.path[1].toLowerCase() + t3.path.substr(2) : t3.path, n2.isWindows && (r3 = r3.replace(/\//g, "\\")), r3;
2475
2475
  }
2476
- function y(t6, e3) {
2477
- let r3 = e3 ? m : g, n3 = "", { scheme: i3, authority: o2, path: s2, query: a2, fragment: h2 } = t6;
2476
+ function y(t3, e3) {
2477
+ let r3 = e3 ? m : g, n3 = "", { scheme: i3, authority: o2, path: s2, query: a2, fragment: h2 } = t3;
2478
2478
  if (i3 && (n3 += i3, n3 += ":"), (o2 || i3 === "file") && (n3 += c, n3 += c), o2) {
2479
- let t7 = o2.indexOf("@");
2480
- if (t7 !== -1) {
2481
- let e4 = o2.substr(0, t7);
2482
- o2 = o2.substr(t7 + 1), t7 = e4.lastIndexOf(":"), t7 === -1 ? n3 += r3(e4, !1, !1) : (n3 += r3(e4.substr(0, t7), !1, !1), n3 += ":", n3 += r3(e4.substr(t7 + 1), !1, !0)), n3 += "@";
2479
+ let t4 = o2.indexOf("@");
2480
+ if (t4 !== -1) {
2481
+ let e4 = o2.substr(0, t4);
2482
+ o2 = o2.substr(t4 + 1), t4 = e4.lastIndexOf(":"), t4 === -1 ? n3 += r3(e4, !1, !1) : (n3 += r3(e4.substr(0, t4), !1, !1), n3 += ":", n3 += r3(e4.substr(t4 + 1), !1, !0)), n3 += "@";
2483
2483
  }
2484
- o2 = o2.toLowerCase(), t7 = o2.lastIndexOf(":"), t7 === -1 ? n3 += r3(o2, !1, !0) : (n3 += r3(o2.substr(0, t7), !1, !0), n3 += o2.substr(t7));
2484
+ o2 = o2.toLowerCase(), t4 = o2.lastIndexOf(":"), t4 === -1 ? n3 += r3(o2, !1, !0) : (n3 += r3(o2.substr(0, t4), !1, !0), n3 += o2.substr(t4));
2485
2485
  }
2486
2486
  if (s2) {
2487
2487
  if (s2.length >= 3 && s2.charCodeAt(0) === 47 && s2.charCodeAt(2) === 58) {
2488
- let t7 = s2.charCodeAt(1);
2489
- t7 >= 65 && t7 <= 90 && (s2 = `/${String.fromCharCode(t7 + 32)}:${s2.substr(3)}`);
2488
+ let t4 = s2.charCodeAt(1);
2489
+ t4 >= 65 && t4 <= 90 && (s2 = `/${String.fromCharCode(t4 + 32)}:${s2.substr(3)}`);
2490
2490
  } else if (s2.length >= 2 && s2.charCodeAt(1) === 58) {
2491
- let t7 = s2.charCodeAt(0);
2492
- t7 >= 65 && t7 <= 90 && (s2 = `${String.fromCharCode(t7 + 32)}:${s2.substr(2)}`);
2491
+ let t4 = s2.charCodeAt(0);
2492
+ t4 >= 65 && t4 <= 90 && (s2 = `${String.fromCharCode(t4 + 32)}:${s2.substr(2)}`);
2493
2493
  }
2494
2494
  n3 += r3(s2, !0, !1);
2495
2495
  }
2496
2496
  return a2 && (n3 += "?", n3 += r3(a2, !1, !1)), h2 && (n3 += "#", n3 += e3 ? h2 : g(h2, !1, !1)), n3;
2497
2497
  }
2498
- function b(t6) {
2498
+ function b(t3) {
2499
2499
  try {
2500
- return decodeURIComponent(t6);
2500
+ return decodeURIComponent(t3);
2501
2501
  } catch {
2502
- return t6.length > 3 ? t6.substr(0, 3) + b(t6.substr(3)) : t6;
2502
+ return t3.length > 3 ? t3.substr(0, 3) + b(t3.substr(3)) : t3;
2503
2503
  }
2504
2504
  }
2505
2505
  e2.uriToFsPath = v;
2506
2506
  let C = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
2507
- function w(t6) {
2508
- return t6.match(C) ? t6.replace(C, ((t7) => b(t7))) : t6;
2507
+ function w(t3) {
2508
+ return t3.match(C) ? t3.replace(C, ((t4) => b(t4))) : t3;
2509
2509
  }
2510
- }, 552: function(t5, e2, r2) {
2511
- var n2 = this && this.__createBinding || (Object.create ? function(t6, e3, r3, n3) {
2510
+ }, 552: function(t2, e2, r2) {
2511
+ var n2 = this && this.__createBinding || (Object.create ? function(t3, e3, r3, n3) {
2512
2512
  n3 === void 0 && (n3 = r3);
2513
2513
  var i3 = Object.getOwnPropertyDescriptor(e3, r3);
2514
2514
  i3 && !("get" in i3 ? !e3.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: !0, get: function() {
2515
2515
  return e3[r3];
2516
- } }), Object.defineProperty(t6, n3, i3);
2517
- } : function(t6, e3, r3, n3) {
2518
- n3 === void 0 && (n3 = r3), t6[n3] = e3[r3];
2519
- }), i2 = this && this.__setModuleDefault || (Object.create ? function(t6, e3) {
2520
- Object.defineProperty(t6, "default", { enumerable: !0, value: e3 });
2521
- } : function(t6, e3) {
2522
- t6.default = e3;
2523
- }), o = this && this.__importStar || function(t6) {
2524
- if (t6 && t6.__esModule) return t6;
2516
+ } }), Object.defineProperty(t3, n3, i3);
2517
+ } : function(t3, e3, r3, n3) {
2518
+ n3 === void 0 && (n3 = r3), t3[n3] = e3[r3];
2519
+ }), i2 = this && this.__setModuleDefault || (Object.create ? function(t3, e3) {
2520
+ Object.defineProperty(t3, "default", { enumerable: !0, value: e3 });
2521
+ } : function(t3, e3) {
2522
+ t3.default = e3;
2523
+ }), o = this && this.__importStar || function(t3) {
2524
+ if (t3 && t3.__esModule) return t3;
2525
2525
  var e3 = {};
2526
- if (t6 != null) for (var r3 in t6) r3 !== "default" && Object.prototype.hasOwnProperty.call(t6, r3) && n2(e3, t6, r3);
2527
- return i2(e3, t6), e3;
2526
+ if (t3 != null) for (var r3 in t3) r3 !== "default" && Object.prototype.hasOwnProperty.call(t3, r3) && n2(e3, t3, r3);
2527
+ return i2(e3, t3), e3;
2528
2528
  };
2529
2529
  Object.defineProperty(e2, "__esModule", { value: !0 }), e2.Utils = void 0;
2530
2530
  let s = o(r2(975)), a = s.posix || s, h = "/";
2531
2531
  var c;
2532
- (function(t6) {
2533
- t6.joinPath = function(t7, ...e3) {
2534
- return t7.with({ path: a.join(t7.path, ...e3) });
2535
- }, t6.resolvePath = function(t7, ...e3) {
2536
- let r3 = t7.path, n3 = !1;
2532
+ (function(t3) {
2533
+ t3.joinPath = function(t4, ...e3) {
2534
+ return t4.with({ path: a.join(t4.path, ...e3) });
2535
+ }, t3.resolvePath = function(t4, ...e3) {
2536
+ let r3 = t4.path, n3 = !1;
2537
2537
  r3[0] !== h && (r3 = h + r3, n3 = !0);
2538
2538
  let i3 = a.resolve(r3, ...e3);
2539
- return n3 && i3[0] === h && !t7.authority && (i3 = i3.substring(1)), t7.with({ path: i3 });
2540
- }, t6.dirname = function(t7) {
2541
- if (t7.path.length === 0 || t7.path === h) return t7;
2542
- let e3 = a.dirname(t7.path);
2543
- return e3.length === 1 && e3.charCodeAt(0) === 46 && (e3 = ""), t7.with({ path: e3 });
2544
- }, t6.basename = function(t7) {
2545
- return a.basename(t7.path);
2546
- }, t6.extname = function(t7) {
2547
- return a.extname(t7.path);
2539
+ return n3 && i3[0] === h && !t4.authority && (i3 = i3.substring(1)), t4.with({ path: i3 });
2540
+ }, t3.dirname = function(t4) {
2541
+ if (t4.path.length === 0 || t4.path === h) return t4;
2542
+ let e3 = a.dirname(t4.path);
2543
+ return e3.length === 1 && e3.charCodeAt(0) === 46 && (e3 = ""), t4.with({ path: e3 });
2544
+ }, t3.basename = function(t4) {
2545
+ return a.basename(t4.path);
2546
+ }, t3.extname = function(t4) {
2547
+ return a.extname(t4.path);
2548
2548
  };
2549
2549
  })(c || (e2.Utils = c = {}));
2550
2550
  } }, e = {};
@@ -2552,18 +2552,18 @@ var require_umd = __commonJS({
2552
2552
  var i2 = e[n2];
2553
2553
  if (i2 !== void 0) return i2.exports;
2554
2554
  var o = e[n2] = { exports: {} };
2555
- return t4[n2].call(o.exports, o, o.exports, r), o.exports;
2555
+ return t[n2].call(o.exports, o, o.exports, r), o.exports;
2556
2556
  }
2557
2557
  var n = {};
2558
2558
  return (() => {
2559
- var t5 = n;
2560
- Object.defineProperty(t5, "__esModule", { value: !0 }), t5.Utils = t5.URI = void 0;
2559
+ var t2 = n;
2560
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Utils = t2.URI = void 0;
2561
2561
  let e2 = r(231);
2562
- Object.defineProperty(t5, "URI", { enumerable: !0, get: function() {
2562
+ Object.defineProperty(t2, "URI", { enumerable: !0, get: function() {
2563
2563
  return e2.URI;
2564
2564
  } });
2565
2565
  let i2 = r(552);
2566
- Object.defineProperty(t5, "Utils", { enumerable: !0, get: function() {
2566
+ Object.defineProperty(t2, "Utils", { enumerable: !0, get: function() {
2567
2567
  return i2.Utils;
2568
2568
  } });
2569
2569
  })(), n;
@@ -6167,7 +6167,7 @@ __export(acorn_exports, {
6167
6167
  lineBreak: () => lineBreak,
6168
6168
  lineBreakG: () => lineBreakG,
6169
6169
  nonASCIIwhitespace: () => nonASCIIwhitespace,
6170
- parse: () => parse3,
6170
+ parse: () => parse4,
6171
6171
  parseExpressionAt: () => parseExpressionAt2,
6172
6172
  tokContexts: () => types,
6173
6173
  tokTypes: () => types$1,
@@ -6335,7 +6335,7 @@ function stringToNumber(str, isLegacyOctalNumericLiteral) {
6335
6335
  function stringToBigInt(str) {
6336
6336
  return typeof BigInt != "function" ? null : BigInt(str.replace(/_/g, ""));
6337
6337
  }
6338
- function parse3(input, options) {
6338
+ function parse4(input, options) {
6339
6339
  return Parser.parse(input, options);
6340
6340
  }
6341
6341
  function parseExpressionAt2(input, pos, options) {
@@ -7825,7 +7825,7 @@ var astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars,
7825
7825
  var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
7826
7826
  return this.enterScope(functionFlags(isAsync, !1) | SCOPE_ARROW), this.initFunction(node), this.options.ecmaVersion >= 8 && (node.async = !!isAsync), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, node.params = this.toAssignableList(params, !0), this.parseFunctionBody(node, !0, !1, forInit), this.yieldPos = oldYieldPos, this.awaitPos = oldAwaitPos, this.awaitIdentPos = oldAwaitIdentPos, this.finishNode(node, "ArrowFunctionExpression");
7827
7827
  };
7828
- pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
7828
+ pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod2, forInit) {
7829
7829
  var isExpression = isArrowFunction && this.type !== types$1.braceL, oldStrict = this.strict, useStrict = !1;
7830
7830
  if (isExpression)
7831
7831
  node.body = this.parseMaybeAssign(forInit), node.expression = !0, this.checkParams(node, !1);
@@ -7833,7 +7833,7 @@ var astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars,
7833
7833
  var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
7834
7834
  (!oldStrict || nonSimple) && (useStrict = this.strictDirective(this.end), useStrict && nonSimple && this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
7835
7835
  var oldLabels = this.labels;
7836
- this.labels = [], useStrict && (this.strict = !0), this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)), this.strict && node.id && this.checkLValSimple(node.id, BIND_OUTSIDE), node.body = this.parseBlock(!1, void 0, useStrict && !oldStrict), node.expression = !1, this.adaptDirectivePrologue(node.body.body), this.labels = oldLabels;
7836
+ this.labels = [], useStrict && (this.strict = !0), this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod2 && this.isSimpleParamList(node.params)), this.strict && node.id && this.checkLValSimple(node.id, BIND_OUTSIDE), node.body = this.parseBlock(!1, void 0, useStrict && !oldStrict), node.expression = !1, this.adaptDirectivePrologue(node.body.body), this.labels = oldLabels;
7837
7837
  }
7838
7838
  this.exitScope();
7839
7839
  };
@@ -10235,12 +10235,12 @@ var require_dist2 = __commonJS({
10235
10235
  "../../../node_modules/@base2/pretty-print-object/dist/index.js"(exports) {
10236
10236
  "use strict";
10237
10237
  var __assign = exports && exports.__assign || function() {
10238
- return __assign = Object.assign || function(t4) {
10238
+ return __assign = Object.assign || function(t) {
10239
10239
  for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
10240
10240
  s = arguments[i2];
10241
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t4[p] = s[p]);
10241
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
10242
10242
  }
10243
- return t4;
10243
+ return t;
10244
10244
  }, __assign.apply(this, arguments);
10245
10245
  }, __spreadArrays = exports && exports.__spreadArrays || function() {
10246
10246
  for (var s = 0, i2 = 0, il = arguments.length; i2 < il; i2++) s += arguments[i2].length;
@@ -10331,7 +10331,7 @@ var require_dist2 = __commonJS({
10331
10331
  var require_react_is_production_min = __commonJS({
10332
10332
  "../../../node_modules/react-element-to-jsx-string/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
10333
10333
  "use strict";
10334
- var b = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), e = /* @__PURE__ */ Symbol.for("react.strict_mode"), f = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.provider"), h = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.server_context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), m = /* @__PURE__ */ Symbol.for("react.suspense"), n = /* @__PURE__ */ Symbol.for("react.suspense_list"), p = /* @__PURE__ */ Symbol.for("react.memo"), q = /* @__PURE__ */ Symbol.for("react.lazy"), t4 = /* @__PURE__ */ Symbol.for("react.offscreen"), u;
10334
+ var b = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), e = /* @__PURE__ */ Symbol.for("react.strict_mode"), f = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.provider"), h = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.server_context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), m = /* @__PURE__ */ Symbol.for("react.suspense"), n = /* @__PURE__ */ Symbol.for("react.suspense_list"), p = /* @__PURE__ */ Symbol.for("react.memo"), q = /* @__PURE__ */ Symbol.for("react.lazy"), t = /* @__PURE__ */ Symbol.for("react.offscreen"), u;
10335
10335
  u = /* @__PURE__ */ Symbol.for("react.module.reference");
10336
10336
  function v(a) {
10337
10337
  if (typeof a == "object" && a !== null) {
@@ -10418,7 +10418,7 @@ var require_react_is_production_min = __commonJS({
10418
10418
  return v(a) === n;
10419
10419
  };
10420
10420
  exports.isValidElementType = function(a) {
10421
- return typeof a == "string" || typeof a == "function" || a === d || a === f || a === e || a === m || a === n || a === t4 || typeof a == "object" && a !== null && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || a.getModuleId !== void 0);
10421
+ return typeof a == "string" || typeof a == "function" || a === d || a === f || a === e || a === m || a === n || a === t || typeof a == "object" && a !== null && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || a.getModuleId !== void 0);
10422
10422
  };
10423
10423
  exports.typeOf = v;
10424
10424
  }
@@ -11655,12 +11655,12 @@ var require_tsconfig_loader = __commonJS({
11655
11655
  "../../../node_modules/tsconfig-paths/lib/tsconfig-loader.js"(exports) {
11656
11656
  "use strict";
11657
11657
  var __assign = exports && exports.__assign || function() {
11658
- return __assign = Object.assign || function(t4) {
11658
+ return __assign = Object.assign || function(t) {
11659
11659
  for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
11660
11660
  s = arguments[i2];
11661
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t4[p] = s[p]);
11661
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
11662
11662
  }
11663
- return t4;
11663
+ return t;
11664
11664
  }, __assign.apply(this, arguments);
11665
11665
  };
11666
11666
  Object.defineProperty(exports, "__esModule", { value: !0 });
@@ -13444,9 +13444,9 @@ function serializeType(typescript, checker, type, isRequired, depth = 0) {
13444
13444
  return { name: checker.typeToString(type) };
13445
13445
  if (type.isUnion()) {
13446
13446
  let nonUndefinedTypes = type.types.filter(
13447
- (t4) => !(t4.getFlags() & typescript.TypeFlags.Undefined)
13447
+ (t) => !(t.getFlags() & typescript.TypeFlags.Undefined)
13448
13448
  ), booleanLiterals = nonUndefinedTypes.filter(
13449
- (t4) => t4.getFlags() & typescript.TypeFlags.BooleanLiteral
13449
+ (t) => t.getFlags() & typescript.TypeFlags.BooleanLiteral
13450
13450
  );
13451
13451
  if (booleanLiterals.length === 2 && booleanLiterals.length === nonUndefinedTypes.length)
13452
13452
  return { name: "boolean" };
@@ -14135,6 +14135,296 @@ var ComponentMetaManager = class extends BaseComponentMetaManager {
14135
14135
  }
14136
14136
  };
14137
14137
 
14138
+ // ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
14139
+ var _lazyMatch = () => {
14140
+ var __lib__ = (() => {
14141
+ var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
14142
+ for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
14143
+ }, H = (r, e, n, a) => {
14144
+ if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, { get: () => e[t], enumerable: !(a = V(e, t)) || a.enumerable });
14145
+ return r;
14146
+ }, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
14147
+ q(w, { default: () => re });
14148
+ var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
14149
+ let e = /* @__PURE__ */ new Map();
14150
+ return (n) => {
14151
+ let a = e.get(n);
14152
+ if (a) return a;
14153
+ let t = r(n);
14154
+ return e.set(n, t), t;
14155
+ };
14156
+ }, rr = (r, e, n = {}) => {
14157
+ let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
14158
+ if (v(e)(a) && a.index === r.length) return a.output;
14159
+ throw new Error(`Failed to parse at index ${a.indexMax}`);
14160
+ }, i2 = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
14161
+ let n = {};
14162
+ for (let a of r) {
14163
+ if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
14164
+ let t = a.charCodeAt(0);
14165
+ n[t] = !0;
14166
+ }
14167
+ return (a) => {
14168
+ let t = a.index, o = a.input;
14169
+ for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
14170
+ let u = a.index;
14171
+ if (u > t) {
14172
+ if (!h(e) && !a.options.silent) {
14173
+ let s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
14174
+ h(c) || a.output.push(c);
14175
+ }
14176
+ a.indexMax = Math.max(a.indexMax, a.index);
14177
+ }
14178
+ return !0;
14179
+ };
14180
+ }, nr = (r, e) => {
14181
+ let n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
14182
+ return g((o) => {
14183
+ t.lastIndex = o.index;
14184
+ let u = t.exec(o.input);
14185
+ if (u) {
14186
+ if (!h(e) && !o.options.silent) {
14187
+ let s = d(e) ? e(...u, o.input, String(o.index)) : e;
14188
+ h(s) || o.output.push(s);
14189
+ }
14190
+ return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
14191
+ } else return !1;
14192
+ });
14193
+ }, ar = (r, e) => (n) => {
14194
+ if (n.input.startsWith(r, n.index)) {
14195
+ if (!h(e) && !n.options.silent) {
14196
+ let t = d(e) ? e(r, n.input, String(n.index)) : e;
14197
+ h(t) || n.output.push(t);
14198
+ }
14199
+ return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
14200
+ } else return !1;
14201
+ }, C = (r, e, n, a) => {
14202
+ let t = v(r);
14203
+ return g(_(M((o) => {
14204
+ let u = 0;
14205
+ for (; u < n; ) {
14206
+ let s = o.index;
14207
+ if (!t(o) || (u += 1, o.index === s)) break;
14208
+ }
14209
+ return u >= e;
14210
+ })));
14211
+ }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
14212
+ let n = r.map(v);
14213
+ return g(_(M((a) => {
14214
+ for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return !1;
14215
+ return !0;
14216
+ })));
14217
+ }, l = (r, e) => {
14218
+ let n = r.map(v);
14219
+ return g(_((a) => {
14220
+ for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return !0;
14221
+ return !1;
14222
+ }));
14223
+ }, M = (r, e = !1) => {
14224
+ let n = v(r);
14225
+ return (a) => {
14226
+ let t = a.index, o = a.output.length, u = n(a);
14227
+ return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
14228
+ };
14229
+ }, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
14230
+ let r = 0;
14231
+ return (e) => {
14232
+ let n = v(e), a = r += 1;
14233
+ return (t) => {
14234
+ var o;
14235
+ if (t.options.memoization === !1) return n(t);
14236
+ let u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
14237
+ if (c === !1) return !1;
14238
+ if (W(c)) return t.index = c, !0;
14239
+ if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), !0;
14240
+ {
14241
+ let Z = t.output.length;
14242
+ if (n(t)) {
14243
+ let D = t.index, U = t.output.length;
14244
+ if (U > Z) {
14245
+ let ee = t.output.slice(Z, U);
14246
+ s.set(u, { index: D, output: ee });
14247
+ } else s.set(u, D);
14248
+ return !0;
14249
+ } else return s.set(u, !1), !1;
14250
+ }
14251
+ };
14252
+ };
14253
+ })(), E = (r) => {
14254
+ let e;
14255
+ return (n) => (e || (e = v(r())), e(n));
14256
+ }, v = Y((r) => {
14257
+ if (d(r)) return Q(r) ? E(r) : r;
14258
+ if (b(r) || X(r)) return i2(r);
14259
+ if (A(r)) return x(r);
14260
+ if (K(r)) return l(Object.values(r));
14261
+ throw new Error("Invalid rule");
14262
+ }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
14263
+ let e = "";
14264
+ for (; r > 0; ) {
14265
+ let n = (r - 1) % 26;
14266
+ e = P[n] + e, r = Math.floor((r - 1) / 26);
14267
+ }
14268
+ return e;
14269
+ }, O = (r) => {
14270
+ let e = 0;
14271
+ for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
14272
+ return e;
14273
+ }, S = (r, e) => {
14274
+ if (e < r) return S(e, r);
14275
+ let n = [];
14276
+ for (; r <= e; ) n.push(r++);
14277
+ return n;
14278
+ }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: !1 }).join("")), ur = (r) => {
14279
+ let e = {};
14280
+ return (n) => e[n] ?? (e[n] = r(n));
14281
+ }, sr = i2(/^\*\*\/\*$/, ".*"), cr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i2(/\\./, p), pr = i2(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i2(/./, p), hr = i2(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i2(/^(!!)+/, ""), fr = l([hr, dr]), xr = i2(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i2(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i2(/\/(\*\*)$/, "(?:/.*|$)"), _r = i2(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i2(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i2(/\*/, "[^/]*"), N = l([Sr, yr]), k = i2("?", "[^/]"), $r = i2("[", p), wr = i2("]", p), Ar = i2(/[!^]/, "^/"), br = i2(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i2(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i2(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i2("{", "(?:"), Or = i2("}", ")"), Rr = i2(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i2(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i2(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i2("{", "(?:"), Br = i2("}", ")"), Ir = i2(",", "|"), Fr = i2(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i2(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i2(/\\./, p), qr = i2(/./, p), Hr = i2(/\*\*\*+/, "*"), Jr = i2(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i2(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
14282
+ let n = Array.isArray(r) ? r : [r];
14283
+ if (!n.length) return !1;
14284
+ let a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
14285
+ return a.some((s) => s.test(o));
14286
+ };
14287
+ $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
14288
+ var re = $;
14289
+ return J(w);
14290
+ })();
14291
+ return __lib__.default || __lib__;
14292
+ }, _match, zeptomatch = (path2, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path2, pattern)), _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
14293
+ function normalizeWindowsPath(input = "") {
14294
+ return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
14295
+ }
14296
+ var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/, sep = "/", normalize = function(path2) {
14297
+ if (path2.length === 0)
14298
+ return ".";
14299
+ path2 = normalizeWindowsPath(path2);
14300
+ let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path2), trailingSeparator = path2[path2.length - 1] === "/";
14301
+ return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2);
14302
+ }, join3 = function(...segments) {
14303
+ let path2 = "";
14304
+ for (let seg of segments)
14305
+ if (seg)
14306
+ if (path2.length > 0) {
14307
+ let pathTrailing = path2[path2.length - 1] === "/", segLeading = seg[0] === "/";
14308
+ pathTrailing && segLeading ? path2 += seg.slice(1) : path2 += pathTrailing || segLeading ? seg : `/${seg}`;
14309
+ } else
14310
+ path2 += seg;
14311
+ return normalize(path2);
14312
+ };
14313
+ function cwd() {
14314
+ return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
14315
+ }
14316
+ var resolve2 = function(...arguments_) {
14317
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
14318
+ let resolvedPath = "", resolvedAbsolute = !1;
14319
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
14320
+ let path2 = index >= 0 ? arguments_[index] : cwd();
14321
+ !path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path2));
14322
+ }
14323
+ return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
14324
+ };
14325
+ function normalizeString(path2, allowAboveRoot) {
14326
+ let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
14327
+ for (let index = 0; index <= path2.length; ++index) {
14328
+ if (index < path2.length)
14329
+ char = path2[index];
14330
+ else {
14331
+ if (char === "/")
14332
+ break;
14333
+ char = "/";
14334
+ }
14335
+ if (char === "/") {
14336
+ if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
14337
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
14338
+ if (res.length > 2) {
14339
+ let lastSlashIndex = res.lastIndexOf("/");
14340
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
14341
+ continue;
14342
+ } else if (res.length > 0) {
14343
+ res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
14344
+ continue;
14345
+ }
14346
+ }
14347
+ allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
14348
+ } else
14349
+ res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
14350
+ lastSlash = index, dots = 0;
14351
+ } else char === "." && dots !== -1 ? ++dots : dots = -1;
14352
+ }
14353
+ return res;
14354
+ }
14355
+ var isAbsolute2 = function(p) {
14356
+ return _IS_ABSOLUTE_RE.test(p);
14357
+ }, toNamespacedPath = function(p) {
14358
+ return normalizeWindowsPath(p);
14359
+ }, extname = function(p) {
14360
+ if (p === "..") return "";
14361
+ let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
14362
+ return match && match[1] || "";
14363
+ }, relative = function(from, to) {
14364
+ let _from = resolve2(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve2(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
14365
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
14366
+ return _to.join("/");
14367
+ let _fromCopy = [..._from];
14368
+ for (let segment of _fromCopy) {
14369
+ if (_to[0] !== segment)
14370
+ break;
14371
+ _from.shift(), _to.shift();
14372
+ }
14373
+ return [..._from.map(() => ".."), ..._to].join("/");
14374
+ }, dirname3 = function(p) {
14375
+ let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
14376
+ return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
14377
+ }, format = function(p) {
14378
+ let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
14379
+ Boolean
14380
+ );
14381
+ return normalizeWindowsPath(
14382
+ p.root ? resolve2(...segments) : segments.join("/")
14383
+ );
14384
+ }, basename = function(p, extension) {
14385
+ let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
14386
+ for (let i2 = segments.length - 1; i2 >= 0; i2--) {
14387
+ let val = segments[i2];
14388
+ if (val) {
14389
+ lastSegment = val;
14390
+ break;
14391
+ }
14392
+ }
14393
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
14394
+ }, parse = function(p) {
14395
+ let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base2 = basename(p), extension = extname(base2);
14396
+ return {
14397
+ root,
14398
+ dir: dirname3(p),
14399
+ base: base2,
14400
+ ext: extension,
14401
+ name: base2.slice(0, base2.length - extension.length)
14402
+ };
14403
+ }, matchesGlob = (path2, pattern) => zeptomatch(pattern, normalize(path2)), _path = {
14404
+ __proto__: null,
14405
+ basename,
14406
+ dirname: dirname3,
14407
+ extname,
14408
+ format,
14409
+ isAbsolute: isAbsolute2,
14410
+ join: join3,
14411
+ matchesGlob,
14412
+ normalize,
14413
+ normalizeString,
14414
+ parse,
14415
+ relative,
14416
+ resolve: resolve2,
14417
+ sep,
14418
+ toNamespacedPath
14419
+ };
14420
+
14421
+ // ../../../node_modules/pathe/dist/index.mjs
14422
+ var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter) => new Proxy(_path, {
14423
+ get(_, prop) {
14424
+ return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win32 : _platforms[prop] || _path[prop];
14425
+ }
14426
+ }), posix = mix(":"), win32 = mix(";");
14427
+
14138
14428
  // src/extractProps.ts
14139
14429
  import {
14140
14430
  TypeSystem,
@@ -14327,7 +14617,7 @@ function parseExpression(expression) {
14327
14617
  return null;
14328
14618
  }
14329
14619
  }
14330
- function parse4(value) {
14620
+ function parse5(value) {
14331
14621
  let ast = acornParser.parse(`(${value})`, { ecmaVersion: 2020 }), parsingResult = {
14332
14622
  inferredType: { type: "Unknown" /* UNKNOWN */ },
14333
14623
  ast
@@ -14345,7 +14635,7 @@ function parse4(value) {
14345
14635
  // src/docs/lib/inspection/inspectValue.ts
14346
14636
  function inspectValue(value) {
14347
14637
  try {
14348
- return { ...parse4(value) };
14638
+ return { ...parse5(value) };
14349
14639
  } catch {
14350
14640
  }
14351
14641
  return { inferredType: { type: "Unknown" /* UNKNOWN */ } };
@@ -14495,13 +14785,13 @@ function _arrayLikeToArray(r, a) {
14495
14785
  function _arrayWithoutHoles(r) {
14496
14786
  if (Array.isArray(r)) return _arrayLikeToArray(r);
14497
14787
  }
14498
- function _defineProperty(e, r, t4) {
14788
+ function _defineProperty(e, r, t) {
14499
14789
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
14500
- value: t4,
14790
+ value: t,
14501
14791
  enumerable: !0,
14502
14792
  configurable: !0,
14503
14793
  writable: !0
14504
- }) : e[r] = t4, e;
14794
+ }) : e[r] = t, e;
14505
14795
  }
14506
14796
  function _iterableToArray(r) {
14507
14797
  if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
@@ -14511,22 +14801,22 @@ function _nonIterableSpread() {
14511
14801
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
14512
14802
  }
14513
14803
  function ownKeys(e, r) {
14514
- var t4 = Object.keys(e);
14804
+ var t = Object.keys(e);
14515
14805
  if (Object.getOwnPropertySymbols) {
14516
14806
  var o = Object.getOwnPropertySymbols(e);
14517
14807
  r && (o = o.filter(function(r2) {
14518
14808
  return Object.getOwnPropertyDescriptor(e, r2).enumerable;
14519
- })), t4.push.apply(t4, o);
14809
+ })), t.push.apply(t, o);
14520
14810
  }
14521
- return t4;
14811
+ return t;
14522
14812
  }
14523
14813
  function _objectSpread2(e) {
14524
14814
  for (var r = 1; r < arguments.length; r++) {
14525
- var t4 = arguments[r] != null ? arguments[r] : {};
14526
- r % 2 ? ownKeys(Object(t4), !0).forEach(function(r2) {
14527
- _defineProperty(e, r2, t4[r2]);
14528
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t4)) : ownKeys(Object(t4)).forEach(function(r2) {
14529
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t4, r2));
14815
+ var t = arguments[r] != null ? arguments[r] : {};
14816
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r2) {
14817
+ _defineProperty(e, r2, t[r2]);
14818
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
14819
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
14530
14820
  });
14531
14821
  }
14532
14822
  return e;
@@ -14534,18 +14824,18 @@ function _objectSpread2(e) {
14534
14824
  function _toConsumableArray(r) {
14535
14825
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
14536
14826
  }
14537
- function _toPrimitive(t4, r) {
14538
- if (typeof t4 != "object" || !t4) return t4;
14539
- var e = t4[Symbol.toPrimitive];
14827
+ function _toPrimitive(t, r) {
14828
+ if (typeof t != "object" || !t) return t;
14829
+ var e = t[Symbol.toPrimitive];
14540
14830
  if (e !== void 0) {
14541
- var i2 = e.call(t4, r || "default");
14831
+ var i2 = e.call(t, r || "default");
14542
14832
  if (typeof i2 != "object") return i2;
14543
14833
  throw new TypeError("@@toPrimitive must return a primitive value.");
14544
14834
  }
14545
- return (r === "string" ? String : Number)(t4);
14835
+ return (r === "string" ? String : Number)(t);
14546
14836
  }
14547
- function _toPropertyKey(t4) {
14548
- var i2 = _toPrimitive(t4, "string");
14837
+ function _toPropertyKey(t) {
14838
+ var i2 = _toPrimitive(t, "string");
14549
14839
  return typeof i2 == "symbol" ? i2 : i2 + "";
14550
14840
  }
14551
14841
  function _typeof(o) {
@@ -14559,8 +14849,8 @@ function _typeof(o) {
14559
14849
  function _unsupportedIterableToArray(r, a) {
14560
14850
  if (r) {
14561
14851
  if (typeof r == "string") return _arrayLikeToArray(r, a);
14562
- var t4 = {}.toString.call(r).slice(8, -1);
14563
- return t4 === "Object" && r.constructor && (t4 = r.constructor.name), t4 === "Map" || t4 === "Set" ? Array.from(r) : t4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t4) ? _arrayLikeToArray(r, a) : void 0;
14852
+ var t = {}.toString.call(r).slice(8, -1);
14853
+ return t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set" ? Array.from(r) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
14564
14854
  }
14565
14855
  }
14566
14856
  function safeSortObject(value, seen) {
@@ -15325,20 +15615,19 @@ var extractArgTypes = (component) => {
15325
15615
  // src/componentManifest/reactDocgen.ts
15326
15616
  var import_ts_dedent2 = __toESM(require_dist(), 1), TsconfigPaths = __toESM(require_lib2(), 1);
15327
15617
  import { existsSync as existsSync2 } from "node:fs";
15328
- import { dirname as dirname3, sep } from "node:path";
15329
- import { babelParse, types as t } from "storybook/internal/babel";
15618
+ import { dirname as dirname4, sep as sep2 } from "node:path";
15330
15619
  import {
15331
15620
  findTsconfigPathForPath,
15332
15621
  getTsconfigPathsBaseDir,
15333
15622
  supportedExtensions as supportedExtensions2
15334
15623
  } from "storybook/internal/common";
15335
- import { extractJSDocInfo } from "storybook/internal/csf-tools";
15624
+ import { extractJSDocInfo, parseModule } from "storybook/internal/csf-tools";
15336
15625
  import { logger as logger3 } from "storybook/internal/node-logger";
15337
15626
  import {
15338
15627
  builtinHandlers as docgenHandlers,
15339
15628
  builtinResolvers as docgenResolver,
15340
15629
  makeFsImporter,
15341
- parse as parse5
15630
+ parse as parse6
15342
15631
  } from "react-docgen";
15343
15632
 
15344
15633
  // src/componentManifest/reactDocgen/actualNameHandler.ts
@@ -15530,7 +15819,7 @@ var getTsConfig = cached(
15530
15819
  },
15531
15820
  { name: "getTsConfig" }
15532
15821
  ), parseWithReactDocgen = cached(
15533
- (code, path2) => parse5(code, {
15822
+ (code, path2) => parse6(code, {
15534
15823
  resolver: defaultResolver2,
15535
15824
  handlers,
15536
15825
  importer: getReactDocgenImporter(),
@@ -15539,15 +15828,15 @@ var getTsConfig = cached(
15539
15828
  { key: (code, path2) => path2, name: "parseWithReactDocgen" }
15540
15829
  ), getExportPaths = cached(
15541
15830
  (code, filePath) => {
15542
- let ast;
15831
+ let program;
15543
15832
  try {
15544
- ast = babelParse(code);
15833
+ program = parseModule(code, filePath).program;
15545
15834
  } catch {
15546
15835
  return [];
15547
15836
  }
15548
- let basedir = dirname3(filePath);
15549
- return ast.program.body.flatMap(
15550
- (statement) => t.isExportAllDeclaration(statement) ? [statement.source.value] : t.isExportNamedDeclaration(statement) && statement.source && !statement.declaration ? [statement.source.value] : []
15837
+ let basedir = dirname4(filePath);
15838
+ return program.body.flatMap(
15839
+ (statement) => statement.type === "ExportAllDeclaration" ? [statement.source.value] : statement.type === "ExportNamedDeclaration" && statement.source && !statement.declaration ? [statement.source.value] : []
15551
15840
  ).map((id) => matchPath(id, filePath)).flatMap((id) => {
15552
15841
  try {
15553
15842
  return [cachedResolveImport(id, { basedir })];
@@ -15673,10 +15962,10 @@ Prefer relative imports if possible.`
15673
15962
  function getReactDocgenImporter() {
15674
15963
  return makeFsImporter((filename, basedir) => {
15675
15964
  let mappedFilenameByPaths = matchPath(filename, basedir), result = cachedResolveImport(mappedFilenameByPaths, { basedir });
15676
- if (result.includes(`${sep}react-native${sep}index.js`)) {
15965
+ if (result.includes(`${sep2}react-native${sep2}index.js`)) {
15677
15966
  let replaced = result.replace(
15678
- `${sep}react-native${sep}index.js`,
15679
- `${sep}react-native-web${sep}dist${sep}index.js`
15967
+ `${sep2}react-native${sep2}index.js`,
15968
+ `${sep2}react-native-web${sep2}dist${sep2}index.js`
15680
15969
  );
15681
15970
  if (existsSync2(replaced) && supportedExtensions2.find((ext) => result.endsWith(ext)))
15682
15971
  return replaced;
@@ -15691,529 +15980,164 @@ function getImportTag(docgen) {
15691
15980
  return (jsdocComment ? extractJSDocInfo(jsdocComment).tags : void 0)?.import?.[0];
15692
15981
  }
15693
15982
 
15694
- // ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
15695
- var _lazyMatch = () => {
15696
- var __lib__ = (() => {
15697
- var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
15698
- for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
15699
- }, H = (r, e, n, a) => {
15700
- if (e && typeof e == "object" || typeof e == "function") for (let t4 of G(e)) !T.call(r, t4) && t4 !== n && m(r, t4, { get: () => e[t4], enumerable: !(a = V(e, t4)) || a.enumerable });
15701
- return r;
15702
- }, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
15703
- q(w, { default: () => re });
15704
- var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
15705
- let e = /* @__PURE__ */ new Map();
15706
- return (n) => {
15707
- let a = e.get(n);
15708
- if (a) return a;
15709
- let t4 = r(n);
15710
- return e.set(n, t4), t4;
15711
- };
15712
- }, rr = (r, e, n = {}) => {
15713
- let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
15714
- if (v(e)(a) && a.index === r.length) return a.output;
15715
- throw new Error(`Failed to parse at index ${a.indexMax}`);
15716
- }, i2 = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
15717
- let n = {};
15718
- for (let a of r) {
15719
- if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
15720
- let t4 = a.charCodeAt(0);
15721
- n[t4] = !0;
15722
- }
15723
- return (a) => {
15724
- let t4 = a.index, o = a.input;
15725
- for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
15726
- let u = a.index;
15727
- if (u > t4) {
15728
- if (!h(e) && !a.options.silent) {
15729
- let s = a.input.slice(t4, u), c = d(e) ? e(s, o, String(t4)) : e;
15730
- h(c) || a.output.push(c);
15731
- }
15732
- a.indexMax = Math.max(a.indexMax, a.index);
15733
- }
15734
- return !0;
15735
- };
15736
- }, nr = (r, e) => {
15737
- let n = r.source, a = r.flags.replace(/y|$/, "y"), t4 = new RegExp(n, a);
15738
- return g((o) => {
15739
- t4.lastIndex = o.index;
15740
- let u = t4.exec(o.input);
15741
- if (u) {
15742
- if (!h(e) && !o.options.silent) {
15743
- let s = d(e) ? e(...u, o.input, String(o.index)) : e;
15744
- h(s) || o.output.push(s);
15745
- }
15746
- return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
15747
- } else return !1;
15748
- });
15749
- }, ar = (r, e) => (n) => {
15750
- if (n.input.startsWith(r, n.index)) {
15751
- if (!h(e) && !n.options.silent) {
15752
- let t4 = d(e) ? e(r, n.input, String(n.index)) : e;
15753
- h(t4) || n.output.push(t4);
15754
- }
15755
- return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
15756
- } else return !1;
15757
- }, C = (r, e, n, a) => {
15758
- let t4 = v(r);
15759
- return g(_(M((o) => {
15760
- let u = 0;
15761
- for (; u < n; ) {
15762
- let s = o.index;
15763
- if (!t4(o) || (u += 1, o.index === s)) break;
15764
- }
15765
- return u >= e;
15766
- })));
15767
- }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
15768
- let n = r.map(v);
15769
- return g(_(M((a) => {
15770
- for (let t4 = 0, o = n.length; t4 < o; t4++) if (!n[t4](a)) return !1;
15771
- return !0;
15772
- })));
15773
- }, l = (r, e) => {
15774
- let n = r.map(v);
15775
- return g(_((a) => {
15776
- for (let t4 = 0, o = n.length; t4 < o; t4++) if (n[t4](a)) return !0;
15777
- return !1;
15778
- }));
15779
- }, M = (r, e = !1) => {
15780
- let n = v(r);
15781
- return (a) => {
15782
- let t4 = a.index, o = a.output.length, u = n(a);
15783
- return (!u || e) && (a.index = t4, a.output.length !== o && (a.output.length = o)), u;
15784
- };
15785
- }, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
15786
- let r = 0;
15787
- return (e) => {
15788
- let n = v(e), a = r += 1;
15789
- return (t4) => {
15790
- var o;
15791
- if (t4.options.memoization === !1) return n(t4);
15792
- let u = t4.index, s = (o = t4.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
15793
- if (c === !1) return !1;
15794
- if (W(c)) return t4.index = c, !0;
15795
- if (c) return t4.index = c.index, c.output?.length && t4.output.push(...c.output), !0;
15796
- {
15797
- let Z = t4.output.length;
15798
- if (n(t4)) {
15799
- let D = t4.index, U = t4.output.length;
15800
- if (U > Z) {
15801
- let ee = t4.output.slice(Z, U);
15802
- s.set(u, { index: D, output: ee });
15803
- } else s.set(u, D);
15804
- return !0;
15805
- } else return s.set(u, !1), !1;
15806
- }
15807
- };
15808
- };
15809
- })(), E = (r) => {
15810
- let e;
15811
- return (n) => (e || (e = v(r())), e(n));
15812
- }, v = Y((r) => {
15813
- if (d(r)) return Q(r) ? E(r) : r;
15814
- if (b(r) || X(r)) return i2(r);
15815
- if (A(r)) return x(r);
15816
- if (K(r)) return l(Object.values(r));
15817
- throw new Error("Invalid rule");
15818
- }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
15819
- let e = "";
15820
- for (; r > 0; ) {
15821
- let n = (r - 1) % 26;
15822
- e = P[n] + e, r = Math.floor((r - 1) / 26);
15823
- }
15824
- return e;
15825
- }, O = (r) => {
15826
- let e = 0;
15827
- for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
15828
- return e;
15829
- }, S = (r, e) => {
15830
- if (e < r) return S(e, r);
15831
- let n = [];
15832
- for (; r <= e; ) n.push(r++);
15833
- return n;
15834
- }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: !1 }).join("")), ur = (r) => {
15835
- let e = {};
15836
- return (n) => e[n] ?? (e[n] = r(n));
15837
- }, sr = i2(/^\*\*\/\*$/, ".*"), cr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i2(/\\./, p), pr = i2(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i2(/./, p), hr = i2(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i2(/^(!!)+/, ""), fr = l([hr, dr]), xr = i2(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i2(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i2(/\/(\*\*)$/, "(?:/.*|$)"), _r = i2(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i2(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i2(/\*/, "[^/]*"), N = l([Sr, yr]), k = i2("?", "[^/]"), $r = i2("[", p), wr = i2("]", p), Ar = i2(/[!^]/, "^/"), br = i2(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i2(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i2(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i2("{", "(?:"), Or = i2("}", ")"), Rr = i2(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i2(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i2(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i2("{", "(?:"), Br = i2("}", ")"), Ir = i2(",", "|"), Fr = i2(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i2(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i2(/\\./, p), qr = i2(/./, p), Hr = i2(/\*\*\*+/, "*"), Jr = i2(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i2(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
15838
- let n = Array.isArray(r) ? r : [r];
15839
- if (!n.length) return !1;
15840
- let a = n.map($.compile), t4 = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t4 ? "/" : "");
15841
- return a.some((s) => s.test(o));
15842
- };
15843
- $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
15844
- var re = $;
15845
- return J(w);
15846
- })();
15847
- return __lib__.default || __lib__;
15848
- }, _match, zeptomatch = (path2, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path2, pattern)), _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
15849
- function normalizeWindowsPath(input = "") {
15850
- return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
15851
- }
15852
- var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/, sep2 = "/", normalize = function(path2) {
15853
- if (path2.length === 0)
15854
- return ".";
15855
- path2 = normalizeWindowsPath(path2);
15856
- let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path2), trailingSeparator = path2[path2.length - 1] === "/";
15857
- return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2);
15858
- }, join3 = function(...segments) {
15859
- let path2 = "";
15860
- for (let seg of segments)
15861
- if (seg)
15862
- if (path2.length > 0) {
15863
- let pathTrailing = path2[path2.length - 1] === "/", segLeading = seg[0] === "/";
15864
- pathTrailing && segLeading ? path2 += seg.slice(1) : path2 += pathTrailing || segLeading ? seg : `/${seg}`;
15865
- } else
15866
- path2 += seg;
15867
- return normalize(path2);
15868
- };
15869
- function cwd() {
15870
- return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
15871
- }
15872
- var resolve3 = function(...arguments_) {
15873
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
15874
- let resolvedPath = "", resolvedAbsolute = !1;
15875
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
15876
- let path2 = index >= 0 ? arguments_[index] : cwd();
15877
- !path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path2));
15878
- }
15879
- return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
15880
- };
15881
- function normalizeString(path2, allowAboveRoot) {
15882
- let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
15883
- for (let index = 0; index <= path2.length; ++index) {
15884
- if (index < path2.length)
15885
- char = path2[index];
15886
- else {
15887
- if (char === "/")
15888
- break;
15889
- char = "/";
15890
- }
15891
- if (char === "/") {
15892
- if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
15893
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
15894
- if (res.length > 2) {
15895
- let lastSlashIndex = res.lastIndexOf("/");
15896
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
15897
- continue;
15898
- } else if (res.length > 0) {
15899
- res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
15900
- continue;
15901
- }
15902
- }
15903
- allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
15904
- } else
15905
- res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
15906
- lastSlash = index, dots = 0;
15907
- } else char === "." && dots !== -1 ? ++dots : dots = -1;
15908
- }
15909
- return res;
15910
- }
15911
- var isAbsolute2 = function(p) {
15912
- return _IS_ABSOLUTE_RE.test(p);
15913
- }, toNamespacedPath = function(p) {
15914
- return normalizeWindowsPath(p);
15915
- }, extname = function(p) {
15916
- if (p === "..") return "";
15917
- let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
15918
- return match && match[1] || "";
15919
- }, relative = function(from, to) {
15920
- let _from = resolve3(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve3(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
15921
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
15922
- return _to.join("/");
15923
- let _fromCopy = [..._from];
15924
- for (let segment of _fromCopy) {
15925
- if (_to[0] !== segment)
15926
- break;
15927
- _from.shift(), _to.shift();
15928
- }
15929
- return [..._from.map(() => ".."), ..._to].join("/");
15930
- }, dirname4 = function(p) {
15931
- let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
15932
- return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
15933
- }, format = function(p) {
15934
- let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
15935
- Boolean
15936
- );
15937
- return normalizeWindowsPath(
15938
- p.root ? resolve3(...segments) : segments.join("/")
15939
- );
15940
- }, basename = function(p, extension) {
15941
- let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
15942
- for (let i2 = segments.length - 1; i2 >= 0; i2--) {
15943
- let val = segments[i2];
15944
- if (val) {
15945
- lastSegment = val;
15946
- break;
15947
- }
15948
- }
15949
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
15950
- }, parse6 = function(p) {
15951
- let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base2 = basename(p), extension = extname(base2);
15952
- return {
15953
- root,
15954
- dir: dirname4(p),
15955
- base: base2,
15956
- ext: extension,
15957
- name: base2.slice(0, base2.length - extension.length)
15958
- };
15959
- }, matchesGlob = (path2, pattern) => zeptomatch(pattern, normalize(path2)), _path = {
15960
- __proto__: null,
15961
- basename,
15962
- dirname: dirname4,
15963
- extname,
15964
- format,
15965
- isAbsolute: isAbsolute2,
15966
- join: join3,
15967
- matchesGlob,
15968
- normalize,
15969
- normalizeString,
15970
- parse: parse6,
15971
- relative,
15972
- resolve: resolve3,
15973
- sep: sep2,
15974
- toNamespacedPath
15975
- };
15976
-
15977
- // ../../../node_modules/pathe/dist/index.mjs
15978
- var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter) => new Proxy(_path, {
15979
- get(_, prop) {
15980
- return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win32 : _platforms[prop] || _path[prop];
15981
- }
15982
- }), posix = mix(":"), win32 = mix(";");
15983
-
15984
15983
  // src/componentManifest/generateCodeSnippet.ts
15985
- import { types as t2 } from "storybook/internal/babel";
15986
15984
  import {
15985
+ textOf,
15987
15986
  collectImportBindings,
15988
15987
  createStoryArgsResolver,
15989
15988
  isCanonicalCsf2BindCall,
15990
- metaObjectPath,
15989
+ isStringLiteral,
15990
+ lineIndent,
15991
+ metaObject,
15991
15992
  normalizeStoryDeclaration,
15992
- resolveRenderFunction
15993
+ parseModule as parseModule2,
15994
+ placeableTextOf,
15995
+ reindent,
15996
+ resolveRenderFunction,
15997
+ storyShapeError,
15998
+ walk
15993
15999
  } from "storybook/internal/csf-tools";
15994
16000
  function renderFunctionOf(resolution) {
15995
- return resolution.kind === "resolved" ? resolution.path : resolution.kind === "unresolved" ? resolution.shadowedRender : void 0;
16001
+ return resolution.kind === "resolved" ? resolution.node : resolution.kind === "unresolved" ? resolution.shadowedRender : void 0;
15996
16002
  }
15997
16003
  function getCodeSnippet(csf, storyName, componentName, resolver = createStoryArgsResolver(csf)) {
15998
16004
  let { args, imports, unresolved } = resolver.resolve(storyName), importedBind = importedBoundStory(csf, storyName, args);
15999
16005
  return importedBind ? {
16000
- node: importedBind.node,
16006
+ code: importedBind.code,
16001
16007
  imports: [...imports, importedBind.importRef],
16002
16008
  unresolved
16003
16009
  } : {
16004
- node: buildSnippetNode(csf, storyName, componentName, args, resolver.ctx),
16010
+ code: buildSnippet(csf, storyName, componentName, args, resolver),
16005
16011
  imports,
16006
16012
  unresolved
16007
16013
  };
16008
16014
  }
16009
16015
  function importedBoundStory(csf, storyName, args) {
16010
- let declaration = csf._storyDeclarationPath[storyName];
16011
- if (!declaration?.isVariableDeclarator())
16012
- return;
16013
- let init = declaration.get("init");
16014
- if (!init.isCallExpression() || !isCanonicalCsf2BindCall(init.node))
16015
- return;
16016
- let callee = init.get("callee");
16017
- if (!callee.isMemberExpression())
16016
+ let declaration = csf._storyExports[storyName];
16017
+ if (declaration?.type !== "VariableDeclarator" || !isCanonicalCsf2BindCall(declaration.init))
16018
16018
  return;
16019
- let object = callee.get("object");
16020
- if (!object.isIdentifier())
16021
- return;
16022
- let binding = collectImportBindings(csf._file.path).get(object.node.name);
16019
+ let local = declaration.init.callee.object.name, binding = collectImportBindings(csf.program).get(local);
16023
16020
  if (!binding)
16024
16021
  return;
16025
- let values = Object.entries(args).map(([key, value]) => (invariant(t2.isExpression(value), `Could not use ${key} as a bound story arg`), t2.objectProperty(t2.stringLiteral(key), value))), boundCall = t2.callExpression(init.node, [t2.objectExpression(values)]);
16022
+ let values = Object.entries(args).map(
16023
+ ([key, value]) => ` ${JSON.stringify(key)}: ${placeableTextOf(value)}`
16024
+ ), argsObject = values.length ? `{
16025
+ ${values.join(`,
16026
+ `)}
16027
+ }` : "{}";
16026
16028
  return {
16027
- node: t2.variableDeclaration("const", [
16028
- t2.variableDeclarator(t2.identifier(storyName), t2.arrowFunctionExpression([], boundCall))
16029
- ]),
16029
+ code: `const ${storyName} = () => ${textOf(declaration.init)}(${argsObject});`,
16030
16030
  importRef: {
16031
- localImportName: object.node.name,
16031
+ localImportName: local,
16032
16032
  importId: binding.importId,
16033
16033
  importName: binding.importName,
16034
- ...binding.importName === "*" ? { namespace: object.node.name } : {}
16034
+ ...binding.importName === "*" ? { namespace: local } : {}
16035
16035
  }
16036
16036
  };
16037
16037
  }
16038
- function buildSnippetNode(csf, storyName, componentName, merged, ctx) {
16039
- let storyDeclaration = csf._storyDeclarationPath[storyName];
16038
+ function buildSnippet(csf, storyName, componentName, merged, resolver) {
16039
+ let editor = csf.editor, storyDeclaration = csf._storyExports[storyName];
16040
16040
  if (!storyDeclaration) {
16041
- let message = "Expected story to be a function or variable declaration";
16042
- throw csf._storyPaths[storyName]?.buildCodeFrameError(message) ?? message;
16043
- }
16044
- let normalizedStory = normalizeStoryDeclaration(storyDeclaration), storyFn;
16045
- normalizedStory.type === "fn" && (storyFn = normalizedStory.path);
16046
- let storyConfigPath = normalizedStory.type === "config" ? normalizedStory.path : void 0, metaRender = resolveRenderFunction(metaObjectPath(csf), storyDeclaration, ctx), storyRender = resolveRenderFunction(storyConfigPath, storyDeclaration, ctx);
16047
- storyFn || (storyFn = renderFunctionOf(storyRender) ?? (storyRender.kind === "missing" ? renderFunctionOf(metaRender) : void 0));
16048
- let entries = Object.entries(merged).filter(([k]) => k !== "children"), validEntries = entries.filter(([k, v]) => isValidJsxAttrName(k) && v != null), invalidEntries = entries.filter(([k, v]) => !isValidJsxAttrName(k) && v != null), injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => a != null);
16049
- if (storyFn) {
16050
- let fn = storyFn.node;
16051
- if (t2.isArrowFunctionExpression(fn) && (t2.isJSXElement(fn.body) || t2.isJSXFragment(fn.body))) {
16052
- let spreadRes = transformArgsSpreadsInJsx(fn.body, merged), inlineRes = inlineArgsInJsx(spreadRes.node, merged);
16053
- if (spreadRes.changed || inlineRes.changed) {
16054
- let newFn = t2.arrowFunctionExpression(
16055
- remainingParams(fn, inlineRes.node),
16056
- inlineRes.node,
16057
- fn.async
16058
- );
16059
- return t2.variableDeclaration("const", [
16060
- t2.variableDeclarator(t2.identifier(storyName), newFn)
16061
- ]);
16062
- }
16063
- }
16064
- let stmts = t2.isFunctionDeclaration(fn) || t2.isObjectMethod(fn) || t2.isArrowFunctionExpression(fn) && t2.isBlockStatement(fn.body) || t2.isFunctionExpression(fn) && t2.isBlockStatement(fn.body) ? fn.body.body : void 0;
16065
- if (stmts) {
16066
- let changed = !1, newBody = stmts.map((stmt) => {
16067
- if (t2.isReturnStatement(stmt) && stmt.argument && (t2.isJSXElement(stmt.argument) || t2.isJSXFragment(stmt.argument))) {
16068
- let spreadRes = transformArgsSpreadsInJsx(stmt.argument, merged), inlineRes = inlineArgsInJsx(spreadRes.node, merged);
16069
- if (spreadRes.changed || inlineRes.changed)
16070
- return changed = !0, t2.returnStatement(inlineRes.node);
16071
- }
16072
- return stmt;
16073
- });
16074
- if (changed) {
16075
- let body = t2.blockStatement(newBody), params = remainingParams(fn, body);
16076
- return t2.isFunctionDeclaration(fn) ? t2.functionDeclaration(t2.identifier(storyName), params, body, fn.generator, fn.async) : t2.variableDeclaration("const", [
16077
- t2.variableDeclarator(
16078
- t2.identifier(storyName),
16079
- t2.arrowFunctionExpression(params, body, fn.async)
16080
- )
16081
- ]);
16082
- }
16083
- }
16084
- return t2.isFunctionDeclaration(fn) ? t2.functionDeclaration(t2.identifier(storyName), fn.params, fn.body, fn.generator, fn.async) : t2.variableDeclaration("const", [
16085
- t2.variableDeclarator(
16086
- t2.identifier(storyName),
16087
- t2.isObjectMethod(fn) ? t2.arrowFunctionExpression(fn.params, fn.body, fn.async) : fn
16041
+ let message = "Expected story to be a function or variable declaration", statement = csf.program.body.find(
16042
+ (node) => node.type === "ExportNamedDeclaration" && node.specifiers.some(
16043
+ (specifier) => (specifier.exported.type === "Identifier" ? specifier.exported.name : specifier.exported.value) === storyName
16088
16044
  )
16089
- ]);
16045
+ );
16046
+ throw statement ? storyShapeError(message, statement, editor) : message;
16090
16047
  }
16048
+ let normalizedStory = normalizeStoryDeclaration(storyDeclaration, editor), storyFn = normalizedStory.type === "fn" ? normalizedStory.node : void 0, storyConfig = normalizedStory.type === "config" ? normalizedStory.node : void 0, metaRender = resolveRenderFunction(metaObject(csf), editor, resolver.ctx), storyRender = resolveRenderFunction(storyConfig, editor, resolver.ctx);
16049
+ if (storyFn || (storyFn = renderFunctionOf(storyRender) ?? (storyRender.kind === "missing" ? renderFunctionOf(metaRender) : void 0)), storyFn)
16050
+ return functionSnippet(
16051
+ editor.code,
16052
+ storyName,
16053
+ storyFn,
16054
+ isMethod(editor.parentOf(storyFn)),
16055
+ merged
16056
+ );
16091
16057
  invariant(componentName, "Could not generate snippet without component name.");
16092
- let invalidSpread = buildInvalidSpread(invalidEntries), name = t2.jsxIdentifier(componentName), openingElAttrs = invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs, children = toJsxChildren(merged.children), selfClosing = children.length === 0, arrow = t2.arrowFunctionExpression(
16093
- [],
16094
- t2.jsxElement(
16095
- t2.jsxOpeningElement(name, openingElAttrs, selfClosing),
16096
- selfClosing ? null : t2.jsxClosingElement(name),
16097
- children,
16098
- selfClosing
16099
- )
16100
- );
16101
- return t2.variableDeclaration("const", [t2.variableDeclarator(t2.identifier(storyName), arrow)]);
16058
+ let attrs = injectedAttributes(merged, /* @__PURE__ */ new Set()), children = toJsxChildren(merged.children), opening = [componentName, ...attrs].join(" "), element = children ? `<${opening}>${children}</${componentName}>` : `<${opening} />`;
16059
+ return `const ${storyName} = () => ${element};`;
16102
16060
  }
16103
- function remainingParams(fn, body) {
16104
- return readsArgs(body) ? fn.params : [];
16061
+ var isMethod = (parent) => parent?.type === "Property" && (parent.method || parent.kind !== "init");
16062
+ function functionSnippet(code, storyName, fn, method, merged) {
16063
+ let asyncPrefix = fn.async ? "async " : "", params = fn.params.length ? code.slice(fn.params[0].start, fn.params[fn.params.length - 1].end) : "", edits = [];
16064
+ if (fn.type === "ArrowFunctionExpression" && isJsx(fn.body)) {
16065
+ if (rewriteJsx(code, fn.body, merged, edits)) {
16066
+ let body = printRange(code, fn.body, edits), kept = readsArgs(`${asyncPrefix}() => (${body});`) ? params : "";
16067
+ return `const ${storyName} = ${asyncPrefix}(${kept}) => ${body};`;
16068
+ }
16069
+ } else if (fn.body?.type === "BlockStatement") {
16070
+ let changed = !1;
16071
+ for (let statement of fn.body.body)
16072
+ statement.type === "ReturnStatement" && isJsx(statement.argument) && (changed = rewriteJsx(code, statement.argument, merged, edits) || changed);
16073
+ if (changed) {
16074
+ let body = printRange(code, fn.body, edits), head = `${asyncPrefix}function${fn.generator ? "*" : ""}`, kept = readsArgs(`${head} f() ${body}`) ? params : "";
16075
+ return fn.type === "FunctionDeclaration" ? `${asyncPrefix}function${fn.generator ? "*" : ""} ${storyName}(${kept}) ${body}` : `const ${storyName} = ${asyncPrefix}(${kept}) => ${body};`;
16076
+ }
16077
+ }
16078
+ return fn.type === "FunctionDeclaration" && fn.body ? `${asyncPrefix}function${fn.generator ? "*" : ""} ${storyName}(${params}) ${printRange(code, fn.body, [])}` : method && fn.body ? `const ${storyName} = ${asyncPrefix}(${params}) => ${printRange(code, fn.body, [])};` : `const ${storyName} = ${printRange(code, fn, [])};`;
16105
16079
  }
16106
- function readsArgs(node) {
16080
+ var isJsx = (node) => node?.type === "JSXElement" || node?.type === "JSXFragment";
16081
+ function printRange(code, range, edits) {
16082
+ let text = "", cursor = range.start;
16083
+ for (let edit of [...edits].sort((a, b) => a.start - b.start || a.end - b.end))
16084
+ text += code.slice(cursor, edit.start) + edit.text, cursor = edit.end;
16085
+ return text += code.slice(cursor, range.end), reindent(text, lineIndent(code, range.start), "");
16086
+ }
16087
+ function readsArgs(source) {
16107
16088
  let named = /* @__PURE__ */ new Set(), reads = !1;
16108
- return t2.traverseFast(node, (current2) => {
16109
- t2.isMemberExpression(current2) && !current2.computed && named.add(current2.property), (t2.isObjectProperty(current2) || t2.isObjectMethod(current2)) && !current2.computed && named.add(current2.key), t2.isIdentifier(current2) && current2.name === "args" && !named.has(current2) && (reads = !0);
16089
+ return walk(parseModule2(source).program, (current2) => {
16090
+ current2.type === "MemberExpression" && !current2.computed && named.add(current2.property), current2.type === "Property" && !current2.computed && !current2.shorthand && named.add(current2.key), current2.type === "Identifier" && current2.name === "args" && !named.has(current2) && (reads = !0);
16110
16091
  }), reads;
16111
16092
  }
16112
- function buildInvalidSpread(entries) {
16113
- if (entries.length === 0)
16114
- return null;
16115
- let objectProps = entries.map(
16116
- ([k, v]) => t2.objectProperty(t2.stringLiteral(k), t2.isExpression(v) ? v : t2.identifier("undefined"))
16117
- );
16118
- return t2.jsxSpreadAttribute(t2.objectExpression(objectProps));
16093
+ var isValidJsxAttrName = (n) => /^[A-Za-z_][A-Za-z0-9_:-]*$/.test(n), toAttr = (key, value) => value.type === "Literal" && typeof value.value == "boolean" ? value.value ? key : `${key}={false}` : isStringLiteral(value) && !/["&\r\n]/.test(value.value) ? `${key}="${value.value}"` : `${key}={${placeableTextOf(value)}}`;
16094
+ function injectedAttributes(merged, existing) {
16095
+ let entries = Object.entries(merged).filter(
16096
+ ([k, v]) => v != null && k !== "children" && !existing.has(k)
16097
+ ), attrs = entries.filter(([k]) => isValidJsxAttrName(k)).map(([k, v]) => toAttr(k, v)), invalid = entries.filter(([k]) => !isValidJsxAttrName(k));
16098
+ if (invalid.length > 0) {
16099
+ let members = invalid.map(([k, v]) => `${JSON.stringify(k)}: ${placeableTextOf(v)}`);
16100
+ attrs.push(`{...{ ${members.join(", ")} }}`);
16101
+ }
16102
+ return attrs;
16119
16103
  }
16120
- var isValidJsxAttrName = (n) => /^[A-Za-z_][A-Za-z0-9_:-]*$/.test(n), toAttr = (key, value) => t2.isBooleanLiteral(value) ? value.value ? t2.jsxAttribute(t2.jsxIdentifier(key), null) : t2.jsxAttribute(t2.jsxIdentifier(key), t2.jsxExpressionContainer(value)) : t2.isStringLiteral(value) ? t2.jsxAttribute(t2.jsxIdentifier(key), t2.stringLiteral(value.value)) : t2.isExpression(value) ? t2.jsxAttribute(t2.jsxIdentifier(key), t2.jsxExpressionContainer(value)) : null, toJsxChildren = (node) => node ? t2.isStringLiteral(node) ? [t2.jsxText(node.value)] : t2.isJSXElement(node) || t2.isJSXFragment(node) ? [node] : t2.isExpression(node) ? [t2.jsxExpressionContainer(node)] : [] : [];
16104
+ var toJsxChildren = (node) => node ? isStringLiteral(node) && !/[{}<>&\r\n]/.test(node.value) ? node.value : isJsx(node) ? textOf(node) : `{${placeableTextOf(node)}}` : "";
16121
16105
  function getArgsMemberKey(expr) {
16122
- if (t2.isMemberExpression(expr) && t2.isIdentifier(expr.object) && expr.object.name === "args") {
16123
- if (t2.isIdentifier(expr.property) && !expr.computed)
16124
- return expr.property.name;
16125
- if (t2.isStringLiteral(expr.property) && expr.computed)
16126
- return expr.property.value;
16127
- }
16128
- if (t2.isOptionalMemberExpression?.(expr) && t2.isIdentifier(expr.object) && expr.object.name === "args") {
16129
- let prop = expr.property;
16130
- if (t2.isIdentifier(prop) && !expr.computed)
16131
- return prop.name;
16132
- if (t2.isStringLiteral(prop) && expr.computed)
16133
- return prop.value;
16134
- }
16135
- return null;
16106
+ let member = expr.type === "ChainExpression" ? expr.expression : expr;
16107
+ return member.type !== "MemberExpression" || member.object.type !== "Identifier" || member.object.name !== "args" ? null : member.property.type === "Identifier" && !member.computed ? member.property.name : isStringLiteral(member.property) && member.computed ? member.property.value : null;
16136
16108
  }
16137
- function inlineArgsInJsx(node, merged) {
16109
+ function rewriteJsx(code, node, merged, edits) {
16138
16110
  let changed = !1;
16139
- if (t2.isJSXElement(node)) {
16140
- let opening = node.openingElement, newAttrs = opening.attributes.flatMap((a) => {
16141
- if (!t2.isJSXAttribute(a))
16142
- return [a];
16143
- let name = t2.isJSXIdentifier(a.name) ? a.name.name : null;
16144
- if (!(name && a.value && t2.isJSXExpressionContainer(a.value)))
16145
- return [a];
16146
- let key = getArgsMemberKey(a.value.expression);
16147
- if (!(key && key in merged))
16148
- return [a];
16149
- let repl = toAttr(name, merged[key]);
16150
- return changed = !0, repl ? [repl] : [];
16151
- }), newChildren = node.children.flatMap((c) => {
16152
- if (t2.isJSXElement(c) || t2.isJSXFragment(c)) {
16153
- let res = inlineArgsInJsx(c, merged);
16154
- return changed ||= res.changed, [res.node];
16155
- }
16156
- return t2.isJSXExpressionContainer(c) && getArgsMemberKey(c.expression) === "children" && merged.children ? (changed = !0, toJsxChildren(merged.children)) : [c];
16157
- }), selfClosing = opening.selfClosing && newChildren.length === 0;
16158
- return {
16159
- node: t2.jsxElement(
16160
- t2.jsxOpeningElement(opening.name, newAttrs, selfClosing),
16161
- selfClosing ? null : node.closingElement ?? t2.jsxClosingElement(opening.name),
16162
- newChildren,
16163
- selfClosing
16164
- ),
16165
- changed
16166
- };
16167
- }
16168
- let fragChildren = node.children.flatMap((c) => {
16169
- if (t2.isJSXElement(c) || t2.isJSXFragment(c)) {
16170
- let res = inlineArgsInJsx(c, merged);
16171
- return changed ||= res.changed, [res.node];
16172
- }
16173
- return t2.isJSXExpressionContainer(c) && getArgsMemberKey(c.expression) === "children" && "children" in merged ? (changed = !0, toJsxChildren(merged.children)) : [c];
16174
- });
16175
- return { node: t2.jsxFragment(node.openingFragment, node.closingFragment, fragChildren), changed };
16176
- }
16177
- function transformArgsSpreadsInJsx(node, merged) {
16178
- let changed = !1, makeInjectedPieces = (existing) => {
16179
- let entries = Object.entries(merged).filter(([k, v]) => v != null && k !== "children"), validEntries = entries.filter(([k]) => isValidJsxAttrName(k)), invalidEntries = entries.filter(([k]) => !isValidJsxAttrName(k)), injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => !!a).filter((a) => t2.isJSXIdentifier(a.name) && !existing.has(a.name.name)), invalidSpread = buildInvalidSpread(invalidEntries.filter(([k]) => !existing.has(k)));
16180
- return invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs;
16181
- };
16182
- if (t2.isJSXElement(node)) {
16183
- let opening = node.openingElement, attrs = opening.attributes, isArgsSpread = (a) => t2.isJSXSpreadAttribute(a) && t2.isIdentifier(a.argument) && a.argument.name === "args", sawArgsSpread = attrs.some(isArgsSpread), firstIdx = attrs.findIndex(isArgsSpread), nonArgsAttrs = attrs.filter((a) => !isArgsSpread(a)), insertionIndex = sawArgsSpread ? attrs.slice(0, firstIdx).filter((a) => !isArgsSpread(a)).length : 0, newAttrs = sawArgsSpread ? (() => {
16111
+ if (node.type === "JSXElement") {
16112
+ let opening = node.openingElement, attrs = opening.attributes, isArgsSpread = (a) => a.type === "JSXSpreadAttribute" && a.argument.type === "Identifier" && a.argument.name === "args", firstSpread = attrs.findIndex(isArgsSpread), tagEnd = (opening.typeArguments ?? opening.name).end;
16113
+ if (firstSpread !== -1) {
16114
+ changed = !0;
16184
16115
  let existing = new Set(
16185
- nonArgsAttrs.filter((a) => t2.isJSXAttribute(a)).flatMap((a) => t2.isJSXIdentifier(a.name) ? [a.name.name] : [])
16186
- ), pieces = makeInjectedPieces(existing);
16187
- return changed = !0, [
16188
- ...nonArgsAttrs.slice(0, insertionIndex),
16189
- ...pieces,
16190
- ...nonArgsAttrs.slice(insertionIndex)
16191
- ];
16192
- })() : nonArgsAttrs, newChildren = node.children.flatMap((c) => {
16193
- if (t2.isJSXElement(c) || t2.isJSXFragment(c)) {
16194
- let res = transformArgsSpreadsInJsx(c, merged);
16195
- return changed ||= res.changed, [res.node];
16116
+ attrs.flatMap(
16117
+ (a) => a.type === "JSXAttribute" && a.name.type === "JSXIdentifier" ? [a.name.name] : []
16118
+ )
16119
+ ), pieces = injectedAttributes(merged, existing).join(" ");
16120
+ if (attrs.forEach((a, index) => {
16121
+ isArgsSpread(a) && (index === firstSpread && pieces ? edits.push({ start: a.start, end: a.end, text: pieces }) : edits.push({ start: index > 0 ? attrs[index - 1].end : tagEnd, end: a.end, text: "" }));
16122
+ }), node.children.length === 0 && merged.children) {
16123
+ let children = toJsxChildren(merged.children);
16124
+ if (opening.selfClosing) {
16125
+ let name = code.slice(opening.name.start, opening.name.end), lastEnd = attrs.length > 0 ? attrs[attrs.length - 1].end : tagEnd;
16126
+ edits.push({ start: lastEnd, end: opening.end, text: `>${children}</${name}>` });
16127
+ } else
16128
+ edits.push({ start: opening.end, end: opening.end, text: children });
16196
16129
  }
16197
- return [c];
16198
- }), children = sawArgsSpread && newChildren.length === 0 && merged.children ? (changed = !0, toJsxChildren(merged.children)) : newChildren, selfClosing = children.length === 0;
16199
- return {
16200
- node: t2.jsxElement(
16201
- t2.jsxOpeningElement(opening.name, newAttrs, selfClosing),
16202
- selfClosing ? null : node.closingElement ?? t2.jsxClosingElement(opening.name),
16203
- children,
16204
- selfClosing
16205
- ),
16206
- changed
16207
- };
16208
- }
16209
- let fragChildren = node.children.flatMap((c) => {
16210
- if (t2.isJSXElement(c) || t2.isJSXFragment(c)) {
16211
- let res = transformArgsSpreadsInJsx(c, merged);
16212
- return changed ||= res.changed, [res.node];
16213
16130
  }
16214
- return [c];
16215
- });
16216
- return { node: t2.jsxFragment(node.openingFragment, node.closingFragment, fragChildren), changed };
16131
+ for (let a of attrs) {
16132
+ if (a.type !== "JSXAttribute" || a.name.type !== "JSXIdentifier" || a.value?.type !== "JSXExpressionContainer")
16133
+ continue;
16134
+ let key = getArgsMemberKey(a.value.expression);
16135
+ key !== null && Object.hasOwn(merged, key) && (edits.push({ start: a.start, end: a.end, text: toAttr(a.name.name, merged[key]) }), changed = !0);
16136
+ }
16137
+ }
16138
+ for (let child of node.children)
16139
+ isJsx(child) ? changed = rewriteJsx(code, child, merged, edits) || changed : child.type === "JSXExpressionContainer" && getArgsMemberKey(child.expression) === "children" && merged.children && (edits.push({ start: child.start, end: child.end, text: toJsxChildren(merged.children) }), changed = !0);
16140
+ return changed;
16217
16141
  }
16218
16142
 
16219
16143
  // src/componentManifest/reactDocgenTypescript.ts
@@ -16422,7 +16346,6 @@ function normalizeFileName(typescript, fileName) {
16422
16346
  }
16423
16347
 
16424
16348
  // src/componentManifest/resolveComponents.ts
16425
- import { recast } from "storybook/internal/babel";
16426
16349
  import { extractDeclaredSubcomponents } from "storybook/internal/common";
16427
16350
  import { storyNameFromExport } from "storybook/internal/csf/csf-utils";
16428
16351
  import {
@@ -16434,11 +16357,11 @@ import {
16434
16357
 
16435
16358
  // src/componentManifest/getComponentImports.ts
16436
16359
  import { dirname as dirname6 } from "node:path";
16437
- import { types as t3 } from "storybook/internal/babel";
16438
16360
  import {
16439
16361
  buildImportStatements,
16440
16362
  collectImportBindings as collectImportBindings2,
16441
- resolveComponentImport
16363
+ resolveComponentImport,
16364
+ walk as walk2
16442
16365
  } from "storybook/internal/csf-tools";
16443
16366
  import { logger as logger5 } from "storybook/internal/node-logger";
16444
16367
  var baseIdentifier = (component) => component.split(".")[0] ?? component, getComponents = async ({
@@ -16448,28 +16371,21 @@ var baseIdentifier = (component) => component.split(".")[0] ?? component, getCom
16448
16371
  docgenEngine,
16449
16372
  additionalComponentNames = []
16450
16373
  }) => {
16451
- let { reactDocgenTypescriptOptions } = typescriptOptions, program = csf._file.path, componentSet = /* @__PURE__ */ new Set(), componentDepth = /* @__PURE__ */ new Map(), localToImport = collectImportBindings2(program), jsxDepth = 0;
16452
- program.traverse({
16453
- JSXElement: {
16454
- enter() {
16455
- jsxDepth++;
16456
- },
16457
- exit() {
16458
- jsxDepth--;
16459
- }
16460
- },
16461
- JSXOpeningElement(p) {
16462
- let n = p.node.name, name;
16463
- if (t3.isJSXIdentifier(n))
16464
- name = n.name, name && /[A-Z]/.test(name.charAt(0)) && componentSet.add(name);
16465
- else if (t3.isJSXMemberExpression(n)) {
16466
- let jsxNameToString = (nm) => t3.isJSXIdentifier(nm) ? nm.name : `${jsxNameToString(nm.object)}.${jsxNameToString(nm.property)}`;
16467
- name = jsxNameToString(n), componentSet.add(name);
16468
- }
16469
- if (name) {
16470
- let depth = jsxDepth - 1, existing = componentDepth.get(name);
16471
- (existing === void 0 || depth < existing) && componentDepth.set(name, depth);
16472
- }
16374
+ let { reactDocgenTypescriptOptions } = typescriptOptions, componentSet = /* @__PURE__ */ new Set(), componentDepth = /* @__PURE__ */ new Map(), localToImport = collectImportBindings2(csf.program), jsxDepth = /* @__PURE__ */ new Map();
16375
+ walk2(csf.program, (node, parent) => {
16376
+ let depth = (parent ? jsxDepth.get(parent) ?? 0 : 0) + (node.type === "JSXElement" ? 1 : 0);
16377
+ if (jsxDepth.set(node, depth), node.type !== "JSXOpeningElement")
16378
+ return;
16379
+ let n = node.name, name;
16380
+ if (n.type === "JSXIdentifier")
16381
+ name = n.name, name && /[A-Z]/.test(name.charAt(0)) && componentSet.add(name);
16382
+ else if (n.type === "JSXMemberExpression") {
16383
+ let jsxNameToString = (nm) => nm.type === "JSXIdentifier" ? nm.name : `${jsxNameToString(nm.object)}.${jsxNameToString(nm.property)}`;
16384
+ name = jsxNameToString(n), componentSet.add(name);
16385
+ }
16386
+ if (name) {
16387
+ let wrappingDepth = depth - 1, existing = componentDepth.get(name);
16388
+ (existing === void 0 || wrappingDepth < existing) && componentDepth.set(name, wrappingDepth);
16473
16389
  }
16474
16390
  });
16475
16391
  let metaComp = csf._meta?.component;
@@ -16477,8 +16393,8 @@ var baseIdentifier = (component) => component.split(".")[0] ?? component, getCom
16477
16393
  for (let componentName of additionalComponentNames)
16478
16394
  componentSet.add(componentName);
16479
16395
  let components = Array.from(componentSet).sort((a, b) => a.localeCompare(b)), isLocallyDefinedWithoutImport = (base2) => {
16480
- let binding = program.scope.getBinding(base2);
16481
- return binding ? !!!(binding.path.isImportSpecifier?.() || binding.path.isImportDefaultSpecifier?.() || binding.path.isImportNamespaceSpecifier?.()) : !1;
16396
+ let binding = csf.editor.scopes.program.bindings.get(base2);
16397
+ return binding ? binding.kind !== "import" : !1;
16482
16398
  }, filteredComponents = components.filter(
16483
16399
  (c) => !isLocallyDefinedWithoutImport(baseIdentifier(c))
16484
16400
  );
@@ -16568,7 +16484,7 @@ function findMatchingComponent(components, componentName, title) {
16568
16484
  return best;
16569
16485
  }
16570
16486
  async function resolveStoryFileComponents(options) {
16571
- let { storyPath, title, typescriptOptions, docgenEngine } = options, storyFile = cachedReadTextFileSync(storyPath), csf = loadCsf(storyFile, { makeTitle: () => title }).parse(), componentName = csf._meta?.component, declaredSubcomponents = extractDeclaredSubcomponents(csf), allComponents = await getComponents({
16487
+ let { storyPath, title, typescriptOptions, docgenEngine } = options, storyFile = cachedReadTextFileSync(storyPath), csf = loadCsf(storyFile, { makeTitle: () => title, fileName: storyPath }).parse(), componentName = csf._meta?.component, declaredSubcomponents = extractDeclaredSubcomponents(csf), allComponents = await getComponents({
16572
16488
  additionalComponentNames: declaredSubcomponents.map(
16573
16489
  (subcomponent) => subcomponent.componentName
16574
16490
  ),
@@ -16587,15 +16503,16 @@ function extractStorySnippets(csf, componentName, filterStoryIds, references) {
16587
16503
  return { stories: Object.entries(csf._stories).filter(([, story]) => !filterStoryIds || filterStoryIds.has(story.id)).map(([storyExport, story]) => {
16588
16504
  let name = story.name ?? storyNameFromExport(storyExport);
16589
16505
  try {
16590
- let { description, summary } = extractStoryJSDocInfo(csf._storyStatements[storyExport]), snippet = getCodeSnippet(csf, storyExport, componentName, resolver);
16506
+ let { description, summary } = extractStoryJSDocInfo(
16507
+ csf._storyStatements[storyExport],
16508
+ csf.editor
16509
+ ), snippet = getCodeSnippet(csf, storyExport, componentName, resolver);
16591
16510
  imports.push(...snippet.imports);
16592
16511
  let warning = unresolvedWarning(snippet.unresolved);
16593
16512
  return {
16594
16513
  id: story.id,
16595
16514
  name,
16596
- // Recast defaults to `os.EOL`, which would carriage-return snippets built on Windows.
16597
- snippet: recast.print(snippet.node, { lineTerminator: `
16598
- ` }).code,
16515
+ snippet: snippet.code,
16599
16516
  description,
16600
16517
  summary,
16601
16518
  ...warning ? { warning } : {}
@@ -16613,7 +16530,8 @@ import {
16613
16530
  buildImportStatements as buildImportStatements2,
16614
16531
  createStoryReferenceResolver,
16615
16532
  extractComponentDescription,
16616
- extractDescription
16533
+ extractDescription,
16534
+ storyShapeError as storyShapeError2
16617
16535
  } from "storybook/internal/csf-tools";
16618
16536
  var openStoryReferences = createStoryReferenceResolver(), ROOT_ENTRY_FIELDS = ["main", "module", "types", "typings", "browser"];
16619
16537
  function hasRootEntry(pkg) {
@@ -16779,14 +16697,14 @@ function buildComponentDocgenFromResolved({
16779
16697
  jsDocTags: base2.jsDocTags ?? {},
16780
16698
  error: docgenError ?? {
16781
16699
  name: error.name,
16782
- message: (csf._metaStatementPath?.buildCodeFrameError(error.message).message ?? error.message) + `
16700
+ message: (csf._metaStatement ? storyShapeError2(error.message, csf._metaStatement, csf.editor).message : error.message) + `
16783
16701
 
16784
16702
  ${entry.importPath}:
16785
16703
  ${storyFile}`
16786
16704
  }
16787
16705
  };
16788
16706
  }
16789
- let metaJsDoc = extractDescription(csf._metaStatement) || void 0, { description, summary, jsDocTags } = extractComponentDescription(
16707
+ let metaJsDoc = extractDescription(csf._metaStatement, csf.editor) || void 0, { description, summary, jsDocTags } = extractComponentDescription(
16790
16708
  metaJsDoc,
16791
16709
  docgenDescription,
16792
16710
  docgenJsDocTags
@@ -16858,12 +16776,13 @@ function buildReactComponentDocgenFromResolved({
16858
16776
  export {
16859
16777
  __commonJS,
16860
16778
  __toESM,
16779
+ join3 as join,
16780
+ isAbsolute2 as isAbsolute,
16781
+ posix,
16861
16782
  extractArgTypes,
16862
16783
  invalidateCache,
16863
16784
  cachedReadFileSync,
16864
16785
  parseWithReactDocgen,
16865
- join3 as join,
16866
- posix,
16867
16786
  getCodeSnippet,
16868
16787
  invalidateParser,
16869
16788
  resolveStoryFileComponents,