@jasonshimmy/custom-elements-runtime 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements-runtime.cjs.js +9 -9
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +821 -777
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +10 -10
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,9 +5,9 @@ class dt {
|
|
|
5
5
|
* Schedule an update to be executed in the next microtask
|
|
6
6
|
* Uses component identity to deduplicate multiple render requests for the same component
|
|
7
7
|
*/
|
|
8
|
-
schedule(t,
|
|
9
|
-
const
|
|
10
|
-
this.pendingUpdates.set(
|
|
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
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Execute all pending updates
|
|
@@ -15,11 +15,11 @@ class dt {
|
|
|
15
15
|
flush() {
|
|
16
16
|
const t = Array.from(this.pendingUpdates.values());
|
|
17
17
|
this.pendingUpdates.clear(), this.isFlushScheduled = !1;
|
|
18
|
-
for (const
|
|
18
|
+
for (const r of t)
|
|
19
19
|
try {
|
|
20
|
-
|
|
21
|
-
} catch (
|
|
22
|
-
typeof console < "u" && console.error && console.error("Error in batched update:",
|
|
20
|
+
r();
|
|
21
|
+
} catch (n) {
|
|
22
|
+
typeof console < "u" && console.error && console.error("Error in batched update:", n);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -41,13 +41,13 @@ class ht {
|
|
|
41
41
|
/**
|
|
42
42
|
* Get or create a reactive proxy for an object
|
|
43
43
|
*/
|
|
44
|
-
static getOrCreateProxy(t,
|
|
44
|
+
static getOrCreateProxy(t, r, n = !1) {
|
|
45
45
|
const i = this.cache.get(t);
|
|
46
46
|
if (i)
|
|
47
47
|
return i;
|
|
48
|
-
const s =
|
|
48
|
+
const s = n ? this.getOrCreateArrayHandler(r) : this.getOrCreateObjectHandler(r), o = new Proxy(t, s);
|
|
49
49
|
try {
|
|
50
|
-
|
|
50
|
+
nt.markAsProxy(o);
|
|
51
51
|
} catch {
|
|
52
52
|
}
|
|
53
53
|
return this.cache.set(t, o), o;
|
|
@@ -57,9 +57,9 @@ class ht {
|
|
|
57
57
|
*/
|
|
58
58
|
static getOrCreateArrayHandler(t) {
|
|
59
59
|
if (!this.arrayHandlerCache.has(t)) {
|
|
60
|
-
const
|
|
61
|
-
get: (
|
|
62
|
-
const o = Reflect.get(
|
|
60
|
+
const r = {
|
|
61
|
+
get: (n, i, s) => {
|
|
62
|
+
const o = Reflect.get(n, i, s);
|
|
63
63
|
return typeof o == "function" && typeof i == "string" && [
|
|
64
64
|
"push",
|
|
65
65
|
"pop",
|
|
@@ -71,14 +71,14 @@ class ht {
|
|
|
71
71
|
"fill",
|
|
72
72
|
"copyWithin"
|
|
73
73
|
].includes(i) ? function(...u) {
|
|
74
|
-
const
|
|
75
|
-
return t.triggerUpdate(),
|
|
74
|
+
const m = o.apply(n, u);
|
|
75
|
+
return t.triggerUpdate(), m;
|
|
76
76
|
} : o;
|
|
77
77
|
},
|
|
78
|
-
set: (
|
|
79
|
-
deleteProperty: (
|
|
78
|
+
set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
79
|
+
deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
|
|
80
80
|
};
|
|
81
|
-
this.arrayHandlerCache.set(t,
|
|
81
|
+
this.arrayHandlerCache.set(t, r);
|
|
82
82
|
}
|
|
83
83
|
return this.arrayHandlerCache.get(t);
|
|
84
84
|
}
|
|
@@ -87,12 +87,12 @@ class ht {
|
|
|
87
87
|
*/
|
|
88
88
|
static getOrCreateObjectHandler(t) {
|
|
89
89
|
if (!this.objectHandlerCache.has(t)) {
|
|
90
|
-
const
|
|
91
|
-
get: (
|
|
92
|
-
set: (
|
|
93
|
-
deleteProperty: (
|
|
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
94
|
};
|
|
95
|
-
this.objectHandlerCache.set(t,
|
|
95
|
+
this.objectHandlerCache.set(t, r);
|
|
96
96
|
}
|
|
97
97
|
return this.objectHandlerCache.get(t);
|
|
98
98
|
}
|
|
@@ -118,7 +118,7 @@ class ht {
|
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
class
|
|
121
|
+
class nt {
|
|
122
122
|
// Cache a stable reactiveContext object keyed by onUpdate -> makeReactive
|
|
123
123
|
// This allows handler caches in ReactiveProxyCache to reuse handlers
|
|
124
124
|
// for identical reactive contexts instead of creating a new context object
|
|
@@ -127,19 +127,19 @@ class rt {
|
|
|
127
127
|
/**
|
|
128
128
|
* Create an optimized reactive proxy with minimal overhead
|
|
129
129
|
*/
|
|
130
|
-
static createReactiveProxy(t,
|
|
130
|
+
static createReactiveProxy(t, r, n) {
|
|
131
131
|
try {
|
|
132
132
|
if (Fe.has(t)) return t;
|
|
133
133
|
} catch {
|
|
134
134
|
}
|
|
135
135
|
const i = Array.isArray(t);
|
|
136
|
-
let s = this.contextCache.get(
|
|
137
|
-
s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(
|
|
138
|
-
let o = s.get(
|
|
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
139
|
return o || (o = {
|
|
140
|
-
triggerUpdate:
|
|
141
|
-
makeReactiveValue:
|
|
142
|
-
}, s.set(
|
|
140
|
+
triggerUpdate: r,
|
|
141
|
+
makeReactiveValue: n
|
|
142
|
+
}, s.set(n, o)), ht.getOrCreateProxy(t, o, i);
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Mark an object as a proxy (for optimization)
|
|
@@ -165,8 +165,8 @@ class gt {
|
|
|
165
165
|
/**
|
|
166
166
|
* Set the current component being rendered for dependency tracking
|
|
167
167
|
*/
|
|
168
|
-
setCurrentComponent(t,
|
|
169
|
-
this.currentComponent = t, this.componentRenderFunctions.set(t,
|
|
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);
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* Clear the current component after rendering
|
|
@@ -198,19 +198,19 @@ class gt {
|
|
|
198
198
|
*/
|
|
199
199
|
shouldEmitRenderWarning() {
|
|
200
200
|
if (!this.currentComponent) return !0;
|
|
201
|
-
const t = this.currentComponent,
|
|
202
|
-
return
|
|
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);
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* Execute a function with tracking disabled
|
|
206
206
|
*/
|
|
207
207
|
withoutTracking(t) {
|
|
208
|
-
const
|
|
208
|
+
const r = this.trackingDisabled;
|
|
209
209
|
this.trackingDisabled = !0;
|
|
210
210
|
try {
|
|
211
211
|
return t();
|
|
212
212
|
} finally {
|
|
213
|
-
this.trackingDisabled =
|
|
213
|
+
this.trackingDisabled = r;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
@@ -219,8 +219,8 @@ class gt {
|
|
|
219
219
|
getOrCreateState(t) {
|
|
220
220
|
if (!this.currentComponent)
|
|
221
221
|
return new He(t);
|
|
222
|
-
const
|
|
223
|
-
if (this.stateIndexCounter.set(
|
|
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
224
|
return this.stateStorage.get(i);
|
|
225
225
|
const s = new He(t);
|
|
226
226
|
return this.stateStorage.set(i, s), s;
|
|
@@ -235,19 +235,19 @@ class gt {
|
|
|
235
235
|
* Trigger updates for all components that depend on a state
|
|
236
236
|
*/
|
|
237
237
|
triggerUpdate(t) {
|
|
238
|
-
t.getDependents().forEach((
|
|
239
|
-
const
|
|
240
|
-
|
|
238
|
+
t.getDependents().forEach((r) => {
|
|
239
|
+
const n = this.componentRenderFunctions.get(r);
|
|
240
|
+
n && fe(n, r);
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
244
244
|
* Clean up component dependencies when component is destroyed
|
|
245
245
|
*/
|
|
246
246
|
cleanup(t) {
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
for (const
|
|
250
|
-
|
|
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
251
|
this.stateIndexCounter.delete(t);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
@@ -258,8 +258,8 @@ class He {
|
|
|
258
258
|
constructor(t) {
|
|
259
259
|
this._value = this.makeReactive(t);
|
|
260
260
|
try {
|
|
261
|
-
const
|
|
262
|
-
Object.defineProperty(this,
|
|
261
|
+
const r = Symbol.for("@cer/ReactiveState");
|
|
262
|
+
Object.defineProperty(this, r, { value: !0, enumerable: !1, configurable: !1 });
|
|
263
263
|
} catch {
|
|
264
264
|
}
|
|
265
265
|
}
|
|
@@ -284,14 +284,14 @@ class He {
|
|
|
284
284
|
return this.dependents;
|
|
285
285
|
}
|
|
286
286
|
makeReactive(t) {
|
|
287
|
-
return t === null || typeof t != "object" || t instanceof Node || t instanceof Element || t instanceof HTMLElement ? t :
|
|
287
|
+
return t === null || typeof t != "object" || t instanceof Node || t instanceof Element || t instanceof HTMLElement ? t : nt.createReactiveProxy(
|
|
288
288
|
t,
|
|
289
289
|
() => F.triggerUpdate(this),
|
|
290
|
-
(
|
|
290
|
+
(r) => this.makeReactive(r)
|
|
291
291
|
);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function ur(e) {
|
|
295
295
|
return F.getOrCreateState(e === void 0 ? null : e);
|
|
296
296
|
}
|
|
297
297
|
function ee(e) {
|
|
@@ -307,7 +307,7 @@ function ee(e) {
|
|
|
307
307
|
return !1;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function fr(e) {
|
|
311
311
|
const t = new He(e());
|
|
312
312
|
return {
|
|
313
313
|
get value() {
|
|
@@ -315,20 +315,20 @@ function dn(e) {
|
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
let
|
|
320
|
-
|
|
318
|
+
function dr(e, t, r = {}) {
|
|
319
|
+
let n = e();
|
|
320
|
+
r.immediate && t(n, n);
|
|
321
321
|
const i = `watch-${Math.random().toString(36).substr(2, 9)}`, s = () => {
|
|
322
322
|
F.setCurrentComponent(i, s);
|
|
323
323
|
const o = e();
|
|
324
|
-
F.clearCurrentComponent(), o !==
|
|
324
|
+
F.clearCurrentComponent(), o !== n && (t(o, n), n = o);
|
|
325
325
|
};
|
|
326
326
|
return F.setCurrentComponent(i, s), e(), F.clearCurrentComponent(), () => {
|
|
327
327
|
F.cleanup(i);
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
330
|
const xe = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map(), Ue = 500;
|
|
331
|
-
function
|
|
331
|
+
function re(e) {
|
|
332
332
|
if (xe.has(e))
|
|
333
333
|
return xe.get(e);
|
|
334
334
|
const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -337,7 +337,7 @@ function ne(e) {
|
|
|
337
337
|
function it(e) {
|
|
338
338
|
if (ve.has(e))
|
|
339
339
|
return ve.get(e);
|
|
340
|
-
const t = e.replace(/-([a-z])/g, (
|
|
340
|
+
const t = e.replace(/-([a-z])/g, (r, n) => n.toUpperCase());
|
|
341
341
|
return ve.size < Ue && ve.set(e, t), t;
|
|
342
342
|
}
|
|
343
343
|
function ie(e) {
|
|
@@ -346,13 +346,13 @@ function ie(e) {
|
|
|
346
346
|
return ke.get(e);
|
|
347
347
|
const t = e.replace(
|
|
348
348
|
/[&<>"']/g,
|
|
349
|
-
(
|
|
349
|
+
(r) => ({
|
|
350
350
|
"&": "&",
|
|
351
351
|
"<": "<",
|
|
352
352
|
">": ">",
|
|
353
353
|
'"': """,
|
|
354
354
|
"'": "'"
|
|
355
|
-
})[
|
|
355
|
+
})[r]
|
|
356
356
|
);
|
|
357
357
|
return t !== e && ke.size < Ue && ke.set(e, t), t;
|
|
358
358
|
}
|
|
@@ -360,16 +360,16 @@ function ie(e) {
|
|
|
360
360
|
}
|
|
361
361
|
function H(e, t) {
|
|
362
362
|
if (typeof t == "string") {
|
|
363
|
-
const
|
|
364
|
-
return ee(
|
|
363
|
+
const r = t.split(".").reduce((n, i) => n?.[i], e);
|
|
364
|
+
return ee(r) ? r.value : r;
|
|
365
365
|
}
|
|
366
366
|
return t;
|
|
367
367
|
}
|
|
368
|
-
function Ee(e, t,
|
|
369
|
-
const
|
|
368
|
+
function Ee(e, t, r) {
|
|
369
|
+
const n = String(t).split("."), i = n.pop();
|
|
370
370
|
if (!i) return;
|
|
371
|
-
const s =
|
|
372
|
-
ee(s[i]) ? s[i].value =
|
|
371
|
+
const s = n.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
372
|
+
ee(s[i]) ? s[i].value = r : s[i] = r;
|
|
373
373
|
}
|
|
374
374
|
const st = typeof process < "u" && process.env?.NODE_ENV !== "production";
|
|
375
375
|
function se(e, ...t) {
|
|
@@ -378,40 +378,40 @@ function se(e, ...t) {
|
|
|
378
378
|
function Oe(e, ...t) {
|
|
379
379
|
st && console.warn(e, ...t);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
383
|
-
for (const [
|
|
381
|
+
function mt(e, t, r) {
|
|
382
|
+
if (r)
|
|
383
|
+
for (const [n, i] of Object.entries(r)) {
|
|
384
384
|
let s, o = {};
|
|
385
|
-
if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(
|
|
385
|
+
if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(n, {
|
|
386
386
|
callback: s,
|
|
387
387
|
options: o,
|
|
388
|
-
oldValue: H(e,
|
|
388
|
+
oldValue: H(e, n)
|
|
389
389
|
}), o.immediate)
|
|
390
390
|
try {
|
|
391
|
-
const a = H(e,
|
|
391
|
+
const a = H(e, n);
|
|
392
392
|
s(a, void 0, e);
|
|
393
393
|
} catch (a) {
|
|
394
|
-
se(`Error in immediate watcher for "${
|
|
394
|
+
se(`Error in immediate watcher for "${n}":`, a);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function yt(e, t, r, n) {
|
|
399
399
|
const i = (o, a) => {
|
|
400
400
|
if (o === a) return !0;
|
|
401
401
|
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
402
402
|
if (Array.isArray(o) && Array.isArray(a))
|
|
403
403
|
return o.length !== a.length ? !1 : o.every((g, b) => i(g, a[b]));
|
|
404
|
-
const u = Object.keys(o),
|
|
405
|
-
return u.length !==
|
|
406
|
-
}, s = t.get(
|
|
407
|
-
if (s && !i(
|
|
404
|
+
const u = Object.keys(o), m = Object.keys(a);
|
|
405
|
+
return u.length !== m.length ? !1 : u.every((g) => i(o[g], a[g]));
|
|
406
|
+
}, s = t.get(r);
|
|
407
|
+
if (s && !i(n, s.oldValue))
|
|
408
408
|
try {
|
|
409
|
-
s.callback(
|
|
409
|
+
s.callback(n, s.oldValue, e), s.oldValue = n;
|
|
410
410
|
} catch (o) {
|
|
411
|
-
se(`Error in watcher for "${
|
|
411
|
+
se(`Error in watcher for "${r}":`, o);
|
|
412
412
|
}
|
|
413
413
|
for (const [o, a] of t.entries())
|
|
414
|
-
if (a.options.deep &&
|
|
414
|
+
if (a.options.deep && r.startsWith(o + "."))
|
|
415
415
|
try {
|
|
416
416
|
const u = H(e, o);
|
|
417
417
|
i(u, a.oldValue) || (a.callback(u, a.oldValue, e), a.oldValue = u);
|
|
@@ -422,32 +422,32 @@ function mt(e, t, n, r) {
|
|
|
422
422
|
function Ke(e, t) {
|
|
423
423
|
return t === Boolean ? e === "true" : t === Number ? Number(e) : e;
|
|
424
424
|
}
|
|
425
|
-
function bt(e, t,
|
|
426
|
-
t && Object.entries(t).forEach(([
|
|
427
|
-
const s =
|
|
428
|
-
if (i.type === Function && typeof e[
|
|
429
|
-
n
|
|
430
|
-
else if (typeof e[
|
|
425
|
+
function bt(e, t, r) {
|
|
426
|
+
t && Object.entries(t).forEach(([n, i]) => {
|
|
427
|
+
const s = re(n), o = e.getAttribute(s);
|
|
428
|
+
if (i.type === Function && typeof e[n] == "function")
|
|
429
|
+
r[n] = e[n];
|
|
430
|
+
else if (typeof e[n] < "u")
|
|
431
431
|
try {
|
|
432
|
-
const a = e[
|
|
433
|
-
i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? n
|
|
432
|
+
const a = e[n];
|
|
433
|
+
i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? r[n] = a : r[n] = ie(Ke(String(a), i.type));
|
|
434
434
|
} catch {
|
|
435
|
-
n
|
|
435
|
+
r[n] = e[n];
|
|
436
436
|
}
|
|
437
|
-
else o !== null ? n
|
|
437
|
+
else o !== null ? r[n] = ie(Ke(o, i.type)) : "default" in i && i.default !== void 0 && (r[n] = ie(i.default));
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
function wt(e, t,
|
|
441
|
-
t.props && bt(e, t.props,
|
|
440
|
+
function wt(e, t, r) {
|
|
441
|
+
t.props && bt(e, t.props, r);
|
|
442
442
|
}
|
|
443
|
-
function xt(e, t,
|
|
444
|
-
e.onConnected && !
|
|
443
|
+
function xt(e, t, r, n) {
|
|
444
|
+
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
445
445
|
}
|
|
446
|
-
function vt(e, t,
|
|
447
|
-
e.onDisconnected && e.onDisconnected(t),
|
|
446
|
+
function vt(e, t, r, n, i, s, o, a) {
|
|
447
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()), n(), i(), s(!1), o(null), a(!1);
|
|
448
448
|
}
|
|
449
|
-
function kt(e, t,
|
|
450
|
-
e.onAttributeChanged && e.onAttributeChanged(t,
|
|
449
|
+
function kt(e, t, r, n, i) {
|
|
450
|
+
e.onAttributeChanged && e.onAttributeChanged(t, r, n, i);
|
|
451
451
|
}
|
|
452
452
|
class Ct {
|
|
453
453
|
static cache = /* @__PURE__ */ new Map();
|
|
@@ -470,14 +470,14 @@ class Ct {
|
|
|
470
470
|
/fetch/i,
|
|
471
471
|
/XMLHttpRequest/i
|
|
472
472
|
];
|
|
473
|
-
static evaluate(t,
|
|
474
|
-
const
|
|
475
|
-
if (
|
|
476
|
-
if (!
|
|
473
|
+
static evaluate(t, r) {
|
|
474
|
+
const n = this.cache.get(t);
|
|
475
|
+
if (n) {
|
|
476
|
+
if (!n.isSecure) {
|
|
477
477
|
Oe("Blocked cached dangerous expression:", t);
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
|
-
return
|
|
480
|
+
return n.evaluator(r);
|
|
481
481
|
}
|
|
482
482
|
const i = this.createEvaluator(t);
|
|
483
483
|
if (this.cache.size >= this.maxCacheSize) {
|
|
@@ -488,7 +488,7 @@ class Ct {
|
|
|
488
488
|
Oe("Blocked dangerous expression:", t);
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
|
-
return i.evaluator(
|
|
491
|
+
return i.evaluator(r);
|
|
492
492
|
}
|
|
493
493
|
static createEvaluator(t) {
|
|
494
494
|
if (this.hasDangerousPatterns(t))
|
|
@@ -499,28 +499,28 @@ class Ct {
|
|
|
499
499
|
}, isSecure: !1 };
|
|
500
500
|
try {
|
|
501
501
|
return { evaluator: this.createSafeEvaluator(t), isSecure: !0 };
|
|
502
|
-
} catch (
|
|
503
|
-
return Oe("Failed to create evaluator for expression:", t,
|
|
502
|
+
} catch (r) {
|
|
503
|
+
return Oe("Failed to create evaluator for expression:", t, r), { evaluator: () => {
|
|
504
504
|
}, isSecure: !1 };
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
static hasDangerousPatterns(t) {
|
|
508
|
-
return this.dangerousPatterns.some((
|
|
508
|
+
return this.dangerousPatterns.some((r) => r.test(t));
|
|
509
509
|
}
|
|
510
510
|
static createSafeEvaluator(t) {
|
|
511
511
|
if (t.trim().startsWith("{") && t.trim().endsWith("}"))
|
|
512
512
|
return this.createObjectEvaluator(t);
|
|
513
513
|
if (/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())) {
|
|
514
|
-
const
|
|
515
|
-
return (
|
|
514
|
+
const r = t.trim().slice(4);
|
|
515
|
+
return (n) => H(n, r);
|
|
516
516
|
}
|
|
517
|
-
return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (
|
|
517
|
+
return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (r) => H(r, t);
|
|
518
518
|
}
|
|
519
519
|
static createObjectEvaluator(t) {
|
|
520
|
-
const
|
|
520
|
+
const r = t.trim().slice(1, -1), n = this.parseObjectProperties(r);
|
|
521
521
|
return (i) => {
|
|
522
522
|
const s = {};
|
|
523
|
-
for (const { key: o, value: a } of
|
|
523
|
+
for (const { key: o, value: a } of n)
|
|
524
524
|
try {
|
|
525
525
|
if (a.startsWith("ctx.")) {
|
|
526
526
|
const u = a.slice(4);
|
|
@@ -534,51 +534,51 @@ class Ct {
|
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
536
|
static parseObjectProperties(t) {
|
|
537
|
-
const
|
|
538
|
-
for (const i of
|
|
537
|
+
const r = [], n = t.split(",");
|
|
538
|
+
for (const i of n) {
|
|
539
539
|
const s = i.indexOf(":");
|
|
540
540
|
if (s === -1) continue;
|
|
541
541
|
const o = i.slice(0, s).trim(), a = i.slice(s + 1).trim(), u = o.replace(/^['"]|['"]$/g, "");
|
|
542
|
-
|
|
542
|
+
r.push({ key: u, value: a });
|
|
543
543
|
}
|
|
544
|
-
return
|
|
544
|
+
return r;
|
|
545
545
|
}
|
|
546
546
|
static createSimpleEvaluator(t) {
|
|
547
|
-
return (
|
|
547
|
+
return (r) => {
|
|
548
548
|
try {
|
|
549
|
-
let
|
|
549
|
+
let n = t;
|
|
550
550
|
const i = [];
|
|
551
|
-
|
|
552
|
-
const s =
|
|
551
|
+
n = n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (b) => `<<#${i.push(b) - 1}#>>`);
|
|
552
|
+
const s = n.match(/ctx\.[\w.]+/g) || [];
|
|
553
553
|
for (const b of s) {
|
|
554
|
-
const h = b.slice(4), l = H(
|
|
554
|
+
const h = b.slice(4), l = H(r, h);
|
|
555
555
|
if (l === void 0) return;
|
|
556
556
|
const d = i.push(JSON.stringify(l)) - 1;
|
|
557
|
-
|
|
557
|
+
n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`);
|
|
558
558
|
}
|
|
559
|
-
const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a =
|
|
559
|
+
const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a = n.match(o) || [];
|
|
560
560
|
for (const b of a) {
|
|
561
561
|
if (b.startsWith("ctx.")) continue;
|
|
562
|
-
const h = H(
|
|
562
|
+
const h = H(r, b);
|
|
563
563
|
if (h === void 0) return;
|
|
564
564
|
const l = i.push(JSON.stringify(h)) - 1;
|
|
565
|
-
|
|
565
|
+
n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${l}#>>`);
|
|
566
566
|
}
|
|
567
567
|
const u = /\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;
|
|
568
|
-
let
|
|
568
|
+
let m;
|
|
569
569
|
const g = /* @__PURE__ */ new Set();
|
|
570
|
-
for (; (
|
|
571
|
-
const b =
|
|
570
|
+
for (; (m = u.exec(n)) !== null; ) {
|
|
571
|
+
const b = m[1];
|
|
572
572
|
if (["true", "false", "null", "undefined"].includes(b) || /^[0-9]+$/.test(b) || b === "ctx" || g.has(b)) continue;
|
|
573
573
|
g.add(b);
|
|
574
|
-
const h = H(
|
|
574
|
+
const h = H(r, b);
|
|
575
575
|
if (h === void 0) return;
|
|
576
576
|
const l = JSON.stringify(h), d = i.push(l) - 1;
|
|
577
|
-
b.includes(".") ?
|
|
577
|
+
b.includes(".") ? n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`) : n = n.replace(new RegExp("\\b" + b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${d}#>>`);
|
|
578
578
|
}
|
|
579
|
-
|
|
579
|
+
n = n.replace(/<<#(\d+)#>>/g, (b, h) => i[Number(h)]);
|
|
580
580
|
try {
|
|
581
|
-
return this.evaluateBasicExpression(
|
|
581
|
+
return this.evaluateBasicExpression(n);
|
|
582
582
|
} catch {
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
@@ -593,13 +593,13 @@ class Ct {
|
|
|
593
593
|
* arithmetic (+ - * / %), comparisons, logical && and ||, parentheses, and ternary `a ? b : c`.
|
|
594
594
|
*/
|
|
595
595
|
static evaluateBasicExpression(t) {
|
|
596
|
-
const
|
|
597
|
-
let
|
|
596
|
+
const r = this.tokenize(t);
|
|
597
|
+
let n = 0;
|
|
598
598
|
function i() {
|
|
599
|
-
return n
|
|
599
|
+
return r[n];
|
|
600
600
|
}
|
|
601
601
|
function s(c) {
|
|
602
|
-
const p = n
|
|
602
|
+
const p = r[n++];
|
|
603
603
|
if (c && !p)
|
|
604
604
|
throw new Error(`Unexpected token EOF, expected ${c}`);
|
|
605
605
|
if (c && p && p.type !== c && p.value !== c)
|
|
@@ -615,21 +615,21 @@ class Ct {
|
|
|
615
615
|
s("?");
|
|
616
616
|
const p = o();
|
|
617
617
|
s(":");
|
|
618
|
-
const
|
|
619
|
-
return c ? p :
|
|
618
|
+
const y = o();
|
|
619
|
+
return c ? p : y;
|
|
620
620
|
}
|
|
621
621
|
return c;
|
|
622
622
|
}
|
|
623
623
|
function u() {
|
|
624
|
-
let c =
|
|
624
|
+
let c = m();
|
|
625
625
|
for (; i() && i().value === "||"; ) {
|
|
626
626
|
s("OP");
|
|
627
|
-
const p =
|
|
627
|
+
const p = m();
|
|
628
628
|
c = c || p;
|
|
629
629
|
}
|
|
630
630
|
return c;
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function m() {
|
|
633
633
|
let c = g();
|
|
634
634
|
for (; i() && i().value === "&&"; ) {
|
|
635
635
|
s("OP");
|
|
@@ -641,19 +641,19 @@ class Ct {
|
|
|
641
641
|
function g() {
|
|
642
642
|
let c = b();
|
|
643
643
|
for (; i() && ["==", "!=", "===", "!=="].includes(i().value); ) {
|
|
644
|
-
const p = s("OP").value,
|
|
644
|
+
const p = s("OP").value, y = b();
|
|
645
645
|
switch (p) {
|
|
646
646
|
case "==":
|
|
647
|
-
c = c ==
|
|
647
|
+
c = c == y;
|
|
648
648
|
break;
|
|
649
649
|
case "!=":
|
|
650
|
-
c = c !=
|
|
650
|
+
c = c != y;
|
|
651
651
|
break;
|
|
652
652
|
case "===":
|
|
653
|
-
c = c ===
|
|
653
|
+
c = c === y;
|
|
654
654
|
break;
|
|
655
655
|
case "!==":
|
|
656
|
-
c = c !==
|
|
656
|
+
c = c !== y;
|
|
657
657
|
break;
|
|
658
658
|
}
|
|
659
659
|
}
|
|
@@ -662,19 +662,19 @@ class Ct {
|
|
|
662
662
|
function b() {
|
|
663
663
|
let c = h();
|
|
664
664
|
for (; i() && [">", "<", ">=", "<="].includes(i().value); ) {
|
|
665
|
-
const p = s("OP").value,
|
|
665
|
+
const p = s("OP").value, y = h();
|
|
666
666
|
switch (p) {
|
|
667
667
|
case ">":
|
|
668
|
-
c = c >
|
|
668
|
+
c = c > y;
|
|
669
669
|
break;
|
|
670
670
|
case "<":
|
|
671
|
-
c = c <
|
|
671
|
+
c = c < y;
|
|
672
672
|
break;
|
|
673
673
|
case ">=":
|
|
674
|
-
c = c >=
|
|
674
|
+
c = c >= y;
|
|
675
675
|
break;
|
|
676
676
|
case "<=":
|
|
677
|
-
c = c <=
|
|
677
|
+
c = c <= y;
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
@@ -683,24 +683,24 @@ class Ct {
|
|
|
683
683
|
function h() {
|
|
684
684
|
let c = l();
|
|
685
685
|
for (; i() && (i().value === "+" || i().value === "-"); ) {
|
|
686
|
-
const p = s("OP").value,
|
|
687
|
-
c = p === "+" ? c +
|
|
686
|
+
const p = s("OP").value, y = l();
|
|
687
|
+
c = p === "+" ? c + y : c - y;
|
|
688
688
|
}
|
|
689
689
|
return c;
|
|
690
690
|
}
|
|
691
691
|
function l() {
|
|
692
692
|
let c = d();
|
|
693
693
|
for (; i() && (i().value === "*" || i().value === "/" || i().value === "%"); ) {
|
|
694
|
-
const p = s("OP").value,
|
|
694
|
+
const p = s("OP").value, y = d();
|
|
695
695
|
switch (p) {
|
|
696
696
|
case "*":
|
|
697
|
-
c = c *
|
|
697
|
+
c = c * y;
|
|
698
698
|
break;
|
|
699
699
|
case "/":
|
|
700
|
-
c = c /
|
|
700
|
+
c = c / y;
|
|
701
701
|
break;
|
|
702
702
|
case "%":
|
|
703
|
-
c = c %
|
|
703
|
+
c = c % y;
|
|
704
704
|
break;
|
|
705
705
|
}
|
|
706
706
|
}
|
|
@@ -736,21 +736,21 @@ class Ct {
|
|
|
736
736
|
return o();
|
|
737
737
|
}
|
|
738
738
|
static tokenize(t) {
|
|
739
|
-
const
|
|
739
|
+
const r = [], n = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
|
|
740
740
|
let i;
|
|
741
|
-
for (; (i =
|
|
741
|
+
for (; (i = n.exec(t)) !== null; ) {
|
|
742
742
|
const s = i[1];
|
|
743
|
-
s && (/^\d/.test(s) ?
|
|
743
|
+
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 }));
|
|
744
744
|
}
|
|
745
|
-
return
|
|
745
|
+
return r;
|
|
746
746
|
}
|
|
747
|
-
static evaluateSimpleValue(t,
|
|
747
|
+
static evaluateSimpleValue(t, r) {
|
|
748
748
|
if (t === "true") return !0;
|
|
749
749
|
if (t === "false") return !1;
|
|
750
750
|
if (!isNaN(Number(t))) return Number(t);
|
|
751
751
|
if (t.startsWith("ctx.")) {
|
|
752
|
-
const
|
|
753
|
-
return H(
|
|
752
|
+
const n = t.slice(4);
|
|
753
|
+
return H(r, n);
|
|
754
754
|
}
|
|
755
755
|
return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t;
|
|
756
756
|
}
|
|
@@ -766,9 +766,9 @@ class oe {
|
|
|
766
766
|
/**
|
|
767
767
|
* Add an event listener with automatic cleanup tracking
|
|
768
768
|
*/
|
|
769
|
-
static addListener(t,
|
|
770
|
-
t.addEventListener(
|
|
771
|
-
const o = { event:
|
|
769
|
+
static addListener(t, r, n, i) {
|
|
770
|
+
t.addEventListener(r, n, i);
|
|
771
|
+
const o = { event: r, handler: n, options: i, cleanup: () => t.removeEventListener(r, n, i), addedAt: Date.now() };
|
|
772
772
|
this.cleanupFunctions.has(t) || this.cleanupFunctions.set(t, []);
|
|
773
773
|
const a = this.cleanupFunctions.get(t);
|
|
774
774
|
a.push(o), this.cleanupFunctions.get(t).__metaList = a;
|
|
@@ -776,13 +776,13 @@ class oe {
|
|
|
776
776
|
/**
|
|
777
777
|
* Remove a specific event listener
|
|
778
778
|
*/
|
|
779
|
-
static removeListener(t,
|
|
780
|
-
t.removeEventListener(
|
|
779
|
+
static removeListener(t, r, n, i) {
|
|
780
|
+
t.removeEventListener(r, n, i);
|
|
781
781
|
const s = this.cleanupFunctions.get(t);
|
|
782
782
|
if (s) {
|
|
783
783
|
const o = s.__metaList || null;
|
|
784
784
|
if (o) {
|
|
785
|
-
const a = o.findIndex((u) => u.event ===
|
|
785
|
+
const a = o.findIndex((u) => u.event === r && u.handler === n && JSON.stringify(u.options) === JSON.stringify(i));
|
|
786
786
|
if (a >= 0) {
|
|
787
787
|
try {
|
|
788
788
|
o[a].cleanup();
|
|
@@ -801,8 +801,8 @@ class oe {
|
|
|
801
801
|
* Clean up all event listeners for an element
|
|
802
802
|
*/
|
|
803
803
|
static cleanup(t) {
|
|
804
|
-
const
|
|
805
|
-
|
|
804
|
+
const r = this.cleanupFunctions.get(t);
|
|
805
|
+
r && ((r.__metaList || r).forEach((i) => {
|
|
806
806
|
try {
|
|
807
807
|
typeof i == "function" ? i() : i && typeof i.cleanup == "function" && i.cleanup();
|
|
808
808
|
} catch (s) {
|
|
@@ -824,34 +824,34 @@ class oe {
|
|
|
824
824
|
* Check if an element has any tracked event listeners
|
|
825
825
|
*/
|
|
826
826
|
static hasListeners(t) {
|
|
827
|
-
const
|
|
828
|
-
return !!(
|
|
827
|
+
const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
|
|
828
|
+
return !!(n && n.length > 0);
|
|
829
829
|
}
|
|
830
830
|
/**
|
|
831
831
|
* Get the number of tracked event listeners for an element
|
|
832
832
|
*/
|
|
833
833
|
static getListenerCount(t) {
|
|
834
|
-
const
|
|
835
|
-
return
|
|
834
|
+
const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
|
|
835
|
+
return n ? n.length : 0;
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
function ue(e, t) {
|
|
839
839
|
if (t && e instanceof HTMLElement) {
|
|
840
840
|
oe.cleanup(e);
|
|
841
|
-
for (const
|
|
842
|
-
t[
|
|
843
|
-
for (const
|
|
844
|
-
ue(
|
|
841
|
+
for (const r in t)
|
|
842
|
+
t[r] === e && delete t[r];
|
|
843
|
+
for (const r of Array.from(e.childNodes))
|
|
844
|
+
ue(r, t);
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
|
-
function he(e, t,
|
|
847
|
+
function he(e, t, r) {
|
|
848
848
|
if (typeof e == "string") return;
|
|
849
|
-
const
|
|
850
|
-
|
|
849
|
+
const n = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), i = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
850
|
+
n ? n.value = t : i && r && (r[i] = t);
|
|
851
851
|
}
|
|
852
|
-
function _t(e, t,
|
|
852
|
+
function _t(e, t, r, n, i, s, o, a) {
|
|
853
853
|
if (!s) return;
|
|
854
|
-
const u = t.includes("lazy"),
|
|
854
|
+
const u = t.includes("lazy"), m = t.includes("trim"), g = t.includes("number"), b = e && typeof e == "object" && "value" in e && typeof e.value < "u", h = () => {
|
|
855
855
|
if (b) {
|
|
856
856
|
const C = e.value;
|
|
857
857
|
return a && typeof C == "object" && C !== null ? C[a] : C;
|
|
@@ -859,17 +859,17 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
859
859
|
return H(s._state || s, e);
|
|
860
860
|
}, l = h();
|
|
861
861
|
let d = "text";
|
|
862
|
-
o instanceof HTMLInputElement ? d =
|
|
862
|
+
o instanceof HTMLInputElement ? d = n?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
|
|
863
863
|
const x = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = x ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
864
864
|
if (d === "checkbox")
|
|
865
865
|
if (Array.isArray(l))
|
|
866
|
-
|
|
866
|
+
r[c] = l.includes(String(o?.getAttribute("value") ?? n?.value ?? ""));
|
|
867
867
|
else {
|
|
868
868
|
const C = o?.getAttribute("true-value") ?? !0;
|
|
869
|
-
|
|
869
|
+
r[c] = l === C;
|
|
870
870
|
}
|
|
871
871
|
else if (d === "radio")
|
|
872
|
-
|
|
872
|
+
r[c] = l === (n?.value ?? "");
|
|
873
873
|
else if (d === "select")
|
|
874
874
|
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
875
875
|
const C = Array.isArray(l) ? l.map(String) : [];
|
|
@@ -877,18 +877,18 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
877
877
|
Array.from(o.options).forEach((k) => {
|
|
878
878
|
k.selected = C.includes(k.value);
|
|
879
879
|
});
|
|
880
|
-
}, 0),
|
|
880
|
+
}, 0), r[c] = Array.isArray(l) ? l : [];
|
|
881
881
|
} else
|
|
882
|
-
|
|
882
|
+
r[c] = l;
|
|
883
883
|
else {
|
|
884
|
-
|
|
884
|
+
r[c] = l;
|
|
885
885
|
try {
|
|
886
|
-
const C =
|
|
887
|
-
|
|
886
|
+
const C = re(c);
|
|
887
|
+
n && (n[C] = l);
|
|
888
888
|
} catch {
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
const p = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input",
|
|
891
|
+
const p = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input", y = (C) => {
|
|
892
892
|
if (C.isComposing || i._isComposing) return;
|
|
893
893
|
const k = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
|
|
894
894
|
if (C.isTrusted === !1 && !k) return;
|
|
@@ -914,7 +914,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
914
914
|
v = f.getAttribute("value") ?? f.value;
|
|
915
915
|
else if (d === "select" && f.multiple)
|
|
916
916
|
v = Array.from(f.selectedOptions).map((T) => T.value);
|
|
917
|
-
else if (
|
|
917
|
+
else if (m && typeof v == "string" && (v = v.trim()), g) {
|
|
918
918
|
const T = Number(v);
|
|
919
919
|
isNaN(T) || (v = T);
|
|
920
920
|
}
|
|
@@ -935,7 +935,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
935
935
|
s._triggerWatchers(T, v);
|
|
936
936
|
}
|
|
937
937
|
if (f) {
|
|
938
|
-
const T = `update:${
|
|
938
|
+
const T = `update:${re(c)}`, R = new CustomEvent(T, {
|
|
939
939
|
detail: v,
|
|
940
940
|
bubbles: !0,
|
|
941
941
|
composed: !0
|
|
@@ -952,9 +952,9 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
952
952
|
const C = i[p];
|
|
953
953
|
o && oe.removeListener(o, p, C);
|
|
954
954
|
}
|
|
955
|
-
i[p] =
|
|
955
|
+
i[p] = y;
|
|
956
956
|
} else {
|
|
957
|
-
const C = `update:${
|
|
957
|
+
const C = `update:${re(c)}`;
|
|
958
958
|
if (i[C]) {
|
|
959
959
|
const k = i[C];
|
|
960
960
|
o && oe.removeListener(o, C, k);
|
|
@@ -967,7 +967,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
967
967
|
if ($) {
|
|
968
968
|
$[c] = v;
|
|
969
969
|
try {
|
|
970
|
-
const T =
|
|
970
|
+
const T = re(c);
|
|
971
971
|
typeof v == "boolean" ? v ? $.setAttribute(T, "true") : $.setAttribute(T, "false") : $.setAttribute(T, String(v));
|
|
972
972
|
} catch {
|
|
973
973
|
}
|
|
@@ -984,7 +984,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
984
984
|
k && setTimeout(() => {
|
|
985
985
|
const f = k.value, v = s._state || s, A = H(v, e);
|
|
986
986
|
let _ = f;
|
|
987
|
-
if (
|
|
987
|
+
if (m && (_ = _.trim()), g) {
|
|
988
988
|
const T = Number(_);
|
|
989
989
|
isNaN(T) || (_ = T);
|
|
990
990
|
}
|
|
@@ -1003,38 +1003,38 @@ function ot(e) {
|
|
|
1003
1003
|
const t = e.slice(2);
|
|
1004
1004
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
1005
1005
|
}
|
|
1006
|
-
function Et(e, t,
|
|
1006
|
+
function Et(e, t, r, n) {
|
|
1007
1007
|
if (typeof e == "object" && e !== null)
|
|
1008
1008
|
for (const [i, s] of Object.entries(e))
|
|
1009
|
-
i.startsWith("data-") || i.startsWith("aria-") || i === "class" ?
|
|
1009
|
+
i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? r[i] = s : t[i] = s;
|
|
1010
1010
|
else if (typeof e == "string") {
|
|
1011
|
-
if (!
|
|
1011
|
+
if (!n) return;
|
|
1012
1012
|
try {
|
|
1013
|
-
const i =
|
|
1013
|
+
const i = me(e, n);
|
|
1014
1014
|
if (typeof i == "object" && i !== null) {
|
|
1015
1015
|
for (const [s, o] of Object.entries(i))
|
|
1016
|
-
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ?
|
|
1016
|
+
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
|
|
1017
1017
|
return;
|
|
1018
1018
|
} else {
|
|
1019
|
-
|
|
1019
|
+
r[e] = i;
|
|
1020
1020
|
return;
|
|
1021
1021
|
}
|
|
1022
1022
|
} catch {
|
|
1023
|
-
const i = H(
|
|
1024
|
-
|
|
1023
|
+
const i = H(n, e);
|
|
1024
|
+
r[e] = i;
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
|
-
function $t(e, t,
|
|
1029
|
-
let
|
|
1028
|
+
function $t(e, t, r) {
|
|
1029
|
+
let n;
|
|
1030
1030
|
if (typeof e == "string") {
|
|
1031
|
-
if (!
|
|
1032
|
-
|
|
1031
|
+
if (!r) return;
|
|
1032
|
+
n = me(e, r);
|
|
1033
1033
|
} else
|
|
1034
|
-
|
|
1034
|
+
n = e;
|
|
1035
1035
|
const i = t.style || "";
|
|
1036
1036
|
let s = i;
|
|
1037
|
-
if (
|
|
1037
|
+
if (n) {
|
|
1038
1038
|
if (i) {
|
|
1039
1039
|
const o = i.split(";").map((u) => u.trim()).filter(Boolean), a = o.findIndex(
|
|
1040
1040
|
(u) => u.startsWith("display:")
|
|
@@ -1050,36 +1050,36 @@ function $t(e, t, n) {
|
|
|
1050
1050
|
s = "display: none";
|
|
1051
1051
|
s !== i && (s ? t.style = s : delete t.style);
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function me(e, t) {
|
|
1054
1054
|
return Ct.evaluate(e, t);
|
|
1055
1055
|
}
|
|
1056
|
-
function St(e, t,
|
|
1057
|
-
let
|
|
1056
|
+
function St(e, t, r) {
|
|
1057
|
+
let n;
|
|
1058
1058
|
if (typeof e == "string") {
|
|
1059
|
-
if (!
|
|
1060
|
-
|
|
1059
|
+
if (!r) return;
|
|
1060
|
+
n = me(e, r);
|
|
1061
1061
|
} else
|
|
1062
|
-
|
|
1062
|
+
n = e;
|
|
1063
1063
|
let i = [];
|
|
1064
|
-
typeof
|
|
1064
|
+
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)));
|
|
1065
1065
|
const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
|
|
1066
1066
|
o && (t.class = o);
|
|
1067
1067
|
}
|
|
1068
|
-
function At(e, t,
|
|
1069
|
-
let
|
|
1068
|
+
function At(e, t, r) {
|
|
1069
|
+
let n;
|
|
1070
1070
|
if (typeof e == "string") {
|
|
1071
|
-
if (!
|
|
1072
|
-
|
|
1071
|
+
if (!r) return;
|
|
1072
|
+
n = me(e, r);
|
|
1073
1073
|
} else
|
|
1074
|
-
|
|
1074
|
+
n = e;
|
|
1075
1075
|
let i = "";
|
|
1076
|
-
if (typeof
|
|
1077
|
-
i =
|
|
1078
|
-
else if (
|
|
1076
|
+
if (typeof n == "string")
|
|
1077
|
+
i = n;
|
|
1078
|
+
else if (n && typeof n == "object") {
|
|
1079
1079
|
const o = [];
|
|
1080
|
-
for (const [a, u] of Object.entries(
|
|
1080
|
+
for (const [a, u] of Object.entries(n))
|
|
1081
1081
|
if (u != null && u !== "") {
|
|
1082
|
-
const
|
|
1082
|
+
const m = a.replace(
|
|
1083
1083
|
/[A-Z]/g,
|
|
1084
1084
|
(h) => `-${h.toLowerCase()}`
|
|
1085
1085
|
), g = [
|
|
@@ -1109,51 +1109,51 @@ function At(e, t, n) {
|
|
|
1109
1109
|
"max-height"
|
|
1110
1110
|
];
|
|
1111
1111
|
let b = String(u);
|
|
1112
|
-
typeof u == "number" && g.includes(
|
|
1112
|
+
typeof u == "number" && g.includes(m) && (b = `${u}px`), o.push(`${m}: ${b}`);
|
|
1113
1113
|
}
|
|
1114
1114
|
i = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
1115
1115
|
}
|
|
1116
1116
|
const s = t.style || "";
|
|
1117
1117
|
t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
|
|
1118
1118
|
}
|
|
1119
|
-
function Tt(e, t,
|
|
1120
|
-
let
|
|
1121
|
-
typeof e == "string" &&
|
|
1119
|
+
function Tt(e, t, r) {
|
|
1120
|
+
let n = e;
|
|
1121
|
+
typeof e == "string" && r && (n = me(e, r)), ee(n) ? t.reactiveRef = n : t.ref = n;
|
|
1122
1122
|
}
|
|
1123
|
-
function at(e, t,
|
|
1124
|
-
const i = {}, s = { ...
|
|
1123
|
+
function at(e, t, r, n) {
|
|
1124
|
+
const i = {}, s = { ...n || {} }, o = {};
|
|
1125
1125
|
for (const [a, u] of Object.entries(e)) {
|
|
1126
|
-
const { value:
|
|
1126
|
+
const { value: m, modifiers: g, arg: b } = u;
|
|
1127
1127
|
if (a === "model" || a.startsWith("model:")) {
|
|
1128
1128
|
const h = a.split(":"), l = h.length > 1 ? h[1] : b;
|
|
1129
1129
|
_t(
|
|
1130
|
-
|
|
1130
|
+
m,
|
|
1131
1131
|
// Pass the original value (could be string or reactive state object)
|
|
1132
1132
|
g,
|
|
1133
1133
|
i,
|
|
1134
1134
|
s,
|
|
1135
1135
|
o,
|
|
1136
1136
|
t,
|
|
1137
|
-
|
|
1137
|
+
r,
|
|
1138
1138
|
l
|
|
1139
1139
|
);
|
|
1140
1140
|
continue;
|
|
1141
1141
|
}
|
|
1142
1142
|
switch (a) {
|
|
1143
1143
|
case "bind":
|
|
1144
|
-
Et(
|
|
1144
|
+
Et(m, i, s, t);
|
|
1145
1145
|
break;
|
|
1146
1146
|
case "show":
|
|
1147
|
-
$t(
|
|
1147
|
+
$t(m, s, t);
|
|
1148
1148
|
break;
|
|
1149
1149
|
case "class":
|
|
1150
|
-
St(
|
|
1150
|
+
St(m, s, t);
|
|
1151
1151
|
break;
|
|
1152
1152
|
case "style":
|
|
1153
|
-
At(
|
|
1153
|
+
At(m, s, t);
|
|
1154
1154
|
break;
|
|
1155
1155
|
case "ref":
|
|
1156
|
-
Tt(
|
|
1156
|
+
Tt(m, i, t);
|
|
1157
1157
|
break;
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
@@ -1179,36 +1179,36 @@ function Be(e, t) {
|
|
|
1179
1179
|
].find((d) => d != null) ?? "";
|
|
1180
1180
|
a = l ? `${t}:${b}:${l}` : `${t}:${b}`;
|
|
1181
1181
|
}
|
|
1182
|
-
let u = a,
|
|
1182
|
+
let u = a, m = 1;
|
|
1183
1183
|
for (; s.has(u); )
|
|
1184
|
-
u = `${a}#${
|
|
1184
|
+
u = `${a}#${m++}`;
|
|
1185
1185
|
s.add(u);
|
|
1186
1186
|
let g = o.children;
|
|
1187
1187
|
return Array.isArray(g) && (g = Be(g, u)), { ...o, key: u, children: g };
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
|
-
const
|
|
1191
|
-
let
|
|
1192
|
-
return Array.isArray(i) && (i = Be(i,
|
|
1190
|
+
const r = e;
|
|
1191
|
+
let n = r.props?.key ?? r.key ?? t, i = r.children;
|
|
1192
|
+
return Array.isArray(i) && (i = Be(i, n)), { ...r, key: n, children: i };
|
|
1193
1193
|
}
|
|
1194
|
-
function Ve(e, t,
|
|
1195
|
-
const i =
|
|
1194
|
+
function Ve(e, t, r, n) {
|
|
1195
|
+
const i = r.directives ?? {}, s = at(
|
|
1196
1196
|
i,
|
|
1197
|
-
|
|
1197
|
+
n,
|
|
1198
1198
|
e,
|
|
1199
|
-
|
|
1199
|
+
r.attrs
|
|
1200
1200
|
), o = {
|
|
1201
1201
|
...t.props,
|
|
1202
|
-
...
|
|
1202
|
+
...r.props,
|
|
1203
1203
|
...s.props
|
|
1204
1204
|
}, a = {
|
|
1205
1205
|
...t.attrs,
|
|
1206
|
-
...
|
|
1206
|
+
...r.attrs,
|
|
1207
1207
|
...s.attrs
|
|
1208
|
-
}, u = t.props ?? {},
|
|
1208
|
+
}, u = t.props ?? {}, m = o, g = r?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
1209
1209
|
let b = !1;
|
|
1210
|
-
for (const d in { ...u, ...
|
|
1211
|
-
const x = u[d], w =
|
|
1210
|
+
for (const d in { ...u, ...m }) {
|
|
1211
|
+
const x = u[d], w = m[d];
|
|
1212
1212
|
if (x !== w)
|
|
1213
1213
|
if (b = !0, d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
1214
1214
|
e.value !== w && (e.value = w ?? "");
|
|
@@ -1219,7 +1219,7 @@ function Ve(e, t, n, r) {
|
|
|
1219
1219
|
typeof x == "function" && oe.removeListener(e, c, x), oe.addListener(e, c, w);
|
|
1220
1220
|
} else if (w == null)
|
|
1221
1221
|
e.removeAttribute(d);
|
|
1222
|
-
else if ((
|
|
1222
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
|
|
1223
1223
|
try {
|
|
1224
1224
|
e[d] = w;
|
|
1225
1225
|
} catch {
|
|
@@ -1298,15 +1298,15 @@ function Ve(e, t, n, r) {
|
|
|
1298
1298
|
e.setAttribute(d, String(p));
|
|
1299
1299
|
continue;
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1302
|
-
if (g && !
|
|
1301
|
+
const y = e.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1302
|
+
if (g && !y && d.includes("-")) {
|
|
1303
1303
|
const C = it(d);
|
|
1304
1304
|
try {
|
|
1305
1305
|
e[C] = p;
|
|
1306
1306
|
} catch {
|
|
1307
1307
|
e.setAttribute(d, String(p));
|
|
1308
1308
|
}
|
|
1309
|
-
} else if (!
|
|
1309
|
+
} else if (!y && d in e)
|
|
1310
1310
|
try {
|
|
1311
1311
|
e[d] = p;
|
|
1312
1312
|
} catch {
|
|
@@ -1327,7 +1327,7 @@ function Ve(e, t, n, r) {
|
|
|
1327
1327
|
} catch {
|
|
1328
1328
|
}
|
|
1329
1329
|
}
|
|
1330
|
-
function X(e, t,
|
|
1330
|
+
function X(e, t, r) {
|
|
1331
1331
|
if (typeof e == "string")
|
|
1332
1332
|
return document.createTextNode(e);
|
|
1333
1333
|
if (e.tag === "#text") {
|
|
@@ -1347,70 +1347,70 @@ function X(e, t, n) {
|
|
|
1347
1347
|
}
|
|
1348
1348
|
return w.appendChild(x), w;
|
|
1349
1349
|
}
|
|
1350
|
-
const
|
|
1351
|
-
e.key != null && (
|
|
1352
|
-
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t,
|
|
1350
|
+
const n = document.createElement(e.tag);
|
|
1351
|
+
e.key != null && (n.key = e.key);
|
|
1352
|
+
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t, n, s), u = {
|
|
1353
1353
|
...i,
|
|
1354
1354
|
...a.props
|
|
1355
|
-
},
|
|
1355
|
+
}, m = {
|
|
1356
1356
|
...s,
|
|
1357
1357
|
...a.attrs
|
|
1358
|
-
}, g =
|
|
1359
|
-
for (const h in
|
|
1360
|
-
const l =
|
|
1358
|
+
}, g = n.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1359
|
+
for (const h in m) {
|
|
1360
|
+
const l = m[h];
|
|
1361
1361
|
if (!(typeof h != "string" || /\[object Object\]/.test(h))) {
|
|
1362
1362
|
if (typeof l == "boolean")
|
|
1363
|
-
l &&
|
|
1363
|
+
l && n.setAttribute(h, "");
|
|
1364
1364
|
else if (l != null)
|
|
1365
|
-
if (!g && h === "value" && (
|
|
1365
|
+
if (!g && h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement || n instanceof HTMLProgressElement))
|
|
1366
1366
|
try {
|
|
1367
|
-
|
|
1367
|
+
n instanceof HTMLProgressElement ? n.value = Number(l) : n.value = l ?? "";
|
|
1368
1368
|
} catch {
|
|
1369
|
-
|
|
1369
|
+
n.setAttribute(h, String(l));
|
|
1370
1370
|
}
|
|
1371
|
-
else if (!g && h === "checked" &&
|
|
1371
|
+
else if (!g && h === "checked" && n instanceof HTMLInputElement)
|
|
1372
1372
|
try {
|
|
1373
|
-
|
|
1373
|
+
n.checked = !!l;
|
|
1374
1374
|
} catch {
|
|
1375
|
-
|
|
1375
|
+
n.setAttribute(h, String(l));
|
|
1376
1376
|
}
|
|
1377
|
-
else if (!g && h in
|
|
1377
|
+
else if (!g && h in n)
|
|
1378
1378
|
try {
|
|
1379
|
-
|
|
1379
|
+
n[h] = l;
|
|
1380
1380
|
} catch {
|
|
1381
|
-
|
|
1381
|
+
n.setAttribute(h, String(l));
|
|
1382
1382
|
}
|
|
1383
1383
|
else if ((e.props?.isCustomElement ?? !1) && !g && h.includes("-")) {
|
|
1384
1384
|
const x = it(h);
|
|
1385
1385
|
try {
|
|
1386
|
-
|
|
1386
|
+
n[x] = l;
|
|
1387
1387
|
} catch {
|
|
1388
|
-
|
|
1388
|
+
n.setAttribute(h, String(l));
|
|
1389
1389
|
}
|
|
1390
1390
|
} else
|
|
1391
|
-
|
|
1391
|
+
n.setAttribute(h, String(l));
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
for (const h in u) {
|
|
1395
1395
|
const l = u[h];
|
|
1396
1396
|
if (!(typeof h != "string" || /\[object Object\]/.test(h)))
|
|
1397
|
-
if (h === "value" && (
|
|
1397
|
+
if (h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement)) {
|
|
1398
1398
|
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1399
|
-
|
|
1400
|
-
} else if (h === "checked" &&
|
|
1399
|
+
n.value = d ?? "";
|
|
1400
|
+
} else if (h === "checked" && n instanceof HTMLInputElement) {
|
|
1401
1401
|
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1402
|
-
|
|
1402
|
+
n.checked = !!d;
|
|
1403
1403
|
} else if (h.startsWith("on") && typeof l == "function")
|
|
1404
|
-
oe.addListener(
|
|
1404
|
+
oe.addListener(n, ot(h), l);
|
|
1405
1405
|
else {
|
|
1406
1406
|
if (h.startsWith("on") && l === void 0)
|
|
1407
1407
|
continue;
|
|
1408
1408
|
if (l == null || l === !1)
|
|
1409
|
-
|
|
1410
|
-
else if ((e.props?.isCustomElement ?? !1) || h in
|
|
1409
|
+
n.removeAttribute(h);
|
|
1410
|
+
else if ((e.props?.isCustomElement ?? !1) || h in n)
|
|
1411
1411
|
try {
|
|
1412
1412
|
const x = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1413
|
-
|
|
1413
|
+
n[h] = x;
|
|
1414
1414
|
} catch {
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
@@ -1418,7 +1418,7 @@ function X(e, t, n) {
|
|
|
1418
1418
|
for (const [h, l] of Object.entries(
|
|
1419
1419
|
a.listeners || {}
|
|
1420
1420
|
))
|
|
1421
|
-
oe.addListener(
|
|
1421
|
+
oe.addListener(n, h, l);
|
|
1422
1422
|
const b = {
|
|
1423
1423
|
...e,
|
|
1424
1424
|
props: {
|
|
@@ -1426,36 +1426,36 @@ function X(e, t, n) {
|
|
|
1426
1426
|
...a.props
|
|
1427
1427
|
}
|
|
1428
1428
|
};
|
|
1429
|
-
he(b,
|
|
1429
|
+
he(b, n, r);
|
|
1430
1430
|
try {
|
|
1431
|
-
if (typeof
|
|
1431
|
+
if (typeof n._applyProps == "function")
|
|
1432
1432
|
try {
|
|
1433
|
-
|
|
1433
|
+
n._applyProps(n._cfg);
|
|
1434
1434
|
} catch {
|
|
1435
1435
|
}
|
|
1436
|
-
typeof
|
|
1436
|
+
typeof n.requestRender == "function" ? n.requestRender() : typeof n._render == "function" && n._render(n._cfg);
|
|
1437
1437
|
} catch {
|
|
1438
1438
|
}
|
|
1439
1439
|
if (Array.isArray(e.children))
|
|
1440
1440
|
for (const h of e.children)
|
|
1441
|
-
|
|
1442
|
-
else typeof e.children == "string" && (
|
|
1441
|
+
n.appendChild(X(h, t, r));
|
|
1442
|
+
else typeof e.children == "string" && (n.textContent = e.children);
|
|
1443
1443
|
try {
|
|
1444
|
-
if (
|
|
1444
|
+
if (n instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
|
|
1445
1445
|
try {
|
|
1446
|
-
|
|
1446
|
+
n.value = m.value ?? "";
|
|
1447
1447
|
} catch {
|
|
1448
1448
|
}
|
|
1449
1449
|
} catch {
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1451
|
+
return n;
|
|
1452
1452
|
}
|
|
1453
|
-
function Rt(e, t,
|
|
1454
|
-
if (typeof
|
|
1455
|
-
e.textContent !==
|
|
1453
|
+
function Rt(e, t, r, n, i) {
|
|
1454
|
+
if (typeof r == "string") {
|
|
1455
|
+
e.textContent !== r && (e.textContent = r);
|
|
1456
1456
|
return;
|
|
1457
1457
|
}
|
|
1458
|
-
if (!Array.isArray(
|
|
1458
|
+
if (!Array.isArray(r)) return;
|
|
1459
1459
|
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
1460
1460
|
for (const l of o)
|
|
1461
1461
|
l && l.key != null && a.set(l.key, l);
|
|
@@ -1464,11 +1464,11 @@ function Rt(e, t, n, r, i) {
|
|
|
1464
1464
|
const d = l.key;
|
|
1465
1465
|
d != null && u.set(d, l);
|
|
1466
1466
|
}
|
|
1467
|
-
const
|
|
1467
|
+
const m = /* @__PURE__ */ new Set();
|
|
1468
1468
|
let g = e.firstChild;
|
|
1469
1469
|
function b(l, d) {
|
|
1470
1470
|
let x = l;
|
|
1471
|
-
for (; x && (
|
|
1471
|
+
for (; x && (m.add(x), x !== d); )
|
|
1472
1472
|
x = x.nextSibling;
|
|
1473
1473
|
}
|
|
1474
1474
|
function h(l, d, x, w) {
|
|
@@ -1476,10 +1476,10 @@ function Rt(e, t, n, r, i) {
|
|
|
1476
1476
|
let p = l.nextSibling;
|
|
1477
1477
|
for (; p && p !== d; )
|
|
1478
1478
|
c.push(p), p = p.nextSibling;
|
|
1479
|
-
const
|
|
1480
|
-
if (w.some((k) => k && k.key != null) ||
|
|
1479
|
+
const y = Array.isArray(x) ? x : [];
|
|
1480
|
+
if (w.some((k) => k && k.key != null) || y.some((k) => k && k.key != null)) {
|
|
1481
1481
|
const k = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
1482
|
-
for (const _ of
|
|
1482
|
+
for (const _ of y)
|
|
1483
1483
|
_ && _.key != null && k.set(_.key, _);
|
|
1484
1484
|
for (const _ of c) {
|
|
1485
1485
|
const $ = _.key;
|
|
@@ -1495,48 +1495,48 @@ function Rt(e, t, n, r, i) {
|
|
|
1495
1495
|
f.get(_.key),
|
|
1496
1496
|
T,
|
|
1497
1497
|
_,
|
|
1498
|
-
|
|
1498
|
+
n
|
|
1499
1499
|
), v.add($), $ !== A && e.contains($) && e.insertBefore($, A);
|
|
1500
1500
|
} else
|
|
1501
|
-
$ = X(_,
|
|
1501
|
+
$ = X(_, n), e.insertBefore($, A), v.add($);
|
|
1502
1502
|
A = $.nextSibling;
|
|
1503
1503
|
}
|
|
1504
1504
|
for (const _ of c)
|
|
1505
1505
|
!v.has(_) && e.contains(_) && e.removeChild(_);
|
|
1506
1506
|
} else {
|
|
1507
1507
|
const k = Math.min(
|
|
1508
|
-
|
|
1508
|
+
y.length,
|
|
1509
1509
|
w.length
|
|
1510
1510
|
);
|
|
1511
1511
|
for (let f = 0; f < k; f++) {
|
|
1512
|
-
const v =
|
|
1512
|
+
const v = y[f], A = w[f], _ = $e(c[f], v, A, n);
|
|
1513
1513
|
_ !== c[f] && (e.insertBefore(_, c[f]), e.removeChild(c[f]));
|
|
1514
1514
|
}
|
|
1515
1515
|
for (let f = k; f < w.length; f++)
|
|
1516
|
-
e.insertBefore(X(w[f],
|
|
1516
|
+
e.insertBefore(X(w[f], n), d);
|
|
1517
1517
|
for (let f = k; f < c.length; f++)
|
|
1518
1518
|
e.removeChild(c[f]);
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
|
-
for (const l of
|
|
1521
|
+
for (const l of r) {
|
|
1522
1522
|
let d;
|
|
1523
1523
|
if (l.tag === "#anchor") {
|
|
1524
1524
|
const x = l.key, w = `${x}:start`, c = `${x}:end`;
|
|
1525
|
-
let p = u.get(w),
|
|
1525
|
+
let p = u.get(w), y = u.get(c);
|
|
1526
1526
|
const C = Array.isArray(l.children) ? l.children : [];
|
|
1527
|
-
if (p || (p = document.createTextNode(""), p.key = w),
|
|
1527
|
+
if (p || (p = document.createTextNode(""), p.key = w), y || (y = document.createTextNode(""), y.key = c), l._startNode = p, l._endNode = y, !e.contains(p) || !e.contains(y)) {
|
|
1528
1528
|
e.insertBefore(p, g);
|
|
1529
1529
|
for (const k of C)
|
|
1530
|
-
e.insertBefore(X(k,
|
|
1531
|
-
e.insertBefore(
|
|
1530
|
+
e.insertBefore(X(k, n), g);
|
|
1531
|
+
e.insertBefore(y, g);
|
|
1532
1532
|
} else
|
|
1533
1533
|
h(
|
|
1534
1534
|
p,
|
|
1535
|
-
|
|
1535
|
+
y,
|
|
1536
1536
|
a.get(x)?.children,
|
|
1537
1537
|
C
|
|
1538
1538
|
);
|
|
1539
|
-
b(p,
|
|
1539
|
+
b(p, y), g = y.nextSibling;
|
|
1540
1540
|
continue;
|
|
1541
1541
|
}
|
|
1542
1542
|
if (l.key != null && u.has(l.key)) {
|
|
@@ -1545,71 +1545,71 @@ function Rt(e, t, n, r, i) {
|
|
|
1545
1545
|
u.get(l.key),
|
|
1546
1546
|
x,
|
|
1547
1547
|
l,
|
|
1548
|
-
|
|
1548
|
+
n,
|
|
1549
1549
|
i
|
|
1550
|
-
),
|
|
1550
|
+
), m.add(d), d !== g && e.contains(d) && (g && !e.contains(g) && (g = null), e.insertBefore(d, g));
|
|
1551
1551
|
} else
|
|
1552
|
-
d = X(l,
|
|
1552
|
+
d = X(l, n, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g), m.add(d);
|
|
1553
1553
|
g = d.nextSibling;
|
|
1554
1554
|
}
|
|
1555
1555
|
for (const l of s)
|
|
1556
|
-
!
|
|
1556
|
+
!m.has(l) && e.contains(l) && (ue(l, i), e.removeChild(l));
|
|
1557
1557
|
}
|
|
1558
|
-
function $e(e, t,
|
|
1559
|
-
if (t && typeof t != "string" && t.props?.ref && i && ue(e, i), t ===
|
|
1560
|
-
if (typeof
|
|
1558
|
+
function $e(e, t, r, n, i) {
|
|
1559
|
+
if (t && typeof t != "string" && t.props?.ref && i && ue(e, i), t === r) return e;
|
|
1560
|
+
if (typeof r == "string") {
|
|
1561
1561
|
if (e.nodeType === Node.TEXT_NODE)
|
|
1562
|
-
return e.textContent !==
|
|
1562
|
+
return e.textContent !== r && (e.textContent = r), e;
|
|
1563
1563
|
{
|
|
1564
|
-
const o = document.createTextNode(
|
|
1564
|
+
const o = document.createTextNode(r);
|
|
1565
1565
|
return e.parentNode?.replaceChild(o, e), o;
|
|
1566
1566
|
}
|
|
1567
1567
|
}
|
|
1568
|
-
if (
|
|
1569
|
-
const o =
|
|
1570
|
-
o.key != null && (u.key = `${o.key}:start`,
|
|
1568
|
+
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
1569
|
+
const o = r, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), m = o._endNode ?? document.createTextNode("");
|
|
1570
|
+
o.key != null && (u.key = `${o.key}:start`, m.key = `${o.key}:end`), o._startNode = u, o._endNode = m;
|
|
1571
1571
|
const g = document.createDocumentFragment();
|
|
1572
1572
|
g.appendChild(u);
|
|
1573
1573
|
for (const b of a) {
|
|
1574
|
-
const h = X(b,
|
|
1574
|
+
const h = X(b, n);
|
|
1575
1575
|
g.appendChild(h);
|
|
1576
1576
|
}
|
|
1577
|
-
return g.appendChild(
|
|
1577
|
+
return g.appendChild(m), e.parentNode?.replaceChild(g, e), u;
|
|
1578
1578
|
}
|
|
1579
|
-
if (!
|
|
1579
|
+
if (!r) {
|
|
1580
1580
|
ue(e, i);
|
|
1581
1581
|
const o = document.createComment("removed");
|
|
1582
1582
|
return e.parentNode?.replaceChild(o, e), o;
|
|
1583
1583
|
}
|
|
1584
1584
|
if (!t || typeof t == "string") {
|
|
1585
1585
|
ue(e, i);
|
|
1586
|
-
const o = X(
|
|
1587
|
-
return he(
|
|
1588
|
-
}
|
|
1589
|
-
if (
|
|
1590
|
-
const o = Array.isArray(
|
|
1591
|
-
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1586
|
+
const o = X(r, n, i);
|
|
1587
|
+
return he(r, o, i), e.parentNode?.replaceChild(o, e), o;
|
|
1588
|
+
}
|
|
1589
|
+
if (r.tag === "#anchor") {
|
|
1590
|
+
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), u = r._endNode ?? document.createTextNode("");
|
|
1591
|
+
r.key != null && (a.key = `${r.key}:start`, u.key = `${r.key}:end`), r._startNode = a, r._endNode = u;
|
|
1592
|
+
const m = document.createDocumentFragment();
|
|
1593
|
+
m.appendChild(a);
|
|
1594
1594
|
for (const g of o)
|
|
1595
|
-
|
|
1596
|
-
return
|
|
1595
|
+
m.appendChild(X(g, n));
|
|
1596
|
+
return m.appendChild(u), e.parentNode?.replaceChild(m, e), a;
|
|
1597
1597
|
}
|
|
1598
|
-
if (typeof t != "string" && typeof
|
|
1598
|
+
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
1599
1599
|
const o = e;
|
|
1600
|
-
return Ve(o, t.props || {},
|
|
1600
|
+
return Ve(o, t.props || {}, r.props || {}, n), Rt(o, t.children, r.children, n, i), he(r, o, i), o;
|
|
1601
1601
|
}
|
|
1602
|
-
if (typeof t != "string" && typeof
|
|
1602
|
+
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))
|
|
1603
1603
|
try {
|
|
1604
1604
|
const a = e;
|
|
1605
|
-
return Ve(a, t.props || {},
|
|
1605
|
+
return Ve(a, t.props || {}, r.props || {}, n), he(r, a, i), a;
|
|
1606
1606
|
} catch {
|
|
1607
1607
|
}
|
|
1608
1608
|
ue(e, i);
|
|
1609
|
-
const s = X(
|
|
1610
|
-
return he(
|
|
1609
|
+
const s = X(r, n, i);
|
|
1610
|
+
return he(r, s, i), e.parentNode?.replaceChild(s, e), s;
|
|
1611
1611
|
}
|
|
1612
|
-
function Ot(e, t,
|
|
1612
|
+
function Ot(e, t, r, n) {
|
|
1613
1613
|
let i;
|
|
1614
1614
|
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 = {
|
|
1615
1615
|
tag: "div",
|
|
@@ -1619,13 +1619,13 @@ function Ot(e, t, n, r) {
|
|
|
1619
1619
|
}), i = Be(i, String(i.key ?? "root"));
|
|
1620
1620
|
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
1621
1621
|
let a;
|
|
1622
|
-
s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a = $e(o, s, i,
|
|
1622
|
+
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));
|
|
1623
1623
|
const u = [];
|
|
1624
|
-
for (let
|
|
1625
|
-
const g = e.childNodes[
|
|
1626
|
-
g !== a && g.nodeName !== "STYLE" && (ue(g,
|
|
1624
|
+
for (let m = 0; m < e.childNodes.length; m++) {
|
|
1625
|
+
const g = e.childNodes[m];
|
|
1626
|
+
g !== a && g.nodeName !== "STYLE" && (ue(g, n), u.push(g));
|
|
1627
1627
|
}
|
|
1628
|
-
u.forEach((
|
|
1628
|
+
u.forEach((m) => e.removeChild(m)), e._prevVNode = i, e._prevDom = a;
|
|
1629
1629
|
}
|
|
1630
1630
|
function Pe(e) {
|
|
1631
1631
|
if (typeof e == "string") return ie(e);
|
|
@@ -1635,16 +1635,16 @@ function Pe(e) {
|
|
|
1635
1635
|
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(Pe).join("");
|
|
1636
1636
|
let t = "";
|
|
1637
1637
|
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
|
|
1638
|
-
let
|
|
1639
|
-
e.props && (
|
|
1640
|
-
const
|
|
1641
|
-
return `<${e.tag}${t}${
|
|
1638
|
+
let r = "";
|
|
1639
|
+
e.props && (r = Object.entries(e.props).filter(([i]) => i !== "attrs" && i !== "directives" && i !== "ref" && i !== "key").map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
|
|
1640
|
+
const n = Array.isArray(e.children) ? e.children.filter(Boolean).map(Pe).join("") : typeof e.children == "string" ? ie(e.children) : e.children ? Pe(e.children) : "";
|
|
1641
|
+
return `<${e.tag}${t}${r}>${n}</${e.tag}>`;
|
|
1642
1642
|
}
|
|
1643
1643
|
function Pt(e, ...t) {
|
|
1644
|
-
let
|
|
1645
|
-
for (let
|
|
1646
|
-
|
|
1647
|
-
return
|
|
1644
|
+
let r = "";
|
|
1645
|
+
for (let n = 0; n < e.length; n++)
|
|
1646
|
+
r += e[n], n < t.length && (r += t[n]);
|
|
1647
|
+
return r;
|
|
1648
1648
|
}
|
|
1649
1649
|
function ct(e) {
|
|
1650
1650
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
@@ -1814,9 +1814,9 @@ const Mt = Pt`
|
|
|
1814
1814
|
Object.entries(jt).map(([e, t]) => [
|
|
1815
1815
|
e,
|
|
1816
1816
|
Object.fromEntries(
|
|
1817
|
-
Object.entries(t).map(([
|
|
1818
|
-
|
|
1819
|
-
`var(--color-${e}${
|
|
1817
|
+
Object.entries(t).map(([r, n]) => [
|
|
1818
|
+
r,
|
|
1819
|
+
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${n})`
|
|
1820
1820
|
])
|
|
1821
1821
|
)
|
|
1822
1822
|
])
|
|
@@ -1850,8 +1850,8 @@ const Mt = Pt`
|
|
|
1850
1850
|
"7xl": 320
|
|
1851
1851
|
}, zt = () => {
|
|
1852
1852
|
const e = {};
|
|
1853
|
-
for (const [t,
|
|
1854
|
-
e[`max-w-${t}`] = `max-width:calc(${le} * ${
|
|
1853
|
+
for (const [t, r] of Object.entries(Wt))
|
|
1854
|
+
e[`max-w-${t}`] = `max-width:calc(${le} * ${r});`, e[`min-w-${t}`] = `min-width:calc(${le} * ${r});`, e[`w-${t}`] = `width:calc(${le} * ${r});`, e[`max-h-${t}`] = `max-height:calc(${le} * ${r});`, e[`min-h-${t}`] = `min-height:calc(${le} * ${r});`, e[`h-${t}`] = `height:calc(${le} * ${r});`;
|
|
1855
1855
|
return e;
|
|
1856
1856
|
}, Dt = () => {
|
|
1857
1857
|
const e = {};
|
|
@@ -1878,6 +1878,8 @@ const Mt = Pt`
|
|
|
1878
1878
|
"max-h-screen": "max-height:100dvh;",
|
|
1879
1879
|
"min-w-0": "min-width:0;",
|
|
1880
1880
|
"min-h-0": "min-height:0;",
|
|
1881
|
+
"min-w-screen": "min-width:100dvw;",
|
|
1882
|
+
"min-h-screen": "min-height:100dvh;",
|
|
1881
1883
|
...zt(),
|
|
1882
1884
|
"m-auto": "margin:auto;",
|
|
1883
1885
|
"mx-auto": "margin-inline:auto;",
|
|
@@ -1932,20 +1934,62 @@ const Mt = Pt`
|
|
|
1932
1934
|
"text-8xl": "font-size:6rem;line-height:1",
|
|
1933
1935
|
/* Borders */
|
|
1934
1936
|
border: "border-width:1px;",
|
|
1937
|
+
"border-t": "border-top-width:1px;",
|
|
1938
|
+
"border-r": "border-right-width:1px;",
|
|
1939
|
+
"border-b": "border-bottom-width:1px;",
|
|
1940
|
+
"border-l": "border-left-width:1px;",
|
|
1941
|
+
"border-x": "border-inline-width:1px;",
|
|
1942
|
+
"border-y": "border-block-width:1px;",
|
|
1935
1943
|
"border-2": "border-width:2px;",
|
|
1936
1944
|
"border-4": "border-width:4px;",
|
|
1937
1945
|
"border-6": "border-width:6px;",
|
|
1938
1946
|
"border-8": "border-width:8px;",
|
|
1939
1947
|
"rounded-none": "border-radius:0;",
|
|
1940
1948
|
"rounded-xs": "border-radius:0.125rem;",
|
|
1949
|
+
"rounded-t-xs": "border-top-left-radius:0.125rem;border-top-right-radius:0.125rem;",
|
|
1950
|
+
"rounded-r-xs": "border-top-right-radius:0.125rem;border-bottom-right-radius:0.125rem;",
|
|
1951
|
+
"rounded-b-xs": "border-bottom-left-radius:0.125rem;border-bottom-right-radius:0.125rem;",
|
|
1952
|
+
"rounded-l-xs": "border-top-left-radius:0.125rem;border-bottom-left-radius:0.125rem;",
|
|
1941
1953
|
"rounded-sm": "border-radius:0.25rem;",
|
|
1954
|
+
"rounded-t-sm": "border-top-left-radius:0.25rem;border-top-right-radius:0.25rem;",
|
|
1955
|
+
"rounded-r-sm": "border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;",
|
|
1956
|
+
"rounded-b-sm": "border-bottom-left-radius:0.25rem;border-bottom-right-radius:0.25rem;",
|
|
1957
|
+
"rounded-l-sm": "border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;",
|
|
1942
1958
|
"rounded-md": "border-radius:0.375rem;",
|
|
1959
|
+
"rounded-t-md": "border-top-left-radius:0.375rem;border-top-right-radius:0.375rem;",
|
|
1960
|
+
"rounded-r-md": "border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem;",
|
|
1961
|
+
"rounded-b-md": "border-bottom-left-radius:0.375rem;border-bottom-right-radius:0.375rem;",
|
|
1962
|
+
"rounded-l-md": "border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem;",
|
|
1943
1963
|
"rounded-lg": "border-radius:0.5rem;",
|
|
1964
|
+
"rounded-t-lg": "border-top-left-radius:0.5rem;border-top-right-radius:0.5rem;",
|
|
1965
|
+
"rounded-r-lg": "border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;",
|
|
1966
|
+
"rounded-b-lg": "border-bottom-left-radius:0.5rem;border-bottom-right-radius:0.5rem;",
|
|
1967
|
+
"rounded-l-lg": "border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;",
|
|
1944
1968
|
"rounded-xl": "border-radius:0.75rem;",
|
|
1969
|
+
"rounded-t-xl": "border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;",
|
|
1970
|
+
"rounded-r-xl": "border-top-right-radius:0.75rem;border-bottom-right-radius:0.75rem;",
|
|
1971
|
+
"rounded-b-xl": "border-bottom-left-radius:0.75rem;border-bottom-right-radius:0.75rem;",
|
|
1972
|
+
"rounded-l-xl": "border-top-left-radius:0.75rem;border-bottom-left-radius:0.75rem;",
|
|
1945
1973
|
"rounded-2xl": "border-radius:1rem;",
|
|
1974
|
+
"rounded-t-2xl": "border-top-left-radius:1rem;border-top-right-radius:1rem;",
|
|
1975
|
+
"rounded-r-2xl": "border-top-right-radius:1rem;border-bottom-right-radius:1rem;",
|
|
1976
|
+
"rounded-b-2xl": "border-bottom-left-radius:1rem;border-bottom-right-radius:1rem;",
|
|
1977
|
+
"rounded-l-2xl": "border-top-left-radius:1rem;border-bottom-left-radius:1rem;",
|
|
1946
1978
|
"rounded-3xl": "border-radius:1.5rem;",
|
|
1979
|
+
"rounded-t-3xl": "border-top-left-radius:1.5rem;border-top-right-radius:1.5rem;",
|
|
1980
|
+
"rounded-r-3xl": "border-top-right-radius:1.5rem;border-bottom-right-radius:1.5rem;",
|
|
1981
|
+
"rounded-b-3xl": "border-bottom-left-radius:1.5rem;border-bottom-right-radius:1.5rem;",
|
|
1982
|
+
"rounded-l-3xl": "border-top-left-radius:1.5rem;border-bottom-left-radius:1.5rem;",
|
|
1947
1983
|
"rounded-4xl": "border-radius:2rem;",
|
|
1984
|
+
"rounded-t-4xl": "border-top-left-radius:2rem;border-top-right-radius:2rem;",
|
|
1985
|
+
"rounded-r-4xl": "border-top-right-radius:2rem;border-bottom-right-radius:2rem;",
|
|
1986
|
+
"rounded-b-4xl": "border-bottom-left-radius:2rem;border-bottom-right-radius:2rem;",
|
|
1987
|
+
"rounded-l-4xl": "border-top-left-radius:2rem;border-bottom-left-radius:2rem;",
|
|
1948
1988
|
"rounded-full": "border-radius:9999px;",
|
|
1989
|
+
"rounded-t-full": "border-top-left-radius:9999px;border-top-right-radius:9999px;",
|
|
1990
|
+
"rounded-r-full": "border-top-right-radius:9999px;border-bottom-right-radius:9999px;",
|
|
1991
|
+
"rounded-b-full": "border-bottom-left-radius:9999px;border-bottom-right-radius:9999px;",
|
|
1992
|
+
"rounded-l-full": "border-top-left-radius:9999px;border-bottom-left-radius:9999px;",
|
|
1949
1993
|
/* Shadow and effects */
|
|
1950
1994
|
// Shadows use a CSS variable for color so color utilities can modify --ce-shadow-color
|
|
1951
1995
|
"shadow-none": "--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);",
|
|
@@ -2062,14 +2106,14 @@ const Mt = Pt`
|
|
|
2062
2106
|
"gap-y": ["row-gap"]
|
|
2063
2107
|
};
|
|
2064
2108
|
function G(e, t) {
|
|
2065
|
-
let
|
|
2109
|
+
let r = 0, n = 0;
|
|
2066
2110
|
for (let i = 0; i < e.length; i++) {
|
|
2067
2111
|
const s = e[i];
|
|
2068
|
-
if (s === "[")
|
|
2069
|
-
else if (s === "]" &&
|
|
2070
|
-
else if (s === "(")
|
|
2071
|
-
else if (s === ")" &&
|
|
2072
|
-
else if (
|
|
2112
|
+
if (s === "[") r++;
|
|
2113
|
+
else if (s === "]" && r > 0) r--;
|
|
2114
|
+
else if (s === "(") n++;
|
|
2115
|
+
else if (s === ")" && n > 0) n--;
|
|
2116
|
+
else if (r === 0 && n === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
2073
2117
|
return e.slice(0, i) + t + e.slice(i);
|
|
2074
2118
|
}
|
|
2075
2119
|
return e + t;
|
|
@@ -2108,23 +2152,23 @@ const It = {
|
|
|
2108
2152
|
dark: "(prefers-color-scheme: dark)"
|
|
2109
2153
|
}, je = ["sm", "md", "lg", "xl", "2xl"];
|
|
2110
2154
|
function Ne(e) {
|
|
2111
|
-
const t = e.startsWith("-"),
|
|
2112
|
-
if (
|
|
2113
|
-
const i =
|
|
2155
|
+
const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
|
|
2156
|
+
if (n.length < 2) return null;
|
|
2157
|
+
const i = n.slice(0, -1).join("-"), s = n[n.length - 1], o = parseFloat(s);
|
|
2114
2158
|
if (Number.isNaN(o) || !Ze[i]) return null;
|
|
2115
2159
|
const a = t ? "-" : "";
|
|
2116
2160
|
return Ze[i].map((u) => `${u}:calc(${a}${le} * ${o});`).join("");
|
|
2117
2161
|
}
|
|
2118
2162
|
function Ge(e) {
|
|
2119
|
-
const t = e.replace("#", ""),
|
|
2120
|
-
return `${
|
|
2163
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, i = r >> 8 & 255, s = r & 255;
|
|
2164
|
+
return `${n} ${i} ${s}`;
|
|
2121
2165
|
}
|
|
2122
2166
|
function Ht(e) {
|
|
2123
2167
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
2124
2168
|
if (!t) return null;
|
|
2125
|
-
const [,
|
|
2169
|
+
const [, r, n, i = "DEFAULT"] = t, s = Nt[n]?.[i];
|
|
2126
2170
|
if (!s) return null;
|
|
2127
|
-
if (
|
|
2171
|
+
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
2128
2172
|
const a = {
|
|
2129
2173
|
bg: "background-color",
|
|
2130
2174
|
decoration: "text-decoration-color",
|
|
@@ -2135,33 +2179,33 @@ function Ht(e) {
|
|
|
2135
2179
|
accent: "accent-color",
|
|
2136
2180
|
fill: "fill",
|
|
2137
2181
|
stroke: "stroke"
|
|
2138
|
-
}[
|
|
2182
|
+
}[r];
|
|
2139
2183
|
return a ? `${a}:${s};` : null;
|
|
2140
2184
|
}
|
|
2141
2185
|
function Bt(e) {
|
|
2142
|
-
const [t,
|
|
2143
|
-
if (!
|
|
2144
|
-
const
|
|
2145
|
-
return isNaN(
|
|
2186
|
+
const [t, r] = e.split("/");
|
|
2187
|
+
if (!r) return { base: t };
|
|
2188
|
+
const n = parseInt(r, 10);
|
|
2189
|
+
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
2146
2190
|
}
|
|
2147
2191
|
function We(e) {
|
|
2148
|
-
const { base: t, opacity:
|
|
2149
|
-
if (
|
|
2150
|
-
if (
|
|
2151
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
2192
|
+
const { base: t, opacity: r } = Bt(e), n = Ht(t);
|
|
2193
|
+
if (n) {
|
|
2194
|
+
if (r !== void 0) {
|
|
2195
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
2152
2196
|
if (s) {
|
|
2153
2197
|
const o = Ge(s[0]);
|
|
2154
|
-
return
|
|
2198
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
2155
2199
|
}
|
|
2156
2200
|
}
|
|
2157
|
-
return
|
|
2201
|
+
return n;
|
|
2158
2202
|
}
|
|
2159
2203
|
const i = Se(t);
|
|
2160
|
-
if (i &&
|
|
2204
|
+
if (i && r !== void 0) {
|
|
2161
2205
|
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
2162
2206
|
if (s) {
|
|
2163
2207
|
const o = Ge(s[0]);
|
|
2164
|
-
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${
|
|
2208
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
2165
2209
|
}
|
|
2166
2210
|
}
|
|
2167
2211
|
return i;
|
|
@@ -2169,8 +2213,8 @@ function We(e) {
|
|
|
2169
2213
|
function ze(e) {
|
|
2170
2214
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
2171
2215
|
if (!t) return null;
|
|
2172
|
-
const
|
|
2173
|
-
return
|
|
2216
|
+
const r = parseInt(t[1], 10);
|
|
2217
|
+
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
2174
2218
|
}
|
|
2175
2219
|
function Se(e) {
|
|
2176
2220
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
@@ -2182,9 +2226,9 @@ function Se(e) {
|
|
|
2182
2226
|
}
|
|
2183
2227
|
return null;
|
|
2184
2228
|
}
|
|
2185
|
-
const t = e.indexOf("-["),
|
|
2186
|
-
if (t > 0 &&
|
|
2187
|
-
const
|
|
2229
|
+
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
2230
|
+
if (t > 0 && r) {
|
|
2231
|
+
const n = e.slice(0, t);
|
|
2188
2232
|
let i = e.slice(t + 2, -1);
|
|
2189
2233
|
i = i.replace(/_/g, " ");
|
|
2190
2234
|
const s = {
|
|
@@ -2203,12 +2247,12 @@ function Se(e) {
|
|
|
2203
2247
|
"max-w": "max-width",
|
|
2204
2248
|
"min-h": "min-height",
|
|
2205
2249
|
"max-h": "max-height",
|
|
2206
|
-
"border-t": "border-top",
|
|
2207
|
-
"border-b": "border-bottom",
|
|
2208
|
-
"border-l": "border-left",
|
|
2209
|
-
"border-r": "border-right",
|
|
2210
|
-
"border-x": "border-inline",
|
|
2211
|
-
"border-y": "border-block",
|
|
2250
|
+
"border-t": "border-top-width",
|
|
2251
|
+
"border-b": "border-bottom-width",
|
|
2252
|
+
"border-l": "border-left-width",
|
|
2253
|
+
"border-r": "border-right-width",
|
|
2254
|
+
"border-x": "border-inline-width",
|
|
2255
|
+
"border-y": "border-block-width",
|
|
2212
2256
|
"grid-cols": "grid-template-columns",
|
|
2213
2257
|
"grid-rows": "grid-template-rows",
|
|
2214
2258
|
transition: "transition-property",
|
|
@@ -2231,22 +2275,22 @@ function Se(e) {
|
|
|
2231
2275
|
leading: "line-height",
|
|
2232
2276
|
z: "z-index"
|
|
2233
2277
|
};
|
|
2234
|
-
if (
|
|
2278
|
+
if (n === "rotate")
|
|
2235
2279
|
return `transform:rotate(${i});`;
|
|
2236
|
-
const o = s[
|
|
2280
|
+
const o = s[n] ?? n.replace(/_/g, "-");
|
|
2237
2281
|
if (o && i) return `${o}:${i};`;
|
|
2238
2282
|
}
|
|
2239
2283
|
return null;
|
|
2240
2284
|
}
|
|
2241
2285
|
function Ut(e) {
|
|
2242
2286
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
2243
|
-
const
|
|
2244
|
-
return
|
|
2287
|
+
const r = e.slice(1, -1);
|
|
2288
|
+
return r.includes("&") ? r : e;
|
|
2245
2289
|
}
|
|
2246
2290
|
const t = e.indexOf("-[");
|
|
2247
2291
|
if (t > 0 && e.endsWith("]")) {
|
|
2248
|
-
const
|
|
2249
|
-
return
|
|
2292
|
+
const r = e.slice(t + 2, -1).replace(/_/g, "-");
|
|
2293
|
+
return r.includes("&") ? r : e.replace(/_/g, "-");
|
|
2250
2294
|
}
|
|
2251
2295
|
return null;
|
|
2252
2296
|
}
|
|
@@ -2254,35 +2298,35 @@ function qt(e) {
|
|
|
2254
2298
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
2255
2299
|
}
|
|
2256
2300
|
function Ft(e) {
|
|
2257
|
-
const t = /class\s*=\s*(['"])(.*?)\1/g,
|
|
2258
|
-
let
|
|
2259
|
-
for (;
|
|
2260
|
-
const i =
|
|
2261
|
-
i.length &&
|
|
2301
|
+
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
2302
|
+
let n;
|
|
2303
|
+
for (; n = t.exec(e); ) {
|
|
2304
|
+
const i = n[2].split(/\s+/).filter(Boolean);
|
|
2305
|
+
i.length && r.push(...i);
|
|
2262
2306
|
}
|
|
2263
|
-
return
|
|
2307
|
+
return r.filter(Boolean);
|
|
2264
2308
|
}
|
|
2265
2309
|
const Xe = /* @__PURE__ */ new Map(), Kt = 16;
|
|
2266
2310
|
function Vt(e) {
|
|
2267
|
-
const t = Date.now(),
|
|
2268
|
-
if (
|
|
2269
|
-
const
|
|
2311
|
+
const t = Date.now(), r = Xe.get(e);
|
|
2312
|
+
if (r && t - r.timestamp < Kt) return r.css;
|
|
2313
|
+
const n = Ft(e), i = new Set(n), s = [], o = [], a = [], u = [], m = {};
|
|
2270
2314
|
function g(w, c = !1) {
|
|
2271
2315
|
const p = (c ? "dark|" : "") + w;
|
|
2272
|
-
if (p in
|
|
2273
|
-
const
|
|
2274
|
-
return
|
|
2316
|
+
if (p in m) return m[p];
|
|
2317
|
+
const y = d(w, c);
|
|
2318
|
+
return m[p] = y, y;
|
|
2275
2319
|
}
|
|
2276
2320
|
function b(w) {
|
|
2277
|
-
const c = w.some((
|
|
2321
|
+
const c = w.some((y) => je.includes(y)), p = w.includes("dark");
|
|
2278
2322
|
return w.length === 0 ? 1 : !c && !p ? 2 : c && !p ? 3 : 4;
|
|
2279
2323
|
}
|
|
2280
2324
|
function h(w) {
|
|
2281
2325
|
const c = [];
|
|
2282
|
-
let p = "",
|
|
2326
|
+
let p = "", y = 0, C = 0;
|
|
2283
2327
|
for (let k = 0; k < w.length; k++) {
|
|
2284
2328
|
const f = w[k];
|
|
2285
|
-
f === "[" ?
|
|
2329
|
+
f === "[" ? y++ : f === "]" && y > 0 ? y-- : f === "(" ? C++ : f === ")" && C > 0 && C--, f === ":" && y === 0 && C === 0 ? (c.push(p), p = "") : p += f;
|
|
2286
2330
|
}
|
|
2287
2331
|
return p && c.push(p), c;
|
|
2288
2332
|
}
|
|
@@ -2318,15 +2362,15 @@ function Vt(e) {
|
|
|
2318
2362
|
}
|
|
2319
2363
|
function d(w, c = !1) {
|
|
2320
2364
|
const p = h(w);
|
|
2321
|
-
let
|
|
2322
|
-
const C = p.find((E) => (E.startsWith("!") && (
|
|
2365
|
+
let y = !1;
|
|
2366
|
+
const C = p.find((E) => (E.startsWith("!") && (y = !0, E = E.slice(1)), Le[E] || Ne(E) || ze(E) || We(E) || Se(E)));
|
|
2323
2367
|
if (!C) return null;
|
|
2324
2368
|
const k = C.replace(/^!/, ""), f = Le[k] ?? Ne(k) ?? ze(k) ?? We(k) ?? Se(k);
|
|
2325
2369
|
if (!f) return null;
|
|
2326
2370
|
const v = p.indexOf(C);
|
|
2327
2371
|
let A = v >= 0 ? p.slice(0, v) : [];
|
|
2328
2372
|
c && (A = A.filter((E) => E !== "dark"));
|
|
2329
|
-
const _ = `.${qt(w)}`, $ = "__SUBJECT__", T =
|
|
2373
|
+
const _ = `.${qt(w)}`, $ = "__SUBJECT__", T = y ? f.replace(/;$/, " !important;") : f;
|
|
2330
2374
|
let R = $;
|
|
2331
2375
|
const S = [];
|
|
2332
2376
|
for (const E of A)
|
|
@@ -2393,7 +2437,7 @@ function Vt(e) {
|
|
|
2393
2437
|
(f) => Le[f] || Ne(f) || ze(f) || We(f) || Se(f)
|
|
2394
2438
|
);
|
|
2395
2439
|
if (!p) continue;
|
|
2396
|
-
const
|
|
2440
|
+
const y = c.indexOf(p), C = y >= 0 ? c.slice(0, y) : [], k = b(C);
|
|
2397
2441
|
if (k === 4) {
|
|
2398
2442
|
const f = g(w, !0);
|
|
2399
2443
|
f && u.push(f);
|
|
@@ -2406,36 +2450,36 @@ function Vt(e) {
|
|
|
2406
2450
|
return Xe.set(e, { css: x, timestamp: t }), x;
|
|
2407
2451
|
}
|
|
2408
2452
|
const ge = [];
|
|
2409
|
-
function Jt(e, t,
|
|
2453
|
+
function Jt(e, t, r, n, i, s, o, a) {
|
|
2410
2454
|
if (e) {
|
|
2411
|
-
ge.push(
|
|
2455
|
+
ge.push(r);
|
|
2412
2456
|
try {
|
|
2413
|
-
const u = t.render(
|
|
2457
|
+
const u = t.render(r);
|
|
2414
2458
|
if (u instanceof Promise) {
|
|
2415
|
-
s(!0), u.then((
|
|
2416
|
-
s(!1), o(null), Ye(e,
|
|
2417
|
-
}).catch((
|
|
2418
|
-
s(!1), o(
|
|
2459
|
+
s(!0), u.then((m) => {
|
|
2460
|
+
s(!1), o(null), Ye(e, m, r, n, i), a(e.innerHTML);
|
|
2461
|
+
}).catch((m) => {
|
|
2462
|
+
s(!1), o(m);
|
|
2419
2463
|
});
|
|
2420
2464
|
return;
|
|
2421
2465
|
}
|
|
2422
|
-
Ye(e, u,
|
|
2466
|
+
Ye(e, u, r, n, i), a(e.innerHTML);
|
|
2423
2467
|
} finally {
|
|
2424
2468
|
ge.pop();
|
|
2425
2469
|
}
|
|
2426
2470
|
}
|
|
2427
2471
|
}
|
|
2428
|
-
function Ye(e, t,
|
|
2472
|
+
function Ye(e, t, r, n, i) {
|
|
2429
2473
|
e && (Ot(
|
|
2430
2474
|
e,
|
|
2431
2475
|
Array.isArray(t) ? t : [t],
|
|
2432
|
-
|
|
2433
|
-
|
|
2476
|
+
r,
|
|
2477
|
+
n
|
|
2434
2478
|
), i(e.innerHTML));
|
|
2435
2479
|
}
|
|
2436
|
-
function Zt(e, t,
|
|
2480
|
+
function Zt(e, t, r, n, i, s, o) {
|
|
2437
2481
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
2438
|
-
if (i(
|
|
2482
|
+
if (i(r + 1), r === 15)
|
|
2439
2483
|
console.warn(
|
|
2440
2484
|
`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
2441
2485
|
Common causes:
|
|
@@ -2444,7 +2488,7 @@ function Zt(e, t, n, r, i, s, o) {
|
|
|
2444
2488
|
• Missing dependencies in computed/watch
|
|
2445
2489
|
Component rendering will be throttled to prevent browser freeze.`
|
|
2446
2490
|
);
|
|
2447
|
-
else if (
|
|
2491
|
+
else if (r > 20) {
|
|
2448
2492
|
console.error(
|
|
2449
2493
|
`🛑 Infinite loop detected in component render:
|
|
2450
2494
|
• This might be caused by state updates during render
|
|
@@ -2455,14 +2499,14 @@ Stopping runaway component render to prevent browser freeze`
|
|
|
2455
2499
|
}
|
|
2456
2500
|
} else
|
|
2457
2501
|
i(0);
|
|
2458
|
-
const
|
|
2459
|
-
|
|
2460
|
-
},
|
|
2461
|
-
o(
|
|
2502
|
+
const m = setTimeout(() => {
|
|
2503
|
+
n(Date.now()), e(), o(null);
|
|
2504
|
+
}, r > 10 ? 100 : 0);
|
|
2505
|
+
o(m);
|
|
2462
2506
|
}
|
|
2463
|
-
function Gt(e, t,
|
|
2507
|
+
function Gt(e, t, r, n, i) {
|
|
2464
2508
|
if (!e) return;
|
|
2465
|
-
const s = Vt(
|
|
2509
|
+
const s = Vt(r);
|
|
2466
2510
|
if ((!s || s.trim() === "") && !t._computedStyle) {
|
|
2467
2511
|
i(null), e.adoptedStyleSheets = [Je()];
|
|
2468
2512
|
return;
|
|
@@ -2473,7 +2517,7 @@ function Gt(e, t, n, r, i) {
|
|
|
2473
2517
|
${s}
|
|
2474
2518
|
`);
|
|
2475
2519
|
a = ct(a);
|
|
2476
|
-
let u =
|
|
2520
|
+
let u = n;
|
|
2477
2521
|
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Je(), u], i(u);
|
|
2478
2522
|
}
|
|
2479
2523
|
let N = null;
|
|
@@ -2483,13 +2527,13 @@ function Xt(e) {
|
|
|
2483
2527
|
function Yt() {
|
|
2484
2528
|
N = null;
|
|
2485
2529
|
}
|
|
2486
|
-
function
|
|
2530
|
+
function pr() {
|
|
2487
2531
|
if (!N)
|
|
2488
2532
|
throw new Error("useEmit must be called during component render");
|
|
2489
2533
|
const e = N.emit;
|
|
2490
|
-
return (t,
|
|
2534
|
+
return (t, r) => e(t, r);
|
|
2491
2535
|
}
|
|
2492
|
-
function
|
|
2536
|
+
function ye(e) {
|
|
2493
2537
|
e._hookCallbacks || Object.defineProperty(e, "_hookCallbacks", {
|
|
2494
2538
|
value: {},
|
|
2495
2539
|
writable: !0,
|
|
@@ -2497,30 +2541,30 @@ function me(e) {
|
|
|
2497
2541
|
configurable: !1
|
|
2498
2542
|
});
|
|
2499
2543
|
}
|
|
2500
|
-
function
|
|
2544
|
+
function hr(e) {
|
|
2501
2545
|
if (!N)
|
|
2502
2546
|
throw new Error("useOnConnected must be called during component render");
|
|
2503
|
-
|
|
2547
|
+
ye(N), N._hookCallbacks.onConnected = e;
|
|
2504
2548
|
}
|
|
2505
|
-
function
|
|
2549
|
+
function gr(e) {
|
|
2506
2550
|
if (!N)
|
|
2507
2551
|
throw new Error("useOnDisconnected must be called during component render");
|
|
2508
|
-
|
|
2552
|
+
ye(N), N._hookCallbacks.onDisconnected = e;
|
|
2509
2553
|
}
|
|
2510
|
-
function
|
|
2554
|
+
function mr(e) {
|
|
2511
2555
|
if (!N)
|
|
2512
2556
|
throw new Error("useOnAttributeChanged must be called during component render");
|
|
2513
|
-
|
|
2557
|
+
ye(N), N._hookCallbacks.onAttributeChanged = e;
|
|
2514
2558
|
}
|
|
2515
|
-
function
|
|
2559
|
+
function yr(e) {
|
|
2516
2560
|
if (!N)
|
|
2517
2561
|
throw new Error("useOnError must be called during component render");
|
|
2518
|
-
|
|
2562
|
+
ye(N), N._hookCallbacks.onError = e;
|
|
2519
2563
|
}
|
|
2520
|
-
function
|
|
2564
|
+
function br(e) {
|
|
2521
2565
|
if (!N)
|
|
2522
2566
|
throw new Error("useStyle must be called during component render");
|
|
2523
|
-
|
|
2567
|
+
ye(N);
|
|
2524
2568
|
try {
|
|
2525
2569
|
const t = e();
|
|
2526
2570
|
Object.defineProperty(N, "_computedStyle", {
|
|
@@ -2589,33 +2633,33 @@ function Qt(e, t) {
|
|
|
2589
2633
|
_templateError = null;
|
|
2590
2634
|
constructor() {
|
|
2591
2635
|
super(), this.attachShadow({ mode: "open" }), this._cfg = Te.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2592
|
-
const
|
|
2593
|
-
Object.defineProperty(
|
|
2636
|
+
const r = this._initContext(t);
|
|
2637
|
+
Object.defineProperty(r, "refs", {
|
|
2594
2638
|
value: this._refs,
|
|
2595
2639
|
writable: !1,
|
|
2596
2640
|
enumerable: !1,
|
|
2597
2641
|
configurable: !1
|
|
2598
|
-
}), Object.defineProperty(
|
|
2642
|
+
}), Object.defineProperty(r, "requestRender", {
|
|
2599
2643
|
value: () => this.requestRender(),
|
|
2600
2644
|
writable: !1,
|
|
2601
2645
|
enumerable: !1,
|
|
2602
2646
|
configurable: !1
|
|
2603
|
-
}), Object.defineProperty(
|
|
2647
|
+
}), Object.defineProperty(r, "_requestRender", {
|
|
2604
2648
|
value: () => this._requestRender(),
|
|
2605
2649
|
writable: !1,
|
|
2606
2650
|
enumerable: !1,
|
|
2607
2651
|
configurable: !1
|
|
2608
|
-
}), Object.defineProperty(
|
|
2652
|
+
}), Object.defineProperty(r, "_componentId", {
|
|
2609
2653
|
value: this._componentId,
|
|
2610
2654
|
writable: !1,
|
|
2611
2655
|
enumerable: !1,
|
|
2612
2656
|
configurable: !1
|
|
2613
|
-
}), Object.defineProperty(
|
|
2657
|
+
}), Object.defineProperty(r, "_triggerWatchers", {
|
|
2614
2658
|
value: (i, s) => this._triggerWatchers(i, s),
|
|
2615
2659
|
writable: !1,
|
|
2616
2660
|
enumerable: !1,
|
|
2617
2661
|
configurable: !1
|
|
2618
|
-
}), this.context =
|
|
2662
|
+
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
2619
2663
|
value: (i, s, o) => {
|
|
2620
2664
|
const a = new CustomEvent(i, {
|
|
2621
2665
|
detail: s,
|
|
@@ -2629,11 +2673,11 @@ function Qt(e, t) {
|
|
|
2629
2673
|
enumerable: !1,
|
|
2630
2674
|
configurable: !1
|
|
2631
2675
|
});
|
|
2632
|
-
const
|
|
2633
|
-
Object.keys(
|
|
2634
|
-
const s =
|
|
2676
|
+
const n = Te.get(e) || t;
|
|
2677
|
+
Object.keys(n).forEach((i) => {
|
|
2678
|
+
const s = n[i];
|
|
2635
2679
|
typeof s == "function" && (this.context[i] = (...o) => s(...o, this.context));
|
|
2636
|
-
}), this._applyComputed(
|
|
2680
|
+
}), this._applyComputed(n), n.props && Object.keys(n.props).forEach((i) => {
|
|
2637
2681
|
let s = this[i];
|
|
2638
2682
|
Object.defineProperty(this, i, {
|
|
2639
2683
|
get() {
|
|
@@ -2641,12 +2685,12 @@ function Qt(e, t) {
|
|
|
2641
2685
|
},
|
|
2642
2686
|
set(o) {
|
|
2643
2687
|
const a = s;
|
|
2644
|
-
s = o, this.context[i] = o, this._initializing || (this._applyProps(
|
|
2688
|
+
s = o, this.context[i] = o, this._initializing || (this._applyProps(n), a !== o && this._requestRender());
|
|
2645
2689
|
},
|
|
2646
2690
|
enumerable: !0,
|
|
2647
2691
|
configurable: !0
|
|
2648
2692
|
});
|
|
2649
|
-
}), this._initializing = !1, this._initWatchers(
|
|
2693
|
+
}), this._initializing = !1, this._initWatchers(n), this._applyProps(n), this._render(n);
|
|
2650
2694
|
}
|
|
2651
2695
|
connectedCallback() {
|
|
2652
2696
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
@@ -2654,8 +2698,8 @@ function Qt(e, t) {
|
|
|
2654
2698
|
t,
|
|
2655
2699
|
this.context,
|
|
2656
2700
|
this._mounted,
|
|
2657
|
-
(
|
|
2658
|
-
this._mounted =
|
|
2701
|
+
(r) => {
|
|
2702
|
+
this._mounted = r;
|
|
2659
2703
|
}
|
|
2660
2704
|
);
|
|
2661
2705
|
});
|
|
@@ -2672,52 +2716,52 @@ function Qt(e, t) {
|
|
|
2672
2716
|
() => {
|
|
2673
2717
|
this._watchers.clear();
|
|
2674
2718
|
},
|
|
2675
|
-
(
|
|
2676
|
-
this._templateLoading =
|
|
2719
|
+
(r) => {
|
|
2720
|
+
this._templateLoading = r;
|
|
2677
2721
|
},
|
|
2678
|
-
(
|
|
2679
|
-
this._templateError =
|
|
2722
|
+
(r) => {
|
|
2723
|
+
this._templateError = r;
|
|
2680
2724
|
},
|
|
2681
|
-
(
|
|
2682
|
-
this._mounted =
|
|
2725
|
+
(r) => {
|
|
2726
|
+
this._mounted = r;
|
|
2683
2727
|
}
|
|
2684
2728
|
);
|
|
2685
2729
|
});
|
|
2686
2730
|
}
|
|
2687
|
-
attributeChangedCallback(
|
|
2731
|
+
attributeChangedCallback(r, n, i) {
|
|
2688
2732
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2689
|
-
this._applyProps(t),
|
|
2733
|
+
this._applyProps(t), n !== i && this._requestRender(), kt(
|
|
2690
2734
|
t,
|
|
2691
|
-
n,
|
|
2692
2735
|
r,
|
|
2736
|
+
n,
|
|
2693
2737
|
i,
|
|
2694
2738
|
this.context
|
|
2695
2739
|
);
|
|
2696
2740
|
});
|
|
2697
2741
|
}
|
|
2698
2742
|
static get observedAttributes() {
|
|
2699
|
-
return t.props ? Object.keys(t.props).map(
|
|
2743
|
+
return t.props ? Object.keys(t.props).map(re) : [];
|
|
2700
2744
|
}
|
|
2701
|
-
_applyComputed(
|
|
2745
|
+
_applyComputed(r) {
|
|
2702
2746
|
}
|
|
2703
2747
|
// --- Render ---
|
|
2704
|
-
_render(
|
|
2705
|
-
this._runLogicWithinErrorBoundary(
|
|
2748
|
+
_render(r) {
|
|
2749
|
+
this._runLogicWithinErrorBoundary(r, () => {
|
|
2706
2750
|
Jt(
|
|
2707
2751
|
this.shadowRoot,
|
|
2708
|
-
|
|
2752
|
+
r,
|
|
2709
2753
|
this.context,
|
|
2710
2754
|
this._refs,
|
|
2711
|
-
(
|
|
2712
|
-
this._lastHtmlStringForJitCSS =
|
|
2755
|
+
(n) => {
|
|
2756
|
+
this._lastHtmlStringForJitCSS = n, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(n);
|
|
2713
2757
|
},
|
|
2714
|
-
(
|
|
2715
|
-
this._templateLoading =
|
|
2758
|
+
(n) => {
|
|
2759
|
+
this._templateLoading = n, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(n);
|
|
2716
2760
|
},
|
|
2717
|
-
(
|
|
2718
|
-
this._templateError =
|
|
2761
|
+
(n) => {
|
|
2762
|
+
this._templateError = n, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(n);
|
|
2719
2763
|
},
|
|
2720
|
-
(
|
|
2764
|
+
(n) => this._applyStyle(r, n)
|
|
2721
2765
|
);
|
|
2722
2766
|
});
|
|
2723
2767
|
}
|
|
@@ -2731,27 +2775,27 @@ function Qt(e, t) {
|
|
|
2731
2775
|
() => this._render(this._cfg),
|
|
2732
2776
|
this._lastRenderTime,
|
|
2733
2777
|
this._renderCount,
|
|
2734
|
-
(
|
|
2735
|
-
this._lastRenderTime =
|
|
2778
|
+
(r) => {
|
|
2779
|
+
this._lastRenderTime = r;
|
|
2736
2780
|
},
|
|
2737
|
-
(
|
|
2738
|
-
this._renderCount =
|
|
2781
|
+
(r) => {
|
|
2782
|
+
this._renderCount = r;
|
|
2739
2783
|
},
|
|
2740
2784
|
this._renderTimeoutId,
|
|
2741
|
-
(
|
|
2742
|
-
this._renderTimeoutId =
|
|
2785
|
+
(r) => {
|
|
2786
|
+
this._renderTimeoutId = r;
|
|
2743
2787
|
}
|
|
2744
2788
|
);
|
|
2745
2789
|
}, this._componentId);
|
|
2746
2790
|
});
|
|
2747
2791
|
}
|
|
2748
2792
|
// --- Style ---
|
|
2749
|
-
_applyStyle(
|
|
2750
|
-
this._runLogicWithinErrorBoundary(
|
|
2793
|
+
_applyStyle(r, n) {
|
|
2794
|
+
this._runLogicWithinErrorBoundary(r, () => {
|
|
2751
2795
|
Gt(
|
|
2752
2796
|
this.shadowRoot,
|
|
2753
2797
|
this.context,
|
|
2754
|
-
|
|
2798
|
+
n,
|
|
2755
2799
|
this._styleSheet,
|
|
2756
2800
|
(i) => {
|
|
2757
2801
|
this._styleSheet = i;
|
|
@@ -2760,21 +2804,21 @@ function Qt(e, t) {
|
|
|
2760
2804
|
});
|
|
2761
2805
|
}
|
|
2762
2806
|
// --- Error Boundary function ---
|
|
2763
|
-
_runLogicWithinErrorBoundary(
|
|
2807
|
+
_runLogicWithinErrorBoundary(r, n) {
|
|
2764
2808
|
this._hasError && (this._hasError = !1);
|
|
2765
2809
|
try {
|
|
2766
|
-
|
|
2810
|
+
n();
|
|
2767
2811
|
} catch (i) {
|
|
2768
|
-
this._hasError = !0,
|
|
2812
|
+
this._hasError = !0, r.onError && r.onError(i, this.context);
|
|
2769
2813
|
}
|
|
2770
2814
|
}
|
|
2771
2815
|
// --- State, props, computed ---
|
|
2772
|
-
_initContext(
|
|
2816
|
+
_initContext(r) {
|
|
2773
2817
|
try {
|
|
2774
|
-
let
|
|
2818
|
+
let n = function(s, o = "") {
|
|
2775
2819
|
return Array.isArray(s) ? new Proxy(s, {
|
|
2776
|
-
get(a, u,
|
|
2777
|
-
const g = Reflect.get(a, u,
|
|
2820
|
+
get(a, u, m) {
|
|
2821
|
+
const g = Reflect.get(a, u, m);
|
|
2778
2822
|
return typeof g == "function" && typeof u == "string" && [
|
|
2779
2823
|
"push",
|
|
2780
2824
|
"pop",
|
|
@@ -2787,56 +2831,56 @@ function Qt(e, t) {
|
|
|
2787
2831
|
const l = g.apply(a, h);
|
|
2788
2832
|
if (!i._initializing) {
|
|
2789
2833
|
const d = o || "root";
|
|
2790
|
-
i._triggerWatchers(d, a), fe(() => i._render(
|
|
2834
|
+
i._triggerWatchers(d, a), fe(() => i._render(r), i._componentId);
|
|
2791
2835
|
}
|
|
2792
2836
|
return l;
|
|
2793
2837
|
} : g;
|
|
2794
2838
|
},
|
|
2795
|
-
set(a, u,
|
|
2796
|
-
if (a[u] =
|
|
2839
|
+
set(a, u, m) {
|
|
2840
|
+
if (a[u] = m, !i._initializing) {
|
|
2797
2841
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2798
|
-
i._triggerWatchers(g,
|
|
2842
|
+
i._triggerWatchers(g, m), fe(() => i._render(r), i._componentId);
|
|
2799
2843
|
}
|
|
2800
2844
|
return !0;
|
|
2801
2845
|
},
|
|
2802
2846
|
deleteProperty(a, u) {
|
|
2803
2847
|
if (delete a[u], !i._initializing) {
|
|
2804
|
-
const
|
|
2805
|
-
i._triggerWatchers(
|
|
2848
|
+
const m = o ? `${o}.${String(u)}` : String(u);
|
|
2849
|
+
i._triggerWatchers(m, void 0), fe(() => i._render(r), i._componentId);
|
|
2806
2850
|
}
|
|
2807
2851
|
return !0;
|
|
2808
2852
|
}
|
|
2809
2853
|
}) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((a) => {
|
|
2810
2854
|
const u = o ? `${o}.${a}` : a;
|
|
2811
|
-
s[a] =
|
|
2855
|
+
s[a] = n(s[a], u);
|
|
2812
2856
|
}), new Proxy(s, {
|
|
2813
|
-
set(a, u,
|
|
2857
|
+
set(a, u, m) {
|
|
2814
2858
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2815
|
-
return a[u] =
|
|
2859
|
+
return a[u] = n(m, g), i._initializing || (i._triggerWatchers(
|
|
2816
2860
|
g,
|
|
2817
2861
|
a[u]
|
|
2818
|
-
), fe(() => i._render(
|
|
2862
|
+
), fe(() => i._render(r), i._componentId)), !0;
|
|
2819
2863
|
},
|
|
2820
|
-
get(a, u,
|
|
2821
|
-
return Reflect.get(a, u,
|
|
2864
|
+
get(a, u, m) {
|
|
2865
|
+
return Reflect.get(a, u, m);
|
|
2822
2866
|
}
|
|
2823
2867
|
})) : s;
|
|
2824
2868
|
};
|
|
2825
2869
|
const i = this;
|
|
2826
|
-
return
|
|
2870
|
+
return n({
|
|
2827
2871
|
// For functional components, state is managed by state() function calls
|
|
2828
2872
|
// Include prop defaults in initial reactive context so prop updates trigger reactivity
|
|
2829
|
-
...
|
|
2830
|
-
Object.entries(
|
|
2873
|
+
...r.props ? Object.fromEntries(
|
|
2874
|
+
Object.entries(r.props).map(([s, o]) => [s, o.default])
|
|
2831
2875
|
) : {}
|
|
2832
2876
|
});
|
|
2833
2877
|
} catch {
|
|
2834
2878
|
return {};
|
|
2835
2879
|
}
|
|
2836
2880
|
}
|
|
2837
|
-
_initWatchers(
|
|
2838
|
-
this._runLogicWithinErrorBoundary(
|
|
2839
|
-
|
|
2881
|
+
_initWatchers(r) {
|
|
2882
|
+
this._runLogicWithinErrorBoundary(r, () => {
|
|
2883
|
+
mt(
|
|
2840
2884
|
this.context,
|
|
2841
2885
|
this._watchers,
|
|
2842
2886
|
{}
|
|
@@ -2844,41 +2888,41 @@ function Qt(e, t) {
|
|
|
2844
2888
|
);
|
|
2845
2889
|
});
|
|
2846
2890
|
}
|
|
2847
|
-
_triggerWatchers(
|
|
2848
|
-
|
|
2891
|
+
_triggerWatchers(r, n) {
|
|
2892
|
+
yt(this.context, this._watchers, r, n);
|
|
2849
2893
|
}
|
|
2850
|
-
_applyProps(
|
|
2851
|
-
this._runLogicWithinErrorBoundary(
|
|
2894
|
+
_applyProps(r) {
|
|
2895
|
+
this._runLogicWithinErrorBoundary(r, () => {
|
|
2852
2896
|
try {
|
|
2853
|
-
wt(this,
|
|
2854
|
-
} catch (
|
|
2855
|
-
this._hasError = !0,
|
|
2897
|
+
wt(this, r, this.context);
|
|
2898
|
+
} catch (n) {
|
|
2899
|
+
this._hasError = !0, r.onError && r.onError(n, this.context);
|
|
2856
2900
|
}
|
|
2857
2901
|
});
|
|
2858
2902
|
}
|
|
2859
2903
|
};
|
|
2860
2904
|
}
|
|
2861
2905
|
function et(e, t) {
|
|
2862
|
-
let
|
|
2863
|
-
|
|
2864
|
-
let
|
|
2906
|
+
let r = re(e);
|
|
2907
|
+
r.includes("-") || (r = `cer-${r}`);
|
|
2908
|
+
let n = {};
|
|
2865
2909
|
if (typeof window < "u")
|
|
2866
2910
|
try {
|
|
2867
2911
|
const a = t.toString().match(/\(\s*{\s*([^}]+)\s*}/);
|
|
2868
2912
|
if (a) {
|
|
2869
|
-
const
|
|
2870
|
-
for (const g of
|
|
2913
|
+
const m = a[1].split(",").map((g) => g.trim());
|
|
2914
|
+
for (const g of m) {
|
|
2871
2915
|
const b = g.indexOf("=");
|
|
2872
2916
|
if (b !== -1) {
|
|
2873
2917
|
const h = g.substring(0, b).trim(), l = g.substring(b + 1).trim();
|
|
2874
2918
|
try {
|
|
2875
|
-
l === "true" ?
|
|
2919
|
+
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;
|
|
2876
2920
|
} catch {
|
|
2877
|
-
|
|
2921
|
+
n[h] = "";
|
|
2878
2922
|
}
|
|
2879
2923
|
} else {
|
|
2880
2924
|
const h = g.split(":")[0].trim();
|
|
2881
|
-
h && !h.includes("}") && (
|
|
2925
|
+
h && !h.includes("}") && (n[h] = "");
|
|
2882
2926
|
}
|
|
2883
2927
|
}
|
|
2884
2928
|
}
|
|
@@ -2888,7 +2932,7 @@ function et(e, t) {
|
|
|
2888
2932
|
const s = {
|
|
2889
2933
|
// Generate props config from defaults
|
|
2890
2934
|
props: Object.fromEntries(
|
|
2891
|
-
Object.entries(
|
|
2935
|
+
Object.entries(n).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
|
|
2892
2936
|
),
|
|
2893
2937
|
// Add lifecycle hooks from the stored functions
|
|
2894
2938
|
onConnected: (o) => {
|
|
@@ -2897,55 +2941,55 @@ function et(e, t) {
|
|
|
2897
2941
|
onDisconnected: (o) => {
|
|
2898
2942
|
i.onDisconnected && i.onDisconnected();
|
|
2899
2943
|
},
|
|
2900
|
-
onAttributeChanged: (o, a, u,
|
|
2944
|
+
onAttributeChanged: (o, a, u, m) => {
|
|
2901
2945
|
i.onAttributeChanged && i.onAttributeChanged(o, a, u);
|
|
2902
2946
|
},
|
|
2903
2947
|
onError: (o, a) => {
|
|
2904
2948
|
i.onError && o && i.onError(o);
|
|
2905
2949
|
},
|
|
2906
2950
|
render: (o) => {
|
|
2907
|
-
const a = o._componentId || `${
|
|
2951
|
+
const a = o._componentId || `${r}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2908
2952
|
F.setCurrentComponent(a, () => {
|
|
2909
2953
|
o.requestRender && o.requestRender();
|
|
2910
2954
|
});
|
|
2911
2955
|
try {
|
|
2912
2956
|
Xt(o);
|
|
2913
|
-
const u = Object.keys(
|
|
2914
|
-
let
|
|
2957
|
+
const u = Object.keys(n).length > 0;
|
|
2958
|
+
let m;
|
|
2915
2959
|
if (u) {
|
|
2916
2960
|
const g = {};
|
|
2917
|
-
Object.keys(
|
|
2918
|
-
g[b] = o[b] ??
|
|
2919
|
-
}),
|
|
2961
|
+
Object.keys(n).forEach((b) => {
|
|
2962
|
+
g[b] = o[b] ?? n[b];
|
|
2963
|
+
}), m = t(g);
|
|
2920
2964
|
} else
|
|
2921
|
-
|
|
2965
|
+
m = t();
|
|
2922
2966
|
if (o._hookCallbacks) {
|
|
2923
2967
|
const g = o._hookCallbacks;
|
|
2924
2968
|
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);
|
|
2925
2969
|
}
|
|
2926
|
-
return
|
|
2970
|
+
return m;
|
|
2927
2971
|
} finally {
|
|
2928
2972
|
Yt(), F.clearCurrentComponent();
|
|
2929
2973
|
}
|
|
2930
2974
|
}
|
|
2931
2975
|
};
|
|
2932
|
-
Te.set(
|
|
2976
|
+
Te.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(r, Qt(r, s)));
|
|
2933
2977
|
}
|
|
2934
|
-
class
|
|
2978
|
+
class er {
|
|
2935
2979
|
map = /* @__PURE__ */ new Map();
|
|
2936
2980
|
maxSize;
|
|
2937
2981
|
constructor(t) {
|
|
2938
2982
|
this.maxSize = t;
|
|
2939
2983
|
}
|
|
2940
2984
|
get(t) {
|
|
2941
|
-
const
|
|
2942
|
-
if (
|
|
2943
|
-
return this.map.delete(t), this.map.set(t,
|
|
2985
|
+
const r = this.map.get(t);
|
|
2986
|
+
if (r !== void 0)
|
|
2987
|
+
return this.map.delete(t), this.map.set(t, r), r;
|
|
2944
2988
|
}
|
|
2945
|
-
set(t,
|
|
2946
|
-
if (this.map.has(t) && this.map.delete(t), this.map.set(t,
|
|
2947
|
-
const
|
|
2948
|
-
|
|
2989
|
+
set(t, r) {
|
|
2990
|
+
if (this.map.has(t) && this.map.delete(t), this.map.set(t, r), this.map.size > this.maxSize) {
|
|
2991
|
+
const n = this.map.keys().next().value;
|
|
2992
|
+
n !== void 0 && this.map.delete(n);
|
|
2949
2993
|
}
|
|
2950
2994
|
}
|
|
2951
2995
|
has(t) {
|
|
@@ -2955,8 +2999,8 @@ class en {
|
|
|
2955
2999
|
this.map.clear();
|
|
2956
3000
|
}
|
|
2957
3001
|
}
|
|
2958
|
-
const De = new
|
|
2959
|
-
function
|
|
3002
|
+
const De = new er(500);
|
|
3003
|
+
function tr(e, t) {
|
|
2960
3004
|
if (e == null) {
|
|
2961
3005
|
console.warn(
|
|
2962
3006
|
`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`
|
|
@@ -2969,9 +3013,9 @@ function tn(e, t) {
|
|
|
2969
3013
|
`💡 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()}"`
|
|
2970
3014
|
);
|
|
2971
3015
|
}
|
|
2972
|
-
function pe(e, t = {},
|
|
2973
|
-
const i =
|
|
2974
|
-
return { tag: e, key: i, props: t, children:
|
|
3016
|
+
function pe(e, t = {}, r, n) {
|
|
3017
|
+
const i = n ?? t.key;
|
|
3018
|
+
return { tag: e, key: i, props: t, children: r };
|
|
2975
3019
|
}
|
|
2976
3020
|
function Ae(e) {
|
|
2977
3021
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
@@ -2979,47 +3023,47 @@ function Ae(e) {
|
|
|
2979
3023
|
function _e(e) {
|
|
2980
3024
|
return typeof e == "object" && e !== null && "tag" in e && !Ae(e);
|
|
2981
3025
|
}
|
|
2982
|
-
function
|
|
3026
|
+
function rr(e, t) {
|
|
2983
3027
|
return e.key != null ? e : { ...e, key: t };
|
|
2984
3028
|
}
|
|
2985
|
-
function
|
|
2986
|
-
const
|
|
3029
|
+
function nr(e, t = [], r = {}) {
|
|
3030
|
+
const n = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2987
3031
|
let u;
|
|
2988
3032
|
for (; u = a.exec(e); ) {
|
|
2989
|
-
const
|
|
3033
|
+
const m = u[1], g = u[2], b = (u[4] || u[6]) ?? "", h = b.match(/^{{(\d+)}}$/);
|
|
2990
3034
|
let l = h ? t[Number(h[1])] ?? null : b;
|
|
2991
3035
|
h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
2992
3036
|
const d = ["model", "bind", "show", "class", "style", "ref"];
|
|
2993
|
-
if (
|
|
3037
|
+
if (m === ":") {
|
|
2994
3038
|
const [x, w] = g.split(":"), [c, ...p] = x.split(".");
|
|
2995
3039
|
if (d.includes(c)) {
|
|
2996
|
-
const
|
|
3040
|
+
const y = [...p], C = c === "model" && w ? `model:${w}` : c;
|
|
2997
3041
|
s[C] = {
|
|
2998
3042
|
value: l,
|
|
2999
|
-
modifiers:
|
|
3043
|
+
modifiers: y,
|
|
3000
3044
|
arg: w
|
|
3001
3045
|
};
|
|
3002
3046
|
} else {
|
|
3003
|
-
let
|
|
3004
|
-
|
|
3047
|
+
let y = l;
|
|
3048
|
+
y && ee(y) && (y = y.value), i[g] = y, o.push(g);
|
|
3005
3049
|
}
|
|
3006
|
-
} else if (
|
|
3050
|
+
} else if (m === "@") {
|
|
3007
3051
|
const [x, ...w] = g.split("."), c = w;
|
|
3008
|
-
|
|
3009
|
-
const p = typeof l == "function" ? l : typeof
|
|
3052
|
+
tr(l, x);
|
|
3053
|
+
const p = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
3010
3054
|
if (p) {
|
|
3011
|
-
const
|
|
3055
|
+
const y = (k) => {
|
|
3012
3056
|
if (c.includes("prevent") && k.preventDefault(), c.includes("stop") && k.stopPropagation(), !(c.includes("self") && k.target !== k.currentTarget))
|
|
3013
|
-
return c.includes("once") && k.currentTarget?.removeEventListener(x,
|
|
3057
|
+
return c.includes("once") && k.currentTarget?.removeEventListener(x, y), p(k);
|
|
3014
3058
|
}, C = "on" + x.charAt(0).toUpperCase() + x.slice(1);
|
|
3015
|
-
|
|
3059
|
+
n[C] = y;
|
|
3016
3060
|
}
|
|
3017
|
-
} else g === "ref" ?
|
|
3061
|
+
} else g === "ref" ? n.ref = l : i[g] = l;
|
|
3018
3062
|
}
|
|
3019
|
-
return { props:
|
|
3063
|
+
return { props: n, attrs: i, directives: s, bound: o };
|
|
3020
3064
|
}
|
|
3021
|
-
function
|
|
3022
|
-
const
|
|
3065
|
+
function ir(e, t, r) {
|
|
3066
|
+
const n = ge.length > 0 ? ge[ge.length - 1] : void 0, i = r ?? n, s = !r && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
|
|
3023
3067
|
if (s && o) {
|
|
3024
3068
|
const f = De.get(o);
|
|
3025
3069
|
if (f) return f;
|
|
@@ -3030,7 +3074,7 @@ function sn(e, t, n) {
|
|
|
3030
3074
|
let u = "";
|
|
3031
3075
|
for (let f = 0; f < e.length; f++)
|
|
3032
3076
|
u += e[f], f < t.length && (u += `{{${f}}}`);
|
|
3033
|
-
const
|
|
3077
|
+
const m = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
|
|
3034
3078
|
let b, h = [], l = null, d = {}, x, w = 0, c = [];
|
|
3035
3079
|
function p(f) {
|
|
3036
3080
|
!f || typeof f != "object" || Ae(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((v) => {
|
|
@@ -3049,7 +3093,7 @@ function sn(e, t, n) {
|
|
|
3049
3093
|
d.attrs[v] = f.attrs[v];
|
|
3050
3094
|
}))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
|
|
3051
3095
|
}
|
|
3052
|
-
function
|
|
3096
|
+
function y(f, v) {
|
|
3053
3097
|
const A = l ? h : c;
|
|
3054
3098
|
if (Ae(f)) {
|
|
3055
3099
|
const _ = f.key ?? v;
|
|
@@ -3062,14 +3106,14 @@ function sn(e, t, n) {
|
|
|
3062
3106
|
return;
|
|
3063
3107
|
}
|
|
3064
3108
|
if (_e(f)) {
|
|
3065
|
-
A.push(
|
|
3109
|
+
A.push(rr(f, void 0));
|
|
3066
3110
|
return;
|
|
3067
3111
|
}
|
|
3068
3112
|
if (Array.isArray(f)) {
|
|
3069
3113
|
if (f.length === 0) return;
|
|
3070
3114
|
for (let _ = 0; _ < f.length; _++) {
|
|
3071
3115
|
const $ = f[_];
|
|
3072
|
-
Ae($) || _e($) || Array.isArray($) ?
|
|
3116
|
+
Ae($) || _e($) || Array.isArray($) ? y($, `${v}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${v}-${_}`));
|
|
3073
3117
|
}
|
|
3074
3118
|
return;
|
|
3075
3119
|
}
|
|
@@ -3095,7 +3139,7 @@ function sn(e, t, n) {
|
|
|
3095
3139
|
"track",
|
|
3096
3140
|
"wbr"
|
|
3097
3141
|
]);
|
|
3098
|
-
for (; b =
|
|
3142
|
+
for (; b = m.exec(u); )
|
|
3099
3143
|
if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
|
|
3100
3144
|
if (b[1]) {
|
|
3101
3145
|
const f = b[1], v = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
|
|
@@ -3103,7 +3147,7 @@ function sn(e, t, n) {
|
|
|
3103
3147
|
attrs: $,
|
|
3104
3148
|
directives: T,
|
|
3105
3149
|
bound: R
|
|
3106
|
-
} =
|
|
3150
|
+
} = nr(b[2] || "", t, i), S = { props: {}, attrs: {} };
|
|
3107
3151
|
for (const P in _) S.props[P] = _[P];
|
|
3108
3152
|
for (const P in $) S.attrs[P] = $[P];
|
|
3109
3153
|
if (S.attrs && Object.prototype.hasOwnProperty.call(S.attrs, "key") && !(S.props && Object.prototype.hasOwnProperty.call(S.props, "key")))
|
|
@@ -3150,14 +3194,14 @@ function sn(e, t, n) {
|
|
|
3150
3194
|
let O;
|
|
3151
3195
|
typeof z == "string" && i ? O = U(W, z) : (O = z, O && ee(O) && (O = O.value)), S.props[E] = O;
|
|
3152
3196
|
try {
|
|
3153
|
-
const
|
|
3154
|
-
S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[
|
|
3197
|
+
const ne = re(E);
|
|
3198
|
+
S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[ne] = O);
|
|
3155
3199
|
} catch {
|
|
3156
3200
|
}
|
|
3157
3201
|
S.isCustomElement = !0;
|
|
3158
|
-
const qe = `update:${
|
|
3159
|
-
S.props[ut] = function(
|
|
3160
|
-
const Y =
|
|
3202
|
+
const qe = `update:${re(E)}`.replace(/-([a-z])/g, (ne, Y) => Y.toUpperCase()), ut = "on" + qe.charAt(0).toUpperCase() + qe.slice(1);
|
|
3203
|
+
S.props[ut] = function(ne) {
|
|
3204
|
+
const Y = ne.detail !== void 0 ? ne.detail : ne.target ? ne.target.value : void 0;
|
|
3161
3205
|
if (W)
|
|
3162
3206
|
if (z && ee(z)) {
|
|
3163
3207
|
const ae = z.value;
|
|
@@ -3186,7 +3230,7 @@ function sn(e, t, n) {
|
|
|
3186
3230
|
}), l = f, d = S, h = []);
|
|
3187
3231
|
} else if (typeof b[3] < "u") {
|
|
3188
3232
|
const f = Number(b[3]), v = t[f], A = `interp-${f}`;
|
|
3189
|
-
|
|
3233
|
+
y(v, A);
|
|
3190
3234
|
} else if (b[4]) {
|
|
3191
3235
|
const f = b[4], v = l ? h : c, A = f.split(/({{\d+}})/);
|
|
3192
3236
|
for (const _ of A) {
|
|
@@ -3194,7 +3238,7 @@ function sn(e, t, n) {
|
|
|
3194
3238
|
const $ = _.match(/^{{(\d+)}}$/);
|
|
3195
3239
|
if ($) {
|
|
3196
3240
|
const T = Number($[1]), R = t[T], S = `interp-${T}`;
|
|
3197
|
-
|
|
3241
|
+
y(R, S);
|
|
3198
3242
|
} else {
|
|
3199
3243
|
const T = `text-${w++}`;
|
|
3200
3244
|
v.push(a(_, T));
|
|
@@ -3213,94 +3257,94 @@ function sn(e, t, n) {
|
|
|
3213
3257
|
return pe("div", {}, "", "fallback-root");
|
|
3214
3258
|
}
|
|
3215
3259
|
function ce(e, ...t) {
|
|
3216
|
-
const
|
|
3217
|
-
return
|
|
3260
|
+
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
3261
|
+
return ir(e, t, n);
|
|
3218
3262
|
}
|
|
3219
3263
|
function Re(e, t) {
|
|
3220
3264
|
return j(e ? t : [], "when-block");
|
|
3221
3265
|
}
|
|
3222
|
-
function
|
|
3223
|
-
return e.map((
|
|
3224
|
-
const i = typeof
|
|
3225
|
-
return j(t(
|
|
3266
|
+
function wr(e, t) {
|
|
3267
|
+
return e.map((r, n) => {
|
|
3268
|
+
const i = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
|
|
3269
|
+
return j(t(r, n), `each-${i}`);
|
|
3226
3270
|
});
|
|
3227
3271
|
}
|
|
3228
|
-
function
|
|
3272
|
+
function sr() {
|
|
3229
3273
|
const e = [];
|
|
3230
3274
|
return {
|
|
3231
|
-
when(t,
|
|
3232
|
-
return e.push([t,
|
|
3275
|
+
when(t, r) {
|
|
3276
|
+
return e.push([t, r]), this;
|
|
3233
3277
|
},
|
|
3234
3278
|
otherwise(t) {
|
|
3235
3279
|
return e.push([!0, t]), this;
|
|
3236
3280
|
},
|
|
3237
3281
|
done() {
|
|
3238
|
-
return
|
|
3282
|
+
return or(...e);
|
|
3239
3283
|
}
|
|
3240
3284
|
};
|
|
3241
3285
|
}
|
|
3242
|
-
function
|
|
3286
|
+
function or(...e) {
|
|
3243
3287
|
for (let t = 0; t < e.length; t++) {
|
|
3244
|
-
const [
|
|
3245
|
-
if (
|
|
3288
|
+
const [r, n] = e[t];
|
|
3289
|
+
if (r) return [j(n, `whenChain-branch-${t}`)];
|
|
3246
3290
|
}
|
|
3247
3291
|
return [j([], "whenChain-empty")];
|
|
3248
3292
|
}
|
|
3249
3293
|
function j(e, t) {
|
|
3250
|
-
const
|
|
3294
|
+
const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
3251
3295
|
return {
|
|
3252
3296
|
tag: "#anchor",
|
|
3253
3297
|
key: t,
|
|
3254
|
-
children:
|
|
3298
|
+
children: r
|
|
3255
3299
|
};
|
|
3256
3300
|
}
|
|
3257
|
-
function
|
|
3301
|
+
function xr(e, t) {
|
|
3258
3302
|
return Re(!e, t);
|
|
3259
3303
|
}
|
|
3260
|
-
function
|
|
3261
|
-
const
|
|
3262
|
-
return Re(
|
|
3304
|
+
function vr(e, t) {
|
|
3305
|
+
const r = !e || e.length === 0;
|
|
3306
|
+
return Re(r, t);
|
|
3263
3307
|
}
|
|
3264
|
-
function
|
|
3265
|
-
const
|
|
3266
|
-
return Re(
|
|
3308
|
+
function kr(e, t) {
|
|
3309
|
+
const r = !!(e && e.length > 0);
|
|
3310
|
+
return Re(r, t);
|
|
3267
3311
|
}
|
|
3268
|
-
function
|
|
3269
|
-
const
|
|
3312
|
+
function Cr(e, t, r) {
|
|
3313
|
+
const n = [];
|
|
3270
3314
|
return e.forEach((i, s) => {
|
|
3271
|
-
t(i, s) &&
|
|
3272
|
-
}),
|
|
3315
|
+
t(i, s) && n.push({ item: i, originalIndex: s });
|
|
3316
|
+
}), n.map(({ item: i, originalIndex: s }, o) => {
|
|
3273
3317
|
const a = typeof i == "object" && i != null ? i?.key ?? i?.id ?? `filtered-${s}` : `filtered-${s}`;
|
|
3274
|
-
return j(
|
|
3318
|
+
return j(r(i, s, o), `each-where-${a}`);
|
|
3275
3319
|
});
|
|
3276
3320
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const
|
|
3279
|
-
return
|
|
3321
|
+
function _r(e, t) {
|
|
3322
|
+
const r = e?.length ?? 0;
|
|
3323
|
+
return r === 0 && t.empty ? j(t.empty, "switch-length-empty") : r === 1 && t.one ? j(t.one(e[0]), "switch-length-one") : t.exactly?.[r] ? j(t.exactly[r](e), `switch-length-${r}`) : r > 1 && t.many ? j(t.many(e), "switch-length-many") : j([], "switch-length-fallback");
|
|
3280
3324
|
}
|
|
3281
|
-
function
|
|
3282
|
-
const
|
|
3325
|
+
function Er(e, t, r) {
|
|
3326
|
+
const n = /* @__PURE__ */ new Map();
|
|
3283
3327
|
return e.forEach((i) => {
|
|
3284
3328
|
const s = t(i);
|
|
3285
|
-
|
|
3286
|
-
}), Array.from(
|
|
3287
|
-
|
|
3329
|
+
n.has(s) || n.set(s, []), n.get(s).push(i);
|
|
3330
|
+
}), Array.from(n.entries()).map(([i, s], o) => j(
|
|
3331
|
+
r(i, s, o),
|
|
3288
3332
|
`each-group-${i}`
|
|
3289
3333
|
));
|
|
3290
3334
|
}
|
|
3291
|
-
function
|
|
3292
|
-
const i =
|
|
3335
|
+
function $r(e, t, r, n) {
|
|
3336
|
+
const i = r * t, s = Math.min(i + t, e.length);
|
|
3293
3337
|
return e.slice(i, s).map((a, u) => {
|
|
3294
|
-
const
|
|
3295
|
-
return j(
|
|
3338
|
+
const m = i + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${m}` : `page-${m}`;
|
|
3339
|
+
return j(n(a, m, u), `each-page-${g}`);
|
|
3296
3340
|
});
|
|
3297
3341
|
}
|
|
3298
|
-
function
|
|
3342
|
+
function Sr(e, t) {
|
|
3299
3343
|
return e.loading && t.loading ? j(t.loading, "promise-loading") : e.error && t.error ? j(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? j(t.success(e.data), "promise-success") : t.idle ? j(t.idle, "promise-idle") : j([], "promise-fallback");
|
|
3300
3344
|
}
|
|
3301
3345
|
function q(e, t) {
|
|
3302
|
-
const
|
|
3303
|
-
return Re(!!
|
|
3346
|
+
const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
|
|
3347
|
+
return Re(!!r, t);
|
|
3304
3348
|
}
|
|
3305
3349
|
const te = {
|
|
3306
3350
|
// Responsive breakpoints (matching style.ts)
|
|
@@ -3311,7 +3355,7 @@ const te = {
|
|
|
3311
3355
|
"2xl": "(min-width:1536px)",
|
|
3312
3356
|
// Dark mode (matching style.ts)
|
|
3313
3357
|
dark: "(prefers-color-scheme: dark)"
|
|
3314
|
-
}, lt = ["sm", "md", "lg", "xl", "2xl"],
|
|
3358
|
+
}, lt = ["sm", "md", "lg", "xl", "2xl"], ar = {
|
|
3315
3359
|
// Breakpoint-based rendering (matching style.ts exactly)
|
|
3316
3360
|
sm: (e) => q(te.sm, e),
|
|
3317
3361
|
md: (e) => q(te.md, e),
|
|
@@ -3330,44 +3374,44 @@ const te = {
|
|
|
3330
3374
|
portrait: (e) => q("(orientation: portrait)", e),
|
|
3331
3375
|
landscape: (e) => q("(orientation: landscape)", e)
|
|
3332
3376
|
};
|
|
3333
|
-
function
|
|
3334
|
-
const
|
|
3335
|
-
e.includes("dark") ?
|
|
3336
|
-
const
|
|
3377
|
+
function Ar(e, t) {
|
|
3378
|
+
const r = [];
|
|
3379
|
+
e.includes("dark") ? r.push(te.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
|
|
3380
|
+
const n = e.filter(
|
|
3337
3381
|
(o) => lt.includes(o)
|
|
3338
|
-
), i =
|
|
3339
|
-
i && i in te &&
|
|
3340
|
-
const s =
|
|
3382
|
+
), i = n[n.length - 1];
|
|
3383
|
+
i && i in te && r.push(te[i]);
|
|
3384
|
+
const s = r.length > 0 ? r.join(" and ") : "all";
|
|
3341
3385
|
return q(s, t);
|
|
3342
3386
|
}
|
|
3343
|
-
function
|
|
3387
|
+
function Tr(e) {
|
|
3344
3388
|
const t = [];
|
|
3345
|
-
return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((
|
|
3346
|
-
const
|
|
3347
|
-
|
|
3389
|
+
return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((r) => {
|
|
3390
|
+
const n = e[r];
|
|
3391
|
+
n && t.push(ar[r](n));
|
|
3348
3392
|
}), t;
|
|
3349
3393
|
}
|
|
3350
|
-
function
|
|
3394
|
+
function Rr(e) {
|
|
3351
3395
|
const t = [];
|
|
3352
|
-
let
|
|
3396
|
+
let r = null;
|
|
3353
3397
|
return {
|
|
3354
|
-
case(
|
|
3355
|
-
const s = typeof
|
|
3398
|
+
case(n, i) {
|
|
3399
|
+
const s = typeof n == "function" ? n : (o) => o === n;
|
|
3356
3400
|
return t.push({ condition: s, content: i }), this;
|
|
3357
3401
|
},
|
|
3358
|
-
when(
|
|
3359
|
-
return t.push({ condition:
|
|
3402
|
+
when(n, i) {
|
|
3403
|
+
return t.push({ condition: n, content: i }), this;
|
|
3360
3404
|
},
|
|
3361
|
-
otherwise(
|
|
3362
|
-
return
|
|
3405
|
+
otherwise(n) {
|
|
3406
|
+
return r = n, this;
|
|
3363
3407
|
},
|
|
3364
3408
|
done() {
|
|
3365
|
-
for (let
|
|
3366
|
-
const { condition: i, content: s } = t[
|
|
3409
|
+
for (let n = 0; n < t.length; n++) {
|
|
3410
|
+
const { condition: i, content: s } = t[n];
|
|
3367
3411
|
if (i(e))
|
|
3368
|
-
return j(s, `switch-case-${
|
|
3412
|
+
return j(s, `switch-case-${n}`);
|
|
3369
3413
|
}
|
|
3370
|
-
return j(
|
|
3414
|
+
return j(r || [], "switch-otherwise");
|
|
3371
3415
|
}
|
|
3372
3416
|
};
|
|
3373
3417
|
}
|
|
@@ -3386,14 +3430,14 @@ class de extends EventTarget {
|
|
|
3386
3430
|
* @param eventName - Name of the event
|
|
3387
3431
|
* @param data - Optional event payload
|
|
3388
3432
|
*/
|
|
3389
|
-
emit(t,
|
|
3390
|
-
const
|
|
3391
|
-
if (!i ||
|
|
3392
|
-
this.eventCounters.set(t, { count: 1, window:
|
|
3433
|
+
emit(t, r) {
|
|
3434
|
+
const n = Date.now(), i = this.eventCounters.get(t);
|
|
3435
|
+
if (!i || n - i.window > 1e3)
|
|
3436
|
+
this.eventCounters.set(t, { count: 1, window: n });
|
|
3393
3437
|
else if (i.count++, i.count > 50 && i.count > 100)
|
|
3394
3438
|
return;
|
|
3395
3439
|
this.dispatchEvent(new CustomEvent(t, {
|
|
3396
|
-
detail:
|
|
3440
|
+
detail: r,
|
|
3397
3441
|
bubbles: !1,
|
|
3398
3442
|
// Global events don't need to bubble
|
|
3399
3443
|
cancelable: !0
|
|
@@ -3401,7 +3445,7 @@ class de extends EventTarget {
|
|
|
3401
3445
|
const s = this.handlers[t];
|
|
3402
3446
|
s && s.forEach((o) => {
|
|
3403
3447
|
try {
|
|
3404
|
-
o(
|
|
3448
|
+
o(r);
|
|
3405
3449
|
} catch (a) {
|
|
3406
3450
|
se(`Error in global event handler for "${t}":`, a);
|
|
3407
3451
|
}
|
|
@@ -3412,17 +3456,17 @@ class de extends EventTarget {
|
|
|
3412
3456
|
* @param eventName - Name of the event
|
|
3413
3457
|
* @param handler - Handler function
|
|
3414
3458
|
*/
|
|
3415
|
-
on(t,
|
|
3416
|
-
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(
|
|
3459
|
+
on(t, r) {
|
|
3460
|
+
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(r), () => this.off(t, r);
|
|
3417
3461
|
}
|
|
3418
3462
|
/**
|
|
3419
3463
|
* Remove a specific handler for a global event.
|
|
3420
3464
|
* @param eventName - Name of the event
|
|
3421
3465
|
* @param handler - Handler function to remove
|
|
3422
3466
|
*/
|
|
3423
|
-
off(t,
|
|
3424
|
-
const
|
|
3425
|
-
|
|
3467
|
+
off(t, r) {
|
|
3468
|
+
const n = this.handlers[t];
|
|
3469
|
+
n && n.delete(r);
|
|
3426
3470
|
}
|
|
3427
3471
|
/**
|
|
3428
3472
|
* Remove all handlers for a specific event.
|
|
@@ -3437,18 +3481,18 @@ class de extends EventTarget {
|
|
|
3437
3481
|
* @param handler - CustomEvent handler
|
|
3438
3482
|
* @param options - AddEventListener options
|
|
3439
3483
|
*/
|
|
3440
|
-
listen(t,
|
|
3441
|
-
return this.addEventListener(t,
|
|
3484
|
+
listen(t, r, n) {
|
|
3485
|
+
return this.addEventListener(t, r, n), () => this.removeEventListener(t, r);
|
|
3442
3486
|
}
|
|
3443
3487
|
/**
|
|
3444
3488
|
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
3445
3489
|
* @param eventName - Name of the event
|
|
3446
3490
|
* @param handler - Handler function
|
|
3447
3491
|
*/
|
|
3448
|
-
once(t,
|
|
3449
|
-
return new Promise((
|
|
3492
|
+
once(t, r) {
|
|
3493
|
+
return new Promise((n) => {
|
|
3450
3494
|
const i = this.on(t, (s) => {
|
|
3451
|
-
i(),
|
|
3495
|
+
i(), r(s), n(s);
|
|
3452
3496
|
});
|
|
3453
3497
|
});
|
|
3454
3498
|
}
|
|
@@ -3478,10 +3522,10 @@ class de extends EventTarget {
|
|
|
3478
3522
|
*/
|
|
3479
3523
|
getEventStats() {
|
|
3480
3524
|
const t = {};
|
|
3481
|
-
for (const [
|
|
3482
|
-
t[
|
|
3483
|
-
count:
|
|
3484
|
-
handlersCount: this.getHandlerCount(
|
|
3525
|
+
for (const [r, n] of this.eventCounters.entries())
|
|
3526
|
+
t[r] = {
|
|
3527
|
+
count: n.count,
|
|
3528
|
+
handlersCount: this.getHandlerCount(r)
|
|
3485
3529
|
};
|
|
3486
3530
|
return t;
|
|
3487
3531
|
}
|
|
@@ -3492,12 +3536,12 @@ class de extends EventTarget {
|
|
|
3492
3536
|
this.eventCounters.clear();
|
|
3493
3537
|
}
|
|
3494
3538
|
}
|
|
3495
|
-
const be = de.getInstance(),
|
|
3539
|
+
const be = de.getInstance(), Or = (e, t) => be.emit(e, t), Pr = (e, t) => be.on(e, t), Lr = (e, t) => be.off(e, t), Mr = (e, t) => be.once(e, t), jr = (e, t, r) => be.listen(e, t, r);
|
|
3496
3540
|
function tt(e) {
|
|
3497
3541
|
let t = { ...e };
|
|
3498
|
-
const
|
|
3499
|
-
function
|
|
3500
|
-
|
|
3542
|
+
const r = [];
|
|
3543
|
+
function n(a) {
|
|
3544
|
+
r.push(a), a(t);
|
|
3501
3545
|
}
|
|
3502
3546
|
function i() {
|
|
3503
3547
|
return t;
|
|
@@ -3507,23 +3551,23 @@ function tt(e) {
|
|
|
3507
3551
|
t = { ...t, ...u }, o();
|
|
3508
3552
|
}
|
|
3509
3553
|
function o() {
|
|
3510
|
-
|
|
3554
|
+
r.forEach((a) => a(t));
|
|
3511
3555
|
}
|
|
3512
|
-
return { subscribe:
|
|
3556
|
+
return { subscribe: n, getState: i, setState: s };
|
|
3513
3557
|
}
|
|
3514
|
-
const
|
|
3515
|
-
for (const
|
|
3516
|
-
const
|
|
3558
|
+
const rt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
|
|
3559
|
+
for (const r of e) {
|
|
3560
|
+
const n = [], i = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
|
|
3517
3561
|
if (o) {
|
|
3518
3562
|
const a = {};
|
|
3519
|
-
return
|
|
3520
|
-
a[u] = o[
|
|
3521
|
-
}), { route:
|
|
3563
|
+
return n.forEach((u, m) => {
|
|
3564
|
+
a[u] = o[m + 1];
|
|
3565
|
+
}), { route: r, params: a };
|
|
3522
3566
|
}
|
|
3523
3567
|
}
|
|
3524
3568
|
return { route: null, params: {} };
|
|
3525
3569
|
}, Ie = {};
|
|
3526
|
-
async function
|
|
3570
|
+
async function cr(e) {
|
|
3527
3571
|
if (e.component) return e.component;
|
|
3528
3572
|
if (e.load) {
|
|
3529
3573
|
if (Ie[e.path]) return Ie[e.path];
|
|
@@ -3536,9 +3580,9 @@ async function ln(e) {
|
|
|
3536
3580
|
}
|
|
3537
3581
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
3538
3582
|
}
|
|
3539
|
-
function
|
|
3540
|
-
const { routes: t, base:
|
|
3541
|
-
let i, s, o, a, u,
|
|
3583
|
+
function lr(e) {
|
|
3584
|
+
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
3585
|
+
let i, s, o, a, u, m, g;
|
|
3542
3586
|
const b = async (x, w) => {
|
|
3543
3587
|
const c = t.find((p) => Q([p], x.path).route !== null);
|
|
3544
3588
|
if (c?.beforeEnter)
|
|
@@ -3570,24 +3614,24 @@ function un(e) {
|
|
|
3570
3614
|
}, d = async (x, w = !1) => {
|
|
3571
3615
|
try {
|
|
3572
3616
|
const c = {
|
|
3573
|
-
path: x.replace(
|
|
3617
|
+
path: x.replace(r, "") || "/",
|
|
3574
3618
|
query: {}
|
|
3575
3619
|
}, p = Q(t, c.path);
|
|
3576
3620
|
if (!p) throw new Error(`No route found for ${c.path}`);
|
|
3577
|
-
const
|
|
3621
|
+
const y = o.getState(), C = {
|
|
3578
3622
|
path: c.path,
|
|
3579
3623
|
params: p.params,
|
|
3580
3624
|
query: c.query
|
|
3581
3625
|
};
|
|
3582
|
-
if (!await b(C,
|
|
3583
|
-
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "",
|
|
3626
|
+
if (!await b(C, y) || !await h(C, y)) return;
|
|
3627
|
+
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + x) : window.history.pushState({}, "", r + x)), o.setState(C), l(C, y);
|
|
3584
3628
|
} catch (c) {
|
|
3585
3629
|
se("Navigation error:", c);
|
|
3586
3630
|
}
|
|
3587
3631
|
};
|
|
3588
|
-
if (typeof window < "u" && typeof document < "u" && typeof
|
|
3632
|
+
if (typeof window < "u" && typeof document < "u" && typeof n > "u") {
|
|
3589
3633
|
i = () => {
|
|
3590
|
-
const w = new URL(window.location.href), c = w.pathname.replace(
|
|
3634
|
+
const w = new URL(window.location.href), c = w.pathname.replace(r, "") || "/", p = rt(w.search);
|
|
3591
3635
|
return { path: c, query: p };
|
|
3592
3636
|
}, s = i();
|
|
3593
3637
|
const x = Q(t, s.path);
|
|
@@ -3598,11 +3642,11 @@ function un(e) {
|
|
|
3598
3642
|
}), a = async (w = !1) => {
|
|
3599
3643
|
const c = i();
|
|
3600
3644
|
await d(c.path, w);
|
|
3601
|
-
}, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1),
|
|
3645
|
+
}, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1), m = (w) => d(w, !0), g = () => window.history.back();
|
|
3602
3646
|
} else {
|
|
3603
3647
|
i = () => {
|
|
3604
|
-
const c = new URL(
|
|
3605
|
-
return { path: p, query:
|
|
3648
|
+
const c = new URL(n || "/", "http://localhost"), p = c.pathname.replace(r, "") || "/", y = rt(c.search);
|
|
3649
|
+
return { path: p, query: y };
|
|
3606
3650
|
}, s = i();
|
|
3607
3651
|
const x = Q(t, s.path);
|
|
3608
3652
|
o = tt({
|
|
@@ -3616,13 +3660,13 @@ function un(e) {
|
|
|
3616
3660
|
const w = async (c) => {
|
|
3617
3661
|
try {
|
|
3618
3662
|
const p = {
|
|
3619
|
-
path: c.replace(
|
|
3663
|
+
path: c.replace(r, "") || "/",
|
|
3620
3664
|
query: {}
|
|
3621
|
-
},
|
|
3622
|
-
if (!
|
|
3665
|
+
}, y = Q(t, p.path);
|
|
3666
|
+
if (!y) throw new Error(`No route found for ${p.path}`);
|
|
3623
3667
|
const C = o.getState(), k = {
|
|
3624
3668
|
path: p.path,
|
|
3625
|
-
params:
|
|
3669
|
+
params: y.params,
|
|
3626
3670
|
query: p.query
|
|
3627
3671
|
}, f = t.find((v) => Q([v], k.path).route !== null);
|
|
3628
3672
|
if (f?.beforeEnter)
|
|
@@ -3655,27 +3699,27 @@ function un(e) {
|
|
|
3655
3699
|
} catch {
|
|
3656
3700
|
}
|
|
3657
3701
|
};
|
|
3658
|
-
u = async (c) => w(c),
|
|
3702
|
+
u = async (c) => w(c), m = async (c) => w(c), g = () => {
|
|
3659
3703
|
};
|
|
3660
3704
|
}
|
|
3661
3705
|
return {
|
|
3662
3706
|
store: o,
|
|
3663
3707
|
push: u,
|
|
3664
|
-
replace:
|
|
3708
|
+
replace: m,
|
|
3665
3709
|
back: g,
|
|
3666
3710
|
subscribe: o.subscribe,
|
|
3667
3711
|
matchRoute: (x) => Q(t, x),
|
|
3668
3712
|
getCurrent: () => o.getState(),
|
|
3669
|
-
resolveRouteComponent:
|
|
3713
|
+
resolveRouteComponent: cr
|
|
3670
3714
|
};
|
|
3671
3715
|
}
|
|
3672
|
-
function
|
|
3716
|
+
function Nr(e, t) {
|
|
3673
3717
|
return Q(e, t);
|
|
3674
3718
|
}
|
|
3675
|
-
function
|
|
3676
|
-
const t =
|
|
3677
|
-
return et("router-view", (
|
|
3678
|
-
const { onConnected: i } =
|
|
3719
|
+
function Wr(e) {
|
|
3720
|
+
const t = lr(e);
|
|
3721
|
+
return et("router-view", (r = {}, n = {}) => {
|
|
3722
|
+
const { onConnected: i } = n;
|
|
3679
3723
|
if (i && i(() => {
|
|
3680
3724
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
3681
3725
|
});
|
|
@@ -3685,30 +3729,30 @@ function zn(e) {
|
|
|
3685
3729
|
if (typeof u == "string")
|
|
3686
3730
|
return { tag: u, props: {}, children: [] };
|
|
3687
3731
|
if (typeof u == "function") {
|
|
3688
|
-
const
|
|
3689
|
-
return (
|
|
3732
|
+
const m = u();
|
|
3733
|
+
return (m instanceof Promise ? m : Promise.resolve(m)).then((b) => typeof b == "string" ? { tag: b, props: {}, children: [] } : b);
|
|
3690
3734
|
}
|
|
3691
3735
|
return ce`<div>Invalid route component</div>`;
|
|
3692
3736
|
}).catch(() => ce`<div>Invalid route component</div>`) : ce`<div>Not found</div>`;
|
|
3693
|
-
}), et("router-link", (
|
|
3737
|
+
}), et("router-link", (r = {}, n = {}) => {
|
|
3694
3738
|
const {
|
|
3695
3739
|
to: i = "",
|
|
3696
3740
|
tag: s = "a",
|
|
3697
3741
|
replace: o = !1,
|
|
3698
3742
|
exact: a = !1,
|
|
3699
3743
|
activeClass: u = "active",
|
|
3700
|
-
exactActiveClass:
|
|
3744
|
+
exactActiveClass: m = "exact-active",
|
|
3701
3745
|
ariaCurrentValue: g = "page",
|
|
3702
3746
|
disabled: b = !1,
|
|
3703
3747
|
external: h = !1,
|
|
3704
3748
|
class: l = ""
|
|
3705
|
-
} =
|
|
3706
|
-
for (const _ of p)
|
|
3749
|
+
} = r, d = t.getCurrent(), x = d.path === i, w = a ? x : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = x ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), y = {};
|
|
3750
|
+
for (const _ of p) y[_] = !0;
|
|
3707
3751
|
const C = {
|
|
3708
|
-
...
|
|
3752
|
+
...y,
|
|
3709
3753
|
// Also include the configurable names (may duplicate the above)
|
|
3710
3754
|
[u]: w,
|
|
3711
|
-
[
|
|
3755
|
+
[m]: x
|
|
3712
3756
|
}, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", v = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
|
|
3713
3757
|
if (b) {
|
|
3714
3758
|
_.preventDefault();
|
|
@@ -3717,7 +3761,7 @@ function zn(e) {
|
|
|
3717
3761
|
h && (s === "a" || !s) || (_.preventDefault(), o ? t.replace(i) : t.push(i));
|
|
3718
3762
|
};
|
|
3719
3763
|
return ce`
|
|
3720
|
-
${
|
|
3764
|
+
${sr().when(k, ce`
|
|
3721
3765
|
<button
|
|
3722
3766
|
part="button"
|
|
3723
3767
|
:class="${C}"
|
|
@@ -3744,48 +3788,48 @@ export {
|
|
|
3744
3788
|
de as GlobalEventBus,
|
|
3745
3789
|
j as anchorBlock,
|
|
3746
3790
|
et as component,
|
|
3747
|
-
|
|
3791
|
+
fr as computed,
|
|
3748
3792
|
tt as createStore,
|
|
3749
3793
|
Pt as css,
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3794
|
+
wr as each,
|
|
3795
|
+
Er as eachGroup,
|
|
3796
|
+
$r as eachPage,
|
|
3797
|
+
Cr as eachWhere,
|
|
3798
|
+
Or as emit,
|
|
3755
3799
|
be as eventBus,
|
|
3756
3800
|
ce as html,
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3801
|
+
Wr as initRouter,
|
|
3802
|
+
jr as listen,
|
|
3803
|
+
sr as match,
|
|
3760
3804
|
Q as matchRoute,
|
|
3761
|
-
|
|
3805
|
+
Nr as matchRouteSSR,
|
|
3762
3806
|
te as mediaVariants,
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3807
|
+
Lr as off,
|
|
3808
|
+
Pr as on,
|
|
3809
|
+
Mr as once,
|
|
3810
|
+
rt as parseQuery,
|
|
3811
|
+
ur as ref,
|
|
3768
3812
|
Pe as renderToString,
|
|
3769
|
-
|
|
3770
|
-
|
|
3813
|
+
cr as resolveRouteComponent,
|
|
3814
|
+
ar as responsive,
|
|
3771
3815
|
lt as responsiveOrder,
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3816
|
+
Tr as responsiveSwitch,
|
|
3817
|
+
Rr as switchOn,
|
|
3818
|
+
_r as switchOnLength,
|
|
3819
|
+
Sr as switchOnPromise,
|
|
3820
|
+
xr as unless,
|
|
3821
|
+
pr as useEmit,
|
|
3822
|
+
mr as useOnAttributeChanged,
|
|
3823
|
+
hr as useOnConnected,
|
|
3824
|
+
gr as useOnDisconnected,
|
|
3825
|
+
yr as useOnError,
|
|
3826
|
+
lr as useRouter,
|
|
3827
|
+
br as useStyle,
|
|
3828
|
+
dr as watch,
|
|
3785
3829
|
Re as when,
|
|
3786
|
-
|
|
3830
|
+
vr as whenEmpty,
|
|
3787
3831
|
q as whenMedia,
|
|
3788
|
-
|
|
3789
|
-
|
|
3832
|
+
kr as whenNotEmpty,
|
|
3833
|
+
Ar as whenVariants
|
|
3790
3834
|
};
|
|
3791
3835
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|