storybook 9.0.0-alpha.9 → 9.0.0-beta.0

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 (140) hide show
  1. package/assets/docs/addon-backgrounds.gif +0 -0
  2. package/assets/docs/addon-controls-args-annotated.png +0 -0
  3. package/assets/docs/addon-controls-args-background-color.png +0 -0
  4. package/assets/docs/addon-controls-args-background-string.png +0 -0
  5. package/assets/docs/addon-controls-args-docs.png +0 -0
  6. package/assets/docs/addon-controls-args-logging.png +0 -0
  7. package/assets/docs/addon-controls-args-no-annotation.png +0 -0
  8. package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
  9. package/assets/docs/addon-controls-args-reflow.png +0 -0
  10. package/assets/docs/addon-controls-args-template.png +0 -0
  11. package/assets/docs/addon-controls-expanded.png +0 -0
  12. package/assets/docs/addon-controls-hero.gif +0 -0
  13. package/assets/docs/addon-controls-install.png +0 -0
  14. package/assets/docs/hero.gif +0 -0
  15. package/assets/docs/highlight.png +0 -0
  16. package/assets/docs/viewport.png +0 -0
  17. package/assets/server/base-preview-head.html +1 -3
  18. package/bin/index.cjs +2 -2
  19. package/dist/actions/decorator.js +67 -72
  20. package/dist/actions/index.cjs +27 -31
  21. package/dist/actions/index.d.ts +0 -3
  22. package/dist/actions/index.js +27 -31
  23. package/dist/actions/preview.cjs +23 -27
  24. package/dist/actions/preview.d.ts +0 -1
  25. package/dist/actions/preview.js +19 -23
  26. package/dist/babel/index.cjs +822 -816
  27. package/dist/babel/index.js +822 -816
  28. package/dist/backgrounds/index.cjs +148 -0
  29. package/dist/backgrounds/index.d.ts +91 -0
  30. package/dist/backgrounds/index.js +130 -0
  31. package/dist/backgrounds/preview.cjs +143 -0
  32. package/dist/backgrounds/preview.d.ts +54 -0
  33. package/dist/backgrounds/preview.js +127 -0
  34. package/dist/bin/index.cjs +73 -92
  35. package/dist/bin/index.js +66 -85
  36. package/dist/builder-manager/index.cjs +316 -296
  37. package/dist/builder-manager/index.js +567 -547
  38. package/dist/channels/index.cjs +1020 -950
  39. package/dist/channels/index.js +1256 -1201
  40. package/dist/cli/bin/index.cjs +198 -198
  41. package/dist/cli/bin/index.js +204 -204
  42. package/dist/cli/index.cjs +61734 -7589
  43. package/dist/cli/index.d.ts +24 -20
  44. package/dist/cli/index.js +61775 -7630
  45. package/dist/common/index.cjs +16133 -9095
  46. package/dist/common/index.d.ts +32 -24
  47. package/dist/common/index.js +16227 -9183
  48. package/dist/component-testing/index.cjs +23 -0
  49. package/dist/component-testing/index.d.ts +3 -0
  50. package/dist/component-testing/index.js +5 -0
  51. package/dist/component-testing/preview.cjs +40 -0
  52. package/dist/component-testing/preview.d.ts +5 -0
  53. package/dist/component-testing/preview.js +25 -0
  54. package/dist/components/index.cjs +6479 -13005
  55. package/dist/components/index.d.ts +8 -257
  56. package/dist/components/index.js +6160 -18689
  57. package/dist/controls/decorator.d.ts +5 -0
  58. package/dist/controls/decorator.js +8 -0
  59. package/dist/controls/index.cjs +26 -0
  60. package/dist/controls/index.d.ts +39 -0
  61. package/dist/controls/index.js +6 -0
  62. package/dist/controls/preview.cjs +26 -0
  63. package/dist/controls/preview.d.ts +54 -0
  64. package/dist/controls/preview.js +9 -0
  65. package/dist/core-events/index.cjs +91 -106
  66. package/dist/core-events/index.d.ts +2 -80
  67. package/dist/core-events/index.js +79 -94
  68. package/dist/core-server/index.cjs +12409 -12231
  69. package/dist/core-server/index.d.ts +32 -23
  70. package/dist/core-server/index.js +12567 -12389
  71. package/dist/core-server/presets/common-manager.css +170 -0
  72. package/dist/core-server/presets/common-manager.js +12153 -12
  73. package/dist/core-server/presets/common-preset.cjs +3004 -3151
  74. package/dist/core-server/presets/common-preset.js +2833 -2981
  75. package/dist/csf/index.d.ts +1 -3
  76. package/dist/csf-tools/index.cjs +412 -403
  77. package/dist/csf-tools/index.d.ts +0 -4
  78. package/dist/csf-tools/index.js +410 -401
  79. package/dist/docs-tools/index.cjs +2569 -575
  80. package/dist/docs-tools/index.js +2565 -564
  81. package/dist/highlight/index.cjs +27 -0
  82. package/dist/highlight/index.d.ts +61 -0
  83. package/dist/highlight/index.js +7 -0
  84. package/dist/highlight/preview.cjs +535 -0
  85. package/dist/highlight/preview.d.ts +54 -0
  86. package/dist/highlight/preview.js +519 -0
  87. package/dist/instrumenter/index.cjs +1411 -1758
  88. package/dist/instrumenter/index.d.ts +8 -7
  89. package/dist/instrumenter/index.js +1325 -1663
  90. package/dist/manager/globals-module-info.cjs +22 -33
  91. package/dist/manager/globals-module-info.js +7 -18
  92. package/dist/manager/globals-runtime.js +45452 -49541
  93. package/dist/manager/runtime.js +4392 -3774
  94. package/dist/manager-api/index.cjs +2622 -2529
  95. package/dist/manager-api/index.d.ts +109 -114
  96. package/dist/manager-api/index.js +2603 -2475
  97. package/dist/manager-errors.js +41 -37
  98. package/dist/measure/index.cjs +476 -0
  99. package/dist/measure/index.d.ts +66 -0
  100. package/dist/measure/index.js +464 -0
  101. package/dist/measure/preview.cjs +466 -0
  102. package/dist/measure/preview.d.ts +59 -0
  103. package/dist/measure/preview.js +450 -0
  104. package/dist/outline/index.cjs +528 -0
  105. package/dist/outline/index.d.ts +66 -0
  106. package/dist/outline/index.js +500 -0
  107. package/dist/outline/preview.cjs +518 -0
  108. package/dist/outline/preview.d.ts +59 -0
  109. package/dist/outline/preview.js +486 -0
  110. package/dist/preview/runtime.js +41973 -38159
  111. package/dist/preview-api/index.cjs +1204 -1293
  112. package/dist/preview-api/index.d.ts +126 -178
  113. package/dist/preview-api/index.js +1614 -1685
  114. package/dist/preview-errors.cjs +65 -51
  115. package/dist/preview-errors.d.ts +6 -2
  116. package/dist/preview-errors.js +176 -142
  117. package/dist/server-errors.cjs +160 -113
  118. package/dist/server-errors.d.ts +12 -2
  119. package/dist/server-errors.js +157 -110
  120. package/dist/telemetry/index.cjs +374 -370
  121. package/dist/telemetry/index.d.ts +1 -1
  122. package/dist/telemetry/index.js +460 -456
  123. package/dist/test/index.cjs +1553 -1552
  124. package/dist/test/index.js +9603 -9514
  125. package/dist/test/preview.cjs +1906 -1905
  126. package/dist/test/preview.d.ts +0 -6
  127. package/dist/test/preview.js +3664 -3603
  128. package/dist/test/spy.cjs +65 -64
  129. package/dist/test/spy.js +59 -58
  130. package/dist/types/index.cjs +11 -12
  131. package/dist/types/index.d.ts +601 -334
  132. package/dist/types/index.js +1 -2
  133. package/dist/viewport/index.cjs +310 -0
  134. package/dist/viewport/index.d.ts +320 -0
  135. package/dist/viewport/index.js +290 -0
  136. package/dist/viewport/preview.cjs +35 -0
  137. package/dist/viewport/preview.d.ts +68 -0
  138. package/dist/viewport/preview.js +19 -0
  139. package/package.json +207 -12
  140. package/dist/actions/manager.js +0 -1196
@@ -1,243 +1,85 @@
1
- var se = Object.create;
2
- var ut = Object.defineProperty;
3
- var le = Object.getOwnPropertyDescriptor;
4
- var ce = Object.getOwnPropertyNames;
5
- var pe = Object.getPrototypeOf, ue = Object.prototype.hasOwnProperty;
6
- var a = (r, t) => ut(r, "name", { value: t, configurable: !0 }), H = /* @__PURE__ */ ((r) => typeof require < "u" ? require : typeof Proxy <
7
- "u" ? new Proxy(r, {
8
- get: (t, e) => (typeof require < "u" ? require : t)[e]
9
- }) : r)(function(r) {
10
- if (typeof require < "u") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + r + '" is not supported');
12
- });
13
- var fe = (r, t) => () => (t || r((t = { exports: {} }).exports, t), t.exports);
14
- var he = (r, t, e, n) => {
15
- if (t && typeof t == "object" || typeof t == "function")
16
- for (let o of ce(t))
17
- !ue.call(r, o) && o !== e && ut(r, o, { get: () => t[o], enumerable: !(n = le(t, o)) || n.enumerable });
18
- return r;
19
- };
20
- var ye = (r, t, e) => (e = r != null ? se(pe(r)) : {}, he(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- t || !r || !r.__esModule ? ut(e, "default", { value: r, enumerable: !0 }) : e,
26
- r
27
- ));
28
-
29
- // ../node_modules/memoizerific/memoizerific.js
30
- var xt = fe((It, yt) => {
31
- (function(r) {
32
- if (typeof It == "object" && typeof yt < "u")
33
- yt.exports = r();
34
- else if (typeof define == "function" && define.amd)
35
- define([], r);
36
- else {
37
- var t;
38
- typeof window < "u" ? t = window : typeof global < "u" ? t = global : typeof self < "u" ? t = self : t = this, t.memoizerific = r();
39
- }
40
- })(function() {
41
- var r, t, e;
42
- return (/* @__PURE__ */ a(function n(o, s, l) {
43
- function c(p, u) {
44
- if (!s[p]) {
45
- if (!o[p]) {
46
- var y = typeof H == "function" && H;
47
- if (!u && y) return y(p, !0);
48
- if (i) return i(p, !0);
49
- var v = new Error("Cannot find module '" + p + "'");
50
- throw v.code = "MODULE_NOT_FOUND", v;
51
- }
52
- var d = s[p] = { exports: {} };
53
- o[p][0].call(d.exports, function(m) {
54
- var E = o[p][1][m];
55
- return c(E || m);
56
- }, d, d.exports, n, o, s, l);
57
- }
58
- return s[p].exports;
59
- }
60
- a(c, "s");
61
- for (var i = typeof H == "function" && H, g = 0; g < l.length; g++) c(l[g]);
62
- return c;
63
- }, "e"))({ 1: [function(n, o, s) {
64
- o.exports = function(l) {
65
- if (typeof Map != "function" || l) {
66
- var c = n("./similar");
67
- return new c();
68
- } else
69
- return /* @__PURE__ */ new Map();
70
- };
71
- }, { "./similar": 2 }], 2: [function(n, o, s) {
72
- function l() {
73
- return this.list = [], this.lastItem = void 0, this.size = 0, this;
74
- }
75
- a(l, "Similar"), l.prototype.get = function(c) {
76
- var i;
77
- if (this.lastItem && this.isEqual(this.lastItem.key, c))
78
- return this.lastItem.val;
79
- if (i = this.indexOf(c), i >= 0)
80
- return this.lastItem = this.list[i], this.list[i].val;
81
- }, l.prototype.set = function(c, i) {
82
- var g;
83
- return this.lastItem && this.isEqual(this.lastItem.key, c) ? (this.lastItem.val = i, this) : (g = this.indexOf(c), g >= 0 ? (this.lastItem =
84
- this.list[g], this.list[g].val = i, this) : (this.lastItem = { key: c, val: i }, this.list.push(this.lastItem), this.size++, this));
85
- }, l.prototype.delete = function(c) {
86
- var i;
87
- if (this.lastItem && this.isEqual(this.lastItem.key, c) && (this.lastItem = void 0), i = this.indexOf(c), i >= 0)
88
- return this.size--, this.list.splice(i, 1)[0];
89
- }, l.prototype.has = function(c) {
90
- var i;
91
- return this.lastItem && this.isEqual(this.lastItem.key, c) ? !0 : (i = this.indexOf(c), i >= 0 ? (this.lastItem = this.list[i], !0) :
92
- !1);
93
- }, l.prototype.forEach = function(c, i) {
94
- var g;
95
- for (g = 0; g < this.size; g++)
96
- c.call(i || this, this.list[g].val, this.list[g].key, this);
97
- }, l.prototype.indexOf = function(c) {
98
- var i;
99
- for (i = 0; i < this.size; i++)
100
- if (this.isEqual(this.list[i].key, c))
101
- return i;
102
- return -1;
103
- }, l.prototype.isEqual = function(c, i) {
104
- return c === i || c !== c && i !== i;
105
- }, o.exports = l;
106
- }, {}], 3: [function(n, o, s) {
107
- var l = n("map-or-similar");
108
- o.exports = function(p) {
109
- var u = new l(!1), y = [];
110
- return function(v) {
111
- var d = /* @__PURE__ */ a(function() {
112
- var m = u, E, I, _ = arguments.length - 1, R = Array(_ + 1), C = !0, N;
113
- if ((d.numArgs || d.numArgs === 0) && d.numArgs !== _ + 1)
114
- throw new Error("Memoizerific functions should always be called with the same number of arguments");
115
- for (N = 0; N < _; N++) {
116
- if (R[N] = {
117
- cacheItem: m,
118
- arg: arguments[N]
119
- }, m.has(arguments[N])) {
120
- m = m.get(arguments[N]);
121
- continue;
122
- }
123
- C = !1, E = new l(!1), m.set(arguments[N], E), m = E;
124
- }
125
- return C && (m.has(arguments[_]) ? I = m.get(arguments[_]) : C = !1), C || (I = v.apply(null, arguments), m.set(arguments[_], I)),
126
- p > 0 && (R[_] = {
127
- cacheItem: m,
128
- arg: arguments[_]
129
- }, C ? c(y, R) : y.push(R), y.length > p && i(y.shift())), d.wasMemoized = C, d.numArgs = _ + 1, I;
130
- }, "memoizerific");
131
- return d.limit = p, d.wasMemoized = !1, d.cache = u, d.lru = y, d;
132
- };
133
- };
134
- function c(p, u) {
135
- var y = p.length, v = u.length, d, m, E;
136
- for (m = 0; m < y; m++) {
137
- for (d = !0, E = 0; E < v; E++)
138
- if (!g(p[m][E].arg, u[E].arg)) {
139
- d = !1;
140
- break;
141
- }
142
- if (d)
143
- break;
144
- }
145
- p.push(p.splice(m, 1)[0]);
146
- }
147
- a(c, "moveToMostRecentLru");
148
- function i(p) {
149
- var u = p.length, y = p[u - 1], v, d;
150
- for (y.cacheItem.delete(y.arg), d = u - 2; d >= 0 && (y = p[d], v = y.cacheItem.get(y.arg), !v || !v.size); d--)
151
- y.cacheItem.delete(y.arg);
152
- }
153
- a(i, "removeCachedResult");
154
- function g(p, u) {
155
- return p === u || p !== p && u !== u;
156
- }
157
- a(g, "isEqual");
158
- }, { "map-or-similar": 1 }] }, {}, [3])(3);
159
- });
160
- });
1
+ var xt = Object.defineProperty;
2
+ var s = (t, e) => xt(t, "name", { value: e, configurable: !0 });
161
3
 
162
4
  // src/channels/index.ts
163
- import { global as uo } from "@storybook/global";
5
+ import { global as Mo } from "@storybook/global";
164
6
 
165
7
  // ../node_modules/ts-dedent/esm/index.js
166
- function F(r) {
167
- for (var t = [], e = 1; e < arguments.length; e++)
168
- t[e - 1] = arguments[e];
169
- var n = Array.from(typeof r == "string" ? [r] : r);
8
+ function j(t) {
9
+ for (var e = [], r = 1; r < arguments.length; r++)
10
+ e[r - 1] = arguments[r];
11
+ var n = Array.from(typeof t == "string" ? [t] : t);
170
12
  n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
171
13
  var o = n.reduce(function(c, i) {
172
- var g = i.match(/\n([\t ]+|(?!\s).)/g);
173
- return g ? c.concat(g.map(function(p) {
14
+ var l = i.match(/\n([\t ]+|(?!\s).)/g);
15
+ return l ? c.concat(l.map(function(d) {
174
16
  var u, y;
175
- return (y = (u = p.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && y !== void 0 ? y : 0;
17
+ return (y = (u = d.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && y !== void 0 ? y : 0;
176
18
  })) : c;
177
19
  }, []);
178
20
  if (o.length) {
179
- var s = new RegExp(`
21
+ var p = new RegExp(`
180
22
  [ ]{` + Math.min.apply(Math, o) + "}", "g");
181
23
  n = n.map(function(c) {
182
- return c.replace(s, `
24
+ return c.replace(p, `
183
25
  `);
184
26
  });
185
27
  }
186
28
  n[0] = n[0].replace(/^\r?\n/, "");
187
- var l = n[0];
188
- return t.forEach(function(c, i) {
189
- var g = l.match(/(?:^|\n)( *)$/), p = g ? g[1] : "", u = c;
29
+ var a = n[0];
30
+ return e.forEach(function(c, i) {
31
+ var l = a.match(/(?:^|\n)( *)$/), d = l ? l[1] : "", u = c;
190
32
  typeof c == "string" && c.includes(`
191
33
  `) && (u = String(c).split(`
192
- `).map(function(y, v) {
193
- return v === 0 ? y : "" + p + y;
34
+ `).map(function(y, g) {
35
+ return g === 0 ? y : "" + d + y;
194
36
  }).join(`
195
- `)), l += u + n[i + 1];
196
- }), l;
37
+ `)), a += u + n[i + 1];
38
+ }), a;
197
39
  }
198
- a(F, "dedent");
40
+ s(j, "dedent");
199
41
 
200
42
  // src/shared/universal-store/instances.ts
201
- var ft = /* @__PURE__ */ new Map();
43
+ var he = /* @__PURE__ */ new Map();
202
44
 
203
45
  // src/shared/universal-store/index.ts
204
- var de = "UNIVERSAL_STORE:", x = {
46
+ var wt = "UNIVERSAL_STORE:", x = {
205
47
  PENDING: "PENDING",
206
48
  RESOLVED: "RESOLVED",
207
49
  REJECTED: "REJECTED"
208
- }, h = class h {
209
- constructor(t, e) {
50
+ }, M = class t {
51
+ constructor(e, r) {
210
52
  /** Enable debug logs for this store */
211
53
  this.debugging = !1;
212
54
  // TODO: narrow type of listeners based on event type
213
55
  this.listeners = /* @__PURE__ */ new Map([["*", /* @__PURE__ */ new Set()]]);
214
56
  /** Gets the current state */
215
- this.getState = /* @__PURE__ */ a(() => (this.debug("getState", { state: this.state }), this.state), "getState");
57
+ this.getState = /* @__PURE__ */ s(() => (this.debug("getState", { state: this.state }), this.state), "getState");
216
58
  /**
217
59
  * Subscribes to store events
218
60
  *
219
61
  * @returns A function to unsubscribe
220
62
  */
221
- this.subscribe = /* @__PURE__ */ a((t, e) => {
222
- let n = typeof t == "function", o = n ? "*" : t, s = n ? t : e;
223
- if (this.debug("subscribe", { eventType: o, listener: s }), !s)
63
+ this.subscribe = /* @__PURE__ */ s((e, r) => {
64
+ let n = typeof e == "function", o = n ? "*" : e, p = n ? e : r;
65
+ if (this.debug("subscribe", { eventType: o, listener: p }), !p)
224
66
  throw new TypeError(
225
67
  `Missing first subscribe argument, or second if first is the event type, when subscribing to a UniversalStore with id '${this.id}'`
226
68
  );
227
- return this.listeners.has(o) || this.listeners.set(o, /* @__PURE__ */ new Set()), this.listeners.get(o).add(s), () => {
228
- this.debug("unsubscribe", { eventType: o, listener: s }), this.listeners.has(o) && (this.listeners.get(o).delete(s), this.listeners.
69
+ return this.listeners.has(o) || this.listeners.set(o, /* @__PURE__ */ new Set()), this.listeners.get(o).add(p), () => {
70
+ this.debug("unsubscribe", { eventType: o, listener: p }), this.listeners.has(o) && (this.listeners.get(o).delete(p), this.listeners.
229
71
  get(o)?.size === 0 && this.listeners.delete(o));
230
72
  };
231
73
  }, "subscribe");
232
74
  /** Sends a custom event to the other stores */
233
- this.send = /* @__PURE__ */ a((t) => {
234
- if (this.debug("send", { event: t }), this.status !== h.Status.READY)
75
+ this.send = /* @__PURE__ */ s((e) => {
76
+ if (this.debug("send", { event: e }), this.status !== t.Status.READY)
235
77
  throw new TypeError(
236
- F`Cannot send event before store is ready. You can get the current status with store.status,
78
+ j`Cannot send event before store is ready. You can get the current status with store.status,
237
79
  or await store.readyPromise to wait for the store to be ready before sending events.
238
80
  ${JSON.stringify(
239
81
  {
240
- event: t,
82
+ event: e,
241
83
  id: this.id,
242
84
  actor: this.actor,
243
85
  environment: this.environment
@@ -246,34 +88,34 @@ var de = "UNIVERSAL_STORE:", x = {
246
88
  2
247
89
  )}`
248
90
  );
249
- this.emitToListeners(t, { actor: this.actor }), this.emitToChannel(t, { actor: this.actor });
91
+ this.emitToListeners(e, { actor: this.actor }), this.emitToChannel(e, { actor: this.actor });
250
92
  }, "send");
251
- if (this.debugging = t.debug ?? !1, !h.isInternalConstructing)
93
+ if (this.debugging = e.debug ?? !1, !t.isInternalConstructing)
252
94
  throw new TypeError(
253
95
  "UniversalStore is not constructable - use UniversalStore.create() instead"
254
96
  );
255
- if (h.isInternalConstructing = !1, this.id = t.id, this.actorId = Date.now().toString(36) + Math.random().toString(36).substring(2), this.
256
- actorType = t.leader ? h.ActorType.LEADER : h.ActorType.FOLLOWER, this.state = t.initialState, this.channelEventName = `${de}${this.id}`,
97
+ if (t.isInternalConstructing = !1, this.id = e.id, this.actorId = Date.now().toString(36) + Math.random().toString(36).substring(2), this.
98
+ actorType = e.leader ? t.ActorType.LEADER : t.ActorType.FOLLOWER, this.state = e.initialState, this.channelEventName = `${wt}${this.id}`,
257
99
  this.debug("constructor", {
258
- options: t,
259
- environmentOverrides: e,
100
+ options: e,
101
+ environmentOverrides: r,
260
102
  channelEventName: this.channelEventName
261
- }), this.actor.type === h.ActorType.LEADER)
103
+ }), this.actor.type === t.ActorType.LEADER)
262
104
  this.syncing = {
263
105
  state: x.RESOLVED,
264
106
  promise: Promise.resolve()
265
107
  };
266
108
  else {
267
- let n, o, s = new Promise((l, c) => {
268
- n = /* @__PURE__ */ a(() => {
269
- this.syncing.state === x.PENDING && (this.syncing.state = x.RESOLVED, l());
270
- }, "syncingResolve"), o = /* @__PURE__ */ a((i) => {
109
+ let n, o, p = new Promise((a, c) => {
110
+ n = /* @__PURE__ */ s(() => {
111
+ this.syncing.state === x.PENDING && (this.syncing.state = x.RESOLVED, a());
112
+ }, "syncingResolve"), o = /* @__PURE__ */ s((i) => {
271
113
  this.syncing.state === x.PENDING && (this.syncing.state = x.REJECTED, c(i));
272
114
  }, "syncingReject");
273
115
  });
274
116
  this.syncing = {
275
117
  state: x.PENDING,
276
- promise: s,
118
+ promise: p,
277
119
  resolve: n,
278
120
  reject: o
279
121
  };
@@ -281,23 +123,80 @@ var de = "UNIVERSAL_STORE:", x = {
281
123
  this.getState = this.getState.bind(this), this.setState = this.setState.bind(this), this.subscribe = this.subscribe.bind(this), this.onStateChange =
282
124
  this.onStateChange.bind(this), this.send = this.send.bind(this), this.emitToChannel = this.emitToChannel.bind(this), this.prepareThis = this.
283
125
  prepareThis.bind(this), this.emitToListeners = this.emitToListeners.bind(this), this.handleChannelEvents = this.handleChannelEvents.bind(
284
- this), this.debug = this.debug.bind(this), this.channel = e?.channel ?? h.preparation.channel, this.environment = e?.environment ?? h.preparation.
285
- environment, this.channel && this.environment ? this.prepareThis({ channel: this.channel, environment: this.environment }) : h.preparation.
286
- promise.then(this.prepareThis);
126
+ this), this.debug = this.debug.bind(this), this.channel = r?.channel ?? t.preparation.channel, this.environment = r?.environment ?? t.preparation.
127
+ environment, this.channel && this.environment ? (t.preparation.resolve({ channel: this.channel, environment: this.environment }), this.prepareThis(
128
+ { channel: this.channel, environment: this.environment })) : t.preparation.promise.then(this.prepareThis);
129
+ }
130
+ static {
131
+ s(this, "UniversalStore");
132
+ }
133
+ static {
134
+ /**
135
+ * Defines the possible actor types in the store system
136
+ *
137
+ * @readonly
138
+ */
139
+ this.ActorType = {
140
+ LEADER: "LEADER",
141
+ FOLLOWER: "FOLLOWER"
142
+ };
143
+ }
144
+ static {
145
+ /**
146
+ * Defines the possible environments the store can run in
147
+ *
148
+ * @readonly
149
+ */
150
+ this.Environment = {
151
+ SERVER: "SERVER",
152
+ MANAGER: "MANAGER",
153
+ PREVIEW: "PREVIEW",
154
+ UNKNOWN: "UNKNOWN",
155
+ MOCK: "MOCK"
156
+ };
157
+ }
158
+ static {
159
+ /**
160
+ * Internal event types used for store synchronization
161
+ *
162
+ * @readonly
163
+ */
164
+ this.InternalEventType = {
165
+ EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST",
166
+ EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE",
167
+ SET_STATE: "__SET_STATE",
168
+ LEADER_CREATED: "__LEADER_CREATED",
169
+ FOLLOWER_CREATED: "__FOLLOWER_CREATED"
170
+ };
171
+ }
172
+ static {
173
+ this.Status = {
174
+ UNPREPARED: "UNPREPARED",
175
+ SYNCING: "SYNCING",
176
+ READY: "READY",
177
+ ERROR: "ERROR"
178
+ };
179
+ }
180
+ static {
181
+ // This is used to check if constructor was called from the static factory create()
182
+ this.isInternalConstructing = !1;
183
+ }
184
+ static {
185
+ t.setupPreparationPromise();
287
186
  }
288
187
  static setupPreparationPromise() {
289
- let t, e, n = new Promise(
290
- (o, s) => {
291
- t = /* @__PURE__ */ a((l) => {
292
- o(l);
293
- }, "resolveRef"), e = /* @__PURE__ */ a((...l) => {
294
- s(l);
188
+ let e, r, n = new Promise(
189
+ (o, p) => {
190
+ e = /* @__PURE__ */ s((a) => {
191
+ o(a);
192
+ }, "resolveRef"), r = /* @__PURE__ */ s((...a) => {
193
+ p(a);
295
194
  }, "rejectRef");
296
195
  }
297
196
  );
298
- h.preparation = {
299
- resolve: t,
300
- reject: e,
197
+ t.preparation = {
198
+ resolve: e,
199
+ reject: r,
301
200
  promise: n
302
201
  };
303
202
  }
@@ -306,7 +205,7 @@ var de = "UNIVERSAL_STORE:", x = {
306
205
  return Object.freeze({
307
206
  id: this.actorId,
308
207
  type: this.actorType,
309
- environment: this.environment ?? h.Environment.UNKNOWN
208
+ environment: this.environment ?? t.Environment.UNKNOWN
310
209
  });
311
210
  }
312
211
  /**
@@ -315,16 +214,16 @@ var de = "UNIVERSAL_STORE:", x = {
315
214
  */
316
215
  get status() {
317
216
  if (!this.channel || !this.environment)
318
- return h.Status.UNPREPARED;
217
+ return t.Status.UNPREPARED;
319
218
  switch (this.syncing?.state) {
320
219
  case x.PENDING:
321
220
  case void 0:
322
- return h.Status.SYNCING;
221
+ return t.Status.SYNCING;
323
222
  case x.REJECTED:
324
- return h.Status.ERROR;
223
+ return t.Status.ERROR;
325
224
  case x.RESOLVED:
326
225
  default:
327
- return h.Status.READY;
226
+ return t.Status.READY;
328
227
  }
329
228
  }
330
229
  /**
@@ -335,24 +234,24 @@ var de = "UNIVERSAL_STORE:", x = {
335
234
  * hundred milliseconds.
336
235
  */
337
236
  untilReady() {
338
- return Promise.all([h.preparation.promise, this.syncing?.promise]);
237
+ return Promise.all([t.preparation.promise, this.syncing?.promise]);
339
238
  }
340
239
  /** Creates a new instance of UniversalStore */
341
- static create(t) {
342
- if (!t || typeof t?.id != "string")
240
+ static create(e) {
241
+ if (!e || typeof e?.id != "string")
343
242
  throw new TypeError("id is required and must be a string, when creating a UniversalStore");
344
- t.debug && console.debug(
345
- F`[UniversalStore]
243
+ e.debug && console.debug(
244
+ j`[UniversalStore]
346
245
  create`,
347
- { options: t }
246
+ { options: e }
348
247
  );
349
- let e = ft.get(t.id);
350
- if (e)
351
- return console.warn(F`UniversalStore with id "${t.id}" already exists in this environment, re-using existing.
352
- You should reuse the existing instance instead of trying to create a new one.`), e;
353
- h.isInternalConstructing = !0;
354
- let n = new h(t);
355
- return ft.set(t.id, n), n;
248
+ let r = he.get(e.id);
249
+ if (r)
250
+ return console.warn(j`UniversalStore with id "${e.id}" already exists in this environment, re-using existing.
251
+ You should reuse the existing instance instead of trying to create a new one.`), r;
252
+ t.isInternalConstructing = !0;
253
+ let n = new t(e);
254
+ return he.set(e.id, n), n;
356
255
  }
357
256
  /**
358
257
  * Used by Storybook to set the channel for all instances of UniversalStore in the given
@@ -360,19 +259,19 @@ var de = "UNIVERSAL_STORE:", x = {
360
259
  *
361
260
  * @internal
362
261
  */
363
- static __prepare(t, e) {
364
- h.preparation.channel = t, h.preparation.environment = e, h.preparation.resolve({ channel: t, environment: e });
262
+ static __prepare(e, r) {
263
+ t.preparation.channel = e, t.preparation.environment = r, t.preparation.resolve({ channel: e, environment: r });
365
264
  }
366
265
  /**
367
266
  * Updates the store's state
368
267
  *
369
268
  * Either a new state or a state updater function can be passed to the method.
370
269
  */
371
- setState(t) {
372
- let e = this.state, n = typeof t == "function" ? t(e) : t;
373
- if (this.debug("setState", { newState: n, previousState: e, updater: t }), this.status !== h.Status.READY)
270
+ setState(e) {
271
+ let r = this.state, n = typeof e == "function" ? e(r) : e;
272
+ if (this.debug("setState", { newState: n, previousState: r, updater: e }), this.status !== t.Status.READY)
374
273
  throw new TypeError(
375
- F`Cannot set state before store is ready. You can get the current status with store.status,
274
+ j`Cannot set state before store is ready. You can get the current status with store.status,
376
275
  or await store.readyPromise to wait for the store to be ready before sending events.
377
276
  ${JSON.stringify(
378
277
  {
@@ -387,10 +286,10 @@ var de = "UNIVERSAL_STORE:", x = {
387
286
  );
388
287
  this.state = n;
389
288
  let o = {
390
- type: h.InternalEventType.SET_STATE,
289
+ type: t.InternalEventType.SET_STATE,
391
290
  payload: {
392
291
  state: n,
393
- previousState: e
292
+ previousState: r
394
293
  }
395
294
  };
396
295
  this.emitToChannel(o, { actor: this.actor }), this.emitToListeners(o, { actor: this.actor });
@@ -400,33 +299,33 @@ var de = "UNIVERSAL_STORE:", x = {
400
299
  *
401
300
  * @returns Unsubscribe function
402
301
  */
403
- onStateChange(t) {
404
- return this.debug("onStateChange", { listener: t }), this.subscribe(
405
- h.InternalEventType.SET_STATE,
406
- ({ payload: e }, n) => {
407
- t(e.state, e.previousState, n);
302
+ onStateChange(e) {
303
+ return this.debug("onStateChange", { listener: e }), this.subscribe(
304
+ t.InternalEventType.SET_STATE,
305
+ ({ payload: r }, n) => {
306
+ e(r.state, r.previousState, n);
408
307
  }
409
308
  );
410
309
  }
411
- emitToChannel(t, e) {
412
- this.debug("emitToChannel", { event: t, eventInfo: e, channel: !!this.channel }), this.channel?.emit(this.channelEventName, {
413
- event: t,
414
- eventInfo: e
310
+ emitToChannel(e, r) {
311
+ this.debug("emitToChannel", { event: e, eventInfo: r, channel: !!this.channel }), this.channel?.emit(this.channelEventName, {
312
+ event: e,
313
+ eventInfo: r
415
314
  });
416
315
  }
417
316
  prepareThis({
418
- channel: t,
419
- environment: e
317
+ channel: e,
318
+ environment: r
420
319
  }) {
421
- this.channel = t, this.environment = e, this.debug("prepared", { channel: !!t, environment: e }), this.channel.on(this.channelEventName,
422
- this.handleChannelEvents), this.actor.type === h.ActorType.LEADER ? this.emitToChannel(
423
- { type: h.InternalEventType.LEADER_CREATED },
320
+ this.channel = e, this.environment = r, this.debug("prepared", { channel: !!e, environment: r }), this.channel.on(this.channelEventName,
321
+ this.handleChannelEvents), this.actor.type === t.ActorType.LEADER ? this.emitToChannel(
322
+ { type: t.InternalEventType.LEADER_CREATED },
424
323
  { actor: this.actor }
425
324
  ) : (this.emitToChannel(
426
- { type: h.InternalEventType.FOLLOWER_CREATED },
325
+ { type: t.InternalEventType.FOLLOWER_CREATED },
427
326
  { actor: this.actor }
428
327
  ), this.emitToChannel(
429
- { type: h.InternalEventType.EXISTING_STATE_REQUEST },
328
+ { type: t.InternalEventType.EXISTING_STATE_REQUEST },
430
329
  { actor: this.actor }
431
330
  ), setTimeout(() => {
432
331
  this.syncing.reject(
@@ -437,44 +336,44 @@ var de = "UNIVERSAL_STORE:", x = {
437
336
  );
438
337
  }, 1e3));
439
338
  }
440
- emitToListeners(t, e) {
441
- let n = this.listeners.get(t.type), o = this.listeners.get("*");
339
+ emitToListeners(e, r) {
340
+ let n = this.listeners.get(e.type), o = this.listeners.get("*");
442
341
  this.debug("emitToListeners", {
443
- event: t,
444
- eventInfo: e,
342
+ event: e,
343
+ eventInfo: r,
445
344
  eventTypeListeners: n,
446
345
  everythingListeners: o
447
346
  }), [...n ?? [], ...o ?? []].forEach(
448
- (s) => s(t, e)
347
+ (p) => p(e, r)
449
348
  );
450
349
  }
451
- handleChannelEvents(t) {
452
- let { event: e, eventInfo: n } = t;
350
+ handleChannelEvents(e) {
351
+ let { event: r, eventInfo: n } = e;
453
352
  if ([n.actor.id, n.forwardingActor?.id].includes(this.actor.id)) {
454
- this.debug("handleChannelEvents: Ignoring event from self", { channelEvent: t });
353
+ this.debug("handleChannelEvents: Ignoring event from self", { channelEvent: e });
455
354
  return;
456
- } else if (this.syncing?.state === x.PENDING && e.type !== h.InternalEventType.EXISTING_STATE_RESPONSE) {
457
- this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent: t });
355
+ } else if (this.syncing?.state === x.PENDING && r.type !== t.InternalEventType.EXISTING_STATE_RESPONSE) {
356
+ this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent: e });
458
357
  return;
459
358
  }
460
- if (this.debug("handleChannelEvents", { channelEvent: t }), this.actor.type === h.ActorType.LEADER) {
359
+ if (this.debug("handleChannelEvents", { channelEvent: e }), this.actor.type === t.ActorType.LEADER) {
461
360
  let o = !0;
462
- switch (e.type) {
463
- case h.InternalEventType.EXISTING_STATE_REQUEST:
361
+ switch (r.type) {
362
+ case t.InternalEventType.EXISTING_STATE_REQUEST:
464
363
  o = !1;
465
- let s = {
466
- type: h.InternalEventType.EXISTING_STATE_RESPONSE,
364
+ let p = {
365
+ type: t.InternalEventType.EXISTING_STATE_RESPONSE,
467
366
  payload: this.state
468
367
  };
469
368
  this.debug("handleChannelEvents: responding to existing state request", {
470
- responseEvent: s
471
- }), this.emitToChannel(s, { actor: this.actor });
369
+ responseEvent: p
370
+ }), this.emitToChannel(p, { actor: this.actor }), this.emitToListeners(p, { actor: this.actor });
472
371
  break;
473
- case h.InternalEventType.LEADER_CREATED:
372
+ case t.InternalEventType.LEADER_CREATED:
474
373
  o = !1, this.syncing.state = x.REJECTED, this.debug("handleChannelEvents: erroring due to second leader being created", {
475
- event: e
374
+ event: r
476
375
  }), console.error(
477
- F`Detected multiple UniversalStore leaders created with the same id "${this.id}".
376
+ j`Detected multiple UniversalStore leaders created with the same id "${this.id}".
478
377
  Only one leader can exists at a time, your stores are now in an invalid state.
479
378
  Leaders detected:
480
379
  this: ${JSON.stringify(this.actor, null, 2)}
@@ -482,41 +381,41 @@ var de = "UNIVERSAL_STORE:", x = {
482
381
  );
483
382
  break;
484
383
  }
485
- o && (this.debug("handleChannelEvents: forwarding event", { channelEvent: t }), this.emitToChannel(e, { actor: n.actor, forwardingActor: this.
384
+ o && (this.debug("handleChannelEvents: forwarding event", { channelEvent: e }), this.emitToChannel(r, { actor: n.actor, forwardingActor: this.
486
385
  actor }));
487
386
  }
488
- if (this.actor.type === h.ActorType.FOLLOWER)
489
- switch (e.type) {
490
- case h.InternalEventType.EXISTING_STATE_RESPONSE:
387
+ if (this.actor.type === t.ActorType.FOLLOWER)
388
+ switch (r.type) {
389
+ case t.InternalEventType.EXISTING_STATE_RESPONSE:
491
390
  if (this.debug("handleChannelEvents: Setting state from leader's existing state response", {
492
- event: e
391
+ event: r
493
392
  }), this.syncing?.state !== x.PENDING)
494
393
  break;
495
394
  this.syncing.resolve?.();
496
395
  let o = {
497
- type: h.InternalEventType.SET_STATE,
396
+ type: t.InternalEventType.SET_STATE,
498
397
  payload: {
499
- state: e.payload,
398
+ state: r.payload,
500
399
  previousState: this.state
501
400
  }
502
401
  };
503
- this.state = e.payload, this.emitToListeners(o, n);
402
+ this.state = r.payload, this.emitToListeners(o, n);
504
403
  break;
505
404
  }
506
- switch (e.type) {
507
- case h.InternalEventType.SET_STATE:
508
- this.debug("handleChannelEvents: Setting state", { event: e }), this.state = e.payload.state;
405
+ switch (r.type) {
406
+ case t.InternalEventType.SET_STATE:
407
+ this.debug("handleChannelEvents: Setting state", { event: r }), this.state = r.payload.state;
509
408
  break;
510
409
  }
511
- this.emitToListeners(e, { actor: n.actor });
410
+ this.emitToListeners(r, { actor: n.actor });
512
411
  }
513
- debug(t, e) {
412
+ debug(e, r) {
514
413
  this.debugging && console.debug(
515
- F`[UniversalStore::${this.id}::${this.environment ?? h.Environment.UNKNOWN}]
516
- ${t}`,
414
+ j`[UniversalStore::${this.id}::${this.environment ?? t.Environment.UNKNOWN}]
415
+ ${e}`,
517
416
  JSON.stringify(
518
417
  {
519
- data: e,
418
+ data: r,
520
419
  actor: this.actor,
521
420
  state: this.state,
522
421
  status: this.status
@@ -532,140 +431,107 @@ var de = "UNIVERSAL_STORE:", x = {
532
431
  * @internal
533
432
  */
534
433
  static __reset() {
535
- h.preparation.reject(new Error("reset")), h.setupPreparationPromise(), h.isInternalConstructing = !1;
434
+ t.preparation.reject(new Error("reset")), t.setupPreparationPromise(), t.isInternalConstructing = !1;
536
435
  }
537
436
  };
538
- a(h, "UniversalStore"), /**
539
- * Defines the possible actor types in the store system
540
- *
541
- * @readonly
542
- */
543
- h.ActorType = {
544
- LEADER: "LEADER",
545
- FOLLOWER: "FOLLOWER"
546
- }, /**
547
- * Defines the possible environments the store can run in
548
- *
549
- * @readonly
550
- */
551
- h.Environment = {
552
- SERVER: "SERVER",
553
- MANAGER: "MANAGER",
554
- PREVIEW: "PREVIEW",
555
- UNKNOWN: "UNKNOWN",
556
- MOCK: "MOCK"
557
- }, /**
558
- * Internal event types used for store synchronization
559
- *
560
- * @readonly
561
- */
562
- h.InternalEventType = {
563
- EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST",
564
- EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE",
565
- SET_STATE: "__SET_STATE",
566
- LEADER_CREATED: "__LEADER_CREATED",
567
- FOLLOWER_CREATED: "__FOLLOWER_CREATED"
568
- }, h.Status = {
569
- UNPREPARED: "UNPREPARED",
570
- SYNCING: "SYNCING",
571
- READY: "READY",
572
- ERROR: "ERROR"
573
- }, // This is used to check if constructor was called from the static factory create()
574
- h.isInternalConstructing = !1, h.setupPreparationPromise();
575
- var $ = h;
576
437
 
577
438
  // src/channels/main.ts
578
- var ge = /* @__PURE__ */ a((r) => r.transports !== void 0, "isMulti"), ve = /* @__PURE__ */ a(() => Math.random().toString(16).slice(2), "ge\
579
- nerateRandomId"), ht = class ht {
580
- constructor(t = {}) {
581
- this.sender = ve();
439
+ var Pt = /* @__PURE__ */ s((t) => t.transports !== void 0, "isMulti"), Ot = /* @__PURE__ */ s(() => Math.random().toString(16).slice(2), "ge\
440
+ nerateRandomId"), J = class {
441
+ constructor(e = {}) {
442
+ this.sender = Ot();
582
443
  this.events = {};
583
444
  this.data = {};
584
445
  this.transports = [];
585
- this.isAsync = t.async || !1, ge(t) ? (this.transports = t.transports || [], this.transports.forEach((e) => {
586
- e.setHandler((n) => this.handleEvent(n));
587
- })) : this.transports = t.transport ? [t.transport] : [], this.transports.forEach((e) => {
588
- e.setHandler((n) => this.handleEvent(n));
446
+ this.isAsync = e.async || !1, Pt(e) ? (this.transports = e.transports || [], this.transports.forEach((r) => {
447
+ r.setHandler((n) => this.handleEvent(n));
448
+ })) : this.transports = e.transport ? [e.transport] : [], this.transports.forEach((r) => {
449
+ r.setHandler((n) => this.handleEvent(n));
589
450
  });
590
451
  }
452
+ static {
453
+ s(this, "Channel");
454
+ }
591
455
  get hasTransport() {
592
456
  return this.transports.length > 0;
593
457
  }
594
- addListener(t, e) {
595
- this.events[t] = this.events[t] || [], this.events[t].push(e);
458
+ addListener(e, r) {
459
+ this.events[e] = this.events[e] || [], this.events[e].push(r);
596
460
  }
597
- emit(t, ...e) {
598
- let n = { type: t, args: e, from: this.sender }, o = {};
599
- e.length >= 1 && e[0] && e[0].options && (o = e[0].options);
600
- let s = /* @__PURE__ */ a(() => {
601
- this.transports.forEach((l) => {
602
- l.send(n, o);
461
+ emit(e, ...r) {
462
+ let n = { type: e, args: r, from: this.sender }, o = {};
463
+ r.length >= 1 && r[0] && r[0].options && (o = r[0].options);
464
+ let p = /* @__PURE__ */ s(() => {
465
+ this.transports.forEach((a) => {
466
+ a.send(n, o);
603
467
  }), this.handleEvent(n);
604
468
  }, "handler");
605
- this.isAsync ? setImmediate(s) : s();
469
+ this.isAsync ? setImmediate(p) : p();
606
470
  }
607
- last(t) {
608
- return this.data[t];
471
+ last(e) {
472
+ return this.data[e];
609
473
  }
610
474
  eventNames() {
611
475
  return Object.keys(this.events);
612
476
  }
613
- listenerCount(t) {
614
- let e = this.listeners(t);
615
- return e ? e.length : 0;
477
+ listenerCount(e) {
478
+ let r = this.listeners(e);
479
+ return r ? r.length : 0;
616
480
  }
617
- listeners(t) {
618
- return this.events[t] || void 0;
481
+ listeners(e) {
482
+ return this.events[e] || void 0;
619
483
  }
620
- once(t, e) {
621
- let n = this.onceListener(t, e);
622
- this.addListener(t, n);
484
+ once(e, r) {
485
+ let n = this.onceListener(e, r);
486
+ this.addListener(e, n);
623
487
  }
624
- removeAllListeners(t) {
625
- t ? this.events[t] && delete this.events[t] : this.events = {};
488
+ removeAllListeners(e) {
489
+ e ? this.events[e] && delete this.events[e] : this.events = {};
626
490
  }
627
- removeListener(t, e) {
628
- let n = this.listeners(t);
629
- n && (this.events[t] = n.filter((o) => o !== e));
491
+ removeListener(e, r) {
492
+ let n = this.listeners(e);
493
+ n && (this.events[e] = n.filter((o) => o !== r));
630
494
  }
631
- on(t, e) {
632
- this.addListener(t, e);
495
+ on(e, r) {
496
+ this.addListener(e, r);
633
497
  }
634
- off(t, e) {
635
- this.removeListener(t, e);
498
+ off(e, r) {
499
+ this.removeListener(e, r);
636
500
  }
637
- handleEvent(t) {
638
- let e = this.listeners(t.type);
639
- e && e.length && e.forEach((n) => {
640
- n.apply(t, t.args);
641
- }), this.data[t.type] = t.args;
501
+ handleEvent(e) {
502
+ let r = this.listeners(e.type);
503
+ r && r.length && r.forEach((n) => {
504
+ n.apply(e, e.args);
505
+ }), this.data[e.type] = e.args;
642
506
  }
643
- onceListener(t, e) {
644
- let n = /* @__PURE__ */ a((...o) => (this.removeListener(t, n), e(...o)), "onceListener");
507
+ onceListener(e, r) {
508
+ let n = /* @__PURE__ */ s((...o) => (this.removeListener(e, n), r(...o)), "onceListener");
645
509
  return n;
646
510
  }
647
511
  };
648
- a(ht, "Channel");
649
- var B = ht;
650
512
 
651
513
  // src/channels/postmessage/index.ts
652
- import { logger as Kt, pretty as Yt } from "storybook/internal/client-logger";
653
- import * as lo from "storybook/internal/core-events";
654
- import { global as A } from "@storybook/global";
514
+ import { logger as st, pretty as it } from "storybook/internal/client-logger";
515
+ import * as Do from "storybook/internal/core-events";
516
+ import { global as b } from "@storybook/global";
655
517
 
656
- // ../node_modules/telejson/dist/chunk-465TF3XA.mjs
657
- var me = Object.create, Ot = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, Ct = Object.getOwnPropertyNames, be = Object.getPrototypeOf,
658
- Se = Object.prototype.hasOwnProperty, P = /* @__PURE__ */ a((r, t) => /* @__PURE__ */ a(function() {
659
- return t || (0, r[Ct(r)[0]])((t = { exports: {} }).exports, t), t.exports;
660
- }, "__require"), "__commonJS"), _e = /* @__PURE__ */ a((r, t, e, n) => {
661
- if (t && typeof t == "object" || typeof t == "function")
662
- for (let o of Ct(t))
663
- !Se.call(r, o) && o !== e && Ot(r, o, { get: /* @__PURE__ */ a(() => t[o], "get"), enumerable: !(n = Ee(t, o)) || n.enumerable });
664
- return r;
665
- }, "__copyProps"), ot = /* @__PURE__ */ a((r, t, e) => (e = r != null ? me(be(r)) : {}, _e(
666
- t || !r || !r.__esModule ? Ot(e, "default", { value: r, enumerable: !0 }) : e,
667
- r
668
- )), "__toESM"), Te = [
518
+ // ../node_modules/telejson/dist/chunk-EAFQLD22.mjs
519
+ var Ct = Object.create, je = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, Le = Object.getOwnPropertyNames, It = Object.getPrototypeOf,
520
+ Rt = Object.prototype.hasOwnProperty, f = /* @__PURE__ */ s((t, e) => /* @__PURE__ */ s(function() {
521
+ return e || (0, t[Le(t)[0]])((e = { exports: {} }).exports, e), e.exports;
522
+ }, "__require"), "__commonJS"), jt = /* @__PURE__ */ s((t, e, r, n) => {
523
+ if (e && typeof e == "object" || typeof e == "function")
524
+ for (let o of Le(e))
525
+ !Rt.call(t, o) && o !== r && je(t, o, { get: /* @__PURE__ */ s(() => e[o], "get"), enumerable: !(n = Nt(e, o)) || n.enumerable });
526
+ return t;
527
+ }, "__copyProps"), ae = /* @__PURE__ */ s((t, e, r) => (r = t != null ? Ct(It(t)) : {}, jt(
528
+ // If the importer is in node compatibility mode or this is not an ESM
529
+ // file that has been converted to a CommonJS file using a Babel-
530
+ // compatible transform (i.e. "__esModule" has not been set), then set
531
+ // "default" to the CommonJS "module.exports" for node compatibility.
532
+ e || !t || !t.__esModule ? je(r, "default", { value: t, enumerable: !0 }) : r,
533
+ t
534
+ )), "__toESM"), Lt = [
669
535
  "bubbles",
670
536
  "cancelBubble",
671
537
  "cancelable",
@@ -679,210 +545,441 @@ Se = Object.prototype.hasOwnProperty, P = /* @__PURE__ */ a((r, t) => /* @__PURE
679
545
  "target",
680
546
  "timeStamp",
681
547
  "type"
682
- ], Ae = ["detail"];
683
- function Pt(r) {
684
- let t = Te.filter((e) => r[e] !== void 0).reduce((e, n) => ({ ...e, [n]: r[n] }), {});
685
- return r instanceof CustomEvent && Ae.filter((e) => r[e] !== void 0).forEach((e) => {
686
- t[e] = r[e];
687
- }), t;
548
+ ], Dt = ["detail"];
549
+ function De(t) {
550
+ let e = Lt.filter((r) => t[r] !== void 0).reduce((r, n) => (r[n] = t[n], r), {});
551
+ if (t instanceof CustomEvent)
552
+ for (let r of Dt.filter(
553
+ (n) => t[n] !== void 0
554
+ ))
555
+ e[r] = t[r];
556
+ return e;
688
557
  }
689
- a(Pt, "extractEventHiddenProperties");
558
+ s(De, "extractEventHiddenProperties");
690
559
 
691
560
  // ../node_modules/telejson/dist/index.mjs
692
- var Bt = ye(xt(), 1);
693
- var Ft = P({
694
- "node_modules/has-symbols/shams.js"(r, t) {
561
+ var ke = f({
562
+ "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(t, e) {
563
+ "use strict";
564
+ e.exports = Object;
565
+ }
566
+ }), $t = f({
567
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(t, e) {
568
+ "use strict";
569
+ e.exports = Error;
570
+ }
571
+ }), Ft = f({
572
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(t, e) {
573
+ "use strict";
574
+ e.exports = EvalError;
575
+ }
576
+ }), Mt = f({
577
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(t, e) {
578
+ "use strict";
579
+ e.exports = RangeError;
580
+ }
581
+ }), Ut = f({
582
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(t, e) {
583
+ "use strict";
584
+ e.exports = ReferenceError;
585
+ }
586
+ }), Gt = f({
587
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(t, e) {
588
+ "use strict";
589
+ e.exports = SyntaxError;
590
+ }
591
+ }), me = f({
592
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(t, e) {
593
+ "use strict";
594
+ e.exports = TypeError;
595
+ }
596
+ }), kt = f({
597
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(t, e) {
598
+ "use strict";
599
+ e.exports = URIError;
600
+ }
601
+ }), Wt = f({
602
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(t, e) {
603
+ "use strict";
604
+ e.exports = Math.abs;
605
+ }
606
+ }), qt = f({
607
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(t, e) {
608
+ "use strict";
609
+ e.exports = Math.floor;
610
+ }
611
+ }), Bt = f({
612
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(t, e) {
613
+ "use strict";
614
+ e.exports = Math.max;
615
+ }
616
+ }), Ht = f({
617
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(t, e) {
618
+ "use strict";
619
+ e.exports = Math.min;
620
+ }
621
+ }), Vt = f({
622
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(t, e) {
623
+ "use strict";
624
+ e.exports = Math.pow;
625
+ }
626
+ }), Jt = f({
627
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(t, e) {
695
628
  "use strict";
696
- t.exports = /* @__PURE__ */ a(function() {
629
+ e.exports = Math.round;
630
+ }
631
+ }), zt = f({
632
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(t, e) {
633
+ "use strict";
634
+ e.exports = Number.isNaN || /* @__PURE__ */ s(function(n) {
635
+ return n !== n;
636
+ }, "isNaN2");
637
+ }
638
+ }), Yt = f({
639
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(t, e) {
640
+ "use strict";
641
+ var r = zt();
642
+ e.exports = /* @__PURE__ */ s(function(o) {
643
+ return r(o) || o === 0 ? o : o < 0 ? -1 : 1;
644
+ }, "sign");
645
+ }
646
+ }), Kt = f({
647
+ "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(t, e) {
648
+ "use strict";
649
+ e.exports = Object.getOwnPropertyDescriptor;
650
+ }
651
+ }), ve = f({
652
+ "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(t, e) {
653
+ "use strict";
654
+ var r = Kt();
655
+ if (r)
656
+ try {
657
+ r([], "length");
658
+ } catch {
659
+ r = null;
660
+ }
661
+ e.exports = r;
662
+ }
663
+ }), Xt = f({
664
+ "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(t, e) {
665
+ "use strict";
666
+ var r = Object.defineProperty || !1;
667
+ if (r)
668
+ try {
669
+ r({}, "a", { value: 1 });
670
+ } catch {
671
+ r = !1;
672
+ }
673
+ e.exports = r;
674
+ }
675
+ }), We = f({
676
+ "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(t, e) {
677
+ "use strict";
678
+ e.exports = /* @__PURE__ */ s(function() {
697
679
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
698
680
  return !1;
699
681
  if (typeof Symbol.iterator == "symbol")
700
682
  return !0;
701
- var n = {}, o = Symbol("test"), s = Object(o);
702
- if (typeof o == "string" || Object.prototype.toString.call(o) !== "[object Symbol]" || Object.prototype.toString.call(s) !== "[object \
683
+ var n = {}, o = Symbol("test"), p = Object(o);
684
+ if (typeof o == "string" || Object.prototype.toString.call(o) !== "[object Symbol]" || Object.prototype.toString.call(p) !== "[object \
703
685
  Symbol]")
704
686
  return !1;
705
- var l = 42;
706
- n[o] = l;
707
- for (o in n)
687
+ var a = 42;
688
+ n[o] = a;
689
+ for (var c in n)
708
690
  return !1;
709
691
  if (typeof Object.keys == "function" && Object.keys(n).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(
710
692
  n).length !== 0)
711
693
  return !1;
712
- var c = Object.getOwnPropertySymbols(n);
713
- if (c.length !== 1 || c[0] !== o || !Object.prototype.propertyIsEnumerable.call(n, o))
694
+ var i = Object.getOwnPropertySymbols(n);
695
+ if (i.length !== 1 || i[0] !== o || !Object.prototype.propertyIsEnumerable.call(n, o))
714
696
  return !1;
715
697
  if (typeof Object.getOwnPropertyDescriptor == "function") {
716
- var i = Object.getOwnPropertyDescriptor(n, o);
717
- if (i.value !== l || i.enumerable !== !0)
698
+ var l = (
699
+ /** @type {PropertyDescriptor} */
700
+ Object.getOwnPropertyDescriptor(n, o)
701
+ );
702
+ if (l.value !== a || l.enumerable !== !0)
718
703
  return !1;
719
704
  }
720
705
  return !0;
721
706
  }, "hasSymbols");
722
707
  }
723
- }), Mt = P({
724
- "node_modules/has-symbols/index.js"(r, t) {
708
+ }), qe = f({
709
+ "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(t, e) {
725
710
  "use strict";
726
- var e = typeof Symbol < "u" && Symbol, n = Ft();
727
- t.exports = /* @__PURE__ */ a(function() {
728
- return typeof e != "function" || typeof Symbol != "function" || typeof e("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 :
711
+ var r = typeof Symbol < "u" && Symbol, n = We();
712
+ e.exports = /* @__PURE__ */ s(function() {
713
+ return typeof r != "function" || typeof Symbol != "function" || typeof r("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 :
729
714
  n();
730
715
  }, "hasNativeSymbols");
731
716
  }
732
- }), we = P({
733
- "node_modules/function-bind/implementation.js"(r, t) {
717
+ }), Be = f({
718
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(t, e) {
734
719
  "use strict";
735
- var e = "Function.prototype.bind called on incompatible ", n = Array.prototype.slice, o = Object.prototype.toString, s = "[object Functi\
736
- on]";
737
- t.exports = /* @__PURE__ */ a(function(c) {
738
- var i = this;
739
- if (typeof i != "function" || o.call(i) !== s)
740
- throw new TypeError(e + i);
741
- for (var g = n.call(arguments, 1), p, u = /* @__PURE__ */ a(function() {
742
- if (this instanceof p) {
743
- var E = i.apply(
720
+ e.exports = typeof Reflect < "u" && Reflect.getPrototypeOf || null;
721
+ }
722
+ }), He = f({
723
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(t, e) {
724
+ "use strict";
725
+ var r = ke();
726
+ e.exports = r.getPrototypeOf || null;
727
+ }
728
+ }), Qt = f({
729
+ "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(t, e) {
730
+ "use strict";
731
+ var r = "Function.prototype.bind called on incompatible ", n = Object.prototype.toString, o = Math.max, p = "[object Function]", a = /* @__PURE__ */ s(
732
+ function(d, u) {
733
+ for (var y = [], g = 0; g < d.length; g += 1)
734
+ y[g] = d[g];
735
+ for (var h = 0; h < u.length; h += 1)
736
+ y[h + d.length] = u[h];
737
+ return y;
738
+ }, "concatty2"), c = /* @__PURE__ */ s(function(d, u) {
739
+ for (var y = [], g = u || 0, h = 0; g < d.length; g += 1, h += 1)
740
+ y[h] = d[g];
741
+ return y;
742
+ }, "slicy2"), i = /* @__PURE__ */ s(function(l, d) {
743
+ for (var u = "", y = 0; y < l.length; y += 1)
744
+ u += l[y], y + 1 < l.length && (u += d);
745
+ return u;
746
+ }, "joiny");
747
+ e.exports = /* @__PURE__ */ s(function(d) {
748
+ var u = this;
749
+ if (typeof u != "function" || n.apply(u) !== p)
750
+ throw new TypeError(r + u);
751
+ for (var y = c(arguments, 1), g, h = /* @__PURE__ */ s(function() {
752
+ if (this instanceof g) {
753
+ var I = u.apply(
744
754
  this,
745
- g.concat(n.call(arguments))
746
- );
747
- return Object(E) === E ? E : this;
748
- } else
749
- return i.apply(
750
- c,
751
- g.concat(n.call(arguments))
755
+ a(y, arguments)
752
756
  );
753
- }, "binder"), y = Math.max(0, i.length - g.length), v = [], d = 0; d < y; d++)
754
- v.push("$" + d);
755
- if (p = Function("binder", "return function (" + v.join(",") + "){ return binder.apply(this,arguments); }")(u), i.prototype) {
756
- var m = /* @__PURE__ */ a(function() {
757
+ return Object(I) === I ? I : this;
758
+ }
759
+ return u.apply(
760
+ d,
761
+ a(y, arguments)
762
+ );
763
+ }, "binder"), C = o(0, u.length - y.length), w = [], A = 0; A < C; A++)
764
+ w[A] = "$" + A;
765
+ if (g = Function("binder", "return function (" + i(w, ",") + "){ return binder.apply(this,arguments); }")(h), u.prototype) {
766
+ var L = /* @__PURE__ */ s(function() {
757
767
  }, "Empty2");
758
- m.prototype = i.prototype, p.prototype = new m(), m.prototype = null;
768
+ L.prototype = u.prototype, g.prototype = new L(), L.prototype = null;
759
769
  }
760
- return p;
770
+ return g;
761
771
  }, "bind");
762
772
  }
763
- }), gt = P({
764
- "node_modules/function-bind/index.js"(r, t) {
773
+ }), pe = f({
774
+ "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(t, e) {
765
775
  "use strict";
766
- var e = we();
767
- t.exports = Function.prototype.bind || e;
776
+ var r = Qt();
777
+ e.exports = Function.prototype.bind || r;
768
778
  }
769
- }), Oe = P({
770
- "node_modules/has/src/index.js"(r, t) {
779
+ }), Ee = f({
780
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(t, e) {
771
781
  "use strict";
772
- var e = gt();
773
- t.exports = e.call(Function.call, Object.prototype.hasOwnProperty);
782
+ e.exports = Function.prototype.call;
774
783
  }
775
- }), $t = P({
776
- "node_modules/get-intrinsic/index.js"(r, t) {
784
+ }), Ve = f({
785
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(t, e) {
777
786
  "use strict";
778
- var e, n = SyntaxError, o = Function, s = TypeError, l = /* @__PURE__ */ a(function(j) {
779
- try {
780
- return o('"use strict"; return (' + j + ").constructor;")();
781
- } catch {
782
- }
783
- }, "getEvalledConstructor"), c = Object.getOwnPropertyDescriptor;
784
- if (c)
787
+ e.exports = Function.prototype.apply;
788
+ }
789
+ }), Zt = f({
790
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(t, e) {
791
+ "use strict";
792
+ e.exports = typeof Reflect < "u" && Reflect && Reflect.apply;
793
+ }
794
+ }), er = f({
795
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(t, e) {
796
+ "use strict";
797
+ var r = pe(), n = Ve(), o = Ee(), p = Zt();
798
+ e.exports = p || r.call(o, n);
799
+ }
800
+ }), Je = f({
801
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(t, e) {
802
+ "use strict";
803
+ var r = pe(), n = me(), o = Ee(), p = er();
804
+ e.exports = /* @__PURE__ */ s(function(c) {
805
+ if (c.length < 1 || typeof c[0] != "function")
806
+ throw new n("a function is required");
807
+ return p(r, o, c);
808
+ }, "callBindBasic");
809
+ }
810
+ }), tr = f({
811
+ "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(t, e) {
812
+ "use strict";
813
+ var r = Je(), n = ve(), o;
814
+ try {
815
+ o = /** @type {{ __proto__?: typeof Array.prototype }} */
816
+ [].__proto__ === Array.prototype;
817
+ } catch (i) {
818
+ if (!i || typeof i != "object" || !("code" in i) || i.code !== "ERR_PROTO_ACCESS")
819
+ throw i;
820
+ }
821
+ var p = !!o && n && n(
822
+ Object.prototype,
823
+ /** @type {keyof typeof Object.prototype} */
824
+ "__proto__"
825
+ ), a = Object, c = a.getPrototypeOf;
826
+ e.exports = p && typeof p.get == "function" ? r([p.get]) : typeof c == "function" ? (
827
+ /** @type {import('./get')} */
828
+ /* @__PURE__ */ s(function(l) {
829
+ return c(l == null ? l : a(l));
830
+ }, "getDunder")
831
+ ) : !1;
832
+ }
833
+ }), rr = f({
834
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(t, e) {
835
+ "use strict";
836
+ var r = Be(), n = He(), o = tr();
837
+ e.exports = r ? /* @__PURE__ */ s(function(a) {
838
+ return r(a);
839
+ }, "getProto") : n ? /* @__PURE__ */ s(function(a) {
840
+ if (!a || typeof a != "object" && typeof a != "function")
841
+ throw new TypeError("getProto: not an object");
842
+ return n(a);
843
+ }, "getProto") : o ? /* @__PURE__ */ s(function(a) {
844
+ return o(a);
845
+ }, "getProto") : null;
846
+ }
847
+ }), ze = f({
848
+ "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(t, e) {
849
+ "use strict";
850
+ var r = Function.prototype.call, n = Object.prototype.hasOwnProperty, o = pe();
851
+ e.exports = o.call(r, n);
852
+ }
853
+ }), nr = f({
854
+ "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(t, e) {
855
+ "use strict";
856
+ var r, n = ke(), o = $t(), p = Ft(), a = Mt(), c = Ut(), i = Gt(), l = me(), d = kt(), u = Wt(), y = qt(), g = Bt(), h = Ht(), C = Vt(),
857
+ w = Jt(), A = Yt(), L = Function, I = /* @__PURE__ */ s(function(P) {
785
858
  try {
786
- c({}, "");
859
+ return L('"use strict"; return (' + P + ").constructor;")();
787
860
  } catch {
788
- c = null;
789
861
  }
790
- var i = /* @__PURE__ */ a(function() {
791
- throw new s();
792
- }, "throwTypeError"), g = c ? function() {
862
+ }, "getEvalledConstructor"), q = ve(), ft = Xt(), de = /* @__PURE__ */ s(function() {
863
+ throw new l();
864
+ }, "throwTypeError"), dt = q ? function() {
793
865
  try {
794
- return arguments.callee, i;
866
+ return arguments.callee, de;
795
867
  } catch {
796
868
  try {
797
- return c(arguments, "callee").get;
869
+ return q(arguments, "callee").get;
798
870
  } catch {
799
- return i;
871
+ return de;
800
872
  }
801
873
  }
802
- }() : i, p = Mt()(), u = Object.getPrototypeOf || function(j) {
803
- return j.__proto__;
804
- }, y = {}, v = typeof Uint8Array > "u" ? e : u(Uint8Array), d = {
805
- "%AggregateError%": typeof AggregateError > "u" ? e : AggregateError,
874
+ }() : de, D = qe()(), E = rr(), yt = He(), ht = Be(), Ce = Ve(), B = Ee(), $ = {}, gt = typeof Uint8Array > "u" || !E ? r : E(Uint8Array),
875
+ R = {
876
+ __proto__: null,
877
+ "%AggregateError%": typeof AggregateError > "u" ? r : AggregateError,
806
878
  "%Array%": Array,
807
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? e : ArrayBuffer,
808
- "%ArrayIteratorPrototype%": p ? u([][Symbol.iterator]()) : e,
809
- "%AsyncFromSyncIteratorPrototype%": e,
810
- "%AsyncFunction%": y,
811
- "%AsyncGenerator%": y,
812
- "%AsyncGeneratorFunction%": y,
813
- "%AsyncIteratorPrototype%": y,
814
- "%Atomics%": typeof Atomics > "u" ? e : Atomics,
815
- "%BigInt%": typeof BigInt > "u" ? e : BigInt,
879
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? r : ArrayBuffer,
880
+ "%ArrayIteratorPrototype%": D && E ? E([][Symbol.iterator]()) : r,
881
+ "%AsyncFromSyncIteratorPrototype%": r,
882
+ "%AsyncFunction%": $,
883
+ "%AsyncGenerator%": $,
884
+ "%AsyncGeneratorFunction%": $,
885
+ "%AsyncIteratorPrototype%": $,
886
+ "%Atomics%": typeof Atomics > "u" ? r : Atomics,
887
+ "%BigInt%": typeof BigInt > "u" ? r : BigInt,
888
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? r : BigInt64Array,
889
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? r : BigUint64Array,
816
890
  "%Boolean%": Boolean,
817
- "%DataView%": typeof DataView > "u" ? e : DataView,
891
+ "%DataView%": typeof DataView > "u" ? r : DataView,
818
892
  "%Date%": Date,
819
893
  "%decodeURI%": decodeURI,
820
894
  "%decodeURIComponent%": decodeURIComponent,
821
895
  "%encodeURI%": encodeURI,
822
896
  "%encodeURIComponent%": encodeURIComponent,
823
- "%Error%": Error,
897
+ "%Error%": o,
824
898
  "%eval%": eval,
825
- "%EvalError%": EvalError,
826
- "%Float32Array%": typeof Float32Array > "u" ? e : Float32Array,
827
- "%Float64Array%": typeof Float64Array > "u" ? e : Float64Array,
828
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? e : FinalizationRegistry,
829
- "%Function%": o,
830
- "%GeneratorFunction%": y,
831
- "%Int8Array%": typeof Int8Array > "u" ? e : Int8Array,
832
- "%Int16Array%": typeof Int16Array > "u" ? e : Int16Array,
833
- "%Int32Array%": typeof Int32Array > "u" ? e : Int32Array,
899
+ // eslint-disable-line no-eval
900
+ "%EvalError%": p,
901
+ "%Float16Array%": typeof Float16Array > "u" ? r : Float16Array,
902
+ "%Float32Array%": typeof Float32Array > "u" ? r : Float32Array,
903
+ "%Float64Array%": typeof Float64Array > "u" ? r : Float64Array,
904
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? r : FinalizationRegistry,
905
+ "%Function%": L,
906
+ "%GeneratorFunction%": $,
907
+ "%Int8Array%": typeof Int8Array > "u" ? r : Int8Array,
908
+ "%Int16Array%": typeof Int16Array > "u" ? r : Int16Array,
909
+ "%Int32Array%": typeof Int32Array > "u" ? r : Int32Array,
834
910
  "%isFinite%": isFinite,
835
911
  "%isNaN%": isNaN,
836
- "%IteratorPrototype%": p ? u(u([][Symbol.iterator]())) : e,
837
- "%JSON%": typeof JSON == "object" ? JSON : e,
838
- "%Map%": typeof Map > "u" ? e : Map,
839
- "%MapIteratorPrototype%": typeof Map > "u" || !p ? e : u((/* @__PURE__ */ new Map())[Symbol.iterator]()),
912
+ "%IteratorPrototype%": D && E ? E(E([][Symbol.iterator]())) : r,
913
+ "%JSON%": typeof JSON == "object" ? JSON : r,
914
+ "%Map%": typeof Map > "u" ? r : Map,
915
+ "%MapIteratorPrototype%": typeof Map > "u" || !D || !E ? r : E((/* @__PURE__ */ new Map())[Symbol.iterator]()),
840
916
  "%Math%": Math,
841
917
  "%Number%": Number,
842
- "%Object%": Object,
918
+ "%Object%": n,
919
+ "%Object.getOwnPropertyDescriptor%": q,
843
920
  "%parseFloat%": parseFloat,
844
921
  "%parseInt%": parseInt,
845
- "%Promise%": typeof Promise > "u" ? e : Promise,
846
- "%Proxy%": typeof Proxy > "u" ? e : Proxy,
847
- "%RangeError%": RangeError,
848
- "%ReferenceError%": ReferenceError,
849
- "%Reflect%": typeof Reflect > "u" ? e : Reflect,
922
+ "%Promise%": typeof Promise > "u" ? r : Promise,
923
+ "%Proxy%": typeof Proxy > "u" ? r : Proxy,
924
+ "%RangeError%": a,
925
+ "%ReferenceError%": c,
926
+ "%Reflect%": typeof Reflect > "u" ? r : Reflect,
850
927
  "%RegExp%": RegExp,
851
- "%Set%": typeof Set > "u" ? e : Set,
852
- "%SetIteratorPrototype%": typeof Set > "u" || !p ? e : u((/* @__PURE__ */ new Set())[Symbol.iterator]()),
853
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? e : SharedArrayBuffer,
928
+ "%Set%": typeof Set > "u" ? r : Set,
929
+ "%SetIteratorPrototype%": typeof Set > "u" || !D || !E ? r : E((/* @__PURE__ */ new Set())[Symbol.iterator]()),
930
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? r : SharedArrayBuffer,
854
931
  "%String%": String,
855
- "%StringIteratorPrototype%": p ? u(""[Symbol.iterator]()) : e,
856
- "%Symbol%": p ? Symbol : e,
857
- "%SyntaxError%": n,
858
- "%ThrowTypeError%": g,
859
- "%TypedArray%": v,
860
- "%TypeError%": s,
861
- "%Uint8Array%": typeof Uint8Array > "u" ? e : Uint8Array,
862
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? e : Uint8ClampedArray,
863
- "%Uint16Array%": typeof Uint16Array > "u" ? e : Uint16Array,
864
- "%Uint32Array%": typeof Uint32Array > "u" ? e : Uint32Array,
865
- "%URIError%": URIError,
866
- "%WeakMap%": typeof WeakMap > "u" ? e : WeakMap,
867
- "%WeakRef%": typeof WeakRef > "u" ? e : WeakRef,
868
- "%WeakSet%": typeof WeakSet > "u" ? e : WeakSet
869
- }, m = /* @__PURE__ */ a(function j(b) {
870
- var T;
871
- if (b === "%AsyncFunction%")
872
- T = l("async function () {}");
873
- else if (b === "%GeneratorFunction%")
874
- T = l("function* () {}");
875
- else if (b === "%AsyncGeneratorFunction%")
876
- T = l("async function* () {}");
877
- else if (b === "%AsyncGenerator%") {
878
- var S = j("%AsyncGeneratorFunction%");
879
- S && (T = S.prototype);
880
- } else if (b === "%AsyncIteratorPrototype%") {
881
- var w = j("%AsyncGenerator%");
882
- w && (T = u(w.prototype));
932
+ "%StringIteratorPrototype%": D && E ? E(""[Symbol.iterator]()) : r,
933
+ "%Symbol%": D ? Symbol : r,
934
+ "%SyntaxError%": i,
935
+ "%ThrowTypeError%": dt,
936
+ "%TypedArray%": gt,
937
+ "%TypeError%": l,
938
+ "%Uint8Array%": typeof Uint8Array > "u" ? r : Uint8Array,
939
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? r : Uint8ClampedArray,
940
+ "%Uint16Array%": typeof Uint16Array > "u" ? r : Uint16Array,
941
+ "%Uint32Array%": typeof Uint32Array > "u" ? r : Uint32Array,
942
+ "%URIError%": d,
943
+ "%WeakMap%": typeof WeakMap > "u" ? r : WeakMap,
944
+ "%WeakRef%": typeof WeakRef > "u" ? r : WeakRef,
945
+ "%WeakSet%": typeof WeakSet > "u" ? r : WeakSet,
946
+ "%Function.prototype.call%": B,
947
+ "%Function.prototype.apply%": Ce,
948
+ "%Object.defineProperty%": ft,
949
+ "%Object.getPrototypeOf%": yt,
950
+ "%Math.abs%": u,
951
+ "%Math.floor%": y,
952
+ "%Math.max%": g,
953
+ "%Math.min%": h,
954
+ "%Math.pow%": C,
955
+ "%Math.round%": w,
956
+ "%Math.sign%": A,
957
+ "%Reflect.getPrototypeOf%": ht
958
+ };
959
+ if (E)
960
+ try {
961
+ null.error;
962
+ } catch (P) {
963
+ Ne = E(E(P)), R["%Error.prototype%"] = Ne;
883
964
  }
884
- return d[b] = T, T;
885
- }, "doEval2"), E = {
965
+ var Ne, mt = /* @__PURE__ */ s(function P(m) {
966
+ var _;
967
+ if (m === "%AsyncFunction%")
968
+ _ = I("async function () {}");
969
+ else if (m === "%GeneratorFunction%")
970
+ _ = I("function* () {}");
971
+ else if (m === "%AsyncGeneratorFunction%")
972
+ _ = I("async function* () {}");
973
+ else if (m === "%AsyncGenerator%") {
974
+ var v = P("%AsyncGeneratorFunction%");
975
+ v && (_ = v.prototype);
976
+ } else if (m === "%AsyncIteratorPrototype%") {
977
+ var S = P("%AsyncGenerator%");
978
+ S && E && (_ = E(S.prototype));
979
+ }
980
+ return R[m] = _, _;
981
+ }, "doEval2"), Ie = {
982
+ __proto__: null,
886
983
  "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
887
984
  "%ArrayPrototype%": ["Array", "prototype"],
888
985
  "%ArrayProto_entries%": ["Array", "prototype", "entries"],
@@ -934,601 +1031,576 @@ on]";
934
1031
  "%URIErrorPrototype%": ["URIError", "prototype"],
935
1032
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
936
1033
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
937
- }, I = gt(), _ = Oe(), R = I.call(Function.call, Array.prototype.concat), C = I.call(Function.apply, Array.prototype.splice), N = I.call(
938
- Function.call, String.prototype.replace), Q = I.call(Function.call, String.prototype.slice), re = I.call(Function.call, RegExp.prototype.
939
- exec), ne = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, oe = /\\(\\)?/g, ie = /* @__PURE__ */ a(
940
- function(b) {
941
- var T = Q(b, 0, 1), S = Q(b, -1);
942
- if (T === "%" && S !== "%")
943
- throw new n("invalid intrinsic syntax, expected closing `%`");
944
- if (S === "%" && T !== "%")
945
- throw new n("invalid intrinsic syntax, expected opening `%`");
946
- var w = [];
947
- return N(b, ne, function(L, M, O, Z) {
948
- w[w.length] = O ? N(Z, oe, "$1") : M || L;
949
- }), w;
950
- }, "stringToPath3"), ae = /* @__PURE__ */ a(function(b, T) {
951
- var S = b, w;
952
- if (_(E, S) && (w = E[S], S = "%" + w[0] + "%"), _(d, S)) {
953
- var L = d[S];
954
- if (L === y && (L = m(S)), typeof L > "u" && !T)
955
- throw new s("intrinsic " + b + " exists, but is not available. Please file an issue!");
1034
+ }, H = pe(), ee = ze(), vt = H.call(B, Array.prototype.concat), Et = H.call(Ce, Array.prototype.splice), Re = H.call(B, String.prototype.
1035
+ replace), te = H.call(B, String.prototype.slice), _t = H.call(B, RegExp.prototype.exec), bt = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,
1036
+ St = /\\(\\)?/g, Tt = /* @__PURE__ */ s(function(m) {
1037
+ var _ = te(m, 0, 1), v = te(m, -1);
1038
+ if (_ === "%" && v !== "%")
1039
+ throw new i("invalid intrinsic syntax, expected closing `%`");
1040
+ if (v === "%" && _ !== "%")
1041
+ throw new i("invalid intrinsic syntax, expected opening `%`");
1042
+ var S = [];
1043
+ return Re(m, bt, function(O, F, T, re) {
1044
+ S[S.length] = T ? Re(re, St, "$1") : F || O;
1045
+ }), S;
1046
+ }, "stringToPath3"), At = /* @__PURE__ */ s(function(m, _) {
1047
+ var v = m, S;
1048
+ if (ee(Ie, v) && (S = Ie[v], v = "%" + S[0] + "%"), ee(R, v)) {
1049
+ var O = R[v];
1050
+ if (O === $ && (O = mt(v)), typeof O > "u" && !_)
1051
+ throw new l("intrinsic " + m + " exists, but is not available. Please file an issue!");
956
1052
  return {
957
- alias: w,
958
- name: S,
959
- value: L
1053
+ alias: S,
1054
+ name: v,
1055
+ value: O
960
1056
  };
961
1057
  }
962
- throw new n("intrinsic " + b + " does not exist!");
1058
+ throw new i("intrinsic " + m + " does not exist!");
963
1059
  }, "getBaseIntrinsic2");
964
- t.exports = /* @__PURE__ */ a(function(b, T) {
965
- if (typeof b != "string" || b.length === 0)
966
- throw new s("intrinsic name must be a non-empty string");
967
- if (arguments.length > 1 && typeof T != "boolean")
968
- throw new s('"allowMissing" argument must be a boolean');
969
- if (re(/^%?[^%]*%?$/, b) === null)
970
- throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
971
- var S = ie(b), w = S.length > 0 ? S[0] : "", L = ae("%" + w + "%", T), M = L.name, O = L.value, Z = !1, pt = L.alias;
972
- pt && (w = pt[0], C(S, R([0, 1], pt)));
973
- for (var tt = 1, z = !0; tt < S.length; tt += 1) {
974
- var D = S[tt], et = Q(D, 0, 1), rt = Q(D, -1);
975
- if ((et === '"' || et === "'" || et === "`" || rt === '"' || rt === "'" || rt === "`") && et !== rt)
976
- throw new n("property names with quotes must have matching quotes");
977
- if ((D === "constructor" || !z) && (Z = !0), w += "." + D, M = "%" + w + "%", _(d, M))
978
- O = d[M];
979
- else if (O != null) {
980
- if (!(D in O)) {
981
- if (!T)
982
- throw new s("base intrinsic for " + b + " exists, but the property is not available.");
1060
+ e.exports = /* @__PURE__ */ s(function(m, _) {
1061
+ if (typeof m != "string" || m.length === 0)
1062
+ throw new l("intrinsic name must be a non-empty string");
1063
+ if (arguments.length > 1 && typeof _ != "boolean")
1064
+ throw new l('"allowMissing" argument must be a boolean');
1065
+ if (_t(/^%?[^%]*%?$/, m) === null)
1066
+ throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
1067
+ var v = Tt(m), S = v.length > 0 ? v[0] : "", O = At("%" + S + "%", _), F = O.name, T = O.value, re = !1, ye = O.alias;
1068
+ ye && (S = ye[0], Et(v, vt([0, 1], ye)));
1069
+ for (var ne = 1, V = !0; ne < v.length; ne += 1) {
1070
+ var N = v[ne], oe = te(N, 0, 1), se = te(N, -1);
1071
+ if ((oe === '"' || oe === "'" || oe === "`" || se === '"' || se === "'" || se === "`") && oe !== se)
1072
+ throw new i("property names with quotes must have matching quotes");
1073
+ if ((N === "constructor" || !V) && (re = !0), S += "." + N, F = "%" + S + "%", ee(R, F))
1074
+ T = R[F];
1075
+ else if (T != null) {
1076
+ if (!(N in T)) {
1077
+ if (!_)
1078
+ throw new l("base intrinsic for " + m + " exists, but the property is not available.");
983
1079
  return;
984
1080
  }
985
- if (c && tt + 1 >= S.length) {
986
- var nt = c(O, D);
987
- z = !!nt, z && "get" in nt && !("originalValue" in nt.get) ? O = nt.get : O = O[D];
1081
+ if (q && ne + 1 >= v.length) {
1082
+ var ie = q(T, N);
1083
+ V = !!ie, V && "get" in ie && !("originalValue" in ie.get) ? T = ie.get : T = T[N];
988
1084
  } else
989
- z = _(O, D), O = O[D];
990
- z && !Z && (d[M] = O);
1085
+ V = ee(T, N), T = T[N];
1086
+ V && !re && (R[F] = T);
991
1087
  }
992
1088
  }
993
- return O;
1089
+ return T;
994
1090
  }, "GetIntrinsic");
995
1091
  }
996
- }), Ce = P({
997
- "node_modules/call-bind/index.js"(r, t) {
998
- "use strict";
999
- var e = gt(), n = $t(), o = n("%Function.prototype.apply%"), s = n("%Function.prototype.call%"), l = n("%Reflect.apply%", !0) || e.call(
1000
- s, o), c = n("%Object.getOwnPropertyDescriptor%", !0), i = n("%Object.defineProperty%", !0), g = n("%Math.max%");
1001
- if (i)
1002
- try {
1003
- i({}, "a", { value: 1 });
1004
- } catch {
1005
- i = null;
1006
- }
1007
- t.exports = /* @__PURE__ */ a(function(y) {
1008
- var v = l(e, s, arguments);
1009
- if (c && i) {
1010
- var d = c(v, "length");
1011
- d.configurable && i(
1012
- v,
1013
- "length",
1014
- { value: 1 + g(0, y.length - (arguments.length - 1)) }
1015
- );
1016
- }
1017
- return v;
1018
- }, "callBind");
1019
- var p = /* @__PURE__ */ a(function() {
1020
- return l(e, o, arguments);
1021
- }, "applyBind2");
1022
- i ? i(t.exports, "apply", { value: p }) : t.exports.apply = p;
1023
- }
1024
- }), Pe = P({
1025
- "node_modules/call-bind/callBound.js"(r, t) {
1092
+ }), _e = f({
1093
+ "node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(t, e) {
1026
1094
  "use strict";
1027
- var e = $t(), n = Ce(), o = n(e("String.prototype.indexOf"));
1028
- t.exports = /* @__PURE__ */ a(function(l, c) {
1029
- var i = e(l, !!c);
1030
- return typeof i == "function" && o(l, ".prototype.") > -1 ? n(i) : i;
1095
+ var r = nr(), n = Je(), o = n([r("%String.prototype.indexOf%")]);
1096
+ e.exports = /* @__PURE__ */ s(function(a, c) {
1097
+ var i = (
1098
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
1099
+ r(a, !!c)
1100
+ );
1101
+ return typeof i == "function" && o(a, ".prototype.") > -1 ? n(
1102
+ /** @type {const} */
1103
+ [i]
1104
+ ) : i;
1031
1105
  }, "callBoundIntrinsic");
1032
1106
  }
1033
- }), Ie = P({
1034
- "node_modules/has-tostringtag/shams.js"(r, t) {
1107
+ }), or = f({
1108
+ "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(t, e) {
1035
1109
  "use strict";
1036
- var e = Ft();
1037
- t.exports = /* @__PURE__ */ a(function() {
1038
- return e() && !!Symbol.toStringTag;
1110
+ var r = We();
1111
+ e.exports = /* @__PURE__ */ s(function() {
1112
+ return r() && !!Symbol.toStringTag;
1039
1113
  }, "hasToStringTagShams");
1040
1114
  }
1041
- }), xe = P({
1042
- "node_modules/is-regex/index.js"(r, t) {
1115
+ }), Ye = f({
1116
+ "node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js"(t, e) {
1043
1117
  "use strict";
1044
- var e = Pe(), n = Ie()(), o, s, l, c;
1045
- n && (o = e("Object.prototype.hasOwnProperty"), s = e("RegExp.prototype.exec"), l = {}, i = /* @__PURE__ */ a(function() {
1046
- throw l;
1047
- }, "throwRegexMarker"), c = {
1048
- toString: i,
1049
- valueOf: i
1050
- }, typeof Symbol.toPrimitive == "symbol" && (c[Symbol.toPrimitive] = i));
1051
- var i, g = e("Object.prototype.toString"), p = Object.getOwnPropertyDescriptor, u = "[object RegExp]";
1052
- t.exports = /* @__PURE__ */ a(n ? function(v) {
1053
- if (!v || typeof v != "object")
1118
+ var r = _e(), n = or()(), o = ze(), p = ve(), a;
1119
+ n ? (c = r("RegExp.prototype.exec"), i = {}, l = /* @__PURE__ */ s(function() {
1120
+ throw i;
1121
+ }, "throwRegexMarker"), d = {
1122
+ toString: l,
1123
+ valueOf: l
1124
+ }, typeof Symbol.toPrimitive == "symbol" && (d[Symbol.toPrimitive] = l), a = /* @__PURE__ */ s(function(h) {
1125
+ if (!h || typeof h != "object")
1054
1126
  return !1;
1055
- var d = p(v, "lastIndex"), m = d && o(d, "value");
1056
- if (!m)
1127
+ var C = (
1128
+ /** @type {NonNullable<typeof gOPD>} */
1129
+ p(
1130
+ /** @type {{ lastIndex?: unknown }} */
1131
+ h,
1132
+ "lastIndex"
1133
+ )
1134
+ ), w = C && o(C, "value");
1135
+ if (!w)
1057
1136
  return !1;
1058
1137
  try {
1059
- s(v, c);
1060
- } catch (E) {
1061
- return E === l;
1138
+ c(
1139
+ h,
1140
+ /** @type {string} */
1141
+ /** @type {unknown} */
1142
+ d
1143
+ );
1144
+ } catch (A) {
1145
+ return A === i;
1062
1146
  }
1063
- } : function(v) {
1064
- return !v || typeof v != "object" && typeof v != "function" ? !1 : g(v) === u;
1065
- }, "isRegex");
1066
- }
1067
- }), Re = P({
1068
- "node_modules/is-function/index.js"(r, t) {
1069
- t.exports = n;
1070
- var e = Object.prototype.toString;
1147
+ }, "isRegex")) : (u = r("Object.prototype.toString"), y = "[object RegExp]", a = /* @__PURE__ */ s(function(h) {
1148
+ return !h || typeof h != "object" && typeof h != "function" ? !1 : u(h) === y;
1149
+ }, "isRegex"));
1150
+ var c, i, l, d, u, y;
1151
+ e.exports = a;
1152
+ }
1153
+ }), sr = f({
1154
+ "node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js"(t, e) {
1155
+ e.exports = n;
1156
+ var r = Object.prototype.toString;
1071
1157
  function n(o) {
1072
1158
  if (!o)
1073
1159
  return !1;
1074
- var s = e.call(o);
1075
- return s === "[object Function]" || typeof o == "function" && s !== "[object RegExp]" || typeof window < "u" && (o === window.setTimeout ||
1076
- o === window.alert || o === window.confirm || o === window.prompt);
1160
+ var p = r.call(o);
1161
+ return p === "[object Function]" || typeof o == "function" && p !== "[object RegExp]" || typeof window < "u" && // IE8 and below
1162
+ (o === window.setTimeout || o === window.alert || o === window.confirm || o === window.prompt);
1077
1163
  }
1078
- a(n, "isFunction3");
1164
+ s(n, "isFunction3");
1079
1165
  }
1080
- }), Ne = P({
1081
- "node_modules/is-symbol/index.js"(r, t) {
1166
+ }), ir = f({
1167
+ "node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js"(t, e) {
1168
+ "use strict";
1169
+ var r = _e(), n = Ye(), o = r("RegExp.prototype.exec"), p = me();
1170
+ e.exports = /* @__PURE__ */ s(function(c) {
1171
+ if (!n(c))
1172
+ throw new p("`regex` must be a RegExp");
1173
+ return /* @__PURE__ */ s(function(l) {
1174
+ return o(c, l) !== null;
1175
+ }, "test");
1176
+ }, "regexTester");
1177
+ }
1178
+ }), ar = f({
1179
+ "node_modules/.pnpm/is-symbol@1.1.1/node_modules/is-symbol/index.js"(t, e) {
1082
1180
  "use strict";
1083
- var e = Object.prototype.toString, n = Mt()();
1084
- n ? (o = Symbol.prototype.toString, s = /^Symbol\(.*\)$/, l = /* @__PURE__ */ a(function(i) {
1085
- return typeof i.valueOf() != "symbol" ? !1 : s.test(o.call(i));
1086
- }, "isRealSymbolObject"), t.exports = /* @__PURE__ */ a(function(i) {
1087
- if (typeof i == "symbol")
1181
+ var r = _e(), n = r("Object.prototype.toString"), o = qe()(), p = ir();
1182
+ o ? (a = r("Symbol.prototype.toString"), c = p(/^Symbol\(.*\)$/), i = /* @__PURE__ */ s(function(d) {
1183
+ return typeof d.valueOf() != "symbol" ? !1 : c(a(d));
1184
+ }, "isRealSymbolObject"), e.exports = /* @__PURE__ */ s(function(d) {
1185
+ if (typeof d == "symbol")
1088
1186
  return !0;
1089
- if (e.call(i) !== "[object Symbol]")
1187
+ if (!d || typeof d != "object" || n(d) !== "[object Symbol]")
1090
1188
  return !1;
1091
1189
  try {
1092
- return l(i);
1190
+ return i(d);
1093
1191
  } catch {
1094
1192
  return !1;
1095
1193
  }
1096
- }, "isSymbol3")) : t.exports = /* @__PURE__ */ a(function(i) {
1194
+ }, "isSymbol3")) : e.exports = /* @__PURE__ */ s(function(d) {
1097
1195
  return !1;
1098
1196
  }, "isSymbol3");
1099
- var o, s, l;
1197
+ var a, c, i;
1100
1198
  }
1101
- }), je = ot(xe()), Le = ot(Re()), De = ot(Ne());
1102
- function Fe(r) {
1103
- return r != null && typeof r == "object" && Array.isArray(r) === !1;
1199
+ }), pr = ae(Ye()), cr = ae(sr()), lr = ae(ar());
1200
+ function ur(t) {
1201
+ return t != null && typeof t == "object" && Array.isArray(t) === !1;
1104
1202
  }
1105
- a(Fe, "isObject");
1106
- var Me = typeof global == "object" && global && global.Object === Object && global, $e = Me, Ue = typeof self == "object" && self && self.Object ===
1107
- Object && self, ke = $e || Ue || Function("return this")(), vt = ke, Ge = vt.Symbol, U = Ge, Ut = Object.prototype, We = Ut.hasOwnProperty, ze = Ut.
1108
- toString, q = U ? U.toStringTag : void 0;
1109
- function He(r) {
1110
- var t = We.call(r, q), e = r[q];
1203
+ s(ur, "isObject");
1204
+ var fr = typeof global == "object" && global && global.Object === Object && global, dr = fr, yr = typeof self == "object" && self && self.Object ===
1205
+ Object && self, hr = dr || yr || Function("return this")(), be = hr, gr = be.Symbol, U = gr, Ke = Object.prototype, mr = Ke.hasOwnProperty, vr = Ke.
1206
+ toString, z = U ? U.toStringTag : void 0;
1207
+ function Er(t) {
1208
+ var e = mr.call(t, z), r = t[z];
1111
1209
  try {
1112
- r[q] = void 0;
1210
+ t[z] = void 0;
1113
1211
  var n = !0;
1114
1212
  } catch {
1115
1213
  }
1116
- var o = ze.call(r);
1117
- return n && (t ? r[q] = e : delete r[q]), o;
1214
+ var o = vr.call(t);
1215
+ return n && (e ? t[z] = r : delete t[z]), o;
1118
1216
  }
1119
- a(He, "getRawTag");
1120
- var Be = He, qe = Object.prototype, Ve = qe.toString;
1121
- function Je(r) {
1122
- return Ve.call(r);
1217
+ s(Er, "getRawTag");
1218
+ var _r = Er, br = Object.prototype, Sr = br.toString;
1219
+ function Tr(t) {
1220
+ return Sr.call(t);
1123
1221
  }
1124
- a(Je, "objectToString");
1125
- var Ke = Je, Ye = "[object Null]", Xe = "[object Undefined]", Rt = U ? U.toStringTag : void 0;
1126
- function Qe(r) {
1127
- return r == null ? r === void 0 ? Xe : Ye : Rt && Rt in Object(r) ? Be(r) : Ke(r);
1222
+ s(Tr, "objectToString");
1223
+ var Ar = Tr, xr = "[object Null]", wr = "[object Undefined]", $e = U ? U.toStringTag : void 0;
1224
+ function Pr(t) {
1225
+ return t == null ? t === void 0 ? wr : xr : $e && $e in Object(t) ? _r(t) : Ar(t);
1128
1226
  }
1129
- a(Qe, "baseGetTag");
1130
- var kt = Qe;
1131
- function Ze(r) {
1132
- return r != null && typeof r == "object";
1227
+ s(Pr, "baseGetTag");
1228
+ var Xe = Pr;
1229
+ function Or(t) {
1230
+ return t != null && typeof t == "object";
1133
1231
  }
1134
- a(Ze, "isObjectLike");
1135
- var tr = Ze, er = "[object Symbol]";
1136
- function rr(r) {
1137
- return typeof r == "symbol" || tr(r) && kt(r) == er;
1232
+ s(Or, "isObjectLike");
1233
+ var Cr = Or, Nr = "[object Symbol]";
1234
+ function Ir(t) {
1235
+ return typeof t == "symbol" || Cr(t) && Xe(t) == Nr;
1138
1236
  }
1139
- a(rr, "isSymbol");
1140
- var mt = rr;
1141
- function nr(r, t) {
1142
- for (var e = -1, n = r == null ? 0 : r.length, o = Array(n); ++e < n; )
1143
- o[e] = t(r[e], e, r);
1237
+ s(Ir, "isSymbol");
1238
+ var Se = Ir;
1239
+ function Rr(t, e) {
1240
+ for (var r = -1, n = t == null ? 0 : t.length, o = Array(n); ++r < n; )
1241
+ o[r] = e(t[r], r, t);
1144
1242
  return o;
1145
1243
  }
1146
- a(nr, "arrayMap");
1147
- var or = nr, ir = Array.isArray, Et = ir, ar = 1 / 0, Nt = U ? U.prototype : void 0, jt = Nt ? Nt.toString : void 0;
1148
- function Gt(r) {
1149
- if (typeof r == "string")
1150
- return r;
1151
- if (Et(r))
1152
- return or(r, Gt) + "";
1153
- if (mt(r))
1154
- return jt ? jt.call(r) : "";
1155
- var t = r + "";
1156
- return t == "0" && 1 / r == -ar ? "-0" : t;
1244
+ s(Rr, "arrayMap");
1245
+ var jr = Rr, Lr = Array.isArray, Te = Lr, Dr = 1 / 0, Fe = U ? U.prototype : void 0, Me = Fe ? Fe.toString : void 0;
1246
+ function Qe(t) {
1247
+ if (typeof t == "string")
1248
+ return t;
1249
+ if (Te(t))
1250
+ return jr(t, Qe) + "";
1251
+ if (Se(t))
1252
+ return Me ? Me.call(t) : "";
1253
+ var e = t + "";
1254
+ return e == "0" && 1 / t == -Dr ? "-0" : e;
1157
1255
  }
1158
- a(Gt, "baseToString");
1159
- var sr = Gt;
1160
- function lr(r) {
1161
- var t = typeof r;
1162
- return r != null && (t == "object" || t == "function");
1256
+ s(Qe, "baseToString");
1257
+ var $r = Qe;
1258
+ function Fr(t) {
1259
+ var e = typeof t;
1260
+ return t != null && (e == "object" || e == "function");
1163
1261
  }
1164
- a(lr, "isObject2");
1165
- var Wt = lr, cr = "[object AsyncFunction]", pr = "[object Function]", ur = "[object GeneratorFunction]", fr = "[object Proxy]";
1166
- function hr(r) {
1167
- if (!Wt(r))
1262
+ s(Fr, "isObject2");
1263
+ var Ze = Fr, Mr = "[object AsyncFunction]", Ur = "[object Function]", Gr = "[object GeneratorFunction]", kr = "[object Proxy]";
1264
+ function Wr(t) {
1265
+ if (!Ze(t))
1168
1266
  return !1;
1169
- var t = kt(r);
1170
- return t == pr || t == ur || t == cr || t == fr;
1267
+ var e = Xe(t);
1268
+ return e == Ur || e == Gr || e == Mr || e == kr;
1171
1269
  }
1172
- a(hr, "isFunction");
1173
- var yr = hr, dr = vt["__core-js_shared__"], dt = dr, Lt = function() {
1174
- var r = /[^.]+$/.exec(dt && dt.keys && dt.keys.IE_PROTO || "");
1175
- return r ? "Symbol(src)_1." + r : "";
1270
+ s(Wr, "isFunction");
1271
+ var qr = Wr, Br = be["__core-js_shared__"], ge = Br, Ue = function() {
1272
+ var t = /[^.]+$/.exec(ge && ge.keys && ge.keys.IE_PROTO || "");
1273
+ return t ? "Symbol(src)_1." + t : "";
1176
1274
  }();
1177
- function gr(r) {
1178
- return !!Lt && Lt in r;
1275
+ function Hr(t) {
1276
+ return !!Ue && Ue in t;
1179
1277
  }
1180
- a(gr, "isMasked");
1181
- var vr = gr, mr = Function.prototype, Er = mr.toString;
1182
- function br(r) {
1183
- if (r != null) {
1278
+ s(Hr, "isMasked");
1279
+ var Vr = Hr, Jr = Function.prototype, zr = Jr.toString;
1280
+ function Yr(t) {
1281
+ if (t != null) {
1184
1282
  try {
1185
- return Er.call(r);
1283
+ return zr.call(t);
1186
1284
  } catch {
1187
1285
  }
1188
1286
  try {
1189
- return r + "";
1287
+ return t + "";
1190
1288
  } catch {
1191
1289
  }
1192
1290
  }
1193
1291
  return "";
1194
1292
  }
1195
- a(br, "toSource");
1196
- var Sr = br, _r = /[\\^$.*+?()[\]{}|]/g, Tr = /^\[object .+?Constructor\]$/, Ar = Function.prototype, wr = Object.prototype, Or = Ar.toString,
1197
- Cr = wr.hasOwnProperty, Pr = RegExp(
1198
- "^" + Or.call(Cr).replace(_r, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1293
+ s(Yr, "toSource");
1294
+ var Kr = Yr, Xr = /[\\^$.*+?()[\]{}|]/g, Qr = /^\[object .+?Constructor\]$/, Zr = Function.prototype, en = Object.prototype, tn = Zr.toString,
1295
+ rn = en.hasOwnProperty, nn = RegExp(
1296
+ "^" + tn.call(rn).replace(Xr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1199
1297
  );
1200
- function Ir(r) {
1201
- if (!Wt(r) || vr(r))
1298
+ function on(t) {
1299
+ if (!Ze(t) || Vr(t))
1202
1300
  return !1;
1203
- var t = yr(r) ? Pr : Tr;
1204
- return t.test(Sr(r));
1301
+ var e = qr(t) ? nn : Qr;
1302
+ return e.test(Kr(t));
1205
1303
  }
1206
- a(Ir, "baseIsNative");
1207
- var xr = Ir;
1208
- function Rr(r, t) {
1209
- return r?.[t];
1304
+ s(on, "baseIsNative");
1305
+ var sn = on;
1306
+ function an(t, e) {
1307
+ return t?.[e];
1210
1308
  }
1211
- a(Rr, "getValue");
1212
- var Nr = Rr;
1213
- function jr(r, t) {
1214
- var e = Nr(r, t);
1215
- return xr(e) ? e : void 0;
1309
+ s(an, "getValue");
1310
+ var pn = an;
1311
+ function cn(t, e) {
1312
+ var r = pn(t, e);
1313
+ return sn(r) ? r : void 0;
1216
1314
  }
1217
- a(jr, "getNative");
1218
- var zt = jr;
1219
- function Lr(r, t) {
1220
- return r === t || r !== r && t !== t;
1315
+ s(cn, "getNative");
1316
+ var et = cn;
1317
+ function ln(t, e) {
1318
+ return t === e || t !== t && e !== e;
1221
1319
  }
1222
- a(Lr, "eq");
1223
- var Dr = Lr, Fr = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Mr = /^\w*$/;
1224
- function $r(r, t) {
1225
- if (Et(r))
1320
+ s(ln, "eq");
1321
+ var un = ln, fn = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, dn = /^\w*$/;
1322
+ function yn(t, e) {
1323
+ if (Te(t))
1226
1324
  return !1;
1227
- var e = typeof r;
1228
- return e == "number" || e == "symbol" || e == "boolean" || r == null || mt(r) ? !0 : Mr.test(r) || !Fr.test(r) || t != null && r in Object(
1229
- t);
1325
+ var r = typeof t;
1326
+ return r == "number" || r == "symbol" || r == "boolean" || t == null || Se(t) ? !0 : dn.test(t) || !fn.test(t) || e != null && t in Object(
1327
+ e);
1230
1328
  }
1231
- a($r, "isKey");
1232
- var Ur = $r, kr = zt(Object, "create"), V = kr;
1233
- function Gr() {
1234
- this.__data__ = V ? V(null) : {}, this.size = 0;
1329
+ s(yn, "isKey");
1330
+ var hn = yn, gn = et(Object, "create"), Y = gn;
1331
+ function mn() {
1332
+ this.__data__ = Y ? Y(null) : {}, this.size = 0;
1235
1333
  }
1236
- a(Gr, "hashClear");
1237
- var Wr = Gr;
1238
- function zr(r) {
1239
- var t = this.has(r) && delete this.__data__[r];
1240
- return this.size -= t ? 1 : 0, t;
1334
+ s(mn, "hashClear");
1335
+ var vn = mn;
1336
+ function En(t) {
1337
+ var e = this.has(t) && delete this.__data__[t];
1338
+ return this.size -= e ? 1 : 0, e;
1241
1339
  }
1242
- a(zr, "hashDelete");
1243
- var Hr = zr, Br = "__lodash_hash_undefined__", qr = Object.prototype, Vr = qr.hasOwnProperty;
1244
- function Jr(r) {
1245
- var t = this.__data__;
1246
- if (V) {
1247
- var e = t[r];
1248
- return e === Br ? void 0 : e;
1249
- }
1250
- return Vr.call(t, r) ? t[r] : void 0;
1251
- }
1252
- a(Jr, "hashGet");
1253
- var Kr = Jr, Yr = Object.prototype, Xr = Yr.hasOwnProperty;
1254
- function Qr(r) {
1255
- var t = this.__data__;
1256
- return V ? t[r] !== void 0 : Xr.call(t, r);
1340
+ s(En, "hashDelete");
1341
+ var _n = En, bn = "__lodash_hash_undefined__", Sn = Object.prototype, Tn = Sn.hasOwnProperty;
1342
+ function An(t) {
1343
+ var e = this.__data__;
1344
+ if (Y) {
1345
+ var r = e[t];
1346
+ return r === bn ? void 0 : r;
1347
+ }
1348
+ return Tn.call(e, t) ? e[t] : void 0;
1257
1349
  }
1258
- a(Qr, "hashHas");
1259
- var Zr = Qr, tn = "__lodash_hash_undefined__";
1260
- function en(r, t) {
1350
+ s(An, "hashGet");
1351
+ var xn = An, wn = Object.prototype, Pn = wn.hasOwnProperty;
1352
+ function On(t) {
1261
1353
  var e = this.__data__;
1262
- return this.size += this.has(r) ? 0 : 1, e[r] = V && t === void 0 ? tn : t, this;
1354
+ return Y ? e[t] !== void 0 : Pn.call(e, t);
1263
1355
  }
1264
- a(en, "hashSet");
1265
- var rn = en;
1266
- function k(r) {
1267
- var t = -1, e = r == null ? 0 : r.length;
1268
- for (this.clear(); ++t < e; ) {
1269
- var n = r[t];
1356
+ s(On, "hashHas");
1357
+ var Cn = On, Nn = "__lodash_hash_undefined__";
1358
+ function In(t, e) {
1359
+ var r = this.__data__;
1360
+ return this.size += this.has(t) ? 0 : 1, r[t] = Y && e === void 0 ? Nn : e, this;
1361
+ }
1362
+ s(In, "hashSet");
1363
+ var Rn = In;
1364
+ function G(t) {
1365
+ var e = -1, r = t == null ? 0 : t.length;
1366
+ for (this.clear(); ++e < r; ) {
1367
+ var n = t[e];
1270
1368
  this.set(n[0], n[1]);
1271
1369
  }
1272
1370
  }
1273
- a(k, "Hash");
1274
- k.prototype.clear = Wr;
1275
- k.prototype.delete = Hr;
1276
- k.prototype.get = Kr;
1277
- k.prototype.has = Zr;
1278
- k.prototype.set = rn;
1279
- var Dt = k;
1280
- function nn() {
1371
+ s(G, "Hash");
1372
+ G.prototype.clear = vn;
1373
+ G.prototype.delete = _n;
1374
+ G.prototype.get = xn;
1375
+ G.prototype.has = Cn;
1376
+ G.prototype.set = Rn;
1377
+ var Ge = G;
1378
+ function jn() {
1281
1379
  this.__data__ = [], this.size = 0;
1282
1380
  }
1283
- a(nn, "listCacheClear");
1284
- var on = nn;
1285
- function an(r, t) {
1286
- for (var e = r.length; e--; )
1287
- if (Dr(r[e][0], t))
1288
- return e;
1381
+ s(jn, "listCacheClear");
1382
+ var Ln = jn;
1383
+ function Dn(t, e) {
1384
+ for (var r = t.length; r--; )
1385
+ if (un(t[r][0], e))
1386
+ return r;
1289
1387
  return -1;
1290
1388
  }
1291
- a(an, "assocIndexOf");
1292
- var at = an, sn = Array.prototype, ln = sn.splice;
1293
- function cn(r) {
1294
- var t = this.__data__, e = at(t, r);
1295
- if (e < 0)
1389
+ s(Dn, "assocIndexOf");
1390
+ var ce = Dn, $n = Array.prototype, Fn = $n.splice;
1391
+ function Mn(t) {
1392
+ var e = this.__data__, r = ce(e, t);
1393
+ if (r < 0)
1296
1394
  return !1;
1297
- var n = t.length - 1;
1298
- return e == n ? t.pop() : ln.call(t, e, 1), --this.size, !0;
1395
+ var n = e.length - 1;
1396
+ return r == n ? e.pop() : Fn.call(e, r, 1), --this.size, !0;
1299
1397
  }
1300
- a(cn, "listCacheDelete");
1301
- var pn = cn;
1302
- function un(r) {
1303
- var t = this.__data__, e = at(t, r);
1304
- return e < 0 ? void 0 : t[e][1];
1398
+ s(Mn, "listCacheDelete");
1399
+ var Un = Mn;
1400
+ function Gn(t) {
1401
+ var e = this.__data__, r = ce(e, t);
1402
+ return r < 0 ? void 0 : e[r][1];
1305
1403
  }
1306
- a(un, "listCacheGet");
1307
- var fn = un;
1308
- function hn(r) {
1309
- return at(this.__data__, r) > -1;
1404
+ s(Gn, "listCacheGet");
1405
+ var kn = Gn;
1406
+ function Wn(t) {
1407
+ return ce(this.__data__, t) > -1;
1310
1408
  }
1311
- a(hn, "listCacheHas");
1312
- var yn = hn;
1313
- function dn(r, t) {
1314
- var e = this.__data__, n = at(e, r);
1315
- return n < 0 ? (++this.size, e.push([r, t])) : e[n][1] = t, this;
1409
+ s(Wn, "listCacheHas");
1410
+ var qn = Wn;
1411
+ function Bn(t, e) {
1412
+ var r = this.__data__, n = ce(r, t);
1413
+ return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
1316
1414
  }
1317
- a(dn, "listCacheSet");
1318
- var gn = dn;
1319
- function G(r) {
1320
- var t = -1, e = r == null ? 0 : r.length;
1321
- for (this.clear(); ++t < e; ) {
1322
- var n = r[t];
1415
+ s(Bn, "listCacheSet");
1416
+ var Hn = Bn;
1417
+ function k(t) {
1418
+ var e = -1, r = t == null ? 0 : t.length;
1419
+ for (this.clear(); ++e < r; ) {
1420
+ var n = t[e];
1323
1421
  this.set(n[0], n[1]);
1324
1422
  }
1325
1423
  }
1326
- a(G, "ListCache");
1327
- G.prototype.clear = on;
1328
- G.prototype.delete = pn;
1329
- G.prototype.get = fn;
1330
- G.prototype.has = yn;
1331
- G.prototype.set = gn;
1332
- var vn = G, mn = zt(vt, "Map"), En = mn;
1333
- function bn() {
1424
+ s(k, "ListCache");
1425
+ k.prototype.clear = Ln;
1426
+ k.prototype.delete = Un;
1427
+ k.prototype.get = kn;
1428
+ k.prototype.has = qn;
1429
+ k.prototype.set = Hn;
1430
+ var Vn = k, Jn = et(be, "Map"), zn = Jn;
1431
+ function Yn() {
1334
1432
  this.size = 0, this.__data__ = {
1335
- hash: new Dt(),
1336
- map: new (En || vn)(),
1337
- string: new Dt()
1433
+ hash: new Ge(),
1434
+ map: new (zn || Vn)(),
1435
+ string: new Ge()
1338
1436
  };
1339
1437
  }
1340
- a(bn, "mapCacheClear");
1341
- var Sn = bn;
1342
- function _n(r) {
1343
- var t = typeof r;
1344
- return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? r !== "__proto__" : r === null;
1438
+ s(Yn, "mapCacheClear");
1439
+ var Kn = Yn;
1440
+ function Xn(t) {
1441
+ var e = typeof t;
1442
+ return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
1345
1443
  }
1346
- a(_n, "isKeyable");
1347
- var Tn = _n;
1348
- function An(r, t) {
1349
- var e = r.__data__;
1350
- return Tn(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map;
1444
+ s(Xn, "isKeyable");
1445
+ var Qn = Xn;
1446
+ function Zn(t, e) {
1447
+ var r = t.__data__;
1448
+ return Qn(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
1351
1449
  }
1352
- a(An, "getMapData");
1353
- var st = An;
1354
- function wn(r) {
1355
- var t = st(this, r).delete(r);
1356
- return this.size -= t ? 1 : 0, t;
1450
+ s(Zn, "getMapData");
1451
+ var le = Zn;
1452
+ function eo(t) {
1453
+ var e = le(this, t).delete(t);
1454
+ return this.size -= e ? 1 : 0, e;
1357
1455
  }
1358
- a(wn, "mapCacheDelete");
1359
- var On = wn;
1360
- function Cn(r) {
1361
- return st(this, r).get(r);
1456
+ s(eo, "mapCacheDelete");
1457
+ var to = eo;
1458
+ function ro(t) {
1459
+ return le(this, t).get(t);
1362
1460
  }
1363
- a(Cn, "mapCacheGet");
1364
- var Pn = Cn;
1365
- function In(r) {
1366
- return st(this, r).has(r);
1461
+ s(ro, "mapCacheGet");
1462
+ var no = ro;
1463
+ function oo(t) {
1464
+ return le(this, t).has(t);
1367
1465
  }
1368
- a(In, "mapCacheHas");
1369
- var xn = In;
1370
- function Rn(r, t) {
1371
- var e = st(this, r), n = e.size;
1372
- return e.set(r, t), this.size += e.size == n ? 0 : 1, this;
1466
+ s(oo, "mapCacheHas");
1467
+ var so = oo;
1468
+ function io(t, e) {
1469
+ var r = le(this, t), n = r.size;
1470
+ return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
1373
1471
  }
1374
- a(Rn, "mapCacheSet");
1375
- var Nn = Rn;
1376
- function W(r) {
1377
- var t = -1, e = r == null ? 0 : r.length;
1378
- for (this.clear(); ++t < e; ) {
1379
- var n = r[t];
1472
+ s(io, "mapCacheSet");
1473
+ var ao = io;
1474
+ function W(t) {
1475
+ var e = -1, r = t == null ? 0 : t.length;
1476
+ for (this.clear(); ++e < r; ) {
1477
+ var n = t[e];
1380
1478
  this.set(n[0], n[1]);
1381
1479
  }
1382
1480
  }
1383
- a(W, "MapCache");
1384
- W.prototype.clear = Sn;
1385
- W.prototype.delete = On;
1386
- W.prototype.get = Pn;
1387
- W.prototype.has = xn;
1388
- W.prototype.set = Nn;
1389
- var Ht = W, jn = "Expected a function";
1390
- function bt(r, t) {
1391
- if (typeof r != "function" || t != null && typeof t != "function")
1392
- throw new TypeError(jn);
1393
- var e = /* @__PURE__ */ a(function() {
1394
- var n = arguments, o = t ? t.apply(this, n) : n[0], s = e.cache;
1395
- if (s.has(o))
1396
- return s.get(o);
1397
- var l = r.apply(this, n);
1398
- return e.cache = s.set(o, l) || s, l;
1481
+ s(W, "MapCache");
1482
+ W.prototype.clear = Kn;
1483
+ W.prototype.delete = to;
1484
+ W.prototype.get = no;
1485
+ W.prototype.has = so;
1486
+ W.prototype.set = ao;
1487
+ var tt = W, po = "Expected a function";
1488
+ function Ae(t, e) {
1489
+ if (typeof t != "function" || e != null && typeof e != "function")
1490
+ throw new TypeError(po);
1491
+ var r = /* @__PURE__ */ s(function() {
1492
+ var n = arguments, o = e ? e.apply(this, n) : n[0], p = r.cache;
1493
+ if (p.has(o))
1494
+ return p.get(o);
1495
+ var a = t.apply(this, n);
1496
+ return r.cache = p.set(o, a) || p, a;
1399
1497
  }, "memoized");
1400
- return e.cache = new (bt.Cache || Ht)(), e;
1498
+ return r.cache = new (Ae.Cache || tt)(), r;
1401
1499
  }
1402
- a(bt, "memoize");
1403
- bt.Cache = Ht;
1404
- var Ln = bt, Dn = 500;
1405
- function Fn(r) {
1406
- var t = Ln(r, function(n) {
1407
- return e.size === Dn && e.clear(), n;
1408
- }), e = t.cache;
1409
- return t;
1500
+ s(Ae, "memoize");
1501
+ Ae.Cache = tt;
1502
+ var co = Ae, lo = 500;
1503
+ function uo(t) {
1504
+ var e = co(t, function(n) {
1505
+ return r.size === lo && r.clear(), n;
1506
+ }), r = e.cache;
1507
+ return e;
1410
1508
  }
1411
- a(Fn, "memoizeCapped");
1412
- var Mn = Fn, $n = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Un = /\\(\\)?/g, kn = Mn(
1413
- function(r) {
1414
- var t = [];
1415
- return r.charCodeAt(0) === 46 && t.push(""), r.replace($n, function(e, n, o, s) {
1416
- t.push(o ? s.replace(Un, "$1") : n || e);
1417
- }), t;
1418
- }), Gn = kn;
1419
- function Wn(r) {
1420
- return r == null ? "" : sr(r);
1509
+ s(uo, "memoizeCapped");
1510
+ var fo = uo, yo = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ho = /\\(\\)?/g, go = fo(
1511
+ function(t) {
1512
+ var e = [];
1513
+ return t.charCodeAt(0) === 46 && e.push(""), t.replace(yo, function(r, n, o, p) {
1514
+ e.push(o ? p.replace(ho, "$1") : n || r);
1515
+ }), e;
1516
+ }), mo = go;
1517
+ function vo(t) {
1518
+ return t == null ? "" : $r(t);
1421
1519
  }
1422
- a(Wn, "toString");
1423
- var zn = Wn;
1424
- function Hn(r, t) {
1425
- return Et(r) ? r : Ur(r, t) ? [r] : Gn(zn(r));
1520
+ s(vo, "toString");
1521
+ var Eo = vo;
1522
+ function _o(t, e) {
1523
+ return Te(t) ? t : hn(t, e) ? [t] : mo(Eo(t));
1426
1524
  }
1427
- a(Hn, "castPath");
1428
- var Bn = Hn, qn = 1 / 0;
1429
- function Vn(r) {
1430
- if (typeof r == "string" || mt(r))
1431
- return r;
1432
- var t = r + "";
1433
- return t == "0" && 1 / r == -qn ? "-0" : t;
1525
+ s(_o, "castPath");
1526
+ var bo = _o, So = 1 / 0;
1527
+ function To(t) {
1528
+ if (typeof t == "string" || Se(t))
1529
+ return t;
1530
+ var e = t + "";
1531
+ return e == "0" && 1 / t == -So ? "-0" : e;
1434
1532
  }
1435
- a(Vn, "toKey");
1436
- var Jn = Vn;
1437
- function Kn(r, t) {
1438
- t = Bn(t, r);
1439
- for (var e = 0, n = t.length; r != null && e < n; )
1440
- r = r[Jn(t[e++])];
1441
- return e && e == n ? r : void 0;
1533
+ s(To, "toKey");
1534
+ var Ao = To;
1535
+ function xo(t, e) {
1536
+ e = bo(e, t);
1537
+ for (var r = 0, n = e.length; t != null && r < n; )
1538
+ t = t[Ao(e[r++])];
1539
+ return r && r == n ? t : void 0;
1442
1540
  }
1443
- a(Kn, "baseGet");
1444
- var Yn = Kn;
1445
- function Xn(r, t, e) {
1446
- var n = r == null ? void 0 : Yn(r, t);
1447
- return n === void 0 ? e : n;
1541
+ s(xo, "baseGet");
1542
+ var wo = xo;
1543
+ function Po(t, e, r) {
1544
+ var n = t == null ? void 0 : wo(t, e);
1545
+ return n === void 0 ? r : n;
1448
1546
  }
1449
- a(Xn, "get");
1450
- var Qn = Xn, it = Fe, Zn = /* @__PURE__ */ a((r) => {
1451
- let t = null, e = !1, n = !1, o = !1, s = "";
1452
- if (r.indexOf("//") >= 0 || r.indexOf("/*") >= 0)
1453
- for (let l = 0; l < r.length; l += 1)
1454
- !t && !e && !n && !o ? r[l] === '"' || r[l] === "'" || r[l] === "`" ? t = r[l] : r[l] === "/" && r[l + 1] === "*" ? e = !0 : r[l] === "\
1455
- /" && r[l + 1] === "/" ? n = !0 : r[l] === "/" && r[l + 1] !== "/" && (o = !0) : (t && (r[l] === t && r[l - 1] !== "\\" || r[l] === `
1456
- ` && t !== "`") && (t = null), o && (r[l] === "/" && r[l - 1] !== "\\" || r[l] === `
1457
- `) && (o = !1), e && r[l - 1] === "/" && r[l - 2] === "*" && (e = !1), n && r[l] === `
1458
- ` && (n = !1)), !e && !n && (s += r[l]);
1459
- else
1460
- s = r;
1461
- return s;
1462
- }, "removeCodeComments"), to = (0, Bt.default)(1e4)(
1463
- (r) => Zn(r).replace(/\n\s*/g, "").trim()
1464
- ), eo = /* @__PURE__ */ a(function(t, e) {
1465
- let n = e.slice(0, e.indexOf("{")), o = e.slice(e.indexOf("{"));
1466
- if (n.includes("=>") || n.includes("function"))
1467
- return e;
1468
- let s = n;
1469
- return s = s.replace(t, "function"), s + o;
1470
- }, "convertShorthandMethods2"), ro = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, J = /* @__PURE__ */ a((r) => r.match(/^[\[\{\"\}].*[\]\}\"]$/),
1547
+ s(Po, "get");
1548
+ var Oo = Po, xe = ur, Co = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, K = /* @__PURE__ */ s((t) => t.match(/^[\[\{\"\}].*[\]\}\"]$/),
1471
1549
  "isJSON");
1472
- function qt(r) {
1473
- if (!it(r))
1474
- return r;
1475
- let t = r, e = !1;
1476
- return typeof Event < "u" && r instanceof Event && (t = Pt(t), e = !0), t = Object.keys(t).reduce((n, o) => {
1550
+ function rt(t) {
1551
+ if (!xe(t))
1552
+ return t;
1553
+ let e = t, r = !1;
1554
+ return typeof Event < "u" && t instanceof Event && (e = De(e), r = !0), e = Object.keys(e).reduce((n, o) => {
1477
1555
  try {
1478
- t[o] && t[o].toJSON, n[o] = t[o];
1556
+ e[o] && e[o].toJSON, n[o] = e[o];
1479
1557
  } catch {
1480
- e = !0;
1558
+ r = !0;
1481
1559
  }
1482
1560
  return n;
1483
- }, {}), e ? t : r;
1561
+ }, {}), r ? e : t;
1484
1562
  }
1485
- a(qt, "convertUnconventionalData");
1486
- var no = /* @__PURE__ */ a(function(t) {
1487
- let e, n, o, s;
1488
- return /* @__PURE__ */ a(function(c, i) {
1563
+ s(rt, "convertUnconventionalData");
1564
+ var No = /* @__PURE__ */ s(function(e) {
1565
+ let r, n, o, p;
1566
+ return /* @__PURE__ */ s(function(c, i) {
1489
1567
  try {
1490
1568
  if (c === "")
1491
- return s = [], e = /* @__PURE__ */ new Map([[i, "[]"]]), n = /* @__PURE__ */ new Map(), o = [], i;
1492
- let g = n.get(this) || this;
1493
- for (; o.length && g !== o[0]; )
1494
- o.shift(), s.pop();
1569
+ return p = [], r = /* @__PURE__ */ new Map([[i, "[]"]]), n = /* @__PURE__ */ new Map(), o = [], i;
1570
+ let l = n.get(this) || this;
1571
+ for (; o.length && l !== o[0]; )
1572
+ o.shift(), p.pop();
1495
1573
  if (typeof i == "boolean")
1496
1574
  return i;
1497
1575
  if (i === void 0)
1498
- return t.allowUndefined ? "_undefined_" : void 0;
1576
+ return e.allowUndefined ? "_undefined_" : void 0;
1499
1577
  if (i === null)
1500
1578
  return null;
1501
1579
  if (typeof i == "number")
1502
- return i === -1 / 0 ? "_-Infinity_" : i === 1 / 0 ? "_Infinity_" : Number.isNaN(i) ? "_NaN_" : i;
1580
+ return i === Number.NEGATIVE_INFINITY ? "_-Infinity_" : i === Number.POSITIVE_INFINITY ? "_Infinity_" : Number.isNaN(i) ? "_NaN_" : i;
1503
1581
  if (typeof i == "bigint")
1504
1582
  return `_bigint_${i.toString()}`;
1505
1583
  if (typeof i == "string")
1506
- return ro.test(i) ? t.allowDate ? `_date_${i}` : void 0 : i;
1507
- if ((0, je.default)(i))
1508
- return t.allowRegExp ? `_regexp_${i.flags}|${i.source}` : void 0;
1509
- if ((0, Le.default)(i)) {
1510
- if (!t.allowFunction)
1511
- return;
1512
- let { name: u } = i, y = i.toString();
1513
- return y.match(
1514
- /(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/
1515
- ) ? `_function_${u}|${(() => {
1516
- }).toString()}` : `_function_${u}|${to(eo(c, y))}`;
1517
- }
1518
- if ((0, De.default)(i)) {
1519
- if (!t.allowSymbol)
1584
+ return Co.test(i) ? e.allowDate ? `_date_${i}` : void 0 : i;
1585
+ if ((0, pr.default)(i))
1586
+ return e.allowRegExp ? `_regexp_${i.flags}|${i.source}` : void 0;
1587
+ if ((0, cr.default)(i))
1588
+ return;
1589
+ if ((0, lr.default)(i)) {
1590
+ if (!e.allowSymbol)
1520
1591
  return;
1521
1592
  let u = Symbol.keyFor(i);
1522
1593
  return u !== void 0 ? `_gsymbol_${u}` : `_symbol_${i.toString().slice(7, -1)}`;
1523
1594
  }
1524
- if (o.length >= t.maxDepth)
1595
+ if (o.length >= e.maxDepth)
1525
1596
  return Array.isArray(i) ? `[Array(${i.length})]` : "[Object]";
1526
1597
  if (i === this)
1527
- return `_duplicate_${JSON.stringify(s)}`;
1528
- if (i instanceof Error && t.allowError)
1598
+ return `_duplicate_${JSON.stringify(p)}`;
1599
+ if (i instanceof Error && e.allowError)
1529
1600
  return {
1530
1601
  __isConvertedError__: !0,
1531
1602
  errorProperties: {
1603
+ // @ts-expect-error cause is not defined in the current tsconfig target(es2020)
1532
1604
  ...i.cause ? { cause: i.cause } : {},
1533
1605
  ...i,
1534
1606
  name: i.name,
@@ -1537,152 +1609,143 @@ var no = /* @__PURE__ */ a(function(t) {
1537
1609
  "_constructor-name_": i.constructor.name
1538
1610
  }
1539
1611
  };
1540
- if (i.constructor && i.constructor.name && i.constructor.name !== "Object" && !Array.isArray(i) && !t.allowClass)
1541
- return;
1542
- let p = e.get(i);
1543
- if (!p) {
1544
- let u = Array.isArray(i) ? i : qt(i);
1545
- if (i.constructor && i.constructor.name && i.constructor.name !== "Object" && !Array.isArray(i) && t.allowClass)
1546
- try {
1547
- Object.assign(u, { "_constructor-name_": i.constructor.name });
1548
- } catch {
1549
- }
1550
- return s.push(c), o.unshift(u), e.set(i, JSON.stringify(s)), i !== u && n.set(i, u), u;
1612
+ if (i?.constructor?.name && i.constructor.name !== "Object" && !Array.isArray(i)) {
1613
+ let u = r.get(i);
1614
+ if (!u) {
1615
+ let y = {
1616
+ __isClassInstance__: !0,
1617
+ __className__: i.constructor.name,
1618
+ ...Object.getOwnPropertyNames(i).reduce(
1619
+ (g, h) => {
1620
+ try {
1621
+ g[h] = i[h];
1622
+ } catch {
1623
+ }
1624
+ return g;
1625
+ },
1626
+ {}
1627
+ )
1628
+ };
1629
+ return p.push(c), o.unshift(y), r.set(i, JSON.stringify(p)), i !== y && n.set(i, y), y;
1630
+ }
1631
+ return `_duplicate_${u}`;
1551
1632
  }
1552
- return `_duplicate_${p}`;
1633
+ let d = r.get(i);
1634
+ if (!d) {
1635
+ let u = Array.isArray(i) ? i : rt(i);
1636
+ return p.push(c), o.unshift(u), r.set(i, JSON.stringify(p)), i !== u && n.set(i, u), u;
1637
+ }
1638
+ return `_duplicate_${d}`;
1553
1639
  } catch {
1554
1640
  return;
1555
1641
  }
1556
1642
  }, "replace");
1557
- }, "replacer2"), oo = /* @__PURE__ */ a(function reviver(options) {
1558
- let refs = [], root;
1559
- return /* @__PURE__ */ a(function revive(key, value) {
1560
- if (key === "" && (root = value, refs.forEach(({ target: r, container: t, replacement: e }) => {
1561
- let n = J(e) ? JSON.parse(e) : e.split(".");
1562
- n.length === 0 ? t[r] = root : t[r] = Qn(root, n);
1563
- })), key === "_constructor-name_")
1564
- return value;
1565
- if (it(value) && value.__isConvertedError__) {
1566
- let { message: r, ...t } = value.errorProperties, e = new Error(r);
1567
- return Object.assign(e, t), e;
1643
+ }, "replacer2"), Io = /* @__PURE__ */ s(function(e) {
1644
+ let r = [], n;
1645
+ return /* @__PURE__ */ s(function(p, a) {
1646
+ if (p === "" && (n = a, r.forEach(({ target: c, container: i, replacement: l }) => {
1647
+ let d = K(l) ? JSON.parse(l) : l.split(".");
1648
+ d.length === 0 ? i[c] = n : i[c] = Oo(n, d);
1649
+ })), p === "_constructor-name_")
1650
+ return a;
1651
+ if (xe(a) && a.__isConvertedError__) {
1652
+ let { message: c, ...i } = a.errorProperties, l = new Error(c);
1653
+ return Object.assign(l, i), l;
1568
1654
  }
1569
- if (it(value) && value["_constructor-name_"] && options.allowFunction) {
1570
- let r = value["_constructor-name_"];
1571
- if (r !== "Object") {
1572
- let t = new Function(`return function ${r.replace(/[^a-zA-Z0-9$_]+/g, "")}(){}`)();
1573
- Object.setPrototypeOf(value, new t());
1574
- }
1575
- return delete value["_constructor-name_"], value;
1655
+ if (typeof a == "string" && a.startsWith("_regexp_") && e.allowRegExp) {
1656
+ let [, c, i] = a.match(/_regexp_([^|]*)\|(.*)/) || [];
1657
+ return new RegExp(i, c);
1576
1658
  }
1577
- if (typeof value == "string" && value.startsWith("_function_") && options.allowFunction) {
1578
- let [, name, source] = value.match(/_function_([^|]*)\|(.*)/) || [], sourceSanitized = source.replace(/[(\(\))|\\| |\]|`]*$/, "");
1579
- if (!options.lazyEval)
1580
- return eval(`(${sourceSanitized})`);
1581
- let result = /* @__PURE__ */ a((...args) => {
1582
- let f = eval(`(${sourceSanitized})`);
1583
- return f(...args);
1584
- }, "result");
1585
- return Object.defineProperty(result, "toString", {
1586
- value: /* @__PURE__ */ a(() => sourceSanitized, "value")
1587
- }), Object.defineProperty(result, "name", {
1588
- value: name
1589
- }), result;
1590
- }
1591
- if (typeof value == "string" && value.startsWith("_regexp_") && options.allowRegExp) {
1592
- let [, r, t] = value.match(/_regexp_([^|]*)\|(.*)/) || [];
1593
- return new RegExp(t, r);
1594
- }
1595
- return typeof value == "string" && value.startsWith("_date_") && options.allowDate ? new Date(value.replace("_date_", "")) : typeof value ==
1596
- "string" && value.startsWith("_duplicate_") ? (refs.push({ target: key, container: this, replacement: value.replace(/^_duplicate_/, "") }),
1597
- null) : typeof value == "string" && value.startsWith("_symbol_") && options.allowSymbol ? Symbol(value.replace("_symbol_", "")) : typeof value ==
1598
- "string" && value.startsWith("_gsymbol_") && options.allowSymbol ? Symbol.for(value.replace("_gsymbol_", "")) : typeof value == "string" &&
1599
- value === "_-Infinity_" ? -1 / 0 : typeof value == "string" && value === "_Infinity_" ? 1 / 0 : typeof value == "string" && value === "_\
1600
- NaN_" ? NaN : typeof value == "string" && value.startsWith("_bigint_") && typeof BigInt == "function" ? BigInt(value.replace("_bigint_", "")) :
1601
- value;
1659
+ return typeof a == "string" && a.startsWith("_date_") && e.allowDate ? new Date(a.replace("_date_", "")) : typeof a == "string" && a.startsWith(
1660
+ "_duplicate_") ? (r.push({ target: p, container: this, replacement: a.replace(/^_duplicate_/, "") }), null) : typeof a == "string" && a.
1661
+ startsWith("_symbol_") && e.allowSymbol ? Symbol(a.replace("_symbol_", "")) : typeof a == "string" && a.startsWith("_gsymbol_") && e.allowSymbol ?
1662
+ Symbol.for(a.replace("_gsymbol_", "")) : typeof a == "string" && a === "_-Infinity_" ? Number.NEGATIVE_INFINITY : typeof a == "string" &&
1663
+ a === "_Infinity_" ? Number.POSITIVE_INFINITY : typeof a == "string" && a === "_NaN_" ? Number.NaN : typeof a == "string" && a.startsWith(
1664
+ "_bigint_") && typeof BigInt == "function" ? BigInt(a.replace("_bigint_", "")) : a;
1602
1665
  }, "revive");
1603
- }, "reviver"), Vt = {
1666
+ }, "reviver2"), nt = {
1604
1667
  maxDepth: 10,
1605
1668
  space: void 0,
1606
- allowFunction: !0,
1607
1669
  allowRegExp: !0,
1608
1670
  allowDate: !0,
1609
- allowClass: !0,
1610
1671
  allowError: !0,
1611
1672
  allowUndefined: !0,
1612
- allowSymbol: !0,
1613
- lazyEval: !0
1614
- }, lt = /* @__PURE__ */ a((r, t = {}) => {
1615
- let e = { ...Vt, ...t };
1616
- return JSON.stringify(qt(r), no(e), t.space);
1617
- }, "stringify"), io = /* @__PURE__ */ a(() => {
1618
- let r = /* @__PURE__ */ new Map();
1619
- return /* @__PURE__ */ a(function t(e) {
1620
- it(e) && Object.entries(e).forEach(([n, o]) => {
1621
- o === "_undefined_" ? e[n] = void 0 : r.get(o) || (r.set(o, !0), t(o));
1622
- }), Array.isArray(e) && e.forEach((n, o) => {
1623
- n === "_undefined_" ? (r.set(n, !0), e[o] = void 0) : r.get(n) || (r.set(n, !0), t(n));
1673
+ allowSymbol: !0
1674
+ }, ue = /* @__PURE__ */ s((t, e = {}) => {
1675
+ let r = { ...nt, ...e };
1676
+ return JSON.stringify(rt(t), No(r), e.space);
1677
+ }, "stringify"), Ro = /* @__PURE__ */ s(() => {
1678
+ let t = /* @__PURE__ */ new Map();
1679
+ return /* @__PURE__ */ s(function e(r) {
1680
+ xe(r) && Object.entries(r).forEach(([n, o]) => {
1681
+ o === "_undefined_" ? r[n] = void 0 : t.get(o) || (t.set(o, !0), e(o));
1682
+ }), Array.isArray(r) && r.forEach((n, o) => {
1683
+ n === "_undefined_" ? (t.set(n, !0), r[o] = void 0) : t.get(n) || (t.set(n, !0), e(n));
1624
1684
  });
1625
1685
  }, "mutateUndefined");
1626
- }, "mutator"), ct = /* @__PURE__ */ a((r, t = {}) => {
1627
- let e = { ...Vt, ...t }, n = JSON.parse(r, oo(e));
1628
- return io()(n), n;
1686
+ }, "mutator"), fe = /* @__PURE__ */ s((t, e = {}) => {
1687
+ let r = { ...nt, ...e }, n = JSON.parse(t, Io(r));
1688
+ return Ro()(n), n;
1629
1689
  }, "parse");
1630
1690
 
1631
1691
  // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
1632
- var ao = !1, St = "Invariant failed";
1633
- function K(r, t) {
1634
- if (!r) {
1635
- if (ao)
1636
- throw new Error(St);
1637
- var e = typeof t == "function" ? t() : t, n = e ? "".concat(St, ": ").concat(e) : St;
1692
+ var jo = !1, we = "Invariant failed";
1693
+ function X(t, e) {
1694
+ if (!t) {
1695
+ if (jo)
1696
+ throw new Error(we);
1697
+ var r = typeof e == "function" ? e() : e, n = r ? "".concat(we, ": ").concat(r) : we;
1638
1698
  throw new Error(n);
1639
1699
  }
1640
1700
  }
1641
- a(K, "invariant");
1701
+ s(X, "invariant");
1642
1702
 
1643
1703
  // src/channels/postmessage/getEventSourceUrl.ts
1644
- import { logger as so } from "storybook/internal/client-logger";
1645
- var Jt = /* @__PURE__ */ a((r) => {
1646
- let t = Array.from(
1704
+ import { logger as Lo } from "storybook/internal/client-logger";
1705
+ var ot = /* @__PURE__ */ s((t) => {
1706
+ let e = Array.from(
1647
1707
  document.querySelectorAll("iframe[data-is-storybook]")
1648
- ), [e, ...n] = t.filter((s) => {
1708
+ ), [r, ...n] = e.filter((p) => {
1649
1709
  try {
1650
- return s.contentWindow?.location.origin === r.source.location.origin && s.contentWindow?.location.pathname === r.source.location.pathname;
1710
+ return p.contentWindow?.location.origin === t.source.location.origin && p.contentWindow?.location.pathname === t.source.location.pathname;
1651
1711
  } catch {
1652
1712
  }
1653
1713
  try {
1654
- return s.contentWindow === r.source;
1714
+ return p.contentWindow === t.source;
1655
1715
  } catch {
1656
1716
  }
1657
- let l = s.getAttribute("src"), c;
1717
+ let a = p.getAttribute("src"), c;
1658
1718
  try {
1659
- if (!l)
1719
+ if (!a)
1660
1720
  return !1;
1661
- ({ origin: c } = new URL(l, document.location.toString()));
1721
+ ({ origin: c } = new URL(a, document.location.toString()));
1662
1722
  } catch {
1663
1723
  return !1;
1664
1724
  }
1665
- return c === r.origin;
1666
- }), o = e?.getAttribute("src");
1725
+ return c === t.origin;
1726
+ }), o = r?.getAttribute("src");
1667
1727
  if (o && n.length === 0) {
1668
- let { protocol: s, host: l, pathname: c } = new URL(o, document.location.toString());
1669
- return `${s}//${l}${c}`;
1728
+ let { protocol: p, host: a, pathname: c } = new URL(o, document.location.toString());
1729
+ return `${p}//${a}${c}`;
1670
1730
  }
1671
- return n.length > 0 && so.error("found multiple candidates for event source"), null;
1731
+ return n.length > 0 && Lo.error("found multiple candidates for event source"), null;
1672
1732
  }, "getEventSourceUrl");
1673
1733
 
1674
1734
  // src/channels/postmessage/index.ts
1675
- var { document: _t, location: Tt } = A, Xt = "storybook-channel", co = { allowFunction: !1, maxDepth: 25 }, At = class At {
1676
- constructor(t) {
1677
- this.config = t;
1735
+ var { document: Pe, location: Oe } = b, at = "storybook-channel", $o = { maxDepth: 25 }, Q = class {
1736
+ constructor(e) {
1737
+ this.config = e;
1678
1738
  this.connected = !1;
1679
- if (this.buffer = [], typeof A?.addEventListener == "function" && A.addEventListener("message", this.handleEvent.bind(this), !1), t.page !==
1680
- "manager" && t.page !== "preview")
1681
- throw new Error(`postmsg-channel: "config.page" cannot be "${t.page}"`);
1739
+ if (this.buffer = [], typeof b?.addEventListener == "function" && b.addEventListener("message", this.handleEvent.bind(this), !1), e.page !==
1740
+ "manager" && e.page !== "preview")
1741
+ throw new Error(`postmsg-channel: "config.page" cannot be "${e.page}"`);
1682
1742
  }
1683
- setHandler(t) {
1684
- this.handler = (...e) => {
1685
- t.apply(this, e), !this.connected && this.getLocalFrame().length && (this.flush(), this.connected = !0);
1743
+ static {
1744
+ s(this, "PostMessageTransport");
1745
+ }
1746
+ setHandler(e) {
1747
+ this.handler = (...r) => {
1748
+ e.apply(this, r), !this.connected && this.getLocalFrame().length && (this.flush(), this.connected = !0);
1686
1749
  };
1687
1750
  }
1688
1751
  /**
@@ -1691,191 +1754,183 @@ var { document: _t, location: Tt } = A, Xt = "storybook-channel", co = { allowFu
1691
1754
  *
1692
1755
  * @param event
1693
1756
  */
1694
- send(t, e) {
1757
+ send(e, r) {
1695
1758
  let {
1696
1759
  target: n,
1697
1760
  // telejson options
1698
1761
  allowRegExp: o,
1699
- allowFunction: s,
1700
- allowSymbol: l,
1701
- allowDate: c,
1702
- allowError: i,
1703
- allowUndefined: g,
1704
- allowClass: p,
1705
- maxDepth: u,
1706
- space: y,
1707
- lazyEval: v
1708
- } = e || {}, d = Object.fromEntries(
1762
+ allowSymbol: p,
1763
+ allowDate: a,
1764
+ allowError: c,
1765
+ allowUndefined: i,
1766
+ maxDepth: l,
1767
+ space: d
1768
+ } = r || {}, u = Object.fromEntries(
1709
1769
  Object.entries({
1710
1770
  allowRegExp: o,
1711
- allowFunction: s,
1712
- allowSymbol: l,
1713
- allowDate: c,
1714
- allowError: i,
1715
- allowUndefined: g,
1716
- allowClass: p,
1717
- maxDepth: u,
1718
- space: y,
1719
- lazyEval: v
1720
- }).filter(([R, C]) => typeof C < "u")
1721
- ), m = {
1722
- ...co,
1723
- ...A.CHANNEL_OPTIONS || {},
1724
- ...d
1725
- }, E = this.getFrames(n), I = new URLSearchParams(Tt?.search || ""), _ = lt(
1771
+ allowSymbol: p,
1772
+ allowDate: a,
1773
+ allowError: c,
1774
+ allowUndefined: i,
1775
+ maxDepth: l,
1776
+ space: d
1777
+ }).filter(([w, A]) => typeof A < "u")
1778
+ ), y = {
1779
+ ...$o,
1780
+ ...b.CHANNEL_OPTIONS || {},
1781
+ ...u
1782
+ }, g = this.getFrames(n), h = new URLSearchParams(Oe?.search || ""), C = ue(
1726
1783
  {
1727
- key: Xt,
1728
- event: t,
1729
- refId: I.get("refId")
1784
+ key: at,
1785
+ event: e,
1786
+ refId: h.get("refId")
1730
1787
  },
1731
- m
1788
+ y
1732
1789
  );
1733
- return E.length ? (this.buffer.length && this.flush(), E.forEach((R) => {
1790
+ return g.length ? (this.buffer.length && this.flush(), g.forEach((w) => {
1734
1791
  try {
1735
- R.postMessage(_, "*");
1792
+ w.postMessage(C, "*");
1736
1793
  } catch {
1737
- Kt.error("sending over postmessage fail");
1794
+ st.error("sending over postmessage fail");
1738
1795
  }
1739
- }), Promise.resolve(null)) : new Promise((R, C) => {
1740
- this.buffer.push({ event: t, resolve: R, reject: C });
1796
+ }), Promise.resolve(null)) : new Promise((w, A) => {
1797
+ this.buffer.push({ event: e, resolve: w, reject: A });
1741
1798
  });
1742
1799
  }
1743
1800
  flush() {
1744
- let { buffer: t } = this;
1745
- this.buffer = [], t.forEach((e) => {
1746
- this.send(e.event).then(e.resolve).catch(e.reject);
1801
+ let { buffer: e } = this;
1802
+ this.buffer = [], e.forEach((r) => {
1803
+ this.send(r.event).then(r.resolve).catch(r.reject);
1747
1804
  });
1748
1805
  }
1749
- getFrames(t) {
1806
+ getFrames(e) {
1750
1807
  if (this.config.page === "manager") {
1751
1808
  let n = Array.from(
1752
- _t.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")
1809
+ Pe.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")
1753
1810
  ).flatMap((o) => {
1754
1811
  try {
1755
- return o.contentWindow && o.dataset.isStorybook !== void 0 && o.id === t ? [o.contentWindow] : [];
1812
+ return o.contentWindow && o.dataset.isStorybook !== void 0 && o.id === e ? [o.contentWindow] : [];
1756
1813
  } catch {
1757
1814
  return [];
1758
1815
  }
1759
1816
  });
1760
1817
  return n?.length ? n : this.getCurrentFrames();
1761
1818
  }
1762
- return A && A.parent && A.parent !== A.self ? [A.parent] : [];
1819
+ return b && b.parent && b.parent !== b.self ? [b.parent] : [];
1763
1820
  }
1764
1821
  getCurrentFrames() {
1765
1822
  return this.config.page === "manager" ? Array.from(
1766
- _t.querySelectorAll('[data-is-storybook="true"]')
1767
- ).flatMap((e) => e.contentWindow ? [e.contentWindow] : []) : A && A.parent ? [A.parent] : [];
1823
+ Pe.querySelectorAll('[data-is-storybook="true"]')
1824
+ ).flatMap((r) => r.contentWindow ? [r.contentWindow] : []) : b && b.parent ? [b.parent] : [];
1768
1825
  }
1769
1826
  getLocalFrame() {
1770
1827
  return this.config.page === "manager" ? Array.from(
1771
- _t.querySelectorAll("#storybook-preview-iframe")
1772
- ).flatMap((e) => e.contentWindow ? [e.contentWindow] : []) : A && A.parent ? [A.parent] : [];
1828
+ Pe.querySelectorAll("#storybook-preview-iframe")
1829
+ ).flatMap((r) => r.contentWindow ? [r.contentWindow] : []) : b && b.parent ? [b.parent] : [];
1773
1830
  }
1774
- handleEvent(t) {
1831
+ handleEvent(e) {
1775
1832
  try {
1776
- let { data: e } = t, { key: n, event: o, refId: s } = typeof e == "string" && J(e) ? ct(e, A.CHANNEL_OPTIONS || {}) : e;
1777
- if (n === Xt) {
1778
- let l = this.config.page === "manager" ? '<span style="color: #37D5D3; background: black"> manager </span>' : '<span style="color: #\
1779
- 1EA7FD; background: black"> preview </span>', c = Object.values(lo).includes(o.type) ? `<span style="color: #FF4785">${o.type}</span>` : `<s\
1833
+ let { data: r } = e, { key: n, event: o, refId: p } = typeof r == "string" && K(r) ? fe(r, b.CHANNEL_OPTIONS || {}) : r;
1834
+ if (n === at) {
1835
+ let a = this.config.page === "manager" ? '<span style="color: #37D5D3; background: black"> manager </span>' : '<span style="color: #\
1836
+ 1EA7FD; background: black"> preview </span>', c = Object.values(Do).includes(o.type) ? `<span style="color: #FF4785">${o.type}</span>` : `<s\
1780
1837
  pan style="color: #FFAE00">${o.type}</span>`;
1781
- if (s && (o.refId = s), o.source = this.config.page === "preview" ? t.origin : Jt(t), !o.source) {
1782
- Yt.error(
1783
- `${l} received ${c} but was unable to determine the source of the event`
1838
+ if (p && (o.refId = p), o.source = this.config.page === "preview" ? e.origin : ot(e), !o.source) {
1839
+ it.error(
1840
+ `${a} received ${c} but was unable to determine the source of the event`
1784
1841
  );
1785
1842
  return;
1786
1843
  }
1787
- let i = `${l} received ${c} (${e.length})`;
1788
- Yt.debug(
1789
- Tt.origin !== o.source ? i : `${i} <span style="color: gray">(on ${Tt.origin} from ${o.source})</span>`,
1844
+ let i = `${a} received ${c} (${r.length})`;
1845
+ it.debug(
1846
+ Oe.origin !== o.source ? i : `${i} <span style="color: gray">(on ${Oe.origin} from ${o.source})</span>`,
1790
1847
  ...o.args
1791
- ), K(this.handler, "ChannelHandler should be set"), this.handler(o);
1848
+ ), X(this.handler, "ChannelHandler should be set"), this.handler(o);
1792
1849
  }
1793
- } catch (e) {
1794
- Kt.error(e);
1850
+ } catch (r) {
1851
+ st.error(r);
1795
1852
  }
1796
1853
  }
1797
1854
  };
1798
- a(At, "PostMessageTransport");
1799
- var Y = At;
1800
1855
 
1801
1856
  // src/channels/websocket/index.ts
1802
- import * as Qt from "storybook/internal/core-events";
1803
- import { global as Zt } from "@storybook/global";
1804
- var { WebSocket: po } = Zt, te = 15e3, ee = 5e3, wt = class wt {
1805
- constructor({ url: t, onError: e, page: n }) {
1857
+ import * as pt from "storybook/internal/core-events";
1858
+ import { global as ct } from "@storybook/global";
1859
+ var { WebSocket: Fo } = ct, lt = 15e3, ut = 5e3, Z = class {
1860
+ constructor({ url: e, onError: r, page: n }) {
1806
1861
  this.buffer = [];
1807
1862
  this.isReady = !1;
1808
1863
  this.isClosed = !1;
1809
1864
  this.pingTimeout = 0;
1810
- this.socket = new po(t), this.socket.onopen = () => {
1865
+ this.socket = new Fo(e), this.socket.onopen = () => {
1811
1866
  this.isReady = !0, this.heartbeat(), this.flush();
1812
1867
  }, this.socket.onmessage = ({ data: o }) => {
1813
- let s = typeof o == "string" && J(o) ? ct(o) : o;
1814
- K(this.handler, "WebsocketTransport handler should be set"), this.handler(s), s.type === "ping" && (this.heartbeat(), this.send({ type: "\
1868
+ let p = typeof o == "string" && K(o) ? fe(o) : o;
1869
+ X(this.handler, "WebsocketTransport handler should be set"), this.handler(p), p.type === "ping" && (this.heartbeat(), this.send({ type: "\
1815
1870
  pong" }));
1816
1871
  }, this.socket.onerror = (o) => {
1817
- e && e(o);
1872
+ r && r(o);
1818
1873
  }, this.socket.onclose = (o) => {
1819
- K(this.handler, "WebsocketTransport handler should be set"), this.handler({
1820
- type: Qt.CHANNEL_WS_DISCONNECT,
1874
+ X(this.handler, "WebsocketTransport handler should be set"), this.handler({
1875
+ type: pt.CHANNEL_WS_DISCONNECT,
1821
1876
  args: [{ reason: o.reason, code: o.code }],
1822
1877
  from: n || "preview"
1823
1878
  }), this.isClosed = !0, clearTimeout(this.pingTimeout);
1824
1879
  };
1825
1880
  }
1881
+ static {
1882
+ s(this, "WebsocketTransport");
1883
+ }
1826
1884
  heartbeat() {
1827
1885
  clearTimeout(this.pingTimeout), this.pingTimeout = setTimeout(() => {
1828
1886
  this.socket.close(3008, "timeout");
1829
- }, te + ee);
1887
+ }, lt + ut);
1830
1888
  }
1831
- setHandler(t) {
1832
- this.handler = t;
1889
+ setHandler(e) {
1890
+ this.handler = e;
1833
1891
  }
1834
- send(t) {
1835
- this.isClosed || (this.isReady ? this.sendNow(t) : this.sendLater(t));
1892
+ send(e) {
1893
+ this.isClosed || (this.isReady ? this.sendNow(e) : this.sendLater(e));
1836
1894
  }
1837
- sendLater(t) {
1838
- this.buffer.push(t);
1895
+ sendLater(e) {
1896
+ this.buffer.push(e);
1839
1897
  }
1840
- sendNow(t) {
1841
- let e = lt(t, {
1898
+ sendNow(e) {
1899
+ let r = ue(e, {
1842
1900
  maxDepth: 15,
1843
- allowFunction: !1,
1844
- ...Zt.CHANNEL_OPTIONS
1901
+ ...ct.CHANNEL_OPTIONS
1845
1902
  });
1846
- this.socket.send(e);
1903
+ this.socket.send(r);
1847
1904
  }
1848
1905
  flush() {
1849
- let { buffer: t } = this;
1850
- this.buffer = [], t.forEach((e) => this.send(e));
1906
+ let { buffer: e } = this;
1907
+ this.buffer = [], e.forEach((r) => this.send(r));
1851
1908
  }
1852
1909
  };
1853
- a(wt, "WebsocketTransport");
1854
- var X = wt;
1855
1910
 
1856
1911
  // src/channels/index.ts
1857
- var { CONFIG_TYPE: fo } = uo, Qo = B;
1858
- function Zo({ page: r, extraTransports: t = [] }) {
1859
- let e = [new Y({ page: r }), ...t];
1860
- if (fo === "DEVELOPMENT") {
1861
- let o = window.location.protocol === "http:" ? "ws" : "wss", { hostname: s, port: l } = window.location, c = `${o}://${s}:${l}/storybook\
1912
+ var { CONFIG_TYPE: Uo } = Mo, Ts = J;
1913
+ function As({ page: t, extraTransports: e = [] }) {
1914
+ let r = [new Q({ page: t }), ...e];
1915
+ if (Uo === "DEVELOPMENT") {
1916
+ let o = window.location.protocol === "http:" ? "ws" : "wss", { hostname: p, port: a } = window.location, c = `${o}://${p}:${a}/storybook\
1862
1917
  -server-channel`;
1863
- e.push(new X({ url: c, onError: /* @__PURE__ */ a(() => {
1864
- }, "onError"), page: r }));
1918
+ r.push(new Z({ url: c, onError: /* @__PURE__ */ s(() => {
1919
+ }, "onError"), page: t }));
1865
1920
  }
1866
- let n = new B({ transports: e });
1867
- return $.__prepare(
1921
+ let n = new J({ transports: r });
1922
+ return M.__prepare(
1868
1923
  n,
1869
- r === "manager" ? $.Environment.MANAGER : $.Environment.PREVIEW
1924
+ t === "manager" ? M.Environment.MANAGER : M.Environment.PREVIEW
1870
1925
  ), n;
1871
1926
  }
1872
- a(Zo, "createBrowserChannel");
1927
+ s(As, "createBrowserChannel");
1873
1928
  export {
1874
- B as Channel,
1875
- te as HEARTBEAT_INTERVAL,
1876
- ee as HEARTBEAT_MAX_LATENCY,
1877
- Y as PostMessageTransport,
1878
- X as WebsocketTransport,
1879
- Zo as createBrowserChannel,
1880
- Qo as default
1929
+ J as Channel,
1930
+ lt as HEARTBEAT_INTERVAL,
1931
+ ut as HEARTBEAT_MAX_LATENCY,
1932
+ Q as PostMessageTransport,
1933
+ Z as WebsocketTransport,
1934
+ As as createBrowserChannel,
1935
+ Ts as default
1881
1936
  };