storybook 9.0.0-beta.1 → 9.0.0-beta.10

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