@jasonshimmy/custom-elements-runtime 0.0.17 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/custom-elements-runtime.cjs.js +4 -4
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +709 -688
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +4 -4
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/runtime.d.ts +4 -1
- package/dist/vdom.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Re(e) {
|
|
2
2
|
let t = new Proxy(e, {
|
|
3
|
-
set: (o,
|
|
3
|
+
set: (o, l, f) => (o[l] = f, s(), !0)
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
|
|
5
|
+
const n = [];
|
|
6
|
+
function r(o) {
|
|
7
|
+
n.push(o), o(t);
|
|
8
8
|
}
|
|
9
9
|
function i() {
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
12
12
|
function s() {
|
|
13
|
-
|
|
13
|
+
n.forEach((o) => o(t));
|
|
14
14
|
}
|
|
15
|
-
return { subscribe:
|
|
15
|
+
return { subscribe: r, getState: i };
|
|
16
16
|
}
|
|
17
|
-
class
|
|
17
|
+
class B extends EventTarget {
|
|
18
18
|
handlers = {};
|
|
19
19
|
static instance;
|
|
20
20
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -22,7 +22,7 @@ class R extends EventTarget {
|
|
|
22
22
|
* Returns the singleton instance of GlobalEventBus
|
|
23
23
|
*/
|
|
24
24
|
static getInstance() {
|
|
25
|
-
return
|
|
25
|
+
return B.instance || (B.instance = new B()), B.instance;
|
|
26
26
|
}
|
|
27
27
|
// Enhanced emit method with better typing and event storm protection
|
|
28
28
|
/**
|
|
@@ -30,16 +30,16 @@ class R extends EventTarget {
|
|
|
30
30
|
* @param eventName - Name of the event
|
|
31
31
|
* @param data - Optional event payload
|
|
32
32
|
*/
|
|
33
|
-
emit(t,
|
|
34
|
-
const
|
|
35
|
-
if (!i ||
|
|
36
|
-
this.eventCounters.set(t, { count: 1, window:
|
|
33
|
+
emit(t, n) {
|
|
34
|
+
const r = Date.now(), i = this.eventCounters.get(t);
|
|
35
|
+
if (!i || r - i.window > 1e3)
|
|
36
|
+
this.eventCounters.set(t, { count: 1, window: r });
|
|
37
37
|
else if (i.count++, i.count > 50 && (console.error(`Event storm detected for "${t}": ${i.count} events in 1 second. Throttling...`), i.count > 100)) {
|
|
38
38
|
console.warn(`Blocking further "${t}" events to prevent infinite loop`);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
this.dispatchEvent(new CustomEvent(t, {
|
|
42
|
-
detail:
|
|
42
|
+
detail: n,
|
|
43
43
|
bubbles: !1,
|
|
44
44
|
// Global events don't need to bubble
|
|
45
45
|
cancelable: !0
|
|
@@ -47,9 +47,9 @@ class R extends EventTarget {
|
|
|
47
47
|
const s = this.handlers[t];
|
|
48
48
|
s && s.forEach((o) => {
|
|
49
49
|
try {
|
|
50
|
-
o(
|
|
51
|
-
} catch (
|
|
52
|
-
console.error(`Error in global event handler for "${t}":`,
|
|
50
|
+
o(n);
|
|
51
|
+
} catch (l) {
|
|
52
|
+
console.error(`Error in global event handler for "${t}":`, l);
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -58,17 +58,17 @@ class R extends EventTarget {
|
|
|
58
58
|
* @param eventName - Name of the event
|
|
59
59
|
* @param handler - Handler function
|
|
60
60
|
*/
|
|
61
|
-
on(t,
|
|
62
|
-
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(
|
|
61
|
+
on(t, n) {
|
|
62
|
+
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(n), () => this.off(t, n);
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Remove a specific handler for a global event.
|
|
66
66
|
* @param eventName - Name of the event
|
|
67
67
|
* @param handler - Handler function to remove
|
|
68
68
|
*/
|
|
69
|
-
off(t,
|
|
70
|
-
const
|
|
71
|
-
|
|
69
|
+
off(t, n) {
|
|
70
|
+
const r = this.handlers[t];
|
|
71
|
+
r && r.delete(n);
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Remove all handlers for a specific event.
|
|
@@ -83,18 +83,18 @@ class R extends EventTarget {
|
|
|
83
83
|
* @param handler - CustomEvent handler
|
|
84
84
|
* @param options - AddEventListener options
|
|
85
85
|
*/
|
|
86
|
-
listen(t,
|
|
87
|
-
return this.addEventListener(t,
|
|
86
|
+
listen(t, n, r) {
|
|
87
|
+
return this.addEventListener(t, n, r), () => this.removeEventListener(t, n);
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
91
91
|
* @param eventName - Name of the event
|
|
92
92
|
* @param handler - Handler function
|
|
93
93
|
*/
|
|
94
|
-
once(t,
|
|
95
|
-
return new Promise((
|
|
94
|
+
once(t, n) {
|
|
95
|
+
return new Promise((r) => {
|
|
96
96
|
const i = this.on(t, (s) => {
|
|
97
|
-
i(),
|
|
97
|
+
i(), n(s), r(s);
|
|
98
98
|
});
|
|
99
99
|
});
|
|
100
100
|
}
|
|
@@ -124,10 +124,10 @@ class R extends EventTarget {
|
|
|
124
124
|
*/
|
|
125
125
|
getEventStats() {
|
|
126
126
|
const t = {};
|
|
127
|
-
for (const [
|
|
128
|
-
t[
|
|
129
|
-
count:
|
|
130
|
-
handlersCount: this.getHandlerCount(
|
|
127
|
+
for (const [n, r] of this.eventCounters.entries())
|
|
128
|
+
t[n] = {
|
|
129
|
+
count: r.count,
|
|
130
|
+
handlersCount: this.getHandlerCount(n)
|
|
131
131
|
};
|
|
132
132
|
return t;
|
|
133
133
|
}
|
|
@@ -138,127 +138,126 @@ class R extends EventTarget {
|
|
|
138
138
|
this.eventCounters.clear();
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
function P(e, t = {},
|
|
143
|
-
const i =
|
|
144
|
-
return { tag: e, key: i, props: t, children:
|
|
141
|
+
const Be = B.getInstance();
|
|
142
|
+
function P(e, t = {}, n, r) {
|
|
143
|
+
const i = r ?? t.key;
|
|
144
|
+
return { tag: e, key: i, props: t, children: n };
|
|
145
145
|
}
|
|
146
146
|
function I(e) {
|
|
147
147
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function R(e) {
|
|
150
150
|
return typeof e == "object" && e !== null && "tag" in e && !I(e);
|
|
151
151
|
}
|
|
152
152
|
function le(e, t) {
|
|
153
153
|
return e.key != null ? e : { ...e, key: t };
|
|
154
154
|
}
|
|
155
|
-
function ce(e, t = [],
|
|
156
|
-
const
|
|
157
|
-
let
|
|
158
|
-
for (;
|
|
159
|
-
const
|
|
160
|
-
let
|
|
161
|
-
if (
|
|
162
|
-
typeof
|
|
163
|
-
else if (
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
} else if (
|
|
167
|
-
const [
|
|
168
|
-
let
|
|
169
|
-
if (
|
|
170
|
-
const b = ["trim", "number", "lazy"],
|
|
171
|
-
let
|
|
172
|
-
const
|
|
173
|
-
for (let
|
|
174
|
-
|
|
175
|
-
|
|
155
|
+
function ce(e, t = [], n = {}) {
|
|
156
|
+
const r = {}, i = {}, s = {}, o = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
157
|
+
let l;
|
|
158
|
+
for (; l = o.exec(e); ) {
|
|
159
|
+
const f = l[1], u = l[2], p = (l[4] || l[6]) ?? "", d = p.match(/^{{(\d+)}}$/);
|
|
160
|
+
let c = d ? t[Number(d[1])] ?? null : p;
|
|
161
|
+
if (d || (c === "true" ? c = !0 : c === "false" ? c = !1 : c === "null" ? c = null : isNaN(Number(c)) || (c = Number(c))), f === ":")
|
|
162
|
+
typeof c == "boolean" ? i[u] = c : c != null && (r[u] = c);
|
|
163
|
+
else if (f === "@") {
|
|
164
|
+
const y = "on" + u.charAt(0).toUpperCase() + u.slice(1);
|
|
165
|
+
r[y] = typeof c == "function" ? c : typeof n[c] == "function" ? n[c] : void 0;
|
|
166
|
+
} else if (f === "#") {
|
|
167
|
+
const [y, ...h] = u.split("."), S = [...h];
|
|
168
|
+
let m = c, a = [...S];
|
|
169
|
+
if (y === "model" && typeof m == "string" && m.includes(".")) {
|
|
170
|
+
const b = ["trim", "number", "lazy"], g = m.split(".");
|
|
171
|
+
let x = m;
|
|
172
|
+
const w = [];
|
|
173
|
+
for (let k = g.length - 1; k > 0 && b.includes(g[k]); k--)
|
|
174
|
+
w.unshift(g[k]), x = g.slice(0, k).join(".");
|
|
175
|
+
m = x, a.push(...w);
|
|
176
176
|
}
|
|
177
|
-
s[
|
|
178
|
-
value:
|
|
179
|
-
modifiers:
|
|
177
|
+
s[y] = {
|
|
178
|
+
value: m,
|
|
179
|
+
modifiers: a
|
|
180
180
|
};
|
|
181
|
-
} else
|
|
182
|
-
i[a] = f;
|
|
181
|
+
} else u === "ref" ? r.ref = c : i[u] = c;
|
|
183
182
|
}
|
|
184
|
-
return { props:
|
|
183
|
+
return { props: r, attrs: i, directives: s };
|
|
185
184
|
}
|
|
186
|
-
function fe(e, t,
|
|
187
|
-
function
|
|
188
|
-
return P("#text", {},
|
|
185
|
+
function fe(e, t, n) {
|
|
186
|
+
function r(a, b) {
|
|
187
|
+
return P("#text", {}, a, b);
|
|
189
188
|
}
|
|
190
189
|
let i = "";
|
|
191
|
-
for (let
|
|
192
|
-
i += e[
|
|
190
|
+
for (let a = 0; a < e.length; a++)
|
|
191
|
+
i += e[a], a < t.length && (i += `{{${a}}}`);
|
|
193
192
|
const s = /<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g, o = [];
|
|
194
|
-
let
|
|
195
|
-
function S(
|
|
196
|
-
!
|
|
197
|
-
if (b === "style" &&
|
|
198
|
-
const
|
|
193
|
+
let l = null, f, u = [], p = null, d = {}, c, y = 0, h = [];
|
|
194
|
+
function S(a) {
|
|
195
|
+
!a || typeof a != "object" || I(a) || (a.props || a.attrs ? (a.props && (d.props || (d.props = {}), Object.assign(d.props, a.props)), a.attrs && (d.attrs || (d.attrs = {}), Object.keys(a.attrs).forEach((b) => {
|
|
196
|
+
if (b === "style" && d.attrs.style) {
|
|
197
|
+
const g = d.attrs.style.replace(
|
|
199
198
|
/;?\s*$/,
|
|
200
199
|
""
|
|
201
|
-
),
|
|
202
|
-
|
|
203
|
-
} else if (b === "class" &&
|
|
204
|
-
const
|
|
205
|
-
.../* @__PURE__ */ new Set([...
|
|
200
|
+
), x = a.attrs.style.replace(/^;?\s*/, "");
|
|
201
|
+
d.attrs.style = g + "; " + x;
|
|
202
|
+
} else if (b === "class" && d.attrs.class) {
|
|
203
|
+
const g = d.attrs.class.trim().split(/\s+/).filter(Boolean), x = a.attrs.class.trim().split(/\s+/).filter(Boolean), w = [
|
|
204
|
+
.../* @__PURE__ */ new Set([...g, ...x])
|
|
206
205
|
];
|
|
207
|
-
|
|
206
|
+
d.attrs.class = w.join(" ");
|
|
208
207
|
} else
|
|
209
|
-
|
|
210
|
-
}))) : (
|
|
211
|
-
}
|
|
212
|
-
function
|
|
213
|
-
const
|
|
214
|
-
if (I(
|
|
215
|
-
const
|
|
216
|
-
let
|
|
217
|
-
|
|
218
|
-
...
|
|
219
|
-
key:
|
|
220
|
-
children:
|
|
208
|
+
d.attrs[b] = a.attrs[b];
|
|
209
|
+
}))) : (d.props || (d.props = {}), Object.assign(d.props, a)));
|
|
210
|
+
}
|
|
211
|
+
function m(a, b) {
|
|
212
|
+
const g = p ? u : h;
|
|
213
|
+
if (I(a)) {
|
|
214
|
+
const x = a.key ?? b;
|
|
215
|
+
let w = a.children;
|
|
216
|
+
g.push({
|
|
217
|
+
...a,
|
|
218
|
+
key: x,
|
|
219
|
+
children: w
|
|
221
220
|
});
|
|
222
221
|
return;
|
|
223
222
|
}
|
|
224
|
-
if (
|
|
225
|
-
|
|
223
|
+
if (R(a)) {
|
|
224
|
+
g.push(le(a, void 0));
|
|
226
225
|
return;
|
|
227
226
|
}
|
|
228
|
-
if (Array.isArray(
|
|
229
|
-
if (
|
|
230
|
-
for (let
|
|
231
|
-
const
|
|
232
|
-
I(
|
|
227
|
+
if (Array.isArray(a)) {
|
|
228
|
+
if (a.length === 0) return;
|
|
229
|
+
for (let x = 0; x < a.length; x++) {
|
|
230
|
+
const w = a[x];
|
|
231
|
+
I(w) || R(w) || Array.isArray(w) ? m(w, `${b}-${x}`) : w !== null && typeof w == "object" ? S(w) : g.push(r(String(w), `${b}-${x}`));
|
|
233
232
|
}
|
|
234
233
|
return;
|
|
235
234
|
}
|
|
236
|
-
if (
|
|
237
|
-
S(
|
|
235
|
+
if (a !== null && typeof a == "object") {
|
|
236
|
+
S(a);
|
|
238
237
|
return;
|
|
239
238
|
}
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
for (;
|
|
243
|
-
if (
|
|
244
|
-
const
|
|
245
|
-
props:
|
|
246
|
-
attrs:
|
|
247
|
-
directives:
|
|
248
|
-
} = ce(
|
|
249
|
-
for (const
|
|
250
|
-
for (const
|
|
251
|
-
for (const [
|
|
252
|
-
if (
|
|
253
|
-
if (typeof
|
|
254
|
-
for (const [A, E] of Object.entries(
|
|
255
|
-
typeof E == "boolean" ?
|
|
256
|
-
else
|
|
257
|
-
else if (
|
|
258
|
-
const A =
|
|
259
|
-
|
|
260
|
-
} else if (
|
|
261
|
-
const A =
|
|
239
|
+
g.push(r(String(a), b));
|
|
240
|
+
}
|
|
241
|
+
for (; f = s.exec(i); )
|
|
242
|
+
if (f[1]) {
|
|
243
|
+
const a = f[1], b = f[0][1] === "/", g = f[0][f[0].length - 2] === "/", {
|
|
244
|
+
props: x,
|
|
245
|
+
attrs: w,
|
|
246
|
+
directives: k
|
|
247
|
+
} = ce(f[2] || "", t, n), $ = { props: {}, attrs: {} };
|
|
248
|
+
for (const v in x) $.props[v] = x[v];
|
|
249
|
+
for (const v in w) $.attrs[v] = w[v];
|
|
250
|
+
for (const [v, _] of Object.entries(k))
|
|
251
|
+
if (v === "bind")
|
|
252
|
+
if (typeof _.value == "object" && _.value !== null)
|
|
253
|
+
for (const [A, E] of Object.entries(_.value))
|
|
254
|
+
typeof E == "boolean" ? $.attrs[A] = E : E != null && ($.attrs[A] = String(E));
|
|
255
|
+
else _.value != null && ($.attrs[v] = String(_.value));
|
|
256
|
+
else if (v === "show") {
|
|
257
|
+
const A = !!_.value;
|
|
258
|
+
$.attrs.style = ($.attrs.style || "") + (A ? "" : "; display: none !important");
|
|
259
|
+
} else if (v === "class") {
|
|
260
|
+
const A = _.value;
|
|
262
261
|
let E = [];
|
|
263
262
|
if (typeof A == "string")
|
|
264
263
|
E = A.split(/\s+/).filter(Boolean);
|
|
@@ -267,20 +266,20 @@ function fe(e, t, r) {
|
|
|
267
266
|
if (typeof j == "string")
|
|
268
267
|
E.push(...j.split(/\s+/).filter(Boolean));
|
|
269
268
|
else if (j && typeof j == "object")
|
|
270
|
-
for (const [L,
|
|
271
|
-
|
|
269
|
+
for (const [L, N] of Object.entries(j))
|
|
270
|
+
N && E.push(...L.split(/\s+/).filter(Boolean));
|
|
272
271
|
} else if (A && typeof A == "object")
|
|
273
272
|
for (const [j, L] of Object.entries(A))
|
|
274
273
|
L && E.push(...j.split(/\s+/).filter(Boolean));
|
|
275
|
-
const
|
|
274
|
+
const M = $.attrs.class || "", O = [
|
|
276
275
|
.../* @__PURE__ */ new Set([
|
|
277
|
-
...
|
|
276
|
+
...M.split(/\s+/).filter(Boolean),
|
|
278
277
|
...E
|
|
279
278
|
])
|
|
280
279
|
];
|
|
281
|
-
|
|
282
|
-
} else if (
|
|
283
|
-
const A =
|
|
280
|
+
$.attrs.class = O.join(" ");
|
|
281
|
+
} else if (v === "style") {
|
|
282
|
+
const A = _.value;
|
|
284
283
|
let E = "";
|
|
285
284
|
if (typeof A == "string")
|
|
286
285
|
E = A;
|
|
@@ -288,7 +287,7 @@ function fe(e, t, r) {
|
|
|
288
287
|
const O = [];
|
|
289
288
|
for (const [j, L] of Object.entries(A))
|
|
290
289
|
if (L != null && L !== "") {
|
|
291
|
-
const
|
|
290
|
+
const N = j.replace(
|
|
292
291
|
/[A-Z]/g,
|
|
293
292
|
(ae) => `-${ae.toLowerCase()}`
|
|
294
293
|
), se = [
|
|
@@ -318,78 +317,78 @@ function fe(e, t, r) {
|
|
|
318
317
|
"max-height"
|
|
319
318
|
];
|
|
320
319
|
let X = String(L);
|
|
321
|
-
typeof L == "number" && se.includes(
|
|
320
|
+
typeof L == "number" && se.includes(N) && (X = `${L}px`), O.push(`${N}: ${X}`);
|
|
322
321
|
}
|
|
323
322
|
E = O.join("; ") + (O.length > 0 ? ";" : "");
|
|
324
323
|
}
|
|
325
|
-
const
|
|
326
|
-
|
|
324
|
+
const M = $.attrs.style || "";
|
|
325
|
+
$.attrs.style = M + (M && !M.endsWith(";") ? "; " : "") + E;
|
|
327
326
|
}
|
|
328
|
-
const
|
|
329
|
-
for (const [
|
|
330
|
-
["bind", "show", "class", "style"].includes(
|
|
331
|
-
if (Object.keys(
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
),
|
|
338
|
-
|
|
339
|
-
} else
|
|
340
|
-
tag:
|
|
341
|
-
props:
|
|
342
|
-
children:
|
|
343
|
-
key:
|
|
344
|
-
}),
|
|
345
|
-
} else if (typeof
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
} else if (
|
|
349
|
-
const
|
|
350
|
-
for (const
|
|
351
|
-
if (!
|
|
352
|
-
const
|
|
353
|
-
if (
|
|
354
|
-
const
|
|
355
|
-
|
|
327
|
+
const C = {};
|
|
328
|
+
for (const [v, _] of Object.entries(k))
|
|
329
|
+
["bind", "show", "class", "style"].includes(v) || (C[v] = _);
|
|
330
|
+
if (Object.keys(C).length > 0 && ($.directives = C), b) {
|
|
331
|
+
const v = P(
|
|
332
|
+
p,
|
|
333
|
+
d,
|
|
334
|
+
u.length === 1 && R(u[0]) && u[0].tag === "#text" ? typeof u[0].children == "string" ? u[0].children : "" : u.length ? u : void 0,
|
|
335
|
+
c
|
|
336
|
+
), _ = o.pop();
|
|
337
|
+
_ ? (p = _.tag, d = _.props, c = _.key, u = _.children, u.push(v)) : l = v;
|
|
338
|
+
} else g ? (p ? u : h).push(P(a, $, void 0, void 0)) : (p && o.push({
|
|
339
|
+
tag: p,
|
|
340
|
+
props: d,
|
|
341
|
+
children: u,
|
|
342
|
+
key: c
|
|
343
|
+
}), p = a, d = $, u = []);
|
|
344
|
+
} else if (typeof f[3] < "u") {
|
|
345
|
+
const a = Number(f[3]), b = t[a], g = `interp-${a}`;
|
|
346
|
+
m(b, g);
|
|
347
|
+
} else if (f[4]) {
|
|
348
|
+
const a = f[4], b = p ? u : h, g = a.split(/({{\d+}})/);
|
|
349
|
+
for (const x of g) {
|
|
350
|
+
if (!x) continue;
|
|
351
|
+
const w = x.match(/^{{(\d+)}}$/);
|
|
352
|
+
if (w) {
|
|
353
|
+
const k = Number(w[1]), $ = t[k], C = `interp-${k}`;
|
|
354
|
+
m($, C);
|
|
356
355
|
} else {
|
|
357
|
-
const
|
|
358
|
-
b.push(
|
|
356
|
+
const k = `text-${y++}`;
|
|
357
|
+
b.push(r(x, k));
|
|
359
358
|
}
|
|
360
359
|
}
|
|
361
360
|
}
|
|
362
|
-
if (
|
|
363
|
-
return
|
|
364
|
-
(
|
|
361
|
+
if (l)
|
|
362
|
+
return R(l) && Array.isArray(l.children) && (l.children = l.children.filter(
|
|
363
|
+
(a) => R(a) ? a.tag !== "#text" || typeof a.children == "string" && a.children.trim() !== "" : !0
|
|
365
364
|
// keep non-element VNodes (including anchors) as-is
|
|
366
|
-
)),
|
|
367
|
-
if (
|
|
368
|
-
const
|
|
369
|
-
(b) =>
|
|
365
|
+
)), l;
|
|
366
|
+
if (h.length > 0) {
|
|
367
|
+
const a = h.filter(
|
|
368
|
+
(b) => R(b) ? b.tag !== "#text" || typeof b.children == "string" && b.children.trim() !== "" : !0
|
|
370
369
|
);
|
|
371
|
-
return
|
|
370
|
+
return a.length === 1 ? a[0] : a;
|
|
372
371
|
}
|
|
373
372
|
return P("div", {}, "", "fallback-root");
|
|
374
373
|
}
|
|
375
|
-
function
|
|
376
|
-
const
|
|
377
|
-
return fe(e, t,
|
|
374
|
+
function Me(e, ...t) {
|
|
375
|
+
const n = t[t.length - 1], r = typeof n == "object" && n && !Array.isArray(n) ? n : void 0;
|
|
376
|
+
return fe(e, t, r);
|
|
378
377
|
}
|
|
379
378
|
function Oe(e, t) {
|
|
380
|
-
return
|
|
379
|
+
return K(e ? t : [], "when-block");
|
|
381
380
|
}
|
|
382
|
-
function
|
|
383
|
-
return e.map((
|
|
384
|
-
const i = typeof
|
|
385
|
-
return
|
|
381
|
+
function Ne(e, t) {
|
|
382
|
+
return e.map((n, r) => {
|
|
383
|
+
const i = typeof n == "object" ? n?.key ?? n?.id ?? `idx-${r}` : String(n);
|
|
384
|
+
return K(t(n, r), `each-${i}`);
|
|
386
385
|
});
|
|
387
386
|
}
|
|
388
387
|
function Pe() {
|
|
389
388
|
const e = [];
|
|
390
389
|
return {
|
|
391
|
-
when(t,
|
|
392
|
-
return e.push([t,
|
|
390
|
+
when(t, n) {
|
|
391
|
+
return e.push([t, n]), this;
|
|
393
392
|
},
|
|
394
393
|
otherwise(t) {
|
|
395
394
|
return e.push([!0, t]), this;
|
|
@@ -401,175 +400,175 @@ function Pe() {
|
|
|
401
400
|
}
|
|
402
401
|
function de(...e) {
|
|
403
402
|
for (let t = 0; t < e.length; t++) {
|
|
404
|
-
const [
|
|
405
|
-
if (
|
|
403
|
+
const [n, r] = e[t];
|
|
404
|
+
if (n) return [K(r, `whenChain-branch-${t}`)];
|
|
406
405
|
}
|
|
407
|
-
return [
|
|
406
|
+
return [K([], "whenChain-empty")];
|
|
408
407
|
}
|
|
409
|
-
function
|
|
410
|
-
const
|
|
408
|
+
function K(e, t) {
|
|
409
|
+
const n = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
411
410
|
return {
|
|
412
411
|
tag: "#anchor",
|
|
413
412
|
key: t,
|
|
414
|
-
children:
|
|
413
|
+
children: n
|
|
415
414
|
};
|
|
416
415
|
}
|
|
417
|
-
function
|
|
418
|
-
return t.split(".").reduce((
|
|
416
|
+
function z(e, t) {
|
|
417
|
+
return t.split(".").reduce((n, r) => n?.[r], e);
|
|
419
418
|
}
|
|
420
|
-
function Y(e, t,
|
|
421
|
-
const
|
|
419
|
+
function Y(e, t, n) {
|
|
420
|
+
const r = t.split("."), i = r.pop();
|
|
422
421
|
if (!i) return;
|
|
423
|
-
const s =
|
|
424
|
-
s[i] =
|
|
422
|
+
const s = r.reduce((o, l) => (l in o || (o[l] = {}), o[l]), e);
|
|
423
|
+
s[i] = n;
|
|
425
424
|
}
|
|
426
|
-
function ue(e, t,
|
|
425
|
+
function ue(e, t, n, r, i, s, o) {
|
|
427
426
|
if (!s) return;
|
|
428
|
-
const
|
|
429
|
-
const
|
|
430
|
-
return
|
|
431
|
-
},
|
|
432
|
-
let
|
|
433
|
-
const
|
|
434
|
-
if (o instanceof HTMLInputElement ?
|
|
435
|
-
if (Array.isArray(
|
|
436
|
-
const
|
|
437
|
-
o && o.checked !==
|
|
427
|
+
const l = t.includes("lazy"), f = t.includes("trim"), u = t.includes("number"), p = () => {
|
|
428
|
+
const m = s._state || s;
|
|
429
|
+
return z(m, e);
|
|
430
|
+
}, d = p();
|
|
431
|
+
let c = "text";
|
|
432
|
+
const y = r?.type;
|
|
433
|
+
if (o instanceof HTMLInputElement ? c = y || o.type || "text" : o instanceof HTMLSelectElement ? c = "select" : o instanceof HTMLTextAreaElement && (c = "textarea"), c === "checkbox")
|
|
434
|
+
if (Array.isArray(d)) {
|
|
435
|
+
const m = o?.getAttribute("value") || r?.value || "", a = d.includes(m);
|
|
436
|
+
o && o.checked !== a && (n.checked = a);
|
|
438
437
|
} else {
|
|
439
|
-
const
|
|
440
|
-
o && o.checked !==
|
|
438
|
+
const m = o?.getAttribute("true-value") || !0, a = d === m;
|
|
439
|
+
o && o.checked !== a && (n.checked = a);
|
|
441
440
|
}
|
|
442
|
-
else if (
|
|
443
|
-
const
|
|
444
|
-
o && o.checked !==
|
|
445
|
-
} else if (
|
|
441
|
+
else if (c === "radio") {
|
|
442
|
+
const m = r?.value || "", a = d === m;
|
|
443
|
+
o && o.checked !== a && (n.checked = a);
|
|
444
|
+
} else if (c === "select")
|
|
446
445
|
if (o && o.hasAttribute("multiple")) {
|
|
447
|
-
const
|
|
446
|
+
const m = o, a = Array.isArray(d) ? d : [];
|
|
448
447
|
setTimeout(() => {
|
|
449
|
-
Array.from(
|
|
450
|
-
const
|
|
451
|
-
b.selected !==
|
|
448
|
+
Array.from(m.options).forEach((b) => {
|
|
449
|
+
const g = a.includes(b.value);
|
|
450
|
+
b.selected !== g && (b.selected = g);
|
|
452
451
|
});
|
|
453
452
|
}, 0);
|
|
454
453
|
} else
|
|
455
454
|
setTimeout(() => {
|
|
456
|
-
o instanceof HTMLSelectElement && o.value !== String(
|
|
455
|
+
o instanceof HTMLSelectElement && o.value !== String(d) && (o.value = String(d));
|
|
457
456
|
}, 0);
|
|
458
457
|
else {
|
|
459
|
-
const
|
|
460
|
-
(!o || o.value !==
|
|
461
|
-
}
|
|
462
|
-
const
|
|
463
|
-
if (
|
|
464
|
-
const
|
|
465
|
-
if (
|
|
466
|
-
const b =
|
|
467
|
-
let
|
|
468
|
-
if (
|
|
458
|
+
const m = String(d ?? "");
|
|
459
|
+
(!o || o.value !== m) && (n.value = d);
|
|
460
|
+
}
|
|
461
|
+
const h = l || c === "checkbox" || c === "radio" || c === "select" ? "change" : "input", S = (m) => {
|
|
462
|
+
if (m.isComposing || i._isComposing || m.isTrusted === !1) return;
|
|
463
|
+
const a = m.target;
|
|
464
|
+
if (a._modelUpdating) return;
|
|
465
|
+
const b = p();
|
|
466
|
+
let g = a.value;
|
|
467
|
+
if (c === "checkbox")
|
|
469
468
|
if (Array.isArray(b)) {
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
|
|
469
|
+
const $ = a.getAttribute("value") || "", C = [...b];
|
|
470
|
+
if (a.checked)
|
|
471
|
+
C.includes($) || C.push($);
|
|
473
472
|
else {
|
|
474
|
-
const
|
|
475
|
-
|
|
473
|
+
const v = C.indexOf($);
|
|
474
|
+
v > -1 && C.splice(v, 1);
|
|
476
475
|
}
|
|
477
|
-
|
|
476
|
+
g = C;
|
|
478
477
|
} else {
|
|
479
|
-
const
|
|
480
|
-
|
|
478
|
+
const $ = a.getAttribute("true-value") || !0, C = a.getAttribute("false-value") || !1;
|
|
479
|
+
g = a.checked ? $ : C;
|
|
481
480
|
}
|
|
482
|
-
else if (
|
|
483
|
-
|
|
484
|
-
else if (
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
(
|
|
481
|
+
else if (c === "radio")
|
|
482
|
+
g = a.getAttribute("value") || a.value;
|
|
483
|
+
else if (c === "select" && a.multiple) {
|
|
484
|
+
const $ = a;
|
|
485
|
+
g = Array.from($.selectedOptions).map(
|
|
486
|
+
(C) => C.value
|
|
488
487
|
);
|
|
489
|
-
} else if (
|
|
490
|
-
const
|
|
491
|
-
isNaN(
|
|
488
|
+
} else if (f && (g = g.trim()), u) {
|
|
489
|
+
const $ = Number(g);
|
|
490
|
+
isNaN($) || (g = $);
|
|
492
491
|
}
|
|
493
|
-
const
|
|
494
|
-
if (Array.isArray(
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
|
|
492
|
+
const x = s._state || s, w = z(x, e);
|
|
493
|
+
if (Array.isArray(g) && Array.isArray(w) ? JSON.stringify([...g].sort()) !== JSON.stringify([...w].sort()) : g !== w) {
|
|
494
|
+
const $ = m.target;
|
|
495
|
+
$._modelUpdating = !0, Y(x, e, g), setTimeout(() => {
|
|
496
|
+
$._modelUpdating = !1;
|
|
498
497
|
}, 0), s._requestRender && s._requestRender();
|
|
499
498
|
}
|
|
500
499
|
};
|
|
501
|
-
if (i[
|
|
502
|
-
const
|
|
500
|
+
if (i[h] = S, c === "text" || c === "textarea") {
|
|
501
|
+
const m = () => {
|
|
503
502
|
i._isComposing = !0;
|
|
504
|
-
},
|
|
503
|
+
}, a = (b) => {
|
|
505
504
|
i._isComposing = !1;
|
|
506
|
-
const
|
|
505
|
+
const g = b.target;
|
|
507
506
|
setTimeout(() => {
|
|
508
|
-
if (
|
|
509
|
-
let
|
|
510
|
-
if (
|
|
511
|
-
const
|
|
512
|
-
isNaN(
|
|
507
|
+
if (g) {
|
|
508
|
+
let x = g.value;
|
|
509
|
+
if (f && (x = x.trim()), u) {
|
|
510
|
+
const C = Number(x);
|
|
511
|
+
isNaN(C) || (x = C);
|
|
513
512
|
}
|
|
514
|
-
const
|
|
515
|
-
(Array.isArray(
|
|
516
|
-
|
|
517
|
-
}, 0)), Y(
|
|
513
|
+
const w = s._state || s, k = z(w, e);
|
|
514
|
+
(Array.isArray(x) && Array.isArray(k) ? JSON.stringify([...x].sort()) !== JSON.stringify([...k].sort()) : x !== k) && (g && (g._modelUpdating = !0, setTimeout(() => {
|
|
515
|
+
g._modelUpdating = !1;
|
|
516
|
+
}, 0)), Y(w, e, x), s._requestRender && s._requestRender());
|
|
518
517
|
}
|
|
519
518
|
}, 0);
|
|
520
519
|
};
|
|
521
|
-
i.compositionstart =
|
|
520
|
+
i.compositionstart = m, i.compositionend = a;
|
|
522
521
|
}
|
|
523
522
|
}
|
|
524
|
-
function
|
|
525
|
-
if (
|
|
523
|
+
function pe(e, t, n, r) {
|
|
524
|
+
if (r)
|
|
526
525
|
try {
|
|
527
526
|
const i = JSON.parse(e);
|
|
528
527
|
if (typeof i == "object")
|
|
529
528
|
for (const [s, o] of Object.entries(i))
|
|
530
529
|
t[s] = o;
|
|
531
530
|
} catch {
|
|
532
|
-
const i =
|
|
533
|
-
|
|
531
|
+
const i = z(r, e);
|
|
532
|
+
n[e] = i;
|
|
534
533
|
}
|
|
535
534
|
}
|
|
536
|
-
function
|
|
537
|
-
if (!
|
|
538
|
-
const
|
|
535
|
+
function he(e, t, n) {
|
|
536
|
+
if (!n) return;
|
|
537
|
+
const r = z(n, e), i = t.style || "", s = r ? "" : "none";
|
|
539
538
|
if (i) {
|
|
540
|
-
const o = i.split(";").filter(Boolean),
|
|
541
|
-
(
|
|
539
|
+
const o = i.split(";").filter(Boolean), l = o.findIndex(
|
|
540
|
+
(f) => f.trim().startsWith("display:")
|
|
542
541
|
);
|
|
543
|
-
|
|
542
|
+
l >= 0 ? o[l] = `display: ${s}` : o.push(`display: ${s}`), t.style = o.join("; ");
|
|
544
543
|
} else
|
|
545
544
|
t.style = `display: ${s}`;
|
|
546
545
|
}
|
|
547
|
-
function ge(e, t,
|
|
548
|
-
if (!
|
|
549
|
-
const
|
|
546
|
+
function ge(e, t, n) {
|
|
547
|
+
if (!n) return;
|
|
548
|
+
const r = z(n, e);
|
|
550
549
|
let i = [];
|
|
551
|
-
typeof
|
|
550
|
+
typeof r == "string" ? i = [r] : Array.isArray(r) ? i = r.filter(Boolean) : typeof r == "object" && (i = Object.entries(r).filter(([, l]) => !!l).map(([l]) => l));
|
|
552
551
|
const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
|
|
553
552
|
o && (t.class = o);
|
|
554
553
|
}
|
|
555
|
-
function
|
|
556
|
-
let
|
|
554
|
+
function ye(e, t, n) {
|
|
555
|
+
let r;
|
|
557
556
|
if (typeof e == "string") {
|
|
558
|
-
if (!
|
|
559
|
-
|
|
557
|
+
if (!n) return;
|
|
558
|
+
r = z(n, e);
|
|
560
559
|
} else
|
|
561
|
-
|
|
560
|
+
r = e;
|
|
562
561
|
let i = "";
|
|
563
|
-
if (typeof
|
|
564
|
-
i =
|
|
565
|
-
else if (
|
|
562
|
+
if (typeof r == "string")
|
|
563
|
+
i = r;
|
|
564
|
+
else if (r && typeof r == "object") {
|
|
566
565
|
const o = [];
|
|
567
|
-
for (const [
|
|
568
|
-
if (
|
|
569
|
-
const
|
|
566
|
+
for (const [l, f] of Object.entries(r))
|
|
567
|
+
if (f != null && f !== "") {
|
|
568
|
+
const u = l.replace(
|
|
570
569
|
/[A-Z]/g,
|
|
571
|
-
(
|
|
572
|
-
),
|
|
570
|
+
(c) => `-${c.toLowerCase()}`
|
|
571
|
+
), p = [
|
|
573
572
|
"width",
|
|
574
573
|
"height",
|
|
575
574
|
"top",
|
|
@@ -595,41 +594,41 @@ function me(e, t, r) {
|
|
|
595
594
|
"min-height",
|
|
596
595
|
"max-height"
|
|
597
596
|
];
|
|
598
|
-
let
|
|
599
|
-
typeof
|
|
597
|
+
let d = String(f);
|
|
598
|
+
typeof f == "number" && p.includes(u) && (d = `${f}px`), o.push(`${u}: ${d}`);
|
|
600
599
|
}
|
|
601
600
|
i = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
602
601
|
}
|
|
603
602
|
const s = t.style || "";
|
|
604
603
|
t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
|
|
605
604
|
}
|
|
606
|
-
function ie(e, t,
|
|
607
|
-
const i = {}, s = { ...
|
|
608
|
-
for (const [
|
|
609
|
-
const { value:
|
|
610
|
-
switch (
|
|
605
|
+
function ie(e, t, n, r) {
|
|
606
|
+
const i = {}, s = { ...r || {} }, o = {};
|
|
607
|
+
for (const [l, f] of Object.entries(e)) {
|
|
608
|
+
const { value: u, modifiers: p } = f;
|
|
609
|
+
switch (l) {
|
|
611
610
|
case "model":
|
|
612
611
|
ue(
|
|
613
|
-
typeof
|
|
614
|
-
|
|
612
|
+
typeof u == "string" ? u : String(u),
|
|
613
|
+
p,
|
|
615
614
|
i,
|
|
616
615
|
s,
|
|
617
616
|
o,
|
|
618
617
|
t,
|
|
619
|
-
|
|
618
|
+
n
|
|
620
619
|
);
|
|
621
620
|
break;
|
|
622
621
|
case "bind":
|
|
623
|
-
|
|
622
|
+
pe(u, i, s, t);
|
|
624
623
|
break;
|
|
625
624
|
case "show":
|
|
626
|
-
|
|
625
|
+
he(u, s, t);
|
|
627
626
|
break;
|
|
628
627
|
case "class":
|
|
629
|
-
ge(
|
|
628
|
+
ge(u, s, t);
|
|
630
629
|
break;
|
|
631
630
|
case "style":
|
|
632
|
-
|
|
631
|
+
ye(u, s, t);
|
|
633
632
|
break;
|
|
634
633
|
}
|
|
635
634
|
}
|
|
@@ -640,274 +639,286 @@ function Z(e, t) {
|
|
|
640
639
|
const s = /* @__PURE__ */ new Set();
|
|
641
640
|
return e.map((o) => {
|
|
642
641
|
if (!o || typeof o != "object") return o;
|
|
643
|
-
let
|
|
644
|
-
if (!
|
|
645
|
-
const
|
|
646
|
-
|
|
642
|
+
let l = o.props?.key ?? o.key;
|
|
643
|
+
if (!l) {
|
|
644
|
+
const d = o.tag || "node", c = o.props?.attrs?.id ?? o.props?.attrs?.name ?? o.props?.attrs?.["data-key"] ?? "";
|
|
645
|
+
l = c ? `${t}:${d}:${c}` : `${t}:${d}`;
|
|
647
646
|
}
|
|
648
|
-
let
|
|
649
|
-
for (; s.has(
|
|
650
|
-
|
|
651
|
-
s.add(
|
|
652
|
-
let
|
|
653
|
-
return Array.isArray(
|
|
647
|
+
let f = l, u = 1;
|
|
648
|
+
for (; s.has(f); )
|
|
649
|
+
f = `${l}#${u++}`;
|
|
650
|
+
s.add(f);
|
|
651
|
+
let p = o.children;
|
|
652
|
+
return Array.isArray(p) && (p = Z(p, f)), { ...o, key: f, children: p };
|
|
654
653
|
});
|
|
655
654
|
}
|
|
656
|
-
const
|
|
657
|
-
let
|
|
658
|
-
return Array.isArray(i) && (i = Z(i,
|
|
655
|
+
const n = e;
|
|
656
|
+
let r = n.props?.key ?? n.key ?? t, i = n.children;
|
|
657
|
+
return Array.isArray(i) && (i = Z(i, r)), { ...n, key: r, children: i };
|
|
659
658
|
}
|
|
660
|
-
function
|
|
661
|
-
const i =
|
|
659
|
+
function me(e, t, n, r) {
|
|
660
|
+
const i = n.directives ?? {}, s = ie(
|
|
662
661
|
i,
|
|
663
|
-
|
|
662
|
+
r,
|
|
664
663
|
e,
|
|
665
|
-
|
|
664
|
+
n.attrs
|
|
666
665
|
), o = {
|
|
667
666
|
...t.props,
|
|
668
|
-
...
|
|
667
|
+
...n.props,
|
|
669
668
|
...s.props
|
|
670
|
-
},
|
|
669
|
+
}, l = {
|
|
671
670
|
...t.attrs,
|
|
672
|
-
...
|
|
671
|
+
...n.attrs,
|
|
673
672
|
...s.attrs
|
|
674
|
-
},
|
|
675
|
-
for (const
|
|
676
|
-
const
|
|
677
|
-
|
|
673
|
+
}, f = t.props ?? {}, u = o;
|
|
674
|
+
for (const c in { ...f, ...u }) {
|
|
675
|
+
const y = f[c], h = u[c];
|
|
676
|
+
y !== h && (c === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== h && (e.value = h ?? "") : c === "checked" && e instanceof HTMLInputElement ? e.checked = !!h : c.startsWith("on") && typeof h == "function" ? (typeof y == "function" && e.removeEventListener(c.slice(2).toLowerCase(), y), e.addEventListener(c.slice(2).toLowerCase(), h)) : h == null || h === !1 ? e.removeAttribute(c) : e.setAttribute(c, String(h)));
|
|
678
677
|
}
|
|
679
|
-
for (const [
|
|
678
|
+
for (const [c, y] of Object.entries(
|
|
680
679
|
s.listeners || {}
|
|
681
680
|
))
|
|
682
|
-
e.addEventListener(
|
|
683
|
-
const
|
|
684
|
-
for (const
|
|
685
|
-
const
|
|
686
|
-
|
|
681
|
+
e.addEventListener(c, y);
|
|
682
|
+
const p = t.attrs ?? {}, d = l;
|
|
683
|
+
for (const c in { ...p, ...d }) {
|
|
684
|
+
const y = p[c], h = d[c];
|
|
685
|
+
y !== h && (h == null || h === !1 ? e.removeAttribute(c) : e.setAttribute(c, String(h)));
|
|
687
686
|
}
|
|
688
687
|
}
|
|
689
|
-
function T(e, t) {
|
|
688
|
+
function T(e, t, n) {
|
|
690
689
|
if (typeof e == "string")
|
|
691
690
|
return document.createTextNode(e);
|
|
692
691
|
if (e.tag === "#text") {
|
|
693
|
-
const
|
|
692
|
+
const d = document.createTextNode(
|
|
694
693
|
typeof e.children == "string" ? e.children : ""
|
|
695
694
|
);
|
|
696
|
-
return e.key != null && (
|
|
695
|
+
return e.key != null && (d.key = e.key), d;
|
|
697
696
|
}
|
|
698
697
|
if (e.tag === "#anchor") {
|
|
699
|
-
const
|
|
700
|
-
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
for (const
|
|
704
|
-
|
|
705
|
-
return
|
|
698
|
+
const d = e, c = Array.isArray(d.children) ? d.children : [], y = document.createTextNode(""), h = document.createTextNode("");
|
|
699
|
+
d.key != null && (y.key = `${d.key}:start`, h.key = `${d.key}:end`), d._startNode = y, d._endNode = h;
|
|
700
|
+
const S = document.createDocumentFragment();
|
|
701
|
+
S.appendChild(y);
|
|
702
|
+
for (const m of c)
|
|
703
|
+
S.appendChild(T(m, t));
|
|
704
|
+
return S.appendChild(h), S;
|
|
706
705
|
}
|
|
707
706
|
const r = document.createElement(e.tag);
|
|
708
707
|
e.key != null && (r.key = e.key);
|
|
709
|
-
const { props:
|
|
710
|
-
...n,
|
|
711
|
-
...o.props
|
|
712
|
-
}, d = {
|
|
708
|
+
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, l = ie(o, t, r, s), f = {
|
|
713
709
|
...i,
|
|
714
|
-
...
|
|
710
|
+
...l.props
|
|
711
|
+
}, u = {
|
|
712
|
+
...s,
|
|
713
|
+
...l.attrs
|
|
715
714
|
};
|
|
716
|
-
for (const
|
|
717
|
-
const
|
|
718
|
-
typeof
|
|
719
|
-
}
|
|
720
|
-
for (const
|
|
721
|
-
const
|
|
722
|
-
if (
|
|
723
|
-
r.value =
|
|
724
|
-
else if (
|
|
725
|
-
r.checked = !!
|
|
726
|
-
else if (
|
|
727
|
-
r.addEventListener(
|
|
715
|
+
for (const d in u) {
|
|
716
|
+
const c = u[d];
|
|
717
|
+
typeof c == "boolean" ? c && r.setAttribute(d, "") : c != null && r.setAttribute(d, String(c));
|
|
718
|
+
}
|
|
719
|
+
for (const d in f) {
|
|
720
|
+
const c = f[d];
|
|
721
|
+
if (d === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement))
|
|
722
|
+
r.value = c ?? "";
|
|
723
|
+
else if (d === "checked" && r instanceof HTMLInputElement)
|
|
724
|
+
r.checked = !!c;
|
|
725
|
+
else if (d.startsWith("on") && typeof c == "function")
|
|
726
|
+
r.addEventListener(d.slice(2).toLowerCase(), c);
|
|
728
727
|
else {
|
|
729
|
-
if (
|
|
728
|
+
if (d.startsWith("on") && c === void 0)
|
|
730
729
|
continue;
|
|
731
|
-
|
|
730
|
+
c == null || c === !1 ? r.removeAttribute(d) : r.setAttribute(d, String(c));
|
|
732
731
|
}
|
|
733
732
|
}
|
|
734
|
-
for (const [
|
|
735
|
-
|
|
733
|
+
for (const [d, c] of Object.entries(
|
|
734
|
+
l.listeners || {}
|
|
736
735
|
))
|
|
737
|
-
r.addEventListener(
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
736
|
+
r.addEventListener(d, c);
|
|
737
|
+
const p = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
738
|
+
if (typeof e != "string" && p && n && (n[p] = r), Array.isArray(e.children))
|
|
739
|
+
for (const d of e.children)
|
|
740
|
+
r.appendChild(T(d, t, n));
|
|
741
741
|
else typeof e.children == "string" && (r.textContent = e.children);
|
|
742
742
|
return r;
|
|
743
743
|
}
|
|
744
|
-
function be(e, t, r,
|
|
745
|
-
if (typeof
|
|
746
|
-
e.textContent !==
|
|
744
|
+
function be(e, t, n, r, i) {
|
|
745
|
+
if (typeof n == "string") {
|
|
746
|
+
e.textContent !== n && (e.textContent = n);
|
|
747
747
|
return;
|
|
748
748
|
}
|
|
749
|
-
if (!Array.isArray(
|
|
750
|
-
const
|
|
751
|
-
for (const
|
|
752
|
-
|
|
753
|
-
const
|
|
754
|
-
for (const
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
}
|
|
758
|
-
const
|
|
759
|
-
let
|
|
760
|
-
function
|
|
761
|
-
let
|
|
762
|
-
for (;
|
|
763
|
-
|
|
764
|
-
}
|
|
765
|
-
function y
|
|
766
|
-
const
|
|
767
|
-
let
|
|
768
|
-
for (;
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
772
|
-
const
|
|
773
|
-
for (const v of
|
|
774
|
-
v && v.key != null &&
|
|
775
|
-
for (const v of
|
|
749
|
+
if (!Array.isArray(n)) return;
|
|
750
|
+
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], l = /* @__PURE__ */ new Map();
|
|
751
|
+
for (const y of o)
|
|
752
|
+
y && y.key != null && l.set(y.key, y);
|
|
753
|
+
const f = /* @__PURE__ */ new Map();
|
|
754
|
+
for (const y of s) {
|
|
755
|
+
const h = y.key;
|
|
756
|
+
h != null && f.set(h, y);
|
|
757
|
+
}
|
|
758
|
+
const u = /* @__PURE__ */ new Set();
|
|
759
|
+
let p = e.firstChild;
|
|
760
|
+
function d(y, h) {
|
|
761
|
+
let S = y;
|
|
762
|
+
for (; S && (u.add(S), S !== h); )
|
|
763
|
+
S = S.nextSibling;
|
|
764
|
+
}
|
|
765
|
+
function c(y, h, S, m) {
|
|
766
|
+
const a = [];
|
|
767
|
+
let b = y.nextSibling;
|
|
768
|
+
for (; b && b !== h; )
|
|
769
|
+
a.push(b), b = b.nextSibling;
|
|
770
|
+
const g = Array.isArray(S) ? S : [];
|
|
771
|
+
if (m.some((w) => w && w.key != null) || g.some((w) => w && w.key != null)) {
|
|
772
|
+
const w = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map();
|
|
773
|
+
for (const v of g)
|
|
774
|
+
v && v.key != null && w.set(v.key, v);
|
|
775
|
+
for (const v of a) {
|
|
776
776
|
const _ = v.key;
|
|
777
|
-
_ != null &&
|
|
777
|
+
_ != null && k.set(_, v);
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
let
|
|
781
|
-
for (const v of
|
|
779
|
+
const $ = /* @__PURE__ */ new Set();
|
|
780
|
+
let C = y.nextSibling;
|
|
781
|
+
for (const v of m) {
|
|
782
782
|
let _;
|
|
783
|
-
if (v.key != null &&
|
|
784
|
-
const
|
|
783
|
+
if (v.key != null && k.has(v.key)) {
|
|
784
|
+
const A = w.get(v.key);
|
|
785
785
|
_ = D(
|
|
786
|
-
|
|
787
|
-
|
|
786
|
+
k.get(v.key),
|
|
787
|
+
A,
|
|
788
788
|
v,
|
|
789
|
-
|
|
790
|
-
),
|
|
789
|
+
r
|
|
790
|
+
), $.add(_), _ !== C && e.contains(_) && e.insertBefore(_, C);
|
|
791
791
|
} else
|
|
792
|
-
_ = T(v,
|
|
793
|
-
|
|
792
|
+
_ = T(v, r), e.insertBefore(_, C), $.add(_);
|
|
793
|
+
C = _.nextSibling;
|
|
794
794
|
}
|
|
795
|
-
for (const v of
|
|
796
|
-
|
|
795
|
+
for (const v of a)
|
|
796
|
+
!$.has(v) && e.contains(v) && e.removeChild(v);
|
|
797
797
|
} else {
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
|
|
798
|
+
const w = Math.min(
|
|
799
|
+
g.length,
|
|
800
|
+
m.length
|
|
801
801
|
);
|
|
802
|
-
for (let
|
|
803
|
-
const
|
|
804
|
-
v !==
|
|
802
|
+
for (let k = 0; k < w; k++) {
|
|
803
|
+
const $ = g[k], C = m[k], v = D(a[k], $, C, r);
|
|
804
|
+
v !== a[k] && (e.insertBefore(v, a[k]), e.removeChild(a[k]));
|
|
805
805
|
}
|
|
806
|
-
for (let
|
|
807
|
-
e.insertBefore(T(
|
|
808
|
-
for (let
|
|
809
|
-
e.removeChild(
|
|
806
|
+
for (let k = w; k < m.length; k++)
|
|
807
|
+
e.insertBefore(T(m[k], r), h);
|
|
808
|
+
for (let k = w; k < a.length; k++)
|
|
809
|
+
e.removeChild(a[k]);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
for (const
|
|
813
|
-
let
|
|
814
|
-
if (
|
|
815
|
-
const
|
|
816
|
-
let
|
|
817
|
-
const
|
|
818
|
-
if (
|
|
819
|
-
e.insertBefore(
|
|
820
|
-
for (const
|
|
821
|
-
e.insertBefore(T(
|
|
822
|
-
e.insertBefore(
|
|
812
|
+
for (const y of n) {
|
|
813
|
+
let h;
|
|
814
|
+
if (y.tag === "#anchor") {
|
|
815
|
+
const S = y.key, m = `${S}:start`, a = `${S}:end`;
|
|
816
|
+
let b = f.get(m), g = f.get(a);
|
|
817
|
+
const x = Array.isArray(y.children) ? y.children : [];
|
|
818
|
+
if (b || (b = document.createTextNode(""), b.key = m), g || (g = document.createTextNode(""), g.key = a), y._startNode = b, y._endNode = g, !e.contains(b) || !e.contains(g)) {
|
|
819
|
+
e.insertBefore(b, p);
|
|
820
|
+
for (const w of x)
|
|
821
|
+
e.insertBefore(T(w, r), p);
|
|
822
|
+
e.insertBefore(g, p);
|
|
823
823
|
} else
|
|
824
|
-
|
|
825
|
-
l,
|
|
824
|
+
c(
|
|
826
825
|
b,
|
|
827
|
-
|
|
828
|
-
|
|
826
|
+
g,
|
|
827
|
+
l.get(S)?.children,
|
|
828
|
+
x
|
|
829
829
|
);
|
|
830
|
-
|
|
830
|
+
d(b, g), p = g.nextSibling;
|
|
831
831
|
continue;
|
|
832
832
|
}
|
|
833
|
-
if (
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
833
|
+
if (y.key != null && f.has(y.key)) {
|
|
834
|
+
const S = l.get(y.key);
|
|
835
|
+
h = D(
|
|
836
|
+
f.get(y.key),
|
|
837
|
+
S,
|
|
838
|
+
y,
|
|
839
|
+
r,
|
|
840
|
+
i
|
|
841
|
+
), u.add(h), h !== p && e.contains(h) && (p && !e.contains(p) && (p = null), e.insertBefore(h, p));
|
|
841
842
|
} else
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
}
|
|
845
|
-
for (const
|
|
846
|
-
!
|
|
843
|
+
h = T(y, r, i), p && !e.contains(p) && (p = null), e.insertBefore(h, p), u.add(h);
|
|
844
|
+
p = h.nextSibling;
|
|
845
|
+
}
|
|
846
|
+
for (const y of s)
|
|
847
|
+
if (!u.has(y) && e.contains(y)) {
|
|
848
|
+
if (y instanceof HTMLElement && i)
|
|
849
|
+
for (const h in i)
|
|
850
|
+
i[h] === y && delete i[h];
|
|
851
|
+
e.removeChild(y);
|
|
852
|
+
}
|
|
847
853
|
}
|
|
848
|
-
function D(e, t, r,
|
|
849
|
-
if (t ===
|
|
850
|
-
if (typeof
|
|
854
|
+
function D(e, t, n, r, i) {
|
|
855
|
+
if (t && typeof t != "string" && t.props?.ref && i && delete i[t.props.ref], t === n) return e;
|
|
856
|
+
if (typeof n == "string") {
|
|
851
857
|
if (e.nodeType === Node.TEXT_NODE)
|
|
852
|
-
return e.textContent !==
|
|
858
|
+
return e.textContent !== n && (e.textContent = n), e;
|
|
853
859
|
{
|
|
854
|
-
const
|
|
855
|
-
return e.parentNode?.replaceChild(
|
|
860
|
+
const o = document.createTextNode(n);
|
|
861
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
856
862
|
}
|
|
857
863
|
}
|
|
858
|
-
if (
|
|
859
|
-
const
|
|
860
|
-
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
for (const
|
|
864
|
-
|
|
865
|
-
return
|
|
864
|
+
if (n && typeof n != "string" && n.tag === "#anchor") {
|
|
865
|
+
const o = n, l = Array.isArray(o.children) ? o.children : [], f = o._startNode ?? document.createTextNode(""), u = o._endNode ?? document.createTextNode("");
|
|
866
|
+
o.key != null && (f.key = `${o.key}:start`, u.key = `${o.key}:end`), o._startNode = f, o._endNode = u;
|
|
867
|
+
const p = document.createDocumentFragment();
|
|
868
|
+
p.appendChild(f);
|
|
869
|
+
for (const d of l)
|
|
870
|
+
p.appendChild(T(d, r));
|
|
871
|
+
return p.appendChild(u), e.parentNode?.replaceChild(p, e), f;
|
|
866
872
|
}
|
|
867
|
-
if (!
|
|
868
|
-
const
|
|
869
|
-
return e.parentNode?.replaceChild(
|
|
873
|
+
if (!n) {
|
|
874
|
+
const o = document.createComment("removed");
|
|
875
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
870
876
|
}
|
|
871
877
|
if (!t || typeof t == "string") {
|
|
872
|
-
const
|
|
873
|
-
return e.parentNode?.replaceChild(
|
|
874
|
-
}
|
|
875
|
-
if (
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
const
|
|
879
|
-
|
|
880
|
-
for (const
|
|
881
|
-
|
|
882
|
-
return
|
|
883
|
-
}
|
|
884
|
-
if (typeof t != "string" && typeof
|
|
885
|
-
const
|
|
886
|
-
return
|
|
887
|
-
}
|
|
888
|
-
const
|
|
889
|
-
return e.parentNode?.replaceChild(
|
|
878
|
+
const o = T(n, r, i);
|
|
879
|
+
return typeof n != "string" && n.props?.ref && i && (i[n.props.ref] = o), e.parentNode?.replaceChild(o, e), o;
|
|
880
|
+
}
|
|
881
|
+
if (n.tag === "#anchor") {
|
|
882
|
+
const o = Array.isArray(n.children) ? n.children : [], l = n._startNode ?? document.createTextNode(""), f = n._endNode ?? document.createTextNode("");
|
|
883
|
+
n.key != null && (l.key = `${n.key}:start`, f.key = `${n.key}:end`), n._startNode = l, n._endNode = f;
|
|
884
|
+
const u = document.createDocumentFragment();
|
|
885
|
+
u.appendChild(l);
|
|
886
|
+
for (const p of o)
|
|
887
|
+
u.appendChild(T(p, r));
|
|
888
|
+
return u.appendChild(f), e.parentNode?.replaceChild(u, e), l;
|
|
889
|
+
}
|
|
890
|
+
if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && t.key === n.key) {
|
|
891
|
+
const o = e;
|
|
892
|
+
return me(o, t.props || {}, n.props || {}, r), be(o, t.children, n.children, r, i), typeof n != "string" && n.props?.ref && i && (i[n.props.ref] = o), o;
|
|
893
|
+
}
|
|
894
|
+
const s = T(n, r, i);
|
|
895
|
+
return typeof n != "string" && n.props?.ref && i && (i[n.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
890
896
|
}
|
|
891
|
-
function xe(e, t, r) {
|
|
892
|
-
const
|
|
893
|
-
let
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
-
let
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
for (let
|
|
900
|
-
const
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
897
|
+
function xe(e, t, n, r) {
|
|
898
|
+
const i = (p) => p.key == null ? { ...p, key: "__root__" } : p;
|
|
899
|
+
let s = Array.isArray(t) ? { tag: "div", key: "__root__", children: t } : i(t);
|
|
900
|
+
s = Z(s, String(s.key ?? "root"));
|
|
901
|
+
const o = e._prevVNode ?? null, l = e._prevDom ?? e.firstChild ?? null;
|
|
902
|
+
let f;
|
|
903
|
+
o && l ? typeof o != "string" && typeof s != "string" && o.tag === s.tag && o.key === s.key ? f = D(l, o, s, n, r) : (f = T(s, n, r), e.replaceChild(f, l)) : (f = T(s, n, r), e.firstChild ? e.replaceChild(f, e.firstChild) : e.appendChild(f));
|
|
904
|
+
const u = [];
|
|
905
|
+
for (let p = 0; p < e.childNodes.length; p++) {
|
|
906
|
+
const d = e.childNodes[p];
|
|
907
|
+
if (d !== f && d.nodeName !== "STYLE") {
|
|
908
|
+
if (d instanceof HTMLElement && r)
|
|
909
|
+
for (const c in r)
|
|
910
|
+
r[c] === d && delete r[c];
|
|
911
|
+
u.push(d);
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
u.forEach((p) => e.removeChild(p)), e._prevVNode = s, e._prevDom = f;
|
|
904
915
|
}
|
|
905
916
|
function oe(e) {
|
|
906
917
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
907
918
|
}
|
|
908
|
-
let
|
|
919
|
+
let H = null;
|
|
909
920
|
function G() {
|
|
910
|
-
return
|
|
921
|
+
return H || (H = new CSSStyleSheet(), H.replaceSync(oe(we))), H;
|
|
911
922
|
}
|
|
912
923
|
function ve(e) {
|
|
913
924
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
@@ -1159,7 +1170,7 @@ const we = `
|
|
|
1159
1170
|
},
|
|
1160
1171
|
white: { DEFAULT: "var(--color-white, #ffffff)" },
|
|
1161
1172
|
black: { DEFAULT: "var(--color-black, #000000)" }
|
|
1162
|
-
},
|
|
1173
|
+
}, F = {
|
|
1163
1174
|
/* Display */
|
|
1164
1175
|
block: "display:block;",
|
|
1165
1176
|
inline: "display:inline;",
|
|
@@ -1352,23 +1363,23 @@ const we = `
|
|
|
1352
1363
|
"2xl": "(min-width:1536px)",
|
|
1353
1364
|
// Dark mode (now plain string)
|
|
1354
1365
|
dark: "(prefers-color-scheme: dark)"
|
|
1355
|
-
},
|
|
1366
|
+
}, V = ["sm", "md", "lg", "xl", "2xl"];
|
|
1356
1367
|
function U(e) {
|
|
1357
|
-
const t = e.startsWith("-"),
|
|
1358
|
-
if (
|
|
1359
|
-
const i =
|
|
1368
|
+
const t = e.startsWith("-"), r = (t ? e.slice(1) : e).split("-");
|
|
1369
|
+
if (r.length < 2) return null;
|
|
1370
|
+
const i = r.slice(0, -1).join("-"), s = r[r.length - 1], o = parseFloat(s);
|
|
1360
1371
|
if (Number.isNaN(o) || !ee[i]) return null;
|
|
1361
|
-
const
|
|
1362
|
-
return ee[i].map((
|
|
1372
|
+
const l = t ? "-" : "";
|
|
1373
|
+
return ee[i].map((f) => `${f}:calc(${l}${_e} * ${o});`).join("");
|
|
1363
1374
|
}
|
|
1364
1375
|
function re(e) {
|
|
1365
|
-
const t = e.replace("#", ""),
|
|
1366
|
-
return `${
|
|
1376
|
+
const t = e.replace("#", ""), n = parseInt(t, 16), r = n >> 16 & 255, i = n >> 8 & 255, s = n & 255;
|
|
1377
|
+
return `${r} ${i} ${s}`;
|
|
1367
1378
|
}
|
|
1368
1379
|
function Se(e) {
|
|
1369
1380
|
const t = /^(bg|text|border|shadow|outline|caret|accent)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1370
1381
|
if (!t) return null;
|
|
1371
|
-
const [,
|
|
1382
|
+
const [, n, r, i = "DEFAULT"] = t, s = ke[r]?.[i];
|
|
1372
1383
|
return s ? `${{
|
|
1373
1384
|
bg: "background-color",
|
|
1374
1385
|
text: "color",
|
|
@@ -1377,40 +1388,40 @@ function Se(e) {
|
|
|
1377
1388
|
outline: "outline-color",
|
|
1378
1389
|
caret: "caret-color",
|
|
1379
1390
|
accent: "accent-color"
|
|
1380
|
-
}[
|
|
1391
|
+
}[n]}:${s};` : null;
|
|
1381
1392
|
}
|
|
1382
1393
|
function Ce(e) {
|
|
1383
|
-
const [t,
|
|
1384
|
-
if (!
|
|
1385
|
-
const
|
|
1386
|
-
return isNaN(
|
|
1394
|
+
const [t, n] = e.split("/");
|
|
1395
|
+
if (!n) return { base: t };
|
|
1396
|
+
const r = parseInt(n, 10);
|
|
1397
|
+
return isNaN(r) || r < 0 || r > 100 ? { base: t } : { base: t, opacity: r / 100 };
|
|
1387
1398
|
}
|
|
1388
1399
|
function q(e) {
|
|
1389
|
-
const { base: t, opacity:
|
|
1390
|
-
if (
|
|
1391
|
-
if (
|
|
1392
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
1400
|
+
const { base: t, opacity: n } = Ce(e), r = Se(t);
|
|
1401
|
+
if (r) {
|
|
1402
|
+
if (n !== void 0) {
|
|
1403
|
+
const s = /#([0-9a-f]{6})/i.exec(r);
|
|
1393
1404
|
if (s) {
|
|
1394
1405
|
const o = re(s[0]);
|
|
1395
|
-
return
|
|
1406
|
+
return r.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
|
|
1396
1407
|
}
|
|
1397
1408
|
}
|
|
1398
|
-
return
|
|
1409
|
+
return r;
|
|
1399
1410
|
}
|
|
1400
|
-
const i =
|
|
1401
|
-
if (i &&
|
|
1411
|
+
const i = W(t);
|
|
1412
|
+
if (i && n !== void 0) {
|
|
1402
1413
|
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
1403
1414
|
if (s) {
|
|
1404
1415
|
const o = re(s[0]);
|
|
1405
|
-
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${
|
|
1416
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
|
|
1406
1417
|
}
|
|
1407
1418
|
}
|
|
1408
1419
|
return i;
|
|
1409
1420
|
}
|
|
1410
|
-
function
|
|
1411
|
-
const t = e.indexOf("-["),
|
|
1412
|
-
if (t > 0 &&
|
|
1413
|
-
const
|
|
1421
|
+
function W(e) {
|
|
1422
|
+
const t = e.indexOf("-["), n = e.endsWith("]");
|
|
1423
|
+
if (t > 0 && n) {
|
|
1424
|
+
const r = e.slice(0, t);
|
|
1414
1425
|
let i = e.slice(t + 2, -1);
|
|
1415
1426
|
i = i.replace(/_/g, " ");
|
|
1416
1427
|
const o = {
|
|
@@ -1452,7 +1463,7 @@ function H(e) {
|
|
|
1452
1463
|
weight: "font-weight",
|
|
1453
1464
|
leading: "line-height",
|
|
1454
1465
|
z: "z-index"
|
|
1455
|
-
}[
|
|
1466
|
+
}[r] ?? r.replace(/_/g, "-");
|
|
1456
1467
|
if (o && i) return `${o}:${i};`;
|
|
1457
1468
|
}
|
|
1458
1469
|
return null;
|
|
@@ -1461,67 +1472,67 @@ function Ae(e) {
|
|
|
1461
1472
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1462
1473
|
}
|
|
1463
1474
|
function Ee(e) {
|
|
1464
|
-
const t = /class\s*=\s*["']([^"']+)["']/g,
|
|
1465
|
-
let
|
|
1466
|
-
for (;
|
|
1475
|
+
const t = /class\s*=\s*["']([^"']+)["']/g, n = [];
|
|
1476
|
+
let r;
|
|
1477
|
+
for (; r = t.exec(e); ) {
|
|
1467
1478
|
let i = "", s = !1;
|
|
1468
|
-
for (const o of
|
|
1469
|
-
o === "[" && (s = !0), o === "]" && (s = !1), o === " " && !s ? (i &&
|
|
1470
|
-
i &&
|
|
1479
|
+
for (const o of r[1])
|
|
1480
|
+
o === "[" && (s = !0), o === "]" && (s = !1), o === " " && !s ? (i && n.push(i), i = "") : i += o;
|
|
1481
|
+
i && n.push(i);
|
|
1471
1482
|
}
|
|
1472
|
-
return
|
|
1483
|
+
return n.filter(Boolean);
|
|
1473
1484
|
}
|
|
1474
1485
|
const ne = /* @__PURE__ */ new Map(), Te = 16;
|
|
1475
1486
|
function je(e) {
|
|
1476
|
-
const t = Date.now(),
|
|
1477
|
-
if (
|
|
1478
|
-
const
|
|
1479
|
-
function
|
|
1480
|
-
const
|
|
1481
|
-
if (
|
|
1482
|
-
const
|
|
1483
|
-
return
|
|
1484
|
-
}
|
|
1485
|
-
function
|
|
1486
|
-
const S =
|
|
1487
|
-
return
|
|
1488
|
-
}
|
|
1489
|
-
function
|
|
1490
|
-
const
|
|
1491
|
-
(
|
|
1487
|
+
const t = Date.now(), n = ne.get(e);
|
|
1488
|
+
if (n && t - n.timestamp < Te) return n.css;
|
|
1489
|
+
const r = Ee(e), i = new Set(r), s = [], o = [], l = [], f = [], u = {};
|
|
1490
|
+
function p(h, S = !1) {
|
|
1491
|
+
const m = (S ? "dark|" : "") + h;
|
|
1492
|
+
if (m in u) return u[m];
|
|
1493
|
+
const a = c(h, S);
|
|
1494
|
+
return u[m] = a, a;
|
|
1495
|
+
}
|
|
1496
|
+
function d(h) {
|
|
1497
|
+
const S = h.some((a) => V.includes(a)), m = h.includes("dark");
|
|
1498
|
+
return h.length === 0 ? 1 : !S && !m ? 2 : S && !m ? 3 : 4;
|
|
1499
|
+
}
|
|
1500
|
+
function c(h, S = !1) {
|
|
1501
|
+
const m = h.split(":"), a = m.find(
|
|
1502
|
+
(_) => F[_] || U(_) || q(_) || W(_)
|
|
1492
1503
|
);
|
|
1493
|
-
if (!
|
|
1494
|
-
const b =
|
|
1504
|
+
if (!a) return null;
|
|
1505
|
+
const b = F[a] ?? U(a) ?? q(a) ?? W(a);
|
|
1495
1506
|
if (!b) return null;
|
|
1496
|
-
let
|
|
1497
|
-
const
|
|
1498
|
-
let
|
|
1499
|
-
S && (
|
|
1500
|
-
const
|
|
1501
|
-
for (const
|
|
1502
|
-
if (
|
|
1503
|
-
const A = $e[
|
|
1504
|
-
typeof A == "function" && (
|
|
1507
|
+
let g = `.${Ae(h)}`, x = b;
|
|
1508
|
+
const w = m.indexOf(a);
|
|
1509
|
+
let k = w >= 0 ? m.slice(0, w) : [];
|
|
1510
|
+
S && (k = k.filter((_) => _ !== "dark"));
|
|
1511
|
+
const $ = k.filter((_) => V.includes(_)), C = $.length ? $[$.length - 1] : null;
|
|
1512
|
+
for (const _ of k) {
|
|
1513
|
+
if (V.includes(_)) continue;
|
|
1514
|
+
const A = $e[_];
|
|
1515
|
+
typeof A == "function" && (g = A(g, x).replace(/\{.*$/, ""));
|
|
1505
1516
|
}
|
|
1506
|
-
let
|
|
1507
|
-
return S &&
|
|
1517
|
+
let v = `${g}{${x}}`;
|
|
1518
|
+
return S && C ? v = `@media (prefers-color-scheme: dark) and ${te[C]}{${v}}` : S ? v = `@media (prefers-color-scheme: dark){${v}}` : C && (v = `@media ${te[C]}{${v}}`), v;
|
|
1508
1519
|
}
|
|
1509
|
-
for (const
|
|
1510
|
-
const S =
|
|
1511
|
-
(
|
|
1520
|
+
for (const h of i) {
|
|
1521
|
+
const S = h.split(":"), m = S.find(
|
|
1522
|
+
(x) => F[x] || U(x) || q(x) || W(x)
|
|
1512
1523
|
);
|
|
1513
|
-
if (!
|
|
1514
|
-
const
|
|
1515
|
-
if (
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1524
|
+
if (!m) continue;
|
|
1525
|
+
const a = S.indexOf(m), b = a >= 0 ? S.slice(0, a) : [], g = d(b);
|
|
1526
|
+
if (g === 4) {
|
|
1527
|
+
const x = p(h, !0);
|
|
1528
|
+
x && f.push(x);
|
|
1518
1529
|
} else {
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1530
|
+
const x = p(h);
|
|
1531
|
+
x && (g === 1 ? s.push(x) : g === 2 ? o.push(x) : g === 3 && l.push(x));
|
|
1521
1532
|
}
|
|
1522
1533
|
}
|
|
1523
|
-
const
|
|
1524
|
-
return ne.set(e, { css:
|
|
1534
|
+
const y = [...s, ...o, ...l, ...f].join("");
|
|
1535
|
+
return ne.set(e, { css: y, timestamp: t }), y;
|
|
1525
1536
|
}
|
|
1526
1537
|
const Le = /* @__PURE__ */ new Map();
|
|
1527
1538
|
function Q(e) {
|
|
@@ -1539,21 +1550,21 @@ function J(e) {
|
|
|
1539
1550
|
})[t]
|
|
1540
1551
|
) : e;
|
|
1541
1552
|
}
|
|
1542
|
-
function
|
|
1543
|
-
let
|
|
1544
|
-
for (let
|
|
1545
|
-
|
|
1546
|
-
return
|
|
1553
|
+
function He(e, ...t) {
|
|
1554
|
+
let n = "";
|
|
1555
|
+
for (let r = 0; r < e.length; r++)
|
|
1556
|
+
n += e[r], r < t.length && (n += t[r]);
|
|
1557
|
+
return n;
|
|
1547
1558
|
}
|
|
1548
|
-
function Ie(e, t,
|
|
1549
|
-
let
|
|
1550
|
-
|
|
1559
|
+
function Ie(e, t, n) {
|
|
1560
|
+
let r = Q(e);
|
|
1561
|
+
r.includes("-") || (r = `cer-${r}`);
|
|
1551
1562
|
let i;
|
|
1552
|
-
typeof t == "function" ? i = { ...
|
|
1553
|
-
console.error(`[${
|
|
1554
|
-
}), Le.set(
|
|
1563
|
+
typeof t == "function" ? i = { ...n, render: t } : i = t, typeof i.onError != "function" && (i.onError = (s, o) => {
|
|
1564
|
+
console.error(`[${r}] Error:`, s, o);
|
|
1565
|
+
}), Le.set(r, i), typeof window < "u" && !customElements.get(r) && customElements.define(r, ze(i));
|
|
1555
1566
|
}
|
|
1556
|
-
function
|
|
1567
|
+
function ze(e) {
|
|
1557
1568
|
if (!e.render)
|
|
1558
1569
|
throw new Error(
|
|
1559
1570
|
"Component must have a render function"
|
|
@@ -1563,6 +1574,7 @@ function Ne(e) {
|
|
|
1563
1574
|
}
|
|
1564
1575
|
} : class extends HTMLElement {
|
|
1565
1576
|
context;
|
|
1577
|
+
_refs = {};
|
|
1566
1578
|
_listeners = [];
|
|
1567
1579
|
_watchers = /* @__PURE__ */ new Map();
|
|
1568
1580
|
/** @internal */
|
|
@@ -1578,9 +1590,17 @@ function Ne(e) {
|
|
|
1578
1590
|
_templateLoading = !1;
|
|
1579
1591
|
_templateError = null;
|
|
1580
1592
|
constructor() {
|
|
1581
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg = e
|
|
1582
|
-
|
|
1583
|
-
|
|
1593
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = e;
|
|
1594
|
+
const t = this._initContext(e);
|
|
1595
|
+
Object.defineProperty(t, "refs", {
|
|
1596
|
+
value: this._refs,
|
|
1597
|
+
writable: !1,
|
|
1598
|
+
enumerable: !1,
|
|
1599
|
+
// Hide from iteration to avoid proxy traps
|
|
1600
|
+
configurable: !1
|
|
1601
|
+
}), this.context = t, Object.keys(e).forEach((n) => {
|
|
1602
|
+
const r = e[n];
|
|
1603
|
+
typeof r == "function" && !n.startsWith("on") && (this.context[n] = (...i) => r(...i, this.context));
|
|
1584
1604
|
}), this._applyProps(e), this._applyComputed(e), this._initializing = !1, this._initWatchers(e), this._render(e);
|
|
1585
1605
|
}
|
|
1586
1606
|
connectedCallback() {
|
|
@@ -1593,12 +1613,12 @@ function Ne(e) {
|
|
|
1593
1613
|
e.onDisconnected && e.onDisconnected(this.context), this._listeners.forEach((t) => t()), this._listeners = [], this._watchers.clear(), this._templateLoading = !1, this._templateError = null, this._mounted = !1;
|
|
1594
1614
|
});
|
|
1595
1615
|
}
|
|
1596
|
-
attributeChangedCallback(t,
|
|
1616
|
+
attributeChangedCallback(t, n, r) {
|
|
1597
1617
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1598
1618
|
this._applyProps(e), e.onAttributeChanged && e.onAttributeChanged(
|
|
1599
1619
|
t,
|
|
1600
|
-
r,
|
|
1601
1620
|
n,
|
|
1621
|
+
r,
|
|
1602
1622
|
this.context
|
|
1603
1623
|
);
|
|
1604
1624
|
});
|
|
@@ -1608,10 +1628,10 @@ function Ne(e) {
|
|
|
1608
1628
|
}
|
|
1609
1629
|
_applyComputed(t) {
|
|
1610
1630
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1611
|
-
t.computed && Object.entries(t.computed).forEach(([
|
|
1612
|
-
Object.defineProperty(this.context,
|
|
1631
|
+
t.computed && Object.entries(t.computed).forEach(([n, r]) => {
|
|
1632
|
+
Object.defineProperty(this.context, n, {
|
|
1613
1633
|
get: () => {
|
|
1614
|
-
const i =
|
|
1634
|
+
const i = r(this.context);
|
|
1615
1635
|
return J(i);
|
|
1616
1636
|
},
|
|
1617
1637
|
enumerable: !0
|
|
@@ -1631,39 +1651,40 @@ function Ne(e) {
|
|
|
1631
1651
|
this._renderOutput(t.errorTemplate(this._templateError, this.context));
|
|
1632
1652
|
return;
|
|
1633
1653
|
}
|
|
1634
|
-
const
|
|
1635
|
-
if (
|
|
1636
|
-
this._templateLoading = !0,
|
|
1637
|
-
if (this._templateLoading = !1, this._templateError =
|
|
1638
|
-
const i = t.errorTemplate(
|
|
1654
|
+
const n = t.render(this.context);
|
|
1655
|
+
if (n instanceof Promise) {
|
|
1656
|
+
this._templateLoading = !0, n.then((r) => (this._templateLoading = !1, this._templateError = null, this._renderOutput(r), r)).catch((r) => {
|
|
1657
|
+
if (this._templateLoading = !1, this._templateError = r, t.errorTemplate) {
|
|
1658
|
+
const i = t.errorTemplate(r, this.context);
|
|
1639
1659
|
return this._renderOutput(i), i;
|
|
1640
1660
|
}
|
|
1641
|
-
throw
|
|
1661
|
+
throw r;
|
|
1642
1662
|
}), t.loadingTemplate && this._renderOutput(t.loadingTemplate(this.context));
|
|
1643
1663
|
return;
|
|
1644
1664
|
}
|
|
1645
|
-
this._renderOutput(
|
|
1665
|
+
this._renderOutput(n), this._applyStyle(t);
|
|
1646
1666
|
});
|
|
1647
1667
|
}
|
|
1648
1668
|
// --- Helper to render output ---
|
|
1649
1669
|
_renderOutput(t) {
|
|
1650
1670
|
if (!this.shadowRoot) return;
|
|
1651
|
-
const
|
|
1652
|
-
get: (
|
|
1653
|
-
set: (
|
|
1671
|
+
const n = new Proxy(this.context, {
|
|
1672
|
+
get: (r, i) => i === "_requestRender" ? () => this._requestRender() : i === "context" ? r : typeof i == "string" && i.includes(".") ? i.split(".").reduce((s, o) => s?.[o], r) : r[i],
|
|
1673
|
+
set: (r, i, s) => {
|
|
1654
1674
|
if (typeof i == "string" && i.includes(".")) {
|
|
1655
|
-
const o = i.split("."),
|
|
1656
|
-
if (!
|
|
1657
|
-
const
|
|
1658
|
-
return
|
|
1675
|
+
const o = i.split("."), l = o.pop();
|
|
1676
|
+
if (!l) return !1;
|
|
1677
|
+
const f = o.reduce((u, p) => (p in u || (u[p] = {}), u[p]), r);
|
|
1678
|
+
return f[l] = s, !0;
|
|
1659
1679
|
}
|
|
1660
|
-
return
|
|
1680
|
+
return r[i] = s, !0;
|
|
1661
1681
|
}
|
|
1662
1682
|
});
|
|
1663
1683
|
xe(
|
|
1664
1684
|
this.shadowRoot,
|
|
1665
1685
|
Array.isArray(t) ? t : [t],
|
|
1666
|
-
|
|
1686
|
+
n,
|
|
1687
|
+
this._refs
|
|
1667
1688
|
), this._lastHtmlStringForJitCSS = this.shadowRoot.innerHTML;
|
|
1668
1689
|
}
|
|
1669
1690
|
_requestRender() {
|
|
@@ -1684,27 +1705,27 @@ function Ne(e) {
|
|
|
1684
1705
|
_applyStyle(t) {
|
|
1685
1706
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1686
1707
|
if (!this.shadowRoot) return;
|
|
1687
|
-
const
|
|
1688
|
-
if (!t.style && (!
|
|
1708
|
+
const n = je(this._lastHtmlStringForJitCSS);
|
|
1709
|
+
if (!t.style && (!n || n.trim() === "")) {
|
|
1689
1710
|
this._styleSheet = null, this.shadowRoot.adoptedStyleSheets = [G()];
|
|
1690
1711
|
return;
|
|
1691
1712
|
}
|
|
1692
|
-
let
|
|
1693
|
-
t.style && (typeof t.style == "string" ?
|
|
1694
|
-
let i = ve(`${
|
|
1695
|
-
${
|
|
1713
|
+
let r = "";
|
|
1714
|
+
t.style && (typeof t.style == "string" ? r = t.style : typeof t.style == "function" && (r = t.style(this.context)));
|
|
1715
|
+
let i = ve(`${r}
|
|
1716
|
+
${n}
|
|
1696
1717
|
`);
|
|
1697
1718
|
i = oe(i), this._styleSheet || (this._styleSheet = new CSSStyleSheet()), (this._styleSheet.cssRules.length === 0 || this._styleSheet.toString() !== i) && this._styleSheet.replaceSync(i), this.shadowRoot.adoptedStyleSheets = [G(), this._styleSheet];
|
|
1698
1719
|
});
|
|
1699
1720
|
}
|
|
1700
1721
|
// --- Error Boundary function ---
|
|
1701
|
-
_runLogicWithinErrorBoundary(t,
|
|
1722
|
+
_runLogicWithinErrorBoundary(t, n) {
|
|
1702
1723
|
this._hasError && (this._hasError = !1);
|
|
1703
1724
|
try {
|
|
1704
|
-
|
|
1705
|
-
} catch (
|
|
1706
|
-
this._hasError = !0, t.onError && t.onError(
|
|
1707
|
-
|
|
1725
|
+
n();
|
|
1726
|
+
} catch (r) {
|
|
1727
|
+
this._hasError = !0, t.onError && t.onError(r, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(
|
|
1728
|
+
r,
|
|
1708
1729
|
this.context
|
|
1709
1730
|
));
|
|
1710
1731
|
}
|
|
@@ -1712,11 +1733,11 @@ ${r}
|
|
|
1712
1733
|
// --- State, props, computed ---
|
|
1713
1734
|
_initContext(t) {
|
|
1714
1735
|
try {
|
|
1715
|
-
let
|
|
1736
|
+
let n = function(i, s = "") {
|
|
1716
1737
|
return Array.isArray(i) ? new Proxy(i, {
|
|
1717
|
-
get(o,
|
|
1718
|
-
const
|
|
1719
|
-
return typeof
|
|
1738
|
+
get(o, l, f) {
|
|
1739
|
+
const u = Reflect.get(o, l, f);
|
|
1740
|
+
return typeof u == "function" && typeof l == "string" && [
|
|
1720
1741
|
"push",
|
|
1721
1742
|
"pop",
|
|
1722
1743
|
"shift",
|
|
@@ -1724,113 +1745,113 @@ ${r}
|
|
|
1724
1745
|
"splice",
|
|
1725
1746
|
"sort",
|
|
1726
1747
|
"reverse"
|
|
1727
|
-
].includes(
|
|
1728
|
-
const
|
|
1729
|
-
if (!
|
|
1730
|
-
const
|
|
1731
|
-
|
|
1748
|
+
].includes(l) ? function(...d) {
|
|
1749
|
+
const c = u.apply(o, d);
|
|
1750
|
+
if (!r._initializing) {
|
|
1751
|
+
const y = s || "root";
|
|
1752
|
+
r._triggerWatchers(y, o), r._render(t);
|
|
1732
1753
|
}
|
|
1733
|
-
return
|
|
1734
|
-
} :
|
|
1754
|
+
return c;
|
|
1755
|
+
} : u;
|
|
1735
1756
|
},
|
|
1736
|
-
set(o,
|
|
1737
|
-
if (o[
|
|
1738
|
-
const
|
|
1739
|
-
|
|
1757
|
+
set(o, l, f) {
|
|
1758
|
+
if (o[l] = f, !r._initializing) {
|
|
1759
|
+
const u = s ? `${s}.${String(l)}` : String(l);
|
|
1760
|
+
r._triggerWatchers(u, f), r._render(t);
|
|
1740
1761
|
}
|
|
1741
1762
|
return !0;
|
|
1742
1763
|
},
|
|
1743
|
-
deleteProperty(o,
|
|
1744
|
-
if (delete o[
|
|
1745
|
-
const
|
|
1746
|
-
|
|
1764
|
+
deleteProperty(o, l) {
|
|
1765
|
+
if (delete o[l], !r._initializing) {
|
|
1766
|
+
const f = s ? `${s}.${String(l)}` : String(l);
|
|
1767
|
+
r._triggerWatchers(f, void 0), r._render(t);
|
|
1747
1768
|
}
|
|
1748
1769
|
return !0;
|
|
1749
1770
|
}
|
|
1750
1771
|
}) : i && typeof i == "object" ? (Object.keys(i).forEach((o) => {
|
|
1751
|
-
const
|
|
1752
|
-
i[o] =
|
|
1772
|
+
const l = s ? `${s}.${o}` : o;
|
|
1773
|
+
i[o] = n(i[o], l);
|
|
1753
1774
|
}), new Proxy(i, {
|
|
1754
|
-
set(o,
|
|
1755
|
-
const
|
|
1756
|
-
return o[
|
|
1757
|
-
|
|
1758
|
-
o[
|
|
1759
|
-
),
|
|
1775
|
+
set(o, l, f) {
|
|
1776
|
+
const u = s ? `${s}.${String(l)}` : String(l);
|
|
1777
|
+
return o[l] = n(f, u), r._initializing || (r._triggerWatchers(
|
|
1778
|
+
u,
|
|
1779
|
+
o[l]
|
|
1780
|
+
), r._render(t)), !0;
|
|
1760
1781
|
},
|
|
1761
|
-
get(o,
|
|
1762
|
-
return Reflect.get(o,
|
|
1782
|
+
get(o, l, f) {
|
|
1783
|
+
return Reflect.get(o, l, f);
|
|
1763
1784
|
}
|
|
1764
1785
|
})) : i;
|
|
1765
1786
|
};
|
|
1766
|
-
const
|
|
1767
|
-
return
|
|
1787
|
+
const r = this;
|
|
1788
|
+
return n({ ...t.state });
|
|
1768
1789
|
} catch {
|
|
1769
1790
|
return {};
|
|
1770
1791
|
}
|
|
1771
1792
|
}
|
|
1772
1793
|
_initWatchers(t) {
|
|
1773
1794
|
if (t.watch)
|
|
1774
|
-
for (const [
|
|
1795
|
+
for (const [n, r] of Object.entries(t.watch)) {
|
|
1775
1796
|
let i, s = {};
|
|
1776
|
-
if (Array.isArray(
|
|
1797
|
+
if (Array.isArray(r) ? (i = r[0], s = r[1] || {}) : i = r, this._watchers.set(n, {
|
|
1777
1798
|
callback: i,
|
|
1778
1799
|
options: s,
|
|
1779
|
-
oldValue: this._getNestedValue(
|
|
1800
|
+
oldValue: this._getNestedValue(n)
|
|
1780
1801
|
}), s.immediate)
|
|
1781
1802
|
try {
|
|
1782
|
-
const o = this._getNestedValue(
|
|
1803
|
+
const o = this._getNestedValue(n);
|
|
1783
1804
|
i(o, void 0, this.context);
|
|
1784
1805
|
} catch (o) {
|
|
1785
|
-
console.error(`Error in immediate watcher for "${
|
|
1806
|
+
console.error(`Error in immediate watcher for "${n}":`, o);
|
|
1786
1807
|
}
|
|
1787
1808
|
}
|
|
1788
1809
|
}
|
|
1789
1810
|
_getNestedValue(t) {
|
|
1790
1811
|
return t.split(".").reduce(
|
|
1791
|
-
(
|
|
1812
|
+
(n, r) => n?.[r],
|
|
1792
1813
|
this.context
|
|
1793
1814
|
);
|
|
1794
1815
|
}
|
|
1795
|
-
_triggerWatchers(t,
|
|
1796
|
-
const
|
|
1816
|
+
_triggerWatchers(t, n) {
|
|
1817
|
+
const r = (s, o) => {
|
|
1797
1818
|
if (s === o) return !0;
|
|
1798
1819
|
if (typeof s != typeof o || typeof s != "object" || s === null || o === null) return !1;
|
|
1799
1820
|
if (Array.isArray(s) && Array.isArray(o))
|
|
1800
|
-
return s.length !== o.length ? !1 : s.every((
|
|
1801
|
-
const
|
|
1802
|
-
return
|
|
1821
|
+
return s.length !== o.length ? !1 : s.every((u, p) => r(u, o[p]));
|
|
1822
|
+
const l = Object.keys(s), f = Object.keys(o);
|
|
1823
|
+
return l.length !== f.length ? !1 : l.every((u) => r(s[u], o[u]));
|
|
1803
1824
|
}, i = this._watchers.get(t);
|
|
1804
|
-
if (i && !n
|
|
1825
|
+
if (i && !r(n, i.oldValue))
|
|
1805
1826
|
try {
|
|
1806
|
-
i.callback(
|
|
1827
|
+
i.callback(n, i.oldValue, this.context), i.oldValue = n;
|
|
1807
1828
|
} catch (s) {
|
|
1808
1829
|
console.error(`Error in watcher for "${t}":`, s);
|
|
1809
1830
|
}
|
|
1810
1831
|
for (const [s, o] of this._watchers.entries())
|
|
1811
1832
|
if (o.options.deep && t.startsWith(s + "."))
|
|
1812
1833
|
try {
|
|
1813
|
-
const
|
|
1814
|
-
|
|
1815
|
-
} catch (
|
|
1816
|
-
console.error(`Error in deep watcher for "${s}":`,
|
|
1834
|
+
const l = this._getNestedValue(s);
|
|
1835
|
+
r(l, o.oldValue) || (o.callback(l, o.oldValue, this.context), o.oldValue = l);
|
|
1836
|
+
} catch (l) {
|
|
1837
|
+
console.error(`Error in deep watcher for "${s}":`, l);
|
|
1817
1838
|
}
|
|
1818
1839
|
}
|
|
1819
1840
|
_applyProps(t) {
|
|
1820
1841
|
try {
|
|
1821
|
-
let
|
|
1822
|
-
return i === Boolean ?
|
|
1842
|
+
let n = function(r, i) {
|
|
1843
|
+
return i === Boolean ? r === "true" : i === Number ? Number(r) : r;
|
|
1823
1844
|
};
|
|
1824
1845
|
if (!t.props) return;
|
|
1825
|
-
Object.entries(t.props).forEach(([
|
|
1826
|
-
const s = this.getAttribute(Q(
|
|
1827
|
-
s !== null ? this.context[
|
|
1828
|
-
|
|
1829
|
-
) : "default" in i && i.default !== void 0 && (this.context[
|
|
1846
|
+
Object.entries(t.props).forEach(([r, i]) => {
|
|
1847
|
+
const s = this.getAttribute(Q(r));
|
|
1848
|
+
s !== null ? this.context[r] = J(
|
|
1849
|
+
n(s, i.type)
|
|
1850
|
+
) : "default" in i && i.default !== void 0 && (this.context[r] = J(i.default));
|
|
1830
1851
|
});
|
|
1831
|
-
} catch (
|
|
1832
|
-
this._hasError = !0, t.onError && t.onError(
|
|
1833
|
-
|
|
1852
|
+
} catch (n) {
|
|
1853
|
+
this._hasError = !0, t.onError && t.onError(n, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(
|
|
1854
|
+
n,
|
|
1834
1855
|
this.context
|
|
1835
1856
|
));
|
|
1836
1857
|
}
|
|
@@ -1839,12 +1860,12 @@ ${r}
|
|
|
1839
1860
|
}
|
|
1840
1861
|
export {
|
|
1841
1862
|
Ie as component,
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1863
|
+
ze as createElementClass,
|
|
1864
|
+
Re as createStore,
|
|
1865
|
+
He as css,
|
|
1866
|
+
Ne as each,
|
|
1867
|
+
Be as eventBus,
|
|
1868
|
+
Me as html,
|
|
1848
1869
|
Pe as match,
|
|
1849
1870
|
Oe as when
|
|
1850
1871
|
};
|