@jasonshimmy/custom-elements-runtime 0.3.0 → 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 -57
- 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 +2534 -1373
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +35 -29
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/directive-enhancements.d.ts +138 -0
- package/dist/directives.d.ts +5 -0
- package/dist/index.d.ts +9 -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/logger.d.ts +16 -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/scheduler.d.ts +27 -0
- 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 -9
- package/package.json +1 -1
|
@@ -1,438 +1,1070 @@
|
|
|
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 pe(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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
53
|
+
return this.cache.set(t, o), o;
|
|
54
|
+
}
|
|
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);
|
|
82
|
+
}
|
|
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
|
+
};
|
|
28
119
|
}
|
|
29
|
-
return [pe([], "whenChain-empty")];
|
|
30
|
-
}
|
|
31
|
-
function pe(e, t) {
|
|
32
|
-
const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
33
|
-
return {
|
|
34
|
-
tag: "#anchor",
|
|
35
|
-
key: t,
|
|
36
|
-
children: r
|
|
37
|
-
};
|
|
38
120
|
}
|
|
39
|
-
class
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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();
|
|
43
127
|
/**
|
|
44
|
-
*
|
|
128
|
+
* Create an optimized reactive proxy with minimal overhead
|
|
45
129
|
*/
|
|
46
|
-
static
|
|
47
|
-
|
|
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);
|
|
48
143
|
}
|
|
49
144
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @param eventName - Name of the event
|
|
52
|
-
* @param data - Optional event payload
|
|
145
|
+
* Mark an object as a proxy (for optimization)
|
|
53
146
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (!n || i - n.window > 1e3)
|
|
57
|
-
this.eventCounters.set(t, { count: 1, window: i });
|
|
58
|
-
else if (n.count++, n.count > 50 && n.count > 100)
|
|
59
|
-
return;
|
|
60
|
-
this.dispatchEvent(new CustomEvent(t, {
|
|
61
|
-
detail: r,
|
|
62
|
-
bubbles: !1,
|
|
63
|
-
// Global events don't need to bubble
|
|
64
|
-
cancelable: !0
|
|
65
|
-
}));
|
|
66
|
-
const o = this.handlers[t];
|
|
67
|
-
o && o.forEach((s) => {
|
|
147
|
+
static markAsProxy(t) {
|
|
148
|
+
if (t)
|
|
68
149
|
try {
|
|
69
|
-
|
|
70
|
-
} catch
|
|
71
|
-
console.error(`Error in global event handler for "${t}":`, a);
|
|
150
|
+
Ue.add(t);
|
|
151
|
+
} catch {
|
|
72
152
|
}
|
|
73
|
-
});
|
|
74
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();
|
|
75
165
|
/**
|
|
76
|
-
*
|
|
77
|
-
* @param eventName - Name of the event
|
|
78
|
-
* @param handler - Handler function
|
|
166
|
+
* Set the current component being rendered for dependency tracking
|
|
79
167
|
*/
|
|
80
|
-
|
|
81
|
-
|
|
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);
|
|
82
170
|
}
|
|
83
171
|
/**
|
|
84
|
-
*
|
|
85
|
-
* @param eventName - Name of the event
|
|
86
|
-
* @param handler - Handler function to remove
|
|
172
|
+
* Clear the current component after rendering
|
|
87
173
|
*/
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
i && i.delete(r);
|
|
174
|
+
clearCurrentComponent() {
|
|
175
|
+
this.currentComponent = null;
|
|
91
176
|
}
|
|
92
177
|
/**
|
|
93
|
-
*
|
|
94
|
-
* @param eventName - Name of the event
|
|
178
|
+
* Temporarily disable dependency tracking
|
|
95
179
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
180
|
+
disableTracking() {
|
|
181
|
+
this.trackingDisabled = !0;
|
|
98
182
|
}
|
|
99
183
|
/**
|
|
100
|
-
*
|
|
101
|
-
* @param eventName - Name of the event
|
|
102
|
-
* @param handler - CustomEvent handler
|
|
103
|
-
* @param options - AddEventListener options
|
|
184
|
+
* Re-enable dependency tracking
|
|
104
185
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
186
|
+
enableTracking() {
|
|
187
|
+
this.trackingDisabled = !1;
|
|
107
188
|
}
|
|
108
189
|
/**
|
|
109
|
-
*
|
|
110
|
-
* @param eventName - Name of the event
|
|
111
|
-
* @param handler - Handler function
|
|
190
|
+
* Check if a component is currently rendering
|
|
112
191
|
*/
|
|
113
|
-
|
|
114
|
-
return
|
|
115
|
-
const n = this.on(t, (o) => {
|
|
116
|
-
n(), r(o), i(o);
|
|
117
|
-
});
|
|
118
|
-
});
|
|
192
|
+
isRenderingComponent() {
|
|
193
|
+
return this.currentComponent !== null;
|
|
119
194
|
}
|
|
120
195
|
/**
|
|
121
|
-
*
|
|
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.
|
|
122
198
|
*/
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
);
|
|
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);
|
|
127
203
|
}
|
|
128
204
|
/**
|
|
129
|
-
*
|
|
205
|
+
* Execute a function with tracking disabled
|
|
130
206
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
207
|
+
withoutTracking(t) {
|
|
208
|
+
const r = this.trackingDisabled;
|
|
209
|
+
this.trackingDisabled = !0;
|
|
210
|
+
try {
|
|
211
|
+
return t();
|
|
212
|
+
} finally {
|
|
213
|
+
this.trackingDisabled = r;
|
|
214
|
+
}
|
|
133
215
|
}
|
|
134
216
|
/**
|
|
135
|
-
* Get
|
|
136
|
-
* @param eventName - Name of the event
|
|
217
|
+
* Get or create a state instance for the current component
|
|
137
218
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
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;
|
|
140
227
|
}
|
|
141
228
|
/**
|
|
142
|
-
*
|
|
229
|
+
* Track a dependency for the current component
|
|
143
230
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
for (const [r, i] of this.eventCounters.entries())
|
|
147
|
-
t[r] = {
|
|
148
|
-
count: i.count,
|
|
149
|
-
handlersCount: this.getHandlerCount(r)
|
|
150
|
-
};
|
|
151
|
-
return t;
|
|
231
|
+
trackDependency(t) {
|
|
232
|
+
this.trackingDisabled || this.currentComponent && (this.componentDependencies.get(this.currentComponent)?.add(t), t.addDependent(this.currentComponent));
|
|
152
233
|
}
|
|
153
234
|
/**
|
|
154
|
-
*
|
|
235
|
+
* Trigger updates for all components that depend on a state
|
|
155
236
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
function $e(e) {
|
|
162
|
-
let t = { ...e };
|
|
163
|
-
const r = [];
|
|
164
|
-
function i(a) {
|
|
165
|
-
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
|
+
});
|
|
166
242
|
}
|
|
167
|
-
|
|
168
|
-
|
|
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
|
+
);
|
|
169
287
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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;
|
|
173
340
|
}
|
|
174
|
-
|
|
175
|
-
|
|
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;
|
|
176
347
|
}
|
|
177
|
-
return
|
|
178
|
-
}
|
|
179
|
-
function
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
function W(e, t) {
|
|
195
|
-
return typeof t == "string" ? t.split(".").reduce((r, i) => r?.[i], e) : t;
|
|
196
|
-
}
|
|
197
|
-
function ce(e, t, r) {
|
|
198
|
-
const i = String(t).split("."), n = i.pop();
|
|
199
|
-
if (!n) return;
|
|
200
|
-
const o = i.reduce((s, a) => (s[a] == null && (s[a] = {}), s[a]), e);
|
|
201
|
-
o[n] = r;
|
|
202
|
-
}
|
|
203
|
-
function qe(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) {
|
|
204
364
|
if (r)
|
|
205
|
-
for (const [
|
|
206
|
-
let
|
|
207
|
-
if (Array.isArray(
|
|
208
|
-
callback:
|
|
209
|
-
options:
|
|
210
|
-
oldValue:
|
|
211
|
-
}),
|
|
365
|
+
for (const [n, i] of Object.entries(r)) {
|
|
366
|
+
let s, o = {};
|
|
367
|
+
if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(n, {
|
|
368
|
+
callback: s,
|
|
369
|
+
options: o,
|
|
370
|
+
oldValue: H(e, n)
|
|
371
|
+
}), o.immediate)
|
|
212
372
|
try {
|
|
213
|
-
const a =
|
|
214
|
-
|
|
373
|
+
const a = H(e, n);
|
|
374
|
+
s(a, void 0, e);
|
|
215
375
|
} catch (a) {
|
|
216
|
-
|
|
376
|
+
ie(`Error in immediate watcher for "${n}":`, a);
|
|
217
377
|
}
|
|
218
378
|
}
|
|
219
379
|
}
|
|
220
|
-
function
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
if (typeof
|
|
224
|
-
if (Array.isArray(
|
|
225
|
-
return
|
|
226
|
-
const
|
|
227
|
-
return
|
|
228
|
-
},
|
|
229
|
-
if (
|
|
380
|
+
function gt(e, t, r, n) {
|
|
381
|
+
const i = (o, a) => {
|
|
382
|
+
if (o === a) return !0;
|
|
383
|
+
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
384
|
+
if (Array.isArray(o) && Array.isArray(a))
|
|
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]));
|
|
388
|
+
}, s = t.get(r);
|
|
389
|
+
if (s && !i(n, s.oldValue))
|
|
230
390
|
try {
|
|
231
|
-
|
|
232
|
-
} catch (
|
|
233
|
-
|
|
391
|
+
s.callback(n, s.oldValue, e), s.oldValue = n;
|
|
392
|
+
} catch (o) {
|
|
393
|
+
ie(`Error in watcher for "${r}":`, o);
|
|
234
394
|
}
|
|
235
|
-
for (const [
|
|
236
|
-
if (a.options.deep && r.startsWith(
|
|
395
|
+
for (const [o, a] of t.entries())
|
|
396
|
+
if (a.options.deep && r.startsWith(o + "."))
|
|
237
397
|
try {
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
} catch (
|
|
241
|
-
|
|
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);
|
|
242
402
|
}
|
|
243
403
|
}
|
|
244
|
-
function
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
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")
|
|
251
411
|
r[n] = e[n];
|
|
252
|
-
else
|
|
253
|
-
|
|
254
|
-
|
|
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)
|
|
255
506
|
try {
|
|
256
|
-
|
|
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);
|
|
257
512
|
} catch {
|
|
258
|
-
|
|
513
|
+
s[o] = void 0;
|
|
259
514
|
}
|
|
260
|
-
|
|
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 });
|
|
261
525
|
}
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
+
}
|
|
269
745
|
}
|
|
270
|
-
|
|
271
|
-
|
|
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
|
+
}
|
|
272
819
|
}
|
|
273
|
-
function
|
|
820
|
+
function ce(e, t) {
|
|
274
821
|
if (t && e instanceof HTMLElement) {
|
|
822
|
+
se.cleanup(e);
|
|
275
823
|
for (const r in t)
|
|
276
824
|
t[r] === e && delete t[r];
|
|
277
825
|
for (const r of Array.from(e.childNodes))
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
function
|
|
282
|
-
if (
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
if (
|
|
288
|
-
|
|
289
|
-
|
|
826
|
+
ce(r, t);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
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) {
|
|
835
|
+
if (!s) return;
|
|
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 ?? ""));
|
|
290
849
|
else {
|
|
291
|
-
const
|
|
292
|
-
r[
|
|
293
|
-
}
|
|
294
|
-
else if (
|
|
295
|
-
r[
|
|
296
|
-
else if (
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
850
|
+
const C = o?.getAttribute("true-value") ?? !0;
|
|
851
|
+
r[c] = l === C;
|
|
852
|
+
}
|
|
853
|
+
else if (d === "radio")
|
|
854
|
+
r[c] = l === (n?.value ?? "");
|
|
855
|
+
else if (d === "select")
|
|
856
|
+
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
857
|
+
const C = Array.isArray(l) ? l.map(String) : [];
|
|
299
858
|
setTimeout(() => {
|
|
300
|
-
Array.from(
|
|
301
|
-
|
|
859
|
+
Array.from(o.options).forEach((k) => {
|
|
860
|
+
k.selected = C.includes(k.value);
|
|
302
861
|
});
|
|
303
|
-
}, 0), r[
|
|
862
|
+
}, 0), r[c] = Array.isArray(l) ? l : [];
|
|
304
863
|
} else
|
|
305
|
-
r[
|
|
864
|
+
r[c] = l;
|
|
306
865
|
else {
|
|
307
|
-
r[
|
|
866
|
+
r[c] = l;
|
|
308
867
|
try {
|
|
309
|
-
const
|
|
310
|
-
|
|
868
|
+
const C = te(c);
|
|
869
|
+
n && (n[C] = l);
|
|
311
870
|
} catch {
|
|
312
871
|
}
|
|
313
872
|
}
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
316
|
-
const
|
|
317
|
-
if (!
|
|
318
|
-
|
|
319
|
-
if (
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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);
|
|
325
886
|
else {
|
|
326
|
-
const
|
|
327
|
-
|
|
887
|
+
const P = $.indexOf(T);
|
|
888
|
+
P > -1 && $.splice(P, 1);
|
|
328
889
|
}
|
|
329
|
-
|
|
890
|
+
x = $;
|
|
330
891
|
} else {
|
|
331
|
-
const
|
|
332
|
-
|
|
892
|
+
const T = f.getAttribute("true-value") ?? !0, $ = f.getAttribute("false-value") ?? !1;
|
|
893
|
+
x = f.checked ? T : $;
|
|
333
894
|
}
|
|
334
|
-
} else if (
|
|
335
|
-
|
|
336
|
-
else if (
|
|
337
|
-
|
|
338
|
-
else if (
|
|
339
|
-
const
|
|
340
|
-
isNaN(
|
|
341
|
-
}
|
|
342
|
-
const
|
|
343
|
-
if (Array.isArray(
|
|
344
|
-
|
|
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;
|
|
345
906
|
try {
|
|
346
|
-
|
|
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,
|
|
922
|
+
bubbles: !0,
|
|
923
|
+
composed: !0
|
|
924
|
+
});
|
|
925
|
+
f.dispatchEvent(T);
|
|
926
|
+
}
|
|
347
927
|
} finally {
|
|
348
|
-
setTimeout(() =>
|
|
928
|
+
setTimeout(() => f._modelUpdating = !1, 0);
|
|
349
929
|
}
|
|
350
930
|
}
|
|
351
931
|
};
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
932
|
+
if (v) {
|
|
933
|
+
if (i[p]) {
|
|
934
|
+
const C = i[p];
|
|
935
|
+
o && se.removeListener(o, p, C);
|
|
936
|
+
}
|
|
937
|
+
i[p] = y;
|
|
938
|
+
} else {
|
|
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;
|
|
949
|
+
if (S) {
|
|
950
|
+
S[c] = x;
|
|
951
|
+
try {
|
|
952
|
+
const R = te(c);
|
|
953
|
+
typeof x == "boolean" ? x ? S.setAttribute(R, "true") : S.setAttribute(R, "false") : S.setAttribute(R, String(x));
|
|
954
|
+
} catch {
|
|
955
|
+
}
|
|
956
|
+
queueMicrotask(() => {
|
|
957
|
+
typeof S._applyProps == "function" && S._applyProps(S._cfg), typeof S._requestRender == "function" && S._requestRender();
|
|
958
|
+
});
|
|
959
|
+
}
|
|
364
960
|
}
|
|
365
|
-
|
|
366
|
-
|
|
961
|
+
};
|
|
962
|
+
}
|
|
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);
|
|
972
|
+
}
|
|
973
|
+
if (Array.isArray(_) && Array.isArray(A) ? JSON.stringify([..._].sort()) !== JSON.stringify([...A].sort()) : _ !== A) {
|
|
974
|
+
k._modelUpdating = !0;
|
|
367
975
|
try {
|
|
368
|
-
|
|
976
|
+
Ce(x, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
|
|
369
977
|
} finally {
|
|
370
|
-
setTimeout(() =>
|
|
978
|
+
setTimeout(() => k._modelUpdating = !1, 0);
|
|
371
979
|
}
|
|
372
980
|
}
|
|
373
981
|
}, 0);
|
|
374
982
|
});
|
|
375
983
|
}
|
|
376
|
-
function
|
|
984
|
+
function it(e) {
|
|
377
985
|
const t = e.slice(2);
|
|
378
986
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
379
987
|
}
|
|
380
|
-
function
|
|
381
|
-
if (
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
r[e] = n;
|
|
988
|
+
function Ct(e, t, r, n) {
|
|
989
|
+
if (typeof e == "object" && e !== null)
|
|
990
|
+
for (const [i, s] of Object.entries(e))
|
|
991
|
+
i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? r[i] = s : t[i] = s;
|
|
992
|
+
else if (typeof e == "string") {
|
|
993
|
+
if (!n) return;
|
|
994
|
+
try {
|
|
995
|
+
const i = he(e, n);
|
|
996
|
+
if (typeof i == "object" && i !== null) {
|
|
997
|
+
for (const [s, o] of Object.entries(i))
|
|
998
|
+
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
|
|
999
|
+
return;
|
|
1000
|
+
} else {
|
|
1001
|
+
r[e] = i;
|
|
1002
|
+
return;
|
|
396
1003
|
}
|
|
1004
|
+
} catch {
|
|
1005
|
+
const i = H(n, e);
|
|
1006
|
+
r[e] = i;
|
|
1007
|
+
}
|
|
397
1008
|
}
|
|
398
1009
|
}
|
|
399
|
-
function
|
|
400
|
-
|
|
401
|
-
|
|
1010
|
+
function _t(e, t, r) {
|
|
1011
|
+
let n;
|
|
1012
|
+
if (typeof e == "string") {
|
|
1013
|
+
if (!r) return;
|
|
1014
|
+
n = he(e, r);
|
|
1015
|
+
} else
|
|
1016
|
+
n = e;
|
|
1017
|
+
const i = t.style || "";
|
|
1018
|
+
let s = i;
|
|
402
1019
|
if (n) {
|
|
403
|
-
|
|
404
|
-
(
|
|
1020
|
+
if (i) {
|
|
1021
|
+
const o = i.split(";").map((u) => u.trim()).filter(Boolean), a = o.findIndex(
|
|
1022
|
+
(u) => u.startsWith("display:")
|
|
1023
|
+
);
|
|
1024
|
+
a >= 0 && o[a] === "display: none" && (o.splice(a, 1), s = o.length > 0 ? o.join("; ") + ";" : "");
|
|
1025
|
+
}
|
|
1026
|
+
} else if (i) {
|
|
1027
|
+
const o = i.split(";").filter(Boolean), a = o.findIndex(
|
|
1028
|
+
(u) => u.trim().startsWith("display:")
|
|
405
1029
|
);
|
|
406
|
-
a >= 0 ?
|
|
1030
|
+
a >= 0 ? o[a] = "display: none" : o.push("display: none"), s = o.join("; ");
|
|
407
1031
|
} else
|
|
408
|
-
|
|
1032
|
+
s = "display: none";
|
|
1033
|
+
s !== i && (s ? t.style = s : delete t.style);
|
|
409
1034
|
}
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
const i = W(r, e);
|
|
413
|
-
let n = [];
|
|
414
|
-
typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
415
|
-
const o = t.class || "", s = o ? `${o} ${n.join(" ")}`.trim() : n.join(" ");
|
|
416
|
-
s && (t.class = s);
|
|
1035
|
+
function he(e, t) {
|
|
1036
|
+
return xt.evaluate(e, t);
|
|
417
1037
|
}
|
|
418
|
-
function
|
|
419
|
-
let
|
|
1038
|
+
function Et(e, t, r) {
|
|
1039
|
+
let n;
|
|
420
1040
|
if (typeof e == "string") {
|
|
421
1041
|
if (!r) return;
|
|
422
|
-
|
|
1042
|
+
n = he(e, r);
|
|
423
1043
|
} else
|
|
424
|
-
|
|
425
|
-
let
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
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(" ");
|
|
1048
|
+
o && (t.class = o);
|
|
1049
|
+
}
|
|
1050
|
+
function St(e, t, r) {
|
|
1051
|
+
let n;
|
|
1052
|
+
if (typeof e == "string") {
|
|
1053
|
+
if (!r) return;
|
|
1054
|
+
n = he(e, r);
|
|
1055
|
+
} else
|
|
1056
|
+
n = e;
|
|
1057
|
+
let i = "";
|
|
1058
|
+
if (typeof n == "string")
|
|
1059
|
+
i = n;
|
|
1060
|
+
else if (n && typeof n == "object") {
|
|
1061
|
+
const o = [];
|
|
1062
|
+
for (const [a, u] of Object.entries(n))
|
|
1063
|
+
if (u != null && u !== "") {
|
|
1064
|
+
const m = a.replace(
|
|
433
1065
|
/[A-Z]/g,
|
|
434
|
-
(
|
|
435
|
-
),
|
|
1066
|
+
(h) => `-${h.toLowerCase()}`
|
|
1067
|
+
), g = [
|
|
436
1068
|
"width",
|
|
437
1069
|
"height",
|
|
438
1070
|
"top",
|
|
@@ -458,126 +1090,136 @@ function Ze(e, t, r) {
|
|
|
458
1090
|
"min-height",
|
|
459
1091
|
"max-height"
|
|
460
1092
|
];
|
|
461
|
-
let
|
|
462
|
-
typeof
|
|
1093
|
+
let w = String(u);
|
|
1094
|
+
typeof u == "number" && g.includes(m) && (w = `${u}px`), o.push(`${m}: ${w}`);
|
|
463
1095
|
}
|
|
464
|
-
|
|
1096
|
+
i = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
465
1097
|
}
|
|
466
|
-
const
|
|
467
|
-
t.style =
|
|
1098
|
+
const s = t.style || "";
|
|
1099
|
+
t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
|
|
1100
|
+
}
|
|
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;
|
|
468
1104
|
}
|
|
469
|
-
function
|
|
470
|
-
const
|
|
471
|
-
for (const [a,
|
|
472
|
-
const { value:
|
|
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;
|
|
473
1109
|
if (a === "model" || a.startsWith("model:")) {
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
1110
|
+
const h = a.split(":"), l = h.length > 1 ? h[1] : w;
|
|
1111
|
+
kt(
|
|
1112
|
+
m,
|
|
1113
|
+
// Pass the original value (could be string or reactive state object)
|
|
1114
|
+
g,
|
|
1115
|
+
i,
|
|
480
1116
|
s,
|
|
1117
|
+
o,
|
|
481
1118
|
t,
|
|
482
1119
|
r,
|
|
483
|
-
|
|
1120
|
+
l
|
|
484
1121
|
);
|
|
485
1122
|
continue;
|
|
486
1123
|
}
|
|
487
1124
|
switch (a) {
|
|
488
1125
|
case "bind":
|
|
489
|
-
|
|
1126
|
+
Ct(m, i, s, t);
|
|
490
1127
|
break;
|
|
491
1128
|
case "show":
|
|
492
|
-
|
|
1129
|
+
_t(m, s, t);
|
|
493
1130
|
break;
|
|
494
1131
|
case "class":
|
|
495
|
-
|
|
1132
|
+
Et(m, s, t);
|
|
496
1133
|
break;
|
|
497
1134
|
case "style":
|
|
498
|
-
|
|
1135
|
+
St(m, s, t);
|
|
1136
|
+
break;
|
|
1137
|
+
case "ref":
|
|
1138
|
+
$t(m, i, t);
|
|
499
1139
|
break;
|
|
500
1140
|
}
|
|
501
1141
|
}
|
|
502
|
-
return { props:
|
|
1142
|
+
return { props: i, attrs: s, listeners: o };
|
|
503
1143
|
}
|
|
504
|
-
function
|
|
1144
|
+
function Ie(e, t) {
|
|
505
1145
|
if (Array.isArray(e)) {
|
|
506
|
-
const
|
|
507
|
-
return e.map((
|
|
508
|
-
if (!
|
|
509
|
-
let a =
|
|
1146
|
+
const s = /* @__PURE__ */ new Set();
|
|
1147
|
+
return e.map((o) => {
|
|
1148
|
+
if (!o || typeof o != "object") return o;
|
|
1149
|
+
let a = o.props?.key ?? o.key;
|
|
510
1150
|
if (!a) {
|
|
511
|
-
const
|
|
1151
|
+
const w = o.tag || "node", l = [
|
|
512
1152
|
// attrs (kebab-case)
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
1153
|
+
o.props?.attrs?.id,
|
|
1154
|
+
o.props?.attrs?.name,
|
|
1155
|
+
o.props?.attrs?.["data-key"],
|
|
516
1156
|
// promoted JS props (camelCase or original)
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
].find((
|
|
522
|
-
a =
|
|
1157
|
+
o.props?.props?.id,
|
|
1158
|
+
o.props?.props?.name,
|
|
1159
|
+
o.props?.props?.dataKey,
|
|
1160
|
+
o.props?.props?.["data-key"]
|
|
1161
|
+
].find((d) => d != null) ?? "";
|
|
1162
|
+
a = l ? `${t}:${w}:${l}` : `${t}:${w}`;
|
|
523
1163
|
}
|
|
524
|
-
let
|
|
525
|
-
for (;
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
let
|
|
529
|
-
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 };
|
|
530
1170
|
});
|
|
531
1171
|
}
|
|
532
1172
|
const r = e;
|
|
533
|
-
let
|
|
534
|
-
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 };
|
|
535
1175
|
}
|
|
536
|
-
function
|
|
537
|
-
const
|
|
538
|
-
n,
|
|
1176
|
+
function Fe(e, t, r, n) {
|
|
1177
|
+
const i = r.directives ?? {}, s = st(
|
|
539
1178
|
i,
|
|
1179
|
+
n,
|
|
540
1180
|
e,
|
|
541
1181
|
r.attrs
|
|
542
|
-
),
|
|
1182
|
+
), o = {
|
|
543
1183
|
...t.props,
|
|
544
1184
|
...r.props,
|
|
545
|
-
...
|
|
1185
|
+
...s.props
|
|
546
1186
|
}, a = {
|
|
547
1187
|
...t.attrs,
|
|
548
1188
|
...r.attrs,
|
|
549
|
-
...
|
|
550
|
-
},
|
|
551
|
-
let
|
|
552
|
-
for (const
|
|
553
|
-
const v =
|
|
554
|
-
if (v !==
|
|
555
|
-
if (
|
|
556
|
-
e.value !==
|
|
557
|
-
else if (
|
|
558
|
-
e.checked = !!
|
|
559
|
-
else if (
|
|
560
|
-
const
|
|
561
|
-
typeof v == "function" &&
|
|
562
|
-
} else if (
|
|
563
|
-
e.removeAttribute(
|
|
564
|
-
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) ||
|
|
1189
|
+
...s.attrs
|
|
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)
|
|
565
1205
|
try {
|
|
566
|
-
e[
|
|
1206
|
+
e[d] = b;
|
|
567
1207
|
} catch {
|
|
568
1208
|
}
|
|
569
|
-
|
|
1209
|
+
else
|
|
1210
|
+
b === !1 && e.removeAttribute(d);
|
|
570
1211
|
}
|
|
571
|
-
for (const [
|
|
572
|
-
|
|
1212
|
+
for (const [d, v] of Object.entries(
|
|
1213
|
+
s.listeners || {}
|
|
573
1214
|
))
|
|
574
|
-
|
|
575
|
-
const
|
|
576
|
-
for (const
|
|
577
|
-
const v =
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
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") {
|
|
581
1223
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
582
1224
|
try {
|
|
583
1225
|
e.value = "";
|
|
@@ -594,57 +1236,69 @@ function Se(e, t, r, i) {
|
|
|
594
1236
|
} catch {
|
|
595
1237
|
}
|
|
596
1238
|
}
|
|
597
|
-
if (
|
|
1239
|
+
if (d === "checked" && e instanceof HTMLInputElement)
|
|
598
1240
|
try {
|
|
599
1241
|
e.checked = !1;
|
|
600
1242
|
} catch {
|
|
601
1243
|
}
|
|
602
|
-
if (
|
|
1244
|
+
if (d === "disabled")
|
|
603
1245
|
try {
|
|
604
1246
|
e.disabled = !1;
|
|
605
1247
|
} catch {
|
|
606
1248
|
}
|
|
607
1249
|
} else {
|
|
608
|
-
if (
|
|
1250
|
+
if (d === "value") {
|
|
609
1251
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) {
|
|
610
1252
|
try {
|
|
611
|
-
e.value =
|
|
1253
|
+
e.value = p ?? "";
|
|
612
1254
|
} catch {
|
|
613
|
-
e.setAttribute(
|
|
1255
|
+
e.setAttribute(d, String(p));
|
|
614
1256
|
}
|
|
615
1257
|
continue;
|
|
616
1258
|
} else if (e instanceof HTMLSelectElement) {
|
|
617
1259
|
try {
|
|
618
|
-
e.value =
|
|
1260
|
+
e.value = p ?? "";
|
|
619
1261
|
} catch {
|
|
620
1262
|
}
|
|
621
1263
|
continue;
|
|
622
1264
|
} else if (e instanceof HTMLProgressElement) {
|
|
623
1265
|
try {
|
|
624
|
-
e.value = Number(
|
|
1266
|
+
e.value = Number(p);
|
|
625
1267
|
} catch {
|
|
626
1268
|
}
|
|
627
1269
|
continue;
|
|
628
1270
|
}
|
|
629
1271
|
}
|
|
630
|
-
if (
|
|
1272
|
+
if (d === "checked" && e instanceof HTMLInputElement) {
|
|
631
1273
|
try {
|
|
632
|
-
e.checked = !!
|
|
1274
|
+
e.checked = !!p;
|
|
633
1275
|
} catch {
|
|
634
1276
|
}
|
|
635
1277
|
continue;
|
|
636
1278
|
}
|
|
637
|
-
if (
|
|
1279
|
+
if (d === "style") {
|
|
1280
|
+
e.setAttribute(d, String(p));
|
|
1281
|
+
continue;
|
|
1282
|
+
}
|
|
1283
|
+
const y = e.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1284
|
+
if (g && !y && d.includes("-")) {
|
|
1285
|
+
const C = rt(d);
|
|
638
1286
|
try {
|
|
639
|
-
e[
|
|
1287
|
+
e[C] = p;
|
|
640
1288
|
} catch {
|
|
641
|
-
e.setAttribute(
|
|
1289
|
+
e.setAttribute(d, String(p));
|
|
1290
|
+
}
|
|
1291
|
+
} else if (!y && d in e)
|
|
1292
|
+
try {
|
|
1293
|
+
e[d] = p;
|
|
1294
|
+
} catch {
|
|
1295
|
+
e.setAttribute(d, String(p));
|
|
642
1296
|
}
|
|
643
1297
|
else
|
|
644
|
-
e.setAttribute(
|
|
1298
|
+
e.setAttribute(d, String(p));
|
|
645
1299
|
}
|
|
646
1300
|
}
|
|
647
|
-
if (
|
|
1301
|
+
if (g && w)
|
|
648
1302
|
try {
|
|
649
1303
|
if (typeof e._applyProps == "function")
|
|
650
1304
|
try {
|
|
@@ -655,320 +1309,336 @@ function Se(e, t, r, i) {
|
|
|
655
1309
|
} catch {
|
|
656
1310
|
}
|
|
657
1311
|
}
|
|
658
|
-
function
|
|
1312
|
+
function X(e, t, r) {
|
|
659
1313
|
if (typeof e == "string")
|
|
660
1314
|
return document.createTextNode(e);
|
|
661
1315
|
if (e.tag === "#text") {
|
|
662
|
-
const
|
|
1316
|
+
const h = document.createTextNode(
|
|
663
1317
|
typeof e.children == "string" ? e.children : ""
|
|
664
1318
|
);
|
|
665
|
-
return e.key != null && (
|
|
1319
|
+
return e.key != null && (h.key = e.key), h;
|
|
666
1320
|
}
|
|
667
1321
|
if (e.tag === "#anchor") {
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
for (const
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
}
|
|
676
|
-
return
|
|
677
|
-
}
|
|
678
|
-
const
|
|
679
|
-
e.key != null && (
|
|
680
|
-
const { props:
|
|
681
|
-
...
|
|
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,
|
|
682
1336
|
...a.props
|
|
683
|
-
},
|
|
684
|
-
...
|
|
1337
|
+
}, m = {
|
|
1338
|
+
...s,
|
|
685
1339
|
...a.attrs
|
|
686
|
-
},
|
|
687
|
-
for (const
|
|
688
|
-
const
|
|
689
|
-
if (!(typeof
|
|
690
|
-
if (typeof
|
|
691
|
-
|
|
692
|
-
else if (
|
|
693
|
-
if (!
|
|
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))) {
|
|
1344
|
+
if (typeof l == "boolean")
|
|
1345
|
+
l && n.setAttribute(h, "");
|
|
1346
|
+
else if (l != null)
|
|
1347
|
+
if (!g && h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement || n instanceof HTMLProgressElement))
|
|
694
1348
|
try {
|
|
695
|
-
|
|
1349
|
+
n instanceof HTMLProgressElement ? n.value = Number(l) : n.value = l ?? "";
|
|
696
1350
|
} catch {
|
|
697
|
-
|
|
1351
|
+
n.setAttribute(h, String(l));
|
|
698
1352
|
}
|
|
699
|
-
else if (!
|
|
1353
|
+
else if (!g && h === "checked" && n instanceof HTMLInputElement)
|
|
700
1354
|
try {
|
|
701
|
-
|
|
1355
|
+
n.checked = !!l;
|
|
702
1356
|
} catch {
|
|
703
|
-
|
|
1357
|
+
n.setAttribute(h, String(l));
|
|
704
1358
|
}
|
|
705
|
-
else if (!
|
|
1359
|
+
else if (!g && h in n)
|
|
706
1360
|
try {
|
|
707
|
-
|
|
1361
|
+
n[h] = l;
|
|
708
1362
|
} catch {
|
|
709
|
-
|
|
1363
|
+
n.setAttribute(h, String(l));
|
|
710
1364
|
}
|
|
711
|
-
else
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
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);
|
|
724
1387
|
else {
|
|
725
|
-
if (
|
|
1388
|
+
if (h.startsWith("on") && l === void 0)
|
|
726
1389
|
continue;
|
|
727
|
-
if (
|
|
728
|
-
|
|
729
|
-
else if ((e.props?.isCustomElement ?? !1) ||
|
|
1390
|
+
if (l == null || l === !1)
|
|
1391
|
+
n.removeAttribute(h);
|
|
1392
|
+
else if ((e.props?.isCustomElement ?? !1) || h in n)
|
|
730
1393
|
try {
|
|
731
|
-
|
|
1394
|
+
const v = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1395
|
+
n[h] = v;
|
|
732
1396
|
} catch {
|
|
733
1397
|
}
|
|
734
1398
|
}
|
|
735
1399
|
}
|
|
736
|
-
for (const [
|
|
1400
|
+
for (const [h, l] of Object.entries(
|
|
737
1401
|
a.listeners || {}
|
|
738
1402
|
))
|
|
739
|
-
|
|
740
|
-
const
|
|
741
|
-
|
|
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);
|
|
742
1412
|
try {
|
|
743
|
-
if (typeof
|
|
1413
|
+
if (typeof n._applyProps == "function")
|
|
744
1414
|
try {
|
|
745
|
-
|
|
1415
|
+
n._applyProps(n._cfg);
|
|
746
1416
|
} catch {
|
|
747
1417
|
}
|
|
748
|
-
typeof
|
|
1418
|
+
typeof n.requestRender == "function" ? n.requestRender() : typeof n._render == "function" && n._render(n._cfg);
|
|
749
1419
|
} catch {
|
|
750
1420
|
}
|
|
751
1421
|
if (Array.isArray(e.children))
|
|
752
|
-
for (const
|
|
753
|
-
|
|
754
|
-
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);
|
|
755
1425
|
try {
|
|
756
|
-
if (
|
|
1426
|
+
if (n instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
|
|
757
1427
|
try {
|
|
758
|
-
|
|
1428
|
+
n.value = m.value ?? "";
|
|
759
1429
|
} catch {
|
|
760
1430
|
}
|
|
761
1431
|
} catch {
|
|
762
1432
|
}
|
|
763
|
-
return
|
|
1433
|
+
return n;
|
|
764
1434
|
}
|
|
765
|
-
function
|
|
1435
|
+
function At(e, t, r, n, i) {
|
|
766
1436
|
if (typeof r == "string") {
|
|
767
1437
|
e.textContent !== r && (e.textContent = r);
|
|
768
1438
|
return;
|
|
769
1439
|
}
|
|
770
1440
|
if (!Array.isArray(r)) return;
|
|
771
|
-
const
|
|
772
|
-
for (const
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
for (const
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
}
|
|
779
|
-
const
|
|
780
|
-
let
|
|
781
|
-
function
|
|
782
|
-
let v =
|
|
783
|
-
for (; v && (
|
|
1441
|
+
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
1442
|
+
for (const l of o)
|
|
1443
|
+
l && l.key != null && a.set(l.key, l);
|
|
1444
|
+
const u = /* @__PURE__ */ new Map();
|
|
1445
|
+
for (const l of s) {
|
|
1446
|
+
const d = l.key;
|
|
1447
|
+
d != null && u.set(d, l);
|
|
1448
|
+
}
|
|
1449
|
+
const m = /* @__PURE__ */ new Set();
|
|
1450
|
+
let g = e.firstChild;
|
|
1451
|
+
function w(l, d) {
|
|
1452
|
+
let v = l;
|
|
1453
|
+
for (; v && (m.add(v), v !== d); )
|
|
784
1454
|
v = v.nextSibling;
|
|
785
1455
|
}
|
|
786
|
-
function
|
|
787
|
-
const
|
|
788
|
-
let
|
|
789
|
-
for (;
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
if (
|
|
793
|
-
const
|
|
794
|
-
for (const
|
|
795
|
-
|
|
796
|
-
for (const
|
|
797
|
-
const
|
|
798
|
-
|
|
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, _);
|
|
799
1469
|
}
|
|
800
|
-
const
|
|
801
|
-
let
|
|
802
|
-
for (const
|
|
803
|
-
let
|
|
804
|
-
if (
|
|
805
|
-
const
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
),
|
|
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);
|
|
812
1482
|
} else
|
|
813
|
-
|
|
814
|
-
|
|
1483
|
+
S = X(_, n), e.insertBefore(S, A), x.add(S);
|
|
1484
|
+
A = S.nextSibling;
|
|
815
1485
|
}
|
|
816
|
-
for (const
|
|
817
|
-
!
|
|
1486
|
+
for (const _ of c)
|
|
1487
|
+
!x.has(_) && e.contains(_) && e.removeChild(_);
|
|
818
1488
|
} else {
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
|
|
1489
|
+
const k = Math.min(
|
|
1490
|
+
y.length,
|
|
1491
|
+
b.length
|
|
822
1492
|
);
|
|
823
|
-
for (let
|
|
824
|
-
const
|
|
825
|
-
|
|
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]));
|
|
826
1496
|
}
|
|
827
|
-
for (let
|
|
828
|
-
e.insertBefore(
|
|
829
|
-
for (let
|
|
830
|
-
e.removeChild(
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
for (const
|
|
834
|
-
let
|
|
835
|
-
if (
|
|
836
|
-
const v =
|
|
837
|
-
let
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
e.insertBefore(
|
|
841
|
-
for (const
|
|
842
|
-
e.insertBefore(
|
|
843
|
-
e.insertBefore(
|
|
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]);
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
for (const l of r) {
|
|
1504
|
+
let d;
|
|
1505
|
+
if (l.tag === "#anchor") {
|
|
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);
|
|
844
1514
|
} else
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
1515
|
+
h(
|
|
1516
|
+
p,
|
|
1517
|
+
y,
|
|
848
1518
|
a.get(v)?.children,
|
|
849
|
-
|
|
1519
|
+
C
|
|
850
1520
|
);
|
|
851
|
-
|
|
1521
|
+
w(p, y), g = y.nextSibling;
|
|
852
1522
|
continue;
|
|
853
1523
|
}
|
|
854
|
-
if (
|
|
855
|
-
const v = a.get(
|
|
856
|
-
|
|
857
|
-
|
|
1524
|
+
if (l.key != null && u.has(l.key)) {
|
|
1525
|
+
const v = a.get(l.key);
|
|
1526
|
+
d = _e(
|
|
1527
|
+
u.get(l.key),
|
|
858
1528
|
v,
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
),
|
|
1529
|
+
l,
|
|
1530
|
+
n,
|
|
1531
|
+
i
|
|
1532
|
+
), m.add(d), d !== g && e.contains(d) && (g && !e.contains(g) && (g = null), e.insertBefore(d, g));
|
|
863
1533
|
} else
|
|
864
|
-
|
|
865
|
-
|
|
1534
|
+
d = X(l, n, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g), m.add(d);
|
|
1535
|
+
g = d.nextSibling;
|
|
866
1536
|
}
|
|
867
|
-
for (const
|
|
868
|
-
!
|
|
1537
|
+
for (const l of s)
|
|
1538
|
+
!m.has(l) && e.contains(l) && (ce(l, i), e.removeChild(l));
|
|
869
1539
|
}
|
|
870
|
-
function
|
|
871
|
-
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;
|
|
872
1542
|
if (typeof r == "string") {
|
|
873
1543
|
if (e.nodeType === Node.TEXT_NODE)
|
|
874
1544
|
return e.textContent !== r && (e.textContent = r), e;
|
|
875
1545
|
{
|
|
876
|
-
const
|
|
877
|
-
return e.parentNode?.replaceChild(
|
|
1546
|
+
const o = document.createTextNode(r);
|
|
1547
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
878
1548
|
}
|
|
879
1549
|
}
|
|
880
1550
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
for (const
|
|
886
|
-
const
|
|
887
|
-
|
|
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);
|
|
888
1558
|
}
|
|
889
|
-
return
|
|
1559
|
+
return g.appendChild(m), e.parentNode?.replaceChild(g, e), u;
|
|
890
1560
|
}
|
|
891
1561
|
if (!r) {
|
|
892
|
-
|
|
893
|
-
const
|
|
894
|
-
return e.parentNode?.replaceChild(
|
|
1562
|
+
ce(e, i);
|
|
1563
|
+
const o = document.createComment("removed");
|
|
1564
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
895
1565
|
}
|
|
896
1566
|
if (!t || typeof t == "string") {
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
return
|
|
1567
|
+
ce(e, i);
|
|
1568
|
+
const o = X(r, n, i);
|
|
1569
|
+
return de(r, o, i), e.parentNode?.replaceChild(o, e), o;
|
|
900
1570
|
}
|
|
901
1571
|
if (r.tag === "#anchor") {
|
|
902
|
-
const
|
|
903
|
-
r.key != null && (a.key = `${r.key}:start`,
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
for (const
|
|
907
|
-
|
|
908
|
-
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;
|
|
909
1579
|
}
|
|
910
1580
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
911
|
-
const
|
|
912
|
-
return
|
|
1581
|
+
const o = e;
|
|
1582
|
+
return Fe(o, t.props || {}, r.props || {}, n), At(o, t.children, r.children, n, i), de(r, o, i), o;
|
|
913
1583
|
}
|
|
914
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))
|
|
915
1585
|
try {
|
|
916
1586
|
const a = e;
|
|
917
|
-
return
|
|
1587
|
+
return Fe(a, t.props || {}, r.props || {}, n), de(r, a, i), a;
|
|
918
1588
|
} catch {
|
|
919
1589
|
}
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
return
|
|
1590
|
+
ce(e, i);
|
|
1591
|
+
const s = X(r, n, i);
|
|
1592
|
+
return de(r, s, i), e.parentNode?.replaceChild(s, e), s;
|
|
923
1593
|
}
|
|
924
|
-
function
|
|
925
|
-
let
|
|
926
|
-
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 = {
|
|
927
1597
|
tag: "div",
|
|
928
1598
|
key: "__anchor_root__",
|
|
929
1599
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
930
|
-
children: [
|
|
931
|
-
}),
|
|
932
|
-
const
|
|
1600
|
+
children: [i]
|
|
1601
|
+
}), i = Ie(i, String(i.key ?? "root"));
|
|
1602
|
+
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
933
1603
|
let a;
|
|
934
|
-
|
|
935
|
-
const
|
|
936
|
-
for (let
|
|
937
|
-
const
|
|
938
|
-
|
|
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));
|
|
939
1609
|
}
|
|
940
|
-
|
|
1610
|
+
u.forEach((m) => e.removeChild(m)), e._prevVNode = i, e._prevDom = a;
|
|
941
1611
|
}
|
|
942
|
-
function
|
|
943
|
-
if (typeof e == "string") return
|
|
1612
|
+
function Te(e) {
|
|
1613
|
+
if (typeof e == "string") return ne(e);
|
|
944
1614
|
if (e.tag === "#text")
|
|
945
|
-
return typeof e.children == "string" ?
|
|
1615
|
+
return typeof e.children == "string" ? ne(e.children) : "";
|
|
946
1616
|
if (e.tag === "#anchor")
|
|
947
|
-
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(
|
|
1617
|
+
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(Te).join("");
|
|
948
1618
|
let t = "";
|
|
949
|
-
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(""));
|
|
950
1620
|
let r = "";
|
|
951
|
-
e.props && (r = Object.entries(e.props).filter(([
|
|
952
|
-
const
|
|
953
|
-
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}>`;
|
|
954
1624
|
}
|
|
955
|
-
function
|
|
1625
|
+
function Tt(e, ...t) {
|
|
956
1626
|
let r = "";
|
|
957
|
-
for (let
|
|
958
|
-
r += e[
|
|
1627
|
+
for (let n = 0; n < e.length; n++)
|
|
1628
|
+
r += e[n], n < t.length && (r += t[n]);
|
|
959
1629
|
return r;
|
|
960
1630
|
}
|
|
961
|
-
function
|
|
1631
|
+
function ot(e) {
|
|
962
1632
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
963
1633
|
}
|
|
964
|
-
let
|
|
965
|
-
function
|
|
966
|
-
return
|
|
1634
|
+
let xe = null;
|
|
1635
|
+
function Ke() {
|
|
1636
|
+
return xe || (xe = new CSSStyleSheet(), xe.replaceSync(ot(Pt))), xe;
|
|
967
1637
|
}
|
|
968
|
-
function
|
|
1638
|
+
function Ot(e) {
|
|
969
1639
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
970
1640
|
}
|
|
971
|
-
const
|
|
1641
|
+
const Pt = Tt`
|
|
972
1642
|
:host, *, ::before, ::after {
|
|
973
1643
|
all: isolate;
|
|
974
1644
|
box-sizing: border-box;
|
|
@@ -1026,7 +1696,7 @@ const Xe = Pe`
|
|
|
1026
1696
|
sup { top: -.5em }
|
|
1027
1697
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
1028
1698
|
[hidden] { display: none }
|
|
1029
|
-
`,
|
|
1699
|
+
`, Lt = {
|
|
1030
1700
|
neutral: {
|
|
1031
1701
|
50: "#fafafa",
|
|
1032
1702
|
100: "#f4f4f5",
|
|
@@ -1122,17 +1792,17 @@ const Xe = Pe`
|
|
|
1122
1792
|
black: { DEFAULT: "#000000" },
|
|
1123
1793
|
transparent: { DEFAULT: "transparent" },
|
|
1124
1794
|
current: { DEFAULT: "currentColor" }
|
|
1125
|
-
},
|
|
1126
|
-
Object.entries(
|
|
1795
|
+
}, jt = Object.fromEntries(
|
|
1796
|
+
Object.entries(Lt).map(([e, t]) => [
|
|
1127
1797
|
e,
|
|
1128
1798
|
Object.fromEntries(
|
|
1129
|
-
Object.entries(t).map(([r,
|
|
1799
|
+
Object.entries(t).map(([r, n]) => [
|
|
1130
1800
|
r,
|
|
1131
|
-
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${
|
|
1801
|
+
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${n})`
|
|
1132
1802
|
])
|
|
1133
1803
|
)
|
|
1134
1804
|
])
|
|
1135
|
-
),
|
|
1805
|
+
), Oe = {
|
|
1136
1806
|
/* Display */
|
|
1137
1807
|
block: "display:block;",
|
|
1138
1808
|
inline: "display:inline;",
|
|
@@ -1347,7 +2017,7 @@ const Xe = Pe`
|
|
|
1347
2017
|
"z-30": "z-index:30;",
|
|
1348
2018
|
"z-40": "z-index:40;",
|
|
1349
2019
|
"z-50": "z-index:50;"
|
|
1350
|
-
},
|
|
2020
|
+
}, Mt = "0.25rem", Ve = {
|
|
1351
2021
|
m: ["margin"],
|
|
1352
2022
|
mx: ["margin-inline"],
|
|
1353
2023
|
my: ["margin-block"],
|
|
@@ -1379,34 +2049,34 @@ const Xe = Pe`
|
|
|
1379
2049
|
"gap-x": ["column-gap"],
|
|
1380
2050
|
"gap-y": ["row-gap"]
|
|
1381
2051
|
};
|
|
1382
|
-
function
|
|
1383
|
-
let r = 0,
|
|
1384
|
-
for (let
|
|
1385
|
-
const
|
|
1386
|
-
if (
|
|
1387
|
-
else if (
|
|
1388
|
-
else if (
|
|
1389
|
-
else if (
|
|
1390
|
-
else if (r === 0 &&
|
|
1391
|
-
return e.slice(0,
|
|
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];
|
|
2056
|
+
if (s === "[") r++;
|
|
2057
|
+
else if (s === "]" && r > 0) r--;
|
|
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);
|
|
1392
2062
|
}
|
|
1393
2063
|
return e + t;
|
|
1394
2064
|
}
|
|
1395
|
-
const
|
|
2065
|
+
const Nt = {
|
|
1396
2066
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1397
2067
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1398
|
-
hover: (e, t) => `${
|
|
1399
|
-
focus: (e, t) => `${
|
|
1400
|
-
active: (e, t) => `${
|
|
1401
|
-
disabled: (e, t) => `${
|
|
1402
|
-
visited: (e, t) => `${
|
|
1403
|
-
checked: (e, t) => `${
|
|
1404
|
-
first: (e, t) => `${
|
|
1405
|
-
last: (e, t) => `${
|
|
1406
|
-
odd: (e, t) => `${
|
|
1407
|
-
even: (e, t) => `${
|
|
1408
|
-
"focus-within": (e, t) => `${
|
|
1409
|
-
"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}}`,
|
|
1410
2080
|
"group-hover": (e, t) => `.group:hover ${e}{${t}}`,
|
|
1411
2081
|
"group-focus": (e, t) => `.group:focus ${e}{${t}}`,
|
|
1412
2082
|
"group-active": (e, t) => `.group:active ${e}{${t}}`,
|
|
@@ -1415,7 +2085,7 @@ const nt = {
|
|
|
1415
2085
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1416
2086
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1417
2087
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1418
|
-
},
|
|
2088
|
+
}, Pe = {
|
|
1419
2089
|
// Responsive
|
|
1420
2090
|
sm: "(min-width:640px)",
|
|
1421
2091
|
md: "(min-width:768px)",
|
|
@@ -1424,25 +2094,25 @@ const nt = {
|
|
|
1424
2094
|
"2xl": "(min-width:1536px)",
|
|
1425
2095
|
// Dark mode (now plain string)
|
|
1426
2096
|
dark: "(prefers-color-scheme: dark)"
|
|
1427
|
-
},
|
|
1428
|
-
function
|
|
1429
|
-
const t = e.startsWith("-"),
|
|
1430
|
-
if (
|
|
1431
|
-
const
|
|
1432
|
-
if (Number.isNaN(
|
|
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;
|
|
1433
2103
|
const a = t ? "-" : "";
|
|
1434
|
-
return
|
|
2104
|
+
return Ve[i].map((u) => `${u}:calc(${a}${Mt} * ${o});`).join("");
|
|
1435
2105
|
}
|
|
1436
|
-
function
|
|
1437
|
-
const t = e.replace("#", ""), r = parseInt(t, 16),
|
|
1438
|
-
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}`;
|
|
1439
2109
|
}
|
|
1440
|
-
function
|
|
2110
|
+
function Wt(e) {
|
|
1441
2111
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1442
2112
|
if (!t) return null;
|
|
1443
|
-
const [, r,
|
|
1444
|
-
if (!
|
|
1445
|
-
if (r === "shadow") return `--ce-shadow-color:${
|
|
2113
|
+
const [, r, n, i = "DEFAULT"] = t, s = jt[n]?.[i];
|
|
2114
|
+
if (!s) return null;
|
|
2115
|
+
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
1446
2116
|
const a = {
|
|
1447
2117
|
bg: "background-color",
|
|
1448
2118
|
decoration: "text-decoration-color",
|
|
@@ -1454,58 +2124,58 @@ function it(e) {
|
|
|
1454
2124
|
fill: "fill",
|
|
1455
2125
|
stroke: "stroke"
|
|
1456
2126
|
}[r];
|
|
1457
|
-
return a ? `${a}:${
|
|
2127
|
+
return a ? `${a}:${s};` : null;
|
|
1458
2128
|
}
|
|
1459
|
-
function
|
|
2129
|
+
function zt(e) {
|
|
1460
2130
|
const [t, r] = e.split("/");
|
|
1461
2131
|
if (!r) return { base: t };
|
|
1462
|
-
const
|
|
1463
|
-
return isNaN(
|
|
2132
|
+
const n = parseInt(r, 10);
|
|
2133
|
+
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
1464
2134
|
}
|
|
1465
|
-
function
|
|
1466
|
-
const { base: t, opacity: r } =
|
|
1467
|
-
if (
|
|
2135
|
+
function Me(e) {
|
|
2136
|
+
const { base: t, opacity: r } = zt(e), n = Wt(t);
|
|
2137
|
+
if (n) {
|
|
1468
2138
|
if (r !== void 0) {
|
|
1469
|
-
const
|
|
1470
|
-
if (
|
|
1471
|
-
const
|
|
1472
|
-
return
|
|
2139
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
2140
|
+
if (s) {
|
|
2141
|
+
const o = Je(s[0]);
|
|
2142
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1473
2143
|
}
|
|
1474
2144
|
}
|
|
1475
|
-
return
|
|
2145
|
+
return n;
|
|
1476
2146
|
}
|
|
1477
|
-
const
|
|
1478
|
-
if (
|
|
1479
|
-
const
|
|
1480
|
-
if (
|
|
1481
|
-
const
|
|
1482
|
-
return
|
|
2147
|
+
const i = Ee(t);
|
|
2148
|
+
if (i && r !== void 0) {
|
|
2149
|
+
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
2150
|
+
if (s) {
|
|
2151
|
+
const o = Je(s[0]);
|
|
2152
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1483
2153
|
}
|
|
1484
2154
|
}
|
|
1485
|
-
return
|
|
2155
|
+
return i;
|
|
1486
2156
|
}
|
|
1487
|
-
function
|
|
2157
|
+
function Ne(e) {
|
|
1488
2158
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
1489
2159
|
if (!t) return null;
|
|
1490
2160
|
const r = parseInt(t[1], 10);
|
|
1491
2161
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1492
2162
|
}
|
|
1493
|
-
function
|
|
2163
|
+
function Ee(e) {
|
|
1494
2164
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1495
|
-
const
|
|
1496
|
-
if (
|
|
1497
|
-
const
|
|
1498
|
-
let
|
|
1499
|
-
return
|
|
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();
|
|
2169
|
+
return o = o.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), o = o.replace(/^'([^']*)'$/g, '"$1"'), `${s}:${o};`;
|
|
1500
2170
|
}
|
|
1501
2171
|
return null;
|
|
1502
2172
|
}
|
|
1503
2173
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
1504
2174
|
if (t > 0 && r) {
|
|
1505
|
-
const
|
|
1506
|
-
let
|
|
1507
|
-
|
|
1508
|
-
const
|
|
2175
|
+
const n = e.slice(0, t);
|
|
2176
|
+
let i = e.slice(t + 2, -1);
|
|
2177
|
+
i = i.replace(/_/g, " ");
|
|
2178
|
+
const s = {
|
|
1509
2179
|
bg: "background-color",
|
|
1510
2180
|
text: "color",
|
|
1511
2181
|
shadow: "box-shadow",
|
|
@@ -1547,14 +2217,14 @@ function fe(e) {
|
|
|
1547
2217
|
leading: "line-height",
|
|
1548
2218
|
z: "z-index"
|
|
1549
2219
|
};
|
|
1550
|
-
if (
|
|
1551
|
-
return `transform:rotate(${
|
|
1552
|
-
const
|
|
1553
|
-
if (
|
|
2220
|
+
if (n === "rotate")
|
|
2221
|
+
return `transform:rotate(${i});`;
|
|
2222
|
+
const o = s[n] ?? n.replace(/_/g, "-");
|
|
2223
|
+
if (o && i) return `${o}:${i};`;
|
|
1554
2224
|
}
|
|
1555
2225
|
return null;
|
|
1556
2226
|
}
|
|
1557
|
-
function
|
|
2227
|
+
function Dt(e) {
|
|
1558
2228
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1559
2229
|
const r = e.slice(1, -1);
|
|
1560
2230
|
return r.includes("&") ? r : e;
|
|
@@ -1566,44 +2236,44 @@ function ot(e) {
|
|
|
1566
2236
|
}
|
|
1567
2237
|
return null;
|
|
1568
2238
|
}
|
|
1569
|
-
function
|
|
2239
|
+
function It(e) {
|
|
1570
2240
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1571
2241
|
}
|
|
1572
|
-
function
|
|
2242
|
+
function Ht(e) {
|
|
1573
2243
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1574
|
-
let
|
|
1575
|
-
for (;
|
|
1576
|
-
const
|
|
1577
|
-
|
|
2244
|
+
let n;
|
|
2245
|
+
for (; n = t.exec(e); ) {
|
|
2246
|
+
const i = n[2].split(/\s+/).filter(Boolean);
|
|
2247
|
+
i.length && r.push(...i);
|
|
1578
2248
|
}
|
|
1579
2249
|
return r.filter(Boolean);
|
|
1580
2250
|
}
|
|
1581
|
-
const
|
|
1582
|
-
function
|
|
1583
|
-
const t = Date.now(), r =
|
|
1584
|
-
if (r && t - r.timestamp <
|
|
1585
|
-
const
|
|
1586
|
-
function
|
|
1587
|
-
const
|
|
1588
|
-
if (
|
|
1589
|
-
const
|
|
1590
|
-
return p
|
|
1591
|
-
}
|
|
1592
|
-
function
|
|
1593
|
-
const
|
|
1594
|
-
return
|
|
1595
|
-
}
|
|
1596
|
-
function
|
|
1597
|
-
const
|
|
1598
|
-
let
|
|
1599
|
-
for (let
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1602
|
-
}
|
|
1603
|
-
return
|
|
1604
|
-
}
|
|
1605
|
-
function
|
|
1606
|
-
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) {
|
|
1607
2277
|
case "hover":
|
|
1608
2278
|
return ":hover";
|
|
1609
2279
|
case "focus":
|
|
@@ -1632,210 +2302,234 @@ function ft(e) {
|
|
|
1632
2302
|
return null;
|
|
1633
2303
|
}
|
|
1634
2304
|
}
|
|
1635
|
-
function
|
|
1636
|
-
const
|
|
1637
|
-
let
|
|
1638
|
-
const
|
|
1639
|
-
if (!
|
|
1640
|
-
const
|
|
1641
|
-
if (!
|
|
1642
|
-
const
|
|
1643
|
-
let
|
|
1644
|
-
|
|
1645
|
-
const
|
|
1646
|
-
let T =
|
|
1647
|
-
const
|
|
1648
|
-
for (const
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1652
|
-
let
|
|
1653
|
-
for (const
|
|
1654
|
-
if (
|
|
1655
|
-
const
|
|
1656
|
-
if (
|
|
1657
|
-
|
|
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);
|
|
2311
|
+
if (!f) return null;
|
|
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;
|
|
1658
2328
|
continue;
|
|
1659
2329
|
}
|
|
1660
|
-
const
|
|
1661
|
-
if (
|
|
1662
|
-
|
|
2330
|
+
const D = l(E);
|
|
2331
|
+
if (D) {
|
|
2332
|
+
J ? B.push(D) : P.push(D);
|
|
1663
2333
|
continue;
|
|
1664
2334
|
}
|
|
1665
|
-
const
|
|
1666
|
-
typeof
|
|
1667
|
-
}
|
|
1668
|
-
function
|
|
1669
|
-
if (!
|
|
1670
|
-
let
|
|
1671
|
-
if (
|
|
1672
|
-
let
|
|
1673
|
-
for (;
|
|
1674
|
-
for (;
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1677
|
-
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);
|
|
1678
2348
|
}
|
|
1679
|
-
return
|
|
2349
|
+
return E + U;
|
|
1680
2350
|
}
|
|
1681
|
-
for (let
|
|
1682
|
-
const
|
|
1683
|
-
if (
|
|
1684
|
-
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);
|
|
1685
2355
|
}
|
|
1686
|
-
return
|
|
1687
|
-
}
|
|
1688
|
-
const
|
|
1689
|
-
if (
|
|
1690
|
-
if (
|
|
1691
|
-
const
|
|
1692
|
-
if (
|
|
1693
|
-
T =
|
|
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);
|
|
1694
2364
|
else {
|
|
1695
|
-
const
|
|
1696
|
-
T =
|
|
2365
|
+
const I = ye(D, L);
|
|
2366
|
+
T = O.replace(S, U + z + I);
|
|
1697
2367
|
}
|
|
1698
2368
|
} else
|
|
1699
|
-
T = T.replace(
|
|
2369
|
+
T = T.replace(S, `${J}${S + K}`), L && (T = T.replace(S, `${S}${L}`));
|
|
1700
2370
|
else
|
|
1701
|
-
T =
|
|
1702
|
-
T = T.replace(new RegExp(
|
|
1703
|
-
let
|
|
1704
|
-
const
|
|
1705
|
-
return
|
|
1706
|
-
}
|
|
1707
|
-
for (const
|
|
1708
|
-
const
|
|
1709
|
-
(
|
|
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)
|
|
1710
2380
|
);
|
|
1711
|
-
if (!
|
|
1712
|
-
const
|
|
1713
|
-
if (
|
|
1714
|
-
const
|
|
1715
|
-
|
|
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);
|
|
1716
2386
|
} else {
|
|
1717
|
-
const
|
|
1718
|
-
|
|
2387
|
+
const f = g(b);
|
|
2388
|
+
f && (k === 1 ? s.push(f) : k === 2 ? o.push(f) : k === 3 && a.push(f));
|
|
1719
2389
|
}
|
|
1720
2390
|
}
|
|
1721
|
-
const v = [...
|
|
1722
|
-
return
|
|
2391
|
+
const v = [...s, ...o, ...a, ...u].join("");
|
|
2392
|
+
return Ze.set(e, { css: v, timestamp: t }), v;
|
|
1723
2393
|
}
|
|
1724
|
-
const
|
|
1725
|
-
function
|
|
2394
|
+
const pe = [];
|
|
2395
|
+
function qt(e, t, r, n, i, s, o, a) {
|
|
1726
2396
|
if (e) {
|
|
1727
|
-
|
|
2397
|
+
pe.push(r);
|
|
1728
2398
|
try {
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
}
|
|
1737
|
-
const f = t.render(r);
|
|
1738
|
-
if (f instanceof Promise) {
|
|
1739
|
-
o(!0), f.then((p) => {
|
|
1740
|
-
o(!1), s(null), Q(e, p, r, i, n), a(e.innerHTML);
|
|
1741
|
-
}).catch((p) => {
|
|
1742
|
-
o(!1), s(p), t.errorTemplate && Q(e, t.errorTemplate(p, r), r, i, n);
|
|
1743
|
-
}), t.loadingTemplate && Q(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
|
+
});
|
|
1744
2406
|
return;
|
|
1745
2407
|
}
|
|
1746
|
-
|
|
2408
|
+
Ge(e, u, r, n, i), a(e.innerHTML);
|
|
1747
2409
|
} finally {
|
|
1748
|
-
|
|
2410
|
+
pe.pop();
|
|
1749
2411
|
}
|
|
1750
2412
|
}
|
|
1751
2413
|
}
|
|
1752
|
-
function
|
|
1753
|
-
e && (
|
|
2414
|
+
function Ge(e, t, r, n, i) {
|
|
2415
|
+
e && (Rt(
|
|
1754
2416
|
e,
|
|
1755
2417
|
Array.isArray(t) ? t : [t],
|
|
1756
2418
|
r,
|
|
1757
|
-
|
|
1758
|
-
),
|
|
2419
|
+
n
|
|
2420
|
+
), i(e.innerHTML));
|
|
1759
2421
|
}
|
|
1760
|
-
function
|
|
1761
|
-
if (
|
|
1762
|
-
if (
|
|
1763
|
-
|
|
2422
|
+
function Ft(e, t, r, n, i, s, o) {
|
|
2423
|
+
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
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);
|
|
1764
2440
|
return;
|
|
1765
2441
|
}
|
|
1766
2442
|
} else
|
|
1767
|
-
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1770
|
-
}, 0);
|
|
1771
|
-
|
|
2443
|
+
i(0);
|
|
2444
|
+
const m = setTimeout(() => {
|
|
2445
|
+
n(Date.now()), e(), o(null);
|
|
2446
|
+
}, r > 10 ? 100 : 0);
|
|
2447
|
+
o(m);
|
|
1772
2448
|
}
|
|
1773
|
-
function
|
|
2449
|
+
function Kt(e, t, r, n, i) {
|
|
1774
2450
|
if (!e) return;
|
|
1775
|
-
const s =
|
|
1776
|
-
if (
|
|
1777
|
-
|
|
2451
|
+
const s = Ut(r);
|
|
2452
|
+
if ((!s || s.trim() === "") && !t._computedStyle) {
|
|
2453
|
+
i(null), e.adoptedStyleSheets = [Ke()];
|
|
1778
2454
|
return;
|
|
1779
2455
|
}
|
|
1780
|
-
let
|
|
1781
|
-
t.
|
|
1782
|
-
let
|
|
2456
|
+
let o = "";
|
|
2457
|
+
t._computedStyle && (o = t._computedStyle);
|
|
2458
|
+
let a = Ot(`${o}
|
|
1783
2459
|
${s}
|
|
1784
2460
|
`);
|
|
1785
|
-
|
|
1786
|
-
let
|
|
1787
|
-
|
|
2461
|
+
a = ot(a);
|
|
2462
|
+
let u = n;
|
|
2463
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Ke(), u], i(u);
|
|
1788
2464
|
}
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
e[je] || (e[je] = de);
|
|
2465
|
+
let N = null;
|
|
2466
|
+
function Vt(e) {
|
|
2467
|
+
N = e;
|
|
1793
2468
|
}
|
|
1794
|
-
function
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
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
|
|
1800
2484
|
});
|
|
2485
|
+
}
|
|
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);
|
|
1801
2510
|
try {
|
|
1802
|
-
const
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
}), s.length > 0) {
|
|
1817
|
-
const a = Array.from(new Set(s));
|
|
1818
|
-
console.warn(
|
|
1819
|
-
`[${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.`
|
|
1820
|
-
);
|
|
1821
|
-
}
|
|
1822
|
-
} catch {
|
|
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
|
+
});
|
|
1823
2525
|
}
|
|
1824
|
-
if (de.set(i, n), typeof window < "u")
|
|
1825
|
-
if (!customElements.get(i))
|
|
1826
|
-
customElements.define(i, ht(i, n));
|
|
1827
|
-
else
|
|
1828
|
-
try {
|
|
1829
|
-
document.querySelectorAll(i).forEach((o) => {
|
|
1830
|
-
try {
|
|
1831
|
-
typeof o._cfg < "u" && (o._cfg = n), typeof o._render == "function" && o._render(n);
|
|
1832
|
-
} catch {
|
|
1833
|
-
}
|
|
1834
|
-
});
|
|
1835
|
-
} catch {
|
|
1836
|
-
}
|
|
1837
2526
|
}
|
|
1838
|
-
|
|
2527
|
+
const $e = /* @__PURE__ */ new Map(), Xe = Symbol.for("cer.registry");
|
|
2528
|
+
if (typeof window < "u") {
|
|
2529
|
+
const e = globalThis;
|
|
2530
|
+
e[Xe] || (e[Xe] = $e);
|
|
2531
|
+
}
|
|
2532
|
+
function Zt(e, t) {
|
|
1839
2533
|
if (!t.render)
|
|
1840
2534
|
throw new Error(
|
|
1841
2535
|
"Component must have a render function"
|
|
@@ -1853,6 +2547,7 @@ function ht(e, t) {
|
|
|
1853
2547
|
_mounted = !1;
|
|
1854
2548
|
_hasError = !1;
|
|
1855
2549
|
_initializing = !0;
|
|
2550
|
+
_componentId;
|
|
1856
2551
|
_styleSheet = null;
|
|
1857
2552
|
_lastHtmlStringForJitCSS = "";
|
|
1858
2553
|
/**
|
|
@@ -1879,7 +2574,7 @@ function ht(e, t) {
|
|
|
1879
2574
|
_templateLoading = !1;
|
|
1880
2575
|
_templateError = null;
|
|
1881
2576
|
constructor() {
|
|
1882
|
-
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)}`;
|
|
1883
2578
|
const r = this._initContext(t);
|
|
1884
2579
|
Object.defineProperty(r, "refs", {
|
|
1885
2580
|
value: this._refs,
|
|
@@ -1891,13 +2586,28 @@ function ht(e, t) {
|
|
|
1891
2586
|
writable: !1,
|
|
1892
2587
|
enumerable: !1,
|
|
1893
2588
|
configurable: !1
|
|
2589
|
+
}), Object.defineProperty(r, "_requestRender", {
|
|
2590
|
+
value: () => this._requestRender(),
|
|
2591
|
+
writable: !1,
|
|
2592
|
+
enumerable: !1,
|
|
2593
|
+
configurable: !1
|
|
2594
|
+
}), Object.defineProperty(r, "_componentId", {
|
|
2595
|
+
value: this._componentId,
|
|
2596
|
+
writable: !1,
|
|
2597
|
+
enumerable: !1,
|
|
2598
|
+
configurable: !1
|
|
2599
|
+
}), Object.defineProperty(r, "_triggerWatchers", {
|
|
2600
|
+
value: (i, s) => this._triggerWatchers(i, s),
|
|
2601
|
+
writable: !1,
|
|
2602
|
+
enumerable: !1,
|
|
2603
|
+
configurable: !1
|
|
1894
2604
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
1895
|
-
value: (
|
|
1896
|
-
const a = new CustomEvent(
|
|
1897
|
-
detail:
|
|
2605
|
+
value: (i, s, o) => {
|
|
2606
|
+
const a = new CustomEvent(i, {
|
|
2607
|
+
detail: s,
|
|
1898
2608
|
bubbles: !0,
|
|
1899
2609
|
composed: !0,
|
|
1900
|
-
...
|
|
2610
|
+
...o || {}
|
|
1901
2611
|
});
|
|
1902
2612
|
return this.dispatchEvent(a), !a.defaultPrevented;
|
|
1903
2613
|
},
|
|
@@ -1905,15 +2615,28 @@ function ht(e, t) {
|
|
|
1905
2615
|
enumerable: !1,
|
|
1906
2616
|
configurable: !1
|
|
1907
2617
|
});
|
|
1908
|
-
const
|
|
1909
|
-
Object.keys(
|
|
1910
|
-
const
|
|
1911
|
-
typeof
|
|
1912
|
-
}), this._applyComputed(
|
|
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, {
|
|
2625
|
+
get() {
|
|
2626
|
+
return s;
|
|
2627
|
+
},
|
|
2628
|
+
set(o) {
|
|
2629
|
+
const a = s;
|
|
2630
|
+
s = o, this.context[i] = o, this._initializing || (this._applyProps(n), a !== o && this._requestRender());
|
|
2631
|
+
},
|
|
2632
|
+
enumerable: !0,
|
|
2633
|
+
configurable: !0
|
|
2634
|
+
});
|
|
2635
|
+
}), this._initializing = !1, this._initWatchers(n), this._applyProps(n), this._render(n);
|
|
1913
2636
|
}
|
|
1914
2637
|
connectedCallback() {
|
|
1915
2638
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1916
|
-
this._applyProps(t),
|
|
2639
|
+
this._applyProps(t), this._requestRender(), bt(
|
|
1917
2640
|
t,
|
|
1918
2641
|
this.context,
|
|
1919
2642
|
this._mounted,
|
|
@@ -1925,7 +2648,7 @@ function ht(e, t) {
|
|
|
1925
2648
|
}
|
|
1926
2649
|
disconnectedCallback() {
|
|
1927
2650
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1928
|
-
|
|
2651
|
+
wt(
|
|
1929
2652
|
t,
|
|
1930
2653
|
this.context,
|
|
1931
2654
|
this._listeners,
|
|
@@ -1947,51 +2670,40 @@ function ht(e, t) {
|
|
|
1947
2670
|
);
|
|
1948
2671
|
});
|
|
1949
2672
|
}
|
|
1950
|
-
attributeChangedCallback(r,
|
|
2673
|
+
attributeChangedCallback(r, n, i) {
|
|
1951
2674
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1952
|
-
this._applyProps(t),
|
|
2675
|
+
this._applyProps(t), n !== i && this._requestRender(), vt(
|
|
1953
2676
|
t,
|
|
1954
2677
|
r,
|
|
1955
|
-
i,
|
|
1956
2678
|
n,
|
|
2679
|
+
i,
|
|
1957
2680
|
this.context
|
|
1958
2681
|
);
|
|
1959
2682
|
});
|
|
1960
2683
|
}
|
|
1961
2684
|
static get observedAttributes() {
|
|
1962
|
-
return t.props ? Object.keys(t.props).map(
|
|
2685
|
+
return t.props ? Object.keys(t.props).map(te) : [];
|
|
1963
2686
|
}
|
|
1964
2687
|
_applyComputed(r) {
|
|
1965
|
-
this._runLogicWithinErrorBoundary(t, () => {
|
|
1966
|
-
r.computed && Object.entries(r.computed).forEach(([i, n]) => {
|
|
1967
|
-
Object.defineProperty(this.context, i, {
|
|
1968
|
-
get: () => {
|
|
1969
|
-
const o = n(this.context);
|
|
1970
|
-
return J(o);
|
|
1971
|
-
},
|
|
1972
|
-
enumerable: !0
|
|
1973
|
-
});
|
|
1974
|
-
});
|
|
1975
|
-
});
|
|
1976
2688
|
}
|
|
1977
2689
|
// --- Render ---
|
|
1978
2690
|
_render(r) {
|
|
1979
2691
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1980
|
-
|
|
2692
|
+
qt(
|
|
1981
2693
|
this.shadowRoot,
|
|
1982
2694
|
r,
|
|
1983
2695
|
this.context,
|
|
1984
2696
|
this._refs,
|
|
1985
|
-
(
|
|
1986
|
-
this._lastHtmlStringForJitCSS =
|
|
2697
|
+
(n) => {
|
|
2698
|
+
this._lastHtmlStringForJitCSS = n, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(n);
|
|
1987
2699
|
},
|
|
1988
|
-
(
|
|
1989
|
-
this._templateLoading =
|
|
2700
|
+
(n) => {
|
|
2701
|
+
this._templateLoading = n, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(n);
|
|
1990
2702
|
},
|
|
1991
|
-
(
|
|
1992
|
-
this._templateError =
|
|
2703
|
+
(n) => {
|
|
2704
|
+
this._templateError = n, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(n);
|
|
1993
2705
|
},
|
|
1994
|
-
(
|
|
2706
|
+
(n) => this._applyStyle(r, n)
|
|
1995
2707
|
);
|
|
1996
2708
|
});
|
|
1997
2709
|
}
|
|
@@ -2000,58 +2712,56 @@ function ht(e, t) {
|
|
|
2000
2712
|
}
|
|
2001
2713
|
_requestRender() {
|
|
2002
2714
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
2003
|
-
|
|
2004
|
-
(
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2715
|
+
le(() => {
|
|
2716
|
+
Ft(
|
|
2717
|
+
() => this._render(this._cfg),
|
|
2718
|
+
this._lastRenderTime,
|
|
2719
|
+
this._renderCount,
|
|
2720
|
+
(r) => {
|
|
2721
|
+
this._lastRenderTime = r;
|
|
2722
|
+
},
|
|
2723
|
+
(r) => {
|
|
2724
|
+
this._renderCount = r;
|
|
2725
|
+
},
|
|
2726
|
+
this._renderTimeoutId,
|
|
2727
|
+
(r) => {
|
|
2728
|
+
this._renderTimeoutId = r;
|
|
2729
|
+
}
|
|
2730
|
+
);
|
|
2731
|
+
}, this._componentId);
|
|
2018
2732
|
});
|
|
2019
2733
|
}
|
|
2020
2734
|
// --- Style ---
|
|
2021
|
-
_applyStyle(r,
|
|
2735
|
+
_applyStyle(r, n) {
|
|
2022
2736
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2023
|
-
|
|
2737
|
+
Kt(
|
|
2024
2738
|
this.shadowRoot,
|
|
2025
|
-
r,
|
|
2026
2739
|
this.context,
|
|
2027
|
-
|
|
2740
|
+
n,
|
|
2028
2741
|
this._styleSheet,
|
|
2029
|
-
(
|
|
2030
|
-
this._styleSheet =
|
|
2742
|
+
(i) => {
|
|
2743
|
+
this._styleSheet = i;
|
|
2031
2744
|
}
|
|
2032
2745
|
);
|
|
2033
2746
|
});
|
|
2034
2747
|
}
|
|
2035
2748
|
// --- Error Boundary function ---
|
|
2036
|
-
_runLogicWithinErrorBoundary(r,
|
|
2749
|
+
_runLogicWithinErrorBoundary(r, n) {
|
|
2037
2750
|
this._hasError && (this._hasError = !1);
|
|
2038
2751
|
try {
|
|
2039
|
-
|
|
2040
|
-
} catch (
|
|
2041
|
-
this._hasError = !0, r.onError && r.onError(
|
|
2042
|
-
n,
|
|
2043
|
-
this.context
|
|
2044
|
-
));
|
|
2752
|
+
n();
|
|
2753
|
+
} catch (i) {
|
|
2754
|
+
this._hasError = !0, r.onError && r.onError(i, this.context);
|
|
2045
2755
|
}
|
|
2046
2756
|
}
|
|
2047
2757
|
// --- State, props, computed ---
|
|
2048
2758
|
_initContext(r) {
|
|
2049
2759
|
try {
|
|
2050
|
-
let
|
|
2051
|
-
return Array.isArray(
|
|
2052
|
-
get(a,
|
|
2053
|
-
const
|
|
2054
|
-
return typeof
|
|
2760
|
+
let n = function(s, o = "") {
|
|
2761
|
+
return Array.isArray(s) ? new Proxy(s, {
|
|
2762
|
+
get(a, u, m) {
|
|
2763
|
+
const g = Reflect.get(a, u, m);
|
|
2764
|
+
return typeof g == "function" && typeof u == "string" && [
|
|
2055
2765
|
"push",
|
|
2056
2766
|
"pop",
|
|
2057
2767
|
"shift",
|
|
@@ -2059,171 +2769,303 @@ function ht(e, t) {
|
|
|
2059
2769
|
"splice",
|
|
2060
2770
|
"sort",
|
|
2061
2771
|
"reverse"
|
|
2062
|
-
].includes(
|
|
2063
|
-
const
|
|
2064
|
-
if (!
|
|
2065
|
-
const
|
|
2066
|
-
|
|
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);
|
|
2067
2777
|
}
|
|
2068
|
-
return
|
|
2069
|
-
} :
|
|
2778
|
+
return l;
|
|
2779
|
+
} : g;
|
|
2070
2780
|
},
|
|
2071
|
-
set(a,
|
|
2072
|
-
if (a[
|
|
2073
|
-
const
|
|
2074
|
-
|
|
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);
|
|
2075
2785
|
}
|
|
2076
2786
|
return !0;
|
|
2077
2787
|
},
|
|
2078
|
-
deleteProperty(a,
|
|
2079
|
-
if (delete a[
|
|
2080
|
-
const
|
|
2081
|
-
|
|
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);
|
|
2082
2792
|
}
|
|
2083
2793
|
return !0;
|
|
2084
2794
|
}
|
|
2085
|
-
}) :
|
|
2086
|
-
const
|
|
2087
|
-
|
|
2088
|
-
}), new Proxy(
|
|
2089
|
-
set(a,
|
|
2090
|
-
const
|
|
2091
|
-
return a[
|
|
2092
|
-
|
|
2093
|
-
a[
|
|
2094
|
-
),
|
|
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);
|
|
2798
|
+
}), new Proxy(s, {
|
|
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;
|
|
2095
2805
|
},
|
|
2096
|
-
get(a,
|
|
2097
|
-
return Reflect.get(a,
|
|
2806
|
+
get(a, u, m) {
|
|
2807
|
+
return Reflect.get(a, u, m);
|
|
2098
2808
|
}
|
|
2099
|
-
})) :
|
|
2809
|
+
})) : s;
|
|
2100
2810
|
};
|
|
2101
|
-
const
|
|
2102
|
-
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
|
+
});
|
|
2103
2819
|
} catch {
|
|
2104
2820
|
return {};
|
|
2105
2821
|
}
|
|
2106
2822
|
}
|
|
2107
2823
|
_initWatchers(r) {
|
|
2108
2824
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2109
|
-
|
|
2825
|
+
ht(
|
|
2110
2826
|
this.context,
|
|
2111
2827
|
this._watchers,
|
|
2112
|
-
|
|
2828
|
+
{}
|
|
2829
|
+
// Watchers are now handled by the watch() function in functional API
|
|
2113
2830
|
);
|
|
2114
2831
|
});
|
|
2115
2832
|
}
|
|
2116
|
-
_triggerWatchers(r,
|
|
2117
|
-
|
|
2833
|
+
_triggerWatchers(r, n) {
|
|
2834
|
+
gt(this.context, this._watchers, r, n);
|
|
2118
2835
|
}
|
|
2119
2836
|
_applyProps(r) {
|
|
2120
2837
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2121
2838
|
try {
|
|
2122
|
-
|
|
2123
|
-
} catch (
|
|
2124
|
-
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
|
+
}
|
|
2125
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();
|
|
2126
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
|
+
}
|
|
2127
2916
|
}
|
|
2128
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
|
+
}
|
|
2943
|
+
}
|
|
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
|
+
);
|
|
2129
2957
|
}
|
|
2130
|
-
function
|
|
2131
|
-
const
|
|
2132
|
-
return { tag: e, key:
|
|
2958
|
+
function fe(e, t = {}, r, n) {
|
|
2959
|
+
const i = n ?? t.key;
|
|
2960
|
+
return { tag: e, key: i, props: t, children: r };
|
|
2133
2961
|
}
|
|
2134
|
-
function
|
|
2962
|
+
function Se(e) {
|
|
2135
2963
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
2136
2964
|
}
|
|
2137
|
-
function
|
|
2138
|
-
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);
|
|
2139
2967
|
}
|
|
2140
|
-
function
|
|
2968
|
+
function Yt(e, t) {
|
|
2141
2969
|
return e.key != null ? e : { ...e, key: t };
|
|
2142
2970
|
}
|
|
2143
|
-
function
|
|
2144
|
-
const
|
|
2145
|
-
let
|
|
2146
|
-
for (;
|
|
2147
|
-
const
|
|
2148
|
-
let
|
|
2149
|
-
|
|
2150
|
-
const
|
|
2151
|
-
if (
|
|
2152
|
-
const [v,
|
|
2153
|
-
if (
|
|
2154
|
-
const
|
|
2155
|
-
|
|
2156
|
-
value:
|
|
2157
|
-
modifiers:
|
|
2158
|
-
arg:
|
|
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] = {
|
|
2984
|
+
value: l,
|
|
2985
|
+
modifiers: y,
|
|
2986
|
+
arg: b
|
|
2159
2987
|
};
|
|
2160
|
-
} else
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2988
|
+
} else {
|
|
2989
|
+
let y = l;
|
|
2990
|
+
y && typeof y == "object" && y.constructor?.name === "ReactiveState" && (y = y.value), i[g] = y, o.push(g);
|
|
2991
|
+
}
|
|
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;
|
|
3004
|
+
}
|
|
3005
|
+
return { props: n, attrs: i, directives: s, bound: o };
|
|
3006
|
+
}
|
|
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;
|
|
3012
|
+
}
|
|
3013
|
+
function a(f, x) {
|
|
3014
|
+
return fe("#text", {}, f, x);
|
|
3015
|
+
}
|
|
3016
|
+
let u = "";
|
|
3017
|
+
for (let f = 0; f < e.length; f++)
|
|
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(
|
|
2183
3025
|
/;?\s*$/,
|
|
2184
3026
|
""
|
|
2185
|
-
), _ =
|
|
2186
|
-
|
|
2187
|
-
} else if (
|
|
2188
|
-
const
|
|
2189
|
-
.../* @__PURE__ */ new Set([...
|
|
3027
|
+
), _ = f.attrs.style.replace(/^;?\s*/, "");
|
|
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, ..._])
|
|
2190
3032
|
];
|
|
2191
|
-
|
|
3033
|
+
d.attrs.class = S.join(" ");
|
|
2192
3034
|
} else
|
|
2193
|
-
|
|
2194
|
-
}))) : (
|
|
2195
|
-
}
|
|
2196
|
-
function
|
|
2197
|
-
const
|
|
2198
|
-
if (
|
|
2199
|
-
const _ =
|
|
2200
|
-
let
|
|
2201
|
-
|
|
2202
|
-
...
|
|
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({
|
|
3044
|
+
...f,
|
|
2203
3045
|
key: _,
|
|
2204
|
-
children:
|
|
3046
|
+
children: S
|
|
2205
3047
|
});
|
|
2206
3048
|
return;
|
|
2207
3049
|
}
|
|
2208
|
-
if (
|
|
2209
|
-
|
|
3050
|
+
if (ke(f)) {
|
|
3051
|
+
A.push(Yt(f, void 0));
|
|
2210
3052
|
return;
|
|
2211
3053
|
}
|
|
2212
|
-
if (Array.isArray(
|
|
2213
|
-
if (
|
|
2214
|
-
for (let _ = 0; _ <
|
|
2215
|
-
const
|
|
2216
|
-
|
|
3054
|
+
if (Array.isArray(f)) {
|
|
3055
|
+
if (f.length === 0) return;
|
|
3056
|
+
for (let _ = 0; _ < f.length; _++) {
|
|
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}-${_}`));
|
|
2217
3059
|
}
|
|
2218
3060
|
return;
|
|
2219
3061
|
}
|
|
2220
|
-
if (
|
|
2221
|
-
|
|
3062
|
+
if (f !== null && typeof f == "object") {
|
|
3063
|
+
p(f);
|
|
2222
3064
|
return;
|
|
2223
3065
|
}
|
|
2224
|
-
|
|
3066
|
+
A.push(a(String(f), x));
|
|
2225
3067
|
}
|
|
2226
|
-
const
|
|
3068
|
+
const C = /* @__PURE__ */ new Set([
|
|
2227
3069
|
"area",
|
|
2228
3070
|
"base",
|
|
2229
3071
|
"br",
|
|
@@ -2239,378 +3081,697 @@ function yt(e, t, r) {
|
|
|
2239
3081
|
"track",
|
|
2240
3082
|
"wbr"
|
|
2241
3083
|
]);
|
|
2242
|
-
for (;
|
|
2243
|
-
if (
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
const T = {
|
|
2259
|
-
input: ["value", "checked", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2260
|
-
textarea: ["value", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2261
|
-
select: ["value", "disabled", "required", "multiple"],
|
|
2262
|
-
option: ["selected", "disabled", "value"],
|
|
2263
|
-
video: ["muted", "autoplay", "controls", "loop", "playsinline"],
|
|
2264
|
-
audio: ["muted", "autoplay", "controls", "loop"],
|
|
2265
|
-
img: ["src", "alt", "width", "height"],
|
|
2266
|
-
button: ["type", "name", "value", "disabled", "autofocus", "form"]
|
|
2267
|
-
}, B = l.toLowerCase(), G = T[B] ?? [];
|
|
2268
|
-
if ($.attrs)
|
|
2269
|
-
for (const M of G)
|
|
2270
|
-
A && A.includes(M) && M in $.attrs && !($.props && M in $.props) && ($.props[M] = $.attrs[M], delete $.attrs[M]);
|
|
2271
|
-
if ((l.includes("-") || !!n?.__customElements?.has?.(l)) && A && $.attrs) {
|
|
2272
|
-
const M = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
|
|
2273
|
-
for (const U of A)
|
|
2274
|
-
if (U in $.attrs && !($.props && U in $.props)) {
|
|
2275
|
-
const q = U.includes("-") ? U.split("-").map((I, z) => z === 0 ? I : I.charAt(0).toUpperCase() + I.slice(1)).join("") : U;
|
|
2276
|
-
$.props[q] = $.attrs[U], M.has(U) || delete $.attrs[U];
|
|
2277
|
-
}
|
|
2278
|
-
$.isCustomElement = !0;
|
|
2279
|
-
}
|
|
2280
|
-
} catch {
|
|
2281
|
-
}
|
|
2282
|
-
if (S && Object.keys(S).some((T) => T === "model" || T.startsWith("model:")))
|
|
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), {
|
|
3088
|
+
props: _,
|
|
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")))
|
|
3096
|
+
try {
|
|
3097
|
+
$.props.key = $.attrs.key;
|
|
3098
|
+
} catch {
|
|
3099
|
+
}
|
|
2283
3100
|
try {
|
|
2284
|
-
const
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
3101
|
+
const P = {
|
|
3102
|
+
input: ["value", "checked", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
3103
|
+
textarea: ["value", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
3104
|
+
select: ["value", "disabled", "required", "multiple"],
|
|
3105
|
+
option: ["selected", "disabled", "value"],
|
|
3106
|
+
video: ["muted", "autoplay", "controls", "loop", "playsinline"],
|
|
3107
|
+
audio: ["muted", "autoplay", "controls", "loop"],
|
|
3108
|
+
img: ["src", "alt", "width", "height"],
|
|
3109
|
+
button: ["type", "name", "value", "disabled", "autofocus", "form"]
|
|
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];
|
|
2295
3116
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
const
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
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];
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
2305
3127
|
} catch {
|
|
2306
3128
|
}
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
3129
|
+
if (R && Object.keys(R).some((P) => P === "model" || P.startsWith("model:")))
|
|
3130
|
+
try {
|
|
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;
|
|
3138
|
+
try {
|
|
3139
|
+
const re = te(E);
|
|
3140
|
+
$.attrs || ($.attrs = {}), O !== void 0 && ($.attrs[re] = O);
|
|
3141
|
+
} catch {
|
|
3142
|
+
}
|
|
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];
|
|
3156
|
+
}
|
|
3157
|
+
} catch {
|
|
3158
|
+
}
|
|
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) {
|
|
3179
|
+
if (!_) continue;
|
|
3180
|
+
const S = _.match(/^{{(\d+)}}$/);
|
|
3181
|
+
if (S) {
|
|
3182
|
+
const R = Number(S[1]), T = t[R], $ = `interp-${R}`;
|
|
3183
|
+
y(T, $);
|
|
3184
|
+
} else {
|
|
3185
|
+
const R = `text-${b++}`;
|
|
3186
|
+
x.push(a(_, R));
|
|
3187
|
+
}
|
|
2335
3188
|
}
|
|
2336
3189
|
}
|
|
2337
3190
|
}
|
|
2338
|
-
const
|
|
2339
|
-
|
|
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
|
+
}
|
|
2340
3480
|
}
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
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 };
|
|
2344
3499
|
}
|
|
2345
|
-
const
|
|
3500
|
+
const et = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
|
|
2346
3501
|
for (const r of e) {
|
|
2347
|
-
const
|
|
2348
|
-
if (
|
|
3502
|
+
const n = [], i = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
|
|
3503
|
+
if (o) {
|
|
2349
3504
|
const a = {};
|
|
2350
|
-
return
|
|
2351
|
-
a[
|
|
3505
|
+
return n.forEach((u, m) => {
|
|
3506
|
+
a[u] = o[m + 1];
|
|
2352
3507
|
}), { route: r, params: a };
|
|
2353
3508
|
}
|
|
2354
3509
|
}
|
|
2355
3510
|
return { route: null, params: {} };
|
|
2356
|
-
},
|
|
2357
|
-
async function
|
|
3511
|
+
}, ze = {};
|
|
3512
|
+
async function ir(e) {
|
|
2358
3513
|
if (e.component) return e.component;
|
|
2359
3514
|
if (e.load) {
|
|
2360
|
-
if (
|
|
3515
|
+
if (ze[e.path]) return ze[e.path];
|
|
2361
3516
|
try {
|
|
2362
3517
|
const t = await e.load();
|
|
2363
|
-
return
|
|
3518
|
+
return ze[e.path] = t.default, t.default;
|
|
2364
3519
|
} catch {
|
|
2365
3520
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2366
3521
|
}
|
|
2367
3522
|
}
|
|
2368
3523
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2369
3524
|
}
|
|
2370
|
-
function
|
|
2371
|
-
const { routes: t, base: r = "", initialUrl:
|
|
2372
|
-
let
|
|
2373
|
-
const
|
|
2374
|
-
const
|
|
2375
|
-
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)
|
|
2376
3531
|
try {
|
|
2377
|
-
const
|
|
2378
|
-
return typeof
|
|
2379
|
-
} catch (
|
|
2380
|
-
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;
|
|
2381
3536
|
}
|
|
2382
3537
|
return !0;
|
|
2383
|
-
},
|
|
2384
|
-
const
|
|
2385
|
-
if (
|
|
3538
|
+
}, h = async (v, b) => {
|
|
3539
|
+
const c = t.find((p) => Q([p], v.path).route !== null);
|
|
3540
|
+
if (c?.onEnter)
|
|
2386
3541
|
try {
|
|
2387
|
-
const
|
|
2388
|
-
return typeof
|
|
2389
|
-
} catch (
|
|
2390
|
-
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;
|
|
2391
3546
|
}
|
|
2392
3547
|
return !0;
|
|
2393
|
-
},
|
|
2394
|
-
const
|
|
2395
|
-
if (
|
|
3548
|
+
}, l = (v, b) => {
|
|
3549
|
+
const c = t.find((p) => Q([p], v.path).route !== null);
|
|
3550
|
+
if (c?.afterEnter)
|
|
2396
3551
|
try {
|
|
2397
|
-
|
|
2398
|
-
} catch (
|
|
2399
|
-
|
|
3552
|
+
c.afterEnter(v, b);
|
|
3553
|
+
} catch (p) {
|
|
3554
|
+
ie("afterEnter error", p);
|
|
2400
3555
|
}
|
|
2401
|
-
},
|
|
3556
|
+
}, d = async (v, b = !1) => {
|
|
2402
3557
|
try {
|
|
2403
|
-
const
|
|
3558
|
+
const c = {
|
|
2404
3559
|
path: v.replace(r, "") || "/",
|
|
2405
3560
|
query: {}
|
|
2406
|
-
},
|
|
2407
|
-
if (!
|
|
2408
|
-
const
|
|
2409
|
-
path:
|
|
2410
|
-
params:
|
|
2411
|
-
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
|
|
2412
3567
|
};
|
|
2413
|
-
if (!await C
|
|
2414
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2415
|
-
} catch (
|
|
2416
|
-
|
|
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);
|
|
2417
3572
|
}
|
|
2418
3573
|
};
|
|
2419
|
-
if (typeof window < "u" && typeof document < "u") {
|
|
2420
|
-
|
|
2421
|
-
const
|
|
2422
|
-
return { path:
|
|
2423
|
-
},
|
|
2424
|
-
const v =
|
|
2425
|
-
|
|
2426
|
-
path:
|
|
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({
|
|
3581
|
+
path: s.path,
|
|
2427
3582
|
params: v.params,
|
|
2428
|
-
query:
|
|
2429
|
-
}), a = async (
|
|
2430
|
-
const
|
|
2431
|
-
await
|
|
2432
|
-
}, window.addEventListener("popstate", () => a(!0)),
|
|
3583
|
+
query: s.query
|
|
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();
|
|
2433
3588
|
} else {
|
|
2434
|
-
|
|
2435
|
-
const
|
|
2436
|
-
return { path:
|
|
2437
|
-
},
|
|
2438
|
-
const v =
|
|
2439
|
-
|
|
2440
|
-
path:
|
|
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({
|
|
3595
|
+
path: s.path,
|
|
2441
3596
|
params: v.params,
|
|
2442
|
-
query:
|
|
3597
|
+
query: s.query
|
|
2443
3598
|
}), a = async () => {
|
|
2444
|
-
const
|
|
2445
|
-
await
|
|
3599
|
+
const c = i();
|
|
3600
|
+
await b(c.path);
|
|
2446
3601
|
};
|
|
2447
|
-
const
|
|
3602
|
+
const b = async (c) => {
|
|
2448
3603
|
try {
|
|
2449
|
-
const
|
|
2450
|
-
path:
|
|
3604
|
+
const p = {
|
|
3605
|
+
path: c.replace(r, "") || "/",
|
|
2451
3606
|
query: {}
|
|
2452
|
-
},
|
|
2453
|
-
if (!
|
|
2454
|
-
const
|
|
2455
|
-
path:
|
|
2456
|
-
params:
|
|
2457
|
-
query:
|
|
2458
|
-
},
|
|
2459
|
-
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)
|
|
2460
3615
|
try {
|
|
2461
|
-
const
|
|
2462
|
-
if (typeof
|
|
2463
|
-
await
|
|
3616
|
+
const x = await f.beforeEnter(k, C);
|
|
3617
|
+
if (typeof x == "string") {
|
|
3618
|
+
await b(x);
|
|
2464
3619
|
return;
|
|
2465
3620
|
}
|
|
2466
|
-
if (
|
|
3621
|
+
if (x === !1) return;
|
|
2467
3622
|
} catch {
|
|
2468
3623
|
return;
|
|
2469
3624
|
}
|
|
2470
|
-
if (
|
|
3625
|
+
if (f?.onEnter)
|
|
2471
3626
|
try {
|
|
2472
|
-
const
|
|
2473
|
-
if (typeof
|
|
2474
|
-
await
|
|
3627
|
+
const x = await f.onEnter(k, C);
|
|
3628
|
+
if (typeof x == "string") {
|
|
3629
|
+
await b(x);
|
|
2475
3630
|
return;
|
|
2476
3631
|
}
|
|
2477
|
-
if (
|
|
3632
|
+
if (x === !1) return;
|
|
2478
3633
|
} catch {
|
|
2479
3634
|
return;
|
|
2480
3635
|
}
|
|
2481
|
-
if (
|
|
3636
|
+
if (o.setState(k), f?.afterEnter)
|
|
2482
3637
|
try {
|
|
2483
|
-
|
|
3638
|
+
f.afterEnter(k, C);
|
|
2484
3639
|
} catch {
|
|
2485
3640
|
}
|
|
2486
3641
|
} catch {
|
|
2487
3642
|
}
|
|
2488
3643
|
};
|
|
2489
|
-
|
|
3644
|
+
u = async (c) => b(c), m = async (c) => b(c), g = () => {
|
|
2490
3645
|
};
|
|
2491
3646
|
}
|
|
2492
3647
|
return {
|
|
2493
|
-
store:
|
|
2494
|
-
push:
|
|
2495
|
-
replace:
|
|
2496
|
-
back:
|
|
2497
|
-
subscribe:
|
|
2498
|
-
matchRoute: (v) =>
|
|
2499
|
-
getCurrent: () =>
|
|
2500
|
-
resolveRouteComponent:
|
|
3648
|
+
store: o,
|
|
3649
|
+
push: u,
|
|
3650
|
+
replace: m,
|
|
3651
|
+
back: g,
|
|
3652
|
+
subscribe: o.subscribe,
|
|
3653
|
+
matchRoute: (v) => Q(t, v),
|
|
3654
|
+
getCurrent: () => o.getState(),
|
|
3655
|
+
resolveRouteComponent: ir
|
|
2501
3656
|
};
|
|
2502
3657
|
}
|
|
2503
|
-
function
|
|
2504
|
-
return
|
|
3658
|
+
function Pr(e, t) {
|
|
3659
|
+
return Q(e, t);
|
|
2505
3660
|
}
|
|
2506
|
-
function
|
|
2507
|
-
const t =
|
|
2508
|
-
return
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
const r = t.getCurrent(), { path: i } = r, n = t.matchRoute(i);
|
|
2512
|
-
if (!n.route) return Z`<div>Not found</div>`;
|
|
2513
|
-
try {
|
|
2514
|
-
const o = await t.resolveRouteComponent(n.route);
|
|
2515
|
-
if (typeof o == "string")
|
|
2516
|
-
return { tag: o, props: {}, children: [] };
|
|
2517
|
-
if (typeof o == "function") {
|
|
2518
|
-
const s = o(), a = s instanceof Promise ? await s : s;
|
|
2519
|
-
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2520
|
-
}
|
|
2521
|
-
return Z`<div>Invalid route component</div>`;
|
|
2522
|
-
} catch {
|
|
2523
|
-
return Z`<div>Invalid route component</div>`;
|
|
2524
|
-
}
|
|
2525
|
-
},
|
|
2526
|
-
onConnected(r) {
|
|
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(() => {
|
|
2527
3666
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
2528
|
-
typeof r.requestRender == "function" && r.requestRender();
|
|
2529
3667
|
});
|
|
2530
|
-
}
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
<button
|
|
2564
|
-
part="button"
|
|
2565
|
-
:class="${g}"
|
|
2566
|
-
${w}
|
|
2567
|
-
${x}
|
|
2568
|
-
${l}
|
|
2569
|
-
@click="navigate"
|
|
2570
|
-
><slot></slot></button>
|
|
2571
|
-
`).otherwise(Z`
|
|
2572
|
-
<a
|
|
2573
|
-
part="link"
|
|
2574
|
-
href="${n}"
|
|
2575
|
-
:class="${g}"
|
|
2576
|
-
${w}
|
|
2577
|
-
${x}
|
|
2578
|
-
${l}
|
|
2579
|
-
@click="navigate"
|
|
2580
|
-
><slot></slot></a>
|
|
2581
|
-
`).done()}
|
|
2582
|
-
`;
|
|
2583
|
-
},
|
|
2584
|
-
navigate: (r, i) => {
|
|
2585
|
-
if (i.disabled) {
|
|
2586
|
-
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();
|
|
2587
3701
|
return;
|
|
2588
3702
|
}
|
|
2589
|
-
|
|
2590
|
-
}
|
|
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
|
+
`;
|
|
2591
3727
|
}), t;
|
|
2592
3728
|
}
|
|
2593
3729
|
export {
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
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,
|
|
3773
|
+
q as whenMedia,
|
|
3774
|
+
br as whenNotEmpty,
|
|
3775
|
+
_r as whenVariants
|
|
2615
3776
|
};
|
|
2616
3777
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|