@jasonshimmy/custom-elements-runtime 3.4.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +28 -7
  2. package/dist/css-utils-Bn-dO44e.js +203 -0
  3. package/dist/{css-utils-CC43BbEy.js.map → css-utils-Bn-dO44e.js.map} +1 -1
  4. package/dist/{css-utils-CC43BbEy.js → css-utils-CFeP8SK1.cjs} +5 -71
  5. package/dist/{css-utils-mgjmH8qX.cjs.map → css-utils-CFeP8SK1.cjs.map} +1 -1
  6. package/dist/custom-elements-runtime.cjs.js +3 -4
  7. package/dist/custom-elements-runtime.cjs.js.map +1 -1
  8. package/dist/custom-elements-runtime.colors.cjs.js +1 -2
  9. package/dist/custom-elements-runtime.colors.cjs.js.map +1 -1
  10. package/dist/custom-elements-runtime.colors.es.js +277 -277
  11. package/dist/custom-elements-runtime.colors.es.js.map +1 -1
  12. package/dist/custom-elements-runtime.directive-enhancements.cjs.js +1 -2
  13. package/dist/custom-elements-runtime.directive-enhancements.cjs.js.map +1 -1
  14. package/dist/custom-elements-runtime.directive-enhancements.es.js +106 -122
  15. package/dist/custom-elements-runtime.directive-enhancements.es.js.map +1 -1
  16. package/dist/custom-elements-runtime.directives.cjs.js +1 -2
  17. package/dist/custom-elements-runtime.directives.cjs.js.map +1 -1
  18. package/dist/custom-elements-runtime.directives.es.js +60 -65
  19. package/dist/custom-elements-runtime.directives.es.js.map +1 -1
  20. package/dist/custom-elements-runtime.dom-jit-css.cjs.js +1 -7
  21. package/dist/custom-elements-runtime.dom-jit-css.cjs.js.map +1 -1
  22. package/dist/custom-elements-runtime.dom-jit-css.es.js +103 -115
  23. package/dist/custom-elements-runtime.dom-jit-css.es.js.map +1 -1
  24. package/dist/custom-elements-runtime.es.js +206 -253
  25. package/dist/custom-elements-runtime.es.js.map +1 -1
  26. package/dist/custom-elements-runtime.event-bus.cjs.js +1 -2
  27. package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
  28. package/dist/custom-elements-runtime.event-bus.es.js +102 -108
  29. package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
  30. package/dist/custom-elements-runtime.jit-css.cjs.js +1 -2
  31. package/dist/custom-elements-runtime.jit-css.cjs.js.map +1 -1
  32. package/dist/custom-elements-runtime.jit-css.es.js +14 -32
  33. package/dist/custom-elements-runtime.jit-css.es.js.map +1 -1
  34. package/dist/custom-elements-runtime.router.cjs.js +20 -21
  35. package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
  36. package/dist/custom-elements-runtime.router.es.js +866 -926
  37. package/dist/custom-elements-runtime.router.es.js.map +1 -1
  38. package/dist/custom-elements-runtime.ssr-middleware.cjs.js +3 -4
  39. package/dist/custom-elements-runtime.ssr-middleware.cjs.js.map +1 -1
  40. package/dist/custom-elements-runtime.ssr-middleware.es.js +67 -73
  41. package/dist/custom-elements-runtime.ssr-middleware.es.js.map +1 -1
  42. package/dist/custom-elements-runtime.ssr.cjs.js +1 -1
  43. package/dist/custom-elements-runtime.ssr.es.js +3 -14
  44. package/dist/custom-elements-runtime.store.cjs.js +1 -2
  45. package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
  46. package/dist/custom-elements-runtime.store.es.js +32 -33
  47. package/dist/custom-elements-runtime.store.es.js.map +1 -1
  48. package/dist/custom-elements-runtime.transitions.cjs.js +1 -2
  49. package/dist/custom-elements-runtime.transitions.cjs.js.map +1 -1
  50. package/dist/custom-elements-runtime.transitions.es.js +200 -210
  51. package/dist/custom-elements-runtime.transitions.es.js.map +1 -1
  52. package/dist/custom-elements-runtime.vite-plugin.cjs.js +4 -2
  53. package/dist/custom-elements-runtime.vite-plugin.cjs.js.map +1 -1
  54. package/dist/custom-elements-runtime.vite-plugin.es.js +155 -78
  55. package/dist/custom-elements-runtime.vite-plugin.es.js.map +1 -1
  56. package/dist/helpers-7zLtbh_q.cjs +5 -0
  57. package/dist/helpers-7zLtbh_q.cjs.map +1 -0
  58. package/dist/helpers-kOWgceUQ.js +696 -0
  59. package/dist/helpers-kOWgceUQ.js.map +1 -0
  60. package/dist/hooks-BY_35J9Y.cjs +2 -0
  61. package/dist/hooks-BY_35J9Y.cjs.map +1 -0
  62. package/dist/hooks-Dj1xwqpK.js +407 -0
  63. package/dist/hooks-Dj1xwqpK.js.map +1 -0
  64. package/dist/logger-DIJ0UH3R.js +36 -0
  65. package/dist/{logger-L25axmB-.js.map → logger-DIJ0UH3R.js.map} +1 -1
  66. package/dist/logger-Dkht1dCX.cjs +2 -0
  67. package/dist/{logger-BYIN7ysT.cjs.map → logger-Dkht1dCX.cjs.map} +1 -1
  68. package/dist/namespace-helpers-CIUkG8Mn.js +56 -0
  69. package/dist/{namespace-helpers-BucDdgz_.js.map → namespace-helpers-CIUkG8Mn.js.map} +1 -1
  70. package/dist/namespace-helpers-yYIb7INq.cjs +2 -0
  71. package/dist/{namespace-helpers-Bf7rm9JV.cjs.map → namespace-helpers-yYIb7INq.cjs.map} +1 -1
  72. package/dist/runtime/tag-utils.d.ts +11 -0
  73. package/dist/ssr-Bg9jYXYv.js +171 -0
  74. package/dist/{ssr-H9GDwbTy.js.map → ssr-Bg9jYXYv.js.map} +1 -1
  75. package/dist/ssr-CucZ-Iwz.cjs +4 -0
  76. package/dist/{ssr-DRsGduIK.cjs.map → ssr-CucZ-Iwz.cjs.map} +1 -1
  77. package/dist/ssr.d.ts +2 -0
  78. package/dist/style-A8l3aQ52.cjs +55 -0
  79. package/dist/{style-Bjn8zDiZ.cjs.map → style-A8l3aQ52.cjs.map} +1 -1
  80. package/dist/style-DSSoCbC9.js +1877 -0
  81. package/dist/{style-DuDoj_xK.js.map → style-DSSoCbC9.js.map} +1 -1
  82. package/dist/tag-utils-Dg0vRKq9.js +10 -0
  83. package/dist/tag-utils-Dg0vRKq9.js.map +1 -0
  84. package/dist/tag-utils-ZOoyzCm9.cjs +2 -0
  85. package/dist/tag-utils-ZOoyzCm9.cjs.map +1 -0
  86. package/dist/template-compiler-BJRZoRzZ.js +3044 -0
  87. package/dist/{template-compiler-Cs5axmn4.js.map → template-compiler-BJRZoRzZ.js.map} +1 -1
  88. package/dist/template-compiler-C0SkzB_f.cjs +19 -0
  89. package/dist/{template-compiler-BB4JJdqk.cjs.map → template-compiler-C0SkzB_f.cjs.map} +1 -1
  90. package/dist/vite-plugin.d.ts +96 -2
  91. package/package.json +8 -8
  92. package/dist/css-utils-mgjmH8qX.cjs +0 -577
  93. package/dist/hooks-_3xP4G2N.js +0 -1189
  94. package/dist/hooks-_3xP4G2N.js.map +0 -1
  95. package/dist/hooks-fYQgZk2g.cjs +0 -7
  96. package/dist/hooks-fYQgZk2g.cjs.map +0 -1
  97. package/dist/logger-BYIN7ysT.cjs +0 -3
  98. package/dist/logger-L25axmB-.js +0 -41
  99. package/dist/namespace-helpers-Bf7rm9JV.cjs +0 -3
  100. package/dist/namespace-helpers-BucDdgz_.js +0 -61
  101. package/dist/ssr-DRsGduIK.cjs +0 -5
  102. package/dist/ssr-H9GDwbTy.js +0 -172
  103. package/dist/style-Bjn8zDiZ.cjs +0 -56
  104. package/dist/style-DuDoj_xK.js +0 -1972
  105. package/dist/template-compiler-BB4JJdqk.cjs +0 -23
  106. package/dist/template-compiler-Cs5axmn4.js +0 -3236
@@ -1,272 +1,225 @@
1
- import { i as G, n as J, r as b, t as m } from "./logger-L25axmB-.js";
2
- import { B as T, H as W, I as Y, J as Z, L as X, R as F, U as Q, V as f, Y as ee, Z as te, _ as k, a as ne, d as A, f as re, g as I, h as oe, i as D, l as se, m as ie, n as ae, o as U, p as ce, r as le, s as ue, u as de, v as he, w as me, y as fe, z as pe } from "./hooks-_3xP4G2N.js";
3
- import { n as g, r as p, t as l } from "./template-compiler-Cs5axmn4.js";
4
- import { o as ve } from "./css-utils-CC43BbEy.js";
5
- function Ce(e = document) {
6
- typeof CustomEvent > "u" || (e instanceof Document ? e.documentElement : e).dispatchEvent(new CustomEvent("cer:hydrate", {
7
- bubbles: !0,
8
- composed: !0
9
- }));
1
+ import { i as e, n as t, r as n, t as r } from "./logger-DIJ0UH3R.js";
2
+ import { D as i, E as a, _ as o, b as s, g as c, h as l, k as u, m as d, n as f, v as p, x as m, y as h } from "./helpers-kOWgceUQ.js";
3
+ import { n as g, r as _, t as v } from "./template-compiler-BJRZoRzZ.js";
4
+ import { o as y } from "./css-utils-Bn-dO44e.js";
5
+ import { _ as b, a as x, d as S, f as C, g as w, h as T, i as E, l as D, m as O, n as k, o as A, p as j, r as M, s as N, u as P, v as F, y as I } from "./hooks-Dj1xwqpK.js";
6
+ //#region src/lib/runtime/hydration.ts
7
+ function L(e = document) {
8
+ typeof CustomEvent > "u" || (e instanceof Document ? e.documentElement : e).dispatchEvent(new CustomEvent("cer:hydrate", {
9
+ bubbles: !0,
10
+ composed: !0
11
+ }));
10
12
  }
11
- var x = 100, O = 3e4;
12
- function z(e, t, r) {
13
- return r === "jitCacheHitRate" ? e < t * 0.5 ? "critical" : e < t ? "warning" : "healthy" : e > t * 2 ? "critical" : e > t ? "warning" : "healthy";
13
+ //#endregion
14
+ //#region src/lib/runtime/monitoring/health-monitor.ts
15
+ var R = 100, z = 3e4;
16
+ function B(e, t, n) {
17
+ return n === "jitCacheHitRate" ? e < t * .5 ? "critical" : e < t ? "warning" : "healthy" : e > t * 2 ? "critical" : e > t ? "warning" : "healthy";
14
18
  }
15
- function K(e) {
16
- const t = [];
17
- return e.memoryUsage?.status !== "healthy" && t.push("Consider reducing component complexity or implementing better memory cleanup"), e.averageRenderTime?.status !== "healthy" && t.push("Optimize component render functions - consider lazy loading or virtualization"), e.jitCacheHitRate?.status !== "healthy" && t.push("JIT CSS cache performance is poor - review CSS patterns for optimization"), e.componentErrorRate?.status !== "healthy" && t.push("High component error rate detected - review error handling and component logic"), e.activeReactiveStates?.status !== "healthy" && t.push("High number of reactive states - consider state consolidation or cleanup"), e.memoryLeakIndicator?.status !== "healthy" && t.push("Potential memory leak detected - review component cleanup and event listener management"), t;
19
+ function V(e) {
20
+ let t = [];
21
+ return e.memoryUsage?.status !== "healthy" && t.push("Consider reducing component complexity or implementing better memory cleanup"), e.averageRenderTime?.status !== "healthy" && t.push("Optimize component render functions - consider lazy loading or virtualization"), e.jitCacheHitRate?.status !== "healthy" && t.push("JIT CSS cache performance is poor - review CSS patterns for optimization"), e.componentErrorRate?.status !== "healthy" && t.push("High component error rate detected - review error handling and component logic"), e.activeReactiveStates?.status !== "healthy" && t.push("High number of reactive states - consider state consolidation or cleanup"), e.memoryLeakIndicator?.status !== "healthy" && t.push("Potential memory leak detected - review component cleanup and event listener management"), t;
18
22
  }
19
- function N() {
20
- const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
21
- let r = null;
22
- function n(o, s, i) {
23
- e.set(o, {
24
- name: o,
25
- value: s,
26
- threshold: i,
27
- status: "healthy",
28
- lastUpdated: Date.now(),
29
- history: []
30
- });
31
- }
32
- function c() {
33
- n("activeComponents", 0, 1e3), n("componentCreateRate", 0, 50), n("componentErrorRate", 0, 0.1), n("memoryUsage", 0, 50 * 1024 * 1024), n("memoryGrowthRate", 0, 1024 * 1024), n("averageRenderTime", 0, 16), n("slowRenderCount", 0, 10), n("jitCacheHitRate", 100, 80), n("activeReactiveStates", 0, 5e3), n("dependencyUpdates", 0, 100), n("memoryLeakIndicator", 0, 0.1);
34
- }
35
- function a(o, s) {
36
- const i = e.get(o);
37
- i && (i.value = s, i.lastUpdated = Date.now(), i.history.push(s), i.history.length > x && i.history.shift(), i.status = z(s, i.threshold, o));
38
- }
39
- function h() {
40
- const o = {};
41
- let s = "healthy";
42
- for (const [i, u] of e)
43
- o[i] = { ...u }, u.status === "critical" ? s = "critical" : u.status === "warning" && s === "healthy" && (s = "warning");
44
- return {
45
- overall: s,
46
- metrics: o,
47
- timestamp: Date.now(),
48
- recommendations: K(o)
49
- };
50
- }
51
- function C() {
52
- if ("memory" in performance && performance.memory) {
53
- const o = performance.memory;
54
- a("memoryUsage", o.usedJSHeapSize);
55
- const s = e.get("memoryUsage");
56
- if (s && s.history.length > 1) {
57
- const i = s.history[s.history.length - 2], u = s.history[s.history.length - 1];
58
- a("memoryGrowthRate", Math.max(0, u - i));
59
- }
60
- }
61
- }
62
- function w(o) {
63
- for (const s of t) try {
64
- s(o);
65
- } catch (i) {
66
- m("Error in health monitor listener:", i);
67
- }
68
- }
69
- function E() {
70
- C();
71
- const o = h();
72
- w(o), o.overall === "critical" ? m("🚨 Runtime Health: Critical issues detected", o.recommendations) : o.overall === "warning" && b("⚠️ Runtime Health: Performance warnings", o.recommendations);
73
- }
74
- function S() {
75
- typeof window > "u" || (r = setInterval(E, O));
76
- }
77
- function _() {
78
- r !== null && (clearInterval(r), r = null);
79
- }
80
- function R(o) {
81
- t.add(o);
82
- }
83
- function H(o) {
84
- t.delete(o);
85
- }
86
- function M(o) {
87
- const s = e.get(o);
88
- return s ? [...s.history] : [];
89
- }
90
- function L() {
91
- for (const o of e.values()) o.history = [];
92
- }
93
- return c(), S(), {
94
- updateMetric: a,
95
- getHealthReport: h,
96
- addListener: R,
97
- removeListener: H,
98
- stop: _,
99
- getMetricHistory: M,
100
- clearHistory: L
101
- };
23
+ function H() {
24
+ let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), i = null;
25
+ function a(t, n, r) {
26
+ e.set(t, {
27
+ name: t,
28
+ value: n,
29
+ threshold: r,
30
+ status: "healthy",
31
+ lastUpdated: Date.now(),
32
+ history: []
33
+ });
34
+ }
35
+ function o() {
36
+ a("activeComponents", 0, 1e3), a("componentCreateRate", 0, 50), a("componentErrorRate", 0, .1), a("memoryUsage", 0, 50 * 1024 * 1024), a("memoryGrowthRate", 0, 1024 * 1024), a("averageRenderTime", 0, 16), a("slowRenderCount", 0, 10), a("jitCacheHitRate", 100, 80), a("activeReactiveStates", 0, 5e3), a("dependencyUpdates", 0, 100), a("memoryLeakIndicator", 0, .1);
37
+ }
38
+ function s(t, n) {
39
+ let r = e.get(t);
40
+ r && (r.value = n, r.lastUpdated = Date.now(), r.history.push(n), r.history.length > R && r.history.shift(), r.status = B(n, r.threshold, t));
41
+ }
42
+ function c() {
43
+ let t = {}, n = "healthy";
44
+ for (let [r, i] of e) t[r] = { ...i }, i.status === "critical" ? n = "critical" : i.status === "warning" && n === "healthy" && (n = "warning");
45
+ return {
46
+ overall: n,
47
+ metrics: t,
48
+ timestamp: Date.now(),
49
+ recommendations: V(t)
50
+ };
51
+ }
52
+ function l() {
53
+ if ("memory" in performance && performance.memory) {
54
+ let t = performance.memory;
55
+ s("memoryUsage", t.usedJSHeapSize);
56
+ let n = e.get("memoryUsage");
57
+ if (n && n.history.length > 1) {
58
+ let e = n.history[n.history.length - 2], t = n.history[n.history.length - 1];
59
+ s("memoryGrowthRate", Math.max(0, t - e));
60
+ }
61
+ }
62
+ }
63
+ function u(e) {
64
+ for (let n of t) try {
65
+ n(e);
66
+ } catch (e) {
67
+ r("Error in health monitor listener:", e);
68
+ }
69
+ }
70
+ function d() {
71
+ l();
72
+ let e = c();
73
+ u(e), e.overall === "critical" ? r("🚨 Runtime Health: Critical issues detected", e.recommendations) : e.overall === "warning" && n("⚠️ Runtime Health: Performance warnings", e.recommendations);
74
+ }
75
+ function f() {
76
+ typeof window > "u" || (i = setInterval(d, z));
77
+ }
78
+ function p() {
79
+ i !== null && (clearInterval(i), i = null);
80
+ }
81
+ function m(e) {
82
+ t.add(e);
83
+ }
84
+ function h(e) {
85
+ t.delete(e);
86
+ }
87
+ function g(t) {
88
+ let n = e.get(t);
89
+ return n ? [...n.history] : [];
90
+ }
91
+ function _() {
92
+ for (let t of e.values()) t.history = [];
93
+ }
94
+ return o(), f(), {
95
+ updateMetric: s,
96
+ getHealthReport: c,
97
+ addListener: m,
98
+ removeListener: h,
99
+ stop: p,
100
+ getMetricHistory: g,
101
+ clearHistory: _
102
+ };
102
103
  }
103
- var d = null;
104
- function v() {
105
- return d || (d = N()), d;
104
+ var U = null;
105
+ function W() {
106
+ return U ||= H(), U;
106
107
  }
107
- function we(e, t) {
108
- v().updateMetric(e, t);
108
+ function G(e, t) {
109
+ W().updateMetric(e, t);
109
110
  }
110
- function Ee() {
111
- return v().getHealthReport();
111
+ function K() {
112
+ return W().getHealthReport();
112
113
  }
113
- function $() {
114
- typeof window > "u" || typeof customElements > "u" || customElements.get("cer-keep-alive") || customElements.define("cer-keep-alive", j());
114
+ //#endregion
115
+ //#region src/lib/keep-alive.ts
116
+ function q() {
117
+ typeof window > "u" || typeof customElements > "u" || customElements.get("cer-keep-alive") || customElements.define("cer-keep-alive", J());
115
118
  }
116
- function j() {
117
- return class extends HTMLElement {
118
- _cache = /* @__PURE__ */ new Map();
119
- _slot = null;
120
- _slotListener = null;
121
- connectedCallback() {
122
- this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.querySelector("slot") || (this.shadowRoot.innerHTML = "<slot></slot>"), this._slot = this.shadowRoot.querySelector("slot"), this._slot && (this._slotListener = () => this._handleSlotChange(), this._slot.addEventListener("slotchange", this._slotListener), this._handleSlotChange());
123
- }
124
- disconnectedCallback() {
125
- this._slot && this._slotListener && this._slot.removeEventListener("slotchange", this._slotListener), this._slotListener = null;
126
- }
127
- clearCache(t) {
128
- t ? this._cache.delete(t) : this._cache.clear();
129
- }
130
- _handleSlotChange() {
131
- if (!this._slot) return;
132
- const t = this._slot.assignedElements({ flatten: !0 });
133
- for (const r of t) {
134
- const n = this._buildCacheKey(r);
135
- if (!this._cache.has(n)) this._cache.set(n, r);
136
- else {
137
- const c = this._cache.get(n);
138
- if (c !== r) try {
139
- r.parentNode?.replaceChild(c, r);
140
- } catch {
141
- this._cache.set(n, r);
142
- }
143
- }
144
- }
145
- }
146
- _buildCacheKey(t) {
147
- const r = t.tagName.toLowerCase(), n = t.getAttribute("id");
148
- return n ? `${r}:${n}` : r;
149
- }
150
- };
119
+ function J() {
120
+ return class extends HTMLElement {
121
+ _cache = /* @__PURE__ */ new Map();
122
+ _slot = null;
123
+ _slotListener = null;
124
+ connectedCallback() {
125
+ this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.querySelector("slot") || (this.shadowRoot.innerHTML = "<slot></slot>"), this._slot = this.shadowRoot.querySelector("slot"), this._slot && (this._slotListener = () => this._handleSlotChange(), this._slot.addEventListener("slotchange", this._slotListener), this._handleSlotChange());
126
+ }
127
+ disconnectedCallback() {
128
+ this._slot && this._slotListener && this._slot.removeEventListener("slotchange", this._slotListener), this._slotListener = null;
129
+ }
130
+ clearCache(e) {
131
+ e ? this._cache.delete(e) : this._cache.clear();
132
+ }
133
+ _handleSlotChange() {
134
+ if (!this._slot) return;
135
+ let e = this._slot.assignedElements({ flatten: !0 });
136
+ for (let t of e) {
137
+ let e = this._buildCacheKey(t);
138
+ if (!this._cache.has(e)) this._cache.set(e, t);
139
+ else {
140
+ let n = this._cache.get(e);
141
+ if (n !== t) try {
142
+ t.parentNode?.replaceChild(n, t);
143
+ } catch {
144
+ this._cache.set(e, t);
145
+ }
146
+ }
147
+ }
148
+ }
149
+ _buildCacheKey(e) {
150
+ let t = e.tagName.toLowerCase(), n = e.getAttribute("id");
151
+ return n ? `${t}:${n}` : t;
152
+ }
153
+ };
151
154
  }
152
- function P() {
153
- typeof customElements < "u" && customElements.get("cer-suspense") || g("cer-suspense", () => {
154
- const { pending: e } = k({ pending: !1 });
155
- return e ? l`<slot name="fallback"><span>Loading…</span></slot>` : l`<slot></slot>`;
156
- });
155
+ //#endregion
156
+ //#region src/lib/runtime/builtin-components.ts
157
+ function Y() {
158
+ typeof customElements < "u" && customElements.get("cer-suspense") || g("cer-suspense", () => {
159
+ let { pending: e } = b({ pending: !1 });
160
+ return e ? v`<slot name="fallback"><span>Loading…</span></slot>` : v`<slot></slot>`;
161
+ });
157
162
  }
158
- function q() {
159
- typeof customElements < "u" && customElements.get("cer-error-boundary") || g("cer-error-boundary", () => {
160
- const e = f(!1), t = f("");
161
- return I((r) => {
162
- e.value = !0, t.value = r.message;
163
- }), A({
164
- _cerHandleChildError: (r) => {
165
- e.peek() || (e.value = !0, t.value = r instanceof Error ? r.message : String(r));
166
- },
167
- reset: () => {
168
- e.value = !1, t.value = "";
169
- }
170
- }), e.value ? l`<slot name="fallback"
163
+ function X() {
164
+ typeof customElements < "u" && customElements.get("cer-error-boundary") || g("cer-error-boundary", () => {
165
+ let e = h(!1), t = h("");
166
+ return w((n) => {
167
+ e.value = !0, t.value = n.message;
168
+ }), S({
169
+ _cerHandleChildError: (n) => {
170
+ e.peek() || (e.value = !0, t.value = n instanceof Error ? n.message : String(n));
171
+ },
172
+ reset: () => {
173
+ e.value = !1, t.value = "";
174
+ }
175
+ }), e.value ? v`<slot name="fallback"
171
176
  ><div role="alert">
172
177
  <strong>Something went wrong.</strong>
173
- ${t.value ? l`<p>${t.value}</p>` : l``}
178
+ ${t.value ? v`<p>${t.value}</p>` : v``}
174
179
  </div></slot
175
- >` : l`<slot></slot>`;
176
- });
180
+ >` : v`<slot></slot>`;
181
+ });
177
182
  }
178
- function _e() {
179
- P(), q(), $();
183
+ function Z() {
184
+ Y(), X(), q();
180
185
  }
181
- function Re(e) {
182
- if (typeof document > "u") return {
183
- portal: () => {
184
- },
185
- destroy: () => {
186
- }
187
- };
188
- if (U()) return {
189
- portal: () => {
190
- },
191
- destroy: () => {
192
- }
193
- };
194
- if (D()) {
195
- const t = T.getOrCreateState(null), r = t.peek();
196
- if (r !== null) return r;
197
- const n = y(e, () => t.initSilent(null));
198
- return t.initSilent(n), n;
199
- }
200
- return y(e);
186
+ //#endregion
187
+ //#region src/lib/teleport.ts
188
+ function Q(e) {
189
+ if (typeof document > "u" || A()) return {
190
+ portal: () => {},
191
+ destroy: () => {}
192
+ };
193
+ if (E()) {
194
+ let t = p.getOrCreateState(null), n = t.peek();
195
+ if (n !== null) return n;
196
+ let r = $(e, () => t.initSilent(null));
197
+ return t.initSilent(r), r;
198
+ }
199
+ return $(e);
201
200
  }
202
- function y(e, t) {
203
- const r = typeof e == "string" ? document.querySelector(e) : e;
204
- if (!r)
205
- return console.warn(`[useTeleport] Target "${String(e)}" not found in the document. Teleported content will not be rendered.`), {
206
- portal: () => {
207
- },
208
- destroy: () => {
209
- }
210
- };
211
- const n = document.createElement("cer-teleport");
212
- n.dataset.cerTeleport = "", r.appendChild(n);
213
- const c = {};
214
- return {
215
- portal(a) {
216
- p(n, a == null ? [] : Array.isArray(a) ? a : [a], void 0, c);
217
- },
218
- destroy() {
219
- try {
220
- p(n, [], void 0, c);
221
- } catch {
222
- }
223
- n.parentNode && n.parentNode.removeChild(n), t?.();
224
- }
225
- };
201
+ function $(e, t) {
202
+ let n = typeof e == "string" ? document.querySelector(e) : e;
203
+ if (!n) return console.warn(`[useTeleport] Target "${String(e)}" not found in the document. Teleported content will not be rendered.`), {
204
+ portal: () => {},
205
+ destroy: () => {}
206
+ };
207
+ let r = document.createElement("cer-teleport");
208
+ r.dataset.cerTeleport = "", n.appendChild(r);
209
+ let i = {};
210
+ return {
211
+ portal(e) {
212
+ _(r, e == null ? [] : Array.isArray(e) ? e : [e], void 0, i);
213
+ },
214
+ destroy() {
215
+ try {
216
+ _(r, [], void 0, i);
217
+ } catch {}
218
+ r.parentNode && r.parentNode.removeChild(r), t?.();
219
+ }
220
+ };
226
221
  }
227
- export {
228
- X as ReactiveState,
229
- g as component,
230
- F as computed,
231
- ae as createComposable,
232
- N as createHealthMonitor,
233
- ve as css,
234
- me as decodeEntities,
235
- le as defineModel,
236
- J as devLog,
237
- Z as flushDOMUpdates,
238
- D as getCurrentComponentContext,
239
- v as getHealthMonitor,
240
- Ee as getHealthStatus,
241
- l as html,
242
- Ce as hydrateApp,
243
- ne as inject,
244
- pe as isReactiveState,
245
- ee as nextTick,
246
- ue as provide,
247
- f as ref,
248
- _e as registerBuiltinComponents,
249
- q as registerErrorBoundary,
250
- $ as registerKeepAlive,
251
- P as registerSuspense,
252
- te as scheduleWithPriority,
253
- G as setDevMode,
254
- Y as unsafeHTML,
255
- we as updateHealthMetric,
256
- se as useDesignTokens,
257
- de as useEmit,
258
- A as useExpose,
259
- re as useGlobalStyle,
260
- ce as useOnAttributeChanged,
261
- ie as useOnConnected,
262
- oe as useOnDisconnected,
263
- I as useOnError,
264
- k as useProps,
265
- he as useSlots,
266
- fe as useStyle,
267
- Re as useTeleport,
268
- W as watch,
269
- Q as watchEffect
270
- };
222
+ //#endregion
223
+ export { l as ReactiveState, g as component, c as computed, k as createComposable, H as createHealthMonitor, y as css, f as decodeEntities, M as defineModel, t as devLog, a as flushDOMUpdates, E as getCurrentComponentContext, W as getHealthMonitor, K as getHealthStatus, v as html, L as hydrateApp, x as inject, o as isReactiveState, i as nextTick, N as provide, h as ref, Z as registerBuiltinComponents, X as registerErrorBoundary, q as registerKeepAlive, Y as registerSuspense, u as scheduleWithPriority, e as setDevMode, d as unsafeHTML, G as updateHealthMetric, D as useDesignTokens, P as useEmit, S as useExpose, C as useGlobalStyle, j as useOnAttributeChanged, O as useOnConnected, T as useOnDisconnected, w as useOnError, b as useProps, F as useSlots, I as useStyle, Q as useTeleport, s as watch, m as watchEffect };
271
224
 
272
225
  //# sourceMappingURL=custom-elements-runtime.es.js.map