storybook 9.0.0-beta.9 → 9.0.0-rc.1

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 (72) hide show
  1. package/assets/server/base-preview-head.html +21 -0
  2. package/assets/server/template.ejs +4 -4
  3. package/dist/actions/preview.cjs +1 -1
  4. package/dist/actions/preview.d.ts +501 -0
  5. package/dist/actions/preview.js +1 -1
  6. package/dist/backgrounds/index.d.ts +501 -0
  7. package/dist/backgrounds/preview.d.ts +501 -0
  8. package/dist/bin/index.cjs +61 -62
  9. package/dist/bin/index.js +61 -62
  10. package/dist/builder-manager/index.cjs +27 -27
  11. package/dist/builder-manager/index.js +46 -46
  12. package/dist/cli/bin/index.cjs +1032 -1032
  13. package/dist/cli/bin/index.js +1032 -1032
  14. package/dist/cli/index.cjs +33709 -28783
  15. package/dist/cli/index.js +33641 -28711
  16. package/dist/common/index.cjs +3060 -3048
  17. package/dist/common/index.d.ts +2 -2
  18. package/dist/common/index.js +3247 -3235
  19. package/dist/components/index.cjs +711 -711
  20. package/dist/components/index.d.ts +2 -1
  21. package/dist/components/index.js +15 -15
  22. package/dist/controls/preview.d.ts +501 -0
  23. package/dist/core-events/index.cjs +55 -52
  24. package/dist/core-events/index.d.ts +3 -1
  25. package/dist/core-events/index.js +52 -49
  26. package/dist/core-server/index.cjs +12 -12
  27. package/dist/core-server/index.d.ts +512 -11
  28. package/dist/core-server/index.js +12 -12
  29. package/dist/core-server/presets/common-manager.js +4563 -5786
  30. package/dist/core-server/presets/common-override-preset.cjs +10 -12
  31. package/dist/core-server/presets/common-override-preset.js +3 -5
  32. package/dist/core-server/presets/common-preset.cjs +112 -116
  33. package/dist/core-server/presets/common-preset.js +10 -14
  34. package/dist/csf/index.d.ts +1 -1
  35. package/dist/csf-tools/index.cjs +116 -111
  36. package/dist/csf-tools/index.js +33 -28
  37. package/dist/docs-tools/index.d.ts +1 -1
  38. package/dist/highlight/preview.d.ts +501 -0
  39. package/dist/instrumenter/index.js +1849 -3547
  40. package/dist/manager/globals-module-info.cjs +3 -0
  41. package/dist/manager/globals-module-info.js +3 -0
  42. package/dist/manager/globals-runtime.js +21082 -22647
  43. package/dist/manager/runtime.js +2468 -2449
  44. package/dist/manager-api/index.cjs +2302 -8594
  45. package/dist/manager-api/index.d.ts +501 -0
  46. package/dist/manager-api/index.js +2602 -2631
  47. package/dist/measure/index.d.ts +501 -0
  48. package/dist/measure/preview.d.ts +501 -0
  49. package/dist/outline/index.d.ts +501 -0
  50. package/dist/outline/preview.d.ts +501 -0
  51. package/dist/preview/runtime.js +38420 -40024
  52. package/dist/preview-api/index.cjs +1546 -1459
  53. package/dist/preview-api/index.d.ts +8 -5
  54. package/dist/preview-api/index.js +1267 -1181
  55. package/dist/router/index.cjs +5700 -2327
  56. package/dist/router/index.d.ts +622 -243
  57. package/dist/router/index.js +1297 -870
  58. package/dist/test/index.cjs +1810 -1811
  59. package/dist/test/index.d.ts +53 -5
  60. package/dist/test/index.js +1907 -1908
  61. package/dist/test/preview.cjs +51 -15860
  62. package/dist/test/preview.d.ts +520 -13
  63. package/dist/test/preview.js +44 -14431
  64. package/dist/theming/index.cjs +17 -0
  65. package/dist/theming/index.js +17 -0
  66. package/dist/types/index.d.ts +516 -82
  67. package/dist/viewport/index.d.ts +502 -3
  68. package/dist/viewport/preview.d.ts +501 -0
  69. package/package.json +2 -18
  70. package/dist/test/spy.cjs +0 -258
  71. package/dist/test/spy.d.ts +0 -62
  72. package/dist/test/spy.js +0 -240
@@ -1,36 +1,36 @@
1
- var Kn = Object.create;
2
- var hr = Object.defineProperty;
3
- var Xn = Object.getOwnPropertyDescriptor;
4
- var Jn = Object.getOwnPropertyNames;
5
- var Qn = Object.getPrototypeOf, Zn = Object.prototype.hasOwnProperty;
6
- var n = (r, e) => hr(r, "name", { value: e, configurable: !0 }), Ee = /* @__PURE__ */ ((r) => typeof require < "u" ? require : typeof Proxy <
1
+ var Zn = Object.create;
2
+ var Sr = Object.defineProperty;
3
+ var es = Object.getOwnPropertyDescriptor;
4
+ var rs = Object.getOwnPropertyNames;
5
+ var ts = Object.getPrototypeOf, os = Object.prototype.hasOwnProperty;
6
+ var n = (r, e) => Sr(r, "name", { value: e, configurable: !0 }), Ee = /* @__PURE__ */ ((r) => typeof require < "u" ? require : typeof Proxy <
7
7
  "u" ? new Proxy(r, {
8
8
  get: (e, t) => (typeof require < "u" ? require : e)[t]
9
9
  }) : r)(function(r) {
10
10
  if (typeof require < "u") return require.apply(this, arguments);
11
11
  throw Error('Dynamic require of "' + r + '" is not supported');
12
12
  });
13
- var O = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
14
- var es = (r, e, t, o) => {
13
+ var I = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
14
+ var ns = (r, e, t, o) => {
15
15
  if (e && typeof e == "object" || typeof e == "function")
16
- for (let s of Jn(e))
17
- !Zn.call(r, s) && s !== t && hr(r, s, { get: () => e[s], enumerable: !(o = Xn(e, s)) || o.enumerable });
16
+ for (let s of rs(e))
17
+ !os.call(r, s) && s !== t && Sr(r, s, { get: () => e[s], enumerable: !(o = es(e, s)) || o.enumerable });
18
18
  return r;
19
19
  };
20
- var ue = (r, e, t) => (t = r != null ? Kn(Qn(r)) : {}, es(
20
+ var ue = (r, e, t) => (t = r != null ? Zn(ts(r)) : {}, ns(
21
21
  // If the importer is in node compatibility mode or this is not an ESM
22
22
  // file that has been converted to a CommonJS file using a Babel-
23
23
  // compatible transform (i.e. "__esModule" has not been set), then set
24
24
  // "default" to the CommonJS "module.exports" for node compatibility.
25
- e || !r || !r.__esModule ? hr(t, "default", { value: r, enumerable: !0 }) : t,
25
+ e || !r || !r.__esModule ? Sr(t, "default", { value: r, enumerable: !0 }) : t,
26
26
  r
27
27
  ));
28
28
 
29
29
  // ../node_modules/memoizerific/memoizerific.js
30
- var kr = O((oo, Dr) => {
30
+ var _r = I((io, Mr) => {
31
31
  (function(r) {
32
- if (typeof oo == "object" && typeof Dr < "u")
33
- Dr.exports = r();
32
+ if (typeof io == "object" && typeof Mr < "u")
33
+ Mr.exports = r();
34
34
  else if (typeof define == "function" && define.amd)
35
35
  define([], r);
36
36
  else {
@@ -160,11 +160,11 @@ var kr = O((oo, Dr) => {
160
160
  });
161
161
 
162
162
  // ../node_modules/picoquery/lib/string-util.js
163
- var st = O((nt) => {
163
+ var lt = I((at) => {
164
164
  "use strict";
165
- Object.defineProperty(nt, "__esModule", { value: !0 });
166
- nt.encodeString = ia;
167
- var z = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()), sa = new Int8Array([
165
+ Object.defineProperty(at, "__esModule", { value: !0 });
166
+ at.encodeString = pa;
167
+ var G = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()), da = new Int8Array([
168
168
  0,
169
169
  0,
170
170
  0,
@@ -294,7 +294,7 @@ var st = O((nt) => {
294
294
  1,
295
295
  0
296
296
  ]);
297
- function ia(r) {
297
+ function pa(r) {
298
298
  let e = r.length;
299
299
  if (e === 0)
300
300
  return "";
@@ -302,107 +302,107 @@ var st = O((nt) => {
302
302
  e: for (; s < e; s++) {
303
303
  let i = r.charCodeAt(s);
304
304
  for (; i < 128; ) {
305
- if (sa[i] !== 1 && (o < s && (t += r.slice(o, s)), o = s + 1, t += z[i]), ++s === e)
305
+ if (da[i] !== 1 && (o < s && (t += r.slice(o, s)), o = s + 1, t += G[i]), ++s === e)
306
306
  break e;
307
307
  i = r.charCodeAt(s);
308
308
  }
309
309
  if (o < s && (t += r.slice(o, s)), i < 2048) {
310
- o = s + 1, t += z[192 | i >> 6] + z[128 | i & 63];
310
+ o = s + 1, t += G[192 | i >> 6] + G[128 | i & 63];
311
311
  continue;
312
312
  }
313
313
  if (i < 55296 || i >= 57344) {
314
- o = s + 1, t += z[224 | i >> 12] + z[128 | i >> 6 & 63] + z[128 | i & 63];
314
+ o = s + 1, t += G[224 | i >> 12] + G[128 | i >> 6 & 63] + G[128 | i & 63];
315
315
  continue;
316
316
  }
317
317
  if (++s, s >= e)
318
318
  throw new Error("URI malformed");
319
319
  let a = r.charCodeAt(s) & 1023;
320
- o = s + 1, i = 65536 + ((i & 1023) << 10 | a), t += z[240 | i >> 18] + z[128 | i >> 12 & 63] + z[128 | i >> 6 & 63] + z[128 | i & 63];
320
+ o = s + 1, i = 65536 + ((i & 1023) << 10 | a), t += G[240 | i >> 18] + G[128 | i >> 12 & 63] + G[128 | i >> 6 & 63] + G[128 | i & 63];
321
321
  }
322
322
  return o === 0 ? r : o < e ? t + r.slice(o) : t;
323
323
  }
324
- n(ia, "encodeString");
324
+ n(pa, "encodeString");
325
325
  });
326
326
 
327
327
  // ../node_modules/picoquery/lib/shared.js
328
- var tr = O((G) => {
328
+ var sr = I((U) => {
329
329
  "use strict";
330
- Object.defineProperty(G, "__esModule", { value: !0 });
331
- G.defaultOptions = G.defaultShouldSerializeObject = G.defaultValueSerializer = void 0;
332
- var it = st(), aa = /* @__PURE__ */ n((r) => {
330
+ Object.defineProperty(U, "__esModule", { value: !0 });
331
+ U.defaultOptions = U.defaultShouldSerializeObject = U.defaultValueSerializer = void 0;
332
+ var ct = lt(), ua = /* @__PURE__ */ n((r) => {
333
333
  switch (typeof r) {
334
334
  case "string":
335
- return (0, it.encodeString)(r);
335
+ return (0, ct.encodeString)(r);
336
336
  case "bigint":
337
337
  case "boolean":
338
338
  return "" + r;
339
339
  case "number":
340
340
  if (Number.isFinite(r))
341
- return r < 1e21 ? "" + r : (0, it.encodeString)("" + r);
341
+ return r < 1e21 ? "" + r : (0, ct.encodeString)("" + r);
342
342
  break;
343
343
  }
344
- return r instanceof Date ? (0, it.encodeString)(r.toISOString()) : "";
344
+ return r instanceof Date ? (0, ct.encodeString)(r.toISOString()) : "";
345
345
  }, "defaultValueSerializer");
346
- G.defaultValueSerializer = aa;
347
- var la = /* @__PURE__ */ n((r) => r instanceof Date, "defaultShouldSerializeObject");
348
- G.defaultShouldSerializeObject = la;
349
- var Vo = /* @__PURE__ */ n((r) => r, "identityFunc");
350
- G.defaultOptions = {
346
+ U.defaultValueSerializer = ua;
347
+ var fa = /* @__PURE__ */ n((r) => r instanceof Date, "defaultShouldSerializeObject");
348
+ U.defaultShouldSerializeObject = fa;
349
+ var Ko = /* @__PURE__ */ n((r) => r, "identityFunc");
350
+ U.defaultOptions = {
351
351
  nesting: !0,
352
352
  nestingSyntax: "dot",
353
353
  arrayRepeat: !1,
354
354
  arrayRepeatSyntax: "repeat",
355
355
  delimiter: 38,
356
- valueDeserializer: Vo,
357
- valueSerializer: G.defaultValueSerializer,
358
- keyDeserializer: Vo,
359
- shouldSerializeObject: G.defaultShouldSerializeObject
356
+ valueDeserializer: Ko,
357
+ valueSerializer: U.defaultValueSerializer,
358
+ keyDeserializer: Ko,
359
+ shouldSerializeObject: U.defaultShouldSerializeObject
360
360
  };
361
361
  });
362
362
 
363
363
  // ../node_modules/picoquery/lib/object-util.js
364
- var at = O((or) => {
364
+ var dt = I((ir) => {
365
365
  "use strict";
366
- Object.defineProperty(or, "__esModule", { value: !0 });
367
- or.getDeepObject = pa;
368
- or.stringifyObject = Wo;
369
- var ae = tr(), ca = st();
370
- function da(r) {
366
+ Object.defineProperty(ir, "__esModule", { value: !0 });
367
+ ir.getDeepObject = ha;
368
+ ir.stringifyObject = Xo;
369
+ var ae = sr(), ya = lt();
370
+ function ma(r) {
371
371
  return r === "__proto__" || r === "constructor" || r === "prototype";
372
372
  }
373
- n(da, "isPrototypeKey");
374
- function pa(r, e, t, o, s) {
375
- if (da(e))
373
+ n(ma, "isPrototypeKey");
374
+ function ha(r, e, t, o, s) {
375
+ if (ma(e))
376
376
  return r;
377
377
  let i = r[e];
378
378
  return typeof i == "object" && i !== null ? i : !o && (s || typeof t == "number" || typeof t == "string" && t * 0 === 0 && t.indexOf(".") ===
379
379
  -1) ? r[e] = [] : r[e] = {};
380
380
  }
381
- n(pa, "getDeepObject");
382
- var ua = 20, fa = "[]", ya = "[", ma = "]", ha = ".";
383
- function Wo(r, e, t = 0, o, s) {
381
+ n(ha, "getDeepObject");
382
+ var ga = 20, ba = "[]", Sa = "[", Ta = "]", xa = ".";
383
+ function Xo(r, e, t = 0, o, s) {
384
384
  let { nestingSyntax: i = ae.defaultOptions.nestingSyntax, arrayRepeat: a = ae.defaultOptions.arrayRepeat, arrayRepeatSyntax: l = ae.defaultOptions.
385
385
  arrayRepeatSyntax, nesting: c = ae.defaultOptions.nesting, delimiter: d = ae.defaultOptions.delimiter, valueSerializer: p = ae.defaultOptions.
386
386
  valueSerializer, shouldSerializeObject: u = ae.defaultOptions.shouldSerializeObject } = e, y = typeof d == "number" ? String.fromCharCode(
387
387
  d) : d, h = s === !0 && a, g = i === "dot" || i === "js" && !s;
388
- if (t > ua)
388
+ if (t > ga)
389
389
  return "";
390
390
  let b = "", m = !0, T = !1;
391
391
  for (let x in r) {
392
392
  let f = r[x], S;
393
- o ? (S = o, h ? l === "bracket" && (S += fa) : g ? (S += ha, S += x) : (S += ya, S += x, S += ma)) : S = x, m || (b += y), typeof f ==
394
- "object" && f !== null && !u(f) ? (T = f.pop !== void 0, (c || a && T) && (b += Wo(f, e, t + 1, S, T))) : (b += (0, ca.encodeString)(S),
393
+ o ? (S = o, h ? l === "bracket" && (S += ba) : g ? (S += xa, S += x) : (S += Sa, S += x, S += Ta)) : S = x, m || (b += y), typeof f ==
394
+ "object" && f !== null && !u(f) ? (T = f.pop !== void 0, (c || a && T) && (b += Xo(f, e, t + 1, S, T))) : (b += (0, ya.encodeString)(S),
395
395
  b += "=", b += p(f, x)), m && (m = !1);
396
396
  }
397
397
  return b;
398
398
  }
399
- n(Wo, "stringifyObject");
399
+ n(Xo, "stringifyObject");
400
400
  });
401
401
 
402
402
  // ../node_modules/fast-decode-uri-component/index.js
403
- var Xo = O((ff, Ko) => {
403
+ var en = I((xf, Zo) => {
404
404
  "use strict";
405
- var $o = 12, ga = 0, lt = [
405
+ var Jo = 12, Ra = 0, pt = [
406
406
  // The first part of the table maps bytes to character to a transition.
407
407
  0,
408
408
  0,
@@ -785,18 +785,18 @@ var Xo = O((ff, Ko) => {
785
785
  7,
786
786
  7
787
787
  ];
788
- function ba(r) {
788
+ function wa(r) {
789
789
  var e = r.indexOf("%");
790
790
  if (e === -1) return r;
791
- for (var t = r.length, o = "", s = 0, i = 0, a = e, l = $o; e > -1 && e < t; ) {
792
- var c = Yo(r[e + 1], 4), d = Yo(r[e + 2], 0), p = c | d, u = lt[p];
793
- if (l = lt[256 + l + u], i = i << 6 | p & lt[364 + u], l === $o)
791
+ for (var t = r.length, o = "", s = 0, i = 0, a = e, l = Jo; e > -1 && e < t; ) {
792
+ var c = Qo(r[e + 1], 4), d = Qo(r[e + 2], 0), p = c | d, u = pt[p];
793
+ if (l = pt[256 + l + u], i = i << 6 | p & pt[364 + u], l === Jo)
794
794
  o += r.slice(s, a), o += i <= 65535 ? String.fromCharCode(i) : String.fromCharCode(
795
795
  55232 + (i >> 10),
796
796
  56320 + (i & 1023)
797
797
  ), i = 0, s = e + 3, e = a = r.indexOf("%", s);
798
798
  else {
799
- if (l === ga)
799
+ if (l === Ra)
800
800
  return null;
801
801
  if (e += 3, e < t && r.charCodeAt(e) === 37) continue;
802
802
  return null;
@@ -804,8 +804,8 @@ var Xo = O((ff, Ko) => {
804
804
  }
805
805
  return o + r.slice(s);
806
806
  }
807
- n(ba, "decodeURIComponent");
808
- var Sa = {
807
+ n(wa, "decodeURIComponent");
808
+ var Aa = {
809
809
  0: 0,
810
810
  1: 1,
811
811
  2: 2,
@@ -829,95 +829,95 @@ var Xo = O((ff, Ko) => {
829
829
  f: 15,
830
830
  F: 15
831
831
  };
832
- function Yo(r, e) {
833
- var t = Sa[r];
832
+ function Qo(r, e) {
833
+ var t = Aa[r];
834
834
  return t === void 0 ? 255 : t << e;
835
835
  }
836
- n(Yo, "hexCodeToInt");
837
- Ko.exports = ba;
836
+ n(Qo, "hexCodeToInt");
837
+ Zo.exports = wa;
838
838
  });
839
839
 
840
840
  // ../node_modules/picoquery/lib/parse.js
841
- var en = O((W) => {
841
+ var nn = I(($) => {
842
842
  "use strict";
843
- var Ta = W && W.__importDefault || function(r) {
843
+ var Ea = $ && $.__importDefault || function(r) {
844
844
  return r && r.__esModule ? r : { default: r };
845
845
  };
846
- Object.defineProperty(W, "__esModule", { value: !0 });
847
- W.numberValueDeserializer = W.numberKeyDeserializer = void 0;
848
- W.parse = wa;
849
- var nr = at(), le = tr(), Jo = Ta(Xo()), xa = /* @__PURE__ */ n((r) => {
846
+ Object.defineProperty($, "__esModule", { value: !0 });
847
+ $.numberValueDeserializer = $.numberKeyDeserializer = void 0;
848
+ $.parse = Pa;
849
+ var ar = dt(), le = sr(), rn = Ea(en()), Ca = /* @__PURE__ */ n((r) => {
850
850
  let e = Number(r);
851
851
  return Number.isNaN(e) ? r : e;
852
852
  }, "numberKeyDeserializer");
853
- W.numberKeyDeserializer = xa;
854
- var Ra = /* @__PURE__ */ n((r) => {
853
+ $.numberKeyDeserializer = Ca;
854
+ var va = /* @__PURE__ */ n((r) => {
855
855
  let e = Number(r);
856
856
  return Number.isNaN(e) ? r : e;
857
857
  }, "numberValueDeserializer");
858
- W.numberValueDeserializer = Ra;
859
- var Qo = /\+/g, Zo = /* @__PURE__ */ n(function() {
858
+ $.numberValueDeserializer = va;
859
+ var tn = /\+/g, on = /* @__PURE__ */ n(function() {
860
860
  }, "Empty");
861
- Zo.prototype = /* @__PURE__ */ Object.create(null);
862
- function sr(r, e, t, o, s) {
861
+ on.prototype = /* @__PURE__ */ Object.create(null);
862
+ function lr(r, e, t, o, s) {
863
863
  let i = r.substring(e, t);
864
- return o && (i = i.replace(Qo, " ")), s && (i = (0, Jo.default)(i) || i), i;
864
+ return o && (i = i.replace(tn, " ")), s && (i = (0, rn.default)(i) || i), i;
865
865
  }
866
- n(sr, "computeKeySlice");
867
- function wa(r, e) {
866
+ n(lr, "computeKeySlice");
867
+ function Pa(r, e) {
868
868
  let { valueDeserializer: t = le.defaultOptions.valueDeserializer, keyDeserializer: o = le.defaultOptions.keyDeserializer, arrayRepeatSyntax: s = le.
869
869
  defaultOptions.arrayRepeatSyntax, nesting: i = le.defaultOptions.nesting, arrayRepeat: a = le.defaultOptions.arrayRepeat, nestingSyntax: l = le.
870
870
  defaultOptions.nestingSyntax, delimiter: c = le.defaultOptions.delimiter } = e ?? {}, d = typeof c == "string" ? c.charCodeAt(0) : c, p = l ===
871
- "js", u = new Zo();
871
+ "js", u = new on();
872
872
  if (typeof r != "string")
873
873
  return u;
874
- let y = r.length, h = "", g = -1, b = -1, m = -1, T = u, x, f = "", S = "", R = !1, w = !1, A = !1, F = !1, j = !1, N = !1, pe = !1, C = 0,
875
- B = -1, Re = -1, wt = -1;
876
- for (let I = 0; I < y + 1; I++) {
877
- if (C = I !== y ? r.charCodeAt(I) : d, C === d) {
878
- if (pe = b > g, pe || (b = I), m !== b - 1 && (S = sr(r, m + 1, B > -1 ? B : b, A, R), f = o(S), x !== void 0 && (T = (0, nr.getDeepObject)(
879
- T, x, f, p && j, p && N))), pe || f !== "") {
880
- pe && (h = r.slice(b + 1, I), F && (h = h.replace(Qo, " ")), w && (h = (0, Jo.default)(h) || h));
881
- let we = t(h, f);
874
+ let y = r.length, h = "", g = -1, b = -1, m = -1, T = u, x, f = "", S = "", R = !1, w = !1, E = !1, D = !1, k = !1, L = !1, pe = !1, q = 0,
875
+ v = -1, z = -1, Ct = -1;
876
+ for (let F = 0; F < y + 1; F++) {
877
+ if (q = F !== y ? r.charCodeAt(F) : d, q === d) {
878
+ if (pe = b > g, pe || (b = F), m !== b - 1 && (S = lr(r, m + 1, v > -1 ? v : b, E, R), f = o(S), x !== void 0 && (T = (0, ar.getDeepObject)(
879
+ T, x, f, p && k, p && L))), pe || f !== "") {
880
+ pe && (h = r.slice(b + 1, F), D && (h = h.replace(tn, " ")), w && (h = (0, rn.default)(h) || h));
881
+ let Ae = t(h, f);
882
882
  if (a) {
883
- let Be = T[f];
884
- Be === void 0 ? B > -1 ? T[f] = [we] : T[f] = we : Be.pop ? Be.push(we) : T[f] = [Be, we];
883
+ let Ge = T[f];
884
+ Ge === void 0 ? v > -1 ? T[f] = [Ae] : T[f] = Ae : Ge.pop ? Ge.push(Ae) : T[f] = [Ge, Ae];
885
885
  } else
886
- T[f] = we;
886
+ T[f] = Ae;
887
887
  }
888
- h = "", g = I, b = I, R = !1, w = !1, A = !1, F = !1, j = !1, N = !1, B = -1, m = I, T = u, x = void 0, f = "";
889
- } else C === 93 ? (a && s === "bracket" && wt === 91 && (B = Re), i && (l === "index" || p) && b <= g && (m !== Re && (S = sr(r, m + 1,
890
- I, A, R), f = o(S), x !== void 0 && (T = (0, nr.getDeepObject)(T, x, f, void 0, p)), x = f, A = !1, R = !1), m = I, N = !0, j = !1)) :
891
- C === 46 ? i && (l === "dot" || p) && b <= g && (m !== Re && (S = sr(r, m + 1, I, A, R), f = o(S), x !== void 0 && (T = (0, nr.getDeepObject)(
892
- T, x, f, p)), x = f, A = !1, R = !1), j = !0, N = !1, m = I) : C === 91 ? i && (l === "index" || p) && b <= g && (m !== Re && (S = sr(
893
- r, m + 1, I, A, R), f = o(S), p && x !== void 0 && (T = (0, nr.getDeepObject)(T, x, f, p)), x = f, A = !1, R = !1, j = !1, N = !0), m =
894
- I) : C === 61 ? b <= g ? b = I : w = !0 : C === 43 ? b > g ? F = !0 : A = !0 : C === 37 && (b > g ? w = !0 : R = !0);
895
- Re = I, wt = C;
888
+ h = "", g = F, b = F, R = !1, w = !1, E = !1, D = !1, k = !1, L = !1, v = -1, m = F, T = u, x = void 0, f = "";
889
+ } else q === 93 ? (a && s === "bracket" && Ct === 91 && (v = z), i && (l === "index" || p) && b <= g && (m !== z && (S = lr(r, m + 1, F,
890
+ E, R), f = o(S), x !== void 0 && (T = (0, ar.getDeepObject)(T, x, f, void 0, p)), x = f, E = !1, R = !1), m = F, L = !0, k = !1)) : q ===
891
+ 46 ? i && (l === "dot" || p) && b <= g && (m !== z && (S = lr(r, m + 1, F, E, R), f = o(S), x !== void 0 && (T = (0, ar.getDeepObject)(
892
+ T, x, f, p)), x = f, E = !1, R = !1), k = !0, L = !1, m = F) : q === 91 ? i && (l === "index" || p) && b <= g && (m !== z && (S = lr(r,
893
+ m + 1, F, E, R), f = o(S), p && x !== void 0 && (T = (0, ar.getDeepObject)(T, x, f, p)), x = f, E = !1, R = !1, k = !1, L = !0), m = F) :
894
+ q === 61 ? b <= g ? b = F : w = !0 : q === 43 ? b > g ? D = !0 : E = !0 : q === 37 && (b > g ? w = !0 : R = !0);
895
+ z = F, Ct = q;
896
896
  }
897
897
  return u;
898
898
  }
899
- n(wa, "parse");
899
+ n(Pa, "parse");
900
900
  });
901
901
 
902
902
  // ../node_modules/picoquery/lib/stringify.js
903
- var rn = O((ct) => {
903
+ var sn = I((ut) => {
904
904
  "use strict";
905
- Object.defineProperty(ct, "__esModule", { value: !0 });
906
- ct.stringify = Aa;
907
- var Ea = at();
908
- function Aa(r, e) {
905
+ Object.defineProperty(ut, "__esModule", { value: !0 });
906
+ ut.stringify = Ia;
907
+ var Fa = dt();
908
+ function Ia(r, e) {
909
909
  if (r === null || typeof r != "object")
910
910
  return "";
911
911
  let t = e ?? {};
912
- return (0, Ea.stringifyObject)(r, t);
912
+ return (0, Fa.stringifyObject)(r, t);
913
913
  }
914
- n(Aa, "stringify");
914
+ n(Ia, "stringify");
915
915
  });
916
916
 
917
917
  // ../node_modules/picoquery/lib/main.js
918
- var ir = O((q) => {
918
+ var cr = I((B) => {
919
919
  "use strict";
920
- var Ca = q && q.__createBinding || (Object.create ? function(r, e, t, o) {
920
+ var Oa = B && B.__createBinding || (Object.create ? function(r, e, t, o) {
921
921
  o === void 0 && (o = t);
922
922
  var s = Object.getOwnPropertyDescriptor(e, t);
923
923
  (!s || ("get" in s ? !e.__esModule : s.writable || s.configurable)) && (s = { enumerable: !0, get: /* @__PURE__ */ n(function() {
@@ -925,25 +925,25 @@ var ir = O((q) => {
925
925
  }, "get") }), Object.defineProperty(r, o, s);
926
926
  } : function(r, e, t, o) {
927
927
  o === void 0 && (o = t), r[o] = e[t];
928
- }), va = q && q.__exportStar || function(r, e) {
929
- for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Ca(e, r, t);
928
+ }), Da = B && B.__exportStar || function(r, e) {
929
+ for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Oa(e, r, t);
930
930
  };
931
- Object.defineProperty(q, "__esModule", { value: !0 });
932
- q.stringify = q.parse = void 0;
933
- var Pa = en();
934
- Object.defineProperty(q, "parse", { enumerable: !0, get: /* @__PURE__ */ n(function() {
935
- return Pa.parse;
931
+ Object.defineProperty(B, "__esModule", { value: !0 });
932
+ B.stringify = B.parse = void 0;
933
+ var ka = nn();
934
+ Object.defineProperty(B, "parse", { enumerable: !0, get: /* @__PURE__ */ n(function() {
935
+ return ka.parse;
936
936
  }, "get") });
937
- var Fa = rn();
938
- Object.defineProperty(q, "stringify", { enumerable: !0, get: /* @__PURE__ */ n(function() {
939
- return Fa.stringify;
937
+ var ja = sn();
938
+ Object.defineProperty(B, "stringify", { enumerable: !0, get: /* @__PURE__ */ n(function() {
939
+ return ja.stringify;
940
940
  }, "get") });
941
- va(tr(), q);
941
+ Da(sr(), B);
942
942
  });
943
943
 
944
944
  // ../node_modules/entities/lib/maps/entities.json
945
- var ft = O((If, Na) => {
946
- Na.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\
945
+ var ht = I((Lf, Ua) => {
946
+ Ua.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\
947
947
  \xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}",
948
948
  Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\
949
949
  \u2A3F", amp: "&", AMP: "&", andand: "\u2A55", And: "\u2A53", and: "\u2227", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220",
@@ -1224,8 +1224,8 @@ var ft = O((If, Na) => {
1224
1224
  });
1225
1225
 
1226
1226
  // ../node_modules/entities/lib/maps/legacy.json
1227
- var cn = O((Of, qa) => {
1228
- qa.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\
1227
+ var fn = I((qf, Ha) => {
1228
+ Ha.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\
1229
1229
  \xE0", amp: "&", AMP: "&", Aring: "\xC5", aring: "\xE5", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", brvbar: "\xA6", Ccedil: "\
1230
1230
  \xC7", ccedil: "\xE7", cedil: "\xB8", cent: "\xA2", copy: "\xA9", COPY: "\xA9", curren: "\xA4", deg: "\xB0", divide: "\xF7", Eacute: "\xC9",
1231
1231
  eacute: "\xE9", Ecirc: "\xCA", ecirc: "\xEA", Egrave: "\xC8", egrave: "\xE8", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", frac12: "\
@@ -1239,25 +1239,25 @@ var cn = O((Of, qa) => {
1239
1239
  });
1240
1240
 
1241
1241
  // ../node_modules/entities/lib/maps/xml.json
1242
- var yt = O((Df, Ba) => {
1243
- Ba.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
1242
+ var gt = I((Bf, Va) => {
1243
+ Va.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
1244
1244
  });
1245
1245
 
1246
1246
  // ../node_modules/entities/lib/maps/decode.json
1247
- var dn = O((kf, za) => {
1248
- za.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240,
1247
+ var yn = I((zf, Wa) => {
1248
+ Wa.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240,
1249
1249
  "138": 352, "139": 8249, "140": 338, "142": 381, "145": 8216, "146": 8217, "147": 8220, "148": 8221, "149": 8226, "150": 8211, "151": 8212,
1250
1250
  "152": 732, "153": 8482, "154": 353, "155": 8250, "156": 339, "158": 382, "159": 376 };
1251
1251
  });
1252
1252
 
1253
1253
  // ../node_modules/entities/lib/decode_codepoint.js
1254
- var un = O((qe) => {
1254
+ var hn = I((ze) => {
1255
1255
  "use strict";
1256
- var Ga = qe && qe.__importDefault || function(r) {
1256
+ var $a = ze && ze.__importDefault || function(r) {
1257
1257
  return r && r.__esModule ? r : { default: r };
1258
1258
  };
1259
- Object.defineProperty(qe, "__esModule", { value: !0 });
1260
- var pn = Ga(dn()), Ua = (
1259
+ Object.defineProperty(ze, "__esModule", { value: !0 });
1260
+ var mn = $a(yn()), Ya = (
1261
1261
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1262
1262
  String.fromCodePoint || function(r) {
1263
1263
  var e = "";
@@ -1265,38 +1265,38 @@ var un = O((qe) => {
1265
1265
  e;
1266
1266
  }
1267
1267
  );
1268
- function Ha(r) {
1269
- return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in pn.default && (r = pn.default[r]), Ua(r));
1268
+ function Ka(r) {
1269
+ return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in mn.default && (r = mn.default[r]), Ya(r));
1270
1270
  }
1271
- n(Ha, "decodeCodePoint");
1272
- qe.default = Ha;
1271
+ n(Ka, "decodeCodePoint");
1272
+ ze.default = Ka;
1273
1273
  });
1274
1274
 
1275
1275
  // ../node_modules/entities/lib/decode.js
1276
- var ht = O((U) => {
1276
+ var St = I((H) => {
1277
1277
  "use strict";
1278
- var ar = U && U.__importDefault || function(r) {
1278
+ var dr = H && H.__importDefault || function(r) {
1279
1279
  return r && r.__esModule ? r : { default: r };
1280
1280
  };
1281
- Object.defineProperty(U, "__esModule", { value: !0 });
1282
- U.decodeHTML = U.decodeHTMLStrict = U.decodeXML = void 0;
1283
- var mt = ar(ft()), Va = ar(cn()), Wa = ar(yt()), fn = ar(un()), $a = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
1284
- U.decodeXML = mn(Wa.default);
1285
- U.decodeHTMLStrict = mn(mt.default);
1286
- function mn(r) {
1287
- var e = hn(r);
1281
+ Object.defineProperty(H, "__esModule", { value: !0 });
1282
+ H.decodeHTML = H.decodeHTMLStrict = H.decodeXML = void 0;
1283
+ var bt = dr(ht()), Xa = dr(fn()), Ja = dr(gt()), gn = dr(hn()), Qa = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
1284
+ H.decodeXML = Sn(Ja.default);
1285
+ H.decodeHTMLStrict = Sn(bt.default);
1286
+ function Sn(r) {
1287
+ var e = Tn(r);
1288
1288
  return function(t) {
1289
- return String(t).replace($a, e);
1289
+ return String(t).replace(Qa, e);
1290
1290
  };
1291
1291
  }
1292
- n(mn, "getStrictDecoder");
1293
- var yn = /* @__PURE__ */ n(function(r, e) {
1292
+ n(Sn, "getStrictDecoder");
1293
+ var bn = /* @__PURE__ */ n(function(r, e) {
1294
1294
  return r < e ? 1 : -1;
1295
1295
  }, "sorter");
1296
- U.decodeHTML = function() {
1297
- for (var r = Object.keys(Va.default).sort(yn), e = Object.keys(mt.default).sort(yn), t = 0, o = 0; t < e.length; t++)
1296
+ H.decodeHTML = function() {
1297
+ for (var r = Object.keys(Xa.default).sort(bn), e = Object.keys(bt.default).sort(bn), t = 0, o = 0; t < e.length; t++)
1298
1298
  r[o] === e[t] ? (e[t] += ";?", o++) : e[t] += ";";
1299
- var s = new RegExp("&(?:" + e.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), i = hn(mt.default);
1299
+ var s = new RegExp("&(?:" + e.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), i = Tn(bt.default);
1300
1300
  function a(l) {
1301
1301
  return l.substr(-1) !== ";" && (l += ";"), i(l);
1302
1302
  }
@@ -1304,38 +1304,38 @@ var ht = O((U) => {
1304
1304
  return String(l).replace(s, a);
1305
1305
  };
1306
1306
  }();
1307
- function hn(r) {
1307
+ function Tn(r) {
1308
1308
  return /* @__PURE__ */ n(function(t) {
1309
1309
  if (t.charAt(1) === "#") {
1310
1310
  var o = t.charAt(2);
1311
- return o === "X" || o === "x" ? fn.default(parseInt(t.substr(3), 16)) : fn.default(parseInt(t.substr(2), 10));
1311
+ return o === "X" || o === "x" ? gn.default(parseInt(t.substr(3), 16)) : gn.default(parseInt(t.substr(2), 10));
1312
1312
  }
1313
1313
  return r[t.slice(1, -1)] || t;
1314
1314
  }, "replace");
1315
1315
  }
1316
- n(hn, "getReplacer");
1316
+ n(Tn, "getReplacer");
1317
1317
  });
1318
1318
 
1319
1319
  // ../node_modules/entities/lib/encode.js
1320
- var bt = O((M) => {
1320
+ var xt = I((M) => {
1321
1321
  "use strict";
1322
- var gn = M && M.__importDefault || function(r) {
1322
+ var xn = M && M.__importDefault || function(r) {
1323
1323
  return r && r.__esModule ? r : { default: r };
1324
1324
  };
1325
1325
  Object.defineProperty(M, "__esModule", { value: !0 });
1326
1326
  M.escapeUTF8 = M.escape = M.encodeNonAsciiHTML = M.encodeHTML = M.encodeXML = void 0;
1327
- var Ya = gn(yt()), bn = Tn(Ya.default), Sn = xn(bn);
1328
- M.encodeXML = En(bn);
1329
- var Ka = gn(ft()), gt = Tn(Ka.default), Xa = xn(gt);
1330
- M.encodeHTML = Qa(gt, Xa);
1331
- M.encodeNonAsciiHTML = En(gt);
1332
- function Tn(r) {
1327
+ var Za = xn(gt()), Rn = An(Za.default), wn = En(Rn);
1328
+ M.encodeXML = Pn(Rn);
1329
+ var el = xn(ht()), Tt = An(el.default), rl = En(Tt);
1330
+ M.encodeHTML = ol(Tt, rl);
1331
+ M.encodeNonAsciiHTML = Pn(Tt);
1332
+ function An(r) {
1333
1333
  return Object.keys(r).sort().reduce(function(e, t) {
1334
1334
  return e[r[t]] = "&" + t + ";", e;
1335
1335
  }, {});
1336
1336
  }
1337
- n(Tn, "getInverseObj");
1338
- function xn(r) {
1337
+ n(An, "getInverseObj");
1338
+ function En(r) {
1339
1339
  for (var e = [], t = [], o = 0, s = Object.keys(r); o < s.length; o++) {
1340
1340
  var i = s[o];
1341
1341
  i.length === 1 ? e.push("\\" + i) : t.push(i);
@@ -1349,9 +1349,9 @@ var bt = O((M) => {
1349
1349
  }
1350
1350
  return t.unshift("[" + e.join("") + "]"), new RegExp(t.join("|"), "g");
1351
1351
  }
1352
- n(xn, "getInverseReplacer");
1353
- var Rn = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,
1354
- Ja = (
1352
+ n(En, "getInverseReplacer");
1353
+ var Cn = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,
1354
+ tl = (
1355
1355
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1356
1356
  String.prototype.codePointAt != null ? (
1357
1357
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -1365,134 +1365,134 @@ var bt = O((M) => {
1365
1365
  }
1366
1366
  )
1367
1367
  );
1368
- function lr(r) {
1369
- return "&#x" + (r.length > 1 ? Ja(r) : r.charCodeAt(0)).toString(16).toUpperCase() + ";";
1368
+ function pr(r) {
1369
+ return "&#x" + (r.length > 1 ? tl(r) : r.charCodeAt(0)).toString(16).toUpperCase() + ";";
1370
1370
  }
1371
- n(lr, "singleCharReplacer");
1372
- function Qa(r, e) {
1371
+ n(pr, "singleCharReplacer");
1372
+ function ol(r, e) {
1373
1373
  return function(t) {
1374
1374
  return t.replace(e, function(o) {
1375
1375
  return r[o];
1376
- }).replace(Rn, lr);
1376
+ }).replace(Cn, pr);
1377
1377
  };
1378
1378
  }
1379
- n(Qa, "getInverse");
1380
- var wn = new RegExp(Sn.source + "|" + Rn.source, "g");
1381
- function Za(r) {
1382
- return r.replace(wn, lr);
1379
+ n(ol, "getInverse");
1380
+ var vn = new RegExp(wn.source + "|" + Cn.source, "g");
1381
+ function nl(r) {
1382
+ return r.replace(vn, pr);
1383
1383
  }
1384
- n(Za, "escape");
1385
- M.escape = Za;
1386
- function el(r) {
1387
- return r.replace(Sn, lr);
1384
+ n(nl, "escape");
1385
+ M.escape = nl;
1386
+ function sl(r) {
1387
+ return r.replace(wn, pr);
1388
1388
  }
1389
- n(el, "escapeUTF8");
1390
- M.escapeUTF8 = el;
1391
- function En(r) {
1389
+ n(sl, "escapeUTF8");
1390
+ M.escapeUTF8 = sl;
1391
+ function Pn(r) {
1392
1392
  return function(e) {
1393
- return e.replace(wn, function(t) {
1394
- return r[t] || lr(t);
1393
+ return e.replace(vn, function(t) {
1394
+ return r[t] || pr(t);
1395
1395
  });
1396
1396
  };
1397
1397
  }
1398
- n(En, "getASCIIEncoder");
1398
+ n(Pn, "getASCIIEncoder");
1399
1399
  });
1400
1400
 
1401
1401
  // ../node_modules/entities/lib/index.js
1402
- var Cn = O((E) => {
1402
+ var In = I((A) => {
1403
1403
  "use strict";
1404
- Object.defineProperty(E, "__esModule", { value: !0 });
1405
- E.decodeXMLStrict = E.decodeHTML5Strict = E.decodeHTML4Strict = E.decodeHTML5 = E.decodeHTML4 = E.decodeHTMLStrict = E.decodeHTML = E.decodeXML =
1406
- E.encodeHTML5 = E.encodeHTML4 = E.escapeUTF8 = E.escape = E.encodeNonAsciiHTML = E.encodeHTML = E.encodeXML = E.encode = E.decodeStrict = E.
1404
+ Object.defineProperty(A, "__esModule", { value: !0 });
1405
+ A.decodeXMLStrict = A.decodeHTML5Strict = A.decodeHTML4Strict = A.decodeHTML5 = A.decodeHTML4 = A.decodeHTMLStrict = A.decodeHTML = A.decodeXML =
1406
+ A.encodeHTML5 = A.encodeHTML4 = A.escapeUTF8 = A.escape = A.encodeNonAsciiHTML = A.encodeHTML = A.encodeXML = A.encode = A.decodeStrict = A.
1407
1407
  decode = void 0;
1408
- var cr = ht(), An = bt();
1409
- function rl(r, e) {
1410
- return (!e || e <= 0 ? cr.decodeXML : cr.decodeHTML)(r);
1411
- }
1412
- n(rl, "decode");
1413
- E.decode = rl;
1414
- function tl(r, e) {
1415
- return (!e || e <= 0 ? cr.decodeXML : cr.decodeHTMLStrict)(r);
1416
- }
1417
- n(tl, "decodeStrict");
1418
- E.decodeStrict = tl;
1419
- function ol(r, e) {
1420
- return (!e || e <= 0 ? An.encodeXML : An.encodeHTML)(r);
1421
- }
1422
- n(ol, "encode");
1423
- E.encode = ol;
1424
- var ce = bt();
1425
- Object.defineProperty(E, "encodeXML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1408
+ var ur = St(), Fn = xt();
1409
+ function il(r, e) {
1410
+ return (!e || e <= 0 ? ur.decodeXML : ur.decodeHTML)(r);
1411
+ }
1412
+ n(il, "decode");
1413
+ A.decode = il;
1414
+ function al(r, e) {
1415
+ return (!e || e <= 0 ? ur.decodeXML : ur.decodeHTMLStrict)(r);
1416
+ }
1417
+ n(al, "decodeStrict");
1418
+ A.decodeStrict = al;
1419
+ function ll(r, e) {
1420
+ return (!e || e <= 0 ? Fn.encodeXML : Fn.encodeHTML)(r);
1421
+ }
1422
+ n(ll, "encode");
1423
+ A.encode = ll;
1424
+ var ce = xt();
1425
+ Object.defineProperty(A, "encodeXML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1426
1426
  return ce.encodeXML;
1427
1427
  }, "get") });
1428
- Object.defineProperty(E, "encodeHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1428
+ Object.defineProperty(A, "encodeHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1429
1429
  return ce.encodeHTML;
1430
1430
  }, "get") });
1431
- Object.defineProperty(E, "encodeNonAsciiHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1431
+ Object.defineProperty(A, "encodeNonAsciiHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1432
1432
  return ce.encodeNonAsciiHTML;
1433
1433
  }, "get") });
1434
- Object.defineProperty(E, "escape", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1434
+ Object.defineProperty(A, "escape", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1435
1435
  return ce.escape;
1436
1436
  }, "get") });
1437
- Object.defineProperty(E, "escapeUTF8", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1437
+ Object.defineProperty(A, "escapeUTF8", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1438
1438
  return ce.escapeUTF8;
1439
1439
  }, "get") });
1440
- Object.defineProperty(E, "encodeHTML4", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1440
+ Object.defineProperty(A, "encodeHTML4", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1441
1441
  return ce.encodeHTML;
1442
1442
  }, "get") });
1443
- Object.defineProperty(E, "encodeHTML5", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1443
+ Object.defineProperty(A, "encodeHTML5", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1444
1444
  return ce.encodeHTML;
1445
1445
  }, "get") });
1446
- var Z = ht();
1447
- Object.defineProperty(E, "decodeXML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1448
- return Z.decodeXML;
1446
+ var ee = St();
1447
+ Object.defineProperty(A, "decodeXML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1448
+ return ee.decodeXML;
1449
1449
  }, "get") });
1450
- Object.defineProperty(E, "decodeHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1451
- return Z.decodeHTML;
1450
+ Object.defineProperty(A, "decodeHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1451
+ return ee.decodeHTML;
1452
1452
  }, "get") });
1453
- Object.defineProperty(E, "decodeHTMLStrict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1454
- return Z.decodeHTMLStrict;
1453
+ Object.defineProperty(A, "decodeHTMLStrict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1454
+ return ee.decodeHTMLStrict;
1455
1455
  }, "get") });
1456
- Object.defineProperty(E, "decodeHTML4", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1457
- return Z.decodeHTML;
1456
+ Object.defineProperty(A, "decodeHTML4", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1457
+ return ee.decodeHTML;
1458
1458
  }, "get") });
1459
- Object.defineProperty(E, "decodeHTML5", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1460
- return Z.decodeHTML;
1459
+ Object.defineProperty(A, "decodeHTML5", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1460
+ return ee.decodeHTML;
1461
1461
  }, "get") });
1462
- Object.defineProperty(E, "decodeHTML4Strict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1463
- return Z.decodeHTMLStrict;
1462
+ Object.defineProperty(A, "decodeHTML4Strict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1463
+ return ee.decodeHTMLStrict;
1464
1464
  }, "get") });
1465
- Object.defineProperty(E, "decodeHTML5Strict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1466
- return Z.decodeHTMLStrict;
1465
+ Object.defineProperty(A, "decodeHTML5Strict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1466
+ return ee.decodeHTMLStrict;
1467
1467
  }, "get") });
1468
- Object.defineProperty(E, "decodeXMLStrict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1469
- return Z.decodeXML;
1468
+ Object.defineProperty(A, "decodeXMLStrict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1469
+ return ee.decodeXML;
1470
1470
  }, "get") });
1471
1471
  });
1472
1472
 
1473
1473
  // ../node_modules/ansi-to-html/lib/ansi_to_html.js
1474
- var _n = O((Gf, Ln) => {
1474
+ var zn = I((Xf, Bn) => {
1475
1475
  "use strict";
1476
- function nl(r, e) {
1476
+ function cl(r, e) {
1477
1477
  if (!(r instanceof e))
1478
1478
  throw new TypeError("Cannot call a class as a function");
1479
1479
  }
1480
- n(nl, "_classCallCheck");
1481
- function vn(r, e) {
1480
+ n(cl, "_classCallCheck");
1481
+ function On(r, e) {
1482
1482
  for (var t = 0; t < e.length; t++) {
1483
1483
  var o = e[t];
1484
1484
  o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, o.key, o);
1485
1485
  }
1486
1486
  }
1487
- n(vn, "_defineProperties");
1488
- function sl(r, e, t) {
1489
- return e && vn(r.prototype, e), t && vn(r, t), r;
1487
+ n(On, "_defineProperties");
1488
+ function dl(r, e, t) {
1489
+ return e && On(r.prototype, e), t && On(r, t), r;
1490
1490
  }
1491
- n(sl, "_createClass");
1492
- function kn(r, e) {
1491
+ n(dl, "_createClass");
1492
+ function Nn(r, e) {
1493
1493
  var t = typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
1494
1494
  if (!t) {
1495
- if (Array.isArray(r) || (t = il(r)) || e && r && typeof r.length == "number") {
1495
+ if (Array.isArray(r) || (t = pl(r)) || e && r && typeof r.length == "number") {
1496
1496
  t && (r = t);
1497
1497
  var o = 0, s = /* @__PURE__ */ n(function() {
1498
1498
  }, "F");
@@ -1521,32 +1521,32 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1521
1521
  }
1522
1522
  }, "f") };
1523
1523
  }
1524
- n(kn, "_createForOfIteratorHelper");
1525
- function il(r, e) {
1524
+ n(Nn, "_createForOfIteratorHelper");
1525
+ function pl(r, e) {
1526
1526
  if (r) {
1527
- if (typeof r == "string") return Pn(r, e);
1527
+ if (typeof r == "string") return Dn(r, e);
1528
1528
  var t = Object.prototype.toString.call(r).slice(8, -1);
1529
1529
  if (t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set") return Array.from(r);
1530
- if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Pn(r, e);
1530
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Dn(r, e);
1531
1531
  }
1532
1532
  }
1533
- n(il, "_unsupportedIterableToArray");
1534
- function Pn(r, e) {
1533
+ n(pl, "_unsupportedIterableToArray");
1534
+ function Dn(r, e) {
1535
1535
  (e == null || e > r.length) && (e = r.length);
1536
1536
  for (var t = 0, o = new Array(e); t < e; t++)
1537
1537
  o[t] = r[t];
1538
1538
  return o;
1539
1539
  }
1540
- n(Pn, "_arrayLikeToArray");
1541
- var al = Cn(), Fn = {
1540
+ n(Dn, "_arrayLikeToArray");
1541
+ var ul = In(), kn = {
1542
1542
  fg: "#FFF",
1543
1543
  bg: "#000",
1544
1544
  newline: !1,
1545
1545
  escapeXML: !1,
1546
1546
  stream: !1,
1547
- colors: ll()
1547
+ colors: fl()
1548
1548
  };
1549
- function ll() {
1549
+ function fl() {
1550
1550
  var r = {
1551
1551
  0: "#000",
1552
1552
  1: "#A00",
@@ -1565,35 +1565,35 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1565
1565
  14: "#5FF",
1566
1566
  15: "#FFF"
1567
1567
  };
1568
- return dr(0, 5).forEach(function(e) {
1569
- dr(0, 5).forEach(function(t) {
1570
- dr(0, 5).forEach(function(o) {
1571
- return cl(e, t, o, r);
1568
+ return fr(0, 5).forEach(function(e) {
1569
+ fr(0, 5).forEach(function(t) {
1570
+ fr(0, 5).forEach(function(o) {
1571
+ return yl(e, t, o, r);
1572
1572
  });
1573
1573
  });
1574
- }), dr(0, 23).forEach(function(e) {
1575
- var t = e + 232, o = jn(e * 10 + 8);
1574
+ }), fr(0, 23).forEach(function(e) {
1575
+ var t = e + 232, o = Ln(e * 10 + 8);
1576
1576
  r[t] = "#" + o + o + o;
1577
1577
  }), r;
1578
1578
  }
1579
- n(ll, "getDefaultColors");
1580
- function cl(r, e, t, o) {
1579
+ n(fl, "getDefaultColors");
1580
+ function yl(r, e, t, o) {
1581
1581
  var s = 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;
1582
- o[s] = dl([i, a, l]);
1582
+ o[s] = ml([i, a, l]);
1583
1583
  }
1584
- n(cl, "setStyleColor");
1585
- function jn(r) {
1584
+ n(yl, "setStyleColor");
1585
+ function Ln(r) {
1586
1586
  for (var e = r.toString(16); e.length < 2; )
1587
1587
  e = "0" + e;
1588
1588
  return e;
1589
1589
  }
1590
- n(jn, "toHexString");
1591
- function dl(r) {
1592
- var e = [], t = kn(r), o;
1590
+ n(Ln, "toHexString");
1591
+ function ml(r) {
1592
+ var e = [], t = Nn(r), o;
1593
1593
  try {
1594
1594
  for (t.s(); !(o = t.n()).done; ) {
1595
1595
  var s = o.value;
1596
- e.push(jn(s));
1596
+ e.push(Ln(s));
1597
1597
  }
1598
1598
  } catch (i) {
1599
1599
  t.e(i);
@@ -1602,123 +1602,123 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1602
1602
  }
1603
1603
  return "#" + e.join("");
1604
1604
  }
1605
- n(dl, "toColorHexString");
1606
- function In(r, e, t, o) {
1605
+ n(ml, "toColorHexString");
1606
+ function jn(r, e, t, o) {
1607
1607
  var s;
1608
- return e === "text" ? s = yl(t, o) : e === "display" ? s = ul(r, t, o) : e === "xterm256Foreground" ? s = ur(r, o.colors[t]) : e === "xt\
1609
- erm256Background" ? s = fr(r, o.colors[t]) : e === "rgb" && (s = pl(r, t)), s;
1608
+ return e === "text" ? s = Sl(t, o) : e === "display" ? s = gl(r, t, o) : e === "xterm256Foreground" ? s = mr(r, o.colors[t]) : e === "xt\
1609
+ erm256Background" ? s = hr(r, o.colors[t]) : e === "rgb" && (s = hl(r, t)), s;
1610
1610
  }
1611
- n(In, "generateOutput");
1612
- function pl(r, e) {
1611
+ n(jn, "generateOutput");
1612
+ function hl(r, e) {
1613
1613
  e = e.substring(2).slice(0, -1);
1614
1614
  var t = +e.substr(0, 2), o = e.substring(5).split(";"), s = o.map(function(i) {
1615
1615
  return ("0" + Number(i).toString(16)).substr(-2);
1616
1616
  }).join("");
1617
- return pr(r, (t === 38 ? "color:#" : "background-color:#") + s);
1617
+ return yr(r, (t === 38 ? "color:#" : "background-color:#") + s);
1618
1618
  }
1619
- n(pl, "handleRgb");
1620
- function ul(r, e, t) {
1619
+ n(hl, "handleRgb");
1620
+ function gl(r, e, t) {
1621
1621
  e = parseInt(e, 10);
1622
1622
  var o = {
1623
1623
  "-1": /* @__PURE__ */ n(function() {
1624
1624
  return "<br/>";
1625
1625
  }, "_"),
1626
1626
  0: /* @__PURE__ */ n(function() {
1627
- return r.length && Mn(r);
1627
+ return r.length && qn(r);
1628
1628
  }, "_"),
1629
1629
  1: /* @__PURE__ */ n(function() {
1630
- return ee(r, "b");
1630
+ return re(r, "b");
1631
1631
  }, "_"),
1632
1632
  3: /* @__PURE__ */ n(function() {
1633
- return ee(r, "i");
1633
+ return re(r, "i");
1634
1634
  }, "_"),
1635
1635
  4: /* @__PURE__ */ n(function() {
1636
- return ee(r, "u");
1636
+ return re(r, "u");
1637
1637
  }, "_"),
1638
1638
  8: /* @__PURE__ */ n(function() {
1639
- return pr(r, "display:none");
1639
+ return yr(r, "display:none");
1640
1640
  }, "_"),
1641
1641
  9: /* @__PURE__ */ n(function() {
1642
- return ee(r, "strike");
1642
+ return re(r, "strike");
1643
1643
  }, "_"),
1644
1644
  22: /* @__PURE__ */ n(function() {
1645
- return pr(r, "font-weight:normal;text-decoration:none;font-style:normal");
1645
+ return yr(r, "font-weight:normal;text-decoration:none;font-style:normal");
1646
1646
  }, "_"),
1647
1647
  23: /* @__PURE__ */ n(function() {
1648
- return Dn(r, "i");
1648
+ return _n(r, "i");
1649
1649
  }, "_"),
1650
1650
  24: /* @__PURE__ */ n(function() {
1651
- return Dn(r, "u");
1651
+ return _n(r, "u");
1652
1652
  }, "_"),
1653
1653
  39: /* @__PURE__ */ n(function() {
1654
- return ur(r, t.fg);
1654
+ return mr(r, t.fg);
1655
1655
  }, "_"),
1656
1656
  49: /* @__PURE__ */ n(function() {
1657
- return fr(r, t.bg);
1657
+ return hr(r, t.bg);
1658
1658
  }, "_"),
1659
1659
  53: /* @__PURE__ */ n(function() {
1660
- return pr(r, "text-decoration:overline");
1660
+ return yr(r, "text-decoration:overline");
1661
1661
  }, "_")
1662
1662
  }, s;
1663
- return o[e] ? s = o[e]() : 4 < e && e < 7 ? s = ee(r, "blink") : 29 < e && e < 38 ? s = ur(r, t.colors[e - 30]) : 39 < e && e < 48 ? s =
1664
- fr(r, t.colors[e - 40]) : 89 < e && e < 98 ? s = ur(r, t.colors[8 + (e - 90)]) : 99 < e && e < 108 && (s = fr(r, t.colors[8 + (e - 100)])),
1663
+ return o[e] ? s = o[e]() : 4 < e && e < 7 ? s = re(r, "blink") : 29 < e && e < 38 ? s = mr(r, t.colors[e - 30]) : 39 < e && e < 48 ? s =
1664
+ hr(r, t.colors[e - 40]) : 89 < e && e < 98 ? s = mr(r, t.colors[8 + (e - 90)]) : 99 < e && e < 108 && (s = hr(r, t.colors[8 + (e - 100)])),
1665
1665
  s;
1666
1666
  }
1667
- n(ul, "handleDisplay");
1668
- function Mn(r) {
1667
+ n(gl, "handleDisplay");
1668
+ function qn(r) {
1669
1669
  var e = r.slice(0);
1670
1670
  return r.length = 0, e.reverse().map(function(t) {
1671
1671
  return "</" + t + ">";
1672
1672
  }).join("");
1673
1673
  }
1674
- n(Mn, "resetStyles");
1675
- function dr(r, e) {
1674
+ n(qn, "resetStyles");
1675
+ function fr(r, e) {
1676
1676
  for (var t = [], o = r; o <= e; o++)
1677
1677
  t.push(o);
1678
1678
  return t;
1679
1679
  }
1680
- n(dr, "range");
1681
- function fl(r) {
1680
+ n(fr, "range");
1681
+ function bl(r) {
1682
1682
  return function(e) {
1683
1683
  return (r === null || e.category !== r) && r !== "all";
1684
1684
  };
1685
1685
  }
1686
- n(fl, "notCategory");
1687
- function On(r) {
1686
+ n(bl, "notCategory");
1687
+ function Mn(r) {
1688
1688
  r = parseInt(r, 10);
1689
1689
  var e = null;
1690
1690
  return r === 0 ? e = "all" : r === 1 ? e = "bold" : 2 < r && r < 5 ? e = "underline" : 4 < r && r < 7 ? e = "blink" : r === 8 ? e = "hid\
1691
1691
  e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ? e = "foreground-color" : (39 < r && r < 48 || r === 49 || 99 <
1692
1692
  r && r < 108) && (e = "background-color"), e;
1693
1693
  }
1694
- n(On, "categoryForCode");
1695
- function yl(r, e) {
1696
- return e.escapeXML ? al.encodeXML(r) : r;
1694
+ n(Mn, "categoryForCode");
1695
+ function Sl(r, e) {
1696
+ return e.escapeXML ? ul.encodeXML(r) : r;
1697
1697
  }
1698
- n(yl, "pushText");
1699
- function ee(r, e, t) {
1698
+ n(Sl, "pushText");
1699
+ function re(r, e, t) {
1700
1700
  return t || (t = ""), r.push(e), "<".concat(e).concat(t ? ' style="'.concat(t, '"') : "", ">");
1701
1701
  }
1702
- n(ee, "pushTag");
1703
- function pr(r, e) {
1704
- return ee(r, "span", e);
1702
+ n(re, "pushTag");
1703
+ function yr(r, e) {
1704
+ return re(r, "span", e);
1705
1705
  }
1706
- n(pr, "pushStyle");
1707
- function ur(r, e) {
1708
- return ee(r, "span", "color:" + e);
1706
+ n(yr, "pushStyle");
1707
+ function mr(r, e) {
1708
+ return re(r, "span", "color:" + e);
1709
1709
  }
1710
- n(ur, "pushForegroundColor");
1711
- function fr(r, e) {
1712
- return ee(r, "span", "background-color:" + e);
1710
+ n(mr, "pushForegroundColor");
1711
+ function hr(r, e) {
1712
+ return re(r, "span", "background-color:" + e);
1713
1713
  }
1714
- n(fr, "pushBackgroundColor");
1715
- function Dn(r, e) {
1714
+ n(hr, "pushBackgroundColor");
1715
+ function _n(r, e) {
1716
1716
  var t;
1717
1717
  if (r.slice(-1)[0] === e && (t = r.pop()), t)
1718
1718
  return "</" + e + ">";
1719
1719
  }
1720
- n(Dn, "closeTag");
1721
- function ml(r, e, t) {
1720
+ n(_n, "closeTag");
1721
+ function Tl(r, e, t) {
1722
1722
  var o = !1, s = 3;
1723
1723
  function i() {
1724
1724
  return "";
@@ -1738,16 +1738,16 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
1738
1738
  n(c, "newline");
1739
1739
  function d(R, w) {
1740
1740
  o = !0, w.trim().length === 0 && (w = "0"), w = w.trimRight(";").split(";");
1741
- var A = kn(w), F;
1741
+ var E = Nn(w), D;
1742
1742
  try {
1743
- for (A.s(); !(F = A.n()).done; ) {
1744
- var j = F.value;
1745
- t("display", j);
1743
+ for (E.s(); !(D = E.n()).done; ) {
1744
+ var k = D.value;
1745
+ t("display", k);
1746
1746
  }
1747
- } catch (N) {
1748
- A.e(N);
1747
+ } catch (L) {
1748
+ E.e(L);
1749
1749
  } finally {
1750
- A.f();
1750
+ E.f();
1751
1751
  }
1752
1752
  return "";
1753
1753
  }
@@ -1839,61 +1839,61 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
1839
1839
  }
1840
1840
  return g;
1841
1841
  }
1842
- n(ml, "tokenize");
1843
- function hl(r, e, t) {
1844
- return e !== "text" && (r = r.filter(fl(On(t))), r.push({
1842
+ n(Tl, "tokenize");
1843
+ function xl(r, e, t) {
1844
+ return e !== "text" && (r = r.filter(bl(Mn(t))), r.push({
1845
1845
  token: e,
1846
1846
  data: t,
1847
- category: On(t)
1847
+ category: Mn(t)
1848
1848
  })), r;
1849
1849
  }
1850
- n(hl, "updateStickyStack");
1851
- var gl = /* @__PURE__ */ function() {
1850
+ n(xl, "updateStickyStack");
1851
+ var Rl = /* @__PURE__ */ function() {
1852
1852
  function r(e) {
1853
- nl(this, r), e = e || {}, e.colors && (e.colors = Object.assign({}, Fn.colors, e.colors)), this.options = Object.assign({}, Fn, e), this.
1853
+ cl(this, r), e = e || {}, e.colors && (e.colors = Object.assign({}, kn.colors, e.colors)), this.options = Object.assign({}, kn, e), this.
1854
1854
  stack = [], this.stickyStack = [];
1855
1855
  }
1856
- return n(r, "Filter"), sl(r, [{
1856
+ return n(r, "Filter"), dl(r, [{
1857
1857
  key: "toHtml",
1858
1858
  value: /* @__PURE__ */ n(function(t) {
1859
1859
  var o = this;
1860
1860
  t = typeof t == "string" ? [t] : t;
1861
1861
  var s = this.stack, i = this.options, a = [];
1862
1862
  return this.stickyStack.forEach(function(l) {
1863
- var c = In(s, l.token, l.data, i);
1863
+ var c = jn(s, l.token, l.data, i);
1864
1864
  c && a.push(c);
1865
- }), ml(t.join(""), i, function(l, c) {
1866
- var d = In(s, l, c, i);
1867
- d && a.push(d), i.stream && (o.stickyStack = hl(o.stickyStack, l, c));
1868
- }), s.length && a.push(Mn(s)), a.join("");
1865
+ }), Tl(t.join(""), i, function(l, c) {
1866
+ var d = jn(s, l, c, i);
1867
+ d && a.push(d), i.stream && (o.stickyStack = xl(o.stickyStack, l, c));
1868
+ }), s.length && a.push(qn(s)), a.join("");
1869
1869
  }, "toHtml")
1870
1870
  }]), r;
1871
1871
  }();
1872
- Ln.exports = gl;
1872
+ Bn.exports = Rl;
1873
1873
  });
1874
1874
 
1875
1875
  // src/preview-api/modules/addons/main.ts
1876
- import { global as br } from "@storybook/global";
1876
+ import { global as xr } from "@storybook/global";
1877
1877
 
1878
1878
  // src/preview-api/modules/addons/storybook-channel-mock.ts
1879
- import { Channel as rs } from "storybook/internal/channels";
1880
- function gr() {
1879
+ import { Channel as ss } from "storybook/internal/channels";
1880
+ function Tr() {
1881
1881
  let r = {
1882
1882
  setHandler: /* @__PURE__ */ n(() => {
1883
1883
  }, "setHandler"),
1884
1884
  send: /* @__PURE__ */ n(() => {
1885
1885
  }, "send")
1886
1886
  };
1887
- return new rs({ transport: r });
1887
+ return new ss({ transport: r });
1888
1888
  }
1889
- n(gr, "mockChannel");
1889
+ n(Tr, "mockChannel");
1890
1890
 
1891
1891
  // src/preview-api/modules/addons/main.ts
1892
- var xr = class xr {
1892
+ var Ar = class Ar {
1893
1893
  constructor() {
1894
1894
  this.getChannel = /* @__PURE__ */ n(() => {
1895
1895
  if (!this.channel) {
1896
- let e = gr();
1896
+ let e = Tr();
1897
1897
  return this.setChannel(e), e;
1898
1898
  }
1899
1899
  return this.channel;
@@ -1908,31 +1908,31 @@ var xr = class xr {
1908
1908
  });
1909
1909
  }
1910
1910
  };
1911
- n(xr, "AddonStore");
1912
- var Tr = xr, Sr = "__STORYBOOK_ADDONS_PREVIEW";
1913
- function ts() {
1914
- return br[Sr] || (br[Sr] = new Tr()), br[Sr];
1911
+ n(Ar, "AddonStore");
1912
+ var wr = Ar, Rr = "__STORYBOOK_ADDONS_PREVIEW";
1913
+ function is() {
1914
+ return xr[Rr] || (xr[Rr] = new wr()), xr[Rr];
1915
1915
  }
1916
- n(ts, "getAddonsStore");
1917
- var L = ts();
1916
+ n(is, "getAddonsStore");
1917
+ var _ = is();
1918
1918
 
1919
1919
  // src/preview-api/modules/addons/definePreview.ts
1920
- function os(r) {
1920
+ function as(r) {
1921
1921
  return r;
1922
1922
  }
1923
- n(os, "definePreview");
1923
+ n(as, "definePreview");
1924
1924
 
1925
1925
  // src/preview-api/modules/addons/hooks.ts
1926
- import { logger as Ae } from "storybook/internal/client-logger";
1926
+ import { logger as Ce } from "storybook/internal/client-logger";
1927
1927
  import {
1928
- FORCE_RE_RENDER as ns,
1929
- RESET_STORY_ARGS as ss,
1930
- STORY_RENDERED as Et,
1931
- UPDATE_GLOBALS as is,
1932
- UPDATE_STORY_ARGS as as
1928
+ FORCE_RE_RENDER as ls,
1929
+ RESET_STORY_ARGS as cs,
1930
+ STORY_RENDERED as vt,
1931
+ UPDATE_GLOBALS as ds,
1932
+ UPDATE_STORY_ARGS as ps
1933
1933
  } from "storybook/internal/core-events";
1934
- import { global as ze } from "@storybook/global";
1935
- var Cr = class Cr {
1934
+ import { global as Ue } from "@storybook/global";
1935
+ var Fr = class Fr {
1936
1936
  constructor() {
1937
1937
  this.hookListsMap = void 0;
1938
1938
  this.mountedDecorators = void 0;
@@ -1972,24 +1972,24 @@ var Cr = class Cr {
1972
1972
  }), this.prevEffects = this.currentEffects, this.currentEffects = [];
1973
1973
  }
1974
1974
  addRenderListeners() {
1975
- this.removeRenderListeners(), L.getChannel().on(Et, this.renderListener);
1975
+ this.removeRenderListeners(), _.getChannel().on(vt, this.renderListener);
1976
1976
  }
1977
1977
  removeRenderListeners() {
1978
- L.getChannel().removeListener(Et, this.renderListener);
1978
+ _.getChannel().removeListener(vt, this.renderListener);
1979
1979
  }
1980
1980
  };
1981
- n(Cr, "HooksContext");
1982
- var re = Cr;
1983
- function At(r) {
1981
+ n(Fr, "HooksContext");
1982
+ var te = Fr;
1983
+ function Pt(r) {
1984
1984
  let e = /* @__PURE__ */ n((...t) => {
1985
1985
  let { hooks: o } = typeof t[0] == "function" ? t[1] : t[0], s = o.currentPhase, i = o.currentHooks, a = o.nextHookIndex, l = o.currentDecoratorName;
1986
1986
  o.currentDecoratorName = r.name, o.prevMountedDecorators.has(r) ? (o.currentPhase = "UPDATE", o.currentHooks = o.hookListsMap.get(r) || []) :
1987
1987
  (o.currentPhase = "MOUNT", o.currentHooks = [], o.hookListsMap.set(r, o.currentHooks), o.prevMountedDecorators.add(r)), o.nextHookIndex =
1988
1988
  0;
1989
- let c = ze.STORYBOOK_HOOKS_CONTEXT;
1990
- ze.STORYBOOK_HOOKS_CONTEXT = o;
1989
+ let c = Ue.STORYBOOK_HOOKS_CONTEXT;
1990
+ Ue.STORYBOOK_HOOKS_CONTEXT = o;
1991
1991
  let d = r(...t);
1992
- if (ze.STORYBOOK_HOOKS_CONTEXT = c, o.currentPhase === "UPDATE" && o.getNextHook() != null)
1992
+ if (Ue.STORYBOOK_HOOKS_CONTEXT = c, o.currentPhase === "UPDATE" && o.getNextHook() != null)
1993
1993
  throw new Error(
1994
1994
  "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
1995
1995
  );
@@ -1997,41 +1997,41 @@ function At(r) {
1997
1997
  }, "hookified");
1998
1998
  return e.originalFn = r, e;
1999
1999
  }
2000
- n(At, "hookify");
2001
- var Rr = 0, ls = 25, wr = /* @__PURE__ */ n((r) => (e, t) => {
2000
+ n(Pt, "hookify");
2001
+ var Er = 0, us = 25, Cr = /* @__PURE__ */ n((r) => (e, t) => {
2002
2002
  let o = r(
2003
- At(e),
2004
- t.map((s) => At(s))
2003
+ Pt(e),
2004
+ t.map((s) => Pt(s))
2005
2005
  );
2006
2006
  return (s) => {
2007
2007
  let { hooks: i } = s;
2008
2008
  i.prevMountedDecorators ??= /* @__PURE__ */ new Set(), i.mountedDecorators = /* @__PURE__ */ new Set([e, ...t]), i.currentContext = s, i.
2009
2009
  hasUpdates = !1;
2010
2010
  let a = o(s);
2011
- for (Rr = 1; i.hasUpdates; )
2012
- if (i.hasUpdates = !1, i.currentEffects = [], a = o(s), Rr += 1, Rr > ls)
2011
+ for (Er = 1; i.hasUpdates; )
2012
+ if (i.hasUpdates = !1, i.currentEffects = [], a = o(s), Er += 1, Er > us)
2013
2013
  throw new Error(
2014
2014
  "Too many re-renders. Storybook limits the number of renders to prevent an infinite loop."
2015
2015
  );
2016
2016
  return i.addRenderListeners(), a;
2017
2017
  };
2018
- }, "applyHooks"), cs = /* @__PURE__ */ n((r, e) => r.length === e.length && r.every((t, o) => t === e[o]), "areDepsEqual"), Er = /* @__PURE__ */ n(
2018
+ }, "applyHooks"), fs = /* @__PURE__ */ n((r, e) => r.length === e.length && r.every((t, o) => t === e[o]), "areDepsEqual"), vr = /* @__PURE__ */ n(
2019
2019
  () => new Error("Storybook preview hooks can only be called inside decorators and story functions."), "invalidHooksError");
2020
- function Ct() {
2021
- return ze.STORYBOOK_HOOKS_CONTEXT || null;
2020
+ function Ft() {
2021
+ return Ue.STORYBOOK_HOOKS_CONTEXT || null;
2022
2022
  }
2023
- n(Ct, "getHooksContextOrNull");
2024
- function Ar() {
2025
- let r = Ct();
2023
+ n(Ft, "getHooksContextOrNull");
2024
+ function Pr() {
2025
+ let r = Ft();
2026
2026
  if (r == null)
2027
- throw Er();
2027
+ throw vr();
2028
2028
  return r;
2029
2029
  }
2030
- n(Ar, "getHooksContextOrThrow");
2031
- function ds(r, e, t) {
2032
- let o = Ar();
2030
+ n(Pr, "getHooksContextOrThrow");
2031
+ function ys(r, e, t) {
2032
+ let o = Pr();
2033
2033
  if (o.currentPhase === "MOUNT") {
2034
- t != null && !Array.isArray(t) && Ae.warn(
2034
+ t != null && !Array.isArray(t) && Ce.warn(
2035
2035
  `${r} received a final argument that is not an array (instead, received ${t}). When specified, the final argument must be an array.`
2036
2036
  );
2037
2037
  let s = { name: r, deps: t };
@@ -2041,22 +2041,22 @@ function ds(r, e, t) {
2041
2041
  let s = o.getNextHook();
2042
2042
  if (s == null)
2043
2043
  throw new Error("Rendered more hooks than during the previous render.");
2044
- return s.name !== r && Ae.warn(
2044
+ return s.name !== r && Ce.warn(
2045
2045
  `Storybook has detected a change in the order of Hooks${o.currentDecoratorName ? ` called by ${o.currentDecoratorName}` : ""}. This wi\
2046
2046
  ll lead to bugs and errors if not fixed.`
2047
- ), t != null && s.deps == null && Ae.warn(
2047
+ ), t != null && s.deps == null && Ce.warn(
2048
2048
  `${r} received a final argument during this render, but not during the previous render. Even though the final argument is optional, it\
2049
2049
  s type cannot change between renders.`
2050
- ), t != null && s.deps != null && t.length !== s.deps.length && Ae.warn(`The final argument passed to ${r} changed size between renders.\
2050
+ ), t != null && s.deps != null && t.length !== s.deps.length && Ce.warn(`The final argument passed to ${r} changed size between renders.\
2051
2051
  The order and size of this array must remain constant.
2052
2052
  Previous: ${s.deps}
2053
- Incoming: ${t}`), (t == null || s.deps == null || !cs(t, s.deps)) && (e(s), s.deps = t), s;
2053
+ Incoming: ${t}`), (t == null || s.deps == null || !fs(t, s.deps)) && (e(s), s.deps = t), s;
2054
2054
  }
2055
- throw Er();
2055
+ throw vr();
2056
2056
  }
2057
- n(ds, "useHook");
2058
- function Ge(r, e, t) {
2059
- let { memoizedState: o } = ds(
2057
+ n(ys, "useHook");
2058
+ function He(r, e, t) {
2059
+ let { memoizedState: o } = ys(
2060
2060
  r,
2061
2061
  (s) => {
2062
2062
  s.memoizedState = e();
@@ -2065,104 +2065,104 @@ function Ge(r, e, t) {
2065
2065
  );
2066
2066
  return o;
2067
2067
  }
2068
- n(Ge, "useMemoLike");
2069
- function ps(r, e) {
2070
- return Ge("useMemo", r, e);
2068
+ n(He, "useMemoLike");
2069
+ function ms(r, e) {
2070
+ return He("useMemo", r, e);
2071
2071
  }
2072
- n(ps, "useMemo");
2073
- function Ce(r, e) {
2074
- return Ge("useCallback", () => r, e);
2072
+ n(ms, "useMemo");
2073
+ function ve(r, e) {
2074
+ return He("useCallback", () => r, e);
2075
2075
  }
2076
- n(Ce, "useCallback");
2077
- function vt(r, e) {
2078
- return Ge(r, () => ({ current: e }), []);
2076
+ n(ve, "useCallback");
2077
+ function It(r, e) {
2078
+ return He(r, () => ({ current: e }), []);
2079
2079
  }
2080
- n(vt, "useRefLike");
2081
- function us(r) {
2082
- return vt("useRef", r);
2080
+ n(It, "useRefLike");
2081
+ function hs(r) {
2082
+ return It("useRef", r);
2083
2083
  }
2084
- n(us, "useRef");
2085
- function fs() {
2086
- let r = Ct();
2084
+ n(hs, "useRef");
2085
+ function gs() {
2086
+ let r = Ft();
2087
2087
  if (r != null && r.currentPhase !== "NONE")
2088
2088
  r.hasUpdates = !0;
2089
2089
  else
2090
2090
  try {
2091
- L.getChannel().emit(ns);
2091
+ _.getChannel().emit(ls);
2092
2092
  } catch {
2093
- Ae.warn("State updates of Storybook preview hooks work only in browser");
2093
+ Ce.warn("State updates of Storybook preview hooks work only in browser");
2094
2094
  }
2095
2095
  }
2096
- n(fs, "triggerUpdate");
2097
- function Pt(r, e) {
2098
- let t = vt(
2096
+ n(gs, "triggerUpdate");
2097
+ function Ot(r, e) {
2098
+ let t = It(
2099
2099
  r,
2100
2100
  // @ts-expect-error S type should never be function, but there's no way to tell that to TypeScript
2101
2101
  typeof e == "function" ? e() : e
2102
2102
  ), o = /* @__PURE__ */ n((s) => {
2103
- t.current = typeof s == "function" ? s(t.current) : s, fs();
2103
+ t.current = typeof s == "function" ? s(t.current) : s, gs();
2104
2104
  }, "setState");
2105
2105
  return [t.current, o];
2106
2106
  }
2107
- n(Pt, "useStateLike");
2108
- function ys(r) {
2109
- return Pt("useState", r);
2107
+ n(Ot, "useStateLike");
2108
+ function bs(r) {
2109
+ return Ot("useState", r);
2110
2110
  }
2111
- n(ys, "useState");
2112
- function ms(r, e, t) {
2113
- let o = t != null ? () => t(e) : e, [s, i] = Pt("useReducer", o);
2111
+ n(bs, "useState");
2112
+ function Ss(r, e, t) {
2113
+ let o = t != null ? () => t(e) : e, [s, i] = Ot("useReducer", o);
2114
2114
  return [s, /* @__PURE__ */ n((l) => i((c) => r(c, l)), "dispatch")];
2115
2115
  }
2116
- n(ms, "useReducer");
2117
- function Ft(r, e) {
2118
- let t = Ar(), o = Ge("useEffect", () => ({ create: r }), e);
2116
+ n(Ss, "useReducer");
2117
+ function Dt(r, e) {
2118
+ let t = Pr(), o = He("useEffect", () => ({ create: r }), e);
2119
2119
  t.currentEffects.includes(o) || t.currentEffects.push(o);
2120
2120
  }
2121
- n(Ft, "useEffect");
2122
- function hs(r, e = []) {
2123
- let t = L.getChannel();
2124
- return Ft(() => (Object.entries(r).forEach(([o, s]) => t.on(o, s)), () => {
2121
+ n(Dt, "useEffect");
2122
+ function Ts(r, e = []) {
2123
+ let t = _.getChannel();
2124
+ return Dt(() => (Object.entries(r).forEach(([o, s]) => t.on(o, s)), () => {
2125
2125
  Object.entries(r).forEach(
2126
2126
  ([o, s]) => t.removeListener(o, s)
2127
2127
  );
2128
- }), [...Object.keys(r), ...e]), Ce(t.emit.bind(t), [t]);
2128
+ }), [...Object.keys(r), ...e]), ve(t.emit.bind(t), [t]);
2129
2129
  }
2130
- n(hs, "useChannel");
2131
- function Ue() {
2132
- let { currentContext: r } = Ar();
2130
+ n(Ts, "useChannel");
2131
+ function Ve() {
2132
+ let { currentContext: r } = Pr();
2133
2133
  if (r == null)
2134
- throw Er();
2134
+ throw vr();
2135
2135
  return r;
2136
2136
  }
2137
- n(Ue, "useStoryContext");
2138
- function gs(r, e) {
2139
- let { parameters: t } = Ue();
2137
+ n(Ve, "useStoryContext");
2138
+ function xs(r, e) {
2139
+ let { parameters: t } = Ve();
2140
2140
  if (r)
2141
2141
  return t[r] ?? e;
2142
2142
  }
2143
- n(gs, "useParameter");
2144
- function bs() {
2145
- let r = L.getChannel(), { id: e, args: t } = Ue(), o = Ce(
2146
- (i) => r.emit(as, { storyId: e, updatedArgs: i }),
2143
+ n(xs, "useParameter");
2144
+ function Rs() {
2145
+ let r = _.getChannel(), { id: e, args: t } = Ve(), o = ve(
2146
+ (i) => r.emit(ps, { storyId: e, updatedArgs: i }),
2147
2147
  [r, e]
2148
- ), s = Ce(
2149
- (i) => r.emit(ss, { storyId: e, argNames: i }),
2148
+ ), s = ve(
2149
+ (i) => r.emit(cs, { storyId: e, argNames: i }),
2150
2150
  [r, e]
2151
2151
  );
2152
2152
  return [t, o, s];
2153
2153
  }
2154
- n(bs, "useArgs");
2155
- function Ss() {
2156
- let r = L.getChannel(), { globals: e } = Ue(), t = Ce(
2157
- (o) => r.emit(is, { globals: o }),
2154
+ n(Rs, "useArgs");
2155
+ function ws() {
2156
+ let r = _.getChannel(), { globals: e } = Ve(), t = ve(
2157
+ (o) => r.emit(ds, { globals: o }),
2158
2158
  [r]
2159
2159
  );
2160
2160
  return [e, t];
2161
2161
  }
2162
- n(Ss, "useGlobals");
2162
+ n(ws, "useGlobals");
2163
2163
 
2164
2164
  // src/preview-api/modules/addons/make-decorator.ts
2165
- var Ts = /* @__PURE__ */ n(({
2165
+ var As = /* @__PURE__ */ n(({
2166
2166
  name: r,
2167
2167
  parameterName: e,
2168
2168
  wrapper: t,
@@ -2187,46 +2187,46 @@ var Ts = /* @__PURE__ */ n(({
2187
2187
 
2188
2188
  // src/preview-api/modules/store/StoryStore.ts
2189
2189
  import {
2190
- CalledExtractOnStoreError as si,
2191
- MissingStoryFromCsfFileError as ii
2190
+ CalledExtractOnStoreError as di,
2191
+ MissingStoryFromCsfFileError as pi
2192
2192
  } from "storybook/internal/preview-errors";
2193
2193
 
2194
2194
  // ../node_modules/es-toolkit/dist/function/noop.mjs
2195
- function It() {
2195
+ function kt() {
2196
2196
  }
2197
- n(It, "noop");
2197
+ n(kt, "noop");
2198
2198
 
2199
2199
  // ../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
2200
- function vr(r) {
2200
+ function Ir(r) {
2201
2201
  return Object.getOwnPropertySymbols(r).filter((e) => Object.prototype.propertyIsEnumerable.call(r, e));
2202
2202
  }
2203
- n(vr, "getSymbols");
2203
+ n(Ir, "getSymbols");
2204
2204
 
2205
2205
  // ../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
2206
- function Pr(r) {
2206
+ function Or(r) {
2207
2207
  return r == null ? r === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(r);
2208
2208
  }
2209
- n(Pr, "getTag");
2209
+ n(Or, "getTag");
2210
2210
 
2211
2211
  // ../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
2212
- var Ot = "[object RegExp]", Dt = "[object String]", kt = "[object Number]", jt = "[object Boolean]", Fr = "[object Arguments]", Mt = "[objec\
2213
- t Symbol]", Lt = "[object Date]", _t = "[object Map]", Nt = "[object Set]", qt = "[object Array]", Bt = "[object Function]", zt = "[object A\
2214
- rrayBuffer]", He = "[object Object]", Gt = "[object Error]", Ut = "[object DataView]", Ht = "[object Uint8Array]", Vt = "[object Uint8Clampe\
2215
- dArray]", Wt = "[object Uint16Array]", $t = "[object Uint32Array]", Yt = "[object BigUint64Array]", Kt = "[object Int8Array]", Xt = "[object\
2216
- Int16Array]", Jt = "[object Int32Array]", Qt = "[object BigInt64Array]", Zt = "[object Float32Array]", eo = "[object Float64Array]";
2212
+ var jt = "[object RegExp]", Mt = "[object String]", _t = "[object Number]", Nt = "[object Boolean]", Dr = "[object Arguments]", Lt = "[objec\
2213
+ t Symbol]", qt = "[object Date]", Bt = "[object Map]", zt = "[object Set]", Gt = "[object Array]", Ut = "[object Function]", Ht = "[object A\
2214
+ rrayBuffer]", We = "[object Object]", Vt = "[object Error]", Wt = "[object DataView]", $t = "[object Uint8Array]", Yt = "[object Uint8Clampe\
2215
+ dArray]", Kt = "[object Uint16Array]", Xt = "[object Uint32Array]", Jt = "[object BigUint64Array]", Qt = "[object Int8Array]", Zt = "[object\
2216
+ Int16Array]", eo = "[object Int32Array]", ro = "[object BigInt64Array]", to = "[object Float32Array]", oo = "[object Float64Array]";
2217
2217
 
2218
2218
  // ../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
2219
- function k(r) {
2219
+ function j(r) {
2220
2220
  if (!r || typeof r != "object")
2221
2221
  return !1;
2222
2222
  let e = Object.getPrototypeOf(r);
2223
2223
  return e === null || e === Object.prototype || Object.getPrototypeOf(e) === null ? Object.prototype.toString.call(r) === "[object Object]" :
2224
2224
  !1;
2225
2225
  }
2226
- n(k, "isPlainObject");
2226
+ n(j, "isPlainObject");
2227
2227
 
2228
2228
  // ../node_modules/es-toolkit/dist/object/mapValues.mjs
2229
- function H(r, e) {
2229
+ function V(r, e) {
2230
2230
  let t = {}, o = Object.keys(r);
2231
2231
  for (let s = 0; s < o.length; s++) {
2232
2232
  let i = o[s], a = r[i];
@@ -2234,10 +2234,10 @@ function H(r, e) {
2234
2234
  }
2235
2235
  return t;
2236
2236
  }
2237
- n(H, "mapValues");
2237
+ n(V, "mapValues");
2238
2238
 
2239
2239
  // ../node_modules/es-toolkit/dist/object/pickBy.mjs
2240
- function Ir(r, e) {
2240
+ function kr(r, e) {
2241
2241
  let t = {}, o = Object.keys(r);
2242
2242
  for (let s = 0; s < o.length; s++) {
2243
2243
  let i = o[s], a = r[i];
@@ -2245,20 +2245,20 @@ function Ir(r, e) {
2245
2245
  }
2246
2246
  return t;
2247
2247
  }
2248
- n(Ir, "pickBy");
2248
+ n(kr, "pickBy");
2249
2249
 
2250
2250
  // ../node_modules/es-toolkit/dist/compat/util/eq.mjs
2251
- function ro(r, e) {
2251
+ function no(r, e) {
2252
2252
  return r === e || Number.isNaN(r) && Number.isNaN(e);
2253
2253
  }
2254
- n(ro, "eq");
2254
+ n(no, "eq");
2255
2255
 
2256
2256
  // ../node_modules/es-toolkit/dist/predicate/isEqualWith.mjs
2257
- function to(r, e, t) {
2258
- return ve(r, e, void 0, void 0, void 0, void 0, t);
2257
+ function so(r, e, t) {
2258
+ return Pe(r, e, void 0, void 0, void 0, void 0, t);
2259
2259
  }
2260
- n(to, "isEqualWith");
2261
- function ve(r, e, t, o, s, i, a) {
2260
+ n(so, "isEqualWith");
2261
+ function Pe(r, e, t, o, s, i, a) {
2262
2262
  let l = a(r, e, t, o, s, i);
2263
2263
  if (l !== void 0)
2264
2264
  return l;
@@ -2275,31 +2275,31 @@ function ve(r, e, t, o, s, i, a) {
2275
2275
  case "function":
2276
2276
  return r === e;
2277
2277
  case "object":
2278
- return Pe(r, e, i, a);
2278
+ return Fe(r, e, i, a);
2279
2279
  }
2280
- return Pe(r, e, i, a);
2280
+ return Fe(r, e, i, a);
2281
2281
  }
2282
- n(ve, "isEqualWithImpl");
2283
- function Pe(r, e, t, o) {
2282
+ n(Pe, "isEqualWithImpl");
2283
+ function Fe(r, e, t, o) {
2284
2284
  if (Object.is(r, e))
2285
2285
  return !0;
2286
- let s = Pr(r), i = Pr(e);
2287
- if (s === Fr && (s = He), i === Fr && (i = He), s !== i)
2286
+ let s = Or(r), i = Or(e);
2287
+ if (s === Dr && (s = We), i === Dr && (i = We), s !== i)
2288
2288
  return !1;
2289
2289
  switch (s) {
2290
- case Dt:
2290
+ case Mt:
2291
2291
  return r.toString() === e.toString();
2292
- case kt: {
2292
+ case _t: {
2293
2293
  let c = r.valueOf(), d = e.valueOf();
2294
- return ro(c, d);
2294
+ return no(c, d);
2295
2295
  }
2296
- case jt:
2296
+ case Nt:
2297
+ case qt:
2297
2298
  case Lt:
2298
- case Mt:
2299
2299
  return Object.is(r.valueOf(), e.valueOf());
2300
- case Ot:
2300
+ case jt:
2301
2301
  return r.source === e.source && r.flags === e.flags;
2302
- case Bt:
2302
+ case Ut:
2303
2303
  return r === e;
2304
2304
  }
2305
2305
  t = t ?? /* @__PURE__ */ new Map();
@@ -2309,30 +2309,27 @@ function Pe(r, e, t, o) {
2309
2309
  t.set(r, e), t.set(e, r);
2310
2310
  try {
2311
2311
  switch (s) {
2312
- case _t: {
2312
+ case Bt: {
2313
2313
  if (r.size !== e.size)
2314
2314
  return !1;
2315
2315
  for (let [c, d] of r.entries())
2316
- if (!e.has(c) || !ve(d, e.get(c), c, r, e, t, o))
2316
+ if (!e.has(c) || !Pe(d, e.get(c), c, r, e, t, o))
2317
2317
  return !1;
2318
2318
  return !0;
2319
2319
  }
2320
- case Nt: {
2320
+ case zt: {
2321
2321
  if (r.size !== e.size)
2322
2322
  return !1;
2323
2323
  let c = Array.from(r.values()), d = Array.from(e.values());
2324
2324
  for (let p = 0; p < c.length; p++) {
2325
- let u = c[p], y = d.findIndex((h) => ve(u, h, void 0, r, e, t, o));
2325
+ let u = c[p], y = d.findIndex((h) => Pe(u, h, void 0, r, e, t, o));
2326
2326
  if (y === -1)
2327
2327
  return !1;
2328
2328
  d.splice(y, 1);
2329
2329
  }
2330
2330
  return !0;
2331
2331
  }
2332
- case qt:
2333
- case Ht:
2334
- case Vt:
2335
- case Wt:
2332
+ case Gt:
2336
2333
  case $t:
2337
2334
  case Yt:
2338
2335
  case Kt:
@@ -2340,24 +2337,27 @@ function Pe(r, e, t, o) {
2340
2337
  case Jt:
2341
2338
  case Qt:
2342
2339
  case Zt:
2343
- case eo: {
2340
+ case eo:
2341
+ case ro:
2342
+ case to:
2343
+ case oo: {
2344
2344
  if (typeof Buffer < "u" && Buffer.isBuffer(r) !== Buffer.isBuffer(e) || r.length !== e.length)
2345
2345
  return !1;
2346
2346
  for (let c = 0; c < r.length; c++)
2347
- if (!ve(r[c], e[c], c, r, e, t, o))
2347
+ if (!Pe(r[c], e[c], c, r, e, t, o))
2348
2348
  return !1;
2349
2349
  return !0;
2350
2350
  }
2351
- case zt:
2352
- return r.byteLength !== e.byteLength ? !1 : Pe(new Uint8Array(r), new Uint8Array(e), t, o);
2353
- case Ut:
2354
- return r.byteLength !== e.byteLength || r.byteOffset !== e.byteOffset ? !1 : Pe(new Uint8Array(r), new Uint8Array(e), t, o);
2355
- case Gt:
2351
+ case Ht:
2352
+ return r.byteLength !== e.byteLength ? !1 : Fe(new Uint8Array(r), new Uint8Array(e), t, o);
2353
+ case Wt:
2354
+ return r.byteLength !== e.byteLength || r.byteOffset !== e.byteOffset ? !1 : Fe(new Uint8Array(r), new Uint8Array(e), t, o);
2355
+ case Vt:
2356
2356
  return r.name === e.name && r.message === e.message;
2357
- case He: {
2358
- if (!(Pe(r.constructor, e.constructor, t, o) || k(r) && k(e)))
2357
+ case We: {
2358
+ if (!(Fe(r.constructor, e.constructor, t, o) || j(r) && j(e)))
2359
2359
  return !1;
2360
- let d = [...Object.keys(r), ...vr(r)], p = [...Object.keys(e), ...vr(e)];
2360
+ let d = [...Object.keys(r), ...Ir(r)], p = [...Object.keys(e), ...Ir(e)];
2361
2361
  if (d.length !== p.length)
2362
2362
  return !1;
2363
2363
  for (let u = 0; u < d.length; u++) {
@@ -2365,7 +2365,7 @@ function Pe(r, e, t, o) {
2365
2365
  if (!Object.hasOwn(e, y))
2366
2366
  return !1;
2367
2367
  let g = e[y];
2368
- if (!ve(h, g, y, r, e, t, o))
2368
+ if (!Pe(h, g, y, r, e, t, o))
2369
2369
  return !1;
2370
2370
  }
2371
2371
  return !0;
@@ -2377,50 +2377,50 @@ function Pe(r, e, t, o) {
2377
2377
  t.delete(r), t.delete(e);
2378
2378
  }
2379
2379
  }
2380
- n(Pe, "areObjectsEqual");
2380
+ n(Fe, "areObjectsEqual");
2381
2381
 
2382
2382
  // ../node_modules/es-toolkit/dist/predicate/isEqual.mjs
2383
- function Or(r, e) {
2384
- return to(r, e, It);
2383
+ function jr(r, e) {
2384
+ return so(r, e, kt);
2385
2385
  }
2386
- n(Or, "isEqual");
2386
+ n(jr, "isEqual");
2387
2387
 
2388
2388
  // src/preview-api/modules/store/StoryStore.ts
2389
- var Ze = ue(kr(), 1);
2389
+ var tr = ue(_r(), 1);
2390
2390
 
2391
- // src/preview-api/core-annotations.ts
2392
- import no from "storybook/internal/component-testing/preview";
2393
- import so from "storybook/actions/preview";
2394
- import io from "storybook/backgrounds/preview";
2395
- import ao from "storybook/highlight/preview";
2396
- import lo from "storybook/measure/preview";
2397
- import co from "storybook/outline/preview";
2398
- import po from "storybook/test/preview";
2399
- import uo from "storybook/viewport/preview";
2400
- function te() {
2391
+ // src/shared/preview/core-annotations.ts
2392
+ import ao from "storybook/internal/component-testing/preview";
2393
+ import lo from "storybook/actions/preview";
2394
+ import co from "storybook/backgrounds/preview";
2395
+ import po from "storybook/highlight/preview";
2396
+ import uo from "storybook/measure/preview";
2397
+ import fo from "storybook/outline/preview";
2398
+ import yo from "storybook/test/preview";
2399
+ import mo from "storybook/viewport/preview";
2400
+ function Ie() {
2401
2401
  return [
2402
2402
  // @ts-expect-error CJS fallback
2403
- (lo.default ?? lo)(),
2403
+ (uo.default ?? uo)(),
2404
2404
  // @ts-expect-error CJS fallback
2405
- (io.default ?? io)(),
2405
+ (co.default ?? co)(),
2406
2406
  // @ts-expect-error CJS fallback
2407
- (ao.default ?? ao)(),
2407
+ (po.default ?? po)(),
2408
2408
  // @ts-expect-error CJS fallback
2409
- (co.default ?? co)(),
2409
+ (fo.default ?? fo)(),
2410
2410
  // @ts-expect-error CJS fallback
2411
- (uo.default ?? uo)(),
2411
+ (mo.default ?? mo)(),
2412
2412
  // @ts-expect-error CJS fallback
2413
- (so.default ?? so)(),
2413
+ (lo.default ?? lo)(),
2414
2414
  // @ts-expect-error CJS fallback
2415
- (no.default ?? no)(),
2415
+ (ao.default ?? ao)(),
2416
2416
  // @ts-expect-error CJS fallback
2417
- (po.default ?? po)()
2417
+ (yo.default ?? yo)()
2418
2418
  ];
2419
2419
  }
2420
- n(te, "getCoreAnnotations");
2420
+ n(Ie, "getCoreAnnotations");
2421
2421
 
2422
2422
  // src/preview-api/modules/store/args.ts
2423
- import { once as jr } from "storybook/internal/client-logger";
2423
+ import { once as Nr } from "storybook/internal/client-logger";
2424
2424
 
2425
2425
  // ../node_modules/ts-dedent/esm/index.js
2426
2426
  function P(r) {
@@ -2458,7 +2458,7 @@ function P(r) {
2458
2458
  n(P, "dedent");
2459
2459
 
2460
2460
  // src/preview-api/modules/store/args.ts
2461
- var fe = Symbol("incompatible"), Mr = /* @__PURE__ */ n((r, e) => {
2461
+ var fe = Symbol("incompatible"), Lr = /* @__PURE__ */ n((r, e) => {
2462
2462
  let t = e.type;
2463
2463
  if (r == null || !t || e.mapping)
2464
2464
  return r;
@@ -2473,46 +2473,46 @@ var fe = Symbol("incompatible"), Mr = /* @__PURE__ */ n((r, e) => {
2473
2473
  return String(r) === "true";
2474
2474
  case "array":
2475
2475
  return !t.value || !Array.isArray(r) ? fe : r.reduce((o, s, i) => {
2476
- let a = Mr(s, { type: t.value });
2476
+ let a = Lr(s, { type: t.value });
2477
2477
  return a !== fe && (o[i] = a), o;
2478
2478
  }, new Array(r.length));
2479
2479
  case "object":
2480
2480
  return typeof r == "string" || typeof r == "number" ? r : !t.value || typeof r != "object" ? fe : Object.entries(r).reduce((o, [s, i]) => {
2481
- let a = Mr(i, { type: t.value[s] });
2481
+ let a = Lr(i, { type: t.value[s] });
2482
2482
  return a === fe ? o : Object.assign(o, { [s]: a });
2483
2483
  }, {});
2484
2484
  default:
2485
2485
  return fe;
2486
2486
  }
2487
- }, "map"), fo = /* @__PURE__ */ n((r, e) => Object.entries(r).reduce((t, [o, s]) => {
2487
+ }, "map"), ho = /* @__PURE__ */ n((r, e) => Object.entries(r).reduce((t, [o, s]) => {
2488
2488
  if (!e[o])
2489
2489
  return t;
2490
- let i = Mr(s, e[o]);
2490
+ let i = Lr(s, e[o]);
2491
2491
  return i === fe ? t : Object.assign(t, { [o]: i });
2492
- }, {}), "mapArgsToTypes"), Fe = /* @__PURE__ */ n((r, e) => Array.isArray(r) && Array.isArray(e) ? e.reduce(
2493
- (t, o, s) => (t[s] = Fe(r[s], e[s]), t),
2492
+ }, {}), "mapArgsToTypes"), Oe = /* @__PURE__ */ n((r, e) => Array.isArray(r) && Array.isArray(e) ? e.reduce(
2493
+ (t, o, s) => (t[s] = Oe(r[s], e[s]), t),
2494
2494
  [...r]
2495
- ).filter((t) => t !== void 0) : !k(r) || !k(e) ? e : Object.keys({ ...r, ...e }).reduce((t, o) => {
2495
+ ).filter((t) => t !== void 0) : !j(r) || !j(e) ? e : Object.keys({ ...r, ...e }).reduce((t, o) => {
2496
2496
  if (o in e) {
2497
- let s = Fe(r[o], e[o]);
2497
+ let s = Oe(r[o], e[o]);
2498
2498
  s !== void 0 && (t[o] = s);
2499
2499
  } else
2500
2500
  t[o] = r[o];
2501
2501
  return t;
2502
- }, {}), "combineArgs"), yo = /* @__PURE__ */ n((r, e) => Object.entries(e).reduce((t, [o, { options: s }]) => {
2502
+ }, {}), "combineArgs"), go = /* @__PURE__ */ n((r, e) => Object.entries(e).reduce((t, [o, { options: s }]) => {
2503
2503
  function i() {
2504
2504
  return o in r && (t[o] = r[o]), t;
2505
2505
  }
2506
2506
  if (n(i, "allowArg"), !s)
2507
2507
  return i();
2508
2508
  if (!Array.isArray(s))
2509
- return jr.error(P`
2509
+ return Nr.error(P`
2510
2510
  Invalid argType: '${o}.options' should be an array.
2511
2511
 
2512
2512
  More info: https://storybook.js.org/docs/api/arg-types
2513
2513
  `), i();
2514
2514
  if (s.some((u) => u && ["object", "function"].includes(typeof u)))
2515
- return jr.error(P`
2515
+ return Nr.error(P`
2516
2516
  Invalid argType: '${o}.options' should only contain primitives. Use a 'mapping' for complex values.
2517
2517
 
2518
2518
  More info: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
@@ -2521,11 +2521,11 @@ var fe = Symbol("incompatible"), Mr = /* @__PURE__ */ n((r, e) => {
2521
2521
  if (r[o] === void 0 || s.includes(r[o]) || c)
2522
2522
  return i();
2523
2523
  let d = a ? `${o}[${l}]` : o, p = s.map((u) => typeof u == "string" ? `'${u}'` : String(u)).join(", ");
2524
- return jr.warn(`Received illegal value for '${d}'. Supported options: ${p}`), t;
2524
+ return Nr.warn(`Received illegal value for '${d}'. Supported options: ${p}`), t;
2525
2525
  }, {}), "validateOptions"), oe = Symbol("Deeply equal"), ye = /* @__PURE__ */ n((r, e) => {
2526
2526
  if (typeof r != typeof e)
2527
2527
  return e;
2528
- if (Or(r, e))
2528
+ if (jr(r, e))
2529
2529
  return oe;
2530
2530
  if (Array.isArray(r) && Array.isArray(e)) {
2531
2531
  let t = e.reduce((o, s, i) => {
@@ -2534,29 +2534,29 @@ var fe = Symbol("incompatible"), Mr = /* @__PURE__ */ n((r, e) => {
2534
2534
  }, new Array(e.length));
2535
2535
  return e.length >= r.length ? t : t.concat(new Array(r.length - e.length).fill(void 0));
2536
2536
  }
2537
- return k(r) && k(e) ? Object.keys({ ...r, ...e }).reduce((t, o) => {
2537
+ return j(r) && j(e) ? Object.keys({ ...r, ...e }).reduce((t, o) => {
2538
2538
  let s = ye(r?.[o], e?.[o]);
2539
2539
  return s === oe ? t : Object.assign(t, { [o]: s });
2540
2540
  }, {}) : e;
2541
- }, "deepDiff"), Lr = "UNTARGETED";
2542
- function mo({
2541
+ }, "deepDiff"), qr = "UNTARGETED";
2542
+ function bo({
2543
2543
  args: r,
2544
2544
  argTypes: e
2545
2545
  }) {
2546
2546
  let t = {};
2547
2547
  return Object.entries(r).forEach(([o, s]) => {
2548
- let { target: i = Lr } = e[o] || {};
2548
+ let { target: i = qr } = e[o] || {};
2549
2549
  t[i] = t[i] || {}, t[i][o] = s;
2550
2550
  }), t;
2551
2551
  }
2552
- n(mo, "groupArgsByTarget");
2552
+ n(bo, "groupArgsByTarget");
2553
2553
 
2554
2554
  // src/preview-api/modules/store/ArgsStore.ts
2555
- function xs(r) {
2555
+ function Es(r) {
2556
2556
  return Object.keys(r).forEach((e) => r[e] === void 0 && delete r[e]), r;
2557
2557
  }
2558
- n(xs, "deleteUndefined");
2559
- var _r = class _r {
2558
+ n(Es, "deleteUndefined");
2559
+ var Br = class Br {
2560
2560
  constructor() {
2561
2561
  this.initialArgsByStoryId = {};
2562
2562
  this.argsByStoryId = {};
@@ -2575,34 +2575,34 @@ var _r = class _r {
2575
2575
  }
2576
2576
  }
2577
2577
  updateFromDelta(e, t) {
2578
- let o = yo(t, e.argTypes);
2579
- this.argsByStoryId[e.id] = Fe(this.argsByStoryId[e.id], o);
2578
+ let o = go(t, e.argTypes);
2579
+ this.argsByStoryId[e.id] = Oe(this.argsByStoryId[e.id], o);
2580
2580
  }
2581
2581
  updateFromPersisted(e, t) {
2582
- let o = fo(t, e.argTypes);
2582
+ let o = ho(t, e.argTypes);
2583
2583
  return this.updateFromDelta(e, o);
2584
2584
  }
2585
2585
  update(e, t) {
2586
2586
  if (!(e in this.argsByStoryId))
2587
2587
  throw new Error(`No args known for ${e} -- has it been rendered yet?`);
2588
- this.argsByStoryId[e] = xs({
2588
+ this.argsByStoryId[e] = Es({
2589
2589
  ...this.argsByStoryId[e],
2590
2590
  ...t
2591
2591
  });
2592
2592
  }
2593
2593
  };
2594
- n(_r, "ArgsStore");
2595
- var Ve = _r;
2594
+ n(Br, "ArgsStore");
2595
+ var $e = Br;
2596
2596
 
2597
2597
  // src/preview-api/modules/store/GlobalsStore.ts
2598
- import { logger as Rs } from "storybook/internal/client-logger";
2598
+ import { logger as Cs } from "storybook/internal/client-logger";
2599
2599
 
2600
2600
  // src/preview-api/modules/store/csf/getValuesFromArgTypes.ts
2601
- var We = /* @__PURE__ */ n((r = {}) => Object.entries(r).reduce((e, [t, { defaultValue: o }]) => (typeof o < "u" && (e[t] = o), e), {}), "ge\
2601
+ var Ye = /* @__PURE__ */ n((r = {}) => Object.entries(r).reduce((e, [t, { defaultValue: o }]) => (typeof o < "u" && (e[t] = o), e), {}), "ge\
2602
2602
  tValuesFromArgTypes");
2603
2603
 
2604
2604
  // src/preview-api/modules/store/GlobalsStore.ts
2605
- var Nr = class Nr {
2605
+ var zr = class zr {
2606
2606
  constructor({
2607
2607
  globals: e = {},
2608
2608
  globalTypes: t = {}
@@ -2612,11 +2612,11 @@ var Nr = class Nr {
2612
2612
  set({ globals: e = {}, globalTypes: t = {} }) {
2613
2613
  let o = this.initialGlobals && ye(this.initialGlobals, this.globals);
2614
2614
  this.allowedGlobalNames = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
2615
- let s = We(t);
2615
+ let s = Ye(t);
2616
2616
  this.initialGlobals = { ...s, ...e }, this.globals = this.initialGlobals, o && o !== oe && this.updateFromPersisted(o);
2617
2617
  }
2618
2618
  filterAllowedGlobals(e) {
2619
- return Object.entries(e).reduce((t, [o, s]) => (this.allowedGlobalNames.has(o) ? t[o] = s : Rs.warn(
2619
+ return Object.entries(e).reduce((t, [o, s]) => (this.allowedGlobalNames.has(o) ? t[o] = s : Cs.warn(
2620
2620
  `Attempted to set a global (${o}) that is not defined in initial globals or globalTypes`
2621
2621
  ), t), {});
2622
2622
  }
@@ -2629,20 +2629,22 @@ var Nr = class Nr {
2629
2629
  }
2630
2630
  update(e) {
2631
2631
  this.globals = { ...this.globals, ...this.filterAllowedGlobals(e) };
2632
+ for (let t in e)
2633
+ e[t] === void 0 && (this.globals[t] = this.initialGlobals[t]);
2632
2634
  }
2633
2635
  };
2634
- n(Nr, "GlobalsStore");
2635
- var $e = Nr;
2636
+ n(zr, "GlobalsStore");
2637
+ var Ke = zr;
2636
2638
 
2637
2639
  // src/preview-api/modules/store/StoryIndexStore.ts
2638
- var ho = ue(kr(), 1);
2639
- import { MissingStoryAfterHmrError as ws } from "storybook/internal/preview-errors";
2640
- var Es = (0, ho.default)(1)(
2640
+ var So = ue(_r(), 1);
2641
+ import { MissingStoryAfterHmrError as vs } from "storybook/internal/preview-errors";
2642
+ var Ps = (0, So.default)(1)(
2641
2643
  (r) => Object.values(r).reduce(
2642
2644
  (e, t) => (e[t.importPath] = e[t.importPath] || t, e),
2643
2645
  {}
2644
2646
  )
2645
- ), qr = class qr {
2647
+ ), Gr = class Gr {
2646
2648
  constructor({ entries: e } = { v: 5, entries: {} }) {
2647
2649
  this.entries = e;
2648
2650
  }
@@ -2658,35 +2660,35 @@ var Es = (0, ho.default)(1)(
2658
2660
  storyIdToEntry(e) {
2659
2661
  let t = this.entries[e];
2660
2662
  if (!t)
2661
- throw new ws({ storyId: e });
2663
+ throw new vs({ storyId: e });
2662
2664
  return t;
2663
2665
  }
2664
2666
  importPathToEntry(e) {
2665
- return Es(this.entries)[e];
2667
+ return Ps(this.entries)[e];
2666
2668
  }
2667
2669
  };
2668
- n(qr, "StoryIndexStore");
2669
- var Ye = qr;
2670
+ n(Gr, "StoryIndexStore");
2671
+ var Xe = Gr;
2670
2672
 
2671
2673
  // src/preview-api/modules/store/csf/normalizeInputTypes.ts
2672
- var As = /* @__PURE__ */ n((r) => typeof r == "string" ? { name: r } : r, "normalizeType"), Cs = /* @__PURE__ */ n((r) => typeof r == "strin\
2673
- g" ? { type: r } : r, "normalizeControl"), vs = /* @__PURE__ */ n((r, e) => {
2674
+ var Fs = /* @__PURE__ */ n((r) => typeof r == "string" ? { name: r } : r, "normalizeType"), Is = /* @__PURE__ */ n((r) => typeof r == "strin\
2675
+ g" ? { type: r } : r, "normalizeControl"), Os = /* @__PURE__ */ n((r, e) => {
2674
2676
  let { type: t, control: o, ...s } = r, i = {
2675
2677
  name: e,
2676
2678
  ...s
2677
2679
  };
2678
- return t && (i.type = As(t)), o ? i.control = Cs(o) : o === !1 && (i.control = { disable: !0 }), i;
2679
- }, "normalizeInputType"), ne = /* @__PURE__ */ n((r) => H(r, vs), "normalizeInputTypes");
2680
+ return t && (i.type = Fs(t)), o ? i.control = Is(o) : o === !1 && (i.control = { disable: !0 }), i;
2681
+ }, "normalizeInputType"), ne = /* @__PURE__ */ n((r) => V(r, Os), "normalizeInputTypes");
2680
2682
 
2681
2683
  // src/preview-api/modules/store/csf/normalizeStory.ts
2682
- import { deprecate as Ps, logger as Fs } from "storybook/internal/client-logger";
2683
- import { storyNameFromExport as Is, toId as Os } from "storybook/internal/csf";
2684
+ import { deprecate as Ds, logger as ks } from "storybook/internal/client-logger";
2685
+ import { storyNameFromExport as js, toId as Ms } from "storybook/internal/csf";
2684
2686
 
2685
2687
  // src/preview-api/modules/store/csf/normalizeArrays.ts
2686
- var v = /* @__PURE__ */ n((r) => Array.isArray(r) ? r : r ? [r] : [], "normalizeArrays");
2688
+ var C = /* @__PURE__ */ n((r) => Array.isArray(r) ? r : r ? [r] : [], "normalizeArrays");
2687
2689
 
2688
2690
  // src/preview-api/modules/store/csf/normalizeStory.ts
2689
- var Ds = P`
2691
+ var _s = P`
2690
2692
  CSF .story annotations deprecated; annotate story functions directly:
2691
2693
  - StoryFn.story.name => StoryFn.storyName
2692
2694
  - StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
@@ -2694,18 +2696,18 @@ See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-
2694
2696
  `;
2695
2697
  function me(r, e, t) {
2696
2698
  let o = e, s = typeof e == "function" ? e : null, { story: i } = o;
2697
- i && (Fs.debug("deprecated story", i), Ps(Ds));
2698
- let a = Is(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a, c = [
2699
- ...v(o.decorators),
2700
- ...v(i?.decorators)
2701
- ], d = { ...i?.parameters, ...o.parameters }, p = { ...i?.args, ...o.args }, u = { ...i?.argTypes, ...o.argTypes }, y = [...v(o.loaders), ...v(
2699
+ i && (ks.debug("deprecated story", i), Ds(_s));
2700
+ let a = js(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a, c = [
2701
+ ...C(o.decorators),
2702
+ ...C(i?.decorators)
2703
+ ], d = { ...i?.parameters, ...o.parameters }, p = { ...i?.args, ...o.args }, u = { ...i?.argTypes, ...o.argTypes }, y = [...C(o.loaders), ...C(
2702
2704
  i?.loaders)], h = [
2703
- ...v(o.beforeEach),
2704
- ...v(i?.beforeEach)
2705
+ ...C(o.beforeEach),
2706
+ ...C(i?.beforeEach)
2705
2707
  ], g = [
2706
- ...v(o.experimental_afterEach),
2707
- ...v(i?.experimental_afterEach)
2708
- ], { render: b, play: m, tags: T = [], globals: x = {} } = o, f = d.__id || Os(t.id, a);
2708
+ ...C(o.afterEach),
2709
+ ...C(i?.afterEach)
2710
+ ], { render: b, play: m, tags: T = [], globals: x = {} } = o, f = d.__id || Ms(t.id, a);
2709
2711
  return {
2710
2712
  moduleExport: e,
2711
2713
  id: f,
@@ -2717,7 +2719,7 @@ function me(r, e, t) {
2717
2719
  argTypes: ne(u),
2718
2720
  loaders: y,
2719
2721
  beforeEach: h,
2720
- experimental_afterEach: g,
2722
+ afterEach: g,
2721
2723
  globals: x,
2722
2724
  ...b && { render: b },
2723
2725
  ...s && { userStoryFn: s },
@@ -2727,15 +2729,15 @@ function me(r, e, t) {
2727
2729
  n(me, "normalizeStory");
2728
2730
 
2729
2731
  // src/preview-api/modules/store/csf/processCSFFile.ts
2730
- import { logger as bo } from "storybook/internal/client-logger";
2731
- import { isExportStory as go, isStory as js } from "storybook/internal/csf";
2732
+ import { logger as xo } from "storybook/internal/client-logger";
2733
+ import { isExportStory as To, isStory as Ls } from "storybook/internal/csf";
2732
2734
 
2733
2735
  // src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts
2734
- import { sanitize as ks } from "storybook/internal/csf";
2735
- function Ie(r, e = r.title, t) {
2736
+ import { sanitize as Ns } from "storybook/internal/csf";
2737
+ function De(r, e = r.title, t) {
2736
2738
  let { id: o, argTypes: s } = r;
2737
2739
  return {
2738
- id: ks(o || e),
2740
+ id: Ns(o || e),
2739
2741
  ...r,
2740
2742
  title: e,
2741
2743
  ...s && { argTypes: ne(s) },
@@ -2745,76 +2747,76 @@ function Ie(r, e = r.title, t) {
2745
2747
  }
2746
2748
  };
2747
2749
  }
2748
- n(Ie, "normalizeComponentAnnotations");
2750
+ n(De, "normalizeComponentAnnotations");
2749
2751
 
2750
2752
  // src/preview-api/modules/store/csf/processCSFFile.ts
2751
- var Ms = /* @__PURE__ */ n((r) => {
2753
+ var qs = /* @__PURE__ */ n((r) => {
2752
2754
  let { globals: e, globalTypes: t } = r;
2753
- (e || t) && bo.error(
2755
+ (e || t) && xo.error(
2754
2756
  "Global args/argTypes can only be set globally",
2755
2757
  JSON.stringify({
2756
2758
  globals: e,
2757
2759
  globalTypes: t
2758
2760
  })
2759
2761
  );
2760
- }, "checkGlobals"), Ls = /* @__PURE__ */ n((r) => {
2762
+ }, "checkGlobals"), Bs = /* @__PURE__ */ n((r) => {
2761
2763
  let { options: e } = r;
2762
- e?.storySort && bo.error("The storySort option parameter can only be set globally");
2763
- }, "checkStorySort"), Ke = /* @__PURE__ */ n((r) => {
2764
- r && (Ms(r), Ls(r));
2764
+ e?.storySort && xo.error("The storySort option parameter can only be set globally");
2765
+ }, "checkStorySort"), Je = /* @__PURE__ */ n((r) => {
2766
+ r && (qs(r), Bs(r));
2765
2767
  }, "checkDisallowedParameters");
2766
- function So(r, e, t) {
2768
+ function Ro(r, e, t) {
2767
2769
  let { default: o, __namedExportsOrder: s, ...i } = r, a = Object.values(i)[0];
2768
- if (js(a)) {
2769
- let d = Ie(a.meta.input, t, e);
2770
- Ke(d.parameters);
2770
+ if (Ls(a)) {
2771
+ let d = De(a.meta.input, t, e);
2772
+ Je(d.parameters);
2771
2773
  let p = { meta: d, stories: {}, moduleExports: r };
2772
2774
  return Object.keys(i).forEach((u) => {
2773
- if (go(u, d)) {
2775
+ if (To(u, d)) {
2774
2776
  let y = me(u, i[u].input, d);
2775
- Ke(y.parameters), p.stories[y.id] = y;
2777
+ Je(y.parameters), p.stories[y.id] = y;
2776
2778
  }
2777
2779
  }), p.projectAnnotations = a.meta.preview.composed, p;
2778
2780
  }
2779
- let l = Ie(
2781
+ let l = De(
2780
2782
  o,
2781
2783
  t,
2782
2784
  e
2783
2785
  );
2784
- Ke(l.parameters);
2786
+ Je(l.parameters);
2785
2787
  let c = { meta: l, stories: {}, moduleExports: r };
2786
2788
  return Object.keys(i).forEach((d) => {
2787
- if (go(d, l)) {
2789
+ if (To(d, l)) {
2788
2790
  let p = me(d, i[d], l);
2789
- Ke(p.parameters), c.stories[p.id] = p;
2791
+ Je(p.parameters), c.stories[p.id] = p;
2790
2792
  }
2791
2793
  }), c;
2792
2794
  }
2793
- n(So, "processCSFFile");
2795
+ n(Ro, "processCSFFile");
2794
2796
 
2795
2797
  // src/preview-api/modules/store/csf/prepareStory.ts
2796
- import { combineTags as Ns, includeConditionalArg as qs } from "storybook/internal/csf";
2797
- import { NoRenderFunctionError as Bs } from "storybook/internal/preview-errors";
2798
- import { global as zs } from "@storybook/global";
2799
- import { global as Gs } from "@storybook/global";
2798
+ import { combineTags as Gs, includeConditionalArg as Us } from "storybook/internal/csf";
2799
+ import { NoRenderFunctionError as Hs } from "storybook/internal/preview-errors";
2800
+ import { global as Vs } from "@storybook/global";
2801
+ import { global as Ws } from "@storybook/global";
2800
2802
 
2801
2803
  // src/preview-api/modules/preview-web/render/mount-utils.ts
2802
- function xo(r) {
2803
- return r != null && _s(r).includes("mount");
2804
+ function Ao(r) {
2805
+ return r != null && zs(r).includes("mount");
2804
2806
  }
2805
- n(xo, "mountDestructured");
2806
- function _s(r) {
2807
+ n(Ao, "mountDestructured");
2808
+ function zs(r) {
2807
2809
  let e = r.toString().match(/[^(]*\(([^)]*)/);
2808
2810
  if (!e)
2809
2811
  return [];
2810
- let t = To(e[1]);
2812
+ let t = wo(e[1]);
2811
2813
  if (!t.length)
2812
2814
  return [];
2813
2815
  let o = t[0];
2814
- return o.startsWith("{") && o.endsWith("}") ? To(o.slice(1, -1).replace(/\s/g, "")).map((i) => i.replace(/:.*|=.*/g, "")) : [];
2816
+ return o.startsWith("{") && o.endsWith("}") ? wo(o.slice(1, -1).replace(/\s/g, "")).map((i) => i.replace(/:.*|=.*/g, "")) : [];
2815
2817
  }
2816
- n(_s, "getUsedProps");
2817
- function To(r) {
2818
+ n(zs, "getUsedProps");
2819
+ function wo(r) {
2818
2820
  let e = [], t = [], o = 0;
2819
2821
  for (let i = 0; i < r.length; i++)
2820
2822
  if (r[i] === "{" || r[i] === "[")
@@ -2828,15 +2830,15 @@ function To(r) {
2828
2830
  let s = r.substring(o).trim();
2829
2831
  return s && e.push(s), e;
2830
2832
  }
2831
- n(To, "splitByComma");
2833
+ n(wo, "splitByComma");
2832
2834
 
2833
2835
  // src/preview-api/modules/store/decorators.ts
2834
- function Ro(r, e, t) {
2836
+ function Eo(r, e, t) {
2835
2837
  let o = t(r);
2836
2838
  return (s) => e(o, s);
2837
2839
  }
2838
- n(Ro, "decorateStory");
2839
- function wo({
2840
+ n(Eo, "decorateStory");
2841
+ function Co({
2840
2842
  componentId: r,
2841
2843
  title: e,
2842
2844
  kind: t,
@@ -2850,87 +2852,87 @@ function wo({
2850
2852
  } = {}) {
2851
2853
  return d;
2852
2854
  }
2853
- n(wo, "sanitizeStoryContextUpdate");
2854
- function Br(r, e) {
2855
+ n(Co, "sanitizeStoryContextUpdate");
2856
+ function Ur(r, e) {
2855
2857
  let t = {}, o = /* @__PURE__ */ n((i) => (a) => {
2856
2858
  if (!t.value)
2857
2859
  throw new Error("Decorated function called without init");
2858
2860
  return t.value = {
2859
2861
  ...t.value,
2860
- ...wo(a)
2862
+ ...Co(a)
2861
2863
  }, i(t.value);
2862
2864
  }, "bindWithContext"), s = e.reduce(
2863
- (i, a) => Ro(i, a, o),
2865
+ (i, a) => Eo(i, a, o),
2864
2866
  r
2865
2867
  );
2866
2868
  return (i) => (t.value = i, s(i));
2867
2869
  }
2868
- n(Br, "defaultDecorateStory");
2870
+ n(Ur, "defaultDecorateStory");
2869
2871
 
2870
2872
  // src/preview-api/modules/store/parameters.ts
2871
- var _ = /* @__PURE__ */ n((...r) => {
2873
+ var N = /* @__PURE__ */ n((...r) => {
2872
2874
  let e = {}, t = r.filter(Boolean), o = t.reduce((s, i) => (Object.entries(i).forEach(([a, l]) => {
2873
2875
  let c = s[a];
2874
- Array.isArray(l) || typeof c > "u" ? s[a] = l : k(l) && k(c) ? e[a] = !0 : typeof l < "u" && (s[a] = l);
2876
+ Array.isArray(l) || typeof c > "u" ? s[a] = l : j(l) && j(c) ? e[a] = !0 : typeof l < "u" && (s[a] = l);
2875
2877
  }), s), {});
2876
2878
  return Object.keys(e).forEach((s) => {
2877
2879
  let i = t.filter(Boolean).map((a) => a[s]).filter((a) => typeof a < "u");
2878
- i.every((a) => k(a)) ? o[s] = _(...i) : o[s] = i[i.length - 1];
2880
+ i.every((a) => j(a)) ? o[s] = N(...i) : o[s] = i[i.length - 1];
2879
2881
  }), o;
2880
2882
  }, "combineParameters");
2881
2883
 
2882
2884
  // src/preview-api/modules/store/csf/prepareStory.ts
2883
- function Oe(r, e, t) {
2884
- let { moduleExport: o, id: s, name: i } = r || {}, a = Eo(
2885
+ function ke(r, e, t) {
2886
+ let { moduleExport: o, id: s, name: i } = r || {}, a = vo(
2885
2887
  r,
2886
2888
  e,
2887
2889
  t
2888
2890
  ), l = /* @__PURE__ */ n(async (w) => {
2889
- let A = {};
2890
- for (let F of [
2891
- v(t.loaders),
2892
- v(e.loaders),
2893
- v(r.loaders)
2891
+ let E = {};
2892
+ for (let D of [
2893
+ C(t.loaders),
2894
+ C(e.loaders),
2895
+ C(r.loaders)
2894
2896
  ]) {
2895
2897
  if (w.abortSignal.aborted)
2896
- return A;
2897
- let j = await Promise.all(F.map((N) => N(w)));
2898
- Object.assign(A, ...j);
2898
+ return E;
2899
+ let k = await Promise.all(D.map((L) => L(w)));
2900
+ Object.assign(E, ...k);
2899
2901
  }
2900
- return A;
2902
+ return E;
2901
2903
  }, "applyLoaders"), c = /* @__PURE__ */ n(async (w) => {
2902
- let A = new Array();
2903
- for (let F of [
2904
- ...v(t.beforeEach),
2905
- ...v(e.beforeEach),
2906
- ...v(r.beforeEach)
2904
+ let E = new Array();
2905
+ for (let D of [
2906
+ ...C(t.beforeEach),
2907
+ ...C(e.beforeEach),
2908
+ ...C(r.beforeEach)
2907
2909
  ]) {
2908
2910
  if (w.abortSignal.aborted)
2909
- return A;
2910
- let j = await F(w);
2911
- j && A.push(j);
2911
+ return E;
2912
+ let k = await D(w);
2913
+ k && E.push(k);
2912
2914
  }
2913
- return A;
2915
+ return E;
2914
2916
  }, "applyBeforeEach"), d = /* @__PURE__ */ n(async (w) => {
2915
- let A = [
2916
- ...v(t.experimental_afterEach),
2917
- ...v(e.experimental_afterEach),
2918
- ...v(r.experimental_afterEach)
2917
+ let E = [
2918
+ ...C(t.afterEach),
2919
+ ...C(e.afterEach),
2920
+ ...C(r.afterEach)
2919
2921
  ].reverse();
2920
- for (let F of A) {
2922
+ for (let D of E) {
2921
2923
  if (w.abortSignal.aborted)
2922
2924
  return;
2923
- await F(w);
2925
+ await D(w);
2924
2926
  }
2925
- }, "applyAfterEach"), p = /* @__PURE__ */ n((w) => w.originalStoryFn(w.args, w), "undecoratedStoryFn"), { applyDecorators: u = Br, runStep: y } = t,
2927
+ }, "applyAfterEach"), p = /* @__PURE__ */ n((w) => w.originalStoryFn(w.args, w), "undecoratedStoryFn"), { applyDecorators: u = Ur, runStep: y } = t,
2926
2928
  h = [
2927
- ...v(r?.decorators),
2928
- ...v(e?.decorators),
2929
- ...v(t?.decorators)
2930
- ], g = r?.userStoryFn || r?.render || e.render || t.render, b = wr(u)(p, h), m = /* @__PURE__ */ n((w) => b(w), "unboundStoryFn"), T = r?.
2931
- play ?? e?.play, x = xo(T);
2929
+ ...C(r?.decorators),
2930
+ ...C(e?.decorators),
2931
+ ...C(t?.decorators)
2932
+ ], g = r?.userStoryFn || r?.render || e.render || t.render, b = Cr(u)(p, h), m = /* @__PURE__ */ n((w) => b(w), "unboundStoryFn"), T = r?.
2933
+ play ?? e?.play, x = Ao(T);
2932
2934
  if (!g && !x)
2933
- throw new Bs({ id: s });
2935
+ throw new Hs({ id: s });
2934
2936
  let f = /* @__PURE__ */ n((w) => async () => (await w.renderToCanvas(), w.canvas), "defaultMount"), S = r.mount ?? e.mount ?? t.mount ?? f,
2935
2937
  R = t.testingLibraryRender;
2936
2938
  return {
@@ -2954,26 +2956,26 @@ function Oe(r, e, t) {
2954
2956
  usesMount: x
2955
2957
  };
2956
2958
  }
2957
- n(Oe, "prepareStory");
2958
- function zr(r, e, t) {
2959
+ n(ke, "prepareStory");
2960
+ function Hr(r, e, t) {
2959
2961
  return {
2960
- ...Eo(void 0, r, e),
2962
+ ...vo(void 0, r, e),
2961
2963
  moduleExport: t
2962
2964
  };
2963
2965
  }
2964
- n(zr, "prepareMeta");
2965
- function Eo(r, e, t) {
2966
- let o = ["dev", "test"], s = Gs.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], i = Ns(
2966
+ n(Hr, "prepareMeta");
2967
+ function vo(r, e, t) {
2968
+ let o = ["dev", "test"], s = Ws.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], i = Gs(
2967
2969
  ...o,
2968
2970
  ...s,
2969
2971
  ...t.tags ?? [],
2970
2972
  ...e.tags ?? [],
2971
2973
  ...r?.tags ?? []
2972
- ), a = _(
2974
+ ), a = N(
2973
2975
  t.parameters,
2974
2976
  e.parameters,
2975
2977
  r?.parameters
2976
- ), { argTypesEnhancers: l = [], argsEnhancers: c = [] } = t, d = _(
2978
+ ), { argTypesEnhancers: l = [], argsEnhancers: c = [] } = t, d = N(
2977
2979
  t.argTypes,
2978
2980
  e.argTypes,
2979
2981
  r?.argTypes
@@ -3025,20 +3027,20 @@ function Eo(r, e, t) {
3025
3027
  let { name: g, story: b, ...m } = y;
3026
3028
  return m;
3027
3029
  }
3028
- n(Eo, "preparePartialAnnotations");
3029
- function Xe(r) {
3030
+ n(vo, "preparePartialAnnotations");
3031
+ function Qe(r) {
3030
3032
  let { args: e } = r, t = {
3031
3033
  ...r,
3032
3034
  allArgs: void 0,
3033
3035
  argsByTarget: void 0
3034
3036
  };
3035
- if (zs.FEATURES?.argTypeTargetsV7) {
3036
- let i = mo(r);
3037
+ if (Vs.FEATURES?.argTypeTargetsV7) {
3038
+ let i = bo(r);
3037
3039
  t = {
3038
3040
  ...r,
3039
3041
  allArgs: r.args,
3040
3042
  argsByTarget: i,
3041
- args: i[Lr] || {}
3043
+ args: i[qr] || {}
3042
3044
  };
3043
3045
  }
3044
3046
  let o = Object.entries(t.args).reduce((i, [a, l]) => {
@@ -3051,15 +3053,15 @@ function Xe(r) {
3051
3053
  return i[a] = Array.isArray(l) ? l.map(c) : c(l), i;
3052
3054
  }, {}), s = Object.entries(o).reduce((i, [a, l]) => {
3053
3055
  let c = t.argTypes[a] || {};
3054
- return qs(c, o, t.globals) && (i[a] = l), i;
3056
+ return Us(c, o, t.globals) && (i[a] = l), i;
3055
3057
  }, {});
3056
3058
  return { ...t, unmappedArgs: e, args: s };
3057
3059
  }
3058
- n(Xe, "prepareContext");
3060
+ n(Qe, "prepareContext");
3059
3061
 
3060
3062
  // src/preview-api/modules/store/inferArgTypes.ts
3061
- import { logger as Us } from "storybook/internal/client-logger";
3062
- var Gr = /* @__PURE__ */ n((r, e, t) => {
3063
+ import { logger as $s } from "storybook/internal/client-logger";
3064
+ var Vr = /* @__PURE__ */ n((r, e, t) => {
3063
3065
  let o = typeof r;
3064
3066
  switch (o) {
3065
3067
  case "boolean":
@@ -3071,44 +3073,44 @@ var Gr = /* @__PURE__ */ n((r, e, t) => {
3071
3073
  default:
3072
3074
  break;
3073
3075
  }
3074
- return r ? t.has(r) ? (Us.warn(P`
3076
+ return r ? t.has(r) ? ($s.warn(P`
3075
3077
  We've detected a cycle in arg '${e}'. Args should be JSON-serializable.
3076
3078
 
3077
3079
  Consider using the mapping feature or fully custom args:
3078
3080
  - Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
3079
3081
  - Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
3080
- `), { name: "other", value: "cyclic object" }) : (t.add(r), Array.isArray(r) ? { name: "array", value: r.length > 0 ? Gr(r[0], e, new Set(
3081
- t)) : { name: "other", value: "unknown" } } : { name: "object", value: H(r, (i) => Gr(i, e, new Set(t))) }) : { name: "object", value: {} };
3082
- }, "inferType"), Ur = /* @__PURE__ */ n((r) => {
3083
- let { id: e, argTypes: t = {}, initialArgs: o = {} } = r, s = H(o, (a, l) => ({
3082
+ `), { name: "other", value: "cyclic object" }) : (t.add(r), Array.isArray(r) ? { name: "array", value: r.length > 0 ? Vr(r[0], e, new Set(
3083
+ t)) : { name: "other", value: "unknown" } } : { name: "object", value: V(r, (i) => Vr(i, e, new Set(t))) }) : { name: "object", value: {} };
3084
+ }, "inferType"), Wr = /* @__PURE__ */ n((r) => {
3085
+ let { id: e, argTypes: t = {}, initialArgs: o = {} } = r, s = V(o, (a, l) => ({
3084
3086
  name: l,
3085
- type: Gr(a, `${e}.${l}`, /* @__PURE__ */ new Set())
3086
- })), i = H(t, (a, l) => ({
3087
+ type: Vr(a, `${e}.${l}`, /* @__PURE__ */ new Set())
3088
+ })), i = V(t, (a, l) => ({
3087
3089
  name: l
3088
3090
  }));
3089
- return _(s, i, t);
3091
+ return N(s, i, t);
3090
3092
  }, "inferArgTypes");
3091
- Ur.secondPass = !0;
3093
+ Wr.secondPass = !0;
3092
3094
 
3093
3095
  // src/preview-api/modules/store/inferControls.ts
3094
- import { logger as Hs } from "storybook/internal/client-logger";
3096
+ import { logger as Ys } from "storybook/internal/client-logger";
3095
3097
 
3096
3098
  // src/preview-api/modules/store/filterArgTypes.ts
3097
- var Ao = /* @__PURE__ */ n((r, e) => Array.isArray(e) ? e.includes(r) : r.match(e), "matches"), Je = /* @__PURE__ */ n((r, e, t) => !e && !t ?
3098
- r : r && Ir(r, (o, s) => {
3099
+ var Po = /* @__PURE__ */ n((r, e) => Array.isArray(e) ? e.includes(r) : r.match(e), "matches"), Ze = /* @__PURE__ */ n((r, e, t) => !e && !t ?
3100
+ r : r && kr(r, (o, s) => {
3099
3101
  let i = o.name || s.toString();
3100
- return !!(!e || Ao(i, e)) && (!t || !Ao(i, t));
3102
+ return !!(!e || Po(i, e)) && (!t || !Po(i, t));
3101
3103
  }), "filterArgTypes");
3102
3104
 
3103
3105
  // src/preview-api/modules/store/inferControls.ts
3104
- var Vs = /* @__PURE__ */ n((r, e, t) => {
3106
+ var Ks = /* @__PURE__ */ n((r, e, t) => {
3105
3107
  let { type: o, options: s } = r;
3106
3108
  if (o) {
3107
3109
  if (t.color && t.color.test(e)) {
3108
3110
  let i = o.name;
3109
3111
  if (i === "string")
3110
3112
  return { control: { type: "color" } };
3111
- i !== "enum" && Hs.warn(
3113
+ i !== "enum" && Ys.warn(
3112
3114
  `Addon controls: Control of type color only supports string, received "${i}" instead`
3113
3115
  );
3114
3116
  }
@@ -3134,17 +3136,17 @@ var Vs = /* @__PURE__ */ n((r, e, t) => {
3134
3136
  return { control: { type: s ? "select" : "object" } };
3135
3137
  }
3136
3138
  }
3137
- }, "inferControl"), De = /* @__PURE__ */ n((r) => {
3139
+ }, "inferControl"), je = /* @__PURE__ */ n((r) => {
3138
3140
  let {
3139
3141
  argTypes: e,
3140
3142
  parameters: { __isArgsStory: t, controls: { include: o = null, exclude: s = null, matchers: i = {} } = {} }
3141
3143
  } = r;
3142
3144
  if (!t)
3143
3145
  return e;
3144
- let a = Je(e, o, s), l = H(a, (c, d) => c?.type && Vs(c, d.toString(), i));
3145
- return _(l, a);
3146
+ let a = Ze(e, o, s), l = V(a, (c, d) => c?.type && Ks(c, d.toString(), i));
3147
+ return N(l, a);
3146
3148
  }, "inferControls");
3147
- De.secondPass = !0;
3149
+ je.secondPass = !0;
3148
3150
 
3149
3151
  // src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts
3150
3152
  function he({
@@ -3154,20 +3156,20 @@ function he({
3154
3156
  decorators: o,
3155
3157
  loaders: s,
3156
3158
  beforeEach: i,
3157
- experimental_afterEach: a,
3159
+ afterEach: a,
3158
3160
  initialGlobals: l,
3159
3161
  ...c
3160
3162
  }) {
3161
3163
  return {
3162
3164
  ...r && { argTypes: ne(r) },
3163
3165
  ...e && { globalTypes: ne(e) },
3164
- decorators: v(o),
3165
- loaders: v(s),
3166
- beforeEach: v(i),
3167
- experimental_afterEach: v(a),
3166
+ decorators: C(o),
3167
+ loaders: C(s),
3168
+ beforeEach: C(i),
3169
+ afterEach: C(a),
3168
3170
  argTypesEnhancers: [
3169
3171
  ...t || [],
3170
- Ur,
3172
+ Wr,
3171
3173
  // There's an architectural decision to be made regarding embedded addons in core:
3172
3174
  //
3173
3175
  // Option 1: Keep embedded addons but ensure consistency by moving addon-specific code
@@ -3183,7 +3185,7 @@ function he({
3183
3185
  // currently rely on this behavior.
3184
3186
  //
3185
3187
  // TODO: Make an architectural decision on the handling of core addons
3186
- De
3188
+ je
3187
3189
  ],
3188
3190
  initialGlobals: l,
3189
3191
  ...c
@@ -3192,10 +3194,10 @@ function he({
3192
3194
  n(he, "normalizeProjectAnnotations");
3193
3195
 
3194
3196
  // src/preview-api/modules/store/csf/composeConfigs.ts
3195
- import { global as Ws } from "@storybook/global";
3197
+ import { global as Xs } from "@storybook/global";
3196
3198
 
3197
3199
  // src/preview-api/modules/store/csf/beforeAll.ts
3198
- var Co = /* @__PURE__ */ n((r) => async () => {
3200
+ var Fo = /* @__PURE__ */ n((r) => async () => {
3199
3201
  let e = [];
3200
3202
  for (let t of r) {
3201
3203
  let o = await t();
@@ -3208,7 +3210,7 @@ var Co = /* @__PURE__ */ n((r) => async () => {
3208
3210
  }, "composeBeforeAllHooks");
3209
3211
 
3210
3212
  // src/preview-api/modules/store/csf/stepRunners.ts
3211
- function Hr(r) {
3213
+ function $r(r) {
3212
3214
  return async (e, t, o) => {
3213
3215
  await r.reduceRight(
3214
3216
  (i, a) => async () => a(e, i, o),
@@ -3216,65 +3218,140 @@ function Hr(r) {
3216
3218
  )();
3217
3219
  };
3218
3220
  }
3219
- n(Hr, "composeStepRunners");
3221
+ n($r, "composeStepRunners");
3220
3222
 
3221
3223
  // src/preview-api/modules/store/csf/composeConfigs.ts
3222
- function je(r, e) {
3224
+ function _e(r, e) {
3223
3225
  return r.map((t) => t.default?.[e] ?? t[e]).filter(Boolean);
3224
3226
  }
3225
- n(je, "getField");
3226
- function $(r, e, t = {}) {
3227
- return je(r, e).reduce((o, s) => {
3228
- let i = v(s);
3227
+ n(_e, "getField");
3228
+ function Y(r, e, t = {}) {
3229
+ return _e(r, e).reduce((o, s) => {
3230
+ let i = C(s);
3229
3231
  return t.reverseFileOrder ? [...i, ...o] : [...o, ...i];
3230
3232
  }, []);
3231
3233
  }
3232
- n($, "getArrayField");
3233
- function Qe(r, e) {
3234
- return Object.assign({}, ...je(r, e));
3234
+ n(Y, "getArrayField");
3235
+ function er(r, e) {
3236
+ return Object.assign({}, ..._e(r, e));
3235
3237
  }
3236
- n(Qe, "getObjectField");
3237
- function ke(r, e) {
3238
- return je(r, e).pop();
3238
+ n(er, "getObjectField");
3239
+ function Me(r, e) {
3240
+ return _e(r, e).pop();
3239
3241
  }
3240
- n(ke, "getSingletonField");
3241
- function Y(r) {
3242
- let e = [te(), ...r], t = $(e, "argTypesEnhancers"), o = je(e, "runStep"), s = $(e, "beforeAll");
3242
+ n(Me, "getSingletonField");
3243
+ function K(r) {
3244
+ let e = Y(r, "argTypesEnhancers"), t = _e(r, "runStep"), o = Y(r, "beforeAll");
3243
3245
  return {
3244
- parameters: _(...je(e, "parameters")),
3245
- decorators: $(e, "decorators", {
3246
- reverseFileOrder: !(Ws.FEATURES?.legacyDecoratorFileOrder ?? !1)
3246
+ parameters: N(..._e(r, "parameters")),
3247
+ decorators: Y(r, "decorators", {
3248
+ reverseFileOrder: !(Xs.FEATURES?.legacyDecoratorFileOrder ?? !1)
3247
3249
  }),
3248
- args: Qe(e, "args"),
3249
- argsEnhancers: $(e, "argsEnhancers"),
3250
- argTypes: Qe(e, "argTypes"),
3250
+ args: er(r, "args"),
3251
+ argsEnhancers: Y(r, "argsEnhancers"),
3252
+ argTypes: er(r, "argTypes"),
3251
3253
  argTypesEnhancers: [
3252
- ...t.filter((i) => !i.secondPass),
3253
- ...t.filter((i) => i.secondPass)
3254
+ ...e.filter((s) => !s.secondPass),
3255
+ ...e.filter((s) => s.secondPass)
3254
3256
  ],
3255
- initialGlobals: Qe(e, "initialGlobals"),
3256
- globalTypes: Qe(e, "globalTypes"),
3257
- loaders: $(e, "loaders"),
3258
- beforeAll: Co(s),
3259
- beforeEach: $(e, "beforeEach"),
3260
- experimental_afterEach: $(e, "experimental_afterEach"),
3261
- render: ke(e, "render"),
3262
- renderToCanvas: ke(e, "renderToCanvas"),
3263
- applyDecorators: ke(e, "applyDecorators"),
3264
- runStep: Hr(o),
3265
- tags: $(e, "tags"),
3266
- mount: ke(e, "mount"),
3267
- testingLibraryRender: ke(e, "testingLibraryRender")
3257
+ initialGlobals: er(r, "initialGlobals"),
3258
+ globalTypes: er(r, "globalTypes"),
3259
+ loaders: Y(r, "loaders"),
3260
+ beforeAll: Fo(o),
3261
+ beforeEach: Y(r, "beforeEach"),
3262
+ afterEach: Y(r, "afterEach"),
3263
+ render: Me(r, "render"),
3264
+ renderToCanvas: Me(r, "renderToCanvas"),
3265
+ applyDecorators: Me(r, "applyDecorators"),
3266
+ runStep: $r(t),
3267
+ tags: Y(r, "tags"),
3268
+ mount: Me(r, "mount"),
3269
+ testingLibraryRender: Me(r, "testingLibraryRender")
3268
3270
  };
3269
3271
  }
3270
- n(Y, "composeConfigs");
3272
+ n(K, "composeConfigs");
3271
3273
 
3272
3274
  // src/preview-api/modules/store/csf/portable-stories.ts
3273
- import { isExportStory as Ys } from "storybook/internal/csf";
3274
- import { MountMustBeDestructuredError as Ks } from "storybook/internal/preview-errors";
3275
+ import { isExportStory as Zs } from "storybook/internal/csf";
3276
+ import { MountMustBeDestructuredError as ei } from "storybook/internal/preview-errors";
3277
+
3278
+ // src/preview-api/modules/preview-web/render/animation-utils.ts
3279
+ function rr() {
3280
+ try {
3281
+ return (
3282
+ // @ts-expect-error this property exists in certain environments
3283
+ !!globalThis.__vitest_browser__ || // @ts-expect-error this property exists in certain environments
3284
+ !!globalThis.__playwright__binding__ || // @ts-expect-error this property exists in certain environments
3285
+ !!import.meta.vitest || // @ts-expect-error this property exists in certain environments
3286
+ import.meta.env.MODE === "test"
3287
+ );
3288
+ } catch {
3289
+ return !1;
3290
+ }
3291
+ }
3292
+ n(rr, "isTestEnvironment");
3293
+ function ge(r = !0) {
3294
+ if (!("document" in globalThis && "createElement" in globalThis.document))
3295
+ return () => {
3296
+ };
3297
+ let e = document.createElement("style");
3298
+ e.textContent = `*, *:before, *:after {
3299
+ animation: none !important;
3300
+ }`, document.head.appendChild(e);
3301
+ let t = document.createElement("style");
3302
+ return t.textContent = `*, *:before, *:after {
3303
+ animation-delay: 0s !important;
3304
+ animation-direction: ${r ? "reverse" : "normal"} !important;
3305
+ animation-play-state: paused !important;
3306
+ transition: none !important;
3307
+ }`, document.head.appendChild(t), document.body.clientHeight, document.head.removeChild(e), () => {
3308
+ t.parentNode?.removeChild(t);
3309
+ };
3310
+ }
3311
+ n(ge, "pauseAnimations");
3312
+ async function be(r) {
3313
+ if (!("document" in globalThis && "getAnimations" in globalThis.document && "querySelectorAll" in globalThis.document))
3314
+ return;
3315
+ let e = !1;
3316
+ await Promise.race([
3317
+ // After 50ms, retrieve any running animations and wait for them to finish
3318
+ // If new animations are created while waiting, we'll wait for them too
3319
+ new Promise((t) => {
3320
+ setTimeout(() => {
3321
+ let o = [globalThis.document, ...Io(globalThis.document)], s = /* @__PURE__ */ n(async () => {
3322
+ if (e || r?.aborted)
3323
+ return;
3324
+ let i = o.flatMap((a) => a?.getAnimations?.() || []).filter((a) => a.playState === "running" && !Js(a));
3325
+ i.length > 0 && (await Promise.all(i.map((a) => a.finished)), await s());
3326
+ }, "checkAnimationsFinished");
3327
+ s().then(t);
3328
+ }, 100);
3329
+ }),
3330
+ // If animations don't finish within the timeout, continue without waiting
3331
+ new Promise(
3332
+ (t) => setTimeout(() => {
3333
+ e = !0, t(void 0);
3334
+ }, 5e3)
3335
+ )
3336
+ ]);
3337
+ }
3338
+ n(be, "waitForAnimations");
3339
+ function Io(r) {
3340
+ return [r, ...r.querySelectorAll("*")].reduce((e, t) => ("shadowRoot" in t && t.shadowRoot && e.push(t.shadowRoot, ...Io(t.shadowRoot)), e),
3341
+ []);
3342
+ }
3343
+ n(Io, "getShadowRoots");
3344
+ function Js(r) {
3345
+ if (r instanceof CSSAnimation && r.effect instanceof KeyframeEffect && r.effect.target) {
3346
+ let e = getComputedStyle(r.effect.target, r.effect.pseudoElement), t = e.animationName?.split(", ").indexOf(r.animationName);
3347
+ return e.animationIterationCount.split(", ")[t] === "infinite";
3348
+ }
3349
+ return !1;
3350
+ }
3351
+ n(Js, "isInfiniteAnimation");
3275
3352
 
3276
3353
  // src/preview-api/modules/store/reporter-api.ts
3277
- var Vr = class Vr {
3354
+ var Yr = class Yr {
3278
3355
  constructor() {
3279
3356
  this.reports = [];
3280
3357
  }
@@ -3282,64 +3359,64 @@ var Vr = class Vr {
3282
3359
  this.reports.push(e);
3283
3360
  }
3284
3361
  };
3285
- n(Vr, "ReporterAPI");
3286
- var se = Vr;
3362
+ n(Yr, "ReporterAPI");
3363
+ var se = Yr;
3287
3364
 
3288
3365
  // src/preview-api/modules/store/csf/csf-factory-utils.ts
3289
- import { isStory as $s } from "storybook/internal/csf";
3290
- function Wr(r, e, t) {
3291
- return $s(r) ? {
3366
+ import { isStory as Qs } from "storybook/internal/csf";
3367
+ function Kr(r, e, t) {
3368
+ return Qs(r) ? {
3292
3369
  story: r.input,
3293
3370
  meta: r.meta.input,
3294
3371
  preview: r.meta.preview.composed
3295
3372
  } : { story: r, meta: e, preview: t };
3296
3373
  }
3297
- n(Wr, "getCsfFactoryAnnotations");
3374
+ n(Kr, "getCsfFactoryAnnotations");
3298
3375
 
3299
3376
  // src/preview-api/modules/store/csf/portable-stories.ts
3300
- function Xs(r) {
3377
+ function ri(r) {
3301
3378
  globalThis.defaultProjectAnnotations = r;
3302
3379
  }
3303
- n(Xs, "setDefaultProjectAnnotations");
3304
- var Js = "ComposedStory", Qs = "Unnamed Story";
3305
- function Zs(r) {
3306
- return r ? Y([r]) : {};
3380
+ n(ri, "setDefaultProjectAnnotations");
3381
+ var ti = "ComposedStory", oi = "Unnamed Story";
3382
+ function ni(r) {
3383
+ return r ? K([r]) : {};
3307
3384
  }
3308
- n(Zs, "extractAnnotation");
3309
- function ei(r) {
3385
+ n(ni, "extractAnnotation");
3386
+ function si(r) {
3310
3387
  let e = Array.isArray(r) ? r : [r];
3311
- return globalThis.globalProjectAnnotations = Y([
3388
+ return globalThis.globalProjectAnnotations = K([
3389
+ ...Ie(),
3312
3390
  globalThis.defaultProjectAnnotations ?? {},
3313
- Y(e.map(Zs))
3391
+ K(e.map(ni))
3314
3392
  ]), globalThis.globalProjectAnnotations ?? {};
3315
3393
  }
3316
- n(ei, "setProjectAnnotations");
3317
- var K = [];
3318
- function vo(r, e, t, o, s) {
3394
+ n(si, "setProjectAnnotations");
3395
+ var X = [];
3396
+ function Oo(r, e, t, o, s) {
3319
3397
  if (r === void 0)
3320
3398
  throw new Error("Expected a story but received undefined.");
3321
- e.title = e.title ?? Js;
3322
- let i = Ie(e), a = s || r.storyName || r.story?.name || r.name || Qs, l = me(
3399
+ e.title = e.title ?? ti;
3400
+ let i = De(e), a = s || r.storyName || r.story?.name || r.name || oi, l = me(
3323
3401
  a,
3324
3402
  r,
3325
3403
  i
3326
3404
  ), c = he(
3327
- Y([
3328
- ...te(),
3405
+ K([
3329
3406
  o ?? globalThis.globalProjectAnnotations ?? {},
3330
3407
  t ?? {}
3331
3408
  ])
3332
- ), d = Oe(
3409
+ ), d = ke(
3333
3410
  l,
3334
3411
  i,
3335
3412
  c
3336
3413
  ), u = {
3337
- ...We(c.globalTypes),
3414
+ ...Ye(c.globalTypes),
3338
3415
  ...c.initialGlobals,
3339
3416
  ...d.storyGlobals
3340
3417
  }, y = new se(), h = /* @__PURE__ */ n(() => {
3341
- let f = Xe({
3342
- hooks: new re(),
3418
+ let f = Qe({
3419
+ hooks: new te(),
3343
3420
  globals: u,
3344
3421
  args: { ...d.initialArgs },
3345
3422
  viewMode: "story",
@@ -3379,14 +3456,14 @@ ${R.description}`);
3379
3456
  },
3380
3457
  f.canvasElement
3381
3458
  );
3382
- S && K.push(S);
3459
+ S && X.push(S);
3383
3460
  }), f.mount = d.mount(f), f;
3384
3461
  }, "initializeContext"), g, b = /* @__PURE__ */ n(async (f) => {
3385
3462
  let S = h();
3386
3463
  return S.canvasElement ??= globalThis?.document?.body, g && (S.loaded = g.loaded), Object.assign(S, f), d.playFunction(S);
3387
3464
  }, "play"), m = /* @__PURE__ */ n((f) => {
3388
3465
  let S = h();
3389
- return Object.assign(S, f), ni(d, S);
3466
+ return Object.assign(S, f), ci(d, S);
3390
3467
  }, "run"), T = d.playFunction ? b : void 0;
3391
3468
  return Object.assign(
3392
3469
  /* @__PURE__ */ n(function(S) {
@@ -3400,11 +3477,11 @@ ${R.description}`);
3400
3477
  id: d.id,
3401
3478
  storyName: a,
3402
3479
  load: /* @__PURE__ */ n(async () => {
3403
- for (let S of [...K].reverse())
3480
+ for (let S of [...X].reverse())
3404
3481
  await S();
3405
- K.length = 0;
3482
+ X.length = 0;
3406
3483
  let f = h();
3407
- f.loaded = await d.applyLoaders(f), K.push(...(await d.applyBeforeEach(f)).filter(Boolean)), g = f;
3484
+ f.loaded = await d.applyLoaders(f), X.push(...(await d.applyBeforeEach(f)).filter(Boolean)), g = f;
3408
3485
  }, "load"),
3409
3486
  globals: u,
3410
3487
  args: d.initialArgs,
@@ -3417,22 +3494,22 @@ ${R.description}`);
3417
3494
  }
3418
3495
  );
3419
3496
  }
3420
- n(vo, "composeStory");
3421
- var ri = /* @__PURE__ */ n((r, e, t, o) => vo(r, e, t, {}, o), "defaultComposeStory");
3422
- function ti(r, e, t = ri) {
3497
+ n(Oo, "composeStory");
3498
+ var ii = /* @__PURE__ */ n((r, e, t, o) => Oo(r, e, t, {}, o), "defaultComposeStory");
3499
+ function ai(r, e, t = ii) {
3423
3500
  let { default: o, __esModule: s, __namedExportsOrder: i, ...a } = r, l = o;
3424
3501
  return Object.entries(a).reduce(
3425
3502
  (d, [p, u]) => {
3426
- let { story: y, meta: h } = Wr(u);
3427
- return !l && h && (l = h), Ys(p, l) ? Object.assign(d, {
3503
+ let { story: y, meta: h } = Kr(u);
3504
+ return !l && h && (l = h), Zs(p, l) ? Object.assign(d, {
3428
3505
  [p]: t(y, l, e, p)
3429
3506
  }) : d;
3430
3507
  },
3431
3508
  {}
3432
3509
  );
3433
3510
  }
3434
- n(ti, "composeStories");
3435
- function oi(r) {
3511
+ n(ai, "composeStories");
3512
+ function li(r) {
3436
3513
  return r.extend({
3437
3514
  mount: /* @__PURE__ */ n(async ({ mount: e, page: t }, o) => {
3438
3515
  await o(async (s, ...i) => {
@@ -3462,36 +3539,40 @@ function oi(r) {
3462
3539
  }, "mount")
3463
3540
  });
3464
3541
  }
3465
- n(oi, "createPlaywrightTest");
3466
- async function ni(r, e) {
3467
- for (let s of [...K].reverse())
3468
- await s();
3469
- if (K.length = 0, !e.canvasElement) {
3470
- let s = document.createElement("div");
3471
- globalThis?.document?.body?.appendChild(s), e.canvasElement = s, K.push(() => {
3472
- globalThis?.document?.body?.contains(s) && globalThis?.document?.body?.removeChild(s);
3542
+ n(li, "createPlaywrightTest");
3543
+ async function ci(r, e) {
3544
+ for (let i of [...X].reverse())
3545
+ await i();
3546
+ if (X.length = 0, !e.canvasElement) {
3547
+ let i = document.createElement("div");
3548
+ globalThis?.document?.body?.appendChild(i), e.canvasElement = i, X.push(() => {
3549
+ globalThis?.document?.body?.contains(i) && globalThis?.document?.body?.removeChild(i);
3473
3550
  });
3474
3551
  }
3475
3552
  if (e.loaded = await r.applyLoaders(e), e.abortSignal.aborted)
3476
3553
  return;
3477
- K.push(...(await r.applyBeforeEach(e)).filter(Boolean));
3554
+ X.push(...(await r.applyBeforeEach(e)).filter(Boolean));
3478
3555
  let t = r.playFunction, o = r.usesMount;
3479
- o || await e.mount(), !e.abortSignal.aborted && (t && (o || (e.mount = async () => {
3480
- throw new Ks({ playFunction: t.toString() });
3481
- }), await t(e)), await r.applyAfterEach(e));
3556
+ if (o || await e.mount(), e.abortSignal.aborted)
3557
+ return;
3558
+ t && (o || (e.mount = async () => {
3559
+ throw new ei({ playFunction: t.toString() });
3560
+ }), await t(e));
3561
+ let s;
3562
+ rr() ? s = ge() : await be(e.abortSignal), await r.applyAfterEach(e), await s?.();
3482
3563
  }
3483
- n(ni, "runStory");
3564
+ n(ci, "runStory");
3484
3565
 
3485
3566
  // src/preview-api/modules/store/StoryStore.ts
3486
- var Po = 1e3, ai = 1e4, $r = class $r {
3567
+ var Do = 1e3, ui = 1e4, Xr = class Xr {
3487
3568
  constructor(e, t, o) {
3488
3569
  this.importFn = t;
3489
- this.storyIndex = new Ye(e), this.projectAnnotations = he(
3490
- Y([...te(), o])
3570
+ this.storyIndex = new Xe(e), this.projectAnnotations = he(
3571
+ K([...Ie(), o])
3491
3572
  );
3492
3573
  let { initialGlobals: s, globalTypes: i } = this.projectAnnotations;
3493
- this.args = new Ve(), this.userGlobals = new $e({ globals: s, globalTypes: i }), this.hooks = {}, this.cleanupCallbacks = {}, this.processCSFFileWithCache =
3494
- (0, Ze.default)(Po)(So), this.prepareMetaWithCache = (0, Ze.default)(Po)(zr), this.prepareStoryWithCache = (0, Ze.default)(ai)(Oe);
3574
+ this.args = new $e(), this.userGlobals = new Ke({ globals: s, globalTypes: i }), this.hooks = {}, this.cleanupCallbacks = {}, this.processCSFFileWithCache =
3575
+ (0, tr.default)(Do)(Ro), this.prepareMetaWithCache = (0, tr.default)(Do)(Hr), this.prepareStoryWithCache = (0, tr.default)(ui)(ke);
3495
3576
  }
3496
3577
  setProjectAnnotations(e) {
3497
3578
  this.projectAnnotations = he(e);
@@ -3555,13 +3636,13 @@ var Po = 1e3, ai = 1e4, $r = class $r {
3555
3636
  }) {
3556
3637
  let o = t.stories[e];
3557
3638
  if (!o)
3558
- throw new ii({ storyId: e });
3639
+ throw new pi({ storyId: e });
3559
3640
  let s = t.meta, i = this.prepareStoryWithCache(
3560
3641
  o,
3561
3642
  s,
3562
3643
  t.projectAnnotations ?? this.projectAnnotations
3563
3644
  );
3564
- return this.args.setInitial(i), this.hooks[i.id] = this.hooks[i.id] || new re(), i;
3645
+ return this.args.setInitial(i), this.hooks[i.id] = this.hooks[i.id] || new te(), i;
3565
3646
  }
3566
3647
  // If we have a CSF file we can get all the stories from it synchronously
3567
3648
  componentStoriesFromCSFFile({
@@ -3583,7 +3664,7 @@ var Po = 1e3, ai = 1e4, $r = class $r {
3583
3664
  // and updated separtely to the (immutable) story.
3584
3665
  getStoryContext(e, { forceInitialArgs: t = !1 } = {}) {
3585
3666
  let o = this.userGlobals.get(), { initialGlobals: s } = this.userGlobals, i = new se();
3586
- return Xe({
3667
+ return Qe({
3587
3668
  ...e,
3588
3669
  args: t ? e.initialArgs : this.args.get(e.id),
3589
3670
  initialGlobals: s,
@@ -3597,8 +3678,8 @@ var Po = 1e3, ai = 1e4, $r = class $r {
3597
3678
  hooks: this.hooks[e.id]
3598
3679
  });
3599
3680
  }
3600
- addCleanupCallbacks(e, t) {
3601
- this.cleanupCallbacks[e.id] = t;
3681
+ addCleanupCallbacks(e, ...t) {
3682
+ this.cleanupCallbacks[e.id] = (this.cleanupCallbacks[e.id] || []).concat(t);
3602
3683
  }
3603
3684
  async cleanupStory(e) {
3604
3685
  this.hooks[e.id].clean();
@@ -3611,7 +3692,7 @@ var Po = 1e3, ai = 1e4, $r = class $r {
3611
3692
  extract(e = { includeDocsOnly: !1 }) {
3612
3693
  let { cachedCSFFiles: t } = this;
3613
3694
  if (!t)
3614
- throw new si();
3695
+ throw new di();
3615
3696
  return Object.entries(this.storyIndex.entries).reduce(
3616
3697
  (o, [s, { type: i, importPath: a }]) => {
3617
3698
  if (i === "docs")
@@ -3635,20 +3716,20 @@ var Po = 1e3, ai = 1e4, $r = class $r {
3635
3716
  );
3636
3717
  }
3637
3718
  };
3638
- n($r, "StoryStore");
3639
- var ge = $r;
3719
+ n(Xr, "StoryStore");
3720
+ var Se = Xr;
3640
3721
 
3641
3722
  // src/preview-api/modules/store/autoTitle.ts
3642
- import { once as li } from "storybook/internal/client-logger";
3723
+ import { once as fi } from "storybook/internal/client-logger";
3643
3724
 
3644
3725
  // ../node_modules/slash/index.js
3645
- function Yr(r) {
3726
+ function Jr(r) {
3646
3727
  return r.startsWith("\\\\?\\") ? r : r.replace(/\\/g, "/");
3647
3728
  }
3648
- n(Yr, "slash");
3729
+ n(Jr, "slash");
3649
3730
 
3650
3731
  // src/preview-api/modules/store/autoTitle.ts
3651
- var ci = /* @__PURE__ */ n((r) => {
3732
+ var yi = /* @__PURE__ */ n((r) => {
3652
3733
  if (r.length === 0)
3653
3734
  return r;
3654
3735
  let e = r[r.length - 1], t = e?.replace(/(?:[.](?:story|stories))?([.][^.]+)$/i, "");
@@ -3658,28 +3739,28 @@ var ci = /* @__PURE__ */ n((r) => {
3658
3739
  return t && o && t.toLowerCase() === o.toLowerCase() ? [...r.slice(0, -2), t] : t && (/^(story|stories)([.][^.]+)$/i.test(e) || /^index$/i.
3659
3740
  test(t)) ? r.slice(0, -1) : [...r.slice(0, -1), t];
3660
3741
  }, "sanitize");
3661
- function Fo(r) {
3742
+ function ko(r) {
3662
3743
  return r.flatMap((e) => e.split("/")).filter(Boolean).join("/");
3663
3744
  }
3664
- n(Fo, "pathJoin");
3665
- var Io = /* @__PURE__ */ n((r, e, t) => {
3745
+ n(ko, "pathJoin");
3746
+ var jo = /* @__PURE__ */ n((r, e, t) => {
3666
3747
  let { directory: o, importPathMatcher: s, titlePrefix: i = "" } = e || {};
3667
- typeof r == "number" && li.warn(P`
3748
+ typeof r == "number" && fi.warn(P`
3668
3749
  CSF Auto-title received a numeric fileName. This typically happens when
3669
3750
  webpack is mis-configured in production mode. To force webpack to produce
3670
3751
  filenames, set optimization.moduleIds = "named" in your webpack config.
3671
3752
  `);
3672
- let a = Yr(String(r));
3753
+ let a = Jr(String(r));
3673
3754
  if (s.exec(a)) {
3674
3755
  if (!t) {
3675
- let l = a.replace(o, ""), c = Fo([i, l]).split("/");
3676
- return c = ci(c), c.join("/");
3756
+ let l = a.replace(o, ""), c = ko([i, l]).split("/");
3757
+ return c = yi(c), c.join("/");
3677
3758
  }
3678
- return i ? Fo([i, t]) : t;
3759
+ return i ? ko([i, t]) : t;
3679
3760
  }
3680
- }, "userOrAutoTitleFromSpecifier"), di = /* @__PURE__ */ n((r, e, t) => {
3761
+ }, "userOrAutoTitleFromSpecifier"), mi = /* @__PURE__ */ n((r, e, t) => {
3681
3762
  for (let o = 0; o < e.length; o += 1) {
3682
- let s = Io(r, e[o], t);
3763
+ let s = jo(r, e[o], t);
3683
3764
  if (s)
3684
3765
  return s;
3685
3766
  }
@@ -3687,10 +3768,10 @@ var Io = /* @__PURE__ */ n((r, e, t) => {
3687
3768
  }, "userOrAutoTitle");
3688
3769
 
3689
3770
  // src/preview-api/modules/store/storySort.ts
3690
- var Oo = /\s*\/\s*/, Do = /* @__PURE__ */ n((r = {}) => (e, t) => {
3771
+ var Mo = /\s*\/\s*/, _o = /* @__PURE__ */ n((r = {}) => (e, t) => {
3691
3772
  if (e.title === t.title && !r.includeNames)
3692
3773
  return 0;
3693
- let o = r.method || "configure", s = r.order || [], i = e.title.trim().split(Oo), a = t.title.trim().split(Oo);
3774
+ let o = r.method || "configure", s = r.order || [], i = e.title.trim().split(Mo), a = t.title.trim().split(Mo);
3694
3775
  r.includeNames && (i.push(e.name), a.push(t.name));
3695
3776
  let l = 0;
3696
3777
  for (; i[l] || a[l]; ) {
@@ -3714,18 +3795,18 @@ var Oo = /\s*\/\s*/, Do = /* @__PURE__ */ n((r = {}) => (e, t) => {
3714
3795
  }, "storySort");
3715
3796
 
3716
3797
  // src/preview-api/modules/store/sortStories.ts
3717
- var pi = /* @__PURE__ */ n((r, e, t) => {
3798
+ var hi = /* @__PURE__ */ n((r, e, t) => {
3718
3799
  if (e) {
3719
3800
  let o;
3720
- typeof e == "function" ? o = e : o = Do(e), r.sort(o);
3801
+ typeof e == "function" ? o = e : o = _o(e), r.sort(o);
3721
3802
  } else
3722
3803
  r.sort(
3723
3804
  (o, s) => t.indexOf(o.importPath) - t.indexOf(s.importPath)
3724
3805
  );
3725
3806
  return r;
3726
- }, "sortStoriesCommon"), ui = /* @__PURE__ */ n((r, e, t) => {
3807
+ }, "sortStoriesCommon"), gi = /* @__PURE__ */ n((r, e, t) => {
3727
3808
  try {
3728
- return pi(r, e, t);
3809
+ return hi(r, e, t);
3729
3810
  } catch (o) {
3730
3811
  throw new Error(P`
3731
3812
  Error sorting stories with sort parameter ${e}:
@@ -3740,48 +3821,48 @@ var pi = /* @__PURE__ */ n((r, e, t) => {
3740
3821
  }, "sortStoriesV7");
3741
3822
 
3742
3823
  // src/preview-api/modules/preview-web/Preview.tsx
3743
- import { deprecate as bi, logger as _o } from "storybook/internal/client-logger";
3824
+ import { deprecate as wi, logger as zo } from "storybook/internal/client-logger";
3744
3825
  import {
3745
- ARGTYPES_INFO_REQUEST as Si,
3746
- ARGTYPES_INFO_RESPONSE as No,
3747
- CONFIG_ERROR as Ti,
3748
- FORCE_REMOUNT as xi,
3749
- FORCE_RE_RENDER as Ri,
3750
- GLOBALS_UPDATED as qo,
3751
- RESET_STORY_ARGS as wi,
3752
- SET_GLOBALS as Ei,
3753
- STORY_ARGS_UPDATED as Ai,
3754
- STORY_INDEX_INVALIDATED as Ci,
3755
- UPDATE_GLOBALS as vi,
3756
- UPDATE_STORY_ARGS as Pi
3826
+ ARGTYPES_INFO_REQUEST as Ai,
3827
+ ARGTYPES_INFO_RESPONSE as Go,
3828
+ CONFIG_ERROR as Ei,
3829
+ FORCE_REMOUNT as Ci,
3830
+ FORCE_RE_RENDER as vi,
3831
+ GLOBALS_UPDATED as Uo,
3832
+ RESET_STORY_ARGS as Pi,
3833
+ SET_GLOBALS as Fi,
3834
+ STORY_ARGS_UPDATED as Ii,
3835
+ STORY_INDEX_INVALIDATED as Oi,
3836
+ UPDATE_GLOBALS as Di,
3837
+ UPDATE_STORY_ARGS as ki
3757
3838
  } from "storybook/internal/core-events";
3758
3839
  import {
3759
- CalledPreviewMethodBeforeInitializationError as V,
3760
- MissingRenderToCanvasError as Fi,
3761
- StoryIndexFetchError as Ii,
3762
- StoryStoreAccessedBeforeInitializationError as Oi
3840
+ CalledPreviewMethodBeforeInitializationError as W,
3841
+ MissingRenderToCanvasError as ji,
3842
+ StoryIndexFetchError as Mi,
3843
+ StoryStoreAccessedBeforeInitializationError as _i
3763
3844
  } from "storybook/internal/preview-errors";
3764
- import { global as Di } from "@storybook/global";
3845
+ import { global as Ni } from "@storybook/global";
3765
3846
 
3766
3847
  // src/preview-api/modules/preview-web/render/StoryRender.ts
3767
3848
  import {
3768
- PLAY_FUNCTION_THREW_EXCEPTION as fi,
3769
- STORY_FINISHED as ko,
3770
- STORY_RENDERED as yi,
3771
- STORY_RENDER_PHASE_CHANGED as jo,
3772
- UNHANDLED_ERRORS_WHILE_PLAYING as mi
3849
+ PLAY_FUNCTION_THREW_EXCEPTION as bi,
3850
+ STORY_FINISHED as No,
3851
+ STORY_RENDERED as Si,
3852
+ STORY_RENDER_PHASE_CHANGED as Lo,
3853
+ UNHANDLED_ERRORS_WHILE_PLAYING as Ti
3773
3854
  } from "storybook/internal/core-events";
3774
3855
  import {
3775
- MountMustBeDestructuredError as hi,
3776
- NoStoryMountedError as gi
3856
+ MountMustBeDestructuredError as xi,
3857
+ NoStoryMountedError as Ri
3777
3858
  } from "storybook/internal/preview-errors";
3778
3859
 
3779
3860
  // src/preview-api/modules/preview-web/render/Render.ts
3780
- var X = new Error("prepareAborted");
3861
+ var J = new Error("prepareAborted");
3781
3862
 
3782
3863
  // src/preview-api/modules/preview-web/render/StoryRender.ts
3783
- var { AbortController: Mo } = globalThis;
3784
- function Lo(r) {
3864
+ var { AbortController: qo } = globalThis;
3865
+ function Bo(r) {
3785
3866
  try {
3786
3867
  let { name: e = "Error", message: t = String(r), stack: o } = r;
3787
3868
  return { name: e, message: t, stack: o };
@@ -3789,8 +3870,8 @@ function Lo(r) {
3789
3870
  return { name: "Error", message: String(r) };
3790
3871
  }
3791
3872
  }
3792
- n(Lo, "serializeError");
3793
- var Kr = class Kr {
3873
+ n(Bo, "serializeError");
3874
+ var Qr = class Qr {
3794
3875
  constructor(e, t, o, s, i, a, l = { autoplay: !0, forceInitialArgs: !1 }, c) {
3795
3876
  this.channel = e;
3796
3877
  this.store = t;
@@ -3806,19 +3887,19 @@ var Kr = class Kr {
3806
3887
  this.teardownRender = /* @__PURE__ */ n(() => {
3807
3888
  }, "teardownRender");
3808
3889
  this.torndown = !1;
3809
- this.abortController = new Mo(), c && (this.story = c, this.phase = "preparing");
3890
+ this.abortController = new qo(), c && (this.story = c, this.phase = "preparing");
3810
3891
  }
3811
3892
  async runPhase(e, t, o) {
3812
- this.phase = t, this.channel.emit(jo, { newPhase: this.phase, storyId: this.id }), o && (await o(), this.checkIfAborted(e));
3893
+ this.phase = t, this.channel.emit(Lo, { newPhase: this.phase, storyId: this.id }), o && (await o(), this.checkIfAborted(e));
3813
3894
  }
3814
3895
  checkIfAborted(e) {
3815
- return e.aborted ? (this.phase = "aborted", this.channel.emit(jo, { newPhase: this.phase, storyId: this.id }), !0) : !1;
3896
+ return e.aborted ? (this.phase = "aborted", this.channel.emit(Lo, { newPhase: this.phase, storyId: this.id }), !0) : !1;
3816
3897
  }
3817
3898
  async prepare() {
3818
3899
  if (await this.runPhase(this.abortController.signal, "preparing", async () => {
3819
3900
  this.story = await this.store.loadStory({ storyId: this.id });
3820
3901
  }), this.abortController.signal.aborted)
3821
- throw await this.store.cleanupStory(this.story), X;
3902
+ throw await this.store.cleanupStory(this.story), J;
3822
3903
  }
3823
3904
  // The two story "renders" are equal and have both loaded the same story
3824
3905
  isEqual(e) {
@@ -3864,7 +3945,7 @@ var Kr = class Kr {
3864
3945
  playFunction: g,
3865
3946
  runStep: b
3866
3947
  } = s;
3867
- t && !e && (this.cancelRender(), this.abortController = new Mo());
3948
+ t && !e && (this.cancelRender(), this.abortController = new qo());
3868
3949
  let m = this.abortController.signal, T = !1, x = s.usesMount;
3869
3950
  try {
3870
3951
  let f = {
@@ -3873,13 +3954,13 @@ var Kr = class Kr {
3873
3954
  abortSignal: m,
3874
3955
  canvasElement: o,
3875
3956
  loaded: {},
3876
- step: /* @__PURE__ */ n((C, B) => b(C, B, f), "step"),
3957
+ step: /* @__PURE__ */ n((v, z) => b(v, z, f), "step"),
3877
3958
  context: null,
3878
3959
  canvas: {},
3879
3960
  userEvent: {},
3880
3961
  renderToCanvas: /* @__PURE__ */ n(async () => {
3881
- let C = await this.renderToScreen(S, o);
3882
- this.teardownRender = C || (() => {
3962
+ let v = await this.renderToScreen(S, o);
3963
+ this.teardownRender = v || (() => {
3883
3964
  }), T = !0;
3884
3965
  }, "renderToCanvas"),
3885
3966
  // The story provides (set in a renderer) a mount function that is a higher order function
@@ -3887,12 +3968,12 @@ var Kr = class Kr {
3887
3968
  //
3888
3969
  // Before assigning it to the context, we resolve the context dependency,
3889
3970
  // so that a user can just call it as await mount(...args) in their play function.
3890
- mount: /* @__PURE__ */ n(async (...C) => {
3971
+ mount: /* @__PURE__ */ n(async (...v) => {
3891
3972
  this.callbacks.showStoryDuringRender?.();
3892
- let B = null;
3973
+ let z = null;
3893
3974
  return await this.runPhase(m, "rendering", async () => {
3894
- B = await s.mount(f)(...C);
3895
- }), x && await this.runPhase(m, "playing"), B;
3975
+ z = await s.mount(f)(...v);
3976
+ }), x && await this.runPhase(m, "playing"), z;
3896
3977
  }, "mount")
3897
3978
  };
3898
3979
  f.context = f;
@@ -3905,8 +3986,8 @@ var Kr = class Kr {
3905
3986
  story: c,
3906
3987
  tags: d,
3907
3988
  ...this.callbacks,
3908
- showError: /* @__PURE__ */ n((C) => (this.phase = "errored", this.callbacks.showError(C)), "showError"),
3909
- showException: /* @__PURE__ */ n((C) => (this.phase = "errored", this.callbacks.showException(C)), "showException"),
3989
+ showError: /* @__PURE__ */ n((v) => (this.phase = "errored", this.callbacks.showError(v)), "showError"),
3990
+ showException: /* @__PURE__ */ n((v) => (this.phase = "errored", this.callbacks.showException(v)), "showException"),
3910
3991
  forceRemount: t || this.notYetRendered,
3911
3992
  storyContext: f,
3912
3993
  storyFn: /* @__PURE__ */ n(() => h(f), "storyFn"),
@@ -3917,47 +3998,50 @@ var Kr = class Kr {
3917
3998
  }), m.aborted)
3918
3999
  return;
3919
4000
  let R = await u(f);
3920
- if (this.store.addCleanupCallbacks(s, R), this.checkIfAborted(m) || (!T && !x && await f.mount(), this.notYetRendered = !1, m.aborted))
4001
+ if (this.store.addCleanupCallbacks(s, ...R), this.checkIfAborted(m) || (!T && !x && await f.mount(), this.notYetRendered = !1, m.aborted))
3921
4002
  return;
3922
- let w = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, A = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ n((C) => A.
3923
- add("error" in C ? C.error : C.reason), "onError");
4003
+ let w = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, E = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ n((v) => {
4004
+ v.error && E.add(v.error);
4005
+ }, "onError"), k = /* @__PURE__ */ n((v) => {
4006
+ v.reason && E.add(v.reason);
4007
+ }, "onUnhandledRejection");
3924
4008
  if (this.renderOptions.autoplay && t && g && this.phase !== "errored") {
3925
- window.addEventListener("error", F), window.addEventListener("unhandledrejection", F), this.disableKeyListeners = !0;
4009
+ window.addEventListener("error", D), window.addEventListener("unhandledrejection", k), this.disableKeyListeners = !0;
3926
4010
  try {
3927
4011
  if (x ? await g(f) : (f.mount = async () => {
3928
- throw new hi({ playFunction: g.toString() });
4012
+ throw new xi({ playFunction: g.toString() });
3929
4013
  }, await this.runPhase(m, "playing", async () => g(f))), !T)
3930
- throw new gi();
3931
- this.checkIfAborted(m), !w && A.size > 0 ? await this.runPhase(m, "errored") : await this.runPhase(m, "played");
3932
- } catch (C) {
4014
+ throw new Ri();
4015
+ this.checkIfAborted(m), !w && E.size > 0 ? await this.runPhase(m, "errored") : await this.runPhase(m, "played");
4016
+ } catch (v) {
3933
4017
  if (this.callbacks.showStoryDuringRender?.(), await this.runPhase(m, "errored", async () => {
3934
- this.channel.emit(fi, Lo(C));
4018
+ this.channel.emit(bi, Bo(v));
3935
4019
  }), this.story.parameters.throwPlayFunctionExceptions !== !1)
3936
- throw C;
3937
- console.error(C);
4020
+ throw v;
4021
+ console.error(v);
3938
4022
  }
3939
- if (!w && A.size > 0 && this.channel.emit(
3940
- mi,
3941
- Array.from(A).map(Lo)
3942
- ), this.disableKeyListeners = !1, window.removeEventListener("unhandledrejection", F), window.removeEventListener("error", F), m.aborted)
4023
+ if (!w && E.size > 0 && this.channel.emit(
4024
+ Ti,
4025
+ Array.from(E).map(Bo)
4026
+ ), this.disableKeyListeners = !1, window.removeEventListener("unhandledrejection", k), window.removeEventListener("error", D), m.aborted)
3943
4027
  return;
3944
4028
  }
3945
- await this.runPhase(
3946
- m,
3947
- "completed",
3948
- async () => this.channel.emit(yi, i)
3949
- ), this.phase !== "errored" && await this.runPhase(m, "afterEach", async () => {
4029
+ await this.runPhase(m, "completing", async () => {
4030
+ rr() ? this.store.addCleanupCallbacks(s, ge()) : await be(m);
4031
+ }), await this.runPhase(m, "completed", async () => {
4032
+ this.channel.emit(Si, i);
4033
+ }), this.phase !== "errored" && await this.runPhase(m, "afterEach", async () => {
3950
4034
  await y(f);
3951
4035
  });
3952
- let j = !w && A.size > 0, N = f.reporting.reports.some(
3953
- (C) => C.status === "failed"
3954
- ), pe = j || N;
4036
+ let L = !w && E.size > 0, pe = f.reporting.reports.some(
4037
+ (v) => v.status === "failed"
4038
+ ), q = L || pe;
3955
4039
  await this.runPhase(
3956
4040
  m,
3957
4041
  "finished",
3958
- async () => this.channel.emit(ko, {
4042
+ async () => this.channel.emit(No, {
3959
4043
  storyId: i,
3960
- status: pe ? "error" : "success",
4044
+ status: q ? "error" : "success",
3961
4045
  reporters: f.reporting.reports
3962
4046
  })
3963
4047
  );
@@ -3965,7 +4049,7 @@ var Kr = class Kr {
3965
4049
  this.phase = "errored", this.callbacks.showException(f), await this.runPhase(
3966
4050
  m,
3967
4051
  "finished",
3968
- async () => this.channel.emit(ko, {
4052
+ async () => this.channel.emit(No, {
3969
4053
  storyId: i,
3970
4054
  status: "error",
3971
4055
  reporters: []
@@ -4010,12 +4094,12 @@ var Kr = class Kr {
4010
4094
  });
4011
4095
  }
4012
4096
  };
4013
- n(Kr, "StoryRender");
4014
- var ie = Kr;
4097
+ n(Qr, "StoryRender");
4098
+ var ie = Qr;
4015
4099
 
4016
4100
  // src/preview-api/modules/preview-web/Preview.tsx
4017
- var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4018
- constructor(e, t, o = L.getChannel(), s = !0) {
4101
+ var { fetch: Li } = Ni, qi = "./index.json", Zr = class Zr {
4102
+ constructor(e, t, o = _.getChannel(), s = !0) {
4019
4103
  this.importFn = e;
4020
4104
  this.getProjectAnnotations = t;
4021
4105
  this.channel = o;
@@ -4035,8 +4119,8 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4035
4119
  {
4036
4120
  get: /* @__PURE__ */ n((e, t) => {
4037
4121
  if (this.storyStoreValue)
4038
- return bi("Accessing the Story Store is deprecated and will be removed in 9.0"), this.storyStoreValue[t];
4039
- throw new Oi();
4122
+ return wi("Accessing the Story Store is deprecated and will be removed in 9.0"), this.storyStoreValue[t];
4123
+ throw new _i();
4040
4124
  }, "get")
4041
4125
  }
4042
4126
  );
@@ -4055,15 +4139,15 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4055
4139
  return this.storeInitializationPromise;
4056
4140
  }
4057
4141
  setupListeners() {
4058
- this.channel.on(Ci, this.onStoryIndexChanged.bind(this)), this.channel.on(vi, this.onUpdateGlobals.bind(this)), this.channel.on(Pi, this.
4059
- onUpdateArgs.bind(this)), this.channel.on(Si, this.onRequestArgTypesInfo.bind(this)), this.channel.on(wi, this.onResetArgs.bind(this)), this.
4060
- channel.on(Ri, this.onForceReRender.bind(this)), this.channel.on(xi, this.onForceRemount.bind(this));
4142
+ this.channel.on(Oi, this.onStoryIndexChanged.bind(this)), this.channel.on(Di, this.onUpdateGlobals.bind(this)), this.channel.on(ki, this.
4143
+ onUpdateArgs.bind(this)), this.channel.on(Ai, this.onRequestArgTypesInfo.bind(this)), this.channel.on(Pi, this.onResetArgs.bind(this)), this.
4144
+ channel.on(vi, this.onForceReRender.bind(this)), this.channel.on(Ci, this.onForceRemount.bind(this));
4061
4145
  }
4062
4146
  async getProjectAnnotationsOrRenderError() {
4063
4147
  try {
4064
4148
  let e = await this.getProjectAnnotations();
4065
4149
  if (this.renderToCanvas = e.renderToCanvas, !this.renderToCanvas)
4066
- throw new Fi();
4150
+ throw new ji();
4067
4151
  return e;
4068
4152
  } catch (e) {
4069
4153
  throw this.renderPreviewEntryError("Error reading preview.js:", e), e;
@@ -4087,16 +4171,16 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4087
4171
  }
4088
4172
  }
4089
4173
  async getStoryIndexFromServer() {
4090
- let e = await ki(ji);
4174
+ let e = await Li(qi);
4091
4175
  if (e.status === 200)
4092
4176
  return e.json();
4093
- throw new Ii({ text: await e.text() });
4177
+ throw new Mi({ text: await e.text() });
4094
4178
  }
4095
4179
  // If initialization gets as far as the story index, this function runs.
4096
4180
  initializeWithStoryIndex(e) {
4097
4181
  if (!this.projectAnnotationsBeforeInitialization)
4098
4182
  throw new Error("Cannot call initializeWithStoryIndex until project annotations resolve");
4099
- this.storyStoreValue = new ge(
4183
+ this.storyStoreValue = new Se(
4100
4184
  e,
4101
4185
  this.importFn,
4102
4186
  this.projectAnnotationsBeforeInitialization
@@ -4107,12 +4191,12 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4107
4191
  }
4108
4192
  emitGlobals() {
4109
4193
  if (!this.storyStoreValue)
4110
- throw new V({ methodName: "emitGlobals" });
4194
+ throw new W({ methodName: "emitGlobals" });
4111
4195
  let e = {
4112
4196
  globals: this.storyStoreValue.userGlobals.get() || {},
4113
4197
  globalTypes: this.storyStoreValue.projectAnnotations.globalTypes || {}
4114
4198
  };
4115
- this.channel.emit(Ei, e);
4199
+ this.channel.emit(Fi, e);
4116
4200
  }
4117
4201
  // EVENT HANDLERS
4118
4202
  // This happens when a config file gets reloaded
@@ -4146,7 +4230,7 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4146
4230
  storyIndex: t
4147
4231
  }) {
4148
4232
  if (!this.storyStoreValue)
4149
- throw new V({ methodName: "onStoriesChanged" });
4233
+ throw new W({ methodName: "onStoriesChanged" });
4150
4234
  await this.storyStoreValue.onStoriesChanged({ importFn: e, storyIndex: t });
4151
4235
  }
4152
4236
  async onUpdateGlobals({
@@ -4154,10 +4238,10 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4154
4238
  currentStory: t
4155
4239
  }) {
4156
4240
  if (this.storyStoreValue || await this.storeInitializationPromise, !this.storyStoreValue)
4157
- throw new V({ methodName: "onUpdateGlobals" });
4241
+ throw new W({ methodName: "onUpdateGlobals" });
4158
4242
  if (this.storyStoreValue.userGlobals.update(e), t) {
4159
4243
  let { initialGlobals: o, storyGlobals: s, userGlobals: i, globals: a } = this.storyStoreValue.getStoryContext(t);
4160
- this.channel.emit(qo, {
4244
+ this.channel.emit(Uo, {
4161
4245
  initialGlobals: o,
4162
4246
  userGlobals: i,
4163
4247
  storyGlobals: s,
@@ -4165,7 +4249,7 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4165
4249
  });
4166
4250
  } else {
4167
4251
  let { initialGlobals: o, globals: s } = this.storyStoreValue.userGlobals;
4168
- this.channel.emit(qo, {
4252
+ this.channel.emit(Uo, {
4169
4253
  initialGlobals: o,
4170
4254
  userGlobals: s,
4171
4255
  storyGlobals: {},
@@ -4176,7 +4260,7 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4176
4260
  }
4177
4261
  async onUpdateArgs({ storyId: e, updatedArgs: t }) {
4178
4262
  if (!this.storyStoreValue)
4179
- throw new V({ methodName: "onUpdateArgs" });
4263
+ throw new W({ methodName: "onUpdateArgs" });
4180
4264
  this.storyStoreValue.args.update(e, t), await Promise.all(
4181
4265
  this.storyRenders.filter((o) => o.id === e && !o.renderOptions.forceInitialArgs).map(
4182
4266
  (o) => (
@@ -4185,7 +4269,7 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4185
4269
  o.story && o.story.usesMount ? o.remount() : o.rerender()
4186
4270
  )
4187
4271
  )
4188
- ), this.channel.emit(Ai, {
4272
+ ), this.channel.emit(Ii, {
4189
4273
  storyId: e,
4190
4274
  args: this.storyStoreValue.args.get(e)
4191
4275
  });
@@ -4194,14 +4278,14 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4194
4278
  try {
4195
4279
  await this.storeInitializationPromise;
4196
4280
  let o = await this.storyStoreValue?.loadStory(t);
4197
- this.channel.emit(No, {
4281
+ this.channel.emit(Go, {
4198
4282
  id: e,
4199
4283
  success: !0,
4200
4284
  payload: { argTypes: o?.argTypes || {} },
4201
4285
  error: null
4202
4286
  });
4203
4287
  } catch (o) {
4204
- this.channel.emit(No, {
4288
+ this.channel.emit(Go, {
4205
4289
  id: e,
4206
4290
  success: !1,
4207
4291
  error: o?.message
@@ -4210,7 +4294,7 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4210
4294
  }
4211
4295
  async onResetArgs({ storyId: e, argNames: t }) {
4212
4296
  if (!this.storyStoreValue)
4213
- throw new V({ methodName: "onResetArgs" });
4297
+ throw new W({ methodName: "onResetArgs" });
4214
4298
  let s = this.storyRenders.find((l) => l.id === e)?.story || await this.storyStoreValue.loadStory({ storyId: e }), a = (t || [
4215
4299
  .../* @__PURE__ */ new Set([
4216
4300
  ...Object.keys(s.initialArgs),
@@ -4234,7 +4318,7 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4234
4318
  // "instant", although async.
4235
4319
  renderStoryToElement(e, t, o, s) {
4236
4320
  if (!this.renderToCanvas || !this.storyStoreValue)
4237
- throw new V({
4321
+ throw new W({
4238
4322
  methodName: "renderStoryToElement"
4239
4323
  });
4240
4324
  let i = new ie(
@@ -4257,76 +4341,76 @@ var { fetch: ki } = Di, ji = "./index.json", Xr = class Xr {
4257
4341
  // API
4258
4342
  async loadStory({ storyId: e }) {
4259
4343
  if (!this.storyStoreValue)
4260
- throw new V({ methodName: "loadStory" });
4344
+ throw new W({ methodName: "loadStory" });
4261
4345
  return this.storyStoreValue.loadStory({ storyId: e });
4262
4346
  }
4263
4347
  getStoryContext(e, { forceInitialArgs: t = !1 } = {}) {
4264
4348
  if (!this.storyStoreValue)
4265
- throw new V({ methodName: "getStoryContext" });
4349
+ throw new W({ methodName: "getStoryContext" });
4266
4350
  return this.storyStoreValue.getStoryContext(e, { forceInitialArgs: t });
4267
4351
  }
4268
4352
  async extract(e) {
4269
4353
  if (!this.storyStoreValue)
4270
- throw new V({ methodName: "extract" });
4354
+ throw new W({ methodName: "extract" });
4271
4355
  if (this.previewEntryError)
4272
4356
  throw this.previewEntryError;
4273
4357
  return await this.storyStoreValue.cacheAllCSFFiles(), this.storyStoreValue.extract(e);
4274
4358
  }
4275
4359
  // UTILITIES
4276
4360
  renderPreviewEntryError(e, t) {
4277
- this.previewEntryError = t, _o.error(e), _o.error(t), this.channel.emit(Ti, t);
4361
+ this.previewEntryError = t, zo.error(e), zo.error(t), this.channel.emit(Ei, t);
4278
4362
  }
4279
4363
  };
4280
- n(Xr, "Preview");
4281
- var be = Xr;
4364
+ n(Zr, "Preview");
4365
+ var Te = Zr;
4282
4366
 
4283
4367
  // src/preview-api/modules/preview-web/PreviewWeb.tsx
4284
- import { global as Tl } from "@storybook/global";
4368
+ import { global as El } from "@storybook/global";
4285
4369
 
4286
4370
  // src/preview-api/modules/preview-web/PreviewWithSelection.tsx
4287
- import { logger as rr } from "storybook/internal/client-logger";
4371
+ import { logger as nr } from "storybook/internal/client-logger";
4288
4372
  import {
4289
- CURRENT_STORY_WAS_SET as Bo,
4290
- DOCS_PREPARED as qi,
4291
- GLOBALS_UPDATED as zo,
4292
- PRELOAD_ENTRIES as Bi,
4293
- PREVIEW_KEYDOWN as zi,
4294
- SET_CURRENT_STORY as Gi,
4295
- STORY_CHANGED as Ui,
4296
- STORY_ERRORED as Hi,
4297
- STORY_MISSING as Go,
4298
- STORY_PREPARED as Vi,
4299
- STORY_RENDER_PHASE_CHANGED as Uo,
4300
- STORY_SPECIFIED as Wi,
4301
- STORY_THREW_EXCEPTION as $i,
4302
- STORY_UNCHANGED as Yi,
4303
- UPDATE_QUERY_PARAMS as Ki
4373
+ CURRENT_STORY_WAS_SET as Ho,
4374
+ DOCS_PREPARED as Hi,
4375
+ GLOBALS_UPDATED as Vo,
4376
+ PRELOAD_ENTRIES as Vi,
4377
+ PREVIEW_KEYDOWN as Wi,
4378
+ SET_CURRENT_STORY as $i,
4379
+ STORY_CHANGED as Yi,
4380
+ STORY_ERRORED as Ki,
4381
+ STORY_MISSING as Wo,
4382
+ STORY_PREPARED as Xi,
4383
+ STORY_RENDER_PHASE_CHANGED as $o,
4384
+ STORY_SPECIFIED as Ji,
4385
+ STORY_THREW_EXCEPTION as Qi,
4386
+ STORY_UNCHANGED as Zi,
4387
+ UPDATE_QUERY_PARAMS as ea
4304
4388
  } from "storybook/internal/core-events";
4305
4389
  import {
4306
- CalledPreviewMethodBeforeInitializationError as rt,
4307
- EmptyIndexError as Xi,
4308
- MdxFileWithNoCsfReferencesError as Ji,
4309
- NoStoryMatchError as Qi
4390
+ CalledPreviewMethodBeforeInitializationError as nt,
4391
+ EmptyIndexError as ra,
4392
+ MdxFileWithNoCsfReferencesError as ta,
4393
+ NoStoryMatchError as oa
4310
4394
  } from "storybook/internal/preview-errors";
4311
4395
 
4312
4396
  // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
4313
- var Mi = !1, Jr = "Invariant failed";
4314
- function er(r, e) {
4397
+ var Bi = !1, et = "Invariant failed";
4398
+ function or(r, e) {
4315
4399
  if (!r) {
4316
- if (Mi)
4317
- throw new Error(Jr);
4318
- var t = typeof e == "function" ? e() : e, o = t ? "".concat(Jr, ": ").concat(t) : Jr;
4400
+ if (Bi)
4401
+ throw new Error(et);
4402
+ var t = typeof e == "function" ? e() : e, o = t ? "".concat(et, ": ").concat(t) : et;
4319
4403
  throw new Error(o);
4320
4404
  }
4321
4405
  }
4322
- n(er, "invariant");
4406
+ n(or, "invariant");
4323
4407
 
4324
4408
  // src/preview-api/modules/preview-web/render/CsfDocsRender.ts
4325
- import { DOCS_RENDERED as _i } from "storybook/internal/core-events";
4409
+ import { DOCS_RENDERED as Gi } from "storybook/internal/core-events";
4326
4410
 
4327
4411
  // src/preview-api/modules/preview-web/docs-context/DocsContext.ts
4328
- import { isStory as Li } from "storybook/internal/csf";
4329
- var Qr = class Qr {
4412
+ import { isStory as zi } from "storybook/internal/csf";
4413
+ var rt = class rt {
4330
4414
  constructor(e, t, o, s) {
4331
4415
  this.channel = e;
4332
4416
  this.store = t;
@@ -4426,7 +4510,7 @@ CSF file?"
4426
4510
  if (t)
4427
4511
  return { type: "meta", csfFile: t };
4428
4512
  let o = this.exportToStory.get(
4429
- Li(e) ? e.input : e
4513
+ zi(e) ? e.input : e
4430
4514
  );
4431
4515
  return o ? { type: "story", story: o } : { type: "component", component: e };
4432
4516
  }
@@ -4464,11 +4548,11 @@ CSF file?"
4464
4548
  }
4465
4549
  }
4466
4550
  };
4467
- n(Qr, "DocsContext");
4468
- var J = Qr;
4551
+ n(rt, "DocsContext");
4552
+ var Q = rt;
4469
4553
 
4470
4554
  // src/preview-api/modules/preview-web/render/CsfDocsRender.ts
4471
- var Zr = class Zr {
4555
+ var tt = class tt {
4472
4556
  constructor(e, t, o, s) {
4473
4557
  this.channel = e;
4474
4558
  this.store = t;
@@ -4488,7 +4572,7 @@ var Zr = class Zr {
4488
4572
  this.preparing = !0;
4489
4573
  let { entryExports: e, csfFiles: t = [] } = await this.store.loadEntry(this.id);
4490
4574
  if (this.torndown)
4491
- throw X;
4575
+ throw J;
4492
4576
  let { importPath: o, title: s } = this.entry, i = this.store.processCSFFileWithCache(
4493
4577
  e,
4494
4578
  o,
@@ -4502,7 +4586,7 @@ var Zr = class Zr {
4502
4586
  docsContext(e) {
4503
4587
  if (!this.csfFiles)
4504
4588
  throw new Error("Cannot render docs before preparing");
4505
- let t = new J(
4589
+ let t = new Q(
4506
4590
  this.channel,
4507
4591
  this.store,
4508
4592
  e,
@@ -4520,7 +4604,7 @@ var Zr = class Zr {
4520
4604
  );
4521
4605
  let i = await s.renderer(), { render: a } = i, l = /* @__PURE__ */ n(async () => {
4522
4606
  try {
4523
- await a(o, s, e), this.channel.emit(_i, this.id);
4607
+ await a(o, s, e), this.channel.emit(Gi, this.id);
4524
4608
  } catch (c) {
4525
4609
  this.callbacks.showException(c);
4526
4610
  }
@@ -4533,12 +4617,12 @@ var Zr = class Zr {
4533
4617
  this.teardownRender?.({ viewModeChanged: e }), this.torndown = !0;
4534
4618
  }
4535
4619
  };
4536
- n(Zr, "CsfDocsRender");
4537
- var Me = Zr;
4620
+ n(tt, "CsfDocsRender");
4621
+ var Ne = tt;
4538
4622
 
4539
4623
  // src/preview-api/modules/preview-web/render/MdxDocsRender.ts
4540
- import { DOCS_RENDERED as Ni } from "storybook/internal/core-events";
4541
- var et = class et {
4624
+ import { DOCS_RENDERED as Ui } from "storybook/internal/core-events";
4625
+ var ot = class ot {
4542
4626
  constructor(e, t, o, s) {
4543
4627
  this.channel = e;
4544
4628
  this.store = t;
@@ -4558,7 +4642,7 @@ var et = class et {
4558
4642
  this.preparing = !0;
4559
4643
  let { entryExports: e, csfFiles: t = [] } = await this.store.loadEntry(this.id);
4560
4644
  if (this.torndown)
4561
- throw X;
4645
+ throw J;
4562
4646
  this.csfFiles = t, this.exports = e, this.preparing = !1;
4563
4647
  }
4564
4648
  isEqual(e) {
@@ -4567,7 +4651,7 @@ var et = class et {
4567
4651
  docsContext(e) {
4568
4652
  if (!this.csfFiles)
4569
4653
  throw new Error("Cannot render docs before preparing");
4570
- return new J(
4654
+ return new Q(
4571
4655
  this.channel,
4572
4656
  this.store,
4573
4657
  e,
@@ -4584,7 +4668,7 @@ var et = class et {
4584
4668
  );
4585
4669
  let i = { ...s, page: this.exports.default }, a = await s.renderer(), { render: l } = a, c = /* @__PURE__ */ n(async () => {
4586
4670
  try {
4587
- await l(o, i, e), this.channel.emit(Ni, this.id);
4671
+ await l(o, i, e), this.channel.emit(Ui, this.id);
4588
4672
  } catch (d) {
4589
4673
  this.callbacks.showException(d);
4590
4674
  }
@@ -4597,34 +4681,34 @@ var et = class et {
4597
4681
  this.teardownRender?.({ viewModeChanged: e }), this.torndown = !0;
4598
4682
  }
4599
4683
  };
4600
- n(et, "MdxDocsRender");
4601
- var Le = et;
4684
+ n(ot, "MdxDocsRender");
4685
+ var Le = ot;
4602
4686
 
4603
4687
  // src/preview-api/modules/preview-web/PreviewWithSelection.tsx
4604
- var Zi = globalThis;
4605
- function ea(r) {
4688
+ var na = globalThis;
4689
+ function sa(r) {
4606
4690
  let e = r.composedPath && r.composedPath()[0] || r.target;
4607
4691
  return /input|textarea/i.test(e.tagName) || e.getAttribute("contenteditable") !== null;
4608
4692
  }
4609
- n(ea, "focusInInput");
4610
- var Ho = "attached-mdx", ra = "unattached-mdx";
4611
- function ta({ tags: r }) {
4612
- return r?.includes(ra) || r?.includes(Ho);
4693
+ n(sa, "focusInInput");
4694
+ var Yo = "attached-mdx", ia = "unattached-mdx";
4695
+ function aa({ tags: r }) {
4696
+ return r?.includes(ia) || r?.includes(Yo);
4613
4697
  }
4614
- n(ta, "isMdxEntry");
4615
- function tt(r) {
4698
+ n(aa, "isMdxEntry");
4699
+ function st(r) {
4616
4700
  return r.type === "story";
4617
4701
  }
4618
- n(tt, "isStoryRender");
4619
- function oa(r) {
4702
+ n(st, "isStoryRender");
4703
+ function la(r) {
4620
4704
  return r.type === "docs";
4621
4705
  }
4622
- n(oa, "isDocsRender");
4623
- function na(r) {
4624
- return oa(r) && r.subtype === "csf";
4706
+ n(la, "isDocsRender");
4707
+ function ca(r) {
4708
+ return la(r) && r.subtype === "csf";
4625
4709
  }
4626
- n(na, "isCsfDocsRender");
4627
- var ot = class ot extends be {
4710
+ n(ca, "isCsfDocsRender");
4711
+ var it = class it extends Te {
4628
4712
  constructor(t, o, s, i) {
4629
4713
  super(t, o, void 0, !1);
4630
4714
  this.importFn = t;
@@ -4634,12 +4718,12 @@ var ot = class ot extends be {
4634
4718
  this.initialize();
4635
4719
  }
4636
4720
  setupListeners() {
4637
- super.setupListeners(), Zi.onkeydown = this.onKeydown.bind(this), this.channel.on(Gi, this.onSetCurrentStory.bind(this)), this.channel.on(
4638
- Ki, this.onUpdateQueryParams.bind(this)), this.channel.on(Bi, this.onPreloadStories.bind(this));
4721
+ super.setupListeners(), na.onkeydown = this.onKeydown.bind(this), this.channel.on($i, this.onSetCurrentStory.bind(this)), this.channel.on(
4722
+ ea, this.onUpdateQueryParams.bind(this)), this.channel.on(Vi, this.onPreloadStories.bind(this));
4639
4723
  }
4640
4724
  async setInitialGlobals() {
4641
4725
  if (!this.storyStoreValue)
4642
- throw new rt({ methodName: "setInitialGlobals" });
4726
+ throw new nt({ methodName: "setInitialGlobals" });
4643
4727
  let { globals: t } = this.selectionStore.selectionSpecifier || {};
4644
4728
  t && this.storyStoreValue.userGlobals.updateFromPersisted(t), this.emitGlobals();
4645
4729
  }
@@ -4650,7 +4734,7 @@ var ot = class ot extends be {
4650
4734
  // Use the selection specifier to choose a story, then render it
4651
4735
  async selectSpecifiedStory() {
4652
4736
  if (!this.storyStoreValue)
4653
- throw new rt({
4737
+ throw new nt({
4654
4738
  methodName: "selectSpecifiedStory"
4655
4739
  });
4656
4740
  if (this.selectionStore.selection) {
@@ -4663,14 +4747,14 @@ var ot = class ot extends be {
4663
4747
  }
4664
4748
  let { storySpecifier: t, args: o } = this.selectionStore.selectionSpecifier, s = this.storyStoreValue.storyIndex.entryFromSpecifier(t);
4665
4749
  if (!s) {
4666
- t === "*" ? this.renderStoryLoadingException(t, new Xi()) : this.renderStoryLoadingException(
4750
+ t === "*" ? this.renderStoryLoadingException(t, new ra()) : this.renderStoryLoadingException(
4667
4751
  t,
4668
- new Qi({ storySpecifier: t.toString() })
4752
+ new oa({ storySpecifier: t.toString() })
4669
4753
  );
4670
4754
  return;
4671
4755
  }
4672
4756
  let { id: i, type: a } = s;
4673
- this.selectionStore.setSelection({ storyId: i, viewMode: a }), this.channel.emit(Wi, this.selectionStore.selection), this.channel.emit(Bo,
4757
+ this.selectionStore.setSelection({ storyId: i, viewMode: a }), this.channel.emit(Ji, this.selectionStore.selection), this.channel.emit(Ho,
4674
4758
  this.selectionStore.selection), await this.renderSelection({ persistedArgs: o });
4675
4759
  }
4676
4760
  // EVENT HANDLERS
@@ -4689,15 +4773,15 @@ var ot = class ot extends be {
4689
4773
  selectSpecifiedStory();
4690
4774
  }
4691
4775
  onKeydown(t) {
4692
- if (!this.storyRenders.find((o) => o.disableKeyListeners) && !ea(t)) {
4776
+ if (!this.storyRenders.find((o) => o.disableKeyListeners) && !sa(t)) {
4693
4777
  let { altKey: o, ctrlKey: s, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d } = t;
4694
- this.channel.emit(zi, {
4778
+ this.channel.emit(Wi, {
4695
4779
  event: { altKey: o, ctrlKey: s, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d }
4696
4780
  });
4697
4781
  }
4698
4782
  }
4699
4783
  async onSetCurrentStory(t) {
4700
- this.selectionStore.setSelection({ viewMode: "story", ...t }), await this.storeInitializationPromise, this.channel.emit(Bo, this.selectionStore.
4784
+ this.selectionStore.setSelection({ viewMode: "story", ...t }), await this.storeInitializationPromise, this.channel.emit(Ho, this.selectionStore.
4701
4785
  selection), this.renderSelection();
4702
4786
  }
4703
4787
  onUpdateQueryParams(t) {
@@ -4705,7 +4789,7 @@ var ot = class ot extends be {
4705
4789
  }
4706
4790
  async onUpdateGlobals({ globals: t }) {
4707
4791
  let o = this.currentRender instanceof ie && this.currentRender.story || void 0;
4708
- super.onUpdateGlobals({ globals: t, currentStory: o }), (this.currentRender instanceof Le || this.currentRender instanceof Me) && await this.
4792
+ super.onUpdateGlobals({ globals: t, currentStory: o }), (this.currentRender instanceof Le || this.currentRender instanceof Ne) && await this.
4709
4793
  currentRender.rerender?.();
4710
4794
  }
4711
4795
  async onUpdateArgs({ storyId: t, updatedArgs: o }) {
@@ -4723,7 +4807,7 @@ var ot = class ot extends be {
4723
4807
  async renderSelection({ persistedArgs: t } = {}) {
4724
4808
  let { renderToCanvas: o } = this;
4725
4809
  if (!this.storyStoreValue || !o)
4726
- throw new rt({ methodName: "renderSelection" });
4810
+ throw new nt({ methodName: "renderSelection" });
4727
4811
  let { selection: s } = this.selectionStore;
4728
4812
  if (!s)
4729
4813
  throw new Error("Cannot call renderSelection as no selection was made");
@@ -4745,12 +4829,12 @@ var ot = class ot extends be {
4745
4829
  this.mainStoryCallbacks(i),
4746
4830
  i,
4747
4831
  "story"
4748
- ) : ta(a) ? d = new Le(
4832
+ ) : aa(a) ? d = new Le(
4749
4833
  this.channel,
4750
4834
  this.storyStoreValue,
4751
4835
  a,
4752
4836
  this.mainStoryCallbacks(i)
4753
- ) : d = new Me(
4837
+ ) : d = new Ne(
4754
4838
  this.channel,
4755
4839
  this.storyStoreValue,
4756
4840
  a,
@@ -4763,16 +4847,16 @@ var ot = class ot extends be {
4763
4847
  try {
4764
4848
  await d.prepare();
4765
4849
  } catch (h) {
4766
- u && await this.teardownRender(u), h !== X && this.renderStoryLoadingException(i, h);
4850
+ u && await this.teardownRender(u), h !== J && this.renderStoryLoadingException(i, h);
4767
4851
  return;
4768
4852
  }
4769
4853
  let y = !l && u && !d.isEqual(u);
4770
- if (t && tt(d) && (er(!!d.story), this.storyStoreValue.args.updateFromPersisted(d.story, t)), u && !u.torndown && !l && !y && !c) {
4771
- this.currentRender = u, this.channel.emit(Yi, i), this.view.showMain();
4854
+ if (t && st(d) && (or(!!d.story), this.storyStoreValue.args.updateFromPersisted(d.story, t)), u && !u.torndown && !l && !y && !c) {
4855
+ this.currentRender = u, this.channel.emit(Zi, i), this.view.showMain();
4772
4856
  return;
4773
4857
  }
4774
- if (u && await this.teardownRender(u, { viewModeChanged: c }), p && (l || c) && this.channel.emit(Ui, i), tt(d)) {
4775
- er(!!d.story);
4858
+ if (u && await this.teardownRender(u, { viewModeChanged: c }), p && (l || c) && this.channel.emit(Yi, i), st(d)) {
4859
+ or(!!d.story);
4776
4860
  let {
4777
4861
  parameters: h,
4778
4862
  initialArgs: g,
@@ -4783,33 +4867,33 @@ var ot = class ot extends be {
4783
4867
  storyGlobals: f,
4784
4868
  globals: S
4785
4869
  } = this.storyStoreValue.getStoryContext(d.story);
4786
- this.channel.emit(Vi, {
4870
+ this.channel.emit(Xi, {
4787
4871
  id: i,
4788
4872
  parameters: h,
4789
4873
  initialArgs: g,
4790
4874
  argTypes: b,
4791
4875
  args: m
4792
- }), this.channel.emit(zo, { userGlobals: x, storyGlobals: f, globals: S, initialGlobals: T });
4876
+ }), this.channel.emit(Vo, { userGlobals: x, storyGlobals: f, globals: S, initialGlobals: T });
4793
4877
  } else {
4794
4878
  let { parameters: h } = this.storyStoreValue.projectAnnotations, { initialGlobals: g, globals: b } = this.storyStoreValue.userGlobals;
4795
- if (this.channel.emit(zo, {
4879
+ if (this.channel.emit(Vo, {
4796
4880
  globals: b,
4797
4881
  initialGlobals: g,
4798
4882
  storyGlobals: {},
4799
4883
  userGlobals: b
4800
- }), na(d) || d.entry.tags?.includes(Ho)) {
4884
+ }), ca(d) || d.entry.tags?.includes(Yo)) {
4801
4885
  if (!d.csfFiles)
4802
- throw new Ji({ storyId: i });
4886
+ throw new ta({ storyId: i });
4803
4887
  ({ parameters: h } = this.storyStoreValue.preparedMetaFromCSFFile({
4804
4888
  csfFile: d.csfFiles[0]
4805
4889
  }));
4806
4890
  }
4807
- this.channel.emit(qi, {
4891
+ this.channel.emit(Hi, {
4808
4892
  id: i,
4809
4893
  parameters: h
4810
4894
  });
4811
4895
  }
4812
- tt(d) ? (er(!!d.story), this.storyRenders.push(d), this.currentRender.renderToElement(
4896
+ st(d) ? (or(!!d.story), this.storyRenders.push(d), this.currentRender.renderToElement(
4813
4897
  this.view.prepareForStory(d.story)
4814
4898
  )) : this.currentRender.renderToElement(
4815
4899
  this.view.prepareForDocs(),
@@ -4833,41 +4917,41 @@ var ot = class ot extends be {
4833
4917
  super.renderPreviewEntryError(t, o), this.view.showErrorDisplay(o);
4834
4918
  }
4835
4919
  renderMissingStory() {
4836
- this.view.showNoPreview(), this.channel.emit(Go);
4920
+ this.view.showNoPreview(), this.channel.emit(Wo);
4837
4921
  }
4838
4922
  renderStoryLoadingException(t, o) {
4839
- rr.error(o), this.view.showErrorDisplay(o), this.channel.emit(Go, t);
4923
+ nr.error(o), this.view.showErrorDisplay(o), this.channel.emit(Wo, t);
4840
4924
  }
4841
4925
  // renderException is used if we fail to render the story and it is uncaught by the app layer
4842
4926
  renderException(t, o) {
4843
4927
  let { name: s = "Error", message: i = String(o), stack: a } = o;
4844
- this.channel.emit($i, { name: s, message: i, stack: a }), this.channel.emit(Uo, { newPhase: "errored", storyId: t }), this.view.showErrorDisplay(
4845
- o), rr.error(`Error rendering story '${t}':`), rr.error(o);
4928
+ this.channel.emit(Qi, { name: s, message: i, stack: a }), this.channel.emit($o, { newPhase: "errored", storyId: t }), this.view.showErrorDisplay(
4929
+ o), nr.error(`Error rendering story '${t}':`), nr.error(o);
4846
4930
  }
4847
4931
  // renderError is used by the various app layers to inform the user they have done something
4848
4932
  // wrong -- for instance returned the wrong thing from a story
4849
4933
  renderError(t, { title: o, description: s }) {
4850
- rr.error(`Error rendering story ${o}: ${s}`), this.channel.emit(Hi, { title: o, description: s }), this.channel.emit(Uo, { newPhase: "er\
4934
+ nr.error(`Error rendering story ${o}: ${s}`), this.channel.emit(Ki, { title: o, description: s }), this.channel.emit($o, { newPhase: "er\
4851
4935
  rored", storyId: t }), this.view.showErrorDisplay({
4852
4936
  message: o,
4853
4937
  stack: s
4854
4938
  });
4855
4939
  }
4856
4940
  };
4857
- n(ot, "PreviewWithSelection");
4858
- var Se = ot;
4941
+ n(it, "PreviewWithSelection");
4942
+ var xe = it;
4859
4943
 
4860
4944
  // src/preview-api/modules/preview-web/UrlStore.ts
4861
- var Ne = ue(ir(), 1);
4862
- import { global as ka } from "@storybook/global";
4945
+ var Be = ue(cr(), 1);
4946
+ import { global as La } from "@storybook/global";
4863
4947
 
4864
4948
  // src/preview-api/modules/preview-web/parseArgsParam.ts
4865
- import { once as Ia } from "storybook/internal/client-logger";
4866
- var on = ue(ir(), 1);
4867
- var tn = /^[a-zA-Z0-9 _-]*$/, nn = /^-?[0-9]+(\.[0-9]+)?$/, Oa = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i, sn = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,
4868
- dt = /* @__PURE__ */ n((r = "", e) => r === null || r === "" || !tn.test(r) ? !1 : e == null || e instanceof Date || typeof e == "number" ||
4869
- typeof e == "boolean" ? !0 : typeof e == "string" ? tn.test(e) || nn.test(e) || Oa.test(e) || sn.test(e) : Array.isArray(e) ? e.every((t) => dt(
4870
- r, t)) : k(e) ? Object.entries(e).every(([t, o]) => dt(t, o)) : !1, "validateArgs"), Da = {
4949
+ import { once as Ma } from "storybook/internal/client-logger";
4950
+ var ln = ue(cr(), 1);
4951
+ var an = /^[a-zA-Z0-9 _-]*$/, cn = /^-?[0-9]+(\.[0-9]+)?$/, _a = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i, dn = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,
4952
+ ft = /* @__PURE__ */ n((r = "", e) => r === null || r === "" || !an.test(r) ? !1 : e == null || e instanceof Date || typeof e == "number" ||
4953
+ typeof e == "boolean" ? !0 : typeof e == "string" ? an.test(e) || cn.test(e) || _a.test(e) || dn.test(e) : Array.isArray(e) ? e.every((t) => ft(
4954
+ r, t)) : j(e) ? Object.entries(e).every(([t, o]) => ft(t, o)) : !1, "validateArgs"), Na = {
4871
4955
  delimiter: ";",
4872
4956
  // we're parsing a single query param
4873
4957
  nesting: !0,
@@ -4889,17 +4973,17 @@ r, t)) : k(e) ? Object.entries(e).every(([t, o]) => dt(t, o)) : !1, "validateArg
4889
4973
  return new Date(r.replaceAll(" ", "+").slice(6, -1));
4890
4974
  if (r.startsWith("!hex(") && r.endsWith(")"))
4891
4975
  return `#${r.slice(5, -1)}`;
4892
- let e = r.slice(1).match(sn);
4976
+ let e = r.slice(1).match(dn);
4893
4977
  if (e)
4894
4978
  return r.startsWith("!rgba") || r.startsWith("!RGBA") ? `${e[1]}(${e[2]}, ${e[3]}, ${e[4]}, ${e[5]})` : r.startsWith("!hsla") || r.startsWith(
4895
4979
  "!HSLA") ? `${e[1]}(${e[2]}, ${e[3]}%, ${e[4]}%, ${e[5]})` : r.startsWith("!rgb") || r.startsWith("!RGB") ? `${e[1]}(${e[2]}, ${e[3]}\
4896
4980
  , ${e[4]})` : `${e[1]}(${e[2]}, ${e[3]}%, ${e[4]}%)`;
4897
4981
  }
4898
- return nn.test(r) ? Number(r) : r;
4982
+ return cn.test(r) ? Number(r) : r;
4899
4983
  }
4900
- }, pt = /* @__PURE__ */ n((r) => {
4984
+ }, yt = /* @__PURE__ */ n((r) => {
4901
4985
  let e = r.split(";").map((t) => t.replace("=", "~").replace(":", "="));
4902
- return Object.entries((0, on.parse)(e.join(";"), Da)).reduce((t, [o, s]) => dt(o, s) ? Object.assign(t, { [o]: s }) : (Ia.warn(P`
4986
+ return Object.entries((0, ln.parse)(e.join(";"), Na)).reduce((t, [o, s]) => ft(o, s) ? Object.assign(t, { [o]: s }) : (Ma.warn(P`
4903
4987
  Omitted potentially unsafe URL args.
4904
4988
 
4905
4989
  More info: https://storybook.js.org/docs/writing-stories/args#setting-args-through-the-url
@@ -4907,88 +4991,88 @@ r, t)) : k(e) ? Object.entries(e).every(([t, o]) => dt(t, o)) : !1, "validateArg
4907
4991
  }, "parseArgsParam");
4908
4992
 
4909
4993
  // src/preview-api/modules/preview-web/UrlStore.ts
4910
- var { history: an, document: Q } = ka;
4911
- function ja(r) {
4994
+ var { history: pn, document: Z } = La;
4995
+ function qa(r) {
4912
4996
  let e = (r || "").match(/^\/story\/(.+)/);
4913
4997
  if (!e)
4914
4998
  throw new Error(`Invalid path '${r}', must start with '/story/'`);
4915
4999
  return e[1];
4916
5000
  }
4917
- n(ja, "pathToId");
4918
- var ln = /* @__PURE__ */ n(({
5001
+ n(qa, "pathToId");
5002
+ var un = /* @__PURE__ */ n(({
4919
5003
  selection: r,
4920
5004
  extraParams: e
4921
5005
  }) => {
4922
- let t = Q?.location.search.slice(1), { path: o, selectedKind: s, selectedStory: i, ...a } = (0, Ne.parse)(t);
4923
- return `?${(0, Ne.stringify)({
5006
+ let t = Z?.location.search.slice(1), { path: o, selectedKind: s, selectedStory: i, ...a } = (0, Be.parse)(t);
5007
+ return `?${(0, Be.stringify)({
4924
5008
  ...a,
4925
5009
  ...e,
4926
5010
  ...r && { id: r.storyId, viewMode: r.viewMode }
4927
5011
  })}`;
4928
- }, "getQueryString"), Ma = /* @__PURE__ */ n((r) => {
5012
+ }, "getQueryString"), Ba = /* @__PURE__ */ n((r) => {
4929
5013
  if (!r)
4930
5014
  return;
4931
- let e = ln({ selection: r }), { hash: t = "" } = Q.location;
4932
- Q.title = r.storyId, an.replaceState({}, "", `${Q.location.pathname}${e}${t}`);
4933
- }, "setPath"), La = /* @__PURE__ */ n((r) => r != null && typeof r == "object" && Array.isArray(r) === !1, "isObject"), _e = /* @__PURE__ */ n(
5015
+ let e = un({ selection: r }), { hash: t = "" } = Z.location;
5016
+ Z.title = r.storyId, pn.replaceState({}, "", `${Z.location.pathname}${e}${t}`);
5017
+ }, "setPath"), za = /* @__PURE__ */ n((r) => r != null && typeof r == "object" && Array.isArray(r) === !1, "isObject"), qe = /* @__PURE__ */ n(
4934
5018
  (r) => {
4935
5019
  if (r !== void 0) {
4936
5020
  if (typeof r == "string")
4937
5021
  return r;
4938
5022
  if (Array.isArray(r))
4939
- return _e(r[0]);
4940
- if (La(r))
4941
- return _e(
5023
+ return qe(r[0]);
5024
+ if (za(r))
5025
+ return qe(
4942
5026
  Object.values(r).filter(Boolean)
4943
5027
  );
4944
5028
  }
4945
- }, "getFirstString"), _a = /* @__PURE__ */ n(() => {
4946
- if (typeof Q < "u") {
4947
- let r = Q.location.search.slice(1), e = (0, Ne.parse)(r), t = typeof e.args == "string" ? pt(e.args) : void 0, o = typeof e.globals == "\
4948
- string" ? pt(e.globals) : void 0, s = _e(e.viewMode);
5029
+ }, "getFirstString"), Ga = /* @__PURE__ */ n(() => {
5030
+ if (typeof Z < "u") {
5031
+ let r = Z.location.search.slice(1), e = (0, Be.parse)(r), t = typeof e.args == "string" ? yt(e.args) : void 0, o = typeof e.globals == "\
5032
+ string" ? yt(e.globals) : void 0, s = qe(e.viewMode);
4949
5033
  (typeof s != "string" || !s.match(/docs|story/)) && (s = "story");
4950
- let i = _e(e.path), a = i ? ja(i) : _e(e.id);
5034
+ let i = qe(e.path), a = i ? qa(i) : qe(e.id);
4951
5035
  if (a)
4952
5036
  return { storySpecifier: a, args: t, globals: o, viewMode: s };
4953
5037
  }
4954
5038
  return null;
4955
- }, "getSelectionSpecifierFromPath"), ut = class ut {
5039
+ }, "getSelectionSpecifierFromPath"), mt = class mt {
4956
5040
  constructor() {
4957
- this.selectionSpecifier = _a();
5041
+ this.selectionSpecifier = Ga();
4958
5042
  }
4959
5043
  setSelection(e) {
4960
- this.selection = e, Ma(this.selection);
5044
+ this.selection = e, Ba(this.selection);
4961
5045
  }
4962
5046
  setQueryParams(e) {
4963
- let t = ln({ extraParams: e }), { hash: o = "" } = Q.location;
4964
- an.replaceState({}, "", `${Q.location.pathname}${t}${o}`);
5047
+ let t = un({ extraParams: e }), { hash: o = "" } = Z.location;
5048
+ pn.replaceState({}, "", `${Z.location.pathname}${t}${o}`);
4965
5049
  }
4966
5050
  };
4967
- n(ut, "UrlStore");
4968
- var Te = ut;
5051
+ n(mt, "UrlStore");
5052
+ var Re = mt;
4969
5053
 
4970
5054
  // src/preview-api/modules/preview-web/WebView.ts
4971
- var Bn = ue(_n(), 1), zn = ue(ir(), 1);
4972
- import { logger as bl } from "storybook/internal/client-logger";
4973
- import { global as Sl } from "@storybook/global";
4974
- var { document: D } = Sl, Nn = 100, Gn = /* @__PURE__ */ ((i) => (i.MAIN = "MAIN", i.NOPREVIEW = "NOPREVIEW", i.PREPARING_STORY = "PREPARING\
4975
- _STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Gn || {}), St = {
5055
+ var Hn = ue(zn(), 1), Vn = ue(cr(), 1);
5056
+ import { logger as wl } from "storybook/internal/client-logger";
5057
+ import { global as Al } from "@storybook/global";
5058
+ var { document: O } = Al, Gn = 100, Wn = /* @__PURE__ */ ((i) => (i.MAIN = "MAIN", i.NOPREVIEW = "NOPREVIEW", i.PREPARING_STORY = "PREPARING\
5059
+ _STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Wn || {}), Rt = {
4976
5060
  PREPARING_STORY: "sb-show-preparing-story",
4977
5061
  PREPARING_DOCS: "sb-show-preparing-docs",
4978
5062
  MAIN: "sb-show-main",
4979
5063
  NOPREVIEW: "sb-show-nopreview",
4980
5064
  ERROR: "sb-show-errordisplay"
4981
- }, Tt = {
5065
+ }, wt = {
4982
5066
  centered: "sb-main-centered",
4983
5067
  fullscreen: "sb-main-fullscreen",
4984
5068
  padded: "sb-main-padded"
4985
- }, qn = new Bn.default({
5069
+ }, Un = new Hn.default({
4986
5070
  escapeXML: !0
4987
- }), xt = class xt {
5071
+ }), At = class At {
4988
5072
  constructor() {
4989
5073
  this.testing = !1;
4990
- if (typeof D < "u") {
4991
- let { __SPECIAL_TEST_PARAMETER__: e } = (0, zn.parse)(D.location.search.slice(1));
5074
+ if (typeof O < "u") {
5075
+ let { __SPECIAL_TEST_PARAMETER__: e } = (0, Vn.parse)(O.location.search.slice(1));
4992
5076
  switch (e) {
4993
5077
  case "preparing-story": {
4994
5078
  this.showPreparingStory(), this.testing = !0;
@@ -5004,46 +5088,46 @@ _STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Gn || {}),
5004
5088
  }
5005
5089
  // Get ready to render a story, returning the element to render to
5006
5090
  prepareForStory(e) {
5007
- return this.showStory(), this.applyLayout(e.parameters.layout), D.documentElement.scrollTop = 0, D.documentElement.scrollLeft = 0, this.
5091
+ return this.showStory(), this.applyLayout(e.parameters.layout), O.documentElement.scrollTop = 0, O.documentElement.scrollLeft = 0, this.
5008
5092
  storyRoot();
5009
5093
  }
5010
5094
  storyRoot() {
5011
- return D.getElementById("storybook-root");
5095
+ return O.getElementById("storybook-root");
5012
5096
  }
5013
5097
  prepareForDocs() {
5014
- return this.showMain(), this.showDocs(), this.applyLayout("fullscreen"), D.documentElement.scrollTop = 0, D.documentElement.scrollLeft =
5098
+ return this.showMain(), this.showDocs(), this.applyLayout("fullscreen"), O.documentElement.scrollTop = 0, O.documentElement.scrollLeft =
5015
5099
  0, this.docsRoot();
5016
5100
  }
5017
5101
  docsRoot() {
5018
- return D.getElementById("storybook-docs");
5102
+ return O.getElementById("storybook-docs");
5019
5103
  }
5020
5104
  applyLayout(e = "padded") {
5021
5105
  if (e === "none") {
5022
- D.body.classList.remove(this.currentLayoutClass), this.currentLayoutClass = null;
5106
+ O.body.classList.remove(this.currentLayoutClass), this.currentLayoutClass = null;
5023
5107
  return;
5024
5108
  }
5025
5109
  this.checkIfLayoutExists(e);
5026
- let t = Tt[e];
5027
- D.body.classList.remove(this.currentLayoutClass), D.body.classList.add(t), this.currentLayoutClass = t;
5110
+ let t = wt[e];
5111
+ O.body.classList.remove(this.currentLayoutClass), O.body.classList.add(t), this.currentLayoutClass = t;
5028
5112
  }
5029
5113
  checkIfLayoutExists(e) {
5030
- Tt[e] || bl.warn(
5114
+ wt[e] || wl.warn(
5031
5115
  P`
5032
5116
  The desired layout: ${e} is not a valid option.
5033
- The possible options are: ${Object.keys(Tt).join(", ")}, none.
5117
+ The possible options are: ${Object.keys(wt).join(", ")}, none.
5034
5118
  `
5035
5119
  );
5036
5120
  }
5037
5121
  showMode(e) {
5038
- clearTimeout(this.preparingTimeout), Object.keys(Gn).forEach((t) => {
5039
- t === e ? D.body.classList.add(St[t]) : D.body.classList.remove(St[t]);
5122
+ clearTimeout(this.preparingTimeout), Object.keys(Wn).forEach((t) => {
5123
+ t === e ? O.body.classList.add(Rt[t]) : O.body.classList.remove(Rt[t]);
5040
5124
  });
5041
5125
  }
5042
5126
  showErrorDisplay({ message: e = "", stack: t = "" }) {
5043
5127
  let o = e, s = t, i = e.split(`
5044
5128
  `);
5045
5129
  i.length > 1 && ([o] = i, s = i.slice(1).join(`
5046
- `).replace(/^\n/, "")), D.getElementById("error-message").innerHTML = qn.toHtml(o), D.getElementById("error-stack").innerHTML = qn.toHtml(s),
5130
+ `).replace(/^\n/, "")), O.getElementById("error-message").innerHTML = Un.toHtml(o), O.getElementById("error-stack").innerHTML = Un.toHtml(s),
5047
5131
  this.showMode("ERROR");
5048
5132
  }
5049
5133
  showNoPreview() {
@@ -5053,12 +5137,12 @@ true"));
5053
5137
  showPreparingStory({ immediate: e = !1 } = {}) {
5054
5138
  clearTimeout(this.preparingTimeout), e ? this.showMode("PREPARING_STORY") : this.preparingTimeout = setTimeout(
5055
5139
  () => this.showMode("PREPARING_STORY"),
5056
- Nn
5140
+ Gn
5057
5141
  );
5058
5142
  }
5059
5143
  showPreparingDocs({ immediate: e = !1 } = {}) {
5060
5144
  clearTimeout(this.preparingTimeout), e ? this.showMode("PREPARING_DOCS") : this.preparingTimeout = setTimeout(() => this.showMode("PREPA\
5061
- RING_DOCS"), Nn);
5145
+ RING_DOCS"), Gn);
5062
5146
  }
5063
5147
  showMain() {
5064
5148
  this.showMode("MAIN");
@@ -5070,27 +5154,27 @@ RING_DOCS"), Nn);
5070
5154
  this.docsRoot().setAttribute("hidden", "true"), this.storyRoot().removeAttribute("hidden");
5071
5155
  }
5072
5156
  showStoryDuringRender() {
5073
- D.body.classList.add(St.MAIN);
5157
+ O.body.classList.add(Rt.MAIN);
5074
5158
  }
5075
5159
  };
5076
- n(xt, "WebView");
5077
- var xe = xt;
5160
+ n(At, "WebView");
5161
+ var we = At;
5078
5162
 
5079
5163
  // src/preview-api/modules/preview-web/PreviewWeb.tsx
5080
- var Rt = class Rt extends Se {
5164
+ var Et = class Et extends xe {
5081
5165
  constructor(t, o) {
5082
- super(t, o, new Te(), new xe());
5166
+ super(t, o, new Re(), new we());
5083
5167
  this.importFn = t;
5084
5168
  this.getProjectAnnotations = o;
5085
- Tl.__STORYBOOK_PREVIEW__ = this;
5169
+ El.__STORYBOOK_PREVIEW__ = this;
5086
5170
  }
5087
5171
  };
5088
- n(Rt, "PreviewWeb");
5089
- var yr = Rt;
5172
+ n(Et, "PreviewWeb");
5173
+ var gr = Et;
5090
5174
 
5091
5175
  // src/preview-api/modules/preview-web/simulate-pageload.ts
5092
- import { global as xl } from "@storybook/global";
5093
- var { document: de } = xl, Rl = [
5176
+ import { global as Cl } from "@storybook/global";
5177
+ var { document: de } = Cl, vl = [
5094
5178
  "application/javascript",
5095
5179
  "application/ecmascript",
5096
5180
  "application/x-ecmascript",
@@ -5109,103 +5193,105 @@ var { document: de } = xl, Rl = [
5109
5193
  "text/x-javascript",
5110
5194
  // Support modern javascript
5111
5195
  "module"
5112
- ], wl = "script", Un = "scripts-root";
5113
- function mr() {
5196
+ ], Pl = "script", $n = "scripts-root";
5197
+ function br() {
5114
5198
  let r = de.createEvent("Event");
5115
5199
  r.initEvent("DOMContentLoaded", !0, !0), de.dispatchEvent(r);
5116
5200
  }
5117
- n(mr, "simulateDOMContentLoaded");
5118
- function El(r, e, t) {
5201
+ n(br, "simulateDOMContentLoaded");
5202
+ function Fl(r, e, t) {
5119
5203
  let o = de.createElement("script");
5120
5204
  o.type = r.type === "module" ? "module" : "text/javascript", r.src ? (o.onload = e, o.onerror = e, o.src = r.src) : o.textContent = r.innerText,
5121
5205
  t ? t.appendChild(o) : de.head.appendChild(o), r.parentNode.removeChild(r), r.src || e();
5122
5206
  }
5123
- n(El, "insertScript");
5124
- function Hn(r, e, t = 0) {
5207
+ n(Fl, "insertScript");
5208
+ function Yn(r, e, t = 0) {
5125
5209
  r[t](() => {
5126
- t++, t === r.length ? e() : Hn(r, e, t);
5210
+ t++, t === r.length ? e() : Yn(r, e, t);
5127
5211
  });
5128
5212
  }
5129
- n(Hn, "insertScriptsSequentially");
5130
- function Vn(r) {
5131
- let e = de.getElementById(Un);
5132
- e ? e.innerHTML = "" : (e = de.createElement("div"), e.id = Un, de.body.appendChild(e));
5133
- let t = Array.from(r.querySelectorAll(wl));
5213
+ n(Yn, "insertScriptsSequentially");
5214
+ function Kn(r) {
5215
+ let e = de.getElementById($n);
5216
+ e ? e.innerHTML = "" : (e = de.createElement("div"), e.id = $n, de.body.appendChild(e));
5217
+ let t = Array.from(r.querySelectorAll(Pl));
5134
5218
  if (t.length) {
5135
5219
  let o = [];
5136
5220
  t.forEach((s) => {
5137
5221
  let i = s.getAttribute("type");
5138
- (!i || Rl.includes(i)) && o.push((a) => El(s, a, e));
5139
- }), o.length && Hn(o, mr, void 0);
5222
+ (!i || vl.includes(i)) && o.push((a) => Fl(s, a, e));
5223
+ }), o.length && Yn(o, br, void 0);
5140
5224
  } else
5141
- mr();
5225
+ br();
5142
5226
  }
5143
- n(Vn, "simulatePageLoad");
5227
+ n(Kn, "simulatePageLoad");
5144
5228
 
5145
5229
  // src/docs-tools/shared.ts
5146
- var Wn = "storybook/docs", ny = `${Wn}/panel`;
5147
- var $n = `${Wn}/snippet-rendered`;
5230
+ var Xn = "storybook/docs", uy = `${Xn}/panel`;
5231
+ var Jn = `${Xn}/snippet-rendered`;
5148
5232
 
5149
5233
  // src/preview-api/modules/preview-web/emitTransformCode.ts
5150
- async function Yn(r, e) {
5234
+ async function Qn(r, e) {
5151
5235
  let t = e.parameters?.docs?.source?.transform, { id: o, unmappedArgs: s } = e, i = t && r ? t?.(r, e) : r, a = i ? await i : void 0;
5152
- L.getChannel().emit($n, {
5236
+ _.getChannel().emit(Jn, {
5153
5237
  id: o,
5154
5238
  source: a,
5155
5239
  args: s
5156
5240
  });
5157
5241
  }
5158
- n(Yn, "emitTransformCode");
5242
+ n(Qn, "emitTransformCode");
5159
5243
  export {
5160
- J as DocsContext,
5161
- re as HooksContext,
5162
- be as Preview,
5163
- yr as PreviewWeb,
5164
- Se as PreviewWithSelection,
5244
+ Q as DocsContext,
5245
+ te as HooksContext,
5246
+ Te as Preview,
5247
+ gr as PreviewWeb,
5248
+ xe as PreviewWithSelection,
5165
5249
  se as ReporterAPI,
5166
- ge as StoryStore,
5167
- Te as UrlStore,
5168
- xe as WebView,
5169
- L as addons,
5170
- wr as applyHooks,
5171
- Fe as combineArgs,
5172
- _ as combineParameters,
5173
- Y as composeConfigs,
5174
- Hr as composeStepRunners,
5175
- ti as composeStories,
5176
- vo as composeStory,
5177
- oi as createPlaywrightTest,
5178
- Ro as decorateStory,
5179
- Br as defaultDecorateStory,
5180
- os as definePreview,
5181
- Yn as emitTransformCode,
5182
- Je as filterArgTypes,
5183
- te as getCoreAnnotations,
5184
- Wr as getCsfFactoryAnnotations,
5185
- De as inferControls,
5186
- Ts as makeDecorator,
5187
- gr as mockChannel,
5250
+ Se as StoryStore,
5251
+ Re as UrlStore,
5252
+ we as WebView,
5253
+ _ as addons,
5254
+ Cr as applyHooks,
5255
+ Oe as combineArgs,
5256
+ N as combineParameters,
5257
+ K as composeConfigs,
5258
+ $r as composeStepRunners,
5259
+ ai as composeStories,
5260
+ Oo as composeStory,
5261
+ li as createPlaywrightTest,
5262
+ Eo as decorateStory,
5263
+ Ur as defaultDecorateStory,
5264
+ as as definePreview,
5265
+ Qn as emitTransformCode,
5266
+ Ze as filterArgTypes,
5267
+ Ie as getCoreAnnotations,
5268
+ Kr as getCsfFactoryAnnotations,
5269
+ je as inferControls,
5270
+ As as makeDecorator,
5271
+ Tr as mockChannel,
5188
5272
  he as normalizeProjectAnnotations,
5189
5273
  me as normalizeStory,
5190
- zr as prepareMeta,
5191
- Oe as prepareStory,
5192
- wo as sanitizeStoryContextUpdate,
5193
- Xs as setDefaultProjectAnnotations,
5194
- ei as setProjectAnnotations,
5195
- mr as simulateDOMContentLoaded,
5196
- Vn as simulatePageLoad,
5197
- ui as sortStoriesV7,
5198
- bs as useArgs,
5199
- Ce as useCallback,
5200
- hs as useChannel,
5201
- Ft as useEffect,
5202
- Ss as useGlobals,
5203
- ps as useMemo,
5204
- gs as useParameter,
5205
- ms as useReducer,
5206
- us as useRef,
5207
- ys as useState,
5208
- Ue as useStoryContext,
5209
- di as userOrAutoTitle,
5210
- Io as userOrAutoTitleFromSpecifier
5274
+ ge as pauseAnimations,
5275
+ Hr as prepareMeta,
5276
+ ke as prepareStory,
5277
+ Co as sanitizeStoryContextUpdate,
5278
+ ri as setDefaultProjectAnnotations,
5279
+ si as setProjectAnnotations,
5280
+ br as simulateDOMContentLoaded,
5281
+ Kn as simulatePageLoad,
5282
+ gi as sortStoriesV7,
5283
+ Rs as useArgs,
5284
+ ve as useCallback,
5285
+ Ts as useChannel,
5286
+ Dt as useEffect,
5287
+ ws as useGlobals,
5288
+ ms as useMemo,
5289
+ xs as useParameter,
5290
+ Ss as useReducer,
5291
+ hs as useRef,
5292
+ bs as useState,
5293
+ Ve as useStoryContext,
5294
+ mi as userOrAutoTitle,
5295
+ jo as userOrAutoTitleFromSpecifier,
5296
+ be as waitForAnimations
5211
5297
  };