@mgdis/stencil-helpers 3.2.12 → 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,1328 +1,978 @@
1
- class Dt {
2
- /**
3
- * Available classes
4
- */
5
- classes;
6
- constructor(t = []) {
7
- this.classes = t;
8
- }
9
- /**
10
- * Add class
11
- * @param className - class name to add
12
- */
13
- add = (t) => {
14
- this.has(t) || this.classes.push(t);
15
- };
16
- /**
17
- * Delete class
18
- * @param className - class name to delete
19
- */
20
- delete = (t) => {
21
- const s = this.classes.indexOf(t);
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 = (t) => this.classes.includes(t);
30
- /**
31
- * Join classes seperated by spaces
32
- * @returns joined values
33
- */
34
- join = () => this.classes.join(" ");
35
- }
36
- const G = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, He = (e, t, s) => {
37
- if (!G(e) || typeof t != "string")
38
- return s;
39
- const [r, ...o] = t.split(".");
40
- return o.length ? He(e[r], o.join("."), s) : e[r] ?? s;
41
- }, jt = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Me = (e) => typeof e == "string" && e.trim() !== "", Pt = (e) => typeof e == "object" ? JSON.stringify(e) : String(e), zt = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Fe = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, s) => (s > 0 ? "-" : "") + t.toLowerCase()).replace(/[^a-z0-9-]+/g, "-").replace(/--+/g, "-").replace(/(?:^-)|(?:-$)/g, ""), Ht = (e = "", t = 10) => {
42
- const s = new Uint8Array(t);
43
- crypto.getRandomValues(s);
44
- const n = Array.from(s).map((r) => r.toString(16).padStart(2, "0")).join("").slice(0, t);
45
- return e !== "" ? `${e}-${n}` : n;
46
- }, Mt = (e) => Me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null, Ft = (e) => {
47
- let t;
48
- return typeof e == "string" ? t = e : e && typeof e == "object" && (G(e) || Array.isArray(e)) ? t = JSON.stringify(e) : e != null && typeof e != "boolean" && typeof e != "object" && (t = String(e)), t && Fe(t);
49
- }, Gt = async (e) => {
50
- if (e)
51
- return e();
52
- }, Bt = {
53
- FIRST: "first",
54
- NEXT: "next",
55
- PREVIOUS: "previous",
56
- LAST: "last"
57
- }, fe = 10;
58
- class Ge {
59
- /**
60
- * Define items
61
- */
62
- items = [];
63
- /**
64
- * Define total
65
- */
66
- total;
67
- /**
68
- * Define top
69
- */
70
- top = fe;
71
- /**
72
- * Define next
73
- */
74
- next;
75
- /**
76
- * Define base index
77
- */
78
- baseIndex = 1;
79
- constructor(t) {
80
- if (G(t))
81
- Array.isArray(t.items) && (this.items = t.items), typeof t.top == "number" && (this.top = t.top), this.total = typeof t.total == "number" ? t.total : this.items.length, this.next = t.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 = (t = "first", s) => {
92
- if (!Array.isArray(this.items) || !this.items.length)
93
- return null;
94
- const r = this.items.length - this.baseIndex;
95
- let o, i = 0;
96
- if (["previous", "next"].includes(t) && s) {
97
- const u = this.items.findIndex((f) => JSON.stringify(f) === JSON.stringify(s));
98
- if (u === -1)
99
- return 0;
100
- i = u;
101
- }
102
- return t === "first" ? o = 0 : t === "last" ? o = r : t === "previous" ? o = JSON.stringify(this.items[i]) === JSON.stringify(this.items[0]) ? r : i - this.baseIndex : t === "next" ? o = JSON.stringify(this.items[i]) === JSON.stringify(this.items[r]) ? 0 : i + this.baseIndex : o = 0, o;
103
- };
104
- }
105
- class Ut {
106
- /**
107
- * Define paginated items
108
- */
109
- items = [];
110
- /* Privates */
111
- #e = fe;
112
- #t;
113
- #s;
114
- constructor(t, s) {
115
- Array.isArray(t) && (this.items = t), s && (["string", "function"].includes(typeof s.next) || G(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 = (t = 0, s) => {
124
- const n = typeof s == "function" ? this.items.filter(s) : this.items;
125
- let r;
126
- return this.#t ? r = this.#t : n.length > t + this.#e && (r = () => this.getPage(t + this.#e, s)), new Ge({
127
- items: n.slice(t, t + this.#e),
128
- total: this.#s,
129
- top: this.#e,
130
- next: r
131
- });
132
- };
133
- }
134
- const Zt = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, Wt = (e) => e.toISOString().split("T")[0], qt = (e, t) => t.includes(e?.tagName.toLowerCase()), Jt = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Yt = (e) => typeof e == "number" && !Number.isNaN(e), Kt = (e) => {
135
- const t = ue(e), s = ge(e);
136
- return [e, ...t, ...s];
137
- }, ue = (e, t = []) => {
138
- if (e.self !== e.top)
139
- try {
140
- const s = e.parent;
141
- return s ? (t.push(s), ue(s, t)) : t;
142
- } catch (s) {
143
- return console.error("Different hosts between iframes:", s), t;
144
- }
145
- return t;
146
- }, ge = (e, t = []) => {
147
- if (e.frames.length > 0)
148
- for (const s of Array.from(e.frames))
149
- t.push(s), ge(s, t);
150
- return t;
151
- }, pe = (e, t) => {
152
- if (!t)
153
- return;
154
- const s = t.split("/");
155
- return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
156
- }, Be = (e, t) => {
157
- if (t)
158
- return `${e}${t}`;
159
- }, $e = (e) => {
160
- let t = e.overview ? `${e.overview}
161
-
162
- ` : "";
163
- const s = e.props.filter(({ attr: r }) => r !== void 0);
164
- s.length && (t += `Attributes:
165
- `, t += s.map(({ attr: r, docs: o }) => `- \`${r}\`: ${o}
166
- `).join(""), t += `
167
- `);
168
- const n = e.props.filter(({ attr: r }) => r === void 0);
169
- return n.length && (t += `Properties:
170
- `, t += n.map(({ name: r, docs: o }) => `- \`${r}\`: ${o}
171
- `).join(""), t += `
172
- `), e.methods.length && (t += `Methods:
173
- `, t += e.methods.map(({ name: r, docs: o }) => `- \`${r}\`: ${o}
174
- `).join(""), t += `
175
- `), e.events.length && (t += `Events:
176
- `, t += e.events.map(({ event: r, docs: o }) => `- \`${r}\`: ${o}
177
- `).join(""), t += `
178
- `), e.listeners.length && (t += `Listeners:
179
- `, t += e.listeners.map(({ event: r }) => `- \`${r}\`
180
- `).join(""), t += `
181
- `), e.slots.length && (t += `Slots:
182
- `, t += e.slots.map(({ name: r, docs: o }) => `- \`${r}\`: ${o}
183
- `).join(""), t += `
184
- `), t;
185
- }, Z = (e) => `${e.docs}
186
-
187
- Type: \`${e.type}\``, Xt = (e, t, s, n) => ({
188
- $schema: "https://json.schemastore.org/web-types",
189
- name: e,
190
- version: t,
191
- "description-markup": "markdown",
192
- contributions: {
193
- html: {
194
- elements: s.components.map((r) => {
195
- const o = pe(n, r.filePath);
196
- return {
197
- name: r.tag,
198
- description: $e(r),
199
- "doc-url": o,
200
- attributes: r.props.filter((i) => i.attr).map((i) => ({
201
- name: i.attr,
202
- description: Z(i),
203
- "doc-url": o,
204
- value: {
205
- type: i.type,
206
- default: i.default,
207
- required: i.required
208
- }
209
- })),
210
- js: {
211
- properties: r.props.map((i) => ({
212
- name: i.name,
213
- description: Z(i),
214
- "doc-url": o,
215
- value: {
216
- type: i.type,
217
- default: i.default,
218
- required: i.required
219
- }
220
- })),
221
- events: r.events.map((i) => ({
222
- name: i.event,
223
- description: i.docs
224
- }))
225
- },
226
- css: {
227
- properties: r.styles.map((i) => ({
228
- name: i.name,
229
- description: i.docs
230
- }))
231
- }
232
- };
233
- })
234
- }
235
- }
236
- }), Ue = (e, t, s) => [
237
- { name: "Storybook", url: pe(e, s) },
238
- { name: "Sources", url: Be(t, s) }
239
- ], Ze = (e) => {
240
- if (!e.values.some(({ value: t }) => t === void 0))
241
- return e.values.map(({ value: t }) => ({ name: t }));
242
- }, Qt = (e, t, s) => ({
243
- version: 1.1,
244
- tags: e.components.map((n) => {
245
- const r = Ue(t, s, n.filePath);
246
- return {
247
- name: n.tag,
248
- description: $e(n),
249
- attributes: n.props.map((o) => ({
250
- name: o.attr ?? o.name,
251
- description: Z(o),
252
- values: Ze(o),
253
- references: r
254
- })),
255
- references: r
256
- };
257
- }),
258
- globalAttributes: [],
259
- valueSets: []
260
- }), Vt = (e) => ({
261
- version: 1.1,
262
- properties: e.components.flatMap((t) => t.styles.map((s) => ({
263
- name: s.name,
264
- description: s.docs
265
- })))
266
- }), We = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, es = (e) => {
267
- const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, n = { value: "24", pattern: "dd" };
268
- return Je([t.value, s.value, n.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(n.value, n.pattern);
269
- }, qe = (e, t, s) => {
270
- const n = e.closest("[lang]"), r = Intl.NumberFormat.supportedLocalesOf(n?.lang), o = r.length > 0 && typeof r[0] == "string" ? r[0] : navigator.language || s, i = o.split("-").shift();
271
- return Object.keys(t).length === 0 ? {
272
- locale: o,
273
- messages: { lang: s }
274
- } : {
275
- locale: o,
276
- messages: t[i] ?? t[s] ?? { lang: s }
277
- };
278
- }, ts = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), ss = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(Number(e)), ns = (e, t, s = 0) => new Intl.NumberFormat(t, {
279
- style: "percent",
280
- minimumFractionDigits: s,
281
- maximumFractionDigits: s
282
- }).format(e), rs = (e, t, s, n = "short", r = 0) => new Intl.NumberFormat(t, {
283
- style: "unit",
284
- unit: s,
285
- unitDisplay: n,
286
- minimumFractionDigits: r,
287
- maximumFractionDigits: r
288
- }).format(e), Je = (e, t, s) => typeof e != "string" || e === "" || !We.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), os = (e, t) => (s) => qe(s, e, t);
289
- var X = {
290
- updatable: !0,
291
- slotRelocation: !0
292
- }, Ye = "http://www.w3.org/2000/svg", Ke = "http://www.w3.org/1999/xhtml", Xe = (e) => {
293
- if (e.__stencil__getHostRef)
294
- return e.__stencil__getHostRef();
295
- }, te = (e, t) => t in e, se = "http://www.w3.org/1999/xlink", A = typeof window < "u" ? window : {}, T = {
296
- $flags$: 0,
297
- $resourcesUrl$: "",
298
- jmp: (e) => e(),
299
- raf: (e) => requestAnimationFrame(e),
300
- ael: (e, t, s, n) => e.addEventListener(t, s, n),
301
- rel: (e, t, s, n) => e.removeEventListener(t, s, n),
302
- ce: (e, t) => new CustomEvent(e, t)
303
- }, de = (e) => {
304
- const t = W(e, "childNodes");
305
- e.tagName && e.tagName.includes("-") && e["s-cr"] && e.tagName !== "SLOT-FB" && Q(t, e.tagName).forEach((n) => {
306
- n.nodeType === 1 && n.tagName === "SLOT-FB" && (Ve(n, I(n), !1).length ? n.hidden = !0 : n.hidden = !1);
307
- });
308
- let s = 0;
309
- for (s = 0; s < t.length; s++) {
310
- const n = t[s];
311
- n.nodeType === 1 && W(n, "childNodes").length && de(n);
312
- }
313
- }, Qe = (e) => {
314
- const t = [];
315
- for (let s = 0; s < e.length; s++) {
316
- const n = e[s]["s-nr"] || void 0;
317
- n && n.isConnected && t.push(n);
318
- }
319
- return t;
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;
320
244
  };
321
- function Q(e, t, s) {
322
- let n = 0, r = [], o;
323
- for (; n < e.length; n++) {
324
- if (o = e[n], o["s-sr"] && (!t || o["s-hn"] === t) && (s === void 0 || I(o) === s) && (r.push(o), typeof s < "u"))
325
- return r;
326
- r = [...r, ...Q(o.childNodes, t, s)];
327
- }
328
- return r;
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;
329
252
  }
330
- var Ve = (e, t, s = !0) => {
331
- const n = [];
332
- (s && e["s-sr"] || !e["s-sr"]) && n.push(e);
333
- let r = e;
334
- for (; r = r.nextSibling; )
335
- I(r) === t && (s || !r["s-sr"]) && n.push(r);
336
- return n;
337
- }, ne = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", I = (e) => typeof e["s-sn"] == "string" ? e["s-sn"] : e.nodeType === 1 && e.getAttribute("slot") || void 0;
338
- function et(e) {
339
- if (e.assignedElements || e.assignedNodes || !e["s-sr"]) return;
340
- const t = (s) => (function(n) {
341
- const r = [], o = this["s-sn"];
342
- n?.flatten && console.error(`
343
- Flattening is not supported for Stencil non-shadow slots.
344
- You can use \`.childNodes\` to nested slot fallback content.
345
- If you have a particular use case, please open an issue on the Stencil repo.
346
- `);
347
- const i = this["s-cr"].parentElement;
348
- return (i.__childNodes ? i.childNodes : Qe(i.childNodes)).forEach((f) => {
349
- o === I(f) && r.push(f);
350
- }), s ? r.filter(
351
- (f) => f.nodeType === 1
352
- /* ElementNode */
353
- ) : r;
354
- }).bind(e);
355
- e.assignedElements = t(!0), e.assignedNodes = t(!1);
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);
356
271
  }
357
- function tt(e) {
358
- e.dispatchEvent(new CustomEvent("slotchange", { bubbles: !1, cancelable: !1, composed: !1 }));
272
+ function ke(e) {
273
+ e.dispatchEvent(new CustomEvent("slotchange", {
274
+ bubbles: !1,
275
+ cancelable: !1,
276
+ composed: !1
277
+ }));
359
278
  }
360
- function st(e, t) {
361
- var s;
362
- if (t = t || ((s = e["s-ol"]) == null ? void 0 : s.parentElement), !t) return { slotNode: null, slotName: "" };
363
- const n = e["s-sn"] = I(e) || "", r = W(t, "childNodes");
364
- return { slotNode: Q(r, t.tagName, n)[0], slotName: n };
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
+ };
365
289
  }
366
- function W(e, t) {
367
- if ("__" + t in e) {
368
- const s = e["__" + t];
369
- return typeof s != "function" ? s : s.bind(e);
370
- } else
371
- return typeof e[t] != "function" ? e[t] : e[t].bind(e);
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];
372
295
  }
373
- var nt = (e) => e != null && e !== void 0, _e = (e) => (e = typeof e, e === "object" || e === "function"), rt = (e, t, ...s) => {
374
- let n = null, r = null, o = null, i = !1, u = !1;
375
- const f = [], c = (l) => {
376
- for (let p = 0; p < l.length; p++)
377
- n = l[p], Array.isArray(n) ? c(n) : n != null && typeof n != "boolean" && ((i = !_e(n)) && (n = String(n)), i && u ? f[f.length - 1].$text$ += n : f.push(i ? q(null, n) : n), u = i);
378
- };
379
- c(s);
380
- const a = q(e, null);
381
- return a.$attrs$ = t, f.length > 0 && (a.$children$ = f), a.$key$ = r, a.$name$ = o, a;
382
- }, q = (e, t) => {
383
- const s = {
384
- $flags$: 0,
385
- $tag$: e,
386
- // Normalize undefined to null to prevent rendering "undefined" as text
387
- $text$: t ?? null,
388
- $elm$: null,
389
- $children$: null
390
- };
391
- return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
392
- }, ot = {}, it = (e) => e && e.$tag$ === ot, re = (e, t, s, n, r, o, i) => {
393
- if (s === n)
394
- return;
395
- let u = te(e, t), f = t.toLowerCase();
396
- if (t === "class") {
397
- const c = e.classList, a = oe(s);
398
- let l = oe(n);
399
- c.remove(...a.filter((p) => p && !l.includes(p))), c.add(...l.filter((p) => p && !a.includes(p)));
400
- } else if (t === "style") {
401
- for (const c in s)
402
- (!n || n[c] == null) && (c.includes("-") ? e.style.removeProperty(c) : e.style[c] = "");
403
- for (const c in n)
404
- (!s || n[c] !== s[c]) && (c.includes("-") ? e.style.setProperty(c, n[c]) : e.style[c] = n[c]);
405
- } else if (t !== "key") if (t === "ref")
406
- n && ft(n, e);
407
- else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
408
- if (t[2] === "-" ? t = t.slice(3) : te(A, f) ? t = f.slice(2) : t = f[2] + t.slice(3), s || n) {
409
- const c = t.endsWith(he);
410
- t = t.replace(lt, ""), s && T.rel(e, t, s, c), n && T.ael(e, t, n, c);
411
- }
412
- } else if (t[0] === "a" && t.startsWith("attr:")) {
413
- const c = t.slice(5);
414
- let a;
415
- {
416
- const l = Xe(e);
417
- if (l && l.$cmpMeta$ && l.$cmpMeta$.$members$) {
418
- const p = l.$cmpMeta$.$members$[c];
419
- p && p[1] && (a = p[1]);
420
- }
421
- }
422
- a || (a = c.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()), n == null || n === !1 ? (n !== !1 || e.getAttribute(a) === "") && e.removeAttribute(a) : e.setAttribute(a, n === !0 ? "" : n);
423
- return;
424
- } else if (t[0] === "p" && t.startsWith("prop:")) {
425
- const c = t.slice(5);
426
- try {
427
- e[c] = n;
428
- } catch {
429
- }
430
- return;
431
- } else {
432
- const c = _e(n);
433
- if ((u || c && n !== null) && !r)
434
- try {
435
- if (e.tagName.includes("-"))
436
- e[t] !== n && (e[t] = n);
437
- else {
438
- const l = n ?? "";
439
- t === "list" ? u = !1 : (s == null || e[t] !== l) && (typeof e.__lookupSetter__(t) == "function" ? e[t] = l : e.setAttribute(t, l));
440
- }
441
- } catch {
442
- }
443
- let a = !1;
444
- f !== (f = f.replace(/^xlink\:?/, "")) && (t = f, a = !0), n == null || n === !1 ? (n !== !1 || e.getAttribute(t) === "") && (a ? e.removeAttributeNS(se, t) : e.removeAttribute(t)) : (!u || o & 4 || r) && !c && e.nodeType === 1 && (n = n === !0 ? "" : n, a ? e.setAttributeNS(se, t, n) : e.setAttribute(t, n));
445
- }
446
- }, at = /\s/, oe = (e) => (typeof e == "object" && e && "baseVal" in e && (e = e.baseVal), !e || typeof e != "string" ? [] : e.split(at)), he = "Capture", lt = new RegExp(he + "$"), J = (e, t, s, n) => {
447
- const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || {}, i = t.$attrs$ || {};
448
- for (const u of ie(Object.keys(o)))
449
- u in i || re(
450
- r,
451
- u,
452
- o[u],
453
- void 0,
454
- s,
455
- t.$flags$
456
- );
457
- for (const u of ie(Object.keys(i)))
458
- re(
459
- r,
460
- u,
461
- o[u],
462
- i[u],
463
- s,
464
- t.$flags$
465
- );
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$);
466
360
  };
467
- function ie(e) {
468
- return e.includes("ref") ? (
469
- // we need to sort these to ensure that `'ref'` is the last attr
470
- [...e.filter((t) => t !== "ref"), "ref"]
471
- ) : (
472
- // no need to sort, return the original array
473
- e
474
- );
361
+ function Be(e) {
362
+ return e.includes("ref") ? [...e.filter((e) => e !== "ref"), "ref"] : e;
475
363
  }
476
- var P, z, R, C = !1, H = !1, B = !1, E = !1, Y = [], K = [], M = (e, t, s) => {
477
- var n;
478
- const r = t.$children$[s];
479
- let o = 0, i, u, f;
480
- if (C || (B = !0, r.$tag$ === "slot" && (r.$flags$ |= r.$children$ ? (
481
- // slot element has fallback content
482
- // still create an element that "mocks" the slot element
483
- 2
484
- ) : (
485
- // slot element does not have fallback content
486
- // create an html comment we'll use to always reference
487
- // where actual slot content should sit next to
488
- 1
489
- ))), r.$text$ != null)
490
- i = r.$elm$ = A.document.createTextNode(r.$text$);
491
- else if (r.$flags$ & 1)
492
- i = r.$elm$ = A.document.createTextNode(""), J(null, r, E);
493
- else {
494
- if (E || (E = r.$tag$ === "svg"), !A.document)
495
- throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
496
- if (i = r.$elm$ = A.document.createElementNS(
497
- E ? Ye : Ke,
498
- !C && X.slotRelocation && r.$flags$ & 2 ? "slot-fb" : r.$tag$
499
- ), E && r.$tag$ === "foreignObject" && (E = !1), J(null, r, E), nt(P) && i["s-si"] !== P && i.classList.add(i["s-si"] = P), r.$children$) {
500
- const c = r.$tag$ === "template" ? i.content : i;
501
- for (o = 0; o < r.$children$.length; ++o)
502
- u = M(e, r, o), u && c.appendChild(u);
503
- }
504
- r.$tag$ === "svg" ? E = !1 : i.tagName === "foreignObject" && (E = !0);
505
- }
506
- return i["s-hn"] = R, r.$flags$ & 3 && (i["s-sr"] = !0, i["s-cr"] = z, i["s-sn"] = r.$name$ || "", i["s-rf"] = (n = r.$attrs$) == null ? void 0 : n.ref, et(i), f = e && e.$children$ && e.$children$[s], f && f.$tag$ === r.$tag$ && e.$elm$ && ye(e.$elm$), Oe(z, i, t.$elm$, e?.$elm$)), i;
507
- }, ye = (e) => {
508
- T.$flags$ |= 1;
509
- const t = e.closest(R.toLowerCase());
510
- if (t != null) {
511
- const s = Array.from(t.__childNodes || t.childNodes).find(
512
- (r) => r["s-cr"]
513
- ), n = Array.from(
514
- e.__childNodes || e.childNodes
515
- );
516
- for (const r of s ? n.reverse() : n)
517
- r["s-sh"] != null && (v(t, r, s ?? null), r["s-sh"] = void 0, B = !0);
518
- }
519
- T.$flags$ &= -2;
520
- }, F = (e, t) => {
521
- T.$flags$ |= 1;
522
- const s = Array.from(e.__childNodes || e.childNodes);
523
- if (e["s-sr"]) {
524
- let n = e;
525
- for (; n = n.nextSibling; )
526
- n && n["s-sn"] === e["s-sn"] && n["s-sh"] === R && s.push(n);
527
- }
528
- for (let n = s.length - 1; n >= 0; n--) {
529
- const r = s[n];
530
- r["s-hn"] !== R && r["s-ol"] && (v(w(r).parentNode, r, w(r)), r["s-ol"].remove(), r["s-ol"] = void 0, r["s-sh"] = void 0, B = !0), t && F(r, t);
531
- }
532
- T.$flags$ &= -2;
533
- }, Ee = (e, t, s, n, r, o) => {
534
- let i = e["s-cr"] && e["s-cr"].parentNode || e, u;
535
- for (i.shadowRoot && i.tagName === R && (i = i.shadowRoot), s.$tag$ === "template" && (i = i.content); r <= o; ++r)
536
- n[r] && (u = M(null, s, r), u && (n[r].$elm$ = u, v(i, u, w(t))));
537
- }, be = (e, t, s) => {
538
- for (let n = t; n <= s; ++n) {
539
- const r = e[n];
540
- if (r) {
541
- const o = r.$elm$;
542
- ve(r), o && (H = !0, o["s-ol"] ? o["s-ol"].remove() : F(o, !0), o.remove());
543
- }
544
- }
545
- }, ct = (e, t, s, n, r = !1) => {
546
- let o = 0, i = 0, u = 0, f = 0, c = t.length - 1, a = t[0], l = t[c], p = n.length - 1, $ = n[0], g = n[p], _, m;
547
- const y = s.$tag$ === "template" ? e.content : e;
548
- for (; o <= c && i <= p; )
549
- if (a == null)
550
- a = t[++o];
551
- else if (l == null)
552
- l = t[--c];
553
- else if ($ == null)
554
- $ = n[++i];
555
- else if (g == null)
556
- g = n[--p];
557
- else if (j(a, $, r))
558
- x(a, $, r), a = t[++o], $ = n[++i];
559
- else if (j(l, g, r))
560
- x(l, g, r), l = t[--c], g = n[--p];
561
- else if (j(a, g, r))
562
- (a.$tag$ === "slot" || g.$tag$ === "slot") && F(a.$elm$.parentNode, !1), x(a, g, r), v(y, a.$elm$, l.$elm$.nextSibling), a = t[++o], g = n[--p];
563
- else if (j(l, $, r))
564
- (a.$tag$ === "slot" || g.$tag$ === "slot") && F(l.$elm$.parentNode, !1), x(l, $, r), v(y, l.$elm$, a.$elm$), l = t[--c], $ = n[++i];
565
- else {
566
- for (u = -1, f = o; f <= c; ++f)
567
- if (t[f] && t[f].$key$ !== null && t[f].$key$ === $.$key$) {
568
- u = f;
569
- break;
570
- }
571
- u >= 0 ? (m = t[u], m.$tag$ !== $.$tag$ ? _ = M(t && t[i], s, u) : (x(m, $, r), t[u] = void 0, _ = m.$elm$), $ = n[++i]) : (_ = M(t && t[i], s, i), $ = n[++i]), _ && v(
572
- w(a.$elm$).parentNode,
573
- _,
574
- w(a.$elm$)
575
- );
576
- }
577
- o > c ? Ee(
578
- e,
579
- n[p + 1] == null ? null : n[p + 1].$elm$,
580
- s,
581
- n,
582
- i,
583
- p
584
- ) : i > p && be(t, o, c);
585
- }, j = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : s ? (s && !e.$key$ && t.$key$ && (e.$key$ = t.$key$), !0) : e.$key$ === t.$key$ : !1, w = (e) => e && e["s-ol"] || e, x = (e, t, s = !1) => {
586
- const n = t.$elm$ = e.$elm$, r = e.$children$, o = t.$children$, i = t.$tag$, u = t.$text$;
587
- let f;
588
- u == null ? (E = i === "svg" ? !0 : i === "foreignObject" ? !1 : E, i === "slot" && !C && e.$name$ !== t.$name$ && (t.$elm$["s-sn"] = t.$name$ || "", ye(t.$elm$.parentElement)), J(e, t, E), r !== null && o !== null ? ct(n, r, t, o, s) : o !== null ? (e.$text$ !== null && (n.textContent = ""), Ee(n, null, t, o, 0, o.length - 1)) : (
589
- // don't do this on initial render as it can cause non-hydrated content to be removed
590
- !s && X.updatable && r !== null && be(r, 0, r.length - 1)
591
- ), E && i === "svg" && (E = !1)) : (f = n["s-cr"]) ? f.parentNode.textContent = u : e.$text$ !== u && (n.data = u);
592
- }, O = [], me = (e) => {
593
- let t, s, n;
594
- const r = e.__childNodes || e.childNodes;
595
- for (const o of r) {
596
- if (o["s-sr"] && (t = o["s-cr"]) && t.parentNode) {
597
- s = t.parentNode.__childNodes || t.parentNode.childNodes;
598
- const i = o["s-sn"];
599
- for (n = s.length - 1; n >= 0; n--)
600
- if (t = s[n], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== o["s-hn"] && (!t["s-sh"] || t["s-sh"] !== o["s-hn"]))
601
- if (ne(t, i)) {
602
- let u = O.find((f) => f.$nodeToRelocate$ === t);
603
- H = !0, t["s-sn"] = t["s-sn"] || i, u ? (u.$nodeToRelocate$["s-sh"] = o["s-hn"], u.$slotRefNode$ = o) : (t["s-sh"] = o["s-hn"], O.push({
604
- $slotRefNode$: o,
605
- $nodeToRelocate$: t
606
- })), t["s-sr"] && O.map((f) => {
607
- ne(f.$nodeToRelocate$, t["s-sn"]) && (u = O.find((c) => c.$nodeToRelocate$ === t), u && !f.$slotRefNode$ && (f.$slotRefNode$ = u.$slotRefNode$));
608
- });
609
- } else O.some((u) => u.$nodeToRelocate$ === t) || O.push({
610
- $nodeToRelocate$: t
611
- });
612
- }
613
- o.nodeType === 1 && me(o);
614
- }
615
- }, ve = (e) => {
616
- e.$attrs$ && e.$attrs$.ref && Y.push(() => e.$attrs$.ref(null)), e.$children$ && e.$children$.map(ve);
617
- }, ft = (e, t) => {
618
- K.push(() => e(t));
619
- }, ut = () => {
620
- Y.forEach((e) => e()), Y.length = 0, K.forEach((e) => e()), K.length = 0;
621
- }, v = (e, t, s, n) => {
622
- if (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"])
623
- Oe(t["s-cr"], t, e, t.parentElement);
624
- else if (typeof t["s-sn"] == "string") {
625
- e.insertBefore(t, s);
626
- const { slotNode: r } = st(t);
627
- return r && !n && tt(r), t;
628
- }
629
- return e.__insertBefore ? e.__insertBefore(t, s) : e?.insertBefore(t, s);
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);
630
461
  };
631
- function Oe(e, t, s, n) {
632
- var r, o;
633
- let i;
634
- if (e && typeof t["s-sn"] == "string" && t["s-sr"] && e.parentNode && e.parentNode["s-sc"] && (i = t["s-si"] || e.parentNode["s-sc"])) {
635
- const u = t["s-sn"], f = t["s-hn"];
636
- if ((r = s.classList) == null || r.add(i + "-s"), n && ((o = n.classList) != null && o.contains(i + "-s"))) {
637
- let c = (n.__childNodes || n.childNodes)[0], a = !1;
638
- for (; c; ) {
639
- if (c["s-sn"] !== u && c["s-hn"] === f && c["s-sr"]) {
640
- a = !0;
641
- break;
642
- }
643
- c = c.nextSibling;
644
- }
645
- a || n.classList.remove(i + "-s");
646
- }
647
- }
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
+ }
648
479
  }
649
- var gt = (e, t, s = !1) => {
650
- var n, r, o, i, u;
651
- const f = e.$hostElement$, c = e.$cmpMeta$, a = e.$vnode$ || q(null, null), p = it(t) ? t : rt(null, null, t);
652
- if (R = f.tagName, c.$attrsToReflect$ && (p.$attrs$ = p.$attrs$ || {}, c.$attrsToReflect$.forEach(([$, g]) => {
653
- X.serializer && e.$serializerValues$.has($) ? p.$attrs$[g] = e.$serializerValues$.get($) : p.$attrs$[g] = f[$];
654
- })), s && p.$attrs$)
655
- for (const $ of Object.keys(p.$attrs$))
656
- f.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (p.$attrs$[$] = f[$]);
657
- p.$tag$ = null, p.$flags$ |= 4, e.$vnode$ = p, p.$elm$ = a.$elm$ = f.shadowRoot || f, P = f["s-sc"], C = !!(c.$flags$ & 1) && !(c.$flags$ & 128), z = f["s-cr"], H = !1, x(a, p, s);
658
- {
659
- if (T.$flags$ |= 1, B) {
660
- me(p.$elm$);
661
- for (const $ of O) {
662
- const g = $.$nodeToRelocate$;
663
- if (!g["s-ol"] && A.document) {
664
- const _ = A.document.createTextNode("");
665
- _["s-nr"] = g, v(
666
- g.parentNode,
667
- g["s-ol"] = _,
668
- g,
669
- s
670
- );
671
- }
672
- }
673
- for (const $ of O) {
674
- const g = $.$nodeToRelocate$, _ = $.$slotRefNode$;
675
- if (g.nodeType === 1 && s && (g["s-ih"] = (n = g.hidden) != null ? n : !1), _) {
676
- const m = _.parentNode;
677
- let y = _.nextSibling;
678
- if (y && y.nodeType === 1) {
679
- let h = (r = g["s-ol"]) == null ? void 0 : r.previousSibling;
680
- for (; h; ) {
681
- let d = (o = h["s-nr"]) != null ? o : null;
682
- if (d && d["s-sn"] === g["s-sn"] && m === (d.__parentNode || d.parentNode)) {
683
- for (d = d.nextSibling; d === g || d?.["s-sr"]; )
684
- d = d?.nextSibling;
685
- if (!d || !d["s-nr"]) {
686
- y = d;
687
- break;
688
- }
689
- }
690
- h = h.previousSibling;
691
- }
692
- }
693
- const V = g.__parentNode || g.parentNode, D = g.__nextSibling || g.nextSibling;
694
- if ((!y && m !== V || D !== y) && g !== y) {
695
- if (v(m, g, y, s), g.nodeType === 8 && g.nodeValue.startsWith("s-nt-")) {
696
- const h = A.document.createTextNode(g.nodeValue.replace(/^s-nt-/, ""));
697
- h["s-hn"] = g["s-hn"], h["s-sn"] = g["s-sn"], h["s-sh"] = g["s-sh"], h["s-sr"] = g["s-sr"], h["s-ol"] = g["s-ol"], h["s-ol"]["s-nr"] = h, v(g.parentNode, h, g, s), g.parentNode.removeChild(g);
698
- }
699
- g.nodeType === 1 && g.tagName !== "SLOT-FB" && (g.hidden = (i = g["s-ih"]) != null ? i : !1);
700
- }
701
- g && typeof _["s-rf"] == "function" && _["s-rf"](_);
702
- } else g.nodeType === 1 && (g.hidden = !0);
703
- }
704
- }
705
- H && de(p.$elm$), T.$flags$ &= -2, O.length = 0;
706
- }
707
- if (!C && !(c.$flags$ & 1) && f["s-cr"]) {
708
- const $ = p.$elm$.__childNodes || p.$elm$.childNodes;
709
- for (const g of $)
710
- if (g["s-hn"] !== R && !g["s-sh"]) {
711
- if (s && g["s-ih"] == null && (g["s-ih"] = (u = g.hidden) != null ? u : !1), g.nodeType === 1)
712
- g.hidden = !0;
713
- else if (g.nodeType === 3 && g.nodeValue.trim()) {
714
- const _ = A.document.createComment("s-nt-" + g.nodeValue);
715
- _["s-sn"] = g["s-sn"], v(g.parentNode, _, g, s), g.parentNode.removeChild(g);
716
- }
717
- }
718
- }
719
- z = void 0, ut();
720
- };
721
- const L = {
722
- content_wrap: 0,
723
- ignore: [],
724
- ignore_with: "!i-£___£%_",
725
- strict: !1,
726
- tab_size: 2,
727
- tag_wrap: 0,
728
- trim: []
729
- }, Ae = [
730
- "area",
731
- "base",
732
- "br",
733
- "col",
734
- "embed",
735
- "hr",
736
- "img",
737
- "input",
738
- "link",
739
- "meta",
740
- "param",
741
- "source",
742
- "track",
743
- "wbr"
744
- ], Te = {
745
- checked_html: !1,
746
- config: { ...L },
747
- ignored: !1,
748
- constants: {
749
- CONTENT_IGNORE_PLACEHOLDER: `${L.ignore_with}_`,
750
- SELF_CLOSING_PLACEHOLDER: `${L.ignore_with}/_>`,
751
- ATTRIBUTE_IGNORE_PLACEHOLDER: `${L.ignore_with}=_`
752
- }
753
- }, b = () => Te, k = (e) => Object.assign(Te, e), Re = (e) => (k({ 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)), xe = (e, t) => {
754
- if (!e || !t)
755
- throw new Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");
756
- let s;
757
- if (Array.isArray(e))
758
- s = structuredClone(e).concat(t);
759
- else if (typeof e == "object") {
760
- s = { ...e };
761
- for (let n of Object.keys(t))
762
- typeof t[n] != "object" ? s[n] = t[n] : s[n] = xe(s[n] || {}, t[n]);
763
- }
764
- return s;
765
- }, pt = (e, t) => {
766
- const s = xe(e, t);
767
- return k({
768
- config: s,
769
- constants: {
770
- CONTENT_IGNORE_PLACEHOLDER: `${s.ignore_with}_`,
771
- SELF_CLOSING_PLACEHOLDER: `${s.ignore_with}/_>`,
772
- ATTRIBUTE_IGNORE_PLACEHOLDER: `${s.ignore_with}=_`
773
- }
774
- }), s;
775
- }, $t = (e) => {
776
- const { constants: t } = b();
777
- return e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (s, n) => s.replace(n, (r) => r.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;
778
- }, dt = (e) => {
779
- const { constants: t } = b();
780
- 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!");
781
- }, _t = (e) => {
782
- const 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: s } = b();
783
- return e.replace(t, (n, r, o, i, u) => {
784
- const f = o || u;
785
- if (!f)
786
- return n;
787
- const c = f.replace(/\n/g, s.CONTENT_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, s.CONTENT_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, s.CONTENT_IGNORE_PLACEHOLDER + "ws!");
788
- return n.replace(f, c);
789
- });
790
- }, ht = (e) => {
791
- const 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: s } = b();
792
- return e = e.replace(t, (n, r, o) => n.replace(o, (i) => i.replace(/</g, s.ATTRIBUTE_IGNORE_PLACEHOLDER + "lt!").replace(/>/g, s.ATTRIBUTE_IGNORE_PLACEHOLDER + "gt!"))), e;
793
- }, yt = (e, t) => {
794
- for (let s = 0; s < t.length; s++) {
795
- const n = new RegExp(`(<${t[s]}[^>]*>)\\s+`, "g"), r = new RegExp(`\\s+(</${t[s]}>)`, "g");
796
- e = e.replace(n, "$1").replace(r, "$1");
797
- }
798
- return e;
799
- }, Et = (e) => {
800
- const { constants: t } = b();
801
- return e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (s, n) => s.replace(n, (r) => r.replace(new RegExp(t.ATTRIBUTE_IGNORE_PLACEHOLDER + "nl!", "g"), `
802
- `).replace(new RegExp(t.ATTRIBUTE_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(new RegExp(t.ATTRIBUTE_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), e;
803
- }, bt = (e) => {
804
- const { constants: t } = b();
805
- return e = e.replace(new RegExp(`.*${t.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!.*`, "g"), (s) => s.replace(new RegExp(`${t.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!`, "g"), (n) => n.replace(new RegExp(t.CONTENT_IGNORE_PLACEHOLDER + "nl!", "g"), `
806
- `).replace(new RegExp(t.CONTENT_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(new RegExp(t.CONTENT_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), e;
807
- }, mt = (e) => {
808
- const t = /<([\w:\-]+)([^>]*)>/g, { constants: s } = b(), n = s.ATTRIBUTE_IGNORE_PLACEHOLDER.replace(
809
- /[-\/\\^$*+?.()|[\]{}]/g,
810
- "\\$&"
811
- ), r = new RegExp(n + "lt!", "g"), o = new RegExp(n + "gt!", "g");
812
- return e.replace(
813
- t,
814
- (i, u, f) => {
815
- const c = f.replace(r, "<").replace(o, ">");
816
- return `<${u}${c}>`;
817
- }
818
- );
819
- }, vt = (e) => {
820
- if (typeof e != "object") throw new Error("Config must be an object.");
821
- const t = { ...L };
822
- 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")))
823
- return k({ config: t }), t;
824
- let n = e.tab_size;
825
- if (n) {
826
- if (typeof n != "number") throw new Error(`tab_size must be a number, not ${typeof e.tab_size}.`);
827
- if (!Number.isSafeInteger(n)) throw new 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.`);
828
- if (n = Math.floor(n), n < 1 || n > 16) throw new Error("Tab size out of range. Expecting 1 to 16.");
829
- e.tab_size = n;
830
- }
831
- if (Object.hasOwn(e, "content_wrap") && typeof e.content_wrap != "number")
832
- throw new Error(`content_wrap config must be a number, not ${typeof e.content_wrap}.`);
833
- if (Object.hasOwn(e, "ignore") && (!Array.isArray(e.ignore) || !e.ignore?.every((r) => typeof r == "string")))
834
- throw new Error("Ignore config must be an array of strings.");
835
- if (Object.hasOwn(e, "ignore_with")) {
836
- if (typeof e.ignore_with != "string")
837
- throw new Error(`ignore_with must be a string, not ${typeof e.ignore_with}.`);
838
- if (e.ignore_with.startsWith("_"))
839
- throw new Error("ignore_with cannot start with an underscore.");
840
- }
841
- if (Object.hasOwn(e, "strict") && typeof e.strict != "boolean")
842
- throw new Error(`Strict config must be a boolean, not ${typeof e.strict}.`);
843
- if (Object.hasOwn(e, "tag_wrap") && typeof e.tag_wrap != "number")
844
- throw new Error(`tag_wrap config must be a number, not ${typeof e.tag_wrap}.`);
845
- if (Object.hasOwn(e, "trim") && (!Array.isArray(e.trim) || !e.trim?.every((r) => typeof r == "string")))
846
- throw new Error("Trim config must be an array of strings.");
847
- return pt(t, e);
848
- }, Ot = (e, t, s) => {
849
- const n = e.trim().split(/\s+/);
850
- if (n.length === 0 || n.length === 1 && n[0] === "")
851
- return "";
852
- const r = [];
853
- let o = "";
854
- const i = s;
855
- n.forEach((f) => {
856
- if (f === "") return;
857
- if (f.length >= t) {
858
- o !== "" && r.push(r.length === 0 ? s + o : i + o), r.push(r.length === 0 ? s + f : i + f), o = "";
859
- return;
860
- }
861
- const c = o === "" ? f : o + " " + f;
862
- c.length <= t ? o = c : (o !== "" && r.push(r.length === 0 ? s + o : i + o), o = f);
863
- }), o !== "" && r.push(r.length === 0 ? s + o : i + o);
864
- const u = r.join(`
865
- `);
866
- return dt(u);
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"));
867
657
  };
868
- function Se(e) {
869
- k({ ignored: !0 });
870
- const t = b().config;
871
- let s = e;
872
- const n = /* @__PURE__ */ new Map();
873
- let r = 0;
874
- const o = "___HTMLFY_SPECIAL_IGNORE_MARKER_";
875
- for (const i of t.ignore) {
876
- const u = i.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), f = new RegExp(
877
- `(<\\s*${u}[^>]*>)(.*?)(<\\s*/\\s*${u}\\s*>)`,
878
- "gs"
879
- // global and dotAll
880
- );
881
- let c;
882
- const a = [];
883
- for (; (c = f.exec(s)) !== null; ) {
884
- const l = `${o}${r++}___`;
885
- n.set(l, c[2]), a.push({
886
- start: c.index + c[1].length,
887
- // start of content
888
- end: c.index + c[1].length + c[2].length,
889
- // end of content
890
- marker: l
891
- });
892
- }
893
- for (let l = a.length - 1; l >= 0; l--) {
894
- const p = a[l];
895
- s = s.substring(0, p.start) + p.marker + s.substring(p.end);
896
- }
897
- }
898
- return { html_with_markers: s, extracted_map: n };
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
+ };
899
680
  }
900
- function Le(e, t) {
901
- k({ ignored: !1 });
902
- let s = e;
903
- for (const [n, r] of t)
904
- s = s.split(n).join(r);
905
- return s;
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;
906
686
  }
907
- const At = new RegExp(`<(${Ae.join("|")})(?:\\s(?:[^/>]|/(?!>))*)*>`, "g");
908
- function Tt(e) {
909
- const { constants: t } = b();
910
- return e.replace(
911
- // match only void elements that are not self-closing
912
- At,
913
- (s) => s.replace(/>$/, t.SELF_CLOSING_PLACEHOLDER)
914
- );
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));
915
691
  }
916
- function Rt(e) {
917
- const { constants: t } = b();
918
- return e.replace(t.SELF_CLOSING_PLACEHOLDER, ">");
692
+ function ht(e) {
693
+ let { constants: t } = X();
694
+ return e.replace(t.SELF_CLOSING_PLACEHOLDER, ">");
919
695
  }
920
- const xt = (e, t = !1) => (e = e.replace(/<\s*textarea[^>]*>((.|\n)*?)<s*\/\s*textarea\s*>/g, (s, n) => s.replace(n, (r) => r.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, (s) => s.replace(/\s+/g, " ").replace(/\s>/g, ">").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/<\s/g, "<").replace(/<\/\s/g, "</").replace(/class=["']\s/g, (n) => n.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"))), e), St = (e) => e = e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (t, s) => t.replace(s, (n) => (n = n.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&#10;/g, `
921
- `).replace(/&#13;/g, "\r").replace(/&nbsp;/g, " ").replace(/\s+/g, " "), n)));
922
- let ae;
923
- const Lt = (e, t) => {
924
- let s = !1;
925
- const { checked_html: n, ignored: r, constants: o } = b();
926
- if (!n && !Re(e)) return e;
927
- const u = b().config.ignore.length > 0;
928
- if (!r && u) {
929
- const { html_with_markers: f, extracted_map: c } = Se(e);
930
- e = f, ae = c, s = !0;
931
- }
932
- return e = xt(e, !0), e = e.replace(/\n|\t/g, ""), e = e.replace(/>\s+</g, "><"), e = e.replace(/ {2,}/g, " "), e = e.replace(
933
- /(\S) (<[a-zA-Z][a-zA-Z0-9_:-]*)/g,
934
- "$1___MINIFY-PROTECTED-SPACE___$2"
935
- ), e = e.replace(
936
- /(<\/[a-zA-Z][a-zA-Z0-9_:-]*>) (\S)/g,
937
- "$1___MINIFY-PROTECTED-SPACE___$2"
938
- ), 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(new RegExp("___MINIFY-PROTECTED-SPACE___", "g"), " "), e = e.replace(/ = /g, "="), e = e.replace(
939
- /([a-zA-Z0-9_-]+)=(['"])(.*?)\2/g,
940
- (f, c, a, l) => {
941
- const p = l.trim();
942
- return `${c}=${a}${p}${a}`;
943
- }
944
- ), e = e.trim(), e = St(e), s && (e = Le(e, ae)), e;
945
- }, N = {
946
- line: []
947
- };
948
- let le;
949
- const Nt = (e) => {
950
- N.line = [];
951
- let t = -1;
952
- const s = /(<[^>]+>)|([^<]+)/g;
953
- e.replace(s, (n, r, o) => (r ? N.line.push({ type: "tag", value: n }) : o && o.trim().length > 0 && N.line.push({ type: "text", value: n }), t++, `
954
- [#-# : ${t} : ${n} : #-#]
955
- `));
956
- }, Ct = () => {
957
- const { config: e, constants: t } = b(), s = " ".repeat(e.tab_size), n = e.tag_wrap, r = e.content_wrap, o = e.strict;
958
- let i = "";
959
- const u = [], f = /<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g, c = /\s{1}[A-Za-z-]+(?:=".*?")?/g;
960
- N.line.forEach((l, p) => {
961
- let $ = l.value;
962
- const g = $.startsWith("___HTMLFY_SPECIAL_IGNORE_MARKER_");
963
- let _ = 0;
964
- const m = N.line[p - 1], y = m?.value ?? "";
965
- i += "0", p === 0 && _++, $.trim().startsWith("</") && _++, y.trim().startsWith("<!doctype") && _++, y.trim().startsWith("<!--") && _++, (y.trim().endsWith("/>") || y.trim().endsWith(t.SELF_CLOSING_PLACEHOLDER)) && _++, y.trim().startsWith("</") && _++, m?.type === "text" && _++;
966
- const D = Math.max(0, i.length - _);
967
- if (i = i.substring(0, D), l.type === "text" && /^[!,;\.]/.test($)) {
968
- if ($.length === 1) {
969
- u[u.length - 1] = u.at(-1) + $;
970
- return;
971
- } else if (u[u.length - 1] = u.at(-1) + $.charAt(0), $ = $.slice(1).trim(), $.length === 0) return;
972
- }
973
- const h = s.repeat(D);
974
- if (g)
975
- u.push($);
976
- else {
977
- if (o && $.trim().startsWith("<!--"))
978
- return;
979
- let d = $;
980
- if (d = Rt(d), l.type === "text" && r > 0 && d.length >= r)
981
- d = Ot(d, r, h);
982
- else if (n > 0 && d.length > n && f.test(d)) {
983
- f.lastIndex = 0, c.lastIndex = 0;
984
- const S = d.split(c).filter(Boolean);
985
- if (S.length >= 2) {
986
- const Ce = d.matchAll(c), we = h + s;
987
- let U = h + S[0] + `
988
- `;
989
- for (const Pe of Ce) {
990
- const ze = Pe[0].trim();
991
- U += we + ze + `
992
- `;
993
- }
994
- const ee = S[0].match(/<([A-Za-z_:-]+)/), Ie = ee ? ee[1] : "", ke = S.at(-1)?.endsWith("/>") && Ae.includes(Ie), De = S[1].trim(), je = h + (o && ke ? " " : "");
995
- U += je + De, d = U;
996
- } else
997
- d = h + d;
998
- } else
999
- d = h + d;
1000
- u.push(d);
1001
- }
1002
- });
1003
- let a = u.join(`
1004
- `);
1005
- return n > 0 && (a = $t(a)), r > 0 && new RegExp(`/\\n[ ]*[^\\n]*${t.CONTENT_IGNORE_PLACEHOLDER}[^\\n]*\\n/`).test(a) && (a = _t(a)), a = a.replace(
1006
- /<(?<Element>[^>\s]+)[^>]*>[^<]*?[^><\/\s][^<]*?<\/\k<Element>>|<script[^>]*>[\s]*<\/script>|<([\w:\._-]+)([^>]*)><\/\2>|<([\w:\._-]+)([^>]*)>[\s]+<\/\4>/g,
1007
- (l) => l.includes(t.SELF_CLOSING_PLACEHOLDER) || l.includes(t.CONTENT_IGNORE_PLACEHOLDER) ? l : l.replace(/\n|\t|\s{2,}/g, "")
1008
- ), r > 0 && (a = bt(a)), n > 0 && (a = Et(a)), o && (a = a.replace(/\s\/>|\/>/g, ">")), a.startsWith(`
1009
- `) && (a = a.substring(1)), a.endsWith(`
1010
- `) && (a = a.substring(0, a.length - 1)), a;
1011
- }, wt = (e, t) => {
1012
- let s = !1;
1013
- const { checked_html: n, ignored: r } = b();
1014
- if (!n && !Re(e)) return e;
1015
- const o = vt(t || {}), i = o.ignore.length > 0;
1016
- if (o.trim.length > 0 && (e = yt(e, o.trim)), !r && i) {
1017
- const { html_with_markers: u, extracted_map: f } = Se(e);
1018
- e = u, le = f, s = !0;
1019
- }
1020
- return e = ht(e), e = Tt(e), e = Lt(e), Nt(e), e = Ct(), e = mt(e), s && (e = Le(e, le)), e;
1021
- }, It = (e, t, s) => {
1022
- [null, void 0, "", !1].includes(s) || ["innerHTML", "style", ""].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof s) ? "⚠️ Property must be set through a script or a framework-specific syntax." : s);
1023
- }, Ne = (e, t, s, n, r) => {
1024
- if (t && typeof t == "string") {
1025
- const o = document.createElement(t);
1026
- Object.keys(s || {}).forEach((i) => {
1027
- It(o, i, s[i]);
1028
- }), n?.forEach((i) => {
1029
- Ne(o, i.$tag$, i.$attrs$, i.$children$, i.$text$);
1030
- }), s?.innerHTML && (o.innerHTML = s.innerHTML), e.appendChild(o);
1031
- }
1032
- r && (e.innerHTML = r);
1033
- }, is = (e, t, s = []) => {
1034
- const n = {};
1035
- if (typeof e != "object")
1036
- throw new Error("filterArgs - args isn't an object.");
1037
- for (const r in e)
1038
- if (!s.includes(r)) {
1039
- const o = e[r], i = r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1040
- (!t || !Object.keys(t).includes(r) || t[r] !== o) && (n[i] = o);
1041
- }
1042
- return n;
1043
- }, as = (e, t) => {
1044
- const s = document.getElementById("storybook-root");
1045
- if (s !== null)
1046
- return document.querySelector("[lang]")?.setAttribute("lang", t.globals?.locale || "en"), gt({
1047
- $cmpMeta$: {
1048
- $flags$: 0,
1049
- $tagName$: s.tagName
1050
- },
1051
- $hostElement$: s
1052
- }, e(t)), s.children[s.children.length - 1];
1053
- }, ls = ({ $tag$: e, $attrs$: t, $children$: s, $text$: n }) => {
1054
- const r = document.createElement("div");
1055
- return Ne(r, e, t, s, n), wt(r.innerHTML, {
1056
- tag_wrap: 40,
1057
- content_wrap: 120
1058
- }).replace(/="true"/g, "");
1059
- }, ce = (e, t) => {
1060
- if (!t)
1061
- return;
1062
- const s = t.split("/");
1063
- return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
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;
1064
974
  };
1065
- class cs {
1066
- /**
1067
- * JsonDocs
1068
- */
1069
- jsonDoc;
1070
- constructor(t) {
1071
- this.jsonDoc = t;
1072
- }
1073
- /**
1074
- * Get component data from the jsonDoc
1075
- * @param tagName - tag name we want to get the data from
1076
- * @returns component data
1077
- */
1078
- #e = (t) => this.jsonDoc.components.find((s) => s.tag === t);
1079
- /**
1080
- * Get the control for the given prop
1081
- * Based on https://storybook.js.org/docs/api/arg-types#controltype
1082
- * @param prop - prop to get control for
1083
- * @returns control type and options if applicable
1084
- */
1085
- #t = (t) => {
1086
- const s = t.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (n) => n.replace(/\|/g, " OR ")).split("|").map((n) => n.trim().replace(/ OR /g, "|"));
1087
- return t.type === "string" ? { control: { type: "text" } } : t.type === "number" ? { control: { type: "number" } } : t.type === "boolean" ? { control: { type: "boolean" } } : t.type.startsWith("{") && t.type.endsWith("}") ? { control: { type: "object" } } : s.length > 1 ? s.includes("string") ? { control: { type: "text" } } : s.every((n) => n?.includes("[]")) ? { control: { type: "object" } } : (s.unshift(void 0), { control: { type: "select" }, options: s }) : { control: { type: "object" } };
1088
- };
1089
- /**
1090
- * Extract component arg types from the component data
1091
- * @param tagName - tag name we want to extract the arg types from
1092
- * @returns component arg types
1093
- */
1094
- extractArgTypes = (t) => {
1095
- const s = this.#e(t), n = s?.props.reduce((a, l) => {
1096
- const { control: p, options: $ } = this.#t(l);
1097
- return {
1098
- ...a,
1099
- [l.name]: {
1100
- name: l.attr || l.name,
1101
- description: l.docs,
1102
- type: { required: l.required },
1103
- table: {
1104
- category: "props",
1105
- type: { summary: l.type },
1106
- defaultValue: { summary: l.default }
1107
- },
1108
- control: p,
1109
- options: $
1110
- }
1111
- };
1112
- }, {}), r = s?.events.reduce((a, l) => ({
1113
- ...a,
1114
- [l.event]: {
1115
- name: l.event,
1116
- description: l.docs,
1117
- table: {
1118
- category: "events",
1119
- type: { summary: l.detail }
1120
- }
1121
- }
1122
- }), {}), o = s?.methods.reduce((a, l) => ({
1123
- ...a,
1124
- [l.name]: {
1125
- name: l.name,
1126
- description: l.docs,
1127
- table: {
1128
- category: "methods",
1129
- type: { summary: l.signature }
1130
- }
1131
- }
1132
- }), {}), i = s?.slots.reduce((a, l) => ({
1133
- ...a,
1134
- [l.name]: {
1135
- name: l.name !== "" ? l.name : "default",
1136
- // default slot are unnamed
1137
- description: l.docs,
1138
- table: {
1139
- category: "slots",
1140
- type: { summary: void 0 }
1141
- }
1142
- }
1143
- }), {}), u = s?.styles.reduce((a, l) => ({
1144
- ...a,
1145
- [l.name]: {
1146
- name: l.name,
1147
- description: l.docs,
1148
- table: {
1149
- category: "custom properties",
1150
- type: { summary: void 0 }
1151
- }
1152
- }
1153
- }), {}), f = s?.dependencies.reduce((a, l) => {
1154
- const p = this.#e(l);
1155
- return p ? {
1156
- ...a,
1157
- [l]: {
1158
- name: l,
1159
- description: `<a href="./?path=/docs/${ce("", p?.filePath)}">View Component Documentation</a>`,
1160
- table: {
1161
- category: "depends on",
1162
- type: { summary: void 0 }
1163
- }
1164
- }
1165
- } : a;
1166
- }, {}), c = s?.dependents.reduce((a, l) => {
1167
- const p = this.#e(l);
1168
- return p ? {
1169
- ...a,
1170
- [l]: {
1171
- name: l,
1172
- description: `<a href="./?path=/docs/${ce("", p?.filePath)}">View Component Documentation</a>`,
1173
- table: {
1174
- category: "used by",
1175
- type: { summary: void 0 }
1176
- }
1177
- }
1178
- } : a;
1179
- }, {});
1180
- return {
1181
- ...n,
1182
- ...r,
1183
- ...o,
1184
- ...i,
1185
- ...u,
1186
- ...f,
1187
- ...c
1188
- };
1189
- };
1190
- /**
1191
- * Extract component description from the component data
1192
- * @param tagName - tag name we want to extract the description from
1193
- * @returns component description
1194
- */
1195
- extractComponentDescription = (t) => {
1196
- const s = this.#e(t);
1197
- return s?.readme || s?.docs;
1198
- };
1199
- }
1200
- const fs = ({ disconnect: e, observe: t, takeRecords: s }) => {
1201
- class n {
1202
- /**
1203
- *
1204
- */
1205
- disconnect = e;
1206
- /**
1207
- *
1208
- */
1209
- observe = t;
1210
- /**
1211
- *
1212
- */
1213
- takeRecords = s;
1214
- /**
1215
- *
1216
- */
1217
- cb;
1218
- constructor(o) {
1219
- this.cb = o;
1220
- }
1221
- }
1222
- return [window, global].forEach((r) => {
1223
- Object.defineProperty(r, "MutationObserver", {
1224
- writable: !0,
1225
- configurable: !0,
1226
- value: n
1227
- });
1228
- }), n;
1229
- }, us = ({ disconnect: e, observe: t }) => {
1230
- class s {
1231
- /**
1232
- *
1233
- */
1234
- disconnect = e;
1235
- /**
1236
- *
1237
- */
1238
- observe = t;
1239
- /**
1240
- *
1241
- */
1242
- unobserve;
1243
- /**
1244
- *
1245
- */
1246
- cb;
1247
- constructor(r) {
1248
- this.cb = r;
1249
- }
1250
- }
1251
- return [window, global].forEach((n) => {
1252
- Object.defineProperty(n, "ResizeObserver", {
1253
- writable: !0,
1254
- configurable: !0,
1255
- value: s
1256
- });
1257
- }), s;
1258
- };
1259
- class kt extends Event {
1260
- /**
1261
- *
1262
- */
1263
- detail;
1264
- // eslint-disable-line @typescript-eslint/no-explicit-any
1265
- }
1266
- const gs = () => {
1267
- class e extends kt {
1268
- }
1269
- return [window, global].forEach((t) => {
1270
- Object.defineProperty(t, "SubmitEvent", {
1271
- writable: !0,
1272
- configurable: !0,
1273
- value: e
1274
- });
1275
- }), e;
1276
- }, ps = (e) => {
1277
- const t = (s) => (setTimeout(s, 1), e(), 0);
1278
- return [window, global].forEach((s) => {
1279
- Object.defineProperty(s, "requestAnimationFrame", {
1280
- writable: !0,
1281
- configurable: !0,
1282
- value: t
1283
- });
1284
- }), t;
1285
- };
1286
- export {
1287
- Dt as ClassList,
1288
- Bt as Cursor,
1289
- Ge as Page,
1290
- Ut as Paginate,
1291
- cs as StorybookPreview,
1292
- jt as allItemsAreString,
1293
- zt as cleanString,
1294
- Ht as createID,
1295
- Zt as dateRegExp,
1296
- Wt as dateToString,
1297
- os as defineLocales,
1298
- is as filterArgs,
1299
- Jt as focusableElements,
1300
- Ft as formatID,
1301
- es as getLocaleDatePattern,
1302
- He as getObjectValueFromKey,
1303
- ue as getParentWindows,
1304
- ls as getStoryHTML,
1305
- ce as getStorybookUrl,
1306
- Kt as getWindows,
1307
- G as isObject,
1308
- qt as isTagName,
1309
- Yt as isValidNumber,
1310
- Me as isValidString,
1311
- Mt as isValideID,
1312
- ts as localeCurrency,
1313
- Je as localeDate,
1314
- ss as localeNumber,
1315
- ns as localePercent,
1316
- rs as localeUnit,
1317
- Gt as nextTick,
1318
- ps as setUpRequestAnimationFrameMock,
1319
- fs as setupMutationObserverMock,
1320
- us as setupResizeObserverMock,
1321
- gs as setupSubmitEventMock,
1322
- as as stencilWrapper,
1323
- Pt as toString,
1324
- Vt as vsCodeCssGenerator,
1325
- Qt as vsCodeGenerator,
1326
- Xt as webTypesGenerator
1327
- };
1328
- //# 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