@mgdis/stencil-helpers 1.0.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.
@@ -0,0 +1,565 @@
1
+ var le = Object.defineProperty;
2
+ var oe = (t, e, n) => e in t ? le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var g = (t, e, n) => (oe(t, typeof e != "symbol" ? e + "" : e, n), n);
4
+ const I = {
5
+ allRenderFn: !1,
6
+ cmpDidLoad: !0,
7
+ cmpDidUnload: !1,
8
+ cmpDidUpdate: !0,
9
+ cmpDidRender: !0,
10
+ cmpWillLoad: !0,
11
+ cmpWillUpdate: !0,
12
+ cmpWillRender: !0,
13
+ connectedCallback: !0,
14
+ disconnectedCallback: !0,
15
+ element: !0,
16
+ event: !0,
17
+ hasRenderFn: !0,
18
+ lifecycle: !0,
19
+ hostListener: !0,
20
+ hostListenerTargetWindow: !0,
21
+ hostListenerTargetDocument: !0,
22
+ hostListenerTargetBody: !0,
23
+ hostListenerTargetParent: !1,
24
+ hostListenerTarget: !0,
25
+ member: !0,
26
+ method: !0,
27
+ mode: !0,
28
+ observeAttribute: !0,
29
+ prop: !0,
30
+ propMutable: !0,
31
+ reflect: !0,
32
+ scoped: !0,
33
+ shadowDom: !0,
34
+ slot: !0,
35
+ cssAnnotations: !0,
36
+ state: !0,
37
+ style: !0,
38
+ formAssociated: !1,
39
+ svg: !0,
40
+ updatable: !0,
41
+ vdomAttribute: !0,
42
+ vdomXlink: !0,
43
+ vdomClass: !0,
44
+ vdomFunctional: !0,
45
+ vdomKey: !0,
46
+ vdomListener: !0,
47
+ vdomRef: !0,
48
+ vdomPropOrAttr: !0,
49
+ vdomRender: !0,
50
+ vdomStyle: !0,
51
+ vdomText: !0,
52
+ watchCallback: !0,
53
+ taskQueue: !0,
54
+ hotModuleReplacement: !1,
55
+ isDebug: !1,
56
+ isDev: !1,
57
+ isTesting: !1,
58
+ hydrateServerSide: !1,
59
+ hydrateClientSide: !1,
60
+ lifecycleDOMEvents: !1,
61
+ lazyLoad: !1,
62
+ profile: !1,
63
+ slotRelocation: !0,
64
+ // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
65
+ appendChildSlotFix: !1,
66
+ // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
67
+ cloneNodeFix: !1,
68
+ hydratedAttribute: !1,
69
+ hydratedClass: !0,
70
+ scriptDataOpts: !1,
71
+ // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
72
+ scopedSlotTextContentFix: !1,
73
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
74
+ shadowDomShim: !1,
75
+ // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
76
+ slotChildNodesFix: !1,
77
+ invisiblePrehydration: !0,
78
+ propBoolean: !0,
79
+ propNumber: !0,
80
+ propString: !0,
81
+ constructableCSS: !0,
82
+ cmpShouldUpdate: !0,
83
+ devTools: !1,
84
+ shadowDelegatesFocus: !0,
85
+ initializeNextTick: !1,
86
+ asyncLoading: !1,
87
+ asyncQueue: !1,
88
+ transformTagName: !1,
89
+ attachStyles: !0,
90
+ // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
91
+ experimentalSlotFixes: !1
92
+ };
93
+ let T, F, m, X = !1, M = !1, D = !1, h = !1;
94
+ const N = "http://www.w3.org/1999/xlink", H = {}, re = "http://www.w3.org/2000/svg", ie = "http://www.w3.org/1999/xhtml", ce = (t) => t != null, q = (t) => (t = typeof t, t === "object" || t === "function"), G = (t, e, ...n) => {
95
+ let s = null, l = null, r = null, o = !1, c = !1;
96
+ const i = [], d = (f) => {
97
+ for (let $ = 0; $ < f.length; $++)
98
+ s = f[$], Array.isArray(s) ? d(s) : s != null && typeof s != "boolean" && ((o = typeof t != "function" && !q(s)) && (s = String(s)), o && c ? i[i.length - 1].$text$ += s : i.push(o ? O(null, s) : s), c = o);
99
+ };
100
+ if (d(n), e) {
101
+ e.key && (l = e.key), e.name && (r = e.name);
102
+ {
103
+ const f = e.className || e.class;
104
+ f && (e.class = typeof f != "object" ? f : Object.keys(f).filter(($) => f[$]).join(" "));
105
+ }
106
+ }
107
+ if (typeof t == "function")
108
+ return t(e === null ? {} : e, i, $e);
109
+ const u = O(t, null);
110
+ return u.$attrs$ = e, i.length > 0 && (u.$children$ = i), u.$key$ = l, u.$name$ = r, u;
111
+ }, O = (t, e) => {
112
+ const n = {
113
+ $flags$: 0,
114
+ $tag$: t,
115
+ $text$: e,
116
+ $elm$: null,
117
+ $children$: null
118
+ };
119
+ return n.$attrs$ = null, n.$key$ = null, n.$name$ = null, n;
120
+ }, fe = {}, ae = (t) => t && t.$tag$ === fe, $e = {
121
+ forEach: (t, e) => t.map(C).forEach(e),
122
+ map: (t, e) => t.map(C).map(e).map(ue)
123
+ }, C = (t) => ({
124
+ vattrs: t.$attrs$,
125
+ vchildren: t.$children$,
126
+ vkey: t.$key$,
127
+ vname: t.$name$,
128
+ vtag: t.$tag$,
129
+ vtext: t.$text$
130
+ }), ue = (t) => {
131
+ if (typeof t.vtag == "function") {
132
+ const n = Object.assign({}, t.vattrs);
133
+ return t.vkey && (n.key = t.vkey), t.vname && (n.name = t.vname), G(t.vtag, n, ...t.vchildren || []);
134
+ }
135
+ const e = O(t.vtag, t.vtext);
136
+ return e.$attrs$ = t.vattrs, e.$children$ = t.vchildren, e.$key$ = t.vkey, e.$name$ = t.vname, e;
137
+ }, P = (t, e, n, s, l, r) => {
138
+ if (n !== s) {
139
+ let o = z(t, e), c = e.toLowerCase();
140
+ if (e === "class") {
141
+ const i = t.classList, d = U(n), u = U(s);
142
+ i.remove(...d.filter((f) => f && !u.includes(f))), i.add(...u.filter((f) => f && !d.includes(f)));
143
+ } else if (e === "style") {
144
+ for (const i in n)
145
+ (!s || s[i] == null) && (i.includes("-") ? t.style.removeProperty(i) : t.style[i] = "");
146
+ for (const i in s)
147
+ (!n || s[i] !== n[i]) && (i.includes("-") ? t.style.setProperty(i, s[i]) : t.style[i] = s[i]);
148
+ } else if (e !== "key")
149
+ if (e === "ref")
150
+ s && s(t);
151
+ else if (!t.__lookupSetter__(e) && e[0] === "o" && e[1] === "n") {
152
+ if (e[2] === "-" ? e = e.slice(3) : z(B, c) ? e = c.slice(2) : e = c[2] + e.slice(3), n || s) {
153
+ const i = e.endsWith(K);
154
+ e = e.replace(pe, ""), n && x.rel(t, e, n, i), s && x.ael(t, e, s, i);
155
+ }
156
+ } else {
157
+ const i = q(s);
158
+ if ((o || i && s !== null) && !l)
159
+ try {
160
+ if (t.tagName.includes("-"))
161
+ t[e] = s;
162
+ else {
163
+ const u = s ?? "";
164
+ e === "list" ? o = !1 : (n == null || t[e] != u) && (t[e] = u);
165
+ }
166
+ } catch {
167
+ }
168
+ let d = !1;
169
+ c !== (c = c.replace(/^xlink\:?/, "")) && (e = c, d = !0), s == null || s === !1 ? (s !== !1 || t.getAttribute(e) === "") && (d ? t.removeAttributeNS(N, e) : t.removeAttribute(e)) : (!o || r & 4 || l) && !i && (s = s === !0 ? "" : s, d ? t.setAttributeNS(N, e, s) : t.setAttribute(e, s));
170
+ }
171
+ }
172
+ }, de = /\s/, U = (t) => t ? t.split(de) : [], K = "Capture", pe = new RegExp(K + "$"), Q = (t, e, n, s) => {
173
+ const l = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, r = t && t.$attrs$ || H, o = e.$attrs$ || H;
174
+ for (s in r)
175
+ s in o || P(l, s, r[s], void 0, n, e.$flags$);
176
+ for (s in o)
177
+ P(l, s, r[s], o[s], n, e.$flags$);
178
+ }, j = (t, e, n, s) => {
179
+ const l = e.$children$[n];
180
+ let r = 0, o, c, i;
181
+ if (X || (D = !0, l.$tag$ === "slot" && (T && s.classList.add(T + "-s"), l.$flags$ |= l.$children$ ? (
182
+ // slot element has fallback content
183
+ 2
184
+ ) : (
185
+ // slot element does not have fallback content
186
+ 1
187
+ ))), l.$text$ !== null)
188
+ o = l.$elm$ = R.createTextNode(l.$text$);
189
+ else if (l.$flags$ & 1)
190
+ o = l.$elm$ = R.createTextNode("");
191
+ else {
192
+ if (h || (h = l.$tag$ === "svg"), o = l.$elm$ = R.createElementNS(h ? re : ie, l.$flags$ & 2 ? "slot-fb" : l.$tag$), h && l.$tag$ === "foreignObject" && (h = !1), Q(null, l, h), ce(T) && o["s-si"] !== T && o.classList.add(o["s-si"] = T), l.$children$)
193
+ for (r = 0; r < l.$children$.length; ++r)
194
+ c = j(t, l, r, o), c && o.appendChild(c);
195
+ l.$tag$ === "svg" ? h = !1 : o.tagName === "foreignObject" && (h = !0);
196
+ }
197
+ return o["s-hn"] = m, l.$flags$ & 3 && (o["s-sr"] = !0, o["s-cr"] = F, o["s-sn"] = l.$name$ || "", i = t && t.$children$ && t.$children$[n], i && i.$tag$ === l.$tag$ && t.$elm$ && L(t.$elm$, !1)), o;
198
+ }, L = (t, e) => {
199
+ x.$flags$ |= 1;
200
+ const n = t.childNodes;
201
+ for (let s = n.length - 1; s >= 0; s--) {
202
+ const l = n[s];
203
+ l["s-hn"] !== m && l["s-ol"] && (Z(l).insertBefore(l, _(l)), l["s-ol"].remove(), l["s-ol"] = void 0, l["s-sh"] = void 0, D = !0), e && L(l, e);
204
+ }
205
+ x.$flags$ &= -2;
206
+ }, J = (t, e, n, s, l, r) => {
207
+ let o = t["s-cr"] && t["s-cr"].parentNode || t, c;
208
+ for (o.shadowRoot && o.tagName === m && (o = o.shadowRoot); l <= r; ++l)
209
+ s[l] && (c = j(null, n, l, t), c && (s[l].$elm$ = c, o.insertBefore(c, _(e))));
210
+ }, Y = (t, e, n) => {
211
+ for (let s = e; s <= n; ++s) {
212
+ const l = t[s];
213
+ if (l) {
214
+ const r = l.$elm$;
215
+ ee(l), r && (M = !0, r["s-ol"] ? r["s-ol"].remove() : L(r, !0), r.remove());
216
+ }
217
+ }
218
+ }, ge = (t, e, n, s, l = !1) => {
219
+ let r = 0, o = 0, c = 0, i = 0, d = e.length - 1, u = e[0], f = e[d], $ = s.length - 1, a = s[0], p = s[$], v, y;
220
+ for (; r <= d && o <= $; )
221
+ if (u == null)
222
+ u = e[++r];
223
+ else if (f == null)
224
+ f = e[--d];
225
+ else if (a == null)
226
+ a = s[++o];
227
+ else if (p == null)
228
+ p = s[--$];
229
+ else if (A(u, a, l))
230
+ k(u, a, l), u = e[++r], a = s[++o];
231
+ else if (A(f, p, l))
232
+ k(f, p, l), f = e[--d], p = s[--$];
233
+ else if (A(u, p, l))
234
+ (u.$tag$ === "slot" || p.$tag$ === "slot") && L(u.$elm$.parentNode, !1), k(u, p, l), t.insertBefore(u.$elm$, f.$elm$.nextSibling), u = e[++r], p = s[--$];
235
+ else if (A(f, a, l))
236
+ (u.$tag$ === "slot" || p.$tag$ === "slot") && L(f.$elm$.parentNode, !1), k(f, a, l), t.insertBefore(f.$elm$, u.$elm$), f = e[--d], a = s[++o];
237
+ else {
238
+ for (c = -1, i = r; i <= d; ++i)
239
+ if (e[i] && e[i].$key$ !== null && e[i].$key$ === a.$key$) {
240
+ c = i;
241
+ break;
242
+ }
243
+ c >= 0 ? (y = e[c], y.$tag$ !== a.$tag$ ? v = j(e && e[o], n, c, t) : (k(y, a, l), e[c] = void 0, v = y.$elm$), a = s[++o]) : (v = j(e && e[o], n, o, t), a = s[++o]), v && Z(u.$elm$).insertBefore(v, _(u.$elm$));
244
+ }
245
+ r > d ? J(t, s[$ + 1] == null ? null : s[$ + 1].$elm$, n, s, o, $) : o > $ && Y(e, r, d);
246
+ }, A = (t, e, n = !1) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : n ? !0 : t.$key$ === e.$key$ : !1, _ = (t) => t && t["s-ol"] || t, Z = (t) => (t["s-ol"] ? t["s-ol"] : t).parentNode, k = (t, e, n = !1) => {
247
+ const s = e.$elm$ = t.$elm$, l = t.$children$, r = e.$children$, o = e.$tag$, c = e.$text$;
248
+ let i;
249
+ c === null ? (h = o === "svg" ? !0 : o === "foreignObject" ? !1 : h, o === "slot" || Q(t, e, h), l !== null && r !== null ? ge(s, l, e, r, n) : r !== null ? (t.$text$ !== null && (s.textContent = ""), J(s, null, e, r, 0, r.length - 1)) : l !== null && Y(l, 0, l.length - 1), h && o === "svg" && (h = !1)) : (i = s["s-cr"]) ? i.parentNode.textContent = c : t.$text$ !== c && (s.data = c);
250
+ }, w = (t) => {
251
+ const e = t.childNodes;
252
+ for (const n of e)
253
+ if (n.nodeType === 1) {
254
+ if (n["s-sr"]) {
255
+ const s = n["s-sn"];
256
+ n.hidden = !1;
257
+ for (const l of e)
258
+ if (l !== n) {
259
+ if (l["s-hn"] !== n["s-hn"] || s !== "") {
260
+ if (l.nodeType === 1 && (s === l.getAttribute("slot") || s === l["s-sn"])) {
261
+ n.hidden = !0;
262
+ break;
263
+ }
264
+ } else if (l.nodeType === 1 || l.nodeType === 3 && l.textContent.trim() !== "") {
265
+ n.hidden = !0;
266
+ break;
267
+ }
268
+ }
269
+ }
270
+ w(n);
271
+ }
272
+ }, S = [], V = (t) => {
273
+ let e, n, s;
274
+ for (const l of t.childNodes) {
275
+ if (l["s-sr"] && (e = l["s-cr"]) && e.parentNode) {
276
+ n = e.parentNode.childNodes;
277
+ const r = l["s-sn"];
278
+ for (s = n.length - 1; s >= 0; s--)
279
+ if (e = n[s], !e["s-cn"] && !e["s-nr"] && e["s-hn"] !== l["s-hn"] && !I.experimentalSlotFixes)
280
+ if (W(e, r)) {
281
+ let o = S.find((c) => c.$nodeToRelocate$ === e);
282
+ M = !0, e["s-sn"] = e["s-sn"] || r, o ? (o.$nodeToRelocate$["s-sh"] = l["s-hn"], o.$slotRefNode$ = l) : (e["s-sh"] = l["s-hn"], S.push({
283
+ $slotRefNode$: l,
284
+ $nodeToRelocate$: e
285
+ })), e["s-sr"] && S.map((c) => {
286
+ W(c.$nodeToRelocate$, e["s-sn"]) && (o = S.find((i) => i.$nodeToRelocate$ === e), o && !c.$slotRefNode$ && (c.$slotRefNode$ = o.$slotRefNode$));
287
+ });
288
+ } else
289
+ S.some((o) => o.$nodeToRelocate$ === e) || S.push({
290
+ $nodeToRelocate$: e
291
+ });
292
+ }
293
+ l.nodeType === 1 && V(l);
294
+ }
295
+ }, W = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", ee = (t) => {
296
+ t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(ee);
297
+ }, he = (t, e, n = !1) => {
298
+ var s, l, r, o, c;
299
+ const i = t.$hostElement$, d = t.$cmpMeta$, u = t.$vnode$ || O(null, null), f = ae(e) ? e : G(null, null, e);
300
+ if (m = i.tagName, d.$attrsToReflect$ && (f.$attrs$ = f.$attrs$ || {}, d.$attrsToReflect$.map(([$, a]) => f.$attrs$[a] = i[$])), n && f.$attrs$)
301
+ for (const $ of Object.keys(f.$attrs$))
302
+ i.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (f.$attrs$[$] = i[$]);
303
+ f.$tag$ = null, f.$flags$ |= 4, t.$vnode$ = f, f.$elm$ = u.$elm$ = i.shadowRoot || i, T = i["s-sc"], F = i["s-cr"], X = (d.$flags$ & 1) !== 0, M = !1, k(u, f, n);
304
+ {
305
+ if (x.$flags$ |= 1, D) {
306
+ V(f.$elm$);
307
+ for (const $ of S) {
308
+ const a = $.$nodeToRelocate$;
309
+ if (!a["s-ol"]) {
310
+ const p = R.createTextNode("");
311
+ p["s-nr"] = a, a.parentNode.insertBefore(a["s-ol"] = p, a);
312
+ }
313
+ }
314
+ for (const $ of S) {
315
+ const a = $.$nodeToRelocate$, p = $.$slotRefNode$;
316
+ if (p) {
317
+ const v = p.parentNode;
318
+ let y = p.nextSibling;
319
+ {
320
+ let E = (s = a["s-ol"]) === null || s === void 0 ? void 0 : s.previousSibling;
321
+ for (; E; ) {
322
+ let b = (l = E["s-nr"]) !== null && l !== void 0 ? l : null;
323
+ if (b && b["s-sn"] === a["s-sn"] && v === b.parentNode && (b = b.nextSibling, !b || !b["s-nr"])) {
324
+ y = b;
325
+ break;
326
+ }
327
+ E = E.previousSibling;
328
+ }
329
+ }
330
+ (!y && v !== a.parentNode || a.nextSibling !== y) && a !== y && (!a["s-hn"] && a["s-ol"] && (a["s-hn"] = a["s-ol"].parentNode.nodeName), v.insertBefore(a, y), a.nodeType === 1 && (a.hidden = (r = a["s-ih"]) !== null && r !== void 0 ? r : !1));
331
+ } else
332
+ a.nodeType === 1 && (n && (a["s-ih"] = (o = a.hidden) !== null && o !== void 0 ? o : !1), a.hidden = !0);
333
+ }
334
+ }
335
+ M && w(f.$elm$), x.$flags$ &= -2, S.length = 0;
336
+ }
337
+ if (I.experimentalScopedSlotChanges && d.$flags$ & 2)
338
+ for (const $ of f.$elm$.childNodes)
339
+ $["s-hn"] !== m && !$["s-sh"] && (n && $["s-ih"] == null && ($["s-ih"] = (c = $.hidden) !== null && c !== void 0 ? c : !1), $.hidden = !0);
340
+ F = void 0;
341
+ }, z = (t, e) => e in t, B = typeof window < "u" ? window : {}, R = B.document || { head: {} };
342
+ B.HTMLElement;
343
+ const x = {
344
+ $flags$: 0,
345
+ $resourcesUrl$: "",
346
+ jmp: (t) => t(),
347
+ raf: (t) => requestAnimationFrame(t),
348
+ ael: (t, e, n, s) => t.addEventListener(e, n, s),
349
+ rel: (t, e, n, s) => t.removeEventListener(e, n, s),
350
+ ce: (t, e) => new CustomEvent(t, e)
351
+ }, ye = (t, e, n) => {
352
+ [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);
353
+ }, te = (t, e, n, s, l) => {
354
+ if (e && typeof e == "string") {
355
+ const r = document.createElement(e);
356
+ Object.keys(n || {}).forEach((o) => {
357
+ ye(r, o, n[o]);
358
+ }), s == null || s.forEach((o) => {
359
+ te(r, o.$tag$, o.$attrs$, o.$children$, o.$text$);
360
+ }), n != null && n.innerHTML && (r.innerHTML = n.innerHTML), t.appendChild(r);
361
+ }
362
+ l && (t.innerHTML = l);
363
+ }, xe = (t, e) => {
364
+ const n = {};
365
+ if (typeof t != "object")
366
+ throw new Error("filterArgs - args isn't an object.");
367
+ for (const s in t)
368
+ if (!s.startsWith("slot")) {
369
+ const l = t[s], r = s.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
370
+ (!e || !Object.keys(e).includes(s) || e[s] !== l) && (n[r] = l);
371
+ }
372
+ return n;
373
+ }, me = (t, e) => {
374
+ var s, l;
375
+ const n = document.getElementById("storybook-root");
376
+ if (n)
377
+ return (l = document.querySelector("[lang]")) == null || l.setAttribute("lang", ((s = e.globals) == null ? void 0 : s.locale) || "en"), he(
378
+ {
379
+ $ancestorComponent$: void 0,
380
+ $flags$: 0,
381
+ $modeName$: void 0,
382
+ $cmpMeta$: {
383
+ $flags$: 0,
384
+ $tagName$: n.tagName
385
+ },
386
+ $hostElement$: n
387
+ },
388
+ t(e)
389
+ ), n.children[n.children.length - 1];
390
+ }, Le = ({ $tag$: t, $attrs$: e, $children$: n, $text$: s }) => {
391
+ const l = document.createElement("div");
392
+ return te(l, t, e, n, s), l.innerHTML;
393
+ }, Ee = (t) => {
394
+ const e = { value: "2023", pattern: "yyyy" }, n = { value: "12", pattern: "mm" }, s = { value: "24", pattern: "dd" };
395
+ return be([e.value, n.value, s.value].join("-"), t).replace(e.value, e.pattern).replace(n.value, n.pattern).replace(s.value, s.pattern);
396
+ }, Ae = (t) => t.toISOString().split("T")[0], ve = (t, e, n) => {
397
+ const s = t.closest("[lang]"), l = Intl.NumberFormat.supportedLocalesOf(s == null ? void 0 : s.lang), r = l.length > 0 && typeof l[0] == "string" ? l[0] : navigator.language || n, o = r.split("-").shift();
398
+ return {
399
+ locale: r,
400
+ messages: e[o] || e[n]
401
+ };
402
+ }, Re = (t, e, n) => new Intl.NumberFormat(e, { style: "currency", currency: n }).format(t), Me = (t, e) => new Intl.NumberFormat(e).format(t), Se = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, be = (t, e) => typeof t != "string" || t === "" || !Se.test(t) ? "" : new Intl.DateTimeFormat(e).format(new Date(t)), Oe = (t, e) => (n) => ve(n, t, e), je = (t = "", e = 10) => {
403
+ const n = new Uint8Array(e);
404
+ crypto.getRandomValues(n);
405
+ const s = Array.from(n).map((l) => l.toString(16).padStart(2, "0")).join("").slice(0, e);
406
+ return t !== "" ? `${t}-${s}` : s;
407
+ };
408
+ class Fe {
409
+ constructor(e = []) {
410
+ /**
411
+ * Available classes
412
+ */
413
+ g(this, "classes");
414
+ /**
415
+ * Add class
416
+ * @param className - class name to add
417
+ */
418
+ g(this, "add", (e) => {
419
+ this.has(e) || this.classes.push(e);
420
+ });
421
+ /**
422
+ * Delete class
423
+ * @param className - class name to delete
424
+ */
425
+ g(this, "delete", (e) => {
426
+ const n = this.classes.indexOf(e);
427
+ n > -1 && this.classes.splice(n, 1);
428
+ });
429
+ /**
430
+ * Check if class exist in list
431
+ * @param className - class name to check
432
+ * @returns class name is in the list
433
+ */
434
+ g(this, "has", (e) => this.classes.includes(e));
435
+ /**
436
+ * Join classes seperated by spaces
437
+ * @returns joined values
438
+ */
439
+ g(this, "join", () => this.classes.join(" "));
440
+ this.classes = e;
441
+ }
442
+ }
443
+ const De = (t) => Array.isArray(t) && t.every((e) => typeof e == "string"), _e = (t, e) => e.includes(t == null ? void 0 : t.tagName.toLowerCase()), Be = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Ne = (t) => {
444
+ const e = se(t), n = ne(t);
445
+ return [t, ...e, ...n];
446
+ }, se = (t, e = []) => {
447
+ if (t.self !== t.top)
448
+ try {
449
+ const n = t.parent;
450
+ return n ? (e.push(n), se(n, e)) : e;
451
+ } catch (n) {
452
+ return console.error("Different hosts between iframes:", n), e;
453
+ }
454
+ return e;
455
+ }, ne = (t, e = []) => {
456
+ if (t.frames.length > 0)
457
+ for (const n of Array.from(t.frames))
458
+ e.push(n), ne(n, e);
459
+ return e;
460
+ }, He = (t) => typeof t == "string" && t.trim() !== "", Ce = (t) => typeof t == "string" ? t.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : t, Pe = async (t) => t(), Ue = ({ disconnect: t, observe: e, takeRecords: n }) => {
461
+ class s {
462
+ constructor(r) {
463
+ /**
464
+ *
465
+ */
466
+ g(this, "disconnect", t);
467
+ /**
468
+ *
469
+ */
470
+ g(this, "observe", e);
471
+ /**
472
+ *
473
+ */
474
+ g(this, "takeRecords", n);
475
+ /**
476
+ *
477
+ */
478
+ g(this, "cb");
479
+ this.cb = r;
480
+ }
481
+ }
482
+ return [window, global].forEach((l) => {
483
+ Object.defineProperty(l, "MutationObserver", {
484
+ writable: !0,
485
+ configurable: !0,
486
+ value: s
487
+ });
488
+ }), s;
489
+ }, We = ({ disconnect: t, observe: e }) => {
490
+ class n {
491
+ constructor(l) {
492
+ /**
493
+ *
494
+ */
495
+ g(this, "disconnect", t);
496
+ /**
497
+ *
498
+ */
499
+ g(this, "observe", e);
500
+ /**
501
+ *
502
+ */
503
+ g(this, "unobserve");
504
+ /**
505
+ *
506
+ */
507
+ g(this, "cb");
508
+ this.cb = l;
509
+ }
510
+ }
511
+ return [window, global].forEach((s) => {
512
+ Object.defineProperty(s, "ResizeObserver", {
513
+ writable: !0,
514
+ configurable: !0,
515
+ value: n
516
+ });
517
+ }), n;
518
+ };
519
+ class Te extends Event {
520
+ constructor() {
521
+ super(...arguments);
522
+ /**
523
+ *
524
+ */
525
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
526
+ g(this, "detail");
527
+ }
528
+ }
529
+ const ze = () => {
530
+ class t extends Te {
531
+ }
532
+ return [window, global].forEach((e) => {
533
+ Object.defineProperty(e, "SubmitEvent", {
534
+ writable: !0,
535
+ configurable: !0,
536
+ value: t
537
+ });
538
+ }), t;
539
+ };
540
+ export {
541
+ Fe as ClassList,
542
+ De as allItemsAreString,
543
+ Ce as cleanString,
544
+ je as createID,
545
+ Se as dateRegExp,
546
+ Ae as dateToString,
547
+ Oe as defineLocales,
548
+ xe as filterArgs,
549
+ Be as focusableElements,
550
+ Ee as getLocaleDatePattern,
551
+ se as getParentWindows,
552
+ Le as getStoryHTML,
553
+ Ne as getWindows,
554
+ _e as isTagName,
555
+ He as isValidString,
556
+ Re as localeCurrency,
557
+ be as localeDate,
558
+ Me as localeNumber,
559
+ Pe as nextTick,
560
+ Ue as setupMutationObserverMock,
561
+ We as setupResizeObserverMock,
562
+ ze as setupSubmitEventMock,
563
+ me as stencilWrapper
564
+ };
565
+ //# sourceMappingURL=index.es.js.map