@jasonshimmy/custom-elements-runtime 0.3.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -58
- package/dist/custom-elements-runtime.cjs.js +36 -30
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +2337 -1484
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +36 -30
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/runtime/component.d.ts +39 -2
- package/dist/runtime/event-manager.d.ts +58 -0
- package/dist/runtime/helpers.d.ts +19 -0
- package/dist/runtime/hooks.d.ts +113 -0
- package/dist/runtime/props.d.ts +13 -1
- package/dist/runtime/reactive-proxy-cache.d.ts +51 -0
- package/dist/runtime/reactive.d.ts +118 -0
- package/dist/runtime/render.d.ts +2 -2
- package/dist/runtime/secure-expression-evaluator.d.ts +30 -0
- package/dist/runtime/template-compiler.d.ts +4 -0
- package/dist/runtime/types.d.ts +2 -10
- package/dist/runtime/vdom.d.ts +10 -2
- package/package.json +1 -1
|
@@ -1,510 +1,956 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
class ut {
|
|
2
|
+
pendingUpdates = /* @__PURE__ */ new Map();
|
|
3
|
+
isFlushScheduled = !1;
|
|
4
|
+
/**
|
|
5
|
+
* Schedule an update to be executed in the next microtask
|
|
6
|
+
* Uses component identity to deduplicate multiple render requests for the same component
|
|
7
|
+
*/
|
|
8
|
+
schedule(t, r) {
|
|
9
|
+
const n = r || t.toString();
|
|
10
|
+
this.pendingUpdates.set(n, t), this.isFlushScheduled || (this.isFlushScheduled = !0, typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && (window.__vitest__ || window.Cypress) ? this.flush() : queueMicrotask(() => this.flush()));
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Execute all pending updates
|
|
14
|
+
*/
|
|
15
|
+
flush() {
|
|
16
|
+
const t = Array.from(this.pendingUpdates.values());
|
|
17
|
+
this.pendingUpdates.clear(), this.isFlushScheduled = !1;
|
|
18
|
+
for (const r of t)
|
|
19
|
+
try {
|
|
20
|
+
r();
|
|
21
|
+
} catch (n) {
|
|
22
|
+
typeof console < "u" && console.error && console.error("Error in batched update:", n);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the number of pending updates
|
|
27
|
+
*/
|
|
28
|
+
get pendingCount() {
|
|
29
|
+
return this.pendingUpdates.size;
|
|
30
|
+
}
|
|
3
31
|
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return O(t(r, i), `each-${n}`);
|
|
8
|
-
});
|
|
32
|
+
const ft = new ut();
|
|
33
|
+
function le(e, t) {
|
|
34
|
+
ft.schedule(e, t);
|
|
9
35
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
36
|
+
const Ue = /* @__PURE__ */ new WeakSet();
|
|
37
|
+
class dt {
|
|
38
|
+
static cache = /* @__PURE__ */ new WeakMap();
|
|
39
|
+
static arrayHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
40
|
+
static objectHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
41
|
+
/**
|
|
42
|
+
* Get or create a reactive proxy for an object
|
|
43
|
+
*/
|
|
44
|
+
static getOrCreateProxy(t, r, n = !1) {
|
|
45
|
+
const i = this.cache.get(t);
|
|
46
|
+
if (i)
|
|
47
|
+
return i;
|
|
48
|
+
const s = n ? this.getOrCreateArrayHandler(r) : this.getOrCreateObjectHandler(r), o = new Proxy(t, s);
|
|
49
|
+
try {
|
|
50
|
+
tt.markAsProxy(o);
|
|
51
|
+
} catch {
|
|
21
52
|
}
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
function Je(...e) {
|
|
25
|
-
for (let t = 0; t < e.length; t++) {
|
|
26
|
-
const [r, i] = e[t];
|
|
27
|
-
if (r) return [O(i, `whenChain-branch-${t}`)];
|
|
53
|
+
return this.cache.set(t, o), o;
|
|
28
54
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return O(r(n, s, o), `each-where-${a}`);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function It(e, t) {
|
|
60
|
-
const r = e?.length ?? 0;
|
|
61
|
-
return r === 0 && t.empty ? O(t.empty, "switch-length-empty") : r === 1 && t.one ? O(t.one(e[0]), "switch-length-one") : t.exactly?.[r] ? O(t.exactly[r](e), `switch-length-${r}`) : r > 1 && t.many ? O(t.many(e), "switch-length-many") : O([], "switch-length-fallback");
|
|
62
|
-
}
|
|
63
|
-
function qt(e, t, r) {
|
|
64
|
-
const i = /* @__PURE__ */ new Map();
|
|
65
|
-
return e.forEach((n) => {
|
|
66
|
-
const s = t(n);
|
|
67
|
-
i.has(s) || i.set(s, []), i.get(s).push(n);
|
|
68
|
-
}), Array.from(i.entries()).map(([n, s], o) => O(
|
|
69
|
-
r(n, s, o),
|
|
70
|
-
`each-group-${n}`
|
|
71
|
-
));
|
|
72
|
-
}
|
|
73
|
-
function zt(e, t, r, i) {
|
|
74
|
-
const n = r * t, s = Math.min(n + t, e.length);
|
|
75
|
-
return e.slice(n, s).map((a, c) => {
|
|
76
|
-
const u = n + c, m = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${u}` : `page-${u}`;
|
|
77
|
-
return O(i(a, u, c), `each-page-${m}`);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function Ht(e, t) {
|
|
81
|
-
return e.loading && t.loading ? O(t.loading, "promise-loading") : e.error && t.error ? O(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? O(t.success(e.data), "promise-success") : t.idle ? O(t.idle, "promise-idle") : O([], "promise-fallback");
|
|
82
|
-
}
|
|
83
|
-
function q(e, t) {
|
|
84
|
-
const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
|
|
85
|
-
return we(!!r, t);
|
|
86
|
-
}
|
|
87
|
-
const G = {
|
|
88
|
-
// Responsive breakpoints (matching style.ts)
|
|
89
|
-
sm: "(min-width:640px)",
|
|
90
|
-
md: "(min-width:768px)",
|
|
91
|
-
lg: "(min-width:1024px)",
|
|
92
|
-
xl: "(min-width:1280px)",
|
|
93
|
-
"2xl": "(min-width:1536px)",
|
|
94
|
-
// Dark mode (matching style.ts)
|
|
95
|
-
dark: "(prefers-color-scheme: dark)"
|
|
96
|
-
}, ze = ["sm", "md", "lg", "xl", "2xl"], Ve = {
|
|
97
|
-
// Breakpoint-based rendering (matching style.ts exactly)
|
|
98
|
-
sm: (e) => q(G.sm, e),
|
|
99
|
-
md: (e) => q(G.md, e),
|
|
100
|
-
lg: (e) => q(G.lg, e),
|
|
101
|
-
xl: (e) => q(G.xl, e),
|
|
102
|
-
"2xl": (e) => q(G["2xl"], e),
|
|
103
|
-
// Dark mode (matching style.ts)
|
|
104
|
-
dark: (e) => q(G.dark, e),
|
|
105
|
-
light: (e) => q("(prefers-color-scheme: light)", e),
|
|
106
|
-
// Accessibility and interaction preferences
|
|
107
|
-
touch: (e) => q("(hover: none) and (pointer: coarse)", e),
|
|
108
|
-
mouse: (e) => q("(hover: hover) and (pointer: fine)", e),
|
|
109
|
-
reducedMotion: (e) => q("(prefers-reduced-motion: reduce)", e),
|
|
110
|
-
highContrast: (e) => q("(prefers-contrast: high)", e),
|
|
111
|
-
// Orientation
|
|
112
|
-
portrait: (e) => q("(orientation: portrait)", e),
|
|
113
|
-
landscape: (e) => q("(orientation: landscape)", e)
|
|
114
|
-
};
|
|
115
|
-
function Nt(e, t) {
|
|
116
|
-
const r = [];
|
|
117
|
-
e.includes("dark") ? r.push(G.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
|
|
118
|
-
const i = e.filter(
|
|
119
|
-
(o) => ze.includes(o)
|
|
120
|
-
), n = i[i.length - 1];
|
|
121
|
-
n && n in G && r.push(G[n]);
|
|
122
|
-
const s = r.length > 0 ? r.join(" and ") : "all";
|
|
123
|
-
return q(s, t);
|
|
124
|
-
}
|
|
125
|
-
function Dt(e) {
|
|
126
|
-
const t = [];
|
|
127
|
-
return e.base && t.push(O(e.base, "responsive-base")), ze.forEach((r) => {
|
|
128
|
-
const i = e[r];
|
|
129
|
-
i && t.push(Ve[r](i));
|
|
130
|
-
}), t;
|
|
131
|
-
}
|
|
132
|
-
function Ut(e) {
|
|
133
|
-
const t = [];
|
|
134
|
-
let r = null;
|
|
135
|
-
return {
|
|
136
|
-
case(i, n) {
|
|
137
|
-
const s = typeof i == "function" ? i : (o) => o === i;
|
|
138
|
-
return t.push({ condition: s, content: n }), this;
|
|
139
|
-
},
|
|
140
|
-
when(i, n) {
|
|
141
|
-
return t.push({ condition: i, content: n }), this;
|
|
142
|
-
},
|
|
143
|
-
otherwise(i) {
|
|
144
|
-
return r = i, this;
|
|
145
|
-
},
|
|
146
|
-
done() {
|
|
147
|
-
for (let i = 0; i < t.length; i++) {
|
|
148
|
-
const { condition: n, content: s } = t[i];
|
|
149
|
-
if (n(e))
|
|
150
|
-
return O(s, `switch-case-${i}`);
|
|
151
|
-
}
|
|
152
|
-
return O(r || [], "switch-otherwise");
|
|
55
|
+
/**
|
|
56
|
+
* Get or create a cached array handler
|
|
57
|
+
*/
|
|
58
|
+
static getOrCreateArrayHandler(t) {
|
|
59
|
+
if (!this.arrayHandlerCache.has(t)) {
|
|
60
|
+
const r = {
|
|
61
|
+
get: (n, i, s) => {
|
|
62
|
+
const o = Reflect.get(n, i, s);
|
|
63
|
+
return typeof o == "function" && typeof i == "string" && [
|
|
64
|
+
"push",
|
|
65
|
+
"pop",
|
|
66
|
+
"shift",
|
|
67
|
+
"unshift",
|
|
68
|
+
"splice",
|
|
69
|
+
"sort",
|
|
70
|
+
"reverse",
|
|
71
|
+
"fill",
|
|
72
|
+
"copyWithin"
|
|
73
|
+
].includes(i) ? function(...u) {
|
|
74
|
+
const m = o.apply(n, u);
|
|
75
|
+
return t.triggerUpdate(), m;
|
|
76
|
+
} : o;
|
|
77
|
+
},
|
|
78
|
+
set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
79
|
+
deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
|
|
80
|
+
};
|
|
81
|
+
this.arrayHandlerCache.set(t, r);
|
|
153
82
|
}
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
83
|
+
return this.arrayHandlerCache.get(t);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get or create a cached object handler
|
|
87
|
+
*/
|
|
88
|
+
static getOrCreateObjectHandler(t) {
|
|
89
|
+
if (!this.objectHandlerCache.has(t)) {
|
|
90
|
+
const r = {
|
|
91
|
+
get: (n, i, s) => Reflect.get(n, i, s),
|
|
92
|
+
set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
93
|
+
deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
|
|
94
|
+
};
|
|
95
|
+
this.objectHandlerCache.set(t, r);
|
|
96
|
+
}
|
|
97
|
+
return this.objectHandlerCache.get(t);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Check if an object already has a cached proxy
|
|
101
|
+
*/
|
|
102
|
+
static hasProxy(t) {
|
|
103
|
+
return this.cache.has(t);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Clear all cached proxies (useful for testing)
|
|
107
|
+
*/
|
|
108
|
+
static clear() {
|
|
109
|
+
this.cache = /* @__PURE__ */ new WeakMap(), this.arrayHandlerCache = /* @__PURE__ */ new WeakMap(), this.objectHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Get cache statistics (for debugging)
|
|
113
|
+
* Note: WeakMap doesn't provide size, so this is limited
|
|
114
|
+
*/
|
|
115
|
+
static getStats() {
|
|
116
|
+
return {
|
|
117
|
+
hasCachedProxies: this.cache instanceof WeakMap
|
|
118
|
+
};
|
|
119
|
+
}
|
|
162
120
|
}
|
|
163
|
-
class
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
121
|
+
class tt {
|
|
122
|
+
// Cache a stable reactiveContext object keyed by onUpdate -> makeReactive
|
|
123
|
+
// This allows handler caches in ReactiveProxyCache to reuse handlers
|
|
124
|
+
// for identical reactive contexts instead of creating a new context object
|
|
125
|
+
// on each createReactiveProxy call.
|
|
126
|
+
static contextCache = /* @__PURE__ */ new WeakMap();
|
|
167
127
|
/**
|
|
168
|
-
*
|
|
128
|
+
* Create an optimized reactive proxy with minimal overhead
|
|
169
129
|
*/
|
|
170
|
-
static
|
|
171
|
-
|
|
130
|
+
static createReactiveProxy(t, r, n) {
|
|
131
|
+
try {
|
|
132
|
+
if (Ue.has(t)) return t;
|
|
133
|
+
} catch {
|
|
134
|
+
}
|
|
135
|
+
const i = Array.isArray(t);
|
|
136
|
+
let s = this.contextCache.get(r);
|
|
137
|
+
s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(r, s));
|
|
138
|
+
let o = s.get(n);
|
|
139
|
+
return o || (o = {
|
|
140
|
+
triggerUpdate: r,
|
|
141
|
+
makeReactiveValue: n
|
|
142
|
+
}, s.set(n, o)), dt.getOrCreateProxy(t, o, i);
|
|
172
143
|
}
|
|
173
144
|
/**
|
|
174
|
-
*
|
|
175
|
-
* @param eventName - Name of the event
|
|
176
|
-
* @param data - Optional event payload
|
|
145
|
+
* Mark an object as a proxy (for optimization)
|
|
177
146
|
*/
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (!n || i - n.window > 1e3)
|
|
181
|
-
this.eventCounters.set(t, { count: 1, window: i });
|
|
182
|
-
else if (n.count++, n.count > 50 && n.count > 100)
|
|
183
|
-
return;
|
|
184
|
-
this.dispatchEvent(new CustomEvent(t, {
|
|
185
|
-
detail: r,
|
|
186
|
-
bubbles: !1,
|
|
187
|
-
// Global events don't need to bubble
|
|
188
|
-
cancelable: !0
|
|
189
|
-
}));
|
|
190
|
-
const s = this.handlers[t];
|
|
191
|
-
s && s.forEach((o) => {
|
|
147
|
+
static markAsProxy(t) {
|
|
148
|
+
if (t)
|
|
192
149
|
try {
|
|
193
|
-
|
|
194
|
-
} catch
|
|
195
|
-
Y(`Error in global event handler for "${t}":`, a);
|
|
150
|
+
Ue.add(t);
|
|
151
|
+
} catch {
|
|
196
152
|
}
|
|
197
|
-
});
|
|
198
153
|
}
|
|
154
|
+
}
|
|
155
|
+
class pt {
|
|
156
|
+
currentComponent = null;
|
|
157
|
+
componentDependencies = /* @__PURE__ */ new Map();
|
|
158
|
+
componentRenderFunctions = /* @__PURE__ */ new Map();
|
|
159
|
+
// Flat storage: compound key `${componentId}:${stateIndex}` -> ReactiveState
|
|
160
|
+
stateStorage = /* @__PURE__ */ new Map();
|
|
161
|
+
stateIndexCounter = /* @__PURE__ */ new Map();
|
|
162
|
+
trackingDisabled = !1;
|
|
163
|
+
// Per-component last warning timestamp to throttle repeated warnings
|
|
164
|
+
lastWarningTime = /* @__PURE__ */ new Map();
|
|
199
165
|
/**
|
|
200
|
-
*
|
|
201
|
-
* @param eventName - Name of the event
|
|
202
|
-
* @param handler - Handler function
|
|
166
|
+
* Set the current component being rendered for dependency tracking
|
|
203
167
|
*/
|
|
204
|
-
|
|
205
|
-
|
|
168
|
+
setCurrentComponent(t, r) {
|
|
169
|
+
this.currentComponent = t, this.componentRenderFunctions.set(t, r), this.componentDependencies.has(t) || this.componentDependencies.set(t, /* @__PURE__ */ new Set()), this.stateIndexCounter.set(t, 0);
|
|
206
170
|
}
|
|
207
171
|
/**
|
|
208
|
-
*
|
|
209
|
-
* @param eventName - Name of the event
|
|
210
|
-
* @param handler - Handler function to remove
|
|
172
|
+
* Clear the current component after rendering
|
|
211
173
|
*/
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
i && i.delete(r);
|
|
174
|
+
clearCurrentComponent() {
|
|
175
|
+
this.currentComponent = null;
|
|
215
176
|
}
|
|
216
177
|
/**
|
|
217
|
-
*
|
|
218
|
-
* @param eventName - Name of the event
|
|
178
|
+
* Temporarily disable dependency tracking
|
|
219
179
|
*/
|
|
220
|
-
|
|
221
|
-
|
|
180
|
+
disableTracking() {
|
|
181
|
+
this.trackingDisabled = !0;
|
|
222
182
|
}
|
|
223
183
|
/**
|
|
224
|
-
*
|
|
225
|
-
* @param eventName - Name of the event
|
|
226
|
-
* @param handler - CustomEvent handler
|
|
227
|
-
* @param options - AddEventListener options
|
|
184
|
+
* Re-enable dependency tracking
|
|
228
185
|
*/
|
|
229
|
-
|
|
230
|
-
|
|
186
|
+
enableTracking() {
|
|
187
|
+
this.trackingDisabled = !1;
|
|
231
188
|
}
|
|
232
189
|
/**
|
|
233
|
-
*
|
|
234
|
-
* @param eventName - Name of the event
|
|
235
|
-
* @param handler - Handler function
|
|
190
|
+
* Check if a component is currently rendering
|
|
236
191
|
*/
|
|
237
|
-
|
|
238
|
-
return
|
|
239
|
-
const n = this.on(t, (s) => {
|
|
240
|
-
n(), r(s), i(s);
|
|
241
|
-
});
|
|
242
|
-
});
|
|
192
|
+
isRenderingComponent() {
|
|
193
|
+
return this.currentComponent !== null;
|
|
243
194
|
}
|
|
244
195
|
/**
|
|
245
|
-
*
|
|
196
|
+
* Return whether we should emit a render-time warning for the current component.
|
|
197
|
+
* This throttles warnings to avoid spamming the console for legitimate rapid updates.
|
|
246
198
|
*/
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
);
|
|
199
|
+
shouldEmitRenderWarning() {
|
|
200
|
+
if (!this.currentComponent) return !0;
|
|
201
|
+
const t = this.currentComponent, r = this.lastWarningTime.get(t) || 0, n = Date.now();
|
|
202
|
+
return n - r < 1e3 ? !1 : (this.lastWarningTime.set(t, n), !0);
|
|
251
203
|
}
|
|
252
204
|
/**
|
|
253
|
-
*
|
|
205
|
+
* Execute a function with tracking disabled
|
|
254
206
|
*/
|
|
255
|
-
|
|
256
|
-
|
|
207
|
+
withoutTracking(t) {
|
|
208
|
+
const r = this.trackingDisabled;
|
|
209
|
+
this.trackingDisabled = !0;
|
|
210
|
+
try {
|
|
211
|
+
return t();
|
|
212
|
+
} finally {
|
|
213
|
+
this.trackingDisabled = r;
|
|
214
|
+
}
|
|
257
215
|
}
|
|
258
216
|
/**
|
|
259
|
-
* Get
|
|
260
|
-
* @param eventName - Name of the event
|
|
217
|
+
* Get or create a state instance for the current component
|
|
261
218
|
*/
|
|
262
|
-
|
|
263
|
-
|
|
219
|
+
getOrCreateState(t) {
|
|
220
|
+
if (!this.currentComponent)
|
|
221
|
+
return new De(t);
|
|
222
|
+
const r = this.currentComponent, n = this.stateIndexCounter.get(r) || 0, i = `${r}:${n}`;
|
|
223
|
+
if (this.stateIndexCounter.set(r, n + 1), this.stateStorage.has(i))
|
|
224
|
+
return this.stateStorage.get(i);
|
|
225
|
+
const s = new De(t);
|
|
226
|
+
return this.stateStorage.set(i, s), s;
|
|
264
227
|
}
|
|
265
228
|
/**
|
|
266
|
-
*
|
|
229
|
+
* Track a dependency for the current component
|
|
267
230
|
*/
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
for (const [r, i] of this.eventCounters.entries())
|
|
271
|
-
t[r] = {
|
|
272
|
-
count: i.count,
|
|
273
|
-
handlersCount: this.getHandlerCount(r)
|
|
274
|
-
};
|
|
275
|
-
return t;
|
|
231
|
+
trackDependency(t) {
|
|
232
|
+
this.trackingDisabled || this.currentComponent && (this.componentDependencies.get(this.currentComponent)?.add(t), t.addDependent(this.currentComponent));
|
|
276
233
|
}
|
|
277
234
|
/**
|
|
278
|
-
*
|
|
235
|
+
* Trigger updates for all components that depend on a state
|
|
279
236
|
*/
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
function Le(e) {
|
|
286
|
-
let t = { ...e };
|
|
287
|
-
const r = [];
|
|
288
|
-
function i(a) {
|
|
289
|
-
r.push(a), a(t);
|
|
237
|
+
triggerUpdate(t) {
|
|
238
|
+
t.getDependents().forEach((r) => {
|
|
239
|
+
const n = this.componentRenderFunctions.get(r);
|
|
240
|
+
n && le(n, r);
|
|
241
|
+
});
|
|
290
242
|
}
|
|
291
|
-
|
|
292
|
-
|
|
243
|
+
/**
|
|
244
|
+
* Clean up component dependencies when component is destroyed
|
|
245
|
+
*/
|
|
246
|
+
cleanup(t) {
|
|
247
|
+
const r = this.componentDependencies.get(t);
|
|
248
|
+
r && (r.forEach((n) => n.removeDependent(t)), this.componentDependencies.delete(t)), this.componentRenderFunctions.delete(t);
|
|
249
|
+
for (const n of Array.from(this.stateStorage.keys()))
|
|
250
|
+
n.startsWith(t + ":") && this.stateStorage.delete(n);
|
|
251
|
+
this.stateIndexCounter.delete(t);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
const F = new pt();
|
|
255
|
+
class De {
|
|
256
|
+
_value;
|
|
257
|
+
dependents = /* @__PURE__ */ new Set();
|
|
258
|
+
constructor(t) {
|
|
259
|
+
this._value = this.makeReactive(t);
|
|
260
|
+
}
|
|
261
|
+
get value() {
|
|
262
|
+
return F.trackDependency(this), this._value;
|
|
263
|
+
}
|
|
264
|
+
set value(t) {
|
|
265
|
+
F.isRenderingComponent() && F.shouldEmitRenderWarning() && console.warn(
|
|
266
|
+
`🚨 State modification detected during render! This can cause infinite loops.
|
|
267
|
+
• Move state updates to event handlers
|
|
268
|
+
• Use useEffect/watch for side effects
|
|
269
|
+
• Ensure computed properties don't modify state`
|
|
270
|
+
), this._value = this.makeReactive(t), F.triggerUpdate(this);
|
|
271
|
+
}
|
|
272
|
+
addDependent(t) {
|
|
273
|
+
this.dependents.add(t);
|
|
274
|
+
}
|
|
275
|
+
removeDependent(t) {
|
|
276
|
+
this.dependents.delete(t);
|
|
277
|
+
}
|
|
278
|
+
getDependents() {
|
|
279
|
+
return this.dependents;
|
|
280
|
+
}
|
|
281
|
+
makeReactive(t) {
|
|
282
|
+
return t === null || typeof t != "object" || t instanceof Node || t instanceof Element || t instanceof HTMLElement ? t : tt.createReactiveProxy(
|
|
283
|
+
t,
|
|
284
|
+
() => F.triggerUpdate(this),
|
|
285
|
+
(r) => this.makeReactive(r)
|
|
286
|
+
);
|
|
293
287
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
288
|
+
}
|
|
289
|
+
function or(e) {
|
|
290
|
+
return F.getOrCreateState(e === void 0 ? null : e);
|
|
291
|
+
}
|
|
292
|
+
function ar(e) {
|
|
293
|
+
const t = new De(e());
|
|
294
|
+
return {
|
|
295
|
+
get value() {
|
|
296
|
+
return F.trackDependency(t), e();
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
function cr(e, t, r = {}) {
|
|
301
|
+
let n = e();
|
|
302
|
+
r.immediate && t(n, n);
|
|
303
|
+
const i = `watch-${Math.random().toString(36).substr(2, 9)}`, s = () => {
|
|
304
|
+
F.setCurrentComponent(i, s);
|
|
305
|
+
const o = e();
|
|
306
|
+
F.clearCurrentComponent(), o !== n && (t(o, n), n = o);
|
|
307
|
+
};
|
|
308
|
+
return F.setCurrentComponent(i, s), e(), F.clearCurrentComponent(), () => {
|
|
309
|
+
F.cleanup(i);
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
const be = /* @__PURE__ */ new Map(), we = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), He = 500;
|
|
313
|
+
function te(e) {
|
|
314
|
+
if (be.has(e))
|
|
315
|
+
return be.get(e);
|
|
316
|
+
const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
317
|
+
return be.size < He && be.set(e, t), t;
|
|
318
|
+
}
|
|
319
|
+
function rt(e) {
|
|
320
|
+
if (we.has(e))
|
|
321
|
+
return we.get(e);
|
|
322
|
+
const t = e.replace(/-([a-z])/g, (r, n) => n.toUpperCase());
|
|
323
|
+
return we.size < He && we.set(e, t), t;
|
|
324
|
+
}
|
|
325
|
+
function ne(e) {
|
|
326
|
+
if (typeof e == "string") {
|
|
327
|
+
if (ve.has(e))
|
|
328
|
+
return ve.get(e);
|
|
329
|
+
const t = e.replace(
|
|
330
|
+
/[&<>"']/g,
|
|
331
|
+
(r) => ({
|
|
332
|
+
"&": "&",
|
|
333
|
+
"<": "<",
|
|
334
|
+
">": ">",
|
|
335
|
+
'"': """,
|
|
336
|
+
"'": "'"
|
|
337
|
+
})[r]
|
|
338
|
+
);
|
|
339
|
+
return t !== e && ve.size < He && ve.set(e, t), t;
|
|
297
340
|
}
|
|
298
|
-
|
|
299
|
-
|
|
341
|
+
return e;
|
|
342
|
+
}
|
|
343
|
+
function H(e, t) {
|
|
344
|
+
if (typeof t == "string") {
|
|
345
|
+
const r = t.split(".").reduce((n, i) => n?.[i], e);
|
|
346
|
+
return r && typeof r == "object" && r.constructor && r.constructor.name === "ReactiveState" ? r.value : r;
|
|
300
347
|
}
|
|
301
|
-
return
|
|
302
|
-
}
|
|
303
|
-
function
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
318
|
-
function K(e, t) {
|
|
319
|
-
return typeof t == "string" ? t.split(".").reduce((r, i) => r?.[i], e) : t;
|
|
320
|
-
}
|
|
321
|
-
function he(e, t, r) {
|
|
322
|
-
const i = String(t).split("."), n = i.pop();
|
|
323
|
-
if (!n) return;
|
|
324
|
-
const s = i.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
325
|
-
s[n] = r;
|
|
326
|
-
}
|
|
327
|
-
function Ge(e, t, r) {
|
|
348
|
+
return t;
|
|
349
|
+
}
|
|
350
|
+
function Ce(e, t, r) {
|
|
351
|
+
const n = String(t).split("."), i = n.pop();
|
|
352
|
+
if (!i) return;
|
|
353
|
+
const s = n.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
354
|
+
s[i] && typeof s[i] == "object" && s[i].constructor && s[i].constructor.name === "ReactiveState" ? s[i].value = r : s[i] = r;
|
|
355
|
+
}
|
|
356
|
+
const nt = typeof process < "u" && process.env?.NODE_ENV !== "production";
|
|
357
|
+
function ie(e, ...t) {
|
|
358
|
+
nt && console.error(e, ...t);
|
|
359
|
+
}
|
|
360
|
+
function Re(e, ...t) {
|
|
361
|
+
nt && console.warn(e, ...t);
|
|
362
|
+
}
|
|
363
|
+
function ht(e, t, r) {
|
|
328
364
|
if (r)
|
|
329
|
-
for (const [
|
|
365
|
+
for (const [n, i] of Object.entries(r)) {
|
|
330
366
|
let s, o = {};
|
|
331
|
-
if (Array.isArray(
|
|
367
|
+
if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(n, {
|
|
332
368
|
callback: s,
|
|
333
369
|
options: o,
|
|
334
|
-
oldValue:
|
|
370
|
+
oldValue: H(e, n)
|
|
335
371
|
}), o.immediate)
|
|
336
372
|
try {
|
|
337
|
-
const a =
|
|
373
|
+
const a = H(e, n);
|
|
338
374
|
s(a, void 0, e);
|
|
339
375
|
} catch (a) {
|
|
340
|
-
|
|
376
|
+
ie(`Error in immediate watcher for "${n}":`, a);
|
|
341
377
|
}
|
|
342
378
|
}
|
|
343
379
|
}
|
|
344
|
-
function
|
|
345
|
-
const
|
|
380
|
+
function gt(e, t, r, n) {
|
|
381
|
+
const i = (o, a) => {
|
|
346
382
|
if (o === a) return !0;
|
|
347
383
|
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
348
384
|
if (Array.isArray(o) && Array.isArray(a))
|
|
349
|
-
return o.length !== a.length ? !1 : o.every((
|
|
350
|
-
const
|
|
351
|
-
return
|
|
385
|
+
return o.length !== a.length ? !1 : o.every((g, w) => i(g, a[w]));
|
|
386
|
+
const u = Object.keys(o), m = Object.keys(a);
|
|
387
|
+
return u.length !== m.length ? !1 : u.every((g) => i(o[g], a[g]));
|
|
352
388
|
}, s = t.get(r);
|
|
353
|
-
if (s && !n
|
|
389
|
+
if (s && !i(n, s.oldValue))
|
|
354
390
|
try {
|
|
355
|
-
s.callback(
|
|
391
|
+
s.callback(n, s.oldValue, e), s.oldValue = n;
|
|
356
392
|
} catch (o) {
|
|
357
|
-
|
|
393
|
+
ie(`Error in watcher for "${r}":`, o);
|
|
358
394
|
}
|
|
359
395
|
for (const [o, a] of t.entries())
|
|
360
396
|
if (a.options.deep && r.startsWith(o + "."))
|
|
361
397
|
try {
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
} catch (
|
|
365
|
-
|
|
398
|
+
const u = H(e, o);
|
|
399
|
+
i(u, a.oldValue) || (a.callback(u, a.oldValue, e), a.oldValue = u);
|
|
400
|
+
} catch (u) {
|
|
401
|
+
ie(`Error in deep watcher for "${o}":`, u);
|
|
366
402
|
}
|
|
367
403
|
}
|
|
368
|
-
function
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
if (
|
|
404
|
+
function qe(e, t) {
|
|
405
|
+
return t === Boolean ? e === "true" : t === Number ? Number(e) : e;
|
|
406
|
+
}
|
|
407
|
+
function mt(e, t, r) {
|
|
408
|
+
t && Object.entries(t).forEach(([n, i]) => {
|
|
409
|
+
const s = te(n), o = e.getAttribute(s);
|
|
410
|
+
if (i.type === Function && typeof e[n] == "function")
|
|
375
411
|
r[n] = e[n];
|
|
376
|
-
else
|
|
377
|
-
|
|
378
|
-
|
|
412
|
+
else if (typeof e[n] < "u")
|
|
413
|
+
try {
|
|
414
|
+
const a = e[n];
|
|
415
|
+
i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? r[n] = a : r[n] = ne(qe(String(a), i.type));
|
|
416
|
+
} catch {
|
|
417
|
+
r[n] = e[n];
|
|
418
|
+
}
|
|
419
|
+
else o !== null ? r[n] = ne(qe(o, i.type)) : "default" in i && i.default !== void 0 && (r[n] = ne(i.default));
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
function yt(e, t, r) {
|
|
423
|
+
t.props && mt(e, t.props, r);
|
|
424
|
+
}
|
|
425
|
+
function bt(e, t, r, n) {
|
|
426
|
+
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
427
|
+
}
|
|
428
|
+
function wt(e, t, r, n, i, s, o, a) {
|
|
429
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()), n(), i(), s(!1), o(null), a(!1);
|
|
430
|
+
}
|
|
431
|
+
function vt(e, t, r, n, i) {
|
|
432
|
+
e.onAttributeChanged && e.onAttributeChanged(t, r, n, i);
|
|
433
|
+
}
|
|
434
|
+
class xt {
|
|
435
|
+
static cache = /* @__PURE__ */ new Map();
|
|
436
|
+
static maxCacheSize = 1e3;
|
|
437
|
+
// Dangerous patterns to block
|
|
438
|
+
static dangerousPatterns = [
|
|
439
|
+
/constructor/i,
|
|
440
|
+
/prototype/i,
|
|
441
|
+
/__proto__/i,
|
|
442
|
+
/function/i,
|
|
443
|
+
/eval/i,
|
|
444
|
+
/import/i,
|
|
445
|
+
/require/i,
|
|
446
|
+
/window/i,
|
|
447
|
+
/document/i,
|
|
448
|
+
/global/i,
|
|
449
|
+
/process/i,
|
|
450
|
+
/setTimeout/i,
|
|
451
|
+
/setInterval/i,
|
|
452
|
+
/fetch/i,
|
|
453
|
+
/XMLHttpRequest/i
|
|
454
|
+
];
|
|
455
|
+
static evaluate(t, r) {
|
|
456
|
+
const n = this.cache.get(t);
|
|
457
|
+
if (n) {
|
|
458
|
+
if (!n.isSecure) {
|
|
459
|
+
Re("Blocked cached dangerous expression:", t);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
return n.evaluator(r);
|
|
463
|
+
}
|
|
464
|
+
const i = this.createEvaluator(t);
|
|
465
|
+
if (this.cache.size >= this.maxCacheSize) {
|
|
466
|
+
const s = this.cache.keys().next().value;
|
|
467
|
+
s && this.cache.delete(s);
|
|
468
|
+
}
|
|
469
|
+
if (this.cache.set(t, i), !i.isSecure) {
|
|
470
|
+
Re("Blocked dangerous expression:", t);
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
return i.evaluator(r);
|
|
474
|
+
}
|
|
475
|
+
static createEvaluator(t) {
|
|
476
|
+
if (this.hasDangerousPatterns(t))
|
|
477
|
+
return { evaluator: () => {
|
|
478
|
+
}, isSecure: !1 };
|
|
479
|
+
if (t.length > 1e3)
|
|
480
|
+
return { evaluator: () => {
|
|
481
|
+
}, isSecure: !1 };
|
|
482
|
+
try {
|
|
483
|
+
return { evaluator: this.createSafeEvaluator(t), isSecure: !0 };
|
|
484
|
+
} catch (r) {
|
|
485
|
+
return Re("Failed to create evaluator for expression:", t, r), { evaluator: () => {
|
|
486
|
+
}, isSecure: !1 };
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
static hasDangerousPatterns(t) {
|
|
490
|
+
return this.dangerousPatterns.some((r) => r.test(t));
|
|
491
|
+
}
|
|
492
|
+
static createSafeEvaluator(t) {
|
|
493
|
+
if (t.trim().startsWith("{") && t.trim().endsWith("}"))
|
|
494
|
+
return this.createObjectEvaluator(t);
|
|
495
|
+
if (/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())) {
|
|
496
|
+
const r = t.trim().slice(4);
|
|
497
|
+
return (n) => H(n, r);
|
|
498
|
+
}
|
|
499
|
+
return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (r) => H(r, t);
|
|
500
|
+
}
|
|
501
|
+
static createObjectEvaluator(t) {
|
|
502
|
+
const r = t.trim().slice(1, -1), n = this.parseObjectProperties(r);
|
|
503
|
+
return (i) => {
|
|
504
|
+
const s = {};
|
|
505
|
+
for (const { key: o, value: a } of n)
|
|
379
506
|
try {
|
|
380
|
-
|
|
381
|
-
|
|
507
|
+
if (a.startsWith("ctx.")) {
|
|
508
|
+
const u = a.slice(4);
|
|
509
|
+
s[o] = H(i, u);
|
|
510
|
+
} else
|
|
511
|
+
s[o] = this.evaluateSimpleValue(a, i);
|
|
382
512
|
} catch {
|
|
383
|
-
|
|
513
|
+
s[o] = void 0;
|
|
384
514
|
}
|
|
385
|
-
|
|
515
|
+
return s;
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
static parseObjectProperties(t) {
|
|
519
|
+
const r = [], n = t.split(",");
|
|
520
|
+
for (const i of n) {
|
|
521
|
+
const s = i.indexOf(":");
|
|
522
|
+
if (s === -1) continue;
|
|
523
|
+
const o = i.slice(0, s).trim(), a = i.slice(s + 1).trim(), u = o.replace(/^['"]|['"]$/g, "");
|
|
524
|
+
r.push({ key: u, value: a });
|
|
386
525
|
}
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
526
|
+
return r;
|
|
527
|
+
}
|
|
528
|
+
static createSimpleEvaluator(t) {
|
|
529
|
+
return (r) => {
|
|
530
|
+
try {
|
|
531
|
+
let n = t;
|
|
532
|
+
const i = [];
|
|
533
|
+
n = n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (w) => `<<#${i.push(w) - 1}#>>`);
|
|
534
|
+
const s = n.match(/ctx\.[\w.]+/g) || [];
|
|
535
|
+
for (const w of s) {
|
|
536
|
+
const h = w.slice(4), l = H(r, h);
|
|
537
|
+
if (l === void 0) return;
|
|
538
|
+
const d = i.push(JSON.stringify(l)) - 1;
|
|
539
|
+
n = n.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`);
|
|
540
|
+
}
|
|
541
|
+
const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a = n.match(o) || [];
|
|
542
|
+
for (const w of a) {
|
|
543
|
+
if (w.startsWith("ctx.")) continue;
|
|
544
|
+
const h = H(r, w);
|
|
545
|
+
if (h === void 0) return;
|
|
546
|
+
const l = i.push(JSON.stringify(h)) - 1;
|
|
547
|
+
n = n.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${l}#>>`);
|
|
548
|
+
}
|
|
549
|
+
const u = /\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;
|
|
550
|
+
let m;
|
|
551
|
+
const g = /* @__PURE__ */ new Set();
|
|
552
|
+
for (; (m = u.exec(n)) !== null; ) {
|
|
553
|
+
const w = m[1];
|
|
554
|
+
if (["true", "false", "null", "undefined"].includes(w) || /^[0-9]+$/.test(w) || w === "ctx" || g.has(w)) continue;
|
|
555
|
+
g.add(w);
|
|
556
|
+
const h = H(r, w);
|
|
557
|
+
if (h === void 0) return;
|
|
558
|
+
const l = JSON.stringify(h), d = i.push(l) - 1;
|
|
559
|
+
w.includes(".") ? n = n.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`) : n = n.replace(new RegExp("\\b" + w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${d}#>>`);
|
|
560
|
+
}
|
|
561
|
+
n = n.replace(/<<#(\d+)#>>/g, (w, h) => i[Number(h)]);
|
|
562
|
+
try {
|
|
563
|
+
return this.evaluateBasicExpression(n);
|
|
564
|
+
} catch {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
} catch {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Evaluate a very small, safe expression grammar without using eval/Function.
|
|
574
|
+
* Supports: numbers, string literals, true/false, null, arrays, unary !,
|
|
575
|
+
* arithmetic (+ - * / %), comparisons, logical && and ||, parentheses, and ternary `a ? b : c`.
|
|
576
|
+
*/
|
|
577
|
+
static evaluateBasicExpression(t) {
|
|
578
|
+
const r = this.tokenize(t);
|
|
579
|
+
let n = 0;
|
|
580
|
+
function i() {
|
|
581
|
+
return r[n];
|
|
582
|
+
}
|
|
583
|
+
function s(c) {
|
|
584
|
+
const p = r[n++];
|
|
585
|
+
if (c && !p)
|
|
586
|
+
throw new Error(`Unexpected token EOF, expected ${c}`);
|
|
587
|
+
if (c && p && p.type !== c && p.value !== c)
|
|
588
|
+
throw new Error(`Unexpected token ${p.type}/${p.value}, expected ${c}`);
|
|
589
|
+
return p;
|
|
590
|
+
}
|
|
591
|
+
function o() {
|
|
592
|
+
return a();
|
|
593
|
+
}
|
|
594
|
+
function a() {
|
|
595
|
+
let c = u();
|
|
596
|
+
if (i() && i().value === "?") {
|
|
597
|
+
s("?");
|
|
598
|
+
const p = o();
|
|
599
|
+
s(":");
|
|
600
|
+
const y = o();
|
|
601
|
+
return c ? p : y;
|
|
602
|
+
}
|
|
603
|
+
return c;
|
|
604
|
+
}
|
|
605
|
+
function u() {
|
|
606
|
+
let c = m();
|
|
607
|
+
for (; i() && i().value === "||"; ) {
|
|
608
|
+
s("OP");
|
|
609
|
+
const p = m();
|
|
610
|
+
c = c || p;
|
|
611
|
+
}
|
|
612
|
+
return c;
|
|
613
|
+
}
|
|
614
|
+
function m() {
|
|
615
|
+
let c = g();
|
|
616
|
+
for (; i() && i().value === "&&"; ) {
|
|
617
|
+
s("OP");
|
|
618
|
+
const p = g();
|
|
619
|
+
c = c && p;
|
|
620
|
+
}
|
|
621
|
+
return c;
|
|
622
|
+
}
|
|
623
|
+
function g() {
|
|
624
|
+
let c = w();
|
|
625
|
+
for (; i() && ["==", "!=", "===", "!=="].includes(i().value); ) {
|
|
626
|
+
const p = s("OP").value, y = w();
|
|
627
|
+
switch (p) {
|
|
628
|
+
case "==":
|
|
629
|
+
c = c == y;
|
|
630
|
+
break;
|
|
631
|
+
case "!=":
|
|
632
|
+
c = c != y;
|
|
633
|
+
break;
|
|
634
|
+
case "===":
|
|
635
|
+
c = c === y;
|
|
636
|
+
break;
|
|
637
|
+
case "!==":
|
|
638
|
+
c = c !== y;
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
return c;
|
|
643
|
+
}
|
|
644
|
+
function w() {
|
|
645
|
+
let c = h();
|
|
646
|
+
for (; i() && [">", "<", ">=", "<="].includes(i().value); ) {
|
|
647
|
+
const p = s("OP").value, y = h();
|
|
648
|
+
switch (p) {
|
|
649
|
+
case ">":
|
|
650
|
+
c = c > y;
|
|
651
|
+
break;
|
|
652
|
+
case "<":
|
|
653
|
+
c = c < y;
|
|
654
|
+
break;
|
|
655
|
+
case ">=":
|
|
656
|
+
c = c >= y;
|
|
657
|
+
break;
|
|
658
|
+
case "<=":
|
|
659
|
+
c = c <= y;
|
|
660
|
+
break;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
return c;
|
|
664
|
+
}
|
|
665
|
+
function h() {
|
|
666
|
+
let c = l();
|
|
667
|
+
for (; i() && (i().value === "+" || i().value === "-"); ) {
|
|
668
|
+
const p = s("OP").value, y = l();
|
|
669
|
+
c = p === "+" ? c + y : c - y;
|
|
670
|
+
}
|
|
671
|
+
return c;
|
|
672
|
+
}
|
|
673
|
+
function l() {
|
|
674
|
+
let c = d();
|
|
675
|
+
for (; i() && (i().value === "*" || i().value === "/" || i().value === "%"); ) {
|
|
676
|
+
const p = s("OP").value, y = d();
|
|
677
|
+
switch (p) {
|
|
678
|
+
case "*":
|
|
679
|
+
c = c * y;
|
|
680
|
+
break;
|
|
681
|
+
case "/":
|
|
682
|
+
c = c / y;
|
|
683
|
+
break;
|
|
684
|
+
case "%":
|
|
685
|
+
c = c % y;
|
|
686
|
+
break;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
return c;
|
|
690
|
+
}
|
|
691
|
+
function d() {
|
|
692
|
+
return i() && i().value === "!" ? (s("OP"), !d()) : i() && i().value === "-" ? (s("OP"), -d()) : v();
|
|
693
|
+
}
|
|
694
|
+
function v() {
|
|
695
|
+
const c = i();
|
|
696
|
+
if (c) {
|
|
697
|
+
if (c.type === "NUMBER")
|
|
698
|
+
return s("NUMBER"), Number(c.value);
|
|
699
|
+
if (c.type === "STRING")
|
|
700
|
+
return s("STRING"), c.value.slice(1, -1);
|
|
701
|
+
if (c.type === "IDENT")
|
|
702
|
+
return s("IDENT"), c.value === "true" ? !0 : c.value === "false" ? !1 : c.value === "null" ? null : void 0;
|
|
703
|
+
if (c.value === "[") {
|
|
704
|
+
s("PUNC");
|
|
705
|
+
const p = [];
|
|
706
|
+
for (; i() && i().value !== "]"; )
|
|
707
|
+
p.push(o()), i() && i().value === "," && s("PUNC");
|
|
708
|
+
return s("PUNC"), p;
|
|
709
|
+
}
|
|
710
|
+
if (c.value === "(") {
|
|
711
|
+
s("PUNC");
|
|
712
|
+
const p = o();
|
|
713
|
+
return s("PUNC"), p;
|
|
714
|
+
}
|
|
715
|
+
throw new Error("Unexpected token in expression");
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return o();
|
|
719
|
+
}
|
|
720
|
+
static tokenize(t) {
|
|
721
|
+
const r = [], n = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
|
|
722
|
+
let i;
|
|
723
|
+
for (; (i = n.exec(t)) !== null; ) {
|
|
724
|
+
const s = i[1];
|
|
725
|
+
s && (/^\d/.test(s) ? r.push({ type: "NUMBER", value: s }) : /^"/.test(s) || /^'/.test(s) ? r.push({ type: "STRING", value: s }) : /^[a-zA-Z_]/.test(s) ? r.push({ type: "IDENT", value: s }) : /^[()?:,\[\]]$/.test(s) ? r.push({ type: "PUNC", value: s }) : r.push({ type: "OP", value: s }));
|
|
726
|
+
}
|
|
727
|
+
return r;
|
|
728
|
+
}
|
|
729
|
+
static evaluateSimpleValue(t, r) {
|
|
730
|
+
if (t === "true") return !0;
|
|
731
|
+
if (t === "false") return !1;
|
|
732
|
+
if (!isNaN(Number(t))) return Number(t);
|
|
733
|
+
if (t.startsWith("ctx.")) {
|
|
734
|
+
const n = t.slice(4);
|
|
735
|
+
return H(r, n);
|
|
736
|
+
}
|
|
737
|
+
return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t;
|
|
738
|
+
}
|
|
739
|
+
static clearCache() {
|
|
740
|
+
this.cache.clear();
|
|
741
|
+
}
|
|
742
|
+
static getCacheSize() {
|
|
743
|
+
return this.cache.size;
|
|
744
|
+
}
|
|
394
745
|
}
|
|
395
|
-
|
|
396
|
-
|
|
746
|
+
class se {
|
|
747
|
+
static cleanupFunctions = /* @__PURE__ */ new WeakMap();
|
|
748
|
+
/**
|
|
749
|
+
* Add an event listener with automatic cleanup tracking
|
|
750
|
+
*/
|
|
751
|
+
static addListener(t, r, n, i) {
|
|
752
|
+
t.addEventListener(r, n, i);
|
|
753
|
+
const o = { event: r, handler: n, options: i, cleanup: () => t.removeEventListener(r, n, i), addedAt: Date.now() };
|
|
754
|
+
this.cleanupFunctions.has(t) || this.cleanupFunctions.set(t, []);
|
|
755
|
+
const a = this.cleanupFunctions.get(t);
|
|
756
|
+
a.push(o), this.cleanupFunctions.get(t).__metaList = a;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Remove a specific event listener
|
|
760
|
+
*/
|
|
761
|
+
static removeListener(t, r, n, i) {
|
|
762
|
+
t.removeEventListener(r, n, i);
|
|
763
|
+
const s = this.cleanupFunctions.get(t);
|
|
764
|
+
if (s) {
|
|
765
|
+
const o = s.__metaList || null;
|
|
766
|
+
if (o) {
|
|
767
|
+
const a = o.findIndex((u) => u.event === r && u.handler === n && JSON.stringify(u.options) === JSON.stringify(i));
|
|
768
|
+
if (a >= 0) {
|
|
769
|
+
try {
|
|
770
|
+
o[a].cleanup();
|
|
771
|
+
} catch {
|
|
772
|
+
}
|
|
773
|
+
o.splice(a, 1);
|
|
774
|
+
}
|
|
775
|
+
o.length === 0 && this.cleanupFunctions.delete(t);
|
|
776
|
+
} else {
|
|
777
|
+
const a = s.findIndex(() => !0);
|
|
778
|
+
a >= 0 && (s.splice(a, 1), s.length === 0 && this.cleanupFunctions.delete(t));
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Clean up all event listeners for an element
|
|
784
|
+
*/
|
|
785
|
+
static cleanup(t) {
|
|
786
|
+
const r = this.cleanupFunctions.get(t);
|
|
787
|
+
r && ((r.__metaList || r).forEach((i) => {
|
|
788
|
+
try {
|
|
789
|
+
typeof i == "function" ? i() : i && typeof i.cleanup == "function" && i.cleanup();
|
|
790
|
+
} catch (s) {
|
|
791
|
+
console.error("Error during event cleanup:", s);
|
|
792
|
+
}
|
|
793
|
+
}), this.cleanupFunctions.delete(t));
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Clean up all tracked event listeners (useful for testing)
|
|
797
|
+
*/
|
|
798
|
+
static cleanupAll() {
|
|
799
|
+
try {
|
|
800
|
+
this.cleanupFunctions = /* @__PURE__ */ new WeakMap();
|
|
801
|
+
} catch (t) {
|
|
802
|
+
console.error("Error during global cleanup:", t);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Check if an element has any tracked event listeners
|
|
807
|
+
*/
|
|
808
|
+
static hasListeners(t) {
|
|
809
|
+
const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
|
|
810
|
+
return !!(n && n.length > 0);
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Get the number of tracked event listeners for an element
|
|
814
|
+
*/
|
|
815
|
+
static getListenerCount(t) {
|
|
816
|
+
const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
|
|
817
|
+
return n ? n.length : 0;
|
|
818
|
+
}
|
|
397
819
|
}
|
|
398
|
-
function
|
|
820
|
+
function ce(e, t) {
|
|
399
821
|
if (t && e instanceof HTMLElement) {
|
|
822
|
+
se.cleanup(e);
|
|
400
823
|
for (const r in t)
|
|
401
824
|
t[r] === e && delete t[r];
|
|
402
825
|
for (const r of Array.from(e.childNodes))
|
|
403
|
-
|
|
826
|
+
ce(r, t);
|
|
404
827
|
}
|
|
405
828
|
}
|
|
406
|
-
function
|
|
829
|
+
function de(e, t, r) {
|
|
830
|
+
if (typeof e == "string") return;
|
|
831
|
+
const n = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), i = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
832
|
+
n ? n.value = t : i && r && (r[i] = t);
|
|
833
|
+
}
|
|
834
|
+
function kt(e, t, r, n, i, s, o, a) {
|
|
407
835
|
if (!s) return;
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
836
|
+
const u = t.includes("lazy"), m = t.includes("trim"), g = t.includes("number"), w = e && typeof e == "object" && "value" in e && typeof e.value < "u", h = () => {
|
|
837
|
+
if (w) {
|
|
838
|
+
const C = e.value;
|
|
839
|
+
return a && typeof C == "object" && C !== null ? C[a] : C;
|
|
840
|
+
}
|
|
841
|
+
return H(s._state || s, e);
|
|
842
|
+
}, l = h();
|
|
843
|
+
let d = "text";
|
|
844
|
+
o instanceof HTMLInputElement ? d = n?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
|
|
845
|
+
const v = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = v ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
846
|
+
if (d === "checkbox")
|
|
847
|
+
if (Array.isArray(l))
|
|
848
|
+
r[c] = l.includes(String(o?.getAttribute("value") ?? n?.value ?? ""));
|
|
415
849
|
else {
|
|
416
|
-
const
|
|
417
|
-
r[
|
|
850
|
+
const C = o?.getAttribute("true-value") ?? !0;
|
|
851
|
+
r[c] = l === C;
|
|
418
852
|
}
|
|
419
|
-
else if (
|
|
420
|
-
r[
|
|
421
|
-
else if (
|
|
853
|
+
else if (d === "radio")
|
|
854
|
+
r[c] = l === (n?.value ?? "");
|
|
855
|
+
else if (d === "select")
|
|
422
856
|
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
423
|
-
const
|
|
857
|
+
const C = Array.isArray(l) ? l.map(String) : [];
|
|
424
858
|
setTimeout(() => {
|
|
425
|
-
Array.from(o.options).forEach((
|
|
426
|
-
|
|
859
|
+
Array.from(o.options).forEach((k) => {
|
|
860
|
+
k.selected = C.includes(k.value);
|
|
427
861
|
});
|
|
428
|
-
}, 0), r[
|
|
862
|
+
}, 0), r[c] = Array.isArray(l) ? l : [];
|
|
429
863
|
} else
|
|
430
|
-
r[
|
|
864
|
+
r[c] = l;
|
|
431
865
|
else {
|
|
432
|
-
r[
|
|
866
|
+
r[c] = l;
|
|
433
867
|
try {
|
|
434
|
-
const
|
|
435
|
-
|
|
868
|
+
const C = te(c);
|
|
869
|
+
n && (n[C] = l);
|
|
436
870
|
} catch {
|
|
437
871
|
}
|
|
438
872
|
}
|
|
439
|
-
const
|
|
440
|
-
if (
|
|
441
|
-
const
|
|
442
|
-
if (
|
|
443
|
-
const
|
|
444
|
-
if (!
|
|
445
|
-
let
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
if (Array.isArray(
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
451
|
-
|
|
873
|
+
const p = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input", y = (C) => {
|
|
874
|
+
if (C.isComposing || i._isComposing) return;
|
|
875
|
+
const k = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
|
|
876
|
+
if (C.isTrusted === !1 && !k) return;
|
|
877
|
+
const f = C.target;
|
|
878
|
+
if (!f || f._modelUpdating) return;
|
|
879
|
+
let x = f.value;
|
|
880
|
+
if (d === "checkbox") {
|
|
881
|
+
const R = h();
|
|
882
|
+
if (Array.isArray(R)) {
|
|
883
|
+
const T = f.getAttribute("value") ?? "", $ = Array.from(R);
|
|
884
|
+
if (f.checked)
|
|
885
|
+
$.includes(T) || $.push(T);
|
|
452
886
|
else {
|
|
453
|
-
const P =
|
|
454
|
-
P > -1 &&
|
|
887
|
+
const P = $.indexOf(T);
|
|
888
|
+
P > -1 && $.splice(P, 1);
|
|
455
889
|
}
|
|
456
|
-
|
|
890
|
+
x = $;
|
|
457
891
|
} else {
|
|
458
|
-
const
|
|
459
|
-
|
|
892
|
+
const T = f.getAttribute("true-value") ?? !0, $ = f.getAttribute("false-value") ?? !1;
|
|
893
|
+
x = f.checked ? T : $;
|
|
460
894
|
}
|
|
461
|
-
} else if (
|
|
462
|
-
|
|
463
|
-
else if (
|
|
464
|
-
|
|
465
|
-
else if (
|
|
466
|
-
const
|
|
467
|
-
isNaN(
|
|
468
|
-
}
|
|
469
|
-
const
|
|
470
|
-
if (Array.isArray(
|
|
471
|
-
|
|
895
|
+
} else if (d === "radio")
|
|
896
|
+
x = f.getAttribute("value") ?? f.value;
|
|
897
|
+
else if (d === "select" && f.multiple)
|
|
898
|
+
x = Array.from(f.selectedOptions).map((R) => R.value);
|
|
899
|
+
else if (m && typeof x == "string" && (x = x.trim()), g) {
|
|
900
|
+
const R = Number(x);
|
|
901
|
+
isNaN(R) || (x = R);
|
|
902
|
+
}
|
|
903
|
+
const A = s._state || s, _ = h();
|
|
904
|
+
if (Array.isArray(x) && Array.isArray(_) ? JSON.stringify([...x].sort()) !== JSON.stringify([..._].sort()) : x !== _) {
|
|
905
|
+
f._modelUpdating = !0;
|
|
472
906
|
try {
|
|
473
|
-
if (
|
|
474
|
-
|
|
475
|
-
|
|
907
|
+
if (w)
|
|
908
|
+
if (a && typeof e.value == "object" && e.value !== null) {
|
|
909
|
+
const R = { ...e.value };
|
|
910
|
+
R[a] = x, e.value = R;
|
|
911
|
+
} else
|
|
912
|
+
e.value = x;
|
|
913
|
+
else
|
|
914
|
+
Ce(A, e, x);
|
|
915
|
+
if (s._requestRender && s._requestRender(), s._triggerWatchers) {
|
|
916
|
+
const R = w ? "reactiveState" : e;
|
|
917
|
+
s._triggerWatchers(R, x);
|
|
918
|
+
}
|
|
919
|
+
if (f) {
|
|
920
|
+
const R = `update:${te(c)}`, T = new CustomEvent(R, {
|
|
921
|
+
detail: x,
|
|
476
922
|
bubbles: !0,
|
|
477
923
|
composed: !0
|
|
478
924
|
});
|
|
479
|
-
|
|
925
|
+
f.dispatchEvent(T);
|
|
480
926
|
}
|
|
481
927
|
} finally {
|
|
482
|
-
setTimeout(() =>
|
|
928
|
+
setTimeout(() => f._modelUpdating = !1, 0);
|
|
483
929
|
}
|
|
484
930
|
}
|
|
485
931
|
};
|
|
486
|
-
if (
|
|
487
|
-
if (
|
|
488
|
-
const
|
|
489
|
-
o &&
|
|
932
|
+
if (v) {
|
|
933
|
+
if (i[p]) {
|
|
934
|
+
const C = i[p];
|
|
935
|
+
o && se.removeListener(o, p, C);
|
|
490
936
|
}
|
|
491
|
-
|
|
937
|
+
i[p] = y;
|
|
492
938
|
} else {
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
495
|
-
const
|
|
496
|
-
o &&
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
if (Array.isArray(
|
|
501
|
-
|
|
502
|
-
const S =
|
|
939
|
+
const C = `update:${te(c)}`;
|
|
940
|
+
if (i[C]) {
|
|
941
|
+
const k = i[C];
|
|
942
|
+
o && se.removeListener(o, C, k);
|
|
943
|
+
}
|
|
944
|
+
i[C] = (k) => {
|
|
945
|
+
const f = s._state || s, x = k.detail !== void 0 ? k.detail : k.target?.value, A = H(f, e);
|
|
946
|
+
if (Array.isArray(x) && Array.isArray(A) ? JSON.stringify([...x].sort()) !== JSON.stringify([...A].sort()) : x !== A) {
|
|
947
|
+
Ce(f, e, x), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, x);
|
|
948
|
+
const S = k.target;
|
|
503
949
|
if (S) {
|
|
504
|
-
S[
|
|
950
|
+
S[c] = x;
|
|
505
951
|
try {
|
|
506
|
-
const
|
|
507
|
-
typeof
|
|
952
|
+
const R = te(c);
|
|
953
|
+
typeof x == "boolean" ? x ? S.setAttribute(R, "true") : S.setAttribute(R, "false") : S.setAttribute(R, String(x));
|
|
508
954
|
} catch {
|
|
509
955
|
}
|
|
510
956
|
queueMicrotask(() => {
|
|
@@ -514,143 +960,111 @@ function tt(e, t, r, i, n, s, o, a) {
|
|
|
514
960
|
}
|
|
515
961
|
};
|
|
516
962
|
}
|
|
517
|
-
(
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
const
|
|
522
|
-
let
|
|
523
|
-
if (
|
|
524
|
-
const
|
|
525
|
-
isNaN(
|
|
963
|
+
(d === "text" || d === "textarea") && (i.compositionstart = (() => i._isComposing = !0), i.compositionend = (C) => {
|
|
964
|
+
i._isComposing = !1;
|
|
965
|
+
const k = C.target;
|
|
966
|
+
k && setTimeout(() => {
|
|
967
|
+
const f = k.value, x = s._state || s, A = H(x, e);
|
|
968
|
+
let _ = f;
|
|
969
|
+
if (m && (_ = _.trim()), g) {
|
|
970
|
+
const R = Number(_);
|
|
971
|
+
isNaN(R) || (_ = R);
|
|
526
972
|
}
|
|
527
|
-
if (Array.isArray(
|
|
528
|
-
|
|
973
|
+
if (Array.isArray(_) && Array.isArray(A) ? JSON.stringify([..._].sort()) !== JSON.stringify([...A].sort()) : _ !== A) {
|
|
974
|
+
k._modelUpdating = !0;
|
|
529
975
|
try {
|
|
530
|
-
|
|
976
|
+
Ce(x, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
|
|
531
977
|
} finally {
|
|
532
|
-
setTimeout(() =>
|
|
978
|
+
setTimeout(() => k._modelUpdating = !1, 0);
|
|
533
979
|
}
|
|
534
980
|
}
|
|
535
981
|
}, 0);
|
|
536
982
|
});
|
|
537
983
|
}
|
|
538
|
-
function
|
|
984
|
+
function it(e) {
|
|
539
985
|
const t = e.slice(2);
|
|
540
986
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
541
987
|
}
|
|
542
|
-
function
|
|
988
|
+
function Ct(e, t, r, n) {
|
|
543
989
|
if (typeof e == "object" && e !== null)
|
|
544
|
-
for (const [
|
|
545
|
-
|
|
990
|
+
for (const [i, s] of Object.entries(e))
|
|
991
|
+
i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? r[i] = s : t[i] = s;
|
|
546
992
|
else if (typeof e == "string") {
|
|
547
|
-
if (!
|
|
993
|
+
if (!n) return;
|
|
548
994
|
try {
|
|
549
|
-
const
|
|
550
|
-
if (typeof
|
|
551
|
-
for (const [s, o] of Object.entries(
|
|
995
|
+
const i = he(e, n);
|
|
996
|
+
if (typeof i == "object" && i !== null) {
|
|
997
|
+
for (const [s, o] of Object.entries(i))
|
|
552
998
|
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
|
|
553
999
|
return;
|
|
554
1000
|
} else {
|
|
555
|
-
r[e] =
|
|
1001
|
+
r[e] = i;
|
|
556
1002
|
return;
|
|
557
1003
|
}
|
|
558
1004
|
} catch {
|
|
559
|
-
const
|
|
560
|
-
r[e] =
|
|
1005
|
+
const i = H(n, e);
|
|
1006
|
+
r[e] = i;
|
|
561
1007
|
}
|
|
562
1008
|
}
|
|
563
1009
|
}
|
|
564
|
-
function
|
|
565
|
-
let
|
|
1010
|
+
function _t(e, t, r) {
|
|
1011
|
+
let n;
|
|
566
1012
|
if (typeof e == "string") {
|
|
567
1013
|
if (!r) return;
|
|
568
|
-
|
|
1014
|
+
n = he(e, r);
|
|
569
1015
|
} else
|
|
570
|
-
|
|
571
|
-
const
|
|
572
|
-
let s =
|
|
573
|
-
if (
|
|
574
|
-
if (
|
|
575
|
-
const o =
|
|
576
|
-
(
|
|
1016
|
+
n = e;
|
|
1017
|
+
const i = t.style || "";
|
|
1018
|
+
let s = i;
|
|
1019
|
+
if (n) {
|
|
1020
|
+
if (i) {
|
|
1021
|
+
const o = i.split(";").map((u) => u.trim()).filter(Boolean), a = o.findIndex(
|
|
1022
|
+
(u) => u.startsWith("display:")
|
|
577
1023
|
);
|
|
578
1024
|
a >= 0 && o[a] === "display: none" && (o.splice(a, 1), s = o.length > 0 ? o.join("; ") + ";" : "");
|
|
579
1025
|
}
|
|
580
|
-
} else if (
|
|
581
|
-
const o =
|
|
582
|
-
(
|
|
1026
|
+
} else if (i) {
|
|
1027
|
+
const o = i.split(";").filter(Boolean), a = o.findIndex(
|
|
1028
|
+
(u) => u.trim().startsWith("display:")
|
|
583
1029
|
);
|
|
584
1030
|
a >= 0 ? o[a] = "display: none" : o.push("display: none"), s = o.join("; ");
|
|
585
1031
|
} else
|
|
586
1032
|
s = "display: none";
|
|
587
|
-
s !==
|
|
1033
|
+
s !== i && (s ? t.style = s : delete t.style);
|
|
588
1034
|
}
|
|
589
|
-
function
|
|
590
|
-
|
|
591
|
-
/constructor/i,
|
|
592
|
-
/prototype/i,
|
|
593
|
-
/__proto__/i,
|
|
594
|
-
/function/i,
|
|
595
|
-
/eval/i,
|
|
596
|
-
/import/i,
|
|
597
|
-
/require/i,
|
|
598
|
-
/window/i,
|
|
599
|
-
/document/i,
|
|
600
|
-
/global/i,
|
|
601
|
-
/process/i
|
|
602
|
-
].some((i) => i.test(e))) {
|
|
603
|
-
pe("Potentially dangerous expression blocked:", e);
|
|
604
|
-
return;
|
|
605
|
-
}
|
|
606
|
-
if (e.trim().startsWith("{") && e.trim().endsWith("}"))
|
|
607
|
-
try {
|
|
608
|
-
const i = Object.keys(t), n = i.map((a) => t[a]), s = e.replace(/ctx\./g, "");
|
|
609
|
-
if (s.length > 1e3) {
|
|
610
|
-
pe("Expression too long, blocked for security:", e);
|
|
611
|
-
return;
|
|
612
|
-
}
|
|
613
|
-
return new Function(...i, `return ${s}`)(...n);
|
|
614
|
-
} catch (i) {
|
|
615
|
-
pe("Failed to evaluate expression:", e, i);
|
|
616
|
-
return;
|
|
617
|
-
}
|
|
618
|
-
if (e.startsWith("ctx.")) {
|
|
619
|
-
const i = e.slice(4);
|
|
620
|
-
return K(t, i);
|
|
621
|
-
}
|
|
622
|
-
return K(t, e);
|
|
1035
|
+
function he(e, t) {
|
|
1036
|
+
return xt.evaluate(e, t);
|
|
623
1037
|
}
|
|
624
|
-
function
|
|
625
|
-
let
|
|
1038
|
+
function Et(e, t, r) {
|
|
1039
|
+
let n;
|
|
626
1040
|
if (typeof e == "string") {
|
|
627
1041
|
if (!r) return;
|
|
628
|
-
|
|
1042
|
+
n = he(e, r);
|
|
629
1043
|
} else
|
|
630
|
-
|
|
631
|
-
let
|
|
632
|
-
typeof
|
|
633
|
-
const s = t.class || "", o = s ? `${s} ${
|
|
1044
|
+
n = e;
|
|
1045
|
+
let i = [];
|
|
1046
|
+
typeof n == "string" ? i = [n] : Array.isArray(n) ? i = n.filter(Boolean) : typeof n == "object" && n !== null && (i = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
1047
|
+
const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
|
|
634
1048
|
o && (t.class = o);
|
|
635
1049
|
}
|
|
636
|
-
function
|
|
637
|
-
let
|
|
1050
|
+
function St(e, t, r) {
|
|
1051
|
+
let n;
|
|
638
1052
|
if (typeof e == "string") {
|
|
639
1053
|
if (!r) return;
|
|
640
|
-
|
|
1054
|
+
n = he(e, r);
|
|
641
1055
|
} else
|
|
642
|
-
|
|
643
|
-
let
|
|
644
|
-
if (typeof
|
|
645
|
-
|
|
646
|
-
else if (
|
|
1056
|
+
n = e;
|
|
1057
|
+
let i = "";
|
|
1058
|
+
if (typeof n == "string")
|
|
1059
|
+
i = n;
|
|
1060
|
+
else if (n && typeof n == "object") {
|
|
647
1061
|
const o = [];
|
|
648
|
-
for (const [a,
|
|
649
|
-
if (
|
|
650
|
-
const
|
|
1062
|
+
for (const [a, u] of Object.entries(n))
|
|
1063
|
+
if (u != null && u !== "") {
|
|
1064
|
+
const m = a.replace(
|
|
651
1065
|
/[A-Z]/g,
|
|
652
|
-
(
|
|
653
|
-
),
|
|
1066
|
+
(h) => `-${h.toLowerCase()}`
|
|
1067
|
+
), g = [
|
|
654
1068
|
"width",
|
|
655
1069
|
"height",
|
|
656
1070
|
"top",
|
|
@@ -676,24 +1090,29 @@ function st(e, t, r) {
|
|
|
676
1090
|
"min-height",
|
|
677
1091
|
"max-height"
|
|
678
1092
|
];
|
|
679
|
-
let
|
|
680
|
-
typeof
|
|
1093
|
+
let w = String(u);
|
|
1094
|
+
typeof u == "number" && g.includes(m) && (w = `${u}px`), o.push(`${m}: ${w}`);
|
|
681
1095
|
}
|
|
682
|
-
|
|
1096
|
+
i = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
683
1097
|
}
|
|
684
1098
|
const s = t.style || "";
|
|
685
|
-
t.style = s + (s && !s.endsWith(";") ? "; " : "") +
|
|
1099
|
+
t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
|
|
686
1100
|
}
|
|
687
|
-
function
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
1101
|
+
function $t(e, t, r) {
|
|
1102
|
+
let n = e;
|
|
1103
|
+
typeof e == "string" && r && (n = he(e, r)), n && typeof n == "object" && n.constructor?.name === "ReactiveState" ? t.reactiveRef = n : t.ref = n;
|
|
1104
|
+
}
|
|
1105
|
+
function st(e, t, r, n) {
|
|
1106
|
+
const i = {}, s = { ...n || {} }, o = {};
|
|
1107
|
+
for (const [a, u] of Object.entries(e)) {
|
|
1108
|
+
const { value: m, modifiers: g, arg: w } = u;
|
|
691
1109
|
if (a === "model" || a.startsWith("model:")) {
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
typeof u == "string" ? u : String(u),
|
|
1110
|
+
const h = a.split(":"), l = h.length > 1 ? h[1] : w;
|
|
1111
|
+
kt(
|
|
695
1112
|
m,
|
|
696
|
-
|
|
1113
|
+
// Pass the original value (could be string or reactive state object)
|
|
1114
|
+
g,
|
|
1115
|
+
i,
|
|
697
1116
|
s,
|
|
698
1117
|
o,
|
|
699
1118
|
t,
|
|
@@ -704,29 +1123,32 @@ function De(e, t, r, i) {
|
|
|
704
1123
|
}
|
|
705
1124
|
switch (a) {
|
|
706
1125
|
case "bind":
|
|
707
|
-
|
|
1126
|
+
Ct(m, i, s, t);
|
|
708
1127
|
break;
|
|
709
1128
|
case "show":
|
|
710
|
-
|
|
1129
|
+
_t(m, s, t);
|
|
711
1130
|
break;
|
|
712
1131
|
case "class":
|
|
713
|
-
|
|
1132
|
+
Et(m, s, t);
|
|
714
1133
|
break;
|
|
715
1134
|
case "style":
|
|
716
|
-
|
|
1135
|
+
St(m, s, t);
|
|
1136
|
+
break;
|
|
1137
|
+
case "ref":
|
|
1138
|
+
$t(m, i, t);
|
|
717
1139
|
break;
|
|
718
1140
|
}
|
|
719
1141
|
}
|
|
720
|
-
return { props:
|
|
1142
|
+
return { props: i, attrs: s, listeners: o };
|
|
721
1143
|
}
|
|
722
|
-
function
|
|
1144
|
+
function Ie(e, t) {
|
|
723
1145
|
if (Array.isArray(e)) {
|
|
724
1146
|
const s = /* @__PURE__ */ new Set();
|
|
725
1147
|
return e.map((o) => {
|
|
726
1148
|
if (!o || typeof o != "object") return o;
|
|
727
1149
|
let a = o.props?.key ?? o.key;
|
|
728
1150
|
if (!a) {
|
|
729
|
-
const
|
|
1151
|
+
const w = o.tag || "node", l = [
|
|
730
1152
|
// attrs (kebab-case)
|
|
731
1153
|
o.props?.attrs?.id,
|
|
732
1154
|
o.props?.attrs?.name,
|
|
@@ -736,25 +1158,25 @@ function je(e, t) {
|
|
|
736
1158
|
o.props?.props?.name,
|
|
737
1159
|
o.props?.props?.dataKey,
|
|
738
1160
|
o.props?.props?.["data-key"]
|
|
739
|
-
].find((
|
|
740
|
-
a = l ? `${t}:${
|
|
1161
|
+
].find((d) => d != null) ?? "";
|
|
1162
|
+
a = l ? `${t}:${w}:${l}` : `${t}:${w}`;
|
|
741
1163
|
}
|
|
742
|
-
let
|
|
743
|
-
for (; s.has(
|
|
744
|
-
|
|
745
|
-
s.add(
|
|
746
|
-
let
|
|
747
|
-
return Array.isArray(
|
|
1164
|
+
let u = a, m = 1;
|
|
1165
|
+
for (; s.has(u); )
|
|
1166
|
+
u = `${a}#${m++}`;
|
|
1167
|
+
s.add(u);
|
|
1168
|
+
let g = o.children;
|
|
1169
|
+
return Array.isArray(g) && (g = Ie(g, u)), { ...o, key: u, children: g };
|
|
748
1170
|
});
|
|
749
1171
|
}
|
|
750
1172
|
const r = e;
|
|
751
|
-
let
|
|
752
|
-
return Array.isArray(
|
|
1173
|
+
let n = r.props?.key ?? r.key ?? t, i = r.children;
|
|
1174
|
+
return Array.isArray(i) && (i = Ie(i, n)), { ...r, key: n, children: i };
|
|
753
1175
|
}
|
|
754
|
-
function
|
|
755
|
-
const
|
|
756
|
-
n,
|
|
1176
|
+
function Fe(e, t, r, n) {
|
|
1177
|
+
const i = r.directives ?? {}, s = st(
|
|
757
1178
|
i,
|
|
1179
|
+
n,
|
|
758
1180
|
e,
|
|
759
1181
|
r.attrs
|
|
760
1182
|
), o = {
|
|
@@ -765,38 +1187,39 @@ function Re(e, t, r, i) {
|
|
|
765
1187
|
...t.attrs,
|
|
766
1188
|
...r.attrs,
|
|
767
1189
|
...s.attrs
|
|
768
|
-
},
|
|
769
|
-
let
|
|
770
|
-
for (const
|
|
771
|
-
const v =
|
|
772
|
-
if (v !==
|
|
773
|
-
if (
|
|
774
|
-
e.value !==
|
|
775
|
-
else if (
|
|
776
|
-
e.checked = !!
|
|
777
|
-
else if (
|
|
778
|
-
const
|
|
779
|
-
typeof v == "function" &&
|
|
780
|
-
} else if (
|
|
781
|
-
e.removeAttribute(
|
|
782
|
-
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) ||
|
|
1190
|
+
}, u = t.props ?? {}, m = o, g = r?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
1191
|
+
let w = !1;
|
|
1192
|
+
for (const d in { ...u, ...m }) {
|
|
1193
|
+
const v = u[d], b = m[d];
|
|
1194
|
+
if (v !== b)
|
|
1195
|
+
if (w = !0, d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
1196
|
+
e.value !== b && (e.value = b ?? "");
|
|
1197
|
+
else if (d === "checked" && e instanceof HTMLInputElement)
|
|
1198
|
+
e.checked = !!b;
|
|
1199
|
+
else if (d.startsWith("on") && typeof b == "function") {
|
|
1200
|
+
const c = it(d);
|
|
1201
|
+
typeof v == "function" && se.removeListener(e, c, v), se.addListener(e, c, b);
|
|
1202
|
+
} else if (b == null)
|
|
1203
|
+
e.removeAttribute(d);
|
|
1204
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
|
|
783
1205
|
try {
|
|
784
|
-
e[
|
|
1206
|
+
e[d] = b;
|
|
785
1207
|
} catch {
|
|
786
1208
|
}
|
|
787
1209
|
else
|
|
788
|
-
|
|
1210
|
+
b === !1 && e.removeAttribute(d);
|
|
789
1211
|
}
|
|
790
|
-
for (const [
|
|
1212
|
+
for (const [d, v] of Object.entries(
|
|
791
1213
|
s.listeners || {}
|
|
792
1214
|
))
|
|
793
|
-
|
|
794
|
-
const
|
|
795
|
-
for (const
|
|
796
|
-
const v =
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
1215
|
+
se.addListener(e, d, v);
|
|
1216
|
+
const h = t.attrs ?? {}, l = a;
|
|
1217
|
+
for (const d in { ...h, ...l }) {
|
|
1218
|
+
const v = h[d], b = l[d];
|
|
1219
|
+
let c = v, p = b;
|
|
1220
|
+
if (v && typeof v == "object" && v.constructor?.name === "ReactiveState" && (c = v.value), b && typeof b == "object" && b.constructor?.name === "ReactiveState" && (p = b.value), c !== p)
|
|
1221
|
+
if (w = !0, p == null || p === !1) {
|
|
1222
|
+
if (e.removeAttribute(d), d === "value") {
|
|
800
1223
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
801
1224
|
try {
|
|
802
1225
|
e.value = "";
|
|
@@ -813,61 +1236,69 @@ function Re(e, t, r, i) {
|
|
|
813
1236
|
} catch {
|
|
814
1237
|
}
|
|
815
1238
|
}
|
|
816
|
-
if (
|
|
1239
|
+
if (d === "checked" && e instanceof HTMLInputElement)
|
|
817
1240
|
try {
|
|
818
1241
|
e.checked = !1;
|
|
819
1242
|
} catch {
|
|
820
1243
|
}
|
|
821
|
-
if (
|
|
1244
|
+
if (d === "disabled")
|
|
822
1245
|
try {
|
|
823
1246
|
e.disabled = !1;
|
|
824
1247
|
} catch {
|
|
825
1248
|
}
|
|
826
1249
|
} else {
|
|
827
|
-
if (
|
|
1250
|
+
if (d === "value") {
|
|
828
1251
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) {
|
|
829
1252
|
try {
|
|
830
|
-
e.value =
|
|
1253
|
+
e.value = p ?? "";
|
|
831
1254
|
} catch {
|
|
832
|
-
e.setAttribute(
|
|
1255
|
+
e.setAttribute(d, String(p));
|
|
833
1256
|
}
|
|
834
1257
|
continue;
|
|
835
1258
|
} else if (e instanceof HTMLSelectElement) {
|
|
836
1259
|
try {
|
|
837
|
-
e.value =
|
|
1260
|
+
e.value = p ?? "";
|
|
838
1261
|
} catch {
|
|
839
1262
|
}
|
|
840
1263
|
continue;
|
|
841
1264
|
} else if (e instanceof HTMLProgressElement) {
|
|
842
1265
|
try {
|
|
843
|
-
e.value = Number(
|
|
1266
|
+
e.value = Number(p);
|
|
844
1267
|
} catch {
|
|
845
1268
|
}
|
|
846
1269
|
continue;
|
|
847
1270
|
}
|
|
848
1271
|
}
|
|
849
|
-
if (
|
|
1272
|
+
if (d === "checked" && e instanceof HTMLInputElement) {
|
|
850
1273
|
try {
|
|
851
|
-
e.checked = !!
|
|
1274
|
+
e.checked = !!p;
|
|
852
1275
|
} catch {
|
|
853
1276
|
}
|
|
854
1277
|
continue;
|
|
855
1278
|
}
|
|
856
|
-
if (
|
|
857
|
-
e.setAttribute(
|
|
1279
|
+
if (d === "style") {
|
|
1280
|
+
e.setAttribute(d, String(p));
|
|
858
1281
|
continue;
|
|
859
1282
|
}
|
|
860
|
-
|
|
1283
|
+
const y = e.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1284
|
+
if (g && !y && d.includes("-")) {
|
|
1285
|
+
const C = rt(d);
|
|
1286
|
+
try {
|
|
1287
|
+
e[C] = p;
|
|
1288
|
+
} catch {
|
|
1289
|
+
e.setAttribute(d, String(p));
|
|
1290
|
+
}
|
|
1291
|
+
} else if (!y && d in e)
|
|
861
1292
|
try {
|
|
862
|
-
e[
|
|
1293
|
+
e[d] = p;
|
|
863
1294
|
} catch {
|
|
864
|
-
e.setAttribute(
|
|
1295
|
+
e.setAttribute(d, String(p));
|
|
865
1296
|
}
|
|
866
1297
|
else
|
|
867
|
-
e.setAttribute(
|
|
1298
|
+
e.setAttribute(d, String(p));
|
|
868
1299
|
}
|
|
869
1300
|
}
|
|
870
|
-
if (
|
|
1301
|
+
if (g && w)
|
|
871
1302
|
try {
|
|
872
1303
|
if (typeof e._applyProps == "function")
|
|
873
1304
|
try {
|
|
@@ -878,114 +1309,130 @@ function Re(e, t, r, i) {
|
|
|
878
1309
|
} catch {
|
|
879
1310
|
}
|
|
880
1311
|
}
|
|
881
|
-
function
|
|
1312
|
+
function X(e, t, r) {
|
|
882
1313
|
if (typeof e == "string")
|
|
883
1314
|
return document.createTextNode(e);
|
|
884
1315
|
if (e.tag === "#text") {
|
|
885
|
-
const
|
|
1316
|
+
const h = document.createTextNode(
|
|
886
1317
|
typeof e.children == "string" ? e.children : ""
|
|
887
1318
|
);
|
|
888
|
-
return e.key != null && (
|
|
1319
|
+
return e.key != null && (h.key = e.key), h;
|
|
889
1320
|
}
|
|
890
1321
|
if (e.tag === "#anchor") {
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
const
|
|
894
|
-
|
|
895
|
-
for (const
|
|
896
|
-
const
|
|
897
|
-
|
|
898
|
-
}
|
|
899
|
-
return
|
|
900
|
-
}
|
|
901
|
-
const
|
|
902
|
-
e.key != null && (
|
|
903
|
-
const { props:
|
|
904
|
-
...
|
|
1322
|
+
const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""), v = document.createTextNode("");
|
|
1323
|
+
h.key != null && (d.key = `${h.key}:start`, v.key = `${h.key}:end`), h._startNode = d, h._endNode = v;
|
|
1324
|
+
const b = document.createDocumentFragment();
|
|
1325
|
+
b.appendChild(d);
|
|
1326
|
+
for (const c of l) {
|
|
1327
|
+
const p = X(c, t);
|
|
1328
|
+
b.appendChild(p);
|
|
1329
|
+
}
|
|
1330
|
+
return b.appendChild(v), b;
|
|
1331
|
+
}
|
|
1332
|
+
const n = document.createElement(e.tag);
|
|
1333
|
+
e.key != null && (n.key = e.key);
|
|
1334
|
+
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = st(o, t, n, s), u = {
|
|
1335
|
+
...i,
|
|
905
1336
|
...a.props
|
|
906
|
-
},
|
|
1337
|
+
}, m = {
|
|
907
1338
|
...s,
|
|
908
1339
|
...a.attrs
|
|
909
|
-
},
|
|
910
|
-
for (const
|
|
911
|
-
const l =
|
|
912
|
-
if (!(typeof
|
|
1340
|
+
}, g = n.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1341
|
+
for (const h in m) {
|
|
1342
|
+
const l = m[h];
|
|
1343
|
+
if (!(typeof h != "string" || /\[object Object\]/.test(h))) {
|
|
913
1344
|
if (typeof l == "boolean")
|
|
914
|
-
l &&
|
|
1345
|
+
l && n.setAttribute(h, "");
|
|
915
1346
|
else if (l != null)
|
|
916
|
-
if (!
|
|
1347
|
+
if (!g && h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement || n instanceof HTMLProgressElement))
|
|
917
1348
|
try {
|
|
918
|
-
|
|
1349
|
+
n instanceof HTMLProgressElement ? n.value = Number(l) : n.value = l ?? "";
|
|
919
1350
|
} catch {
|
|
920
|
-
|
|
1351
|
+
n.setAttribute(h, String(l));
|
|
921
1352
|
}
|
|
922
|
-
else if (!
|
|
1353
|
+
else if (!g && h === "checked" && n instanceof HTMLInputElement)
|
|
923
1354
|
try {
|
|
924
|
-
|
|
1355
|
+
n.checked = !!l;
|
|
925
1356
|
} catch {
|
|
926
|
-
|
|
1357
|
+
n.setAttribute(h, String(l));
|
|
927
1358
|
}
|
|
928
|
-
else if (!
|
|
1359
|
+
else if (!g && h in n)
|
|
929
1360
|
try {
|
|
930
|
-
|
|
1361
|
+
n[h] = l;
|
|
931
1362
|
} catch {
|
|
932
|
-
|
|
1363
|
+
n.setAttribute(h, String(l));
|
|
933
1364
|
}
|
|
934
|
-
else
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
1365
|
+
else if ((e.props?.isCustomElement ?? !1) && !g && h.includes("-")) {
|
|
1366
|
+
const v = rt(h);
|
|
1367
|
+
try {
|
|
1368
|
+
n[v] = l;
|
|
1369
|
+
} catch {
|
|
1370
|
+
n.setAttribute(h, String(l));
|
|
1371
|
+
}
|
|
1372
|
+
} else
|
|
1373
|
+
n.setAttribute(h, String(l));
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
for (const h in u) {
|
|
1377
|
+
const l = u[h];
|
|
1378
|
+
if (!(typeof h != "string" || /\[object Object\]/.test(h)))
|
|
1379
|
+
if (h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement)) {
|
|
1380
|
+
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1381
|
+
n.value = d ?? "";
|
|
1382
|
+
} else if (h === "checked" && n instanceof HTMLInputElement) {
|
|
1383
|
+
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1384
|
+
n.checked = !!d;
|
|
1385
|
+
} else if (h.startsWith("on") && typeof l == "function")
|
|
1386
|
+
se.addListener(n, it(h), l);
|
|
947
1387
|
else {
|
|
948
|
-
if (
|
|
1388
|
+
if (h.startsWith("on") && l === void 0)
|
|
949
1389
|
continue;
|
|
950
1390
|
if (l == null || l === !1)
|
|
951
|
-
|
|
952
|
-
else if ((e.props?.isCustomElement ?? !1) ||
|
|
1391
|
+
n.removeAttribute(h);
|
|
1392
|
+
else if ((e.props?.isCustomElement ?? !1) || h in n)
|
|
953
1393
|
try {
|
|
954
|
-
|
|
1394
|
+
const v = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1395
|
+
n[h] = v;
|
|
955
1396
|
} catch {
|
|
956
1397
|
}
|
|
957
1398
|
}
|
|
958
1399
|
}
|
|
959
|
-
for (const [
|
|
1400
|
+
for (const [h, l] of Object.entries(
|
|
960
1401
|
a.listeners || {}
|
|
961
1402
|
))
|
|
962
|
-
|
|
963
|
-
const
|
|
964
|
-
|
|
1403
|
+
se.addListener(n, h, l);
|
|
1404
|
+
const w = {
|
|
1405
|
+
...e,
|
|
1406
|
+
props: {
|
|
1407
|
+
...e.props,
|
|
1408
|
+
...a.props
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
de(w, n, r);
|
|
965
1412
|
try {
|
|
966
|
-
if (typeof
|
|
1413
|
+
if (typeof n._applyProps == "function")
|
|
967
1414
|
try {
|
|
968
|
-
|
|
1415
|
+
n._applyProps(n._cfg);
|
|
969
1416
|
} catch {
|
|
970
1417
|
}
|
|
971
|
-
typeof
|
|
1418
|
+
typeof n.requestRender == "function" ? n.requestRender() : typeof n._render == "function" && n._render(n._cfg);
|
|
972
1419
|
} catch {
|
|
973
1420
|
}
|
|
974
1421
|
if (Array.isArray(e.children))
|
|
975
|
-
for (const
|
|
976
|
-
|
|
977
|
-
else typeof e.children == "string" && (
|
|
1422
|
+
for (const h of e.children)
|
|
1423
|
+
n.appendChild(X(h, t, r));
|
|
1424
|
+
else typeof e.children == "string" && (n.textContent = e.children);
|
|
978
1425
|
try {
|
|
979
|
-
if (
|
|
1426
|
+
if (n instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
|
|
980
1427
|
try {
|
|
981
|
-
|
|
1428
|
+
n.value = m.value ?? "";
|
|
982
1429
|
} catch {
|
|
983
1430
|
}
|
|
984
1431
|
} catch {
|
|
985
1432
|
}
|
|
986
|
-
return
|
|
1433
|
+
return n;
|
|
987
1434
|
}
|
|
988
|
-
function
|
|
1435
|
+
function At(e, t, r, n, i) {
|
|
989
1436
|
if (typeof r == "string") {
|
|
990
1437
|
e.textContent !== r && (e.textContent = r);
|
|
991
1438
|
return;
|
|
@@ -994,104 +1441,104 @@ function ot(e, t, r, i, n) {
|
|
|
994
1441
|
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
995
1442
|
for (const l of o)
|
|
996
1443
|
l && l.key != null && a.set(l.key, l);
|
|
997
|
-
const
|
|
1444
|
+
const u = /* @__PURE__ */ new Map();
|
|
998
1445
|
for (const l of s) {
|
|
999
|
-
const
|
|
1000
|
-
|
|
1446
|
+
const d = l.key;
|
|
1447
|
+
d != null && u.set(d, l);
|
|
1001
1448
|
}
|
|
1002
|
-
const
|
|
1003
|
-
let
|
|
1004
|
-
function
|
|
1449
|
+
const m = /* @__PURE__ */ new Set();
|
|
1450
|
+
let g = e.firstChild;
|
|
1451
|
+
function w(l, d) {
|
|
1005
1452
|
let v = l;
|
|
1006
|
-
for (; v && (
|
|
1453
|
+
for (; v && (m.add(v), v !== d); )
|
|
1007
1454
|
v = v.nextSibling;
|
|
1008
1455
|
}
|
|
1009
|
-
function
|
|
1010
|
-
const
|
|
1011
|
-
let
|
|
1012
|
-
for (;
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1015
|
-
if (
|
|
1016
|
-
const
|
|
1017
|
-
for (const
|
|
1018
|
-
|
|
1019
|
-
for (const
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1456
|
+
function h(l, d, v, b) {
|
|
1457
|
+
const c = [];
|
|
1458
|
+
let p = l.nextSibling;
|
|
1459
|
+
for (; p && p !== d; )
|
|
1460
|
+
c.push(p), p = p.nextSibling;
|
|
1461
|
+
const y = Array.isArray(v) ? v : [];
|
|
1462
|
+
if (b.some((k) => k && k.key != null) || y.some((k) => k && k.key != null)) {
|
|
1463
|
+
const k = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
1464
|
+
for (const _ of y)
|
|
1465
|
+
_ && _.key != null && k.set(_.key, _);
|
|
1466
|
+
for (const _ of c) {
|
|
1467
|
+
const S = _.key;
|
|
1468
|
+
S != null && f.set(S, _);
|
|
1022
1469
|
}
|
|
1023
|
-
const
|
|
1024
|
-
let
|
|
1025
|
-
for (const
|
|
1026
|
-
let
|
|
1027
|
-
if (
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
),
|
|
1470
|
+
const x = /* @__PURE__ */ new Set();
|
|
1471
|
+
let A = l.nextSibling;
|
|
1472
|
+
for (const _ of b) {
|
|
1473
|
+
let S;
|
|
1474
|
+
if (_.key != null && f.has(_.key)) {
|
|
1475
|
+
const R = k.get(_.key);
|
|
1476
|
+
S = _e(
|
|
1477
|
+
f.get(_.key),
|
|
1478
|
+
R,
|
|
1479
|
+
_,
|
|
1480
|
+
n
|
|
1481
|
+
), x.add(S), S !== A && e.contains(S) && e.insertBefore(S, A);
|
|
1035
1482
|
} else
|
|
1036
|
-
|
|
1037
|
-
|
|
1483
|
+
S = X(_, n), e.insertBefore(S, A), x.add(S);
|
|
1484
|
+
A = S.nextSibling;
|
|
1038
1485
|
}
|
|
1039
|
-
for (const
|
|
1040
|
-
!
|
|
1486
|
+
for (const _ of c)
|
|
1487
|
+
!x.has(_) && e.contains(_) && e.removeChild(_);
|
|
1041
1488
|
} else {
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
|
|
1489
|
+
const k = Math.min(
|
|
1490
|
+
y.length,
|
|
1491
|
+
b.length
|
|
1045
1492
|
);
|
|
1046
|
-
for (let
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1493
|
+
for (let f = 0; f < k; f++) {
|
|
1494
|
+
const x = y[f], A = b[f], _ = _e(c[f], x, A, n);
|
|
1495
|
+
_ !== c[f] && (e.insertBefore(_, c[f]), e.removeChild(c[f]));
|
|
1049
1496
|
}
|
|
1050
|
-
for (let
|
|
1051
|
-
e.insertBefore(
|
|
1052
|
-
for (let
|
|
1053
|
-
e.removeChild(
|
|
1497
|
+
for (let f = k; f < b.length; f++)
|
|
1498
|
+
e.insertBefore(X(b[f], n), d);
|
|
1499
|
+
for (let f = k; f < c.length; f++)
|
|
1500
|
+
e.removeChild(c[f]);
|
|
1054
1501
|
}
|
|
1055
1502
|
}
|
|
1056
1503
|
for (const l of r) {
|
|
1057
|
-
let
|
|
1504
|
+
let d;
|
|
1058
1505
|
if (l.tag === "#anchor") {
|
|
1059
|
-
const v = l.key,
|
|
1060
|
-
let
|
|
1061
|
-
const
|
|
1062
|
-
if (
|
|
1063
|
-
e.insertBefore(
|
|
1064
|
-
for (const
|
|
1065
|
-
e.insertBefore(
|
|
1066
|
-
e.insertBefore(
|
|
1506
|
+
const v = l.key, b = `${v}:start`, c = `${v}:end`;
|
|
1507
|
+
let p = u.get(b), y = u.get(c);
|
|
1508
|
+
const C = Array.isArray(l.children) ? l.children : [];
|
|
1509
|
+
if (p || (p = document.createTextNode(""), p.key = b), y || (y = document.createTextNode(""), y.key = c), l._startNode = p, l._endNode = y, !e.contains(p) || !e.contains(y)) {
|
|
1510
|
+
e.insertBefore(p, g);
|
|
1511
|
+
for (const k of C)
|
|
1512
|
+
e.insertBefore(X(k, n), g);
|
|
1513
|
+
e.insertBefore(y, g);
|
|
1067
1514
|
} else
|
|
1068
|
-
|
|
1515
|
+
h(
|
|
1516
|
+
p,
|
|
1069
1517
|
y,
|
|
1070
|
-
x,
|
|
1071
1518
|
a.get(v)?.children,
|
|
1072
|
-
|
|
1519
|
+
C
|
|
1073
1520
|
);
|
|
1074
|
-
|
|
1521
|
+
w(p, y), g = y.nextSibling;
|
|
1075
1522
|
continue;
|
|
1076
1523
|
}
|
|
1077
|
-
if (l.key != null &&
|
|
1524
|
+
if (l.key != null && u.has(l.key)) {
|
|
1078
1525
|
const v = a.get(l.key);
|
|
1079
|
-
|
|
1080
|
-
|
|
1526
|
+
d = _e(
|
|
1527
|
+
u.get(l.key),
|
|
1081
1528
|
v,
|
|
1082
1529
|
l,
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
),
|
|
1530
|
+
n,
|
|
1531
|
+
i
|
|
1532
|
+
), m.add(d), d !== g && e.contains(d) && (g && !e.contains(g) && (g = null), e.insertBefore(d, g));
|
|
1086
1533
|
} else
|
|
1087
|
-
|
|
1088
|
-
|
|
1534
|
+
d = X(l, n, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g), m.add(d);
|
|
1535
|
+
g = d.nextSibling;
|
|
1089
1536
|
}
|
|
1090
1537
|
for (const l of s)
|
|
1091
|
-
!
|
|
1538
|
+
!m.has(l) && e.contains(l) && (ce(l, i), e.removeChild(l));
|
|
1092
1539
|
}
|
|
1093
|
-
function
|
|
1094
|
-
if (t && typeof t != "string" && t.props?.ref &&
|
|
1540
|
+
function _e(e, t, r, n, i) {
|
|
1541
|
+
if (t && typeof t != "string" && t.props?.ref && i && ce(e, i), t === r) return e;
|
|
1095
1542
|
if (typeof r == "string") {
|
|
1096
1543
|
if (e.nodeType === Node.TEXT_NODE)
|
|
1097
1544
|
return e.textContent !== r && (e.textContent = r), e;
|
|
@@ -1101,97 +1548,97 @@ function ge(e, t, r, i, n) {
|
|
|
1101
1548
|
}
|
|
1102
1549
|
}
|
|
1103
1550
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
1104
|
-
const o = r, a = Array.isArray(o.children) ? o.children : [],
|
|
1105
|
-
o.key != null && (
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
for (const
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1551
|
+
const o = r, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), m = o._endNode ?? document.createTextNode("");
|
|
1552
|
+
o.key != null && (u.key = `${o.key}:start`, m.key = `${o.key}:end`), o._startNode = u, o._endNode = m;
|
|
1553
|
+
const g = document.createDocumentFragment();
|
|
1554
|
+
g.appendChild(u);
|
|
1555
|
+
for (const w of a) {
|
|
1556
|
+
const h = X(w, n);
|
|
1557
|
+
g.appendChild(h);
|
|
1111
1558
|
}
|
|
1112
|
-
return
|
|
1559
|
+
return g.appendChild(m), e.parentNode?.replaceChild(g, e), u;
|
|
1113
1560
|
}
|
|
1114
1561
|
if (!r) {
|
|
1115
|
-
|
|
1562
|
+
ce(e, i);
|
|
1116
1563
|
const o = document.createComment("removed");
|
|
1117
1564
|
return e.parentNode?.replaceChild(o, e), o;
|
|
1118
1565
|
}
|
|
1119
1566
|
if (!t || typeof t == "string") {
|
|
1120
|
-
|
|
1121
|
-
const o =
|
|
1122
|
-
return
|
|
1567
|
+
ce(e, i);
|
|
1568
|
+
const o = X(r, n, i);
|
|
1569
|
+
return de(r, o, i), e.parentNode?.replaceChild(o, e), o;
|
|
1123
1570
|
}
|
|
1124
1571
|
if (r.tag === "#anchor") {
|
|
1125
|
-
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""),
|
|
1126
|
-
r.key != null && (a.key = `${r.key}:start`,
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1129
|
-
for (const
|
|
1130
|
-
|
|
1131
|
-
return
|
|
1572
|
+
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), u = r._endNode ?? document.createTextNode("");
|
|
1573
|
+
r.key != null && (a.key = `${r.key}:start`, u.key = `${r.key}:end`), r._startNode = a, r._endNode = u;
|
|
1574
|
+
const m = document.createDocumentFragment();
|
|
1575
|
+
m.appendChild(a);
|
|
1576
|
+
for (const g of o)
|
|
1577
|
+
m.appendChild(X(g, n));
|
|
1578
|
+
return m.appendChild(u), e.parentNode?.replaceChild(m, e), a;
|
|
1132
1579
|
}
|
|
1133
1580
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
1134
1581
|
const o = e;
|
|
1135
|
-
return
|
|
1582
|
+
return Fe(o, t.props || {}, r.props || {}, n), At(o, t.children, r.children, n, i), de(r, o, i), o;
|
|
1136
1583
|
}
|
|
1137
1584
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && (t.tag && String(t.tag).includes("-") || r.props && r.props.isCustomElement || t.props && t.props.isCustomElement))
|
|
1138
1585
|
try {
|
|
1139
1586
|
const a = e;
|
|
1140
|
-
return
|
|
1587
|
+
return Fe(a, t.props || {}, r.props || {}, n), de(r, a, i), a;
|
|
1141
1588
|
} catch {
|
|
1142
1589
|
}
|
|
1143
|
-
|
|
1144
|
-
const s =
|
|
1145
|
-
return
|
|
1590
|
+
ce(e, i);
|
|
1591
|
+
const s = X(r, n, i);
|
|
1592
|
+
return de(r, s, i), e.parentNode?.replaceChild(s, e), s;
|
|
1146
1593
|
}
|
|
1147
|
-
function
|
|
1148
|
-
let
|
|
1149
|
-
Array.isArray(t) ? t.length === 1 ? (
|
|
1594
|
+
function Rt(e, t, r, n) {
|
|
1595
|
+
let i;
|
|
1596
|
+
Array.isArray(t) ? t.length === 1 ? (i = t[0], i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })) : i = { tag: "div", key: "__root__", children: t } : (i = t, i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })), i && typeof i == "object" && i.tag === "#anchor" && (i = {
|
|
1150
1597
|
tag: "div",
|
|
1151
1598
|
key: "__anchor_root__",
|
|
1152
1599
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
1153
|
-
children: [
|
|
1154
|
-
}),
|
|
1600
|
+
children: [i]
|
|
1601
|
+
}), i = Ie(i, String(i.key ?? "root"));
|
|
1155
1602
|
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
1156
1603
|
let a;
|
|
1157
|
-
s && o ? typeof s != "string" && typeof
|
|
1158
|
-
const
|
|
1159
|
-
for (let
|
|
1160
|
-
const
|
|
1161
|
-
|
|
1604
|
+
s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a = _e(o, s, i, r, n) : (a = X(i, r, n), e.replaceChild(a, o)) : (a = X(i, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
1605
|
+
const u = [];
|
|
1606
|
+
for (let m = 0; m < e.childNodes.length; m++) {
|
|
1607
|
+
const g = e.childNodes[m];
|
|
1608
|
+
g !== a && g.nodeName !== "STYLE" && (ce(g, n), u.push(g));
|
|
1162
1609
|
}
|
|
1163
|
-
|
|
1610
|
+
u.forEach((m) => e.removeChild(m)), e._prevVNode = i, e._prevDom = a;
|
|
1164
1611
|
}
|
|
1165
|
-
function
|
|
1166
|
-
if (typeof e == "string") return
|
|
1612
|
+
function Te(e) {
|
|
1613
|
+
if (typeof e == "string") return ne(e);
|
|
1167
1614
|
if (e.tag === "#text")
|
|
1168
|
-
return typeof e.children == "string" ?
|
|
1615
|
+
return typeof e.children == "string" ? ne(e.children) : "";
|
|
1169
1616
|
if (e.tag === "#anchor")
|
|
1170
|
-
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(
|
|
1617
|
+
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(Te).join("");
|
|
1171
1618
|
let t = "";
|
|
1172
|
-
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([
|
|
1619
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([i, s]) => ` ${i}="${ne(String(s))}"`).join(""));
|
|
1173
1620
|
let r = "";
|
|
1174
|
-
e.props && (r = Object.entries(e.props).filter(([
|
|
1175
|
-
const
|
|
1176
|
-
return `<${e.tag}${t}${r}>${
|
|
1621
|
+
e.props && (r = Object.entries(e.props).filter(([i]) => i !== "attrs" && i !== "directives" && i !== "ref" && i !== "key").map(([i, s]) => ` ${i}="${ne(String(s))}"`).join(""));
|
|
1622
|
+
const n = Array.isArray(e.children) ? e.children.filter(Boolean).map(Te).join("") : typeof e.children == "string" ? ne(e.children) : e.children ? Te(e.children) : "";
|
|
1623
|
+
return `<${e.tag}${t}${r}>${n}</${e.tag}>`;
|
|
1177
1624
|
}
|
|
1178
|
-
function
|
|
1625
|
+
function Tt(e, ...t) {
|
|
1179
1626
|
let r = "";
|
|
1180
|
-
for (let
|
|
1181
|
-
r += e[
|
|
1627
|
+
for (let n = 0; n < e.length; n++)
|
|
1628
|
+
r += e[n], n < t.length && (r += t[n]);
|
|
1182
1629
|
return r;
|
|
1183
1630
|
}
|
|
1184
|
-
function
|
|
1631
|
+
function ot(e) {
|
|
1185
1632
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
1186
1633
|
}
|
|
1187
|
-
let
|
|
1188
|
-
function
|
|
1189
|
-
return
|
|
1634
|
+
let xe = null;
|
|
1635
|
+
function Ke() {
|
|
1636
|
+
return xe || (xe = new CSSStyleSheet(), xe.replaceSync(ot(Pt))), xe;
|
|
1190
1637
|
}
|
|
1191
|
-
function
|
|
1638
|
+
function Ot(e) {
|
|
1192
1639
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
1193
1640
|
}
|
|
1194
|
-
const
|
|
1641
|
+
const Pt = Tt`
|
|
1195
1642
|
:host, *, ::before, ::after {
|
|
1196
1643
|
all: isolate;
|
|
1197
1644
|
box-sizing: border-box;
|
|
@@ -1249,7 +1696,7 @@ const lt = Ue`
|
|
|
1249
1696
|
sup { top: -.5em }
|
|
1250
1697
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
1251
1698
|
[hidden] { display: none }
|
|
1252
|
-
`,
|
|
1699
|
+
`, Lt = {
|
|
1253
1700
|
neutral: {
|
|
1254
1701
|
50: "#fafafa",
|
|
1255
1702
|
100: "#f4f4f5",
|
|
@@ -1345,17 +1792,17 @@ const lt = Ue`
|
|
|
1345
1792
|
black: { DEFAULT: "#000000" },
|
|
1346
1793
|
transparent: { DEFAULT: "transparent" },
|
|
1347
1794
|
current: { DEFAULT: "currentColor" }
|
|
1348
|
-
},
|
|
1349
|
-
Object.entries(
|
|
1795
|
+
}, jt = Object.fromEntries(
|
|
1796
|
+
Object.entries(Lt).map(([e, t]) => [
|
|
1350
1797
|
e,
|
|
1351
1798
|
Object.fromEntries(
|
|
1352
|
-
Object.entries(t).map(([r,
|
|
1799
|
+
Object.entries(t).map(([r, n]) => [
|
|
1353
1800
|
r,
|
|
1354
|
-
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${
|
|
1801
|
+
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${n})`
|
|
1355
1802
|
])
|
|
1356
1803
|
)
|
|
1357
1804
|
])
|
|
1358
|
-
),
|
|
1805
|
+
), Oe = {
|
|
1359
1806
|
/* Display */
|
|
1360
1807
|
block: "display:block;",
|
|
1361
1808
|
inline: "display:inline;",
|
|
@@ -1570,7 +2017,7 @@ const lt = Ue`
|
|
|
1570
2017
|
"z-30": "z-index:30;",
|
|
1571
2018
|
"z-40": "z-index:40;",
|
|
1572
2019
|
"z-50": "z-index:50;"
|
|
1573
|
-
},
|
|
2020
|
+
}, Mt = "0.25rem", Ve = {
|
|
1574
2021
|
m: ["margin"],
|
|
1575
2022
|
mx: ["margin-inline"],
|
|
1576
2023
|
my: ["margin-block"],
|
|
@@ -1602,34 +2049,34 @@ const lt = Ue`
|
|
|
1602
2049
|
"gap-x": ["column-gap"],
|
|
1603
2050
|
"gap-y": ["row-gap"]
|
|
1604
2051
|
};
|
|
1605
|
-
function
|
|
1606
|
-
let r = 0,
|
|
1607
|
-
for (let
|
|
1608
|
-
const s = e[
|
|
2052
|
+
function G(e, t) {
|
|
2053
|
+
let r = 0, n = 0;
|
|
2054
|
+
for (let i = 0; i < e.length; i++) {
|
|
2055
|
+
const s = e[i];
|
|
1609
2056
|
if (s === "[") r++;
|
|
1610
2057
|
else if (s === "]" && r > 0) r--;
|
|
1611
|
-
else if (s === "(")
|
|
1612
|
-
else if (s === ")" &&
|
|
1613
|
-
else if (r === 0 &&
|
|
1614
|
-
return e.slice(0,
|
|
2058
|
+
else if (s === "(") n++;
|
|
2059
|
+
else if (s === ")" && n > 0) n--;
|
|
2060
|
+
else if (r === 0 && n === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
2061
|
+
return e.slice(0, i) + t + e.slice(i);
|
|
1615
2062
|
}
|
|
1616
2063
|
return e + t;
|
|
1617
2064
|
}
|
|
1618
|
-
const
|
|
2065
|
+
const Nt = {
|
|
1619
2066
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1620
2067
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1621
|
-
hover: (e, t) => `${
|
|
1622
|
-
focus: (e, t) => `${
|
|
1623
|
-
active: (e, t) => `${
|
|
1624
|
-
disabled: (e, t) => `${
|
|
1625
|
-
visited: (e, t) => `${
|
|
1626
|
-
checked: (e, t) => `${
|
|
1627
|
-
first: (e, t) => `${
|
|
1628
|
-
last: (e, t) => `${
|
|
1629
|
-
odd: (e, t) => `${
|
|
1630
|
-
even: (e, t) => `${
|
|
1631
|
-
"focus-within": (e, t) => `${
|
|
1632
|
-
"focus-visible": (e, t) => `${
|
|
2068
|
+
hover: (e, t) => `${G(e, ":hover")}{${t}}`,
|
|
2069
|
+
focus: (e, t) => `${G(e, ":focus")}{${t}}`,
|
|
2070
|
+
active: (e, t) => `${G(e, ":active")}{${t}}`,
|
|
2071
|
+
disabled: (e, t) => `${G(e, ":disabled")}{${t}}`,
|
|
2072
|
+
visited: (e, t) => `${G(e, ":visited")}{${t}}`,
|
|
2073
|
+
checked: (e, t) => `${G(e, ":checked")}{${t}}`,
|
|
2074
|
+
first: (e, t) => `${G(e, ":first-child")}{${t}}`,
|
|
2075
|
+
last: (e, t) => `${G(e, ":last-child")}{${t}}`,
|
|
2076
|
+
odd: (e, t) => `${G(e, ":nth-child(odd)")}{${t}}`,
|
|
2077
|
+
even: (e, t) => `${G(e, ":nth-child(even)")}{${t}}`,
|
|
2078
|
+
"focus-within": (e, t) => `${G(e, ":focus-within")}{${t}}`,
|
|
2079
|
+
"focus-visible": (e, t) => `${G(e, ":focus-visible")}{${t}}`,
|
|
1633
2080
|
"group-hover": (e, t) => `.group:hover ${e}{${t}}`,
|
|
1634
2081
|
"group-focus": (e, t) => `.group:focus ${e}{${t}}`,
|
|
1635
2082
|
"group-active": (e, t) => `.group:active ${e}{${t}}`,
|
|
@@ -1638,7 +2085,7 @@ const pt = {
|
|
|
1638
2085
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1639
2086
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1640
2087
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1641
|
-
},
|
|
2088
|
+
}, Pe = {
|
|
1642
2089
|
// Responsive
|
|
1643
2090
|
sm: "(min-width:640px)",
|
|
1644
2091
|
md: "(min-width:768px)",
|
|
@@ -1647,23 +2094,23 @@ const pt = {
|
|
|
1647
2094
|
"2xl": "(min-width:1536px)",
|
|
1648
2095
|
// Dark mode (now plain string)
|
|
1649
2096
|
dark: "(prefers-color-scheme: dark)"
|
|
1650
|
-
},
|
|
1651
|
-
function
|
|
1652
|
-
const t = e.startsWith("-"),
|
|
1653
|
-
if (
|
|
1654
|
-
const
|
|
1655
|
-
if (Number.isNaN(o) || !
|
|
2097
|
+
}, Le = ["sm", "md", "lg", "xl", "2xl"];
|
|
2098
|
+
function je(e) {
|
|
2099
|
+
const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
|
|
2100
|
+
if (n.length < 2) return null;
|
|
2101
|
+
const i = n.slice(0, -1).join("-"), s = n[n.length - 1], o = parseFloat(s);
|
|
2102
|
+
if (Number.isNaN(o) || !Ve[i]) return null;
|
|
1656
2103
|
const a = t ? "-" : "";
|
|
1657
|
-
return
|
|
2104
|
+
return Ve[i].map((u) => `${u}:calc(${a}${Mt} * ${o});`).join("");
|
|
1658
2105
|
}
|
|
1659
|
-
function
|
|
1660
|
-
const t = e.replace("#", ""), r = parseInt(t, 16),
|
|
1661
|
-
return `${
|
|
2106
|
+
function Je(e) {
|
|
2107
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, i = r >> 8 & 255, s = r & 255;
|
|
2108
|
+
return `${n} ${i} ${s}`;
|
|
1662
2109
|
}
|
|
1663
|
-
function
|
|
2110
|
+
function Wt(e) {
|
|
1664
2111
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1665
2112
|
if (!t) return null;
|
|
1666
|
-
const [, r,
|
|
2113
|
+
const [, r, n, i = "DEFAULT"] = t, s = jt[n]?.[i];
|
|
1667
2114
|
if (!s) return null;
|
|
1668
2115
|
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
1669
2116
|
const a = {
|
|
@@ -1679,55 +2126,55 @@ function ht(e) {
|
|
|
1679
2126
|
}[r];
|
|
1680
2127
|
return a ? `${a}:${s};` : null;
|
|
1681
2128
|
}
|
|
1682
|
-
function
|
|
2129
|
+
function zt(e) {
|
|
1683
2130
|
const [t, r] = e.split("/");
|
|
1684
2131
|
if (!r) return { base: t };
|
|
1685
|
-
const
|
|
1686
|
-
return isNaN(
|
|
2132
|
+
const n = parseInt(r, 10);
|
|
2133
|
+
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
1687
2134
|
}
|
|
1688
|
-
function
|
|
1689
|
-
const { base: t, opacity: r } =
|
|
1690
|
-
if (
|
|
2135
|
+
function Me(e) {
|
|
2136
|
+
const { base: t, opacity: r } = zt(e), n = Wt(t);
|
|
2137
|
+
if (n) {
|
|
1691
2138
|
if (r !== void 0) {
|
|
1692
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
2139
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1693
2140
|
if (s) {
|
|
1694
|
-
const o =
|
|
1695
|
-
return
|
|
2141
|
+
const o = Je(s[0]);
|
|
2142
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1696
2143
|
}
|
|
1697
2144
|
}
|
|
1698
|
-
return
|
|
2145
|
+
return n;
|
|
1699
2146
|
}
|
|
1700
|
-
const
|
|
1701
|
-
if (
|
|
1702
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
2147
|
+
const i = Ee(t);
|
|
2148
|
+
if (i && r !== void 0) {
|
|
2149
|
+
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
1703
2150
|
if (s) {
|
|
1704
|
-
const o =
|
|
1705
|
-
return
|
|
2151
|
+
const o = Je(s[0]);
|
|
2152
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1706
2153
|
}
|
|
1707
2154
|
}
|
|
1708
|
-
return
|
|
2155
|
+
return i;
|
|
1709
2156
|
}
|
|
1710
|
-
function
|
|
2157
|
+
function Ne(e) {
|
|
1711
2158
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
1712
2159
|
if (!t) return null;
|
|
1713
2160
|
const r = parseInt(t[1], 10);
|
|
1714
2161
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1715
2162
|
}
|
|
1716
|
-
function
|
|
2163
|
+
function Ee(e) {
|
|
1717
2164
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1718
|
-
const
|
|
1719
|
-
if (
|
|
1720
|
-
const s =
|
|
1721
|
-
let o =
|
|
2165
|
+
const i = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
2166
|
+
if (i) {
|
|
2167
|
+
const s = i[1].trim();
|
|
2168
|
+
let o = i[2].trim();
|
|
1722
2169
|
return o = o.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), o = o.replace(/^'([^']*)'$/g, '"$1"'), `${s}:${o};`;
|
|
1723
2170
|
}
|
|
1724
2171
|
return null;
|
|
1725
2172
|
}
|
|
1726
2173
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
1727
2174
|
if (t > 0 && r) {
|
|
1728
|
-
const
|
|
1729
|
-
let
|
|
1730
|
-
|
|
2175
|
+
const n = e.slice(0, t);
|
|
2176
|
+
let i = e.slice(t + 2, -1);
|
|
2177
|
+
i = i.replace(/_/g, " ");
|
|
1731
2178
|
const s = {
|
|
1732
2179
|
bg: "background-color",
|
|
1733
2180
|
text: "color",
|
|
@@ -1770,14 +2217,14 @@ function me(e) {
|
|
|
1770
2217
|
leading: "line-height",
|
|
1771
2218
|
z: "z-index"
|
|
1772
2219
|
};
|
|
1773
|
-
if (
|
|
1774
|
-
return `transform:rotate(${
|
|
1775
|
-
const o = s[
|
|
1776
|
-
if (o &&
|
|
2220
|
+
if (n === "rotate")
|
|
2221
|
+
return `transform:rotate(${i});`;
|
|
2222
|
+
const o = s[n] ?? n.replace(/_/g, "-");
|
|
2223
|
+
if (o && i) return `${o}:${i};`;
|
|
1777
2224
|
}
|
|
1778
2225
|
return null;
|
|
1779
2226
|
}
|
|
1780
|
-
function
|
|
2227
|
+
function Dt(e) {
|
|
1781
2228
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1782
2229
|
const r = e.slice(1, -1);
|
|
1783
2230
|
return r.includes("&") ? r : e;
|
|
@@ -1789,44 +2236,44 @@ function mt(e) {
|
|
|
1789
2236
|
}
|
|
1790
2237
|
return null;
|
|
1791
2238
|
}
|
|
1792
|
-
function
|
|
2239
|
+
function It(e) {
|
|
1793
2240
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1794
2241
|
}
|
|
1795
|
-
function
|
|
2242
|
+
function Ht(e) {
|
|
1796
2243
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1797
|
-
let
|
|
1798
|
-
for (;
|
|
1799
|
-
const
|
|
1800
|
-
|
|
2244
|
+
let n;
|
|
2245
|
+
for (; n = t.exec(e); ) {
|
|
2246
|
+
const i = n[2].split(/\s+/).filter(Boolean);
|
|
2247
|
+
i.length && r.push(...i);
|
|
1801
2248
|
}
|
|
1802
2249
|
return r.filter(Boolean);
|
|
1803
2250
|
}
|
|
1804
|
-
const
|
|
1805
|
-
function
|
|
1806
|
-
const t = Date.now(), r =
|
|
1807
|
-
if (r && t - r.timestamp <
|
|
1808
|
-
const
|
|
1809
|
-
function
|
|
1810
|
-
const
|
|
1811
|
-
if (
|
|
1812
|
-
const
|
|
1813
|
-
return
|
|
1814
|
-
}
|
|
1815
|
-
function
|
|
1816
|
-
const
|
|
1817
|
-
return
|
|
1818
|
-
}
|
|
1819
|
-
function
|
|
1820
|
-
const
|
|
1821
|
-
let
|
|
1822
|
-
for (let
|
|
1823
|
-
const
|
|
1824
|
-
|
|
1825
|
-
}
|
|
1826
|
-
return
|
|
1827
|
-
}
|
|
1828
|
-
function l(
|
|
1829
|
-
switch (
|
|
2251
|
+
const Ze = /* @__PURE__ */ new Map(), Bt = 16;
|
|
2252
|
+
function Ut(e) {
|
|
2253
|
+
const t = Date.now(), r = Ze.get(e);
|
|
2254
|
+
if (r && t - r.timestamp < Bt) return r.css;
|
|
2255
|
+
const n = Ht(e), i = new Set(n), s = [], o = [], a = [], u = [], m = {};
|
|
2256
|
+
function g(b, c = !1) {
|
|
2257
|
+
const p = (c ? "dark|" : "") + b;
|
|
2258
|
+
if (p in m) return m[p];
|
|
2259
|
+
const y = d(b, c);
|
|
2260
|
+
return m[p] = y, y;
|
|
2261
|
+
}
|
|
2262
|
+
function w(b) {
|
|
2263
|
+
const c = b.some((y) => Le.includes(y)), p = b.includes("dark");
|
|
2264
|
+
return b.length === 0 ? 1 : !c && !p ? 2 : c && !p ? 3 : 4;
|
|
2265
|
+
}
|
|
2266
|
+
function h(b) {
|
|
2267
|
+
const c = [];
|
|
2268
|
+
let p = "", y = 0, C = 0;
|
|
2269
|
+
for (let k = 0; k < b.length; k++) {
|
|
2270
|
+
const f = b[k];
|
|
2271
|
+
f === "[" ? y++ : f === "]" && y > 0 ? y-- : f === "(" ? C++ : f === ")" && C > 0 && C--, f === ":" && y === 0 && C === 0 ? (c.push(p), p = "") : p += f;
|
|
2272
|
+
}
|
|
2273
|
+
return p && c.push(p), c;
|
|
2274
|
+
}
|
|
2275
|
+
function l(b) {
|
|
2276
|
+
switch (b) {
|
|
1830
2277
|
case "hover":
|
|
1831
2278
|
return ":hover";
|
|
1832
2279
|
case "focus":
|
|
@@ -1855,245 +2302,234 @@ function xt(e) {
|
|
|
1855
2302
|
return null;
|
|
1856
2303
|
}
|
|
1857
2304
|
}
|
|
1858
|
-
function
|
|
1859
|
-
const
|
|
1860
|
-
let
|
|
1861
|
-
const
|
|
2305
|
+
function d(b, c = !1) {
|
|
2306
|
+
const p = h(b);
|
|
2307
|
+
let y = !1;
|
|
2308
|
+
const C = p.find((E) => (E.startsWith("!") && (y = !0, E = E.slice(1)), Oe[E] || je(E) || Ne(E) || Me(E) || Ee(E)));
|
|
2309
|
+
if (!C) return null;
|
|
2310
|
+
const k = C.replace(/^!/, ""), f = Oe[k] ?? je(k) ?? Ne(k) ?? Me(k) ?? Ee(k);
|
|
1862
2311
|
if (!f) return null;
|
|
1863
|
-
const
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
const
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
if (
|
|
1878
|
-
|
|
1879
|
-
if (W) {
|
|
1880
|
-
M = W;
|
|
2312
|
+
const x = p.indexOf(C);
|
|
2313
|
+
let A = x >= 0 ? p.slice(0, x) : [];
|
|
2314
|
+
c && (A = A.filter((E) => E !== "dark"));
|
|
2315
|
+
const _ = `.${It(b)}`, S = "__SUBJECT__", R = y ? f.replace(/;$/, " !important;") : f;
|
|
2316
|
+
let T = S;
|
|
2317
|
+
const $ = [];
|
|
2318
|
+
for (const E of A)
|
|
2319
|
+
E.startsWith("group-") ? (T = `.group:${E.slice(6)} ${T}`, $.push(E)) : E.startsWith("peer-") && (T = T.replace(S, `.peer:${E.slice(5)}~${S}`), $.push(E));
|
|
2320
|
+
A = A.filter((E) => !$.includes(E));
|
|
2321
|
+
const P = [], B = [];
|
|
2322
|
+
let J = null;
|
|
2323
|
+
for (const E of A) {
|
|
2324
|
+
if (E === "dark" || Le.includes(E)) continue;
|
|
2325
|
+
const U = Dt(E);
|
|
2326
|
+
if (U) {
|
|
2327
|
+
J = U;
|
|
1881
2328
|
continue;
|
|
1882
2329
|
}
|
|
1883
|
-
const
|
|
1884
|
-
if (
|
|
1885
|
-
|
|
2330
|
+
const D = l(E);
|
|
2331
|
+
if (D) {
|
|
2332
|
+
J ? B.push(D) : P.push(D);
|
|
1886
2333
|
continue;
|
|
1887
2334
|
}
|
|
1888
|
-
const
|
|
1889
|
-
typeof
|
|
1890
|
-
}
|
|
1891
|
-
function
|
|
1892
|
-
if (!
|
|
1893
|
-
let
|
|
1894
|
-
if (
|
|
1895
|
-
let
|
|
1896
|
-
for (;
|
|
1897
|
-
for (;
|
|
1898
|
-
const
|
|
1899
|
-
if (
|
|
1900
|
-
return
|
|
2335
|
+
const z = Nt[E];
|
|
2336
|
+
typeof z == "function" && (T = z(T, R).split("{")[0]);
|
|
2337
|
+
}
|
|
2338
|
+
function ye(E, U) {
|
|
2339
|
+
if (!U) return E;
|
|
2340
|
+
let D = 0, z = 0;
|
|
2341
|
+
if (E.length && (E[0] === ">" || E[0] === "+" || E[0] === "~" || E[0] === " ")) {
|
|
2342
|
+
let O = 1;
|
|
2343
|
+
for (; O < E.length && E[O] === " "; ) O++;
|
|
2344
|
+
for (; O < E.length; O++) {
|
|
2345
|
+
const I = E[O];
|
|
2346
|
+
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? z++ : I === ")" && z > 0 && z--, D === 0 && z === 0 && (E[O] === ">" || E[O] === "+" || E[O] === "~" || E[O] === " "))
|
|
2347
|
+
return E.slice(0, O) + U + E.slice(O);
|
|
1901
2348
|
}
|
|
1902
|
-
return
|
|
2349
|
+
return E + U;
|
|
1903
2350
|
}
|
|
1904
|
-
for (let
|
|
1905
|
-
const
|
|
1906
|
-
if (
|
|
1907
|
-
return
|
|
2351
|
+
for (let O = 0; O < E.length; O++) {
|
|
2352
|
+
const I = E[O];
|
|
2353
|
+
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? z++ : I === ")" && z > 0 && z--, D === 0 && z === 0 && (I === ">" || I === "+" || I === "~" || I === " "))
|
|
2354
|
+
return E.slice(0, O) + U + E.slice(O);
|
|
1908
2355
|
}
|
|
1909
|
-
return
|
|
1910
|
-
}
|
|
1911
|
-
const
|
|
1912
|
-
if (
|
|
1913
|
-
if (
|
|
1914
|
-
const
|
|
1915
|
-
if (
|
|
1916
|
-
|
|
2356
|
+
return E + U;
|
|
2357
|
+
}
|
|
2358
|
+
const K = P.join(""), L = B.join("");
|
|
2359
|
+
if (J)
|
|
2360
|
+
if (J.includes("&")) {
|
|
2361
|
+
const E = J.indexOf("&"), U = J.slice(0, E), D = J.slice(E + 1), z = S + K, O = T;
|
|
2362
|
+
if (P.length === 0)
|
|
2363
|
+
T = O.replace(S, U + z + L + D);
|
|
1917
2364
|
else {
|
|
1918
|
-
const
|
|
1919
|
-
|
|
2365
|
+
const I = ye(D, L);
|
|
2366
|
+
T = O.replace(S, U + z + I);
|
|
1920
2367
|
}
|
|
1921
2368
|
} else
|
|
1922
|
-
|
|
2369
|
+
T = T.replace(S, `${J}${S + K}`), L && (T = T.replace(S, `${S}${L}`));
|
|
1923
2370
|
else
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
let
|
|
1927
|
-
const
|
|
1928
|
-
return
|
|
1929
|
-
}
|
|
1930
|
-
for (const
|
|
1931
|
-
const
|
|
1932
|
-
(
|
|
2371
|
+
T = S + K + L;
|
|
2372
|
+
T = T.replace(new RegExp(S, "g"), _);
|
|
2373
|
+
let j = `${T}{${R}}`;
|
|
2374
|
+
const V = A.filter((E) => Le.includes(E)), Z = V.length ? V[V.length - 1] : null, W = A.includes("dark");
|
|
2375
|
+
return c && Z ? j = `@media (prefers-color-scheme: dark) and ${Pe[Z]}{${j}}` : c ? j = `@media (prefers-color-scheme: dark){${j}}` : W && Z ? j = `@media (prefers-color-scheme: dark) and ${Pe[Z]}{${j}}` : W ? j = `@media (prefers-color-scheme: dark){${j}}` : Z && (j = `@media ${Pe[Z]}{${j}}`), j;
|
|
2376
|
+
}
|
|
2377
|
+
for (const b of i) {
|
|
2378
|
+
const c = h(b), p = c.find(
|
|
2379
|
+
(f) => Oe[f] || je(f) || Ne(f) || Me(f) || Ee(f)
|
|
1933
2380
|
);
|
|
1934
|
-
if (!
|
|
1935
|
-
const
|
|
1936
|
-
if (
|
|
1937
|
-
const
|
|
1938
|
-
|
|
2381
|
+
if (!p) continue;
|
|
2382
|
+
const y = c.indexOf(p), C = y >= 0 ? c.slice(0, y) : [], k = w(C);
|
|
2383
|
+
if (k === 4) {
|
|
2384
|
+
const f = g(b, !0);
|
|
2385
|
+
f && u.push(f);
|
|
1939
2386
|
} else {
|
|
1940
|
-
const
|
|
1941
|
-
|
|
2387
|
+
const f = g(b);
|
|
2388
|
+
f && (k === 1 ? s.push(f) : k === 2 ? o.push(f) : k === 3 && a.push(f));
|
|
1942
2389
|
}
|
|
1943
2390
|
}
|
|
1944
|
-
const v = [...s, ...o, ...a, ...
|
|
1945
|
-
return
|
|
2391
|
+
const v = [...s, ...o, ...a, ...u].join("");
|
|
2392
|
+
return Ze.set(e, { css: v, timestamp: t }), v;
|
|
1946
2393
|
}
|
|
1947
|
-
const
|
|
1948
|
-
function
|
|
2394
|
+
const pe = [];
|
|
2395
|
+
function qt(e, t, r, n, i, s, o, a) {
|
|
1949
2396
|
if (e) {
|
|
1950
|
-
|
|
2397
|
+
pe.push(r);
|
|
1951
2398
|
try {
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
}
|
|
1960
|
-
const c = t.render(r);
|
|
1961
|
-
if (c instanceof Promise) {
|
|
1962
|
-
s(!0), c.then((u) => {
|
|
1963
|
-
s(!1), o(null), re(e, u, r, i, n), a(e.innerHTML);
|
|
1964
|
-
}).catch((u) => {
|
|
1965
|
-
s(!1), o(u), t.errorTemplate && re(e, t.errorTemplate(u, r), r, i, n);
|
|
1966
|
-
}), t.loadingTemplate && re(e, t.loadingTemplate(r), r, i, n);
|
|
2399
|
+
const u = t.render(r);
|
|
2400
|
+
if (u instanceof Promise) {
|
|
2401
|
+
s(!0), u.then((m) => {
|
|
2402
|
+
s(!1), o(null), Ge(e, m, r, n, i), a(e.innerHTML);
|
|
2403
|
+
}).catch((m) => {
|
|
2404
|
+
s(!1), o(m);
|
|
2405
|
+
});
|
|
1967
2406
|
return;
|
|
1968
2407
|
}
|
|
1969
|
-
|
|
2408
|
+
Ge(e, u, r, n, i), a(e.innerHTML);
|
|
1970
2409
|
} finally {
|
|
1971
|
-
|
|
2410
|
+
pe.pop();
|
|
1972
2411
|
}
|
|
1973
2412
|
}
|
|
1974
2413
|
}
|
|
1975
|
-
function
|
|
1976
|
-
e && (
|
|
2414
|
+
function Ge(e, t, r, n, i) {
|
|
2415
|
+
e && (Rt(
|
|
1977
2416
|
e,
|
|
1978
2417
|
Array.isArray(t) ? t : [t],
|
|
1979
2418
|
r,
|
|
1980
|
-
|
|
1981
|
-
),
|
|
2419
|
+
n
|
|
2420
|
+
), i(e.innerHTML));
|
|
1982
2421
|
}
|
|
1983
|
-
function
|
|
2422
|
+
function Ft(e, t, r, n, i, s, o) {
|
|
1984
2423
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1985
|
-
if (
|
|
1986
|
-
|
|
2424
|
+
if (i(r + 1), r === 15)
|
|
2425
|
+
console.warn(
|
|
2426
|
+
`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
2427
|
+
Common causes:
|
|
2428
|
+
• Event handler calling a function immediately: @click="\${fn()}" should be @click="\${fn}"
|
|
2429
|
+
• State modification during render
|
|
2430
|
+
• Missing dependencies in computed/watch
|
|
2431
|
+
Component rendering will be throttled to prevent browser freeze.`
|
|
2432
|
+
);
|
|
2433
|
+
else if (r > 20) {
|
|
2434
|
+
console.error(
|
|
2435
|
+
`🛑 Infinite loop detected in component render:
|
|
2436
|
+
• This might be caused by state updates during render
|
|
2437
|
+
• Ensure all state modifications are done in event handlers or effects
|
|
2438
|
+
Stopping runaway component render to prevent browser freeze`
|
|
2439
|
+
), o(null);
|
|
1987
2440
|
return;
|
|
1988
2441
|
}
|
|
1989
2442
|
} else
|
|
1990
|
-
|
|
1991
|
-
const
|
|
1992
|
-
|
|
1993
|
-
}, 0);
|
|
1994
|
-
o(
|
|
2443
|
+
i(0);
|
|
2444
|
+
const m = setTimeout(() => {
|
|
2445
|
+
n(Date.now()), e(), o(null);
|
|
2446
|
+
}, r > 10 ? 100 : 0);
|
|
2447
|
+
o(m);
|
|
1995
2448
|
}
|
|
1996
|
-
function
|
|
2449
|
+
function Kt(e, t, r, n, i) {
|
|
1997
2450
|
if (!e) return;
|
|
1998
|
-
const
|
|
1999
|
-
if (
|
|
2000
|
-
|
|
2451
|
+
const s = Ut(r);
|
|
2452
|
+
if ((!s || s.trim() === "") && !t._computedStyle) {
|
|
2453
|
+
i(null), e.adoptedStyleSheets = [Ke()];
|
|
2001
2454
|
return;
|
|
2002
2455
|
}
|
|
2003
|
-
let
|
|
2004
|
-
t.
|
|
2005
|
-
let
|
|
2006
|
-
${
|
|
2456
|
+
let o = "";
|
|
2457
|
+
t._computedStyle && (o = t._computedStyle);
|
|
2458
|
+
let a = Ot(`${o}
|
|
2459
|
+
${s}
|
|
2007
2460
|
`);
|
|
2008
|
-
|
|
2461
|
+
a = ot(a);
|
|
2009
2462
|
let u = n;
|
|
2010
|
-
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !==
|
|
2463
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Ke(), u], i(u);
|
|
2464
|
+
}
|
|
2465
|
+
let N = null;
|
|
2466
|
+
function Vt(e) {
|
|
2467
|
+
N = e;
|
|
2468
|
+
}
|
|
2469
|
+
function Jt() {
|
|
2470
|
+
N = null;
|
|
2471
|
+
}
|
|
2472
|
+
function lr() {
|
|
2473
|
+
if (!N)
|
|
2474
|
+
throw new Error("useEmit must be called during component render");
|
|
2475
|
+
const e = N.emit;
|
|
2476
|
+
return (t, r) => e(t, r);
|
|
2477
|
+
}
|
|
2478
|
+
function ge(e) {
|
|
2479
|
+
e._hookCallbacks || Object.defineProperty(e, "_hookCallbacks", {
|
|
2480
|
+
value: {},
|
|
2481
|
+
writable: !0,
|
|
2482
|
+
enumerable: !1,
|
|
2483
|
+
configurable: !1
|
|
2484
|
+
});
|
|
2011
2485
|
}
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2486
|
+
function ur(e) {
|
|
2487
|
+
if (!N)
|
|
2488
|
+
throw new Error("useOnConnected must be called during component render");
|
|
2489
|
+
ge(N), N._hookCallbacks.onConnected = e;
|
|
2490
|
+
}
|
|
2491
|
+
function fr(e) {
|
|
2492
|
+
if (!N)
|
|
2493
|
+
throw new Error("useOnDisconnected must be called during component render");
|
|
2494
|
+
ge(N), N._hookCallbacks.onDisconnected = e;
|
|
2495
|
+
}
|
|
2496
|
+
function dr(e) {
|
|
2497
|
+
if (!N)
|
|
2498
|
+
throw new Error("useOnAttributeChanged must be called during component render");
|
|
2499
|
+
ge(N), N._hookCallbacks.onAttributeChanged = e;
|
|
2500
|
+
}
|
|
2501
|
+
function pr(e) {
|
|
2502
|
+
if (!N)
|
|
2503
|
+
throw new Error("useOnError must be called during component render");
|
|
2504
|
+
ge(N), N._hookCallbacks.onError = e;
|
|
2505
|
+
}
|
|
2506
|
+
function hr(e) {
|
|
2507
|
+
if (!N)
|
|
2508
|
+
throw new Error("useStyle must be called during component render");
|
|
2509
|
+
ge(N);
|
|
2510
|
+
try {
|
|
2511
|
+
const t = e();
|
|
2512
|
+
Object.defineProperty(N, "_computedStyle", {
|
|
2513
|
+
value: t,
|
|
2514
|
+
writable: !0,
|
|
2515
|
+
enumerable: !1,
|
|
2516
|
+
configurable: !0
|
|
2517
|
+
});
|
|
2518
|
+
} catch (t) {
|
|
2519
|
+
console.warn("Error in useStyle callback:", t), Object.defineProperty(N, "_computedStyle", {
|
|
2520
|
+
value: "",
|
|
2521
|
+
writable: !0,
|
|
2522
|
+
enumerable: !1,
|
|
2523
|
+
configurable: !0
|
|
2524
|
+
});
|
|
2041
2525
|
}
|
|
2042
2526
|
}
|
|
2043
|
-
const $
|
|
2044
|
-
function oe(e, t) {
|
|
2045
|
-
$t.schedule(e, t);
|
|
2046
|
-
}
|
|
2047
|
-
const be = /* @__PURE__ */ new Map(), We = Symbol.for("cer.registry");
|
|
2527
|
+
const $e = /* @__PURE__ */ new Map(), Xe = Symbol.for("cer.registry");
|
|
2048
2528
|
if (typeof window < "u") {
|
|
2049
2529
|
const e = globalThis;
|
|
2050
|
-
e[
|
|
2051
|
-
}
|
|
2052
|
-
function Ie(e, t, r) {
|
|
2053
|
-
let i = Q(e);
|
|
2054
|
-
i.includes("-") || (i = `cer-${i}`);
|
|
2055
|
-
let n;
|
|
2056
|
-
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (s, o) => {
|
|
2057
|
-
Y(`[${i}] Error:`, s, o);
|
|
2058
|
-
});
|
|
2059
|
-
try {
|
|
2060
|
-
const s = /* @__PURE__ */ new Set([
|
|
2061
|
-
"refs",
|
|
2062
|
-
"requestRender",
|
|
2063
|
-
"error",
|
|
2064
|
-
"hasError",
|
|
2065
|
-
"isLoading",
|
|
2066
|
-
"emit"
|
|
2067
|
-
]), o = [];
|
|
2068
|
-
if (n.state && typeof n.state == "object" && Object.keys(n.state).forEach((a) => {
|
|
2069
|
-
s.has(a) && o.push(a);
|
|
2070
|
-
}), n.props && typeof n.props == "object" && Object.keys(n.props).forEach((a) => {
|
|
2071
|
-
s.has(a) && o.push(a);
|
|
2072
|
-
}), n.computed && typeof n.computed == "object" && Object.keys(n.computed).forEach((a) => {
|
|
2073
|
-
s.has(a) && o.push(a);
|
|
2074
|
-
}), o.length > 0) {
|
|
2075
|
-
const a = Array.from(new Set(o));
|
|
2076
|
-
pe(
|
|
2077
|
-
`[${i}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`
|
|
2078
|
-
);
|
|
2079
|
-
}
|
|
2080
|
-
} catch {
|
|
2081
|
-
}
|
|
2082
|
-
if (be.set(i, n), typeof window < "u")
|
|
2083
|
-
if (!customElements.get(i))
|
|
2084
|
-
customElements.define(i, St(i, n));
|
|
2085
|
-
else
|
|
2086
|
-
try {
|
|
2087
|
-
document.querySelectorAll(i).forEach((s) => {
|
|
2088
|
-
try {
|
|
2089
|
-
typeof s._cfg < "u" && (s._cfg = n), typeof s._render == "function" && s._render(n);
|
|
2090
|
-
} catch {
|
|
2091
|
-
}
|
|
2092
|
-
});
|
|
2093
|
-
} catch {
|
|
2094
|
-
}
|
|
2530
|
+
e[Xe] || (e[Xe] = $e);
|
|
2095
2531
|
}
|
|
2096
|
-
function
|
|
2532
|
+
function Zt(e, t) {
|
|
2097
2533
|
if (!t.render)
|
|
2098
2534
|
throw new Error(
|
|
2099
2535
|
"Component must have a render function"
|
|
@@ -2138,7 +2574,7 @@ function St(e, t) {
|
|
|
2138
2574
|
_templateLoading = !1;
|
|
2139
2575
|
_templateError = null;
|
|
2140
2576
|
constructor() {
|
|
2141
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
2577
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = $e.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2142
2578
|
const r = this._initContext(t);
|
|
2143
2579
|
Object.defineProperty(r, "refs", {
|
|
2144
2580
|
value: this._refs,
|
|
@@ -2155,14 +2591,19 @@ function St(e, t) {
|
|
|
2155
2591
|
writable: !1,
|
|
2156
2592
|
enumerable: !1,
|
|
2157
2593
|
configurable: !1
|
|
2594
|
+
}), Object.defineProperty(r, "_componentId", {
|
|
2595
|
+
value: this._componentId,
|
|
2596
|
+
writable: !1,
|
|
2597
|
+
enumerable: !1,
|
|
2598
|
+
configurable: !1
|
|
2158
2599
|
}), Object.defineProperty(r, "_triggerWatchers", {
|
|
2159
|
-
value: (
|
|
2600
|
+
value: (i, s) => this._triggerWatchers(i, s),
|
|
2160
2601
|
writable: !1,
|
|
2161
2602
|
enumerable: !1,
|
|
2162
2603
|
configurable: !1
|
|
2163
2604
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
2164
|
-
value: (
|
|
2165
|
-
const a = new CustomEvent(
|
|
2605
|
+
value: (i, s, o) => {
|
|
2606
|
+
const a = new CustomEvent(i, {
|
|
2166
2607
|
detail: s,
|
|
2167
2608
|
bubbles: !0,
|
|
2168
2609
|
composed: !0,
|
|
@@ -2174,28 +2615,28 @@ function St(e, t) {
|
|
|
2174
2615
|
enumerable: !1,
|
|
2175
2616
|
configurable: !1
|
|
2176
2617
|
});
|
|
2177
|
-
const
|
|
2178
|
-
Object.keys(
|
|
2179
|
-
const s = i
|
|
2180
|
-
typeof s == "function" && (this.context[
|
|
2181
|
-
}), this._applyComputed(
|
|
2182
|
-
let s = this[
|
|
2183
|
-
Object.defineProperty(this,
|
|
2618
|
+
const n = $e.get(e) || t;
|
|
2619
|
+
Object.keys(n).forEach((i) => {
|
|
2620
|
+
const s = n[i];
|
|
2621
|
+
typeof s == "function" && (this.context[i] = (...o) => s(...o, this.context));
|
|
2622
|
+
}), this._applyComputed(n), n.props && Object.keys(n.props).forEach((i) => {
|
|
2623
|
+
let s = this[i];
|
|
2624
|
+
Object.defineProperty(this, i, {
|
|
2184
2625
|
get() {
|
|
2185
2626
|
return s;
|
|
2186
2627
|
},
|
|
2187
2628
|
set(o) {
|
|
2188
2629
|
const a = s;
|
|
2189
|
-
s = o, this.context[
|
|
2630
|
+
s = o, this.context[i] = o, this._initializing || (this._applyProps(n), a !== o && this._requestRender());
|
|
2190
2631
|
},
|
|
2191
2632
|
enumerable: !0,
|
|
2192
2633
|
configurable: !0
|
|
2193
2634
|
});
|
|
2194
|
-
}), this._initializing = !1, this._initWatchers(
|
|
2635
|
+
}), this._initializing = !1, this._initWatchers(n), this._applyProps(n), this._render(n);
|
|
2195
2636
|
}
|
|
2196
2637
|
connectedCallback() {
|
|
2197
2638
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2198
|
-
this._applyProps(t),
|
|
2639
|
+
this._applyProps(t), this._requestRender(), bt(
|
|
2199
2640
|
t,
|
|
2200
2641
|
this.context,
|
|
2201
2642
|
this._mounted,
|
|
@@ -2207,7 +2648,7 @@ function St(e, t) {
|
|
|
2207
2648
|
}
|
|
2208
2649
|
disconnectedCallback() {
|
|
2209
2650
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2210
|
-
|
|
2651
|
+
wt(
|
|
2211
2652
|
t,
|
|
2212
2653
|
this.context,
|
|
2213
2654
|
this._listeners,
|
|
@@ -2229,51 +2670,40 @@ function St(e, t) {
|
|
|
2229
2670
|
);
|
|
2230
2671
|
});
|
|
2231
2672
|
}
|
|
2232
|
-
attributeChangedCallback(r,
|
|
2673
|
+
attributeChangedCallback(r, n, i) {
|
|
2233
2674
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2234
|
-
this._applyProps(t),
|
|
2675
|
+
this._applyProps(t), n !== i && this._requestRender(), vt(
|
|
2235
2676
|
t,
|
|
2236
2677
|
r,
|
|
2237
|
-
i,
|
|
2238
2678
|
n,
|
|
2679
|
+
i,
|
|
2239
2680
|
this.context
|
|
2240
2681
|
);
|
|
2241
2682
|
});
|
|
2242
2683
|
}
|
|
2243
2684
|
static get observedAttributes() {
|
|
2244
|
-
return t.props ? Object.keys(t.props).map(
|
|
2685
|
+
return t.props ? Object.keys(t.props).map(te) : [];
|
|
2245
2686
|
}
|
|
2246
2687
|
_applyComputed(r) {
|
|
2247
|
-
this._runLogicWithinErrorBoundary(t, () => {
|
|
2248
|
-
r.computed && Object.entries(r.computed).forEach(([i, n]) => {
|
|
2249
|
-
Object.defineProperty(this.context, i, {
|
|
2250
|
-
get: () => {
|
|
2251
|
-
const s = n(this.context);
|
|
2252
|
-
return Z(s);
|
|
2253
|
-
},
|
|
2254
|
-
enumerable: !0
|
|
2255
|
-
});
|
|
2256
|
-
});
|
|
2257
|
-
});
|
|
2258
2688
|
}
|
|
2259
2689
|
// --- Render ---
|
|
2260
2690
|
_render(r) {
|
|
2261
2691
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2262
|
-
|
|
2692
|
+
qt(
|
|
2263
2693
|
this.shadowRoot,
|
|
2264
2694
|
r,
|
|
2265
2695
|
this.context,
|
|
2266
2696
|
this._refs,
|
|
2267
|
-
(
|
|
2268
|
-
this._lastHtmlStringForJitCSS =
|
|
2697
|
+
(n) => {
|
|
2698
|
+
this._lastHtmlStringForJitCSS = n, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(n);
|
|
2269
2699
|
},
|
|
2270
|
-
(
|
|
2271
|
-
this._templateLoading =
|
|
2700
|
+
(n) => {
|
|
2701
|
+
this._templateLoading = n, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(n);
|
|
2272
2702
|
},
|
|
2273
|
-
(
|
|
2274
|
-
this._templateError =
|
|
2703
|
+
(n) => {
|
|
2704
|
+
this._templateError = n, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(n);
|
|
2275
2705
|
},
|
|
2276
|
-
(
|
|
2706
|
+
(n) => this._applyStyle(r, n)
|
|
2277
2707
|
);
|
|
2278
2708
|
});
|
|
2279
2709
|
}
|
|
@@ -2282,8 +2712,8 @@ function St(e, t) {
|
|
|
2282
2712
|
}
|
|
2283
2713
|
_requestRender() {
|
|
2284
2714
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
2285
|
-
|
|
2286
|
-
|
|
2715
|
+
le(() => {
|
|
2716
|
+
Ft(
|
|
2287
2717
|
() => this._render(this._cfg),
|
|
2288
2718
|
this._lastRenderTime,
|
|
2289
2719
|
this._renderCount,
|
|
@@ -2302,40 +2732,36 @@ function St(e, t) {
|
|
|
2302
2732
|
});
|
|
2303
2733
|
}
|
|
2304
2734
|
// --- Style ---
|
|
2305
|
-
_applyStyle(r,
|
|
2735
|
+
_applyStyle(r, n) {
|
|
2306
2736
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2307
|
-
|
|
2737
|
+
Kt(
|
|
2308
2738
|
this.shadowRoot,
|
|
2309
|
-
r,
|
|
2310
2739
|
this.context,
|
|
2311
|
-
|
|
2740
|
+
n,
|
|
2312
2741
|
this._styleSheet,
|
|
2313
|
-
(
|
|
2314
|
-
this._styleSheet =
|
|
2742
|
+
(i) => {
|
|
2743
|
+
this._styleSheet = i;
|
|
2315
2744
|
}
|
|
2316
2745
|
);
|
|
2317
2746
|
});
|
|
2318
2747
|
}
|
|
2319
2748
|
// --- Error Boundary function ---
|
|
2320
|
-
_runLogicWithinErrorBoundary(r,
|
|
2749
|
+
_runLogicWithinErrorBoundary(r, n) {
|
|
2321
2750
|
this._hasError && (this._hasError = !1);
|
|
2322
2751
|
try {
|
|
2323
|
-
|
|
2324
|
-
} catch (
|
|
2325
|
-
this._hasError = !0, r.onError && r.onError(
|
|
2326
|
-
n,
|
|
2327
|
-
this.context
|
|
2328
|
-
));
|
|
2752
|
+
n();
|
|
2753
|
+
} catch (i) {
|
|
2754
|
+
this._hasError = !0, r.onError && r.onError(i, this.context);
|
|
2329
2755
|
}
|
|
2330
2756
|
}
|
|
2331
2757
|
// --- State, props, computed ---
|
|
2332
2758
|
_initContext(r) {
|
|
2333
2759
|
try {
|
|
2334
|
-
let
|
|
2760
|
+
let n = function(s, o = "") {
|
|
2335
2761
|
return Array.isArray(s) ? new Proxy(s, {
|
|
2336
|
-
get(a,
|
|
2337
|
-
const
|
|
2338
|
-
return typeof
|
|
2762
|
+
get(a, u, m) {
|
|
2763
|
+
const g = Reflect.get(a, u, m);
|
|
2764
|
+
return typeof g == "function" && typeof u == "string" && [
|
|
2339
2765
|
"push",
|
|
2340
2766
|
"pop",
|
|
2341
2767
|
"shift",
|
|
@@ -2343,177 +2769,303 @@ function St(e, t) {
|
|
|
2343
2769
|
"splice",
|
|
2344
2770
|
"sort",
|
|
2345
2771
|
"reverse"
|
|
2346
|
-
].includes(
|
|
2347
|
-
const l =
|
|
2348
|
-
if (!
|
|
2349
|
-
const
|
|
2350
|
-
|
|
2772
|
+
].includes(u) ? function(...h) {
|
|
2773
|
+
const l = g.apply(a, h);
|
|
2774
|
+
if (!i._initializing) {
|
|
2775
|
+
const d = o || "root";
|
|
2776
|
+
i._triggerWatchers(d, a), le(() => i._render(r), i._componentId);
|
|
2351
2777
|
}
|
|
2352
2778
|
return l;
|
|
2353
|
-
} :
|
|
2779
|
+
} : g;
|
|
2354
2780
|
},
|
|
2355
|
-
set(a,
|
|
2356
|
-
if (a[
|
|
2357
|
-
const
|
|
2358
|
-
|
|
2781
|
+
set(a, u, m) {
|
|
2782
|
+
if (a[u] = m, !i._initializing) {
|
|
2783
|
+
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2784
|
+
i._triggerWatchers(g, m), le(() => i._render(r), i._componentId);
|
|
2359
2785
|
}
|
|
2360
2786
|
return !0;
|
|
2361
2787
|
},
|
|
2362
|
-
deleteProperty(a,
|
|
2363
|
-
if (delete a[
|
|
2364
|
-
const
|
|
2365
|
-
|
|
2788
|
+
deleteProperty(a, u) {
|
|
2789
|
+
if (delete a[u], !i._initializing) {
|
|
2790
|
+
const m = o ? `${o}.${String(u)}` : String(u);
|
|
2791
|
+
i._triggerWatchers(m, void 0), le(() => i._render(r), i._componentId);
|
|
2366
2792
|
}
|
|
2367
2793
|
return !0;
|
|
2368
2794
|
}
|
|
2369
|
-
}) : s && typeof s == "object" ? (Object.keys(s).forEach((a) => {
|
|
2370
|
-
const
|
|
2371
|
-
s[a] =
|
|
2795
|
+
}) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((a) => {
|
|
2796
|
+
const u = o ? `${o}.${a}` : a;
|
|
2797
|
+
s[a] = n(s[a], u);
|
|
2372
2798
|
}), new Proxy(s, {
|
|
2373
|
-
set(a,
|
|
2374
|
-
const
|
|
2375
|
-
return a[
|
|
2376
|
-
|
|
2377
|
-
a[
|
|
2378
|
-
),
|
|
2799
|
+
set(a, u, m) {
|
|
2800
|
+
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2801
|
+
return a[u] = n(m, g), i._initializing || (i._triggerWatchers(
|
|
2802
|
+
g,
|
|
2803
|
+
a[u]
|
|
2804
|
+
), le(() => i._render(r), i._componentId)), !0;
|
|
2379
2805
|
},
|
|
2380
|
-
get(a,
|
|
2381
|
-
return Reflect.get(a,
|
|
2806
|
+
get(a, u, m) {
|
|
2807
|
+
return Reflect.get(a, u, m);
|
|
2382
2808
|
}
|
|
2383
2809
|
})) : s;
|
|
2384
2810
|
};
|
|
2385
|
-
const
|
|
2386
|
-
return
|
|
2811
|
+
const i = this;
|
|
2812
|
+
return n({
|
|
2813
|
+
// For functional components, state is managed by state() function calls
|
|
2814
|
+
// Include prop defaults in initial reactive context so prop updates trigger reactivity
|
|
2815
|
+
...r.props ? Object.fromEntries(
|
|
2816
|
+
Object.entries(r.props).map(([s, o]) => [s, o.default])
|
|
2817
|
+
) : {}
|
|
2818
|
+
});
|
|
2387
2819
|
} catch {
|
|
2388
2820
|
return {};
|
|
2389
2821
|
}
|
|
2390
2822
|
}
|
|
2391
2823
|
_initWatchers(r) {
|
|
2392
2824
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2393
|
-
|
|
2825
|
+
ht(
|
|
2394
2826
|
this.context,
|
|
2395
2827
|
this._watchers,
|
|
2396
|
-
|
|
2828
|
+
{}
|
|
2829
|
+
// Watchers are now handled by the watch() function in functional API
|
|
2397
2830
|
);
|
|
2398
2831
|
});
|
|
2399
2832
|
}
|
|
2400
|
-
_triggerWatchers(r,
|
|
2401
|
-
|
|
2833
|
+
_triggerWatchers(r, n) {
|
|
2834
|
+
gt(this.context, this._watchers, r, n);
|
|
2402
2835
|
}
|
|
2403
2836
|
_applyProps(r) {
|
|
2404
2837
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2405
2838
|
try {
|
|
2406
|
-
|
|
2407
|
-
} catch (
|
|
2408
|
-
this._hasError = !0, r.onError && r.onError(
|
|
2839
|
+
yt(this, r, this.context);
|
|
2840
|
+
} catch (n) {
|
|
2841
|
+
this._hasError = !0, r.onError && r.onError(n, this.context);
|
|
2842
|
+
}
|
|
2843
|
+
});
|
|
2844
|
+
}
|
|
2845
|
+
};
|
|
2846
|
+
}
|
|
2847
|
+
function Ye(e, t) {
|
|
2848
|
+
let r = te(e);
|
|
2849
|
+
r.includes("-") || (r = `cer-${r}`);
|
|
2850
|
+
let n = {};
|
|
2851
|
+
if (typeof window < "u")
|
|
2852
|
+
try {
|
|
2853
|
+
const a = t.toString().match(/\(\s*{\s*([^}]+)\s*}/);
|
|
2854
|
+
if (a) {
|
|
2855
|
+
const m = a[1].split(",").map((g) => g.trim());
|
|
2856
|
+
for (const g of m) {
|
|
2857
|
+
const w = g.indexOf("=");
|
|
2858
|
+
if (w !== -1) {
|
|
2859
|
+
const h = g.substring(0, w).trim(), l = g.substring(w + 1).trim();
|
|
2860
|
+
try {
|
|
2861
|
+
l === "true" ? n[h] = !0 : l === "false" ? n[h] = !1 : l === "[]" ? n[h] = [] : l === "{}" ? n[h] = {} : /^\d+$/.test(l) ? n[h] = parseInt(l) : /^'.*'$/.test(l) || /^".*"$/.test(l) ? n[h] = l.slice(1, -1) : n[h] = l;
|
|
2862
|
+
} catch {
|
|
2863
|
+
n[h] = "";
|
|
2864
|
+
}
|
|
2865
|
+
} else {
|
|
2866
|
+
const h = g.split(":")[0].trim();
|
|
2867
|
+
h && !h.includes("}") && (n[h] = "");
|
|
2868
|
+
}
|
|
2409
2869
|
}
|
|
2870
|
+
}
|
|
2871
|
+
} catch {
|
|
2872
|
+
}
|
|
2873
|
+
let i = {};
|
|
2874
|
+
const s = {
|
|
2875
|
+
// Generate props config from defaults
|
|
2876
|
+
props: Object.fromEntries(
|
|
2877
|
+
Object.entries(n).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
|
|
2878
|
+
),
|
|
2879
|
+
// Add lifecycle hooks from the stored functions
|
|
2880
|
+
onConnected: (o) => {
|
|
2881
|
+
i.onConnected && i.onConnected();
|
|
2882
|
+
},
|
|
2883
|
+
onDisconnected: (o) => {
|
|
2884
|
+
i.onDisconnected && i.onDisconnected();
|
|
2885
|
+
},
|
|
2886
|
+
onAttributeChanged: (o, a, u, m) => {
|
|
2887
|
+
i.onAttributeChanged && i.onAttributeChanged(o, a, u);
|
|
2888
|
+
},
|
|
2889
|
+
onError: (o, a) => {
|
|
2890
|
+
i.onError && o && i.onError(o);
|
|
2891
|
+
},
|
|
2892
|
+
render: (o) => {
|
|
2893
|
+
const a = o._componentId || `${r}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2894
|
+
F.setCurrentComponent(a, () => {
|
|
2895
|
+
o.requestRender && o.requestRender();
|
|
2410
2896
|
});
|
|
2897
|
+
try {
|
|
2898
|
+
Vt(o);
|
|
2899
|
+
const u = Object.keys(n).length > 0;
|
|
2900
|
+
let m;
|
|
2901
|
+
if (u) {
|
|
2902
|
+
const g = {};
|
|
2903
|
+
Object.keys(n).forEach((w) => {
|
|
2904
|
+
g[w] = o[w] ?? n[w];
|
|
2905
|
+
}), m = t(g);
|
|
2906
|
+
} else
|
|
2907
|
+
m = t();
|
|
2908
|
+
if (o._hookCallbacks) {
|
|
2909
|
+
const g = o._hookCallbacks;
|
|
2910
|
+
g.onConnected && (i.onConnected = g.onConnected), g.onDisconnected && (i.onDisconnected = g.onDisconnected), g.onAttributeChanged && (i.onAttributeChanged = g.onAttributeChanged), g.onError && (i.onError = g.onError), g.style && (o._styleCallback = g.style);
|
|
2911
|
+
}
|
|
2912
|
+
return m;
|
|
2913
|
+
} finally {
|
|
2914
|
+
Jt(), F.clearCurrentComponent();
|
|
2915
|
+
}
|
|
2411
2916
|
}
|
|
2412
2917
|
};
|
|
2918
|
+
$e.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(r, Zt(r, s)));
|
|
2919
|
+
}
|
|
2920
|
+
class Gt {
|
|
2921
|
+
map = /* @__PURE__ */ new Map();
|
|
2922
|
+
maxSize;
|
|
2923
|
+
constructor(t) {
|
|
2924
|
+
this.maxSize = t;
|
|
2925
|
+
}
|
|
2926
|
+
get(t) {
|
|
2927
|
+
const r = this.map.get(t);
|
|
2928
|
+
if (r !== void 0)
|
|
2929
|
+
return this.map.delete(t), this.map.set(t, r), r;
|
|
2930
|
+
}
|
|
2931
|
+
set(t, r) {
|
|
2932
|
+
if (this.map.has(t) && this.map.delete(t), this.map.set(t, r), this.map.size > this.maxSize) {
|
|
2933
|
+
const n = this.map.keys().next().value;
|
|
2934
|
+
n !== void 0 && this.map.delete(n);
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
has(t) {
|
|
2938
|
+
return this.map.has(t);
|
|
2939
|
+
}
|
|
2940
|
+
clear() {
|
|
2941
|
+
this.map.clear();
|
|
2942
|
+
}
|
|
2413
2943
|
}
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2944
|
+
const We = new Gt(500);
|
|
2945
|
+
function Xt(e, t) {
|
|
2946
|
+
if (e == null) {
|
|
2947
|
+
console.warn(
|
|
2948
|
+
`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`
|
|
2949
|
+
);
|
|
2950
|
+
return;
|
|
2951
|
+
}
|
|
2952
|
+
typeof e != "function" && console.warn(
|
|
2953
|
+
`🚨 Potential infinite loop detected! Event handler for '@${t}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${t}="\${functionName()}" to @${t}="\${functionName}" to pass the function reference instead of calling it immediately.`
|
|
2954
|
+
), e === void 0 && typeof e != "function" && console.warn(
|
|
2955
|
+
`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`
|
|
2956
|
+
);
|
|
2957
|
+
}
|
|
2958
|
+
function fe(e, t = {}, r, n) {
|
|
2959
|
+
const i = n ?? t.key;
|
|
2960
|
+
return { tag: e, key: i, props: t, children: r };
|
|
2417
2961
|
}
|
|
2418
|
-
function
|
|
2962
|
+
function Se(e) {
|
|
2419
2963
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
2420
2964
|
}
|
|
2421
|
-
function
|
|
2422
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
2965
|
+
function ke(e) {
|
|
2966
|
+
return typeof e == "object" && e !== null && "tag" in e && !Se(e);
|
|
2423
2967
|
}
|
|
2424
|
-
function
|
|
2968
|
+
function Yt(e, t) {
|
|
2425
2969
|
return e.key != null ? e : { ...e, key: t };
|
|
2426
2970
|
}
|
|
2427
|
-
function
|
|
2428
|
-
const
|
|
2429
|
-
let
|
|
2430
|
-
for (;
|
|
2431
|
-
const
|
|
2432
|
-
let l =
|
|
2433
|
-
|
|
2434
|
-
const
|
|
2435
|
-
if (
|
|
2436
|
-
const [v,
|
|
2437
|
-
if (
|
|
2438
|
-
const
|
|
2439
|
-
s[
|
|
2971
|
+
function Qt(e, t = [], r = {}) {
|
|
2972
|
+
const n = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2973
|
+
let u;
|
|
2974
|
+
for (; u = a.exec(e); ) {
|
|
2975
|
+
const m = u[1], g = u[2], w = (u[4] || u[6]) ?? "", h = w.match(/^{{(\d+)}}$/);
|
|
2976
|
+
let l = h ? t[Number(h[1])] ?? null : w;
|
|
2977
|
+
h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
2978
|
+
const d = ["model", "bind", "show", "class", "style", "ref"];
|
|
2979
|
+
if (m === ":") {
|
|
2980
|
+
const [v, b] = g.split(":"), [c, ...p] = v.split(".");
|
|
2981
|
+
if (d.includes(c)) {
|
|
2982
|
+
const y = [...p], C = c === "model" && b ? `model:${b}` : c;
|
|
2983
|
+
s[C] = {
|
|
2440
2984
|
value: l,
|
|
2441
|
-
modifiers:
|
|
2442
|
-
arg:
|
|
2985
|
+
modifiers: y,
|
|
2986
|
+
arg: b
|
|
2443
2987
|
};
|
|
2444
|
-
} else
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
const [v, ...d] = m.split("."), g = d, y = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
2448
|
-
if (y) {
|
|
2449
|
-
const x = (b) => {
|
|
2450
|
-
if (g.includes("prevent") && b.preventDefault(), g.includes("stop") && b.stopPropagation(), !(g.includes("self") && b.target !== b.currentTarget))
|
|
2451
|
-
return g.includes("once") && b.currentTarget?.removeEventListener(v, x), y(b);
|
|
2452
|
-
}, f = "on" + v.charAt(0).toUpperCase() + v.slice(1);
|
|
2453
|
-
i[f] = x;
|
|
2988
|
+
} else {
|
|
2989
|
+
let y = l;
|
|
2990
|
+
y && typeof y == "object" && y.constructor?.name === "ReactiveState" && (y = y.value), i[g] = y, o.push(g);
|
|
2454
2991
|
}
|
|
2455
|
-
} else m === "
|
|
2992
|
+
} else if (m === "@") {
|
|
2993
|
+
const [v, ...b] = g.split("."), c = b;
|
|
2994
|
+
Xt(l, v);
|
|
2995
|
+
const p = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
2996
|
+
if (p) {
|
|
2997
|
+
const y = (k) => {
|
|
2998
|
+
if (c.includes("prevent") && k.preventDefault(), c.includes("stop") && k.stopPropagation(), !(c.includes("self") && k.target !== k.currentTarget))
|
|
2999
|
+
return c.includes("once") && k.currentTarget?.removeEventListener(v, y), p(k);
|
|
3000
|
+
}, C = "on" + v.charAt(0).toUpperCase() + v.slice(1);
|
|
3001
|
+
n[C] = y;
|
|
3002
|
+
}
|
|
3003
|
+
} else g === "ref" ? n.ref = l : i[g] = l;
|
|
2456
3004
|
}
|
|
2457
|
-
return { props:
|
|
3005
|
+
return { props: n, attrs: i, directives: s, bound: o };
|
|
2458
3006
|
}
|
|
2459
|
-
function
|
|
2460
|
-
const
|
|
2461
|
-
|
|
2462
|
-
|
|
3007
|
+
function er(e, t, r) {
|
|
3008
|
+
const n = pe.length > 0 ? pe[pe.length - 1] : void 0, i = r ?? n, s = !r && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
|
|
3009
|
+
if (s && o) {
|
|
3010
|
+
const f = We.get(o);
|
|
3011
|
+
if (f) return f;
|
|
2463
3012
|
}
|
|
2464
|
-
|
|
3013
|
+
function a(f, x) {
|
|
3014
|
+
return fe("#text", {}, f, x);
|
|
3015
|
+
}
|
|
3016
|
+
let u = "";
|
|
2465
3017
|
for (let f = 0; f < e.length; f++)
|
|
2466
|
-
|
|
2467
|
-
const
|
|
2468
|
-
let
|
|
2469
|
-
function
|
|
2470
|
-
!f || typeof f != "object" ||
|
|
2471
|
-
if (
|
|
2472
|
-
const
|
|
3018
|
+
u += e[f], f < t.length && (u += `{{${f}}}`);
|
|
3019
|
+
const m = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
|
|
3020
|
+
let w, h = [], l = null, d = {}, v, b = 0, c = [];
|
|
3021
|
+
function p(f) {
|
|
3022
|
+
!f || typeof f != "object" || Se(f) || (f.props || f.attrs ? (f.props && (d.props || (d.props = {}), Object.assign(d.props, f.props)), f.attrs && (d.attrs || (d.attrs = {}), Object.keys(f.attrs).forEach((x) => {
|
|
3023
|
+
if (x === "style" && d.attrs.style) {
|
|
3024
|
+
const A = d.attrs.style.replace(
|
|
2473
3025
|
/;?\s*$/,
|
|
2474
3026
|
""
|
|
2475
3027
|
), _ = f.attrs.style.replace(/^;?\s*/, "");
|
|
2476
|
-
|
|
2477
|
-
} else if (
|
|
2478
|
-
const
|
|
2479
|
-
.../* @__PURE__ */ new Set([...
|
|
3028
|
+
d.attrs.style = A + "; " + _;
|
|
3029
|
+
} else if (x === "class" && d.attrs.class) {
|
|
3030
|
+
const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), S = [
|
|
3031
|
+
.../* @__PURE__ */ new Set([...A, ..._])
|
|
2480
3032
|
];
|
|
2481
|
-
|
|
3033
|
+
d.attrs.class = S.join(" ");
|
|
2482
3034
|
} else
|
|
2483
|
-
|
|
2484
|
-
}))) : (
|
|
2485
|
-
}
|
|
2486
|
-
function
|
|
2487
|
-
const
|
|
2488
|
-
if (
|
|
2489
|
-
const _ = f.key ??
|
|
2490
|
-
let
|
|
2491
|
-
|
|
3035
|
+
d.attrs[x] = f.attrs[x];
|
|
3036
|
+
}))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
|
|
3037
|
+
}
|
|
3038
|
+
function y(f, x) {
|
|
3039
|
+
const A = l ? h : c;
|
|
3040
|
+
if (Se(f)) {
|
|
3041
|
+
const _ = f.key ?? x;
|
|
3042
|
+
let S = f.children;
|
|
3043
|
+
A.push({
|
|
2492
3044
|
...f,
|
|
2493
3045
|
key: _,
|
|
2494
|
-
children:
|
|
3046
|
+
children: S
|
|
2495
3047
|
});
|
|
2496
3048
|
return;
|
|
2497
3049
|
}
|
|
2498
|
-
if (
|
|
2499
|
-
|
|
3050
|
+
if (ke(f)) {
|
|
3051
|
+
A.push(Yt(f, void 0));
|
|
2500
3052
|
return;
|
|
2501
3053
|
}
|
|
2502
3054
|
if (Array.isArray(f)) {
|
|
2503
3055
|
if (f.length === 0) return;
|
|
2504
3056
|
for (let _ = 0; _ < f.length; _++) {
|
|
2505
|
-
const
|
|
2506
|
-
|
|
3057
|
+
const S = f[_];
|
|
3058
|
+
Se(S) || ke(S) || Array.isArray(S) ? y(S, `${x}-${_}`) : S !== null && typeof S == "object" ? p(S) : A.push(a(String(S), `${x}-${_}`));
|
|
2507
3059
|
}
|
|
2508
3060
|
return;
|
|
2509
3061
|
}
|
|
2510
3062
|
if (f !== null && typeof f == "object") {
|
|
2511
|
-
|
|
3063
|
+
p(f);
|
|
2512
3064
|
return;
|
|
2513
3065
|
}
|
|
2514
|
-
|
|
3066
|
+
A.push(a(String(f), x));
|
|
2515
3067
|
}
|
|
2516
|
-
const
|
|
3068
|
+
const C = /* @__PURE__ */ new Set([
|
|
2517
3069
|
"area",
|
|
2518
3070
|
"base",
|
|
2519
3071
|
"br",
|
|
@@ -2529,24 +3081,24 @@ function Tt(e, t, r) {
|
|
|
2529
3081
|
"track",
|
|
2530
3082
|
"wbr"
|
|
2531
3083
|
]);
|
|
2532
|
-
for (;
|
|
2533
|
-
if (!(
|
|
2534
|
-
if (
|
|
2535
|
-
const f =
|
|
3084
|
+
for (; w = m.exec(u); )
|
|
3085
|
+
if (!(w[0].startsWith("<!--") && w[0].endsWith("-->"))) {
|
|
3086
|
+
if (w[1]) {
|
|
3087
|
+
const f = w[1], x = w[0][1] === "/", A = w[0][w[0].length - 2] === "/" || C.has(f), {
|
|
2536
3088
|
props: _,
|
|
2537
|
-
attrs:
|
|
2538
|
-
directives:
|
|
2539
|
-
bound:
|
|
2540
|
-
} =
|
|
2541
|
-
for (const
|
|
2542
|
-
for (const
|
|
2543
|
-
if (
|
|
3089
|
+
attrs: S,
|
|
3090
|
+
directives: R,
|
|
3091
|
+
bound: T
|
|
3092
|
+
} = Qt(w[2] || "", t, i), $ = { props: {}, attrs: {} };
|
|
3093
|
+
for (const P in _) $.props[P] = _[P];
|
|
3094
|
+
for (const P in S) $.attrs[P] = S[P];
|
|
3095
|
+
if ($.attrs && Object.prototype.hasOwnProperty.call($.attrs, "key") && !($.props && Object.prototype.hasOwnProperty.call($.props, "key")))
|
|
2544
3096
|
try {
|
|
2545
|
-
|
|
3097
|
+
$.props.key = $.attrs.key;
|
|
2546
3098
|
} catch {
|
|
2547
3099
|
}
|
|
2548
3100
|
try {
|
|
2549
|
-
const
|
|
3101
|
+
const P = {
|
|
2550
3102
|
input: ["value", "checked", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2551
3103
|
textarea: ["value", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2552
3104
|
select: ["value", "disabled", "required", "multiple"],
|
|
@@ -2555,370 +3107,671 @@ function Tt(e, t, r) {
|
|
|
2555
3107
|
audio: ["muted", "autoplay", "controls", "loop"],
|
|
2556
3108
|
img: ["src", "alt", "width", "height"],
|
|
2557
3109
|
button: ["type", "name", "value", "disabled", "autofocus", "form"]
|
|
2558
|
-
},
|
|
2559
|
-
if (
|
|
2560
|
-
for (const
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
3110
|
+
}, B = f.toLowerCase(), J = P[B] ?? [];
|
|
3111
|
+
if ($.attrs) {
|
|
3112
|
+
for (const K of J)
|
|
3113
|
+
if (T && T.includes(K) && K in $.attrs && !($.props && K in $.props)) {
|
|
3114
|
+
let L = $.attrs[K];
|
|
3115
|
+
L && typeof L == "object" && L.constructor?.name === "ReactiveState" && (L = L.value), $.props[K] = L, delete $.attrs[K];
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
if ((f.includes("-") || !!i?.__customElements?.has?.(f)) && ($.isCustomElement = !0, T && $.attrs)) {
|
|
3119
|
+
const K = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
|
|
3120
|
+
for (const L of T)
|
|
3121
|
+
if (L in $.attrs && !($.props && L in $.props)) {
|
|
3122
|
+
const j = L.includes("-") ? L.split("-").map((Z, W) => W === 0 ? Z : Z.charAt(0).toUpperCase() + Z.slice(1)).join("") : L;
|
|
3123
|
+
let V = $.attrs[L];
|
|
3124
|
+
V && typeof V == "object" && V.constructor?.name === "ReactiveState" && (V = V.value), $.props[j] = V, K.has(L) || delete $.attrs[L];
|
|
2568
3125
|
}
|
|
2569
|
-
C.isCustomElement = !0;
|
|
2570
3126
|
}
|
|
2571
3127
|
} catch {
|
|
2572
3128
|
}
|
|
2573
|
-
if (
|
|
3129
|
+
if (R && Object.keys(R).some((P) => P === "model" || P.startsWith("model:")))
|
|
2574
3130
|
try {
|
|
2575
|
-
const
|
|
2576
|
-
if (!!(f.includes("-") ||
|
|
2577
|
-
for (const
|
|
2578
|
-
if (
|
|
2579
|
-
const
|
|
2580
|
-
let
|
|
2581
|
-
typeof
|
|
3131
|
+
const P = Symbol.for("cer.registry"), B = globalThis[P], J = !!(B && typeof B.has == "function" && B.has(f)), ye = !!(i && (i.__customElements instanceof Set && i.__customElements.has(f) || Array.isArray(i.__isCustomElements) && i.__isCustomElements.includes(f)));
|
|
3132
|
+
if (!!(f.includes("-") || ye || J))
|
|
3133
|
+
for (const j of Object.keys(R)) {
|
|
3134
|
+
if (j !== "model" && !j.startsWith("model:")) continue;
|
|
3135
|
+
const V = R[j], Z = V.arg ?? (j.includes(":") ? j.split(":", 2)[1] : void 0), W = V.value, E = Z ?? "modelValue", U = H, D = Ce, z = i ? i._state || i : void 0;
|
|
3136
|
+
let O;
|
|
3137
|
+
typeof W == "string" && i ? O = U(z, W) : (O = W, O && typeof O == "object" && O.constructor?.name === "ReactiveState" && (O = O.value)), $.props[E] = O;
|
|
2582
3138
|
try {
|
|
2583
|
-
const
|
|
2584
|
-
|
|
3139
|
+
const re = te(E);
|
|
3140
|
+
$.attrs || ($.attrs = {}), O !== void 0 && ($.attrs[re] = O);
|
|
2585
3141
|
} catch {
|
|
2586
3142
|
}
|
|
2587
|
-
|
|
2588
|
-
const
|
|
2589
|
-
|
|
2590
|
-
const
|
|
2591
|
-
if (
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
3143
|
+
$.isCustomElement = !0;
|
|
3144
|
+
const Be = `update:${te(E)}`.replace(/-([a-z])/g, (re, Y) => Y.toUpperCase()), ct = "on" + Be.charAt(0).toUpperCase() + Be.slice(1);
|
|
3145
|
+
$.props[ct] = function(re) {
|
|
3146
|
+
const Y = re.detail !== void 0 ? re.detail : re.target ? re.target.value : void 0;
|
|
3147
|
+
if (z)
|
|
3148
|
+
if (W && typeof W == "object" && W.constructor?.name === "ReactiveState") {
|
|
3149
|
+
const oe = W.value;
|
|
3150
|
+
(Array.isArray(Y) && Array.isArray(oe) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...oe].sort()) : Y !== oe) && (W.value = Y, i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
|
|
3151
|
+
} else {
|
|
3152
|
+
const oe = U(z, typeof W == "string" ? W : String(W));
|
|
3153
|
+
(Array.isArray(Y) && Array.isArray(oe) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...oe].sort()) : Y !== oe) && (D(z, typeof W == "string" ? W : String(W), Y), i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
|
|
3154
|
+
}
|
|
3155
|
+
}, delete R[j];
|
|
2595
3156
|
}
|
|
2596
3157
|
} catch {
|
|
2597
3158
|
}
|
|
2598
|
-
if (Object.keys(
|
|
2599
|
-
const
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
),
|
|
2605
|
-
|
|
2606
|
-
} else
|
|
2607
|
-
tag:
|
|
2608
|
-
props:
|
|
2609
|
-
children:
|
|
2610
|
-
key:
|
|
2611
|
-
}),
|
|
2612
|
-
} else if (typeof
|
|
2613
|
-
const f = Number(
|
|
2614
|
-
|
|
2615
|
-
} else if (
|
|
2616
|
-
const f =
|
|
2617
|
-
for (const _ of
|
|
3159
|
+
if (Object.keys(R).length > 0 && ($.directives = { ...R }), x) {
|
|
3160
|
+
const P = fe(
|
|
3161
|
+
l,
|
|
3162
|
+
d,
|
|
3163
|
+
h.length === 1 && ke(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
|
|
3164
|
+
v
|
|
3165
|
+
), B = g.pop();
|
|
3166
|
+
B ? (l = B.tag, d = B.props, v = B.key, h = B.children, h.push(P)) : (c.push(P), l = null, d = {}, v = void 0, h = []);
|
|
3167
|
+
} else A ? l ? h.push(fe(f, $, void 0, void 0)) : c.push(fe(f, $, void 0, void 0)) : (l && g.push({
|
|
3168
|
+
tag: l,
|
|
3169
|
+
props: d,
|
|
3170
|
+
children: h,
|
|
3171
|
+
key: v
|
|
3172
|
+
}), l = f, d = $, h = []);
|
|
3173
|
+
} else if (typeof w[3] < "u") {
|
|
3174
|
+
const f = Number(w[3]), x = t[f], A = `interp-${f}`;
|
|
3175
|
+
y(x, A);
|
|
3176
|
+
} else if (w[4]) {
|
|
3177
|
+
const f = w[4], x = l ? h : c, A = f.split(/({{\d+}})/);
|
|
3178
|
+
for (const _ of A) {
|
|
2618
3179
|
if (!_) continue;
|
|
2619
|
-
const
|
|
2620
|
-
if (
|
|
2621
|
-
const
|
|
2622
|
-
|
|
3180
|
+
const S = _.match(/^{{(\d+)}}$/);
|
|
3181
|
+
if (S) {
|
|
3182
|
+
const R = Number(S[1]), T = t[R], $ = `interp-${R}`;
|
|
3183
|
+
y(T, $);
|
|
2623
3184
|
} else {
|
|
2624
|
-
const
|
|
2625
|
-
|
|
3185
|
+
const R = `text-${b++}`;
|
|
3186
|
+
x.push(a(_, R));
|
|
2626
3187
|
}
|
|
2627
3188
|
}
|
|
2628
3189
|
}
|
|
2629
3190
|
}
|
|
2630
|
-
const
|
|
2631
|
-
|
|
3191
|
+
const k = c.filter((f) => ke(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
|
|
3192
|
+
if (k.length === 1) {
|
|
3193
|
+
const f = k[0];
|
|
3194
|
+
return s && o && We.set(o, f), f;
|
|
3195
|
+
} else if (k.length > 1) {
|
|
3196
|
+
const f = k;
|
|
3197
|
+
return s && o && We.set(o, f), f;
|
|
3198
|
+
}
|
|
3199
|
+
return fe("div", {}, "", "fallback-root");
|
|
3200
|
+
}
|
|
3201
|
+
function ae(e, ...t) {
|
|
3202
|
+
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
3203
|
+
return er(e, t, n);
|
|
3204
|
+
}
|
|
3205
|
+
function Ae(e, t) {
|
|
3206
|
+
return M(e ? t : [], "when-block");
|
|
3207
|
+
}
|
|
3208
|
+
function gr(e, t) {
|
|
3209
|
+
return e.map((r, n) => {
|
|
3210
|
+
const i = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
|
|
3211
|
+
return M(t(r, n), `each-${i}`);
|
|
3212
|
+
});
|
|
3213
|
+
}
|
|
3214
|
+
function tr() {
|
|
3215
|
+
const e = [];
|
|
3216
|
+
return {
|
|
3217
|
+
when(t, r) {
|
|
3218
|
+
return e.push([t, r]), this;
|
|
3219
|
+
},
|
|
3220
|
+
otherwise(t) {
|
|
3221
|
+
return e.push([!0, t]), this;
|
|
3222
|
+
},
|
|
3223
|
+
done() {
|
|
3224
|
+
return rr(...e);
|
|
3225
|
+
}
|
|
3226
|
+
};
|
|
3227
|
+
}
|
|
3228
|
+
function rr(...e) {
|
|
3229
|
+
for (let t = 0; t < e.length; t++) {
|
|
3230
|
+
const [r, n] = e[t];
|
|
3231
|
+
if (r) return [M(n, `whenChain-branch-${t}`)];
|
|
3232
|
+
}
|
|
3233
|
+
return [M([], "whenChain-empty")];
|
|
3234
|
+
}
|
|
3235
|
+
function M(e, t) {
|
|
3236
|
+
const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
3237
|
+
return {
|
|
3238
|
+
tag: "#anchor",
|
|
3239
|
+
key: t,
|
|
3240
|
+
children: r
|
|
3241
|
+
};
|
|
3242
|
+
}
|
|
3243
|
+
function mr(e, t) {
|
|
3244
|
+
return Ae(!e, t);
|
|
3245
|
+
}
|
|
3246
|
+
function yr(e, t) {
|
|
3247
|
+
const r = !e || e.length === 0;
|
|
3248
|
+
return Ae(r, t);
|
|
3249
|
+
}
|
|
3250
|
+
function br(e, t) {
|
|
3251
|
+
const r = !!(e && e.length > 0);
|
|
3252
|
+
return Ae(r, t);
|
|
3253
|
+
}
|
|
3254
|
+
function wr(e, t, r) {
|
|
3255
|
+
const n = [];
|
|
3256
|
+
return e.forEach((i, s) => {
|
|
3257
|
+
t(i, s) && n.push({ item: i, originalIndex: s });
|
|
3258
|
+
}), n.map(({ item: i, originalIndex: s }, o) => {
|
|
3259
|
+
const a = typeof i == "object" && i != null ? i?.key ?? i?.id ?? `filtered-${s}` : `filtered-${s}`;
|
|
3260
|
+
return M(r(i, s, o), `each-where-${a}`);
|
|
3261
|
+
});
|
|
3262
|
+
}
|
|
3263
|
+
function vr(e, t) {
|
|
3264
|
+
const r = e?.length ?? 0;
|
|
3265
|
+
return r === 0 && t.empty ? M(t.empty, "switch-length-empty") : r === 1 && t.one ? M(t.one(e[0]), "switch-length-one") : t.exactly?.[r] ? M(t.exactly[r](e), `switch-length-${r}`) : r > 1 && t.many ? M(t.many(e), "switch-length-many") : M([], "switch-length-fallback");
|
|
3266
|
+
}
|
|
3267
|
+
function xr(e, t, r) {
|
|
3268
|
+
const n = /* @__PURE__ */ new Map();
|
|
3269
|
+
return e.forEach((i) => {
|
|
3270
|
+
const s = t(i);
|
|
3271
|
+
n.has(s) || n.set(s, []), n.get(s).push(i);
|
|
3272
|
+
}), Array.from(n.entries()).map(([i, s], o) => M(
|
|
3273
|
+
r(i, s, o),
|
|
3274
|
+
`each-group-${i}`
|
|
3275
|
+
));
|
|
3276
|
+
}
|
|
3277
|
+
function kr(e, t, r, n) {
|
|
3278
|
+
const i = r * t, s = Math.min(i + t, e.length);
|
|
3279
|
+
return e.slice(i, s).map((a, u) => {
|
|
3280
|
+
const m = i + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${m}` : `page-${m}`;
|
|
3281
|
+
return M(n(a, m, u), `each-page-${g}`);
|
|
3282
|
+
});
|
|
3283
|
+
}
|
|
3284
|
+
function Cr(e, t) {
|
|
3285
|
+
return e.loading && t.loading ? M(t.loading, "promise-loading") : e.error && t.error ? M(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? M(t.success(e.data), "promise-success") : t.idle ? M(t.idle, "promise-idle") : M([], "promise-fallback");
|
|
3286
|
+
}
|
|
3287
|
+
function q(e, t) {
|
|
3288
|
+
const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
|
|
3289
|
+
return Ae(!!r, t);
|
|
3290
|
+
}
|
|
3291
|
+
const ee = {
|
|
3292
|
+
// Responsive breakpoints (matching style.ts)
|
|
3293
|
+
sm: "(min-width:640px)",
|
|
3294
|
+
md: "(min-width:768px)",
|
|
3295
|
+
lg: "(min-width:1024px)",
|
|
3296
|
+
xl: "(min-width:1280px)",
|
|
3297
|
+
"2xl": "(min-width:1536px)",
|
|
3298
|
+
// Dark mode (matching style.ts)
|
|
3299
|
+
dark: "(prefers-color-scheme: dark)"
|
|
3300
|
+
}, at = ["sm", "md", "lg", "xl", "2xl"], nr = {
|
|
3301
|
+
// Breakpoint-based rendering (matching style.ts exactly)
|
|
3302
|
+
sm: (e) => q(ee.sm, e),
|
|
3303
|
+
md: (e) => q(ee.md, e),
|
|
3304
|
+
lg: (e) => q(ee.lg, e),
|
|
3305
|
+
xl: (e) => q(ee.xl, e),
|
|
3306
|
+
"2xl": (e) => q(ee["2xl"], e),
|
|
3307
|
+
// Dark mode (matching style.ts)
|
|
3308
|
+
dark: (e) => q(ee.dark, e),
|
|
3309
|
+
light: (e) => q("(prefers-color-scheme: light)", e),
|
|
3310
|
+
// Accessibility and interaction preferences
|
|
3311
|
+
touch: (e) => q("(hover: none) and (pointer: coarse)", e),
|
|
3312
|
+
mouse: (e) => q("(hover: hover) and (pointer: fine)", e),
|
|
3313
|
+
reducedMotion: (e) => q("(prefers-reduced-motion: reduce)", e),
|
|
3314
|
+
highContrast: (e) => q("(prefers-contrast: high)", e),
|
|
3315
|
+
// Orientation
|
|
3316
|
+
portrait: (e) => q("(orientation: portrait)", e),
|
|
3317
|
+
landscape: (e) => q("(orientation: landscape)", e)
|
|
3318
|
+
};
|
|
3319
|
+
function _r(e, t) {
|
|
3320
|
+
const r = [];
|
|
3321
|
+
e.includes("dark") ? r.push(ee.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
|
|
3322
|
+
const n = e.filter(
|
|
3323
|
+
(o) => at.includes(o)
|
|
3324
|
+
), i = n[n.length - 1];
|
|
3325
|
+
i && i in ee && r.push(ee[i]);
|
|
3326
|
+
const s = r.length > 0 ? r.join(" and ") : "all";
|
|
3327
|
+
return q(s, t);
|
|
3328
|
+
}
|
|
3329
|
+
function Er(e) {
|
|
3330
|
+
const t = [];
|
|
3331
|
+
return e.base && t.push(M(e.base, "responsive-base")), at.forEach((r) => {
|
|
3332
|
+
const n = e[r];
|
|
3333
|
+
n && t.push(nr[r](n));
|
|
3334
|
+
}), t;
|
|
3335
|
+
}
|
|
3336
|
+
function Sr(e) {
|
|
3337
|
+
const t = [];
|
|
3338
|
+
let r = null;
|
|
3339
|
+
return {
|
|
3340
|
+
case(n, i) {
|
|
3341
|
+
const s = typeof n == "function" ? n : (o) => o === n;
|
|
3342
|
+
return t.push({ condition: s, content: i }), this;
|
|
3343
|
+
},
|
|
3344
|
+
when(n, i) {
|
|
3345
|
+
return t.push({ condition: n, content: i }), this;
|
|
3346
|
+
},
|
|
3347
|
+
otherwise(n) {
|
|
3348
|
+
return r = n, this;
|
|
3349
|
+
},
|
|
3350
|
+
done() {
|
|
3351
|
+
for (let n = 0; n < t.length; n++) {
|
|
3352
|
+
const { condition: i, content: s } = t[n];
|
|
3353
|
+
if (i(e))
|
|
3354
|
+
return M(s, `switch-case-${n}`);
|
|
3355
|
+
}
|
|
3356
|
+
return M(r || [], "switch-otherwise");
|
|
3357
|
+
}
|
|
3358
|
+
};
|
|
3359
|
+
}
|
|
3360
|
+
class ue extends EventTarget {
|
|
3361
|
+
handlers = {};
|
|
3362
|
+
static instance;
|
|
3363
|
+
eventCounters = /* @__PURE__ */ new Map();
|
|
3364
|
+
/**
|
|
3365
|
+
* Returns the singleton instance of GlobalEventBus
|
|
3366
|
+
*/
|
|
3367
|
+
static getInstance() {
|
|
3368
|
+
return ue.instance || (ue.instance = new ue()), ue.instance;
|
|
3369
|
+
}
|
|
3370
|
+
/**
|
|
3371
|
+
* Emit a global event with optional data. Includes event storm protection.
|
|
3372
|
+
* @param eventName - Name of the event
|
|
3373
|
+
* @param data - Optional event payload
|
|
3374
|
+
*/
|
|
3375
|
+
emit(t, r) {
|
|
3376
|
+
const n = Date.now(), i = this.eventCounters.get(t);
|
|
3377
|
+
if (!i || n - i.window > 1e3)
|
|
3378
|
+
this.eventCounters.set(t, { count: 1, window: n });
|
|
3379
|
+
else if (i.count++, i.count > 50 && i.count > 100)
|
|
3380
|
+
return;
|
|
3381
|
+
this.dispatchEvent(new CustomEvent(t, {
|
|
3382
|
+
detail: r,
|
|
3383
|
+
bubbles: !1,
|
|
3384
|
+
// Global events don't need to bubble
|
|
3385
|
+
cancelable: !0
|
|
3386
|
+
}));
|
|
3387
|
+
const s = this.handlers[t];
|
|
3388
|
+
s && s.forEach((o) => {
|
|
3389
|
+
try {
|
|
3390
|
+
o(r);
|
|
3391
|
+
} catch (a) {
|
|
3392
|
+
ie(`Error in global event handler for "${t}":`, a);
|
|
3393
|
+
}
|
|
3394
|
+
});
|
|
3395
|
+
}
|
|
3396
|
+
/**
|
|
3397
|
+
* Register a handler for a global event. Returns an unsubscribe function.
|
|
3398
|
+
* @param eventName - Name of the event
|
|
3399
|
+
* @param handler - Handler function
|
|
3400
|
+
*/
|
|
3401
|
+
on(t, r) {
|
|
3402
|
+
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(r), () => this.off(t, r);
|
|
3403
|
+
}
|
|
3404
|
+
/**
|
|
3405
|
+
* Remove a specific handler for a global event.
|
|
3406
|
+
* @param eventName - Name of the event
|
|
3407
|
+
* @param handler - Handler function to remove
|
|
3408
|
+
*/
|
|
3409
|
+
off(t, r) {
|
|
3410
|
+
const n = this.handlers[t];
|
|
3411
|
+
n && n.delete(r);
|
|
3412
|
+
}
|
|
3413
|
+
/**
|
|
3414
|
+
* Remove all handlers for a specific event.
|
|
3415
|
+
* @param eventName - Name of the event
|
|
3416
|
+
*/
|
|
3417
|
+
offAll(t) {
|
|
3418
|
+
delete this.handlers[t];
|
|
3419
|
+
}
|
|
3420
|
+
/**
|
|
3421
|
+
* Listen for a native CustomEvent. Returns an unsubscribe function.
|
|
3422
|
+
* @param eventName - Name of the event
|
|
3423
|
+
* @param handler - CustomEvent handler
|
|
3424
|
+
* @param options - AddEventListener options
|
|
3425
|
+
*/
|
|
3426
|
+
listen(t, r, n) {
|
|
3427
|
+
return this.addEventListener(t, r, n), () => this.removeEventListener(t, r);
|
|
3428
|
+
}
|
|
3429
|
+
/**
|
|
3430
|
+
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
3431
|
+
* @param eventName - Name of the event
|
|
3432
|
+
* @param handler - Handler function
|
|
3433
|
+
*/
|
|
3434
|
+
once(t, r) {
|
|
3435
|
+
return new Promise((n) => {
|
|
3436
|
+
const i = this.on(t, (s) => {
|
|
3437
|
+
i(), r(s), n(s);
|
|
3438
|
+
});
|
|
3439
|
+
});
|
|
3440
|
+
}
|
|
3441
|
+
/**
|
|
3442
|
+
* Get a list of all active event names with registered handlers.
|
|
3443
|
+
*/
|
|
3444
|
+
getActiveEvents() {
|
|
3445
|
+
return Object.keys(this.handlers).filter(
|
|
3446
|
+
(t) => this.handlers[t] && this.handlers[t].size > 0
|
|
3447
|
+
);
|
|
3448
|
+
}
|
|
3449
|
+
/**
|
|
3450
|
+
* Clear all event handlers (useful for testing or cleanup).
|
|
3451
|
+
*/
|
|
3452
|
+
clear() {
|
|
3453
|
+
this.handlers = {};
|
|
3454
|
+
}
|
|
3455
|
+
/**
|
|
3456
|
+
* Get the number of handlers registered for a specific event.
|
|
3457
|
+
* @param eventName - Name of the event
|
|
3458
|
+
*/
|
|
3459
|
+
getHandlerCount(t) {
|
|
3460
|
+
return this.handlers[t]?.size || 0;
|
|
3461
|
+
}
|
|
3462
|
+
/**
|
|
3463
|
+
* Get event statistics for debugging.
|
|
3464
|
+
*/
|
|
3465
|
+
getEventStats() {
|
|
3466
|
+
const t = {};
|
|
3467
|
+
for (const [r, n] of this.eventCounters.entries())
|
|
3468
|
+
t[r] = {
|
|
3469
|
+
count: n.count,
|
|
3470
|
+
handlersCount: this.getHandlerCount(r)
|
|
3471
|
+
};
|
|
3472
|
+
return t;
|
|
3473
|
+
}
|
|
3474
|
+
/**
|
|
3475
|
+
* Reset event counters (useful for testing or after resolving issues).
|
|
3476
|
+
*/
|
|
3477
|
+
resetEventCounters() {
|
|
3478
|
+
this.eventCounters.clear();
|
|
3479
|
+
}
|
|
2632
3480
|
}
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
3481
|
+
const me = ue.getInstance(), $r = (e, t) => me.emit(e, t), Ar = (e, t) => me.on(e, t), Rr = (e, t) => me.off(e, t), Tr = (e, t) => me.once(e, t), Or = (e, t, r) => me.listen(e, t, r);
|
|
3482
|
+
function Qe(e) {
|
|
3483
|
+
let t = { ...e };
|
|
3484
|
+
const r = [];
|
|
3485
|
+
function n(a) {
|
|
3486
|
+
r.push(a), a(t);
|
|
3487
|
+
}
|
|
3488
|
+
function i() {
|
|
3489
|
+
return t;
|
|
3490
|
+
}
|
|
3491
|
+
function s(a) {
|
|
3492
|
+
const u = typeof a == "function" ? a(t) : a;
|
|
3493
|
+
t = { ...t, ...u }, o();
|
|
3494
|
+
}
|
|
3495
|
+
function o() {
|
|
3496
|
+
r.forEach((a) => a(t));
|
|
3497
|
+
}
|
|
3498
|
+
return { subscribe: n, getState: i, setState: s };
|
|
2636
3499
|
}
|
|
2637
|
-
const
|
|
3500
|
+
const et = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
|
|
2638
3501
|
for (const r of e) {
|
|
2639
|
-
const
|
|
3502
|
+
const n = [], i = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
|
|
2640
3503
|
if (o) {
|
|
2641
3504
|
const a = {};
|
|
2642
|
-
return
|
|
2643
|
-
a[
|
|
3505
|
+
return n.forEach((u, m) => {
|
|
3506
|
+
a[u] = o[m + 1];
|
|
2644
3507
|
}), { route: r, params: a };
|
|
2645
3508
|
}
|
|
2646
3509
|
}
|
|
2647
3510
|
return { route: null, params: {} };
|
|
2648
|
-
},
|
|
2649
|
-
async function
|
|
3511
|
+
}, ze = {};
|
|
3512
|
+
async function ir(e) {
|
|
2650
3513
|
if (e.component) return e.component;
|
|
2651
3514
|
if (e.load) {
|
|
2652
|
-
if (
|
|
3515
|
+
if (ze[e.path]) return ze[e.path];
|
|
2653
3516
|
try {
|
|
2654
3517
|
const t = await e.load();
|
|
2655
|
-
return
|
|
3518
|
+
return ze[e.path] = t.default, t.default;
|
|
2656
3519
|
} catch {
|
|
2657
3520
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2658
3521
|
}
|
|
2659
3522
|
}
|
|
2660
3523
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2661
3524
|
}
|
|
2662
|
-
function
|
|
2663
|
-
const { routes: t, base: r = "", initialUrl:
|
|
2664
|
-
let
|
|
2665
|
-
const
|
|
2666
|
-
const
|
|
2667
|
-
if (
|
|
3525
|
+
function sr(e) {
|
|
3526
|
+
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
3527
|
+
let i, s, o, a, u, m, g;
|
|
3528
|
+
const w = async (v, b) => {
|
|
3529
|
+
const c = t.find((p) => Q([p], v.path).route !== null);
|
|
3530
|
+
if (c?.beforeEnter)
|
|
2668
3531
|
try {
|
|
2669
|
-
const
|
|
2670
|
-
return typeof
|
|
2671
|
-
} catch (
|
|
2672
|
-
return
|
|
3532
|
+
const p = await c.beforeEnter(v, b);
|
|
3533
|
+
return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
|
|
3534
|
+
} catch (p) {
|
|
3535
|
+
return ie("beforeEnter error", p), !1;
|
|
2673
3536
|
}
|
|
2674
3537
|
return !0;
|
|
2675
|
-
},
|
|
2676
|
-
const
|
|
2677
|
-
if (
|
|
3538
|
+
}, h = async (v, b) => {
|
|
3539
|
+
const c = t.find((p) => Q([p], v.path).route !== null);
|
|
3540
|
+
if (c?.onEnter)
|
|
2678
3541
|
try {
|
|
2679
|
-
const
|
|
2680
|
-
return typeof
|
|
2681
|
-
} catch (
|
|
2682
|
-
return
|
|
3542
|
+
const p = await c.onEnter(v, b);
|
|
3543
|
+
return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
|
|
3544
|
+
} catch (p) {
|
|
3545
|
+
return ie("onEnter error", p), !1;
|
|
2683
3546
|
}
|
|
2684
3547
|
return !0;
|
|
2685
|
-
}, l = (v,
|
|
2686
|
-
const
|
|
2687
|
-
if (
|
|
3548
|
+
}, l = (v, b) => {
|
|
3549
|
+
const c = t.find((p) => Q([p], v.path).route !== null);
|
|
3550
|
+
if (c?.afterEnter)
|
|
2688
3551
|
try {
|
|
2689
|
-
|
|
2690
|
-
} catch (
|
|
2691
|
-
|
|
3552
|
+
c.afterEnter(v, b);
|
|
3553
|
+
} catch (p) {
|
|
3554
|
+
ie("afterEnter error", p);
|
|
2692
3555
|
}
|
|
2693
|
-
},
|
|
3556
|
+
}, d = async (v, b = !1) => {
|
|
2694
3557
|
try {
|
|
2695
|
-
const
|
|
3558
|
+
const c = {
|
|
2696
3559
|
path: v.replace(r, "") || "/",
|
|
2697
3560
|
query: {}
|
|
2698
|
-
},
|
|
2699
|
-
if (!
|
|
2700
|
-
const
|
|
2701
|
-
path:
|
|
2702
|
-
params:
|
|
2703
|
-
query:
|
|
3561
|
+
}, p = Q(t, c.path);
|
|
3562
|
+
if (!p) throw new Error(`No route found for ${c.path}`);
|
|
3563
|
+
const y = o.getState(), C = {
|
|
3564
|
+
path: c.path,
|
|
3565
|
+
params: p.params,
|
|
3566
|
+
query: c.query
|
|
2704
3567
|
};
|
|
2705
|
-
if (!await
|
|
2706
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2707
|
-
} catch (
|
|
2708
|
-
|
|
3568
|
+
if (!await w(C, y) || !await h(C, y)) return;
|
|
3569
|
+
typeof window < "u" && typeof document < "u" && (b ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), o.setState(C), l(C, y);
|
|
3570
|
+
} catch (c) {
|
|
3571
|
+
ie("Navigation error:", c);
|
|
2709
3572
|
}
|
|
2710
3573
|
};
|
|
2711
|
-
if (typeof window < "u" && typeof document < "u") {
|
|
2712
|
-
|
|
2713
|
-
const
|
|
2714
|
-
return { path:
|
|
2715
|
-
}, s =
|
|
2716
|
-
const v =
|
|
2717
|
-
o =
|
|
3574
|
+
if (typeof window < "u" && typeof document < "u" && typeof n > "u") {
|
|
3575
|
+
i = () => {
|
|
3576
|
+
const b = new URL(window.location.href), c = b.pathname.replace(r, "") || "/", p = et(b.search);
|
|
3577
|
+
return { path: c, query: p };
|
|
3578
|
+
}, s = i();
|
|
3579
|
+
const v = Q(t, s.path);
|
|
3580
|
+
o = Qe({
|
|
2718
3581
|
path: s.path,
|
|
2719
3582
|
params: v.params,
|
|
2720
3583
|
query: s.query
|
|
2721
|
-
}), a = async (
|
|
2722
|
-
const
|
|
2723
|
-
await
|
|
2724
|
-
}, window.addEventListener("popstate", () => a(!0)),
|
|
3584
|
+
}), a = async (b = !1) => {
|
|
3585
|
+
const c = i();
|
|
3586
|
+
await d(c.path, b);
|
|
3587
|
+
}, window.addEventListener("popstate", () => a(!0)), u = (b) => d(b, !1), m = (b) => d(b, !0), g = () => window.history.back();
|
|
2725
3588
|
} else {
|
|
2726
|
-
|
|
2727
|
-
const
|
|
2728
|
-
return { path:
|
|
2729
|
-
}, s =
|
|
2730
|
-
const v =
|
|
2731
|
-
o =
|
|
3589
|
+
i = () => {
|
|
3590
|
+
const c = new URL(n || "/", "http://localhost"), p = c.pathname.replace(r, "") || "/", y = et(c.search);
|
|
3591
|
+
return { path: p, query: y };
|
|
3592
|
+
}, s = i();
|
|
3593
|
+
const v = Q(t, s.path);
|
|
3594
|
+
o = Qe({
|
|
2732
3595
|
path: s.path,
|
|
2733
3596
|
params: v.params,
|
|
2734
3597
|
query: s.query
|
|
2735
3598
|
}), a = async () => {
|
|
2736
|
-
const
|
|
2737
|
-
await
|
|
3599
|
+
const c = i();
|
|
3600
|
+
await b(c.path);
|
|
2738
3601
|
};
|
|
2739
|
-
const
|
|
3602
|
+
const b = async (c) => {
|
|
2740
3603
|
try {
|
|
2741
|
-
const
|
|
2742
|
-
path:
|
|
3604
|
+
const p = {
|
|
3605
|
+
path: c.replace(r, "") || "/",
|
|
2743
3606
|
query: {}
|
|
2744
|
-
},
|
|
2745
|
-
if (!
|
|
2746
|
-
const
|
|
2747
|
-
path:
|
|
2748
|
-
params:
|
|
2749
|
-
query:
|
|
2750
|
-
},
|
|
2751
|
-
if (
|
|
3607
|
+
}, y = Q(t, p.path);
|
|
3608
|
+
if (!y) throw new Error(`No route found for ${p.path}`);
|
|
3609
|
+
const C = o.getState(), k = {
|
|
3610
|
+
path: p.path,
|
|
3611
|
+
params: y.params,
|
|
3612
|
+
query: p.query
|
|
3613
|
+
}, f = t.find((x) => Q([x], k.path).route !== null);
|
|
3614
|
+
if (f?.beforeEnter)
|
|
2752
3615
|
try {
|
|
2753
|
-
const
|
|
2754
|
-
if (typeof
|
|
2755
|
-
await
|
|
3616
|
+
const x = await f.beforeEnter(k, C);
|
|
3617
|
+
if (typeof x == "string") {
|
|
3618
|
+
await b(x);
|
|
2756
3619
|
return;
|
|
2757
3620
|
}
|
|
2758
|
-
if (
|
|
3621
|
+
if (x === !1) return;
|
|
2759
3622
|
} catch {
|
|
2760
3623
|
return;
|
|
2761
3624
|
}
|
|
2762
|
-
if (
|
|
3625
|
+
if (f?.onEnter)
|
|
2763
3626
|
try {
|
|
2764
|
-
const
|
|
2765
|
-
if (typeof
|
|
2766
|
-
await
|
|
3627
|
+
const x = await f.onEnter(k, C);
|
|
3628
|
+
if (typeof x == "string") {
|
|
3629
|
+
await b(x);
|
|
2767
3630
|
return;
|
|
2768
3631
|
}
|
|
2769
|
-
if (
|
|
3632
|
+
if (x === !1) return;
|
|
2770
3633
|
} catch {
|
|
2771
3634
|
return;
|
|
2772
3635
|
}
|
|
2773
|
-
if (o.setState(
|
|
3636
|
+
if (o.setState(k), f?.afterEnter)
|
|
2774
3637
|
try {
|
|
2775
|
-
|
|
3638
|
+
f.afterEnter(k, C);
|
|
2776
3639
|
} catch {
|
|
2777
3640
|
}
|
|
2778
3641
|
} catch {
|
|
2779
3642
|
}
|
|
2780
3643
|
};
|
|
2781
|
-
|
|
3644
|
+
u = async (c) => b(c), m = async (c) => b(c), g = () => {
|
|
2782
3645
|
};
|
|
2783
3646
|
}
|
|
2784
3647
|
return {
|
|
2785
3648
|
store: o,
|
|
2786
|
-
push:
|
|
2787
|
-
replace:
|
|
2788
|
-
back:
|
|
3649
|
+
push: u,
|
|
3650
|
+
replace: m,
|
|
3651
|
+
back: g,
|
|
2789
3652
|
subscribe: o.subscribe,
|
|
2790
|
-
matchRoute: (v) =>
|
|
3653
|
+
matchRoute: (v) => Q(t, v),
|
|
2791
3654
|
getCurrent: () => o.getState(),
|
|
2792
|
-
resolveRouteComponent:
|
|
3655
|
+
resolveRouteComponent: ir
|
|
2793
3656
|
};
|
|
2794
3657
|
}
|
|
2795
|
-
function
|
|
2796
|
-
return
|
|
2797
|
-
}
|
|
2798
|
-
function
|
|
2799
|
-
const t =
|
|
2800
|
-
return
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
const r = t.getCurrent(), { path: i } = r, n = t.matchRoute(i);
|
|
2804
|
-
if (!n.route) return ee`<div>Not found</div>`;
|
|
2805
|
-
try {
|
|
2806
|
-
const s = await t.resolveRouteComponent(n.route);
|
|
2807
|
-
if (typeof s == "string")
|
|
2808
|
-
return { tag: s, props: {}, children: [] };
|
|
2809
|
-
if (typeof s == "function") {
|
|
2810
|
-
const o = s(), a = o instanceof Promise ? await o : o;
|
|
2811
|
-
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2812
|
-
}
|
|
2813
|
-
return ee`<div>Invalid route component</div>`;
|
|
2814
|
-
} catch {
|
|
2815
|
-
return ee`<div>Invalid route component</div>`;
|
|
2816
|
-
}
|
|
2817
|
-
},
|
|
2818
|
-
onConnected(r) {
|
|
3658
|
+
function Pr(e, t) {
|
|
3659
|
+
return Q(e, t);
|
|
3660
|
+
}
|
|
3661
|
+
function Lr(e) {
|
|
3662
|
+
const t = sr(e);
|
|
3663
|
+
return Ye("router-view", (r = {}, n = {}) => {
|
|
3664
|
+
const { onConnected: i } = n;
|
|
3665
|
+
if (i && i(() => {
|
|
2819
3666
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
2820
|
-
typeof r.requestRender == "function" && r.requestRender();
|
|
2821
3667
|
});
|
|
2822
|
-
}
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
<button
|
|
2856
|
-
part="button"
|
|
2857
|
-
:class="${g}"
|
|
2858
|
-
${w}
|
|
2859
|
-
${x}
|
|
2860
|
-
${f}
|
|
2861
|
-
@click="navigate"
|
|
2862
|
-
><slot></slot></button>
|
|
2863
|
-
`).otherwise(ee`
|
|
2864
|
-
<a
|
|
2865
|
-
part="link"
|
|
2866
|
-
href="${n}"
|
|
2867
|
-
:class="${g}"
|
|
2868
|
-
${w}
|
|
2869
|
-
${x}
|
|
2870
|
-
${f}
|
|
2871
|
-
@click="navigate"
|
|
2872
|
-
><slot></slot></a>
|
|
2873
|
-
`).done()}
|
|
2874
|
-
`;
|
|
2875
|
-
},
|
|
2876
|
-
navigate: (r, i) => {
|
|
2877
|
-
if (i.disabled) {
|
|
2878
|
-
r.preventDefault();
|
|
3668
|
+
}), !t) return ae`<div>Router not initialized.</div>`;
|
|
3669
|
+
const s = t.getCurrent(), { path: o } = s, a = t.matchRoute(o);
|
|
3670
|
+
return a.route ? t.resolveRouteComponent(a.route).then((u) => {
|
|
3671
|
+
if (typeof u == "string")
|
|
3672
|
+
return { tag: u, props: {}, children: [] };
|
|
3673
|
+
if (typeof u == "function") {
|
|
3674
|
+
const m = u();
|
|
3675
|
+
return (m instanceof Promise ? m : Promise.resolve(m)).then((w) => typeof w == "string" ? { tag: w, props: {}, children: [] } : w);
|
|
3676
|
+
}
|
|
3677
|
+
return ae`<div>Invalid route component</div>`;
|
|
3678
|
+
}).catch(() => ae`<div>Invalid route component</div>`) : ae`<div>Not found</div>`;
|
|
3679
|
+
}), Ye("router-link", (r = {}, n = {}) => {
|
|
3680
|
+
const {
|
|
3681
|
+
to: i = "",
|
|
3682
|
+
tag: s = "a",
|
|
3683
|
+
replace: o = !1,
|
|
3684
|
+
exact: a = !1,
|
|
3685
|
+
activeClass: u = "active",
|
|
3686
|
+
exactActiveClass: m = "exact-active",
|
|
3687
|
+
ariaCurrentValue: g = "page",
|
|
3688
|
+
disabled: w = !1,
|
|
3689
|
+
external: h = !1,
|
|
3690
|
+
class: l = ""
|
|
3691
|
+
} = r, d = t.getCurrent(), v = d.path === i, b = a ? v : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = v ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), y = {};
|
|
3692
|
+
for (const _ of p) y[_] = !0;
|
|
3693
|
+
const C = {
|
|
3694
|
+
...y,
|
|
3695
|
+
// Also include the configurable names (may duplicate the above)
|
|
3696
|
+
[u]: b,
|
|
3697
|
+
[m]: v
|
|
3698
|
+
}, k = s === "button", f = w ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", x = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
|
|
3699
|
+
if (w) {
|
|
3700
|
+
_.preventDefault();
|
|
2879
3701
|
return;
|
|
2880
3702
|
}
|
|
2881
|
-
|
|
2882
|
-
}
|
|
3703
|
+
h && (s === "a" || !s) || (_.preventDefault(), o ? t.replace(i) : t.push(i));
|
|
3704
|
+
};
|
|
3705
|
+
return ae`
|
|
3706
|
+
${tr().when(k, ae`
|
|
3707
|
+
<button
|
|
3708
|
+
part="button"
|
|
3709
|
+
:class="${C}"
|
|
3710
|
+
${c}
|
|
3711
|
+
${f}
|
|
3712
|
+
${x}
|
|
3713
|
+
@click="${A}"
|
|
3714
|
+
><slot></slot></button>
|
|
3715
|
+
`).otherwise(ae`
|
|
3716
|
+
<a
|
|
3717
|
+
part="link"
|
|
3718
|
+
href="${i}"
|
|
3719
|
+
:class="${C}"
|
|
3720
|
+
${c}
|
|
3721
|
+
${f}
|
|
3722
|
+
${x}
|
|
3723
|
+
@click="${A}"
|
|
3724
|
+
><slot></slot></a>
|
|
3725
|
+
`).done()}
|
|
3726
|
+
`;
|
|
2883
3727
|
}), t;
|
|
2884
3728
|
}
|
|
2885
3729
|
export {
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
3730
|
+
ue as GlobalEventBus,
|
|
3731
|
+
M as anchorBlock,
|
|
3732
|
+
Ye as component,
|
|
3733
|
+
ar as computed,
|
|
3734
|
+
Qe as createStore,
|
|
3735
|
+
Tt as css,
|
|
3736
|
+
gr as each,
|
|
3737
|
+
xr as eachGroup,
|
|
3738
|
+
kr as eachPage,
|
|
3739
|
+
wr as eachWhere,
|
|
3740
|
+
$r as emit,
|
|
3741
|
+
me as eventBus,
|
|
3742
|
+
ae as html,
|
|
3743
|
+
Lr as initRouter,
|
|
3744
|
+
Or as listen,
|
|
3745
|
+
tr as match,
|
|
3746
|
+
Q as matchRoute,
|
|
3747
|
+
Pr as matchRouteSSR,
|
|
3748
|
+
ee as mediaVariants,
|
|
3749
|
+
Rr as off,
|
|
3750
|
+
Ar as on,
|
|
3751
|
+
Tr as once,
|
|
3752
|
+
et as parseQuery,
|
|
3753
|
+
or as ref,
|
|
3754
|
+
Te as renderToString,
|
|
3755
|
+
ir as resolveRouteComponent,
|
|
3756
|
+
nr as responsive,
|
|
3757
|
+
at as responsiveOrder,
|
|
3758
|
+
Er as responsiveSwitch,
|
|
3759
|
+
Sr as switchOn,
|
|
3760
|
+
vr as switchOnLength,
|
|
3761
|
+
Cr as switchOnPromise,
|
|
3762
|
+
mr as unless,
|
|
3763
|
+
lr as useEmit,
|
|
3764
|
+
dr as useOnAttributeChanged,
|
|
3765
|
+
ur as useOnConnected,
|
|
3766
|
+
fr as useOnDisconnected,
|
|
3767
|
+
pr as useOnError,
|
|
3768
|
+
sr as useRouter,
|
|
3769
|
+
hr as useStyle,
|
|
3770
|
+
cr as watch,
|
|
3771
|
+
Ae as when,
|
|
3772
|
+
yr as whenEmpty,
|
|
2920
3773
|
q as whenMedia,
|
|
2921
|
-
|
|
2922
|
-
|
|
3774
|
+
br as whenNotEmpty,
|
|
3775
|
+
_r as whenVariants
|
|
2923
3776
|
};
|
|
2924
3777
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|