@mgdis/stencil-helpers 1.1.6 → 1.1.8

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.
package/dist/index.es.js CHANGED
@@ -1,30 +1,34 @@
1
- var $e = Object.defineProperty;
2
- var ue = (e, t, s) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var v = (e, t, s) => ue(e, typeof t != "symbol" ? t + "" : t, s);
4
- const Ce = (e = "", t = 10) => {
1
+ var ve = Object.defineProperty;
2
+ var X = (e) => {
3
+ throw TypeError(e);
4
+ };
5
+ var he = (e, t, s) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
6
+ var g = (e, t, s) => he(e, typeof t != "symbol" ? t + "" : t, s), ye = (e, t, s) => t.has(e) || X("Cannot " + s);
7
+ var k = (e, t, s) => (ye(e, t, "read from private field"), s ? s.call(e) : t.get(e)), w = (e, t, s) => t.has(e) ? X("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s);
8
+ const ze = (e = "", t = 10) => {
5
9
  const s = new Uint8Array(t);
6
10
  crypto.getRandomValues(s);
7
11
  const r = Array.from(s).map((o) => o.toString(16).padStart(2, "0")).join("").slice(0, t);
8
12
  return e !== "" ? `${e}-${r}` : r;
9
13
  };
10
- class He {
14
+ class Ie {
11
15
  constructor(t = []) {
12
16
  /**
13
17
  * Available classes
14
18
  */
15
- v(this, "classes");
19
+ g(this, "classes");
16
20
  /**
17
21
  * Add class
18
22
  * @param className - class name to add
19
23
  */
20
- v(this, "add", (t) => {
24
+ g(this, "add", (t) => {
21
25
  this.has(t) || this.classes.push(t);
22
26
  });
23
27
  /**
24
28
  * Delete class
25
29
  * @param className - class name to delete
26
30
  */
27
- v(this, "delete", (t) => {
31
+ g(this, "delete", (t) => {
28
32
  const s = this.classes.indexOf(t);
29
33
  s > -1 && this.classes.splice(s, 1);
30
34
  });
@@ -33,146 +37,34 @@ class He {
33
37
  * @param className - class name to check
34
38
  * @returns class name is in the list
35
39
  */
36
- v(this, "has", (t) => this.classes.includes(t));
40
+ g(this, "has", (t) => this.classes.includes(t));
37
41
  /**
38
42
  * Join classes seperated by spaces
39
43
  * @returns joined values
40
44
  */
41
- v(this, "join", () => this.classes.join(" "));
45
+ g(this, "join", () => this.classes.join(" "));
42
46
  this.classes = t;
43
47
  }
44
48
  }
45
- const Pe = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Be = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), We = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', ze = (e) => {
46
- const t = Q(e), s = Z(e);
49
+ const Ge = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Xe = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Ke = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Qe = (e) => {
50
+ const t = te(e), s = se(e);
47
51
  return [e, ...t, ...s];
48
- }, Q = (e, t = []) => {
52
+ }, te = (e, t = []) => {
49
53
  if (e.self !== e.top)
50
54
  try {
51
55
  const s = e.parent;
52
- return s ? (t.push(s), Q(s, t)) : t;
56
+ return s ? (t.push(s), te(s, t)) : t;
53
57
  } catch (s) {
54
58
  return console.error("Different hosts between iframes:", s), t;
55
59
  }
56
60
  return t;
57
- }, Z = (e, t = []) => {
61
+ }, se = (e, t = []) => {
58
62
  if (e.frames.length > 0)
59
63
  for (const s of Array.from(e.frames))
60
- t.push(s), Z(s, t);
64
+ t.push(s), se(s, t);
61
65
  return t;
62
- }, Ie = (e) => typeof e == "string" && e.trim() !== "", qe = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Ge = async (e) => e(), J = (e, t) => {
63
- if (!t)
64
- return;
65
- const s = t.split("/");
66
- return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
67
- }, de = (e, t) => {
68
- if (t)
69
- return `${e}${t}`;
70
- }, Y = (e) => {
71
- let t = e.overview ? `${e.overview}
72
-
73
- ` : "";
74
- const s = e.props.filter(({ attr: o }) => o !== void 0);
75
- s.length && (t += `Attributes:
76
- `, t += s.map(({ attr: o, docs: l }) => `- \`${o}\`: ${l}
77
- `).join(""), t += `
78
- `);
79
- const r = e.props.filter(({ attr: o }) => o === void 0);
80
- return r.length && (t += `Properties:
81
- `, t += r.map(({ name: o, docs: l }) => `- \`${o}\`: ${l}
82
- `).join(""), t += `
83
- `), e.methods.length && (t += `Methods:
84
- `, t += e.methods.map(({ name: o, docs: l }) => `- \`${o}\`: ${l}
85
- `).join(""), t += `
86
- `), e.events.length && (t += `Events:
87
- `, t += e.events.map(({ event: o, docs: l }) => `- \`${o}\`: ${l}
88
- `).join(""), t += `
89
- `), e.listeners.length && (t += `Listeners:
90
- `, t += e.listeners.map(({ event: o }) => `- \`${o}\`
91
- `).join(""), t += `
92
- `), e.slots.length && (t += `Slots:
93
- `, t += e.slots.map(({ name: o, docs: l }) => `- \`${o}\`: ${l}
94
- `).join(""), t += `
95
- `), t;
96
- }, _ = (e) => `${e.docs}
97
-
98
- Type: \`${e.type}\``, Xe = (e, t, s, r) => ({
99
- $schema: "https://json.schemastore.org/web-types",
100
- name: e,
101
- version: t,
102
- "description-markup": "markdown",
103
- contributions: {
104
- html: {
105
- elements: s.components.map((o) => {
106
- const l = J(r, o.filePath);
107
- return {
108
- name: o.tag,
109
- description: Y(o),
110
- "doc-url": l,
111
- attributes: o.props.filter((n) => n.attr).map((n) => ({
112
- name: n.attr,
113
- description: _(n),
114
- "doc-url": l,
115
- value: {
116
- type: n.type,
117
- default: n.default,
118
- required: n.required
119
- }
120
- })),
121
- js: {
122
- properties: o.props.map((n) => ({
123
- name: n.name,
124
- description: _(n),
125
- "doc-url": l,
126
- value: {
127
- type: n.type,
128
- default: n.default,
129
- required: n.required
130
- }
131
- })),
132
- events: o.events.map((n) => ({
133
- name: n.event,
134
- description: n.docs
135
- }))
136
- }
137
- };
138
- })
139
- }
140
- }
141
- }), pe = (e, t, s) => [
142
- { name: "Storybook", url: J(e, s) },
143
- { name: "Sources", url: de(t, s) }
144
- ], ve = (e) => {
145
- if (!e.values.some(({ value: t }) => t === void 0))
146
- return e.values.map(({ value: t }) => ({ name: t }));
147
- }, Ke = (e, t, s, r) => ({
148
- version: e,
149
- tags: t.components.map((o) => {
150
- const l = pe(s, r, o.filePath);
151
- return {
152
- name: o.tag,
153
- description: Y(o),
154
- attributes: o.props.map((n) => ({
155
- name: n.attr || n.name,
156
- description: _(n),
157
- values: ve(n),
158
- references: l
159
- })),
160
- references: l
161
- };
162
- }),
163
- globalAttributes: [],
164
- valueSets: []
165
- }), Qe = (e) => {
166
- const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
167
- return ye([t.value, s.value, r.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
168
- }, Ze = (e) => e.toISOString().split("T")[0], ge = (e, t, s) => {
169
- const r = e.closest("[lang]"), o = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), l = o.length > 0 && typeof o[0] == "string" ? o[0] : navigator.language || s, n = l.split("-").shift();
170
- return {
171
- locale: l,
172
- messages: t[n] || t[s]
173
- };
174
- }, Je = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), Ye = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), he = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, ye = (e, t, s) => typeof e != "string" || e === "" || !he.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), Ve = (e, t) => (s) => ge(s, e, t);
175
- var N = {
66
+ }, Ze = (e) => typeof e == "string" && e.trim() !== "", Je = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Ye = async (e) => e();
67
+ var P = {
176
68
  allRenderFn: !1,
177
69
  cmpDidLoad: !0,
178
70
  cmpDidUnload: !1,
@@ -261,12 +153,12 @@ var N = {
261
153
  attachStyles: !0,
262
154
  // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
263
155
  experimentalSlotFixes: !1
264
- }, be = Object.defineProperty, Se = (e, t) => {
156
+ }, me = Object.defineProperty, be = (e, t) => {
265
157
  for (var s in t)
266
- be(e, s, { get: t[s], enumerable: !0 });
267
- }, W = (e, t) => t in e, z = "http://www.w3.org/1999/xlink", C = typeof window < "u" ? window : {}, j = C.document || { head: {} };
268
- C.HTMLElement;
269
- var x = {
158
+ me(e, s, { get: t[s], enumerable: !0 });
159
+ }, K = (e, t) => t in e, Q = "http://www.w3.org/1999/xlink", q = typeof window < "u" ? window : {}, M = q.document || { head: {} };
160
+ q.HTMLElement;
161
+ var E = {
270
162
  $flags$: 0,
271
163
  $resourcesUrl$: "",
272
164
  jmp: (e) => e(),
@@ -274,35 +166,35 @@ var x = {
274
166
  ael: (e, t, s, r) => e.addEventListener(t, s, r),
275
167
  rel: (e, t, s, r) => e.removeEventListener(t, s, r),
276
168
  ce: (e, t) => new CustomEvent(e, t)
277
- }, I = {}, me = "http://www.w3.org/2000/svg", Te = "http://www.w3.org/1999/xhtml", ke = (e) => e != null, V = (e) => (e = typeof e, e === "object" || e === "function"), xe = {};
278
- Se(xe, {
279
- err: () => ee,
280
- map: () => Ee,
281
- ok: () => F,
282
- unwrap: () => Ae,
169
+ }, Z = {}, Se = "http://www.w3.org/2000/svg", Te = "http://www.w3.org/1999/xhtml", ke = (e) => e != null, re = (e) => (e = typeof e, e === "object" || e === "function"), xe = {};
170
+ be(xe, {
171
+ err: () => oe,
172
+ map: () => Ae,
173
+ ok: () => U,
174
+ unwrap: () => Ee,
283
175
  unwrapErr: () => Le
284
176
  });
285
- var F = (e) => ({
177
+ var U = (e) => ({
286
178
  isOk: !0,
287
179
  isErr: !1,
288
180
  value: e
289
- }), ee = (e) => ({
181
+ }), oe = (e) => ({
290
182
  isOk: !1,
291
183
  isErr: !0,
292
184
  value: e
293
185
  });
294
- function Ee(e, t) {
186
+ function Ae(e, t) {
295
187
  if (e.isOk) {
296
188
  const s = t(e.value);
297
- return s instanceof Promise ? s.then((r) => F(r)) : F(s);
189
+ return s instanceof Promise ? s.then((r) => U(r)) : U(s);
298
190
  }
299
191
  if (e.isErr) {
300
192
  const s = e.value;
301
- return ee(s);
193
+ return oe(s);
302
194
  }
303
195
  throw "should never get here";
304
196
  }
305
- var Ae = (e) => {
197
+ var Ee = (e) => {
306
198
  if (e.isOk)
307
199
  return e.value;
308
200
  throw e.value;
@@ -310,16 +202,16 @@ var Ae = (e) => {
310
202
  if (e.isErr)
311
203
  return e.value;
312
204
  throw e.value;
313
- }, Re = (e, t, ...s) => {
314
- let r = null, o = null, l = null, n = !1, i = !1;
315
- const a = [], d = (f) => {
316
- for (let $ = 0; $ < f.length; $++)
317
- r = f[$], Array.isArray(r) ? d(r) : r != null && typeof r != "boolean" && ((n = !V(r)) && (r = String(r)), n && i ? a[a.length - 1].$text$ += r : a.push(n ? U(null, r) : r), i = n);
205
+ }, je = (e, t, ...s) => {
206
+ let r = null, o = null, n = null, l = !1, a = !1;
207
+ const c = [], d = (i) => {
208
+ for (let $ = 0; $ < i.length; $++)
209
+ r = i[$], Array.isArray(r) ? d(r) : r != null && typeof r != "boolean" && ((l = !re(r)) && (r = String(r)), l && a ? c[c.length - 1].$text$ += r : c.push(l ? H(null, r) : r), a = l);
318
210
  };
319
211
  d(s);
320
- const u = U(e, null);
321
- return u.$attrs$ = t, a.length > 0 && (u.$children$ = a), u.$key$ = o, u.$name$ = l, u;
322
- }, U = (e, t) => {
212
+ const f = H(e, null);
213
+ return f.$attrs$ = t, c.length > 0 && (f.$children$ = c), f.$key$ = o, f.$name$ = n, f;
214
+ }, H = (e, t) => {
323
215
  const s = {
324
216
  $flags$: 0,
325
217
  $tag$: e,
@@ -328,48 +220,48 @@ var Ae = (e) => {
328
220
  $children$: null
329
221
  };
330
222
  return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
331
- }, je = {}, Oe = (e) => e && e.$tag$ === je, q = (e, t, s, r, o, l) => {
223
+ }, Re = {}, Oe = (e) => e && e.$tag$ === Re, J = (e, t, s, r, o, n) => {
332
224
  if (s !== r) {
333
- let n = W(e, t), i = t.toLowerCase();
225
+ let l = K(e, t), a = t.toLowerCase();
334
226
  if (t === "class") {
335
- const a = e.classList, d = G(s), u = G(r);
336
- a.remove(...d.filter((f) => f && !u.includes(f))), a.add(...u.filter((f) => f && !d.includes(f)));
227
+ const c = e.classList, d = Y(s), f = Y(r);
228
+ c.remove(...d.filter((i) => i && !f.includes(i))), c.add(...f.filter((i) => i && !d.includes(i)));
337
229
  } else if (t === "style") {
338
- for (const a in s)
339
- (!r || r[a] == null) && (a.includes("-") ? e.style.removeProperty(a) : e.style[a] = "");
340
- for (const a in r)
341
- (!s || r[a] !== s[a]) && (a.includes("-") ? e.style.setProperty(a, r[a]) : e.style[a] = r[a]);
230
+ for (const c in s)
231
+ (!r || r[c] == null) && (c.includes("-") ? e.style.removeProperty(c) : e.style[c] = "");
232
+ for (const c in r)
233
+ (!s || r[c] !== s[c]) && (c.includes("-") ? e.style.setProperty(c, r[c]) : e.style[c] = r[c]);
342
234
  } else if (t !== "key") if (t === "ref")
343
235
  r && r(e);
344
236
  else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
345
- if (t[2] === "-" ? t = t.slice(3) : W(C, i) ? t = i.slice(2) : t = i[2] + t.slice(3), s || r) {
346
- const a = t.endsWith(te);
347
- t = t.replace(De, ""), s && x.rel(e, t, s, a), r && x.ael(e, t, r, a);
237
+ if (t[2] === "-" ? t = t.slice(3) : K(q, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s || r) {
238
+ const c = t.endsWith(ne);
239
+ t = t.replace(Ne, ""), s && E.rel(e, t, s, c), r && E.ael(e, t, r, c);
348
240
  }
349
241
  } else {
350
- const a = V(r);
351
- if ((n || a && r !== null) && !o)
242
+ const c = re(r);
243
+ if ((l || c && r !== null) && !o)
352
244
  try {
353
245
  if (e.tagName.includes("-"))
354
246
  e[t] = r;
355
247
  else {
356
- const u = r ?? "";
357
- t === "list" ? n = !1 : (s == null || e[t] != u) && (e[t] = u);
248
+ const f = r ?? "";
249
+ t === "list" ? l = !1 : (s == null || e[t] != f) && (e[t] = f);
358
250
  }
359
251
  } catch {
360
252
  }
361
253
  let d = !1;
362
- i !== (i = i.replace(/^xlink\:?/, "")) && (t = i, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (d ? e.removeAttributeNS(z, t) : e.removeAttribute(t)) : (!n || l & 4 || o) && !a && (r = r === !0 ? "" : r, d ? e.setAttributeNS(z, t, r) : e.setAttribute(t, r));
254
+ a !== (a = a.replace(/^xlink\:?/, "")) && (t = a, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (d ? e.removeAttributeNS(Q, t) : e.removeAttribute(t)) : (!l || n & 4 || o) && !c && (r = r === !0 ? "" : r, d ? e.setAttributeNS(Q, t, r) : e.setAttribute(t, r));
363
255
  }
364
256
  }
365
- }, Me = /\s/, G = (e) => e ? e.split(Me) : [], te = "Capture", De = new RegExp(te + "$"), se = (e, t, s) => {
366
- const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || I, l = t.$attrs$ || I;
367
- for (const n of X(Object.keys(o)))
368
- n in l || q(r, n, o[n], void 0, s, t.$flags$);
369
- for (const n of X(Object.keys(l)))
370
- q(r, n, o[n], l[n], s, t.$flags$);
257
+ }, Me = /\s/, Y = (e) => e ? e.split(Me) : [], ne = "Capture", Ne = new RegExp(ne + "$"), le = (e, t, s) => {
258
+ const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || Z, n = t.$attrs$ || Z;
259
+ for (const l of V(Object.keys(o)))
260
+ l in n || J(r, l, o[l], void 0, s, t.$flags$);
261
+ for (const l of V(Object.keys(n)))
262
+ J(r, l, o[l], n[l], s, t.$flags$);
371
263
  };
372
- function X(e) {
264
+ function V(e) {
373
265
  return e.includes("ref") ? (
374
266
  // we need to sort these to ensure that `'ref'` is the last attr
375
267
  [...e.filter((t) => t !== "ref"), "ref"]
@@ -378,11 +270,11 @@ function X(e) {
378
270
  e
379
271
  );
380
272
  }
381
- var T, w, E, O = !1, M = !1, H = !1, h = !1, D = (e, t, s, r) => {
273
+ var x, B, L, N = !1, _ = !1, z = !1, h = !1, F = (e, t, s, r) => {
382
274
  var o;
383
- const l = t.$children$[s];
384
- let n = 0, i, a, d;
385
- if (O || (H = !0, l.$tag$ === "slot" && (T && r.classList.add(T + "-s"), l.$flags$ |= l.$children$ ? (
275
+ const n = t.$children$[s];
276
+ let l = 0, a, c, d;
277
+ if (N || (z = !0, n.$tag$ === "slot" && (x && r.classList.add(x + "-s"), n.$flags$ |= n.$children$ ? (
386
278
  // slot element has fallback content
387
279
  // still create an element that "mocks" the slot element
388
280
  2
@@ -391,85 +283,85 @@ var T, w, E, O = !1, M = !1, H = !1, h = !1, D = (e, t, s, r) => {
391
283
  // create an html comment we'll use to always reference
392
284
  // where actual slot content should sit next to
393
285
  1
394
- ))), l.$text$ !== null)
395
- i = l.$elm$ = j.createTextNode(l.$text$);
396
- else if (l.$flags$ & 1)
397
- i = l.$elm$ = j.createTextNode("");
286
+ ))), n.$text$ !== null)
287
+ a = n.$elm$ = M.createTextNode(n.$text$);
288
+ else if (n.$flags$ & 1)
289
+ a = n.$elm$ = M.createTextNode("");
398
290
  else {
399
- if (h || (h = l.$tag$ === "svg"), i = l.$elm$ = j.createElementNS(
400
- h ? me : Te,
401
- !O && N.slotRelocation && l.$flags$ & 2 ? "slot-fb" : l.$tag$
402
- ), h && l.$tag$ === "foreignObject" && (h = !1), se(null, l, h), ke(T) && i["s-si"] !== T && i.classList.add(i["s-si"] = T), B(i, r), l.$children$)
403
- for (n = 0; n < l.$children$.length; ++n)
404
- a = D(e, l, n, i), a && i.appendChild(a);
405
- l.$tag$ === "svg" ? h = !1 : i.tagName === "foreignObject" && (h = !0);
291
+ if (h || (h = n.$tag$ === "svg"), a = n.$elm$ = M.createElementNS(
292
+ h ? Se : Te,
293
+ !N && P.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
294
+ ), h && n.$tag$ === "foreignObject" && (h = !1), le(null, n, h), ke(x) && a["s-si"] !== x && a.classList.add(a["s-si"] = x), G(a, r), n.$children$)
295
+ for (l = 0; l < n.$children$.length; ++l)
296
+ c = F(e, n, l, a), c && a.appendChild(c);
297
+ n.$tag$ === "svg" ? h = !1 : a.tagName === "foreignObject" && (h = !0);
406
298
  }
407
- return i["s-hn"] = E, l.$flags$ & 3 && (i["s-sr"] = !0, i["s-cr"] = w, i["s-sn"] = l.$name$ || "", i["s-rf"] = (o = l.$attrs$) == null ? void 0 : o.ref, d = e && e.$children$ && e.$children$[s], d && d.$tag$ === l.$tag$ && e.$elm$ && A(e.$elm$, !1)), i;
408
- }, A = (e, t) => {
409
- x.$flags$ |= 1;
299
+ return a["s-hn"] = L, n.$flags$ & 3 && (a["s-sr"] = !0, a["s-cr"] = B, a["s-sn"] = n.$name$ || "", a["s-rf"] = (o = n.$attrs$) == null ? void 0 : o.ref, d = e && e.$children$ && e.$children$[s], d && d.$tag$ === n.$tag$ && e.$elm$ && j(e.$elm$, !1)), a;
300
+ }, j = (e, t) => {
301
+ E.$flags$ |= 1;
410
302
  const s = Array.from(e.childNodes);
411
- if (e["s-sr"] && N.experimentalSlotFixes) {
303
+ if (e["s-sr"] && P.experimentalSlotFixes) {
412
304
  let r = e;
413
305
  for (; r = r.nextSibling; )
414
- r && r["s-sn"] === e["s-sn"] && r["s-sh"] === E && s.push(r);
306
+ r && r["s-sn"] === e["s-sn"] && r["s-sh"] === L && s.push(r);
415
307
  }
416
308
  for (let r = s.length - 1; r >= 0; r--) {
417
309
  const o = s[r];
418
- o["s-hn"] !== E && o["s-ol"] && (m(le(o), o, P(o)), o["s-ol"].remove(), o["s-ol"] = void 0, o["s-sh"] = void 0, H = !0), t && A(o, t);
310
+ o["s-hn"] !== L && o["s-ol"] && (T(ce(o), o, I(o)), o["s-ol"].remove(), o["s-ol"] = void 0, o["s-sh"] = void 0, z = !0), t && j(o, t);
419
311
  }
420
- x.$flags$ &= -2;
421
- }, re = (e, t, s, r, o, l) => {
422
- let n = e["s-cr"] && e["s-cr"].parentNode || e, i;
423
- for (n.shadowRoot && n.tagName === E && (n = n.shadowRoot); o <= l; ++o)
424
- r[o] && (i = D(null, s, o, e), i && (r[o].$elm$ = i, m(n, i, P(t))));
425
- }, oe = (e, t, s) => {
312
+ E.$flags$ &= -2;
313
+ }, ie = (e, t, s, r, o, n) => {
314
+ let l = e["s-cr"] && e["s-cr"].parentNode || e, a;
315
+ for (l.shadowRoot && l.tagName === L && (l = l.shadowRoot); o <= n; ++o)
316
+ r[o] && (a = F(null, s, o, e), a && (r[o].$elm$ = a, T(l, a, I(t))));
317
+ }, ae = (e, t, s) => {
426
318
  for (let r = t; r <= s; ++r) {
427
319
  const o = e[r];
428
320
  if (o) {
429
- const l = o.$elm$;
430
- ae(o), l && (M = !0, l["s-ol"] ? l["s-ol"].remove() : A(l, !0), l.remove());
321
+ const n = o.$elm$;
322
+ $e(o), n && (_ = !0, n["s-ol"] ? n["s-ol"].remove() : j(n, !0), n.remove());
431
323
  }
432
324
  }
433
- }, Ne = (e, t, s, r, o = !1) => {
434
- let l = 0, n = 0, i = 0, a = 0, d = t.length - 1, u = t[0], f = t[d], $ = r.length - 1, c = r[0], p = r[$], b, y;
435
- for (; l <= d && n <= $; )
436
- if (u == null)
437
- u = t[++l];
438
- else if (f == null)
439
- f = t[--d];
440
- else if (c == null)
441
- c = r[++n];
325
+ }, _e = (e, t, s, r, o = !1) => {
326
+ let n = 0, l = 0, a = 0, c = 0, d = t.length - 1, f = t[0], i = t[d], $ = r.length - 1, u = r[0], p = r[$], m, y;
327
+ for (; n <= d && l <= $; )
328
+ if (f == null)
329
+ f = t[++n];
330
+ else if (i == null)
331
+ i = t[--d];
332
+ else if (u == null)
333
+ u = r[++l];
442
334
  else if (p == null)
443
335
  p = r[--$];
444
- else if (R(u, c, o))
445
- k(u, c, o), u = t[++l], c = r[++n];
446
- else if (R(f, p, o))
447
- k(f, p, o), f = t[--d], p = r[--$];
448
- else if (R(u, p, o))
449
- (u.$tag$ === "slot" || p.$tag$ === "slot") && A(u.$elm$.parentNode, !1), k(u, p, o), m(e, u.$elm$, f.$elm$.nextSibling), u = t[++l], p = r[--$];
450
- else if (R(f, c, o))
451
- (u.$tag$ === "slot" || p.$tag$ === "slot") && A(f.$elm$.parentNode, !1), k(f, c, o), m(e, f.$elm$, u.$elm$), f = t[--d], c = r[++n];
336
+ else if (O(f, u, o))
337
+ A(f, u, o), f = t[++n], u = r[++l];
338
+ else if (O(i, p, o))
339
+ A(i, p, o), i = t[--d], p = r[--$];
340
+ else if (O(f, p, o))
341
+ (f.$tag$ === "slot" || p.$tag$ === "slot") && j(f.$elm$.parentNode, !1), A(f, p, o), T(e, f.$elm$, i.$elm$.nextSibling), f = t[++n], p = r[--$];
342
+ else if (O(i, u, o))
343
+ (f.$tag$ === "slot" || p.$tag$ === "slot") && j(i.$elm$.parentNode, !1), A(i, u, o), T(e, i.$elm$, f.$elm$), i = t[--d], u = r[++l];
452
344
  else {
453
- for (i = -1, a = l; a <= d; ++a)
454
- if (t[a] && t[a].$key$ !== null && t[a].$key$ === c.$key$) {
455
- i = a;
345
+ for (a = -1, c = n; c <= d; ++c)
346
+ if (t[c] && t[c].$key$ !== null && t[c].$key$ === u.$key$) {
347
+ a = c;
456
348
  break;
457
349
  }
458
- i >= 0 ? (y = t[i], y.$tag$ !== c.$tag$ ? b = D(t && t[n], s, i, e) : (k(y, c, o), t[i] = void 0, b = y.$elm$), c = r[++n]) : (b = D(t && t[n], s, n, e), c = r[++n]), b && m(le(u.$elm$), b, P(u.$elm$));
350
+ a >= 0 ? (y = t[a], y.$tag$ !== u.$tag$ ? m = F(t && t[l], s, a, e) : (A(y, u, o), t[a] = void 0, m = y.$elm$), u = r[++l]) : (m = F(t && t[l], s, l, e), u = r[++l]), m && T(ce(f.$elm$), m, I(f.$elm$));
459
351
  }
460
- l > d ? re(
352
+ n > d ? ie(
461
353
  e,
462
354
  r[$ + 1] == null ? null : r[$ + 1].$elm$,
463
355
  s,
464
356
  r,
465
- n,
357
+ l,
466
358
  $
467
- ) : n > $ && oe(t, l, d);
468
- }, R = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : s ? !0 : e.$key$ === t.$key$ : !1, P = (e) => e && e["s-ol"] || e, le = (e) => (e["s-ol"] ? e["s-ol"] : e).parentNode, k = (e, t, s = !1) => {
469
- const r = t.$elm$ = e.$elm$, o = e.$children$, l = t.$children$, n = t.$tag$, i = t.$text$;
470
- let a;
471
- i === null ? (h = n === "svg" ? !0 : n === "foreignObject" ? !1 : h, n === "slot" && !O || se(e, t, h), o !== null && l !== null ? Ne(r, o, t, l, s) : l !== null ? (e.$text$ !== null && (r.textContent = ""), re(r, null, t, l, 0, l.length - 1)) : o !== null && oe(o, 0, o.length - 1), h && n === "svg" && (h = !1)) : (a = r["s-cr"]) ? a.parentNode.textContent = i : e.$text$ !== i && (r.data = i);
472
- }, ne = (e) => {
359
+ ) : l > $ && ae(t, n, d);
360
+ }, O = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : s ? !0 : e.$key$ === t.$key$ : !1, I = (e) => e && e["s-ol"] || e, ce = (e) => (e["s-ol"] ? e["s-ol"] : e).parentNode, A = (e, t, s = !1) => {
361
+ const r = t.$elm$ = e.$elm$, o = e.$children$, n = t.$children$, l = t.$tag$, a = t.$text$;
362
+ let c;
363
+ a === null ? (h = l === "svg" ? !0 : l === "foreignObject" ? !1 : h, l === "slot" && !N || le(e, t, h), o !== null && n !== null ? _e(r, o, t, n, s) : n !== null ? (e.$text$ !== null && (r.textContent = ""), ie(r, null, t, n, 0, n.length - 1)) : o !== null && ae(o, 0, o.length - 1), h && l === "svg" && (h = !1)) : (c = r["s-cr"]) ? c.parentNode.textContent = a : e.$text$ !== a && (r.data = a);
364
+ }, fe = (e) => {
473
365
  const t = e.childNodes;
474
366
  for (const s of t)
475
367
  if (s.nodeType === 1) {
@@ -489,129 +381,129 @@ var T, w, E, O = !1, M = !1, H = !1, h = !1, D = (e, t, s, r) => {
489
381
  }
490
382
  }
491
383
  }
492
- ne(s);
384
+ fe(s);
493
385
  }
494
- }, S = [], ie = (e) => {
386
+ }, b = [], ue = (e) => {
495
387
  let t, s, r;
496
388
  for (const o of e.childNodes) {
497
389
  if (o["s-sr"] && (t = o["s-cr"]) && t.parentNode) {
498
390
  s = t.parentNode.childNodes;
499
- const l = o["s-sn"];
391
+ const n = o["s-sn"];
500
392
  for (r = s.length - 1; r >= 0; r--)
501
- if (t = s[r], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== o["s-hn"] && !N.experimentalSlotFixes)
502
- if (K(t, l)) {
503
- let n = S.find((i) => i.$nodeToRelocate$ === t);
504
- M = !0, t["s-sn"] = t["s-sn"] || l, n ? (n.$nodeToRelocate$["s-sh"] = o["s-hn"], n.$slotRefNode$ = o) : (t["s-sh"] = o["s-hn"], S.push({
393
+ if (t = s[r], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== o["s-hn"] && !P.experimentalSlotFixes)
394
+ if (ee(t, n)) {
395
+ let l = b.find((a) => a.$nodeToRelocate$ === t);
396
+ _ = !0, t["s-sn"] = t["s-sn"] || n, l ? (l.$nodeToRelocate$["s-sh"] = o["s-hn"], l.$slotRefNode$ = o) : (t["s-sh"] = o["s-hn"], b.push({
505
397
  $slotRefNode$: o,
506
398
  $nodeToRelocate$: t
507
- })), t["s-sr"] && S.map((i) => {
508
- K(i.$nodeToRelocate$, t["s-sn"]) && (n = S.find((a) => a.$nodeToRelocate$ === t), n && !i.$slotRefNode$ && (i.$slotRefNode$ = n.$slotRefNode$));
399
+ })), t["s-sr"] && b.map((a) => {
400
+ ee(a.$nodeToRelocate$, t["s-sn"]) && (l = b.find((c) => c.$nodeToRelocate$ === t), l && !a.$slotRefNode$ && (a.$slotRefNode$ = l.$slotRefNode$));
509
401
  });
510
- } else S.some((n) => n.$nodeToRelocate$ === t) || S.push({
402
+ } else b.some((l) => l.$nodeToRelocate$ === t) || b.push({
511
403
  $nodeToRelocate$: t
512
404
  });
513
405
  }
514
- o.nodeType === 1 && ie(o);
406
+ o.nodeType === 1 && ue(o);
515
407
  }
516
- }, K = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", ae = (e) => {
517
- e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(ae);
518
- }, m = (e, t, s) => {
408
+ }, ee = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", $e = (e) => {
409
+ e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map($e);
410
+ }, T = (e, t, s) => {
519
411
  const r = e == null ? void 0 : e.insertBefore(t, s);
520
- return B(t, e), r;
521
- }, ce = (e) => {
412
+ return G(t, e), r;
413
+ }, de = (e) => {
522
414
  const t = [];
523
415
  return e && t.push(
524
416
  ...e["s-scs"] || [],
525
417
  e["s-si"],
526
418
  e["s-sc"],
527
- ...ce(e.parentElement)
419
+ ...de(e.parentElement)
528
420
  ), t;
529
- }, B = (e, t, s = !1) => {
421
+ }, G = (e, t, s = !1) => {
530
422
  var r;
531
423
  if (e && t && e.nodeType === 1) {
532
- const o = new Set(ce(t).filter(Boolean));
424
+ const o = new Set(de(t).filter(Boolean));
533
425
  if (o.size && ((r = e.classList) == null || r.add(...e["s-scs"] = [...o]), e["s-ol"] || s))
534
- for (const l of Array.from(e.childNodes))
535
- B(l, e, !0);
426
+ for (const n of Array.from(e.childNodes))
427
+ G(n, e, !0);
536
428
  }
537
- }, _e = (e, t, s = !1) => {
538
- var r, o, l, n, i;
539
- const a = e.$hostElement$, d = e.$cmpMeta$, u = e.$vnode$ || U(null, null), f = Oe(t) ? t : Re(null, null, t);
540
- if (E = a.tagName, d.$attrsToReflect$ && (f.$attrs$ = f.$attrs$ || {}, d.$attrsToReflect$.map(
541
- ([$, c]) => f.$attrs$[c] = a[$]
542
- )), s && f.$attrs$)
543
- for (const $ of Object.keys(f.$attrs$))
544
- a.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (f.$attrs$[$] = a[$]);
545
- f.$tag$ = null, f.$flags$ |= 4, e.$vnode$ = f, f.$elm$ = u.$elm$ = a.shadowRoot || a, T = a["s-sc"], O = (d.$flags$ & 1) !== 0, w = a["s-cr"], M = !1, k(u, f, s);
429
+ }, Fe = (e, t, s = !1) => {
430
+ var r, o, n, l, a;
431
+ const c = e.$hostElement$, d = e.$cmpMeta$, f = e.$vnode$ || H(null, null), i = Oe(t) ? t : je(null, null, t);
432
+ if (L = c.tagName, d.$attrsToReflect$ && (i.$attrs$ = i.$attrs$ || {}, d.$attrsToReflect$.map(
433
+ ([$, u]) => i.$attrs$[u] = c[$]
434
+ )), s && i.$attrs$)
435
+ for (const $ of Object.keys(i.$attrs$))
436
+ c.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (i.$attrs$[$] = c[$]);
437
+ i.$tag$ = null, i.$flags$ |= 4, e.$vnode$ = i, i.$elm$ = f.$elm$ = c.shadowRoot || c, x = c["s-sc"], N = (d.$flags$ & 1) !== 0, B = c["s-cr"], _ = !1, A(f, i, s);
546
438
  {
547
- if (x.$flags$ |= 1, H) {
548
- ie(f.$elm$);
549
- for (const $ of S) {
550
- const c = $.$nodeToRelocate$;
551
- if (!c["s-ol"]) {
552
- const p = j.createTextNode("");
553
- p["s-nr"] = c, m(c.parentNode, c["s-ol"] = p, c);
439
+ if (E.$flags$ |= 1, z) {
440
+ ue(i.$elm$);
441
+ for (const $ of b) {
442
+ const u = $.$nodeToRelocate$;
443
+ if (!u["s-ol"]) {
444
+ const p = M.createTextNode("");
445
+ p["s-nr"] = u, T(u.parentNode, u["s-ol"] = p, u);
554
446
  }
555
447
  }
556
- for (const $ of S) {
557
- const c = $.$nodeToRelocate$, p = $.$slotRefNode$;
448
+ for (const $ of b) {
449
+ const u = $.$nodeToRelocate$, p = $.$slotRefNode$;
558
450
  if (p) {
559
- const b = p.parentNode;
451
+ const m = p.parentNode;
560
452
  let y = p.nextSibling;
561
453
  {
562
- let L = (r = c["s-ol"]) == null ? void 0 : r.previousSibling;
563
- for (; L; ) {
564
- let g = (o = L["s-nr"]) != null ? o : null;
565
- if (g && g["s-sn"] === c["s-sn"] && b === g.parentNode) {
566
- for (g = g.nextSibling; g === c || g != null && g["s-sr"]; )
567
- g = g == null ? void 0 : g.nextSibling;
568
- if (!g || !g["s-nr"]) {
569
- y = g;
454
+ let R = (r = u["s-ol"]) == null ? void 0 : r.previousSibling;
455
+ for (; R; ) {
456
+ let v = (o = R["s-nr"]) != null ? o : null;
457
+ if (v && v["s-sn"] === u["s-sn"] && m === v.parentNode) {
458
+ for (v = v.nextSibling; v === u || v != null && v["s-sr"]; )
459
+ v = v == null ? void 0 : v.nextSibling;
460
+ if (!v || !v["s-nr"]) {
461
+ y = v;
570
462
  break;
571
463
  }
572
464
  }
573
- L = L.previousSibling;
465
+ R = R.previousSibling;
574
466
  }
575
467
  }
576
- (!y && b !== c.parentNode || c.nextSibling !== y) && c !== y && (!c["s-hn"] && c["s-ol"] && (c["s-hn"] = c["s-ol"].parentNode.nodeName), m(b, c, y), c.nodeType === 1 && (c.hidden = (l = c["s-ih"]) != null ? l : !1)), c && typeof p["s-rf"] == "function" && p["s-rf"](c);
468
+ (!y && m !== u.parentNode || u.nextSibling !== y) && u !== y && (!u["s-hn"] && u["s-ol"] && (u["s-hn"] = u["s-ol"].parentNode.nodeName), T(m, u, y), u.nodeType === 1 && (u.hidden = (n = u["s-ih"]) != null ? n : !1)), u && typeof p["s-rf"] == "function" && p["s-rf"](u);
577
469
  } else
578
- c.nodeType === 1 && (s && (c["s-ih"] = (n = c.hidden) != null ? n : !1), c.hidden = !0);
470
+ u.nodeType === 1 && (s && (u["s-ih"] = (l = u.hidden) != null ? l : !1), u.hidden = !0);
579
471
  }
580
472
  }
581
- M && ne(f.$elm$), x.$flags$ &= -2, S.length = 0;
473
+ _ && fe(i.$elm$), E.$flags$ &= -2, b.length = 0;
582
474
  }
583
- if (N.experimentalScopedSlotChanges && d.$flags$ & 2)
584
- for (const $ of f.$elm$.childNodes)
585
- $["s-hn"] !== E && !$["s-sh"] && (s && $["s-ih"] == null && ($["s-ih"] = (i = $.hidden) != null ? i : !1), $.hidden = !0);
586
- w = void 0;
475
+ if (P.experimentalScopedSlotChanges && d.$flags$ & 2)
476
+ for (const $ of i.$elm$.childNodes)
477
+ $["s-hn"] !== L && !$["s-sh"] && (s && $["s-ih"] == null && ($["s-ih"] = (a = $.hidden) != null ? a : !1), $.hidden = !0);
478
+ B = void 0;
587
479
  };
588
- const Fe = (e, t, s) => {
480
+ const Ce = (e, t, s) => {
589
481
  [null, void 0, "", !1].includes(s) || ["innerHTML", "style"].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof s) ? "/!\\ Object props are not rendered in the code example" : s);
590
- }, fe = (e, t, s, r, o) => {
482
+ }, pe = (e, t, s, r, o) => {
591
483
  if (t && typeof t == "string") {
592
- const l = document.createElement(t);
593
- Object.keys(s || {}).forEach((n) => {
594
- Fe(l, n, s[n]);
595
- }), r == null || r.forEach((n) => {
596
- fe(l, n.$tag$, n.$attrs$, n.$children$, n.$text$);
597
- }), s != null && s.innerHTML && (l.innerHTML = s.innerHTML), e.appendChild(l);
484
+ const n = document.createElement(t);
485
+ Object.keys(s || {}).forEach((l) => {
486
+ Ce(n, l, s[l]);
487
+ }), r == null || r.forEach((l) => {
488
+ pe(n, l.$tag$, l.$attrs$, l.$children$, l.$text$);
489
+ }), s != null && s.innerHTML && (n.innerHTML = s.innerHTML), e.appendChild(n);
598
490
  }
599
491
  o && (e.innerHTML = o);
600
- }, et = (e, t) => {
492
+ }, Ve = (e, t) => {
601
493
  const s = {};
602
494
  if (typeof e != "object")
603
495
  throw new Error("filterArgs - args isn't an object.");
604
496
  for (const r in e)
605
497
  if (!r.startsWith("slot")) {
606
- const o = e[r], l = r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
607
- (!t || !Object.keys(t).includes(r) || t[r] !== o) && (s[l] = o);
498
+ const o = e[r], n = r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
499
+ (!t || !Object.keys(t).includes(r) || t[r] !== o) && (s[n] = o);
608
500
  }
609
501
  return s;
610
- }, tt = (e, t) => {
502
+ }, et = (e, t) => {
611
503
  var r, o;
612
504
  const s = document.getElementById("storybook-root");
613
- if (s)
614
- return (o = document.querySelector("[lang]")) == null || o.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), _e(
505
+ if (s !== null)
506
+ return (o = document.querySelector("[lang]")) == null || o.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), Fe(
615
507
  {
616
508
  $ancestorComponent$: void 0,
617
509
  $flags$: 0,
@@ -624,29 +516,291 @@ const Fe = (e, t, s) => {
624
516
  },
625
517
  e(t)
626
518
  ), s.children[s.children.length - 1];
627
- }, st = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
519
+ }, tt = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
628
520
  const o = document.createElement("div");
629
- return fe(o, e, t, s, r), o.innerHTML;
630
- }, rt = ({ disconnect: e, observe: t, takeRecords: s }) => {
521
+ return pe(o, e, t, s, r), o.innerHTML;
522
+ }, C = (e, t) => {
523
+ if (!t)
524
+ return;
525
+ const s = t.split("/");
526
+ return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
527
+ };
528
+ var S, D;
529
+ class st {
530
+ constructor(t) {
531
+ /**
532
+ * JsonDocs
533
+ */
534
+ g(this, "jsonDoc");
535
+ /**
536
+ * Get component data from the jsonDoc
537
+ * @param tagName - tag name we want to get the data from
538
+ * @returns component data
539
+ */
540
+ w(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));
541
+ /**
542
+ * Get the control for the given prop
543
+ * Based on https://storybook.js.org/docs/api/arg-types#controltype
544
+ * @param prop - prop to get control for
545
+ * @returns control type and options if applicable
546
+ */
547
+ w(this, D, (t) => {
548
+ const s = t.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (r) => r.replace(/\|/g, " OR ")).split("|").map((r) => r.trim().replace(/ OR /g, "|"));
549
+ return t.type === "string" ? { control: { type: "text" } } : t.type === "number" ? { control: { type: "number" } } : t.type === "boolean" ? { control: { type: "boolean" } } : t.type.startsWith("{") && t.type.endsWith("}") ? { control: { type: "object" } } : s.length > 1 ? s.includes("string") ? { control: { type: "text" } } : s.every((r) => r == null ? void 0 : r.includes("[]")) ? { control: { type: "object" } } : (s.unshift(void 0), { control: { type: "select" }, options: s }) : { control: { type: "object" } };
550
+ });
551
+ /**
552
+ * Extract component arg types from the component data
553
+ * @param tagName - tag name we want to extract the arg types from
554
+ * @returns component arg types
555
+ */
556
+ g(this, "extractArgTypes", (t) => {
557
+ const s = k(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((f, i) => {
558
+ const { control: $, options: u } = k(this, D).call(this, i);
559
+ return {
560
+ ...f,
561
+ [i.name]: {
562
+ name: i.attr || i.name,
563
+ description: i.docs,
564
+ type: { required: i.required },
565
+ table: {
566
+ category: "props",
567
+ type: { summary: i.type },
568
+ defaultValue: { summary: i.default }
569
+ },
570
+ control: $,
571
+ options: u
572
+ }
573
+ };
574
+ }, {}), o = s == null ? void 0 : s.events.reduce(
575
+ (f, i) => ({
576
+ ...f,
577
+ [i.event]: {
578
+ name: i.event,
579
+ description: i.docs,
580
+ table: {
581
+ category: "events",
582
+ type: { summary: i.detail }
583
+ }
584
+ }
585
+ }),
586
+ {}
587
+ ), n = s == null ? void 0 : s.methods.reduce(
588
+ (f, i) => ({
589
+ ...f,
590
+ [i.name]: {
591
+ name: i.name,
592
+ description: i.docs,
593
+ table: {
594
+ category: "methods",
595
+ type: { summary: i.signature }
596
+ }
597
+ }
598
+ }),
599
+ {}
600
+ ), l = s == null ? void 0 : s.slots.reduce(
601
+ (f, i) => ({
602
+ ...f,
603
+ [i.name]: {
604
+ name: i.name !== "" ? i.name : "default",
605
+ // default slot are unnamed
606
+ description: i.docs,
607
+ table: {
608
+ category: "slots",
609
+ type: { summary: void 0 }
610
+ }
611
+ }
612
+ }),
613
+ {}
614
+ ), a = s == null ? void 0 : s.styles.reduce(
615
+ (f, i) => ({
616
+ ...f,
617
+ [i.name]: {
618
+ name: i.name,
619
+ description: i.docs,
620
+ table: {
621
+ category: "custom properties",
622
+ type: { summary: void 0 }
623
+ }
624
+ }
625
+ }),
626
+ {}
627
+ ), c = s == null ? void 0 : s.dependencies.reduce((f, i) => {
628
+ const $ = k(this, S).call(this, i);
629
+ return {
630
+ ...f,
631
+ [i]: {
632
+ name: i,
633
+ description: `<a href="./?path=/docs/${C("", $ == null ? void 0 : $.filePath)}">View Component Documentation</a>`,
634
+ table: {
635
+ category: "depends on",
636
+ type: { summary: void 0 }
637
+ }
638
+ }
639
+ };
640
+ }, {}), d = s == null ? void 0 : s.dependents.reduce((f, i) => {
641
+ const $ = k(this, S).call(this, i);
642
+ return {
643
+ ...f,
644
+ [i]: {
645
+ name: i,
646
+ description: `<a href="./?path=/docs/${C("", $ == null ? void 0 : $.filePath)}">View Component Documentation</a>`,
647
+ table: {
648
+ category: "used by",
649
+ type: { summary: void 0 }
650
+ }
651
+ }
652
+ };
653
+ }, {});
654
+ return {
655
+ ...r,
656
+ ...o,
657
+ ...n,
658
+ ...l,
659
+ ...a,
660
+ ...c,
661
+ ...d
662
+ };
663
+ });
664
+ /**
665
+ * Extract component description from the component data
666
+ * @param tagName - tag name we want to extract the description from
667
+ * @returns component description
668
+ */
669
+ g(this, "extractComponentDescription", (t) => {
670
+ const s = k(this, S).call(this, t);
671
+ return (s == null ? void 0 : s.readme) || (s == null ? void 0 : s.docs);
672
+ });
673
+ this.jsonDoc = t;
674
+ }
675
+ }
676
+ S = new WeakMap(), D = new WeakMap();
677
+ const De = (e, t) => {
678
+ if (t)
679
+ return `${e}${t}`;
680
+ }, ge = (e) => {
681
+ let t = e.overview ? `${e.overview}
682
+
683
+ ` : "";
684
+ const s = e.props.filter(({ attr: o }) => o !== void 0);
685
+ s.length && (t += `Attributes:
686
+ `, t += s.map(({ attr: o, docs: n }) => `- \`${o}\`: ${n}
687
+ `).join(""), t += `
688
+ `);
689
+ const r = e.props.filter(({ attr: o }) => o === void 0);
690
+ return r.length && (t += `Properties:
691
+ `, t += r.map(({ name: o, docs: n }) => `- \`${o}\`: ${n}
692
+ `).join(""), t += `
693
+ `), e.methods.length && (t += `Methods:
694
+ `, t += e.methods.map(({ name: o, docs: n }) => `- \`${o}\`: ${n}
695
+ `).join(""), t += `
696
+ `), e.events.length && (t += `Events:
697
+ `, t += e.events.map(({ event: o, docs: n }) => `- \`${o}\`: ${n}
698
+ `).join(""), t += `
699
+ `), e.listeners.length && (t += `Listeners:
700
+ `, t += e.listeners.map(({ event: o }) => `- \`${o}\`
701
+ `).join(""), t += `
702
+ `), e.slots.length && (t += `Slots:
703
+ `, t += e.slots.map(({ name: o, docs: n }) => `- \`${o}\`: ${n}
704
+ `).join(""), t += `
705
+ `), t;
706
+ }, W = (e) => `${e.docs}
707
+
708
+ Type: \`${e.type}\``, rt = (e, t, s, r) => ({
709
+ $schema: "https://json.schemastore.org/web-types",
710
+ name: e,
711
+ version: t,
712
+ "description-markup": "markdown",
713
+ contributions: {
714
+ html: {
715
+ elements: s.components.map((o) => {
716
+ const n = C(r, o.filePath);
717
+ return {
718
+ name: o.tag,
719
+ description: ge(o),
720
+ "doc-url": n,
721
+ attributes: o.props.filter((l) => l.attr).map((l) => ({
722
+ name: l.attr,
723
+ description: W(l),
724
+ "doc-url": n,
725
+ value: {
726
+ type: l.type,
727
+ default: l.default,
728
+ required: l.required
729
+ }
730
+ })),
731
+ js: {
732
+ properties: o.props.map((l) => ({
733
+ name: l.name,
734
+ description: W(l),
735
+ "doc-url": n,
736
+ value: {
737
+ type: l.type,
738
+ default: l.default,
739
+ required: l.required
740
+ }
741
+ })),
742
+ events: o.events.map((l) => ({
743
+ name: l.event,
744
+ description: l.docs
745
+ }))
746
+ }
747
+ };
748
+ })
749
+ }
750
+ }
751
+ }), Pe = (e, t, s) => [
752
+ { name: "Storybook", url: C(e, s) },
753
+ { name: "Sources", url: De(t, s) }
754
+ ], we = (e) => {
755
+ if (!e.values.some(({ value: t }) => t === void 0))
756
+ return e.values.map(({ value: t }) => ({ name: t }));
757
+ }, ot = (e, t, s, r) => ({
758
+ version: e,
759
+ tags: t.components.map((o) => {
760
+ const n = Pe(s, r, o.filePath);
761
+ return {
762
+ name: o.tag,
763
+ description: ge(o),
764
+ attributes: o.props.map((l) => ({
765
+ name: l.attr || l.name,
766
+ description: W(l),
767
+ values: we(l),
768
+ references: n
769
+ })),
770
+ references: n
771
+ };
772
+ }),
773
+ globalAttributes: [],
774
+ valueSets: []
775
+ }), nt = (e) => {
776
+ const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
777
+ return Be([t.value, s.value, r.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
778
+ }, lt = (e) => e.toISOString().split("T")[0], Ue = (e, t, s) => {
779
+ const r = e.closest("[lang]"), o = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), n = o.length > 0 && typeof o[0] == "string" ? o[0] : navigator.language || s, l = n.split("-").shift();
780
+ return {
781
+ locale: n,
782
+ messages: t[l] || t[s]
783
+ };
784
+ }, it = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), at = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), He = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, Be = (e, t, s) => typeof e != "string" || e === "" || !He.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), ct = (e, t) => (s) => Ue(s, e, t), ft = ({ disconnect: e, observe: t, takeRecords: s }) => {
631
785
  class r {
632
- constructor(l) {
786
+ constructor(n) {
633
787
  /**
634
788
  *
635
789
  */
636
- v(this, "disconnect", e);
790
+ g(this, "disconnect", e);
637
791
  /**
638
792
  *
639
793
  */
640
- v(this, "observe", t);
794
+ g(this, "observe", t);
641
795
  /**
642
796
  *
643
797
  */
644
- v(this, "takeRecords", s);
798
+ g(this, "takeRecords", s);
645
799
  /**
646
800
  *
647
801
  */
648
- v(this, "cb");
649
- this.cb = l;
802
+ g(this, "cb");
803
+ this.cb = n;
650
804
  }
651
805
  }
652
806
  return [window, global].forEach((o) => {
@@ -656,25 +810,25 @@ const Fe = (e, t, s) => {
656
810
  value: r
657
811
  });
658
812
  }), r;
659
- }, ot = ({ disconnect: e, observe: t }) => {
813
+ }, ut = ({ disconnect: e, observe: t }) => {
660
814
  class s {
661
815
  constructor(o) {
662
816
  /**
663
817
  *
664
818
  */
665
- v(this, "disconnect", e);
819
+ g(this, "disconnect", e);
666
820
  /**
667
821
  *
668
822
  */
669
- v(this, "observe", t);
823
+ g(this, "observe", t);
670
824
  /**
671
825
  *
672
826
  */
673
- v(this, "unobserve");
827
+ g(this, "unobserve");
674
828
  /**
675
829
  *
676
830
  */
677
- v(this, "cb");
831
+ g(this, "cb");
678
832
  this.cb = o;
679
833
  }
680
834
  }
@@ -686,18 +840,18 @@ const Fe = (e, t, s) => {
686
840
  });
687
841
  }), s;
688
842
  };
689
- class Ue extends Event {
843
+ class We extends Event {
690
844
  constructor() {
691
845
  super(...arguments);
692
846
  /**
693
847
  *
694
848
  */
695
849
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
696
- v(this, "detail");
850
+ g(this, "detail");
697
851
  }
698
852
  }
699
- const lt = () => {
700
- class e extends Ue {
853
+ const $t = () => {
854
+ class e extends We {
701
855
  }
702
856
  return [window, global].forEach((t) => {
703
857
  Object.defineProperty(t, "SubmitEvent", {
@@ -708,30 +862,32 @@ const lt = () => {
708
862
  }), e;
709
863
  };
710
864
  export {
711
- He as ClassList,
712
- Pe as allItemsAreString,
713
- qe as cleanString,
714
- Ce as createID,
715
- he as dateRegExp,
716
- Ze as dateToString,
717
- Ve as defineLocales,
718
- et as filterArgs,
719
- We as focusableElements,
720
- Qe as getLocaleDatePattern,
721
- Q as getParentWindows,
722
- st as getStoryHTML,
723
- ze as getWindows,
724
- Be as isTagName,
725
- Ie as isValidString,
726
- Je as localeCurrency,
727
- ye as localeDate,
728
- Ye as localeNumber,
729
- Ge as nextTick,
730
- rt as setupMutationObserverMock,
731
- ot as setupResizeObserverMock,
732
- lt as setupSubmitEventMock,
733
- tt as stencilWrapper,
734
- Ke as vsCodeGenerator,
735
- Xe as webTypesGenerator
865
+ Ie as ClassList,
866
+ st as StorybookPreview,
867
+ Ge as allItemsAreString,
868
+ Je as cleanString,
869
+ ze as createID,
870
+ He as dateRegExp,
871
+ lt as dateToString,
872
+ ct as defineLocales,
873
+ Ve as filterArgs,
874
+ Ke as focusableElements,
875
+ nt as getLocaleDatePattern,
876
+ te as getParentWindows,
877
+ tt as getStoryHTML,
878
+ C as getStorybookUrl,
879
+ Qe as getWindows,
880
+ Xe as isTagName,
881
+ Ze as isValidString,
882
+ it as localeCurrency,
883
+ Be as localeDate,
884
+ at as localeNumber,
885
+ Ye as nextTick,
886
+ ft as setupMutationObserverMock,
887
+ ut as setupResizeObserverMock,
888
+ $t as setupSubmitEventMock,
889
+ et as stencilWrapper,
890
+ ot as vsCodeGenerator,
891
+ rt as webTypesGenerator
736
892
  };
737
893
  //# sourceMappingURL=index.es.js.map