storybook 9.1.0-alpha.5 → 9.1.0-alpha.7

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 (90) hide show
  1. package/assets/browser/favicon-wrapper.svg +46 -0
  2. package/assets/browser/favicon.svg +1 -1
  3. package/dist/bin/index.cjs +62 -69
  4. package/dist/bin/index.js +43 -50
  5. package/dist/cli/bin/index.cjs +932 -932
  6. package/dist/cli/bin/index.js +635 -634
  7. package/dist/cli/index.cjs +14965 -14973
  8. package/dist/cli/index.d.ts +713 -15
  9. package/dist/cli/index.js +13488 -13495
  10. package/dist/common/index.cjs +13169 -13067
  11. package/dist/common/index.d.ts +348 -73
  12. package/dist/common/index.js +24024 -23919
  13. package/dist/components/index.cjs +1462 -1448
  14. package/dist/components/index.d.ts +3 -1
  15. package/dist/components/index.js +412 -397
  16. package/dist/core-server/index.cjs +6649 -6588
  17. package/dist/core-server/index.d.ts +14 -2
  18. package/dist/core-server/index.js +6053 -5993
  19. package/dist/core-server/presets/common-manager.js +3438 -3353
  20. package/dist/core-server/presets/common-preset.cjs +2370 -2374
  21. package/dist/core-server/presets/common-preset.js +1881 -1881
  22. package/dist/csf/index.cjs +2536 -736
  23. package/dist/csf/index.d.ts +251 -9
  24. package/dist/csf/index.js +2558 -749
  25. package/dist/csf-tools/index.cjs +226 -224
  26. package/dist/csf-tools/index.js +116 -112
  27. package/dist/instrumenter/index.cjs +1150 -1099
  28. package/dist/instrumenter/index.d.ts +1 -0
  29. package/dist/instrumenter/index.js +1261 -1214
  30. package/dist/manager/globals-runtime.js +21317 -23959
  31. package/dist/manager/runtime.js +3713 -3534
  32. package/dist/manager-api/index.cjs +74 -74
  33. package/dist/manager-api/index.d.ts +8 -531
  34. package/dist/manager-api/index.js +142 -142
  35. package/dist/node-logger/index.cjs +8520 -994
  36. package/dist/node-logger/index.d.ts +395 -2
  37. package/dist/node-logger/index.js +8535 -995
  38. package/dist/preview/runtime.js +13337 -16032
  39. package/dist/preview-api/index.cjs +273 -271
  40. package/dist/preview-api/index.d.ts +4 -1
  41. package/dist/preview-api/index.js +14 -12
  42. package/dist/server-errors.cjs +201 -242
  43. package/dist/server-errors.d.ts +1 -12
  44. package/dist/server-errors.js +182 -223
  45. package/dist/telemetry/index.cjs +1314 -1313
  46. package/dist/telemetry/index.d.ts +3 -2
  47. package/dist/telemetry/index.js +1195 -1192
  48. package/dist/test/index.cjs +9136 -9815
  49. package/dist/test/index.js +8339 -9025
  50. package/dist/types/index.d.ts +15 -15
  51. package/package.json +6 -188
  52. package/dist/actions/preview.cjs +0 -159
  53. package/dist/actions/preview.d.ts +0 -45
  54. package/dist/actions/preview.js +0 -149
  55. package/dist/backgrounds/index.cjs +0 -16
  56. package/dist/backgrounds/index.d.ts +0 -2
  57. package/dist/backgrounds/index.js +0 -0
  58. package/dist/backgrounds/preview.cjs +0 -143
  59. package/dist/backgrounds/preview.d.ts +0 -53
  60. package/dist/backgrounds/preview.js +0 -127
  61. package/dist/component-testing/index.cjs +0 -23
  62. package/dist/component-testing/index.d.ts +0 -3
  63. package/dist/component-testing/index.js +0 -5
  64. package/dist/component-testing/preview.cjs +0 -40
  65. package/dist/component-testing/preview.d.ts +0 -5
  66. package/dist/component-testing/preview.js +0 -25
  67. package/dist/controls/preview.cjs +0 -26
  68. package/dist/controls/preview.d.ts +0 -43
  69. package/dist/controls/preview.js +0 -9
  70. package/dist/highlight/preview.cjs +0 -590
  71. package/dist/highlight/preview.d.ts +0 -20
  72. package/dist/highlight/preview.js +0 -575
  73. package/dist/measure/index.cjs +0 -16
  74. package/dist/measure/index.d.ts +0 -2
  75. package/dist/measure/index.js +0 -0
  76. package/dist/measure/preview.cjs +0 -466
  77. package/dist/measure/preview.d.ts +0 -25
  78. package/dist/measure/preview.js +0 -450
  79. package/dist/outline/index.cjs +0 -16
  80. package/dist/outline/index.d.ts +0 -2
  81. package/dist/outline/index.js +0 -0
  82. package/dist/outline/preview.cjs +0 -518
  83. package/dist/outline/preview.d.ts +0 -25
  84. package/dist/outline/preview.js +0 -486
  85. package/dist/test/preview.cjs +0 -73
  86. package/dist/test/preview.d.ts +0 -17
  87. package/dist/test/preview.js +0 -66
  88. package/dist/viewport/preview.cjs +0 -35
  89. package/dist/viewport/preview.d.ts +0 -62
  90. package/dist/viewport/preview.js +0 -19
package/dist/csf/index.js CHANGED
@@ -1,62 +1,64 @@
1
- var Ge = Object.create;
2
- var L = Object.defineProperty;
3
- var Ve = Object.getOwnPropertyDescriptor;
4
- var qe = Object.getOwnPropertyNames;
5
- var Ke = Object.getPrototypeOf, Ye = Object.prototype.hasOwnProperty;
6
- var s = (e, r) => L(e, "name", { value: r, configurable: !0 });
7
- var Je = (e, r) => () => (r || e((r = { exports: {} }).exports, r), r.exports);
8
- var Xe = (e, r, t, o) => {
9
- if (r && typeof r == "object" || typeof r == "function")
10
- for (let a of qe(r))
11
- !Ye.call(e, a) && a !== t && L(e, a, { get: () => r[a], enumerable: !(o = Ve(r, a)) || o.enumerable });
1
+ var Br = Object.create;
2
+ var ce = Object.defineProperty;
3
+ var zr = Object.getOwnPropertyDescriptor;
4
+ var Ur = Object.getOwnPropertyNames;
5
+ var Gr = Object.getPrototypeOf, Wr = Object.prototype.hasOwnProperty;
6
+ var n = (e, t) => ce(e, "name", { value: t, configurable: !0 });
7
+ var Yr = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), xt = (e, t) => {
8
+ for (var r in t)
9
+ ce(e, r, { get: t[r], enumerable: !0 });
10
+ }, Vr = (e, t, r, o) => {
11
+ if (t && typeof t == "object" || typeof t == "function")
12
+ for (let i of Ur(t))
13
+ !Wr.call(e, i) && i !== r && ce(e, i, { get: () => t[i], enumerable: !(o = zr(t, i)) || o.enumerable });
12
14
  return e;
13
15
  };
14
- var Ze = (e, r, t) => (t = e != null ? Ge(Ke(e)) : {}, Xe(
16
+ var Kr = (e, t, r) => (r = e != null ? Br(Gr(e)) : {}, Vr(
15
17
  // If the importer is in node compatibility mode or this is not an ESM
16
18
  // file that has been converted to a CommonJS file using a Babel-
17
19
  // compatible transform (i.e. "__esModule" has not been set), then set
18
20
  // "default" to the CommonJS "module.exports" for node compatibility.
19
- r || !e || !e.__esModule ? L(t, "default", { value: e, enumerable: !0 }) : t,
21
+ t || !e || !e.__esModule ? ce(r, "default", { value: e, enumerable: !0 }) : r,
20
22
  e
21
23
  ));
22
24
 
23
25
  // ../node_modules/@ngard/tiny-isequal/index.js
24
- var fe = Je((W) => {
25
- Object.defineProperty(W, "__esModule", { value: !0 }), W.isEqual = /* @__PURE__ */ function() {
26
- var e = Object.prototype.toString, r = Object.getPrototypeOf, t = Object.getOwnPropertySymbols ? function(o) {
26
+ var Tt = Yr((Ee) => {
27
+ Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.isEqual = /* @__PURE__ */ function() {
28
+ var e = Object.prototype.toString, t = Object.getPrototypeOf, r = Object.getOwnPropertySymbols ? function(o) {
27
29
  return Object.keys(o).concat(Object.getOwnPropertySymbols(o));
28
30
  } : Object.keys;
29
- return function(o, a) {
30
- return (/* @__PURE__ */ s(function n(i, p, d) {
31
- var c, m, f, y = e.call(i), h = e.call(p);
32
- if (i === p) return !0;
33
- if (i == null || p == null) return !1;
34
- if (d.indexOf(i) > -1 && d.indexOf(p) > -1) return !0;
35
- if (d.push(i, p), y != h || (c = t(i), m = t(p), c.length != m.length || c.some(function(S) {
36
- return !n(i[S], p[S], d);
31
+ return function(o, i) {
32
+ return (/* @__PURE__ */ n(function s(a, p, c) {
33
+ var l, y, u, h = e.call(a), T = e.call(p);
34
+ if (a === p) return !0;
35
+ if (a == null || p == null) return !1;
36
+ if (c.indexOf(a) > -1 && c.indexOf(p) > -1) return !0;
37
+ if (c.push(a, p), h != T || (l = r(a), y = r(p), l.length != y.length || l.some(function(R) {
38
+ return !s(a[R], p[R], c);
37
39
  }))) return !1;
38
- switch (y.slice(8, -1)) {
40
+ switch (h.slice(8, -1)) {
39
41
  case "Symbol":
40
- return i.valueOf() == p.valueOf();
42
+ return a.valueOf() == p.valueOf();
41
43
  case "Date":
42
44
  case "Number":
43
- return +i == +p || +i != +i && +p != +p;
45
+ return +a == +p || +a != +a && +p != +p;
44
46
  case "RegExp":
45
47
  case "Function":
46
48
  case "String":
47
49
  case "Boolean":
48
- return "" + i == "" + p;
50
+ return "" + a == "" + p;
49
51
  case "Set":
50
52
  case "Map":
51
- c = i.entries(), m = p.entries();
53
+ l = a.entries(), y = p.entries();
52
54
  do
53
- if (!n((f = c.next()).value, m.next().value, d)) return !1;
54
- while (!f.done);
55
+ if (!s((u = l.next()).value, y.next().value, c)) return !1;
56
+ while (!u.done);
55
57
  return !0;
56
58
  case "ArrayBuffer":
57
- i = new Uint8Array(i), p = new Uint8Array(p);
59
+ a = new Uint8Array(a), p = new Uint8Array(p);
58
60
  case "DataView":
59
- i = new Uint8Array(i.buffer), p = new Uint8Array(p.buffer);
61
+ a = new Uint8Array(a.buffer), p = new Uint8Array(p.buffer);
60
62
  case "Float32Array":
61
63
  case "Float64Array":
62
64
  case "Int8Array":
@@ -68,110 +70,110 @@ var fe = Je((W) => {
68
70
  case "Uint8ClampedArray":
69
71
  case "Arguments":
70
72
  case "Array":
71
- if (i.length != p.length) return !1;
72
- for (f = 0; f < i.length; f++) if ((f in i || f in p) && (f in i != f in p || !n(i[f], p[f], d))) return !1;
73
+ if (a.length != p.length) return !1;
74
+ for (u = 0; u < a.length; u++) if ((u in a || u in p) && (u in a != u in p || !s(a[u], p[u], c))) return !1;
73
75
  return !0;
74
76
  case "Object":
75
- return n(r(i), r(p), d);
77
+ return s(t(a), t(p), c);
76
78
  default:
77
79
  return !1;
78
80
  }
79
- }, "n"))(o, a, []);
81
+ }, "n"))(o, i, []);
80
82
  };
81
83
  }();
82
84
  });
83
85
 
84
86
  // src/csf/toStartCaseStr.ts
85
- function le(e) {
86
- return e.replace(/_/g, " ").replace(/-/g, " ").replace(/\./g, " ").replace(/([^\n])([A-Z])([a-z])/g, (r, t, o, a) => `${t} ${o}${a}`).replace(
87
- /([a-z])([A-Z])/g, (r, t, o) => `${t} ${o}`).replace(/([a-z])([0-9])/gi, (r, t, o) => `${t} ${o}`).replace(/([0-9])([a-z])/gi, (r, t, o) => `${t}\
88
- ${o}`).replace(/(\s|^)(\w)/g, (r, t, o) => `${t}${o.toUpperCase()}`).replace(/ +/g, " ").trim();
87
+ function bt(e) {
88
+ return e.replace(/_/g, " ").replace(/-/g, " ").replace(/\./g, " ").replace(/([^\n])([A-Z])([a-z])/g, (t, r, o, i) => `${r} ${o}${i}`).replace(
89
+ /([a-z])([A-Z])/g, (t, r, o) => `${r} ${o}`).replace(/([a-z])([0-9])/gi, (t, r, o) => `${r} ${o}`).replace(/([0-9])([a-z])/gi, (t, r, o) => `${r}\
90
+ ${o}`).replace(/(\s|^)(\w)/g, (t, r, o) => `${r}${o.toUpperCase()}`).replace(/ +/g, " ").trim();
89
91
  }
90
- s(le, "toStartCaseStr");
92
+ n(bt, "toStartCaseStr");
91
93
 
92
94
  // src/csf/includeConditionalArg.ts
93
- var G = Ze(fe(), 1);
94
- var ue = /* @__PURE__ */ s((e) => e.map((r) => typeof r < "u").filter(Boolean).length, "count"), Qe = /* @__PURE__ */ s((e, r) => {
95
- let { exists: t, eq: o, neq: a, truthy: n } = e;
96
- if (ue([t, o, a, n]) > 1)
97
- throw new Error(`Invalid conditional test ${JSON.stringify({ exists: t, eq: o, neq: a })}`);
95
+ var Ce = Kr(Tt(), 1);
96
+ var St = /* @__PURE__ */ n((e) => e.map((t) => typeof t < "u").filter(Boolean).length, "count"), qr = /* @__PURE__ */ n((e, t) => {
97
+ let { exists: r, eq: o, neq: i, truthy: s } = e;
98
+ if (St([r, o, i, s]) > 1)
99
+ throw new Error(`Invalid conditional test ${JSON.stringify({ exists: r, eq: o, neq: i })}`);
98
100
  if (typeof o < "u")
99
- return (0, G.isEqual)(r, o);
100
- if (typeof a < "u")
101
- return !(0, G.isEqual)(r, a);
102
- if (typeof t < "u") {
103
- let p = typeof r < "u";
104
- return t ? p : !p;
101
+ return (0, Ce.isEqual)(t, o);
102
+ if (typeof i < "u")
103
+ return !(0, Ce.isEqual)(t, i);
104
+ if (typeof r < "u") {
105
+ let p = typeof t < "u";
106
+ return r ? p : !p;
105
107
  }
106
- return (typeof n > "u" ? !0 : n) ? !!r : !r;
107
- }, "testValue"), er = /* @__PURE__ */ s((e, r, t) => {
108
+ return (typeof s > "u" ? !0 : s) ? !!t : !t;
109
+ }, "testValue"), Xr = /* @__PURE__ */ n((e, t, r) => {
108
110
  if (!e.if)
109
111
  return !0;
110
- let { arg: o, global: a } = e.if;
111
- if (ue([o, a]) !== 1)
112
- throw new Error(`Invalid conditional value ${JSON.stringify({ arg: o, global: a })}`);
113
- let n = o ? r[o] : t[a];
114
- return Qe(e.if, n);
112
+ let { arg: o, global: i } = e.if;
113
+ if (St([o, i]) !== 1)
114
+ throw new Error(`Invalid conditional value ${JSON.stringify({ arg: o, global: i })}`);
115
+ let s = o ? t[o] : r[i];
116
+ return qr(e.if, s);
115
117
  }, "includeConditionalArg");
116
118
 
117
119
  // src/csf/csf-factories.ts
118
- import { combineTags as kr } from "storybook/internal/csf";
120
+ import { combineTags as Hn } from "storybook/internal/csf";
119
121
 
120
122
  // src/preview-api/modules/addons/main.ts
121
- import { global as V } from "@storybook/global";
123
+ import { global as ve } from "@storybook/global";
122
124
 
123
125
  // src/preview-api/modules/addons/storybook-channel-mock.ts
124
- import { Channel as rr } from "storybook/internal/channels";
125
- function me() {
126
+ import { Channel as Zr } from "storybook/internal/channels";
127
+ function At() {
126
128
  let e = {
127
- setHandler: /* @__PURE__ */ s(() => {
129
+ setHandler: /* @__PURE__ */ n(() => {
128
130
  }, "setHandler"),
129
- send: /* @__PURE__ */ s(() => {
131
+ send: /* @__PURE__ */ n(() => {
130
132
  }, "send")
131
133
  };
132
- return new rr({ transport: e });
134
+ return new Zr({ transport: e });
133
135
  }
134
- s(me, "mockChannel");
136
+ n(At, "mockChannel");
135
137
 
136
138
  // src/preview-api/modules/addons/main.ts
137
- var J = class J {
139
+ var Me = class Me {
138
140
  constructor() {
139
- this.getChannel = /* @__PURE__ */ s(() => {
141
+ this.getChannel = /* @__PURE__ */ n(() => {
140
142
  if (!this.channel) {
141
- let r = me();
142
- return this.setChannel(r), r;
143
+ let t = At();
144
+ return this.setChannel(t), t;
143
145
  }
144
146
  return this.channel;
145
147
  }, "getChannel");
146
- this.ready = /* @__PURE__ */ s(() => this.promise, "ready");
147
- this.hasChannel = /* @__PURE__ */ s(() => !!this.channel, "hasChannel");
148
- this.setChannel = /* @__PURE__ */ s((r) => {
149
- this.channel = r, this.resolve();
148
+ this.ready = /* @__PURE__ */ n(() => this.promise, "ready");
149
+ this.hasChannel = /* @__PURE__ */ n(() => !!this.channel, "hasChannel");
150
+ this.setChannel = /* @__PURE__ */ n((t) => {
151
+ this.channel = t, this.resolve();
150
152
  }, "setChannel");
151
- this.promise = new Promise((r) => {
152
- this.resolve = () => r(this.getChannel());
153
+ this.promise = new Promise((t) => {
154
+ this.resolve = () => t(this.getChannel());
153
155
  });
154
156
  }
155
157
  };
156
- s(J, "AddonStore");
157
- var K = J, q = "__STORYBOOK_ADDONS_PREVIEW";
158
- function tr() {
159
- return V[q] || (V[q] = new K()), V[q];
158
+ n(Me, "AddonStore");
159
+ var Pe = Me, ke = "__STORYBOOK_ADDONS_PREVIEW";
160
+ function Jr() {
161
+ return ve[ke] || (ve[ke] = new Pe()), ve[ke];
160
162
  }
161
- s(tr, "getAddonsStore");
162
- var Y = tr();
163
+ n(Jr, "getAddonsStore");
164
+ var Oe = Jr();
163
165
 
164
166
  // src/preview-api/modules/addons/hooks.ts
165
- import { logger as qr } from "storybook/internal/client-logger";
167
+ import { logger as ri } from "storybook/internal/client-logger";
166
168
  import {
167
- FORCE_RE_RENDER as Yr,
168
- RESET_STORY_ARGS as Jr,
169
- STORY_RENDERED as ye,
170
- UPDATE_GLOBALS as Xr,
171
- UPDATE_STORY_ARGS as Zr
169
+ FORCE_RE_RENDER as ni,
170
+ RESET_STORY_ARGS as ii,
171
+ STORY_RENDERED as Rt,
172
+ UPDATE_GLOBALS as si,
173
+ UPDATE_STORY_ARGS as ai
172
174
  } from "storybook/internal/core-events";
173
- import { global as X } from "@storybook/global";
174
- var Q = class Q {
175
+ import { global as $e } from "@storybook/global";
176
+ var Ie = class Ie {
175
177
  constructor() {
176
178
  this.hookListsMap = void 0;
177
179
  this.mountedDecorators = void 0;
@@ -184,8 +186,8 @@ var Q = class Q {
184
186
  this.currentDecoratorName = void 0;
185
187
  this.hasUpdates = void 0;
186
188
  this.currentContext = void 0;
187
- this.renderListener = /* @__PURE__ */ s((r) => {
188
- r === this.currentContext?.id && (this.triggerEffects(), this.currentContext = null, this.removeRenderListeners());
189
+ this.renderListener = /* @__PURE__ */ n((t) => {
190
+ t === this.currentContext?.id && (this.triggerEffects(), this.currentContext = null, this.removeRenderListeners());
189
191
  }, "renderListener");
190
192
  this.init();
191
193
  }
@@ -195,493 +197,493 @@ var Q = class Q {
195
197
  null, this.hasUpdates = !1, this.currentContext = null;
196
198
  }
197
199
  clean() {
198
- this.prevEffects.forEach((r) => {
199
- r.destroy && r.destroy();
200
+ this.prevEffects.forEach((t) => {
201
+ t.destroy && t.destroy();
200
202
  }), this.init(), this.removeRenderListeners();
201
203
  }
202
204
  getNextHook() {
203
- let r = this.currentHooks[this.nextHookIndex];
204
- return this.nextHookIndex += 1, r;
205
+ let t = this.currentHooks[this.nextHookIndex];
206
+ return this.nextHookIndex += 1, t;
205
207
  }
206
208
  triggerEffects() {
207
- this.prevEffects.forEach((r) => {
208
- !this.currentEffects.includes(r) && r.destroy && r.destroy();
209
- }), this.currentEffects.forEach((r) => {
210
- this.prevEffects.includes(r) || (r.destroy = r.create());
209
+ this.prevEffects.forEach((t) => {
210
+ !this.currentEffects.includes(t) && t.destroy && t.destroy();
211
+ }), this.currentEffects.forEach((t) => {
212
+ this.prevEffects.includes(t) || (t.destroy = t.create());
211
213
  }), this.prevEffects = this.currentEffects, this.currentEffects = [];
212
214
  }
213
215
  addRenderListeners() {
214
- this.removeRenderListeners(), Y.getChannel().on(ye, this.renderListener);
216
+ this.removeRenderListeners(), Oe.getChannel().on(Rt, this.renderListener);
215
217
  }
216
218
  removeRenderListeners() {
217
- Y.getChannel().removeListener(ye, this.renderListener);
219
+ Oe.getChannel().removeListener(Rt, this.renderListener);
218
220
  }
219
221
  };
220
- s(Q, "HooksContext");
221
- var B = Q;
222
- function ge(e) {
223
- let r = /* @__PURE__ */ s((...t) => {
224
- let { hooks: o } = typeof t[0] == "function" ? t[1] : t[0], a = o.currentPhase, n = o.currentHooks, i = o.nextHookIndex, p = o.currentDecoratorName;
222
+ n(Ie, "HooksContext");
223
+ var de = Ie;
224
+ function wt(e) {
225
+ let t = /* @__PURE__ */ n((...r) => {
226
+ let { hooks: o } = typeof r[0] == "function" ? r[1] : r[0], i = o.currentPhase, s = o.currentHooks, a = o.nextHookIndex, p = o.currentDecoratorName;
225
227
  o.currentDecoratorName = e.name, o.prevMountedDecorators.has(e) ? (o.currentPhase = "UPDATE", o.currentHooks = o.hookListsMap.get(e) || []) :
226
228
  (o.currentPhase = "MOUNT", o.currentHooks = [], o.hookListsMap.set(e, o.currentHooks), o.prevMountedDecorators.add(e)), o.nextHookIndex =
227
229
  0;
228
- let d = X.STORYBOOK_HOOKS_CONTEXT;
229
- X.STORYBOOK_HOOKS_CONTEXT = o;
230
- let c = e(...t);
231
- if (X.STORYBOOK_HOOKS_CONTEXT = d, o.currentPhase === "UPDATE" && o.getNextHook() != null)
230
+ let c = $e.STORYBOOK_HOOKS_CONTEXT;
231
+ $e.STORYBOOK_HOOKS_CONTEXT = o;
232
+ let l = e(...r);
233
+ if ($e.STORYBOOK_HOOKS_CONTEXT = c, o.currentPhase === "UPDATE" && o.getNextHook() != null)
232
234
  throw new Error(
233
235
  "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
234
236
  );
235
- return o.currentPhase = a, o.currentHooks = n, o.nextHookIndex = i, o.currentDecoratorName = p, c;
237
+ return o.currentPhase = i, o.currentHooks = s, o.nextHookIndex = a, o.currentDecoratorName = p, l;
236
238
  }, "hookified");
237
- return r.originalFn = e, r;
239
+ return t.originalFn = e, t;
238
240
  }
239
- s(ge, "hookify");
240
- var Z = 0, or = 25, Te = /* @__PURE__ */ s((e) => (r, t) => {
241
+ n(wt, "hookify");
242
+ var Fe = 0, Qr = 25, Et = /* @__PURE__ */ n((e) => (t, r) => {
241
243
  let o = e(
242
- ge(r),
243
- t.map((a) => ge(a))
244
+ wt(t),
245
+ r.map((i) => wt(i))
244
246
  );
245
- return (a) => {
246
- let { hooks: n } = a;
247
- n.prevMountedDecorators ??= /* @__PURE__ */ new Set(), n.mountedDecorators = /* @__PURE__ */ new Set([r, ...t]), n.currentContext = a, n.
247
+ return (i) => {
248
+ let { hooks: s } = i;
249
+ s.prevMountedDecorators ??= /* @__PURE__ */ new Set(), s.mountedDecorators = /* @__PURE__ */ new Set([t, ...r]), s.currentContext = i, s.
248
250
  hasUpdates = !1;
249
- let i = o(a);
250
- for (Z = 1; n.hasUpdates; )
251
- if (n.hasUpdates = !1, n.currentEffects = [], i = o(a), Z += 1, Z > or)
251
+ let a = o(i);
252
+ for (Fe = 1; s.hasUpdates; )
253
+ if (s.hasUpdates = !1, s.currentEffects = [], a = o(i), Fe += 1, Fe > Qr)
252
254
  throw new Error(
253
255
  "Too many re-renders. Storybook limits the number of renders to prevent an infinite loop."
254
256
  );
255
- return n.addRenderListeners(), i;
257
+ return s.addRenderListeners(), a;
256
258
  };
257
259
  }, "applyHooks");
258
260
 
259
261
  // ../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
260
- function I(e) {
262
+ function ee(e) {
261
263
  if (!e || typeof e != "object")
262
264
  return !1;
263
- let r = Object.getPrototypeOf(e);
264
- return r === null || r === Object.prototype || Object.getPrototypeOf(r) === null ? Object.prototype.toString.call(e) === "[object Object]" :
265
+ let t = Object.getPrototypeOf(e);
266
+ return t === null || t === Object.prototype || Object.getPrototypeOf(t) === null ? Object.prototype.toString.call(e) === "[object Object]" :
265
267
  !1;
266
268
  }
267
- s(I, "isPlainObject");
269
+ n(ee, "isPlainObject");
268
270
 
269
271
  // ../node_modules/es-toolkit/dist/object/mapValues.mjs
270
- function w(e, r) {
271
- let t = {}, o = Object.keys(e);
272
- for (let a = 0; a < o.length; a++) {
273
- let n = o[a], i = e[n];
274
- t[n] = r(i, n, e);
272
+ function U(e, t) {
273
+ let r = {}, o = Object.keys(e);
274
+ for (let i = 0; i < o.length; i++) {
275
+ let s = o[i], a = e[s];
276
+ r[s] = t(a, s, e);
275
277
  }
276
- return t;
278
+ return r;
277
279
  }
278
- s(w, "mapValues");
280
+ n(U, "mapValues");
279
281
 
280
282
  // ../node_modules/es-toolkit/dist/object/pickBy.mjs
281
- function ee(e, r) {
282
- let t = {}, o = Object.keys(e);
283
- for (let a = 0; a < o.length; a++) {
284
- let n = o[a], i = e[n];
285
- r(i, n) && (t[n] = i);
283
+ function Le(e, t) {
284
+ let r = {}, o = Object.keys(e);
285
+ for (let i = 0; i < o.length; i++) {
286
+ let s = o[i], a = e[s];
287
+ t(a, s) && (r[s] = a);
286
288
  }
287
- return t;
289
+ return r;
288
290
  }
289
- s(ee, "pickBy");
291
+ n(Le, "pickBy");
290
292
 
291
293
  // src/preview-api/modules/store/args.ts
292
- import { once as gt } from "storybook/internal/client-logger";
294
+ import { once as Ei } from "storybook/internal/client-logger";
293
295
 
294
296
  // ../node_modules/ts-dedent/esm/index.js
295
- function F(e) {
296
- for (var r = [], t = 1; t < arguments.length; t++)
297
- r[t - 1] = arguments[t];
297
+ function W(e) {
298
+ for (var t = [], r = 1; r < arguments.length; r++)
299
+ t[r - 1] = arguments[r];
298
300
  var o = Array.from(typeof e == "string" ? [e] : e);
299
301
  o[o.length - 1] = o[o.length - 1].replace(/\r?\n([\t ]*)$/, "");
300
- var a = o.reduce(function(p, d) {
301
- var c = d.match(/\n([\t ]+|(?!\s).)/g);
302
- return c ? p.concat(c.map(function(m) {
303
- var f, y;
304
- return (y = (f = m.match(/[\t ]/g)) === null || f === void 0 ? void 0 : f.length) !== null && y !== void 0 ? y : 0;
302
+ var i = o.reduce(function(p, c) {
303
+ var l = c.match(/\n([\t ]+|(?!\s).)/g);
304
+ return l ? p.concat(l.map(function(y) {
305
+ var u, h;
306
+ return (h = (u = y.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && h !== void 0 ? h : 0;
305
307
  })) : p;
306
308
  }, []);
307
- if (a.length) {
308
- var n = new RegExp(`
309
- [ ]{` + Math.min.apply(Math, a) + "}", "g");
309
+ if (i.length) {
310
+ var s = new RegExp(`
311
+ [ ]{` + Math.min.apply(Math, i) + "}", "g");
310
312
  o = o.map(function(p) {
311
- return p.replace(n, `
313
+ return p.replace(s, `
312
314
  `);
313
315
  });
314
316
  }
315
317
  o[0] = o[0].replace(/^\r?\n/, "");
316
- var i = o[0];
317
- return r.forEach(function(p, d) {
318
- var c = i.match(/(?:^|\n)( *)$/), m = c ? c[1] : "", f = p;
318
+ var a = o[0];
319
+ return t.forEach(function(p, c) {
320
+ var l = a.match(/(?:^|\n)( *)$/), y = l ? l[1] : "", u = p;
319
321
  typeof p == "string" && p.includes(`
320
- `) && (f = String(p).split(`
321
- `).map(function(y, h) {
322
- return h === 0 ? y : "" + m + y;
322
+ `) && (u = String(p).split(`
323
+ `).map(function(h, T) {
324
+ return T === 0 ? h : "" + y + h;
323
325
  }).join(`
324
- `)), i += f + o[d + 1];
325
- }), i;
326
+ `)), a += u + o[c + 1];
327
+ }), a;
326
328
  }
327
- s(F, "dedent");
329
+ n(W, "dedent");
328
330
 
329
331
  // src/preview-api/modules/store/args.ts
330
- var xt = Symbol("incompatible");
331
- var ht = Symbol("Deeply equal");
332
- var re = "UNTARGETED";
333
- function xe({
332
+ var vi = Symbol("incompatible");
333
+ var ki = Symbol("Deeply equal");
334
+ var De = "UNTARGETED";
335
+ function Ct({
334
336
  args: e,
335
- argTypes: r
337
+ argTypes: t
336
338
  }) {
337
- let t = {};
338
- return Object.entries(e).forEach(([o, a]) => {
339
- let { target: n = re } = r[o] || {};
340
- t[n] = t[n] || {}, t[n][o] = a;
341
- }), t;
339
+ let r = {};
340
+ return Object.entries(e).forEach(([o, i]) => {
341
+ let { target: s = De } = t[o] || {};
342
+ r[s] = r[s] || {}, r[s][o] = i;
343
+ }), r;
342
344
  }
343
- s(xe, "groupArgsByTarget");
345
+ n(Ct, "groupArgsByTarget");
344
346
 
345
347
  // src/preview-api/modules/store/csf/getValuesFromArgTypes.ts
346
- var he = /* @__PURE__ */ s((e = {}) => Object.entries(e).reduce((r, [t, { defaultValue: o }]) => (typeof o < "u" && (r[t] = o), r), {}), "ge\
348
+ var vt = /* @__PURE__ */ n((e = {}) => Object.entries(e).reduce((t, [r, { defaultValue: o }]) => (typeof o < "u" && (t[r] = o), t), {}), "ge\
347
349
  tValuesFromArgTypes");
348
350
 
349
351
  // src/preview-api/modules/store/csf/normalizeInputTypes.ts
350
- var nr = /* @__PURE__ */ s((e) => typeof e == "string" ? { name: e } : e, "normalizeType"), sr = /* @__PURE__ */ s((e) => typeof e == "strin\
351
- g" ? { type: e } : e, "normalizeControl"), ar = /* @__PURE__ */ s((e, r) => {
352
- let { type: t, control: o, ...a } = e, n = {
353
- name: r,
354
- ...a
352
+ var eo = /* @__PURE__ */ n((e) => typeof e == "string" ? { name: e } : e, "normalizeType"), to = /* @__PURE__ */ n((e) => typeof e == "strin\
353
+ g" ? { type: e } : e, "normalizeControl"), ro = /* @__PURE__ */ n((e, t) => {
354
+ let { type: r, control: o, ...i } = e, s = {
355
+ name: t,
356
+ ...i
355
357
  };
356
- return t && (n.type = nr(t)), o ? n.control = sr(o) : o === !1 && (n.control = { disable: !0 }), n;
357
- }, "normalizeInputType"), O = /* @__PURE__ */ s((e) => w(e, ar), "normalizeInputTypes");
358
+ return r && (s.type = eo(r)), o ? s.control = to(o) : o === !1 && (s.control = { disable: !0 }), s;
359
+ }, "normalizeInputType"), K = /* @__PURE__ */ n((e) => U(e, ro), "normalizeInputTypes");
358
360
 
359
361
  // src/preview-api/modules/store/csf/normalizeStory.ts
360
- import { deprecate as ir, logger as pr } from "storybook/internal/client-logger";
361
- import { storyNameFromExport as cr, toId as dr } from "storybook/internal/csf";
362
+ import { deprecate as oo, logger as no } from "storybook/internal/client-logger";
363
+ import { storyNameFromExport as io, toId as so } from "storybook/internal/csf";
362
364
 
363
365
  // src/preview-api/modules/store/csf/normalizeArrays.ts
364
- var l = /* @__PURE__ */ s((e) => Array.isArray(e) ? e : e ? [e] : [], "normalizeArrays");
366
+ var b = /* @__PURE__ */ n((e) => Array.isArray(e) ? e : e ? [e] : [], "normalizeArrays");
365
367
 
366
368
  // src/preview-api/modules/store/csf/normalizeStory.ts
367
- var lr = F`
369
+ var ao = W`
368
370
  CSF .story annotations deprecated; annotate story functions directly:
369
371
  - StoryFn.story.name => StoryFn.storyName
370
372
  - StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
371
373
  See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
372
374
  `;
373
- function te(e, r, t) {
374
- let o = r, a = typeof r == "function" ? r : null, { story: n } = o;
375
- n && (pr.debug("deprecated story", n), ir(lr));
376
- let i = cr(e), p = typeof o != "function" && o.name || o.storyName || n?.name || i, d = [
377
- ...l(o.decorators),
378
- ...l(n?.decorators)
379
- ], c = { ...n?.parameters, ...o.parameters }, m = { ...n?.args, ...o.args }, f = { ...n?.argTypes, ...o.argTypes }, y = [...l(o.loaders), ...l(
380
- n?.loaders)], h = [
381
- ...l(o.beforeEach),
382
- ...l(n?.beforeEach)
383
- ], S = [
384
- ...l(o.afterEach),
385
- ...l(n?.afterEach)
386
- ], { render: k, play: E, tags: A = [], globals: b = {} } = o, u = c.__id || dr(t.id, i);
375
+ function _e(e, t, r) {
376
+ let o = t, i = typeof t == "function" ? t : null, { story: s } = o;
377
+ s && (no.debug("deprecated story", s), oo(ao));
378
+ let a = io(e), p = typeof o != "function" && o.name || o.storyName || s?.name || a, c = [
379
+ ...b(o.decorators),
380
+ ...b(s?.decorators)
381
+ ], l = { ...s?.parameters, ...o.parameters }, y = { ...s?.args, ...o.args }, u = { ...s?.argTypes, ...o.argTypes }, h = [...b(o.loaders), ...b(
382
+ s?.loaders)], T = [
383
+ ...b(o.beforeEach),
384
+ ...b(s?.beforeEach)
385
+ ], R = [
386
+ ...b(o.afterEach),
387
+ ...b(s?.afterEach)
388
+ ], { render: P, play: L, tags: O = [], globals: F = {} } = o, A = l.__id || so(r.id, a);
387
389
  return {
388
- moduleExport: r,
389
- id: u,
390
+ moduleExport: t,
391
+ id: A,
390
392
  name: p,
391
- tags: A,
392
- decorators: d,
393
- parameters: c,
394
- args: m,
395
- argTypes: O(f),
396
- loaders: y,
397
- beforeEach: h,
398
- afterEach: S,
399
- globals: b,
400
- ...k && { render: k },
401
- ...a && { userStoryFn: a },
402
- ...E && { play: E }
393
+ tags: O,
394
+ decorators: c,
395
+ parameters: l,
396
+ args: y,
397
+ argTypes: K(u),
398
+ loaders: h,
399
+ beforeEach: T,
400
+ afterEach: R,
401
+ globals: F,
402
+ ...P && { render: P },
403
+ ...i && { userStoryFn: i },
404
+ ...L && { play: L }
403
405
  };
404
406
  }
405
- s(te, "normalizeStory");
407
+ n(_e, "normalizeStory");
406
408
 
407
409
  // src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts
408
- import { sanitize as fr } from "storybook/internal/csf";
409
- function Se(e, r = e.title, t) {
410
- let { id: o, argTypes: a } = e;
410
+ import { sanitize as po } from "storybook/internal/csf";
411
+ function kt(e, t = e.title, r) {
412
+ let { id: o, argTypes: i } = e;
411
413
  return {
412
- id: fr(o || r),
414
+ id: po(o || t),
413
415
  ...e,
414
- title: r,
415
- ...a && { argTypes: O(a) },
416
+ title: t,
417
+ ...i && { argTypes: K(i) },
416
418
  parameters: {
417
- fileName: t,
419
+ fileName: r,
418
420
  ...e.parameters
419
421
  }
420
422
  };
421
423
  }
422
- s(Se, "normalizeComponentAnnotations");
424
+ n(kt, "normalizeComponentAnnotations");
423
425
 
424
426
  // src/preview-api/modules/store/csf/prepareStory.ts
425
- import { combineTags as mr, includeConditionalArg as yr } from "storybook/internal/csf";
426
- import { NoRenderFunctionError as gr } from "storybook/internal/preview-errors";
427
- import { global as Tr } from "@storybook/global";
428
- import { global as xr } from "@storybook/global";
427
+ import { combineTags as co, includeConditionalArg as mo } from "storybook/internal/csf";
428
+ import { NoRenderFunctionError as uo } from "storybook/internal/preview-errors";
429
+ import { global as fo } from "@storybook/global";
430
+ import { global as yo } from "@storybook/global";
429
431
 
430
432
  // src/preview-api/modules/preview-web/render/mount-utils.ts
431
- function Re(e) {
432
- return e != null && ur(e).includes("mount");
433
+ function Ot(e) {
434
+ return e != null && lo(e).includes("mount");
433
435
  }
434
- s(Re, "mountDestructured");
435
- function ur(e) {
436
- let r = e.toString().match(/[^(]*\(([^)]*)/);
437
- if (!r)
436
+ n(Ot, "mountDestructured");
437
+ function lo(e) {
438
+ let t = e.toString().match(/[^(]*\(([^)]*)/);
439
+ if (!t)
438
440
  return [];
439
- let t = Ae(r[1]);
440
- if (!t.length)
441
+ let r = Pt(t[1]);
442
+ if (!r.length)
441
443
  return [];
442
- let o = t[0];
443
- return o.startsWith("{") && o.endsWith("}") ? Ae(o.slice(1, -1).replace(/\s/g, "")).map((n) => n.replace(/:.*|=.*/g, "")) : [];
444
- }
445
- s(ur, "getUsedProps");
446
- function Ae(e) {
447
- let r = [], t = [], o = 0;
448
- for (let n = 0; n < e.length; n++)
449
- if (e[n] === "{" || e[n] === "[")
450
- t.push(e[n] === "{" ? "}" : "]");
451
- else if (e[n] === t[t.length - 1])
452
- t.pop();
453
- else if (!t.length && e[n] === ",") {
454
- let i = e.substring(o, n).trim();
455
- i && r.push(i), o = n + 1;
456
- }
457
- let a = e.substring(o).trim();
458
- return a && r.push(a), r;
459
- }
460
- s(Ae, "splitByComma");
444
+ let o = r[0];
445
+ return o.startsWith("{") && o.endsWith("}") ? Pt(o.slice(1, -1).replace(/\s/g, "")).map((s) => s.replace(/:.*|=.*/g, "")) : [];
446
+ }
447
+ n(lo, "getUsedProps");
448
+ function Pt(e) {
449
+ let t = [], r = [], o = 0;
450
+ for (let s = 0; s < e.length; s++)
451
+ if (e[s] === "{" || e[s] === "[")
452
+ r.push(e[s] === "{" ? "}" : "]");
453
+ else if (e[s] === r[r.length - 1])
454
+ r.pop();
455
+ else if (!r.length && e[s] === ",") {
456
+ let a = e.substring(o, s).trim();
457
+ a && t.push(a), o = s + 1;
458
+ }
459
+ let i = e.substring(o).trim();
460
+ return i && t.push(i), t;
461
+ }
462
+ n(Pt, "splitByComma");
461
463
 
462
464
  // src/preview-api/modules/store/decorators.ts
463
- function be(e, r, t) {
464
- let o = t(e);
465
- return (a) => r(o, a);
465
+ function Mt(e, t, r) {
466
+ let o = r(e);
467
+ return (i) => t(o, i);
466
468
  }
467
- s(be, "decorateStory");
468
- function Ce({
469
+ n(Mt, "decorateStory");
470
+ function $t({
469
471
  componentId: e,
470
- title: r,
471
- kind: t,
472
+ title: t,
473
+ kind: r,
472
474
  id: o,
473
- name: a,
474
- story: n,
475
- parameters: i,
475
+ name: i,
476
+ story: s,
477
+ parameters: a,
476
478
  initialArgs: p,
477
- argTypes: d,
478
- ...c
479
+ argTypes: c,
480
+ ...l
479
481
  } = {}) {
480
- return c;
482
+ return l;
481
483
  }
482
- s(Ce, "sanitizeStoryContextUpdate");
483
- function oe(e, r) {
484
- let t = {}, o = /* @__PURE__ */ s((n) => (i) => {
485
- if (!t.value)
484
+ n($t, "sanitizeStoryContextUpdate");
485
+ function He(e, t) {
486
+ let r = {}, o = /* @__PURE__ */ n((s) => (a) => {
487
+ if (!r.value)
486
488
  throw new Error("Decorated function called without init");
487
- return t.value = {
488
- ...t.value,
489
- ...Ce(i)
490
- }, n(t.value);
491
- }, "bindWithContext"), a = r.reduce(
492
- (n, i) => be(n, i, o),
489
+ return r.value = {
490
+ ...r.value,
491
+ ...$t(a)
492
+ }, s(r.value);
493
+ }, "bindWithContext"), i = t.reduce(
494
+ (s, a) => Mt(s, a, o),
493
495
  e
494
496
  );
495
- return (n) => (t.value = n, a(n));
497
+ return (s) => (r.value = s, i(s));
496
498
  }
497
- s(oe, "defaultDecorateStory");
499
+ n(He, "defaultDecorateStory");
498
500
 
499
501
  // src/preview-api/modules/store/parameters.ts
500
- var x = /* @__PURE__ */ s((...e) => {
501
- let r = {}, t = e.filter(Boolean), o = t.reduce((a, n) => (Object.entries(n).forEach(([i, p]) => {
502
- let d = a[i];
503
- Array.isArray(p) || typeof d > "u" ? a[i] = p : I(p) && I(d) ? r[i] = !0 : typeof p < "u" && (a[i] = p);
504
- }), a), {});
505
- return Object.keys(r).forEach((a) => {
506
- let n = t.filter(Boolean).map((i) => i[a]).filter((i) => typeof i < "u");
507
- n.every((i) => I(i)) ? o[a] = x(...n) : o[a] = n[n.length - 1];
502
+ var D = /* @__PURE__ */ n((...e) => {
503
+ let t = {}, r = e.filter(Boolean), o = r.reduce((i, s) => (Object.entries(s).forEach(([a, p]) => {
504
+ let c = i[a];
505
+ Array.isArray(p) || typeof c > "u" ? i[a] = p : ee(p) && ee(c) ? t[a] = !0 : typeof p < "u" && (i[a] = p);
506
+ }), i), {});
507
+ return Object.keys(t).forEach((i) => {
508
+ let s = r.filter(Boolean).map((a) => a[i]).filter((a) => typeof a < "u");
509
+ s.every((a) => ee(a)) ? o[i] = D(...s) : o[i] = s[s.length - 1];
508
510
  }), o;
509
511
  }, "combineParameters");
510
512
 
511
513
  // src/preview-api/modules/store/csf/prepareStory.ts
512
- function ne(e, r, t) {
513
- let { moduleExport: o, id: a, name: n } = e || {}, i = hr(
514
+ function Ne(e, t, r) {
515
+ let { moduleExport: o, id: i, name: s } = e || {}, a = go(
514
516
  e,
515
- r,
516
- t
517
- ), p = /* @__PURE__ */ s(async (T) => {
518
- let C = {};
519
- for (let j of [
520
- l(t.loaders),
521
- l(r.loaders),
522
- l(e.loaders)
517
+ t,
518
+ r
519
+ ), p = /* @__PURE__ */ n(async (w) => {
520
+ let d = {};
521
+ for (let m of [
522
+ b(r.loaders),
523
+ b(t.loaders),
524
+ b(e.loaders)
523
525
  ]) {
524
- if (T.abortSignal.aborted)
525
- return C;
526
- let z = await Promise.all(j.map((We) => We(T)));
527
- Object.assign(C, ...z);
528
- }
529
- return C;
530
- }, "applyLoaders"), d = /* @__PURE__ */ s(async (T) => {
531
- let C = new Array();
532
- for (let j of [
533
- ...l(t.beforeEach),
534
- ...l(r.beforeEach),
535
- ...l(e.beforeEach)
526
+ if (w.abortSignal.aborted)
527
+ return d;
528
+ let f = await Promise.all(m.map((x) => x(w)));
529
+ Object.assign(d, ...f);
530
+ }
531
+ return d;
532
+ }, "applyLoaders"), c = /* @__PURE__ */ n(async (w) => {
533
+ let d = new Array();
534
+ for (let m of [
535
+ ...b(r.beforeEach),
536
+ ...b(t.beforeEach),
537
+ ...b(e.beforeEach)
536
538
  ]) {
537
- if (T.abortSignal.aborted)
538
- return C;
539
- let z = await j(T);
540
- z && C.push(z);
541
- }
542
- return C;
543
- }, "applyBeforeEach"), c = /* @__PURE__ */ s(async (T) => {
544
- let C = [
545
- ...l(t.afterEach),
546
- ...l(r.afterEach),
547
- ...l(e.afterEach)
539
+ if (w.abortSignal.aborted)
540
+ return d;
541
+ let f = await m(w);
542
+ f && d.push(f);
543
+ }
544
+ return d;
545
+ }, "applyBeforeEach"), l = /* @__PURE__ */ n(async (w) => {
546
+ let d = [
547
+ ...b(r.afterEach),
548
+ ...b(t.afterEach),
549
+ ...b(e.afterEach)
548
550
  ].reverse();
549
- for (let j of C) {
550
- if (T.abortSignal.aborted)
551
+ for (let m of d) {
552
+ if (w.abortSignal.aborted)
551
553
  return;
552
- await j(T);
553
- }
554
- }, "applyAfterEach"), m = /* @__PURE__ */ s((T) => T.originalStoryFn(T.args, T), "undecoratedStoryFn"), { applyDecorators: f = oe, runStep: y } = t,
555
- h = [
556
- ...l(e?.decorators),
557
- ...l(r?.decorators),
558
- ...l(t?.decorators)
559
- ], S = e?.userStoryFn || e?.render || r.render || t.render, k = Te(f)(m, h), E = /* @__PURE__ */ s((T) => k(T), "unboundStoryFn"), A = e?.
560
- play ?? r?.play, b = Re(A);
561
- if (!S && !b)
562
- throw new gr({ id: a });
563
- let u = /* @__PURE__ */ s((T) => async () => (await T.renderToCanvas(), T.canvas), "defaultMount"), g = e.mount ?? r.mount ?? t.mount ?? u,
564
- R = t.testingLibraryRender;
554
+ await m(w);
555
+ }
556
+ }, "applyAfterEach"), y = /* @__PURE__ */ n((w) => w.originalStoryFn(w.args, w), "undecoratedStoryFn"), { applyDecorators: u = He, runStep: h } = r,
557
+ T = [
558
+ ...b(e?.decorators),
559
+ ...b(t?.decorators),
560
+ ...b(r?.decorators)
561
+ ], R = e?.userStoryFn || e?.render || t.render || r.render, P = Et(u)(y, T), L = /* @__PURE__ */ n((w) => P(w), "unboundStoryFn"), O = e?.
562
+ play ?? t?.play, F = Ot(O);
563
+ if (!R && !F)
564
+ throw new uo({ id: i });
565
+ let A = /* @__PURE__ */ n((w) => async () => (await w.renderToCanvas(), w.canvas), "defaultMount"), S = e.mount ?? t.mount ?? r.mount ?? A,
566
+ v = r.testingLibraryRender;
565
567
  return {
566
568
  storyGlobals: {},
567
- ...i,
569
+ ...a,
568
570
  moduleExport: o,
569
- id: a,
570
- name: n,
571
- story: n,
572
- originalStoryFn: S,
573
- undecoratedStoryFn: m,
574
- unboundStoryFn: E,
571
+ id: i,
572
+ name: s,
573
+ story: s,
574
+ originalStoryFn: R,
575
+ undecoratedStoryFn: y,
576
+ unboundStoryFn: L,
575
577
  applyLoaders: p,
576
- applyBeforeEach: d,
577
- applyAfterEach: c,
578
- playFunction: A,
579
- runStep: y,
580
- mount: g,
581
- testingLibraryRender: R,
582
- renderToCanvas: t.renderToCanvas,
583
- usesMount: b
578
+ applyBeforeEach: c,
579
+ applyAfterEach: l,
580
+ playFunction: O,
581
+ runStep: h,
582
+ mount: S,
583
+ testingLibraryRender: v,
584
+ renderToCanvas: r.renderToCanvas,
585
+ usesMount: F
584
586
  };
585
587
  }
586
- s(ne, "prepareStory");
587
- function hr(e, r, t) {
588
- let o = ["dev", "test"], a = xr.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], n = mr(
588
+ n(Ne, "prepareStory");
589
+ function go(e, t, r) {
590
+ let o = ["dev", "test"], i = yo.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], s = co(
589
591
  ...o,
590
- ...a,
591
- ...t.tags ?? [],
592
+ ...i,
592
593
  ...r.tags ?? [],
594
+ ...t.tags ?? [],
593
595
  ...e?.tags ?? []
594
- ), i = x(
595
- t.parameters,
596
+ ), a = D(
596
597
  r.parameters,
598
+ t.parameters,
597
599
  e?.parameters
598
- ), { argTypesEnhancers: p = [], argsEnhancers: d = [] } = t, c = x(
599
- t.argTypes,
600
+ ), { argTypesEnhancers: p = [], argsEnhancers: c = [] } = r, l = D(
600
601
  r.argTypes,
602
+ t.argTypes,
601
603
  e?.argTypes
602
604
  );
603
605
  if (e) {
604
- let A = e?.userStoryFn || e?.render || r.render || t.render;
605
- i.__isArgsStory = A && A.length > 0;
606
+ let O = e?.userStoryFn || e?.render || t.render || r.render;
607
+ a.__isArgsStory = O && O.length > 0;
606
608
  }
607
- let m = {
608
- ...t.args,
609
+ let y = {
609
610
  ...r.args,
611
+ ...t.args,
610
612
  ...e?.args
611
- }, f = {
612
- ...r.globals,
613
+ }, u = {
614
+ ...t.globals,
613
615
  ...e?.globals
614
- }, y = {
615
- componentId: r.id,
616
- title: r.title,
617
- kind: r.title,
616
+ }, h = {
617
+ componentId: t.id,
618
+ title: t.title,
619
+ kind: t.title,
618
620
  // Back compat
619
- id: e?.id || r.id,
621
+ id: e?.id || t.id,
620
622
  // if there's no story name, we create a fake one since enhancers expect a name
621
623
  name: e?.name || "__meta",
622
624
  story: e?.name || "__meta",
623
625
  // Back compat
624
- component: r.component,
625
- subcomponents: r.subcomponents,
626
- tags: n,
627
- parameters: i,
628
- initialArgs: m,
629
- argTypes: c,
630
- storyGlobals: f
626
+ component: t.component,
627
+ subcomponents: t.subcomponents,
628
+ tags: s,
629
+ parameters: a,
630
+ initialArgs: y,
631
+ argTypes: l,
632
+ storyGlobals: u
631
633
  };
632
- y.argTypes = p.reduce(
633
- (A, b) => b({ ...y, argTypes: A }),
634
- y.argTypes
634
+ h.argTypes = p.reduce(
635
+ (O, F) => F({ ...h, argTypes: O }),
636
+ h.argTypes
635
637
  );
636
- let h = { ...m };
637
- y.initialArgs = [...d].reduce(
638
- (A, b) => ({
639
- ...A,
640
- ...b({
641
- ...y,
642
- initialArgs: A
638
+ let T = { ...y };
639
+ h.initialArgs = [...c].reduce(
640
+ (O, F) => ({
641
+ ...O,
642
+ ...F({
643
+ ...h,
644
+ initialArgs: O
643
645
  })
644
646
  }),
645
- h
647
+ T
646
648
  );
647
- let { name: S, story: k, ...E } = y;
648
- return E;
649
+ let { name: R, story: P, ...L } = h;
650
+ return L;
649
651
  }
650
- s(hr, "preparePartialAnnotations");
651
- function we(e) {
652
- let { args: r } = e, t = {
652
+ n(go, "preparePartialAnnotations");
653
+ function Ft(e) {
654
+ let { args: t } = e, r = {
653
655
  ...e,
654
656
  allArgs: void 0,
655
657
  argsByTarget: void 0
656
658
  };
657
- if (Tr.FEATURES?.argTypeTargetsV7) {
658
- let n = xe(e);
659
- t = {
659
+ if (fo.FEATURES?.argTypeTargetsV7) {
660
+ let s = Ct(e);
661
+ r = {
660
662
  ...e,
661
663
  allArgs: e.args,
662
- argsByTarget: n,
663
- args: n[re] || {}
664
+ argsByTarget: s,
665
+ args: s[De] || {}
664
666
  };
665
667
  }
666
- let o = Object.entries(t.args).reduce((n, [i, p]) => {
667
- if (!t.argTypes[i]?.mapping)
668
- return n[i] = p, n;
669
- let d = /* @__PURE__ */ s((c) => {
670
- let m = t.argTypes[i].mapping;
671
- return m && c in m ? m[c] : c;
668
+ let o = Object.entries(r.args).reduce((s, [a, p]) => {
669
+ if (!r.argTypes[a]?.mapping)
670
+ return s[a] = p, s;
671
+ let c = /* @__PURE__ */ n((l) => {
672
+ let y = r.argTypes[a].mapping;
673
+ return y && l in y ? y[l] : l;
672
674
  }, "mappingFn");
673
- return n[i] = Array.isArray(p) ? p.map(d) : d(p), n;
674
- }, {}), a = Object.entries(o).reduce((n, [i, p]) => {
675
- let d = t.argTypes[i] || {};
676
- return yr(d, o, t.globals) && (n[i] = p), n;
675
+ return s[a] = Array.isArray(p) ? p.map(c) : c(p), s;
676
+ }, {}), i = Object.entries(o).reduce((s, [a, p]) => {
677
+ let c = r.argTypes[a] || {};
678
+ return mo(c, o, r.globals) && (s[a] = p), s;
677
679
  }, {});
678
- return { ...t, unmappedArgs: r, args: a };
680
+ return { ...r, unmappedArgs: t, args: i };
679
681
  }
680
- s(we, "prepareContext");
682
+ n(Ft, "prepareContext");
681
683
 
682
684
  // src/preview-api/modules/store/inferArgTypes.ts
683
- import { logger as Sr } from "storybook/internal/client-logger";
684
- var se = /* @__PURE__ */ s((e, r, t) => {
685
+ import { logger as ho } from "storybook/internal/client-logger";
686
+ var je = /* @__PURE__ */ n((e, t, r) => {
685
687
  let o = typeof e;
686
688
  switch (o) {
687
689
  case "boolean":
@@ -693,48 +695,48 @@ var se = /* @__PURE__ */ s((e, r, t) => {
693
695
  default:
694
696
  break;
695
697
  }
696
- return e ? t.has(e) ? (Sr.warn(F`
697
- We've detected a cycle in arg '${r}'. Args should be JSON-serializable.
698
+ return e ? r.has(e) ? (ho.warn(W`
699
+ We've detected a cycle in arg '${t}'. Args should be JSON-serializable.
698
700
 
699
701
  Consider using the mapping feature or fully custom args:
700
702
  - Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
701
703
  - Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
702
- `), { name: "other", value: "cyclic object" }) : (t.add(e), Array.isArray(e) ? { name: "array", value: e.length > 0 ? se(e[0], r, new Set(
703
- t)) : { name: "other", value: "unknown" } } : { name: "object", value: w(e, (n) => se(n, r, new Set(t))) }) : { name: "object", value: {} };
704
- }, "inferType"), ae = /* @__PURE__ */ s((e) => {
705
- let { id: r, argTypes: t = {}, initialArgs: o = {} } = e, a = w(o, (i, p) => ({
704
+ `), { name: "other", value: "cyclic object" }) : (r.add(e), Array.isArray(e) ? { name: "array", value: e.length > 0 ? je(e[0], t, new Set(
705
+ r)) : { name: "other", value: "unknown" } } : { name: "object", value: U(e, (s) => je(s, t, new Set(r))) }) : { name: "object", value: {} };
706
+ }, "inferType"), Be = /* @__PURE__ */ n((e) => {
707
+ let { id: t, argTypes: r = {}, initialArgs: o = {} } = e, i = U(o, (a, p) => ({
706
708
  name: p,
707
- type: se(i, `${r}.${p}`, /* @__PURE__ */ new Set())
708
- })), n = w(t, (i, p) => ({
709
+ type: je(a, `${t}.${p}`, /* @__PURE__ */ new Set())
710
+ })), s = U(r, (a, p) => ({
709
711
  name: p
710
712
  }));
711
- return x(a, n, t);
713
+ return D(i, s, r);
712
714
  }, "inferArgTypes");
713
- ae.secondPass = !0;
715
+ Be.secondPass = !0;
714
716
 
715
717
  // src/preview-api/modules/store/inferControls.ts
716
- import { logger as Ar } from "storybook/internal/client-logger";
718
+ import { logger as xo } from "storybook/internal/client-logger";
717
719
 
718
720
  // src/preview-api/modules/store/filterArgTypes.ts
719
- var Ee = /* @__PURE__ */ s((e, r) => Array.isArray(r) ? r.includes(e) : e.match(r), "matches"), ie = /* @__PURE__ */ s((e, r, t) => !r && !t ?
720
- e : e && ee(e, (o, a) => {
721
- let n = o.name || a.toString();
722
- return !!(!r || Ee(n, r)) && (!t || !Ee(n, t));
721
+ var It = /* @__PURE__ */ n((e, t) => Array.isArray(t) ? t.includes(e) : e.match(t), "matches"), ze = /* @__PURE__ */ n((e, t, r) => !t && !r ?
722
+ e : e && Le(e, (o, i) => {
723
+ let s = o.name || i.toString();
724
+ return !!(!t || It(s, t)) && (!r || !It(s, r));
723
725
  }), "filterArgTypes");
724
726
 
725
727
  // src/preview-api/modules/store/inferControls.ts
726
- var Rr = /* @__PURE__ */ s((e, r, t) => {
727
- let { type: o, options: a } = e;
728
+ var bo = /* @__PURE__ */ n((e, t, r) => {
729
+ let { type: o, options: i } = e;
728
730
  if (o) {
729
- if (t.color && t.color.test(r)) {
730
- let n = o.name;
731
- if (n === "string")
731
+ if (r.color && r.color.test(t)) {
732
+ let s = o.name;
733
+ if (s === "string")
732
734
  return { control: { type: "color" } };
733
- n !== "enum" && Ar.warn(
734
- `Addon controls: Control of type color only supports string, received "${n}" instead`
735
+ s !== "enum" && xo.warn(
736
+ `Addon controls: Control of type color only supports string, received "${s}" instead`
735
737
  );
736
738
  }
737
- if (t.date && t.date.test(r))
739
+ if (r.date && r.date.test(t))
738
740
  return { control: { type: "date" } };
739
741
  switch (o.name) {
740
742
  case "array":
@@ -746,50 +748,50 @@ var Rr = /* @__PURE__ */ s((e, r, t) => {
746
748
  case "number":
747
749
  return { control: { type: "number" } };
748
750
  case "enum": {
749
- let { value: n } = o;
750
- return { control: { type: n?.length <= 5 ? "radio" : "select" }, options: n };
751
+ let { value: s } = o;
752
+ return { control: { type: s?.length <= 5 ? "radio" : "select" }, options: s };
751
753
  }
752
754
  case "function":
753
755
  case "symbol":
754
756
  return null;
755
757
  default:
756
- return { control: { type: a ? "select" : "object" } };
758
+ return { control: { type: i ? "select" : "object" } };
757
759
  }
758
760
  }
759
- }, "inferControl"), U = /* @__PURE__ */ s((e) => {
761
+ }, "inferControl"), me = /* @__PURE__ */ n((e) => {
760
762
  let {
761
- argTypes: r,
762
- parameters: { __isArgsStory: t, controls: { include: o = null, exclude: a = null, matchers: n = {} } = {} }
763
+ argTypes: t,
764
+ parameters: { __isArgsStory: r, controls: { include: o = null, exclude: i = null, matchers: s = {} } = {} }
763
765
  } = e;
764
- if (!t)
765
- return r;
766
- let i = ie(r, o, a), p = w(i, (d, c) => d?.type && Rr(d, c.toString(), n));
767
- return x(p, i);
766
+ if (!r)
767
+ return t;
768
+ let a = ze(t, o, i), p = U(a, (c, l) => c?.type && bo(c, l.toString(), s));
769
+ return D(p, a);
768
770
  }, "inferControls");
769
- U.secondPass = !0;
771
+ me.secondPass = !0;
770
772
 
771
773
  // src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts
772
- function _({
774
+ function te({
773
775
  argTypes: e,
774
- globalTypes: r,
775
- argTypesEnhancers: t,
776
+ globalTypes: t,
777
+ argTypesEnhancers: r,
776
778
  decorators: o,
777
- loaders: a,
778
- beforeEach: n,
779
- afterEach: i,
779
+ loaders: i,
780
+ beforeEach: s,
781
+ afterEach: a,
780
782
  initialGlobals: p,
781
- ...d
783
+ ...c
782
784
  }) {
783
785
  return {
784
- ...e && { argTypes: O(e) },
785
- ...r && { globalTypes: O(r) },
786
- decorators: l(o),
787
- loaders: l(a),
788
- beforeEach: l(n),
789
- afterEach: l(i),
786
+ ...e && { argTypes: K(e) },
787
+ ...t && { globalTypes: K(t) },
788
+ decorators: b(o),
789
+ loaders: b(i),
790
+ beforeEach: b(s),
791
+ afterEach: b(a),
790
792
  argTypesEnhancers: [
791
- ...t || [],
792
- ae,
793
+ ...r || [],
794
+ Be,
793
795
  // There's an architectural decision to be made regarding embedded addons in core:
794
796
  //
795
797
  // Option 1: Keep embedded addons but ensure consistency by moving addon-specific code
@@ -805,99 +807,99 @@ function _({
805
807
  // currently rely on this behavior.
806
808
  //
807
809
  // TODO: Make an architectural decision on the handling of core addons
808
- U
810
+ me
809
811
  ],
810
812
  initialGlobals: p,
811
- ...d
813
+ ...c
812
814
  };
813
815
  }
814
- s(_, "normalizeProjectAnnotations");
816
+ n(te, "normalizeProjectAnnotations");
815
817
 
816
818
  // src/preview-api/modules/store/csf/composeConfigs.ts
817
- import { global as br } from "@storybook/global";
819
+ import { global as To } from "@storybook/global";
818
820
 
819
821
  // src/preview-api/modules/store/csf/beforeAll.ts
820
- var Pe = /* @__PURE__ */ s((e) => async () => {
821
- let r = [];
822
- for (let t of e) {
823
- let o = await t();
824
- o && r.unshift(o);
822
+ var Lt = /* @__PURE__ */ n((e) => async () => {
823
+ let t = [];
824
+ for (let r of e) {
825
+ let o = await r();
826
+ o && t.unshift(o);
825
827
  }
826
828
  return async () => {
827
- for (let t of r)
828
- await t();
829
+ for (let r of t)
830
+ await r();
829
831
  };
830
832
  }, "composeBeforeAllHooks");
831
833
 
832
834
  // src/preview-api/modules/store/csf/stepRunners.ts
833
- function pe(e) {
834
- return async (r, t, o) => {
835
+ function Ue(e) {
836
+ return async (t, r, o) => {
835
837
  await e.reduceRight(
836
- (n, i) => async () => i(r, n, o),
837
- async () => t(o)
838
+ (s, a) => async () => a(t, s, o),
839
+ async () => r(o)
838
840
  )();
839
841
  };
840
842
  }
841
- s(pe, "composeStepRunners");
843
+ n(Ue, "composeStepRunners");
842
844
 
843
845
  // src/preview-api/modules/store/csf/composeConfigs.ts
844
- function D(e, r) {
845
- return e.map((t) => t.default?.[r] ?? t[r]).filter(Boolean);
846
- }
847
- s(D, "getField");
848
- function P(e, r, t = {}) {
849
- return D(e, r).reduce((o, a) => {
850
- let n = l(a);
851
- return t.reverseFileOrder ? [...n, ...o] : [...o, ...n];
846
+ function oe(e, t) {
847
+ return e.map((r) => r.default?.[t] ?? r[t]).filter(Boolean);
848
+ }
849
+ n(oe, "getField");
850
+ function Y(e, t, r = {}) {
851
+ return oe(e, t).reduce((o, i) => {
852
+ let s = b(i);
853
+ return r.reverseFileOrder ? [...s, ...o] : [...o, ...s];
852
854
  }, []);
853
855
  }
854
- s(P, "getArrayField");
855
- function H(e, r) {
856
- return Object.assign({}, ...D(e, r));
856
+ n(Y, "getArrayField");
857
+ function ue(e, t) {
858
+ return Object.assign({}, ...oe(e, t));
857
859
  }
858
- s(H, "getObjectField");
859
- function N(e, r) {
860
- return D(e, r).pop();
860
+ n(ue, "getObjectField");
861
+ function re(e, t) {
862
+ return oe(e, t).pop();
861
863
  }
862
- s(N, "getSingletonField");
863
- function M(e) {
864
- let r = P(e, "argTypesEnhancers"), t = D(e, "runStep"), o = P(e, "beforeAll");
864
+ n(re, "getSingletonField");
865
+ function ne(e) {
866
+ let t = Y(e, "argTypesEnhancers"), r = oe(e, "runStep"), o = Y(e, "beforeAll");
865
867
  return {
866
- parameters: x(...D(e, "parameters")),
867
- decorators: P(e, "decorators", {
868
- reverseFileOrder: !(br.FEATURES?.legacyDecoratorFileOrder ?? !1)
868
+ parameters: D(...oe(e, "parameters")),
869
+ decorators: Y(e, "decorators", {
870
+ reverseFileOrder: !(To.FEATURES?.legacyDecoratorFileOrder ?? !1)
869
871
  }),
870
- args: H(e, "args"),
871
- argsEnhancers: P(e, "argsEnhancers"),
872
- argTypes: H(e, "argTypes"),
872
+ args: ue(e, "args"),
873
+ argsEnhancers: Y(e, "argsEnhancers"),
874
+ argTypes: ue(e, "argTypes"),
873
875
  argTypesEnhancers: [
874
- ...r.filter((a) => !a.secondPass),
875
- ...r.filter((a) => a.secondPass)
876
+ ...t.filter((i) => !i.secondPass),
877
+ ...t.filter((i) => i.secondPass)
876
878
  ],
877
- initialGlobals: H(e, "initialGlobals"),
878
- globalTypes: H(e, "globalTypes"),
879
- loaders: P(e, "loaders"),
880
- beforeAll: Pe(o),
881
- beforeEach: P(e, "beforeEach"),
882
- afterEach: P(e, "afterEach"),
883
- render: N(e, "render"),
884
- renderToCanvas: N(e, "renderToCanvas"),
885
- applyDecorators: N(e, "applyDecorators"),
886
- runStep: pe(t),
887
- tags: P(e, "tags"),
888
- mount: N(e, "mount"),
889
- testingLibraryRender: N(e, "testingLibraryRender")
879
+ initialGlobals: ue(e, "initialGlobals"),
880
+ globalTypes: ue(e, "globalTypes"),
881
+ loaders: Y(e, "loaders"),
882
+ beforeAll: Lt(o),
883
+ beforeEach: Y(e, "beforeEach"),
884
+ afterEach: Y(e, "afterEach"),
885
+ render: re(e, "render"),
886
+ renderToCanvas: re(e, "renderToCanvas"),
887
+ applyDecorators: re(e, "applyDecorators"),
888
+ runStep: Ue(r),
889
+ tags: Y(e, "tags"),
890
+ mount: re(e, "mount"),
891
+ testingLibraryRender: re(e, "testingLibraryRender")
890
892
  };
891
893
  }
892
- s(M, "composeConfigs");
894
+ n(ne, "composeConfigs");
893
895
 
894
896
  // src/preview-api/modules/store/csf/portable-stories.ts
895
- import { isExportStory as Lo } from "storybook/internal/csf";
896
- import { getCoreAnnotations as Go } from "storybook/internal/csf";
897
- import { MountMustBeDestructuredError as wr } from "storybook/internal/preview-errors";
897
+ import { isExportStory as Zs } from "storybook/internal/csf";
898
+ import { getCoreAnnotations as Qs } from "storybook/internal/csf";
899
+ import { MountMustBeDestructuredError as Ao } from "storybook/internal/preview-errors";
898
900
 
899
901
  // src/preview-api/modules/preview-web/render/animation-utils.ts
900
- function ve() {
902
+ function Dt() {
901
903
  try {
902
904
  return (
903
905
  // @ts-expect-error this property exists in certain environments
@@ -908,389 +910,2196 @@ function ve() {
908
910
  return !1;
909
911
  }
910
912
  }
911
- s(ve, "isTestEnvironment");
912
- function ke(e = !0) {
913
+ n(Dt, "isTestEnvironment");
914
+ function _t(e = !0) {
913
915
  if (!("document" in globalThis && "createElement" in globalThis.document))
914
916
  return () => {
915
917
  };
916
- let r = document.createElement("style");
917
- r.textContent = `*, *:before, *:after {
918
- animation: none !important;
919
- }`, document.head.appendChild(r);
920
918
  let t = document.createElement("style");
921
- return t.textContent = `*, *:before, *:after {
919
+ t.textContent = `*, *:before, *:after {
920
+ animation: none !important;
921
+ }`, document.head.appendChild(t);
922
+ let r = document.createElement("style");
923
+ return r.textContent = `*, *:before, *:after {
922
924
  animation-delay: 0s !important;
923
925
  animation-direction: ${e ? "reverse" : "normal"} !important;
924
926
  animation-play-state: paused !important;
925
927
  transition: none !important;
926
- }`, document.head.appendChild(t), document.body.clientHeight, document.head.removeChild(r), () => {
927
- t.parentNode?.removeChild(t);
928
+ }`, document.head.appendChild(r), document.body.clientHeight, document.head.removeChild(t), () => {
929
+ r.parentNode?.removeChild(r);
928
930
  };
929
931
  }
930
- s(ke, "pauseAnimations");
931
- async function Oe(e) {
932
+ n(_t, "pauseAnimations");
933
+ async function Ht(e) {
932
934
  if (!("document" in globalThis && "getAnimations" in globalThis.document && "querySelectorAll" in globalThis.document))
933
935
  return;
934
- let r = !1;
936
+ let t = !1;
935
937
  await Promise.race([
936
938
  // After 50ms, retrieve any running animations and wait for them to finish
937
939
  // If new animations are created while waiting, we'll wait for them too
938
- new Promise((t) => {
940
+ new Promise((r) => {
939
941
  setTimeout(() => {
940
- let o = [globalThis.document, ...Fe(globalThis.document)], a = /* @__PURE__ */ s(async () => {
941
- if (r || e?.aborted)
942
+ let o = [globalThis.document, ...Nt(globalThis.document)], i = /* @__PURE__ */ n(async () => {
943
+ if (t || e?.aborted)
942
944
  return;
943
- let n = o.flatMap((i) => i?.getAnimations?.() || []).filter((i) => i.playState === "running" && !Cr(i));
944
- n.length > 0 && (await Promise.all(n.map((i) => i.finished)), await a());
945
+ let s = o.flatMap((a) => a?.getAnimations?.() || []).filter((a) => a.playState === "running" && !So(a));
946
+ s.length > 0 && (await Promise.all(s.map((a) => a.finished)), await i());
945
947
  }, "checkAnimationsFinished");
946
- a().then(t);
948
+ i().then(r);
947
949
  }, 100);
948
950
  }),
949
951
  // If animations don't finish within the timeout, continue without waiting
950
952
  new Promise(
951
- (t) => setTimeout(() => {
952
- r = !0, t(void 0);
953
+ (r) => setTimeout(() => {
954
+ t = !0, r(void 0);
953
955
  }, 5e3)
954
956
  )
955
957
  ]);
956
958
  }
957
- s(Oe, "waitForAnimations");
958
- function Fe(e) {
959
- return [e, ...e.querySelectorAll("*")].reduce((r, t) => ("shadowRoot" in t && t.shadowRoot && r.push(t.shadowRoot, ...Fe(t.shadowRoot)), r),
959
+ n(Ht, "waitForAnimations");
960
+ function Nt(e) {
961
+ return [e, ...e.querySelectorAll("*")].reduce((t, r) => ("shadowRoot" in r && r.shadowRoot && t.push(r.shadowRoot, ...Nt(r.shadowRoot)), t),
960
962
  []);
961
963
  }
962
- s(Fe, "getShadowRoots");
963
- function Cr(e) {
964
+ n(Nt, "getShadowRoots");
965
+ function So(e) {
964
966
  if (e instanceof CSSAnimation && e.effect instanceof KeyframeEffect && e.effect.target) {
965
- let r = getComputedStyle(e.effect.target, e.effect.pseudoElement), t = r.animationName?.split(", ").indexOf(e.animationName);
966
- return r.animationIterationCount.split(", ")[t] === "infinite";
967
+ let t = getComputedStyle(e.effect.target, e.effect.pseudoElement), r = t.animationName?.split(", ").indexOf(e.animationName);
968
+ return t.animationIterationCount.split(", ")[r] === "infinite";
967
969
  }
968
970
  return !1;
969
971
  }
970
- s(Cr, "isInfiniteAnimation");
972
+ n(So, "isInfiniteAnimation");
971
973
 
972
974
  // src/preview-api/modules/store/reporter-api.ts
973
- var ce = class ce {
975
+ var Ge = class Ge {
974
976
  constructor() {
975
977
  this.reports = [];
976
978
  }
977
- async addReport(r) {
978
- this.reports.push(r);
979
+ async addReport(t) {
980
+ this.reports.push(t);
979
981
  }
980
982
  };
981
- s(ce, "ReporterAPI");
982
- var $ = ce;
983
+ n(Ge, "ReporterAPI");
984
+ var fe = Ge;
983
985
 
984
986
  // src/preview-api/modules/store/csf/portable-stories.ts
985
- var Er = "ComposedStory", Pr = "Unnamed Story";
986
- var v = [];
987
- function de(e, r, t, o, a) {
987
+ var Ro = "ComposedStory", wo = "Unnamed Story";
988
+ var V = [];
989
+ function We(e, t, r, o, i) {
988
990
  if (e === void 0)
989
991
  throw new Error("Expected a story but received undefined.");
990
- r.title = r.title ?? Er;
991
- let n = Se(r), i = a || e.storyName || e.story?.name || e.name || Pr, p = te(
992
- i,
992
+ t.title = t.title ?? Ro;
993
+ let s = kt(t), a = i || e.storyName || e.story?.name || e.name || wo, p = _e(
994
+ a,
993
995
  e,
994
- n
995
- ), d = _(
996
- M([
996
+ s
997
+ ), c = te(
998
+ ne([
997
999
  o ?? globalThis.globalProjectAnnotations ?? {},
998
- t ?? {}
1000
+ r ?? {}
999
1001
  ])
1000
- ), c = ne(
1002
+ ), l = Ne(
1001
1003
  p,
1002
- n,
1003
- d
1004
- ), f = {
1005
- ...he(d.globalTypes),
1006
- ...d.initialGlobals,
1007
- ...c.storyGlobals
1008
- }, y = new $(), h = /* @__PURE__ */ s(() => {
1009
- let u = we({
1010
- hooks: new B(),
1011
- globals: f,
1012
- args: { ...c.initialArgs },
1004
+ s,
1005
+ c
1006
+ ), u = {
1007
+ ...vt(c.globalTypes),
1008
+ ...c.initialGlobals,
1009
+ ...l.storyGlobals
1010
+ }, h = new fe(), T = /* @__PURE__ */ n(() => {
1011
+ let A = Ft({
1012
+ hooks: new de(),
1013
+ globals: u,
1014
+ args: { ...l.initialArgs },
1013
1015
  viewMode: "story",
1014
- reporting: y,
1016
+ reporting: h,
1015
1017
  loaded: {},
1016
1018
  abortSignal: new AbortController().signal,
1017
- step: /* @__PURE__ */ s((g, R) => c.runStep(g, R, u), "step"),
1019
+ step: /* @__PURE__ */ n((S, v) => l.runStep(S, v, A), "step"),
1018
1020
  canvasElement: null,
1019
1021
  canvas: {},
1020
1022
  userEvent: {},
1021
- globalTypes: d.globalTypes,
1022
- ...c,
1023
+ globalTypes: c.globalTypes,
1024
+ ...l,
1023
1025
  context: null,
1024
1026
  mount: null
1025
1027
  });
1026
- return u.parameters.__isPortableStory = !0, u.context = u, c.renderToCanvas && (u.renderToCanvas = async () => {
1027
- let g = await c.renderToCanvas?.(
1028
+ return A.parameters.__isPortableStory = !0, A.context = A, l.renderToCanvas && (A.renderToCanvas = async () => {
1029
+ let S = await l.renderToCanvas?.(
1028
1030
  {
1029
- componentId: c.componentId,
1030
- title: c.title,
1031
- id: c.id,
1032
- name: c.name,
1033
- tags: c.tags,
1034
- showMain: /* @__PURE__ */ s(() => {
1031
+ componentId: l.componentId,
1032
+ title: l.title,
1033
+ id: l.id,
1034
+ name: l.name,
1035
+ tags: l.tags,
1036
+ showMain: /* @__PURE__ */ n(() => {
1035
1037
  }, "showMain"),
1036
- showError: /* @__PURE__ */ s((R) => {
1037
- throw new Error(`${R.title}
1038
- ${R.description}`);
1038
+ showError: /* @__PURE__ */ n((v) => {
1039
+ throw new Error(`${v.title}
1040
+ ${v.description}`);
1039
1041
  }, "showError"),
1040
- showException: /* @__PURE__ */ s((R) => {
1041
- throw R;
1042
+ showException: /* @__PURE__ */ n((v) => {
1043
+ throw v;
1042
1044
  }, "showException"),
1043
1045
  forceRemount: !0,
1044
- storyContext: u,
1045
- storyFn: /* @__PURE__ */ s(() => c.unboundStoryFn(u), "storyFn"),
1046
- unboundStoryFn: c.unboundStoryFn
1046
+ storyContext: A,
1047
+ storyFn: /* @__PURE__ */ n(() => l.unboundStoryFn(A), "storyFn"),
1048
+ unboundStoryFn: l.unboundStoryFn
1047
1049
  },
1048
- u.canvasElement
1050
+ A.canvasElement
1049
1051
  );
1050
- g && v.push(g);
1051
- }), u.mount = c.mount(u), u;
1052
- }, "initializeContext"), S, k = /* @__PURE__ */ s(async (u) => {
1053
- let g = h();
1054
- return g.canvasElement ??= globalThis?.document?.body, S && (g.loaded = S.loaded), Object.assign(g, u), c.playFunction(g);
1055
- }, "play"), E = /* @__PURE__ */ s((u) => {
1056
- let g = h();
1057
- return Object.assign(g, u), vr(c, g);
1058
- }, "run"), A = c.playFunction ? k : void 0;
1052
+ S && V.push(S);
1053
+ }), A.mount = l.mount(A), A;
1054
+ }, "initializeContext"), R, P = /* @__PURE__ */ n(async (A) => {
1055
+ let S = T();
1056
+ return S.canvasElement ??= globalThis?.document?.body, R && (S.loaded = R.loaded), Object.assign(S, A), l.playFunction(S);
1057
+ }, "play"), L = /* @__PURE__ */ n((A) => {
1058
+ let S = T();
1059
+ return Object.assign(S, A), Eo(l, S);
1060
+ }, "run"), O = l.playFunction ? P : void 0;
1059
1061
  return Object.assign(
1060
- /* @__PURE__ */ s(function(g) {
1061
- let R = h();
1062
- return S && (R.loaded = S.loaded), R.args = {
1063
- ...R.initialArgs,
1064
- ...g
1065
- }, c.unboundStoryFn(R);
1062
+ /* @__PURE__ */ n(function(S) {
1063
+ let v = T();
1064
+ return R && (v.loaded = R.loaded), v.args = {
1065
+ ...v.initialArgs,
1066
+ ...S
1067
+ }, l.unboundStoryFn(v);
1066
1068
  }, "storyFn"),
1067
1069
  {
1068
- id: c.id,
1069
- storyName: i,
1070
- load: /* @__PURE__ */ s(async () => {
1071
- for (let g of [...v].reverse())
1072
- await g();
1073
- v.length = 0;
1074
- let u = h();
1075
- u.loaded = await c.applyLoaders(u), v.push(...(await c.applyBeforeEach(u)).filter(Boolean)), S = u;
1070
+ id: l.id,
1071
+ storyName: a,
1072
+ load: /* @__PURE__ */ n(async () => {
1073
+ for (let S of [...V].reverse())
1074
+ await S();
1075
+ V.length = 0;
1076
+ let A = T();
1077
+ A.loaded = await l.applyLoaders(A), V.push(...(await l.applyBeforeEach(A)).filter(Boolean)), R = A;
1076
1078
  }, "load"),
1077
- globals: f,
1078
- args: c.initialArgs,
1079
- parameters: c.parameters,
1080
- argTypes: c.argTypes,
1081
- play: A,
1082
- run: E,
1083
- reporting: y,
1084
- tags: c.tags
1079
+ globals: u,
1080
+ args: l.initialArgs,
1081
+ parameters: l.parameters,
1082
+ argTypes: l.argTypes,
1083
+ play: O,
1084
+ run: L,
1085
+ reporting: h,
1086
+ tags: l.tags
1085
1087
  }
1086
1088
  );
1087
1089
  }
1088
- s(de, "composeStory");
1089
- async function vr(e, r) {
1090
- for (let n of [...v].reverse())
1091
- await n();
1092
- if (v.length = 0, !r.canvasElement) {
1093
- let n = document.createElement("div");
1094
- globalThis?.document?.body?.appendChild(n), r.canvasElement = n, v.push(() => {
1095
- globalThis?.document?.body?.contains(n) && globalThis?.document?.body?.removeChild(n);
1090
+ n(We, "composeStory");
1091
+ async function Eo(e, t) {
1092
+ for (let s of [...V].reverse())
1093
+ await s();
1094
+ if (V.length = 0, !t.canvasElement) {
1095
+ let s = document.createElement("div");
1096
+ globalThis?.document?.body?.appendChild(s), t.canvasElement = s, V.push(() => {
1097
+ globalThis?.document?.body?.contains(s) && globalThis?.document?.body?.removeChild(s);
1096
1098
  });
1097
1099
  }
1098
- if (r.loaded = await e.applyLoaders(r), r.abortSignal.aborted)
1100
+ if (t.loaded = await e.applyLoaders(t), t.abortSignal.aborted)
1099
1101
  return;
1100
- v.push(...(await e.applyBeforeEach(r)).filter(Boolean));
1101
- let t = e.playFunction, o = e.usesMount;
1102
- if (o || await r.mount(), r.abortSignal.aborted)
1102
+ V.push(...(await e.applyBeforeEach(t)).filter(Boolean));
1103
+ let r = e.playFunction, o = e.usesMount;
1104
+ if (o || await t.mount(), t.abortSignal.aborted)
1103
1105
  return;
1104
- t && (o || (r.mount = async () => {
1105
- throw new wr({ playFunction: t.toString() });
1106
- }), await t(r));
1107
- let a;
1108
- ve() ? a = ke() : await Oe(r.abortSignal), await e.applyAfterEach(r), await a?.();
1106
+ r && (o || (t.mount = async () => {
1107
+ throw new Ao({ playFunction: r.toString() });
1108
+ }), await r(t));
1109
+ let i;
1110
+ Dt() ? i = _t() : await Ht(t.abortSignal), await e.applyAfterEach(t), await i?.();
1111
+ }
1112
+ n(Eo, "runStory");
1113
+
1114
+ // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
1115
+ var Co = !1, Ye = "Invariant failed";
1116
+ function ye(e, t) {
1117
+ if (!e) {
1118
+ if (Co)
1119
+ throw new Error(Ye);
1120
+ var r = typeof t == "function" ? t() : t, o = r ? "".concat(Ye, ": ").concat(r) : Ye;
1121
+ throw new Error(o);
1122
+ }
1123
+ }
1124
+ n(ye, "invariant");
1125
+
1126
+ // src/actions/preview.ts
1127
+ import { definePreviewAddon as Lo } from "storybook/internal/csf";
1128
+
1129
+ // src/actions/addArgs.ts
1130
+ var Ke = {};
1131
+ xt(Ke, {
1132
+ argsEnhancers: () => Mo
1133
+ });
1134
+
1135
+ // src/actions/runtime/action.ts
1136
+ import { ImplicitActionsDuringRendering as vo } from "storybook/internal/preview-errors";
1137
+ import { global as zt } from "@storybook/global";
1138
+ import { addons as ko } from "storybook/preview-api";
1139
+
1140
+ // src/actions/constants.ts
1141
+ var Ve = "storybook/actions", Ia = `${Ve}/panel`, jt = `${Ve}/action-event`, La = `${Ve}/action-clear`;
1142
+
1143
+ // src/actions/runtime/configureActions.ts
1144
+ var Bt = {
1145
+ depth: 10,
1146
+ clearOnStoryChange: !0,
1147
+ limit: 50
1148
+ };
1149
+
1150
+ // src/actions/runtime/action.ts
1151
+ var Ut = /* @__PURE__ */ n((e, t) => {
1152
+ let r = Object.getPrototypeOf(e);
1153
+ return !r || t(r) ? r : Ut(r, t);
1154
+ }, "findProto"), Po = /* @__PURE__ */ n((e) => !!(typeof e == "object" && e && Ut(e, (t) => /^Synthetic(?:Base)?Event$/.test(t.constructor.name)) &&
1155
+ typeof e.persist == "function"), "isReactSyntheticEvent"), Oo = /* @__PURE__ */ n((e) => {
1156
+ if (Po(e)) {
1157
+ let t = Object.create(
1158
+ e.constructor.prototype,
1159
+ Object.getOwnPropertyDescriptors(e)
1160
+ );
1161
+ t.persist();
1162
+ let r = Object.getOwnPropertyDescriptor(t, "view"), o = r?.value;
1163
+ return typeof o == "object" && o?.constructor.name === "Window" && Object.defineProperty(t, "view", {
1164
+ ...r,
1165
+ value: Object.create(o.constructor.prototype)
1166
+ }), t;
1167
+ }
1168
+ return e;
1169
+ }, "serializeArg");
1170
+ function ie(e, t = {}) {
1171
+ let r = {
1172
+ ...Bt,
1173
+ ...t
1174
+ }, o = /* @__PURE__ */ n(function(...s) {
1175
+ if (t.implicit) {
1176
+ let T = ("__STORYBOOK_PREVIEW__" in zt ? zt.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
1177
+ (R) => R.phase === "playing" || R.phase === "rendering"
1178
+ );
1179
+ if (T) {
1180
+ let R = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, P = new vo({
1181
+ phase: T.phase,
1182
+ name: e,
1183
+ deprecated: R
1184
+ });
1185
+ if (R)
1186
+ console.warn(P);
1187
+ else
1188
+ throw P;
1189
+ }
1190
+ }
1191
+ let a = ko.getChannel(), p = Date.now().toString(36) + Math.random().toString(36).substring(2), c = 5, l = s.map(Oo), y = s.length > 1 ?
1192
+ l : l[0], u = {
1193
+ id: p,
1194
+ count: 0,
1195
+ data: { name: e, args: y },
1196
+ options: {
1197
+ ...r,
1198
+ maxDepth: c + (r.depth || 3)
1199
+ }
1200
+ };
1201
+ a.emit(jt, u);
1202
+ }, "actionHandler");
1203
+ return o.isAction = !0, o.implicit = t.implicit, o;
1204
+ }
1205
+ n(ie, "action");
1206
+
1207
+ // src/actions/addArgsHelpers.ts
1208
+ var Gt = /* @__PURE__ */ n((e, t) => typeof t[e] > "u" && !(e in t), "isInInitialArgs"), Wt = /* @__PURE__ */ n((e) => {
1209
+ let {
1210
+ initialArgs: t,
1211
+ argTypes: r,
1212
+ id: o,
1213
+ parameters: { actions: i }
1214
+ } = e;
1215
+ if (!i || i.disable || !i.argTypesRegex || !r)
1216
+ return {};
1217
+ let s = new RegExp(i.argTypesRegex);
1218
+ return Object.entries(r).filter(
1219
+ ([p]) => !!s.test(p)
1220
+ ).reduce((p, [c, l]) => (Gt(c, t) && (p[c] = ie(c, { implicit: !0, id: o })), p), {});
1221
+ }, "inferActionsFromArgTypesRegex"), Yt = /* @__PURE__ */ n((e) => {
1222
+ let {
1223
+ initialArgs: t,
1224
+ argTypes: r,
1225
+ parameters: { actions: o }
1226
+ } = e;
1227
+ return o?.disable || !r ? {} : Object.entries(r).filter(([s, a]) => !!a.action).reduce((s, [a, p]) => (Gt(a, t) && (s[a] = ie(typeof p.action ==
1228
+ "string" ? p.action : a)), s), {});
1229
+ }, "addActionsFromArgTypes");
1230
+
1231
+ // src/actions/addArgs.ts
1232
+ var Mo = [
1233
+ Yt,
1234
+ Wt
1235
+ ];
1236
+
1237
+ // src/actions/loaders.ts
1238
+ var qe = {};
1239
+ xt(qe, {
1240
+ loaders: () => Io
1241
+ });
1242
+ import { onMockCall as $o } from "storybook/test";
1243
+ var Vt = !1, Fo = /* @__PURE__ */ n((e) => {
1244
+ let { parameters: t } = e;
1245
+ t?.actions?.disable || Vt || ($o((r, o) => {
1246
+ let i = r.getMockName();
1247
+ i !== "spy" && (!/^next\/.*::/.test(i) || [
1248
+ "next/router::useRouter()",
1249
+ "next/navigation::useRouter()",
1250
+ "next/navigation::redirect",
1251
+ "next/cache::",
1252
+ "next/headers::cookies().set",
1253
+ "next/headers::cookies().delete",
1254
+ "next/headers::headers().set",
1255
+ "next/headers::headers().delete"
1256
+ ].some((s) => i.startsWith(s))) && ie(i)(o);
1257
+ }), Vt = !0);
1258
+ }, "logActionsWhenMockCalled"), Io = [Fo];
1259
+
1260
+ // src/actions/preview.ts
1261
+ var Xe = /* @__PURE__ */ n(() => Lo({
1262
+ ...Ke,
1263
+ ...qe
1264
+ }), "default");
1265
+
1266
+ // src/backgrounds/preview.ts
1267
+ import { definePreviewAddon as jo } from "storybook/internal/csf";
1268
+
1269
+ // src/backgrounds/constants.ts
1270
+ var Do = "storybook/background", Z = "backgrounds";
1271
+ var rp = {
1272
+ UPDATE: `${Do}/update`
1273
+ };
1274
+
1275
+ // src/backgrounds/decorator.ts
1276
+ import { useEffect as Jt } from "storybook/preview-api";
1277
+
1278
+ // src/backgrounds/defaults.ts
1279
+ var Kt = {
1280
+ light: { name: "light", value: "#F8F8F8" },
1281
+ dark: { name: "dark", value: "#333" }
1282
+ };
1283
+
1284
+ // src/backgrounds/utils.ts
1285
+ var { document: N } = globalThis, qt = /* @__PURE__ */ n(() => globalThis?.matchMedia ? !!globalThis.matchMedia("(prefers-reduced-motion: re\
1286
+ duce)")?.matches : !1, "isReduceMotionEnabled"), Ze = /* @__PURE__ */ n((e) => {
1287
+ (Array.isArray(e) ? e : [e]).forEach(_o);
1288
+ }, "clearStyles"), _o = /* @__PURE__ */ n((e) => {
1289
+ if (!N)
1290
+ return;
1291
+ let t = N.getElementById(e);
1292
+ t && t.parentElement && t.parentElement.removeChild(t);
1293
+ }, "clearStyle"), Xt = /* @__PURE__ */ n((e, t) => {
1294
+ if (!N)
1295
+ return;
1296
+ let r = N.getElementById(e);
1297
+ if (r)
1298
+ r.innerHTML !== t && (r.innerHTML = t);
1299
+ else {
1300
+ let o = N.createElement("style");
1301
+ o.setAttribute("id", e), o.innerHTML = t, N.head.appendChild(o);
1302
+ }
1303
+ }, "addGridStyle"), Zt = /* @__PURE__ */ n((e, t, r) => {
1304
+ if (!N)
1305
+ return;
1306
+ let o = N.getElementById(e);
1307
+ if (o)
1308
+ o.innerHTML !== t && (o.innerHTML = t);
1309
+ else {
1310
+ let i = N.createElement("style");
1311
+ i.setAttribute("id", e), i.innerHTML = t;
1312
+ let s = `addon-backgrounds-grid${r ? `-docs-${r}` : ""}`, a = N.getElementById(s);
1313
+ a ? a.parentElement?.insertBefore(i, a) : N.head.appendChild(i);
1314
+ }
1315
+ }, "addBackgroundStyle");
1316
+
1317
+ // src/backgrounds/decorator.ts
1318
+ var Ho = {
1319
+ cellSize: 100,
1320
+ cellAmount: 10,
1321
+ opacity: 0.8
1322
+ }, Qt = "addon-backgrounds", er = "addon-backgrounds-grid", No = qt() ? "" : "transition: background-color 0.3s;", tr = /* @__PURE__ */ n((e, t) => {
1323
+ let { globals: r = {}, parameters: o = {}, viewMode: i, id: s } = t, {
1324
+ options: a = Kt,
1325
+ disable: p,
1326
+ grid: c = Ho
1327
+ } = o[Z] || {}, l = r[Z] || {}, y = typeof l == "string" ? l : l?.value, u = y ? a[y] : void 0, h = typeof u == "string" ? u : u?.value ||
1328
+ "transparent", T = typeof l == "string" ? !1 : l.grid || !1, R = !!u && !p, P = i === "docs" ? `#anchor--${s} .docs-story` : ".sb-show-mai\
1329
+ n", L = i === "docs" ? `#anchor--${s} .docs-story` : ".sb-show-main", O = o.layout === void 0 || o.layout === "padded", F = i === "docs" ? 20 :
1330
+ O ? 16 : 0, { cellAmount: A, cellSize: S, opacity: v, offsetX: w = F, offsetY: d = F } = c, m = i === "docs" ? `${Qt}-docs-${s}` : `${Qt}-\
1331
+ color`, f = i === "docs" ? s : null;
1332
+ Jt(() => {
1333
+ let g = `
1334
+ ${P} {
1335
+ background: ${h} !important;
1336
+ ${No}
1337
+ }`;
1338
+ if (!R) {
1339
+ Ze(m);
1340
+ return;
1341
+ }
1342
+ Zt(m, g, f);
1343
+ }, [P, m, f, R, h]);
1344
+ let x = i === "docs" ? `${er}-docs-${s}` : `${er}`;
1345
+ return Jt(() => {
1346
+ if (!T) {
1347
+ Ze(x);
1348
+ return;
1349
+ }
1350
+ let g = [
1351
+ `${S * A}px ${S * A}px`,
1352
+ `${S * A}px ${S * A}px`,
1353
+ `${S}px ${S}px`,
1354
+ `${S}px ${S}px`
1355
+ ].join(", "), E = `
1356
+ ${L} {
1357
+ background-size: ${g} !important;
1358
+ background-position: ${w}px ${d}px, ${w}px ${d}px, ${w}px ${d}px, ${w}px ${d}px !important;
1359
+ background-blend-mode: difference !important;
1360
+ background-image: linear-gradient(rgba(130, 130, 130, ${v}) 1px, transparent 1px),
1361
+ linear-gradient(90deg, rgba(130, 130, 130, ${v}) 1px, transparent 1px),
1362
+ linear-gradient(rgba(130, 130, 130, ${v / 2}) 1px, transparent 1px),
1363
+ linear-gradient(90deg, rgba(130, 130, 130, ${v / 2}) 1px, transparent 1px) !important;
1364
+ }
1365
+ `;
1366
+ Xt(x, E);
1367
+ }, [A, S, L, x, T, w, d, v]), e();
1368
+ }, "withBackgroundAndGrid");
1369
+
1370
+ // src/backgrounds/preview.ts
1371
+ var Bo = globalThis.FEATURES?.backgrounds ? [tr] : [], zo = {
1372
+ [Z]: {
1373
+ grid: {
1374
+ cellSize: 20,
1375
+ opacity: 0.5,
1376
+ cellAmount: 5
1377
+ },
1378
+ disable: !1
1379
+ }
1380
+ }, Uo = {
1381
+ [Z]: { value: void 0, grid: !1 }
1382
+ }, Je = /* @__PURE__ */ n(() => jo({
1383
+ decorators: Bo,
1384
+ parameters: zo,
1385
+ initialGlobals: Uo
1386
+ }), "default");
1387
+
1388
+ // src/component-testing/preview.ts
1389
+ import { definePreviewAddon as Go } from "storybook/internal/csf";
1390
+ import { instrument as Wo } from "storybook/internal/instrumenter";
1391
+ var { step: Yo } = Wo(
1392
+ {
1393
+ // It seems like the label is unused, but the instrumenter has access to it
1394
+ // The context will be bounded later in StoryRender, so that the user can write just:
1395
+ // await step("label", (context) => {
1396
+ // // labeled step
1397
+ // });
1398
+ step: /* @__PURE__ */ n(async (e, t, r) => t(r), "step")
1399
+ },
1400
+ { intercept: !0 }
1401
+ ), Qe = /* @__PURE__ */ n(() => Go({
1402
+ parameters: {
1403
+ throwPlayFunctionExceptions: !1
1404
+ },
1405
+ runStep: Yo
1406
+ }), "default");
1407
+
1408
+ // src/highlight/preview.ts
1409
+ import { definePreviewAddon as Zo } from "storybook/internal/csf";
1410
+ import { addons as ur } from "storybook/preview-api";
1411
+
1412
+ // src/highlight/useHighlights.ts
1413
+ import { STORY_RENDER_PHASE_CHANGED as qo } from "storybook/internal/core-events";
1414
+
1415
+ // src/highlight/constants.ts
1416
+ var ge = "storybook/highlight", rr = `${ge}/add`, or = `${ge}/remove`, nr = `${ge}/reset`, ir = `${ge}/scroll-into-view`, et = 2147483647, B = 28;
1417
+
1418
+ // src/highlight/icons.ts
1419
+ var tt = {
1420
+ chevronLeft: [
1421
+ "M9.10355 10.1464C9.29882 10.3417 9.29882 10.6583 9.10355 10.8536C8.90829 11.0488 8.59171 11.0488 8.39645 10.8536L4.89645 7.35355C4.7011\
1422
+ 8 7.15829 4.70118 6.84171 4.89645 6.64645L8.39645 3.14645C8.59171 2.95118 8.90829 2.95118 9.10355 3.14645C9.29882 3.34171 9.29882 3.65829 9.\
1423
+ 10355 3.85355L5.95711 7L9.10355 10.1464Z"
1424
+ ],
1425
+ chevronRight: [
1426
+ "M4.89645 10.1464C4.70118 10.3417 4.70118 10.6583 4.89645 10.8536C5.09171 11.0488 5.40829 11.0488 5.60355 10.8536L9.10355 7.35355C9.2988\
1427
+ 2 7.15829 9.29882 6.84171 9.10355 6.64645L5.60355 3.14645C5.40829 2.95118 5.09171 2.95118 4.89645 3.14645C4.70118 3.34171 4.70118 3.65829 4.\
1428
+ 89645 3.85355L8.04289 7L4.89645 10.1464Z"
1429
+ ],
1430
+ info: [
1431
+ "M7 5.5a.5.5 0 01.5.5v4a.5.5 0 01-1 0V6a.5.5 0 01.5-.5zM7 4.5A.75.75 0 107 3a.75.75 0 000 1.5z",
1432
+ "M7 14A7 7 0 107 0a7 7 0 000 14zm0-1A6 6 0 107 1a6 6 0 000 12z"
1433
+ ],
1434
+ shareAlt: [
1435
+ "M2 1.004a1 1 0 00-1 1v10a1 1 0 001 1h10a1 1 0 001-1v-4.5a.5.5 0 00-1 0v4.5H2v-10h4.5a.5.5 0 000-1H2z",
1436
+ "M7.354 7.357L12 2.711v1.793a.5.5 0 001 0v-3a.5.5 0 00-.5-.5h-3a.5.5 0 100 1h1.793L6.646 6.65a.5.5 0 10.708.707z"
1437
+ ]
1438
+ };
1439
+
1440
+ // src/highlight/utils.ts
1441
+ var Vo = "svg,path,rect,circle,line,polyline,polygon,ellipse,text".split(","), M = /* @__PURE__ */ n((e, t = {}, r) => {
1442
+ let o = Vo.includes(e) ? document.createElementNS("http://www.w3.org/2000/svg", e) : document.createElement(e);
1443
+ return Object.entries(t).forEach(([i, s]) => {
1444
+ /[A-Z]/.test(i) ? (i === "onClick" && (o.addEventListener("click", s), o.addEventListener("keydown", (a) => {
1445
+ (a.key === "Enter" || a.key === " ") && (a.preventDefault(), s());
1446
+ })), i === "onMouseEnter" && o.addEventListener("mouseenter", s), i === "onMouseLeave" && o.addEventListener("mouseleave", s)) : o.setAttribute(
1447
+ i, s);
1448
+ }), r?.forEach((i) => {
1449
+ if (!(i == null || i === !1))
1450
+ try {
1451
+ o.appendChild(i);
1452
+ } catch {
1453
+ o.appendChild(document.createTextNode(String(i)));
1454
+ }
1455
+ }), o;
1456
+ }, "createElement"), ae = /* @__PURE__ */ n((e) => tt[e] && M(
1457
+ "svg",
1458
+ { width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" },
1459
+ tt[e].map(
1460
+ (t) => M("path", {
1461
+ fill: "currentColor",
1462
+ "fill-rule": "evenodd",
1463
+ "clip-rule": "evenodd",
1464
+ d: t
1465
+ })
1466
+ )
1467
+ ), "createIcon"), sr = /* @__PURE__ */ n((e) => {
1468
+ if ("elements" in e) {
1469
+ let { elements: o, color: i, style: s } = e;
1470
+ return {
1471
+ id: void 0,
1472
+ priority: 0,
1473
+ selectors: o,
1474
+ styles: {
1475
+ outline: `2px ${s} ${i}`,
1476
+ outlineOffset: "2px",
1477
+ boxShadow: "0 0 0 6px rgba(255,255,255,0.6)"
1478
+ },
1479
+ menu: void 0
1480
+ };
1481
+ }
1482
+ let { menu: t, ...r } = e;
1483
+ return {
1484
+ id: void 0,
1485
+ priority: 0,
1486
+ styles: {
1487
+ outline: "2px dashed #029cfd"
1488
+ },
1489
+ ...r,
1490
+ menu: Array.isArray(t) ? t.every(Array.isArray) ? t : [t] : void 0
1491
+ };
1492
+ }, "normalizeOptions"), Ko = /* @__PURE__ */ n((e) => e instanceof Function, "isFunction"), se = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(),
1493
+ he = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ n((e) => {
1494
+ let t = Symbol();
1495
+ return q.set(t, []), se.set(t, e), { get: /* @__PURE__ */ n(() => se.get(t), "get"), set: /* @__PURE__ */ n((a) => {
1496
+ let p = se.get(t), c = Ko(a) ? a(p) : a;
1497
+ c !== p && (se.set(t, c), q.get(t)?.forEach((l) => {
1498
+ he.get(l)?.(), he.set(l, l(c));
1499
+ }));
1500
+ }, "set"), subscribe: /* @__PURE__ */ n((a) => (q.get(t)?.push(a), () => {
1501
+ let p = q.get(t);
1502
+ p && q.set(
1503
+ t,
1504
+ p.filter((c) => c !== a)
1505
+ );
1506
+ }), "subscribe"), teardown: /* @__PURE__ */ n(() => {
1507
+ q.get(t)?.forEach((a) => {
1508
+ he.get(a)?.(), he.delete(a);
1509
+ }), q.delete(t), se.delete(t);
1510
+ }, "teardown") };
1511
+ }, "useStore"), rt = /* @__PURE__ */ n((e) => {
1512
+ let t = document.getElementById("storybook-root"), r = /* @__PURE__ */ new Map();
1513
+ for (let o of e) {
1514
+ let { priority: i = 0 } = o;
1515
+ for (let s of o.selectors) {
1516
+ let a = [
1517
+ ...document.querySelectorAll(
1518
+ // Elements matching the selector, excluding storybook elements and their descendants.
1519
+ // Necessary to find portaled elements (e.g. children of `body`).
1520
+ `:is(${s}):not([id^="storybook-"], [id^="storybook-"] *, [class^="sb-"], [class^="sb-"] *)`
1521
+ ),
1522
+ // Elements matching the selector inside the storybook root, as these were excluded above.
1523
+ ...t?.querySelectorAll(s) || []
1524
+ ];
1525
+ for (let p of a) {
1526
+ let c = r.get(p);
1527
+ (!c || c.priority <= i) && r.set(p, {
1528
+ ...o,
1529
+ priority: i,
1530
+ selectors: Array.from(new Set((c?.selectors || []).concat(s)))
1531
+ });
1532
+ }
1533
+ }
1534
+ }
1535
+ return r;
1536
+ }, "mapElements"), ar = /* @__PURE__ */ n((e) => Array.from(e.entries()).map(([t, { selectors: r, styles: o, hoverStyles: i, focusStyles: s,
1537
+ menu: a }]) => {
1538
+ let { top: p, left: c, width: l, height: y } = t.getBoundingClientRect(), { position: u } = getComputedStyle(t);
1539
+ return {
1540
+ element: t,
1541
+ selectors: r,
1542
+ styles: o,
1543
+ hoverStyles: i,
1544
+ focusStyles: s,
1545
+ menu: a,
1546
+ top: u === "fixed" ? p : p + window.scrollY,
1547
+ left: u === "fixed" ? c : c + window.scrollX,
1548
+ width: l,
1549
+ height: y
1550
+ };
1551
+ }).sort((t, r) => r.width * r.height - t.width * t.height), "mapBoxes"), ot = /* @__PURE__ */ n((e, t) => {
1552
+ let r = e.getBoundingClientRect(), { x: o, y: i } = t;
1553
+ return r?.top && r?.left && o >= r.left && o <= r.left + r.width && i >= r.top && i <= r.top + r.height;
1554
+ }, "isOverMenu"), nt = /* @__PURE__ */ n((e, t, r) => {
1555
+ if (!t || !r)
1556
+ return !1;
1557
+ let { left: o, top: i, width: s, height: a } = e;
1558
+ a < B && (i = i - Math.round((B - a) / 2), a = B), s < B && (o = o - Math.round((B - s) / 2), s = B), t.style.position === "fixed" && (o +=
1559
+ window.scrollX, i += window.scrollY);
1560
+ let { x: p, y: c } = r;
1561
+ return p >= o && p <= o + s && c >= i && c <= i + a;
1562
+ }, "isTargeted"), pr = /* @__PURE__ */ n((e, t, r = {}) => {
1563
+ let { x: o, y: i } = t, { margin: s = 5, topOffset: a = 0, centered: p = !1 } = r, { scrollX: c, scrollY: l, innerHeight: y, innerWidth: u } = window,
1564
+ h = Math.min(
1565
+ e.style.position === "fixed" ? i - l : i,
1566
+ y - e.clientHeight - s - a + l
1567
+ ), T = p ? e.clientWidth / 2 : 0, R = e.style.position === "fixed" ? Math.max(Math.min(o - c, u - T - s), T + s) : Math.max(
1568
+ Math.min(o, u - T - s + c),
1569
+ T + s + c
1570
+ );
1571
+ Object.assign(e.style, {
1572
+ ...R !== o && { left: `${R}px` },
1573
+ ...h !== i && { top: `${h}px` }
1574
+ });
1575
+ }, "keepInViewport"), it = /* @__PURE__ */ n((e) => {
1576
+ window.HTMLElement.prototype.hasOwnProperty("showPopover") && e.showPopover();
1577
+ }, "showPopover"), lr = /* @__PURE__ */ n((e) => {
1578
+ window.HTMLElement.prototype.hasOwnProperty("showPopover") && e.hidePopover();
1579
+ }, "hidePopover"), cr = /* @__PURE__ */ n((e) => ({
1580
+ top: e.top,
1581
+ left: e.left,
1582
+ width: e.width,
1583
+ height: e.height,
1584
+ selectors: e.selectors,
1585
+ element: {
1586
+ attributes: Object.fromEntries(
1587
+ Array.from(e.element.attributes).map((t) => [t.name, t.value])
1588
+ ),
1589
+ localName: e.element.localName,
1590
+ tagName: e.element.tagName,
1591
+ outerHTML: e.element.outerHTML
1592
+ }
1593
+ }), "getEventDetails");
1594
+
1595
+ // src/highlight/useHighlights.ts
1596
+ var C = "storybook-highlights-menu", dr = "storybook-highlights-root", Xo = "storybook-root", mr = /* @__PURE__ */ n((e) => {
1597
+ if (globalThis.__STORYBOOK_HIGHLIGHT_INITIALIZED)
1598
+ return;
1599
+ globalThis.__STORYBOOK_HIGHLIGHT_INITIALIZED = !0;
1600
+ let { document: t } = globalThis, r = z([]), o = z(/* @__PURE__ */ new Map()), i = z([]), s = z(), a = z(), p = z([]), c = z([]), l = z(),
1601
+ y = z(), u = t.getElementById(dr);
1602
+ r.subscribe(() => {
1603
+ u || (u = M("div", { id: dr }), t.body.appendChild(u));
1604
+ }), r.subscribe((d) => {
1605
+ let m = t.getElementById(Xo);
1606
+ if (!m)
1607
+ return;
1608
+ o.set(rt(d));
1609
+ let f = new MutationObserver(() => o.set(rt(d)));
1610
+ return f.observe(m, { subtree: !0, childList: !0 }), () => {
1611
+ f.disconnect();
1612
+ };
1613
+ }), o.subscribe((d) => {
1614
+ let m = /* @__PURE__ */ n(() => requestAnimationFrame(() => i.set(ar(d))), "updateBoxes"), f = new ResizeObserver(m);
1615
+ f.observe(t.body), Array.from(d.keys()).forEach((g) => f.observe(g));
1616
+ let x = Array.from(t.body.querySelectorAll("*")).filter((g) => {
1617
+ let { overflow: E, overflowX: I, overflowY: k } = window.getComputedStyle(g);
1618
+ return ["auto", "scroll"].some((H) => [E, I, k].includes(H));
1619
+ });
1620
+ return x.forEach((g) => g.addEventListener("scroll", m)), () => {
1621
+ f.disconnect(), x.forEach((g) => g.removeEventListener("scroll", m));
1622
+ };
1623
+ }), o.subscribe((d) => {
1624
+ let m = Array.from(d.keys()).filter(({ style: x }) => x.position === "sticky"), f = /* @__PURE__ */ n(() => requestAnimationFrame(() => {
1625
+ i.set(
1626
+ (x) => x.map((g) => {
1627
+ if (m.includes(g.element)) {
1628
+ let { top: E, left: I } = g.element.getBoundingClientRect();
1629
+ return { ...g, top: E + window.scrollY, left: I + window.scrollX };
1630
+ }
1631
+ return g;
1632
+ })
1633
+ );
1634
+ }), "updateBoxes");
1635
+ return t.addEventListener("scroll", f), () => t.removeEventListener("scroll", f);
1636
+ }), o.subscribe((d) => {
1637
+ p.set((m) => m.filter(({ element: f }) => d.has(f)));
1638
+ }), p.subscribe((d) => {
1639
+ d.length ? (y.set((m) => d.some((f) => f.element === m?.element) ? m : void 0), l.set((m) => d.some((f) => f.element === m?.element) ? m :
1640
+ void 0)) : (y.set(void 0), l.set(void 0), s.set(void 0));
1641
+ });
1642
+ let h = new Map(/* @__PURE__ */ new Map());
1643
+ r.subscribe((d) => {
1644
+ d.forEach(({ keyframes: m }) => {
1645
+ if (m) {
1646
+ let f = h.get(m);
1647
+ f || (f = t.createElement("style"), f.setAttribute("data-highlight", "keyframes"), h.set(m, f), t.head.appendChild(f)), f.innerHTML =
1648
+ m;
1649
+ }
1650
+ }), h.forEach((m, f) => {
1651
+ d.some((x) => x.keyframes === f) || (m.remove(), h.delete(f));
1652
+ });
1653
+ });
1654
+ let T = new Map(/* @__PURE__ */ new Map());
1655
+ i.subscribe((d) => {
1656
+ d.forEach((m) => {
1657
+ let f = T.get(m.element);
1658
+ if (u && !f) {
1659
+ let x = {
1660
+ popover: "manual",
1661
+ "data-highlight-dimensions": `w${m.width.toFixed(0)}h${m.height.toFixed(0)}`,
1662
+ "data-highlight-coordinates": `x${m.left.toFixed(0)}y${m.top.toFixed(0)}`
1663
+ };
1664
+ f = u.appendChild(
1665
+ M("div", x, [M("div")])
1666
+ ), T.set(m.element, f);
1667
+ }
1668
+ }), T.forEach((m, f) => {
1669
+ d.some(({ element: x }) => x === f) || (m.remove(), T.delete(f));
1670
+ });
1671
+ }), i.subscribe((d) => {
1672
+ let m = d.filter((x) => x.menu);
1673
+ if (!m.length)
1674
+ return;
1675
+ let f = /* @__PURE__ */ n((x) => {
1676
+ requestAnimationFrame(() => {
1677
+ let g = t.getElementById(C), E = { x: x.pageX, y: x.pageY };
1678
+ if (g && !ot(g, E)) {
1679
+ let I = m.filter((k) => {
1680
+ let H = T.get(k.element);
1681
+ return nt(k, H, E);
1682
+ });
1683
+ s.set(I.length ? E : void 0), p.set(I);
1684
+ }
1685
+ });
1686
+ }, "onClick");
1687
+ return t.addEventListener("click", f), () => t.removeEventListener("click", f);
1688
+ });
1689
+ let R = /* @__PURE__ */ n(() => {
1690
+ let d = t.getElementById(C), m = a.get();
1691
+ !m || d && ot(d, m) || c.set((f) => {
1692
+ let x = i.get().filter((k) => {
1693
+ let H = T.get(k.element);
1694
+ return nt(k, H, m);
1695
+ }), g = f.filter((k) => x.includes(k)), E = x.filter((k) => !f.includes(k)), I = f.length - g.length;
1696
+ return E.length || I ? [...g, ...E] : f;
1697
+ });
1698
+ }, "updateHovered");
1699
+ a.subscribe(R), i.subscribe(R);
1700
+ let P = /* @__PURE__ */ n(() => {
1701
+ let d = y.get(), m = d ? [d] : p.get(), f = m.length === 1 ? m[0] : l.get(), x = s.get() !== void 0;
1702
+ i.get().forEach((g) => {
1703
+ let E = T.get(g.element);
1704
+ if (E) {
1705
+ let I = f === g, k = x ? f ? I : m.includes(g) : c.get()?.includes(g);
1706
+ Object.assign(E.style, {
1707
+ animation: "none",
1708
+ background: "transparent",
1709
+ border: "none",
1710
+ boxSizing: "border-box",
1711
+ outline: "none",
1712
+ outlineOffset: "0px",
1713
+ ...g.styles,
1714
+ ...k ? g.hoverStyles : {},
1715
+ ...I ? g.focusStyles : {},
1716
+ position: getComputedStyle(g.element).position === "fixed" ? "fixed" : "absolute",
1717
+ zIndex: et - 10,
1718
+ top: `${g.top}px`,
1719
+ left: `${g.left}px`,
1720
+ width: `${g.width}px`,
1721
+ height: `${g.height}px`,
1722
+ margin: 0,
1723
+ padding: 0,
1724
+ cursor: g.menu && k ? "pointer" : "default",
1725
+ pointerEvents: g.menu ? "auto" : "none",
1726
+ display: "flex",
1727
+ alignItems: "center",
1728
+ justifyContent: "center",
1729
+ overflow: "visible"
1730
+ }), Object.assign(E.children[0].style, {
1731
+ width: "100%",
1732
+ height: "100%",
1733
+ minHeight: `${B}px`,
1734
+ minWidth: `${B}px`,
1735
+ boxSizing: "content-box",
1736
+ padding: E.style.outlineWidth || "0px"
1737
+ }), it(E);
1738
+ }
1739
+ });
1740
+ }, "updateBoxStyles");
1741
+ i.subscribe(P), p.subscribe(P), c.subscribe(P), l.subscribe(P), y.subscribe(P);
1742
+ let L = /* @__PURE__ */ n(() => {
1743
+ if (!u)
1744
+ return;
1745
+ let d = t.getElementById(C);
1746
+ if (d)
1747
+ d.innerHTML = "";
1748
+ else {
1749
+ let g = { id: C, popover: "manual" };
1750
+ d = u.appendChild(M("div", g)), u.appendChild(
1751
+ M("style", {}, [
1752
+ `
1753
+ #${C} {
1754
+ position: absolute;
1755
+ z-index: ${et};
1756
+ width: 300px;
1757
+ padding: 0px;
1758
+ margin: 15px 0 0 0;
1759
+ transform: translateX(-50%);
1760
+ font-family: "Nunito Sans", -apple-system, ".SFNSText-Regular", "San Francisco", BlinkMacSystemFont, "Segoe UI", "Helvetica Ne\
1761
+ ue", Helvetica, Arial, sans-serif;
1762
+ font-size: 12px;
1763
+ background: white;
1764
+ border: none;
1765
+ border-radius: 6px;
1766
+ box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.1);
1767
+ color: #2E3438;
1768
+ }
1769
+ #${C} ul {
1770
+ list-style: none;
1771
+ margin: 0;
1772
+ padding: 0;
1773
+ }
1774
+ #${C} > ul {
1775
+ max-height: 300px;
1776
+ overflow-y: auto;
1777
+ padding: 4px 0;
1778
+ }
1779
+ #${C} li {
1780
+ padding: 0 4px;
1781
+ margin: 0;
1782
+ }
1783
+ #${C} li > :not(ul) {
1784
+ display: flex;
1785
+ padding: 8px;
1786
+ margin: 0;
1787
+ align-items: center;
1788
+ gap: 8px;
1789
+ border-radius: 4px;
1790
+ }
1791
+ #${C} button {
1792
+ width: 100%;
1793
+ border: 0;
1794
+ background: transparent;
1795
+ color: inherit;
1796
+ text-align: left;
1797
+ font-family: inherit;
1798
+ font-size: inherit;
1799
+ }
1800
+ #${C} button:focus-visible {
1801
+ outline-color: #029CFD;
1802
+ }
1803
+ #${C} button:hover {
1804
+ background: rgba(2, 156, 253, 0.07);
1805
+ color: #029CFD;
1806
+ cursor: pointer;
1807
+ }
1808
+ #${C} li code {
1809
+ white-space: nowrap;
1810
+ overflow: hidden;
1811
+ text-overflow: ellipsis;
1812
+ line-height: 16px;
1813
+ font-size: 11px;
1814
+ }
1815
+ #${C} li svg {
1816
+ flex-shrink: 0;
1817
+ margin: 1px;
1818
+ color: #73828C;
1819
+ }
1820
+ #${C} li > button:hover svg, #${C} li > button:focus-visible svg {
1821
+ color: #029CFD;
1822
+ }
1823
+ #${C} .element-list li svg {
1824
+ display: none;
1825
+ }
1826
+ #${C} li.selectable svg, #${C} li.selected svg {
1827
+ display: block;
1828
+ }
1829
+ #${C} .menu-list {
1830
+ border-top: 1px solid rgba(38, 85, 115, 0.15);
1831
+ }
1832
+ #${C} .menu-list > li:not(:last-child) {
1833
+ padding-bottom: 4px;
1834
+ margin-bottom: 4px;
1835
+ border-bottom: 1px solid rgba(38, 85, 115, 0.15);
1836
+ }
1837
+ #${C} .menu-items, #${C} .menu-items li {
1838
+ padding: 0;
1839
+ }
1840
+ #${C} .menu-item {
1841
+ display: flex;
1842
+ }
1843
+ #${C} .menu-item-content {
1844
+ display: flex;
1845
+ flex-direction: column;
1846
+ flex-grow: 1;
1847
+ }
1848
+ `
1849
+ ])
1850
+ );
1851
+ }
1852
+ let m = y.get(), f = m ? [m] : p.get();
1853
+ if (f.length && (d.style.position = getComputedStyle(f[0].element).position === "fixed" ? "fixed" : "absolute", d.appendChild(
1854
+ M(
1855
+ "ul",
1856
+ { class: "element-list" },
1857
+ f.map((g) => {
1858
+ let E = f.length > 1 && !!g.menu?.some(
1859
+ (H) => H.some(
1860
+ (X) => !X.selectors || X.selectors.some((le) => g.selectors.includes(le))
1861
+ )
1862
+ ), I = E ? {
1863
+ class: "selectable",
1864
+ onClick: /* @__PURE__ */ n(() => y.set(g), "onClick"),
1865
+ onMouseEnter: /* @__PURE__ */ n(() => l.set(g), "onMouseEnter"),
1866
+ onMouseLeave: /* @__PURE__ */ n(() => l.set(void 0), "onMouseLeave")
1867
+ } : m ? { class: "selected", onClick: /* @__PURE__ */ n(() => y.set(void 0), "onClick") } : {}, k = E || m;
1868
+ return M("li", I, [
1869
+ M(k ? "button" : "div", k ? { type: "button" } : {}, [
1870
+ m ? ae("chevronLeft") : null,
1871
+ M("code", {}, [g.element.outerHTML]),
1872
+ E ? ae("chevronRight") : null
1873
+ ])
1874
+ ]);
1875
+ })
1876
+ )
1877
+ )), y.get() || p.get().length === 1) {
1878
+ let g = y.get() || p.get()[0], E = g.menu?.filter(
1879
+ (I) => I.some(
1880
+ (k) => !k.selectors || k.selectors.some((H) => g.selectors.includes(H))
1881
+ )
1882
+ );
1883
+ E?.length && d.appendChild(
1884
+ M(
1885
+ "ul",
1886
+ { class: "menu-list" },
1887
+ E.map(
1888
+ (I) => M("li", {}, [
1889
+ M(
1890
+ "ul",
1891
+ { class: "menu-items" },
1892
+ I.map(
1893
+ ({ id: k, title: H, description: X, iconLeft: le, iconRight: gt, clickEvent: ht }) => {
1894
+ let we = ht && (() => e.emit(ht, k, cr(g)));
1895
+ return M("li", {}, [
1896
+ M(
1897
+ we ? "button" : "div",
1898
+ we ? { class: "menu-item", type: "button", onClick: we } : { class: "menu-item" },
1899
+ [
1900
+ le ? ae(le) : null,
1901
+ M("div", { class: "menu-item-content" }, [
1902
+ M(X ? "strong" : "span", {}, [H]),
1903
+ X && M("span", {}, [X])
1904
+ ]),
1905
+ gt ? ae(gt) : null
1906
+ ]
1907
+ )
1908
+ ]);
1909
+ }
1910
+ )
1911
+ )
1912
+ ])
1913
+ )
1914
+ )
1915
+ );
1916
+ }
1917
+ let x = s.get();
1918
+ x ? (Object.assign(d.style, {
1919
+ display: "block",
1920
+ left: `${d.style.position === "fixed" ? x.x - window.scrollX : x.x}px`,
1921
+ top: `${d.style.position === "fixed" ? x.y - window.scrollY : x.y}px`
1922
+ }), it(d), requestAnimationFrame(() => pr(d, x, { topOffset: 15, centered: !0 }))) : (lr(d), Object.assign(d.style, { display: "none" }));
1923
+ }, "renderMenu");
1924
+ p.subscribe(L), y.subscribe(L);
1925
+ let O = /* @__PURE__ */ n((d) => {
1926
+ let m = sr(d);
1927
+ r.set((f) => {
1928
+ let x = m.id ? f.filter((g) => g.id !== m.id) : f;
1929
+ return m.selectors?.length ? [...x, m] : x;
1930
+ });
1931
+ }, "addHighlight"), F = /* @__PURE__ */ n((d) => {
1932
+ d && r.set((m) => m.filter((f) => f.id !== d));
1933
+ }, "removeHighlight"), A = /* @__PURE__ */ n(() => {
1934
+ r.set([]), o.set(/* @__PURE__ */ new Map()), i.set([]), s.set(void 0), a.set(void 0), p.set([]), c.set([]), l.set(void 0), y.set(void 0);
1935
+ }, "resetState"), S, v = /* @__PURE__ */ n((d, m) => {
1936
+ let f = "scrollIntoView-highlight";
1937
+ clearTimeout(S), F(f);
1938
+ let x = t.querySelector(d);
1939
+ if (!x) {
1940
+ console.warn(`Cannot scroll into view: ${d} not found`);
1941
+ return;
1942
+ }
1943
+ x.scrollIntoView({ behavior: "smooth", block: "center", ...m });
1944
+ let g = `kf-${Math.random().toString(36).substring(2, 15)}`;
1945
+ r.set((E) => [
1946
+ ...E,
1947
+ {
1948
+ id: f,
1949
+ priority: 1e3,
1950
+ selectors: [d],
1951
+ styles: {
1952
+ outline: "2px solid #1EA7FD",
1953
+ outlineOffset: "-1px",
1954
+ animation: `${g} 3s linear forwards`
1955
+ },
1956
+ keyframes: `@keyframes ${g} {
1957
+ 0% { outline: 2px solid #1EA7FD; }
1958
+ 20% { outline: 2px solid #1EA7FD00; }
1959
+ 40% { outline: 2px solid #1EA7FD; }
1960
+ 60% { outline: 2px solid #1EA7FD00; }
1961
+ 80% { outline: 2px solid #1EA7FD; }
1962
+ 100% { outline: 2px solid #1EA7FD00; }
1963
+ }`
1964
+ }
1965
+ ]), S = setTimeout(() => F(f), 3500);
1966
+ }, "scrollIntoView"), w = /* @__PURE__ */ n((d) => {
1967
+ requestAnimationFrame(() => a.set({ x: d.pageX, y: d.pageY }));
1968
+ }, "onMouseMove");
1969
+ t.body.addEventListener("mousemove", w), e.on(rr, O), e.on(or, F), e.on(nr, A), e.on(ir, v), e.on(qo, ({ newPhase: d }) => {
1970
+ d === "loading" && A();
1971
+ });
1972
+ }, "useHighlights");
1973
+
1974
+ // src/highlight/preview.ts
1975
+ globalThis?.FEATURES?.highlight && ur?.ready && ur.ready().then(mr);
1976
+ var st = /* @__PURE__ */ n(() => Zo({}), "default");
1977
+
1978
+ // src/measure/preview.ts
1979
+ import { definePreviewAddon as yn } from "storybook/internal/csf";
1980
+
1981
+ // src/measure/constants.ts
1982
+ var xe = "storybook/measure-addon", Hp = `${xe}/tool`, fr = "measureEnabled", Np = {
1983
+ RESULT: `${xe}/result`,
1984
+ REQUEST: `${xe}/request`,
1985
+ CLEAR: `${xe}/clear`
1986
+ };
1987
+
1988
+ // src/measure/withMeasure.ts
1989
+ import { useEffect as kr } from "storybook/preview-api";
1990
+
1991
+ // src/measure/box-model/canvas.ts
1992
+ import { global as be } from "@storybook/global";
1993
+ function yr() {
1994
+ let e = be.document.documentElement, t = Math.max(e.scrollHeight, e.offsetHeight);
1995
+ return { width: Math.max(e.scrollWidth, e.offsetWidth), height: t };
1996
+ }
1997
+ n(yr, "getDocumentWidthAndHeight");
1998
+ function Jo() {
1999
+ let e = be.document.createElement("canvas");
2000
+ e.id = "storybook-addon-measure";
2001
+ let t = e.getContext("2d");
2002
+ ye(t != null);
2003
+ let { width: r, height: o } = yr();
2004
+ return at(e, t, { width: r, height: o }), e.style.position = "absolute", e.style.left = "0", e.style.top = "0", e.style.zIndex = "21474836\
2005
+ 47", e.style.pointerEvents = "none", be.document.body.appendChild(e), { canvas: e, context: t, width: r, height: o };
2006
+ }
2007
+ n(Jo, "createCanvas");
2008
+ function at(e, t, { width: r, height: o }) {
2009
+ e.style.width = `${r}px`, e.style.height = `${o}px`;
2010
+ let i = be.window.devicePixelRatio;
2011
+ e.width = Math.floor(r * i), e.height = Math.floor(o * i), t.scale(i, i);
1109
2012
  }
1110
- s(vr, "runStory");
2013
+ n(at, "setCanvasWidthAndHeight");
2014
+ var $ = {};
2015
+ function gr() {
2016
+ $.canvas || ($ = Jo());
2017
+ }
2018
+ n(gr, "init");
2019
+ function hr() {
2020
+ $.context && $.context.clearRect(0, 0, $.width ?? 0, $.height ?? 0);
2021
+ }
2022
+ n(hr, "clear");
2023
+ function xr(e) {
2024
+ hr(), e($.context);
2025
+ }
2026
+ n(xr, "draw");
2027
+ function br() {
2028
+ ye($.canvas, "Canvas should exist in the state."), ye($.context, "Context should exist in the state."), at($.canvas, $.context, { width: 0,
2029
+ height: 0 });
2030
+ let { width: e, height: t } = yr();
2031
+ at($.canvas, $.context, { width: e, height: t }), $.width = e, $.height = t;
2032
+ }
2033
+ n(br, "rescale");
2034
+ function Tr() {
2035
+ $.canvas && (hr(), $.canvas.parentNode?.removeChild($.canvas), $ = {});
2036
+ }
2037
+ n(Tr, "destroy");
2038
+
2039
+ // src/measure/box-model/visualizer.ts
2040
+ import { global as j } from "@storybook/global";
2041
+
2042
+ // src/measure/box-model/labels.ts
2043
+ var J = {
2044
+ margin: "#f6b26b",
2045
+ border: "#ffe599",
2046
+ padding: "#93c47d",
2047
+ content: "#6fa8dc",
2048
+ text: "#232020"
2049
+ }, G = 6;
2050
+ function Sr(e, { x: t, y: r, w: o, h: i, r: s }) {
2051
+ t = t - o / 2, r = r - i / 2, o < 2 * s && (s = o / 2), i < 2 * s && (s = i / 2), e.beginPath(), e.moveTo(t + s, r), e.arcTo(t + o, r, t +
2052
+ o, r + i, s), e.arcTo(t + o, r + i, t, r + i, s), e.arcTo(t, r + i, t, r, s), e.arcTo(t, r, t + o, r, s), e.closePath();
2053
+ }
2054
+ n(Sr, "roundedRect");
2055
+ function Qo(e, { padding: t, border: r, width: o, height: i, top: s, left: a }) {
2056
+ let p = o - r.left - r.right - t.left - t.right, c = i - t.top - t.bottom - r.top - r.bottom, l = a + r.left + t.left, y = s + r.top + t.top;
2057
+ return e === "top" ? l += p / 2 : e === "right" ? (l += p, y += c / 2) : e === "bottom" ? (l += p / 2, y += c) : e === "left" ? y += c / 2 :
2058
+ e === "center" && (l += p / 2, y += c / 2), { x: l, y };
2059
+ }
2060
+ n(Qo, "positionCoordinate");
2061
+ function en(e, t, { margin: r, border: o, padding: i }, s, a) {
2062
+ let p = /* @__PURE__ */ n((h) => 0, "shift"), c = 0, l = 0, y = a ? 1 : 0.5, u = a ? s * 2 : 0;
2063
+ return e === "padding" ? p = /* @__PURE__ */ n((h) => i[h] * y + u, "shift") : e === "border" ? p = /* @__PURE__ */ n((h) => i[h] + o[h] *
2064
+ y + u, "shift") : e === "margin" && (p = /* @__PURE__ */ n((h) => i[h] + o[h] + r[h] * y + u, "shift")), t === "top" ? l = -p("top") : t ===
2065
+ "right" ? c = p("right") : t === "bottom" ? l = p("bottom") : t === "left" && (c = -p("left")), { offsetX: c, offsetY: l };
2066
+ }
2067
+ n(en, "offset");
2068
+ function tn(e, t) {
2069
+ return Math.abs(e.x - t.x) < Math.abs(e.w + t.w) / 2 && Math.abs(e.y - t.y) < Math.abs(e.h + t.h) / 2;
2070
+ }
2071
+ n(tn, "collide");
2072
+ function rn(e, t, r) {
2073
+ return e === "top" ? t.y = r.y - r.h - G : e === "right" ? t.x = r.x + r.w / 2 + G + t.w / 2 : e === "bottom" ? t.y = r.y + r.h + G : e ===
2074
+ "left" && (t.x = r.x - r.w / 2 - G - t.w / 2), { x: t.x, y: t.y };
2075
+ }
2076
+ n(rn, "overlapAdjustment");
2077
+ function Ar(e, t, { x: r, y: o, w: i, h: s }, a) {
2078
+ return Sr(e, { x: r, y: o, w: i, h: s, r: 3 }), e.fillStyle = `${J[t]}dd`, e.fill(), e.strokeStyle = J[t], e.stroke(), e.fillStyle = J.text,
2079
+ e.fillText(a, r, o), Sr(e, { x: r, y: o, w: i, h: s, r: 3 }), e.fillStyle = `${J[t]}dd`, e.fill(), e.strokeStyle = J[t], e.stroke(), e.fillStyle =
2080
+ J.text, e.fillText(a, r, o), { x: r, y: o, w: i, h: s };
2081
+ }
2082
+ n(Ar, "textWithRect");
2083
+ function Rr(e, t) {
2084
+ e.font = "600 12px monospace", e.textBaseline = "middle", e.textAlign = "center";
2085
+ let r = e.measureText(t), o = r.actualBoundingBoxAscent + r.actualBoundingBoxDescent, i = r.width + G * 2, s = o + G * 2;
2086
+ return { w: i, h: s };
2087
+ }
2088
+ n(Rr, "configureText");
2089
+ function on(e, t, { type: r, position: o = "center", text: i }, s, a = !1) {
2090
+ let { x: p, y: c } = Qo(o, t), { offsetX: l, offsetY: y } = en(r, o, t, G + 1, a);
2091
+ p += l, c += y;
2092
+ let { w: u, h } = Rr(e, i);
2093
+ if (s && tn({ x: p, y: c, w: u, h }, s)) {
2094
+ let T = rn(o, { x: p, y: c, w: u, h }, s);
2095
+ p = T.x, c = T.y;
2096
+ }
2097
+ return Ar(e, r, { x: p, y: c, w: u, h }, i);
2098
+ }
2099
+ n(on, "drawLabel");
2100
+ function nn(e, { w: t, h: r }) {
2101
+ let o = t * 0.5 + G, i = r * 0.5 + G;
2102
+ return {
2103
+ offsetX: (e.x === "left" ? -1 : 1) * o,
2104
+ offsetY: (e.y === "top" ? -1 : 1) * i
2105
+ };
2106
+ }
2107
+ n(nn, "floatingOffset");
2108
+ function sn(e, t, { type: r, text: o }) {
2109
+ let { floatingAlignment: i, extremities: s } = t, a = s[i.x], p = s[i.y], { w: c, h: l } = Rr(e, o), { offsetX: y, offsetY: u } = nn(i, {
2110
+ w: c,
2111
+ h: l
2112
+ });
2113
+ return a += y, p += u, Ar(e, r, { x: a, y: p, w: c, h: l }, o);
2114
+ }
2115
+ n(sn, "drawFloatingLabel");
2116
+ function pe(e, t, r, o) {
2117
+ let i = [];
2118
+ r.forEach((s, a) => {
2119
+ let p = o && s.position === "center" ? sn(e, t, s) : on(e, t, s, i[a - 1], o);
2120
+ i[a] = p;
2121
+ });
2122
+ }
2123
+ n(pe, "drawStack");
2124
+ function wr(e, t, r, o) {
2125
+ let i = r.reduce((s, a) => (Object.prototype.hasOwnProperty.call(s, a.position) || (s[a.position] = []), s[a.position]?.push(a), s), {});
2126
+ i.top && pe(e, t, i.top, o), i.right && pe(e, t, i.right, o), i.bottom && pe(e, t, i.bottom, o), i.left && pe(e, t, i.left, o), i.center &&
2127
+ pe(e, t, i.center, o);
2128
+ }
2129
+ n(wr, "labelStacks");
2130
+
2131
+ // src/measure/box-model/visualizer.ts
2132
+ var Te = {
2133
+ margin: "#f6b26ba8",
2134
+ border: "#ffe599a8",
2135
+ padding: "#93c47d8c",
2136
+ content: "#6fa8dca8"
2137
+ }, Er = 30;
2138
+ function _(e) {
2139
+ return parseInt(e.replace("px", ""), 10);
2140
+ }
2141
+ n(_, "pxToNumber");
2142
+ function Q(e) {
2143
+ return Number.isInteger(e) ? e : e.toFixed(2);
2144
+ }
2145
+ n(Q, "round");
2146
+ function pt(e) {
2147
+ return e.filter((t) => t.text !== 0 && t.text !== "0");
2148
+ }
2149
+ n(pt, "filterZeroValues");
2150
+ function an(e) {
2151
+ let t = {
2152
+ top: j.window.scrollY,
2153
+ bottom: j.window.scrollY + j.window.innerHeight,
2154
+ left: j.window.scrollX,
2155
+ right: j.window.scrollX + j.window.innerWidth
2156
+ }, r = {
2157
+ top: Math.abs(t.top - e.top),
2158
+ bottom: Math.abs(t.bottom - e.bottom),
2159
+ left: Math.abs(t.left - e.left),
2160
+ right: Math.abs(t.right - e.right)
2161
+ };
2162
+ return {
2163
+ x: r.left > r.right ? "left" : "right",
2164
+ y: r.top > r.bottom ? "top" : "bottom"
2165
+ };
2166
+ }
2167
+ n(an, "floatingAlignment");
2168
+ function pn(e) {
2169
+ let t = j.getComputedStyle(e), { top: r, left: o, right: i, bottom: s, width: a, height: p } = e.getBoundingClientRect(), {
2170
+ marginTop: c,
2171
+ marginBottom: l,
2172
+ marginLeft: y,
2173
+ marginRight: u,
2174
+ paddingTop: h,
2175
+ paddingBottom: T,
2176
+ paddingLeft: R,
2177
+ paddingRight: P,
2178
+ borderBottomWidth: L,
2179
+ borderTopWidth: O,
2180
+ borderLeftWidth: F,
2181
+ borderRightWidth: A
2182
+ } = t;
2183
+ r = r + j.window.scrollY, o = o + j.window.scrollX, s = s + j.window.scrollY, i = i + j.window.scrollX;
2184
+ let S = {
2185
+ top: _(c),
2186
+ bottom: _(l),
2187
+ left: _(y),
2188
+ right: _(u)
2189
+ }, v = {
2190
+ top: _(h),
2191
+ bottom: _(T),
2192
+ left: _(R),
2193
+ right: _(P)
2194
+ }, w = {
2195
+ top: _(O),
2196
+ bottom: _(L),
2197
+ left: _(F),
2198
+ right: _(A)
2199
+ }, d = {
2200
+ top: r - S.top,
2201
+ bottom: s + S.bottom,
2202
+ left: o - S.left,
2203
+ right: i + S.right
2204
+ };
2205
+ return {
2206
+ margin: S,
2207
+ padding: v,
2208
+ border: w,
2209
+ top: r,
2210
+ left: o,
2211
+ bottom: s,
2212
+ right: i,
2213
+ width: a,
2214
+ height: p,
2215
+ extremities: d,
2216
+ floatingAlignment: an(d)
2217
+ };
2218
+ }
2219
+ n(pn, "measureElement");
2220
+ function ln(e, { margin: t, width: r, height: o, top: i, left: s, bottom: a, right: p }) {
2221
+ let c = o + t.bottom + t.top;
2222
+ e.fillStyle = Te.margin, e.fillRect(s, i - t.top, r, t.top), e.fillRect(p, i - t.top, t.right, c), e.fillRect(s, a, r, t.bottom), e.fillRect(
2223
+ s - t.left, i - t.top, t.left, c);
2224
+ let l = [
2225
+ {
2226
+ type: "margin",
2227
+ text: Q(t.top),
2228
+ position: "top"
2229
+ },
2230
+ {
2231
+ type: "margin",
2232
+ text: Q(t.right),
2233
+ position: "right"
2234
+ },
2235
+ {
2236
+ type: "margin",
2237
+ text: Q(t.bottom),
2238
+ position: "bottom"
2239
+ },
2240
+ {
2241
+ type: "margin",
2242
+ text: Q(t.left),
2243
+ position: "left"
2244
+ }
2245
+ ];
2246
+ return pt(l);
2247
+ }
2248
+ n(ln, "drawMargin");
2249
+ function cn(e, { padding: t, border: r, width: o, height: i, top: s, left: a, bottom: p, right: c }) {
2250
+ let l = o - r.left - r.right, y = i - t.top - t.bottom - r.top - r.bottom;
2251
+ e.fillStyle = Te.padding, e.fillRect(a + r.left, s + r.top, l, t.top), e.fillRect(
2252
+ c - t.right - r.right,
2253
+ s + t.top + r.top,
2254
+ t.right,
2255
+ y
2256
+ ), e.fillRect(
2257
+ a + r.left,
2258
+ p - t.bottom - r.bottom,
2259
+ l,
2260
+ t.bottom
2261
+ ), e.fillRect(a + r.left, s + t.top + r.top, t.left, y);
2262
+ let u = [
2263
+ {
2264
+ type: "padding",
2265
+ text: t.top,
2266
+ position: "top"
2267
+ },
2268
+ {
2269
+ type: "padding",
2270
+ text: t.right,
2271
+ position: "right"
2272
+ },
2273
+ {
2274
+ type: "padding",
2275
+ text: t.bottom,
2276
+ position: "bottom"
2277
+ },
2278
+ {
2279
+ type: "padding",
2280
+ text: t.left,
2281
+ position: "left"
2282
+ }
2283
+ ];
2284
+ return pt(u);
2285
+ }
2286
+ n(cn, "drawPadding");
2287
+ function dn(e, { border: t, width: r, height: o, top: i, left: s, bottom: a, right: p }) {
2288
+ let c = o - t.top - t.bottom;
2289
+ e.fillStyle = Te.border, e.fillRect(s, i, r, t.top), e.fillRect(s, a - t.bottom, r, t.bottom), e.fillRect(s, i + t.top, t.left, c), e.fillRect(
2290
+ p - t.right, i + t.top, t.right, c);
2291
+ let l = [
2292
+ {
2293
+ type: "border",
2294
+ text: t.top,
2295
+ position: "top"
2296
+ },
2297
+ {
2298
+ type: "border",
2299
+ text: t.right,
2300
+ position: "right"
2301
+ },
2302
+ {
2303
+ type: "border",
2304
+ text: t.bottom,
2305
+ position: "bottom"
2306
+ },
2307
+ {
2308
+ type: "border",
2309
+ text: t.left,
2310
+ position: "left"
2311
+ }
2312
+ ];
2313
+ return pt(l);
2314
+ }
2315
+ n(dn, "drawBorder");
2316
+ function mn(e, { padding: t, border: r, width: o, height: i, top: s, left: a }) {
2317
+ let p = o - r.left - r.right - t.left - t.right, c = i - t.top - t.bottom - r.top - r.bottom;
2318
+ return e.fillStyle = Te.content, e.fillRect(
2319
+ a + r.left + t.left,
2320
+ s + r.top + t.top,
2321
+ p,
2322
+ c
2323
+ ), [
2324
+ {
2325
+ type: "content",
2326
+ position: "center",
2327
+ text: `${Q(p)} x ${Q(c)}`
2328
+ }
2329
+ ];
2330
+ }
2331
+ n(mn, "drawContent");
2332
+ function un(e) {
2333
+ return (t) => {
2334
+ if (e && t) {
2335
+ let r = pn(e), o = ln(t, r), i = cn(t, r), s = dn(t, r), a = mn(t, r), p = r.width <= Er * 3 || r.height <= Er;
2336
+ wr(
2337
+ t,
2338
+ r,
2339
+ [...a, ...i, ...s, ...o],
2340
+ p
2341
+ );
2342
+ }
2343
+ };
2344
+ }
2345
+ n(un, "drawBoxModel");
2346
+ function Cr(e) {
2347
+ xr(un(e));
2348
+ }
2349
+ n(Cr, "drawSelectedElement");
2350
+
2351
+ // src/measure/util.ts
2352
+ import { global as fn } from "@storybook/global";
2353
+ var vr = /* @__PURE__ */ n((e, t) => {
2354
+ let r = fn.document.elementFromPoint(e, t), o = /* @__PURE__ */ n((s) => {
2355
+ if (s && s.shadowRoot) {
2356
+ let a = s.shadowRoot.elementFromPoint(e, t);
2357
+ return s.isEqualNode(a) ? s : a.shadowRoot ? o(a) : a;
2358
+ }
2359
+ return s;
2360
+ }, "crawlShadows");
2361
+ return o(r) || r;
2362
+ }, "deepElementFromPoint");
2363
+
2364
+ // src/measure/withMeasure.ts
2365
+ var Pr, Se = { x: 0, y: 0 };
2366
+ function Or(e, t) {
2367
+ Pr = vr(e, t), Cr(Pr);
2368
+ }
2369
+ n(Or, "findAndDrawElement");
2370
+ var Mr = /* @__PURE__ */ n((e, t) => {
2371
+ let { measureEnabled: r } = t.globals || {};
2372
+ return kr(() => {
2373
+ if (typeof globalThis.document > "u")
2374
+ return;
2375
+ let o = /* @__PURE__ */ n((i) => {
2376
+ window.requestAnimationFrame(() => {
2377
+ i.stopPropagation(), Se.x = i.clientX, Se.y = i.clientY;
2378
+ });
2379
+ }, "onPointerMove");
2380
+ return globalThis.document.addEventListener("pointermove", o), () => {
2381
+ globalThis.document.removeEventListener("pointermove", o);
2382
+ };
2383
+ }, []), kr(() => {
2384
+ let o = /* @__PURE__ */ n((s) => {
2385
+ window.requestAnimationFrame(() => {
2386
+ s.stopPropagation(), Or(s.clientX, s.clientY);
2387
+ });
2388
+ }, "onPointerOver"), i = /* @__PURE__ */ n(() => {
2389
+ window.requestAnimationFrame(() => {
2390
+ br();
2391
+ });
2392
+ }, "onResize");
2393
+ return t.viewMode === "story" && r && (globalThis.document.addEventListener("pointerover", o), gr(), globalThis.window.addEventListener(
2394
+ "resize", i), Or(Se.x, Se.y)), () => {
2395
+ globalThis.window.removeEventListener("resize", i), Tr();
2396
+ };
2397
+ }, [r, t.viewMode]), e();
2398
+ }, "withMeasure");
2399
+
2400
+ // src/measure/preview.ts
2401
+ var gn = globalThis.FEATURES?.measure ? [Mr] : [], hn = {
2402
+ [fr]: !1
2403
+ }, lt = /* @__PURE__ */ n(() => yn({
2404
+ decorators: gn,
2405
+ initialGlobals: hn
2406
+ }), "default");
2407
+
2408
+ // src/outline/preview.ts
2409
+ import { definePreviewAddon as Sn } from "storybook/internal/csf";
2410
+
2411
+ // src/outline/constants.ts
2412
+ var Ae = "outline";
2413
+
2414
+ // src/outline/withOutline.ts
2415
+ import { useEffect as bn, useMemo as Tn } from "storybook/preview-api";
2416
+
2417
+ // src/outline/helpers.ts
2418
+ import { global as Re } from "@storybook/global";
2419
+ var ct = /* @__PURE__ */ n((e) => {
2420
+ (Array.isArray(e) ? e : [e]).forEach(xn);
2421
+ }, "clearStyles"), xn = /* @__PURE__ */ n((e) => {
2422
+ let t = typeof e == "string" ? e : e.join(""), r = Re.document.getElementById(t);
2423
+ r && r.parentElement && r.parentElement.removeChild(r);
2424
+ }, "clearStyle"), $r = /* @__PURE__ */ n((e, t) => {
2425
+ let r = Re.document.getElementById(e);
2426
+ if (r)
2427
+ r.innerHTML !== t && (r.innerHTML = t);
2428
+ else {
2429
+ let o = Re.document.createElement("style");
2430
+ o.setAttribute("id", e), o.innerHTML = t, Re.document.head.appendChild(o);
2431
+ }
2432
+ }, "addOutlineStyles");
2433
+
2434
+ // src/outline/outlineCSS.ts
2435
+ function dt(e) {
2436
+ return W`
2437
+ ${e} body {
2438
+ outline: 1px solid #2980b9 !important;
2439
+ }
2440
+
2441
+ ${e} article {
2442
+ outline: 1px solid #3498db !important;
2443
+ }
2444
+
2445
+ ${e} nav {
2446
+ outline: 1px solid #0088c3 !important;
2447
+ }
2448
+
2449
+ ${e} aside {
2450
+ outline: 1px solid #33a0ce !important;
2451
+ }
2452
+
2453
+ ${e} section {
2454
+ outline: 1px solid #66b8da !important;
2455
+ }
2456
+
2457
+ ${e} header {
2458
+ outline: 1px solid #99cfe7 !important;
2459
+ }
2460
+
2461
+ ${e} footer {
2462
+ outline: 1px solid #cce7f3 !important;
2463
+ }
2464
+
2465
+ ${e} h1 {
2466
+ outline: 1px solid #162544 !important;
2467
+ }
2468
+
2469
+ ${e} h2 {
2470
+ outline: 1px solid #314e6e !important;
2471
+ }
2472
+
2473
+ ${e} h3 {
2474
+ outline: 1px solid #3e5e85 !important;
2475
+ }
2476
+
2477
+ ${e} h4 {
2478
+ outline: 1px solid #449baf !important;
2479
+ }
2480
+
2481
+ ${e} h5 {
2482
+ outline: 1px solid #c7d1cb !important;
2483
+ }
2484
+
2485
+ ${e} h6 {
2486
+ outline: 1px solid #4371d0 !important;
2487
+ }
2488
+
2489
+ ${e} main {
2490
+ outline: 1px solid #2f4f90 !important;
2491
+ }
2492
+
2493
+ ${e} address {
2494
+ outline: 1px solid #1a2c51 !important;
2495
+ }
2496
+
2497
+ ${e} div {
2498
+ outline: 1px solid #036cdb !important;
2499
+ }
2500
+
2501
+ ${e} p {
2502
+ outline: 1px solid #ac050b !important;
2503
+ }
2504
+
2505
+ ${e} hr {
2506
+ outline: 1px solid #ff063f !important;
2507
+ }
2508
+
2509
+ ${e} pre {
2510
+ outline: 1px solid #850440 !important;
2511
+ }
2512
+
2513
+ ${e} blockquote {
2514
+ outline: 1px solid #f1b8e7 !important;
2515
+ }
2516
+
2517
+ ${e} ol {
2518
+ outline: 1px solid #ff050c !important;
2519
+ }
2520
+
2521
+ ${e} ul {
2522
+ outline: 1px solid #d90416 !important;
2523
+ }
2524
+
2525
+ ${e} li {
2526
+ outline: 1px solid #d90416 !important;
2527
+ }
2528
+
2529
+ ${e} dl {
2530
+ outline: 1px solid #fd3427 !important;
2531
+ }
2532
+
2533
+ ${e} dt {
2534
+ outline: 1px solid #ff0043 !important;
2535
+ }
2536
+
2537
+ ${e} dd {
2538
+ outline: 1px solid #e80174 !important;
2539
+ }
2540
+
2541
+ ${e} figure {
2542
+ outline: 1px solid #ff00bb !important;
2543
+ }
2544
+
2545
+ ${e} figcaption {
2546
+ outline: 1px solid #bf0032 !important;
2547
+ }
2548
+
2549
+ ${e} table {
2550
+ outline: 1px solid #00cc99 !important;
2551
+ }
2552
+
2553
+ ${e} caption {
2554
+ outline: 1px solid #37ffc4 !important;
2555
+ }
2556
+
2557
+ ${e} thead {
2558
+ outline: 1px solid #98daca !important;
2559
+ }
2560
+
2561
+ ${e} tbody {
2562
+ outline: 1px solid #64a7a0 !important;
2563
+ }
2564
+
2565
+ ${e} tfoot {
2566
+ outline: 1px solid #22746b !important;
2567
+ }
2568
+
2569
+ ${e} tr {
2570
+ outline: 1px solid #86c0b2 !important;
2571
+ }
2572
+
2573
+ ${e} th {
2574
+ outline: 1px solid #a1e7d6 !important;
2575
+ }
2576
+
2577
+ ${e} td {
2578
+ outline: 1px solid #3f5a54 !important;
2579
+ }
2580
+
2581
+ ${e} col {
2582
+ outline: 1px solid #6c9a8f !important;
2583
+ }
2584
+
2585
+ ${e} colgroup {
2586
+ outline: 1px solid #6c9a9d !important;
2587
+ }
2588
+
2589
+ ${e} button {
2590
+ outline: 1px solid #da8301 !important;
2591
+ }
2592
+
2593
+ ${e} datalist {
2594
+ outline: 1px solid #c06000 !important;
2595
+ }
2596
+
2597
+ ${e} fieldset {
2598
+ outline: 1px solid #d95100 !important;
2599
+ }
2600
+
2601
+ ${e} form {
2602
+ outline: 1px solid #d23600 !important;
2603
+ }
2604
+
2605
+ ${e} input {
2606
+ outline: 1px solid #fca600 !important;
2607
+ }
2608
+
2609
+ ${e} keygen {
2610
+ outline: 1px solid #b31e00 !important;
2611
+ }
2612
+
2613
+ ${e} label {
2614
+ outline: 1px solid #ee8900 !important;
2615
+ }
2616
+
2617
+ ${e} legend {
2618
+ outline: 1px solid #de6d00 !important;
2619
+ }
2620
+
2621
+ ${e} meter {
2622
+ outline: 1px solid #e8630c !important;
2623
+ }
2624
+
2625
+ ${e} optgroup {
2626
+ outline: 1px solid #b33600 !important;
2627
+ }
2628
+
2629
+ ${e} option {
2630
+ outline: 1px solid #ff8a00 !important;
2631
+ }
2632
+
2633
+ ${e} output {
2634
+ outline: 1px solid #ff9619 !important;
2635
+ }
2636
+
2637
+ ${e} progress {
2638
+ outline: 1px solid #e57c00 !important;
2639
+ }
2640
+
2641
+ ${e} select {
2642
+ outline: 1px solid #e26e0f !important;
2643
+ }
2644
+
2645
+ ${e} textarea {
2646
+ outline: 1px solid #cc5400 !important;
2647
+ }
2648
+
2649
+ ${e} details {
2650
+ outline: 1px solid #33848f !important;
2651
+ }
2652
+
2653
+ ${e} summary {
2654
+ outline: 1px solid #60a1a6 !important;
2655
+ }
2656
+
2657
+ ${e} command {
2658
+ outline: 1px solid #438da1 !important;
2659
+ }
2660
+
2661
+ ${e} menu {
2662
+ outline: 1px solid #449da6 !important;
2663
+ }
2664
+
2665
+ ${e} del {
2666
+ outline: 1px solid #bf0000 !important;
2667
+ }
2668
+
2669
+ ${e} ins {
2670
+ outline: 1px solid #400000 !important;
2671
+ }
2672
+
2673
+ ${e} img {
2674
+ outline: 1px solid #22746b !important;
2675
+ }
2676
+
2677
+ ${e} iframe {
2678
+ outline: 1px solid #64a7a0 !important;
2679
+ }
2680
+
2681
+ ${e} embed {
2682
+ outline: 1px solid #98daca !important;
2683
+ }
2684
+
2685
+ ${e} object {
2686
+ outline: 1px solid #00cc99 !important;
2687
+ }
2688
+
2689
+ ${e} param {
2690
+ outline: 1px solid #37ffc4 !important;
2691
+ }
2692
+
2693
+ ${e} video {
2694
+ outline: 1px solid #6ee866 !important;
2695
+ }
2696
+
2697
+ ${e} audio {
2698
+ outline: 1px solid #027353 !important;
2699
+ }
2700
+
2701
+ ${e} source {
2702
+ outline: 1px solid #012426 !important;
2703
+ }
2704
+
2705
+ ${e} canvas {
2706
+ outline: 1px solid #a2f570 !important;
2707
+ }
2708
+
2709
+ ${e} track {
2710
+ outline: 1px solid #59a600 !important;
2711
+ }
2712
+
2713
+ ${e} map {
2714
+ outline: 1px solid #7be500 !important;
2715
+ }
2716
+
2717
+ ${e} area {
2718
+ outline: 1px solid #305900 !important;
2719
+ }
2720
+
2721
+ ${e} a {
2722
+ outline: 1px solid #ff62ab !important;
2723
+ }
2724
+
2725
+ ${e} em {
2726
+ outline: 1px solid #800b41 !important;
2727
+ }
2728
+
2729
+ ${e} strong {
2730
+ outline: 1px solid #ff1583 !important;
2731
+ }
2732
+
2733
+ ${e} i {
2734
+ outline: 1px solid #803156 !important;
2735
+ }
2736
+
2737
+ ${e} b {
2738
+ outline: 1px solid #cc1169 !important;
2739
+ }
2740
+
2741
+ ${e} u {
2742
+ outline: 1px solid #ff0430 !important;
2743
+ }
2744
+
2745
+ ${e} s {
2746
+ outline: 1px solid #f805e3 !important;
2747
+ }
2748
+
2749
+ ${e} small {
2750
+ outline: 1px solid #d107b2 !important;
2751
+ }
2752
+
2753
+ ${e} abbr {
2754
+ outline: 1px solid #4a0263 !important;
2755
+ }
2756
+
2757
+ ${e} q {
2758
+ outline: 1px solid #240018 !important;
2759
+ }
2760
+
2761
+ ${e} cite {
2762
+ outline: 1px solid #64003c !important;
2763
+ }
2764
+
2765
+ ${e} dfn {
2766
+ outline: 1px solid #b4005a !important;
2767
+ }
2768
+
2769
+ ${e} sub {
2770
+ outline: 1px solid #dba0c8 !important;
2771
+ }
2772
+
2773
+ ${e} sup {
2774
+ outline: 1px solid #cc0256 !important;
2775
+ }
2776
+
2777
+ ${e} time {
2778
+ outline: 1px solid #d6606d !important;
2779
+ }
2780
+
2781
+ ${e} code {
2782
+ outline: 1px solid #e04251 !important;
2783
+ }
2784
+
2785
+ ${e} kbd {
2786
+ outline: 1px solid #5e001f !important;
2787
+ }
2788
+
2789
+ ${e} samp {
2790
+ outline: 1px solid #9c0033 !important;
2791
+ }
2792
+
2793
+ ${e} var {
2794
+ outline: 1px solid #d90047 !important;
2795
+ }
2796
+
2797
+ ${e} mark {
2798
+ outline: 1px solid #ff0053 !important;
2799
+ }
2800
+
2801
+ ${e} bdi {
2802
+ outline: 1px solid #bf3668 !important;
2803
+ }
2804
+
2805
+ ${e} bdo {
2806
+ outline: 1px solid #6f1400 !important;
2807
+ }
2808
+
2809
+ ${e} ruby {
2810
+ outline: 1px solid #ff7b93 !important;
2811
+ }
2812
+
2813
+ ${e} rt {
2814
+ outline: 1px solid #ff2f54 !important;
2815
+ }
2816
+
2817
+ ${e} rp {
2818
+ outline: 1px solid #803e49 !important;
2819
+ }
2820
+
2821
+ ${e} span {
2822
+ outline: 1px solid #cc2643 !important;
2823
+ }
2824
+
2825
+ ${e} br {
2826
+ outline: 1px solid #db687d !important;
2827
+ }
2828
+
2829
+ ${e} wbr {
2830
+ outline: 1px solid #db175b !important;
2831
+ }`;
2832
+ }
2833
+ n(dt, "outlineCSS");
2834
+
2835
+ // src/outline/withOutline.ts
2836
+ var Fr = /* @__PURE__ */ n((e, t) => {
2837
+ let r = t.globals || {}, o = [!0, "true"].includes(r[Ae]), i = t.viewMode === "docs", s = Tn(() => dt(i ? '[data-story-block="true"]' : ".\
2838
+ sb-show-main"), [t]);
2839
+ return bn(() => {
2840
+ let a = i ? `addon-outline-docs-${t.id}` : "addon-outline";
2841
+ return o ? $r(a, s) : ct(a), () => {
2842
+ ct(a);
2843
+ };
2844
+ }, [o, s, t]), e();
2845
+ }, "withOutline");
2846
+
2847
+ // src/outline/preview.ts
2848
+ var An = globalThis.FEATURES?.outline ? [Fr] : [], Rn = {
2849
+ [Ae]: !1
2850
+ }, mt = /* @__PURE__ */ n(() => Sn({ decorators: An, initialGlobals: Rn }), "default");
2851
+
2852
+ // src/test/preview.ts
2853
+ import { definePreviewAddon as wn } from "storybook/internal/csf";
2854
+ import { instrument as En } from "storybook/internal/instrumenter";
2855
+ import {
2856
+ clearAllMocks as Cn,
2857
+ fn as vn,
2858
+ isMockFunction as kn,
2859
+ resetAllMocks as Pn,
2860
+ restoreAllMocks as On,
2861
+ uninstrumentedUserEvent as Mn,
2862
+ within as $n
2863
+ } from "storybook/test";
2864
+ var Fn = /* @__PURE__ */ n(({ parameters: e }) => {
2865
+ e?.test?.mockReset === !0 ? Pn() : e?.test?.clearMocks === !0 ? Cn() : e?.test?.restoreMocks !== !1 && On();
2866
+ }, "resetAllMocksLoader"), ut = /* @__PURE__ */ n((e, t = 0, r) => {
2867
+ if (t > 5 || e == null)
2868
+ return e;
2869
+ if (kn(e))
2870
+ return r && e.mockName(r), e;
2871
+ if (typeof e == "function" && "isAction" in e && e.isAction && !("implicit" in e && e.implicit)) {
2872
+ let o = vn(e);
2873
+ return r && o.mockName(r), o;
2874
+ }
2875
+ if (Array.isArray(e)) {
2876
+ t++;
2877
+ for (let o = 0; o < e.length; o++)
2878
+ Object.getOwnPropertyDescriptor(e, o)?.writable && (e[o] = ut(e[o], t));
2879
+ return e;
2880
+ }
2881
+ if (typeof e == "object" && e.constructor === Object) {
2882
+ t++;
2883
+ for (let [o, i] of Object.entries(e))
2884
+ Object.getOwnPropertyDescriptor(e, o)?.writable && (e[o] = ut(i, t, o));
2885
+ return e;
2886
+ }
2887
+ return e;
2888
+ }, "traverseArgs"), In = /* @__PURE__ */ n(({ initialArgs: e }) => {
2889
+ ut(e);
2890
+ }, "nameSpiesAndWrapActionsInSpies"), Ir = !1, Ln = /* @__PURE__ */ n(async (e) => {
2891
+ globalThis.HTMLElement && e.canvasElement instanceof globalThis.HTMLElement && (e.canvas = $n(e.canvasElement));
2892
+ let t = globalThis.window?.navigator?.clipboard;
2893
+ if (t) {
2894
+ e.userEvent = En(
2895
+ { userEvent: Mn.setup() },
2896
+ { intercept: !0 }
2897
+ ).userEvent, Object.defineProperty(globalThis.window.navigator, "clipboard", {
2898
+ get: /* @__PURE__ */ n(() => t, "get"),
2899
+ configurable: !0
2900
+ });
2901
+ let r = HTMLElement.prototype.focus;
2902
+ Ir || Object.defineProperties(HTMLElement.prototype, {
2903
+ focus: {
2904
+ configurable: !0,
2905
+ set: /* @__PURE__ */ n((o) => {
2906
+ r = o, Ir = !0;
2907
+ }, "set"),
2908
+ get: /* @__PURE__ */ n(() => r, "get")
2909
+ }
2910
+ });
2911
+ }
2912
+ }, "enhanceContext"), ft = /* @__PURE__ */ n(() => wn({
2913
+ loaders: [Fn, In, Ln]
2914
+ }), "default");
2915
+
2916
+ // src/viewport/preview.ts
2917
+ import { definePreviewAddon as Dn } from "storybook/internal/csf";
2918
+
2919
+ // src/viewport/constants.ts
2920
+ var Lr = "storybook/viewport", Dr = "viewport", Ll = `${Lr}/panel`, Dl = `${Lr}/tool`;
2921
+
2922
+ // src/viewport/preview.ts
2923
+ var _n = {
2924
+ [Dr]: { value: void 0, isRotated: !1 }
2925
+ }, yt = /* @__PURE__ */ n(() => Dn({
2926
+ initialGlobals: _n
2927
+ }), "default");
1111
2928
 
1112
2929
  // src/csf/core-annotations.ts
1113
- import je from "storybook/internal/component-testing/preview";
1114
- import Ie from "storybook/actions/preview";
1115
- import _e from "storybook/backgrounds/preview";
1116
- import Ne from "storybook/highlight/preview";
1117
- import De from "storybook/measure/preview";
1118
- import Me from "storybook/outline/preview";
1119
- import ze from "storybook/test/preview";
1120
- import Be from "storybook/viewport/preview";
1121
- function Ue() {
2930
+ function _r() {
1122
2931
  return [
1123
2932
  // @ts-expect-error CJS fallback
1124
- (De.default ?? De)(),
2933
+ (lt.default ?? lt)(),
1125
2934
  // @ts-expect-error CJS fallback
1126
- (_e.default ?? _e)(),
2935
+ (Je.default ?? Je)(),
1127
2936
  // @ts-expect-error CJS fallback
1128
- (Ne.default ?? Ne)(),
2937
+ (st.default ?? st)(),
1129
2938
  // @ts-expect-error CJS fallback
1130
- (Me.default ?? Me)(),
2939
+ (mt.default ?? mt)(),
1131
2940
  // @ts-expect-error CJS fallback
1132
- (Be.default ?? Be)(),
2941
+ (yt.default ?? yt)(),
1133
2942
  // @ts-expect-error CJS fallback
1134
- (Ie.default ?? Ie)(),
2943
+ (Xe.default ?? Xe)(),
1135
2944
  // @ts-expect-error CJS fallback
1136
- (je.default ?? je)(),
2945
+ (Qe.default ?? Qe)(),
1137
2946
  // @ts-expect-error CJS fallback
1138
- (ze.default ?? ze)()
2947
+ (ft.default ?? ft)()
1139
2948
  ];
1140
2949
  }
1141
- s(Ue, "getCoreAnnotations");
2950
+ n(_r, "getCoreAnnotations");
1142
2951
 
1143
2952
  // src/csf/csf-factories.ts
1144
- function zn(e) {
1145
- let r, t = {
2953
+ function tc(e) {
2954
+ let t, r = {
1146
2955
  _tag: "Preview",
1147
2956
  input: e,
1148
2957
  get composed() {
1149
- if (r)
1150
- return r;
1151
- let { addons: o, ...a } = e;
1152
- return r = _(
1153
- M([...Ue(), ...o ?? [], a])
1154
- ), r;
2958
+ if (t)
2959
+ return t;
2960
+ let { addons: o, ...i } = e;
2961
+ return t = te(
2962
+ ne([..._r(), ...o ?? [], i])
2963
+ ), t;
1155
2964
  },
1156
2965
  meta(o) {
1157
- return Or(o, this);
2966
+ return Nn(o, this);
1158
2967
  }
1159
2968
  };
1160
- return globalThis.globalProjectAnnotations = t.composed, t;
2969
+ return globalThis.globalProjectAnnotations = r.composed, r;
1161
2970
  }
1162
- s(zn, "definePreview");
1163
- function Bn(e) {
2971
+ n(tc, "definePreview");
2972
+ function rc(e) {
1164
2973
  return e;
1165
2974
  }
1166
- s(Bn, "definePreviewAddon");
1167
- function Un(e) {
2975
+ n(rc, "definePreviewAddon");
2976
+ function oc(e) {
1168
2977
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Preview";
1169
2978
  }
1170
- s(Un, "isPreview");
1171
- function Hn(e) {
2979
+ n(oc, "isPreview");
2980
+ function nc(e) {
1172
2981
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Meta";
1173
2982
  }
1174
- s(Hn, "isMeta");
1175
- function Or(e, r) {
2983
+ n(nc, "isMeta");
2984
+ function Nn(e, t) {
1176
2985
  return {
1177
2986
  _tag: "Meta",
1178
2987
  input: e,
1179
- preview: r,
2988
+ preview: t,
1180
2989
  get composed() {
1181
2990
  throw new Error("Not implemented");
1182
2991
  },
1183
2992
  // @ts-expect-error hard
1184
- story(t = {}) {
1185
- return He(typeof t == "function" ? { render: t } : t, this);
2993
+ story(r = {}) {
2994
+ return Hr(typeof r == "function" ? { render: r } : r, this);
1186
2995
  }
1187
2996
  };
1188
2997
  }
1189
- s(Or, "defineMeta");
1190
- function $n(e) {
2998
+ n(Nn, "defineMeta");
2999
+ function ic(e) {
1191
3000
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Story";
1192
3001
  }
1193
- s($n, "isStory");
1194
- function He(e, r) {
1195
- let t, o = /* @__PURE__ */ s(() => (t || (t = de(
3002
+ n(ic, "isStory");
3003
+ function Hr(e, t) {
3004
+ let r, o = /* @__PURE__ */ n(() => (r || (r = We(
1196
3005
  e,
1197
- r.input,
3006
+ t.input,
1198
3007
  void 0,
1199
- r.preview.composed
1200
- )), t), "compose");
3008
+ t.preview.composed
3009
+ )), r), "compose");
1201
3010
  return {
1202
3011
  _tag: "Story",
1203
3012
  input: e,
1204
- meta: r,
3013
+ meta: t,
1205
3014
  __compose: o,
1206
3015
  get composed() {
1207
- let a = o(), { args: n, argTypes: i, parameters: p, id: d, tags: c, globals: m, storyName: f } = a;
1208
- return { args: n, argTypes: i, parameters: p, id: d, tags: c, name: f, globals: m };
3016
+ let i = o(), { args: s, argTypes: a, parameters: p, id: c, tags: l, globals: y, storyName: u } = i;
3017
+ return { args: s, argTypes: a, parameters: p, id: c, tags: l, name: u, globals: y };
1209
3018
  },
1210
3019
  get play() {
1211
- return e.play ?? r.input?.play ?? (async () => {
3020
+ return e.play ?? t.input?.play ?? (async () => {
1212
3021
  });
1213
3022
  },
1214
3023
  get run() {
1215
3024
  return o().run ?? (async () => {
1216
3025
  });
1217
3026
  },
1218
- extend(a) {
1219
- return He(
3027
+ extend(i) {
3028
+ return Hr(
1220
3029
  {
1221
3030
  ...this.input,
1222
- ...a,
1223
- args: { ...this.input.args, ...a.args },
1224
- argTypes: x(this.input.argTypes, a.argTypes),
3031
+ ...i,
3032
+ args: { ...this.input.args, ...i.args },
3033
+ argTypes: D(this.input.argTypes, i.argTypes),
1225
3034
  afterEach: [
1226
- ...l(this.input?.afterEach ?? []),
1227
- ...l(a.afterEach ?? [])
3035
+ ...b(this.input?.afterEach ?? []),
3036
+ ...b(i.afterEach ?? [])
1228
3037
  ],
1229
3038
  beforeEach: [
1230
- ...l(this.input?.beforeEach ?? []),
1231
- ...l(a.beforeEach ?? [])
3039
+ ...b(this.input?.beforeEach ?? []),
3040
+ ...b(i.beforeEach ?? [])
1232
3041
  ],
1233
3042
  decorators: [
1234
- ...l(this.input?.decorators ?? []),
1235
- ...l(a.decorators ?? [])
3043
+ ...b(this.input?.decorators ?? []),
3044
+ ...b(i.decorators ?? [])
1236
3045
  ],
1237
- globals: { ...this.input.globals, ...a.globals },
3046
+ globals: { ...this.input.globals, ...i.globals },
1238
3047
  loaders: [
1239
- ...l(this.input?.loaders ?? []),
1240
- ...l(a.loaders ?? [])
3048
+ ...b(this.input?.loaders ?? []),
3049
+ ...b(i.loaders ?? [])
1241
3050
  ],
1242
- parameters: x(this.input.parameters, a.parameters),
1243
- tags: kr(...this.input.tags ?? [], ...a.tags ?? [])
3051
+ parameters: D(this.input.parameters, i.parameters),
3052
+ tags: Hn(...this.input.tags ?? [], ...i.tags ?? [])
1244
3053
  },
1245
3054
  this.meta
1246
3055
  );
1247
3056
  }
1248
3057
  };
1249
3058
  }
1250
- s(He, "defineStory");
3059
+ n(Hr, "defineStory");
1251
3060
 
1252
3061
  // src/csf/index.ts
1253
- var Fr = /* @__PURE__ */ s((e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g,
1254
- "-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize"), $e = /* @__PURE__ */ s((e, r) => {
1255
- let t = Fr(e);
1256
- if (t === "")
1257
- throw new Error(`Invalid ${r} '${e}', must include alphanumeric characters`);
1258
- return t;
1259
- }, "sanitizeSafe"), Vn = /* @__PURE__ */ s((e, r) => `${$e(e, "kind")}${r ? `--${$e(r, "name")}` : ""}`, "toId"), qn = /* @__PURE__ */ s((e) => le(
3062
+ var jn = /* @__PURE__ */ n((e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g,
3063
+ "-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize"), Nr = /* @__PURE__ */ n((e, t) => {
3064
+ let r = jn(e);
3065
+ if (r === "")
3066
+ throw new Error(`Invalid ${t} '${e}', must include alphanumeric characters`);
3067
+ return r;
3068
+ }, "sanitizeSafe"), lc = /* @__PURE__ */ n((e, t) => `${Nr(e, "kind")}${t ? `--${Nr(t, "name")}` : ""}`, "toId"), cc = /* @__PURE__ */ n((e) => bt(
1260
3069
  e), "storyNameFromExport");
1261
- function Le(e, r) {
1262
- return Array.isArray(r) ? r.includes(e) : e.match(r);
3070
+ function jr(e, t) {
3071
+ return Array.isArray(t) ? t.includes(e) : e.match(t);
1263
3072
  }
1264
- s(Le, "matches");
1265
- function Kn(e, { includeStories: r, excludeStories: t }) {
3073
+ n(jr, "matches");
3074
+ function dc(e, { includeStories: t, excludeStories: r }) {
1266
3075
  return (
1267
3076
  // https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs
1268
- e !== "__esModule" && (!r || Le(e, r)) && (!t || !Le(e, t))
3077
+ e !== "__esModule" && (!t || jr(e, t)) && (!r || !jr(e, r))
1269
3078
  );
1270
3079
  }
1271
- s(Kn, "isExportStory");
1272
- var Yn = /* @__PURE__ */ s((e, { rootSeparator: r, groupSeparator: t }) => {
1273
- let [o, a] = e.split(r, 2), n = (a || e).split(t).filter((i) => !!i);
3080
+ n(dc, "isExportStory");
3081
+ var mc = /* @__PURE__ */ n((e, { rootSeparator: t, groupSeparator: r }) => {
3082
+ let [o, i] = e.split(t, 2), s = (i || e).split(r).filter((a) => !!a);
1274
3083
  return {
1275
- root: a ? o : null,
1276
- groups: n
3084
+ root: i ? o : null,
3085
+ groups: s
1277
3086
  };
1278
- }, "parseKind"), Jn = /* @__PURE__ */ s((...e) => {
1279
- let r = e.reduce((t, o) => (o.startsWith("!") ? t.delete(o.slice(1)) : t.add(o), t), /* @__PURE__ */ new Set());
1280
- return Array.from(r);
3087
+ }, "parseKind"), uc = /* @__PURE__ */ n((...e) => {
3088
+ let t = e.reduce((r, o) => (o.startsWith("!") ? r.delete(o.slice(1)) : r.add(o), r), /* @__PURE__ */ new Set());
3089
+ return Array.from(t);
1281
3090
  }, "combineTags");
1282
3091
  export {
1283
- Jn as combineTags,
1284
- zn as definePreview,
1285
- Bn as definePreviewAddon,
1286
- Ue as getCoreAnnotations,
1287
- er as includeConditionalArg,
1288
- Kn as isExportStory,
1289
- Hn as isMeta,
1290
- Un as isPreview,
1291
- $n as isStory,
1292
- Yn as parseKind,
1293
- Fr as sanitize,
1294
- qn as storyNameFromExport,
1295
- Vn as toId
3092
+ uc as combineTags,
3093
+ tc as definePreview,
3094
+ rc as definePreviewAddon,
3095
+ _r as getCoreAnnotations,
3096
+ Xr as includeConditionalArg,
3097
+ dc as isExportStory,
3098
+ nc as isMeta,
3099
+ oc as isPreview,
3100
+ ic as isStory,
3101
+ mc as parseKind,
3102
+ jn as sanitize,
3103
+ cc as storyNameFromExport,
3104
+ lc as toId
1296
3105
  };