@mgdis/stencil-helpers 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -4,8 +4,8 @@ var p = (t, e, n) => (ce(t, typeof e != "symbol" ? e + "" : e, n), n);
4
4
  const Re = (t = "", e = 10) => {
5
5
  const n = new Uint8Array(e);
6
6
  crypto.getRandomValues(n);
7
- const r = Array.from(n).map((s) => s.toString(16).padStart(2, "0")).join("").slice(0, e);
8
- return t !== "" ? `${t}-${r}` : r;
7
+ const s = Array.from(n).map((r) => r.toString(16).padStart(2, "0")).join("").slice(0, e);
8
+ return t !== "" ? `${t}-${s}` : s;
9
9
  };
10
10
  class Me {
11
11
  constructor(e = []) {
@@ -43,23 +43,23 @@ class Me {
43
43
  }
44
44
  }
45
45
  const Oe = (t) => Array.isArray(t) && t.every((e) => typeof e == "string"), Fe = (t, e) => e.includes(t == null ? void 0 : t.tagName.toLowerCase()), De = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', _e = (t) => {
46
- const e = G(t), n = I(t);
46
+ const e = I(t), n = X(t);
47
47
  return [t, ...e, ...n];
48
- }, G = (t, e = []) => {
48
+ }, I = (t, e = []) => {
49
49
  if (t.self !== t.top)
50
50
  try {
51
51
  const n = t.parent;
52
- return n ? (e.push(n), G(n, e)) : e;
52
+ return n ? (e.push(n), I(n, e)) : e;
53
53
  } catch (n) {
54
54
  return console.error("Different hosts between iframes:", n), e;
55
55
  }
56
56
  return e;
57
- }, I = (t, e = []) => {
57
+ }, X = (t, e = []) => {
58
58
  if (t.frames.length > 0)
59
59
  for (const n of Array.from(t.frames))
60
- e.push(n), I(n, e);
60
+ e.push(n), X(n, e);
61
61
  return e;
62
- }, Be = (t) => typeof t == "string" && t.trim() !== "", Ne = (t) => typeof t == "string" ? t.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : t, Ue = async (t) => t(), X = (t, e) => {
62
+ }, Be = (t) => typeof t == "string" && t.trim() !== "", Ne = (t) => typeof t == "string" ? t.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : t, Ue = async (t) => t(), K = (t, e) => {
63
63
  if (!e)
64
64
  return;
65
65
  const n = e.split("/");
@@ -67,71 +67,71 @@ const Oe = (t) => Array.isArray(t) && t.every((e) => typeof e == "string"), Fe =
67
67
  }, ae = (t, e) => {
68
68
  if (e)
69
69
  return `${t}${e}`;
70
- }, K = (t) => {
70
+ }, Q = (t) => {
71
71
  let e = t.overview ? `${t.overview}
72
72
 
73
73
  ` : "";
74
- const n = t.props.filter(({ attr: s }) => s !== void 0);
74
+ const n = t.props.filter(({ attr: r }) => r !== void 0);
75
75
  n.length && (e += `Attributes:
76
- `, e += n.map(({ attr: s, docs: o }) => `- \`${s}\`: ${o}
76
+ `, e += n.map(({ attr: r, docs: l }) => `- \`${r}\`: ${l}
77
77
  `).join(""), e += `
78
78
  `);
79
- const r = t.props.filter(({ attr: s }) => s === void 0);
80
- return r.length && (e += `Properties:
81
- `, e += r.map(({ name: s, docs: o }) => `- \`${s}\`: ${o}
79
+ const s = t.props.filter(({ attr: r }) => r === void 0);
80
+ return s.length && (e += `Properties:
81
+ `, e += s.map(({ name: r, docs: l }) => `- \`${r}\`: ${l}
82
82
  `).join(""), e += `
83
83
  `), t.methods.length && (e += `Methods:
84
- `, e += t.methods.map(({ name: s, docs: o }) => `- \`${s}\`: ${o}
84
+ `, e += t.methods.map(({ name: r, docs: l }) => `- \`${r}\`: ${l}
85
85
  `).join(""), e += `
86
86
  `), t.events.length && (e += `Events:
87
- `, e += t.events.map(({ event: s, docs: o }) => `- \`${s}\`: ${o}
87
+ `, e += t.events.map(({ event: r, docs: l }) => `- \`${r}\`: ${l}
88
88
  `).join(""), e += `
89
89
  `), t.listeners.length && (e += `Listeners:
90
- `, e += t.listeners.map(({ event: s }) => `- \`${s}\`
90
+ `, e += t.listeners.map(({ event: r }) => `- \`${r}\`
91
91
  `).join(""), e += `
92
92
  `), t.slots.length && (e += `Slots:
93
- `, e += t.slots.map(({ name: s, docs: o }) => `- \`${s}\`: ${o}
93
+ `, e += t.slots.map(({ name: r, docs: l }) => `- \`${r}\`: ${l}
94
94
  `).join(""), e += `
95
95
  `), e;
96
96
  }, F = (t) => `${t.docs}
97
97
 
98
- Type: \`${t.type}\``, Ce = (t, e, n, r) => ({
98
+ Type: \`${t.type}\``, Ce = (t, e, n, s) => ({
99
99
  $schema: "https://json.schemastore.org/web-types",
100
100
  name: t,
101
101
  version: e,
102
102
  "description-markup": "markdown",
103
103
  contributions: {
104
104
  html: {
105
- elements: n.components.map((s) => {
106
- const o = X(r, s.filePath);
105
+ elements: n.components.map((r) => {
106
+ const l = K(s, r.filePath);
107
107
  return {
108
- name: s.tag,
109
- description: K(s),
110
- "doc-url": o,
111
- attributes: s.props.filter((l) => l.attr).map((l) => ({
112
- name: l.attr,
113
- description: F(l),
114
- "doc-url": o,
108
+ name: r.tag,
109
+ description: Q(r),
110
+ "doc-url": l,
111
+ attributes: r.props.filter((o) => o.attr).map((o) => ({
112
+ name: o.attr,
113
+ description: F(o),
114
+ "doc-url": l,
115
115
  value: {
116
- type: l.type,
117
- default: l.default,
118
- required: l.required
116
+ type: o.type,
117
+ default: o.default,
118
+ required: o.required
119
119
  }
120
120
  })),
121
121
  js: {
122
- properties: s.props.map((l) => ({
123
- name: l.name,
124
- description: F(l),
125
- "doc-url": o,
122
+ properties: r.props.map((o) => ({
123
+ name: o.name,
124
+ description: F(o),
125
+ "doc-url": l,
126
126
  value: {
127
- type: l.type,
128
- default: l.default,
129
- required: l.required
127
+ type: o.type,
128
+ default: o.default,
129
+ required: o.required
130
130
  }
131
131
  })),
132
- events: s.events.map((l) => ({
133
- name: l.event,
134
- description: l.docs
132
+ events: r.events.map((o) => ({
133
+ name: o.event,
134
+ description: o.docs
135
135
  }))
136
136
  }
137
137
  };
@@ -141,40 +141,40 @@ Type: \`${t.type}\``, Ce = (t, e, n, r) => ({
141
141
  }), fe = (t, e, n) => {
142
142
  if (n)
143
143
  return [
144
- { name: "Storybook", url: X(t, n) },
144
+ { name: "Storybook", url: K(t, n) },
145
145
  { name: "Sources", url: ae(e, n) }
146
146
  ];
147
147
  }, $e = (t) => {
148
148
  if (!t.values.some(({ value: e }) => e === void 0))
149
149
  return t.values.map(({ value: e }) => ({ name: e }));
150
- }, He = (t, e, n, r) => ({
150
+ }, He = (t, e, n, s) => ({
151
151
  version: t,
152
- tags: e.components.map((s) => {
153
- const o = fe(n, r, s.filePath);
152
+ tags: e.components.map((r) => {
153
+ const l = fe(n, s, r.filePath);
154
154
  return {
155
- name: s.tag,
156
- description: K(s),
157
- attributes: s.props.map((l) => ({
158
- name: l.attr || l.name,
159
- description: F(l),
160
- values: $e(l),
161
- references: o
155
+ name: r.tag,
156
+ description: Q(r),
157
+ attributes: r.props.map((o) => ({
158
+ name: o.attr || o.name,
159
+ description: F(o),
160
+ values: $e(o),
161
+ references: l
162
162
  })),
163
- references: o
163
+ references: l
164
164
  };
165
165
  }),
166
166
  globalAttributes: [],
167
167
  valueSets: []
168
168
  }), Pe = (t) => {
169
- const e = { value: "2023", pattern: "yyyy" }, n = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
170
- return ge([e.value, n.value, r.value].join("-"), t).replace(e.value, e.pattern).replace(n.value, n.pattern).replace(r.value, r.pattern);
169
+ const e = { value: "2023", pattern: "yyyy" }, n = { value: "12", pattern: "mm" }, s = { value: "24", pattern: "dd" };
170
+ return ge([e.value, n.value, s.value].join("-"), t).replace(e.value, e.pattern).replace(n.value, n.pattern).replace(s.value, s.pattern);
171
171
  }, We = (t) => t.toISOString().split("T")[0], ue = (t, e, n) => {
172
- const r = t.closest("[lang]"), s = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), o = s.length > 0 && typeof s[0] == "string" ? s[0] : navigator.language || n, l = o.split("-").shift();
172
+ const s = t.closest("[lang]"), r = Intl.NumberFormat.supportedLocalesOf(s == null ? void 0 : s.lang), l = r.length > 0 && typeof r[0] == "string" ? r[0] : navigator.language || n, o = l.split("-").shift();
173
173
  return {
174
- locale: o,
175
- messages: e[l] || e[n]
174
+ locale: l,
175
+ messages: e[o] || e[n]
176
176
  };
177
- }, ze = (t, e, n) => new Intl.NumberFormat(e, { style: "currency", currency: n }).format(t), qe = (t, e) => new Intl.NumberFormat(e).format(t), de = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, ge = (t, e) => typeof t != "string" || t === "" || !de.test(t) ? "" : new Intl.DateTimeFormat(e).format(new Date(t)), we = (t, e) => (n) => ue(n, t, e), Q = {
177
+ }, ze = (t, e, n) => new Intl.NumberFormat(e, { style: "currency", currency: n }).format(t), qe = (t, e) => new Intl.NumberFormat(e).format(t), de = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, ge = (t, e) => typeof t != "string" || t === "" || !de.test(t) ? "" : new Intl.DateTimeFormat(e).format(new Date(t)), we = (t, e) => (n) => ue(n, t, e), _ = {
178
178
  allRenderFn: !1,
179
179
  cmpDidLoad: !0,
180
180
  cmpDidUnload: !1,
@@ -263,15 +263,15 @@ Type: \`${t.type}\``, Ce = (t, e, n, r) => ({
263
263
  // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
264
264
  experimentalSlotFixes: !1
265
265
  };
266
- let k, D, x, _ = !1, R = !1, B = !1, h = !1;
267
- const C = "http://www.w3.org/1999/xlink", H = {}, pe = "http://www.w3.org/2000/svg", he = "http://www.w3.org/1999/xhtml", ye = (t) => t != null, J = (t) => (t = typeof t, t === "object" || t === "function"), Y = (t, e, ...n) => {
268
- let r = null, s = null, o = null, l = !1, c = !1;
266
+ let k, D, m, B = !1, R = !1, N = !1, h = !1;
267
+ const H = "http://www.w3.org/1999/xlink", P = {}, pe = "http://www.w3.org/2000/svg", he = "http://www.w3.org/1999/xhtml", ye = (t) => t != null, J = (t) => (t = typeof t, t === "object" || t === "function"), Y = (t, e, ...n) => {
268
+ let s = null, r = null, l = null, o = !1, c = !1;
269
269
  const i = [], d = (a) => {
270
270
  for (let $ = 0; $ < a.length; $++)
271
- r = a[$], Array.isArray(r) ? d(r) : r != null && typeof r != "boolean" && ((l = typeof t != "function" && !J(r)) && (r = String(r)), l && c ? i[i.length - 1].$text$ += r : i.push(l ? M(null, r) : r), c = l);
271
+ s = a[$], Array.isArray(s) ? d(s) : s != null && typeof s != "boolean" && ((o = typeof t != "function" && !J(s)) && (s = String(s)), o && c ? i[i.length - 1].$text$ += s : i.push(o ? M(null, s) : s), c = o);
272
272
  };
273
273
  if (d(n), e) {
274
- e.key && (s = e.key), e.name && (o = e.name);
274
+ e.key && (r = e.key), e.name && (l = e.name);
275
275
  {
276
276
  const a = e.className || e.class;
277
277
  a && (e.class = typeof a != "object" ? a : Object.keys(a).filter(($) => a[$]).join(" "));
@@ -280,7 +280,7 @@ const C = "http://www.w3.org/1999/xlink", H = {}, pe = "http://www.w3.org/2000/s
280
280
  if (typeof t == "function")
281
281
  return t(e === null ? {} : e, i, Se);
282
282
  const u = M(t, null);
283
- return u.$attrs$ = e, i.length > 0 && (u.$children$ = i), u.$key$ = s, u.$name$ = o, u;
283
+ return u.$attrs$ = e, i.length > 0 && (u.$children$ = i), u.$key$ = r, u.$name$ = l, u;
284
284
  }, M = (t, e) => {
285
285
  const n = {
286
286
  $flags$: 0,
@@ -291,9 +291,9 @@ const C = "http://www.w3.org/1999/xlink", H = {}, pe = "http://www.w3.org/2000/s
291
291
  };
292
292
  return n.$attrs$ = null, n.$key$ = null, n.$name$ = null, n;
293
293
  }, ve = {}, be = (t) => t && t.$tag$ === ve, Se = {
294
- forEach: (t, e) => t.map(P).forEach(e),
295
- map: (t, e) => t.map(P).map(e).map(ke)
296
- }, P = (t) => ({
294
+ forEach: (t, e) => t.map(W).forEach(e),
295
+ map: (t, e) => t.map(W).map(e).map(ke)
296
+ }, W = (t) => ({
297
297
  vattrs: t.$attrs$,
298
298
  vchildren: t.$children$,
299
299
  vkey: t.$key$,
@@ -307,134 +307,140 @@ const C = "http://www.w3.org/1999/xlink", H = {}, pe = "http://www.w3.org/2000/s
307
307
  }
308
308
  const e = M(t.vtag, t.vtext);
309
309
  return e.$attrs$ = t.vattrs, e.$children$ = t.vchildren, e.$key$ = t.vkey, e.$name$ = t.vname, e;
310
- }, W = (t, e, n, r, s, o) => {
311
- if (n !== r) {
312
- let l = w(t, e), c = e.toLowerCase();
310
+ }, z = (t, e, n, s, r, l) => {
311
+ if (n !== s) {
312
+ let o = G(t, e), c = e.toLowerCase();
313
313
  if (e === "class") {
314
- const i = t.classList, d = z(n), u = z(r);
314
+ const i = t.classList, d = q(n), u = q(s);
315
315
  i.remove(...d.filter((a) => a && !u.includes(a))), i.add(...u.filter((a) => a && !d.includes(a)));
316
316
  } else if (e === "style") {
317
317
  for (const i in n)
318
- (!r || r[i] == null) && (i.includes("-") ? t.style.removeProperty(i) : t.style[i] = "");
319
- for (const i in r)
320
- (!n || r[i] !== n[i]) && (i.includes("-") ? t.style.setProperty(i, r[i]) : t.style[i] = r[i]);
318
+ (!s || s[i] == null) && (i.includes("-") ? t.style.removeProperty(i) : t.style[i] = "");
319
+ for (const i in s)
320
+ (!n || s[i] !== n[i]) && (i.includes("-") ? t.style.setProperty(i, s[i]) : t.style[i] = s[i]);
321
321
  } else if (e !== "key")
322
322
  if (e === "ref")
323
- r && r(t);
323
+ s && s(t);
324
324
  else if (!t.__lookupSetter__(e) && e[0] === "o" && e[1] === "n") {
325
- if (e[2] === "-" ? e = e.slice(3) : w(U, c) ? e = c.slice(2) : e = c[2] + e.slice(3), n || r) {
325
+ if (e[2] === "-" ? e = e.slice(3) : G(C, c) ? e = c.slice(2) : e = c[2] + e.slice(3), n || s) {
326
326
  const i = e.endsWith(Z);
327
- e = e.replace(Te, ""), n && T.rel(t, e, n, i), r && T.ael(t, e, r, i);
327
+ e = e.replace(me, ""), n && x.rel(t, e, n, i), s && x.ael(t, e, s, i);
328
328
  }
329
329
  } else {
330
- const i = J(r);
331
- if ((l || i && r !== null) && !s)
330
+ const i = J(s);
331
+ if ((o || i && s !== null) && !r)
332
332
  try {
333
333
  if (t.tagName.includes("-"))
334
- t[e] = r;
334
+ t[e] = s;
335
335
  else {
336
- const u = r ?? "";
337
- e === "list" ? l = !1 : (n == null || t[e] != u) && (t[e] = u);
336
+ const u = s ?? "";
337
+ e === "list" ? o = !1 : (n == null || t[e] != u) && (t[e] = u);
338
338
  }
339
339
  } catch {
340
340
  }
341
341
  let d = !1;
342
- c !== (c = c.replace(/^xlink\:?/, "")) && (e = c, d = !0), r == null || r === !1 ? (r !== !1 || t.getAttribute(e) === "") && (d ? t.removeAttributeNS(C, e) : t.removeAttribute(e)) : (!l || o & 4 || s) && !i && (r = r === !0 ? "" : r, d ? t.setAttributeNS(C, e, r) : t.setAttribute(e, r));
342
+ c !== (c = c.replace(/^xlink\:?/, "")) && (e = c, d = !0), s == null || s === !1 ? (s !== !1 || t.getAttribute(e) === "") && (d ? t.removeAttributeNS(H, e) : t.removeAttribute(e)) : (!o || l & 4 || r) && !i && (s = s === !0 ? "" : s, d ? t.setAttributeNS(H, e, s) : t.setAttribute(e, s));
343
343
  }
344
344
  }
345
- }, me = /\s/, z = (t) => t ? t.split(me) : [], Z = "Capture", Te = new RegExp(Z + "$"), V = (t, e, n, r) => {
346
- const s = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, o = t && t.$attrs$ || H, l = e.$attrs$ || H;
347
- for (r in o)
348
- r in l || W(s, r, o[r], void 0, n, e.$flags$);
349
- for (r in l)
350
- W(s, r, o[r], l[r], n, e.$flags$);
351
- }, O = (t, e, n, r) => {
352
- const s = e.$children$[n];
353
- let o = 0, l, c, i;
354
- if (_ || (B = !0, s.$tag$ === "slot" && (k && r.classList.add(k + "-s"), s.$flags$ |= s.$children$ ? (
345
+ }, Te = /\s/, q = (t) => t ? t.split(Te) : [], Z = "Capture", me = new RegExp(Z + "$"), V = (t, e, n, s) => {
346
+ const r = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, l = t && t.$attrs$ || P, o = e.$attrs$ || P;
347
+ for (s in l)
348
+ s in o || z(r, s, l[s], void 0, n, e.$flags$);
349
+ for (s in o)
350
+ z(r, s, l[s], o[s], n, e.$flags$);
351
+ }, O = (t, e, n, s) => {
352
+ var r;
353
+ const l = e.$children$[n];
354
+ let o = 0, c, i, d;
355
+ if (B || (N = !0, l.$tag$ === "slot" && (k && s.classList.add(k + "-s"), l.$flags$ |= l.$children$ ? (
355
356
  // slot element has fallback content
356
357
  2
357
358
  ) : (
358
359
  // slot element does not have fallback content
359
360
  1
360
- ))), s.$text$ !== null)
361
- l = s.$elm$ = j.createTextNode(s.$text$);
362
- else if (s.$flags$ & 1)
363
- l = s.$elm$ = j.createTextNode("");
361
+ ))), l.$text$ !== null)
362
+ c = l.$elm$ = j.createTextNode(l.$text$);
363
+ else if (l.$flags$ & 1)
364
+ c = l.$elm$ = j.createTextNode("");
364
365
  else {
365
- if (h || (h = s.$tag$ === "svg"), l = s.$elm$ = j.createElementNS(h ? pe : he, s.$flags$ & 2 ? "slot-fb" : s.$tag$), h && s.$tag$ === "foreignObject" && (h = !1), V(null, s, h), ye(k) && l["s-si"] !== k && l.classList.add(l["s-si"] = k), s.$children$)
366
- for (o = 0; o < s.$children$.length; ++o)
367
- c = O(t, s, o, l), c && l.appendChild(c);
368
- s.$tag$ === "svg" ? h = !1 : l.tagName === "foreignObject" && (h = !0);
366
+ if (h || (h = l.$tag$ === "svg"), c = l.$elm$ = j.createElementNS(h ? pe : he, l.$flags$ & 2 ? "slot-fb" : l.$tag$), h && l.$tag$ === "foreignObject" && (h = !1), V(null, l, h), ye(k) && c["s-si"] !== k && c.classList.add(c["s-si"] = k), l.$children$)
367
+ for (o = 0; o < l.$children$.length; ++o)
368
+ i = O(t, l, o, c), i && c.appendChild(i);
369
+ l.$tag$ === "svg" ? h = !1 : c.tagName === "foreignObject" && (h = !0);
369
370
  }
370
- return l["s-hn"] = x, s.$flags$ & 3 && (l["s-sr"] = !0, l["s-cr"] = D, l["s-sn"] = s.$name$ || "", i = t && t.$children$ && t.$children$[n], i && i.$tag$ === s.$tag$ && t.$elm$ && E(t.$elm$, !1)), l;
371
- }, E = (t, e) => {
372
- T.$flags$ |= 1;
373
- const n = t.childNodes;
374
- for (let r = n.length - 1; r >= 0; r--) {
375
- const s = n[r];
376
- s["s-hn"] !== x && s["s-ol"] && (se(s).insertBefore(s, N(s)), s["s-ol"].remove(), s["s-ol"] = void 0, s["s-sh"] = void 0, B = !0), e && E(s, e);
371
+ return c["s-hn"] = m, l.$flags$ & 3 && (c["s-sr"] = !0, c["s-cr"] = D, c["s-sn"] = l.$name$ || "", c["s-rf"] = (r = l.$attrs$) === null || r === void 0 ? void 0 : r.ref, d = t && t.$children$ && t.$children$[n], d && d.$tag$ === l.$tag$ && t.$elm$ && L(t.$elm$, !1)), c;
372
+ }, L = (t, e) => {
373
+ x.$flags$ |= 1;
374
+ const n = Array.from(t.childNodes);
375
+ if (t["s-sr"] && _.experimentalSlotFixes) {
376
+ let s = t;
377
+ for (; s = s.nextSibling; )
378
+ s && s["s-sn"] === t["s-sn"] && s["s-sh"] === m && n.push(s);
377
379
  }
378
- T.$flags$ &= -2;
379
- }, ee = (t, e, n, r, s, o) => {
380
- let l = t["s-cr"] && t["s-cr"].parentNode || t, c;
381
- for (l.shadowRoot && l.tagName === x && (l = l.shadowRoot); s <= o; ++s)
382
- r[s] && (c = O(null, n, s, t), c && (r[s].$elm$ = c, l.insertBefore(c, N(e))));
380
+ for (let s = n.length - 1; s >= 0; s--) {
381
+ const r = n[s];
382
+ r["s-hn"] !== m && r["s-ol"] && (se(r).insertBefore(r, U(r)), r["s-ol"].remove(), r["s-ol"] = void 0, r["s-sh"] = void 0, N = !0), e && L(r, e);
383
+ }
384
+ x.$flags$ &= -2;
385
+ }, ee = (t, e, n, s, r, l) => {
386
+ let o = t["s-cr"] && t["s-cr"].parentNode || t, c;
387
+ for (o.shadowRoot && o.tagName === m && (o = o.shadowRoot); r <= l; ++r)
388
+ s[r] && (c = O(null, n, r, t), c && (s[r].$elm$ = c, o.insertBefore(c, U(e))));
383
389
  }, te = (t, e, n) => {
384
- for (let r = e; r <= n; ++r) {
385
- const s = t[r];
386
- if (s) {
387
- const o = s.$elm$;
388
- le(s), o && (R = !0, o["s-ol"] ? o["s-ol"].remove() : E(o, !0), o.remove());
390
+ for (let s = e; s <= n; ++s) {
391
+ const r = t[s];
392
+ if (r) {
393
+ const l = r.$elm$;
394
+ le(r), l && (R = !0, l["s-ol"] ? l["s-ol"].remove() : L(l, !0), l.remove());
389
395
  }
390
396
  }
391
- }, xe = (t, e, n, r, s = !1) => {
392
- let o = 0, l = 0, c = 0, i = 0, d = e.length - 1, u = e[0], a = e[d], $ = r.length - 1, f = r[0], g = r[$], v, y;
393
- for (; o <= d && l <= $; )
397
+ }, xe = (t, e, n, s, r = !1) => {
398
+ let l = 0, o = 0, c = 0, i = 0, d = e.length - 1, u = e[0], a = e[d], $ = s.length - 1, f = s[0], g = s[$], v, y;
399
+ for (; l <= d && o <= $; )
394
400
  if (u == null)
395
- u = e[++o];
401
+ u = e[++l];
396
402
  else if (a == null)
397
403
  a = e[--d];
398
404
  else if (f == null)
399
- f = r[++l];
405
+ f = s[++o];
400
406
  else if (g == null)
401
- g = r[--$];
402
- else if (A(u, f, s))
403
- m(u, f, s), u = e[++o], f = r[++l];
404
- else if (A(a, g, s))
405
- m(a, g, s), a = e[--d], g = r[--$];
406
- else if (A(u, g, s))
407
- (u.$tag$ === "slot" || g.$tag$ === "slot") && E(u.$elm$.parentNode, !1), m(u, g, s), t.insertBefore(u.$elm$, a.$elm$.nextSibling), u = e[++o], g = r[--$];
408
- else if (A(a, f, s))
409
- (u.$tag$ === "slot" || g.$tag$ === "slot") && E(a.$elm$.parentNode, !1), m(a, f, s), t.insertBefore(a.$elm$, u.$elm$), a = e[--d], f = r[++l];
407
+ g = s[--$];
408
+ else if (E(u, f, r))
409
+ T(u, f, r), u = e[++l], f = s[++o];
410
+ else if (E(a, g, r))
411
+ T(a, g, r), a = e[--d], g = s[--$];
412
+ else if (E(u, g, r))
413
+ (u.$tag$ === "slot" || g.$tag$ === "slot") && L(u.$elm$.parentNode, !1), T(u, g, r), t.insertBefore(u.$elm$, a.$elm$.nextSibling), u = e[++l], g = s[--$];
414
+ else if (E(a, f, r))
415
+ (u.$tag$ === "slot" || g.$tag$ === "slot") && L(a.$elm$.parentNode, !1), T(a, f, r), t.insertBefore(a.$elm$, u.$elm$), a = e[--d], f = s[++o];
410
416
  else {
411
- for (c = -1, i = o; i <= d; ++i)
417
+ for (c = -1, i = l; i <= d; ++i)
412
418
  if (e[i] && e[i].$key$ !== null && e[i].$key$ === f.$key$) {
413
419
  c = i;
414
420
  break;
415
421
  }
416
- c >= 0 ? (y = e[c], y.$tag$ !== f.$tag$ ? v = O(e && e[l], n, c, t) : (m(y, f, s), e[c] = void 0, v = y.$elm$), f = r[++l]) : (v = O(e && e[l], n, l, t), f = r[++l]), v && se(u.$elm$).insertBefore(v, N(u.$elm$));
422
+ c >= 0 ? (y = e[c], y.$tag$ !== f.$tag$ ? v = O(e && e[o], n, c, t) : (T(y, f, r), e[c] = void 0, v = y.$elm$), f = s[++o]) : (v = O(e && e[o], n, o, t), f = s[++o]), v && se(u.$elm$).insertBefore(v, U(u.$elm$));
417
423
  }
418
- o > d ? ee(t, r[$ + 1] == null ? null : r[$ + 1].$elm$, n, r, l, $) : l > $ && te(e, o, d);
419
- }, A = (t, e, n = !1) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : n ? !0 : t.$key$ === e.$key$ : !1, N = (t) => t && t["s-ol"] || t, se = (t) => (t["s-ol"] ? t["s-ol"] : t).parentNode, m = (t, e, n = !1) => {
420
- const r = e.$elm$ = t.$elm$, s = t.$children$, o = e.$children$, l = e.$tag$, c = e.$text$;
424
+ l > d ? ee(t, s[$ + 1] == null ? null : s[$ + 1].$elm$, n, s, o, $) : o > $ && te(e, l, d);
425
+ }, E = (t, e, n = !1) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : n ? !0 : t.$key$ === e.$key$ : !1, U = (t) => t && t["s-ol"] || t, se = (t) => (t["s-ol"] ? t["s-ol"] : t).parentNode, T = (t, e, n = !1) => {
426
+ const s = e.$elm$ = t.$elm$, r = t.$children$, l = e.$children$, o = e.$tag$, c = e.$text$;
421
427
  let i;
422
- c === null ? (h = l === "svg" ? !0 : l === "foreignObject" ? !1 : h, l === "slot" && !_ || V(t, e, h), s !== null && o !== null ? xe(r, s, e, o, n) : o !== null ? (t.$text$ !== null && (r.textContent = ""), ee(r, null, e, o, 0, o.length - 1)) : s !== null && te(s, 0, s.length - 1), h && l === "svg" && (h = !1)) : (i = r["s-cr"]) ? i.parentNode.textContent = c : t.$text$ !== c && (r.data = c);
428
+ c === null ? (h = o === "svg" ? !0 : o === "foreignObject" ? !1 : h, o === "slot" && !B || V(t, e, h), r !== null && l !== null ? xe(s, r, e, l, n) : l !== null ? (t.$text$ !== null && (s.textContent = ""), ee(s, null, e, l, 0, l.length - 1)) : r !== null && te(r, 0, r.length - 1), h && o === "svg" && (h = !1)) : (i = s["s-cr"]) ? i.parentNode.textContent = c : t.$text$ !== c && (s.data = c);
423
429
  }, ne = (t) => {
424
430
  const e = t.childNodes;
425
431
  for (const n of e)
426
432
  if (n.nodeType === 1) {
427
433
  if (n["s-sr"]) {
428
- const r = n["s-sn"];
434
+ const s = n["s-sn"];
429
435
  n.hidden = !1;
430
- for (const s of e)
431
- if (s !== n) {
432
- if (s["s-hn"] !== n["s-hn"] || r !== "") {
433
- if (s.nodeType === 1 && (r === s.getAttribute("slot") || r === s["s-sn"])) {
436
+ for (const r of e)
437
+ if (r !== n) {
438
+ if (r["s-hn"] !== n["s-hn"] || s !== "") {
439
+ if (r.nodeType === 1 && (s === r.getAttribute("slot") || s === r["s-sn"])) {
434
440
  n.hidden = !0;
435
441
  break;
436
442
  }
437
- } else if (s.nodeType === 1 || s.nodeType === 3 && s.textContent.trim() !== "") {
443
+ } else if (r.nodeType === 1 || r.nodeType === 3 && r.textContent.trim() !== "") {
438
444
  n.hidden = !0;
439
445
  break;
440
446
  }
@@ -443,39 +449,39 @@ const C = "http://www.w3.org/1999/xlink", H = {}, pe = "http://www.w3.org/2000/s
443
449
  ne(n);
444
450
  }
445
451
  }, b = [], re = (t) => {
446
- let e, n, r;
447
- for (const s of t.childNodes) {
448
- if (s["s-sr"] && (e = s["s-cr"]) && e.parentNode) {
452
+ let e, n, s;
453
+ for (const r of t.childNodes) {
454
+ if (r["s-sr"] && (e = r["s-cr"]) && e.parentNode) {
449
455
  n = e.parentNode.childNodes;
450
- const o = s["s-sn"];
451
- for (r = n.length - 1; r >= 0; r--)
452
- if (e = n[r], !e["s-cn"] && !e["s-nr"] && e["s-hn"] !== s["s-hn"] && !Q.experimentalSlotFixes)
453
- if (q(e, o)) {
454
- let l = b.find((c) => c.$nodeToRelocate$ === e);
455
- R = !0, e["s-sn"] = e["s-sn"] || o, l ? (l.$nodeToRelocate$["s-sh"] = s["s-hn"], l.$slotRefNode$ = s) : (e["s-sh"] = s["s-hn"], b.push({
456
- $slotRefNode$: s,
456
+ const l = r["s-sn"];
457
+ for (s = n.length - 1; s >= 0; s--)
458
+ if (e = n[s], !e["s-cn"] && !e["s-nr"] && e["s-hn"] !== r["s-hn"] && !_.experimentalSlotFixes)
459
+ if (w(e, l)) {
460
+ let o = b.find((c) => c.$nodeToRelocate$ === e);
461
+ R = !0, e["s-sn"] = e["s-sn"] || l, o ? (o.$nodeToRelocate$["s-sh"] = r["s-hn"], o.$slotRefNode$ = r) : (e["s-sh"] = r["s-hn"], b.push({
462
+ $slotRefNode$: r,
457
463
  $nodeToRelocate$: e
458
464
  })), e["s-sr"] && b.map((c) => {
459
- q(c.$nodeToRelocate$, e["s-sn"]) && (l = b.find((i) => i.$nodeToRelocate$ === e), l && !c.$slotRefNode$ && (c.$slotRefNode$ = l.$slotRefNode$));
465
+ w(c.$nodeToRelocate$, e["s-sn"]) && (o = b.find((i) => i.$nodeToRelocate$ === e), o && !c.$slotRefNode$ && (c.$slotRefNode$ = o.$slotRefNode$));
460
466
  });
461
467
  } else
462
- b.some((l) => l.$nodeToRelocate$ === e) || b.push({
468
+ b.some((o) => o.$nodeToRelocate$ === e) || b.push({
463
469
  $nodeToRelocate$: e
464
470
  });
465
471
  }
466
- s.nodeType === 1 && re(s);
472
+ r.nodeType === 1 && re(r);
467
473
  }
468
- }, q = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", le = (t) => {
474
+ }, w = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", le = (t) => {
469
475
  t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(le);
470
- }, Ee = (t, e, n = !1) => {
471
- var r, s, o, l, c;
476
+ }, Le = (t, e, n = !1) => {
477
+ var s, r, l, o, c;
472
478
  const i = t.$hostElement$, d = t.$cmpMeta$, u = t.$vnode$ || M(null, null), a = be(e) ? e : Y(null, null, e);
473
- if (x = i.tagName, d.$attrsToReflect$ && (a.$attrs$ = a.$attrs$ || {}, d.$attrsToReflect$.map(([$, f]) => a.$attrs$[f] = i[$])), n && a.$attrs$)
479
+ if (m = i.tagName, d.$attrsToReflect$ && (a.$attrs$ = a.$attrs$ || {}, d.$attrsToReflect$.map(([$, f]) => a.$attrs$[f] = i[$])), n && a.$attrs$)
474
480
  for (const $ of Object.keys(a.$attrs$))
475
481
  i.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (a.$attrs$[$] = i[$]);
476
- a.$tag$ = null, a.$flags$ |= 4, t.$vnode$ = a, a.$elm$ = u.$elm$ = i.shadowRoot || i, k = i["s-sc"], _ = (d.$flags$ & 1) !== 0, D = i["s-cr"], R = !1, m(u, a, n);
482
+ a.$tag$ = null, a.$flags$ |= 4, t.$vnode$ = a, a.$elm$ = u.$elm$ = i.shadowRoot || i, k = i["s-sc"], B = (d.$flags$ & 1) !== 0, D = i["s-cr"], R = !1, T(u, a, n);
477
483
  {
478
- if (T.$flags$ |= 1, B) {
484
+ if (x.$flags$ |= 1, N) {
479
485
  re(a.$elm$);
480
486
  for (const $ of b) {
481
487
  const f = $.$nodeToRelocate$;
@@ -490,64 +496,64 @@ const C = "http://www.w3.org/1999/xlink", H = {}, pe = "http://www.w3.org/2000/s
490
496
  const v = g.parentNode;
491
497
  let y = g.nextSibling;
492
498
  {
493
- let L = (r = f["s-ol"]) === null || r === void 0 ? void 0 : r.previousSibling;
494
- for (; L; ) {
495
- let S = (s = L["s-nr"]) !== null && s !== void 0 ? s : null;
499
+ let A = (s = f["s-ol"]) === null || s === void 0 ? void 0 : s.previousSibling;
500
+ for (; A; ) {
501
+ let S = (r = A["s-nr"]) !== null && r !== void 0 ? r : null;
496
502
  if (S && S["s-sn"] === f["s-sn"] && v === S.parentNode && (S = S.nextSibling, !S || !S["s-nr"])) {
497
503
  y = S;
498
504
  break;
499
505
  }
500
- L = L.previousSibling;
506
+ A = A.previousSibling;
501
507
  }
502
508
  }
503
- (!y && v !== f.parentNode || f.nextSibling !== y) && f !== y && (!f["s-hn"] && f["s-ol"] && (f["s-hn"] = f["s-ol"].parentNode.nodeName), v.insertBefore(f, y), f.nodeType === 1 && (f.hidden = (o = f["s-ih"]) !== null && o !== void 0 ? o : !1));
509
+ (!y && v !== f.parentNode || f.nextSibling !== y) && f !== y && (!f["s-hn"] && f["s-ol"] && (f["s-hn"] = f["s-ol"].parentNode.nodeName), v.insertBefore(f, y), f.nodeType === 1 && (f.hidden = (l = f["s-ih"]) !== null && l !== void 0 ? l : !1)), f && typeof g["s-rf"] == "function" && g["s-rf"](f);
504
510
  } else
505
- f.nodeType === 1 && (n && (f["s-ih"] = (l = f.hidden) !== null && l !== void 0 ? l : !1), f.hidden = !0);
511
+ f.nodeType === 1 && (n && (f["s-ih"] = (o = f.hidden) !== null && o !== void 0 ? o : !1), f.hidden = !0);
506
512
  }
507
513
  }
508
- R && ne(a.$elm$), T.$flags$ &= -2, b.length = 0;
514
+ R && ne(a.$elm$), x.$flags$ &= -2, b.length = 0;
509
515
  }
510
- if (Q.experimentalScopedSlotChanges && d.$flags$ & 2)
516
+ if (_.experimentalScopedSlotChanges && d.$flags$ & 2)
511
517
  for (const $ of a.$elm$.childNodes)
512
- $["s-hn"] !== x && !$["s-sh"] && (n && $["s-ih"] == null && ($["s-ih"] = (c = $.hidden) !== null && c !== void 0 ? c : !1), $.hidden = !0);
518
+ $["s-hn"] !== m && !$["s-sh"] && (n && $["s-ih"] == null && ($["s-ih"] = (c = $.hidden) !== null && c !== void 0 ? c : !1), $.hidden = !0);
513
519
  D = void 0;
514
- }, w = (t, e) => e in t, U = typeof window < "u" ? window : {}, j = U.document || { head: {} };
515
- U.HTMLElement;
516
- const T = {
520
+ }, G = (t, e) => e in t, C = typeof window < "u" ? window : {}, j = C.document || { head: {} };
521
+ C.HTMLElement;
522
+ const x = {
517
523
  $flags$: 0,
518
524
  $resourcesUrl$: "",
519
525
  jmp: (t) => t(),
520
526
  raf: (t) => requestAnimationFrame(t),
521
- ael: (t, e, n, r) => t.addEventListener(e, n, r),
522
- rel: (t, e, n, r) => t.removeEventListener(e, n, r),
527
+ ael: (t, e, n, s) => t.addEventListener(e, n, s),
528
+ rel: (t, e, n, s) => t.removeEventListener(e, n, s),
523
529
  ce: (t, e) => new CustomEvent(t, e)
524
- }, Le = (t, e, n) => {
530
+ }, Ae = (t, e, n) => {
525
531
  [null, void 0, "", !1].includes(n) || ["innerHTML", "style"].includes(e) || t.setAttribute(e, ["object", "function"].includes(typeof n) ? "/!\\ Object props are not rendered in the code example" : n);
526
- }, oe = (t, e, n, r, s) => {
532
+ }, oe = (t, e, n, s, r) => {
527
533
  if (e && typeof e == "string") {
528
- const o = document.createElement(e);
529
- Object.keys(n || {}).forEach((l) => {
530
- Le(o, l, n[l]);
531
- }), r == null || r.forEach((l) => {
532
- oe(o, l.$tag$, l.$attrs$, l.$children$, l.$text$);
533
- }), n != null && n.innerHTML && (o.innerHTML = n.innerHTML), t.appendChild(o);
534
+ const l = document.createElement(e);
535
+ Object.keys(n || {}).forEach((o) => {
536
+ Ae(l, o, n[o]);
537
+ }), s == null || s.forEach((o) => {
538
+ oe(l, o.$tag$, o.$attrs$, o.$children$, o.$text$);
539
+ }), n != null && n.innerHTML && (l.innerHTML = n.innerHTML), t.appendChild(l);
534
540
  }
535
- s && (t.innerHTML = s);
541
+ r && (t.innerHTML = r);
536
542
  }, Ge = (t, e) => {
537
543
  const n = {};
538
544
  if (typeof t != "object")
539
545
  throw new Error("filterArgs - args isn't an object.");
540
- for (const r in t)
541
- if (!r.startsWith("slot")) {
542
- const s = t[r], o = r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
543
- (!e || !Object.keys(e).includes(r) || e[r] !== s) && (n[o] = s);
546
+ for (const s in t)
547
+ if (!s.startsWith("slot")) {
548
+ const r = t[s], l = s.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
549
+ (!e || !Object.keys(e).includes(s) || e[s] !== r) && (n[l] = r);
544
550
  }
545
551
  return n;
546
552
  }, Ie = (t, e) => {
547
- var r, s;
553
+ var s, r;
548
554
  const n = document.getElementById("storybook-root");
549
555
  if (n)
550
- return (s = document.querySelector("[lang]")) == null || s.setAttribute("lang", ((r = e.globals) == null ? void 0 : r.locale) || "en"), Ee(
556
+ return (r = document.querySelector("[lang]")) == null || r.setAttribute("lang", ((s = e.globals) == null ? void 0 : s.locale) || "en"), Le(
551
557
  {
552
558
  $ancestorComponent$: void 0,
553
559
  $flags$: 0,
@@ -560,12 +566,12 @@ const T = {
560
566
  },
561
567
  t(e)
562
568
  ), n.children[n.children.length - 1];
563
- }, Xe = ({ $tag$: t, $attrs$: e, $children$: n, $text$: r }) => {
564
- const s = document.createElement("div");
565
- return oe(s, t, e, n, r), s.innerHTML;
569
+ }, Xe = ({ $tag$: t, $attrs$: e, $children$: n, $text$: s }) => {
570
+ const r = document.createElement("div");
571
+ return oe(r, t, e, n, s), r.innerHTML;
566
572
  }, Ke = ({ disconnect: t, observe: e, takeRecords: n }) => {
567
- class r {
568
- constructor(o) {
573
+ class s {
574
+ constructor(l) {
569
575
  /**
570
576
  *
571
577
  */
@@ -582,19 +588,19 @@ const T = {
582
588
  *
583
589
  */
584
590
  p(this, "cb");
585
- this.cb = o;
591
+ this.cb = l;
586
592
  }
587
593
  }
588
- return [window, global].forEach((s) => {
589
- Object.defineProperty(s, "MutationObserver", {
594
+ return [window, global].forEach((r) => {
595
+ Object.defineProperty(r, "MutationObserver", {
590
596
  writable: !0,
591
597
  configurable: !0,
592
- value: r
598
+ value: s
593
599
  });
594
- }), r;
600
+ }), s;
595
601
  }, Qe = ({ disconnect: t, observe: e }) => {
596
602
  class n {
597
- constructor(s) {
603
+ constructor(r) {
598
604
  /**
599
605
  *
600
606
  */
@@ -611,18 +617,18 @@ const T = {
611
617
  *
612
618
  */
613
619
  p(this, "cb");
614
- this.cb = s;
620
+ this.cb = r;
615
621
  }
616
622
  }
617
- return [window, global].forEach((r) => {
618
- Object.defineProperty(r, "ResizeObserver", {
623
+ return [window, global].forEach((s) => {
624
+ Object.defineProperty(s, "ResizeObserver", {
619
625
  writable: !0,
620
626
  configurable: !0,
621
627
  value: n
622
628
  });
623
629
  }), n;
624
630
  };
625
- class Ae extends Event {
631
+ class Ee extends Event {
626
632
  constructor() {
627
633
  super(...arguments);
628
634
  /**
@@ -633,7 +639,7 @@ class Ae extends Event {
633
639
  }
634
640
  }
635
641
  const Je = () => {
636
- class t extends Ae {
642
+ class t extends Ee {
637
643
  }
638
644
  return [window, global].forEach((e) => {
639
645
  Object.defineProperty(e, "SubmitEvent", {
@@ -654,7 +660,7 @@ export {
654
660
  Ge as filterArgs,
655
661
  De as focusableElements,
656
662
  Pe as getLocaleDatePattern,
657
- G as getParentWindows,
663
+ I as getParentWindows,
658
664
  Xe as getStoryHTML,
659
665
  _e as getWindows,
660
666
  Fe as isTagName,