@mgdis/stencil-helpers 3.2.11 → 3.2.13

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,3311 +1,978 @@
1
- class Ii {
2
- /**
3
- * Available classes
4
- */
5
- classes;
6
- constructor(e = []) {
7
- this.classes = e;
8
- }
9
- /**
10
- * Add class
11
- * @param className - class name to add
12
- */
13
- add = (e) => {
14
- this.has(e) || this.classes.push(e);
15
- };
16
- /**
17
- * Delete class
18
- * @param className - class name to delete
19
- */
20
- delete = (e) => {
21
- const s = this.classes.indexOf(e);
22
- s > -1 && this.classes.splice(s, 1);
23
- };
24
- /**
25
- * Check if class exist in list
26
- * @param className - class name to check
27
- * @returns class name is in the list
28
- */
29
- has = (e) => this.classes.includes(e);
30
- /**
31
- * Join classes seperated by spaces
32
- * @returns joined values
33
- */
34
- join = () => this.classes.join(" ");
35
- }
36
- const at = (t) => typeof t == "object" && !Array.isArray(t) && t !== null, Hs = (t, e, s) => {
37
- if (!at(t) || typeof e != "string")
38
- return s;
39
- const [n, ...i] = e.split(".");
40
- return i.length ? Hs(t[n], i.join("."), s) : t[n] ?? s;
41
- }, Wi = (t) => Array.isArray(t) && t.every((e) => typeof e == "string"), Fs = (t) => typeof t == "string" && t.trim() !== "", zi = (t) => typeof t == "object" ? JSON.stringify(t) : String(t), Gi = (t) => typeof t == "string" ? t.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : t, Bs = (t) => t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, s) => (s > 0 ? "-" : "") + e.toLowerCase()).replace(/[^a-z0-9-]+/g, "-").replace(/--+/g, "-").replace(/(?:^-)|(?:-$)/g, ""), Hi = (t = "", e = 10) => {
42
- const s = new Uint8Array(e);
43
- crypto.getRandomValues(s);
44
- const r = Array.from(s).map((n) => n.toString(16).padStart(2, "0")).join("").slice(0, e);
45
- return t !== "" ? `${t}-${r}` : r;
46
- }, Fi = (t) => Fs(t) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(t) !== null, Bi = (t) => {
47
- let e;
48
- return typeof t == "string" ? e = t : t && typeof t == "object" && (at(t) || Array.isArray(t)) ? e = JSON.stringify(t) : t != null && typeof t != "boolean" && typeof t != "object" && (e = String(t)), e && Bs(e);
49
- }, Ui = async (t) => {
50
- if (t)
51
- return t();
52
- }, Zi = {
53
- FIRST: "first",
54
- NEXT: "next",
55
- PREVIOUS: "previous",
56
- LAST: "last"
57
- }, Xt = 10;
58
- class Us {
59
- /**
60
- * Define items
61
- */
62
- items = [];
63
- /**
64
- * Define total
65
- */
66
- total;
67
- /**
68
- * Define top
69
- */
70
- top = Xt;
71
- /**
72
- * Define next
73
- */
74
- next;
75
- /**
76
- * Define base index
77
- */
78
- baseIndex = 1;
79
- constructor(e) {
80
- if (at(e))
81
- Array.isArray(e.items) && (this.items = e.items), typeof e.top == "number" && (this.top = e.top), this.total = typeof e.total == "number" ? e.total : this.items.length, this.next = e.next;
82
- else
83
- throw new Error("Page - init must match IPage type.");
84
- }
85
- /**
86
- * Get index of items from cursor
87
- * @param cursor - cursor to find
88
- * @param oldItem - previous item
89
- * @returns item index
90
- */
91
- getIndexFromCursor = (e = "first", s) => {
92
- if (!Array.isArray(this.items) || !this.items.length)
93
- return null;
94
- const n = this.items.length - this.baseIndex;
95
- let i, a = 0;
96
- if (["previous", "next"].includes(e) && s) {
97
- const o = this.items.findIndex((l) => JSON.stringify(l) === JSON.stringify(s));
98
- if (o === -1)
99
- return 0;
100
- a = o;
101
- }
102
- return e === "first" ? i = 0 : e === "last" ? i = n : e === "previous" ? i = JSON.stringify(this.items[a]) === JSON.stringify(this.items[0]) ? n : a - this.baseIndex : e === "next" ? i = JSON.stringify(this.items[a]) === JSON.stringify(this.items[n]) ? 0 : a + this.baseIndex : i = 0, i;
103
- };
104
- }
105
- class qi {
106
- /**
107
- * Define paginated items
108
- */
109
- items = [];
110
- /* Privates */
111
- #e = Xt;
112
- #t;
113
- #s;
114
- constructor(e, s) {
115
- Array.isArray(e) && (this.items = e), s && (["string", "function"].includes(typeof s.next) || at(s.next) && URL.canParse(s.next)) && (this.#t = s.next), typeof s?.top == "number" && (this.#e = s.top), typeof s?.total == "number" && (this.#s = s.total);
116
- }
117
- /**
118
- * Get page
119
- * @param offset - pagiantion offset
120
- * @param filter - filter methode
121
- * @returns formated page
122
- */
123
- getPage = (e = 0, s) => {
124
- const r = typeof s == "function" ? this.items.filter(s) : this.items;
125
- let n;
126
- return this.#t ? n = this.#t : r.length > e + this.#e && (n = () => this.getPage(e + this.#e, s)), new Us({
127
- items: r.slice(e, e + this.#e),
128
- total: this.#s,
129
- top: this.#e,
130
- next: n
131
- });
132
- };
133
- }
134
- const Ji = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, Xi = (t) => t.toISOString().split("T")[0], Yi = (t, e) => e.includes(t?.tagName.toLowerCase()), Ki = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Qi = (t) => typeof t == "number" && !Number.isNaN(t), Vi = (t) => {
135
- const e = Yt(t), s = Kt(t);
136
- return [t, ...e, ...s];
137
- }, Yt = (t, e = []) => {
138
- if (t.self !== t.top)
139
- try {
140
- const s = t.parent;
141
- return s ? (e.push(s), Yt(s, e)) : e;
142
- } catch (s) {
143
- return console.error("Different hosts between iframes:", s), e;
144
- }
145
- return e;
146
- }, Kt = (t, e = []) => {
147
- if (t.frames.length > 0)
148
- for (const s of Array.from(t.frames))
149
- e.push(s), Kt(s, e);
150
- return e;
151
- };
152
- var Zs = Object.create, ot = Object.defineProperty, qs = Object.getOwnPropertyDescriptor, Qt = Object.getOwnPropertyNames, Js = Object.getPrototypeOf, Xs = Object.prototype.hasOwnProperty, Vt = (t) => {
153
- throw TypeError(t);
154
- }, Ys = (t, e, s) => e in t ? ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, es = (t, e) => function() {
155
- return e || (0, t[Qt(t)[0]])((e = { exports: {} }).exports, e), e.exports;
156
- }, Ks = (t, e) => {
157
- for (var s in e)
158
- ot(t, s, { get: e[s], enumerable: !0 });
159
- }, Qs = (t, e, s, r) => {
160
- if (e && typeof e == "object" || typeof e == "function")
161
- for (let n of Qt(e))
162
- !Xs.call(t, n) && n !== s && ot(t, n, { get: () => e[n], enumerable: !(r = qs(e, n)) || r.enumerable });
163
- return t;
164
- }, Vs = (t, e, s) => (s = t != null ? Zs(Js(t)) : {}, Qs(
165
- // If the importer is in node compatibility mode or this is not an ESM
166
- // file that has been converted to a CommonJS file using a Babel-
167
- // compatible transform (i.e. "__esModule" has not been set), then set
168
- // "default" to the CommonJS "module.exports" for node compatibility.
169
- ot(s, "default", { value: t, enumerable: !0 }),
170
- t
171
- )), er = (t, e, s) => Ys(t, e + "", s), bt = (t, e, s) => e.has(t) || Vt("Cannot " + s), v = (t, e, s) => (bt(t, e, "read from private field"), s ? s.call(t) : e.get(t)), Z = (t, e, s) => e.has(t) ? Vt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), R = (t, e, s, r) => (bt(t, e, "write to private field"), e.set(t, s), s), ue = (t, e, s) => (bt(t, e, "access private method"), s), tr = es({
172
- "node_modules/balanced-match/index.js"(t, e) {
173
- e.exports = s;
174
- function s(i, a, o) {
175
- i instanceof RegExp && (i = r(i, o)), a instanceof RegExp && (a = r(a, o));
176
- var l = n(i, a, o);
177
- return l && {
178
- start: l[0],
179
- end: l[1],
180
- pre: o.slice(0, l[0]),
181
- body: o.slice(l[0] + i.length, l[1]),
182
- post: o.slice(l[1] + a.length)
183
- };
184
- }
185
- function r(i, a) {
186
- var o = a.match(i);
187
- return o ? o[0] : null;
188
- }
189
- s.range = n;
190
- function n(i, a, o) {
191
- var l, h, c, u, d, g = o.indexOf(i), f = o.indexOf(a, g + 1), p = g;
192
- if (g >= 0 && f > 0) {
193
- if (i === a)
194
- return [g, f];
195
- for (l = [], c = o.length; p >= 0 && !d; )
196
- p == g ? (l.push(p), g = o.indexOf(i, p + 1)) : l.length == 1 ? d = [l.pop(), f] : (h = l.pop(), h < c && (c = h, u = f), f = o.indexOf(a, p + 1)), p = g < f && g >= 0 ? g : f;
197
- l.length && (d = [c, u]);
198
- }
199
- return d;
200
- }
201
- }
202
- }), sr = es({
203
- "node_modules/brace-expansion/index.js"(t, e) {
204
- var s = tr();
205
- e.exports = d;
206
- var r = "\0SLASH" + Math.random() + "\0", n = "\0OPEN" + Math.random() + "\0", i = "\0CLOSE" + Math.random() + "\0", a = "\0COMMA" + Math.random() + "\0", o = "\0PERIOD" + Math.random() + "\0";
207
- function l($) {
208
- return parseInt($, 10) == $ ? parseInt($, 10) : $.charCodeAt(0);
209
- }
210
- function h($) {
211
- return $.split("\\\\").join(r).split("\\{").join(n).split("\\}").join(i).split("\\,").join(a).split("\\.").join(o);
212
- }
213
- function c($) {
214
- return $.split(r).join("\\").split(n).join("{").split(i).join("}").split(a).join(",").split(o).join(".");
215
- }
216
- function u($) {
217
- if (!$)
218
- return [""];
219
- var w = [], b = s("{", "}", $);
220
- if (!b)
221
- return $.split(",");
222
- var m = b.pre, D = b.body, L = b.post, x = m.split(",");
223
- x[x.length - 1] += "{" + D + "}";
224
- var M = u(L);
225
- return L.length && (x[x.length - 1] += M.shift(), x.push.apply(x, M)), w.push.apply(w, x), w;
226
- }
227
- function d($) {
228
- return $ ? ($.substr(0, 2) === "{}" && ($ = "\\{\\}" + $.substr(2)), E(h($), !0).map(c)) : [];
229
- }
230
- function g($) {
231
- return "{" + $ + "}";
232
- }
233
- function f($) {
234
- return /^-?0\d/.test($);
235
- }
236
- function p($, w) {
237
- return $ <= w;
238
- }
239
- function y($, w) {
240
- return $ >= w;
241
- }
242
- function E($, w) {
243
- var b = [], m = s("{", "}", $);
244
- if (!m) return [$];
245
- var D = m.pre, L = m.post.length ? E(m.post, !1) : [""];
246
- if (/\$$/.test(m.pre))
247
- for (var x = 0; x < L.length; x++) {
248
- var M = D + "{" + m.body + "}" + L[x];
249
- b.push(M);
250
- }
251
- else {
252
- var me = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body), oe = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body), Q = me || oe, Ae = m.body.indexOf(",") >= 0;
253
- if (!Q && !Ae)
254
- return m.post.match(/,(?!,).*\}/) ? ($ = m.pre + "{" + m.body + i + m.post, E($)) : [$];
255
- var S;
256
- if (Q)
257
- S = m.body.split(/\.\./);
258
- else if (S = u(m.body), S.length === 1 && (S = E(S[0], !1).map(g), S.length === 1))
259
- return L.map(function(gt) {
260
- return m.pre + S[0] + gt;
261
- });
262
- var I;
263
- if (Q) {
264
- var le = l(S[0]), Re = l(S[1]), ut = Math.max(S[0].length, S[1].length), Ne = S.length == 3 ? Math.abs(l(S[2])) : 1, Le = p, ft = Re < le;
265
- ft && (Ne *= -1, Le = y);
266
- var pt = S.some(f);
267
- I = [];
268
- for (var V = le; Le(V, Re); V += Ne) {
269
- var A;
270
- if (oe)
271
- A = String.fromCharCode(V), A === "\\" && (A = "");
272
- else if (A = String(V), pt) {
273
- var Me = ut - A.length;
274
- if (Me > 0) {
275
- var ke = new Array(Me + 1).join("0");
276
- V < 0 ? A = "-" + ke + A.slice(1) : A = ke + A;
277
- }
278
- }
279
- I.push(A);
280
- }
281
- } else {
282
- I = [];
283
- for (var G = 0; G < S.length; G++)
284
- I.push.apply(I, E(S[G], !1));
285
- }
286
- for (var G = 0; G < I.length; G++)
287
- for (var x = 0; x < L.length; x++) {
288
- var M = D + I[G] + L[x];
289
- (!w || Q || M) && b.push(M);
290
- }
291
- }
292
- return b;
293
- }
294
- }
295
- }), rr = Vs(sr()), nr = 1024 * 64, Ve = (t) => {
296
- if (typeof t != "string")
297
- throw new TypeError("invalid pattern");
298
- if (t.length > nr)
299
- throw new TypeError("pattern is too long");
300
- }, ir = {
301
- "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
302
- "[:alpha:]": ["\\p{L}\\p{Nl}", !0],
303
- "[:ascii:]": ["\\x00-\\x7f", !1],
304
- "[:blank:]": ["\\p{Zs}\\t", !0],
305
- "[:cntrl:]": ["\\p{Cc}", !0],
306
- "[:digit:]": ["\\p{Nd}", !0],
307
- "[:graph:]": ["\\p{Z}\\p{C}", !0, !0],
308
- "[:lower:]": ["\\p{Ll}", !0],
309
- "[:print:]": ["\\p{C}", !0],
310
- "[:punct:]": ["\\p{P}", !0],
311
- "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0],
312
- "[:upper:]": ["\\p{Lu}", !0],
313
- "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
314
- "[:xdigit:]": ["A-Fa-f0-9", !1]
315
- }, Ce = (t) => t.replace(/[[\]\\-]/g, "\\$&"), ar = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Lt = (t) => t.join(""), or = (t, e) => {
316
- const s = e;
317
- if (t.charAt(s) !== "[")
318
- throw new Error("not in a brace expression");
319
- const r = [], n = [];
320
- let i = s + 1, a = !1, o = !1, l = !1, h = !1, c = s, u = "";
321
- e: for (; i < t.length; ) {
322
- const p = t.charAt(i);
323
- if ((p === "!" || p === "^") && i === s + 1) {
324
- h = !0, i++;
325
- continue;
326
- }
327
- if (p === "]" && a && !l) {
328
- c = i + 1;
329
- break;
330
- }
331
- if (a = !0, p === "\\" && !l) {
332
- l = !0, i++;
333
- continue;
334
- }
335
- if (p === "[" && !l) {
336
- for (const [y, [E, $, w]] of Object.entries(ir))
337
- if (t.startsWith(y, i)) {
338
- if (u)
339
- return ["$.", !1, t.length - s, !0];
340
- i += y.length, w ? n.push(E) : r.push(E), o = o || $;
341
- continue e;
342
- }
343
- }
344
- if (l = !1, u) {
345
- p > u ? r.push(Ce(u) + "-" + Ce(p)) : p === u && r.push(Ce(p)), u = "", i++;
346
- continue;
347
- }
348
- if (t.startsWith("-]", i + 1)) {
349
- r.push(Ce(p + "-")), i += 2;
350
- continue;
351
- }
352
- if (t.startsWith("-", i + 1)) {
353
- u = p, i += 2;
354
- continue;
355
- }
356
- r.push(Ce(p)), i++;
357
- }
358
- if (c < i)
359
- return ["", !1, 0, !1];
360
- if (!r.length && !n.length)
361
- return ["$.", !1, t.length - s, !0];
362
- if (n.length === 0 && r.length === 1 && /^\\?.$/.test(r[0]) && !h) {
363
- const p = r[0].length === 2 ? r[0].slice(-1) : r[0];
364
- return [ar(p), !1, c - s, !1];
365
- }
366
- const d = "[" + (h ? "^" : "") + Lt(r) + "]", g = "[" + (h ? "" : "^") + Lt(n) + "]";
367
- return [r.length && n.length ? "(" + d + "|" + g + ")" : r.length ? d : g, o, c - s, !0];
368
- }, We = (t, { windowsPathsNoEscape: e = !1 } = {}) => e ? t.replace(/\[([^\/\\])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), lr = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), Mt = (t) => lr.has(t), cr = "(?!(?:^|/)\\.\\.?(?:$|/))", qe = "(?!\\.)", hr = /* @__PURE__ */ new Set(["[", "."]), ur = /* @__PURE__ */ new Set(["..", "."]), fr = new Set("().*{}+?[]^$\\!"), pr = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), St = "[^/]", ts = St + "*?", ss = St + "+?", j, W, ie, O, k, fe, be, de, ee, ye, et, Pe, rs, xe, Ye, dt, ns, re = class ce {
369
- constructor(e, s, r = {}) {
370
- Z(this, Pe), er(this, "type"), Z(this, j), Z(this, W), Z(this, ie, !1), Z(this, O, []), Z(this, k), Z(this, fe), Z(this, be), Z(this, de, !1), Z(this, ee), Z(this, ye), Z(this, et, !1), this.type = e, e && R(this, W, !0), R(this, k, s), R(this, j, v(this, k) ? v(v(this, k), j) : this), R(this, ee, v(this, j) === this ? r : v(v(this, j), ee)), R(this, be, v(this, j) === this ? [] : v(v(this, j), be)), e === "!" && !v(v(this, j), de) && v(this, be).push(this), R(this, fe, v(this, k) ? v(v(this, k), O).length : 0);
371
- }
372
- get hasMagic() {
373
- if (v(this, W) !== void 0)
374
- return v(this, W);
375
- for (const e of v(this, O))
376
- if (typeof e != "string" && (e.type || e.hasMagic))
377
- return R(this, W, !0);
378
- return v(this, W);
379
- }
380
- // reconstructs the pattern
381
- toString() {
382
- return v(this, ye) !== void 0 ? v(this, ye) : this.type ? R(this, ye, this.type + "(" + v(this, O).map((e) => String(e)).join("|") + ")") : R(this, ye, v(this, O).map((e) => String(e)).join(""));
383
- }
384
- push(...e) {
385
- for (const s of e)
386
- if (s !== "") {
387
- if (typeof s != "string" && !(s instanceof ce && v(s, k) === this))
388
- throw new Error("invalid part: " + s);
389
- v(this, O).push(s);
390
- }
391
- }
392
- toJSON() {
393
- var e;
394
- const s = this.type === null ? v(this, O).slice().map((r) => typeof r == "string" ? r : r.toJSON()) : [this.type, ...v(this, O).map((r) => r.toJSON())];
395
- return this.isStart() && !this.type && s.unshift([]), this.isEnd() && (this === v(this, j) || v(v(this, j), de) && ((e = v(this, k)) == null ? void 0 : e.type) === "!") && s.push({}), s;
396
- }
397
- isStart() {
398
- var e;
399
- if (v(this, j) === this)
400
- return !0;
401
- if (!((e = v(this, k)) != null && e.isStart()))
402
- return !1;
403
- if (v(this, fe) === 0)
404
- return !0;
405
- const s = v(this, k);
406
- for (let r = 0; r < v(this, fe); r++) {
407
- const n = v(s, O)[r];
408
- if (!(n instanceof ce && n.type === "!"))
409
- return !1;
410
- }
411
- return !0;
412
- }
413
- isEnd() {
414
- var e, s, r;
415
- if (v(this, j) === this || ((e = v(this, k)) == null ? void 0 : e.type) === "!")
416
- return !0;
417
- if (!((s = v(this, k)) != null && s.isEnd()))
418
- return !1;
419
- if (!this.type)
420
- return (r = v(this, k)) == null ? void 0 : r.isEnd();
421
- const n = v(this, k) ? v(v(this, k), O).length : 0;
422
- return v(this, fe) === n - 1;
423
- }
424
- copyIn(e) {
425
- typeof e == "string" ? this.push(e) : this.push(e.clone(this));
426
- }
427
- clone(e) {
428
- const s = new ce(this.type, e);
429
- for (const r of v(this, O))
430
- s.copyIn(r);
431
- return s;
432
- }
433
- static fromGlob(e, s = {}) {
434
- var r;
435
- const n = new ce(null, void 0, s);
436
- return ue(r = ce, xe, Ye).call(r, e, n, 0, s), n;
437
- }
438
- // returns the regular expression if there's magic, or the unescaped
439
- // string if not.
440
- toMMPattern() {
441
- if (this !== v(this, j))
442
- return v(this, j).toMMPattern();
443
- const e = this.toString(), [s, r, n, i] = this.toRegExpSource();
444
- if (!(n || v(this, W) || v(this, ee).nocase && !v(this, ee).nocaseMagicOnly && e.toUpperCase() !== e.toLowerCase()))
445
- return r;
446
- const o = (v(this, ee).nocase ? "i" : "") + (i ? "u" : "");
447
- return Object.assign(new RegExp(`^${s}$`, o), {
448
- _src: s,
449
- _glob: e
450
- });
451
- }
452
- get options() {
453
- return v(this, ee);
454
- }
455
- // returns the string match, the regexp source, whether there's magic
456
- // in the regexp (so a regular expression is required) and whether or
457
- // not the uflag is needed for the regular expression (for posix classes)
458
- // TODO: instead of injecting the start/end at this point, just return
459
- // the BODY of the regexp, along with the start/end portions suitable
460
- // for binding the start/end in either a joined full-path makeRe context
461
- // (where we bind to (^|/), or a standalone matchPart context (where
462
- // we bind to ^, and not /). Otherwise slashes get duped!
463
- //
464
- // In part-matching mode, the start is:
465
- // - if not isStart: nothing
466
- // - if traversal possible, but not allowed: ^(?!\.\.?$)
467
- // - if dots allowed or not possible: ^
468
- // - if dots possible and not allowed: ^(?!\.)
469
- // end is:
470
- // - if not isEnd(): nothing
471
- // - else: $
472
- //
473
- // In full-path matching mode, we put the slash at the START of the
474
- // pattern, so start is:
475
- // - if first pattern: same as part-matching mode
476
- // - if not isStart(): nothing
477
- // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
478
- // - if dots allowed or not possible: /
479
- // - if dots possible and not allowed: /(?!\.)
480
- // end is:
481
- // - if last pattern, same as part-matching mode
482
- // - else nothing
483
- //
484
- // Always put the (?:$|/) on negated tails, though, because that has to be
485
- // there to bind the end of the negated pattern portion, and it's easier to
486
- // just stick it in now rather than try to inject it later in the middle of
487
- // the pattern.
488
- //
489
- // We can just always return the same end, and leave it up to the caller
490
- // to know whether it's going to be used joined or in parts.
491
- // And, if the start is adjusted slightly, can do the same there:
492
- // - if not isStart: nothing
493
- // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
494
- // - if dots allowed or not possible: (?:/|^)
495
- // - if dots possible and not allowed: (?:/|^)(?!\.)
496
- //
497
- // But it's better to have a simpler binding without a conditional, for
498
- // performance, so probably better to return both start options.
499
- //
500
- // Then the caller just ignores the end if it's not the first pattern,
501
- // and the start always gets applied.
502
- //
503
- // But that's always going to be $ if it's the ending pattern, or nothing,
504
- // so the caller can just attach $ at the end of the pattern when building.
505
- //
506
- // So the todo is:
507
- // - better detect what kind of start is needed
508
- // - return both flavors of starting pattern
509
- // - attach $ at the end of the pattern when creating the actual RegExp
510
- //
511
- // Ah, but wait, no, that all only applies to the root when the first pattern
512
- // is not an extglob. If the first pattern IS an extglob, then we need all
513
- // that dot prevention biz to live in the extglob portions, because eg
514
- // +(*|.x*) can match .xy but not .yx.
515
- //
516
- // So, return the two flavors if it's #root and the first child is not an
517
- // AST, otherwise leave it to the child AST to handle it, and there,
518
- // use the (?:^|/) style of start binding.
519
- //
520
- // Even simplified further:
521
- // - Since the start for a join is eg /(?!\.) and the start for a part
522
- // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
523
- // or start or whatever) and prepend ^ or / at the Regexp construction.
524
- toRegExpSource(e) {
525
- var s;
526
- const r = e ?? !!v(this, ee).dot;
527
- if (v(this, j) === this && ue(this, Pe, rs).call(this), !this.type) {
528
- const h = this.isStart() && this.isEnd(), c = v(this, O).map((f) => {
529
- var p;
530
- const [y, E, $, w] = typeof f == "string" ? ue(p = ce, xe, ns).call(p, f, v(this, W), h) : f.toRegExpSource(e);
531
- return R(this, W, v(this, W) || $), R(this, ie, v(this, ie) || w), y;
532
- }).join("");
533
- let u = "";
534
- if (this.isStart() && typeof v(this, O)[0] == "string" && !(v(this, O).length === 1 && ur.has(v(this, O)[0]))) {
535
- const p = hr, y = (
536
- // dots are allowed, and the pattern starts with [ or .
537
- r && p.has(c.charAt(0)) || // the pattern starts with \., and then [ or .
538
- c.startsWith("\\.") && p.has(c.charAt(2)) || // the pattern starts with \.\., and then [ or .
539
- c.startsWith("\\.\\.") && p.has(c.charAt(4))
540
- ), E = !r && !e && p.has(c.charAt(0));
541
- u = y ? cr : E ? qe : "";
542
- }
543
- let d = "";
544
- return this.isEnd() && v(v(this, j), de) && ((s = v(this, k)) == null ? void 0 : s.type) === "!" && (d = "(?:$|\\/)"), [
545
- u + c + d,
546
- We(c),
547
- R(this, W, !!v(this, W)),
548
- v(this, ie)
549
- ];
550
- }
551
- const n = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:";
552
- let a = ue(this, Pe, dt).call(this, r);
553
- if (this.isStart() && this.isEnd() && !a && this.type !== "!") {
554
- const h = this.toString();
555
- return R(this, O, [h]), this.type = null, R(this, W, void 0), [h, We(this.toString()), !1, !1];
556
- }
557
- let o = !n || e || r || !qe ? "" : ue(this, Pe, dt).call(this, !0);
558
- o === a && (o = ""), o && (a = `(?:${a})(?:${o})*?`);
559
- let l = "";
560
- if (this.type === "!" && v(this, et))
561
- l = (this.isStart() && !r ? qe : "") + ss;
562
- else {
563
- const h = this.type === "!" ? (
564
- // !() must match something,but !(x) can match ''
565
- "))" + (this.isStart() && !r && !e ? qe : "") + ts + ")"
566
- ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o ? ")" : this.type === "*" && o ? ")?" : `)${this.type}`;
567
- l = i + a + h;
568
- }
569
- return [
570
- l,
571
- We(a),
572
- R(this, W, !!v(this, W)),
573
- v(this, ie)
574
- ];
575
- }
576
- };
577
- j = /* @__PURE__ */ new WeakMap();
578
- W = /* @__PURE__ */ new WeakMap();
579
- ie = /* @__PURE__ */ new WeakMap();
580
- O = /* @__PURE__ */ new WeakMap();
581
- k = /* @__PURE__ */ new WeakMap();
582
- fe = /* @__PURE__ */ new WeakMap();
583
- be = /* @__PURE__ */ new WeakMap();
584
- de = /* @__PURE__ */ new WeakMap();
585
- ee = /* @__PURE__ */ new WeakMap();
586
- ye = /* @__PURE__ */ new WeakMap();
587
- et = /* @__PURE__ */ new WeakMap();
588
- Pe = /* @__PURE__ */ new WeakSet();
589
- rs = function() {
590
- if (this !== v(this, j))
591
- throw new Error("should only call on root");
592
- if (v(this, de))
593
- return this;
594
- this.toString(), R(this, de, !0);
595
- let t;
596
- for (; t = v(this, be).pop(); ) {
597
- if (t.type !== "!")
598
- continue;
599
- let e = t, s = v(e, k);
600
- for (; s; ) {
601
- for (let r = v(e, fe) + 1; !s.type && r < v(s, O).length; r++)
602
- for (const n of v(t, O)) {
603
- if (typeof n == "string")
604
- throw new Error("string part in extglob AST??");
605
- n.copyIn(v(s, O)[r]);
606
- }
607
- e = s, s = v(e, k);
608
- }
609
- }
610
- return this;
611
- };
612
- xe = /* @__PURE__ */ new WeakSet();
613
- Ye = function(t, e, s, r) {
614
- var n, i;
615
- let a = !1, o = !1, l = -1, h = !1;
616
- if (e.type === null) {
617
- let f = s, p = "";
618
- for (; f < t.length; ) {
619
- const y = t.charAt(f++);
620
- if (a || y === "\\") {
621
- a = !a, p += y;
622
- continue;
623
- }
624
- if (o) {
625
- f === l + 1 ? (y === "^" || y === "!") && (h = !0) : y === "]" && !(f === l + 2 && h) && (o = !1), p += y;
626
- continue;
627
- } else if (y === "[") {
628
- o = !0, l = f, h = !1, p += y;
629
- continue;
630
- }
631
- if (!r.noext && Mt(y) && t.charAt(f) === "(") {
632
- e.push(p), p = "";
633
- const E = new re(y, e);
634
- f = ue(n = re, xe, Ye).call(n, t, E, f, r), e.push(E);
635
- continue;
636
- }
637
- p += y;
638
- }
639
- return e.push(p), f;
640
- }
641
- let c = s + 1, u = new re(null, e);
642
- const d = [];
643
- let g = "";
644
- for (; c < t.length; ) {
645
- const f = t.charAt(c++);
646
- if (a || f === "\\") {
647
- a = !a, g += f;
648
- continue;
649
- }
650
- if (o) {
651
- c === l + 1 ? (f === "^" || f === "!") && (h = !0) : f === "]" && !(c === l + 2 && h) && (o = !1), g += f;
652
- continue;
653
- } else if (f === "[") {
654
- o = !0, l = c, h = !1, g += f;
655
- continue;
656
- }
657
- if (Mt(f) && t.charAt(c) === "(") {
658
- u.push(g), g = "";
659
- const p = new re(f, u);
660
- u.push(p), c = ue(i = re, xe, Ye).call(i, t, p, c, r);
661
- continue;
662
- }
663
- if (f === "|") {
664
- u.push(g), g = "", d.push(u), u = new re(null, e);
665
- continue;
666
- }
667
- if (f === ")")
668
- return g === "" && v(e, O).length === 0 && R(e, et, !0), u.push(g), g = "", e.push(...d, u), c;
669
- g += f;
670
- }
671
- return e.type = null, R(e, W, void 0), R(e, O, [t.substring(s - 1)]), c;
672
- };
673
- dt = function(t) {
674
- return v(this, O).map((e) => {
675
- if (typeof e == "string")
676
- throw new Error("string type in extglob ast??");
677
- const [s, r, n, i] = e.toRegExpSource(t);
678
- return R(this, ie, v(this, ie) || i), s;
679
- }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
680
- };
681
- ns = function(t, e, s = !1) {
682
- let r = !1, n = "", i = !1;
683
- for (let a = 0; a < t.length; a++) {
684
- const o = t.charAt(a);
685
- if (r) {
686
- r = !1, n += (fr.has(o) ? "\\" : "") + o;
687
- continue;
688
- }
689
- if (o === "\\") {
690
- a === t.length - 1 ? n += "\\\\" : r = !0;
691
- continue;
692
- }
693
- if (o === "[") {
694
- const [l, h, c, u] = or(t, a);
695
- if (c) {
696
- n += l, i = i || h, a += c - 1, e = e || u;
697
- continue;
698
- }
699
- }
700
- if (o === "*") {
701
- s && t === "*" ? n += ss : n += ts, e = !0;
702
- continue;
703
- }
704
- if (o === "?") {
705
- n += St, e = !0;
706
- continue;
707
- }
708
- n += pr(o);
709
- }
710
- return [n, We(t), !!e, i];
711
- };
712
- Z(re, xe);
713
- var is = re, gr = (t, { windowsPathsNoEscape: e = !1 } = {}) => e ? t.replace(/[?*()[\]]/g, "[$&]") : t.replace(/[?*()[\]\\]/g, "\\$&"), H = (t, e, s = {}) => (Ve(e), !s.nocomment && e.charAt(0) === "#" ? !1 : new lt(e, s).match(t)), dr = /^\*+([^+@!?\*\[\(]*)$/, $r = (t) => (e) => !e.startsWith(".") && e.endsWith(t), vr = (t) => (e) => e.endsWith(t), _r = (t) => (t = t.toLowerCase(), (e) => !e.startsWith(".") && e.toLowerCase().endsWith(t)), mr = (t) => (t = t.toLowerCase(), (e) => e.toLowerCase().endsWith(t)), yr = /^\*+\.\*+$/, Er = (t) => !t.startsWith(".") && t.includes("."), wr = (t) => t !== "." && t !== ".." && t.includes("."), br = /^\.\*+$/, Sr = (t) => t !== "." && t !== ".." && t.startsWith("."), xr = /^\*+$/, Or = (t) => t.length !== 0 && !t.startsWith("."), Tr = (t) => t.length !== 0 && t !== "." && t !== "..", Ar = /^\?+([^+@!?\*\[\(]*)?$/, Rr = ([t, e = ""]) => {
714
- const s = as([t]);
715
- return e ? (e = e.toLowerCase(), (r) => s(r) && r.toLowerCase().endsWith(e)) : s;
716
- }, Nr = ([t, e = ""]) => {
717
- const s = os([t]);
718
- return e ? (e = e.toLowerCase(), (r) => s(r) && r.toLowerCase().endsWith(e)) : s;
719
- }, Lr = ([t, e = ""]) => {
720
- const s = os([t]);
721
- return e ? (r) => s(r) && r.endsWith(e) : s;
722
- }, Mr = ([t, e = ""]) => {
723
- const s = as([t]);
724
- return e ? (r) => s(r) && r.endsWith(e) : s;
725
- }, as = ([t]) => {
726
- const e = t.length;
727
- return (s) => s.length === e && !s.startsWith(".");
728
- }, os = ([t]) => {
729
- const e = t.length;
730
- return (s) => s.length === e && s !== "." && s !== "..";
731
- }, ls = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", kt = {
732
- win32: { sep: "\\" },
733
- posix: { sep: "/" }
734
- }, kr = ls === "win32" ? kt.win32.sep : kt.posix.sep;
735
- H.sep = kr;
736
- var Y = /* @__PURE__ */ Symbol("globstar **");
737
- H.GLOBSTAR = Y;
738
- var Cr = "[^/]", jr = Cr + "*?", Pr = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", Dr = "(?:(?!(?:\\/|^)\\.).)*?", Ir = (t, e = {}) => (s) => H(s, t, e);
739
- H.filter = Ir;
740
- var J = (t, e = {}) => Object.assign({}, t, e), Wr = (t) => {
741
- if (!t || typeof t != "object" || !Object.keys(t).length)
742
- return H;
743
- const e = H;
744
- return Object.assign((r, n, i = {}) => e(r, n, J(t, i)), {
745
- Minimatch: class extends e.Minimatch {
746
- constructor(n, i = {}) {
747
- super(n, J(t, i));
748
- }
749
- static defaults(n) {
750
- return e.defaults(J(t, n)).Minimatch;
751
- }
752
- },
753
- AST: class extends e.AST {
754
- /* c8 ignore start */
755
- constructor(n, i, a = {}) {
756
- super(n, i, J(t, a));
757
- }
758
- /* c8 ignore stop */
759
- static fromGlob(n, i = {}) {
760
- return e.AST.fromGlob(n, J(t, i));
761
- }
762
- },
763
- unescape: (r, n = {}) => e.unescape(r, J(t, n)),
764
- escape: (r, n = {}) => e.escape(r, J(t, n)),
765
- filter: (r, n = {}) => e.filter(r, J(t, n)),
766
- defaults: (r) => e.defaults(J(t, r)),
767
- makeRe: (r, n = {}) => e.makeRe(r, J(t, n)),
768
- braceExpand: (r, n = {}) => e.braceExpand(r, J(t, n)),
769
- match: (r, n, i = {}) => e.match(r, n, J(t, i)),
770
- sep: e.sep,
771
- GLOBSTAR: Y
772
- });
1
+ //#region ../helpers/dist/utils/index.js
2
+ var e = class {
3
+ classes;
4
+ constructor(e = []) {
5
+ this.classes = e;
6
+ }
7
+ add = (e) => {
8
+ this.has(e) || this.classes.push(e);
9
+ };
10
+ delete = (e) => {
11
+ let t = this.classes.indexOf(e);
12
+ t > -1 && this.classes.splice(t, 1);
13
+ };
14
+ has = (e) => this.classes.includes(e);
15
+ join = () => this.classes.join(" ");
16
+ }, t = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, n = (e, r, i) => {
17
+ if (!t(e) || typeof r != "string") return i;
18
+ let [a, ...o] = r.split(".");
19
+ return o.length ? n(e[a], o.join("."), i) : e[a] ?? i;
20
+ }, r = (e) => Array.isArray(e) && e.every((e) => typeof e == "string"), i = (e) => typeof e == "string" && e.trim() !== "", a = (e) => typeof e == "object" ? JSON.stringify(e) : String(e), o = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, s = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t > 0 ? "-" : "") + e.toLowerCase()).replace(/[^a-z0-9-]+/g, "-").replace(/--+/g, "-").replace(/(?:^-)|(?:-$)/g, ""), c = (e = "", t = 10) => {
21
+ let n = new Uint8Array(t);
22
+ crypto.getRandomValues(n);
23
+ let r = Array.from(n).map((e) => e.toString(16).padStart(2, "0")).join("").slice(0, t);
24
+ return e === "" ? r : `${e}-${r}`;
25
+ }, l = (e) => i(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null, u = (e) => {
26
+ let n;
27
+ return typeof e == "string" ? n = e : e && typeof e == "object" && (t(e) || Array.isArray(e)) ? n = JSON.stringify(e) : e != null && typeof e != "boolean" && typeof e != "object" && (n = String(e)), n && s(n);
28
+ }, d = async (e) => {
29
+ if (e) return e();
30
+ }, f = {
31
+ FIRST: "first",
32
+ NEXT: "next",
33
+ PREVIOUS: "previous",
34
+ LAST: "last"
35
+ }, p = 10, m = class {
36
+ items = [];
37
+ total;
38
+ top = p;
39
+ next;
40
+ baseIndex = 1;
41
+ constructor(e) {
42
+ if (t(e)) Array.isArray(e.items) && (this.items = e.items), typeof e.top == "number" && (this.top = e.top), this.total = typeof e.total == "number" ? e.total : this.items.length, this.next = e.next;
43
+ else throw Error("Page - init must match IPage type.");
44
+ }
45
+ getIndexFromCursor = (e = "first", t) => {
46
+ if (!Array.isArray(this.items) || !this.items.length) return null;
47
+ let n = this.items.length - this.baseIndex, r, i = 0;
48
+ if (["previous", "next"].includes(e) && t) {
49
+ let e = this.items.findIndex((e) => JSON.stringify(e) === JSON.stringify(t));
50
+ if (e === -1) return 0;
51
+ i = e;
52
+ }
53
+ return r = e === "first" ? 0 : e === "last" ? n : e === "previous" ? JSON.stringify(this.items[i]) === JSON.stringify(this.items[0]) ? n : i - this.baseIndex : e === "next" ? JSON.stringify(this.items[i]) === JSON.stringify(this.items[n]) ? 0 : i + this.baseIndex : 0, r;
54
+ };
55
+ }, h = class {
56
+ items = [];
57
+ #e = p;
58
+ #t;
59
+ #n;
60
+ constructor(e, n) {
61
+ Array.isArray(e) && (this.items = e), n && (["string", "function"].includes(typeof n.next) || t(n.next) && URL.canParse(n.next)) && (this.#t = n.next), typeof n?.top == "number" && (this.#e = n.top), typeof n?.total == "number" && (this.#n = n.total);
62
+ }
63
+ getPage = (e = 0, t) => {
64
+ let n = typeof t == "function" ? this.items.filter(t) : this.items, r;
65
+ return this.#t ? r = this.#t : n.length > e + this.#e && (r = () => this.getPage(e + this.#e, t)), new m({
66
+ items: n.slice(e, e + this.#e),
67
+ total: this.#n,
68
+ top: this.#e,
69
+ next: r
70
+ });
71
+ };
72
+ }, g = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, _ = (e) => e.toISOString().split("T")[0], ee = (e, t) => t.includes(e?.tagName.toLowerCase()), te = "a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier], mg-button", ne = (e) => typeof e == "number" && !Number.isNaN(e), re = (e) => {
73
+ let t = v(e), n = ie(e);
74
+ return [
75
+ e,
76
+ ...t,
77
+ ...n
78
+ ];
79
+ }, v = (e, t = []) => {
80
+ if (e.self !== e.top) try {
81
+ let n = e.parent;
82
+ return n ? (t.push(n), v(n, t)) : t;
83
+ } catch (e) {
84
+ return console.error("Different hosts between iframes:", e), t;
85
+ }
86
+ return t;
87
+ }, ie = (e, t = []) => {
88
+ if (e.frames.length > 0) for (let n of Array.from(e.frames)) t.push(n), ie(n, t);
89
+ return t;
90
+ }, ae = (e, t) => {
91
+ if (!t) return;
92
+ let n = t.split("/");
93
+ return `${e}${n.slice(2, n.length - 1).join("-")}--docs`;
94
+ }, oe = (e, t) => {
95
+ if (t) return `${e}${t}`;
96
+ }, se = (e) => {
97
+ let t = e.overview ? `${e.overview}\n\n` : "", n = e.props.filter(({ attr: e }) => e !== void 0);
98
+ n.length && (t += "Attributes:\n", t += n.map(({ attr: e, docs: t }) => `- \`${e}\`: ${t}\n`).join(""), t += "\n");
99
+ let r = e.props.filter(({ attr: e }) => e === void 0);
100
+ return r.length && (t += "Properties:\n", t += r.map(({ name: e, docs: t }) => `- \`${e}\`: ${t}\n`).join(""), t += "\n"), e.methods.length && (t += "Methods:\n", t += e.methods.map(({ name: e, docs: t }) => `- \`${e}\`: ${t}\n`).join(""), t += "\n"), e.events.length && (t += "Events:\n", t += e.events.map(({ event: e, docs: t }) => `- \`${e}\`: ${t}\n`).join(""), t += "\n"), e.listeners.length && (t += "Listeners:\n", t += e.listeners.map(({ event: e }) => `- \`${e}\`\n`).join(""), t += "\n"), e.slots.length && (t += "Slots:\n", t += e.slots.map(({ name: e, docs: t }) => `- ${e ? `\`${e}\`` : "default"}: ${t}\n`).join(""), t += "\n"), t;
101
+ }, y = (e) => `${e.docs}\n\nType: \`${e.type}\``, ce = (e, t, n, r) => ({
102
+ $schema: "https://json.schemastore.org/web-types",
103
+ name: e,
104
+ version: t,
105
+ "description-markup": "markdown",
106
+ contributions: { html: { elements: n.components.map((e) => {
107
+ let t = ae(r, e.filePath);
108
+ return {
109
+ name: e.tag,
110
+ description: se(e),
111
+ "doc-url": t,
112
+ attributes: e.props.filter((e) => e.attr).map((e) => ({
113
+ name: e.attr,
114
+ description: y(e),
115
+ "doc-url": t,
116
+ value: {
117
+ type: e.type,
118
+ default: e.default,
119
+ required: e.required
120
+ }
121
+ })),
122
+ js: {
123
+ properties: e.props.filter((e) => e.attr === void 0).map((e) => ({
124
+ name: e.name,
125
+ description: y(e),
126
+ "doc-url": t,
127
+ value: {
128
+ type: e.type,
129
+ default: e.default,
130
+ required: e.required
131
+ }
132
+ })),
133
+ events: e.events.map((e) => ({
134
+ name: e.event,
135
+ description: e.docs
136
+ }))
137
+ },
138
+ css: { properties: e.styles.map((e) => ({
139
+ name: e.name,
140
+ description: e.docs
141
+ })) }
142
+ };
143
+ }) } }
144
+ }), le = (e, t, n) => [{
145
+ name: "Storybook",
146
+ url: ae(e, n)
147
+ }, {
148
+ name: "Sources",
149
+ url: oe(t, n)
150
+ }], ue = (e) => {
151
+ if (!e.values.some(({ value: e }) => e === void 0)) return e.values.map(({ value: e }) => ({ name: e }));
152
+ }, de = (e, t, n) => ({
153
+ version: 1.1,
154
+ tags: e.components.map((e) => {
155
+ let r = le(t, n, e.filePath);
156
+ return {
157
+ name: e.tag,
158
+ description: se(e),
159
+ attributes: e.props.filter((e) => e.attr !== void 0).map((e) => ({
160
+ name: e.attr,
161
+ description: y(e),
162
+ values: ue(e),
163
+ references: r
164
+ })),
165
+ references: r
166
+ };
167
+ }),
168
+ globalAttributes: [],
169
+ valueSets: []
170
+ }), fe = (e) => ({
171
+ version: 1.1,
172
+ properties: e.components.flatMap((e) => e.styles.map((e) => ({
173
+ name: e.name,
174
+ description: e.docs
175
+ })))
176
+ }), pe = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, me = (e) => {
177
+ let t = {
178
+ value: "2023",
179
+ pattern: "yyyy"
180
+ }, n = {
181
+ value: "12",
182
+ pattern: "mm"
183
+ }, r = {
184
+ value: "24",
185
+ pattern: "dd"
186
+ };
187
+ return be([
188
+ t.value,
189
+ n.value,
190
+ r.value
191
+ ].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(n.value, n.pattern).replace(r.value, r.pattern);
192
+ }, he = (e, t, n) => {
193
+ let r = e.closest("[lang]"), i = Intl.NumberFormat.supportedLocalesOf(r?.lang), a = i.length > 0 && typeof i[0] == "string" ? i[0] : navigator.language || n, o = a.split("-").shift();
194
+ return Object.keys(t).length === 0 ? {
195
+ locale: a,
196
+ messages: { lang: n }
197
+ } : {
198
+ locale: a,
199
+ messages: t[o] ?? t[n] ?? { lang: n }
200
+ };
201
+ }, ge = (e, t, n) => new Intl.NumberFormat(t, {
202
+ style: "currency",
203
+ currency: n
204
+ }).format(e), _e = (e, t, n = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: n }).format(Number(e)), ve = (e, t, n = 0) => new Intl.NumberFormat(t, {
205
+ style: "percent",
206
+ minimumFractionDigits: n,
207
+ maximumFractionDigits: n
208
+ }).format(e), ye = (e, t, n, r = "short", i = 0) => new Intl.NumberFormat(t, {
209
+ style: "unit",
210
+ unit: n,
211
+ unitDisplay: r,
212
+ minimumFractionDigits: i,
213
+ maximumFractionDigits: i
214
+ }).format(e), be = (e, t, n) => typeof e != "string" || e === "" || !pe.test(e) ? "" : new Intl.DateTimeFormat(t, n).format(new Date(e)), xe = (e, t) => (n) => he(n, e, t), b = {
215
+ updatable: !0,
216
+ slotRelocation: !0
217
+ }, Se = "http://www.w3.org/2000/svg", Ce = "http://www.w3.org/1999/xhtml", we = (e) => {
218
+ if (e.__stencil__getHostRef) return e.__stencil__getHostRef();
219
+ }, x = (e, t) => t in e, S = "http://www.w3.org/1999/xlink", C = typeof window < "u" ? window : {}, w = {
220
+ $flags$: 0,
221
+ $resourcesUrl$: "",
222
+ jmp: (e) => e(),
223
+ raf: (e) => requestAnimationFrame(e),
224
+ ael: (e, t, n, r) => e.addEventListener(t, n, r),
225
+ rel: (e, t, n, r) => e.removeEventListener(t, n, r),
226
+ ce: (e, t) => new CustomEvent(e, t)
227
+ }, T = (e) => {
228
+ let t = O(e, "childNodes");
229
+ e.tagName && e.tagName.includes("-") && e["s-cr"] && e.tagName !== "SLOT-FB" && E(t, e.tagName).forEach((e) => {
230
+ e.nodeType === 1 && e.tagName === "SLOT-FB" && (Ee(e, D(e), !1).length ? e.hidden = !0 : e.hidden = !1);
231
+ });
232
+ let n = 0;
233
+ for (n = 0; n < t.length; n++) {
234
+ let e = t[n];
235
+ e.nodeType === 1 && O(e, "childNodes").length && T(e);
236
+ }
237
+ }, Te = (e) => {
238
+ let t = [];
239
+ for (let n = 0; n < e.length; n++) {
240
+ let r = e[n]["s-nr"] || void 0;
241
+ r && r.isConnected && t.push(r);
242
+ }
243
+ return t;
773
244
  };
774
- H.defaults = Wr;
775
- var cs = (t, e = {}) => (Ve(t), e.nobrace || !/\{(?:(?!\{).)*\}/.test(t) ? [t] : (0, rr.default)(t));
776
- H.braceExpand = cs;
777
- var zr = (t, e = {}) => new lt(t, e).makeRe();
778
- H.makeRe = zr;
779
- var Gr = (t, e, s = {}) => {
780
- const r = new lt(e, s);
781
- return t = t.filter((n) => r.match(n)), r.options.nonull && !t.length && t.push(e), t;
782
- };
783
- H.match = Gr;
784
- var Ct = /[?*]|[+@!]\(.*?\)|\[|\]/, Hr = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), lt = class {
785
- options;
786
- set;
787
- pattern;
788
- windowsPathsNoEscape;
789
- nonegate;
790
- negate;
791
- comment;
792
- empty;
793
- preserveMultipleSlashes;
794
- partial;
795
- globSet;
796
- globParts;
797
- nocase;
798
- isWindows;
799
- platform;
800
- windowsNoMagicRoot;
801
- regexp;
802
- constructor(e, s = {}) {
803
- Ve(e), s = s || {}, this.options = s, this.pattern = e, this.platform = s.platform || ls, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!s.windowsPathsNoEscape || s.allowWindowsEscape === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!s.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!s.nonegate, this.comment = !1, this.empty = !1, this.partial = !!s.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = s.windowsNoMagicRoot !== void 0 ? s.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
804
- }
805
- hasMagic() {
806
- if (this.options.magicalBraces && this.set.length > 1)
807
- return !0;
808
- for (const e of this.set)
809
- for (const s of e)
810
- if (typeof s != "string")
811
- return !0;
812
- return !1;
813
- }
814
- debug(...e) {
815
- }
816
- make() {
817
- const e = this.pattern, s = this.options;
818
- if (!s.nocomment && e.charAt(0) === "#") {
819
- this.comment = !0;
820
- return;
821
- }
822
- if (!e) {
823
- this.empty = !0;
824
- return;
825
- }
826
- this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], s.debug && (this.debug = (...i) => console.error(...i)), this.debug(this.pattern, this.globSet);
827
- const r = this.globSet.map((i) => this.slashSplit(i));
828
- this.globParts = this.preprocess(r), this.debug(this.pattern, this.globParts);
829
- let n = this.globParts.map((i, a, o) => {
830
- if (this.isWindows && this.windowsNoMagicRoot) {
831
- const l = i[0] === "" && i[1] === "" && (i[2] === "?" || !Ct.test(i[2])) && !Ct.test(i[3]), h = /^[a-z]:/i.test(i[0]);
832
- if (l)
833
- return [...i.slice(0, 4), ...i.slice(4).map((c) => this.parse(c))];
834
- if (h)
835
- return [i[0], ...i.slice(1).map((c) => this.parse(c))];
836
- }
837
- return i.map((l) => this.parse(l));
838
- });
839
- if (this.debug(this.pattern, n), this.set = n.filter((i) => i.indexOf(!1) === -1), this.isWindows)
840
- for (let i = 0; i < this.set.length; i++) {
841
- const a = this.set[i];
842
- a[0] === "" && a[1] === "" && this.globParts[i][2] === "?" && typeof a[3] == "string" && /^[a-z]:$/i.test(a[3]) && (a[2] = "?");
843
- }
844
- this.debug(this.pattern, this.set);
845
- }
846
- // various transforms to equivalent pattern sets that are
847
- // faster to process in a filesystem walk. The goal is to
848
- // eliminate what we can, and push all ** patterns as far
849
- // to the right as possible, even if it increases the number
850
- // of patterns that we have to process.
851
- preprocess(e) {
852
- if (this.options.noglobstar)
853
- for (let r = 0; r < e.length; r++)
854
- for (let n = 0; n < e[r].length; n++)
855
- e[r][n] === "**" && (e[r][n] = "*");
856
- const { optimizationLevel: s = 1 } = this.options;
857
- return s >= 2 ? (e = this.firstPhasePreProcess(e), e = this.secondPhasePreProcess(e)) : s >= 1 ? e = this.levelOneOptimize(e) : e = this.adjascentGlobstarOptimize(e), e;
858
- }
859
- // just get rid of adjascent ** portions
860
- adjascentGlobstarOptimize(e) {
861
- return e.map((s) => {
862
- let r = -1;
863
- for (; (r = s.indexOf("**", r + 1)) !== -1; ) {
864
- let n = r;
865
- for (; s[n + 1] === "**"; )
866
- n++;
867
- n !== r && s.splice(r, n - r);
868
- }
869
- return s;
870
- });
871
- }
872
- // get rid of adjascent ** and resolve .. portions
873
- levelOneOptimize(e) {
874
- return e.map((s) => (s = s.reduce((r, n) => {
875
- const i = r[r.length - 1];
876
- return n === "**" && i === "**" ? r : n === ".." && i && i !== ".." && i !== "." && i !== "**" ? (r.pop(), r) : (r.push(n), r);
877
- }, []), s.length === 0 ? [""] : s));
878
- }
879
- levelTwoFileOptimize(e) {
880
- Array.isArray(e) || (e = this.slashSplit(e));
881
- let s = !1;
882
- do {
883
- if (s = !1, !this.preserveMultipleSlashes) {
884
- for (let n = 1; n < e.length - 1; n++) {
885
- const i = e[n];
886
- n === 1 && i === "" && e[0] === "" || (i === "." || i === "") && (s = !0, e.splice(n, 1), n--);
887
- }
888
- e[0] === "." && e.length === 2 && (e[1] === "." || e[1] === "") && (s = !0, e.pop());
889
- }
890
- let r = 0;
891
- for (; (r = e.indexOf("..", r + 1)) !== -1; ) {
892
- const n = e[r - 1];
893
- n && n !== "." && n !== ".." && n !== "**" && (s = !0, e.splice(r - 1, 2), r -= 2);
894
- }
895
- } while (s);
896
- return e.length === 0 ? [""] : e;
897
- }
898
- // First phase: single-pattern processing
899
- // <pre> is 1 or more portions
900
- // <rest> is 1 or more portions
901
- // <p> is any portion other than ., .., '', or **
902
- // <e> is . or ''
903
- //
904
- // **/.. is *brutal* for filesystem walking performance, because
905
- // it effectively resets the recursive walk each time it occurs,
906
- // and ** cannot be reduced out by a .. pattern part like a regexp
907
- // or most strings (other than .., ., and '') can be.
908
- //
909
- // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
910
- // <pre>/<e>/<rest> -> <pre>/<rest>
911
- // <pre>/<p>/../<rest> -> <pre>/<rest>
912
- // **/**/<rest> -> **/<rest>
913
- //
914
- // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
915
- // this WOULD be allowed if ** did follow symlinks, or * didn't
916
- firstPhasePreProcess(e) {
917
- let s = !1;
918
- do {
919
- s = !1;
920
- for (let r of e) {
921
- let n = -1;
922
- for (; (n = r.indexOf("**", n + 1)) !== -1; ) {
923
- let a = n;
924
- for (; r[a + 1] === "**"; )
925
- a++;
926
- a > n && r.splice(n + 1, a - n);
927
- let o = r[n + 1];
928
- const l = r[n + 2], h = r[n + 3];
929
- if (o !== ".." || !l || l === "." || l === ".." || !h || h === "." || h === "..")
930
- continue;
931
- s = !0, r.splice(n, 1);
932
- const c = r.slice(0);
933
- c[n] = "**", e.push(c), n--;
934
- }
935
- if (!this.preserveMultipleSlashes) {
936
- for (let a = 1; a < r.length - 1; a++) {
937
- const o = r[a];
938
- a === 1 && o === "" && r[0] === "" || (o === "." || o === "") && (s = !0, r.splice(a, 1), a--);
939
- }
940
- r[0] === "." && r.length === 2 && (r[1] === "." || r[1] === "") && (s = !0, r.pop());
941
- }
942
- let i = 0;
943
- for (; (i = r.indexOf("..", i + 1)) !== -1; ) {
944
- const a = r[i - 1];
945
- if (a && a !== "." && a !== ".." && a !== "**") {
946
- s = !0;
947
- const l = i === 1 && r[i + 1] === "**" ? ["."] : [];
948
- r.splice(i - 1, 2, ...l), r.length === 0 && r.push(""), i -= 2;
949
- }
950
- }
951
- }
952
- } while (s);
953
- return e;
954
- }
955
- // second phase: multi-pattern dedupes
956
- // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
957
- // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
958
- // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
959
- //
960
- // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
961
- // ^-- not valid because ** doens't follow symlinks
962
- secondPhasePreProcess(e) {
963
- for (let s = 0; s < e.length - 1; s++)
964
- for (let r = s + 1; r < e.length; r++) {
965
- const n = this.partsMatch(e[s], e[r], !this.preserveMultipleSlashes);
966
- n && (e[s] = n, e[r] = []);
967
- }
968
- return e.filter((s) => s.length);
969
- }
970
- partsMatch(e, s, r = !1) {
971
- let n = 0, i = 0, a = [], o = "";
972
- for (; n < e.length && i < s.length; )
973
- if (e[n] === s[i])
974
- a.push(o === "b" ? s[i] : e[n]), n++, i++;
975
- else if (r && e[n] === "**" && s[i] === e[n + 1])
976
- a.push(e[n]), n++;
977
- else if (r && s[i] === "**" && e[n] === s[i + 1])
978
- a.push(s[i]), i++;
979
- else if (e[n] === "*" && s[i] && (this.options.dot || !s[i].startsWith(".")) && s[i] !== "**") {
980
- if (o === "b")
981
- return !1;
982
- o = "a", a.push(e[n]), n++, i++;
983
- } else if (s[i] === "*" && e[n] && (this.options.dot || !e[n].startsWith(".")) && e[n] !== "**") {
984
- if (o === "a")
985
- return !1;
986
- o = "b", a.push(s[i]), n++, i++;
987
- } else
988
- return !1;
989
- return e.length === s.length && a;
990
- }
991
- parseNegate() {
992
- if (this.nonegate)
993
- return;
994
- const e = this.pattern;
995
- let s = !1, r = 0;
996
- for (let n = 0; n < e.length && e.charAt(n) === "!"; n++)
997
- s = !s, r++;
998
- r && (this.pattern = e.slice(r)), this.negate = s;
999
- }
1000
- // set partial to true to test if, for example,
1001
- // "/a/b" matches the start of "/*/b/*/d"
1002
- // Partial means, if you run out of file before you run
1003
- // out of pattern, then that's fine, as long as all
1004
- // the parts match.
1005
- matchOne(e, s, r = !1) {
1006
- const n = this.options;
1007
- if (this.isWindows) {
1008
- const p = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), y = !p && e[0] === "" && e[1] === "" && e[2] === "?" && /^[a-z]:$/i.test(e[3]), E = typeof s[0] == "string" && /^[a-z]:$/i.test(s[0]), $ = !E && s[0] === "" && s[1] === "" && s[2] === "?" && typeof s[3] == "string" && /^[a-z]:$/i.test(s[3]), w = y ? 3 : p ? 0 : void 0, b = $ ? 3 : E ? 0 : void 0;
1009
- if (typeof w == "number" && typeof b == "number") {
1010
- const [m, D] = [e[w], s[b]];
1011
- m.toLowerCase() === D.toLowerCase() && (s[b] = m, b > w ? s = s.slice(b) : w > b && (e = e.slice(w)));
1012
- }
1013
- }
1014
- const { optimizationLevel: i = 1 } = this.options;
1015
- i >= 2 && (e = this.levelTwoFileOptimize(e)), this.debug("matchOne", this, { file: e, pattern: s }), this.debug("matchOne", e.length, s.length);
1016
- for (var a = 0, o = 0, l = e.length, h = s.length; a < l && o < h; a++, o++) {
1017
- this.debug("matchOne loop");
1018
- var c = s[o], u = e[a];
1019
- if (this.debug(s, c, u), c === !1)
1020
- return !1;
1021
- if (c === Y) {
1022
- this.debug("GLOBSTAR", [s, c, u]);
1023
- var d = a, g = o + 1;
1024
- if (g === h) {
1025
- for (this.debug("** at the end"); a < l; a++)
1026
- if (e[a] === "." || e[a] === ".." || !n.dot && e[a].charAt(0) === ".")
1027
- return !1;
1028
- return !0;
1029
- }
1030
- for (; d < l; ) {
1031
- var f = e[d];
1032
- if (this.debug(`
1033
- globstar while`, e, d, s, g, f), this.matchOne(e.slice(d), s.slice(g), r))
1034
- return this.debug("globstar found match!", d, l, f), !0;
1035
- if (f === "." || f === ".." || !n.dot && f.charAt(0) === ".") {
1036
- this.debug("dot detected!", e, d, s, g);
1037
- break;
1038
- }
1039
- this.debug("globstar swallow a segment, and continue"), d++;
1040
- }
1041
- return !!(r && (this.debug(`
1042
- >>> no match, partial?`, e, d, s, g), d === l));
1043
- }
1044
- let p;
1045
- if (typeof c == "string" ? (p = u === c, this.debug("string match", c, u, p)) : (p = c.test(u), this.debug("pattern match", c, u, p)), !p)
1046
- return !1;
1047
- }
1048
- if (a === l && o === h)
1049
- return !0;
1050
- if (a === l)
1051
- return r;
1052
- if (o === h)
1053
- return a === l - 1 && e[a] === "";
1054
- throw new Error("wtf?");
1055
- }
1056
- braceExpand() {
1057
- return cs(this.pattern, this.options);
1058
- }
1059
- parse(e) {
1060
- Ve(e);
1061
- const s = this.options;
1062
- if (e === "**")
1063
- return Y;
1064
- if (e === "")
1065
- return "";
1066
- let r, n = null;
1067
- (r = e.match(xr)) ? n = s.dot ? Tr : Or : (r = e.match(dr)) ? n = (s.nocase ? s.dot ? mr : _r : s.dot ? vr : $r)(r[1]) : (r = e.match(Ar)) ? n = (s.nocase ? s.dot ? Nr : Rr : s.dot ? Lr : Mr)(r) : (r = e.match(yr)) ? n = s.dot ? wr : Er : (r = e.match(br)) && (n = Sr);
1068
- const i = is.fromGlob(e, this.options).toMMPattern();
1069
- return n && typeof i == "object" && Reflect.defineProperty(i, "test", { value: n }), i;
1070
- }
1071
- makeRe() {
1072
- if (this.regexp || this.regexp === !1)
1073
- return this.regexp;
1074
- const e = this.set;
1075
- if (!e.length)
1076
- return this.regexp = !1, this.regexp;
1077
- const s = this.options, r = s.noglobstar ? jr : s.dot ? Pr : Dr, n = new Set(s.nocase ? ["i"] : []);
1078
- let i = e.map((l) => {
1079
- const h = l.map((c) => {
1080
- if (c instanceof RegExp)
1081
- for (const u of c.flags.split(""))
1082
- n.add(u);
1083
- return typeof c == "string" ? Hr(c) : c === Y ? Y : c._src;
1084
- });
1085
- return h.forEach((c, u) => {
1086
- const d = h[u + 1], g = h[u - 1];
1087
- c !== Y || g === Y || (g === void 0 ? d !== void 0 && d !== Y ? h[u + 1] = "(?:\\/|" + r + "\\/)?" + d : h[u] = r : d === void 0 ? h[u - 1] = g + "(?:\\/|" + r + ")?" : d !== Y && (h[u - 1] = g + "(?:\\/|\\/" + r + "\\/)" + d, h[u + 1] = Y));
1088
- }), h.filter((c) => c !== Y).join("/");
1089
- }).join("|");
1090
- const [a, o] = e.length > 1 ? ["(?:", ")"] : ["", ""];
1091
- i = "^" + a + i + o + "$", this.negate && (i = "^(?!" + i + ").+$");
1092
- try {
1093
- this.regexp = new RegExp(i, [...n].join(""));
1094
- } catch {
1095
- this.regexp = !1;
1096
- }
1097
- return this.regexp;
1098
- }
1099
- slashSplit(e) {
1100
- return this.preserveMultipleSlashes ? e.split("/") : this.isWindows && /^\/\/[^\/]+/.test(e) ? ["", ...e.split(/\/+/)] : e.split(/\/+/);
1101
- }
1102
- match(e, s = this.partial) {
1103
- if (this.debug("match", e, this.pattern), this.comment)
1104
- return !1;
1105
- if (this.empty)
1106
- return e === "";
1107
- if (e === "/" && s)
1108
- return !0;
1109
- const r = this.options;
1110
- this.isWindows && (e = e.split("\\").join("/"));
1111
- const n = this.slashSplit(e);
1112
- this.debug(this.pattern, "split", n);
1113
- const i = this.set;
1114
- this.debug(this.pattern, "set", i);
1115
- let a = n[n.length - 1];
1116
- if (!a)
1117
- for (let o = n.length - 2; !a && o >= 0; o--)
1118
- a = n[o];
1119
- for (let o = 0; o < i.length; o++) {
1120
- const l = i[o];
1121
- let h = n;
1122
- if (r.matchBase && l.length === 1 && (h = [a]), this.matchOne(h, l, s))
1123
- return r.flipNegate ? !0 : !this.negate;
1124
- }
1125
- return r.flipNegate ? !1 : this.negate;
1126
- }
1127
- static defaults(e) {
1128
- return H.defaults(e).Minimatch;
1129
- }
1130
- };
1131
- H.AST = is;
1132
- H.Minimatch = lt;
1133
- H.escape = gr;
1134
- H.unescape = We;
1135
- var Fr = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Br = {};
1136
- Ks(Br, {
1137
- err: () => hs,
1138
- map: () => Ur,
1139
- ok: () => $t,
1140
- unwrap: () => Zr,
1141
- unwrapErr: () => qr
1142
- });
1143
- var $t = (t) => ({
1144
- isOk: !0,
1145
- isErr: !1,
1146
- value: t
1147
- }), hs = (t) => ({
1148
- isOk: !1,
1149
- isErr: !0,
1150
- value: t
1151
- });
1152
- function Ur(t, e) {
1153
- if (t.isOk) {
1154
- const s = e(t.value);
1155
- return s instanceof Promise ? s.then((r) => $t(r)) : $t(s);
1156
- }
1157
- if (t.isErr) {
1158
- const s = t.value;
1159
- return hs(s);
1160
- }
1161
- throw "should never get here";
245
+ function E(e, t, n) {
246
+ let r = 0, i = [], a;
247
+ for (; r < e.length; r++) {
248
+ if (a = e[r], a["s-sr"] && (!t || a["s-hn"] === t) && (n === void 0 || D(a) === n) && (i.push(a), n !== void 0)) return i;
249
+ i = [...i, ...E(a.childNodes, t, n)];
250
+ }
251
+ return i;
1162
252
  }
1163
- var Zr = (t) => {
1164
- if (t.isOk)
1165
- return t.value;
1166
- throw t.value;
1167
- }, qr = (t) => {
1168
- if (t.isErr)
1169
- return t.value;
1170
- throw t.value;
1171
- }, xt = (t) => {
1172
- const e = Fr(t);
1173
- return new RegExp(
1174
- // First capture group: match any context before the selector that's not inside @supports selector()
1175
- // Using negative lookahead to avoid matching inside @supports selector(...) condition
1176
- `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,
1177
- "g"
1178
- );
1179
- };
1180
- xt("::slotted");
1181
- xt(":host");
1182
- xt(":host-context");
1183
- const us = (t, e) => {
1184
- if (!e)
1185
- return;
1186
- const s = e.split("/");
1187
- return `${t}${s.slice(2, s.length - 1).join("-")}--docs`;
1188
- }, Jr = (t, e) => {
1189
- if (e)
1190
- return `${t}${e}`;
1191
- }, fs = (t) => {
1192
- let e = t.overview ? `${t.overview}
1193
-
1194
- ` : "";
1195
- const s = t.props.filter(({ attr: n }) => n !== void 0);
1196
- s.length && (e += `Attributes:
1197
- `, e += s.map(({ attr: n, docs: i }) => `- \`${n}\`: ${i}
1198
- `).join(""), e += `
1199
- `);
1200
- const r = t.props.filter(({ attr: n }) => n === void 0);
1201
- return r.length && (e += `Properties:
1202
- `, e += r.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
1203
- `).join(""), e += `
1204
- `), t.methods.length && (e += `Methods:
1205
- `, e += t.methods.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
1206
- `).join(""), e += `
1207
- `), t.events.length && (e += `Events:
1208
- `, e += t.events.map(({ event: n, docs: i }) => `- \`${n}\`: ${i}
1209
- `).join(""), e += `
1210
- `), t.listeners.length && (e += `Listeners:
1211
- `, e += t.listeners.map(({ event: n }) => `- \`${n}\`
1212
- `).join(""), e += `
1213
- `), t.slots.length && (e += `Slots:
1214
- `, e += t.slots.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
1215
- `).join(""), e += `
1216
- `), e;
1217
- }, vt = (t) => `${t.docs}
1218
-
1219
- Type: \`${t.type}\``, ra = (t, e, s, r) => ({
1220
- $schema: "https://json.schemastore.org/web-types",
1221
- name: t,
1222
- version: e,
1223
- "description-markup": "markdown",
1224
- contributions: {
1225
- html: {
1226
- elements: s.components.map((n) => {
1227
- const i = us(r, n.filePath);
1228
- return {
1229
- name: n.tag,
1230
- description: fs(n),
1231
- "doc-url": i,
1232
- attributes: n.props.filter((a) => a.attr).map((a) => ({
1233
- name: a.attr,
1234
- description: vt(a),
1235
- "doc-url": i,
1236
- value: {
1237
- type: a.type,
1238
- default: a.default,
1239
- required: a.required
1240
- }
1241
- })),
1242
- js: {
1243
- properties: n.props.map((a) => ({
1244
- name: a.name,
1245
- description: vt(a),
1246
- "doc-url": i,
1247
- value: {
1248
- type: a.type,
1249
- default: a.default,
1250
- required: a.required
1251
- }
1252
- })),
1253
- events: n.events.map((a) => ({
1254
- name: a.event,
1255
- description: a.docs
1256
- }))
1257
- },
1258
- css: {
1259
- properties: n.styles.map((a) => ({
1260
- name: a.name,
1261
- description: a.docs
1262
- }))
1263
- }
1264
- };
1265
- })
1266
- }
1267
- }
1268
- }), Xr = (t, e, s) => [
1269
- { name: "Storybook", url: us(t, s) },
1270
- { name: "Sources", url: Jr(e, s) }
1271
- ], Yr = (t) => {
1272
- if (!t.values.some(({ value: e }) => e === void 0))
1273
- return t.values.map(({ value: e }) => ({ name: e }));
1274
- }, na = (t, e, s) => ({
1275
- version: 1.1,
1276
- tags: t.components.map((r) => {
1277
- const n = Xr(e, s, r.filePath);
1278
- return {
1279
- name: r.tag,
1280
- description: fs(r),
1281
- attributes: r.props.map((i) => ({
1282
- name: i.attr ?? i.name,
1283
- description: vt(i),
1284
- values: Yr(i),
1285
- references: n
1286
- })),
1287
- references: n
1288
- };
1289
- }),
1290
- globalAttributes: [],
1291
- valueSets: []
1292
- }), ia = (t) => ({
1293
- version: 1.1,
1294
- properties: t.components.flatMap((e) => e.styles.map((s) => ({
1295
- name: s.name,
1296
- description: s.docs
1297
- })))
1298
- }), Kr = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, aa = (t) => {
1299
- const e = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
1300
- return Vr([e.value, s.value, r.value].join("-"), t, { timeZone: "UTC" }).replace(e.value, e.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
1301
- }, Qr = (t, e, s) => {
1302
- const r = t.closest("[lang]"), n = Intl.NumberFormat.supportedLocalesOf(r?.lang), i = n.length > 0 && typeof n[0] == "string" ? n[0] : navigator.language || s, a = i.split("-").shift();
1303
- return Object.keys(e).length === 0 ? {
1304
- locale: i,
1305
- messages: { lang: s }
1306
- } : {
1307
- locale: i,
1308
- messages: e[a] ?? e[s] ?? { lang: s }
1309
- };
1310
- }, oa = (t, e, s) => new Intl.NumberFormat(e, { style: "currency", currency: s }).format(t), la = (t, e, s = 0) => new Intl.NumberFormat(e, { minimumFractionDigits: s }).format(Number(t)), ca = (t, e, s = 0) => new Intl.NumberFormat(e, {
1311
- style: "percent",
1312
- minimumFractionDigits: s,
1313
- maximumFractionDigits: s
1314
- }).format(t), ha = (t, e, s, r = "short", n = 0) => new Intl.NumberFormat(e, {
1315
- style: "unit",
1316
- unit: s,
1317
- unitDisplay: r,
1318
- minimumFractionDigits: n,
1319
- maximumFractionDigits: n
1320
- }).format(t), Vr = (t, e, s) => typeof t != "string" || t === "" || !Kr.test(t) ? "" : new Intl.DateTimeFormat(e, s).format(new Date(t)), ua = (t, e) => (s) => Qr(s, t, e);
1321
- var He = {
1322
- updatable: !0,
1323
- slotRelocation: !0,
1324
- // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
1325
- experimentalSlotFixes: !1
1326
- }, en = Object.create, ct = Object.defineProperty, tn = Object.getOwnPropertyDescriptor, ps = Object.getOwnPropertyNames, sn = Object.getPrototypeOf, rn = Object.prototype.hasOwnProperty, gs = (t) => {
1327
- throw TypeError(t);
1328
- }, nn = (t, e, s) => e in t ? ct(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, ds = (t, e) => function() {
1329
- return e || (0, t[ps(t)[0]])((e = { exports: {} }).exports, e), e.exports;
1330
- }, an = (t, e) => {
1331
- for (var s in e)
1332
- ct(t, s, { get: e[s], enumerable: !0 });
1333
- }, on = (t, e, s, r) => {
1334
- if (e && typeof e == "object" || typeof e == "function")
1335
- for (let n of ps(e))
1336
- !rn.call(t, n) && n !== s && ct(t, n, { get: () => e[n], enumerable: !(r = tn(e, n)) || r.enumerable });
1337
- return t;
1338
- }, ln = (t, e, s) => (s = t != null ? en(sn(t)) : {}, on(
1339
- // If the importer is in node compatibility mode or this is not an ESM
1340
- // file that has been converted to a CommonJS file using a Babel-
1341
- // compatible transform (i.e. "__esModule" has not been set), then set
1342
- // "default" to the CommonJS "module.exports" for node compatibility.
1343
- ct(s, "default", { value: t, enumerable: !0 }),
1344
- t
1345
- )), cn = (t, e, s) => nn(t, e + "", s), Ot = (t, e, s) => e.has(t) || gs("Cannot " + s), _ = (t, e, s) => (Ot(t, e, "read from private field"), s ? s.call(t) : e.get(t)), q = (t, e, s) => e.has(t) ? gs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), N = (t, e, s, r) => (Ot(t, e, "write to private field"), e.set(t, s), s), pe = (t, e, s) => (Ot(t, e, "access private method"), s), hn = ds({
1346
- "node_modules/balanced-match/index.js"(t, e) {
1347
- e.exports = s;
1348
- function s(i, a, o) {
1349
- i instanceof RegExp && (i = r(i, o)), a instanceof RegExp && (a = r(a, o));
1350
- var l = n(i, a, o);
1351
- return l && {
1352
- start: l[0],
1353
- end: l[1],
1354
- pre: o.slice(0, l[0]),
1355
- body: o.slice(l[0] + i.length, l[1]),
1356
- post: o.slice(l[1] + a.length)
1357
- };
1358
- }
1359
- function r(i, a) {
1360
- var o = a.match(i);
1361
- return o ? o[0] : null;
1362
- }
1363
- s.range = n;
1364
- function n(i, a, o) {
1365
- var l, h, c, u, d, g = o.indexOf(i), f = o.indexOf(a, g + 1), p = g;
1366
- if (g >= 0 && f > 0) {
1367
- if (i === a)
1368
- return [g, f];
1369
- for (l = [], c = o.length; p >= 0 && !d; )
1370
- p == g ? (l.push(p), g = o.indexOf(i, p + 1)) : l.length == 1 ? d = [l.pop(), f] : (h = l.pop(), h < c && (c = h, u = f), f = o.indexOf(a, p + 1)), p = g < f && g >= 0 ? g : f;
1371
- l.length && (d = [c, u]);
1372
- }
1373
- return d;
1374
- }
1375
- }
1376
- }), un = ds({
1377
- "node_modules/brace-expansion/index.js"(t, e) {
1378
- var s = hn();
1379
- e.exports = d;
1380
- var r = "\0SLASH" + Math.random() + "\0", n = "\0OPEN" + Math.random() + "\0", i = "\0CLOSE" + Math.random() + "\0", a = "\0COMMA" + Math.random() + "\0", o = "\0PERIOD" + Math.random() + "\0";
1381
- function l($) {
1382
- return parseInt($, 10) == $ ? parseInt($, 10) : $.charCodeAt(0);
1383
- }
1384
- function h($) {
1385
- return $.split("\\\\").join(r).split("\\{").join(n).split("\\}").join(i).split("\\,").join(a).split("\\.").join(o);
1386
- }
1387
- function c($) {
1388
- return $.split(r).join("\\").split(n).join("{").split(i).join("}").split(a).join(",").split(o).join(".");
1389
- }
1390
- function u($) {
1391
- if (!$)
1392
- return [""];
1393
- var w = [], b = s("{", "}", $);
1394
- if (!b)
1395
- return $.split(",");
1396
- var m = b.pre, D = b.body, L = b.post, x = m.split(",");
1397
- x[x.length - 1] += "{" + D + "}";
1398
- var M = u(L);
1399
- return L.length && (x[x.length - 1] += M.shift(), x.push.apply(x, M)), w.push.apply(w, x), w;
1400
- }
1401
- function d($) {
1402
- return $ ? ($.substr(0, 2) === "{}" && ($ = "\\{\\}" + $.substr(2)), E(h($), !0).map(c)) : [];
1403
- }
1404
- function g($) {
1405
- return "{" + $ + "}";
1406
- }
1407
- function f($) {
1408
- return /^-?0\d/.test($);
1409
- }
1410
- function p($, w) {
1411
- return $ <= w;
1412
- }
1413
- function y($, w) {
1414
- return $ >= w;
1415
- }
1416
- function E($, w) {
1417
- var b = [], m = s("{", "}", $);
1418
- if (!m) return [$];
1419
- var D = m.pre, L = m.post.length ? E(m.post, !1) : [""];
1420
- if (/\$$/.test(m.pre))
1421
- for (var x = 0; x < L.length; x++) {
1422
- var M = D + "{" + m.body + "}" + L[x];
1423
- b.push(M);
1424
- }
1425
- else {
1426
- var me = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body), oe = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body), Q = me || oe, Ae = m.body.indexOf(",") >= 0;
1427
- if (!Q && !Ae)
1428
- return m.post.match(/,(?!,).*\}/) ? ($ = m.pre + "{" + m.body + i + m.post, E($)) : [$];
1429
- var S;
1430
- if (Q)
1431
- S = m.body.split(/\.\./);
1432
- else if (S = u(m.body), S.length === 1 && (S = E(S[0], !1).map(g), S.length === 1))
1433
- return L.map(function(gt) {
1434
- return m.pre + S[0] + gt;
1435
- });
1436
- var I;
1437
- if (Q) {
1438
- var le = l(S[0]), Re = l(S[1]), ut = Math.max(S[0].length, S[1].length), Ne = S.length == 3 ? Math.abs(l(S[2])) : 1, Le = p, ft = Re < le;
1439
- ft && (Ne *= -1, Le = y);
1440
- var pt = S.some(f);
1441
- I = [];
1442
- for (var V = le; Le(V, Re); V += Ne) {
1443
- var A;
1444
- if (oe)
1445
- A = String.fromCharCode(V), A === "\\" && (A = "");
1446
- else if (A = String(V), pt) {
1447
- var Me = ut - A.length;
1448
- if (Me > 0) {
1449
- var ke = new Array(Me + 1).join("0");
1450
- V < 0 ? A = "-" + ke + A.slice(1) : A = ke + A;
1451
- }
1452
- }
1453
- I.push(A);
1454
- }
1455
- } else {
1456
- I = [];
1457
- for (var G = 0; G < S.length; G++)
1458
- I.push.apply(I, E(S[G], !1));
1459
- }
1460
- for (var G = 0; G < I.length; G++)
1461
- for (var x = 0; x < L.length; x++) {
1462
- var M = D + I[G] + L[x];
1463
- (!w || Q || M) && b.push(M);
1464
- }
1465
- }
1466
- return b;
1467
- }
1468
- }
1469
- }), fn = "http://www.w3.org/2000/svg", pn = "http://www.w3.org/1999/xhtml", jt = (t, e) => e in t, Pt = "http://www.w3.org/1999/xlink", $e = typeof window < "u" ? window : {}, Oe = {
1470
- $flags$: 0,
1471
- $resourcesUrl$: "",
1472
- jmp: (t) => t(),
1473
- raf: (t) => requestAnimationFrame(t),
1474
- ael: (t, e, s, r) => t.addEventListener(e, s, r),
1475
- rel: (t, e, s, r) => t.removeEventListener(e, s, r),
1476
- ce: (t, e) => new CustomEvent(t, e)
1477
- }, gn = (t) => t != null && t !== void 0, $s = (t) => (t = typeof t, t === "object" || t === "function"), dn = ln(un()), $n = 1024 * 64, tt = (t) => {
1478
- if (typeof t != "string")
1479
- throw new TypeError("invalid pattern");
1480
- if (t.length > $n)
1481
- throw new TypeError("pattern is too long");
1482
- }, vn = {
1483
- "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
1484
- "[:alpha:]": ["\\p{L}\\p{Nl}", !0],
1485
- "[:ascii:]": ["\\x00-\\x7f", !1],
1486
- "[:blank:]": ["\\p{Zs}\\t", !0],
1487
- "[:cntrl:]": ["\\p{Cc}", !0],
1488
- "[:digit:]": ["\\p{Nd}", !0],
1489
- "[:graph:]": ["\\p{Z}\\p{C}", !0, !0],
1490
- "[:lower:]": ["\\p{Ll}", !0],
1491
- "[:print:]": ["\\p{C}", !0],
1492
- "[:punct:]": ["\\p{P}", !0],
1493
- "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0],
1494
- "[:upper:]": ["\\p{Lu}", !0],
1495
- "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
1496
- "[:xdigit:]": ["A-Fa-f0-9", !1]
1497
- }, je = (t) => t.replace(/[[\]\\-]/g, "\\$&"), _n = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Dt = (t) => t.join(""), mn = (t, e) => {
1498
- const s = e;
1499
- if (t.charAt(s) !== "[")
1500
- throw new Error("not in a brace expression");
1501
- const r = [], n = [];
1502
- let i = s + 1, a = !1, o = !1, l = !1, h = !1, c = s, u = "";
1503
- e: for (; i < t.length; ) {
1504
- const p = t.charAt(i);
1505
- if ((p === "!" || p === "^") && i === s + 1) {
1506
- h = !0, i++;
1507
- continue;
1508
- }
1509
- if (p === "]" && a && !l) {
1510
- c = i + 1;
1511
- break;
1512
- }
1513
- if (a = !0, p === "\\" && !l) {
1514
- l = !0, i++;
1515
- continue;
1516
- }
1517
- if (p === "[" && !l) {
1518
- for (const [y, [E, $, w]] of Object.entries(vn))
1519
- if (t.startsWith(y, i)) {
1520
- if (u)
1521
- return ["$.", !1, t.length - s, !0];
1522
- i += y.length, w ? n.push(E) : r.push(E), o = o || $;
1523
- continue e;
1524
- }
1525
- }
1526
- if (l = !1, u) {
1527
- p > u ? r.push(je(u) + "-" + je(p)) : p === u && r.push(je(p)), u = "", i++;
1528
- continue;
1529
- }
1530
- if (t.startsWith("-]", i + 1)) {
1531
- r.push(je(p + "-")), i += 2;
1532
- continue;
1533
- }
1534
- if (t.startsWith("-", i + 1)) {
1535
- u = p, i += 2;
1536
- continue;
1537
- }
1538
- r.push(je(p)), i++;
1539
- }
1540
- if (c < i)
1541
- return ["", !1, 0, !1];
1542
- if (!r.length && !n.length)
1543
- return ["$.", !1, t.length - s, !0];
1544
- if (n.length === 0 && r.length === 1 && /^\\?.$/.test(r[0]) && !h) {
1545
- const p = r[0].length === 2 ? r[0].slice(-1) : r[0];
1546
- return [_n(p), !1, c - s, !1];
1547
- }
1548
- const d = "[" + (h ? "^" : "") + Dt(r) + "]", g = "[" + (h ? "" : "^") + Dt(n) + "]";
1549
- return [r.length && n.length ? "(" + d + "|" + g + ")" : r.length ? d : g, o, c - s, !0];
1550
- }, ze = (t, { windowsPathsNoEscape: e = !1 } = {}) => e ? t.replace(/\[([^\/\\])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), yn = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), It = (t) => yn.has(t), En = "(?!(?:^|/)\\.\\.?(?:$|/))", Je = "(?!\\.)", wn = /* @__PURE__ */ new Set(["[", "."]), bn = /* @__PURE__ */ new Set(["..", "."]), Sn = new Set("().*{}+?[]^$\\!"), xn = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Tt = "[^/]", vs = Tt + "*?", _s = Tt + "+?", P, z, ae, T, C, ge, Se, ve, te, Ee, st, De, ms, Te, Ke, _t, ys, ne = class he {
1551
- constructor(e, s, r = {}) {
1552
- q(this, De), cn(this, "type"), q(this, P), q(this, z), q(this, ae, !1), q(this, T, []), q(this, C), q(this, ge), q(this, Se), q(this, ve, !1), q(this, te), q(this, Ee), q(this, st, !1), this.type = e, e && N(this, z, !0), N(this, C, s), N(this, P, _(this, C) ? _(_(this, C), P) : this), N(this, te, _(this, P) === this ? r : _(_(this, P), te)), N(this, Se, _(this, P) === this ? [] : _(_(this, P), Se)), e === "!" && !_(_(this, P), ve) && _(this, Se).push(this), N(this, ge, _(this, C) ? _(_(this, C), T).length : 0);
1553
- }
1554
- get hasMagic() {
1555
- if (_(this, z) !== void 0)
1556
- return _(this, z);
1557
- for (const e of _(this, T))
1558
- if (typeof e != "string" && (e.type || e.hasMagic))
1559
- return N(this, z, !0);
1560
- return _(this, z);
1561
- }
1562
- // reconstructs the pattern
1563
- toString() {
1564
- return _(this, Ee) !== void 0 ? _(this, Ee) : this.type ? N(this, Ee, this.type + "(" + _(this, T).map((e) => String(e)).join("|") + ")") : N(this, Ee, _(this, T).map((e) => String(e)).join(""));
1565
- }
1566
- push(...e) {
1567
- for (const s of e)
1568
- if (s !== "") {
1569
- if (typeof s != "string" && !(s instanceof he && _(s, C) === this))
1570
- throw new Error("invalid part: " + s);
1571
- _(this, T).push(s);
1572
- }
1573
- }
1574
- toJSON() {
1575
- var e;
1576
- const s = this.type === null ? _(this, T).slice().map((r) => typeof r == "string" ? r : r.toJSON()) : [this.type, ..._(this, T).map((r) => r.toJSON())];
1577
- return this.isStart() && !this.type && s.unshift([]), this.isEnd() && (this === _(this, P) || _(_(this, P), ve) && ((e = _(this, C)) == null ? void 0 : e.type) === "!") && s.push({}), s;
1578
- }
1579
- isStart() {
1580
- var e;
1581
- if (_(this, P) === this)
1582
- return !0;
1583
- if (!((e = _(this, C)) != null && e.isStart()))
1584
- return !1;
1585
- if (_(this, ge) === 0)
1586
- return !0;
1587
- const s = _(this, C);
1588
- for (let r = 0; r < _(this, ge); r++) {
1589
- const n = _(s, T)[r];
1590
- if (!(n instanceof he && n.type === "!"))
1591
- return !1;
1592
- }
1593
- return !0;
1594
- }
1595
- isEnd() {
1596
- var e, s, r;
1597
- if (_(this, P) === this || ((e = _(this, C)) == null ? void 0 : e.type) === "!")
1598
- return !0;
1599
- if (!((s = _(this, C)) != null && s.isEnd()))
1600
- return !1;
1601
- if (!this.type)
1602
- return (r = _(this, C)) == null ? void 0 : r.isEnd();
1603
- const n = _(this, C) ? _(_(this, C), T).length : 0;
1604
- return _(this, ge) === n - 1;
1605
- }
1606
- copyIn(e) {
1607
- typeof e == "string" ? this.push(e) : this.push(e.clone(this));
1608
- }
1609
- clone(e) {
1610
- const s = new he(this.type, e);
1611
- for (const r of _(this, T))
1612
- s.copyIn(r);
1613
- return s;
1614
- }
1615
- static fromGlob(e, s = {}) {
1616
- var r;
1617
- const n = new he(null, void 0, s);
1618
- return pe(r = he, Te, Ke).call(r, e, n, 0, s), n;
1619
- }
1620
- // returns the regular expression if there's magic, or the unescaped
1621
- // string if not.
1622
- toMMPattern() {
1623
- if (this !== _(this, P))
1624
- return _(this, P).toMMPattern();
1625
- const e = this.toString(), [s, r, n, i] = this.toRegExpSource();
1626
- if (!(n || _(this, z) || _(this, te).nocase && !_(this, te).nocaseMagicOnly && e.toUpperCase() !== e.toLowerCase()))
1627
- return r;
1628
- const o = (_(this, te).nocase ? "i" : "") + (i ? "u" : "");
1629
- return Object.assign(new RegExp(`^${s}$`, o), {
1630
- _src: s,
1631
- _glob: e
1632
- });
1633
- }
1634
- get options() {
1635
- return _(this, te);
1636
- }
1637
- // returns the string match, the regexp source, whether there's magic
1638
- // in the regexp (so a regular expression is required) and whether or
1639
- // not the uflag is needed for the regular expression (for posix classes)
1640
- // TODO: instead of injecting the start/end at this point, just return
1641
- // the BODY of the regexp, along with the start/end portions suitable
1642
- // for binding the start/end in either a joined full-path makeRe context
1643
- // (where we bind to (^|/), or a standalone matchPart context (where
1644
- // we bind to ^, and not /). Otherwise slashes get duped!
1645
- //
1646
- // In part-matching mode, the start is:
1647
- // - if not isStart: nothing
1648
- // - if traversal possible, but not allowed: ^(?!\.\.?$)
1649
- // - if dots allowed or not possible: ^
1650
- // - if dots possible and not allowed: ^(?!\.)
1651
- // end is:
1652
- // - if not isEnd(): nothing
1653
- // - else: $
1654
- //
1655
- // In full-path matching mode, we put the slash at the START of the
1656
- // pattern, so start is:
1657
- // - if first pattern: same as part-matching mode
1658
- // - if not isStart(): nothing
1659
- // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
1660
- // - if dots allowed or not possible: /
1661
- // - if dots possible and not allowed: /(?!\.)
1662
- // end is:
1663
- // - if last pattern, same as part-matching mode
1664
- // - else nothing
1665
- //
1666
- // Always put the (?:$|/) on negated tails, though, because that has to be
1667
- // there to bind the end of the negated pattern portion, and it's easier to
1668
- // just stick it in now rather than try to inject it later in the middle of
1669
- // the pattern.
1670
- //
1671
- // We can just always return the same end, and leave it up to the caller
1672
- // to know whether it's going to be used joined or in parts.
1673
- // And, if the start is adjusted slightly, can do the same there:
1674
- // - if not isStart: nothing
1675
- // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
1676
- // - if dots allowed or not possible: (?:/|^)
1677
- // - if dots possible and not allowed: (?:/|^)(?!\.)
1678
- //
1679
- // But it's better to have a simpler binding without a conditional, for
1680
- // performance, so probably better to return both start options.
1681
- //
1682
- // Then the caller just ignores the end if it's not the first pattern,
1683
- // and the start always gets applied.
1684
- //
1685
- // But that's always going to be $ if it's the ending pattern, or nothing,
1686
- // so the caller can just attach $ at the end of the pattern when building.
1687
- //
1688
- // So the todo is:
1689
- // - better detect what kind of start is needed
1690
- // - return both flavors of starting pattern
1691
- // - attach $ at the end of the pattern when creating the actual RegExp
1692
- //
1693
- // Ah, but wait, no, that all only applies to the root when the first pattern
1694
- // is not an extglob. If the first pattern IS an extglob, then we need all
1695
- // that dot prevention biz to live in the extglob portions, because eg
1696
- // +(*|.x*) can match .xy but not .yx.
1697
- //
1698
- // So, return the two flavors if it's #root and the first child is not an
1699
- // AST, otherwise leave it to the child AST to handle it, and there,
1700
- // use the (?:^|/) style of start binding.
1701
- //
1702
- // Even simplified further:
1703
- // - Since the start for a join is eg /(?!\.) and the start for a part
1704
- // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
1705
- // or start or whatever) and prepend ^ or / at the Regexp construction.
1706
- toRegExpSource(e) {
1707
- var s;
1708
- const r = e ?? !!_(this, te).dot;
1709
- if (_(this, P) === this && pe(this, De, ms).call(this), !this.type) {
1710
- const h = this.isStart() && this.isEnd(), c = _(this, T).map((f) => {
1711
- var p;
1712
- const [y, E, $, w] = typeof f == "string" ? pe(p = he, Te, ys).call(p, f, _(this, z), h) : f.toRegExpSource(e);
1713
- return N(this, z, _(this, z) || $), N(this, ae, _(this, ae) || w), y;
1714
- }).join("");
1715
- let u = "";
1716
- if (this.isStart() && typeof _(this, T)[0] == "string" && !(_(this, T).length === 1 && bn.has(_(this, T)[0]))) {
1717
- const p = wn, y = (
1718
- // dots are allowed, and the pattern starts with [ or .
1719
- r && p.has(c.charAt(0)) || // the pattern starts with \., and then [ or .
1720
- c.startsWith("\\.") && p.has(c.charAt(2)) || // the pattern starts with \.\., and then [ or .
1721
- c.startsWith("\\.\\.") && p.has(c.charAt(4))
1722
- ), E = !r && !e && p.has(c.charAt(0));
1723
- u = y ? En : E ? Je : "";
1724
- }
1725
- let d = "";
1726
- return this.isEnd() && _(_(this, P), ve) && ((s = _(this, C)) == null ? void 0 : s.type) === "!" && (d = "(?:$|\\/)"), [
1727
- u + c + d,
1728
- ze(c),
1729
- N(this, z, !!_(this, z)),
1730
- _(this, ae)
1731
- ];
1732
- }
1733
- const n = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:";
1734
- let a = pe(this, De, _t).call(this, r);
1735
- if (this.isStart() && this.isEnd() && !a && this.type !== "!") {
1736
- const h = this.toString();
1737
- return N(this, T, [h]), this.type = null, N(this, z, void 0), [h, ze(this.toString()), !1, !1];
1738
- }
1739
- let o = !n || e || r || !Je ? "" : pe(this, De, _t).call(this, !0);
1740
- o === a && (o = ""), o && (a = `(?:${a})(?:${o})*?`);
1741
- let l = "";
1742
- if (this.type === "!" && _(this, st))
1743
- l = (this.isStart() && !r ? Je : "") + _s;
1744
- else {
1745
- const h = this.type === "!" ? (
1746
- // !() must match something,but !(x) can match ''
1747
- "))" + (this.isStart() && !r && !e ? Je : "") + vs + ")"
1748
- ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o ? ")" : this.type === "*" && o ? ")?" : `)${this.type}`;
1749
- l = i + a + h;
1750
- }
1751
- return [
1752
- l,
1753
- ze(a),
1754
- N(this, z, !!_(this, z)),
1755
- _(this, ae)
1756
- ];
1757
- }
1758
- };
1759
- P = /* @__PURE__ */ new WeakMap();
1760
- z = /* @__PURE__ */ new WeakMap();
1761
- ae = /* @__PURE__ */ new WeakMap();
1762
- T = /* @__PURE__ */ new WeakMap();
1763
- C = /* @__PURE__ */ new WeakMap();
1764
- ge = /* @__PURE__ */ new WeakMap();
1765
- Se = /* @__PURE__ */ new WeakMap();
1766
- ve = /* @__PURE__ */ new WeakMap();
1767
- te = /* @__PURE__ */ new WeakMap();
1768
- Ee = /* @__PURE__ */ new WeakMap();
1769
- st = /* @__PURE__ */ new WeakMap();
1770
- De = /* @__PURE__ */ new WeakSet();
1771
- ms = function() {
1772
- if (this !== _(this, P))
1773
- throw new Error("should only call on root");
1774
- if (_(this, ve))
1775
- return this;
1776
- this.toString(), N(this, ve, !0);
1777
- let t;
1778
- for (; t = _(this, Se).pop(); ) {
1779
- if (t.type !== "!")
1780
- continue;
1781
- let e = t, s = _(e, C);
1782
- for (; s; ) {
1783
- for (let r = _(e, ge) + 1; !s.type && r < _(s, T).length; r++)
1784
- for (const n of _(t, T)) {
1785
- if (typeof n == "string")
1786
- throw new Error("string part in extglob AST??");
1787
- n.copyIn(_(s, T)[r]);
1788
- }
1789
- e = s, s = _(e, C);
1790
- }
1791
- }
1792
- return this;
1793
- };
1794
- Te = /* @__PURE__ */ new WeakSet();
1795
- Ke = function(t, e, s, r) {
1796
- var n, i;
1797
- let a = !1, o = !1, l = -1, h = !1;
1798
- if (e.type === null) {
1799
- let f = s, p = "";
1800
- for (; f < t.length; ) {
1801
- const y = t.charAt(f++);
1802
- if (a || y === "\\") {
1803
- a = !a, p += y;
1804
- continue;
1805
- }
1806
- if (o) {
1807
- f === l + 1 ? (y === "^" || y === "!") && (h = !0) : y === "]" && !(f === l + 2 && h) && (o = !1), p += y;
1808
- continue;
1809
- } else if (y === "[") {
1810
- o = !0, l = f, h = !1, p += y;
1811
- continue;
1812
- }
1813
- if (!r.noext && It(y) && t.charAt(f) === "(") {
1814
- e.push(p), p = "";
1815
- const E = new ne(y, e);
1816
- f = pe(n = ne, Te, Ke).call(n, t, E, f, r), e.push(E);
1817
- continue;
1818
- }
1819
- p += y;
1820
- }
1821
- return e.push(p), f;
1822
- }
1823
- let c = s + 1, u = new ne(null, e);
1824
- const d = [];
1825
- let g = "";
1826
- for (; c < t.length; ) {
1827
- const f = t.charAt(c++);
1828
- if (a || f === "\\") {
1829
- a = !a, g += f;
1830
- continue;
1831
- }
1832
- if (o) {
1833
- c === l + 1 ? (f === "^" || f === "!") && (h = !0) : f === "]" && !(c === l + 2 && h) && (o = !1), g += f;
1834
- continue;
1835
- } else if (f === "[") {
1836
- o = !0, l = c, h = !1, g += f;
1837
- continue;
1838
- }
1839
- if (It(f) && t.charAt(c) === "(") {
1840
- u.push(g), g = "";
1841
- const p = new ne(f, u);
1842
- u.push(p), c = pe(i = ne, Te, Ke).call(i, t, p, c, r);
1843
- continue;
1844
- }
1845
- if (f === "|") {
1846
- u.push(g), g = "", d.push(u), u = new ne(null, e);
1847
- continue;
1848
- }
1849
- if (f === ")")
1850
- return g === "" && _(e, T).length === 0 && N(e, st, !0), u.push(g), g = "", e.push(...d, u), c;
1851
- g += f;
1852
- }
1853
- return e.type = null, N(e, z, void 0), N(e, T, [t.substring(s - 1)]), c;
1854
- };
1855
- _t = function(t) {
1856
- return _(this, T).map((e) => {
1857
- if (typeof e == "string")
1858
- throw new Error("string type in extglob ast??");
1859
- const [s, r, n, i] = e.toRegExpSource(t);
1860
- return N(this, ae, _(this, ae) || i), s;
1861
- }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
1862
- };
1863
- ys = function(t, e, s = !1) {
1864
- let r = !1, n = "", i = !1;
1865
- for (let a = 0; a < t.length; a++) {
1866
- const o = t.charAt(a);
1867
- if (r) {
1868
- r = !1, n += (Sn.has(o) ? "\\" : "") + o;
1869
- continue;
1870
- }
1871
- if (o === "\\") {
1872
- a === t.length - 1 ? n += "\\\\" : r = !0;
1873
- continue;
1874
- }
1875
- if (o === "[") {
1876
- const [l, h, c, u] = mn(t, a);
1877
- if (c) {
1878
- n += l, i = i || h, a += c - 1, e = e || u;
1879
- continue;
1880
- }
1881
- }
1882
- if (o === "*") {
1883
- s && t === "*" ? n += _s : n += vs, e = !0;
1884
- continue;
1885
- }
1886
- if (o === "?") {
1887
- n += Tt, e = !0;
1888
- continue;
1889
- }
1890
- n += xn(o);
1891
- }
1892
- return [n, ze(t), !!e, i];
1893
- };
1894
- q(ne, Te);
1895
- var Es = ne, On = (t, { windowsPathsNoEscape: e = !1 } = {}) => e ? t.replace(/[?*()[\]]/g, "[$&]") : t.replace(/[?*()[\]\\]/g, "\\$&"), F = (t, e, s = {}) => (tt(e), !s.nocomment && e.charAt(0) === "#" ? !1 : new ht(e, s).match(t)), Tn = /^\*+([^+@!?\*\[\(]*)$/, An = (t) => (e) => !e.startsWith(".") && e.endsWith(t), Rn = (t) => (e) => e.endsWith(t), Nn = (t) => (t = t.toLowerCase(), (e) => !e.startsWith(".") && e.toLowerCase().endsWith(t)), Ln = (t) => (t = t.toLowerCase(), (e) => e.toLowerCase().endsWith(t)), Mn = /^\*+\.\*+$/, kn = (t) => !t.startsWith(".") && t.includes("."), Cn = (t) => t !== "." && t !== ".." && t.includes("."), jn = /^\.\*+$/, Pn = (t) => t !== "." && t !== ".." && t.startsWith("."), Dn = /^\*+$/, In = (t) => t.length !== 0 && !t.startsWith("."), Wn = (t) => t.length !== 0 && t !== "." && t !== "..", zn = /^\?+([^+@!?\*\[\(]*)?$/, Gn = ([t, e = ""]) => {
1896
- const s = ws([t]);
1897
- return e ? (e = e.toLowerCase(), (r) => s(r) && r.toLowerCase().endsWith(e)) : s;
1898
- }, Hn = ([t, e = ""]) => {
1899
- const s = bs([t]);
1900
- return e ? (e = e.toLowerCase(), (r) => s(r) && r.toLowerCase().endsWith(e)) : s;
1901
- }, Fn = ([t, e = ""]) => {
1902
- const s = bs([t]);
1903
- return e ? (r) => s(r) && r.endsWith(e) : s;
1904
- }, Bn = ([t, e = ""]) => {
1905
- const s = ws([t]);
1906
- return e ? (r) => s(r) && r.endsWith(e) : s;
1907
- }, ws = ([t]) => {
1908
- const e = t.length;
1909
- return (s) => s.length === e && !s.startsWith(".");
1910
- }, bs = ([t]) => {
1911
- const e = t.length;
1912
- return (s) => s.length === e && s !== "." && s !== "..";
1913
- }, Ss = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", Wt = {
1914
- win32: { sep: "\\" },
1915
- posix: { sep: "/" }
1916
- }, Un = Ss === "win32" ? Wt.win32.sep : Wt.posix.sep;
1917
- F.sep = Un;
1918
- var K = /* @__PURE__ */ Symbol("globstar **");
1919
- F.GLOBSTAR = K;
1920
- var Zn = "[^/]", qn = Zn + "*?", Jn = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", Xn = "(?:(?!(?:\\/|^)\\.).)*?", Yn = (t, e = {}) => (s) => F(s, t, e);
1921
- F.filter = Yn;
1922
- var X = (t, e = {}) => Object.assign({}, t, e), Kn = (t) => {
1923
- if (!t || typeof t != "object" || !Object.keys(t).length)
1924
- return F;
1925
- const e = F;
1926
- return Object.assign((r, n, i = {}) => e(r, n, X(t, i)), {
1927
- Minimatch: class extends e.Minimatch {
1928
- constructor(n, i = {}) {
1929
- super(n, X(t, i));
1930
- }
1931
- static defaults(n) {
1932
- return e.defaults(X(t, n)).Minimatch;
1933
- }
1934
- },
1935
- AST: class extends e.AST {
1936
- /* c8 ignore start */
1937
- constructor(n, i, a = {}) {
1938
- super(n, i, X(t, a));
1939
- }
1940
- /* c8 ignore stop */
1941
- static fromGlob(n, i = {}) {
1942
- return e.AST.fromGlob(n, X(t, i));
1943
- }
1944
- },
1945
- unescape: (r, n = {}) => e.unescape(r, X(t, n)),
1946
- escape: (r, n = {}) => e.escape(r, X(t, n)),
1947
- filter: (r, n = {}) => e.filter(r, X(t, n)),
1948
- defaults: (r) => e.defaults(X(t, r)),
1949
- makeRe: (r, n = {}) => e.makeRe(r, X(t, n)),
1950
- braceExpand: (r, n = {}) => e.braceExpand(r, X(t, n)),
1951
- match: (r, n, i = {}) => e.match(r, n, X(t, i)),
1952
- sep: e.sep,
1953
- GLOBSTAR: K
1954
- });
1955
- };
1956
- F.defaults = Kn;
1957
- var xs = (t, e = {}) => (tt(t), e.nobrace || !/\{(?:(?!\{).)*\}/.test(t) ? [t] : (0, dn.default)(t));
1958
- F.braceExpand = xs;
1959
- var Qn = (t, e = {}) => new ht(t, e).makeRe();
1960
- F.makeRe = Qn;
1961
- var Vn = (t, e, s = {}) => {
1962
- const r = new ht(e, s);
1963
- return t = t.filter((n) => r.match(n)), r.options.nonull && !t.length && t.push(e), t;
1964
- };
1965
- F.match = Vn;
1966
- var zt = /[?*]|[+@!]\(.*?\)|\[|\]/, ei = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), ht = class {
1967
- options;
1968
- set;
1969
- pattern;
1970
- windowsPathsNoEscape;
1971
- nonegate;
1972
- negate;
1973
- comment;
1974
- empty;
1975
- preserveMultipleSlashes;
1976
- partial;
1977
- globSet;
1978
- globParts;
1979
- nocase;
1980
- isWindows;
1981
- platform;
1982
- windowsNoMagicRoot;
1983
- regexp;
1984
- constructor(t, e = {}) {
1985
- tt(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || Ss, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
1986
- }
1987
- hasMagic() {
1988
- if (this.options.magicalBraces && this.set.length > 1)
1989
- return !0;
1990
- for (const t of this.set)
1991
- for (const e of t)
1992
- if (typeof e != "string")
1993
- return !0;
1994
- return !1;
1995
- }
1996
- debug(...t) {
1997
- }
1998
- make() {
1999
- const t = this.pattern, e = this.options;
2000
- if (!e.nocomment && t.charAt(0) === "#") {
2001
- this.comment = !0;
2002
- return;
2003
- }
2004
- if (!t) {
2005
- this.empty = !0;
2006
- return;
2007
- }
2008
- this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...n) => console.error(...n)), this.debug(this.pattern, this.globSet);
2009
- const s = this.globSet.map((n) => this.slashSplit(n));
2010
- this.globParts = this.preprocess(s), this.debug(this.pattern, this.globParts);
2011
- let r = this.globParts.map((n, i, a) => {
2012
- if (this.isWindows && this.windowsNoMagicRoot) {
2013
- const o = n[0] === "" && n[1] === "" && (n[2] === "?" || !zt.test(n[2])) && !zt.test(n[3]), l = /^[a-z]:/i.test(n[0]);
2014
- if (o)
2015
- return [...n.slice(0, 4), ...n.slice(4).map((h) => this.parse(h))];
2016
- if (l)
2017
- return [n[0], ...n.slice(1).map((h) => this.parse(h))];
2018
- }
2019
- return n.map((o) => this.parse(o));
2020
- });
2021
- if (this.debug(this.pattern, r), this.set = r.filter((n) => n.indexOf(!1) === -1), this.isWindows)
2022
- for (let n = 0; n < this.set.length; n++) {
2023
- const i = this.set[n];
2024
- i[0] === "" && i[1] === "" && this.globParts[n][2] === "?" && typeof i[3] == "string" && /^[a-z]:$/i.test(i[3]) && (i[2] = "?");
2025
- }
2026
- this.debug(this.pattern, this.set);
2027
- }
2028
- // various transforms to equivalent pattern sets that are
2029
- // faster to process in a filesystem walk. The goal is to
2030
- // eliminate what we can, and push all ** patterns as far
2031
- // to the right as possible, even if it increases the number
2032
- // of patterns that we have to process.
2033
- preprocess(t) {
2034
- if (this.options.noglobstar)
2035
- for (let s = 0; s < t.length; s++)
2036
- for (let r = 0; r < t[s].length; r++)
2037
- t[s][r] === "**" && (t[s][r] = "*");
2038
- const { optimizationLevel: e = 1 } = this.options;
2039
- return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t;
2040
- }
2041
- // just get rid of adjascent ** portions
2042
- adjascentGlobstarOptimize(t) {
2043
- return t.map((e) => {
2044
- let s = -1;
2045
- for (; (s = e.indexOf("**", s + 1)) !== -1; ) {
2046
- let r = s;
2047
- for (; e[r + 1] === "**"; )
2048
- r++;
2049
- r !== s && e.splice(s, r - s);
2050
- }
2051
- return e;
2052
- });
2053
- }
2054
- // get rid of adjascent ** and resolve .. portions
2055
- levelOneOptimize(t) {
2056
- return t.map((e) => (e = e.reduce((s, r) => {
2057
- const n = s[s.length - 1];
2058
- return r === "**" && n === "**" ? s : r === ".." && n && n !== ".." && n !== "." && n !== "**" ? (s.pop(), s) : (s.push(r), s);
2059
- }, []), e.length === 0 ? [""] : e));
2060
- }
2061
- levelTwoFileOptimize(t) {
2062
- Array.isArray(t) || (t = this.slashSplit(t));
2063
- let e = !1;
2064
- do {
2065
- if (e = !1, !this.preserveMultipleSlashes) {
2066
- for (let r = 1; r < t.length - 1; r++) {
2067
- const n = t[r];
2068
- r === 1 && n === "" && t[0] === "" || (n === "." || n === "") && (e = !0, t.splice(r, 1), r--);
2069
- }
2070
- t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e = !0, t.pop());
2071
- }
2072
- let s = 0;
2073
- for (; (s = t.indexOf("..", s + 1)) !== -1; ) {
2074
- const r = t[s - 1];
2075
- r && r !== "." && r !== ".." && r !== "**" && (e = !0, t.splice(s - 1, 2), s -= 2);
2076
- }
2077
- } while (e);
2078
- return t.length === 0 ? [""] : t;
2079
- }
2080
- // First phase: single-pattern processing
2081
- // <pre> is 1 or more portions
2082
- // <rest> is 1 or more portions
2083
- // <p> is any portion other than ., .., '', or **
2084
- // <e> is . or ''
2085
- //
2086
- // **/.. is *brutal* for filesystem walking performance, because
2087
- // it effectively resets the recursive walk each time it occurs,
2088
- // and ** cannot be reduced out by a .. pattern part like a regexp
2089
- // or most strings (other than .., ., and '') can be.
2090
- //
2091
- // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
2092
- // <pre>/<e>/<rest> -> <pre>/<rest>
2093
- // <pre>/<p>/../<rest> -> <pre>/<rest>
2094
- // **/**/<rest> -> **/<rest>
2095
- //
2096
- // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
2097
- // this WOULD be allowed if ** did follow symlinks, or * didn't
2098
- firstPhasePreProcess(t) {
2099
- let e = !1;
2100
- do {
2101
- e = !1;
2102
- for (let s of t) {
2103
- let r = -1;
2104
- for (; (r = s.indexOf("**", r + 1)) !== -1; ) {
2105
- let i = r;
2106
- for (; s[i + 1] === "**"; )
2107
- i++;
2108
- i > r && s.splice(r + 1, i - r);
2109
- let a = s[r + 1];
2110
- const o = s[r + 2], l = s[r + 3];
2111
- if (a !== ".." || !o || o === "." || o === ".." || !l || l === "." || l === "..")
2112
- continue;
2113
- e = !0, s.splice(r, 1);
2114
- const h = s.slice(0);
2115
- h[r] = "**", t.push(h), r--;
2116
- }
2117
- if (!this.preserveMultipleSlashes) {
2118
- for (let i = 1; i < s.length - 1; i++) {
2119
- const a = s[i];
2120
- i === 1 && a === "" && s[0] === "" || (a === "." || a === "") && (e = !0, s.splice(i, 1), i--);
2121
- }
2122
- s[0] === "." && s.length === 2 && (s[1] === "." || s[1] === "") && (e = !0, s.pop());
2123
- }
2124
- let n = 0;
2125
- for (; (n = s.indexOf("..", n + 1)) !== -1; ) {
2126
- const i = s[n - 1];
2127
- if (i && i !== "." && i !== ".." && i !== "**") {
2128
- e = !0;
2129
- const o = n === 1 && s[n + 1] === "**" ? ["."] : [];
2130
- s.splice(n - 1, 2, ...o), s.length === 0 && s.push(""), n -= 2;
2131
- }
2132
- }
2133
- }
2134
- } while (e);
2135
- return t;
2136
- }
2137
- // second phase: multi-pattern dedupes
2138
- // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
2139
- // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
2140
- // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
2141
- //
2142
- // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
2143
- // ^-- not valid because ** doens't follow symlinks
2144
- secondPhasePreProcess(t) {
2145
- for (let e = 0; e < t.length - 1; e++)
2146
- for (let s = e + 1; s < t.length; s++) {
2147
- const r = this.partsMatch(t[e], t[s], !this.preserveMultipleSlashes);
2148
- r && (t[e] = r, t[s] = []);
2149
- }
2150
- return t.filter((e) => e.length);
2151
- }
2152
- partsMatch(t, e, s = !1) {
2153
- let r = 0, n = 0, i = [], a = "";
2154
- for (; r < t.length && n < e.length; )
2155
- if (t[r] === e[n])
2156
- i.push(a === "b" ? e[n] : t[r]), r++, n++;
2157
- else if (s && t[r] === "**" && e[n] === t[r + 1])
2158
- i.push(t[r]), r++;
2159
- else if (s && e[n] === "**" && t[r] === e[n + 1])
2160
- i.push(e[n]), n++;
2161
- else if (t[r] === "*" && e[n] && (this.options.dot || !e[n].startsWith(".")) && e[n] !== "**") {
2162
- if (a === "b")
2163
- return !1;
2164
- a = "a", i.push(t[r]), r++, n++;
2165
- } else if (e[n] === "*" && t[r] && (this.options.dot || !t[r].startsWith(".")) && t[r] !== "**") {
2166
- if (a === "a")
2167
- return !1;
2168
- a = "b", i.push(e[n]), r++, n++;
2169
- } else
2170
- return !1;
2171
- return t.length === e.length && i;
2172
- }
2173
- parseNegate() {
2174
- if (this.nonegate)
2175
- return;
2176
- const t = this.pattern;
2177
- let e = !1, s = 0;
2178
- for (let r = 0; r < t.length && t.charAt(r) === "!"; r++)
2179
- e = !e, s++;
2180
- s && (this.pattern = t.slice(s)), this.negate = e;
2181
- }
2182
- // set partial to true to test if, for example,
2183
- // "/a/b" matches the start of "/*/b/*/d"
2184
- // Partial means, if you run out of file before you run
2185
- // out of pattern, then that's fine, as long as all
2186
- // the parts match.
2187
- matchOne(t, e, s = !1) {
2188
- const r = this.options;
2189
- if (this.isWindows) {
2190
- const f = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), p = !f && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), y = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), E = !y && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), $ = p ? 3 : f ? 0 : void 0, w = E ? 3 : y ? 0 : void 0;
2191
- if (typeof $ == "number" && typeof w == "number") {
2192
- const [b, m] = [t[$], e[w]];
2193
- b.toLowerCase() === m.toLowerCase() && (e[w] = b, w > $ ? e = e.slice(w) : $ > w && (t = t.slice($)));
2194
- }
2195
- }
2196
- const { optimizationLevel: n = 1 } = this.options;
2197
- n >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
2198
- for (var i = 0, a = 0, o = t.length, l = e.length; i < o && a < l; i++, a++) {
2199
- this.debug("matchOne loop");
2200
- var h = e[a], c = t[i];
2201
- if (this.debug(e, h, c), h === !1)
2202
- return !1;
2203
- if (h === K) {
2204
- this.debug("GLOBSTAR", [e, h, c]);
2205
- var u = i, d = a + 1;
2206
- if (d === l) {
2207
- for (this.debug("** at the end"); i < o; i++)
2208
- if (t[i] === "." || t[i] === ".." || !r.dot && t[i].charAt(0) === ".")
2209
- return !1;
2210
- return !0;
2211
- }
2212
- for (; u < o; ) {
2213
- var g = t[u];
2214
- if (this.debug(`
2215
- globstar while`, t, u, e, d, g), this.matchOne(t.slice(u), e.slice(d), s))
2216
- return this.debug("globstar found match!", u, o, g), !0;
2217
- if (g === "." || g === ".." || !r.dot && g.charAt(0) === ".") {
2218
- this.debug("dot detected!", t, u, e, d);
2219
- break;
2220
- }
2221
- this.debug("globstar swallow a segment, and continue"), u++;
2222
- }
2223
- return !!(s && (this.debug(`
2224
- >>> no match, partial?`, t, u, e, d), u === o));
2225
- }
2226
- let f;
2227
- if (typeof h == "string" ? (f = c === h, this.debug("string match", h, c, f)) : (f = h.test(c), this.debug("pattern match", h, c, f)), !f)
2228
- return !1;
2229
- }
2230
- if (i === o && a === l)
2231
- return !0;
2232
- if (i === o)
2233
- return s;
2234
- if (a === l)
2235
- return i === o - 1 && t[i] === "";
2236
- throw new Error("wtf?");
2237
- }
2238
- braceExpand() {
2239
- return xs(this.pattern, this.options);
2240
- }
2241
- parse(t) {
2242
- tt(t);
2243
- const e = this.options;
2244
- if (t === "**")
2245
- return K;
2246
- if (t === "")
2247
- return "";
2248
- let s, r = null;
2249
- (s = t.match(Dn)) ? r = e.dot ? Wn : In : (s = t.match(Tn)) ? r = (e.nocase ? e.dot ? Ln : Nn : e.dot ? Rn : An)(s[1]) : (s = t.match(zn)) ? r = (e.nocase ? e.dot ? Hn : Gn : e.dot ? Fn : Bn)(s) : (s = t.match(Mn)) ? r = e.dot ? Cn : kn : (s = t.match(jn)) && (r = Pn);
2250
- const n = Es.fromGlob(t, this.options).toMMPattern();
2251
- return r && typeof n == "object" && Reflect.defineProperty(n, "test", { value: r }), n;
2252
- }
2253
- makeRe() {
2254
- if (this.regexp || this.regexp === !1)
2255
- return this.regexp;
2256
- const t = this.set;
2257
- if (!t.length)
2258
- return this.regexp = !1, this.regexp;
2259
- const e = this.options, s = e.noglobstar ? qn : e.dot ? Jn : Xn, r = new Set(e.nocase ? ["i"] : []);
2260
- let n = t.map((o) => {
2261
- const l = o.map((h) => {
2262
- if (h instanceof RegExp)
2263
- for (const c of h.flags.split(""))
2264
- r.add(c);
2265
- return typeof h == "string" ? ei(h) : h === K ? K : h._src;
2266
- });
2267
- return l.forEach((h, c) => {
2268
- const u = l[c + 1], d = l[c - 1];
2269
- h !== K || d === K || (d === void 0 ? u !== void 0 && u !== K ? l[c + 1] = "(?:\\/|" + s + "\\/)?" + u : l[c] = s : u === void 0 ? l[c - 1] = d + "(?:\\/|" + s + ")?" : u !== K && (l[c - 1] = d + "(?:\\/|\\/" + s + "\\/)" + u, l[c + 1] = K));
2270
- }), l.filter((h) => h !== K).join("/");
2271
- }).join("|");
2272
- const [i, a] = t.length > 1 ? ["(?:", ")"] : ["", ""];
2273
- n = "^" + i + n + a + "$", this.negate && (n = "^(?!" + n + ").+$");
2274
- try {
2275
- this.regexp = new RegExp(n, [...r].join(""));
2276
- } catch {
2277
- this.regexp = !1;
2278
- }
2279
- return this.regexp;
2280
- }
2281
- slashSplit(t) {
2282
- return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/);
2283
- }
2284
- match(t, e = this.partial) {
2285
- if (this.debug("match", t, this.pattern), this.comment)
2286
- return !1;
2287
- if (this.empty)
2288
- return t === "";
2289
- if (t === "/" && e)
2290
- return !0;
2291
- const s = this.options;
2292
- this.isWindows && (t = t.split("\\").join("/"));
2293
- const r = this.slashSplit(t);
2294
- this.debug(this.pattern, "split", r);
2295
- const n = this.set;
2296
- this.debug(this.pattern, "set", n);
2297
- let i = r[r.length - 1];
2298
- if (!i)
2299
- for (let a = r.length - 2; !i && a >= 0; a--)
2300
- i = r[a];
2301
- for (let a = 0; a < n.length; a++) {
2302
- const o = n[a];
2303
- let l = r;
2304
- if (s.matchBase && o.length === 1 && (l = [i]), this.matchOne(l, o, e))
2305
- return s.flipNegate ? !0 : !this.negate;
2306
- }
2307
- return s.flipNegate ? !1 : this.negate;
2308
- }
2309
- static defaults(t) {
2310
- return F.defaults(t).Minimatch;
2311
- }
2312
- };
2313
- F.AST = Es;
2314
- F.Minimatch = ht;
2315
- F.escape = On;
2316
- F.unescape = ze;
2317
- var ti = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), si = {};
2318
- an(si, {
2319
- err: () => Os,
2320
- map: () => ri,
2321
- ok: () => mt,
2322
- unwrap: () => ni,
2323
- unwrapErr: () => ii
2324
- });
2325
- var mt = (t) => ({
2326
- isOk: !0,
2327
- isErr: !1,
2328
- value: t
2329
- }), Os = (t) => ({
2330
- isOk: !1,
2331
- isErr: !0,
2332
- value: t
2333
- });
2334
- function ri(t, e) {
2335
- if (t.isOk) {
2336
- const s = e(t.value);
2337
- return s instanceof Promise ? s.then((r) => mt(r)) : mt(s);
2338
- }
2339
- if (t.isErr) {
2340
- const s = t.value;
2341
- return Os(s);
2342
- }
2343
- throw "should never get here";
253
+ var Ee = (e, t, n = !0) => {
254
+ let r = [];
255
+ (n && e["s-sr"] || !e["s-sr"]) && r.push(e);
256
+ let i = e;
257
+ for (; i = i.nextSibling;) D(i) === t && (n || !i["s-sr"]) && r.push(i);
258
+ return r;
259
+ }, De = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", D = (e) => typeof e["s-sn"] == "string" ? e["s-sn"] : e.nodeType === 1 && e.getAttribute("slot") || void 0;
260
+ function Oe(e) {
261
+ if (e.assignedElements || e.assignedNodes || !e["s-sr"]) return;
262
+ let t = (t) => (function(e) {
263
+ let n = [], r = this["s-sn"];
264
+ e?.flatten && console.error("\n Flattening is not supported for Stencil non-shadow slots.\n You can use `.childNodes` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n ");
265
+ let i = this["s-cr"].parentElement;
266
+ return (i.__childNodes ? i.childNodes : Te(i.childNodes)).forEach((e) => {
267
+ r === D(e) && n.push(e);
268
+ }), t ? n.filter((e) => e.nodeType === 1) : n;
269
+ }).bind(e);
270
+ e.assignedElements = t(!0), e.assignedNodes = t(!1);
2344
271
  }
2345
- var ni = (t) => {
2346
- if (t.isOk)
2347
- return t.value;
2348
- throw t.value;
2349
- }, ii = (t) => {
2350
- if (t.isErr)
2351
- return t.value;
2352
- throw t.value;
2353
- }, Ts = (t) => {
2354
- const e = Ht(t, "childNodes");
2355
- t.tagName && t.tagName.includes("-") && t["s-cr"] && t.tagName !== "SLOT-FB" && As(e, t.tagName).forEach((r) => {
2356
- r.nodeType === 1 && r.tagName === "SLOT-FB" && (oi(r, At(r), !1).length ? r.hidden = !0 : r.hidden = !1);
2357
- });
2358
- let s = 0;
2359
- for (s = 0; s < e.length; s++) {
2360
- const r = e[s];
2361
- r.nodeType === 1 && Ht(r, "childNodes").length && Ts(r);
2362
- }
2363
- }, ai = (t) => {
2364
- const e = [];
2365
- for (let s = 0; s < t.length; s++) {
2366
- const r = t[s]["s-nr"] || void 0;
2367
- r && r.isConnected && e.push(r);
2368
- }
2369
- return e;
2370
- };
2371
- function As(t, e, s) {
2372
- let r = 0, n = [], i;
2373
- for (; r < t.length; r++)
2374
- i = t[r], i["s-sr"] && (!e || i["s-hn"] === e) && s === void 0 && n.push(i), n = [...n, ...As(i.childNodes, e, s)];
2375
- return n;
272
+ function ke(e) {
273
+ e.dispatchEvent(new CustomEvent("slotchange", {
274
+ bubbles: !1,
275
+ cancelable: !1,
276
+ composed: !1
277
+ }));
2376
278
  }
2377
- var oi = (t, e, s = !0) => {
2378
- const r = [];
2379
- (s && t["s-sr"] || !t["s-sr"]) && r.push(t);
2380
- let n = t;
2381
- for (; n = n.nextSibling; )
2382
- At(n) === e && (s || !n["s-sr"]) && r.push(n);
2383
- return r;
2384
- }, Gt = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", At = (t) => typeof t["s-sn"] == "string" ? t["s-sn"] : t.nodeType === 1 && t.getAttribute("slot") || void 0;
2385
- function li(t) {
2386
- if (t.assignedElements || t.assignedNodes || !t["s-sr"]) return;
2387
- const e = (s) => (function(r) {
2388
- const n = [], i = this["s-sn"];
2389
- r?.flatten && console.error(`
2390
- Flattening is not supported for Stencil non-shadow slots.
2391
- You can use \`.childNodes\` to nested slot fallback content.
2392
- If you have a particular use case, please open an issue on the Stencil repo.
2393
- `);
2394
- const a = this["s-cr"].parentElement;
2395
- return (a.__childNodes ? a.childNodes : ai(a.childNodes)).forEach((l) => {
2396
- i === At(l) && n.push(l);
2397
- }), s ? n.filter(
2398
- (l) => l.nodeType === 1
2399
- /* ElementNode */
2400
- ) : n;
2401
- }).bind(t);
2402
- t.assignedElements = e(!0), t.assignedNodes = e(!1);
279
+ function Ae(e, t) {
280
+ if (t ||= e["s-ol"]?.parentElement, !t) return {
281
+ slotNode: null,
282
+ slotName: ""
283
+ };
284
+ let n = e["s-sn"] = D(e) || "";
285
+ return {
286
+ slotNode: E(O(t, "childNodes"), t.tagName, n)[0],
287
+ slotName: n
288
+ };
2403
289
  }
2404
- function Ht(t, e) {
2405
- if ("__" + e in t) {
2406
- const s = t["__" + e];
2407
- return typeof s != "function" ? s : s.bind(t);
2408
- } else
2409
- return typeof t[e] != "function" ? t[e] : t[e].bind(t);
290
+ function O(e, t) {
291
+ if ("__" + t in e) {
292
+ let n = e["__" + t];
293
+ return typeof n == "function" ? n.bind(e) : n;
294
+ } else return typeof e[t] == "function" ? e[t].bind(e) : e[t];
2410
295
  }
2411
- var ci = (t, e, ...s) => {
2412
- let r = null, n = null, i = null, a = !1, o = !1;
2413
- const l = [], h = (u) => {
2414
- for (let d = 0; d < u.length; d++)
2415
- r = u[d], Array.isArray(r) ? h(r) : r != null && typeof r != "boolean" && ((a = !$s(r)) && (r = String(r)), a && o ? l[l.length - 1].$text$ += r : l.push(a ? yt(null, r) : r), o = a);
2416
- };
2417
- h(s);
2418
- const c = yt(t, null);
2419
- return c.$attrs$ = e, l.length > 0 && (c.$children$ = l), c.$key$ = n, c.$name$ = i, c;
2420
- }, yt = (t, e) => {
2421
- const s = {
2422
- $flags$: 0,
2423
- $tag$: t,
2424
- $text$: e,
2425
- $elm$: null,
2426
- $children$: null
2427
- };
2428
- return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
2429
- }, hi = {}, ui = (t) => t && t.$tag$ === hi, Rt = (t) => {
2430
- const e = ti(t);
2431
- return new RegExp(
2432
- // First capture group: match any context before the selector that's not inside @supports selector()
2433
- // Using negative lookahead to avoid matching inside @supports selector(...) condition
2434
- `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,
2435
- "g"
2436
- );
296
+ var je = (e) => e != null && e !== void 0, Me = (e) => (e = typeof e, e === "object" || e === "function"), Ne = (e, t, ...n) => {
297
+ let r = null, i = !1, a = !1, o = [], s = (e) => {
298
+ for (let t = 0; t < e.length; t++) r = e[t], Array.isArray(r) ? s(r) : r != null && typeof r != "boolean" && ((i = !Me(r)) && (r = String(r)), i && a ? o[o.length - 1].$text$ += r : o.push(i ? k(null, r) : r), a = i);
299
+ };
300
+ s(n);
301
+ let c = k(e, null);
302
+ return c.$attrs$ = t, o.length > 0 && (c.$children$ = o), c.$key$ = null, c.$name$ = null, c;
303
+ }, k = (e, t) => {
304
+ let n = {
305
+ $flags$: 0,
306
+ $tag$: e,
307
+ $text$: t ?? null,
308
+ $elm$: null,
309
+ $children$: null
310
+ };
311
+ return n.$attrs$ = null, n.$key$ = null, n.$name$ = null, n;
312
+ }, Pe = {}, Fe = (e) => e && e.$tag$ === Pe, Ie = (e, t, n, r, i, a, o) => {
313
+ if (n === r) return;
314
+ let s = x(e, t), c = t.toLowerCase();
315
+ if (t === "class") {
316
+ let t = e.classList, i = A(n), a = A(r);
317
+ t.remove(...i.filter((e) => e && !a.includes(e))), t.add(...a.filter((e) => e && !i.includes(e)));
318
+ } else if (t === "style") {
319
+ for (let t in n) (!r || r[t] == null) && (t.includes("-") ? e.style.removeProperty(t) : e.style[t] = "");
320
+ for (let t in r) (!n || r[t] !== n[t]) && (t.includes("-") ? e.style.setProperty(t, r[t]) : e.style[t] = r[t]);
321
+ } else if (t !== "key") if (t === "ref") r && qe(r, e);
322
+ else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
323
+ if (t = t[2] === "-" ? t.slice(3) : x(C, c) ? c.slice(2) : c[2] + t.slice(3), n || r) {
324
+ let i = t.endsWith(Re);
325
+ t = t.replace(ze, ""), n && w.rel(e, t, n, i), r && w.ael(e, t, r, i);
326
+ }
327
+ } else if (t[0] === "a" && t.startsWith("attr:")) {
328
+ let n = t.slice(5), i;
329
+ {
330
+ let t = we(e);
331
+ if (t && t.$cmpMeta$ && t.$cmpMeta$.$members$) {
332
+ let e = t.$cmpMeta$.$members$[n];
333
+ e && e[1] && (i = e[1]);
334
+ }
335
+ }
336
+ i ||= n.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), r == null || r === !1 ? (r !== !1 || e.getAttribute(i) === "") && e.removeAttribute(i) : e.setAttribute(i, r === !0 ? "" : r);
337
+ return;
338
+ } else if (t[0] === "p" && t.startsWith("prop:")) {
339
+ let n = t.slice(5);
340
+ try {
341
+ e[n] = r;
342
+ } catch {}
343
+ return;
344
+ } else {
345
+ let o = Me(r);
346
+ if ((s || o && r !== null) && !i) try {
347
+ if (e.tagName.includes("-")) e[t] !== r && (e[t] = r);
348
+ else {
349
+ let i = r ?? "";
350
+ t === "list" ? s = !1 : (n == null || e[t] !== i) && (typeof e.__lookupSetter__(t) == "function" ? e[t] = i : e.setAttribute(t, i));
351
+ }
352
+ } catch {}
353
+ let l = !1;
354
+ c !== (c = c.replace(/^xlink\:?/, "")) && (t = c, l = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (l ? e.removeAttributeNS(S, t) : e.removeAttribute(t)) : (!s || a & 4 || i) && !o && e.nodeType === 1 && (r = r === !0 ? "" : r, l ? e.setAttributeNS(S, t, r) : e.setAttribute(t, r));
355
+ }
356
+ }, Le = /\s/, A = (e) => (typeof e == "object" && e && "baseVal" in e && (e = e.baseVal), !e || typeof e != "string" ? [] : e.split(Le)), Re = "Capture", ze = RegExp(Re + "$"), j = (e, t, n, r) => {
357
+ let i = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, a = e && e.$attrs$ || {}, o = t.$attrs$ || {};
358
+ for (let e of Be(Object.keys(a))) e in o || Ie(i, e, a[e], void 0, n, t.$flags$);
359
+ for (let e of Be(Object.keys(o))) Ie(i, e, a[e], o[e], n, t.$flags$);
2437
360
  };
2438
- Rt("::slotted");
2439
- Rt(":host");
2440
- Rt(":host-context");
2441
- var Ft = (t, e, s, r, n, i, a) => {
2442
- if (s === r)
2443
- return;
2444
- let o = jt(t, e), l = e.toLowerCase();
2445
- if (e === "class") {
2446
- const h = t.classList, c = Bt(s);
2447
- let u = Bt(r);
2448
- h.remove(...c.filter((d) => d && !u.includes(d))), h.add(...u.filter((d) => d && !c.includes(d)));
2449
- } else if (e === "style") {
2450
- for (const h in s)
2451
- (!r || r[h] == null) && (h.includes("-") ? t.style.removeProperty(h) : t.style[h] = "");
2452
- for (const h in r)
2453
- (!s || r[h] !== s[h]) && (h.includes("-") ? t.style.setProperty(h, r[h]) : t.style[h] = r[h]);
2454
- } else if (e !== "key") if (e === "ref")
2455
- r && r(t);
2456
- else if (!t.__lookupSetter__(e) && e[0] === "o" && e[1] === "n") {
2457
- if (e[2] === "-" ? e = e.slice(3) : jt($e, l) ? e = l.slice(2) : e = l[2] + e.slice(3), s || r) {
2458
- const h = e.endsWith(Rs);
2459
- e = e.replace(pi, ""), s && Oe.rel(t, e, s, h), r && Oe.ael(t, e, r, h);
2460
- }
2461
- } else {
2462
- const h = $s(r);
2463
- if ((o || h && r !== null) && !n)
2464
- try {
2465
- if (t.tagName.includes("-"))
2466
- t[e] !== r && (t[e] = r);
2467
- else {
2468
- const u = r ?? "";
2469
- e === "list" ? o = !1 : (s == null || t[e] != u) && (typeof t.__lookupSetter__(e) == "function" ? t[e] = u : t.setAttribute(e, u));
2470
- }
2471
- } catch {
2472
- }
2473
- let c = !1;
2474
- l !== (l = l.replace(/^xlink\:?/, "")) && (e = l, c = !0), r == null || r === !1 ? (r !== !1 || t.getAttribute(e) === "") && (c ? t.removeAttributeNS(Pt, e) : t.removeAttribute(e)) : (!o || i & 4 || n) && !h && t.nodeType === 1 && (r = r === !0 ? "" : r, c ? t.setAttributeNS(Pt, e, r) : t.setAttribute(e, r));
2475
- }
2476
- }, fi = /\s/, Bt = (t) => (typeof t == "object" && t && "baseVal" in t && (t = t.baseVal), !t || typeof t != "string" ? [] : t.split(fi)), Rs = "Capture", pi = new RegExp(Rs + "$"), Et = (t, e, s, r) => {
2477
- const n = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, i = t && t.$attrs$ || {}, a = e.$attrs$ || {};
2478
- for (const o of Ut(Object.keys(i)))
2479
- o in a || Ft(
2480
- n,
2481
- o,
2482
- i[o],
2483
- void 0,
2484
- s,
2485
- e.$flags$
2486
- );
2487
- for (const o of Ut(Object.keys(a)))
2488
- Ft(
2489
- n,
2490
- o,
2491
- i[o],
2492
- a[o],
2493
- s,
2494
- e.$flags$
2495
- );
2496
- };
2497
- function Ut(t) {
2498
- return t.includes("ref") ? (
2499
- // we need to sort these to ensure that `'ref'` is the last attr
2500
- [...t.filter((e) => e !== "ref"), "ref"]
2501
- ) : (
2502
- // no need to sort, return the original array
2503
- t
2504
- );
2505
- }
2506
- var Qe, rt, Fe, wt = !1, nt = !1, Nt = !1, B = !1, it = (t, e, s) => {
2507
- var r;
2508
- const n = e.$children$[s];
2509
- let i = 0, a, o, l;
2510
- if (wt || (Nt = !0, n.$tag$ === "slot" && (n.$flags$ |= n.$children$ ? (
2511
- // slot element has fallback content
2512
- // still create an element that "mocks" the slot element
2513
- 2
2514
- ) : (
2515
- // slot element does not have fallback content
2516
- // create an html comment we'll use to always reference
2517
- // where actual slot content should sit next to
2518
- 1
2519
- ))), n.$text$ !== null)
2520
- a = n.$elm$ = $e.document.createTextNode(n.$text$);
2521
- else if (n.$flags$ & 1)
2522
- a = n.$elm$ = $e.document.createTextNode(""), Et(null, n, B);
2523
- else {
2524
- if (B || (B = n.$tag$ === "svg"), !$e.document)
2525
- throw new Error(
2526
- "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
2527
- );
2528
- if (a = n.$elm$ = $e.document.createElementNS(
2529
- B ? fn : pn,
2530
- !wt && He.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
2531
- ), B && n.$tag$ === "foreignObject" && (B = !1), Et(null, n, B), gn(Qe) && a["s-si"] !== Qe && a.classList.add(a["s-si"] = Qe), n.$children$) {
2532
- const h = n.$tag$ === "template" ? a.content : a;
2533
- for (i = 0; i < n.$children$.length; ++i)
2534
- o = it(t, n, i), o && h.appendChild(o);
2535
- }
2536
- n.$tag$ === "svg" ? B = !1 : a.tagName === "foreignObject" && (B = !0);
2537
- }
2538
- return a["s-hn"] = Fe, n.$flags$ & 3 && (a["s-sr"] = !0, a["s-cr"] = rt, a["s-sn"] = n.$name$ || "", a["s-rf"] = (r = n.$attrs$) == null ? void 0 : r.ref, li(a), l = t && t.$children$ && t.$children$[s], l && l.$tag$ === n.$tag$ && t.$elm$ && Be(t.$elm$, !1), Cs(rt, a, e.$elm$, t?.$elm$)), a;
2539
- }, Be = (t, e) => {
2540
- Oe.$flags$ |= 1;
2541
- const s = Array.from(t.__childNodes || t.childNodes);
2542
- t["s-sr"] && He.experimentalSlotFixes;
2543
- for (let r = s.length - 1; r >= 0; r--) {
2544
- const n = s[r];
2545
- n["s-hn"] !== Fe && n["s-ol"] && (_e(Ue(n).parentNode, n, Ue(n)), n["s-ol"].remove(), n["s-ol"] = void 0, n["s-sh"] = void 0, Nt = !0), e && Be(n, e);
2546
- }
2547
- Oe.$flags$ &= -2;
2548
- }, Ns = (t, e, s, r, n, i) => {
2549
- let a = t["s-cr"] && t["s-cr"].parentNode || t, o;
2550
- for (a.shadowRoot && a.tagName === Fe && (a = a.shadowRoot), s.$tag$ === "template" && (a = a.content); n <= i; ++n)
2551
- r[n] && (o = it(null, s, n), o && (r[n].$elm$ = o, _e(a, o, Ue(e))));
2552
- }, Ls = (t, e, s) => {
2553
- for (let r = e; r <= s; ++r) {
2554
- const n = t[r];
2555
- if (n) {
2556
- const i = n.$elm$;
2557
- ks(n), i && (nt = !0, i["s-ol"] ? i["s-ol"].remove() : Be(i, !0), i.remove());
2558
- }
2559
- }
2560
- }, gi = (t, e, s, r, n = !1) => {
2561
- let i = 0, a = 0, o = 0, l = 0, h = e.length - 1, c = e[0], u = e[h], d = r.length - 1, g = r[0], f = r[d], p, y;
2562
- const E = s.$tag$ === "template" ? t.content : t;
2563
- for (; i <= h && a <= d; )
2564
- if (c == null)
2565
- c = e[++i];
2566
- else if (u == null)
2567
- u = e[--h];
2568
- else if (g == null)
2569
- g = r[++a];
2570
- else if (f == null)
2571
- f = r[--d];
2572
- else if (Xe(c, g, n))
2573
- we(c, g, n), c = e[++i], g = r[++a];
2574
- else if (Xe(u, f, n))
2575
- we(u, f, n), u = e[--h], f = r[--d];
2576
- else if (Xe(c, f, n))
2577
- (c.$tag$ === "slot" || f.$tag$ === "slot") && Be(c.$elm$.parentNode, !1), we(c, f, n), _e(E, c.$elm$, u.$elm$.nextSibling), c = e[++i], f = r[--d];
2578
- else if (Xe(u, g, n))
2579
- (c.$tag$ === "slot" || f.$tag$ === "slot") && Be(u.$elm$.parentNode, !1), we(u, g, n), _e(E, u.$elm$, c.$elm$), u = e[--h], g = r[++a];
2580
- else {
2581
- for (o = -1, l = i; l <= h; ++l)
2582
- if (e[l] && e[l].$key$ !== null && e[l].$key$ === g.$key$) {
2583
- o = l;
2584
- break;
2585
- }
2586
- o >= 0 ? (y = e[o], y.$tag$ !== g.$tag$ ? p = it(e && e[a], s, o) : (we(y, g, n), e[o] = void 0, p = y.$elm$), g = r[++a]) : (p = it(e && e[a], s, a), g = r[++a]), p && _e(
2587
- Ue(c.$elm$).parentNode,
2588
- p,
2589
- Ue(c.$elm$)
2590
- );
2591
- }
2592
- i > h ? Ns(
2593
- t,
2594
- r[d + 1] == null ? null : r[d + 1].$elm$,
2595
- s,
2596
- r,
2597
- a,
2598
- d
2599
- ) : a > d && Ls(e, i, h);
2600
- }, Xe = (t, e, s = !1) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : s ? (s && !t.$key$ && e.$key$ && (t.$key$ = e.$key$), !0) : t.$key$ === e.$key$ : !1, Ue = (t) => t && t["s-ol"] || t, we = (t, e, s = !1) => {
2601
- const r = e.$elm$ = t.$elm$, n = t.$children$, i = e.$children$, a = e.$tag$, o = e.$text$;
2602
- let l;
2603
- o === null ? (B = a === "svg" ? !0 : a === "foreignObject" ? !1 : B, Et(t, e, B), n !== null && i !== null ? gi(r, n, e, i, s) : i !== null ? (t.$text$ !== null && (r.textContent = ""), Ns(r, null, e, i, 0, i.length - 1)) : (
2604
- // don't do this on initial render as it can cause non-hydrated content to be removed
2605
- !s && He.updatable && n !== null && Ls(n, 0, n.length - 1)
2606
- ), B && a === "svg" && (B = !1)) : (l = r["s-cr"]) ? l.parentNode.textContent = o : t.$text$ !== o && (r.data = o);
2607
- }, se = [], Ms = (t) => {
2608
- let e, s, r;
2609
- const n = t.__childNodes || t.childNodes;
2610
- for (const i of n) {
2611
- if (i["s-sr"] && (e = i["s-cr"]) && e.parentNode) {
2612
- s = e.parentNode.__childNodes || e.parentNode.childNodes;
2613
- const a = i["s-sn"];
2614
- for (r = s.length - 1; r >= 0; r--)
2615
- if (e = s[r], !e["s-cn"] && !e["s-nr"] && e["s-hn"] !== i["s-hn"])
2616
- if (Gt(e, a)) {
2617
- let o = se.find((l) => l.$nodeToRelocate$ === e);
2618
- nt = !0, e["s-sn"] = e["s-sn"] || a, o ? (o.$nodeToRelocate$["s-sh"] = i["s-hn"], o.$slotRefNode$ = i) : (e["s-sh"] = i["s-hn"], se.push({
2619
- $slotRefNode$: i,
2620
- $nodeToRelocate$: e
2621
- })), e["s-sr"] && se.map((l) => {
2622
- Gt(l.$nodeToRelocate$, e["s-sn"]) && (o = se.find((h) => h.$nodeToRelocate$ === e), o && !l.$slotRefNode$ && (l.$slotRefNode$ = o.$slotRefNode$));
2623
- });
2624
- } else se.some((o) => o.$nodeToRelocate$ === e) || se.push({
2625
- $nodeToRelocate$: e
2626
- });
2627
- }
2628
- i.nodeType === 1 && Ms(i);
2629
- }
2630
- }, ks = (t) => {
2631
- t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(ks);
2632
- }, _e = (t, e, s) => (typeof e["s-sn"] == "string" && e["s-sr"] && e["s-cr"] && Cs(e["s-cr"], e, t, e.parentElement), t?.insertBefore(e, s));
2633
- function Cs(t, e, s, r) {
2634
- var n, i;
2635
- let a;
2636
- if (t && typeof e["s-sn"] == "string" && e["s-sr"] && t.parentNode && t.parentNode["s-sc"] && (a = e["s-si"] || t.parentNode["s-sc"])) {
2637
- const o = e["s-sn"], l = e["s-hn"];
2638
- if ((n = s.classList) == null || n.add(a + "-s"), r && ((i = r.classList) != null && i.contains(a + "-s"))) {
2639
- let h = (r.__childNodes || r.childNodes)[0], c = !1;
2640
- for (; h; ) {
2641
- if (h["s-sn"] !== o && h["s-hn"] === l && h["s-sr"]) {
2642
- c = !0;
2643
- break;
2644
- }
2645
- h = h.nextSibling;
2646
- }
2647
- c || r.classList.remove(a + "-s");
2648
- }
2649
- }
361
+ function Be(e) {
362
+ return e.includes("ref") ? [...e.filter((e) => e !== "ref"), "ref"] : e;
2650
363
  }
2651
- var di = (t, e, s = !1) => {
2652
- var r, n, i, a, o;
2653
- const l = t.$hostElement$, h = t.$cmpMeta$, c = t.$vnode$ || yt(null, null), d = ui(e) ? e : ci(null, null, e);
2654
- if (Fe = l.tagName, h.$attrsToReflect$ && (d.$attrs$ = d.$attrs$ || {}, h.$attrsToReflect$.forEach(([g, f]) => {
2655
- He.serializer && t.$serializerValues$.has(g) ? d.$attrs$[f] = t.$serializerValues$.get(g) : d.$attrs$[f] = l[g];
2656
- })), s && d.$attrs$)
2657
- for (const g of Object.keys(d.$attrs$))
2658
- l.hasAttribute(g) && !["key", "ref", "style", "class"].includes(g) && (d.$attrs$[g] = l[g]);
2659
- d.$tag$ = null, d.$flags$ |= 4, t.$vnode$ = d, d.$elm$ = c.$elm$ = l.shadowRoot || l, Qe = l["s-sc"], wt = !!(h.$flags$ & 1) && !(h.$flags$ & 128), rt = l["s-cr"], nt = !1, we(c, d, s);
2660
- {
2661
- if (Oe.$flags$ |= 1, Nt) {
2662
- Ms(d.$elm$);
2663
- for (const g of se) {
2664
- const f = g.$nodeToRelocate$;
2665
- if (!f["s-ol"] && $e.document) {
2666
- const p = $e.document.createTextNode("");
2667
- p["s-nr"] = f, _e(f.parentNode, f["s-ol"] = p, f);
2668
- }
2669
- }
2670
- for (const g of se) {
2671
- const f = g.$nodeToRelocate$, p = g.$slotRefNode$;
2672
- if (f.nodeType === 1 && s && (f["s-ih"] = (r = f.hidden) != null ? r : !1), p) {
2673
- const y = p.parentNode;
2674
- let E = p.nextSibling;
2675
- {
2676
- let b = (n = f["s-ol"]) == null ? void 0 : n.previousSibling;
2677
- for (; b; ) {
2678
- let m = (i = b["s-nr"]) != null ? i : null;
2679
- if (m && m["s-sn"] === f["s-sn"] && y === (m.__parentNode || m.parentNode)) {
2680
- for (m = m.nextSibling; m === f || m?.["s-sr"]; )
2681
- m = m?.nextSibling;
2682
- if (!m || !m["s-nr"]) {
2683
- E = m;
2684
- break;
2685
- }
2686
- }
2687
- b = b.previousSibling;
2688
- }
2689
- }
2690
- const $ = f.__parentNode || f.parentNode, w = f.__nextSibling || f.nextSibling;
2691
- (!E && y !== $ || w !== E) && f !== E && (!f["s-hn"] && f["s-ol"] && (f["s-hn"] = f["s-ol"].parentNode.nodeName), _e(y, f, E), f.nodeType === 1 && f.tagName !== "SLOT-FB" && (f.hidden = (a = f["s-ih"]) != null ? a : !1)), f && typeof p["s-rf"] == "function" && p["s-rf"](p);
2692
- } else f.nodeType === 1 && (f.hidden = !0);
2693
- }
2694
- }
2695
- nt && Ts(d.$elm$), Oe.$flags$ &= -2, se.length = 0;
2696
- }
2697
- if (He.experimentalScopedSlotChanges && h.$flags$ & 2) {
2698
- const g = d.$elm$.__childNodes || d.$elm$.childNodes;
2699
- for (const f of g)
2700
- f["s-hn"] !== Fe && !f["s-sh"] && f.nodeType === 1 && (s && f["s-ih"] == null && (f["s-ih"] = (o = f.hidden) != null ? o : !1), f.hidden = !0);
2701
- }
2702
- rt = void 0;
364
+ var M, N, P, F = !1, I = !1, L = !1, R = !1, z = [], B = [], V = (e, t, n) => {
365
+ let r = t.$children$[n], i = 0, a, o, s;
366
+ if (F || (L = !0, r.$tag$ === "slot" && (r.$flags$ |= r.$children$ ? 2 : 1)), r.$text$ != null) a = r.$elm$ = C.document.createTextNode(r.$text$);
367
+ else if (r.$flags$ & 1) a = r.$elm$ = C.document.createTextNode(""), j(null, r, R);
368
+ else {
369
+ if (R ||= r.$tag$ === "svg", !C.document) throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
370
+ if (a = r.$elm$ = C.document.createElementNS(R ? Se : Ce, !F && b.slotRelocation && r.$flags$ & 2 ? "slot-fb" : r.$tag$), R && r.$tag$ === "foreignObject" && (R = !1), j(null, r, R), je(M) && a["s-si"] !== M && a.classList.add(a["s-si"] = M), r.$children$) {
371
+ let t = r.$tag$ === "template" ? a.content : a;
372
+ for (i = 0; i < r.$children$.length; ++i) o = V(e, r, i), o && t.appendChild(o);
373
+ }
374
+ r.$tag$ === "svg" ? R = !1 : a.tagName === "foreignObject" && (R = !0);
375
+ }
376
+ return a["s-hn"] = P, r.$flags$ & 3 && (a["s-sr"] = !0, a["s-cr"] = N, a["s-sn"] = r.$name$ || "", a["s-rf"] = r.$attrs$?.ref, Oe(a), s = e && e.$children$ && e.$children$[n], s && s.$tag$ === r.$tag$ && e.$elm$ && Ve(e.$elm$), Ye(N, a, t.$elm$, e?.$elm$)), a;
377
+ }, Ve = (e) => {
378
+ w.$flags$ |= 1;
379
+ let t = e.closest(P.toLowerCase());
380
+ if (t != null) {
381
+ let n = Array.from(t.__childNodes || t.childNodes).find((e) => e["s-cr"]), r = Array.from(e.__childNodes || e.childNodes);
382
+ for (let e of n ? r.reverse() : r) e["s-sh"] != null && (q(t, e, n ?? null), e["s-sh"] = void 0, L = !0);
383
+ }
384
+ w.$flags$ &= -2;
385
+ }, H = (e, t) => {
386
+ w.$flags$ |= 1;
387
+ let n = Array.from(e.__childNodes || e.childNodes);
388
+ if (e["s-sr"]) {
389
+ let t = e;
390
+ for (; t = t.nextSibling;) t && t["s-sn"] === e["s-sn"] && t["s-sh"] === P && n.push(t);
391
+ }
392
+ for (let e = n.length - 1; e >= 0; e--) {
393
+ let r = n[e];
394
+ r["s-hn"] !== P && r["s-ol"] && (q(W(r).parentNode, r, W(r)), r["s-ol"].remove(), r["s-ol"] = void 0, r["s-sh"] = void 0, L = !0), t && H(r, t);
395
+ }
396
+ w.$flags$ &= -2;
397
+ }, He = (e, t, n, r, i, a) => {
398
+ let o = e["s-cr"] && e["s-cr"].parentNode || e, s;
399
+ for (o.shadowRoot && o.tagName === P && (o = o.shadowRoot), n.$tag$ === "template" && (o = o.content); i <= a; ++i) r[i] && (s = V(null, n, i), s && (r[i].$elm$ = s, q(o, s, W(t))));
400
+ }, Ue = (e, t, n) => {
401
+ for (let r = t; r <= n; ++r) {
402
+ let t = e[r];
403
+ if (t) {
404
+ let e = t.$elm$;
405
+ Ke(t), e && (I = !0, e["s-ol"] ? e["s-ol"].remove() : H(e, !0), e.remove());
406
+ }
407
+ }
408
+ }, We = (e, t, n, r, i = !1) => {
409
+ let a = 0, o = 0, s = 0, c = 0, l = t.length - 1, u = t[0], d = t[l], f = r.length - 1, p = r[0], m = r[f], h, g, _ = n.$tag$ === "template" ? e.content : e;
410
+ for (; a <= l && o <= f;) if (u == null) u = t[++a];
411
+ else if (d == null) d = t[--l];
412
+ else if (p == null) p = r[++o];
413
+ else if (m == null) m = r[--f];
414
+ else if (U(u, p, i)) G(u, p, i), u = t[++a], p = r[++o];
415
+ else if (U(d, m, i)) G(d, m, i), d = t[--l], m = r[--f];
416
+ else if (U(u, m, i)) (u.$tag$ === "slot" || m.$tag$ === "slot") && H(u.$elm$.parentNode, !1), G(u, m, i), q(_, u.$elm$, d.$elm$.nextSibling), u = t[++a], m = r[--f];
417
+ else if (U(d, p, i)) (u.$tag$ === "slot" || m.$tag$ === "slot") && H(d.$elm$.parentNode, !1), G(d, p, i), q(_, d.$elm$, u.$elm$), d = t[--l], p = r[++o];
418
+ else {
419
+ for (s = -1, c = a; c <= l; ++c) if (t[c] && t[c].$key$ !== null && t[c].$key$ === p.$key$) {
420
+ s = c;
421
+ break;
422
+ }
423
+ s >= 0 ? (g = t[s], g.$tag$ === p.$tag$ ? (G(g, p, i), t[s] = void 0, h = g.$elm$) : h = V(t && t[o], n, s), p = r[++o]) : (h = V(t && t[o], n, o), p = r[++o]), h && q(W(u.$elm$).parentNode, h, W(u.$elm$));
424
+ }
425
+ a > l ? He(e, r[f + 1] == null ? null : r[f + 1].$elm$, n, r, o, f) : o > f && Ue(t, a, l);
426
+ }, U = (e, t, n = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : n ? (n && !e.$key$ && t.$key$ && (e.$key$ = t.$key$), !0) : e.$key$ === t.$key$ : !1, W = (e) => e && e["s-ol"] || e, G = (e, t, n = !1) => {
427
+ let r = t.$elm$ = e.$elm$, i = e.$children$, a = t.$children$, o = t.$tag$, s = t.$text$, c;
428
+ s == null ? (R = o === "svg" ? !0 : o === "foreignObject" ? !1 : R, o === "slot" && !F && e.$name$ !== t.$name$ && (t.$elm$["s-sn"] = t.$name$ || "", Ve(t.$elm$.parentElement)), j(e, t, R), i !== null && a !== null ? We(r, i, t, a, n) : a === null ? !n && b.updatable && i !== null && Ue(i, 0, i.length - 1) : (e.$text$ !== null && (r.textContent = ""), He(r, null, t, a, 0, a.length - 1)), R && o === "svg" && (R = !1)) : (c = r["s-cr"]) ? c.parentNode.textContent = s : e.$text$ !== s && (r.data = s);
429
+ }, K = [], Ge = (e) => {
430
+ let t, n, r, i = e.__childNodes || e.childNodes;
431
+ for (let e of i) {
432
+ if (e["s-sr"] && (t = e["s-cr"]) && t.parentNode) {
433
+ n = t.parentNode.__childNodes || t.parentNode.childNodes;
434
+ let i = e["s-sn"];
435
+ for (r = n.length - 1; r >= 0; r--) if (t = n[r], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== e["s-hn"] && (!t["s-sh"] || t["s-sh"] !== e["s-hn"])) if (De(t, i)) {
436
+ let n = K.find((e) => e.$nodeToRelocate$ === t);
437
+ I = !0, t["s-sn"] = t["s-sn"] || i, n ? (n.$nodeToRelocate$["s-sh"] = e["s-hn"], n.$slotRefNode$ = e) : (t["s-sh"] = e["s-hn"], K.push({
438
+ $slotRefNode$: e,
439
+ $nodeToRelocate$: t
440
+ })), t["s-sr"] && K.map((e) => {
441
+ De(e.$nodeToRelocate$, t["s-sn"]) && (n = K.find((e) => e.$nodeToRelocate$ === t), n && !e.$slotRefNode$ && (e.$slotRefNode$ = n.$slotRefNode$));
442
+ });
443
+ } else K.some((e) => e.$nodeToRelocate$ === t) || K.push({ $nodeToRelocate$: t });
444
+ }
445
+ e.nodeType === 1 && Ge(e);
446
+ }
447
+ }, Ke = (e) => {
448
+ e.$attrs$ && e.$attrs$.ref && z.push(() => e.$attrs$.ref(null)), e.$children$ && e.$children$.map(Ke);
449
+ }, qe = (e, t) => {
450
+ B.push(() => e(t));
451
+ }, Je = () => {
452
+ z.forEach((e) => e()), z.length = 0, B.forEach((e) => e()), B.length = 0;
453
+ }, q = (e, t, n, r) => {
454
+ if (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"]) Ye(t["s-cr"], t, e, t.parentElement);
455
+ else if (typeof t["s-sn"] == "string") {
456
+ e.insertBefore(t, n);
457
+ let { slotNode: i } = Ae(t);
458
+ return i && !r && ke(i), t;
459
+ }
460
+ return e.__insertBefore ? e.__insertBefore(t, n) : e?.insertBefore(t, n);
2703
461
  };
2704
- const Ie = {
2705
- content_wrap: 0,
2706
- ignore: [],
2707
- ignore_with: "!i-£___£%_",
2708
- strict: !1,
2709
- tab_size: 2,
2710
- tag_wrap: 0,
2711
- trim: []
2712
- }, js = [
2713
- "area",
2714
- "base",
2715
- "br",
2716
- "col",
2717
- "embed",
2718
- "hr",
2719
- "img",
2720
- "input",
2721
- "link",
2722
- "meta",
2723
- "param",
2724
- "source",
2725
- "track",
2726
- "wbr"
2727
- ], Ps = {
2728
- checked_html: !1,
2729
- config: { ...Ie },
2730
- ignored: !1,
2731
- constants: {
2732
- CONTENT_IGNORE_PLACEHOLDER: `${Ie.ignore_with}_`,
2733
- SELF_CLOSING_PLACEHOLDER: `${Ie.ignore_with}/_>`,
2734
- ATTRIBUTE_IGNORE_PLACEHOLDER: `${Ie.ignore_with}=_`
2735
- }
2736
- }, U = () => Ps, Ze = (t) => Object.assign(Ps, t), Ds = (t) => (Ze({ checked_html: !0 }), /<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(t) || /<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(t) || /<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(t)), Is = (t, e) => {
2737
- if (!t || !e)
2738
- throw new Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");
2739
- let s;
2740
- if (Array.isArray(t))
2741
- s = structuredClone(t).concat(e);
2742
- else if (typeof t == "object") {
2743
- s = { ...t };
2744
- for (let r of Object.keys(e))
2745
- typeof e[r] != "object" ? s[r] = e[r] : s[r] = Is(s[r] || {}, e[r]);
2746
- }
2747
- return s;
2748
- }, $i = (t, e) => {
2749
- const s = Is(t, e);
2750
- return Ze({
2751
- config: s,
2752
- constants: {
2753
- CONTENT_IGNORE_PLACEHOLDER: `${s.ignore_with}_`,
2754
- SELF_CLOSING_PLACEHOLDER: `${s.ignore_with}/_>`,
2755
- ATTRIBUTE_IGNORE_PLACEHOLDER: `${s.ignore_with}=_`
2756
- }
2757
- }), s;
2758
- }, vi = (t) => {
2759
- const { constants: e } = U();
2760
- return t = t.replace(/<[\w:\-]+([^>]*[^\/])>/g, (s, r) => s.replace(r, (n) => n.replace(/\n/g, e.ATTRIBUTE_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, e.ATTRIBUTE_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, e.ATTRIBUTE_IGNORE_PLACEHOLDER + "ws!"))), t;
2761
- }, _i = (t) => {
2762
- const { constants: e } = U();
2763
- return t.replace(/\n/g, e.CONTENT_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, e.CONTENT_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, e.CONTENT_IGNORE_PLACEHOLDER + "ws!");
2764
- }, mi = (t) => {
2765
- const e = /\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g, { constants: s } = U();
2766
- return t.replace(e, (r, n, i, a, o) => {
2767
- const l = i || o;
2768
- if (!l)
2769
- return r;
2770
- const h = l.replace(/\n/g, s.CONTENT_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, s.CONTENT_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, s.CONTENT_IGNORE_PLACEHOLDER + "ws!");
2771
- return r.replace(l, h);
2772
- });
2773
- }, yi = (t) => {
2774
- const e = /<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g, { constants: s } = U();
2775
- return t = t.replace(e, (r, n, i) => r.replace(i, (a) => a.replace(/</g, s.ATTRIBUTE_IGNORE_PLACEHOLDER + "lt!").replace(/>/g, s.ATTRIBUTE_IGNORE_PLACEHOLDER + "gt!"))), t;
2776
- }, Ei = (t, e) => {
2777
- for (let s = 0; s < e.length; s++) {
2778
- const r = new RegExp(`(<${e[s]}[^>]*>)\\s+`, "g"), n = new RegExp(`\\s+(</${e[s]}>)`, "g");
2779
- t = t.replace(r, "$1").replace(n, "$1");
2780
- }
2781
- return t;
2782
- }, wi = (t) => {
2783
- const { constants: e } = U();
2784
- return t = t.replace(/<[\w:\-]+([^>]*[^\/])>/g, (s, r) => s.replace(r, (n) => n.replace(new RegExp(e.ATTRIBUTE_IGNORE_PLACEHOLDER + "nl!", "g"), `
2785
- `).replace(new RegExp(e.ATTRIBUTE_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(new RegExp(e.ATTRIBUTE_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), t;
2786
- }, bi = (t) => {
2787
- const { constants: e } = U();
2788
- return t = t.replace(new RegExp(`.*${e.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!.*`, "g"), (s) => s.replace(new RegExp(`${e.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!`, "g"), (r) => r.replace(new RegExp(e.CONTENT_IGNORE_PLACEHOLDER + "nl!", "g"), `
2789
- `).replace(new RegExp(e.CONTENT_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(new RegExp(e.CONTENT_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), t;
2790
- }, Si = (t) => {
2791
- const e = /<([\w:\-]+)([^>]*)>/g, { constants: s } = U(), r = s.ATTRIBUTE_IGNORE_PLACEHOLDER.replace(
2792
- /[-\/\\^$*+?.()|[\]{}]/g,
2793
- "\\$&"
2794
- ), n = new RegExp(r + "lt!", "g"), i = new RegExp(r + "gt!", "g");
2795
- return t.replace(
2796
- e,
2797
- (a, o, l) => {
2798
- const h = l.replace(n, "<").replace(i, ">");
2799
- return `<${o}${h}>`;
2800
- }
2801
- );
2802
- }, xi = (t) => {
2803
- if (typeof t != "object") throw new Error("Config must be an object.");
2804
- const e = { ...Ie };
2805
- if (!(Object.hasOwn(t, "content_wrap") || Object.hasOwn(t, "ignore") || Object.hasOwn(t, "ignore_with") || Object.hasOwn(t, "strict") || Object.hasOwn(t, "tab_size") || Object.hasOwn(t, "tag_wrap") || Object.hasOwn(t, "trim")))
2806
- return Ze({ config: e }), e;
2807
- let r = t.tab_size;
2808
- if (r) {
2809
- if (typeof r != "number") throw new Error(`tab_size must be a number, not ${typeof t.tab_size}.`);
2810
- if (!Number.isSafeInteger(r)) throw new Error(`Tab size ${r} is not safe. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more info.`);
2811
- if (r = Math.floor(r), r < 1 || r > 16) throw new Error("Tab size out of range. Expecting 1 to 16.");
2812
- t.tab_size = r;
2813
- }
2814
- if (Object.hasOwn(t, "content_wrap") && typeof t.content_wrap != "number")
2815
- throw new Error(`content_wrap config must be a number, not ${typeof t.content_wrap}.`);
2816
- if (Object.hasOwn(t, "ignore") && (!Array.isArray(t.ignore) || !t.ignore?.every((n) => typeof n == "string")))
2817
- throw new Error("Ignore config must be an array of strings.");
2818
- if (Object.hasOwn(t, "ignore_with")) {
2819
- if (typeof t.ignore_with != "string")
2820
- throw new Error(`ignore_with must be a string, not ${typeof t.ignore_with}.`);
2821
- if (t.ignore_with.startsWith("_"))
2822
- throw new Error("ignore_with cannot start with an underscore.");
2823
- }
2824
- if (Object.hasOwn(t, "strict") && typeof t.strict != "boolean")
2825
- throw new Error(`Strict config must be a boolean, not ${typeof t.strict}.`);
2826
- if (Object.hasOwn(t, "tag_wrap") && typeof t.tag_wrap != "number")
2827
- throw new Error(`tag_wrap config must be a number, not ${typeof t.tag_wrap}.`);
2828
- if (Object.hasOwn(t, "trim") && (!Array.isArray(t.trim) || !t.trim?.every((n) => typeof n == "string")))
2829
- throw new Error("Trim config must be an array of strings.");
2830
- return $i(e, t);
2831
- }, Oi = (t, e, s) => {
2832
- const r = t.trim().split(/\s+/);
2833
- if (r.length === 0 || r.length === 1 && r[0] === "")
2834
- return "";
2835
- const n = [];
2836
- let i = "";
2837
- const a = s;
2838
- r.forEach((l) => {
2839
- if (l === "") return;
2840
- if (l.length >= e) {
2841
- i !== "" && n.push(n.length === 0 ? s + i : a + i), n.push(n.length === 0 ? s + l : a + l), i = "";
2842
- return;
2843
- }
2844
- const h = i === "" ? l : i + " " + l;
2845
- h.length <= e ? i = h : (i !== "" && n.push(n.length === 0 ? s + i : a + i), i = l);
2846
- }), i !== "" && n.push(n.length === 0 ? s + i : a + i);
2847
- const o = n.join(`
2848
- `);
2849
- return _i(o);
2850
- };
2851
- function Ws(t) {
2852
- Ze({ ignored: !0 });
2853
- const e = U().config;
2854
- let s = t;
2855
- const r = /* @__PURE__ */ new Map();
2856
- let n = 0;
2857
- const i = "___HTMLFY_SPECIAL_IGNORE_MARKER_";
2858
- for (const a of e.ignore) {
2859
- const o = a.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), l = new RegExp(
2860
- `(<\\s*${o}[^>]*>)(.*?)(<\\s*/\\s*${o}\\s*>)`,
2861
- "gs"
2862
- // global and dotAll
2863
- );
2864
- let h;
2865
- const c = [];
2866
- for (; (h = l.exec(s)) !== null; ) {
2867
- const u = `${i}${n++}___`;
2868
- r.set(u, h[2]), c.push({
2869
- start: h.index + h[1].length,
2870
- // start of content
2871
- end: h.index + h[1].length + h[2].length,
2872
- // end of content
2873
- marker: u
2874
- });
2875
- }
2876
- for (let u = c.length - 1; u >= 0; u--) {
2877
- const d = c[u];
2878
- s = s.substring(0, d.start) + d.marker + s.substring(d.end);
2879
- }
2880
- }
2881
- return { html_with_markers: s, extracted_map: r };
2882
- }
2883
- function zs(t, e) {
2884
- Ze({ ignored: !1 });
2885
- let s = t;
2886
- for (const [r, n] of e)
2887
- s = s.split(r).join(n);
2888
- return s;
462
+ function Ye(e, t, n, r) {
463
+ var i;
464
+ let a;
465
+ if (e && typeof t["s-sn"] == "string" && t["s-sr"] && e.parentNode && e.parentNode["s-sc"] && (a = t["s-si"] || e.parentNode["s-sc"])) {
466
+ let e = t["s-sn"], o = t["s-hn"];
467
+ if ((i = n.classList) == null || i.add(a + "-s"), r && r.classList?.contains(a + "-s")) {
468
+ let t = (r.__childNodes || r.childNodes)[0], n = !1;
469
+ for (; t;) {
470
+ if (t["s-sn"] !== e && t["s-hn"] === o && t["s-sr"]) {
471
+ n = !0;
472
+ break;
473
+ }
474
+ t = t.nextSibling;
475
+ }
476
+ n || r.classList.remove(a + "-s");
477
+ }
478
+ }
2889
479
  }
2890
- const Ti = new RegExp(`<(${js.join("|")})(?:\\s(?:[^/>]|/(?!>))*)*>`, "g");
2891
- function Ai(t) {
2892
- const { constants: e } = U();
2893
- return t.replace(
2894
- // match only void elements that are not self-closing
2895
- Ti,
2896
- (s) => s.replace(/>$/, e.SELF_CLOSING_PLACEHOLDER)
2897
- );
480
+ var Xe = (e, t, n = !1) => {
481
+ let r = e.$hostElement$, i = e.$cmpMeta$, a = e.$vnode$ || k(null, null), o = Fe(t) ? t : Ne(null, null, t);
482
+ if (P = r.tagName, i.$attrsToReflect$ && (o.$attrs$ = o.$attrs$ || {}, i.$attrsToReflect$.forEach(([t, n]) => {
483
+ b.serializer && e.$serializerValues$.has(t) ? o.$attrs$[n] = e.$serializerValues$.get(t) : o.$attrs$[n] = r[t];
484
+ })), n && o.$attrs$) for (let e of Object.keys(o.$attrs$)) r.hasAttribute(e) && ![
485
+ "key",
486
+ "ref",
487
+ "style",
488
+ "class"
489
+ ].includes(e) && (o.$attrs$[e] = r[e]);
490
+ if (o.$tag$ = null, o.$flags$ |= 4, e.$vnode$ = o, o.$elm$ = a.$elm$ = r.shadowRoot || r, M = r["s-sc"], F = !!(i.$flags$ & 1) && !(i.$flags$ & 128), N = r["s-cr"], I = !1, G(a, o, n), w.$flags$ |= 1, L) {
491
+ Ge(o.$elm$);
492
+ for (let e of K) {
493
+ let t = e.$nodeToRelocate$;
494
+ if (!t["s-ol"] && C.document) {
495
+ let e = C.document.createTextNode("");
496
+ e["s-nr"] = t, q(t.parentNode, t["s-ol"] = e, t, n);
497
+ }
498
+ }
499
+ for (let e of K) {
500
+ let t = e.$nodeToRelocate$, r = e.$slotRefNode$;
501
+ if (t.nodeType === 1 && n && (t["s-ih"] = t.hidden ?? !1), r) {
502
+ let e = r.parentNode, i = r.nextSibling;
503
+ if (i && i.nodeType === 1) {
504
+ let n = t["s-ol"]?.previousSibling;
505
+ for (; n;) {
506
+ let r = n["s-nr"] ?? null;
507
+ if (r && r["s-sn"] === t["s-sn"] && e === (r.__parentNode || r.parentNode)) {
508
+ for (r = r.nextSibling; r === t || r?.["s-sr"];) r = r?.nextSibling;
509
+ if (!r || !r["s-nr"]) {
510
+ i = r;
511
+ break;
512
+ }
513
+ }
514
+ n = n.previousSibling;
515
+ }
516
+ }
517
+ let a = t.__parentNode || t.parentNode, o = t.__nextSibling || t.nextSibling;
518
+ if ((!i && e !== a || o !== i) && t !== i) {
519
+ if (q(e, t, i, n), t.nodeType === 8 && t.nodeValue.startsWith("s-nt-")) {
520
+ let e = C.document.createTextNode(t.nodeValue.replace(/^s-nt-/, ""));
521
+ e["s-hn"] = t["s-hn"], e["s-sn"] = t["s-sn"], e["s-sh"] = t["s-sh"], e["s-sr"] = t["s-sr"], e["s-ol"] = t["s-ol"], e["s-ol"]["s-nr"] = e, q(t.parentNode, e, t, n), t.parentNode.removeChild(t);
522
+ }
523
+ t.nodeType === 1 && t.tagName !== "SLOT-FB" && (t.hidden = t["s-ih"] ?? !1);
524
+ }
525
+ t && typeof r["s-rf"] == "function" && r["s-rf"](r);
526
+ } else t.nodeType === 1 && (t.hidden = !0);
527
+ }
528
+ }
529
+ if (I && T(o.$elm$), w.$flags$ &= -2, K.length = 0, !F && !(i.$flags$ & 1) && r["s-cr"]) {
530
+ let e = o.$elm$.__childNodes || o.$elm$.childNodes;
531
+ for (let t of e) if (t["s-hn"] !== P && !t["s-sh"]) {
532
+ if (n && t["s-ih"] == null && (t["s-ih"] = t.hidden ?? !1), t.nodeType === 1) t.hidden = !0;
533
+ else if (t.nodeType === 3 && t.nodeValue.trim()) {
534
+ let e = C.document.createComment("s-nt-" + t.nodeValue);
535
+ e["s-sn"] = t["s-sn"], q(t.parentNode, e, t, n), t.parentNode.removeChild(t);
536
+ }
537
+ }
538
+ }
539
+ N = void 0, Je();
540
+ }, J = {
541
+ content_wrap: 0,
542
+ ignore: [],
543
+ ignore_with: "!i-£___£%_",
544
+ strict: !1,
545
+ tab_size: 2,
546
+ tag_wrap: 0,
547
+ trim: []
548
+ }, Y = [
549
+ "area",
550
+ "base",
551
+ "br",
552
+ "col",
553
+ "embed",
554
+ "hr",
555
+ "img",
556
+ "input",
557
+ "link",
558
+ "meta",
559
+ "param",
560
+ "source",
561
+ "track",
562
+ "wbr"
563
+ ], Ze = {
564
+ checked_html: !1,
565
+ config: { ...J },
566
+ ignored: !1,
567
+ constants: {
568
+ CONTENT_IGNORE_PLACEHOLDER: `${J.ignore_with}_`,
569
+ SELF_CLOSING_PLACEHOLDER: `${J.ignore_with}/_>`,
570
+ ATTRIBUTE_IGNORE_PLACEHOLDER: `${J.ignore_with}=_`
571
+ }
572
+ }, X = () => Ze, Z = (e) => Object.assign(Ze, e), Qe = (e) => (Z({ checked_html: !0 }), /<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(e) || /<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e) || /<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e)), $e = (e, t) => {
573
+ if (!e || !t) throw Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");
574
+ let n;
575
+ if (Array.isArray(e)) n = structuredClone(e).concat(t);
576
+ else if (typeof e == "object") {
577
+ n = { ...e };
578
+ for (let e of Object.keys(t)) typeof t[e] == "object" ? n[e] = $e(n[e] || {}, t[e]) : n[e] = t[e];
579
+ }
580
+ return n;
581
+ }, et = (e, t) => {
582
+ let n = $e(e, t);
583
+ return Z({
584
+ config: n,
585
+ constants: {
586
+ CONTENT_IGNORE_PLACEHOLDER: `${n.ignore_with}_`,
587
+ SELF_CLOSING_PLACEHOLDER: `${n.ignore_with}/_>`,
588
+ ATTRIBUTE_IGNORE_PLACEHOLDER: `${n.ignore_with}=_`
589
+ }
590
+ }), n;
591
+ }, tt = (e) => {
592
+ let { constants: t } = X();
593
+ return e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (e, n) => e.replace(n, (e) => e.replace(/\n/g, t.ATTRIBUTE_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, t.ATTRIBUTE_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, t.ATTRIBUTE_IGNORE_PLACEHOLDER + "ws!"))), e;
594
+ }, nt = (e) => {
595
+ let { constants: t } = X();
596
+ return e.replace(/\n/g, t.CONTENT_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, t.CONTENT_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, t.CONTENT_IGNORE_PLACEHOLDER + "ws!");
597
+ }, rt = (e) => {
598
+ let t = /\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g, { constants: n } = X();
599
+ return e.replace(t, (e, t, r, i, a) => {
600
+ let o = r || a;
601
+ if (!o) return e;
602
+ let s = o.replace(/\n/g, n.CONTENT_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, n.CONTENT_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, n.CONTENT_IGNORE_PLACEHOLDER + "ws!");
603
+ return e.replace(o, s);
604
+ });
605
+ }, it = (e) => {
606
+ let t = /<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g, { constants: n } = X();
607
+ return e = e.replace(t, (e, t, r) => e.replace(r, (e) => e.replace(/</g, n.ATTRIBUTE_IGNORE_PLACEHOLDER + "lt!").replace(/>/g, n.ATTRIBUTE_IGNORE_PLACEHOLDER + "gt!"))), e;
608
+ }, at = (e, t) => {
609
+ for (let n = 0; n < t.length; n++) {
610
+ let r = RegExp(`(<${t[n]}[^>]*>)\\s+`, "g"), i = RegExp(`\\s+(</${t[n]}>)`, "g");
611
+ e = e.replace(r, "$1").replace(i, "$1");
612
+ }
613
+ return e;
614
+ }, ot = (e) => {
615
+ let { constants: t } = X();
616
+ return e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (e, n) => e.replace(n, (e) => e.replace(RegExp(t.ATTRIBUTE_IGNORE_PLACEHOLDER + "nl!", "g"), "\n").replace(RegExp(t.ATTRIBUTE_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(RegExp(t.ATTRIBUTE_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), e;
617
+ }, st = (e) => {
618
+ let { constants: t } = X();
619
+ return e = e.replace(RegExp(`.*${t.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!.*`, "g"), (e) => e.replace(RegExp(`${t.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!`, "g"), (e) => e.replace(RegExp(t.CONTENT_IGNORE_PLACEHOLDER + "nl!", "g"), "\n").replace(RegExp(t.CONTENT_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(RegExp(t.CONTENT_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), e;
620
+ }, ct = (e) => {
621
+ let t = /<([\w:\-]+)([^>]*)>/g, { constants: n } = X(), r = n.ATTRIBUTE_IGNORE_PLACEHOLDER.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), i = RegExp(r + "lt!", "g"), a = RegExp(r + "gt!", "g");
622
+ return e.replace(t, (e, t, n) => `<${t}${n.replace(i, "<").replace(a, ">")}>`);
623
+ }, lt = (e) => {
624
+ if (typeof e != "object") throw Error("Config must be an object.");
625
+ let t = { ...J };
626
+ if (!(Object.hasOwn(e, "content_wrap") || Object.hasOwn(e, "ignore") || Object.hasOwn(e, "ignore_with") || Object.hasOwn(e, "strict") || Object.hasOwn(e, "tab_size") || Object.hasOwn(e, "tag_wrap") || Object.hasOwn(e, "trim"))) return Z({ config: t }), t;
627
+ let n = e.tab_size;
628
+ if (n) {
629
+ if (typeof n != "number") throw Error(`tab_size must be a number, not ${typeof e.tab_size}.`);
630
+ if (!Number.isSafeInteger(n)) throw Error(`Tab size ${n} is not safe. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more info.`);
631
+ if (n = Math.floor(n), n < 1 || n > 16) throw Error("Tab size out of range. Expecting 1 to 16.");
632
+ e.tab_size = n;
633
+ }
634
+ if (Object.hasOwn(e, "content_wrap") && typeof e.content_wrap != "number") throw Error(`content_wrap config must be a number, not ${typeof e.content_wrap}.`);
635
+ if (Object.hasOwn(e, "ignore") && (!Array.isArray(e.ignore) || !e.ignore?.every((e) => typeof e == "string"))) throw Error("Ignore config must be an array of strings.");
636
+ if (Object.hasOwn(e, "ignore_with")) {
637
+ if (typeof e.ignore_with != "string") throw Error(`ignore_with must be a string, not ${typeof e.ignore_with}.`);
638
+ if (e.ignore_with.startsWith("_")) throw Error("ignore_with cannot start with an underscore.");
639
+ }
640
+ if (Object.hasOwn(e, "strict") && typeof e.strict != "boolean") throw Error(`Strict config must be a boolean, not ${typeof e.strict}.`);
641
+ if (Object.hasOwn(e, "tag_wrap") && typeof e.tag_wrap != "number") throw Error(`tag_wrap config must be a number, not ${typeof e.tag_wrap}.`);
642
+ if (Object.hasOwn(e, "trim") && (!Array.isArray(e.trim) || !e.trim?.every((e) => typeof e == "string"))) throw Error("Trim config must be an array of strings.");
643
+ return et(t, e);
644
+ }, ut = (e, t, n) => {
645
+ let r = e.trim().split(/\s+/);
646
+ if (r.length === 0 || r.length === 1 && r[0] === "") return "";
647
+ let i = [], a = "", o = n;
648
+ return r.forEach((e) => {
649
+ if (e === "") return;
650
+ if (e.length >= t) {
651
+ a !== "" && i.push(i.length === 0 ? n + a : o + a), i.push(i.length === 0 ? n + e : o + e), a = "";
652
+ return;
653
+ }
654
+ let r = a === "" ? e : a + " " + e;
655
+ r.length <= t ? a = r : (a !== "" && i.push(i.length === 0 ? n + a : o + a), a = e);
656
+ }), a !== "" && i.push(i.length === 0 ? n + a : o + a), nt(i.join("\n"));
657
+ };
658
+ function dt(e) {
659
+ Z({ ignored: !0 });
660
+ let t = X().config, n = e, r = /* @__PURE__ */ new Map(), i = 0;
661
+ for (let e of t.ignore) {
662
+ let t = e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), a = RegExp(`(<\\s*${t}[^>]*>)(.*?)(<\\s*\/\\s*${t}\\s*>)`, "gs"), o, s = [];
663
+ for (; (o = a.exec(n)) !== null;) {
664
+ let e = `___HTMLFY_SPECIAL_IGNORE_MARKER_${i++}___`;
665
+ r.set(e, o[2]), s.push({
666
+ start: o.index + o[1].length,
667
+ end: o.index + o[1].length + o[2].length,
668
+ marker: e
669
+ });
670
+ }
671
+ for (let e = s.length - 1; e >= 0; e--) {
672
+ let t = s[e];
673
+ n = n.substring(0, t.start) + t.marker + n.substring(t.end);
674
+ }
675
+ }
676
+ return {
677
+ html_with_markers: n,
678
+ extracted_map: r
679
+ };
2898
680
  }
2899
- function Ri(t) {
2900
- const { constants: e } = U();
2901
- return t.replace(e.SELF_CLOSING_PLACEHOLDER, ">");
681
+ function ft(e, t) {
682
+ Z({ ignored: !1 });
683
+ let n = e;
684
+ for (let [e, r] of t) n = n.split(e).join(r);
685
+ return n;
2902
686
  }
2903
- const Ni = (t, e = !1) => (t = t.replace(/<\s*textarea[^>]*>((.|\n)*?)<s*\/\s*textarea\s*>/g, (s, r) => s.replace(r, (n) => n.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/\n/g, "&#10;").replace(/\r/g, "&#13;").replace(/\s/g, "&nbsp;"))), e && (t = t.replace(/<\s*textarea[^>]*>(.|\n)*?<\s*\/\s*textarea\s*>/g, (s) => s.replace(/\s+/g, " ").replace(/\s>/g, ">").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/<\s/g, "<").replace(/<\/\s/g, "</").replace(/class=["']\s/g, (r) => r.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"))), t), Li = (t) => t = t.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (e, s) => e.replace(s, (r) => (r = r.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&#10;/g, `
2904
- `).replace(/&#13;/g, "\r").replace(/&nbsp;/g, " ").replace(/\s+/g, " "), r)));
2905
- let Zt;
2906
- const Mi = (t, e) => {
2907
- let s = !1;
2908
- const { checked_html: r, ignored: n, constants: i } = U();
2909
- if (!r && !Ds(t)) return t;
2910
- const o = U().config.ignore.length > 0;
2911
- if (!n && o) {
2912
- const { html_with_markers: l, extracted_map: h } = Ws(t);
2913
- t = l, Zt = h, s = !0;
2914
- }
2915
- return t = Ni(t, !0), t = t.replace(/\n|\t/g, ""), t = t.replace(/>\s+</g, "><"), t = t.replace(/ {2,}/g, " "), t = t.replace(
2916
- /(\S) (<[a-zA-Z][a-zA-Z0-9_:-]*)/g,
2917
- "$1___MINIFY-PROTECTED-SPACE___$2"
2918
- ), t = t.replace(
2919
- /(<\/[a-zA-Z][a-zA-Z0-9_:-]*>) (\S)/g,
2920
- "$1___MINIFY-PROTECTED-SPACE___$2"
2921
- ), t = t.replace(/ >/g, ">"), t = t.replace(/ </g, "<"), t = t.replace(/> /g, ">"), t = t.replace(/< /g, "<"), t = t.replace(/<\s+\//g, "</"), t = t.replace(/<\/\s+/g, "</"), t = t.replace(new RegExp("___MINIFY-PROTECTED-SPACE___", "g"), " "), t = t.replace(/ = /g, "="), t = t.replace(
2922
- /([a-zA-Z0-9_-]+)=(['"])(.*?)\2/g,
2923
- (l, h, c, u) => {
2924
- const d = u.trim();
2925
- return `${h}=${c}${d}${c}`;
2926
- }
2927
- ), t = t.trim(), t = Li(t), s && (t = zs(t, Zt)), t;
2928
- }, Ge = {
2929
- line: []
2930
- };
2931
- let qt;
2932
- const ki = (t) => {
2933
- Ge.line = [];
2934
- let e = -1;
2935
- const s = /(<[^>]+>)|([^<]+)/g;
2936
- t.replace(s, (r, n, i) => (n ? Ge.line.push({ type: "tag", value: r }) : i && i.trim().length > 0 && Ge.line.push({ type: "text", value: r }), e++, `
2937
- [#-# : ${e} : ${r} : #-#]
2938
- `));
2939
- }, Ci = () => {
2940
- const { config: t, constants: e } = U(), s = " ".repeat(t.tab_size), r = t.tag_wrap, n = t.content_wrap, i = t.strict;
2941
- let a = "";
2942
- const o = [], l = /<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g, h = /\s{1}[A-Za-z-]+(?:=".*?")?/g;
2943
- Ge.line.forEach((u, d) => {
2944
- let g = u.value;
2945
- const f = g.startsWith("___HTMLFY_SPECIAL_IGNORE_MARKER_");
2946
- let p = 0;
2947
- const y = Ge.line[d - 1], E = y?.value ?? "";
2948
- a += "0", d === 0 && p++, g.trim().startsWith("</") && p++, E.trim().startsWith("<!doctype") && p++, E.trim().startsWith("<!--") && p++, (E.trim().endsWith("/>") || E.trim().endsWith(e.SELF_CLOSING_PLACEHOLDER)) && p++, E.trim().startsWith("</") && p++, y?.type === "text" && p++;
2949
- const w = Math.max(0, a.length - p);
2950
- if (a = a.substring(0, w), u.type === "text" && /^[!,;\.]/.test(g)) {
2951
- if (g.length === 1) {
2952
- o[o.length - 1] = o.at(-1) + g;
2953
- return;
2954
- } else if (o[o.length - 1] = o.at(-1) + g.charAt(0), g = g.slice(1).trim(), g.length === 0) return;
2955
- }
2956
- const b = s.repeat(w);
2957
- if (f)
2958
- o.push(g);
2959
- else {
2960
- if (i && g.trim().startsWith("<!--"))
2961
- return;
2962
- let m = g;
2963
- if (m = Ri(m), u.type === "text" && n > 0 && m.length >= n)
2964
- m = Oi(m, n, b);
2965
- else if (r > 0 && m.length > r && l.test(m)) {
2966
- l.lastIndex = 0, h.lastIndex = 0;
2967
- const D = m.split(h).filter(Boolean);
2968
- if (D.length >= 2) {
2969
- const L = m.matchAll(h), x = b + s;
2970
- let M = b + D[0] + `
2971
- `;
2972
- for (const I of L) {
2973
- const le = I[0].trim();
2974
- M += x + le + `
2975
- `;
2976
- }
2977
- const me = D[0].match(/<([A-Za-z_:-]+)/), oe = me ? me[1] : "", Q = D.at(-1)?.endsWith("/>") && js.includes(oe), Ae = D[1].trim(), S = b + (i && Q ? " " : "");
2978
- M += S + Ae, m = M;
2979
- } else
2980
- m = b + m;
2981
- } else
2982
- m = b + m;
2983
- o.push(m);
2984
- }
2985
- });
2986
- let c = o.join(`
2987
- `);
2988
- return r > 0 && (c = vi(c)), n > 0 && new RegExp(`/\\n[ ]*[^\\n]*${e.CONTENT_IGNORE_PLACEHOLDER}[^\\n]*\\n/`).test(c) && (c = mi(c)), c = c.replace(
2989
- /<(?<Element>[^>\s]+)[^>]*>[^<]*?[^><\/\s][^<]*?<\/\k<Element>>|<script[^>]*>[\s]*<\/script>|<([\w:\._-]+)([^>]*)><\/\2>|<([\w:\._-]+)([^>]*)>[\s]+<\/\4>/g,
2990
- (u) => u.includes(e.SELF_CLOSING_PLACEHOLDER) || u.includes(e.CONTENT_IGNORE_PLACEHOLDER) ? u : u.replace(/\n|\t|\s{2,}/g, "")
2991
- ), n > 0 && (c = bi(c)), r > 0 && (c = wi(c)), i && (c = c.replace(/\s\/>|\/>/g, ">")), c.startsWith(`
2992
- `) && (c = c.substring(1)), c.endsWith(`
2993
- `) && (c = c.substring(0, c.length - 1)), c;
2994
- }, ji = (t, e) => {
2995
- let s = !1;
2996
- const { checked_html: r, ignored: n } = U();
2997
- if (!r && !Ds(t)) return t;
2998
- const i = xi(e || {}), a = i.ignore.length > 0;
2999
- if (i.trim.length > 0 && (t = Ei(t, i.trim)), !n && a) {
3000
- const { html_with_markers: o, extracted_map: l } = Ws(t);
3001
- t = o, qt = l, s = !0;
3002
- }
3003
- return t = yi(t), t = Ai(t), t = Mi(t), ki(t), t = Ci(), t = Si(t), s && (t = zs(t, qt)), t;
3004
- }, Pi = (t, e, s) => {
3005
- [null, void 0, "", !1].includes(s) || ["innerHTML", "style", ""].includes(e) || t.setAttribute(e, ["object", "function"].includes(typeof s) ? "⚠️ Property must be set through a script or a framework-specific syntax." : s);
3006
- }, Gs = (t, e, s, r, n) => {
3007
- if (e && typeof e == "string") {
3008
- const i = document.createElement(e);
3009
- Object.keys(s || {}).forEach((a) => {
3010
- Pi(i, a, s[a]);
3011
- }), r?.forEach((a) => {
3012
- Gs(i, a.$tag$, a.$attrs$, a.$children$, a.$text$);
3013
- }), s?.innerHTML && (i.innerHTML = s.innerHTML), t.appendChild(i);
3014
- }
3015
- n && (t.innerHTML = n);
3016
- }, ga = (t, e, s = []) => {
3017
- const r = {};
3018
- if (typeof t != "object")
3019
- throw new Error("filterArgs - args isn't an object.");
3020
- for (const n in t)
3021
- if (!s.includes(n)) {
3022
- const i = t[n], a = n.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
3023
- (!e || !Object.keys(e).includes(n) || e[n] !== i) && (r[a] = i);
3024
- }
3025
- return r;
3026
- }, da = (t, e) => {
3027
- const s = document.getElementById("storybook-root");
3028
- if (s !== null)
3029
- return document.querySelector("[lang]")?.setAttribute("lang", e.globals?.locale || "en"), di({
3030
- $cmpMeta$: {
3031
- $flags$: 0,
3032
- $tagName$: s.tagName
3033
- },
3034
- $hostElement$: s
3035
- }, t(e)), s.children[s.children.length - 1];
3036
- }, $a = ({ $tag$: t, $attrs$: e, $children$: s, $text$: r }) => {
3037
- const n = document.createElement("div");
3038
- return Gs(n, t, e, s, r), ji(n.innerHTML, {
3039
- tag_wrap: 40,
3040
- content_wrap: 120
3041
- }).replace(/="true"/g, "");
3042
- }, Jt = (t, e) => {
3043
- if (!e)
3044
- return;
3045
- const s = e.split("/");
3046
- return `${t}${s.slice(2, s.length - 1).join("-")}--docs`;
3047
- };
3048
- class va {
3049
- /**
3050
- * JsonDocs
3051
- */
3052
- jsonDoc;
3053
- constructor(e) {
3054
- this.jsonDoc = e;
3055
- }
3056
- /**
3057
- * Get component data from the jsonDoc
3058
- * @param tagName - tag name we want to get the data from
3059
- * @returns component data
3060
- */
3061
- #e = (e) => this.jsonDoc.components.find((s) => s.tag === e);
3062
- /**
3063
- * Get the control for the given prop
3064
- * Based on https://storybook.js.org/docs/api/arg-types#controltype
3065
- * @param prop - prop to get control for
3066
- * @returns control type and options if applicable
3067
- */
3068
- #t = (e) => {
3069
- const s = e.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (r) => r.replace(/\|/g, " OR ")).split("|").map((r) => r.trim().replace(/ OR /g, "|"));
3070
- return e.type === "string" ? { control: { type: "text" } } : e.type === "number" ? { control: { type: "number" } } : e.type === "boolean" ? { control: { type: "boolean" } } : e.type.startsWith("{") && e.type.endsWith("}") ? { control: { type: "object" } } : s.length > 1 ? s.includes("string") ? { control: { type: "text" } } : s.every((r) => r?.includes("[]")) ? { control: { type: "object" } } : (s.unshift(void 0), { control: { type: "select" }, options: s }) : { control: { type: "object" } };
3071
- };
3072
- /**
3073
- * Extract component arg types from the component data
3074
- * @param tagName - tag name we want to extract the arg types from
3075
- * @returns component arg types
3076
- */
3077
- extractArgTypes = (e) => {
3078
- const s = this.#e(e), r = s?.props.reduce((c, u) => {
3079
- const { control: d, options: g } = this.#t(u);
3080
- return {
3081
- ...c,
3082
- [u.name]: {
3083
- name: u.attr || u.name,
3084
- description: u.docs,
3085
- type: { required: u.required },
3086
- table: {
3087
- category: "props",
3088
- type: { summary: u.type },
3089
- defaultValue: { summary: u.default }
3090
- },
3091
- control: d,
3092
- options: g
3093
- }
3094
- };
3095
- }, {}), n = s?.events.reduce((c, u) => ({
3096
- ...c,
3097
- [u.event]: {
3098
- name: u.event,
3099
- description: u.docs,
3100
- table: {
3101
- category: "events",
3102
- type: { summary: u.detail }
3103
- }
3104
- }
3105
- }), {}), i = s?.methods.reduce((c, u) => ({
3106
- ...c,
3107
- [u.name]: {
3108
- name: u.name,
3109
- description: u.docs,
3110
- table: {
3111
- category: "methods",
3112
- type: { summary: u.signature }
3113
- }
3114
- }
3115
- }), {}), a = s?.slots.reduce((c, u) => ({
3116
- ...c,
3117
- [u.name]: {
3118
- name: u.name !== "" ? u.name : "default",
3119
- // default slot are unnamed
3120
- description: u.docs,
3121
- table: {
3122
- category: "slots",
3123
- type: { summary: void 0 }
3124
- }
3125
- }
3126
- }), {}), o = s?.styles.reduce((c, u) => ({
3127
- ...c,
3128
- [u.name]: {
3129
- name: u.name,
3130
- description: u.docs,
3131
- table: {
3132
- category: "custom properties",
3133
- type: { summary: void 0 }
3134
- }
3135
- }
3136
- }), {}), l = s?.dependencies.reduce((c, u) => {
3137
- const d = this.#e(u);
3138
- return d ? {
3139
- ...c,
3140
- [u]: {
3141
- name: u,
3142
- description: `<a href="./?path=/docs/${Jt("", d?.filePath)}">View Component Documentation</a>`,
3143
- table: {
3144
- category: "depends on",
3145
- type: { summary: void 0 }
3146
- }
3147
- }
3148
- } : c;
3149
- }, {}), h = s?.dependents.reduce((c, u) => {
3150
- const d = this.#e(u);
3151
- return d ? {
3152
- ...c,
3153
- [u]: {
3154
- name: u,
3155
- description: `<a href="./?path=/docs/${Jt("", d?.filePath)}">View Component Documentation</a>`,
3156
- table: {
3157
- category: "used by",
3158
- type: { summary: void 0 }
3159
- }
3160
- }
3161
- } : c;
3162
- }, {});
3163
- return {
3164
- ...r,
3165
- ...n,
3166
- ...i,
3167
- ...a,
3168
- ...o,
3169
- ...l,
3170
- ...h
3171
- };
3172
- };
3173
- /**
3174
- * Extract component description from the component data
3175
- * @param tagName - tag name we want to extract the description from
3176
- * @returns component description
3177
- */
3178
- extractComponentDescription = (e) => {
3179
- const s = this.#e(e);
3180
- return s?.readme || s?.docs;
3181
- };
687
+ var pt = RegExp(`<(${Y.join("|")})(?:\\s(?:[^/>]|/(?!>))*)*>`, "g");
688
+ function mt(e) {
689
+ let { constants: t } = X();
690
+ return e.replace(pt, (e) => e.replace(/>$/, t.SELF_CLOSING_PLACEHOLDER));
3182
691
  }
3183
- const _a = ({ disconnect: t, observe: e, takeRecords: s }) => {
3184
- class r {
3185
- /**
3186
- *
3187
- */
3188
- disconnect = t;
3189
- /**
3190
- *
3191
- */
3192
- observe = e;
3193
- /**
3194
- *
3195
- */
3196
- takeRecords = s;
3197
- /**
3198
- *
3199
- */
3200
- cb;
3201
- constructor(i) {
3202
- this.cb = i;
3203
- }
3204
- }
3205
- return [window, global].forEach((n) => {
3206
- Object.defineProperty(n, "MutationObserver", {
3207
- writable: !0,
3208
- configurable: !0,
3209
- value: r
3210
- });
3211
- }), r;
3212
- }, ma = ({ disconnect: t, observe: e }) => {
3213
- class s {
3214
- /**
3215
- *
3216
- */
3217
- disconnect = t;
3218
- /**
3219
- *
3220
- */
3221
- observe = e;
3222
- /**
3223
- *
3224
- */
3225
- unobserve;
3226
- /**
3227
- *
3228
- */
3229
- cb;
3230
- constructor(n) {
3231
- this.cb = n;
3232
- }
3233
- }
3234
- return [window, global].forEach((r) => {
3235
- Object.defineProperty(r, "ResizeObserver", {
3236
- writable: !0,
3237
- configurable: !0,
3238
- value: s
3239
- });
3240
- }), s;
3241
- };
3242
- class Di extends Event {
3243
- /**
3244
- *
3245
- */
3246
- detail;
3247
- // eslint-disable-line @typescript-eslint/no-explicit-any
692
+ function ht(e) {
693
+ let { constants: t } = X();
694
+ return e.replace(t.SELF_CLOSING_PLACEHOLDER, ">");
3248
695
  }
3249
- const ya = () => {
3250
- class t extends Di {
3251
- }
3252
- return [window, global].forEach((e) => {
3253
- Object.defineProperty(e, "SubmitEvent", {
3254
- writable: !0,
3255
- configurable: !0,
3256
- value: t
3257
- });
3258
- }), t;
3259
- }, Ea = (t) => {
3260
- const e = (s) => (setTimeout(s, 1), t(), 0);
3261
- return [window, global].forEach((s) => {
3262
- Object.defineProperty(s, "requestAnimationFrame", {
3263
- writable: !0,
3264
- configurable: !0,
3265
- value: e
3266
- });
3267
- }), e;
696
+ var gt = (e, t = !1) => (e = e.replace(/<\s*textarea[^>]*>((.|\n)*?)<s*\/\s*textarea\s*>/g, (e, t) => e.replace(t, (e) => e.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/\n/g, "&#10;").replace(/\r/g, "&#13;").replace(/\s/g, "&nbsp;"))), t && (e = e.replace(/<\s*textarea[^>]*>(.|\n)*?<\s*\/\s*textarea\s*>/g, (e) => e.replace(/\s+/g, " ").replace(/\s>/g, ">").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/<\s/g, "<").replace(/<\/\s/g, "</").replace(/class=["']\s/g, (e) => e.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"))), e), _t = (e) => e = e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (e, t) => e.replace(t, (e) => (e = e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&apos;/g, "'").replace(/&#10;/g, "\n").replace(/&#13;/g, "\r").replace(/&nbsp;/g, " ").replace(/\s+/g, " "), e))), vt, yt = (e, t) => {
697
+ let n = !1, { checked_html: r, ignored: i, constants: a } = X();
698
+ if (!r && !Qe(e)) return e;
699
+ let o = X().config.ignore.length > 0;
700
+ if (!i && o) {
701
+ let { html_with_markers: t, extracted_map: r } = dt(e);
702
+ e = t, vt = r, n = !0;
703
+ }
704
+ return e = gt(e, !0), e = e.replace(/\n|\t/g, ""), e = e.replace(/>\s+</g, "><"), e = e.replace(/ {2,}/g, " "), e = e.replace(/(\S) (<[a-zA-Z][a-zA-Z0-9_:-]*)/g, "$1___MINIFY-PROTECTED-SPACE___$2"), e = e.replace(/(<\/[a-zA-Z][a-zA-Z0-9_:-]*>) (\S)/g, "$1___MINIFY-PROTECTED-SPACE___$2"), e = e.replace(/ >/g, ">"), e = e.replace(/ </g, "<"), e = e.replace(/> /g, ">"), e = e.replace(/< /g, "<"), e = e.replace(/<\s+\//g, "</"), e = e.replace(/<\/\s+/g, "</"), e = e.replace(/* @__PURE__ */ RegExp("___MINIFY-PROTECTED-SPACE___", "g"), " "), e = e.replace(/ = /g, "="), e = e.replace(/([a-zA-Z0-9_-]+)=(['"])(.*?)\2/g, (e, t, n, r) => `${t}=${n}${r.trim()}${n}`), e = e.trim(), e = _t(e), n && (e = ft(e, vt)), e;
705
+ }, Q = { line: [] }, bt, xt = (e) => {
706
+ Q.line = [];
707
+ let t = -1;
708
+ e.replace(/(<[^>]+>)|([^<]+)/g, (e, n, r) => (n ? Q.line.push({
709
+ type: "tag",
710
+ value: e
711
+ }) : r && r.trim().length > 0 && Q.line.push({
712
+ type: "text",
713
+ value: e
714
+ }), t++, `\n[#-# : ${t} : ${e} : #-#]\n`));
715
+ }, St = () => {
716
+ let { config: e, constants: t } = X(), n = " ".repeat(e.tab_size), r = e.tag_wrap, i = e.content_wrap, a = e.strict, o = "", s = [], c = /<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g, l = /\s{1}[A-Za-z-]+(?:=".*?")?/g;
717
+ Q.line.forEach((e, u) => {
718
+ let d = e.value, f = d.startsWith("___HTMLFY_SPECIAL_IGNORE_MARKER_"), p = 0, m = Q.line[u - 1], h = m?.value ?? "";
719
+ o += "0", u === 0 && p++, d.trim().startsWith("</") && p++, h.trim().startsWith("<!doctype") && p++, h.trim().startsWith("<!--") && p++, (h.trim().endsWith("/>") || h.trim().endsWith(t.SELF_CLOSING_PLACEHOLDER)) && p++, h.trim().startsWith("</") && p++, m?.type === "text" && p++;
720
+ let g = Math.max(0, o.length - p);
721
+ if (o = o.substring(0, g), e.type === "text" && /^[!,;\.]/.test(d)) {
722
+ if (d.length === 1) {
723
+ s[s.length - 1] = s.at(-1) + d;
724
+ return;
725
+ } else if (s[s.length - 1] = s.at(-1) + d.charAt(0), d = d.slice(1).trim(), d.length === 0) return;
726
+ }
727
+ let _ = n.repeat(g);
728
+ if (f) s.push(d);
729
+ else {
730
+ if (a && d.trim().startsWith("<!--")) return;
731
+ let t = d;
732
+ if (t = ht(t), e.type === "text" && i > 0 && t.length >= i) t = ut(t, i, _);
733
+ else if (r > 0 && t.length > r && c.test(t)) {
734
+ c.lastIndex = 0, l.lastIndex = 0;
735
+ let e = t.split(l).filter(Boolean);
736
+ if (e.length >= 2) {
737
+ let r = t.matchAll(l), i = _ + n, o = _ + e[0] + "\n";
738
+ for (let e of r) {
739
+ let t = e[0].trim();
740
+ o += i + t + "\n";
741
+ }
742
+ let s = e[0].match(/<([A-Za-z_:-]+)/), c = s ? s[1] : "", u = e.at(-1)?.endsWith("/>") && Y.includes(c), d = e[1].trim(), f = _ + (a && u ? " " : "");
743
+ o += f + d, t = o;
744
+ } else t = _ + t;
745
+ } else t = _ + t;
746
+ s.push(t);
747
+ }
748
+ });
749
+ let u = s.join("\n");
750
+ return r > 0 && (u = tt(u)), i > 0 && RegExp(`/\\n[ ]*[^\\n]*${t.CONTENT_IGNORE_PLACEHOLDER}[^\\n]*\\n/`).test(u) && (u = rt(u)), u = u.replace(/<(?<Element>[^>\s]+)[^>]*>[^<]*?[^><\/\s][^<]*?<\/\k<Element>>|<script[^>]*>[\s]*<\/script>|<([\w:\._-]+)([^>]*)><\/\2>|<([\w:\._-]+)([^>]*)>[\s]+<\/\4>/g, (e) => e.includes(t.SELF_CLOSING_PLACEHOLDER) || e.includes(t.CONTENT_IGNORE_PLACEHOLDER) ? e : e.replace(/\n|\t|\s{2,}/g, "")), i > 0 && (u = st(u)), r > 0 && (u = ot(u)), a && (u = u.replace(/\s\/>|\/>/g, ">")), u.startsWith("\n") && (u = u.substring(1)), u.endsWith("\n") && (u = u.substring(0, u.length - 1)), u;
751
+ }, Ct = (e, t) => {
752
+ let n = !1, { checked_html: r, ignored: i } = X();
753
+ if (!r && !Qe(e)) return e;
754
+ let a = lt(t || {}), o = a.ignore.length > 0;
755
+ if (a.trim.length > 0 && (e = at(e, a.trim)), !i && o) {
756
+ let { html_with_markers: t, extracted_map: r } = dt(e);
757
+ e = t, bt = r, n = !0;
758
+ }
759
+ return e = it(e), e = mt(e), e = yt(e), xt(e), e = St(), e = ct(e), n && (e = ft(e, bt)), e;
760
+ }, wt = (e, t, n) => {
761
+ [
762
+ null,
763
+ void 0,
764
+ "",
765
+ !1
766
+ ].includes(n) || [
767
+ "innerHTML",
768
+ "style",
769
+ ""
770
+ ].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof n) ? "⚠️ Property must be set through a script or a framework-specific syntax." : n);
771
+ }, Tt = (e, t, n, r, i) => {
772
+ if (t && typeof t == "string") {
773
+ let i = document.createElement(t);
774
+ Object.keys(n || {}).forEach((e) => {
775
+ wt(i, e, n[e]);
776
+ }), r?.forEach((e) => {
777
+ Tt(i, e.$tag$, e.$attrs$, e.$children$, e.$text$);
778
+ }), n?.innerHTML && (i.innerHTML = n.innerHTML), e.appendChild(i);
779
+ }
780
+ i && (e.innerHTML = i);
781
+ }, Et = (e, t, n = []) => {
782
+ let r = {};
783
+ if (typeof e != "object") throw Error("filterArgs - args isn't an object.");
784
+ for (let i in e) if (!n.includes(i)) {
785
+ let n = e[i], a = i.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
786
+ (!t || !Object.keys(t).includes(i) || t[i] !== n) && (r[a] = n);
787
+ }
788
+ return r;
789
+ }, Dt = (e, t) => {
790
+ let n = document.getElementById("storybook-root");
791
+ if (n !== null) return document.querySelector("[lang]")?.setAttribute("lang", t.globals?.locale || "en"), Xe({
792
+ $cmpMeta$: {
793
+ $flags$: 0,
794
+ $tagName$: n.tagName
795
+ },
796
+ $hostElement$: n
797
+ }, e(t)), n.children[n.children.length - 1];
798
+ }, Ot = ({ $tag$: e, $attrs$: t, $children$: n, $text$: r }) => {
799
+ let i = document.createElement("div");
800
+ return Tt(i, e, t, n, r), Ct(i.innerHTML, {
801
+ tag_wrap: 40,
802
+ content_wrap: 120
803
+ }).replace(/="true"/g, "");
804
+ }, $ = (e, t) => {
805
+ if (!t) return;
806
+ let n = t.split("/");
807
+ return `${e}${n.slice(2, n.length - 1).join("-")}--docs`;
808
+ }, kt = class {
809
+ jsonDoc;
810
+ constructor(e) {
811
+ this.jsonDoc = e;
812
+ }
813
+ #e = (e) => this.jsonDoc.components.find((t) => t.tag === e);
814
+ #t = (e) => {
815
+ let t = e.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (e) => e.replace(/\|/g, " OR ")).split("|").map((e) => e.trim().replace(/ OR /g, "|"));
816
+ return e.type === "string" ? { control: { type: "text" } } : e.type === "number" ? { control: { type: "number" } } : e.type === "boolean" ? { control: { type: "boolean" } } : e.type.startsWith("{") && e.type.endsWith("}") ? { control: { type: "object" } } : t.length > 1 ? t.includes("string") ? { control: { type: "text" } } : t.every((e) => e?.includes("[]")) ? { control: { type: "object" } } : (t.unshift(void 0), {
817
+ control: { type: "select" },
818
+ options: t
819
+ }) : { control: { type: "object" } };
820
+ };
821
+ extractArgTypes = (e) => {
822
+ let t = this.#e(e), n = t?.props.reduce((e, t) => {
823
+ let { control: n, options: r } = this.#t(t);
824
+ return {
825
+ ...e,
826
+ [t.name]: {
827
+ name: t.attr || t.name,
828
+ description: t.docs,
829
+ type: { required: t.required },
830
+ table: {
831
+ category: "props",
832
+ type: { summary: t.type },
833
+ defaultValue: { summary: t.default }
834
+ },
835
+ control: n,
836
+ options: r
837
+ }
838
+ };
839
+ }, {}), r = t?.events.reduce((e, t) => ({
840
+ ...e,
841
+ [t.event]: {
842
+ name: t.event,
843
+ description: t.docs,
844
+ table: {
845
+ category: "events",
846
+ type: { summary: t.detail }
847
+ }
848
+ }
849
+ }), {}), i = t?.methods.reduce((e, t) => ({
850
+ ...e,
851
+ [t.name]: {
852
+ name: t.name,
853
+ description: t.docs,
854
+ table: {
855
+ category: "methods",
856
+ type: { summary: t.signature }
857
+ }
858
+ }
859
+ }), {}), a = t?.slots.reduce((e, t) => ({
860
+ ...e,
861
+ [t.name]: {
862
+ name: t.name === "" ? "default" : t.name,
863
+ description: t.docs,
864
+ table: {
865
+ category: "slots",
866
+ type: { summary: void 0 }
867
+ }
868
+ }
869
+ }), {}), o = t?.styles.reduce((e, t) => ({
870
+ ...e,
871
+ [t.name]: {
872
+ name: t.name,
873
+ description: t.docs,
874
+ table: {
875
+ category: "custom properties",
876
+ type: { summary: void 0 }
877
+ }
878
+ }
879
+ }), {}), s = t?.dependencies.reduce((e, t) => {
880
+ let n = this.#e(t);
881
+ return n ? {
882
+ ...e,
883
+ [t]: {
884
+ name: t,
885
+ description: `<a href="./?path=/docs/${$("", n?.filePath)}">View Component Documentation</a>`,
886
+ table: {
887
+ category: "depends on",
888
+ type: { summary: void 0 }
889
+ }
890
+ }
891
+ } : e;
892
+ }, {}), c = t?.dependents.reduce((e, t) => {
893
+ let n = this.#e(t);
894
+ return n ? {
895
+ ...e,
896
+ [t]: {
897
+ name: t,
898
+ description: `<a href="./?path=/docs/${$("", n?.filePath)}">View Component Documentation</a>`,
899
+ table: {
900
+ category: "used by",
901
+ type: { summary: void 0 }
902
+ }
903
+ }
904
+ } : e;
905
+ }, {});
906
+ return {
907
+ ...n,
908
+ ...r,
909
+ ...i,
910
+ ...a,
911
+ ...o,
912
+ ...s,
913
+ ...c
914
+ };
915
+ };
916
+ extractComponentDescription = (e) => {
917
+ let t = this.#e(e);
918
+ return t?.readme || t?.docs;
919
+ };
920
+ }, At = ({ disconnect: e, observe: t, takeRecords: n }) => {
921
+ class r {
922
+ disconnect = e;
923
+ observe = t;
924
+ takeRecords = n;
925
+ cb;
926
+ constructor(e) {
927
+ this.cb = e;
928
+ }
929
+ }
930
+ return [window, global].forEach((e) => {
931
+ Object.defineProperty(e, "MutationObserver", {
932
+ writable: !0,
933
+ configurable: !0,
934
+ value: r
935
+ });
936
+ }), r;
937
+ }, jt = ({ disconnect: e, observe: t }) => {
938
+ class n {
939
+ disconnect = e;
940
+ observe = t;
941
+ unobserve;
942
+ cb;
943
+ constructor(e) {
944
+ this.cb = e;
945
+ }
946
+ }
947
+ return [window, global].forEach((e) => {
948
+ Object.defineProperty(e, "ResizeObserver", {
949
+ writable: !0,
950
+ configurable: !0,
951
+ value: n
952
+ });
953
+ }), n;
954
+ }, Mt = class extends Event {
955
+ detail;
956
+ }, Nt = () => {
957
+ class e extends Mt {}
958
+ return [window, global].forEach((t) => {
959
+ Object.defineProperty(t, "SubmitEvent", {
960
+ writable: !0,
961
+ configurable: !0,
962
+ value: e
963
+ });
964
+ }), e;
965
+ }, Pt = (e) => {
966
+ let t = (t) => (setTimeout(t, 1), e(), 0);
967
+ return [window, global].forEach((e) => {
968
+ Object.defineProperty(e, "requestAnimationFrame", {
969
+ writable: !0,
970
+ configurable: !0,
971
+ value: t
972
+ });
973
+ }), t;
3268
974
  };
3269
- export {
3270
- Ii as ClassList,
3271
- Zi as Cursor,
3272
- Us as Page,
3273
- qi as Paginate,
3274
- va as StorybookPreview,
3275
- Wi as allItemsAreString,
3276
- Gi as cleanString,
3277
- Hi as createID,
3278
- Ji as dateRegExp,
3279
- Xi as dateToString,
3280
- ua as defineLocales,
3281
- ga as filterArgs,
3282
- Ki as focusableElements,
3283
- Bi as formatID,
3284
- aa as getLocaleDatePattern,
3285
- Hs as getObjectValueFromKey,
3286
- Yt as getParentWindows,
3287
- $a as getStoryHTML,
3288
- Jt as getStorybookUrl,
3289
- Vi as getWindows,
3290
- at as isObject,
3291
- Yi as isTagName,
3292
- Qi as isValidNumber,
3293
- Fs as isValidString,
3294
- Fi as isValideID,
3295
- oa as localeCurrency,
3296
- Vr as localeDate,
3297
- la as localeNumber,
3298
- ca as localePercent,
3299
- ha as localeUnit,
3300
- Ui as nextTick,
3301
- Ea as setUpRequestAnimationFrameMock,
3302
- _a as setupMutationObserverMock,
3303
- ma as setupResizeObserverMock,
3304
- ya as setupSubmitEventMock,
3305
- da as stencilWrapper,
3306
- zi as toString,
3307
- ia as vsCodeCssGenerator,
3308
- na as vsCodeGenerator,
3309
- ra as webTypesGenerator
3310
- };
3311
- //# sourceMappingURL=index.es.js.map
975
+ //#endregion
976
+ export { e as ClassList, f as Cursor, m as Page, h as Paginate, kt as StorybookPreview, r as allItemsAreString, o as cleanString, c as createID, g as dateRegExp, _ as dateToString, xe as defineLocales, Et as filterArgs, te as focusableElements, u as formatID, me as getLocaleDatePattern, n as getObjectValueFromKey, v as getParentWindows, Ot as getStoryHTML, $ as getStorybookUrl, re as getWindows, t as isObject, ee as isTagName, ne as isValidNumber, i as isValidString, l as isValideID, ge as localeCurrency, be as localeDate, _e as localeNumber, ve as localePercent, ye as localeUnit, d as nextTick, Pt as setUpRequestAnimationFrameMock, At as setupMutationObserverMock, jt as setupResizeObserverMock, Nt as setupSubmitEventMock, Dt as stencilWrapper, a as toString, fe as vsCodeCssGenerator, de as vsCodeGenerator, ce as webTypesGenerator };
977
+
978
+ //# sourceMappingURL=index.es.js.map