storybook 9.0.0-beta.10 → 9.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/actions/preview.cjs +1 -1
  2. package/dist/actions/preview.d.ts +501 -0
  3. package/dist/actions/preview.js +1 -1
  4. package/dist/backgrounds/index.d.ts +501 -0
  5. package/dist/backgrounds/preview.d.ts +501 -0
  6. package/dist/bin/index.cjs +44 -44
  7. package/dist/bin/index.js +44 -44
  8. package/dist/cli/bin/index.cjs +1032 -1032
  9. package/dist/cli/bin/index.js +1032 -1032
  10. package/dist/cli/index.cjs +33709 -28783
  11. package/dist/cli/index.js +33641 -28711
  12. package/dist/common/index.cjs +482 -482
  13. package/dist/common/index.js +466 -466
  14. package/dist/controls/preview.d.ts +501 -0
  15. package/dist/core-server/index.cjs +12 -12
  16. package/dist/core-server/index.d.ts +512 -11
  17. package/dist/core-server/index.js +12 -12
  18. package/dist/core-server/presets/common-manager.js +2 -2
  19. package/dist/core-server/presets/common-override-preset.cjs +10 -12
  20. package/dist/core-server/presets/common-override-preset.js +3 -5
  21. package/dist/core-server/presets/common-preset.cjs +112 -116
  22. package/dist/core-server/presets/common-preset.js +10 -14
  23. package/dist/highlight/preview.d.ts +501 -0
  24. package/dist/manager/globals-module-info.cjs +1 -0
  25. package/dist/manager/globals-module-info.js +1 -0
  26. package/dist/manager/globals-runtime.js +21131 -21017
  27. package/dist/manager/runtime.js +1808 -1801
  28. package/dist/manager-api/index.cjs +1 -1
  29. package/dist/manager-api/index.d.ts +501 -0
  30. package/dist/manager-api/index.js +1 -1
  31. package/dist/measure/index.d.ts +501 -0
  32. package/dist/measure/preview.d.ts +501 -0
  33. package/dist/outline/index.d.ts +501 -0
  34. package/dist/outline/preview.d.ts +501 -0
  35. package/dist/preview/runtime.js +37838 -37834
  36. package/dist/preview-api/index.cjs +247 -245
  37. package/dist/preview-api/index.d.ts +1 -1
  38. package/dist/preview-api/index.js +296 -294
  39. package/dist/router/index.cjs +5700 -2327
  40. package/dist/router/index.d.ts +622 -243
  41. package/dist/router/index.js +1297 -870
  42. package/dist/test/index.cjs +1810 -1811
  43. package/dist/test/index.d.ts +53 -5
  44. package/dist/test/index.js +1907 -1908
  45. package/dist/test/preview.cjs +49 -15862
  46. package/dist/test/preview.d.ts +520 -13
  47. package/dist/test/preview.js +42 -14433
  48. package/dist/types/index.d.ts +516 -82
  49. package/dist/viewport/index.d.ts +502 -3
  50. package/dist/viewport/preview.d.ts +501 -0
  51. package/package.json +2 -18
  52. package/dist/test/spy.cjs +0 -258
  53. package/dist/test/spy.d.ts +0 -62
  54. package/dist/test/spy.js +0 -240
@@ -180,7 +180,7 @@ var W = O((Be) => {
180
180
  var bt = O((gt) => {
181
181
  "use strict";
182
182
  Object.defineProperty(gt, "__esModule", { value: !0 });
183
- gt.encodeString = Ei;
183
+ gt.encodeString = Ai;
184
184
  var Y = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()), wi = new Int8Array([
185
185
  0,
186
186
  0,
@@ -311,7 +311,7 @@ var bt = O((gt) => {
311
311
  1,
312
312
  0
313
313
  ]);
314
- function Ei(r) {
314
+ function Ai(r) {
315
315
  let e = r.length;
316
316
  if (e === 0)
317
317
  return "";
@@ -338,7 +338,7 @@ var bt = O((gt) => {
338
338
  }
339
339
  return o === 0 ? r : o < e ? t + r.slice(o) : t;
340
340
  }
341
- s(Ei, "encodeString");
341
+ s(Ai, "encodeString");
342
342
  });
343
343
 
344
344
  // ../node_modules/picoquery/lib/shared.js
@@ -346,7 +346,7 @@ var Cr = O((K) => {
346
346
  "use strict";
347
347
  Object.defineProperty(K, "__esModule", { value: !0 });
348
348
  K.defaultOptions = K.defaultShouldSerializeObject = K.defaultValueSerializer = void 0;
349
- var St = bt(), Ai = /* @__PURE__ */ s((r) => {
349
+ var St = bt(), Ei = /* @__PURE__ */ s((r) => {
350
350
  switch (typeof r) {
351
351
  case "string":
352
352
  return (0, St.encodeString)(r);
@@ -360,7 +360,7 @@ var Cr = O((K) => {
360
360
  }
361
361
  return r instanceof Date ? (0, St.encodeString)(r.toISOString()) : "";
362
362
  }, "defaultValueSerializer");
363
- K.defaultValueSerializer = Ai;
363
+ K.defaultValueSerializer = Ei;
364
364
  var Ci = /* @__PURE__ */ s((r) => r instanceof Date, "defaultShouldSerializeObject");
365
365
  K.defaultShouldSerializeObject = Ci;
366
366
  var Cn = /* @__PURE__ */ s((r) => r, "identityFunc");
@@ -383,7 +383,7 @@ var Tt = O((vr) => {
383
383
  Object.defineProperty(vr, "__esModule", { value: !0 });
384
384
  vr.getDeepObject = Fi;
385
385
  vr.stringifyObject = vn;
386
- var Se = Cr(), vi = bt();
386
+ var be = Cr(), vi = bt();
387
387
  function Pi(r) {
388
388
  return r === "__proto__" || r === "constructor" || r === "prototype";
389
389
  }
@@ -398,9 +398,9 @@ var Tt = O((vr) => {
398
398
  s(Fi, "getDeepObject");
399
399
  var Ii = 20, Oi = "[]", Di = "[", ki = "]", ji = ".";
400
400
  function vn(r, e, t = 0, o, n) {
401
- let { nestingSyntax: i = Se.defaultOptions.nestingSyntax, arrayRepeat: a = Se.defaultOptions.arrayRepeat, arrayRepeatSyntax: l = Se.defaultOptions.
402
- arrayRepeatSyntax, nesting: c = Se.defaultOptions.nesting, delimiter: d = Se.defaultOptions.delimiter, valueSerializer: u = Se.defaultOptions.
403
- valueSerializer, shouldSerializeObject: p = Se.defaultOptions.shouldSerializeObject } = e, y = typeof d == "number" ? String.fromCharCode(
401
+ let { nestingSyntax: i = be.defaultOptions.nestingSyntax, arrayRepeat: a = be.defaultOptions.arrayRepeat, arrayRepeatSyntax: l = be.defaultOptions.
402
+ arrayRepeatSyntax, nesting: c = be.defaultOptions.nesting, delimiter: d = be.defaultOptions.delimiter, valueSerializer: u = be.defaultOptions.
403
+ valueSerializer, shouldSerializeObject: p = be.defaultOptions.shouldSerializeObject } = e, y = typeof d == "number" ? String.fromCharCode(
404
404
  d) : d, h = n === !0 && a, x = i === "dot" || i === "js" && !n;
405
405
  if (t > Ii)
406
406
  return "";
@@ -417,7 +417,7 @@ var Tt = O((vr) => {
417
417
  });
418
418
 
419
419
  // ../node_modules/fast-decode-uri-component/index.js
420
- var On = O((Op, In) => {
420
+ var On = O((Ip, In) => {
421
421
  "use strict";
422
422
  var Pn = 12, Mi = 0, xt = [
423
423
  // The first part of the table maps bytes to character to a transition.
@@ -863,7 +863,7 @@ var Mn = O((ee) => {
863
863
  Object.defineProperty(ee, "__esModule", { value: !0 });
864
864
  ee.numberValueDeserializer = ee.numberKeyDeserializer = void 0;
865
865
  ee.parse = zi;
866
- var Pr = Tt(), Te = Cr(), Dn = Ni(On()), qi = /* @__PURE__ */ s((r) => {
866
+ var Pr = Tt(), Se = Cr(), Dn = Ni(On()), qi = /* @__PURE__ */ s((r) => {
867
867
  let e = Number(r);
868
868
  return Number.isNaN(e) ? r : e;
869
869
  }, "numberKeyDeserializer");
@@ -882,17 +882,17 @@ var Mn = O((ee) => {
882
882
  }
883
883
  s(Fr, "computeKeySlice");
884
884
  function zi(r, e) {
885
- let { valueDeserializer: t = Te.defaultOptions.valueDeserializer, keyDeserializer: o = Te.defaultOptions.keyDeserializer, arrayRepeatSyntax: n = Te.
886
- defaultOptions.arrayRepeatSyntax, nesting: i = Te.defaultOptions.nesting, arrayRepeat: a = Te.defaultOptions.arrayRepeat, nestingSyntax: l = Te.
887
- defaultOptions.nestingSyntax, delimiter: c = Te.defaultOptions.delimiter } = e ?? {}, d = typeof c == "string" ? c.charCodeAt(0) : c, u = l ===
885
+ let { valueDeserializer: t = Se.defaultOptions.valueDeserializer, keyDeserializer: o = Se.defaultOptions.keyDeserializer, arrayRepeatSyntax: n = Se.
886
+ defaultOptions.arrayRepeatSyntax, nesting: i = Se.defaultOptions.nesting, arrayRepeat: a = Se.defaultOptions.arrayRepeat, nestingSyntax: l = Se.
887
+ defaultOptions.nestingSyntax, delimiter: c = Se.defaultOptions.delimiter } = e ?? {}, d = typeof c == "string" ? c.charCodeAt(0) : c, u = l ===
888
888
  "js", p = new jn();
889
889
  if (typeof r != "string")
890
890
  return p;
891
- let y = r.length, h = "", x = -1, R = -1, m = -1, b = p, w, f = "", g = "", E = !1, S = !1, C = !1, D = !1, L = !1, G = !1, Ae = !1, v = 0,
891
+ let y = r.length, h = "", x = -1, R = -1, m = -1, b = p, w, f = "", g = "", A = !1, S = !1, C = !1, D = !1, L = !1, G = !1, Ae = !1, v = 0,
892
892
  V = -1, ke = -1, Mt = -1;
893
893
  for (let k = 0; k < y + 1; k++) {
894
894
  if (v = k !== y ? r.charCodeAt(k) : d, v === d) {
895
- if (Ae = R > x, Ae || (R = k), m !== R - 1 && (g = Fr(r, m + 1, V > -1 ? V : R, C, E), f = o(g), w !== void 0 && (b = (0, Pr.getDeepObject)(
895
+ if (Ae = R > x, Ae || (R = k), m !== R - 1 && (g = Fr(r, m + 1, V > -1 ? V : R, C, A), f = o(g), w !== void 0 && (b = (0, Pr.getDeepObject)(
896
896
  b, w, f, u && L, u && G))), Ae || f !== "") {
897
897
  Ae && (h = r.slice(R + 1, k), D && (h = h.replace(kn, " ")), S && (h = (0, Dn.default)(h) || h));
898
898
  let je = t(h, f);
@@ -902,13 +902,13 @@ var Mn = O((ee) => {
902
902
  } else
903
903
  b[f] = je;
904
904
  }
905
- h = "", x = k, R = k, E = !1, S = !1, C = !1, D = !1, L = !1, G = !1, V = -1, m = k, b = p, w = void 0, f = "";
905
+ h = "", x = k, R = k, A = !1, S = !1, C = !1, D = !1, L = !1, G = !1, V = -1, m = k, b = p, w = void 0, f = "";
906
906
  } else v === 93 ? (a && n === "bracket" && Mt === 91 && (V = ke), i && (l === "index" || u) && R <= x && (m !== ke && (g = Fr(r, m + 1,
907
- k, C, E), f = o(g), w !== void 0 && (b = (0, Pr.getDeepObject)(b, w, f, void 0, u)), w = f, C = !1, E = !1), m = k, G = !0, L = !1)) :
908
- v === 46 ? i && (l === "dot" || u) && R <= x && (m !== ke && (g = Fr(r, m + 1, k, C, E), f = o(g), w !== void 0 && (b = (0, Pr.getDeepObject)(
909
- b, w, f, u)), w = f, C = !1, E = !1), L = !0, G = !1, m = k) : v === 91 ? i && (l === "index" || u) && R <= x && (m !== ke && (g = Fr(
910
- r, m + 1, k, C, E), f = o(g), u && w !== void 0 && (b = (0, Pr.getDeepObject)(b, w, f, u)), w = f, C = !1, E = !1, L = !1, G = !0), m =
911
- k) : v === 61 ? R <= x ? R = k : S = !0 : v === 43 ? R > x ? D = !0 : C = !0 : v === 37 && (R > x ? S = !0 : E = !0);
907
+ k, C, A), f = o(g), w !== void 0 && (b = (0, Pr.getDeepObject)(b, w, f, void 0, u)), w = f, C = !1, A = !1), m = k, G = !0, L = !1)) :
908
+ v === 46 ? i && (l === "dot" || u) && R <= x && (m !== ke && (g = Fr(r, m + 1, k, C, A), f = o(g), w !== void 0 && (b = (0, Pr.getDeepObject)(
909
+ b, w, f, u)), w = f, C = !1, A = !1), L = !0, G = !1, m = k) : v === 91 ? i && (l === "index" || u) && R <= x && (m !== ke && (g = Fr(
910
+ r, m + 1, k, C, A), f = o(g), u && w !== void 0 && (b = (0, Pr.getDeepObject)(b, w, f, u)), w = f, C = !1, A = !1, L = !1, G = !0), m =
911
+ k) : v === 61 ? R <= x ? R = k : S = !0 : v === 43 ? R > x ? D = !0 : C = !0 : v === 37 && (R > x ? S = !0 : A = !0);
912
912
  ke = k, Mt = v;
913
913
  }
914
914
  return p;
@@ -959,7 +959,7 @@ var Ir = O((H) => {
959
959
  });
960
960
 
961
961
  // ../node_modules/entities/lib/maps/entities.json
962
- var At = O((Vp, ea) => {
962
+ var Et = O((Hp, ea) => {
963
963
  ea.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\
964
964
  \xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}",
965
965
  Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\
@@ -1241,7 +1241,7 @@ var At = O((Vp, ea) => {
1241
1241
  });
1242
1242
 
1243
1243
  // ../node_modules/entities/lib/maps/legacy.json
1244
- var Wn = O((Wp, ra) => {
1244
+ var Wn = O((Vp, ra) => {
1245
1245
  ra.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\
1246
1246
  \xE0", amp: "&", AMP: "&", Aring: "\xC5", aring: "\xE5", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", brvbar: "\xA6", Ccedil: "\
1247
1247
  \xC7", ccedil: "\xE7", cedil: "\xB8", cent: "\xA2", copy: "\xA9", COPY: "\xA9", curren: "\xA4", deg: "\xB0", divide: "\xF7", Eacute: "\xC9",
@@ -1256,12 +1256,12 @@ var Wn = O((Wp, ra) => {
1256
1256
  });
1257
1257
 
1258
1258
  // ../node_modules/entities/lib/maps/xml.json
1259
- var Ct = O(($p, ta) => {
1259
+ var Ct = O((Wp, ta) => {
1260
1260
  ta.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
1261
1261
  });
1262
1262
 
1263
1263
  // ../node_modules/entities/lib/maps/decode.json
1264
- var $n = O((Yp, oa) => {
1264
+ var $n = O(($p, oa) => {
1265
1265
  oa.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240,
1266
1266
  "138": 352, "139": 8249, "140": 338, "142": 381, "145": 8216, "146": 8217, "147": 8220, "148": 8221, "149": 8226, "150": 8211, "151": 8212,
1267
1267
  "152": 732, "153": 8482, "154": 353, "155": 8250, "156": 339, "158": 382, "159": 376 };
@@ -1297,7 +1297,7 @@ var Pt = O((X) => {
1297
1297
  };
1298
1298
  Object.defineProperty(X, "__esModule", { value: !0 });
1299
1299
  X.decodeHTML = X.decodeHTMLStrict = X.decodeXML = void 0;
1300
- var vt = Or(At()), aa = Or(Wn()), la = Or(Ct()), Xn = Or(Kn()), ca = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
1300
+ var vt = Or(Et()), aa = Or(Wn()), la = Or(Ct()), Xn = Or(Kn()), ca = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
1301
1301
  X.decodeXML = Qn(la.default);
1302
1302
  X.decodeHTMLStrict = Qn(vt.default);
1303
1303
  function Qn(r) {
@@ -1343,7 +1343,7 @@ var It = O((N) => {
1343
1343
  N.escapeUTF8 = N.escape = N.encodeNonAsciiHTML = N.encodeHTML = N.encodeXML = void 0;
1344
1344
  var da = es(Ct()), rs = os(da.default), ts = ns(rs);
1345
1345
  N.encodeXML = as(rs);
1346
- var pa = es(At()), Ft = os(pa.default), ua = ns(Ft);
1346
+ var pa = es(Et()), Ft = os(pa.default), ua = ns(Ft);
1347
1347
  N.encodeHTML = ya(Ft, ua);
1348
1348
  N.encodeNonAsciiHTML = as(Ft);
1349
1349
  function os(r) {
@@ -1438,57 +1438,57 @@ var cs = O((T) => {
1438
1438
  }
1439
1439
  s(Sa, "encode");
1440
1440
  T.encode = Sa;
1441
- var Re = It();
1441
+ var xe = It();
1442
1442
  Object.defineProperty(T, "encodeXML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1443
- return Re.encodeXML;
1443
+ return xe.encodeXML;
1444
1444
  }, "get") });
1445
1445
  Object.defineProperty(T, "encodeHTML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1446
- return Re.encodeHTML;
1446
+ return xe.encodeHTML;
1447
1447
  }, "get") });
1448
1448
  Object.defineProperty(T, "encodeNonAsciiHTML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1449
- return Re.encodeNonAsciiHTML;
1449
+ return xe.encodeNonAsciiHTML;
1450
1450
  }, "get") });
1451
1451
  Object.defineProperty(T, "escape", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1452
- return Re.escape;
1452
+ return xe.escape;
1453
1453
  }, "get") });
1454
1454
  Object.defineProperty(T, "escapeUTF8", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1455
- return Re.escapeUTF8;
1455
+ return xe.escapeUTF8;
1456
1456
  }, "get") });
1457
1457
  Object.defineProperty(T, "encodeHTML4", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1458
- return Re.encodeHTML;
1458
+ return xe.encodeHTML;
1459
1459
  }, "get") });
1460
1460
  Object.defineProperty(T, "encodeHTML5", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1461
- return Re.encodeHTML;
1461
+ return xe.encodeHTML;
1462
1462
  }, "get") });
1463
- var ce = Pt();
1463
+ var le = Pt();
1464
1464
  Object.defineProperty(T, "decodeXML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1465
- return ce.decodeXML;
1465
+ return le.decodeXML;
1466
1466
  }, "get") });
1467
1467
  Object.defineProperty(T, "decodeHTML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1468
- return ce.decodeHTML;
1468
+ return le.decodeHTML;
1469
1469
  }, "get") });
1470
1470
  Object.defineProperty(T, "decodeHTMLStrict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1471
- return ce.decodeHTMLStrict;
1471
+ return le.decodeHTMLStrict;
1472
1472
  }, "get") });
1473
1473
  Object.defineProperty(T, "decodeHTML4", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1474
- return ce.decodeHTML;
1474
+ return le.decodeHTML;
1475
1475
  }, "get") });
1476
1476
  Object.defineProperty(T, "decodeHTML5", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1477
- return ce.decodeHTML;
1477
+ return le.decodeHTML;
1478
1478
  }, "get") });
1479
1479
  Object.defineProperty(T, "decodeHTML4Strict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1480
- return ce.decodeHTMLStrict;
1480
+ return le.decodeHTMLStrict;
1481
1481
  }, "get") });
1482
1482
  Object.defineProperty(T, "decodeHTML5Strict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1483
- return ce.decodeHTMLStrict;
1483
+ return le.decodeHTMLStrict;
1484
1484
  }, "get") });
1485
1485
  Object.defineProperty(T, "decodeXMLStrict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
1486
- return ce.decodeXML;
1486
+ return le.decodeXML;
1487
1487
  }, "get") });
1488
1488
  });
1489
1489
 
1490
1490
  // ../node_modules/ansi-to-html/lib/ansi_to_html.js
1491
- var Ts = O((ou, Ss) => {
1491
+ var Ts = O((tu, Ss) => {
1492
1492
  "use strict";
1493
1493
  function Ta(r, e) {
1494
1494
  if (!(r instanceof e))
@@ -1561,9 +1561,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1561
1561
  newline: !1,
1562
1562
  escapeXML: !1,
1563
1563
  stream: !1,
1564
- colors: Ea()
1564
+ colors: Aa()
1565
1565
  };
1566
- function Ea() {
1566
+ function Aa() {
1567
1567
  var r = {
1568
1568
  0: "#000",
1569
1569
  1: "#A00",
@@ -1585,7 +1585,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1585
1585
  return jr(0, 5).forEach(function(e) {
1586
1586
  jr(0, 5).forEach(function(t) {
1587
1587
  jr(0, 5).forEach(function(o) {
1588
- return Aa(e, t, o, r);
1588
+ return Ea(e, t, o, r);
1589
1589
  });
1590
1590
  });
1591
1591
  }), jr(0, 23).forEach(function(e) {
@@ -1593,12 +1593,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1593
1593
  r[t] = "#" + o + o + o;
1594
1594
  }), r;
1595
1595
  }
1596
- s(Ea, "getDefaultColors");
1597
- function Aa(r, e, t, o) {
1596
+ s(Aa, "getDefaultColors");
1597
+ function Ea(r, e, t, o) {
1598
1598
  var n = 16 + r * 36 + e * 6 + t, i = r > 0 ? r * 40 + 55 : 0, a = e > 0 ? e * 40 + 55 : 0, l = t > 0 ? t * 40 + 55 : 0;
1599
1599
  o[n] = Ca([i, a, l]);
1600
1600
  }
1601
- s(Aa, "setStyleColor");
1601
+ s(Ea, "setStyleColor");
1602
1602
  function gs(r) {
1603
1603
  for (var e = r.toString(16); e.length < 2; )
1604
1604
  e = "0" + e;
@@ -1644,19 +1644,19 @@ erm256Background" ? n = Lr(r, o.colors[t]) : e === "rgb" && (n = va(r, t)), n;
1644
1644
  return r.length && bs(r);
1645
1645
  }, "_"),
1646
1646
  1: /* @__PURE__ */ s(function() {
1647
- return de(r, "b");
1647
+ return ce(r, "b");
1648
1648
  }, "_"),
1649
1649
  3: /* @__PURE__ */ s(function() {
1650
- return de(r, "i");
1650
+ return ce(r, "i");
1651
1651
  }, "_"),
1652
1652
  4: /* @__PURE__ */ s(function() {
1653
- return de(r, "u");
1653
+ return ce(r, "u");
1654
1654
  }, "_"),
1655
1655
  8: /* @__PURE__ */ s(function() {
1656
1656
  return Mr(r, "display:none");
1657
1657
  }, "_"),
1658
1658
  9: /* @__PURE__ */ s(function() {
1659
- return de(r, "strike");
1659
+ return ce(r, "strike");
1660
1660
  }, "_"),
1661
1661
  22: /* @__PURE__ */ s(function() {
1662
1662
  return Mr(r, "font-weight:normal;text-decoration:none;font-style:normal");
@@ -1677,7 +1677,7 @@ erm256Background" ? n = Lr(r, o.colors[t]) : e === "rgb" && (n = va(r, t)), n;
1677
1677
  return Mr(r, "text-decoration:overline");
1678
1678
  }, "_")
1679
1679
  }, n;
1680
- return o[e] ? n = o[e]() : 4 < e && e < 7 ? n = de(r, "blink") : 29 < e && e < 38 ? n = _r(r, t.colors[e - 30]) : 39 < e && e < 48 ? n =
1680
+ return o[e] ? n = o[e]() : 4 < e && e < 7 ? n = ce(r, "blink") : 29 < e && e < 38 ? n = _r(r, t.colors[e - 30]) : 39 < e && e < 48 ? n =
1681
1681
  Lr(r, t.colors[e - 40]) : 89 < e && e < 98 ? n = _r(r, t.colors[8 + (e - 90)]) : 99 < e && e < 108 && (n = Lr(r, t.colors[8 + (e - 100)])),
1682
1682
  n;
1683
1683
  }
@@ -1713,20 +1713,20 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
1713
1713
  return e.escapeXML ? wa.encodeXML(r) : r;
1714
1714
  }
1715
1715
  s(Ia, "pushText");
1716
- function de(r, e, t) {
1716
+ function ce(r, e, t) {
1717
1717
  return t || (t = ""), r.push(e), "<".concat(e).concat(t ? ' style="'.concat(t, '"') : "", ">");
1718
1718
  }
1719
- s(de, "pushTag");
1719
+ s(ce, "pushTag");
1720
1720
  function Mr(r, e) {
1721
- return de(r, "span", e);
1721
+ return ce(r, "span", e);
1722
1722
  }
1723
1723
  s(Mr, "pushStyle");
1724
1724
  function _r(r, e) {
1725
- return de(r, "span", "color:" + e);
1725
+ return ce(r, "span", "color:" + e);
1726
1726
  }
1727
1727
  s(_r, "pushForegroundColor");
1728
1728
  function Lr(r, e) {
1729
- return de(r, "span", "background-color:" + e);
1729
+ return ce(r, "span", "background-color:" + e);
1730
1730
  }
1731
1731
  s(Lr, "pushBackgroundColor");
1732
1732
  function ms(r, e) {
@@ -1741,19 +1741,19 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
1741
1741
  return "";
1742
1742
  }
1743
1743
  s(i, "remove");
1744
- function a(E, S) {
1744
+ function a(A, S) {
1745
1745
  return t("xterm256Foreground", S), "";
1746
1746
  }
1747
1747
  s(a, "removeXterm256Foreground");
1748
- function l(E, S) {
1748
+ function l(A, S) {
1749
1749
  return t("xterm256Background", S), "";
1750
1750
  }
1751
1751
  s(l, "removeXterm256Background");
1752
- function c(E) {
1753
- return e.newline ? t("display", -1) : t("text", E), "";
1752
+ function c(A) {
1753
+ return e.newline ? t("display", -1) : t("text", A), "";
1754
1754
  }
1755
1755
  s(c, "newline");
1756
- function d(E, S) {
1756
+ function d(A, S) {
1757
1757
  o = !0, S.trim().length === 0 && (S = "0"), S = S.trimRight(";").split(";");
1758
1758
  var C = hs(S), D;
1759
1759
  try {
@@ -1769,12 +1769,12 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
1769
1769
  return "";
1770
1770
  }
1771
1771
  s(d, "ansiMess");
1772
- function u(E) {
1773
- return t("text", E), "";
1772
+ function u(A) {
1773
+ return t("text", A), "";
1774
1774
  }
1775
1775
  s(u, "realText");
1776
- function p(E) {
1777
- return t("rgb", E), "";
1776
+ function p(A) {
1777
+ return t("rgb", A), "";
1778
1778
  }
1779
1779
  s(p, "rgb");
1780
1780
  var y = [{
@@ -1837,8 +1837,8 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
1837
1837
  pattern: /^(([^\x1b\x08\r\n])+)/,
1838
1838
  sub: u
1839
1839
  }];
1840
- function h(E, S) {
1841
- S > n && o || (o = !1, r = r.replace(E.pattern, E.sub));
1840
+ function h(A, S) {
1841
+ S > n && o || (o = !1, r = r.replace(A.pattern, A.sub));
1842
1842
  }
1843
1843
  s(h, "process");
1844
1844
  var x = [], R = r, m = R.length;
@@ -1894,13 +1894,13 @@ var La = {};
1894
1894
  Bs(La, {
1895
1895
  DocsContext: () => Z,
1896
1896
  HooksContext: () => re,
1897
- Preview: () => ge,
1897
+ Preview: () => he,
1898
1898
  PreviewWeb: () => Ze,
1899
- PreviewWithSelection: () => be,
1900
- ReporterAPI: () => se,
1901
- StoryStore: () => me,
1902
- UrlStore: () => xe,
1903
- WebView: () => we,
1899
+ PreviewWithSelection: () => ge,
1900
+ ReporterAPI: () => ne,
1901
+ StoryStore: () => ye,
1902
+ UrlStore: () => Te,
1903
+ WebView: () => Re,
1904
1904
  addons: () => q,
1905
1905
  applyHooks: () => nr,
1906
1906
  combineArgs: () => Fe,
@@ -1915,13 +1915,13 @@ Bs(La, {
1915
1915
  definePreview: () => Nt,
1916
1916
  emitTransformCode: () => jt,
1917
1917
  filterArgTypes: () => Ue,
1918
- getCoreAnnotations: () => oe,
1918
+ getCoreAnnotations: () => ve,
1919
1919
  getCsfFactoryAnnotations: () => xr,
1920
1920
  inferControls: () => De,
1921
1921
  makeDecorator: () => Jt,
1922
1922
  mockChannel: () => tr,
1923
- normalizeProjectAnnotations: () => ye,
1924
- normalizeStory: () => fe,
1923
+ normalizeProjectAnnotations: () => fe,
1924
+ normalizeStory: () => ue,
1925
1925
  prepareMeta: () => gr,
1926
1926
  prepareStory: () => Oe,
1927
1927
  sanitizeStoryContextUpdate: () => ct,
@@ -1931,7 +1931,7 @@ Bs(La, {
1931
1931
  simulatePageLoad: () => kt,
1932
1932
  sortStoriesV7: () => gn,
1933
1933
  useArgs: () => Kt,
1934
- useCallback: () => ve,
1934
+ useCallback: () => Ce,
1935
1935
  useChannel: () => $t,
1936
1936
  useEffect: () => Ur,
1937
1937
  useGlobals: () => Xt,
@@ -1998,7 +1998,7 @@ function Nt(r) {
1998
1998
  s(Nt, "definePreview");
1999
1999
 
2000
2000
  // src/preview-api/modules/addons/hooks.ts
2001
- var Ce = require("storybook/internal/client-logger"), U = require("storybook/internal/core-events"), _e = require("@storybook/global");
2001
+ var Ee = require("storybook/internal/client-logger"), U = require("storybook/internal/core-events"), _e = require("@storybook/global");
2002
2002
  var re = class {
2003
2003
  constructor() {
2004
2004
  this.hookListsMap = void 0;
@@ -2099,7 +2099,7 @@ s(Gr, "getHooksContextOrThrow");
2099
2099
  function Vs(r, e, t) {
2100
2100
  let o = Gr();
2101
2101
  if (o.currentPhase === "MOUNT") {
2102
- t != null && !Array.isArray(t) && Ce.logger.warn(
2102
+ t != null && !Array.isArray(t) && Ee.logger.warn(
2103
2103
  `${r} received a final argument that is not an array (instead, received ${t}). When specified, the final argument must be an array.`
2104
2104
  );
2105
2105
  let n = { name: r, deps: t };
@@ -2109,13 +2109,13 @@ function Vs(r, e, t) {
2109
2109
  let n = o.getNextHook();
2110
2110
  if (n == null)
2111
2111
  throw new Error("Rendered more hooks than during the previous render.");
2112
- return n.name !== r && Ce.logger.warn(
2112
+ return n.name !== r && Ee.logger.warn(
2113
2113
  `Storybook has detected a change in the order of Hooks${o.currentDecoratorName ? ` called by ${o.currentDecoratorName}` : ""}. This wi\
2114
2114
  ll lead to bugs and errors if not fixed.`
2115
- ), t != null && n.deps == null && Ce.logger.warn(
2115
+ ), t != null && n.deps == null && Ee.logger.warn(
2116
2116
  `${r} received a final argument during this render, but not during the previous render. Even though the final argument is optional, it\
2117
2117
  s type cannot change between renders.`
2118
- ), t != null && n.deps != null && t.length !== n.deps.length && Ce.logger.warn(`The final argument passed to ${r} changed size between r\
2118
+ ), t != null && n.deps != null && t.length !== n.deps.length && Ee.logger.warn(`The final argument passed to ${r} changed size between r\
2119
2119
  enders. The order and size of this array must remain constant.
2120
2120
  Previous: ${n.deps}
2121
2121
  Incoming: ${t}`), (t == null || n.deps == null || !Hs(t, n.deps)) && (e(n), n.deps = t), n;
@@ -2138,10 +2138,10 @@ function zt(r, e) {
2138
2138
  return sr("useMemo", r, e);
2139
2139
  }
2140
2140
  s(zt, "useMemo");
2141
- function ve(r, e) {
2141
+ function Ce(r, e) {
2142
2142
  return sr("useCallback", () => r, e);
2143
2143
  }
2144
- s(ve, "useCallback");
2144
+ s(Ce, "useCallback");
2145
2145
  function Gt(r, e) {
2146
2146
  return sr(r, () => ({ current: e }), []);
2147
2147
  }
@@ -2158,7 +2158,7 @@ function Ws() {
2158
2158
  try {
2159
2159
  q.getChannel().emit(U.FORCE_RE_RENDER);
2160
2160
  } catch {
2161
- Ce.logger.warn("State updates of Storybook preview hooks work only in browser");
2161
+ Ee.logger.warn("State updates of Storybook preview hooks work only in browser");
2162
2162
  }
2163
2163
  }
2164
2164
  s(Ws, "triggerUpdate");
@@ -2193,7 +2193,7 @@ function $t(r, e = []) {
2193
2193
  Object.entries(r).forEach(
2194
2194
  ([o, n]) => t.removeListener(o, n)
2195
2195
  );
2196
- }), [...Object.keys(r), ...e]), ve(t.emit.bind(t), [t]);
2196
+ }), [...Object.keys(r), ...e]), Ce(t.emit.bind(t), [t]);
2197
2197
  }
2198
2198
  s($t, "useChannel");
2199
2199
  function Le() {
@@ -2210,10 +2210,10 @@ function Yt(r, e) {
2210
2210
  }
2211
2211
  s(Yt, "useParameter");
2212
2212
  function Kt() {
2213
- let r = q.getChannel(), { id: e, args: t } = Le(), o = ve(
2213
+ let r = q.getChannel(), { id: e, args: t } = Le(), o = Ce(
2214
2214
  (i) => r.emit(U.UPDATE_STORY_ARGS, { storyId: e, updatedArgs: i }),
2215
2215
  [r, e]
2216
- ), n = ve(
2216
+ ), n = Ce(
2217
2217
  (i) => r.emit(U.RESET_STORY_ARGS, { storyId: e, argNames: i }),
2218
2218
  [r, e]
2219
2219
  );
@@ -2221,7 +2221,7 @@ function Kt() {
2221
2221
  }
2222
2222
  s(Kt, "useArgs");
2223
2223
  function Xt() {
2224
- let r = q.getChannel(), { globals: e } = Le(), t = ve(
2224
+ let r = q.getChannel(), { globals: e } = Le(), t = Ce(
2225
2225
  (o) => r.emit(U.UPDATE_GLOBALS, { globals: o }),
2226
2226
  [r]
2227
2227
  );
@@ -2313,16 +2313,16 @@ function $r(r, e) {
2313
2313
  s($r, "pickBy");
2314
2314
 
2315
2315
  // ../node_modules/es-toolkit/dist/compat/util/eq.mjs
2316
- function Eo(r, e) {
2316
+ function Ao(r, e) {
2317
2317
  return r === e || Number.isNaN(r) && Number.isNaN(e);
2318
2318
  }
2319
- s(Eo, "eq");
2319
+ s(Ao, "eq");
2320
2320
 
2321
2321
  // ../node_modules/es-toolkit/dist/predicate/isEqualWith.mjs
2322
- function Ao(r, e, t) {
2322
+ function Eo(r, e, t) {
2323
2323
  return Ne(r, e, void 0, void 0, void 0, void 0, t);
2324
2324
  }
2325
- s(Ao, "isEqualWith");
2325
+ s(Eo, "isEqualWith");
2326
2326
  function Ne(r, e, t, o, n, i, a) {
2327
2327
  let l = a(r, e, t, o, n, i);
2328
2328
  if (l !== void 0)
@@ -2356,7 +2356,7 @@ function qe(r, e, t, o) {
2356
2356
  return r.toString() === e.toString();
2357
2357
  case ro: {
2358
2358
  let c = r.valueOf(), d = e.valueOf();
2359
- return Eo(c, d);
2359
+ return Ao(c, d);
2360
2360
  }
2361
2361
  case to:
2362
2362
  case no:
@@ -2446,18 +2446,18 @@ s(qe, "areObjectsEqual");
2446
2446
 
2447
2447
  // ../node_modules/es-toolkit/dist/predicate/isEqual.mjs
2448
2448
  function Yr(r, e) {
2449
- return Ao(r, e, Qt);
2449
+ return Eo(r, e, Qt);
2450
2450
  }
2451
2451
  s(Yr, "isEqual");
2452
2452
 
2453
2453
  // src/preview-api/modules/store/StoryStore.ts
2454
2454
  var Rr = I(Kr(), 1);
2455
2455
 
2456
- // src/preview-api/core-annotations.ts
2456
+ // src/shared/preview/core-annotations.ts
2457
2457
  var Xr = I(require("storybook/internal/component-testing/preview"), 1), Jr = I(require("storybook/actions/preview"), 1), Qr = I(require("storybook/backgrounds/preview"), 1),
2458
2458
  Zr = I(require("storybook/highlight/preview"), 1), et = I(require("storybook/measure/preview"), 1), rt = I(require("storybook/outline/preview"), 1),
2459
2459
  tt = I(require("storybook/test/preview"), 1), ot = I(require("storybook/viewport/preview"), 1);
2460
- function oe() {
2460
+ function ve() {
2461
2461
  return [
2462
2462
  // @ts-expect-error CJS fallback
2463
2463
  (et.default.default ?? et.default)(),
@@ -2477,7 +2477,7 @@ function oe() {
2477
2477
  (tt.default.default ?? tt.default)()
2478
2478
  ];
2479
2479
  }
2480
- s(oe, "getCoreAnnotations");
2480
+ s(ve, "getCoreAnnotations");
2481
2481
 
2482
2482
  // src/preview-api/modules/store/args.ts
2483
2483
  var ar = require("storybook/internal/client-logger");
@@ -2546,21 +2546,21 @@ var Pe = Symbol("incompatible"), st = /* @__PURE__ */ s((r, e) => {
2546
2546
  return i();
2547
2547
  let d = a ? `${o}[${l}]` : o, u = n.map((p) => typeof p == "string" ? `'${p}'` : String(p)).join(", ");
2548
2548
  return ar.once.warn(`Received illegal value for '${d}'. Supported options: ${u}`), t;
2549
- }, {}), "validateOptions"), pe = Symbol("Deeply equal"), Ie = /* @__PURE__ */ s((r, e) => {
2549
+ }, {}), "validateOptions"), de = Symbol("Deeply equal"), Ie = /* @__PURE__ */ s((r, e) => {
2550
2550
  if (typeof r != typeof e)
2551
2551
  return e;
2552
2552
  if (Yr(r, e))
2553
- return pe;
2553
+ return de;
2554
2554
  if (Array.isArray(r) && Array.isArray(e)) {
2555
2555
  let t = e.reduce((o, n, i) => {
2556
2556
  let a = Ie(r[i], n);
2557
- return a !== pe && (o[i] = a), o;
2557
+ return a !== de && (o[i] = a), o;
2558
2558
  }, new Array(e.length));
2559
2559
  return e.length >= r.length ? t : t.concat(new Array(r.length - e.length).fill(void 0));
2560
2560
  }
2561
2561
  return _(r) && _(e) ? Object.keys({ ...r, ...e }).reduce((t, o) => {
2562
2562
  let n = Ie(r?.[o], e?.[o]);
2563
- return n === pe ? t : Object.assign(t, { [o]: n });
2563
+ return n === de ? t : Object.assign(t, { [o]: n });
2564
2564
  }, {}) : e;
2565
2565
  }, "deepDiff"), it = "UNTARGETED";
2566
2566
  function Mo({
@@ -2598,7 +2598,7 @@ var lr = class {
2598
2598
  this.initialArgsByStoryId[e.id] = e.initialArgs, this.argsByStoryId[e.id] = e.initialArgs;
2599
2599
  else if (this.initialArgsByStoryId[e.id] !== e.initialArgs) {
2600
2600
  let t = Ie(this.initialArgsByStoryId[e.id], this.argsByStoryId[e.id]);
2601
- this.initialArgsByStoryId[e.id] = e.initialArgs, this.argsByStoryId[e.id] = e.initialArgs, t !== pe && this.updateFromDelta(e, t);
2601
+ this.initialArgsByStoryId[e.id] = e.initialArgs, this.argsByStoryId[e.id] = e.initialArgs, t !== de && this.updateFromDelta(e, t);
2602
2602
  }
2603
2603
  }
2604
2604
  updateFromDelta(e, t) {
@@ -2641,7 +2641,7 @@ var dr = class {
2641
2641
  let o = this.initialGlobals && Ie(this.initialGlobals, this.globals);
2642
2642
  this.allowedGlobalNames = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
2643
2643
  let n = cr(t);
2644
- this.initialGlobals = { ...n, ...e }, this.globals = this.initialGlobals, o && o !== pe && this.updateFromPersisted(o);
2644
+ this.initialGlobals = { ...n, ...e }, this.globals = this.initialGlobals, o && o !== de && this.updateFromPersisted(o);
2645
2645
  }
2646
2646
  filterAllowedGlobals(e) {
2647
2647
  return Object.entries(e).reduce((t, [o, n]) => (this.allowedGlobalNames.has(o) ? t[o] = n : _o.logger.warn(
@@ -2657,6 +2657,8 @@ var dr = class {
2657
2657
  }
2658
2658
  update(e) {
2659
2659
  this.globals = { ...this.globals, ...this.filterAllowedGlobals(e) };
2660
+ for (let t in e)
2661
+ e[t] === void 0 && (this.globals[t] = this.initialGlobals[t]);
2660
2662
  }
2661
2663
  };
2662
2664
 
@@ -2702,7 +2704,7 @@ g" ? { type: r } : r, "normalizeControl"), ei = /* @__PURE__ */ s((r, e) => {
2702
2704
  ...n
2703
2705
  };
2704
2706
  return t && (i.type = Qs(t)), o ? i.control = Zs(o) : o === !1 && (i.control = { disable: !0 }), i;
2705
- }, "normalizeInputType"), ue = /* @__PURE__ */ s((r) => J(r, ei), "normalizeInputTypes");
2707
+ }, "normalizeInputType"), pe = /* @__PURE__ */ s((r) => J(r, ei), "normalizeInputTypes");
2706
2708
 
2707
2709
  // src/preview-api/modules/store/csf/normalizeStory.ts
2708
2710
  var ur = require("storybook/internal/client-logger"), fr = require("storybook/internal/csf"), qo = I(W(), 1);
@@ -2717,7 +2719,7 @@ CSF .story annotations deprecated; annotate story functions directly:
2717
2719
  - StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
2718
2720
  See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
2719
2721
  `;
2720
- function fe(r, e, t) {
2722
+ function ue(r, e, t) {
2721
2723
  let o = e, n = typeof e == "function" ? e : null, { story: i } = o;
2722
2724
  i && (ur.logger.debug("deprecated story", i), (0, ur.deprecate)(ri));
2723
2725
  let a = (0, fr.storyNameFromExport)(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a, c = [
@@ -2739,7 +2741,7 @@ function fe(r, e, t) {
2739
2741
  decorators: c,
2740
2742
  parameters: d,
2741
2743
  args: u,
2742
- argTypes: ue(p),
2744
+ argTypes: pe(p),
2743
2745
  loaders: y,
2744
2746
  beforeEach: h,
2745
2747
  experimental_afterEach: x,
@@ -2749,7 +2751,7 @@ function fe(r, e, t) {
2749
2751
  ...m && { play: m }
2750
2752
  };
2751
2753
  }
2752
- s(fe, "normalizeStory");
2754
+ s(ue, "normalizeStory");
2753
2755
 
2754
2756
  // src/preview-api/modules/store/csf/processCSFFile.ts
2755
2757
  var at = require("storybook/internal/client-logger"), Ge = require("storybook/internal/csf");
@@ -2762,7 +2764,7 @@ function ze(r, e = r.title, t) {
2762
2764
  id: (0, Bo.sanitize)(o || e),
2763
2765
  ...r,
2764
2766
  title: e,
2765
- ...n && { argTypes: ue(n) },
2767
+ ...n && { argTypes: pe(n) },
2766
2768
  parameters: {
2767
2769
  fileName: t,
2768
2770
  ...r.parameters
@@ -2795,7 +2797,7 @@ function zo(r, e, t) {
2795
2797
  let u = { meta: d, stories: {}, moduleExports: r };
2796
2798
  return Object.keys(i).forEach((p) => {
2797
2799
  if ((0, Ge.isExportStory)(p, d)) {
2798
- let y = fe(p, i[p].input, d);
2800
+ let y = ue(p, i[p].input, d);
2799
2801
  yr(y.parameters), u.stories[y.id] = y;
2800
2802
  }
2801
2803
  }), u.projectAnnotations = a.meta.preview.composed, u;
@@ -2809,7 +2811,7 @@ function zo(r, e, t) {
2809
2811
  let c = { meta: l, stories: {}, moduleExports: r };
2810
2812
  return Object.keys(i).forEach((d) => {
2811
2813
  if ((0, Ge.isExportStory)(d, l)) {
2812
- let u = fe(d, i[d], l);
2814
+ let u = ue(d, i[d], l);
2813
2815
  yr(u.parameters), c.stories[u.id] = u;
2814
2816
  }
2815
2817
  }), c;
@@ -2953,7 +2955,7 @@ function Oe(r, e, t) {
2953
2955
  if (!x && !w)
2954
2956
  throw new Ho.NoRenderFunctionError({ id: n });
2955
2957
  let f = /* @__PURE__ */ s((S) => async () => (await S.renderToCanvas(), S.canvas), "defaultMount"), g = r.mount ?? e.mount ?? t.mount ?? f,
2956
- E = t.testingLibraryRender;
2958
+ A = t.testingLibraryRender;
2957
2959
  return {
2958
2960
  storyGlobals: {},
2959
2961
  ...a,
@@ -2970,7 +2972,7 @@ function Oe(r, e, t) {
2970
2972
  playFunction: b,
2971
2973
  runStep: y,
2972
2974
  mount: g,
2973
- testingLibraryRender: E,
2975
+ testingLibraryRender: A,
2974
2976
  renderToCanvas: t.renderToCanvas,
2975
2977
  usesMount: w
2976
2978
  };
@@ -3169,7 +3171,7 @@ var si = /* @__PURE__ */ s((r, e, t) => {
3169
3171
  De.secondPass = !0;
3170
3172
 
3171
3173
  // src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts
3172
- function ye({
3174
+ function fe({
3173
3175
  argTypes: r,
3174
3176
  globalTypes: e,
3175
3177
  argTypesEnhancers: t,
@@ -3181,8 +3183,8 @@ function ye({
3181
3183
  ...c
3182
3184
  }) {
3183
3185
  return {
3184
- ...r && { argTypes: ue(r) },
3185
- ...e && { globalTypes: ue(e) },
3186
+ ...r && { argTypes: pe(r) },
3187
+ ...e && { globalTypes: pe(e) },
3186
3188
  decorators: P(o),
3187
3189
  loaders: P(n),
3188
3190
  beforeEach: P(i),
@@ -3211,7 +3213,7 @@ function ye({
3211
3213
  ...c
3212
3214
  };
3213
3215
  }
3214
- s(ye, "normalizeProjectAnnotations");
3216
+ s(fe, "normalizeProjectAnnotations");
3215
3217
 
3216
3218
  // src/preview-api/modules/store/csf/composeConfigs.ts
3217
3219
  var Zo = require("@storybook/global");
@@ -3245,13 +3247,13 @@ function Ve(r, e) {
3245
3247
  return r.map((t) => t.default?.[e] ?? t[e]).filter(Boolean);
3246
3248
  }
3247
3249
  s(Ve, "getField");
3248
- function ne(r, e, t = {}) {
3250
+ function oe(r, e, t = {}) {
3249
3251
  return Ve(r, e).reduce((o, n) => {
3250
3252
  let i = P(n);
3251
3253
  return t.reverseFileOrder ? [...i, ...o] : [...o, ...i];
3252
3254
  }, []);
3253
3255
  }
3254
- s(ne, "getArrayField");
3256
+ s(oe, "getArrayField");
3255
3257
  function Tr(r, e) {
3256
3258
  return Object.assign({}, ...Ve(r, e));
3257
3259
  }
@@ -3261,32 +3263,32 @@ function He(r, e) {
3261
3263
  }
3262
3264
  s(He, "getSingletonField");
3263
3265
  function Q(r) {
3264
- let e = [oe(), ...r], t = ne(e, "argTypesEnhancers"), o = Ve(e, "runStep"), n = ne(e, "beforeAll");
3266
+ let e = oe(r, "argTypesEnhancers"), t = Ve(r, "runStep"), o = oe(r, "beforeAll");
3265
3267
  return {
3266
- parameters: B(...Ve(e, "parameters")),
3267
- decorators: ne(e, "decorators", {
3268
+ parameters: B(...Ve(r, "parameters")),
3269
+ decorators: oe(r, "decorators", {
3268
3270
  reverseFileOrder: !(Zo.global.FEATURES?.legacyDecoratorFileOrder ?? !1)
3269
3271
  }),
3270
- args: Tr(e, "args"),
3271
- argsEnhancers: ne(e, "argsEnhancers"),
3272
- argTypes: Tr(e, "argTypes"),
3272
+ args: Tr(r, "args"),
3273
+ argsEnhancers: oe(r, "argsEnhancers"),
3274
+ argTypes: Tr(r, "argTypes"),
3273
3275
  argTypesEnhancers: [
3274
- ...t.filter((i) => !i.secondPass),
3275
- ...t.filter((i) => i.secondPass)
3276
+ ...e.filter((n) => !n.secondPass),
3277
+ ...e.filter((n) => n.secondPass)
3276
3278
  ],
3277
- initialGlobals: Tr(e, "initialGlobals"),
3278
- globalTypes: Tr(e, "globalTypes"),
3279
- loaders: ne(e, "loaders"),
3280
- beforeAll: Qo(n),
3281
- beforeEach: ne(e, "beforeEach"),
3282
- experimental_afterEach: ne(e, "experimental_afterEach"),
3283
- render: He(e, "render"),
3284
- renderToCanvas: He(e, "renderToCanvas"),
3285
- applyDecorators: He(e, "applyDecorators"),
3286
- runStep: Sr(o),
3287
- tags: ne(e, "tags"),
3288
- mount: He(e, "mount"),
3289
- testingLibraryRender: He(e, "testingLibraryRender")
3279
+ initialGlobals: Tr(r, "initialGlobals"),
3280
+ globalTypes: Tr(r, "globalTypes"),
3281
+ loaders: oe(r, "loaders"),
3282
+ beforeAll: Qo(o),
3283
+ beforeEach: oe(r, "beforeEach"),
3284
+ experimental_afterEach: oe(r, "experimental_afterEach"),
3285
+ render: He(r, "render"),
3286
+ renderToCanvas: He(r, "renderToCanvas"),
3287
+ applyDecorators: He(r, "applyDecorators"),
3288
+ runStep: Sr(t),
3289
+ tags: oe(r, "tags"),
3290
+ mount: He(r, "mount"),
3291
+ testingLibraryRender: He(r, "testingLibraryRender")
3290
3292
  };
3291
3293
  }
3292
3294
  s(Q, "composeConfigs");
@@ -3295,7 +3297,7 @@ s(Q, "composeConfigs");
3295
3297
  var rn = require("storybook/internal/csf"), tn = require("storybook/internal/preview-errors"), on = I(W(), 1);
3296
3298
 
3297
3299
  // src/preview-api/modules/store/reporter-api.ts
3298
- var se = class {
3300
+ var ne = class {
3299
3301
  constructor() {
3300
3302
  this.reports = [];
3301
3303
  }
@@ -3331,23 +3333,23 @@ s(li, "extractAnnotation");
3331
3333
  function sn(r) {
3332
3334
  let e = Array.isArray(r) ? r : [r];
3333
3335
  return globalThis.globalProjectAnnotations = Q([
3336
+ ...ve(),
3334
3337
  globalThis.defaultProjectAnnotations ?? {},
3335
3338
  Q(e.map(li))
3336
3339
  ]), globalThis.globalProjectAnnotations ?? {};
3337
3340
  }
3338
3341
  s(sn, "setProjectAnnotations");
3339
- var ie = [];
3342
+ var se = [];
3340
3343
  function ut(r, e, t, o, n) {
3341
3344
  if (r === void 0)
3342
3345
  throw new Error("Expected a story but received undefined.");
3343
3346
  e.title = e.title ?? ii;
3344
- let i = ze(e), a = n || r.storyName || r.story?.name || r.name || ai, l = fe(
3347
+ let i = ze(e), a = n || r.storyName || r.story?.name || r.name || ai, l = ue(
3345
3348
  a,
3346
3349
  r,
3347
3350
  i
3348
- ), c = ye(
3351
+ ), c = fe(
3349
3352
  Q([
3350
- ...oe(),
3351
3353
  o ?? globalThis.globalProjectAnnotations ?? {},
3352
3354
  t ?? {}
3353
3355
  ])
@@ -3359,7 +3361,7 @@ function ut(r, e, t, o, n) {
3359
3361
  ...cr(c.globalTypes),
3360
3362
  ...c.initialGlobals,
3361
3363
  ...d.storyGlobals
3362
- }, y = new se(), h = /* @__PURE__ */ s(() => {
3364
+ }, y = new ne(), h = /* @__PURE__ */ s(() => {
3363
3365
  let f = br({
3364
3366
  hooks: new re(),
3365
3367
  globals: p,
@@ -3368,7 +3370,7 @@ function ut(r, e, t, o, n) {
3368
3370
  reporting: y,
3369
3371
  loaded: {},
3370
3372
  abortSignal: new AbortController().signal,
3371
- step: /* @__PURE__ */ s((g, E) => d.runStep(g, E, f), "step"),
3373
+ step: /* @__PURE__ */ s((g, A) => d.runStep(g, A, f), "step"),
3372
3374
  canvasElement: null,
3373
3375
  canvas: {},
3374
3376
  userEvent: {},
@@ -3387,12 +3389,12 @@ function ut(r, e, t, o, n) {
3387
3389
  tags: d.tags,
3388
3390
  showMain: /* @__PURE__ */ s(() => {
3389
3391
  }, "showMain"),
3390
- showError: /* @__PURE__ */ s((E) => {
3391
- throw new Error(`${E.title}
3392
- ${E.description}`);
3392
+ showError: /* @__PURE__ */ s((A) => {
3393
+ throw new Error(`${A.title}
3394
+ ${A.description}`);
3393
3395
  }, "showError"),
3394
- showException: /* @__PURE__ */ s((E) => {
3395
- throw E;
3396
+ showException: /* @__PURE__ */ s((A) => {
3397
+ throw A;
3396
3398
  }, "showException"),
3397
3399
  forceRemount: !0,
3398
3400
  storyContext: f,
@@ -3401,7 +3403,7 @@ ${E.description}`);
3401
3403
  },
3402
3404
  f.canvasElement
3403
3405
  );
3404
- g && ie.push(g);
3406
+ g && se.push(g);
3405
3407
  }), f.mount = d.mount(f), f;
3406
3408
  }, "initializeContext"), x, R = /* @__PURE__ */ s(async (f) => {
3407
3409
  let g = h();
@@ -3412,21 +3414,21 @@ ${E.description}`);
3412
3414
  }, "run"), b = d.playFunction ? R : void 0;
3413
3415
  return Object.assign(
3414
3416
  /* @__PURE__ */ s(function(g) {
3415
- let E = h();
3416
- return x && (E.loaded = x.loaded), E.args = {
3417
- ...E.initialArgs,
3417
+ let A = h();
3418
+ return x && (A.loaded = x.loaded), A.args = {
3419
+ ...A.initialArgs,
3418
3420
  ...g
3419
- }, d.unboundStoryFn(E);
3421
+ }, d.unboundStoryFn(A);
3420
3422
  }, "storyFn"),
3421
3423
  {
3422
3424
  id: d.id,
3423
3425
  storyName: a,
3424
3426
  load: /* @__PURE__ */ s(async () => {
3425
- for (let g of [...ie].reverse())
3427
+ for (let g of [...se].reverse())
3426
3428
  await g();
3427
- ie.length = 0;
3429
+ se.length = 0;
3428
3430
  let f = h();
3429
- f.loaded = await d.applyLoaders(f), ie.push(...(await d.applyBeforeEach(f)).filter(Boolean)), x = f;
3431
+ f.loaded = await d.applyLoaders(f), se.push(...(await d.applyBeforeEach(f)).filter(Boolean)), x = f;
3430
3432
  }, "load"),
3431
3433
  globals: p,
3432
3434
  args: d.initialArgs,
@@ -3486,17 +3488,17 @@ function ln(r) {
3486
3488
  }
3487
3489
  s(ln, "createPlaywrightTest");
3488
3490
  async function di(r, e) {
3489
- for (let n of [...ie].reverse())
3491
+ for (let n of [...se].reverse())
3490
3492
  await n();
3491
- if (ie.length = 0, !e.canvasElement) {
3493
+ if (se.length = 0, !e.canvasElement) {
3492
3494
  let n = document.createElement("div");
3493
- globalThis?.document?.body?.appendChild(n), e.canvasElement = n, ie.push(() => {
3495
+ globalThis?.document?.body?.appendChild(n), e.canvasElement = n, se.push(() => {
3494
3496
  globalThis?.document?.body?.contains(n) && globalThis?.document?.body?.removeChild(n);
3495
3497
  });
3496
3498
  }
3497
3499
  if (e.loaded = await r.applyLoaders(e), e.abortSignal.aborted)
3498
3500
  return;
3499
- ie.push(...(await r.applyBeforeEach(e)).filter(Boolean));
3501
+ se.push(...(await r.applyBeforeEach(e)).filter(Boolean));
3500
3502
  let t = r.playFunction, o = r.usesMount;
3501
3503
  o || await e.mount(), !e.abortSignal.aborted && (t && (o || (e.mount = async () => {
3502
3504
  throw new tn.MountMustBeDestructuredError({ playFunction: t.toString() });
@@ -3505,11 +3507,11 @@ async function di(r, e) {
3505
3507
  s(di, "runStory");
3506
3508
 
3507
3509
  // src/preview-api/modules/store/StoryStore.ts
3508
- var cn = 1e3, pi = 1e4, me = class {
3510
+ var cn = 1e3, pi = 1e4, ye = class {
3509
3511
  constructor(e, t, o) {
3510
3512
  this.importFn = t;
3511
- this.storyIndex = new pr(e), this.projectAnnotations = ye(
3512
- Q([...oe(), o])
3513
+ this.storyIndex = new pr(e), this.projectAnnotations = fe(
3514
+ Q([...ve(), o])
3513
3515
  );
3514
3516
  let { initialGlobals: n, globalTypes: i } = this.projectAnnotations;
3515
3517
  this.args = new lr(), this.userGlobals = new dr({ globals: n, globalTypes: i }), this.hooks = {}, this.cleanupCallbacks = {}, this.processCSFFileWithCache =
@@ -3519,7 +3521,7 @@ var cn = 1e3, pi = 1e4, me = class {
3519
3521
  s(this, "StoryStore");
3520
3522
  }
3521
3523
  setProjectAnnotations(e) {
3522
- this.projectAnnotations = ye(e);
3524
+ this.projectAnnotations = fe(e);
3523
3525
  let { initialGlobals: t, globalTypes: o } = e;
3524
3526
  this.userGlobals.set({ globals: t, globalTypes: o });
3525
3527
  }
@@ -3607,7 +3609,7 @@ var cn = 1e3, pi = 1e4, me = class {
3607
3609
  // A prepared story does not include args, globals or hooks. These are stored in the story store
3608
3610
  // and updated separtely to the (immutable) story.
3609
3611
  getStoryContext(e, { forceInitialArgs: t = !1 } = {}) {
3610
- let o = this.userGlobals.get(), { initialGlobals: n } = this.userGlobals, i = new se();
3612
+ let o = this.userGlobals.get(), { initialGlobals: n } = this.userGlobals, i = new ne();
3611
3613
  return br({
3612
3614
  ...e,
3613
3615
  args: t ? e.initialArgs : this.args.get(e.id),
@@ -3771,10 +3773,10 @@ var We = require("storybook/internal/client-logger"), F = require("storybook/int
3771
3773
  Tn = require("@storybook/global");
3772
3774
 
3773
3775
  // src/preview-api/modules/preview-web/render/StoryRender.ts
3774
- var z = require("storybook/internal/core-events"), Er = require("storybook/internal/preview-errors");
3776
+ var z = require("storybook/internal/core-events"), Ar = require("storybook/internal/preview-errors");
3775
3777
 
3776
3778
  // src/preview-api/modules/preview-web/render/Render.ts
3777
- var ae = new Error("prepareAborted");
3779
+ var ie = new Error("prepareAborted");
3778
3780
 
3779
3781
  // src/preview-api/modules/preview-web/render/StoryRender.ts
3780
3782
  var { AbortController: bn } = globalThis;
@@ -3787,7 +3789,7 @@ function Sn(r) {
3787
3789
  }
3788
3790
  }
3789
3791
  s(Sn, "serializeError");
3790
- var he = class {
3792
+ var me = class {
3791
3793
  constructor(e, t, o, n, i, a, l = { autoplay: !0, forceInitialArgs: !1 }, c) {
3792
3794
  this.channel = e;
3793
3795
  this.store = t;
@@ -3820,7 +3822,7 @@ var he = class {
3820
3822
  if (await this.runPhase(this.abortController.signal, "preparing", async () => {
3821
3823
  this.story = await this.store.loadStory({ storyId: this.id });
3822
3824
  }), this.abortController.signal.aborted)
3823
- throw await this.store.cleanupStory(this.story), ae;
3825
+ throw await this.store.cleanupStory(this.story), ie;
3824
3826
  }
3825
3827
  // The two story "renders" are equal and have both loaded the same story
3826
3828
  isEqual(e) {
@@ -3918,8 +3920,8 @@ var he = class {
3918
3920
  f.loaded = await u(f);
3919
3921
  }), m.aborted)
3920
3922
  return;
3921
- let E = await p(f);
3922
- if (this.store.addCleanupCallbacks(n, E), this.checkIfAborted(m) || (!b && !w && await f.mount(), this.notYetRendered = !1, m.aborted))
3923
+ let A = await p(f);
3924
+ if (this.store.addCleanupCallbacks(n, A), this.checkIfAborted(m) || (!b && !w && await f.mount(), this.notYetRendered = !1, m.aborted))
3923
3925
  return;
3924
3926
  let S = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, C = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ s((v) => C.
3925
3927
  add("error" in v ? v.error : v.reason), "onError");
@@ -3927,9 +3929,9 @@ var he = class {
3927
3929
  window.addEventListener("error", D), window.addEventListener("unhandledrejection", D), this.disableKeyListeners = !0;
3928
3930
  try {
3929
3931
  if (w ? await x(f) : (f.mount = async () => {
3930
- throw new Er.MountMustBeDestructuredError({ playFunction: x.toString() });
3932
+ throw new Ar.MountMustBeDestructuredError({ playFunction: x.toString() });
3931
3933
  }, await this.runPhase(m, "playing", async () => x(f))), !b)
3932
- throw new Er.NoStoryMountedError();
3934
+ throw new Ar.NoStoryMountedError();
3933
3935
  this.checkIfAborted(m), !S && C.size > 0 ? await this.runPhase(m, "errored") : await this.runPhase(m, "played");
3934
3936
  } catch (v) {
3935
3937
  if (this.callbacks.showStoryDuringRender?.(), await this.runPhase(m, "errored", async () => {
@@ -4014,7 +4016,7 @@ var he = class {
4014
4016
  };
4015
4017
 
4016
4018
  // src/preview-api/modules/preview-web/Preview.tsx
4017
- var { fetch: yi } = Tn.global, mi = "./index.json", ge = class {
4019
+ var { fetch: yi } = Tn.global, mi = "./index.json", he = class {
4018
4020
  constructor(e, t, o = q.getChannel(), n = !0) {
4019
4021
  this.importFn = e;
4020
4022
  this.getProjectAnnotations = t;
@@ -4100,7 +4102,7 @@ var { fetch: yi } = Tn.global, mi = "./index.json", ge = class {
4100
4102
  initializeWithStoryIndex(e) {
4101
4103
  if (!this.projectAnnotationsBeforeInitialization)
4102
4104
  throw new Error("Cannot call initializeWithStoryIndex until project annotations resolve");
4103
- this.storyStoreValue = new me(
4105
+ this.storyStoreValue = new ye(
4104
4106
  e,
4105
4107
  this.importFn,
4106
4108
  this.projectAnnotationsBeforeInitialization
@@ -4241,7 +4243,7 @@ var { fetch: yi } = Tn.global, mi = "./index.json", ge = class {
4241
4243
  throw new j.CalledPreviewMethodBeforeInitializationError({
4242
4244
  methodName: "renderStoryToElement"
4243
4245
  });
4244
- let i = new he(
4246
+ let i = new me(
4245
4247
  this.channel,
4246
4248
  this.storyStoreValue,
4247
4249
  this.renderToCanvas,
@@ -4286,11 +4288,11 @@ var { fetch: yi } = Tn.global, mi = "./index.json", ge = class {
4286
4288
  var Fs = require("@storybook/global");
4287
4289
 
4288
4290
  // src/preview-api/modules/preview-web/PreviewWithSelection.tsx
4289
- var Ke = require("storybook/internal/client-logger"), A = require("storybook/internal/core-events"), $ = require("storybook/internal/preview-errors");
4291
+ var Ke = require("storybook/internal/client-logger"), E = require("storybook/internal/core-events"), $ = require("storybook/internal/preview-errors");
4290
4292
 
4291
4293
  // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
4292
4294
  var hi = process.env.NODE_ENV === "production", mt = "Invariant failed";
4293
- function Ar(r, e) {
4295
+ function Er(r, e) {
4294
4296
  if (!r) {
4295
4297
  if (hi)
4296
4298
  throw new Error(mt);
@@ -4298,7 +4300,7 @@ function Ar(r, e) {
4298
4300
  throw new Error(o);
4299
4301
  }
4300
4302
  }
4301
- s(Ar, "invariant");
4303
+ s(Er, "invariant");
4302
4304
 
4303
4305
  // src/preview-api/modules/preview-web/render/CsfDocsRender.ts
4304
4306
  var wn = require("storybook/internal/core-events");
@@ -4471,7 +4473,7 @@ var $e = class {
4471
4473
  this.preparing = !0;
4472
4474
  let { entryExports: e, csfFiles: t = [] } = await this.store.loadEntry(this.id);
4473
4475
  if (this.torndown)
4474
- throw ae;
4476
+ throw ie;
4475
4477
  let { importPath: o, title: n } = this.entry, i = this.store.processCSFFileWithCache(
4476
4478
  e,
4477
4479
  o,
@@ -4518,7 +4520,7 @@ var $e = class {
4518
4520
  };
4519
4521
 
4520
4522
  // src/preview-api/modules/preview-web/render/MdxDocsRender.ts
4521
- var En = require("storybook/internal/core-events");
4523
+ var An = require("storybook/internal/core-events");
4522
4524
  var Ye = class {
4523
4525
  constructor(e, t, o, n) {
4524
4526
  this.channel = e;
@@ -4542,7 +4544,7 @@ var Ye = class {
4542
4544
  this.preparing = !0;
4543
4545
  let { entryExports: e, csfFiles: t = [] } = await this.store.loadEntry(this.id);
4544
4546
  if (this.torndown)
4545
- throw ae;
4547
+ throw ie;
4546
4548
  this.csfFiles = t, this.exports = e, this.preparing = !1;
4547
4549
  }
4548
4550
  isEqual(e) {
@@ -4568,7 +4570,7 @@ var Ye = class {
4568
4570
  );
4569
4571
  let i = { ...n, page: this.exports.default }, a = await n.renderer(), { render: l } = a, c = /* @__PURE__ */ s(async () => {
4570
4572
  try {
4571
- await l(o, i, e), this.channel.emit(En.DOCS_RENDERED, this.id);
4573
+ await l(o, i, e), this.channel.emit(An.DOCS_RENDERED, this.id);
4572
4574
  } catch (d) {
4573
4575
  this.callbacks.showException(d);
4574
4576
  }
@@ -4589,9 +4591,9 @@ function bi(r) {
4589
4591
  return /input|textarea/i.test(e.tagName) || e.getAttribute("contenteditable") !== null;
4590
4592
  }
4591
4593
  s(bi, "focusInInput");
4592
- var An = "attached-mdx", Si = "unattached-mdx";
4594
+ var En = "attached-mdx", Si = "unattached-mdx";
4593
4595
  function Ti({ tags: r }) {
4594
- return r?.includes(Si) || r?.includes(An);
4596
+ return r?.includes(Si) || r?.includes(En);
4595
4597
  }
4596
4598
  s(Ti, "isMdxEntry");
4597
4599
  function ht(r) {
@@ -4606,7 +4608,7 @@ function Ri(r) {
4606
4608
  return xi(r) && r.subtype === "csf";
4607
4609
  }
4608
4610
  s(Ri, "isCsfDocsRender");
4609
- var be = class extends ge {
4611
+ var ge = class extends he {
4610
4612
  constructor(t, o, n, i) {
4611
4613
  super(t, o, void 0, !1);
4612
4614
  this.importFn = t;
@@ -4619,8 +4621,8 @@ var be = class extends ge {
4619
4621
  s(this, "PreviewWithSelection");
4620
4622
  }
4621
4623
  setupListeners() {
4622
- super.setupListeners(), gi.onkeydown = this.onKeydown.bind(this), this.channel.on(A.SET_CURRENT_STORY, this.onSetCurrentStory.bind(this)),
4623
- this.channel.on(A.UPDATE_QUERY_PARAMS, this.onUpdateQueryParams.bind(this)), this.channel.on(A.PRELOAD_ENTRIES, this.onPreloadStories.bind(
4624
+ super.setupListeners(), gi.onkeydown = this.onKeydown.bind(this), this.channel.on(E.SET_CURRENT_STORY, this.onSetCurrentStory.bind(this)),
4625
+ this.channel.on(E.UPDATE_QUERY_PARAMS, this.onUpdateQueryParams.bind(this)), this.channel.on(E.PRELOAD_ENTRIES, this.onPreloadStories.bind(
4624
4626
  this));
4625
4627
  }
4626
4628
  async setInitialGlobals() {
@@ -4656,8 +4658,8 @@ var be = class extends ge {
4656
4658
  return;
4657
4659
  }
4658
4660
  let { id: i, type: a } = n;
4659
- this.selectionStore.setSelection({ storyId: i, viewMode: a }), this.channel.emit(A.STORY_SPECIFIED, this.selectionStore.selection), this.
4660
- channel.emit(A.CURRENT_STORY_WAS_SET, this.selectionStore.selection), await this.renderSelection({ persistedArgs: o });
4661
+ this.selectionStore.setSelection({ storyId: i, viewMode: a }), this.channel.emit(E.STORY_SPECIFIED, this.selectionStore.selection), this.
4662
+ channel.emit(E.CURRENT_STORY_WAS_SET, this.selectionStore.selection), await this.renderSelection({ persistedArgs: o });
4661
4663
  }
4662
4664
  // EVENT HANDLERS
4663
4665
  // This happens when a config file gets reloaded
@@ -4677,20 +4679,20 @@ var be = class extends ge {
4677
4679
  onKeydown(t) {
4678
4680
  if (!this.storyRenders.find((o) => o.disableKeyListeners) && !bi(t)) {
4679
4681
  let { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d } = t;
4680
- this.channel.emit(A.PREVIEW_KEYDOWN, {
4682
+ this.channel.emit(E.PREVIEW_KEYDOWN, {
4681
4683
  event: { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d }
4682
4684
  });
4683
4685
  }
4684
4686
  }
4685
4687
  async onSetCurrentStory(t) {
4686
- this.selectionStore.setSelection({ viewMode: "story", ...t }), await this.storeInitializationPromise, this.channel.emit(A.CURRENT_STORY_WAS_SET,
4688
+ this.selectionStore.setSelection({ viewMode: "story", ...t }), await this.storeInitializationPromise, this.channel.emit(E.CURRENT_STORY_WAS_SET,
4687
4689
  this.selectionStore.selection), this.renderSelection();
4688
4690
  }
4689
4691
  onUpdateQueryParams(t) {
4690
4692
  this.selectionStore.setQueryParams(t);
4691
4693
  }
4692
4694
  async onUpdateGlobals({ globals: t }) {
4693
- let o = this.currentRender instanceof he && this.currentRender.story || void 0;
4695
+ let o = this.currentRender instanceof me && this.currentRender.story || void 0;
4694
4696
  super.onUpdateGlobals({ globals: t, currentStory: o }), (this.currentRender instanceof Ye || this.currentRender instanceof $e) && await this.
4695
4697
  currentRender.rerender?.();
4696
4698
  }
@@ -4724,7 +4726,7 @@ var be = class extends ge {
4724
4726
  a.type === "story" ? this.view.showPreparingStory({ immediate: c }) : this.view.showPreparingDocs({ immediate: c }), this.currentRender?.
4725
4727
  isPreparing() && await this.teardownRender(this.currentRender);
4726
4728
  let d;
4727
- a.type === "story" ? d = new he(
4729
+ a.type === "story" ? d = new me(
4728
4730
  this.channel,
4729
4731
  this.storyStoreValue,
4730
4732
  o,
@@ -4749,16 +4751,16 @@ var be = class extends ge {
4749
4751
  try {
4750
4752
  await d.prepare();
4751
4753
  } catch (h) {
4752
- p && await this.teardownRender(p), h !== ae && this.renderStoryLoadingException(i, h);
4754
+ p && await this.teardownRender(p), h !== ie && this.renderStoryLoadingException(i, h);
4753
4755
  return;
4754
4756
  }
4755
4757
  let y = !l && p && !d.isEqual(p);
4756
- if (t && ht(d) && (Ar(!!d.story), this.storyStoreValue.args.updateFromPersisted(d.story, t)), p && !p.torndown && !l && !y && !c) {
4757
- this.currentRender = p, this.channel.emit(A.STORY_UNCHANGED, i), this.view.showMain();
4758
+ if (t && ht(d) && (Er(!!d.story), this.storyStoreValue.args.updateFromPersisted(d.story, t)), p && !p.torndown && !l && !y && !c) {
4759
+ this.currentRender = p, this.channel.emit(E.STORY_UNCHANGED, i), this.view.showMain();
4758
4760
  return;
4759
4761
  }
4760
- if (p && await this.teardownRender(p, { viewModeChanged: c }), u && (l || c) && this.channel.emit(A.STORY_CHANGED, i), ht(d)) {
4761
- Ar(!!d.story);
4762
+ if (p && await this.teardownRender(p, { viewModeChanged: c }), u && (l || c) && this.channel.emit(E.STORY_CHANGED, i), ht(d)) {
4763
+ Er(!!d.story);
4762
4764
  let {
4763
4765
  parameters: h,
4764
4766
  initialArgs: x,
@@ -4769,33 +4771,33 @@ var be = class extends ge {
4769
4771
  storyGlobals: f,
4770
4772
  globals: g
4771
4773
  } = this.storyStoreValue.getStoryContext(d.story);
4772
- this.channel.emit(A.STORY_PREPARED, {
4774
+ this.channel.emit(E.STORY_PREPARED, {
4773
4775
  id: i,
4774
4776
  parameters: h,
4775
4777
  initialArgs: x,
4776
4778
  argTypes: R,
4777
4779
  args: m
4778
- }), this.channel.emit(A.GLOBALS_UPDATED, { userGlobals: w, storyGlobals: f, globals: g, initialGlobals: b });
4780
+ }), this.channel.emit(E.GLOBALS_UPDATED, { userGlobals: w, storyGlobals: f, globals: g, initialGlobals: b });
4779
4781
  } else {
4780
4782
  let { parameters: h } = this.storyStoreValue.projectAnnotations, { initialGlobals: x, globals: R } = this.storyStoreValue.userGlobals;
4781
- if (this.channel.emit(A.GLOBALS_UPDATED, {
4783
+ if (this.channel.emit(E.GLOBALS_UPDATED, {
4782
4784
  globals: R,
4783
4785
  initialGlobals: x,
4784
4786
  storyGlobals: {},
4785
4787
  userGlobals: R
4786
- }), Ri(d) || d.entry.tags?.includes(An)) {
4788
+ }), Ri(d) || d.entry.tags?.includes(En)) {
4787
4789
  if (!d.csfFiles)
4788
4790
  throw new $.MdxFileWithNoCsfReferencesError({ storyId: i });
4789
4791
  ({ parameters: h } = this.storyStoreValue.preparedMetaFromCSFFile({
4790
4792
  csfFile: d.csfFiles[0]
4791
4793
  }));
4792
4794
  }
4793
- this.channel.emit(A.DOCS_PREPARED, {
4795
+ this.channel.emit(E.DOCS_PREPARED, {
4794
4796
  id: i,
4795
4797
  parameters: h
4796
4798
  });
4797
4799
  }
4798
- ht(d) ? (Ar(!!d.story), this.storyRenders.push(d), this.currentRender.renderToElement(
4800
+ ht(d) ? (Er(!!d.story), this.storyRenders.push(d), this.currentRender.renderToElement(
4799
4801
  this.view.prepareForStory(d.story)
4800
4802
  )) : this.currentRender.renderToElement(
4801
4803
  this.view.prepareForDocs(),
@@ -4819,22 +4821,22 @@ var be = class extends ge {
4819
4821
  super.renderPreviewEntryError(t, o), this.view.showErrorDisplay(o);
4820
4822
  }
4821
4823
  renderMissingStory() {
4822
- this.view.showNoPreview(), this.channel.emit(A.STORY_MISSING);
4824
+ this.view.showNoPreview(), this.channel.emit(E.STORY_MISSING);
4823
4825
  }
4824
4826
  renderStoryLoadingException(t, o) {
4825
- Ke.logger.error(o), this.view.showErrorDisplay(o), this.channel.emit(A.STORY_MISSING, t);
4827
+ Ke.logger.error(o), this.view.showErrorDisplay(o), this.channel.emit(E.STORY_MISSING, t);
4826
4828
  }
4827
4829
  // renderException is used if we fail to render the story and it is uncaught by the app layer
4828
4830
  renderException(t, o) {
4829
4831
  let { name: n = "Error", message: i = String(o), stack: a } = o;
4830
- this.channel.emit(A.STORY_THREW_EXCEPTION, { name: n, message: i, stack: a }), this.channel.emit(A.STORY_RENDER_PHASE_CHANGED, { newPhase: "\
4832
+ this.channel.emit(E.STORY_THREW_EXCEPTION, { name: n, message: i, stack: a }), this.channel.emit(E.STORY_RENDER_PHASE_CHANGED, { newPhase: "\
4831
4833
  errored", storyId: t }), this.view.showErrorDisplay(o), Ke.logger.error(`Error rendering story '${t}':`), Ke.logger.error(o);
4832
4834
  }
4833
4835
  // renderError is used by the various app layers to inform the user they have done something
4834
4836
  // wrong -- for instance returned the wrong thing from a story
4835
4837
  renderError(t, { title: o, description: n }) {
4836
- Ke.logger.error(`Error rendering story ${o}: ${n}`), this.channel.emit(A.STORY_ERRORED, { title: o, description: n }), this.channel.emit(
4837
- A.STORY_RENDER_PHASE_CHANGED, { newPhase: "errored", storyId: t }), this.view.showErrorDisplay({
4838
+ Ke.logger.error(`Error rendering story ${o}: ${n}`), this.channel.emit(E.STORY_ERRORED, { title: o, description: n }), this.channel.emit(
4839
+ E.STORY_RENDER_PHASE_CHANGED, { newPhase: "errored", storyId: t }), this.view.showErrorDisplay({
4838
4840
  message: o,
4839
4841
  stack: n
4840
4842
  });
@@ -4880,7 +4882,7 @@ r, t)) : _(e) ? Object.entries(e).every(([t, o]) => wt(t, o)) : !1, "validateArg
4880
4882
  }
4881
4883
  return zn.test(r) ? Number(r) : r;
4882
4884
  }
4883
- }, Et = /* @__PURE__ */ s((r) => {
4885
+ }, At = /* @__PURE__ */ s((r) => {
4884
4886
  let e = r.split(";").map((t) => t.replace("=", "~").replace(":", "="));
4885
4887
  return Object.entries((0, qn.parse)(e.join(";"), Ki)).reduce((t, [o, n]) => wt(o, n) ? Object.assign(t, { [o]: n }) : (Nn.once.warn(Bn.dedent`
4886
4888
  Omitted potentially unsafe URL args.
@@ -4890,7 +4892,7 @@ r, t)) : _(e) ? Object.entries(e).every(([t, o]) => wt(t, o)) : !1, "validateArg
4890
4892
  }, "parseArgsParam");
4891
4893
 
4892
4894
  // src/preview-api/modules/preview-web/UrlStore.ts
4893
- var { history: Hn, document: le } = Un.global;
4895
+ var { history: Hn, document: ae } = Un.global;
4894
4896
  function Xi(r) {
4895
4897
  let e = (r || "").match(/^\/story\/(.+)/);
4896
4898
  if (!e)
@@ -4902,7 +4904,7 @@ var Vn = /* @__PURE__ */ s(({
4902
4904
  selection: r,
4903
4905
  extraParams: e
4904
4906
  }) => {
4905
- let t = le?.location.search.slice(1), { path: o, selectedKind: n, selectedStory: i, ...a } = (0, Je.parse)(t);
4907
+ let t = ae?.location.search.slice(1), { path: o, selectedKind: n, selectedStory: i, ...a } = (0, Je.parse)(t);
4906
4908
  return `?${(0, Je.stringify)({
4907
4909
  ...a,
4908
4910
  ...e,
@@ -4911,8 +4913,8 @@ var Vn = /* @__PURE__ */ s(({
4911
4913
  }, "getQueryString"), Ji = /* @__PURE__ */ s((r) => {
4912
4914
  if (!r)
4913
4915
  return;
4914
- let e = Vn({ selection: r }), { hash: t = "" } = le.location;
4915
- le.title = r.storyId, Hn.replaceState({}, "", `${le.location.pathname}${e}${t}`);
4916
+ let e = Vn({ selection: r }), { hash: t = "" } = ae.location;
4917
+ ae.title = r.storyId, Hn.replaceState({}, "", `${ae.location.pathname}${e}${t}`);
4916
4918
  }, "setPath"), Qi = /* @__PURE__ */ s((r) => r != null && typeof r == "object" && Array.isArray(r) === !1, "isObject"), Xe = /* @__PURE__ */ s(
4917
4919
  (r) => {
4918
4920
  if (r !== void 0) {
@@ -4926,16 +4928,16 @@ var Vn = /* @__PURE__ */ s(({
4926
4928
  );
4927
4929
  }
4928
4930
  }, "getFirstString"), Zi = /* @__PURE__ */ s(() => {
4929
- if (typeof le < "u") {
4930
- let r = le.location.search.slice(1), e = (0, Je.parse)(r), t = typeof e.args == "string" ? Et(e.args) : void 0, o = typeof e.globals == "\
4931
- string" ? Et(e.globals) : void 0, n = Xe(e.viewMode);
4931
+ if (typeof ae < "u") {
4932
+ let r = ae.location.search.slice(1), e = (0, Je.parse)(r), t = typeof e.args == "string" ? At(e.args) : void 0, o = typeof e.globals == "\
4933
+ string" ? At(e.globals) : void 0, n = Xe(e.viewMode);
4932
4934
  (typeof n != "string" || !n.match(/docs|story/)) && (n = "story");
4933
4935
  let i = Xe(e.path), a = i ? Xi(i) : Xe(e.id);
4934
4936
  if (a)
4935
4937
  return { storySpecifier: a, args: t, globals: o, viewMode: n };
4936
4938
  }
4937
4939
  return null;
4938
- }, "getSelectionSpecifierFromPath"), xe = class {
4940
+ }, "getSelectionSpecifierFromPath"), Te = class {
4939
4941
  static {
4940
4942
  s(this, "UrlStore");
4941
4943
  }
@@ -4946,14 +4948,14 @@ string" ? Et(e.globals) : void 0, n = Xe(e.viewMode);
4946
4948
  this.selection = e, Ji(this.selection);
4947
4949
  }
4948
4950
  setQueryParams(e) {
4949
- let t = Vn({ extraParams: e }), { hash: o = "" } = le.location;
4950
- Hn.replaceState({}, "", `${le.location.pathname}${t}${o}`);
4951
+ let t = Vn({ extraParams: e }), { hash: o = "" } = ae.location;
4952
+ Hn.replaceState({}, "", `${ae.location.pathname}${t}${o}`);
4951
4953
  }
4952
4954
  };
4953
4955
 
4954
4956
  // src/preview-api/modules/preview-web/WebView.ts
4955
- var ws = require("storybook/internal/client-logger"), Es = require("@storybook/global"), As = I(Ts(), 1), Cs = I(Ir(), 1), vs = I(W(), 1);
4956
- var { document: M } = Es.global, xs = 100, Ps = /* @__PURE__ */ ((i) => (i.MAIN = "MAIN", i.NOPREVIEW = "NOPREVIEW", i.PREPARING_STORY = "PR\
4957
+ var ws = require("storybook/internal/client-logger"), As = require("@storybook/global"), Es = I(Ts(), 1), Cs = I(Ir(), 1), vs = I(W(), 1);
4958
+ var { document: M } = As.global, xs = 100, Ps = /* @__PURE__ */ ((i) => (i.MAIN = "MAIN", i.NOPREVIEW = "NOPREVIEW", i.PREPARING_STORY = "PR\
4957
4959
  EPARING_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Ps || {}), Ot = {
4958
4960
  PREPARING_STORY: "sb-show-preparing-story",
4959
4961
  PREPARING_DOCS: "sb-show-preparing-docs",
@@ -4964,9 +4966,9 @@ EPARING_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Ps |
4964
4966
  centered: "sb-main-centered",
4965
4967
  fullscreen: "sb-main-fullscreen",
4966
4968
  padded: "sb-main-padded"
4967
- }, Rs = new As.default({
4969
+ }, Rs = new Es.default({
4968
4970
  escapeXML: !0
4969
- }), we = class {
4971
+ }), Re = class {
4970
4972
  constructor() {
4971
4973
  this.testing = !1;
4972
4974
  if (typeof M < "u") {
@@ -5060,9 +5062,9 @@ RING_DOCS"), xs);
5060
5062
  };
5061
5063
 
5062
5064
  // src/preview-api/modules/preview-web/PreviewWeb.tsx
5063
- var Ze = class extends be {
5065
+ var Ze = class extends ge {
5064
5066
  constructor(t, o) {
5065
- super(t, o, new xe(), new we());
5067
+ super(t, o, new Te(), new Re());
5066
5068
  this.importFn = t;
5067
5069
  this.getProjectAnnotations = o;
5068
5070
  Fs.global.__STORYBOOK_PREVIEW__ = this;
@@ -5074,7 +5076,7 @@ var Ze = class extends be {
5074
5076
 
5075
5077
  // src/preview-api/modules/preview-web/simulate-pageload.ts
5076
5078
  var Os = require("@storybook/global");
5077
- var { document: Ee } = Os.global, ja = [
5079
+ var { document: we } = Os.global, ja = [
5078
5080
  "application/javascript",
5079
5081
  "application/ecmascript",
5080
5082
  "application/x-ecmascript",
@@ -5095,14 +5097,14 @@ var { document: Ee } = Os.global, ja = [
5095
5097
  "module"
5096
5098
  ], Ma = "script", Is = "scripts-root";
5097
5099
  function er() {
5098
- let r = Ee.createEvent("Event");
5099
- r.initEvent("DOMContentLoaded", !0, !0), Ee.dispatchEvent(r);
5100
+ let r = we.createEvent("Event");
5101
+ r.initEvent("DOMContentLoaded", !0, !0), we.dispatchEvent(r);
5100
5102
  }
5101
5103
  s(er, "simulateDOMContentLoaded");
5102
5104
  function _a(r, e, t) {
5103
- let o = Ee.createElement("script");
5105
+ let o = we.createElement("script");
5104
5106
  o.type = r.type === "module" ? "module" : "text/javascript", r.src ? (o.onload = e, o.onerror = e, o.src = r.src) : o.textContent = r.innerText,
5105
- t ? t.appendChild(o) : Ee.head.appendChild(o), r.parentNode.removeChild(r), r.src || e();
5107
+ t ? t.appendChild(o) : we.head.appendChild(o), r.parentNode.removeChild(r), r.src || e();
5106
5108
  }
5107
5109
  s(_a, "insertScript");
5108
5110
  function Ds(r, e, t = 0) {
@@ -5112,8 +5114,8 @@ function Ds(r, e, t = 0) {
5112
5114
  }
5113
5115
  s(Ds, "insertScriptsSequentially");
5114
5116
  function kt(r) {
5115
- let e = Ee.getElementById(Is);
5116
- e ? e.innerHTML = "" : (e = Ee.createElement("div"), e.id = Is, Ee.body.appendChild(e));
5117
+ let e = we.getElementById(Is);
5118
+ e ? e.innerHTML = "" : (e = we.createElement("div"), e.id = Is, we.body.appendChild(e));
5117
5119
  let t = Array.from(r.querySelectorAll(Ma));
5118
5120
  if (t.length) {
5119
5121
  let o = [];
@@ -5127,7 +5129,7 @@ function kt(r) {
5127
5129
  s(kt, "simulatePageLoad");
5128
5130
 
5129
5131
  // src/docs-tools/shared.ts
5130
- var ks = "storybook/docs", yu = `${ks}/panel`;
5132
+ var ks = "storybook/docs", fu = `${ks}/panel`;
5131
5133
  var js = `${ks}/snippet-rendered`;
5132
5134
 
5133
5135
  // src/preview-api/modules/preview-web/emitTransformCode.ts