@jasonshimmy/custom-elements-runtime 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/custom-elements-runtime.cjs.js +10 -10
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +680 -680
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +8 -8
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
1
|
+
function yt(e, t) {
|
|
2
2
|
return te(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return e.map((r,
|
|
6
|
-
const
|
|
7
|
-
return te(t(r,
|
|
4
|
+
function mt(e, t) {
|
|
5
|
+
return e.map((r, n) => {
|
|
6
|
+
const o = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
|
|
7
|
+
return te(t(r, n), `each-${o}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Be() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,14 +17,14 @@ function ze() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return Re(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Re(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
|
-
const [r,
|
|
27
|
-
if (r) return [te(
|
|
26
|
+
const [r, n] = e[t];
|
|
27
|
+
if (r) return [te(n, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
29
|
return [te([], "whenChain-empty")];
|
|
30
30
|
}
|
|
@@ -36,7 +36,7 @@ function te(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class K extends EventTarget {
|
|
40
40
|
handlers = {};
|
|
41
41
|
static instance;
|
|
42
42
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,7 +44,7 @@ class F extends EventTarget {
|
|
|
44
44
|
* Returns the singleton instance of GlobalEventBus
|
|
45
45
|
*/
|
|
46
46
|
static getInstance() {
|
|
47
|
-
return
|
|
47
|
+
return K.instance || (K.instance = new K()), K.instance;
|
|
48
48
|
}
|
|
49
49
|
// Enhanced emit method with better typing and event storm protection
|
|
50
50
|
/**
|
|
@@ -53,10 +53,10 @@ class F extends EventTarget {
|
|
|
53
53
|
* @param data - Optional event payload
|
|
54
54
|
*/
|
|
55
55
|
emit(t, r) {
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
58
|
-
this.eventCounters.set(t, { count: 1, window:
|
|
59
|
-
else if (
|
|
56
|
+
const n = Date.now(), o = this.eventCounters.get(t);
|
|
57
|
+
if (!o || n - o.window > 1e3)
|
|
58
|
+
this.eventCounters.set(t, { count: 1, window: n });
|
|
59
|
+
else if (o.count++, o.count > 50 && (console.error(`Event storm detected for "${t}": ${o.count} events in 1 second. Throttling...`), o.count > 100)) {
|
|
60
60
|
console.warn(`Blocking further "${t}" events to prevent infinite loop`);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
@@ -89,8 +89,8 @@ class F extends EventTarget {
|
|
|
89
89
|
* @param handler - Handler function to remove
|
|
90
90
|
*/
|
|
91
91
|
off(t, r) {
|
|
92
|
-
const
|
|
93
|
-
|
|
92
|
+
const n = this.handlers[t];
|
|
93
|
+
n && n.delete(r);
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* Remove all handlers for a specific event.
|
|
@@ -105,8 +105,8 @@ class F extends EventTarget {
|
|
|
105
105
|
* @param handler - CustomEvent handler
|
|
106
106
|
* @param options - AddEventListener options
|
|
107
107
|
*/
|
|
108
|
-
listen(t, r,
|
|
109
|
-
return this.addEventListener(t, r,
|
|
108
|
+
listen(t, r, n) {
|
|
109
|
+
return this.addEventListener(t, r, n), () => this.removeEventListener(t, r);
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
@@ -114,9 +114,9 @@ class F extends EventTarget {
|
|
|
114
114
|
* @param handler - Handler function
|
|
115
115
|
*/
|
|
116
116
|
once(t, r) {
|
|
117
|
-
return new Promise((
|
|
118
|
-
const
|
|
119
|
-
|
|
117
|
+
return new Promise((n) => {
|
|
118
|
+
const o = this.on(t, (s) => {
|
|
119
|
+
o(), r(s), n(s);
|
|
120
120
|
});
|
|
121
121
|
});
|
|
122
122
|
}
|
|
@@ -146,9 +146,9 @@ class F extends EventTarget {
|
|
|
146
146
|
*/
|
|
147
147
|
getEventStats() {
|
|
148
148
|
const t = {};
|
|
149
|
-
for (const [r,
|
|
149
|
+
for (const [r, n] of this.eventCounters.entries())
|
|
150
150
|
t[r] = {
|
|
151
|
-
count:
|
|
151
|
+
count: n.count,
|
|
152
152
|
handlersCount: this.getHandlerCount(r)
|
|
153
153
|
};
|
|
154
154
|
return t;
|
|
@@ -160,24 +160,24 @@ class F extends EventTarget {
|
|
|
160
160
|
this.eventCounters.clear();
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
const Z =
|
|
163
|
+
const Z = K.getInstance(), bt = (e, t) => Z.emit(e, t), vt = (e, t) => Z.on(e, t), xt = (e, t) => Z.off(e, t), wt = (e, t) => Z.once(e, t), kt = (e, t, r) => Z.listen(e, t, r);
|
|
164
164
|
function xe(e) {
|
|
165
165
|
let t = { ...e };
|
|
166
166
|
const r = [];
|
|
167
|
-
function
|
|
167
|
+
function n(a) {
|
|
168
168
|
r.push(a), a(t);
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function o() {
|
|
171
171
|
return t;
|
|
172
172
|
}
|
|
173
173
|
function s(a) {
|
|
174
|
-
const
|
|
175
|
-
t = { ...t, ...
|
|
174
|
+
const c = typeof a == "function" ? a(t) : a;
|
|
175
|
+
t = { ...t, ...c }, i();
|
|
176
176
|
}
|
|
177
177
|
function i() {
|
|
178
178
|
r.forEach((a) => a(t));
|
|
179
179
|
}
|
|
180
|
-
return { subscribe:
|
|
180
|
+
return { subscribe: n, getState: o, setState: s };
|
|
181
181
|
}
|
|
182
182
|
function me(e) {
|
|
183
183
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -194,72 +194,72 @@ function pe(e) {
|
|
|
194
194
|
})[t]
|
|
195
195
|
) : e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Pe(e, t, r) {
|
|
198
198
|
if (r)
|
|
199
|
-
for (const [
|
|
199
|
+
for (const [n, o] of Object.entries(r)) {
|
|
200
200
|
let s, i = {};
|
|
201
|
-
if (Array.isArray(
|
|
201
|
+
if (Array.isArray(o) ? (s = o[0], i = o[1] || {}) : s = o, t.set(n, {
|
|
202
202
|
callback: s,
|
|
203
203
|
options: i,
|
|
204
|
-
oldValue: he(e,
|
|
204
|
+
oldValue: he(e, n)
|
|
205
205
|
}), i.immediate)
|
|
206
206
|
try {
|
|
207
|
-
const a = he(e,
|
|
207
|
+
const a = he(e, n);
|
|
208
208
|
s(a, void 0, e);
|
|
209
209
|
} catch (a) {
|
|
210
|
-
console.error(`Error in immediate watcher for "${
|
|
210
|
+
console.error(`Error in immediate watcher for "${n}":`, a);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
function he(e, t) {
|
|
215
|
-
return t.split(".").reduce((r,
|
|
215
|
+
return t.split(".").reduce((r, n) => r?.[n], e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
const
|
|
217
|
+
function Oe(e, t, r, n) {
|
|
218
|
+
const o = (i, a) => {
|
|
219
219
|
if (i === a) return !0;
|
|
220
220
|
if (typeof i != typeof a || typeof i != "object" || i === null || a === null) return !1;
|
|
221
221
|
if (Array.isArray(i) && Array.isArray(a))
|
|
222
|
-
return i.length !== a.length ? !1 : i.every((
|
|
223
|
-
const
|
|
224
|
-
return
|
|
222
|
+
return i.length !== a.length ? !1 : i.every((p, y) => o(p, a[y]));
|
|
223
|
+
const c = Object.keys(i), f = Object.keys(a);
|
|
224
|
+
return c.length !== f.length ? !1 : c.every((p) => o(i[p], a[p]));
|
|
225
225
|
}, s = t.get(r);
|
|
226
|
-
if (s && !n
|
|
226
|
+
if (s && !o(n, s.oldValue))
|
|
227
227
|
try {
|
|
228
|
-
s.callback(
|
|
228
|
+
s.callback(n, s.oldValue, e), s.oldValue = n;
|
|
229
229
|
} catch (i) {
|
|
230
230
|
console.error(`Error in watcher for "${r}":`, i);
|
|
231
231
|
}
|
|
232
232
|
for (const [i, a] of t.entries())
|
|
233
233
|
if (a.options.deep && r.startsWith(i + "."))
|
|
234
234
|
try {
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
} catch (
|
|
238
|
-
console.error(`Error in deep watcher for "${i}":`,
|
|
235
|
+
const c = he(e, i);
|
|
236
|
+
o(c, a.oldValue) || (a.callback(c, a.oldValue, e), a.oldValue = c);
|
|
237
|
+
} catch (c) {
|
|
238
|
+
console.error(`Error in deep watcher for "${i}":`, c);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Me(e, t, r) {
|
|
242
242
|
if (!t.props) return;
|
|
243
|
-
function o
|
|
244
|
-
return s === Boolean ?
|
|
243
|
+
function n(o, s) {
|
|
244
|
+
return s === Boolean ? o === "true" : s === Number ? Number(o) : o;
|
|
245
245
|
}
|
|
246
|
-
Object.entries(t.props).forEach(([
|
|
247
|
-
if (s.type === Function && typeof e[
|
|
248
|
-
r[
|
|
246
|
+
Object.entries(t.props).forEach(([o, s]) => {
|
|
247
|
+
if (s.type === Function && typeof e[o] == "function")
|
|
248
|
+
r[o] = e[o];
|
|
249
249
|
else {
|
|
250
|
-
const i = e.getAttribute(me(
|
|
251
|
-
i !== null ? r[
|
|
250
|
+
const i = e.getAttribute(me(o));
|
|
251
|
+
i !== null ? r[o] = pe(n(i, s.type)) : "default" in s && s.default !== void 0 && (r[o] = pe(s.default));
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
e.onConnected && !r && (e.onConnected(t),
|
|
255
|
+
function Ne(e, t, r, n) {
|
|
256
|
+
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
257
257
|
}
|
|
258
|
-
function We(e, t, r,
|
|
259
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((
|
|
258
|
+
function We(e, t, r, n, o, s, i, a) {
|
|
259
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((c) => c()), n(), o(), s(!1), i(null), a(!1);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
e.onAttributeChanged && e.onAttributeChanged(t, r,
|
|
261
|
+
function De(e, t, r, n, o) {
|
|
262
|
+
e.onAttributeChanged && e.onAttributeChanged(t, r, n, o);
|
|
263
263
|
}
|
|
264
264
|
function q(e, t) {
|
|
265
265
|
if (t && e instanceof HTMLElement) {
|
|
@@ -269,35 +269,35 @@ function q(e, t) {
|
|
|
269
269
|
q(r, t);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
return typeof t == "string" ? t.split(".").reduce((r,
|
|
272
|
+
function I(e, t) {
|
|
273
|
+
return typeof t == "string" ? t.split(".").reduce((r, n) => r?.[n], e) : t;
|
|
274
274
|
}
|
|
275
275
|
function we(e, t, r) {
|
|
276
|
-
const
|
|
277
|
-
if (!
|
|
278
|
-
const s =
|
|
279
|
-
s[
|
|
276
|
+
const n = t.split("."), o = n.pop();
|
|
277
|
+
if (!o) return;
|
|
278
|
+
const s = n.reduce((i, a) => (a in i || (i[a] = {}), i[a]), e);
|
|
279
|
+
s[o] = r;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function qe(e, t, r, n, o, s, i) {
|
|
282
282
|
if (!s) return;
|
|
283
|
-
const a = t.includes("lazy"),
|
|
283
|
+
const a = t.includes("lazy"), c = t.includes("trim"), f = t.includes("number"), p = () => {
|
|
284
284
|
const h = s._state || s;
|
|
285
|
-
return
|
|
286
|
-
}, y =
|
|
287
|
-
let
|
|
288
|
-
const w =
|
|
289
|
-
if (i instanceof HTMLInputElement ?
|
|
285
|
+
return I(h, e);
|
|
286
|
+
}, y = p();
|
|
287
|
+
let l = "text";
|
|
288
|
+
const w = n?.type;
|
|
289
|
+
if (i instanceof HTMLInputElement ? l = w || i.type || "text" : i instanceof HTMLSelectElement ? l = "select" : i instanceof HTMLTextAreaElement && (l = "textarea"), l === "checkbox")
|
|
290
290
|
if (Array.isArray(y)) {
|
|
291
|
-
const h = i?.getAttribute("value") ||
|
|
291
|
+
const h = i?.getAttribute("value") || n?.value || "", u = y.includes(h);
|
|
292
292
|
i && i.checked !== u && (r.checked = u);
|
|
293
293
|
} else {
|
|
294
294
|
const h = i?.getAttribute("true-value") || !0, u = y === h;
|
|
295
295
|
i && i.checked !== u && (r.checked = u);
|
|
296
296
|
}
|
|
297
|
-
else if (
|
|
298
|
-
const h =
|
|
297
|
+
else if (l === "radio") {
|
|
298
|
+
const h = n?.value || "", u = y === h;
|
|
299
299
|
i && i.checked !== u && (r.checked = u);
|
|
300
|
-
} else if (
|
|
300
|
+
} else if (l === "select")
|
|
301
301
|
if (i && i.hasAttribute("multiple")) {
|
|
302
302
|
const h = i, u = Array.isArray(y) ? y : [];
|
|
303
303
|
setTimeout(() => {
|
|
@@ -314,124 +314,127 @@ function De(e, t, r, o, n, s, i) {
|
|
|
314
314
|
const h = String(y ?? "");
|
|
315
315
|
(!i || i.value !== h) && (r.value = y);
|
|
316
316
|
}
|
|
317
|
-
const x = a ||
|
|
318
|
-
if (h.isComposing ||
|
|
317
|
+
const x = a || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input", k = (h) => {
|
|
318
|
+
if (h.isComposing || o._isComposing || h.isTrusted === !1) return;
|
|
319
319
|
const u = h.target;
|
|
320
320
|
if (u._modelUpdating) return;
|
|
321
|
-
const g =
|
|
321
|
+
const g = p();
|
|
322
322
|
let b = u.value;
|
|
323
|
-
if (
|
|
323
|
+
if (l === "checkbox")
|
|
324
324
|
if (Array.isArray(g)) {
|
|
325
|
-
const
|
|
325
|
+
const $ = u.getAttribute("value") || "", _ = [...g];
|
|
326
326
|
if (u.checked)
|
|
327
|
-
_.includes(
|
|
327
|
+
_.includes($) || _.push($);
|
|
328
328
|
else {
|
|
329
|
-
const C = _.indexOf(
|
|
329
|
+
const C = _.indexOf($);
|
|
330
330
|
C > -1 && _.splice(C, 1);
|
|
331
331
|
}
|
|
332
332
|
b = _;
|
|
333
333
|
} else {
|
|
334
|
-
const
|
|
335
|
-
b = u.checked ?
|
|
334
|
+
const $ = u.getAttribute("true-value") || !0, _ = u.getAttribute("false-value") || !1;
|
|
335
|
+
b = u.checked ? $ : _;
|
|
336
336
|
}
|
|
337
|
-
else if (
|
|
337
|
+
else if (l === "radio")
|
|
338
338
|
b = u.getAttribute("value") || u.value;
|
|
339
|
-
else if (
|
|
340
|
-
const
|
|
341
|
-
b = Array.from(
|
|
339
|
+
else if (l === "select" && u.multiple) {
|
|
340
|
+
const $ = u;
|
|
341
|
+
b = Array.from($.selectedOptions).map(
|
|
342
342
|
(_) => _.value
|
|
343
343
|
);
|
|
344
|
-
} else if (
|
|
345
|
-
const
|
|
346
|
-
isNaN(
|
|
344
|
+
} else if (c && (b = b.trim()), f) {
|
|
345
|
+
const $ = Number(b);
|
|
346
|
+
isNaN($) || (b = $);
|
|
347
347
|
}
|
|
348
|
-
const
|
|
348
|
+
const d = s._state || s, v = I(d, e);
|
|
349
349
|
if (Array.isArray(b) && Array.isArray(v) ? JSON.stringify([...b].sort()) !== JSON.stringify([...v].sort()) : b !== v) {
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
350
|
+
const $ = h.target;
|
|
351
|
+
$._modelUpdating = !0, we(d, e, b), setTimeout(() => {
|
|
352
|
+
$._modelUpdating = !1;
|
|
353
353
|
}, 0), s._requestRender && s._requestRender();
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
|
-
if (
|
|
356
|
+
if (o[x] = k, l === "text" || l === "textarea") {
|
|
357
357
|
const h = () => {
|
|
358
|
-
|
|
358
|
+
o._isComposing = !0;
|
|
359
359
|
}, u = (g) => {
|
|
360
|
-
|
|
360
|
+
o._isComposing = !1;
|
|
361
361
|
const b = g.target;
|
|
362
362
|
setTimeout(() => {
|
|
363
363
|
if (b) {
|
|
364
|
-
let
|
|
365
|
-
if (
|
|
366
|
-
const _ = Number(
|
|
367
|
-
isNaN(_) || (
|
|
364
|
+
let d = b.value;
|
|
365
|
+
if (c && (d = d.trim()), f) {
|
|
366
|
+
const _ = Number(d);
|
|
367
|
+
isNaN(_) || (d = _);
|
|
368
368
|
}
|
|
369
|
-
const v = s._state || s, m =
|
|
370
|
-
(Array.isArray(
|
|
369
|
+
const v = s._state || s, m = I(v, e);
|
|
370
|
+
(Array.isArray(d) && Array.isArray(m) ? JSON.stringify([...d].sort()) !== JSON.stringify([...m].sort()) : d !== m) && (b && (b._modelUpdating = !0, setTimeout(() => {
|
|
371
371
|
b._modelUpdating = !1;
|
|
372
|
-
}, 0)), we(v, e,
|
|
372
|
+
}, 0)), we(v, e, d), s._requestRender && s._requestRender());
|
|
373
373
|
}
|
|
374
374
|
}, 0);
|
|
375
375
|
};
|
|
376
|
-
|
|
376
|
+
o.compositionstart = h, o.compositionend = u;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
379
|
+
function Ae(e) {
|
|
380
|
+
return e.slice(2).charAt(0).toLowerCase() + e.slice(3);
|
|
381
|
+
}
|
|
382
|
+
function Ie(e, t, r, n) {
|
|
383
|
+
if (n) {
|
|
381
384
|
if (typeof e == "object" && e !== null)
|
|
382
|
-
for (const [
|
|
383
|
-
t[
|
|
385
|
+
for (const [o, s] of Object.entries(e))
|
|
386
|
+
t[o] = s;
|
|
384
387
|
else if (typeof e == "string")
|
|
385
388
|
try {
|
|
386
|
-
const
|
|
387
|
-
if (typeof
|
|
388
|
-
for (const [s, i] of Object.entries(
|
|
389
|
+
const o = JSON.parse(e);
|
|
390
|
+
if (typeof o == "object" && o !== null) {
|
|
391
|
+
for (const [s, i] of Object.entries(o))
|
|
389
392
|
t[s] = i;
|
|
390
393
|
return;
|
|
391
394
|
}
|
|
392
395
|
} catch {
|
|
393
|
-
const
|
|
394
|
-
r[e] =
|
|
396
|
+
const o = I(n, e);
|
|
397
|
+
r[e] = o;
|
|
395
398
|
}
|
|
396
399
|
}
|
|
397
400
|
}
|
|
398
401
|
function He(e, t, r) {
|
|
399
402
|
if (!r) return;
|
|
400
|
-
const
|
|
401
|
-
if (
|
|
402
|
-
const i =
|
|
403
|
-
(
|
|
403
|
+
const n = I(r, e), o = t.style || "", s = n ? "" : "none";
|
|
404
|
+
if (o) {
|
|
405
|
+
const i = o.split(";").filter(Boolean), a = i.findIndex(
|
|
406
|
+
(c) => c.trim().startsWith("display:")
|
|
404
407
|
);
|
|
405
408
|
a >= 0 ? i[a] = `display: ${s}` : i.push(`display: ${s}`), t.style = i.join("; ");
|
|
406
409
|
} else
|
|
407
410
|
t.style = `display: ${s}`;
|
|
408
411
|
}
|
|
409
|
-
function
|
|
412
|
+
function Fe(e, t, r) {
|
|
410
413
|
if (!r) return;
|
|
411
|
-
const
|
|
412
|
-
let
|
|
413
|
-
typeof
|
|
414
|
-
const s = t.class || "", i = s ? `${s} ${
|
|
414
|
+
const n = I(r, e);
|
|
415
|
+
let o = [];
|
|
416
|
+
typeof n == "string" ? o = [n] : Array.isArray(n) ? o = n.filter(Boolean) : typeof n == "object" && (o = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
417
|
+
const s = t.class || "", i = s ? `${s} ${o.join(" ")}`.trim() : o.join(" ");
|
|
415
418
|
i && (t.class = i);
|
|
416
419
|
}
|
|
417
|
-
function
|
|
418
|
-
let
|
|
420
|
+
function Ke(e, t, r) {
|
|
421
|
+
let n;
|
|
419
422
|
if (typeof e == "string") {
|
|
420
423
|
if (!r) return;
|
|
421
|
-
|
|
424
|
+
n = I(r, e);
|
|
422
425
|
} else
|
|
423
|
-
|
|
424
|
-
let
|
|
425
|
-
if (typeof
|
|
426
|
-
|
|
427
|
-
else if (
|
|
426
|
+
n = e;
|
|
427
|
+
let o = "";
|
|
428
|
+
if (typeof n == "string")
|
|
429
|
+
o = n;
|
|
430
|
+
else if (n && typeof n == "object") {
|
|
428
431
|
const i = [];
|
|
429
|
-
for (const [a,
|
|
430
|
-
if (
|
|
432
|
+
for (const [a, c] of Object.entries(n))
|
|
433
|
+
if (c != null && c !== "") {
|
|
431
434
|
const f = a.replace(
|
|
432
435
|
/[A-Z]/g,
|
|
433
|
-
(
|
|
434
|
-
),
|
|
436
|
+
(l) => `-${l.toLowerCase()}`
|
|
437
|
+
), p = [
|
|
435
438
|
"width",
|
|
436
439
|
"height",
|
|
437
440
|
"top",
|
|
@@ -457,24 +460,24 @@ function Ue(e, t, r) {
|
|
|
457
460
|
"min-height",
|
|
458
461
|
"max-height"
|
|
459
462
|
];
|
|
460
|
-
let y = String(
|
|
461
|
-
typeof
|
|
463
|
+
let y = String(c);
|
|
464
|
+
typeof c == "number" && p.includes(f) && (y = `${c}px`), i.push(`${f}: ${y}`);
|
|
462
465
|
}
|
|
463
|
-
|
|
466
|
+
o = i.join("; ") + (i.length > 0 ? ";" : "");
|
|
464
467
|
}
|
|
465
468
|
const s = t.style || "";
|
|
466
|
-
t.style = s + (s && !s.endsWith(";") ? "; " : "") +
|
|
469
|
+
t.style = s + (s && !s.endsWith(";") ? "; " : "") + o;
|
|
467
470
|
}
|
|
468
|
-
function
|
|
469
|
-
const
|
|
470
|
-
for (const [a,
|
|
471
|
-
const { value: f, modifiers:
|
|
471
|
+
function Te(e, t, r, n) {
|
|
472
|
+
const o = {}, s = { ...n || {} }, i = {};
|
|
473
|
+
for (const [a, c] of Object.entries(e)) {
|
|
474
|
+
const { value: f, modifiers: p } = c;
|
|
472
475
|
switch (a) {
|
|
473
476
|
case "model":
|
|
474
|
-
|
|
477
|
+
qe(
|
|
475
478
|
typeof f == "string" ? f : String(f),
|
|
476
|
-
|
|
477
|
-
|
|
479
|
+
p,
|
|
480
|
+
o,
|
|
478
481
|
s,
|
|
479
482
|
i,
|
|
480
483
|
t,
|
|
@@ -482,20 +485,20 @@ function Ae(e, t, r, o) {
|
|
|
482
485
|
);
|
|
483
486
|
break;
|
|
484
487
|
case "bind":
|
|
485
|
-
|
|
488
|
+
Ie(f, o, s, t);
|
|
486
489
|
break;
|
|
487
490
|
case "show":
|
|
488
491
|
He(f, s, t);
|
|
489
492
|
break;
|
|
490
493
|
case "class":
|
|
491
|
-
|
|
494
|
+
Fe(f, s, t);
|
|
492
495
|
break;
|
|
493
496
|
case "style":
|
|
494
|
-
|
|
497
|
+
Ke(f, s, t);
|
|
495
498
|
break;
|
|
496
499
|
}
|
|
497
500
|
}
|
|
498
|
-
return { props:
|
|
501
|
+
return { props: o, attrs: s, listeners: i };
|
|
499
502
|
}
|
|
500
503
|
function ge(e, t) {
|
|
501
504
|
if (Array.isArray(e)) {
|
|
@@ -504,25 +507,25 @@ function ge(e, t) {
|
|
|
504
507
|
if (!i || typeof i != "object") return i;
|
|
505
508
|
let a = i.props?.key ?? i.key;
|
|
506
509
|
if (!a) {
|
|
507
|
-
const y = i.tag || "node",
|
|
508
|
-
a =
|
|
510
|
+
const y = i.tag || "node", l = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
|
|
511
|
+
a = l ? `${t}:${y}:${l}` : `${t}:${y}`;
|
|
509
512
|
}
|
|
510
|
-
let
|
|
511
|
-
for (; s.has(
|
|
512
|
-
|
|
513
|
-
s.add(
|
|
514
|
-
let
|
|
515
|
-
return Array.isArray(
|
|
513
|
+
let c = a, f = 1;
|
|
514
|
+
for (; s.has(c); )
|
|
515
|
+
c = `${a}#${f++}`;
|
|
516
|
+
s.add(c);
|
|
517
|
+
let p = i.children;
|
|
518
|
+
return Array.isArray(p) && (p = ge(p, c)), { ...i, key: c, children: p };
|
|
516
519
|
});
|
|
517
520
|
}
|
|
518
521
|
const r = e;
|
|
519
|
-
let
|
|
520
|
-
return Array.isArray(
|
|
522
|
+
let n = r.props?.key ?? r.key ?? t, o = r.children;
|
|
523
|
+
return Array.isArray(o) && (o = ge(o, n)), { ...r, key: n, children: o };
|
|
521
524
|
}
|
|
522
|
-
function
|
|
523
|
-
const
|
|
524
|
-
n,
|
|
525
|
+
function Ue(e, t, r, n) {
|
|
526
|
+
const o = r.directives ?? {}, s = Te(
|
|
525
527
|
o,
|
|
528
|
+
n,
|
|
526
529
|
e,
|
|
527
530
|
r.attrs
|
|
528
531
|
), i = {
|
|
@@ -533,19 +536,27 @@ function Fe(e, t, r, o) {
|
|
|
533
536
|
...t.attrs,
|
|
534
537
|
...r.attrs,
|
|
535
538
|
...s.attrs
|
|
536
|
-
},
|
|
537
|
-
for (const
|
|
538
|
-
const w = l
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
539
|
+
}, c = t.props ?? {}, f = i;
|
|
540
|
+
for (const l in { ...c, ...f }) {
|
|
541
|
+
const w = c[l], x = f[l];
|
|
542
|
+
if (w !== x)
|
|
543
|
+
if (l === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
544
|
+
e.value !== x && (e.value = x ?? "");
|
|
545
|
+
else if (l === "checked" && e instanceof HTMLInputElement)
|
|
546
|
+
e.checked = !!x;
|
|
547
|
+
else if (l.startsWith("on") && typeof x == "function") {
|
|
548
|
+
const k = Ae(l);
|
|
549
|
+
typeof w == "function" && e.removeEventListener(k, w), e.addEventListener(k, x);
|
|
550
|
+
} else x == null || x === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(x));
|
|
551
|
+
}
|
|
552
|
+
for (const [l, w] of Object.entries(
|
|
542
553
|
s.listeners || {}
|
|
543
554
|
))
|
|
544
|
-
e.addEventListener(
|
|
545
|
-
const
|
|
546
|
-
for (const
|
|
547
|
-
const w =
|
|
548
|
-
w !== x && (x == null || x === !1 ? e.removeAttribute(
|
|
555
|
+
e.addEventListener(l, w);
|
|
556
|
+
const p = t.attrs ?? {}, y = a;
|
|
557
|
+
for (const l in { ...p, ...y }) {
|
|
558
|
+
const w = p[l], x = y[l];
|
|
559
|
+
w !== x && (x == null || x === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(x)));
|
|
549
560
|
}
|
|
550
561
|
}
|
|
551
562
|
function P(e, t, r) {
|
|
@@ -558,63 +569,63 @@ function P(e, t, r) {
|
|
|
558
569
|
return e.key != null && (y.key = e.key), y;
|
|
559
570
|
}
|
|
560
571
|
if (e.tag === "#anchor") {
|
|
561
|
-
const y = e,
|
|
572
|
+
const y = e, l = Array.isArray(y.children) ? y.children : [], w = document.createTextNode(""), x = document.createTextNode("");
|
|
562
573
|
y.key != null && (w.key = `${y.key}:start`, x.key = `${y.key}:end`), y._startNode = w, y._endNode = x;
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
for (const h of
|
|
574
|
+
const k = document.createDocumentFragment();
|
|
575
|
+
k.appendChild(w);
|
|
576
|
+
for (const h of l) {
|
|
566
577
|
const u = P(h, t);
|
|
567
|
-
|
|
578
|
+
k.appendChild(u);
|
|
568
579
|
}
|
|
569
|
-
return
|
|
580
|
+
return k.appendChild(x), k;
|
|
570
581
|
}
|
|
571
|
-
const
|
|
572
|
-
e.key != null && (
|
|
573
|
-
const { props:
|
|
574
|
-
...
|
|
582
|
+
const n = document.createElement(e.tag);
|
|
583
|
+
e.key != null && (n.key = e.key);
|
|
584
|
+
const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a = Te(i, t, n, s), c = {
|
|
585
|
+
...o,
|
|
575
586
|
...a.props
|
|
576
587
|
}, f = {
|
|
577
588
|
...s,
|
|
578
589
|
...a.attrs
|
|
579
590
|
};
|
|
580
591
|
for (const y in f) {
|
|
581
|
-
const
|
|
592
|
+
const l = f[y];
|
|
582
593
|
if (typeof y != "string" || /\[object Object\]/.test(y)) {
|
|
583
|
-
typeof window < "u" && window.console && console.warn("Skipping invalid attribute key:", y,
|
|
594
|
+
typeof window < "u" && window.console && console.warn("Skipping invalid attribute key:", y, l);
|
|
584
595
|
continue;
|
|
585
596
|
}
|
|
586
|
-
typeof
|
|
597
|
+
typeof l == "boolean" ? l && n.setAttribute(y, "") : l != null && n.setAttribute(y, l);
|
|
587
598
|
}
|
|
588
|
-
for (const y in
|
|
589
|
-
const
|
|
599
|
+
for (const y in c) {
|
|
600
|
+
const l = c[y];
|
|
590
601
|
if (typeof y != "string" || /\[object Object\]/.test(y)) {
|
|
591
|
-
typeof window < "u" && window.console && console.warn("Skipping invalid prop key:", y,
|
|
602
|
+
typeof window < "u" && window.console && console.warn("Skipping invalid prop key:", y, l);
|
|
592
603
|
continue;
|
|
593
604
|
}
|
|
594
|
-
if (y === "value" && (
|
|
595
|
-
|
|
596
|
-
else if (y === "checked" &&
|
|
597
|
-
|
|
598
|
-
else if (y.startsWith("on") && typeof
|
|
599
|
-
|
|
605
|
+
if (y === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement))
|
|
606
|
+
n.value = l ?? "";
|
|
607
|
+
else if (y === "checked" && n instanceof HTMLInputElement)
|
|
608
|
+
n.checked = !!l;
|
|
609
|
+
else if (y.startsWith("on") && typeof l == "function")
|
|
610
|
+
n.addEventListener(Ae(y), l);
|
|
600
611
|
else {
|
|
601
|
-
if (y.startsWith("on") &&
|
|
612
|
+
if (y.startsWith("on") && l === void 0)
|
|
602
613
|
continue;
|
|
603
|
-
|
|
614
|
+
l == null || l === !1 ? n.removeAttribute(y) : n.setAttribute(y, String(l));
|
|
604
615
|
}
|
|
605
616
|
}
|
|
606
|
-
for (const [y,
|
|
617
|
+
for (const [y, l] of Object.entries(
|
|
607
618
|
a.listeners || {}
|
|
608
619
|
))
|
|
609
|
-
|
|
610
|
-
const
|
|
611
|
-
if (typeof e != "string" &&
|
|
620
|
+
n.addEventListener(y, l);
|
|
621
|
+
const p = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
622
|
+
if (typeof e != "string" && p && r && (r[p] = n), Array.isArray(e.children))
|
|
612
623
|
for (const y of e.children)
|
|
613
|
-
|
|
614
|
-
else typeof e.children == "string" && (
|
|
615
|
-
return
|
|
624
|
+
n.appendChild(P(y, t, r));
|
|
625
|
+
else typeof e.children == "string" && (n.textContent = e.children);
|
|
626
|
+
return n;
|
|
616
627
|
}
|
|
617
|
-
function
|
|
628
|
+
function Ve(e, t, r, n, o) {
|
|
618
629
|
if (typeof r == "string") {
|
|
619
630
|
e.textContent !== r && (e.textContent = r);
|
|
620
631
|
return;
|
|
@@ -623,24 +634,24 @@ function Ke(e, t, r, o, n) {
|
|
|
623
634
|
const s = Array.from(e.childNodes), i = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
624
635
|
for (const w of i)
|
|
625
636
|
w && w.key != null && a.set(w.key, w);
|
|
626
|
-
const
|
|
637
|
+
const c = /* @__PURE__ */ new Map();
|
|
627
638
|
for (const w of s) {
|
|
628
639
|
const x = w.key;
|
|
629
|
-
x != null &&
|
|
640
|
+
x != null && c.set(x, w);
|
|
630
641
|
}
|
|
631
642
|
const f = /* @__PURE__ */ new Set();
|
|
632
|
-
let
|
|
643
|
+
let p = e.firstChild;
|
|
633
644
|
function y(w, x) {
|
|
634
|
-
let
|
|
635
|
-
for (;
|
|
636
|
-
|
|
645
|
+
let k = w;
|
|
646
|
+
for (; k && (f.add(k), k !== x); )
|
|
647
|
+
k = k.nextSibling;
|
|
637
648
|
}
|
|
638
|
-
function
|
|
649
|
+
function l(w, x, k, h) {
|
|
639
650
|
const u = [];
|
|
640
651
|
let g = w.nextSibling;
|
|
641
652
|
for (; g && g !== x; )
|
|
642
653
|
u.push(g), g = g.nextSibling;
|
|
643
|
-
const b = Array.isArray(
|
|
654
|
+
const b = Array.isArray(k) ? k : [];
|
|
644
655
|
if (h.some((v) => v && v.key != null) || b.some((v) => v && v.key != null)) {
|
|
645
656
|
const v = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
646
657
|
for (const C of b)
|
|
@@ -649,7 +660,7 @@ function Ke(e, t, r, o, n) {
|
|
|
649
660
|
const E = C.key;
|
|
650
661
|
E != null && m.set(E, C);
|
|
651
662
|
}
|
|
652
|
-
const
|
|
663
|
+
const $ = /* @__PURE__ */ new Set();
|
|
653
664
|
let _ = w.nextSibling;
|
|
654
665
|
for (const C of h) {
|
|
655
666
|
let E;
|
|
@@ -659,25 +670,25 @@ function Ke(e, t, r, o, n) {
|
|
|
659
670
|
m.get(C.key),
|
|
660
671
|
j,
|
|
661
672
|
C,
|
|
662
|
-
|
|
663
|
-
),
|
|
673
|
+
n
|
|
674
|
+
), $.add(E), E !== _ && e.contains(E) && e.insertBefore(E, _);
|
|
664
675
|
} else
|
|
665
|
-
E = P(C,
|
|
676
|
+
E = P(C, n), e.insertBefore(E, _), $.add(E);
|
|
666
677
|
_ = E.nextSibling;
|
|
667
678
|
}
|
|
668
679
|
for (const C of u)
|
|
669
|
-
|
|
680
|
+
!$.has(C) && e.contains(C) && e.removeChild(C);
|
|
670
681
|
} else {
|
|
671
682
|
const v = Math.min(
|
|
672
683
|
b.length,
|
|
673
684
|
h.length
|
|
674
685
|
);
|
|
675
686
|
for (let m = 0; m < v; m++) {
|
|
676
|
-
const
|
|
687
|
+
const $ = b[m], _ = h[m], C = Y(u[m], $, _, n);
|
|
677
688
|
C !== u[m] && (e.insertBefore(C, u[m]), e.removeChild(u[m]));
|
|
678
689
|
}
|
|
679
690
|
for (let m = v; m < h.length; m++)
|
|
680
|
-
e.insertBefore(P(h[m],
|
|
691
|
+
e.insertBefore(P(h[m], n), x);
|
|
681
692
|
for (let m = v; m < u.length; m++)
|
|
682
693
|
e.removeChild(u[m]);
|
|
683
694
|
}
|
|
@@ -685,42 +696,42 @@ function Ke(e, t, r, o, n) {
|
|
|
685
696
|
for (const w of r) {
|
|
686
697
|
let x;
|
|
687
698
|
if (w.tag === "#anchor") {
|
|
688
|
-
const
|
|
689
|
-
let g =
|
|
690
|
-
const
|
|
699
|
+
const k = w.key, h = `${k}:start`, u = `${k}:end`;
|
|
700
|
+
let g = c.get(h), b = c.get(u);
|
|
701
|
+
const d = Array.isArray(w.children) ? w.children : [];
|
|
691
702
|
if (g || (g = document.createTextNode(""), g.key = h), b || (b = document.createTextNode(""), b.key = u), w._startNode = g, w._endNode = b, !e.contains(g) || !e.contains(b)) {
|
|
692
|
-
e.insertBefore(g,
|
|
693
|
-
for (const v of
|
|
694
|
-
e.insertBefore(P(v,
|
|
695
|
-
e.insertBefore(b,
|
|
703
|
+
e.insertBefore(g, p);
|
|
704
|
+
for (const v of d)
|
|
705
|
+
e.insertBefore(P(v, n), p);
|
|
706
|
+
e.insertBefore(b, p);
|
|
696
707
|
} else
|
|
697
|
-
|
|
708
|
+
l(
|
|
698
709
|
g,
|
|
699
710
|
b,
|
|
700
|
-
a.get(
|
|
701
|
-
|
|
711
|
+
a.get(k)?.children,
|
|
712
|
+
d
|
|
702
713
|
);
|
|
703
|
-
y(g, b),
|
|
714
|
+
y(g, b), p = b.nextSibling;
|
|
704
715
|
continue;
|
|
705
716
|
}
|
|
706
|
-
if (w.key != null &&
|
|
707
|
-
const
|
|
717
|
+
if (w.key != null && c.has(w.key)) {
|
|
718
|
+
const k = a.get(w.key);
|
|
708
719
|
x = Y(
|
|
709
|
-
|
|
710
|
-
|
|
720
|
+
c.get(w.key),
|
|
721
|
+
k,
|
|
711
722
|
w,
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
), f.add(x), x !==
|
|
723
|
+
n,
|
|
724
|
+
o
|
|
725
|
+
), f.add(x), x !== p && e.contains(x) && (p && !e.contains(p) && (p = null), e.insertBefore(x, p));
|
|
715
726
|
} else
|
|
716
|
-
x = P(w,
|
|
717
|
-
|
|
727
|
+
x = P(w, n, o), p && !e.contains(p) && (p = null), e.insertBefore(x, p), f.add(x);
|
|
728
|
+
p = x.nextSibling;
|
|
718
729
|
}
|
|
719
730
|
for (const w of s)
|
|
720
|
-
!f.has(w) && e.contains(w) && (q(w,
|
|
731
|
+
!f.has(w) && e.contains(w) && (q(w, o), e.removeChild(w));
|
|
721
732
|
}
|
|
722
|
-
function Y(e, t, r,
|
|
723
|
-
if (t && typeof t != "string" && t.props?.ref &&
|
|
733
|
+
function Y(e, t, r, n, o) {
|
|
734
|
+
if (t && typeof t != "string" && t.props?.ref && o && q(e, o), t === r) return e;
|
|
724
735
|
if (typeof r == "string") {
|
|
725
736
|
if (e.nodeType === Node.TEXT_NODE)
|
|
726
737
|
return e.textContent !== r && (e.textContent = r), e;
|
|
@@ -730,78 +741,78 @@ function Y(e, t, r, o, n) {
|
|
|
730
741
|
}
|
|
731
742
|
}
|
|
732
743
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
733
|
-
const i = r, a = Array.isArray(i.children) ? i.children : [],
|
|
734
|
-
i.key != null && (
|
|
735
|
-
const
|
|
736
|
-
|
|
744
|
+
const i = r, a = Array.isArray(i.children) ? i.children : [], c = i._startNode ?? document.createTextNode(""), f = i._endNode ?? document.createTextNode("");
|
|
745
|
+
i.key != null && (c.key = `${i.key}:start`, f.key = `${i.key}:end`), i._startNode = c, i._endNode = f;
|
|
746
|
+
const p = document.createDocumentFragment();
|
|
747
|
+
p.appendChild(c);
|
|
737
748
|
for (const y of a) {
|
|
738
|
-
const
|
|
739
|
-
|
|
749
|
+
const l = P(y, n);
|
|
750
|
+
p.appendChild(l);
|
|
740
751
|
}
|
|
741
|
-
return
|
|
752
|
+
return p.appendChild(f), e.parentNode?.replaceChild(p, e), c;
|
|
742
753
|
}
|
|
743
754
|
if (!r) {
|
|
744
|
-
q(e,
|
|
755
|
+
q(e, o);
|
|
745
756
|
const i = document.createComment("removed");
|
|
746
757
|
return e.parentNode?.replaceChild(i, e), i;
|
|
747
758
|
}
|
|
748
759
|
if (!t || typeof t == "string") {
|
|
749
|
-
q(e,
|
|
750
|
-
const i = P(r,
|
|
751
|
-
return typeof r != "string" && r.props?.ref &&
|
|
760
|
+
q(e, o);
|
|
761
|
+
const i = P(r, n, o);
|
|
762
|
+
return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), e.parentNode?.replaceChild(i, e), i;
|
|
752
763
|
}
|
|
753
764
|
if (r.tag === "#anchor") {
|
|
754
|
-
const i = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""),
|
|
755
|
-
r.key != null && (a.key = `${r.key}:start`,
|
|
765
|
+
const i = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), c = r._endNode ?? document.createTextNode("");
|
|
766
|
+
r.key != null && (a.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = a, r._endNode = c;
|
|
756
767
|
const f = document.createDocumentFragment();
|
|
757
768
|
f.appendChild(a);
|
|
758
|
-
for (const
|
|
759
|
-
f.appendChild(P(
|
|
760
|
-
return f.appendChild(
|
|
769
|
+
for (const p of i)
|
|
770
|
+
f.appendChild(P(p, n));
|
|
771
|
+
return f.appendChild(c), e.parentNode?.replaceChild(f, e), a;
|
|
761
772
|
}
|
|
762
773
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
763
774
|
const i = e;
|
|
764
|
-
return
|
|
775
|
+
return Ue(i, t.props || {}, r.props || {}, n), Ve(i, t.children, r.children, n, o), typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), i;
|
|
765
776
|
}
|
|
766
|
-
q(e,
|
|
767
|
-
const s = P(r,
|
|
768
|
-
return typeof r != "string" && r.props?.ref &&
|
|
777
|
+
q(e, o);
|
|
778
|
+
const s = P(r, n, o);
|
|
779
|
+
return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
769
780
|
}
|
|
770
|
-
function
|
|
771
|
-
let
|
|
772
|
-
Array.isArray(t) ? t.length === 1 ? (
|
|
781
|
+
function Je(e, t, r, n) {
|
|
782
|
+
let o;
|
|
783
|
+
Array.isArray(t) ? t.length === 1 ? (o = t[0], o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })) : o = { tag: "div", key: "__root__", children: t } : (o = t, o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })), o && typeof o == "object" && o.tag === "#anchor" && (o = {
|
|
773
784
|
tag: "div",
|
|
774
785
|
key: "__anchor_root__",
|
|
775
786
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
776
|
-
children: [
|
|
777
|
-
}),
|
|
787
|
+
children: [o]
|
|
788
|
+
}), o = ge(o, String(o.key ?? "root"));
|
|
778
789
|
const s = e._prevVNode ?? null, i = e._prevDom ?? e.firstChild ?? null;
|
|
779
790
|
let a;
|
|
780
|
-
s && i ? typeof s != "string" && typeof
|
|
781
|
-
const
|
|
791
|
+
s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a = Y(i, s, o, r, n) : (a = P(o, r, n), e.replaceChild(a, i)) : (a = P(o, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
792
|
+
const c = [];
|
|
782
793
|
for (let f = 0; f < e.childNodes.length; f++) {
|
|
783
|
-
const
|
|
784
|
-
|
|
794
|
+
const p = e.childNodes[f];
|
|
795
|
+
p !== a && p.nodeName !== "STYLE" && (q(p, n), c.push(p));
|
|
785
796
|
}
|
|
786
|
-
|
|
797
|
+
c.forEach((f) => e.removeChild(f)), e._prevVNode = o, e._prevDom = a;
|
|
787
798
|
}
|
|
788
|
-
function
|
|
799
|
+
function je(e, ...t) {
|
|
789
800
|
let r = "";
|
|
790
|
-
for (let
|
|
791
|
-
r += e[
|
|
801
|
+
for (let n = 0; n < e.length; n++)
|
|
802
|
+
r += e[n], n < t.length && (r += t[n]);
|
|
792
803
|
return r;
|
|
793
804
|
}
|
|
794
|
-
function
|
|
805
|
+
function Le(e) {
|
|
795
806
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
796
807
|
}
|
|
797
808
|
let Q = null;
|
|
798
809
|
function ke() {
|
|
799
|
-
return Q || (Q = new CSSStyleSheet(), Q.replaceSync(
|
|
810
|
+
return Q || (Q = new CSSStyleSheet(), Q.replaceSync(Le(Qe))), Q;
|
|
800
811
|
}
|
|
801
|
-
function
|
|
812
|
+
function Ze(e) {
|
|
802
813
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
803
814
|
}
|
|
804
|
-
const
|
|
815
|
+
const Qe = je`
|
|
805
816
|
:host, *, ::before, ::after {
|
|
806
817
|
all: isolate;
|
|
807
818
|
box-sizing: border-box;
|
|
@@ -859,7 +870,7 @@ const Ze = Te`
|
|
|
859
870
|
sup { top: -.5em }
|
|
860
871
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
861
872
|
[hidden] { display: none }
|
|
862
|
-
`,
|
|
873
|
+
`, Xe = {
|
|
863
874
|
gray: {
|
|
864
875
|
50: "var(--color-gray-50, #f9fafb)",
|
|
865
876
|
100: "var(--color-gray-100, #f3f4f6)",
|
|
@@ -1175,7 +1186,7 @@ const Ze = Te`
|
|
|
1175
1186
|
"z-30": "z-index:30;",
|
|
1176
1187
|
"z-40": "z-index:40;",
|
|
1177
1188
|
"z-50": "z-index:50;"
|
|
1178
|
-
},
|
|
1189
|
+
}, Ye = "0.25rem", $e = {
|
|
1179
1190
|
m: ["margin"],
|
|
1180
1191
|
mx: ["margin-inline"],
|
|
1181
1192
|
my: ["margin-block"],
|
|
@@ -1208,19 +1219,19 @@ const Ze = Te`
|
|
|
1208
1219
|
"gap-y": ["row-gap"]
|
|
1209
1220
|
};
|
|
1210
1221
|
function R(e, t) {
|
|
1211
|
-
let r = 0,
|
|
1212
|
-
for (let
|
|
1213
|
-
const s = e[
|
|
1222
|
+
let r = 0, n = 0;
|
|
1223
|
+
for (let o = 0; o < e.length; o++) {
|
|
1224
|
+
const s = e[o];
|
|
1214
1225
|
if (s === "[") r++;
|
|
1215
1226
|
else if (s === "]" && r > 0) r--;
|
|
1216
|
-
else if (s === "(")
|
|
1217
|
-
else if (s === ")" &&
|
|
1218
|
-
else if (r === 0 &&
|
|
1219
|
-
return e.slice(0,
|
|
1227
|
+
else if (s === "(") n++;
|
|
1228
|
+
else if (s === ")" && n > 0) n--;
|
|
1229
|
+
else if (r === 0 && n === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
1230
|
+
return e.slice(0, o) + t + e.slice(o);
|
|
1220
1231
|
}
|
|
1221
1232
|
return e + t;
|
|
1222
1233
|
}
|
|
1223
|
-
const
|
|
1234
|
+
const Ge = {
|
|
1224
1235
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1225
1236
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1226
1237
|
hover: (e, t) => `${R(e, ":hover")}{${t}}`,
|
|
@@ -1254,21 +1265,21 @@ const Ye = {
|
|
|
1254
1265
|
dark: "(prefers-color-scheme: dark)"
|
|
1255
1266
|
}, le = ["sm", "md", "lg", "xl", "2xl"];
|
|
1256
1267
|
function ce(e) {
|
|
1257
|
-
const t = e.startsWith("-"),
|
|
1258
|
-
if (
|
|
1259
|
-
const
|
|
1260
|
-
if (Number.isNaN(i) || !$e[
|
|
1268
|
+
const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
|
|
1269
|
+
if (n.length < 2) return null;
|
|
1270
|
+
const o = n.slice(0, -1).join("-"), s = n[n.length - 1], i = parseFloat(s);
|
|
1271
|
+
if (Number.isNaN(i) || !$e[o]) return null;
|
|
1261
1272
|
const a = t ? "-" : "";
|
|
1262
|
-
return $e[
|
|
1273
|
+
return $e[o].map((c) => `${c}:calc(${a}${Ye} * ${i});`).join("");
|
|
1263
1274
|
}
|
|
1264
1275
|
function Se(e) {
|
|
1265
|
-
const t = e.replace("#", ""), r = parseInt(t, 16),
|
|
1266
|
-
return `${
|
|
1276
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, o = r >> 8 & 255, s = r & 255;
|
|
1277
|
+
return `${n} ${o} ${s}`;
|
|
1267
1278
|
}
|
|
1268
|
-
function
|
|
1279
|
+
function et(e) {
|
|
1269
1280
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1270
1281
|
if (!t) return null;
|
|
1271
|
-
const [, r,
|
|
1282
|
+
const [, r, n, o = "DEFAULT"] = t, s = Xe[n]?.[o];
|
|
1272
1283
|
return s ? `${{
|
|
1273
1284
|
bg: "background-color",
|
|
1274
1285
|
decoration: "text-decoration-color",
|
|
@@ -1283,33 +1294,33 @@ function Ge(e) {
|
|
|
1283
1294
|
stroke: "stroke-color"
|
|
1284
1295
|
}[r]}:${s};` : null;
|
|
1285
1296
|
}
|
|
1286
|
-
function
|
|
1297
|
+
function tt(e) {
|
|
1287
1298
|
const [t, r] = e.split("/");
|
|
1288
1299
|
if (!r) return { base: t };
|
|
1289
|
-
const
|
|
1290
|
-
return isNaN(
|
|
1300
|
+
const n = parseInt(r, 10);
|
|
1301
|
+
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
1291
1302
|
}
|
|
1292
1303
|
function fe(e) {
|
|
1293
|
-
const { base: t, opacity: r } =
|
|
1294
|
-
if (
|
|
1304
|
+
const { base: t, opacity: r } = tt(e), n = et(t);
|
|
1305
|
+
if (n) {
|
|
1295
1306
|
if (r !== void 0) {
|
|
1296
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
1307
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1297
1308
|
if (s) {
|
|
1298
1309
|
const i = Se(s[0]);
|
|
1299
|
-
return
|
|
1310
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
|
|
1300
1311
|
}
|
|
1301
1312
|
}
|
|
1302
|
-
return
|
|
1313
|
+
return n;
|
|
1303
1314
|
}
|
|
1304
|
-
const
|
|
1305
|
-
if (
|
|
1306
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
1315
|
+
const o = G(t);
|
|
1316
|
+
if (o && r !== void 0) {
|
|
1317
|
+
const s = /#([0-9a-f]{6})/i.exec(o);
|
|
1307
1318
|
if (s) {
|
|
1308
1319
|
const i = Se(s[0]);
|
|
1309
|
-
return
|
|
1320
|
+
return o.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
|
|
1310
1321
|
}
|
|
1311
1322
|
}
|
|
1312
|
-
return
|
|
1323
|
+
return o;
|
|
1313
1324
|
}
|
|
1314
1325
|
function ue(e) {
|
|
1315
1326
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
@@ -1319,19 +1330,19 @@ function ue(e) {
|
|
|
1319
1330
|
}
|
|
1320
1331
|
function G(e) {
|
|
1321
1332
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1322
|
-
const
|
|
1323
|
-
if (
|
|
1324
|
-
const s =
|
|
1325
|
-
let i =
|
|
1333
|
+
const o = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1334
|
+
if (o) {
|
|
1335
|
+
const s = o[1].trim();
|
|
1336
|
+
let i = o[2].trim();
|
|
1326
1337
|
return i = i.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), i = i.replace(/^'([^']*)'$/g, '"$1"'), `${s}:${i};`;
|
|
1327
1338
|
}
|
|
1328
1339
|
return null;
|
|
1329
1340
|
}
|
|
1330
1341
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
1331
1342
|
if (t > 0 && r) {
|
|
1332
|
-
const
|
|
1333
|
-
let
|
|
1334
|
-
|
|
1343
|
+
const n = e.slice(0, t);
|
|
1344
|
+
let o = e.slice(t + 2, -1);
|
|
1345
|
+
o = o.replace(/_/g, " ");
|
|
1335
1346
|
const s = {
|
|
1336
1347
|
bg: "background-color",
|
|
1337
1348
|
text: "color",
|
|
@@ -1372,14 +1383,14 @@ function G(e) {
|
|
|
1372
1383
|
leading: "line-height",
|
|
1373
1384
|
z: "z-index"
|
|
1374
1385
|
};
|
|
1375
|
-
if (
|
|
1376
|
-
return `transform:rotate(${
|
|
1377
|
-
const i = s[
|
|
1378
|
-
if (i &&
|
|
1386
|
+
if (n === "rotate")
|
|
1387
|
+
return `transform:rotate(${o});`;
|
|
1388
|
+
const i = s[n] ?? n.replace(/_/g, "-");
|
|
1389
|
+
if (i && o) return `${i}:${o};`;
|
|
1379
1390
|
}
|
|
1380
1391
|
return null;
|
|
1381
1392
|
}
|
|
1382
|
-
function
|
|
1393
|
+
function rt(e) {
|
|
1383
1394
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1384
1395
|
const r = e.slice(1, -1);
|
|
1385
1396
|
return r.includes("&") ? r : e;
|
|
@@ -1391,24 +1402,24 @@ function tt(e) {
|
|
|
1391
1402
|
}
|
|
1392
1403
|
return null;
|
|
1393
1404
|
}
|
|
1394
|
-
function
|
|
1405
|
+
function nt(e) {
|
|
1395
1406
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1396
1407
|
}
|
|
1397
|
-
function
|
|
1408
|
+
function ot(e) {
|
|
1398
1409
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1399
|
-
let
|
|
1400
|
-
for (;
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1410
|
+
let n;
|
|
1411
|
+
for (; n = t.exec(e); ) {
|
|
1412
|
+
const o = n[2].split(/\s+/).filter(Boolean);
|
|
1413
|
+
o.length && r.push(...o);
|
|
1403
1414
|
}
|
|
1404
1415
|
return r.filter(Boolean);
|
|
1405
1416
|
}
|
|
1406
|
-
const _e = /* @__PURE__ */ new Map(),
|
|
1407
|
-
function
|
|
1417
|
+
const _e = /* @__PURE__ */ new Map(), it = 16;
|
|
1418
|
+
function st(e) {
|
|
1408
1419
|
const t = Date.now(), r = _e.get(e);
|
|
1409
|
-
if (r && t - r.timestamp <
|
|
1410
|
-
const
|
|
1411
|
-
function
|
|
1420
|
+
if (r && t - r.timestamp < it) return r.css;
|
|
1421
|
+
const n = ot(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
|
|
1422
|
+
function p(h, u = !1) {
|
|
1412
1423
|
const g = (u ? "dark|" : "") + h;
|
|
1413
1424
|
if (g in f) return f[g];
|
|
1414
1425
|
const b = x(h, u);
|
|
@@ -1418,12 +1429,12 @@ function it(e) {
|
|
|
1418
1429
|
const u = h.some((b) => le.includes(b)), g = h.includes("dark");
|
|
1419
1430
|
return h.length === 0 ? 1 : !u && !g ? 2 : u && !g ? 3 : 4;
|
|
1420
1431
|
}
|
|
1421
|
-
function
|
|
1432
|
+
function l(h) {
|
|
1422
1433
|
const u = [];
|
|
1423
|
-
let g = "", b = 0,
|
|
1434
|
+
let g = "", b = 0, d = 0;
|
|
1424
1435
|
for (let v = 0; v < h.length; v++) {
|
|
1425
1436
|
const m = h[v];
|
|
1426
|
-
m === "[" ? b++ : m === "]" && b > 0 ? b-- : m === "(" ?
|
|
1437
|
+
m === "[" ? b++ : m === "]" && b > 0 ? b-- : m === "(" ? d++ : m === ")" && d > 0 && d--, m === ":" && b === 0 && d === 0 ? (u.push(g), g = "") : g += m;
|
|
1427
1438
|
}
|
|
1428
1439
|
return g && u.push(g), u;
|
|
1429
1440
|
}
|
|
@@ -1458,181 +1469,181 @@ function it(e) {
|
|
|
1458
1469
|
}
|
|
1459
1470
|
}
|
|
1460
1471
|
function x(h, u = !1) {
|
|
1461
|
-
const g =
|
|
1472
|
+
const g = l(h);
|
|
1462
1473
|
(h.includes("mask-image") || h.includes("sm: hover") || h.includes("sm:hover") || h.includes("mask.svg")) && console.error("DEBUG generateRule:", h, g);
|
|
1463
|
-
let b = !1,
|
|
1464
|
-
if (!
|
|
1465
|
-
const v =
|
|
1474
|
+
let b = !1, d = g.find((S) => (S.startsWith("!") && (b = !0, S = S.slice(1)), se[S] || ce(S) || ue(S) || fe(S) || G(S)));
|
|
1475
|
+
if (!d) return null;
|
|
1476
|
+
const v = d.replace(/^!/, ""), m = se[v] ?? ce(v) ?? ue(v) ?? fe(v) ?? G(v);
|
|
1466
1477
|
if (!m) return null;
|
|
1467
|
-
const
|
|
1468
|
-
let _ =
|
|
1469
|
-
u && (_ = _.filter((
|
|
1470
|
-
const C = `.${
|
|
1478
|
+
const $ = g.indexOf(d);
|
|
1479
|
+
let _ = $ >= 0 ? g.slice(0, $) : [];
|
|
1480
|
+
u && (_ = _.filter((S) => S !== "dark"));
|
|
1481
|
+
const C = `.${nt(h)}`, E = "__SUBJECT__", j = b ? m.replace(/;$/, " !important;") : m;
|
|
1471
1482
|
let A = E;
|
|
1472
1483
|
const re = [];
|
|
1473
|
-
for (const
|
|
1474
|
-
|
|
1475
|
-
_ = _.filter((
|
|
1484
|
+
for (const S of _)
|
|
1485
|
+
S.startsWith("group-") ? (A = `.group:${S.slice(6)} ${A}`, re.push(S)) : S.startsWith("peer-") && (A = A.replace(E, `.peer:${S.slice(5)}~${E}`), re.push(S));
|
|
1486
|
+
_ = _.filter((S) => !re.includes(S));
|
|
1476
1487
|
const ne = [], be = [];
|
|
1477
|
-
let
|
|
1478
|
-
for (const
|
|
1479
|
-
if (
|
|
1480
|
-
const M =
|
|
1488
|
+
let W = null;
|
|
1489
|
+
for (const S of _) {
|
|
1490
|
+
if (S === "dark" || le.includes(S)) continue;
|
|
1491
|
+
const M = rt(S);
|
|
1481
1492
|
if (M) {
|
|
1482
|
-
|
|
1493
|
+
W = M;
|
|
1483
1494
|
continue;
|
|
1484
1495
|
}
|
|
1485
|
-
const L = w(
|
|
1496
|
+
const L = w(S);
|
|
1486
1497
|
if (L) {
|
|
1487
|
-
|
|
1498
|
+
W ? be.push(L) : ne.push(L);
|
|
1488
1499
|
continue;
|
|
1489
1500
|
}
|
|
1490
|
-
const B =
|
|
1501
|
+
const B = Ge[S];
|
|
1491
1502
|
typeof B == "function" && (A = B(A, j).split("{")[0]);
|
|
1492
1503
|
}
|
|
1493
|
-
function
|
|
1494
|
-
if (!M) return
|
|
1504
|
+
function ze(S, M) {
|
|
1505
|
+
if (!M) return S;
|
|
1495
1506
|
let L = 0, B = 0;
|
|
1496
|
-
if (
|
|
1507
|
+
if (S.length && (S[0] === ">" || S[0] === "+" || S[0] === "~" || S[0] === " ")) {
|
|
1497
1508
|
let T = 1;
|
|
1498
|
-
for (; T <
|
|
1499
|
-
for (; T <
|
|
1500
|
-
const z =
|
|
1501
|
-
if (z === "[" ? L++ : z === "]" && L > 0 ? L-- : z === "(" ? B++ : z === ")" && B > 0 && B--, L === 0 && B === 0 && (
|
|
1502
|
-
return
|
|
1509
|
+
for (; T < S.length && S[T] === " "; ) T++;
|
|
1510
|
+
for (; T < S.length; T++) {
|
|
1511
|
+
const z = S[T];
|
|
1512
|
+
if (z === "[" ? L++ : z === "]" && L > 0 ? L-- : z === "(" ? B++ : z === ")" && B > 0 && B--, L === 0 && B === 0 && (S[T] === ">" || S[T] === "+" || S[T] === "~" || S[T] === " "))
|
|
1513
|
+
return S.slice(0, T) + M + S.slice(T);
|
|
1503
1514
|
}
|
|
1504
|
-
return
|
|
1515
|
+
return S + M;
|
|
1505
1516
|
}
|
|
1506
|
-
for (let T = 0; T <
|
|
1507
|
-
const z =
|
|
1517
|
+
for (let T = 0; T < S.length; T++) {
|
|
1518
|
+
const z = S[T];
|
|
1508
1519
|
if (z === "[" ? L++ : z === "]" && L > 0 ? L-- : z === "(" ? B++ : z === ")" && B > 0 && B--, L === 0 && B === 0 && (z === ">" || z === "+" || z === "~" || z === " "))
|
|
1509
|
-
return
|
|
1520
|
+
return S.slice(0, T) + M + S.slice(T);
|
|
1510
1521
|
}
|
|
1511
|
-
return
|
|
1522
|
+
return S + M;
|
|
1512
1523
|
}
|
|
1513
|
-
const oe = ne.join(""),
|
|
1514
|
-
if (
|
|
1515
|
-
if (
|
|
1516
|
-
const
|
|
1524
|
+
const oe = ne.join(""), U = be.join("");
|
|
1525
|
+
if (W)
|
|
1526
|
+
if (W.includes("&")) {
|
|
1527
|
+
const S = W.indexOf("&"), M = W.slice(0, S), L = W.slice(S + 1), B = E + oe, T = A;
|
|
1517
1528
|
if (ne.length === 0)
|
|
1518
|
-
A = T.replace(E, M + B +
|
|
1529
|
+
A = T.replace(E, M + B + U + L);
|
|
1519
1530
|
else {
|
|
1520
|
-
const z =
|
|
1531
|
+
const z = ze(L, U);
|
|
1521
1532
|
A = T.replace(E, M + B + z);
|
|
1522
1533
|
}
|
|
1523
1534
|
} else
|
|
1524
|
-
A = A.replace(E, `${
|
|
1535
|
+
A = A.replace(E, `${W}${E + oe}`), U && (A = A.replace(E, `${E}${U}`));
|
|
1525
1536
|
else
|
|
1526
|
-
A = E + oe +
|
|
1537
|
+
A = E + oe + U;
|
|
1527
1538
|
A = A.replace(new RegExp(E, "g"), C);
|
|
1528
1539
|
let O = `${A}{${j}}`;
|
|
1529
|
-
const ie = _.filter((
|
|
1530
|
-
return u &&
|
|
1540
|
+
const ie = _.filter((S) => le.includes(S)), H = ie.length ? ie[ie.length - 1] : null, ve = _.includes("dark");
|
|
1541
|
+
return u && H ? O = `@media (prefers-color-scheme: dark) and ${ae[H]}{${O}}` : u ? O = `@media (prefers-color-scheme: dark){${O}}` : ve && H ? O = `@media (prefers-color-scheme: dark) and ${ae[H]}{${O}}` : ve ? O = `@media (prefers-color-scheme: dark){${O}}` : H && (O = `@media ${ae[H]}{${O}}`), O;
|
|
1531
1542
|
}
|
|
1532
|
-
for (const h of
|
|
1533
|
-
const u =
|
|
1543
|
+
for (const h of o) {
|
|
1544
|
+
const u = l(h), g = u.find(
|
|
1534
1545
|
(m) => se[m] || ce(m) || ue(m) || fe(m) || G(m)
|
|
1535
1546
|
);
|
|
1536
1547
|
if (!g) continue;
|
|
1537
|
-
const b = u.indexOf(g),
|
|
1548
|
+
const b = u.indexOf(g), d = b >= 0 ? u.slice(0, b) : [], v = y(d);
|
|
1538
1549
|
if (v === 4) {
|
|
1539
|
-
const m =
|
|
1540
|
-
m &&
|
|
1550
|
+
const m = p(h, !0);
|
|
1551
|
+
m && c.push(m);
|
|
1541
1552
|
} else {
|
|
1542
|
-
const m =
|
|
1553
|
+
const m = p(h);
|
|
1543
1554
|
m && (v === 1 ? s.push(m) : v === 2 ? i.push(m) : v === 3 && a.push(m));
|
|
1544
1555
|
}
|
|
1545
1556
|
}
|
|
1546
|
-
const
|
|
1547
|
-
return _e.set(e, { css:
|
|
1557
|
+
const k = [...s, ...i, ...a, ...c].join("");
|
|
1558
|
+
return _e.set(e, { css: k, timestamp: t }), k;
|
|
1548
1559
|
}
|
|
1549
1560
|
const J = [];
|
|
1550
|
-
function
|
|
1561
|
+
function at(e, t, r, n, o, s, i, a) {
|
|
1551
1562
|
if (e) {
|
|
1552
1563
|
J.push(r);
|
|
1553
1564
|
try {
|
|
1554
1565
|
if (t.loadingTemplate && r.isLoading) {
|
|
1555
|
-
|
|
1566
|
+
F(e, t.loadingTemplate(r), r, n, o);
|
|
1556
1567
|
return;
|
|
1557
1568
|
}
|
|
1558
1569
|
if (t.errorTemplate && r.hasError) {
|
|
1559
|
-
r.error instanceof Error &&
|
|
1570
|
+
r.error instanceof Error && F(e, t.errorTemplate(r.error, r), r, n, o);
|
|
1560
1571
|
return;
|
|
1561
1572
|
}
|
|
1562
|
-
const
|
|
1563
|
-
if (
|
|
1564
|
-
s(!0),
|
|
1565
|
-
s(!1), i(null),
|
|
1573
|
+
const c = t.render(r);
|
|
1574
|
+
if (c instanceof Promise) {
|
|
1575
|
+
s(!0), c.then((f) => {
|
|
1576
|
+
s(!1), i(null), F(e, f, r, n, o), a(e.innerHTML);
|
|
1566
1577
|
}).catch((f) => {
|
|
1567
|
-
s(!1), i(f), t.errorTemplate &&
|
|
1568
|
-
}), t.loadingTemplate &&
|
|
1578
|
+
s(!1), i(f), t.errorTemplate && F(e, t.errorTemplate(f, r), r, n, o);
|
|
1579
|
+
}), t.loadingTemplate && F(e, t.loadingTemplate(r), r, n, o);
|
|
1569
1580
|
return;
|
|
1570
1581
|
}
|
|
1571
|
-
|
|
1582
|
+
F(e, c, r, n, o), a(e.innerHTML);
|
|
1572
1583
|
} finally {
|
|
1573
1584
|
J.pop();
|
|
1574
1585
|
}
|
|
1575
1586
|
}
|
|
1576
1587
|
}
|
|
1577
|
-
function
|
|
1578
|
-
e && (
|
|
1588
|
+
function F(e, t, r, n, o) {
|
|
1589
|
+
e && (Je(
|
|
1579
1590
|
e,
|
|
1580
1591
|
Array.isArray(t) ? t : [t],
|
|
1581
1592
|
r,
|
|
1582
|
-
|
|
1583
|
-
),
|
|
1593
|
+
n
|
|
1594
|
+
), o(e.innerHTML));
|
|
1584
1595
|
}
|
|
1585
|
-
function
|
|
1596
|
+
function lt(e, t, r, n, o, s, i) {
|
|
1586
1597
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1587
|
-
if (
|
|
1598
|
+
if (o(r + 1), r > 10) {
|
|
1588
1599
|
console.warn("Potential infinite render loop detected. Skipping render."), i(null);
|
|
1589
1600
|
return;
|
|
1590
1601
|
}
|
|
1591
1602
|
} else
|
|
1592
|
-
|
|
1593
|
-
const
|
|
1594
|
-
|
|
1603
|
+
o(0);
|
|
1604
|
+
const c = setTimeout(() => {
|
|
1605
|
+
n(Date.now()), e(), i(null);
|
|
1595
1606
|
}, 0);
|
|
1596
|
-
i(
|
|
1607
|
+
i(c);
|
|
1597
1608
|
}
|
|
1598
|
-
function
|
|
1609
|
+
function ct(e, t, r, n, o, s) {
|
|
1599
1610
|
if (!e) return;
|
|
1600
|
-
const i =
|
|
1611
|
+
const i = st(n);
|
|
1601
1612
|
if (!t.style && (!i || i.trim() === "")) {
|
|
1602
1613
|
s(null), e.adoptedStyleSheets = [ke()];
|
|
1603
1614
|
return;
|
|
1604
1615
|
}
|
|
1605
1616
|
let a = "";
|
|
1606
1617
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1607
|
-
let
|
|
1618
|
+
let c = Ze(`${a}
|
|
1608
1619
|
${i}
|
|
1609
1620
|
`);
|
|
1610
|
-
|
|
1611
|
-
let f =
|
|
1612
|
-
f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !==
|
|
1621
|
+
c = Le(c);
|
|
1622
|
+
let f = o;
|
|
1623
|
+
f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !== c) && f.replaceSync(c), e.adoptedStyleSheets = [ke(), f], s(f);
|
|
1613
1624
|
}
|
|
1614
1625
|
const ye = /* @__PURE__ */ new Map();
|
|
1615
1626
|
function Ce(e, t, r) {
|
|
1616
|
-
let
|
|
1617
|
-
|
|
1618
|
-
let
|
|
1619
|
-
if (typeof t == "function" ?
|
|
1620
|
-
console.error(`[${
|
|
1621
|
-
}), ye.set(
|
|
1622
|
-
if (!customElements.get(
|
|
1623
|
-
customElements.define(
|
|
1627
|
+
let n = me(e);
|
|
1628
|
+
n.includes("-") || (n = `cer-${n}`);
|
|
1629
|
+
let o;
|
|
1630
|
+
if (typeof t == "function" ? o = { ...r, render: t } : o = t, typeof o.onError != "function" && (o.onError = (s, i) => {
|
|
1631
|
+
console.error(`[${n}] Error:`, s, i);
|
|
1632
|
+
}), ye.set(n, o), typeof window < "u")
|
|
1633
|
+
if (!customElements.get(n))
|
|
1634
|
+
customElements.define(n, ft(n, o));
|
|
1624
1635
|
else
|
|
1625
1636
|
try {
|
|
1626
|
-
document.querySelectorAll(
|
|
1637
|
+
document.querySelectorAll(n).forEach((s) => {
|
|
1627
1638
|
try {
|
|
1628
|
-
typeof s._cfg < "u" && (s._cfg =
|
|
1639
|
+
typeof s._cfg < "u" && (s._cfg = o), typeof s._render == "function" && s._render(o);
|
|
1629
1640
|
} catch {
|
|
1630
1641
|
}
|
|
1631
1642
|
});
|
|
1632
1643
|
} catch {
|
|
1633
1644
|
}
|
|
1634
1645
|
}
|
|
1635
|
-
function
|
|
1646
|
+
function ft(e, t) {
|
|
1636
1647
|
if (!t.render)
|
|
1637
1648
|
throw new Error(
|
|
1638
1649
|
"Component must have a render function"
|
|
@@ -1689,39 +1700,28 @@ function ct(e, t) {
|
|
|
1689
1700
|
enumerable: !1,
|
|
1690
1701
|
configurable: !1
|
|
1691
1702
|
}), this.context = r, this._applyProps(t), Object.defineProperty(this.context, "emit", {
|
|
1692
|
-
value: (
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
);
|
|
1701
|
-
const a = `on${n.charAt(0).toUpperCase()}${n.slice(1)}`, l = typeof this[a] == "function" ? this[a] : void 0, f = typeof this.context[a] == "function" ? this.context[a] : void 0, d = typeof t[a] == "function" ? t[a] : void 0;
|
|
1702
|
-
l && l(s, this.context), f && f !== l && f(s, this.context), d && d !== l && d !== f && d(s, this.context);
|
|
1703
|
+
value: (o, s, i) => {
|
|
1704
|
+
const a = new CustomEvent(o, {
|
|
1705
|
+
detail: s,
|
|
1706
|
+
bubbles: !0,
|
|
1707
|
+
composed: !0,
|
|
1708
|
+
...i || {}
|
|
1709
|
+
});
|
|
1710
|
+
return this.dispatchEvent(a), !a.defaultPrevented;
|
|
1703
1711
|
},
|
|
1704
1712
|
writable: !1,
|
|
1705
1713
|
enumerable: !1,
|
|
1706
1714
|
configurable: !1
|
|
1707
1715
|
});
|
|
1708
|
-
const
|
|
1709
|
-
Object.keys(
|
|
1710
|
-
const s = o
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
else if (n.startsWith("on") && n.length > 2 && n[2] === n[2].toUpperCase()) {
|
|
1714
|
-
const i = n.slice(2, 3).toLowerCase() + n.slice(3);
|
|
1715
|
-
this.addEventListener(i, (a) => {
|
|
1716
|
-
const l = typeof this[n] == "function" ? this[n] : this.context[n];
|
|
1717
|
-
typeof l == "function" && l(a.detail, this.context);
|
|
1718
|
-
});
|
|
1719
|
-
}
|
|
1720
|
-
}), this._applyComputed(o), this._initializing = !1, this._initWatchers(o), this._render(o);
|
|
1716
|
+
const n = ye.get(e) || t;
|
|
1717
|
+
Object.keys(n).forEach((o) => {
|
|
1718
|
+
const s = n[o];
|
|
1719
|
+
typeof s == "function" && (this.context[o] = (...i) => s(...i, this.context));
|
|
1720
|
+
}), this._applyComputed(n), this._initializing = !1, this._initWatchers(n), this._render(n);
|
|
1721
1721
|
}
|
|
1722
1722
|
connectedCallback() {
|
|
1723
1723
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1724
|
-
|
|
1724
|
+
Ne(
|
|
1725
1725
|
t,
|
|
1726
1726
|
this.context,
|
|
1727
1727
|
this._mounted,
|
|
@@ -1755,13 +1755,13 @@ function ct(e, t) {
|
|
|
1755
1755
|
);
|
|
1756
1756
|
});
|
|
1757
1757
|
}
|
|
1758
|
-
attributeChangedCallback(r,
|
|
1758
|
+
attributeChangedCallback(r, n, o) {
|
|
1759
1759
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1760
|
-
this._applyProps(t),
|
|
1760
|
+
this._applyProps(t), De(
|
|
1761
1761
|
t,
|
|
1762
1762
|
r,
|
|
1763
|
-
o,
|
|
1764
1763
|
n,
|
|
1764
|
+
o,
|
|
1765
1765
|
this.context
|
|
1766
1766
|
);
|
|
1767
1767
|
});
|
|
@@ -1771,10 +1771,10 @@ function ct(e, t) {
|
|
|
1771
1771
|
}
|
|
1772
1772
|
_applyComputed(r) {
|
|
1773
1773
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1774
|
-
r.computed && Object.entries(r.computed).forEach(([
|
|
1775
|
-
Object.defineProperty(this.context,
|
|
1774
|
+
r.computed && Object.entries(r.computed).forEach(([n, o]) => {
|
|
1775
|
+
Object.defineProperty(this.context, n, {
|
|
1776
1776
|
get: () => {
|
|
1777
|
-
const s =
|
|
1777
|
+
const s = o(this.context);
|
|
1778
1778
|
return pe(s);
|
|
1779
1779
|
},
|
|
1780
1780
|
enumerable: !0
|
|
@@ -1785,21 +1785,21 @@ function ct(e, t) {
|
|
|
1785
1785
|
// --- Render ---
|
|
1786
1786
|
_render(r) {
|
|
1787
1787
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1788
|
-
|
|
1788
|
+
at(
|
|
1789
1789
|
this.shadowRoot,
|
|
1790
1790
|
r,
|
|
1791
1791
|
this.context,
|
|
1792
1792
|
this._refs,
|
|
1793
|
-
(
|
|
1794
|
-
this._lastHtmlStringForJitCSS =
|
|
1793
|
+
(n) => {
|
|
1794
|
+
this._lastHtmlStringForJitCSS = n, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(n);
|
|
1795
1795
|
},
|
|
1796
|
-
(
|
|
1797
|
-
this._templateLoading =
|
|
1796
|
+
(n) => {
|
|
1797
|
+
this._templateLoading = n, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(n);
|
|
1798
1798
|
},
|
|
1799
|
-
(
|
|
1800
|
-
this._templateError =
|
|
1799
|
+
(n) => {
|
|
1800
|
+
this._templateError = n, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(n);
|
|
1801
1801
|
},
|
|
1802
|
-
(
|
|
1802
|
+
(n) => this._applyStyle(r, n)
|
|
1803
1803
|
);
|
|
1804
1804
|
});
|
|
1805
1805
|
}
|
|
@@ -1808,7 +1808,7 @@ function ct(e, t) {
|
|
|
1808
1808
|
}
|
|
1809
1809
|
_requestRender() {
|
|
1810
1810
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1811
|
-
|
|
1811
|
+
lt(
|
|
1812
1812
|
() => this._render(this._cfg),
|
|
1813
1813
|
this._lastRenderTime,
|
|
1814
1814
|
this._renderCount,
|
|
@@ -1826,28 +1826,28 @@ function ct(e, t) {
|
|
|
1826
1826
|
});
|
|
1827
1827
|
}
|
|
1828
1828
|
// --- Style ---
|
|
1829
|
-
_applyStyle(r,
|
|
1829
|
+
_applyStyle(r, n) {
|
|
1830
1830
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1831
|
-
|
|
1831
|
+
ct(
|
|
1832
1832
|
this.shadowRoot,
|
|
1833
1833
|
r,
|
|
1834
1834
|
this.context,
|
|
1835
|
-
|
|
1835
|
+
n,
|
|
1836
1836
|
this._styleSheet,
|
|
1837
|
-
(
|
|
1838
|
-
this._styleSheet =
|
|
1837
|
+
(o) => {
|
|
1838
|
+
this._styleSheet = o;
|
|
1839
1839
|
}
|
|
1840
1840
|
);
|
|
1841
1841
|
});
|
|
1842
1842
|
}
|
|
1843
1843
|
// --- Error Boundary function ---
|
|
1844
|
-
_runLogicWithinErrorBoundary(r,
|
|
1844
|
+
_runLogicWithinErrorBoundary(r, n) {
|
|
1845
1845
|
this._hasError && (this._hasError = !1);
|
|
1846
1846
|
try {
|
|
1847
|
-
|
|
1848
|
-
} catch (
|
|
1849
|
-
this._hasError = !0, r.onError && r.onError(
|
|
1850
|
-
|
|
1847
|
+
n();
|
|
1848
|
+
} catch (o) {
|
|
1849
|
+
this._hasError = !0, r.onError && r.onError(o, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(
|
|
1850
|
+
o,
|
|
1851
1851
|
this.context
|
|
1852
1852
|
));
|
|
1853
1853
|
}
|
|
@@ -1855,11 +1855,11 @@ function ct(e, t) {
|
|
|
1855
1855
|
// --- State, props, computed ---
|
|
1856
1856
|
_initContext(r) {
|
|
1857
1857
|
try {
|
|
1858
|
-
let
|
|
1858
|
+
let n = function(s, i = "") {
|
|
1859
1859
|
return Array.isArray(s) ? new Proxy(s, {
|
|
1860
|
-
get(a,
|
|
1861
|
-
const
|
|
1862
|
-
return typeof
|
|
1860
|
+
get(a, c, f) {
|
|
1861
|
+
const p = Reflect.get(a, c, f);
|
|
1862
|
+
return typeof p == "function" && typeof c == "string" && [
|
|
1863
1863
|
"push",
|
|
1864
1864
|
"pop",
|
|
1865
1865
|
"shift",
|
|
@@ -1867,77 +1867,77 @@ function ct(e, t) {
|
|
|
1867
1867
|
"splice",
|
|
1868
1868
|
"sort",
|
|
1869
1869
|
"reverse"
|
|
1870
|
-
].includes(
|
|
1871
|
-
const w =
|
|
1872
|
-
if (!
|
|
1870
|
+
].includes(c) ? function(...l) {
|
|
1871
|
+
const w = p.apply(a, l);
|
|
1872
|
+
if (!o._initializing) {
|
|
1873
1873
|
const x = i || "root";
|
|
1874
|
-
|
|
1874
|
+
o._triggerWatchers(x, a), o._render(r);
|
|
1875
1875
|
}
|
|
1876
1876
|
return w;
|
|
1877
|
-
} :
|
|
1877
|
+
} : p;
|
|
1878
1878
|
},
|
|
1879
|
-
set(a,
|
|
1880
|
-
if (a[
|
|
1881
|
-
const
|
|
1882
|
-
|
|
1879
|
+
set(a, c, f) {
|
|
1880
|
+
if (a[c] = f, !o._initializing) {
|
|
1881
|
+
const p = i ? `${i}.${String(c)}` : String(c);
|
|
1882
|
+
o._triggerWatchers(p, f), o._render(r);
|
|
1883
1883
|
}
|
|
1884
1884
|
return !0;
|
|
1885
1885
|
},
|
|
1886
|
-
deleteProperty(a,
|
|
1887
|
-
if (delete a[
|
|
1888
|
-
const f = i ? `${i}.${String(
|
|
1889
|
-
|
|
1886
|
+
deleteProperty(a, c) {
|
|
1887
|
+
if (delete a[c], !o._initializing) {
|
|
1888
|
+
const f = i ? `${i}.${String(c)}` : String(c);
|
|
1889
|
+
o._triggerWatchers(f, void 0), o._render(r);
|
|
1890
1890
|
}
|
|
1891
1891
|
return !0;
|
|
1892
1892
|
}
|
|
1893
1893
|
}) : s && typeof s == "object" ? (Object.keys(s).forEach((a) => {
|
|
1894
|
-
const
|
|
1895
|
-
s[a] =
|
|
1894
|
+
const c = i ? `${i}.${a}` : a;
|
|
1895
|
+
s[a] = n(s[a], c);
|
|
1896
1896
|
}), new Proxy(s, {
|
|
1897
|
-
set(a,
|
|
1898
|
-
const
|
|
1899
|
-
return a[
|
|
1900
|
-
|
|
1901
|
-
a[
|
|
1902
|
-
),
|
|
1897
|
+
set(a, c, f) {
|
|
1898
|
+
const p = i ? `${i}.${String(c)}` : String(c);
|
|
1899
|
+
return a[c] = n(f, p), o._initializing || (o._triggerWatchers(
|
|
1900
|
+
p,
|
|
1901
|
+
a[c]
|
|
1902
|
+
), o._render(r)), !0;
|
|
1903
1903
|
},
|
|
1904
|
-
get(a,
|
|
1905
|
-
return Reflect.get(a,
|
|
1904
|
+
get(a, c, f) {
|
|
1905
|
+
return Reflect.get(a, c, f);
|
|
1906
1906
|
}
|
|
1907
1907
|
})) : s;
|
|
1908
1908
|
};
|
|
1909
|
-
const
|
|
1910
|
-
return
|
|
1909
|
+
const o = this;
|
|
1910
|
+
return n({ ...r.state });
|
|
1911
1911
|
} catch {
|
|
1912
1912
|
return {};
|
|
1913
1913
|
}
|
|
1914
1914
|
}
|
|
1915
1915
|
_initWatchers(r) {
|
|
1916
1916
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1917
|
-
|
|
1917
|
+
Pe(
|
|
1918
1918
|
this.context,
|
|
1919
1919
|
this._watchers,
|
|
1920
1920
|
r.watch || {}
|
|
1921
1921
|
);
|
|
1922
1922
|
});
|
|
1923
1923
|
}
|
|
1924
|
-
_triggerWatchers(r,
|
|
1925
|
-
|
|
1924
|
+
_triggerWatchers(r, n) {
|
|
1925
|
+
Oe(this.context, this._watchers, r, n);
|
|
1926
1926
|
}
|
|
1927
1927
|
_applyProps(r) {
|
|
1928
1928
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1929
1929
|
try {
|
|
1930
|
-
|
|
1931
|
-
} catch (
|
|
1932
|
-
this._hasError = !0, r.onError && r.onError(
|
|
1930
|
+
Me(this, r, this.context);
|
|
1931
|
+
} catch (n) {
|
|
1932
|
+
this._hasError = !0, r.onError && r.onError(n, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(n, this.context));
|
|
1933
1933
|
}
|
|
1934
1934
|
});
|
|
1935
1935
|
}
|
|
1936
1936
|
};
|
|
1937
1937
|
}
|
|
1938
|
-
function V(e, t = {}, r,
|
|
1939
|
-
const
|
|
1940
|
-
return { tag: e, key:
|
|
1938
|
+
function V(e, t = {}, r, n) {
|
|
1939
|
+
const o = n ?? t.key;
|
|
1940
|
+
return { tag: e, key: o, props: t, children: r };
|
|
1941
1941
|
}
|
|
1942
1942
|
function ee(e) {
|
|
1943
1943
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
@@ -1945,90 +1945,90 @@ function ee(e) {
|
|
|
1945
1945
|
function X(e) {
|
|
1946
1946
|
return typeof e == "object" && e !== null && "tag" in e && !ee(e);
|
|
1947
1947
|
}
|
|
1948
|
-
function
|
|
1948
|
+
function ut(e, t) {
|
|
1949
1949
|
return e.key != null ? e : { ...e, key: t };
|
|
1950
1950
|
}
|
|
1951
|
-
function
|
|
1952
|
-
const
|
|
1951
|
+
function dt(e, t = [], r = {}) {
|
|
1952
|
+
const n = {}, o = {}, s = {}, i = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
1953
1953
|
let a;
|
|
1954
1954
|
for (; a = i.exec(e); ) {
|
|
1955
|
-
const
|
|
1956
|
-
let
|
|
1957
|
-
y || (
|
|
1955
|
+
const c = a[1], f = a[2], p = (a[4] || a[6]) ?? "", y = p.match(/^{{(\d+)}}$/);
|
|
1956
|
+
let l = y ? t[Number(y[1])] ?? null : p;
|
|
1957
|
+
y || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
1958
1958
|
const w = ["model", "bind", "show", "class", "style"];
|
|
1959
|
-
if (
|
|
1960
|
-
const [x, ...
|
|
1959
|
+
if (c === ":") {
|
|
1960
|
+
const [x, ...k] = f.split(".");
|
|
1961
1961
|
if (w.includes(x)) {
|
|
1962
|
-
const h = [...
|
|
1962
|
+
const h = [...k];
|
|
1963
1963
|
s[x] = {
|
|
1964
|
-
value:
|
|
1964
|
+
value: l,
|
|
1965
1965
|
modifiers: h
|
|
1966
1966
|
};
|
|
1967
1967
|
} else
|
|
1968
|
-
|
|
1969
|
-
} else if (
|
|
1968
|
+
o[f] = l;
|
|
1969
|
+
} else if (c === "@") {
|
|
1970
1970
|
const x = "on" + f.charAt(0).toUpperCase() + f.slice(1);
|
|
1971
|
-
|
|
1972
|
-
} else f === "ref" ?
|
|
1971
|
+
n[x] = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
1972
|
+
} else f === "ref" ? n.ref = l : o[f] = l;
|
|
1973
1973
|
}
|
|
1974
|
-
return { props:
|
|
1974
|
+
return { props: n, attrs: o, directives: s };
|
|
1975
1975
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const
|
|
1978
|
-
function s(
|
|
1979
|
-
return V("#text", {},
|
|
1976
|
+
function pt(e, t, r) {
|
|
1977
|
+
const n = J.length > 0 ? J[J.length - 1] : void 0, o = r ?? n;
|
|
1978
|
+
function s(d, v) {
|
|
1979
|
+
return V("#text", {}, d, v);
|
|
1980
1980
|
}
|
|
1981
1981
|
let i = "";
|
|
1982
|
-
for (let
|
|
1983
|
-
i += e[
|
|
1984
|
-
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,
|
|
1985
|
-
let f,
|
|
1986
|
-
function h(
|
|
1987
|
-
!
|
|
1988
|
-
if (v === "style" &&
|
|
1989
|
-
const m =
|
|
1982
|
+
for (let d = 0; d < e.length; d++)
|
|
1983
|
+
i += e[d], d < t.length && (i += `{{${d}}}`);
|
|
1984
|
+
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, c = [];
|
|
1985
|
+
let f, p = [], y = null, l = {}, w, x = 0, k = [];
|
|
1986
|
+
function h(d) {
|
|
1987
|
+
!d || typeof d != "object" || ee(d) || (d.props || d.attrs ? (d.props && (l.props || (l.props = {}), Object.assign(l.props, d.props)), d.attrs && (l.attrs || (l.attrs = {}), Object.keys(d.attrs).forEach((v) => {
|
|
1988
|
+
if (v === "style" && l.attrs.style) {
|
|
1989
|
+
const m = l.attrs.style.replace(
|
|
1990
1990
|
/;?\s*$/,
|
|
1991
1991
|
""
|
|
1992
|
-
),
|
|
1993
|
-
|
|
1994
|
-
} else if (v === "class" &&
|
|
1995
|
-
const m =
|
|
1996
|
-
.../* @__PURE__ */ new Set([...m,
|
|
1992
|
+
), $ = d.attrs.style.replace(/^;?\s*/, "");
|
|
1993
|
+
l.attrs.style = m + "; " + $;
|
|
1994
|
+
} else if (v === "class" && l.attrs.class) {
|
|
1995
|
+
const m = l.attrs.class.trim().split(/\s+/).filter(Boolean), $ = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = [
|
|
1996
|
+
.../* @__PURE__ */ new Set([...m, ...$])
|
|
1997
1997
|
];
|
|
1998
|
-
|
|
1998
|
+
l.attrs.class = _.join(" ");
|
|
1999
1999
|
} else
|
|
2000
|
-
|
|
2001
|
-
}))) : (
|
|
2002
|
-
}
|
|
2003
|
-
function u(
|
|
2004
|
-
const m = y ?
|
|
2005
|
-
if (ee(
|
|
2006
|
-
const
|
|
2007
|
-
let _ =
|
|
2000
|
+
l.attrs[v] = d.attrs[v];
|
|
2001
|
+
}))) : (l.props || (l.props = {}), Object.assign(l.props, d)));
|
|
2002
|
+
}
|
|
2003
|
+
function u(d, v) {
|
|
2004
|
+
const m = y ? p : k;
|
|
2005
|
+
if (ee(d)) {
|
|
2006
|
+
const $ = d.key ?? v;
|
|
2007
|
+
let _ = d.children;
|
|
2008
2008
|
m.push({
|
|
2009
|
-
...
|
|
2010
|
-
key:
|
|
2009
|
+
...d,
|
|
2010
|
+
key: $,
|
|
2011
2011
|
children: _
|
|
2012
2012
|
});
|
|
2013
2013
|
return;
|
|
2014
2014
|
}
|
|
2015
|
-
if (X(
|
|
2016
|
-
m.push(
|
|
2015
|
+
if (X(d)) {
|
|
2016
|
+
m.push(ut(d, void 0));
|
|
2017
2017
|
return;
|
|
2018
2018
|
}
|
|
2019
|
-
if (Array.isArray(
|
|
2020
|
-
if (
|
|
2021
|
-
for (let
|
|
2022
|
-
const _ =
|
|
2023
|
-
ee(_) || X(_) || Array.isArray(_) ? u(_, `${v}-${
|
|
2019
|
+
if (Array.isArray(d)) {
|
|
2020
|
+
if (d.length === 0) return;
|
|
2021
|
+
for (let $ = 0; $ < d.length; $++) {
|
|
2022
|
+
const _ = d[$];
|
|
2023
|
+
ee(_) || X(_) || Array.isArray(_) ? u(_, `${v}-${$}`) : _ !== null && typeof _ == "object" ? h(_) : m.push(s(String(_), `${v}-${$}`));
|
|
2024
2024
|
}
|
|
2025
2025
|
return;
|
|
2026
2026
|
}
|
|
2027
|
-
if (
|
|
2028
|
-
h(
|
|
2027
|
+
if (d !== null && typeof d == "object") {
|
|
2028
|
+
h(d);
|
|
2029
2029
|
return;
|
|
2030
2030
|
}
|
|
2031
|
-
m.push(s(String(
|
|
2031
|
+
m.push(s(String(d), v));
|
|
2032
2032
|
}
|
|
2033
2033
|
const g = /* @__PURE__ */ new Set([
|
|
2034
2034
|
"area",
|
|
@@ -2048,64 +2048,64 @@ function dt(e, t, r) {
|
|
|
2048
2048
|
]);
|
|
2049
2049
|
for (; f = a.exec(i); )
|
|
2050
2050
|
if (f[1]) {
|
|
2051
|
-
const
|
|
2052
|
-
props:
|
|
2051
|
+
const d = f[1], v = f[0][1] === "/", m = f[0][f[0].length - 2] === "/" || g.has(d), {
|
|
2052
|
+
props: $,
|
|
2053
2053
|
attrs: _,
|
|
2054
2054
|
directives: C
|
|
2055
|
-
} =
|
|
2056
|
-
for (const j in
|
|
2055
|
+
} = dt(f[2] || "", t, o), E = { props: {}, attrs: {} };
|
|
2056
|
+
for (const j in $) E.props[j] = $[j];
|
|
2057
2057
|
for (const j in _) E.attrs[j] = _[j];
|
|
2058
2058
|
if (Object.keys(C).length > 0 && (E.directives = { ...C }), v) {
|
|
2059
2059
|
const j = V(
|
|
2060
2060
|
y,
|
|
2061
|
-
|
|
2062
|
-
|
|
2061
|
+
l,
|
|
2062
|
+
p.length === 1 && X(p[0]) && p[0].tag === "#text" ? typeof p[0].children == "string" ? p[0].children : "" : p.length ? p : void 0,
|
|
2063
2063
|
w
|
|
2064
|
-
), A =
|
|
2065
|
-
A ? (y = A.tag,
|
|
2066
|
-
} else m ? y ?
|
|
2064
|
+
), A = c.pop();
|
|
2065
|
+
A ? (y = A.tag, l = A.props, w = A.key, p = A.children, p.push(j)) : (k.push(j), y = null, l = {}, w = void 0, p = []);
|
|
2066
|
+
} else m ? y ? p.push(V(d, E, void 0, void 0)) : k.push(V(d, E, void 0, void 0)) : (y && c.push({
|
|
2067
2067
|
tag: y,
|
|
2068
|
-
props:
|
|
2069
|
-
children:
|
|
2068
|
+
props: l,
|
|
2069
|
+
children: p,
|
|
2070
2070
|
key: w
|
|
2071
|
-
}), y =
|
|
2071
|
+
}), y = d, l = E, p = []);
|
|
2072
2072
|
} else if (typeof f[3] < "u") {
|
|
2073
|
-
const
|
|
2073
|
+
const d = Number(f[3]), v = t[d], m = `interp-${d}`;
|
|
2074
2074
|
u(v, m);
|
|
2075
2075
|
} else if (f[4]) {
|
|
2076
|
-
const
|
|
2077
|
-
for (const
|
|
2078
|
-
if (
|
|
2079
|
-
const _ =
|
|
2076
|
+
const d = f[4], v = y ? p : k, m = d.split(/({{\d+}})/);
|
|
2077
|
+
for (const $ of m) {
|
|
2078
|
+
if (!$) continue;
|
|
2079
|
+
const _ = $.match(/^{{(\d+)}}$/);
|
|
2080
2080
|
if (_) {
|
|
2081
2081
|
const C = Number(_[1]), E = t[C], j = `interp-${C}`;
|
|
2082
2082
|
u(E, j);
|
|
2083
2083
|
} else {
|
|
2084
2084
|
const C = `text-${x++}`;
|
|
2085
|
-
v.push(s(
|
|
2085
|
+
v.push(s($, C));
|
|
2086
2086
|
}
|
|
2087
2087
|
}
|
|
2088
2088
|
}
|
|
2089
|
-
const b =
|
|
2089
|
+
const b = k.filter((d) => X(d) && d.tag === "#text" ? typeof d.children == "string" && d.children.trim() !== "" : !0);
|
|
2090
2090
|
return b.length === 1 ? b[0] : b.length > 1 ? b : V("div", {}, "", "fallback-root");
|
|
2091
2091
|
}
|
|
2092
2092
|
function D(e, ...t) {
|
|
2093
|
-
const r = t[t.length - 1],
|
|
2094
|
-
return
|
|
2093
|
+
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2094
|
+
return pt(e, t, n);
|
|
2095
2095
|
}
|
|
2096
|
-
const Ee = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {},
|
|
2096
|
+
const Ee = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, N = (e, t) => {
|
|
2097
2097
|
for (const r of e) {
|
|
2098
|
-
const
|
|
2098
|
+
const n = [], o = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${o}$`), i = t.match(s);
|
|
2099
2099
|
if (i) {
|
|
2100
2100
|
const a = {};
|
|
2101
|
-
return
|
|
2102
|
-
a[
|
|
2101
|
+
return n.forEach((c, f) => {
|
|
2102
|
+
a[c] = i[f + 1];
|
|
2103
2103
|
}), { route: r, params: a };
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
2106
|
return { route: null, params: {} };
|
|
2107
2107
|
}, de = {};
|
|
2108
|
-
async function
|
|
2108
|
+
async function ht(e) {
|
|
2109
2109
|
if (e.component) return e.component;
|
|
2110
2110
|
if (e.load) {
|
|
2111
2111
|
if (de[e.path]) return de[e.path];
|
|
@@ -2118,81 +2118,81 @@ async function pt(e) {
|
|
|
2118
2118
|
}
|
|
2119
2119
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2120
2120
|
}
|
|
2121
|
-
function
|
|
2122
|
-
const { routes: t, base: r = "", initialUrl:
|
|
2123
|
-
let
|
|
2124
|
-
const y = async (
|
|
2125
|
-
const u = t.find((g) =>
|
|
2121
|
+
function gt(e) {
|
|
2122
|
+
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
2123
|
+
let o, s, i, a, c, f, p;
|
|
2124
|
+
const y = async (k, h) => {
|
|
2125
|
+
const u = t.find((g) => N([g], k.path).route !== null);
|
|
2126
2126
|
if (u?.beforeEnter)
|
|
2127
2127
|
try {
|
|
2128
|
-
const g = await u.beforeEnter(
|
|
2128
|
+
const g = await u.beforeEnter(k, h);
|
|
2129
2129
|
return typeof g == "string" ? (await x(g, !0), !1) : g !== !1;
|
|
2130
2130
|
} catch (g) {
|
|
2131
2131
|
return console.error("beforeEnter error", g), !1;
|
|
2132
2132
|
}
|
|
2133
2133
|
return !0;
|
|
2134
|
-
},
|
|
2135
|
-
const u = t.find((g) =>
|
|
2134
|
+
}, l = async (k, h) => {
|
|
2135
|
+
const u = t.find((g) => N([g], k.path).route !== null);
|
|
2136
2136
|
if (u?.onEnter)
|
|
2137
2137
|
try {
|
|
2138
|
-
const g = await u.onEnter(
|
|
2138
|
+
const g = await u.onEnter(k, h);
|
|
2139
2139
|
return typeof g == "string" ? (await x(g, !0), !1) : g !== !1;
|
|
2140
2140
|
} catch (g) {
|
|
2141
2141
|
return console.error("onEnter error", g), !1;
|
|
2142
2142
|
}
|
|
2143
2143
|
return !0;
|
|
2144
|
-
}, w = (
|
|
2145
|
-
const u = t.find((g) =>
|
|
2144
|
+
}, w = (k, h) => {
|
|
2145
|
+
const u = t.find((g) => N([g], k.path).route !== null);
|
|
2146
2146
|
if (u?.afterEnter)
|
|
2147
2147
|
try {
|
|
2148
|
-
u.afterEnter(
|
|
2148
|
+
u.afterEnter(k, h);
|
|
2149
2149
|
} catch (g) {
|
|
2150
2150
|
console.error("afterEnter error", g);
|
|
2151
2151
|
}
|
|
2152
|
-
}, x = async (
|
|
2152
|
+
}, x = async (k, h = !1) => {
|
|
2153
2153
|
try {
|
|
2154
2154
|
const u = {
|
|
2155
|
-
path:
|
|
2155
|
+
path: k.replace(r, "") || "/",
|
|
2156
2156
|
query: {}
|
|
2157
|
-
}, g =
|
|
2157
|
+
}, g = N(t, u.path);
|
|
2158
2158
|
if (!g) throw new Error(`No route found for ${u.path}`);
|
|
2159
|
-
const b = i.getState(),
|
|
2159
|
+
const b = i.getState(), d = {
|
|
2160
2160
|
path: u.path,
|
|
2161
2161
|
params: g.params,
|
|
2162
2162
|
query: u.query
|
|
2163
2163
|
};
|
|
2164
|
-
if (!await y(
|
|
2165
|
-
typeof window < "u" && typeof document < "u" && (h ? window.history.replaceState({}, "", r +
|
|
2164
|
+
if (!await y(d, b) || !await l(d, b)) return;
|
|
2165
|
+
typeof window < "u" && typeof document < "u" && (h ? window.history.replaceState({}, "", r + k) : window.history.pushState({}, "", r + k)), i.setState(d), w(d, b);
|
|
2166
2166
|
} catch (u) {
|
|
2167
2167
|
console.error("Navigation error:", u);
|
|
2168
2168
|
}
|
|
2169
2169
|
};
|
|
2170
2170
|
if (typeof window < "u" && typeof document < "u") {
|
|
2171
|
-
|
|
2171
|
+
o = () => {
|
|
2172
2172
|
const h = new URL(window.location.href), u = h.pathname.replace(r, "") || "/", g = Ee(h.search);
|
|
2173
2173
|
return { path: u, query: g };
|
|
2174
|
-
}, s =
|
|
2175
|
-
const
|
|
2174
|
+
}, s = o();
|
|
2175
|
+
const k = N(t, s.path);
|
|
2176
2176
|
i = xe({
|
|
2177
2177
|
path: s.path,
|
|
2178
|
-
params:
|
|
2178
|
+
params: k.params,
|
|
2179
2179
|
query: s.query
|
|
2180
2180
|
}), a = async (h = !1) => {
|
|
2181
|
-
const u =
|
|
2181
|
+
const u = o();
|
|
2182
2182
|
await x(u.path, h);
|
|
2183
|
-
}, window.addEventListener("popstate", () => a(!0)),
|
|
2183
|
+
}, window.addEventListener("popstate", () => a(!0)), c = (h) => x(h, !1), f = (h) => x(h, !0), p = () => window.history.back();
|
|
2184
2184
|
} else {
|
|
2185
|
-
|
|
2186
|
-
const u = new URL(
|
|
2185
|
+
o = () => {
|
|
2186
|
+
const u = new URL(n || "/", "http://localhost"), g = u.pathname.replace(r, "") || "/", b = Ee(u.search);
|
|
2187
2187
|
return { path: g, query: b };
|
|
2188
|
-
}, s =
|
|
2189
|
-
const
|
|
2188
|
+
}, s = o();
|
|
2189
|
+
const k = N(t, s.path);
|
|
2190
2190
|
i = xe({
|
|
2191
2191
|
path: s.path,
|
|
2192
|
-
params:
|
|
2192
|
+
params: k.params,
|
|
2193
2193
|
query: s.query
|
|
2194
2194
|
}), a = async () => {
|
|
2195
|
-
const u =
|
|
2195
|
+
const u = o();
|
|
2196
2196
|
await h(u.path);
|
|
2197
2197
|
};
|
|
2198
2198
|
const h = async (u) => {
|
|
@@ -2200,69 +2200,69 @@ function ht(e) {
|
|
|
2200
2200
|
const g = {
|
|
2201
2201
|
path: u.replace(r, "") || "/",
|
|
2202
2202
|
query: {}
|
|
2203
|
-
}, b =
|
|
2203
|
+
}, b = N(t, g.path);
|
|
2204
2204
|
if (!b) throw new Error(`No route found for ${g.path}`);
|
|
2205
|
-
const
|
|
2205
|
+
const d = i.getState(), v = {
|
|
2206
2206
|
path: g.path,
|
|
2207
2207
|
params: b.params,
|
|
2208
2208
|
query: g.query
|
|
2209
|
-
}, m = t.find((
|
|
2209
|
+
}, m = t.find(($) => N([$], v.path).route !== null);
|
|
2210
2210
|
if (m?.beforeEnter)
|
|
2211
2211
|
try {
|
|
2212
|
-
const
|
|
2213
|
-
if (typeof
|
|
2214
|
-
await h(
|
|
2212
|
+
const $ = await m.beforeEnter(v, d);
|
|
2213
|
+
if (typeof $ == "string") {
|
|
2214
|
+
await h($);
|
|
2215
2215
|
return;
|
|
2216
2216
|
}
|
|
2217
|
-
if (
|
|
2217
|
+
if ($ === !1) return;
|
|
2218
2218
|
} catch {
|
|
2219
2219
|
return;
|
|
2220
2220
|
}
|
|
2221
2221
|
if (m?.onEnter)
|
|
2222
2222
|
try {
|
|
2223
|
-
const
|
|
2224
|
-
if (typeof
|
|
2225
|
-
await h(
|
|
2223
|
+
const $ = await m.onEnter(v, d);
|
|
2224
|
+
if (typeof $ == "string") {
|
|
2225
|
+
await h($);
|
|
2226
2226
|
return;
|
|
2227
2227
|
}
|
|
2228
|
-
if (
|
|
2228
|
+
if ($ === !1) return;
|
|
2229
2229
|
} catch {
|
|
2230
2230
|
return;
|
|
2231
2231
|
}
|
|
2232
2232
|
if (i.setState(v), m?.afterEnter)
|
|
2233
2233
|
try {
|
|
2234
|
-
m.afterEnter(v,
|
|
2234
|
+
m.afterEnter(v, d);
|
|
2235
2235
|
} catch {
|
|
2236
2236
|
}
|
|
2237
2237
|
} catch {
|
|
2238
2238
|
}
|
|
2239
2239
|
};
|
|
2240
|
-
|
|
2240
|
+
c = async (u) => h(u), f = async (u) => h(u), p = () => {
|
|
2241
2241
|
};
|
|
2242
2242
|
}
|
|
2243
2243
|
return {
|
|
2244
2244
|
store: i,
|
|
2245
|
-
push:
|
|
2245
|
+
push: c,
|
|
2246
2246
|
replace: f,
|
|
2247
|
-
back:
|
|
2247
|
+
back: p,
|
|
2248
2248
|
subscribe: i.subscribe,
|
|
2249
|
-
matchRoute: (
|
|
2249
|
+
matchRoute: (k) => N(t, k),
|
|
2250
2250
|
getCurrent: () => i.getState(),
|
|
2251
|
-
resolveRouteComponent:
|
|
2251
|
+
resolveRouteComponent: ht
|
|
2252
2252
|
};
|
|
2253
2253
|
}
|
|
2254
|
-
function
|
|
2255
|
-
return
|
|
2254
|
+
function $t(e, t) {
|
|
2255
|
+
return N(e, t);
|
|
2256
2256
|
}
|
|
2257
|
-
function
|
|
2258
|
-
const t =
|
|
2257
|
+
function St(e) {
|
|
2258
|
+
const t = gt(e);
|
|
2259
2259
|
return Ce("router-view", {
|
|
2260
2260
|
async render() {
|
|
2261
2261
|
if (!t) return D`<div>Router not initialized.</div>`;
|
|
2262
|
-
const r = t.getCurrent(), { path:
|
|
2263
|
-
if (!
|
|
2262
|
+
const r = t.getCurrent(), { path: n } = r, o = t.matchRoute(n);
|
|
2263
|
+
if (!o.route) return D`<div>Not found</div>`;
|
|
2264
2264
|
try {
|
|
2265
|
-
const s = await t.resolveRouteComponent(
|
|
2265
|
+
const s = await t.resolveRouteComponent(o.route);
|
|
2266
2266
|
if (typeof s == "string")
|
|
2267
2267
|
return { tag: s, props: {}, children: [] };
|
|
2268
2268
|
if (typeof s == "function") {
|
|
@@ -2292,7 +2292,7 @@ function $t(e) {
|
|
|
2292
2292
|
disabled: { type: Boolean, default: !1 },
|
|
2293
2293
|
external: { type: Boolean, default: !1 },
|
|
2294
2294
|
class: { type: String, default: "" },
|
|
2295
|
-
style: { type: String, default:
|
|
2295
|
+
style: { type: String, default: je`
|
|
2296
2296
|
[aria-disabled="true"] {
|
|
2297
2297
|
pointer-events: none;
|
|
2298
2298
|
opacity: 0.5;
|
|
@@ -2301,66 +2301,66 @@ function $t(e) {
|
|
|
2301
2301
|
},
|
|
2302
2302
|
style: (r) => r.style,
|
|
2303
2303
|
render: (r) => {
|
|
2304
|
-
const
|
|
2305
|
-
for (const v of
|
|
2304
|
+
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag, p = r.disabled, y = r.external, l = n.path === o, w = s ? l : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, x = l ? `aria-current="${c}"` : "", k = (r.class || "").split(/\s+/).filter(Boolean), h = {};
|
|
2305
|
+
for (const v of k) h[v] = !0;
|
|
2306
2306
|
const u = {
|
|
2307
2307
|
...h,
|
|
2308
2308
|
// Also include the configurable names (may duplicate the above)
|
|
2309
2309
|
[a]: w,
|
|
2310
|
-
[i]:
|
|
2311
|
-
}, g = f === "button", b =
|
|
2310
|
+
[i]: l
|
|
2311
|
+
}, g = f === "button", b = p ? g ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", d = y && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2312
2312
|
return D`
|
|
2313
|
-
${
|
|
2313
|
+
${Be().when(g, D`
|
|
2314
2314
|
<button
|
|
2315
2315
|
part="button"
|
|
2316
2316
|
:class="${u}"
|
|
2317
2317
|
${x}
|
|
2318
2318
|
${b}
|
|
2319
|
-
${
|
|
2319
|
+
${d}
|
|
2320
2320
|
@click="navigate"
|
|
2321
2321
|
><slot></slot></button>
|
|
2322
2322
|
`).otherwise(D`
|
|
2323
2323
|
<a
|
|
2324
2324
|
part="link"
|
|
2325
|
-
href="${
|
|
2325
|
+
href="${o}"
|
|
2326
2326
|
:class="${u}"
|
|
2327
2327
|
${x}
|
|
2328
2328
|
${b}
|
|
2329
|
-
${
|
|
2329
|
+
${d}
|
|
2330
2330
|
@click="navigate"
|
|
2331
2331
|
><slot></slot></a>
|
|
2332
2332
|
`).done()}
|
|
2333
2333
|
`;
|
|
2334
2334
|
},
|
|
2335
|
-
navigate: (r,
|
|
2336
|
-
if (
|
|
2335
|
+
navigate: (r, n) => {
|
|
2336
|
+
if (n.disabled) {
|
|
2337
2337
|
r.preventDefault();
|
|
2338
2338
|
return;
|
|
2339
2339
|
}
|
|
2340
|
-
|
|
2340
|
+
n.external && (n.tag === "a" || !n.tag) || (r.preventDefault(), n.replace ? t.replace(n.to) : t.push(n.to));
|
|
2341
2341
|
}
|
|
2342
2342
|
}), t;
|
|
2343
2343
|
}
|
|
2344
2344
|
export {
|
|
2345
|
-
|
|
2345
|
+
K as GlobalEventBus,
|
|
2346
2346
|
Ce as component,
|
|
2347
2347
|
xe as createStore,
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2348
|
+
je as css,
|
|
2349
|
+
mt as each,
|
|
2350
|
+
bt as emit,
|
|
2351
2351
|
Z as eventBus,
|
|
2352
2352
|
D as html,
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2353
|
+
St as initRouter,
|
|
2354
|
+
kt as listen,
|
|
2355
|
+
Be as match,
|
|
2356
|
+
N as matchRoute,
|
|
2357
|
+
$t as matchRouteSSR,
|
|
2358
|
+
xt as off,
|
|
2359
|
+
vt as on,
|
|
2360
|
+
wt as once,
|
|
2361
2361
|
Ee as parseQuery,
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2362
|
+
ht as resolveRouteComponent,
|
|
2363
|
+
gt as useRouter,
|
|
2364
|
+
yt as when
|
|
2365
2365
|
};
|
|
2366
2366
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|