@florid-kit/components 2.6.9 → 2.6.11

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.
Files changed (63) hide show
  1. package/assets/icons/icons.d.ts +66 -7
  2. package/components/button.d.ts +0 -3
  3. package/components/dropdown-variant.d.ts +0 -1
  4. package/components/dropdown.d.ts +0 -1
  5. package/components/icon-button.d.ts +0 -5
  6. package/components/wishlist-button.d.ts +0 -2
  7. package/index.js +5742 -0
  8. package/index.mjs +9629 -68
  9. package/package.json +2 -19
  10. package/assets/icons/icons-occ.d.ts +0 -315
  11. package/components/accordion-group.mjs +0 -61
  12. package/components/accordion.mjs +0 -185
  13. package/components/arch-image.mjs +0 -135
  14. package/components/badge.mjs +0 -75
  15. package/components/breadcrumb.mjs +0 -83
  16. package/components/breadcrumbs.mjs +0 -35
  17. package/components/button.mjs +0 -10
  18. package/components/checkbox.mjs +0 -188
  19. package/components/chip.mjs +0 -158
  20. package/components/chipset.mjs +0 -44
  21. package/components/dots.mjs +0 -60
  22. package/components/dropdown-variant.mjs +0 -445
  23. package/components/dropdown.mjs +0 -302
  24. package/components/feedback-message.mjs +0 -136
  25. package/components/filter-chip.mjs +0 -214
  26. package/components/footer-simplify.mjs +0 -178
  27. package/components/header-simplify.mjs +0 -234
  28. package/components/icon-button.mjs +0 -345
  29. package/components/input.mjs +0 -294
  30. package/components/link.mjs +0 -172
  31. package/components/mediumtile.mjs +0 -307
  32. package/components/minitile.mjs +0 -231
  33. package/components/option-tile.mjs +0 -413
  34. package/components/popin.mjs +0 -412
  35. package/components/radio.mjs +0 -165
  36. package/components/rating.mjs +0 -84
  37. package/components/reassurance.mjs +0 -163
  38. package/components/search-input-dropdown.mjs +0 -314
  39. package/components/search-input.mjs +0 -107
  40. package/components/side-panel.mjs +0 -1197
  41. package/components/tab.mjs +0 -140
  42. package/components/tablist.mjs +0 -44
  43. package/components/tag.mjs +0 -86
  44. package/components/textarea.mjs +0 -269
  45. package/components/thumbnail-navigation.mjs +0 -232
  46. package/components/toast.mjs +0 -190
  47. package/components/tooltip.mjs +0 -125
  48. package/components/wishlist-button.mjs +0 -137
  49. package/css-r3TDS8Ma.mjs +0 -37
  50. package/directive-helpers-CjGdYF2i.mjs +0 -11
  51. package/directive-oAbCiebi.mjs +0 -27
  52. package/element-internals-Dw7LndlH.mjs +0 -19
  53. package/icons-occ-DW--7nRr.mjs +0 -834
  54. package/if-defined-BaFqfNKT.mjs +0 -10
  55. package/live-BPnRJXAq.mjs +0 -30
  56. package/loader.d.ts +0 -3
  57. package/loader.mjs +0 -81
  58. package/logo-CEgaTL93.mjs +0 -4
  59. package/performance-mixin-vBVz5Iib.mjs +0 -774
  60. package/property-8EkRXcYy.mjs +0 -36
  61. package/query-NJDNu0-P.mjs +0 -25
  62. package/state-BvkYxy1c.mjs +0 -12
  63. package/unsafe-svg-CRYN20gz.mjs +0 -210
@@ -1,774 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- const j = globalThis, Y = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Z = Symbol(), X = /* @__PURE__ */ new WeakMap();
7
- let dt = class {
8
- constructor(t, e, s) {
9
- if (this._$cssResult$ = !0, s !== Z) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
- this.cssText = t, this.t = e;
11
- }
12
- get styleSheet() {
13
- let t = this.o;
14
- const e = this.t;
15
- if (Y && t === void 0) {
16
- const s = e !== void 0 && e.length === 1;
17
- s && (t = X.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && X.set(e, t));
18
- }
19
- return t;
20
- }
21
- toString() {
22
- return this.cssText;
23
- }
24
- };
25
- const gt = (o) => new dt(typeof o == "string" ? o : o + "", void 0, Z), Ft = (o, ...t) => {
26
- const e = o.length === 1 ? o[0] : t.reduce((s, i, r) => s + ((n) => {
27
- if (n._$cssResult$ === !0) return n.cssText;
28
- if (typeof n == "number") return n;
29
- throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
30
- })(i) + o[r + 1], o[0]);
31
- return new dt(e, o, Z);
32
- }, yt = (o, t) => {
33
- if (Y) o.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
34
- else for (const e of t) {
35
- const s = document.createElement("style"), i = j.litNonce;
36
- i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, o.appendChild(s);
37
- }
38
- }, tt = Y ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((t) => {
39
- let e = "";
40
- for (const s of t.cssRules) e += s.cssText;
41
- return gt(e);
42
- })(o) : o;
43
- /**
44
- * @license
45
- * Copyright 2017 Google LLC
46
- * SPDX-License-Identifier: BSD-3-Clause
47
- */
48
- const { is: At, defineProperty: vt, getOwnPropertyDescriptor: bt, getOwnPropertyNames: Et, getOwnPropertySymbols: wt, getPrototypeOf: St } = Object, b = globalThis, et = b.trustedTypes, Ct = et ? et.emptyScript : "", K = b.reactiveElementPolyfillSupport, H = (o, t) => o, G = { toAttribute(o, t) {
49
- switch (t) {
50
- case Boolean:
51
- o = o ? Ct : null;
52
- break;
53
- case Object:
54
- case Array:
55
- o = o == null ? o : JSON.stringify(o);
56
- }
57
- return o;
58
- }, fromAttribute(o, t) {
59
- let e = o;
60
- switch (t) {
61
- case Boolean:
62
- e = o !== null;
63
- break;
64
- case Number:
65
- e = o === null ? null : Number(o);
66
- break;
67
- case Object:
68
- case Array:
69
- try {
70
- e = JSON.parse(o);
71
- } catch {
72
- e = null;
73
- }
74
- }
75
- return e;
76
- } }, pt = (o, t) => !At(o, t), st = { attribute: !0, type: String, converter: G, reflect: !1, useDefault: !1, hasChanged: pt };
77
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), b.litPropertyMetadata ?? (b.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
- let T = class extends HTMLElement {
79
- static addInitializer(t) {
80
- this._$Ei(), (this.l ?? (this.l = [])).push(t);
81
- }
82
- static get observedAttributes() {
83
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
84
- }
85
- static createProperty(t, e = st) {
86
- if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
87
- const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
88
- i !== void 0 && vt(this.prototype, t, i);
89
- }
90
- }
91
- static getPropertyDescriptor(t, e, s) {
92
- const { get: i, set: r } = bt(this.prototype, t) ?? { get() {
93
- return this[e];
94
- }, set(n) {
95
- this[e] = n;
96
- } };
97
- return { get: i, set(n) {
98
- const c = i == null ? void 0 : i.call(this);
99
- r == null || r.call(this, n), this.requestUpdate(t, c, s);
100
- }, configurable: !0, enumerable: !0 };
101
- }
102
- static getPropertyOptions(t) {
103
- return this.elementProperties.get(t) ?? st;
104
- }
105
- static _$Ei() {
106
- if (this.hasOwnProperty(H("elementProperties"))) return;
107
- const t = St(this);
108
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
109
- }
110
- static finalize() {
111
- if (this.hasOwnProperty(H("finalized"))) return;
112
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(H("properties"))) {
113
- const e = this.properties, s = [...Et(e), ...wt(e)];
114
- for (const i of s) this.createProperty(i, e[i]);
115
- }
116
- const t = this[Symbol.metadata];
117
- if (t !== null) {
118
- const e = litPropertyMetadata.get(t);
119
- if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
120
- }
121
- this._$Eh = /* @__PURE__ */ new Map();
122
- for (const [e, s] of this.elementProperties) {
123
- const i = this._$Eu(e, s);
124
- i !== void 0 && this._$Eh.set(i, e);
125
- }
126
- this.elementStyles = this.finalizeStyles(this.styles);
127
- }
128
- static finalizeStyles(t) {
129
- const e = [];
130
- if (Array.isArray(t)) {
131
- const s = new Set(t.flat(1 / 0).reverse());
132
- for (const i of s) e.unshift(tt(i));
133
- } else t !== void 0 && e.push(tt(t));
134
- return e;
135
- }
136
- static _$Eu(t, e) {
137
- const s = e.attribute;
138
- return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
139
- }
140
- constructor() {
141
- super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
142
- }
143
- _$Ev() {
144
- var t;
145
- this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
146
- }
147
- addController(t) {
148
- var e;
149
- (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
150
- }
151
- removeController(t) {
152
- var e;
153
- (e = this._$EO) == null || e.delete(t);
154
- }
155
- _$E_() {
156
- const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
157
- for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
158
- t.size > 0 && (this._$Ep = t);
159
- }
160
- createRenderRoot() {
161
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
162
- return yt(t, this.constructor.elementStyles), t;
163
- }
164
- connectedCallback() {
165
- var t;
166
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
167
- var s;
168
- return (s = e.hostConnected) == null ? void 0 : s.call(e);
169
- });
170
- }
171
- enableUpdating(t) {
172
- }
173
- disconnectedCallback() {
174
- var t;
175
- (t = this._$EO) == null || t.forEach((e) => {
176
- var s;
177
- return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
178
- });
179
- }
180
- attributeChangedCallback(t, e, s) {
181
- this._$AK(t, s);
182
- }
183
- _$ET(t, e) {
184
- var r;
185
- const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
186
- if (i !== void 0 && s.reflect === !0) {
187
- const n = (((r = s.converter) == null ? void 0 : r.toAttribute) !== void 0 ? s.converter : G).toAttribute(e, s.type);
188
- this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
189
- }
190
- }
191
- _$AK(t, e) {
192
- var r, n;
193
- const s = this.constructor, i = s._$Eh.get(t);
194
- if (i !== void 0 && this._$Em !== i) {
195
- const c = s.getPropertyOptions(i), l = typeof c.converter == "function" ? { fromAttribute: c.converter } : ((r = c.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? c.converter : G;
196
- this._$Em = i, this[i] = l.fromAttribute(e, c.type) ?? ((n = this._$Ej) == null ? void 0 : n.get(i)) ?? null, this._$Em = null;
197
- }
198
- }
199
- requestUpdate(t, e, s) {
200
- var i;
201
- if (t !== void 0) {
202
- const r = this.constructor, n = this[t];
203
- if (s ?? (s = r.getPropertyOptions(t)), !((s.hasChanged ?? pt)(n, e) || s.useDefault && s.reflect && n === ((i = this._$Ej) == null ? void 0 : i.get(t)) && !this.hasAttribute(r._$Eu(t, s)))) return;
204
- this.C(t, e, s);
205
- }
206
- this.isUpdatePending === !1 && (this._$ES = this._$EP());
207
- }
208
- C(t, e, { useDefault: s, reflect: i, wrapped: r }, n) {
209
- s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), r !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
210
- }
211
- async _$EP() {
212
- this.isUpdatePending = !0;
213
- try {
214
- await this._$ES;
215
- } catch (e) {
216
- Promise.reject(e);
217
- }
218
- const t = this.scheduleUpdate();
219
- return t != null && await t, !this.isUpdatePending;
220
- }
221
- scheduleUpdate() {
222
- return this.performUpdate();
223
- }
224
- performUpdate() {
225
- var s;
226
- if (!this.isUpdatePending) return;
227
- if (!this.hasUpdated) {
228
- if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
229
- for (const [r, n] of this._$Ep) this[r] = n;
230
- this._$Ep = void 0;
231
- }
232
- const i = this.constructor.elementProperties;
233
- if (i.size > 0) for (const [r, n] of i) {
234
- const { wrapped: c } = n, l = this[r];
235
- c !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, n, l);
236
- }
237
- }
238
- let t = !1;
239
- const e = this._$AL;
240
- try {
241
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
242
- var r;
243
- return (r = i.hostUpdate) == null ? void 0 : r.call(i);
244
- }), this.update(e)) : this._$EM();
245
- } catch (i) {
246
- throw t = !1, this._$EM(), i;
247
- }
248
- t && this._$AE(e);
249
- }
250
- willUpdate(t) {
251
- }
252
- _$AE(t) {
253
- var e;
254
- (e = this._$EO) == null || e.forEach((s) => {
255
- var i;
256
- return (i = s.hostUpdated) == null ? void 0 : i.call(s);
257
- }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
258
- }
259
- _$EM() {
260
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
261
- }
262
- get updateComplete() {
263
- return this.getUpdateComplete();
264
- }
265
- getUpdateComplete() {
266
- return this._$ES;
267
- }
268
- shouldUpdate(t) {
269
- return !0;
270
- }
271
- update(t) {
272
- this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
273
- }
274
- updated(t) {
275
- }
276
- firstUpdated(t) {
277
- }
278
- };
279
- T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[H("elementProperties")] = /* @__PURE__ */ new Map(), T[H("finalized")] = /* @__PURE__ */ new Map(), K == null || K({ ReactiveElement: T }), (b.reactiveElementVersions ?? (b.reactiveElementVersions = [])).push("2.1.0");
280
- /**
281
- * @license
282
- * Copyright 2017 Google LLC
283
- * SPDX-License-Identifier: BSD-3-Clause
284
- */
285
- const R = globalThis, F = R.trustedTypes, it = F ? F.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, ut = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, ft = "?" + v, xt = `<${ft}>`, x = document, L = () => x.createComment(""), D = (o) => o === null || typeof o != "object" && typeof o != "function", Q = Array.isArray, Pt = (o) => Q(o) || typeof (o == null ? void 0 : o[Symbol.iterator]) == "function", V = `[
286
- \f\r]`, N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ot = /-->/g, nt = />/g, w = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
287
- \f\r"'\`<>=]|("|')|))|$)`, "g"), rt = /'/g, at = /"/g, mt = /^(?:script|style|textarea|title)$/i, Tt = (o) => (t, ...e) => ({ _$litType$: o, strings: t, values: e }), Kt = Tt(1), k = Symbol.for("lit-noChange"), $ = Symbol.for("lit-nothing"), lt = /* @__PURE__ */ new WeakMap(), S = x.createTreeWalker(x, 129);
288
- function $t(o, t) {
289
- if (!Q(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
290
- return it !== void 0 ? it.createHTML(t) : t;
291
- }
292
- const kt = (o, t) => {
293
- const e = o.length - 1, s = [];
294
- let i, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = N;
295
- for (let c = 0; c < e; c++) {
296
- const l = o[c];
297
- let d, h, a = -1, p = 0;
298
- for (; p < l.length && (n.lastIndex = p, h = n.exec(l), h !== null); ) p = n.lastIndex, n === N ? h[1] === "!--" ? n = ot : h[1] !== void 0 ? n = nt : h[2] !== void 0 ? (mt.test(h[2]) && (i = RegExp("</" + h[2], "g")), n = w) : h[3] !== void 0 && (n = w) : n === w ? h[0] === ">" ? (n = i ?? N, a = -1) : h[1] === void 0 ? a = -2 : (a = n.lastIndex - h[2].length, d = h[1], n = h[3] === void 0 ? w : h[3] === '"' ? at : rt) : n === at || n === rt ? n = w : n === ot || n === nt ? n = N : (n = w, i = void 0);
299
- const f = n === w && o[c + 1].startsWith("/>") ? " " : "";
300
- r += n === N ? l + xt : a >= 0 ? (s.push(d), l.slice(0, a) + ut + l.slice(a) + v + f) : l + v + (a === -2 ? c : f);
301
- }
302
- return [$t(o, r + (o[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
303
- };
304
- class I {
305
- constructor({ strings: t, _$litType$: e }, s) {
306
- let i;
307
- this.parts = [];
308
- let r = 0, n = 0;
309
- const c = t.length - 1, l = this.parts, [d, h] = kt(t, e);
310
- if (this.el = I.createElement(d, s), S.currentNode = this.el.content, e === 2 || e === 3) {
311
- const a = this.el.content.firstChild;
312
- a.replaceWith(...a.childNodes);
313
- }
314
- for (; (i = S.nextNode()) !== null && l.length < c; ) {
315
- if (i.nodeType === 1) {
316
- if (i.hasAttributes()) for (const a of i.getAttributeNames()) if (a.endsWith(ut)) {
317
- const p = h[n++], f = i.getAttribute(a).split(v), g = /([.?@])?(.*)/.exec(p);
318
- l.push({ type: 1, index: r, name: g[2], strings: f, ctor: g[1] === "." ? Mt : g[1] === "?" ? Ut : g[1] === "@" ? Nt : W }), i.removeAttribute(a);
319
- } else a.startsWith(v) && (l.push({ type: 6, index: r }), i.removeAttribute(a));
320
- if (mt.test(i.tagName)) {
321
- const a = i.textContent.split(v), p = a.length - 1;
322
- if (p > 0) {
323
- i.textContent = F ? F.emptyScript : "";
324
- for (let f = 0; f < p; f++) i.append(a[f], L()), S.nextNode(), l.push({ type: 2, index: ++r });
325
- i.append(a[p], L());
326
- }
327
- }
328
- } else if (i.nodeType === 8) if (i.data === ft) l.push({ type: 2, index: r });
329
- else {
330
- let a = -1;
331
- for (; (a = i.data.indexOf(v, a + 1)) !== -1; ) l.push({ type: 7, index: r }), a += v.length - 1;
332
- }
333
- r++;
334
- }
335
- }
336
- static createElement(t, e) {
337
- const s = x.createElement("template");
338
- return s.innerHTML = t, s;
339
- }
340
- }
341
- function O(o, t, e = o, s) {
342
- var n, c;
343
- if (t === k) return t;
344
- let i = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl;
345
- const r = D(t) ? void 0 : t._$litDirective$;
346
- return (i == null ? void 0 : i.constructor) !== r && ((c = i == null ? void 0 : i._$AO) == null || c.call(i, !1), r === void 0 ? i = void 0 : (i = new r(o), i._$AT(o, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = O(o, i._$AS(o, t.values), i, s)), t;
347
- }
348
- class Ot {
349
- constructor(t, e) {
350
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
351
- }
352
- get parentNode() {
353
- return this._$AM.parentNode;
354
- }
355
- get _$AU() {
356
- return this._$AM._$AU;
357
- }
358
- u(t) {
359
- const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? x).importNode(e, !0);
360
- S.currentNode = i;
361
- let r = S.nextNode(), n = 0, c = 0, l = s[0];
362
- for (; l !== void 0; ) {
363
- if (n === l.index) {
364
- let d;
365
- l.type === 2 ? d = new z(r, r.nextSibling, this, t) : l.type === 1 ? d = new l.ctor(r, l.name, l.strings, this, t) : l.type === 6 && (d = new Ht(r, this, t)), this._$AV.push(d), l = s[++c];
366
- }
367
- n !== (l == null ? void 0 : l.index) && (r = S.nextNode(), n++);
368
- }
369
- return S.currentNode = x, i;
370
- }
371
- p(t) {
372
- let e = 0;
373
- for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
374
- }
375
- }
376
- class z {
377
- get _$AU() {
378
- var t;
379
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
380
- }
381
- constructor(t, e, s, i) {
382
- this.type = 2, this._$AH = $, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
383
- }
384
- get parentNode() {
385
- let t = this._$AA.parentNode;
386
- const e = this._$AM;
387
- return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
388
- }
389
- get startNode() {
390
- return this._$AA;
391
- }
392
- get endNode() {
393
- return this._$AB;
394
- }
395
- _$AI(t, e = this) {
396
- t = O(this, t, e), D(t) ? t === $ || t == null || t === "" ? (this._$AH !== $ && this._$AR(), this._$AH = $) : t !== this._$AH && t !== k && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Pt(t) ? this.k(t) : this._(t);
397
- }
398
- O(t) {
399
- return this._$AA.parentNode.insertBefore(t, this._$AB);
400
- }
401
- T(t) {
402
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
403
- }
404
- _(t) {
405
- this._$AH !== $ && D(this._$AH) ? this._$AA.nextSibling.data = t : this.T(x.createTextNode(t)), this._$AH = t;
406
- }
407
- $(t) {
408
- var r;
409
- const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = I.createElement($t(s.h, s.h[0]), this.options)), s);
410
- if (((r = this._$AH) == null ? void 0 : r._$AD) === i) this._$AH.p(e);
411
- else {
412
- const n = new Ot(i, this), c = n.u(this.options);
413
- n.p(e), this.T(c), this._$AH = n;
414
- }
415
- }
416
- _$AC(t) {
417
- let e = lt.get(t.strings);
418
- return e === void 0 && lt.set(t.strings, e = new I(t)), e;
419
- }
420
- k(t) {
421
- Q(this._$AH) || (this._$AH = [], this._$AR());
422
- const e = this._$AH;
423
- let s, i = 0;
424
- for (const r of t) i === e.length ? e.push(s = new z(this.O(L()), this.O(L()), this, this.options)) : s = e[i], s._$AI(r), i++;
425
- i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
426
- }
427
- _$AR(t = this._$AA.nextSibling, e) {
428
- var s;
429
- for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
430
- const i = t.nextSibling;
431
- t.remove(), t = i;
432
- }
433
- }
434
- setConnected(t) {
435
- var e;
436
- this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
437
- }
438
- }
439
- class W {
440
- get tagName() {
441
- return this.element.tagName;
442
- }
443
- get _$AU() {
444
- return this._$AM._$AU;
445
- }
446
- constructor(t, e, s, i, r) {
447
- this.type = 1, this._$AH = $, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = r, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = $;
448
- }
449
- _$AI(t, e = this, s, i) {
450
- const r = this.strings;
451
- let n = !1;
452
- if (r === void 0) t = O(this, t, e, 0), n = !D(t) || t !== this._$AH && t !== k, n && (this._$AH = t);
453
- else {
454
- const c = t;
455
- let l, d;
456
- for (t = r[0], l = 0; l < r.length - 1; l++) d = O(this, c[s + l], e, l), d === k && (d = this._$AH[l]), n || (n = !D(d) || d !== this._$AH[l]), d === $ ? t = $ : t !== $ && (t += (d ?? "") + r[l + 1]), this._$AH[l] = d;
457
- }
458
- n && !i && this.j(t);
459
- }
460
- j(t) {
461
- t === $ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
462
- }
463
- }
464
- class Mt extends W {
465
- constructor() {
466
- super(...arguments), this.type = 3;
467
- }
468
- j(t) {
469
- this.element[this.name] = t === $ ? void 0 : t;
470
- }
471
- }
472
- class Ut extends W {
473
- constructor() {
474
- super(...arguments), this.type = 4;
475
- }
476
- j(t) {
477
- this.element.toggleAttribute(this.name, !!t && t !== $);
478
- }
479
- }
480
- class Nt extends W {
481
- constructor(t, e, s, i, r) {
482
- super(t, e, s, i, r), this.type = 5;
483
- }
484
- _$AI(t, e = this) {
485
- if ((t = O(this, t, e, 0) ?? $) === k) return;
486
- const s = this._$AH, i = t === $ && s !== $ || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== $ && (s === $ || i);
487
- i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
488
- }
489
- handleEvent(t) {
490
- var e;
491
- typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
492
- }
493
- }
494
- class Ht {
495
- constructor(t, e, s) {
496
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
497
- }
498
- get _$AU() {
499
- return this._$AM._$AU;
500
- }
501
- _$AI(t) {
502
- O(this, t);
503
- }
504
- }
505
- const q = R.litHtmlPolyfillSupport;
506
- q == null || q(I, z), (R.litHtmlVersions ?? (R.litHtmlVersions = [])).push("3.3.0");
507
- const Rt = (o, t, e) => {
508
- const s = (e == null ? void 0 : e.renderBefore) ?? t;
509
- let i = s._$litPart$;
510
- if (i === void 0) {
511
- const r = (e == null ? void 0 : e.renderBefore) ?? null;
512
- s._$litPart$ = i = new z(t.insertBefore(L(), r), r, void 0, e ?? {});
513
- }
514
- return i._$AI(o), i;
515
- };
516
- /**
517
- * @license
518
- * Copyright 2017 Google LLC
519
- * SPDX-License-Identifier: BSD-3-Clause
520
- */
521
- const C = globalThis;
522
- class B extends T {
523
- constructor() {
524
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
525
- }
526
- createRenderRoot() {
527
- var e;
528
- const t = super.createRenderRoot();
529
- return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
530
- }
531
- update(t) {
532
- const e = this.render();
533
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Rt(e, this.renderRoot, this.renderOptions);
534
- }
535
- connectedCallback() {
536
- var t;
537
- super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
538
- }
539
- disconnectedCallback() {
540
- var t;
541
- super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
542
- }
543
- render() {
544
- return k;
545
- }
546
- }
547
- var ht;
548
- B._$litElement$ = !0, B.finalized = !0, (ht = C.litElementHydrateSupport) == null || ht.call(C, { LitElement: B });
549
- const J = C.litElementPolyfillSupport;
550
- J == null || J({ LitElement: B });
551
- (C.litElementVersions ?? (C.litElementVersions = [])).push("4.2.0");
552
- /**
553
- * @license
554
- * Copyright 2017 Google LLC
555
- * SPDX-License-Identifier: BSD-3-Clause
556
- */
557
- const Vt = (o) => (t, e) => {
558
- e !== void 0 ? e.addInitializer(() => {
559
- customElements.define(o, t);
560
- }) : customElements.define(o, t);
561
- }, _t = new URLSearchParams(location.search).has("perf"), ct = () => {
562
- var o;
563
- return _t || ((o = window.__florid__) == null ? void 0 : o.performance) === !0;
564
- };
565
- let Lt = 0;
566
- const Dt = (o, t, e) => {
567
- const s = o.get(t);
568
- s ? (s.count++, s.total += e, s.min = Math.min(s.min, e), s.max = Math.max(s.max, e)) : o.set(t, { count: 1, total: e, min: e, max: e });
569
- }, It = (o) => o < 5 ? "✓ fast" : o < 15 ? "✓ normal" : o < 30 ? "⚠ slow" : "✗ critical", zt = (o, t) => t ? `${o} [${t}]` : o;
570
- function jt() {
571
- const o = /* @__PURE__ */ new Map(), t = [];
572
- let e = !1, s;
573
- const i = [];
574
- let r = null;
575
- try {
576
- r = new PerformanceObserver((h) => {
577
- h.getEntries().forEach((a) => i.push({ start: a.startTime, duration: a.duration }));
578
- }), r.observe({ type: "longtask", buffered: !0 });
579
- } catch {
580
- }
581
- const n = /* @__PURE__ */ new Map();
582
- let c = null;
583
- try {
584
- c = new PerformanceObserver((h) => {
585
- h.getEntries().forEach((a) => {
586
- const p = a;
587
- p.hadRecentInput || (p.sources ?? []).forEach((f) => {
588
- var E, M;
589
- const g = (M = (E = f.node) == null ? void 0 : E.nodeName) == null ? void 0 : M.toLowerCase();
590
- g != null && g.startsWith("o-") && n.set(g, (n.get(g) ?? 0) + p.value);
591
- });
592
- });
593
- }), c.observe({ type: "layout-shift", buffered: !0 });
594
- } catch {
595
- }
596
- const l = () => {
597
- if (e || (e = !0, d.disconnect(), r == null || r.disconnect(), c == null || c.disconnect(), clearTimeout(s), o.size === 0)) return;
598
- const h = [...o.entries()], a = h.filter(([m]) => m.includes(":init")), p = h.filter(([m]) => m.includes(":to-paint")), f = a.reduce((m, [, u]) => m + u.count, 0), g = p.length > 0 ? p : a, E = Math.max(...g.map(([, m]) => m.max));
599
- console.group(
600
- `%c⚡ Web Components Performance%c — ${location.pathname}`,
601
- "font-weight:bold;color:#b45309",
602
- "font-weight:normal;color:inherit"
603
- );
604
- const M = ([m, { count: u, total: y, min: _, max: A }]) => {
605
- const P = y / u;
606
- return [m, { instances: u, avg: `${P.toFixed(2)}ms`, min: `${_.toFixed(2)}ms`, max: `${A.toFixed(2)}ms`, verdict: It(P) }];
607
- };
608
- if (a.length > 0 && (console.groupCollapsed("JS (Lit render)"), console.table(Object.fromEntries(a.map(M))), console.groupEnd()), p.length > 0)
609
- if (f > 1)
610
- console.groupCollapsed(
611
- `🎨 To first paint: ~${E.toFixed(0)}ms — time until the browser painted all ${f} components (expand for details)`
612
- ), console.log(
613
- `How to read this value:
614
- ~${E.toFixed(0)}ms is the time from when the first component mounted
615
- until the browser completed its first paint pass for the entire page.
616
- All components render in a single browser batch, so this is the total
617
- page render cost — NOT the sum of each component's individual cost.
618
-
619
- What it means for the user:
620
- The page was visible ~${E.toFixed(0)}ms after the components started mounting.
621
-
622
- How to investigate per-component CSS/layout cost:
623
- Test each component in isolation (single-component page or ?perf on a
624
- minimal page). The delta (to-paint − init) then reflects that component's
625
- individual CSS recalc + layout + paint overhead.`
626
- ), console.groupEnd();
627
- else {
628
- console.groupCollapsed("To first paint (JS + CSS layout)"), console.table(Object.fromEntries(p.map(M))), console.groupEnd();
629
- const m = a.flatMap(([u, y]) => {
630
- const _ = o.get(u.replace(":init", ":to-paint"));
631
- if (!_) return [];
632
- const A = _.total / _.count - y.total / y.count, P = A < 1 ? "✓ light" : A < 5 ? "~ moderate" : "⚠ heavy";
633
- return [[u.replace(/:init.*/, ""), { "CSS/layout overhead": `+${A.toFixed(2)}ms`, verdict: P }]];
634
- });
635
- m.length > 0 && (console.groupCollapsed("📐 CSS/layout cost (to-paint − init)"), console.table(Object.fromEntries(m)), console.groupEnd());
636
- }
637
- if (i.length > 0) {
638
- const m = i.reduce((u, y) => u + y.duration, 0);
639
- console.groupCollapsed(
640
- `%c🔴 Long tasks: ${i.length} task${i.length > 1 ? "s" : ""} blocked the main thread for ${m.toFixed(0)}ms total%c — user perceives freeze / delayed interactions`,
641
- "font-weight:bold;color:#dc2626",
642
- "font-weight:normal;color:inherit"
643
- ), console.log(
644
- `A long task is any script that runs >50ms without yielding.
645
- During that time the browser cannot respond to user input (clicks, scroll).
646
- Fix: split heavy work with scheduler.yield() or setTimeout(..., 0).
647
-
648
- ⚠ The browser does not expose which function caused the long task.
649
- 'likely components' below are components whose :init overlapped the task window.
650
- For a precise stack trace, record a profile in DevTools → Performance tab.`
651
- ), i.forEach((u, y) => {
652
- const _ = u.start + u.duration, A = t.filter((U) => U.name.endsWith(":init") && U.start < _ && U.end > u.start).map((U) => U.name.replace(":init", "")), P = A.length > 0 ? [...new Set(A)].join(", ") : "none identified — task may be from framework or third-party code";
653
- console.table({ [`task ${y + 1}`]: {
654
- "start (ms)": u.start.toFixed(0),
655
- "duration (ms)": u.duration.toFixed(0),
656
- verdict: u.duration > 200 ? "✗ severe" : u.duration > 100 ? "⚠ high" : "~ noticeable",
657
- "likely component": P
658
- } });
659
- }), console.groupEnd();
660
- }
661
- if (n.size > 0) {
662
- const m = [...n.values()].reduce((y, _) => y + _, 0), u = m < 0.1 ? "✓ good" : m < 0.25 ? "⚠ needs improvement" : "✗ poor";
663
- console.groupCollapsed(
664
- `%c📐 Layout shifts from components — total CLS: ${m.toFixed(4)} ${u}%c`,
665
- "font-weight:bold",
666
- "font-weight:normal"
667
- ), console.log(
668
- `CLS (Cumulative Layout Shift) measures how much elements move unexpectedly.
669
- Google thresholds: < 0.1 good · 0.1–0.25 needs improvement · > 0.25 poor.
670
-
671
- Only light-DOM shifts are detected here. Shifts inside shadow DOM are not visible
672
- to the LayoutShift API. If a component shifts but is not listed, check its host
673
- element size change on mount (min-height, aspect-ratio, or skeleton placeholder).`
674
- ), console.table(Object.fromEntries(
675
- [...n.entries()].map(([y, _]) => [
676
- y,
677
- {
678
- "CLS contribution": _.toFixed(4),
679
- verdict: _ < 0.01 ? "✓ ok" : _ < 0.1 ? "⚠ noticeable" : "✗ poor"
680
- }
681
- ])
682
- )), console.groupEnd();
683
- }
684
- console.log(
685
- `%c⚡ Real page impact:%c ~${E.toFixed(2)}ms (${f} component${f > 1 ? "s" : ""} run in parallel, not serial)`,
686
- "font-weight:bold",
687
- "font-weight:normal"
688
- ), console.log(
689
- "%c💡 Tip:%c JS measures include Lit's async scheduler (~1–2ms overhead). In production builds expect 3–5× lower values.",
690
- "font-weight:bold",
691
- "font-weight:normal"
692
- ), console.groupEnd();
693
- }, d = new PerformanceObserver((h) => {
694
- h.getEntries().filter((a) => a.name.endsWith(":init") || a.name.endsWith(":to-paint")).forEach((a) => {
695
- var f;
696
- const p = (f = a.detail) == null ? void 0 : f.parent;
697
- Dt(o, zt(a.name, p), a.duration), t.push({ name: a.name, start: a.startTime, end: a.startTime + a.duration });
698
- }), clearTimeout(s), s = setTimeout(l, 500);
699
- });
700
- setTimeout(l, 5e3), d.observe({ type: "measure", buffered: !0 });
701
- }
702
- _t && !window.__STORYBOOK_ADDONS_CHANNEL__ && jt();
703
- function qt(o) {
704
- class t extends o {
705
- connectedCallback() {
706
- ct() && (this._perfKey = `${this.tagName.toLowerCase()}#${++Lt}`, this._perfParent = this._getParentContext(), this._perfStartTime = performance.now(), performance.mark(`${this._perfKey}:start`)), super.connectedCallback();
707
- }
708
- disconnectedCallback() {
709
- super.disconnectedCallback(), this._clearPerfState();
710
- }
711
- firstUpdated(s) {
712
- super.firstUpdated(s);
713
- const i = this._perfKey, r = this._perfParent, n = this._perfStartTime;
714
- if (this._perfKey = void 0, this._perfParent = void 0, this._perfStartTime = void 0, !ct() || !i) {
715
- i && performance.clearMarks(`${i}:start`);
716
- return;
717
- }
718
- const c = this.tagName.toLowerCase();
719
- try {
720
- performance.mark(`${i}:end`), performance.measure(`${c}:init`, {
721
- start: `${i}:start`,
722
- end: `${i}:end`,
723
- detail: { parent: r ?? "unknown" }
724
- });
725
- } catch {
726
- } finally {
727
- performance.clearMarks(`${i}:start`), performance.clearMarks(`${i}:end`);
728
- }
729
- n !== void 0 && requestAnimationFrame(() => {
730
- performance.measure(`${c}:to-paint`, {
731
- start: n,
732
- // no `end` → defaults to performance.now() at call time
733
- detail: { parent: r ?? "unknown" }
734
- });
735
- });
736
- }
737
- /**
738
- * Walk up the DOM to find the most relevant ancestor context.
739
- *
740
- * Priority:
741
- * 1. `data-perf-context` attribute on any ancestor (explicit opt-in)
742
- * 2. First ancestor with a CSS class
743
- * 3. First ancestor with an id
744
- * 4. "body" fallback
745
- */
746
- _getParentContext() {
747
- var r;
748
- const s = (r = this.closest("[data-perf-context]")) == null ? void 0 : r.getAttribute("data-perf-context");
749
- if (s) return s;
750
- let i = this.parentElement;
751
- for (let n = 0; n < 5 && i && i.tagName !== "BODY"; n++, i = i.parentElement) {
752
- const c = typeof i.className == "string" ? i.className.trim() : "";
753
- if (c) return `.${c.split(/\s+/)[0]}`;
754
- if (i.id) return `#${i.id}`;
755
- }
756
- return "body";
757
- }
758
- _clearPerfState() {
759
- this._perfKey && (performance.clearMarks(`${this._perfKey}:start`), this._perfKey = void 0, this._perfParent = void 0, this._perfStartTime = void 0);
760
- }
761
- }
762
- return t;
763
- }
764
- export {
765
- $ as E,
766
- k as T,
767
- B as a,
768
- pt as f,
769
- Ft as i,
770
- qt as m,
771
- Vt as t,
772
- G as u,
773
- Kt as x
774
- };