@jasonshimmy/custom-elements-runtime 0.0.10-beta.0 → 0.0.10-beta.1
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 -2
- package/dist/custom-elements-runtime.cjs.js +18 -1
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +1243 -936
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +18 -1
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/runtime.d.ts +2 -3
- package/dist/style-utils.d.ts +3 -94
- package/package.json +5 -5
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
function
|
|
2
|
-
let
|
|
3
|
-
set: (o,
|
|
1
|
+
function Ne(e) {
|
|
2
|
+
let t = new Proxy(e, {
|
|
3
|
+
set: (o, c, d) => (o[c] = d, s(), !0)
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
function r() {
|
|
10
|
-
return e;
|
|
5
|
+
const r = [];
|
|
6
|
+
function n(o) {
|
|
7
|
+
r.push(o), o(t);
|
|
11
8
|
}
|
|
12
9
|
function i() {
|
|
13
|
-
t
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
function s() {
|
|
13
|
+
r.forEach((o) => o(t));
|
|
14
14
|
}
|
|
15
|
-
return { subscribe:
|
|
15
|
+
return { subscribe: n, getState: i };
|
|
16
16
|
}
|
|
17
|
-
class
|
|
17
|
+
class R extends EventTarget {
|
|
18
18
|
handlers = {};
|
|
19
19
|
static instance;
|
|
20
20
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -22,7 +22,7 @@ class j extends EventTarget {
|
|
|
22
22
|
* Returns the singleton instance of GlobalEventBus
|
|
23
23
|
*/
|
|
24
24
|
static getInstance() {
|
|
25
|
-
return
|
|
25
|
+
return R.instance || (R.instance = new R()), R.instance;
|
|
26
26
|
}
|
|
27
27
|
// Enhanced emit method with better typing and event storm protection
|
|
28
28
|
/**
|
|
@@ -30,26 +30,26 @@ class j extends EventTarget {
|
|
|
30
30
|
* @param eventName - Name of the event
|
|
31
31
|
* @param data - Optional event payload
|
|
32
32
|
*/
|
|
33
|
-
emit(
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
this.eventCounters.set(
|
|
37
|
-
else if (
|
|
38
|
-
console.warn(`Blocking further "${
|
|
33
|
+
emit(t, r) {
|
|
34
|
+
const n = Date.now(), i = this.eventCounters.get(t);
|
|
35
|
+
if (!i || n - i.window > 1e3)
|
|
36
|
+
this.eventCounters.set(t, { count: 1, window: n });
|
|
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
|
+
console.warn(`Blocking further "${t}" events to prevent infinite loop`);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
this.dispatchEvent(new CustomEvent(
|
|
42
|
-
detail:
|
|
41
|
+
this.dispatchEvent(new CustomEvent(t, {
|
|
42
|
+
detail: r,
|
|
43
43
|
bubbles: !1,
|
|
44
44
|
// Global events don't need to bubble
|
|
45
45
|
cancelable: !0
|
|
46
46
|
}));
|
|
47
|
-
const
|
|
48
|
-
|
|
47
|
+
const s = this.handlers[t];
|
|
48
|
+
s && s.forEach((o) => {
|
|
49
49
|
try {
|
|
50
|
-
o(
|
|
51
|
-
} catch (
|
|
52
|
-
console.error(`Error in global event handler for "${
|
|
50
|
+
o(r);
|
|
51
|
+
} catch (c) {
|
|
52
|
+
console.error(`Error in global event handler for "${t}":`, c);
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -58,24 +58,24 @@ class j extends EventTarget {
|
|
|
58
58
|
* @param eventName - Name of the event
|
|
59
59
|
* @param handler - Handler function
|
|
60
60
|
*/
|
|
61
|
-
on(
|
|
62
|
-
return this.handlers[
|
|
61
|
+
on(t, r) {
|
|
62
|
+
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(r), () => this.off(t, r);
|
|
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(
|
|
70
|
-
const
|
|
71
|
-
|
|
69
|
+
off(t, r) {
|
|
70
|
+
const n = this.handlers[t];
|
|
71
|
+
n && n.delete(r);
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Remove all handlers for a specific event.
|
|
75
75
|
* @param eventName - Name of the event
|
|
76
76
|
*/
|
|
77
|
-
offAll(
|
|
78
|
-
delete this.handlers[
|
|
77
|
+
offAll(t) {
|
|
78
|
+
delete this.handlers[t];
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Listen for a native CustomEvent. Returns an unsubscribe function.
|
|
@@ -83,18 +83,18 @@ class j extends EventTarget {
|
|
|
83
83
|
* @param handler - CustomEvent handler
|
|
84
84
|
* @param options - AddEventListener options
|
|
85
85
|
*/
|
|
86
|
-
listen(
|
|
87
|
-
return this.addEventListener(
|
|
86
|
+
listen(t, r, n) {
|
|
87
|
+
return this.addEventListener(t, r, n), () => this.removeEventListener(t, r);
|
|
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(
|
|
95
|
-
return new Promise((
|
|
96
|
-
const
|
|
97
|
-
|
|
94
|
+
once(t, r) {
|
|
95
|
+
return new Promise((n) => {
|
|
96
|
+
const i = this.on(t, (s) => {
|
|
97
|
+
i(), r(s), n(s);
|
|
98
98
|
});
|
|
99
99
|
});
|
|
100
100
|
}
|
|
@@ -103,7 +103,7 @@ class j extends EventTarget {
|
|
|
103
103
|
*/
|
|
104
104
|
getActiveEvents() {
|
|
105
105
|
return Object.keys(this.handlers).filter(
|
|
106
|
-
(
|
|
106
|
+
(t) => this.handlers[t] && this.handlers[t].size > 0
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
@@ -116,20 +116,20 @@ class j extends EventTarget {
|
|
|
116
116
|
* Get the number of handlers registered for a specific event.
|
|
117
117
|
* @param eventName - Name of the event
|
|
118
118
|
*/
|
|
119
|
-
getHandlerCount(
|
|
120
|
-
return this.handlers[
|
|
119
|
+
getHandlerCount(t) {
|
|
120
|
+
return this.handlers[t]?.size || 0;
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
123
|
* Get event statistics for debugging.
|
|
124
124
|
*/
|
|
125
125
|
getEventStats() {
|
|
126
|
-
const
|
|
127
|
-
for (const [
|
|
128
|
-
|
|
129
|
-
count:
|
|
130
|
-
handlersCount: this.getHandlerCount(
|
|
126
|
+
const t = {};
|
|
127
|
+
for (const [r, n] of this.eventCounters.entries())
|
|
128
|
+
t[r] = {
|
|
129
|
+
count: n.count,
|
|
130
|
+
handlersCount: this.getHandlerCount(r)
|
|
131
131
|
};
|
|
132
|
-
return
|
|
132
|
+
return t;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* Reset event counters (useful for testing or after resolving issues).
|
|
@@ -138,160 +138,160 @@ class j extends EventTarget {
|
|
|
138
138
|
this.eventCounters.clear();
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
function P(
|
|
143
|
-
const
|
|
144
|
-
return { tag:
|
|
141
|
+
const je = R.getInstance();
|
|
142
|
+
function P(e, t = {}, r, n) {
|
|
143
|
+
const i = n ?? t.key;
|
|
144
|
+
return { tag: e, key: i, props: t, children: r };
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
return !!
|
|
146
|
+
function V(e) {
|
|
147
|
+
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return typeof
|
|
149
|
+
function z(e) {
|
|
150
|
+
return typeof e == "object" && e !== null && "tag" in e && !V(e);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
152
|
+
function oe(e, t) {
|
|
153
|
+
return e.key != null ? e : { ...e, key: t };
|
|
154
154
|
}
|
|
155
|
-
function
|
|
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
|
|
171
|
-
let
|
|
172
|
-
const
|
|
173
|
-
for (let
|
|
174
|
-
|
|
175
|
-
|
|
155
|
+
function se(e, t = [], r = {}) {
|
|
156
|
+
const n = {}, i = {}, s = {}, o = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
157
|
+
let c;
|
|
158
|
+
for (; c = o.exec(e); ) {
|
|
159
|
+
const d = c[1], a = c[2], u = (c[4] || c[6]) ?? "", y = u.match(/^{{(\d+)}}$/);
|
|
160
|
+
let f = y ? t[Number(y[1])] ?? null : u;
|
|
161
|
+
if (y || (f === "true" ? f = !0 : f === "false" ? f = !1 : f === "null" ? f = null : isNaN(Number(f)) || (f = Number(f))), d === ":")
|
|
162
|
+
typeof f == "boolean" ? i[a] = f : f != null && (n[a] = f);
|
|
163
|
+
else if (d === "@") {
|
|
164
|
+
const w = "on" + a.charAt(0).toUpperCase() + a.slice(1);
|
|
165
|
+
n[w] = typeof f == "function" ? f : typeof r[f] == "function" ? r[f] : void 0;
|
|
166
|
+
} else if (d === "#") {
|
|
167
|
+
const [w, ...p] = a.split("."), C = [...p];
|
|
168
|
+
let g = f, l = [...C];
|
|
169
|
+
if (w === "model" && typeof g == "string" && g.includes(".")) {
|
|
170
|
+
const b = ["trim", "number", "lazy"], m = g.split(".");
|
|
171
|
+
let h = g;
|
|
172
|
+
const x = [];
|
|
173
|
+
for (let S = m.length - 1; S > 0 && b.includes(m[S]); S--)
|
|
174
|
+
x.unshift(m[S]), h = m.slice(0, S).join(".");
|
|
175
|
+
g = h, l.push(...x);
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
value:
|
|
179
|
-
modifiers:
|
|
177
|
+
s[w] = {
|
|
178
|
+
value: g,
|
|
179
|
+
modifiers: l
|
|
180
180
|
};
|
|
181
181
|
} else
|
|
182
|
-
|
|
182
|
+
i[a] = f;
|
|
183
183
|
}
|
|
184
|
-
return { props:
|
|
184
|
+
return { props: n, attrs: i, directives: s };
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
function
|
|
188
|
-
return P("#text", {},
|
|
186
|
+
function ae(e, t, r) {
|
|
187
|
+
function n(l, b) {
|
|
188
|
+
return P("#text", {}, l, b);
|
|
189
189
|
}
|
|
190
|
-
let
|
|
191
|
-
for (let
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
let
|
|
195
|
-
function
|
|
196
|
-
!
|
|
197
|
-
if (
|
|
198
|
-
const m =
|
|
190
|
+
let i = "";
|
|
191
|
+
for (let l = 0; l < e.length; l++)
|
|
192
|
+
i += e[l], l < t.length && (i += `{{${l}}}`);
|
|
193
|
+
const s = /<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g, o = [];
|
|
194
|
+
let c = null, d, a = [], u = null, y = {}, f, w = 0, p = [];
|
|
195
|
+
function C(l) {
|
|
196
|
+
!l || typeof l != "object" || V(l) || (l.props || l.attrs ? (l.props && (y.props || (y.props = {}), Object.assign(y.props, l.props)), l.attrs && (y.attrs || (y.attrs = {}), Object.keys(l.attrs).forEach((b) => {
|
|
197
|
+
if (b === "style" && y.attrs.style) {
|
|
198
|
+
const m = y.attrs.style.replace(
|
|
199
199
|
/;?\s*$/,
|
|
200
200
|
""
|
|
201
|
-
),
|
|
202
|
-
|
|
203
|
-
} else if (
|
|
204
|
-
const m =
|
|
205
|
-
.../* @__PURE__ */ new Set([...m, ...
|
|
201
|
+
), h = l.attrs.style.replace(/^;?\s*/, "");
|
|
202
|
+
y.attrs.style = m + "; " + h;
|
|
203
|
+
} else if (b === "class" && y.attrs.class) {
|
|
204
|
+
const m = y.attrs.class.trim().split(/\s+/).filter(Boolean), h = l.attrs.class.trim().split(/\s+/).filter(Boolean), x = [
|
|
205
|
+
.../* @__PURE__ */ new Set([...m, ...h])
|
|
206
206
|
];
|
|
207
|
-
|
|
207
|
+
y.attrs.class = x.join(" ");
|
|
208
208
|
} else
|
|
209
|
-
|
|
210
|
-
}))) : (
|
|
209
|
+
y.attrs[b] = l.attrs[b];
|
|
210
|
+
}))) : (y.props || (y.props = {}), Object.assign(y.props, l)));
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
const m =
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
let
|
|
212
|
+
function g(l, b) {
|
|
213
|
+
const m = u ? a : p;
|
|
214
|
+
if (V(l)) {
|
|
215
|
+
const h = l.key ?? b;
|
|
216
|
+
let x = l.children;
|
|
217
217
|
m.push({
|
|
218
|
-
...
|
|
219
|
-
key:
|
|
220
|
-
children:
|
|
218
|
+
...l,
|
|
219
|
+
key: h,
|
|
220
|
+
children: x
|
|
221
221
|
});
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
if (
|
|
225
|
-
m.push(
|
|
224
|
+
if (z(l)) {
|
|
225
|
+
m.push(oe(l, void 0));
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
|
-
if (Array.isArray(
|
|
229
|
-
if (
|
|
230
|
-
for (let
|
|
231
|
-
const
|
|
232
|
-
|
|
228
|
+
if (Array.isArray(l)) {
|
|
229
|
+
if (l.length === 0) return;
|
|
230
|
+
for (let h = 0; h < l.length; h++) {
|
|
231
|
+
const x = l[h];
|
|
232
|
+
V(x) || z(x) || Array.isArray(x) ? g(x, `${b}-${h}`) : x !== null && typeof x == "object" ? C(x) : m.push(n(String(x), `${b}-${h}`));
|
|
233
233
|
}
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
|
-
if (
|
|
237
|
-
|
|
236
|
+
if (l !== null && typeof l == "object") {
|
|
237
|
+
C(l);
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
m.push(
|
|
240
|
+
m.push(n(String(l), b));
|
|
241
241
|
}
|
|
242
|
-
for (;
|
|
243
|
-
if (
|
|
244
|
-
const
|
|
245
|
-
props:
|
|
246
|
-
attrs:
|
|
247
|
-
directives:
|
|
248
|
-
} =
|
|
249
|
-
for (const
|
|
250
|
-
for (const
|
|
251
|
-
for (const [
|
|
252
|
-
if (
|
|
253
|
-
if (typeof
|
|
254
|
-
for (const [
|
|
255
|
-
typeof
|
|
256
|
-
else
|
|
257
|
-
else if (
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
} else if (
|
|
261
|
-
const
|
|
262
|
-
let
|
|
263
|
-
if (typeof
|
|
264
|
-
|
|
265
|
-
else if (Array.isArray(
|
|
266
|
-
for (const
|
|
267
|
-
if (typeof
|
|
268
|
-
|
|
269
|
-
else if (
|
|
270
|
-
for (const [
|
|
271
|
-
|
|
272
|
-
} else if (
|
|
273
|
-
for (const [
|
|
274
|
-
|
|
275
|
-
const B =
|
|
242
|
+
for (; d = s.exec(i); )
|
|
243
|
+
if (d[1]) {
|
|
244
|
+
const l = d[1], b = d[0][1] === "/", m = d[0][d[0].length - 2] === "/", {
|
|
245
|
+
props: h,
|
|
246
|
+
attrs: x,
|
|
247
|
+
directives: S
|
|
248
|
+
} = se(d[2] || "", t, r), k = { props: {}, attrs: {} };
|
|
249
|
+
for (const _ in h) k.props[_] = h[_];
|
|
250
|
+
for (const _ in x) k.attrs[_] = x[_];
|
|
251
|
+
for (const [_, $] of Object.entries(S))
|
|
252
|
+
if (_ === "bind")
|
|
253
|
+
if (typeof $.value == "object" && $.value !== null)
|
|
254
|
+
for (const [A, E] of Object.entries($.value))
|
|
255
|
+
typeof E == "boolean" ? k.attrs[A] = E : E != null && (k.attrs[A] = String(E));
|
|
256
|
+
else $.value != null && (k.attrs[_] = String($.value));
|
|
257
|
+
else if (_ === "show") {
|
|
258
|
+
const A = !!$.value;
|
|
259
|
+
k.attrs.style = (k.attrs.style || "") + (A ? "" : "; display: none !important");
|
|
260
|
+
} else if (_ === "class") {
|
|
261
|
+
const A = $.value;
|
|
262
|
+
let E = [];
|
|
263
|
+
if (typeof A == "string")
|
|
264
|
+
E = A.split(/\s+/).filter(Boolean);
|
|
265
|
+
else if (Array.isArray(A)) {
|
|
266
|
+
for (const L of A)
|
|
267
|
+
if (typeof L == "string")
|
|
268
|
+
E.push(...L.split(/\s+/).filter(Boolean));
|
|
269
|
+
else if (L && typeof L == "object")
|
|
270
|
+
for (const [N, M] of Object.entries(L))
|
|
271
|
+
M && E.push(...N.split(/\s+/).filter(Boolean));
|
|
272
|
+
} else if (A && typeof A == "object")
|
|
273
|
+
for (const [L, N] of Object.entries(A))
|
|
274
|
+
N && E.push(...L.split(/\s+/).filter(Boolean));
|
|
275
|
+
const B = k.attrs.class || "", O = [
|
|
276
276
|
.../* @__PURE__ */ new Set([
|
|
277
277
|
...B.split(/\s+/).filter(Boolean),
|
|
278
|
-
...
|
|
278
|
+
...E
|
|
279
279
|
])
|
|
280
280
|
];
|
|
281
|
-
|
|
282
|
-
} else if (
|
|
283
|
-
const
|
|
284
|
-
let
|
|
285
|
-
if (typeof
|
|
286
|
-
|
|
287
|
-
else if (
|
|
288
|
-
const
|
|
289
|
-
for (const [
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
281
|
+
k.attrs.class = O.join(" ");
|
|
282
|
+
} else if (_ === "style") {
|
|
283
|
+
const A = $.value;
|
|
284
|
+
let E = "";
|
|
285
|
+
if (typeof A == "string")
|
|
286
|
+
E = A;
|
|
287
|
+
else if (A && typeof A == "object") {
|
|
288
|
+
const O = [];
|
|
289
|
+
for (const [L, N] of Object.entries(A))
|
|
290
|
+
if (N != null && N !== "") {
|
|
291
|
+
const M = L.replace(
|
|
292
292
|
/[A-Z]/g,
|
|
293
|
-
(
|
|
294
|
-
),
|
|
293
|
+
(ie) => `-${ie.toLowerCase()}`
|
|
294
|
+
), ne = [
|
|
295
295
|
"width",
|
|
296
296
|
"height",
|
|
297
297
|
"top",
|
|
@@ -317,259 +317,259 @@ function Q(n, e, t) {
|
|
|
317
317
|
"min-height",
|
|
318
318
|
"max-height"
|
|
319
319
|
];
|
|
320
|
-
let
|
|
321
|
-
typeof
|
|
320
|
+
let Q = String(N);
|
|
321
|
+
typeof N == "number" && ne.includes(M) && (Q = `${N}px`), O.push(`${M}: ${Q}`);
|
|
322
322
|
}
|
|
323
|
-
|
|
323
|
+
E = O.join("; ") + (O.length > 0 ? ";" : "");
|
|
324
324
|
}
|
|
325
|
-
const B =
|
|
326
|
-
|
|
325
|
+
const B = k.attrs.style || "";
|
|
326
|
+
k.attrs.style = B + (B && !B.endsWith(";") ? "; " : "") + E;
|
|
327
327
|
}
|
|
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 m ? (
|
|
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
|
-
k
|
|
328
|
+
const v = {};
|
|
329
|
+
for (const [_, $] of Object.entries(S))
|
|
330
|
+
["bind", "show", "class", "style"].includes(_) || (v[_] = $);
|
|
331
|
+
if (Object.keys(v).length > 0 && (k.directives = v), b) {
|
|
332
|
+
const _ = P(
|
|
333
|
+
u,
|
|
334
|
+
y,
|
|
335
|
+
a.length === 1 && z(a[0]) && a[0].tag === "#text" ? typeof a[0].children == "string" ? a[0].children : "" : a.length ? a : void 0,
|
|
336
|
+
f
|
|
337
|
+
), $ = o.pop();
|
|
338
|
+
$ ? (u = $.tag, y = $.props, f = $.key, a = $.children, a.push(_)) : c = _;
|
|
339
|
+
} else m ? (u ? a : p).push(P(l, k, void 0, void 0)) : (u && o.push({
|
|
340
|
+
tag: u,
|
|
341
|
+
props: y,
|
|
342
|
+
children: a,
|
|
343
|
+
key: f
|
|
344
|
+
}), u = l, y = k, a = []);
|
|
345
|
+
} else if (typeof d[3] < "u") {
|
|
346
|
+
const l = Number(d[3]), b = t[l], m = `interp-${l}`;
|
|
347
|
+
g(b, m);
|
|
348
|
+
} else if (d[4]) {
|
|
349
|
+
const l = d[4], b = u ? a : p, m = l.split(/({{\d+}})/);
|
|
350
|
+
for (const h of m) {
|
|
351
|
+
if (!h) continue;
|
|
352
|
+
const x = h.match(/^{{(\d+)}}$/);
|
|
353
|
+
if (x) {
|
|
354
|
+
const S = Number(x[1]), k = t[S], v = `interp-${S}`;
|
|
355
|
+
g(k, v);
|
|
356
356
|
} else {
|
|
357
|
-
const
|
|
358
|
-
|
|
357
|
+
const S = `text-${w++}`;
|
|
358
|
+
b.push(n(h, S));
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
if (
|
|
363
|
-
return
|
|
364
|
-
(
|
|
362
|
+
if (c)
|
|
363
|
+
return z(c) && Array.isArray(c.children) && (c.children = c.children.filter(
|
|
364
|
+
(l) => z(l) ? l.tag !== "#text" || typeof l.children == "string" && l.children.trim() !== "" : !0
|
|
365
365
|
// keep non-element VNodes (including anchors) as-is
|
|
366
|
-
)),
|
|
367
|
-
if (
|
|
368
|
-
const
|
|
369
|
-
(
|
|
366
|
+
)), c;
|
|
367
|
+
if (p.length > 0) {
|
|
368
|
+
const l = p.filter(
|
|
369
|
+
(b) => z(b) ? b.tag !== "#text" || typeof b.children == "string" && b.children.trim() !== "" : !0
|
|
370
370
|
);
|
|
371
|
-
return
|
|
371
|
+
return l.length === 1 ? l[0] : l;
|
|
372
372
|
}
|
|
373
373
|
return P("div", {}, "", "fallback-root");
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
const
|
|
377
|
-
return
|
|
375
|
+
function ze(e, ...t) {
|
|
376
|
+
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
377
|
+
return ae(e, t, n);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
return H(
|
|
379
|
+
function Re(e, t) {
|
|
380
|
+
return H(e ? t : [], "when-block");
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
return
|
|
384
|
-
const
|
|
385
|
-
return H(
|
|
382
|
+
function Be(e, t) {
|
|
383
|
+
return e.map((r, n) => {
|
|
384
|
+
const i = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
|
|
385
|
+
return H(t(r, n), `each-${i}`);
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
const
|
|
388
|
+
function Oe() {
|
|
389
|
+
const e = [];
|
|
390
390
|
return {
|
|
391
|
-
when(
|
|
392
|
-
return
|
|
391
|
+
when(t, r) {
|
|
392
|
+
return e.push([t, r]), this;
|
|
393
393
|
},
|
|
394
|
-
otherwise(
|
|
395
|
-
return
|
|
394
|
+
otherwise(t) {
|
|
395
|
+
return e.push([!0, t]), this;
|
|
396
396
|
},
|
|
397
397
|
done() {
|
|
398
|
-
return
|
|
398
|
+
return le(...e);
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
|
-
function
|
|
403
|
-
for (let
|
|
404
|
-
const [
|
|
405
|
-
if (
|
|
402
|
+
function le(...e) {
|
|
403
|
+
for (let t = 0; t < e.length; t++) {
|
|
404
|
+
const [r, n] = e[t];
|
|
405
|
+
if (r) return [H(n, `whenChain-branch-${t}`)];
|
|
406
406
|
}
|
|
407
407
|
return [H([], "whenChain-empty")];
|
|
408
408
|
}
|
|
409
|
-
function H(
|
|
410
|
-
const
|
|
409
|
+
function H(e, t) {
|
|
410
|
+
const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
411
411
|
return {
|
|
412
412
|
tag: "#anchor",
|
|
413
|
-
key:
|
|
414
|
-
children:
|
|
413
|
+
key: t,
|
|
414
|
+
children: r
|
|
415
415
|
};
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
return
|
|
419
|
-
}
|
|
420
|
-
function U(n, e, t) {
|
|
421
|
-
const s = e.split("."), r = s.pop();
|
|
422
|
-
if (!r) return;
|
|
423
|
-
const i = s.reduce((o, l) => (l in o || (o[l] = {}), o[l]), n);
|
|
424
|
-
i[r] = t;
|
|
417
|
+
function j(e, t) {
|
|
418
|
+
return t.split(".").reduce((r, n) => r?.[n], e);
|
|
425
419
|
}
|
|
426
|
-
function
|
|
420
|
+
function X(e, t, r) {
|
|
421
|
+
const n = t.split("."), i = n.pop();
|
|
427
422
|
if (!i) return;
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
423
|
+
const s = n.reduce((o, c) => (c in o || (o[c] = {}), o[c]), e);
|
|
424
|
+
s[i] = r;
|
|
425
|
+
}
|
|
426
|
+
function ce(e, t, r, n, i, s, o) {
|
|
427
|
+
if (!s) return;
|
|
428
|
+
const c = t.includes("lazy"), d = t.includes("trim"), a = t.includes("number"), u = () => {
|
|
429
|
+
const g = s._state || s;
|
|
430
|
+
return j(g, e);
|
|
431
|
+
}, y = u();
|
|
432
|
+
let f = "text";
|
|
433
|
+
const w = n?.type;
|
|
434
|
+
if (o instanceof HTMLInputElement ? f = w || o.type || "text" : o instanceof HTMLSelectElement ? f = "select" : o instanceof HTMLTextAreaElement && (f = "textarea"), f === "checkbox")
|
|
435
|
+
if (Array.isArray(y)) {
|
|
436
|
+
const g = o?.getAttribute("value") || n?.value || "", l = y.includes(g);
|
|
437
|
+
o && o.checked !== l && (r.checked = l);
|
|
438
438
|
} else {
|
|
439
|
-
const
|
|
440
|
-
o && o.checked !==
|
|
439
|
+
const g = o?.getAttribute("true-value") || !0, l = y === g;
|
|
440
|
+
o && o.checked !== l && (r.checked = l);
|
|
441
441
|
}
|
|
442
|
-
else if (
|
|
443
|
-
const
|
|
444
|
-
o && o.checked !==
|
|
445
|
-
} else if (
|
|
442
|
+
else if (f === "radio") {
|
|
443
|
+
const g = n?.value || "", l = y === g;
|
|
444
|
+
o && o.checked !== l && (r.checked = l);
|
|
445
|
+
} else if (f === "select")
|
|
446
446
|
if (o && o.hasAttribute("multiple")) {
|
|
447
|
-
const
|
|
447
|
+
const g = o, l = Array.isArray(y) ? y : [];
|
|
448
448
|
setTimeout(() => {
|
|
449
|
-
Array.from(
|
|
450
|
-
const m =
|
|
451
|
-
|
|
449
|
+
Array.from(g.options).forEach((b) => {
|
|
450
|
+
const m = l.includes(b.value);
|
|
451
|
+
b.selected !== m && (b.selected = m);
|
|
452
452
|
});
|
|
453
453
|
}, 0);
|
|
454
454
|
} else
|
|
455
455
|
setTimeout(() => {
|
|
456
|
-
o instanceof HTMLSelectElement && o.value !== String(
|
|
456
|
+
o instanceof HTMLSelectElement && o.value !== String(y) && (o.value = String(y));
|
|
457
457
|
}, 0);
|
|
458
458
|
else {
|
|
459
|
-
const
|
|
460
|
-
(!o || o.value !==
|
|
459
|
+
const g = String(y ?? "");
|
|
460
|
+
(!o || o.value !== g) && (r.value = y);
|
|
461
461
|
}
|
|
462
|
-
const
|
|
463
|
-
if (
|
|
464
|
-
const
|
|
465
|
-
if (
|
|
466
|
-
const
|
|
467
|
-
let m =
|
|
468
|
-
if (
|
|
469
|
-
if (Array.isArray(
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
|
|
462
|
+
const p = c || f === "checkbox" || f === "radio" || f === "select" ? "change" : "input", C = (g) => {
|
|
463
|
+
if (g.isComposing || i._isComposing || g.isTrusted === !1) return;
|
|
464
|
+
const l = g.target;
|
|
465
|
+
if (l._modelUpdating) return;
|
|
466
|
+
const b = u();
|
|
467
|
+
let m = l.value;
|
|
468
|
+
if (f === "checkbox")
|
|
469
|
+
if (Array.isArray(b)) {
|
|
470
|
+
const k = l.getAttribute("value") || "", v = [...b];
|
|
471
|
+
if (l.checked)
|
|
472
|
+
v.includes(k) || v.push(k);
|
|
473
473
|
else {
|
|
474
|
-
const
|
|
475
|
-
|
|
474
|
+
const _ = v.indexOf(k);
|
|
475
|
+
_ > -1 && v.splice(_, 1);
|
|
476
476
|
}
|
|
477
|
-
m =
|
|
477
|
+
m = v;
|
|
478
478
|
} else {
|
|
479
|
-
const
|
|
480
|
-
m =
|
|
479
|
+
const k = l.getAttribute("true-value") || !0, v = l.getAttribute("false-value") || !1;
|
|
480
|
+
m = l.checked ? k : v;
|
|
481
481
|
}
|
|
482
|
-
else if (
|
|
483
|
-
m =
|
|
484
|
-
else if (
|
|
485
|
-
const
|
|
486
|
-
m = Array.from(
|
|
487
|
-
(
|
|
482
|
+
else if (f === "radio")
|
|
483
|
+
m = l.getAttribute("value") || l.value;
|
|
484
|
+
else if (f === "select" && l.multiple) {
|
|
485
|
+
const k = l;
|
|
486
|
+
m = Array.from(k.selectedOptions).map(
|
|
487
|
+
(v) => v.value
|
|
488
488
|
);
|
|
489
|
-
} else if (
|
|
490
|
-
const
|
|
491
|
-
isNaN(
|
|
489
|
+
} else if (d && (m = m.trim()), a) {
|
|
490
|
+
const k = Number(m);
|
|
491
|
+
isNaN(k) || (m = k);
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
if (Array.isArray(m) && Array.isArray(
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}, 0),
|
|
493
|
+
const h = s._state || s, x = j(h, e);
|
|
494
|
+
if (Array.isArray(m) && Array.isArray(x) ? JSON.stringify([...m].sort()) !== JSON.stringify([...x].sort()) : m !== x) {
|
|
495
|
+
const k = g.target;
|
|
496
|
+
k._modelUpdating = !0, X(h, e, m), setTimeout(() => {
|
|
497
|
+
k._modelUpdating = !1;
|
|
498
|
+
}, 0), s._requestRender && s._requestRender();
|
|
499
499
|
}
|
|
500
500
|
};
|
|
501
|
-
if (
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
},
|
|
505
|
-
|
|
506
|
-
const m =
|
|
501
|
+
if (i[p] = C, f === "text" || f === "textarea") {
|
|
502
|
+
const g = () => {
|
|
503
|
+
i._isComposing = !0;
|
|
504
|
+
}, l = (b) => {
|
|
505
|
+
i._isComposing = !1;
|
|
506
|
+
const m = b.target;
|
|
507
507
|
setTimeout(() => {
|
|
508
508
|
if (m) {
|
|
509
|
-
let
|
|
510
|
-
if (
|
|
511
|
-
const
|
|
512
|
-
isNaN(
|
|
509
|
+
let h = m.value;
|
|
510
|
+
if (d && (h = h.trim()), a) {
|
|
511
|
+
const v = Number(h);
|
|
512
|
+
isNaN(v) || (h = v);
|
|
513
513
|
}
|
|
514
|
-
const
|
|
515
|
-
(Array.isArray(
|
|
514
|
+
const x = s._state || s, S = j(x, e);
|
|
515
|
+
(Array.isArray(h) && Array.isArray(S) ? JSON.stringify([...h].sort()) !== JSON.stringify([...S].sort()) : h !== S) && (m && (m._modelUpdating = !0, setTimeout(() => {
|
|
516
516
|
m._modelUpdating = !1;
|
|
517
|
-
}, 0)),
|
|
517
|
+
}, 0)), X(x, e, h), s._requestRender && s._requestRender());
|
|
518
518
|
}
|
|
519
519
|
}, 0);
|
|
520
520
|
};
|
|
521
|
-
|
|
521
|
+
i.compositionstart = g, i.compositionend = l;
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
if (
|
|
524
|
+
function fe(e, t, r, n) {
|
|
525
|
+
if (n)
|
|
526
526
|
try {
|
|
527
|
-
const
|
|
528
|
-
if (typeof
|
|
529
|
-
for (const [
|
|
530
|
-
|
|
527
|
+
const i = JSON.parse(e);
|
|
528
|
+
if (typeof i == "object")
|
|
529
|
+
for (const [s, o] of Object.entries(i))
|
|
530
|
+
t[s] = o;
|
|
531
531
|
} catch {
|
|
532
|
-
const
|
|
533
|
-
|
|
532
|
+
const i = j(n, e);
|
|
533
|
+
r[e] = i;
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
if (!
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
const o =
|
|
541
|
-
(
|
|
536
|
+
function de(e, t, r) {
|
|
537
|
+
if (!r) return;
|
|
538
|
+
const n = j(r, e), i = t.style || "", s = n ? "" : "none";
|
|
539
|
+
if (i) {
|
|
540
|
+
const o = i.split(";").filter(Boolean), c = o.findIndex(
|
|
541
|
+
(d) => d.trim().startsWith("display:")
|
|
542
542
|
);
|
|
543
|
-
|
|
543
|
+
c >= 0 ? o[c] = `display: ${s}` : o.push(`display: ${s}`), t.style = o.join("; ");
|
|
544
544
|
} else
|
|
545
|
-
|
|
545
|
+
t.style = `display: ${s}`;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
if (!
|
|
549
|
-
const
|
|
550
|
-
let
|
|
551
|
-
typeof
|
|
552
|
-
const
|
|
553
|
-
o && (
|
|
547
|
+
function ue(e, t, r) {
|
|
548
|
+
if (!r) return;
|
|
549
|
+
const n = j(r, e);
|
|
550
|
+
let i = [];
|
|
551
|
+
typeof n == "string" ? i = [n] : Array.isArray(n) ? i = n.filter(Boolean) : typeof n == "object" && (i = Object.entries(n).filter(([, c]) => !!c).map(([c]) => c));
|
|
552
|
+
const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
|
|
553
|
+
o && (t.class = o);
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
let
|
|
557
|
-
if (typeof
|
|
558
|
-
if (!
|
|
559
|
-
|
|
555
|
+
function he(e, t, r) {
|
|
556
|
+
let n;
|
|
557
|
+
if (typeof e == "string") {
|
|
558
|
+
if (!r) return;
|
|
559
|
+
n = j(r, e);
|
|
560
560
|
} else
|
|
561
|
-
|
|
562
|
-
let
|
|
563
|
-
if (typeof
|
|
564
|
-
|
|
565
|
-
else if (
|
|
561
|
+
n = e;
|
|
562
|
+
let i = "";
|
|
563
|
+
if (typeof n == "string")
|
|
564
|
+
i = n;
|
|
565
|
+
else if (n && typeof n == "object") {
|
|
566
566
|
const o = [];
|
|
567
|
-
for (const [
|
|
568
|
-
if (
|
|
569
|
-
const
|
|
567
|
+
for (const [c, d] of Object.entries(n))
|
|
568
|
+
if (d != null && d !== "") {
|
|
569
|
+
const a = c.replace(
|
|
570
570
|
/[A-Z]/g,
|
|
571
|
-
(
|
|
572
|
-
),
|
|
571
|
+
(f) => `-${f.toLowerCase()}`
|
|
572
|
+
), u = [
|
|
573
573
|
"width",
|
|
574
574
|
"height",
|
|
575
575
|
"top",
|
|
@@ -595,473 +595,841 @@ function re(n, e, t) {
|
|
|
595
595
|
"min-height",
|
|
596
596
|
"max-height"
|
|
597
597
|
];
|
|
598
|
-
let
|
|
599
|
-
typeof
|
|
598
|
+
let y = String(d);
|
|
599
|
+
typeof d == "number" && u.includes(a) && (y = `${d}px`), o.push(`${a}: ${y}`);
|
|
600
600
|
}
|
|
601
|
-
|
|
601
|
+
i = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
602
602
|
}
|
|
603
|
-
const
|
|
604
|
-
|
|
603
|
+
const s = t.style || "";
|
|
604
|
+
t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
const
|
|
608
|
-
for (const [
|
|
609
|
-
const { value:
|
|
610
|
-
switch (
|
|
606
|
+
function re(e, t, r, n) {
|
|
607
|
+
const i = {}, s = { ...n || {} }, o = {};
|
|
608
|
+
for (const [c, d] of Object.entries(e)) {
|
|
609
|
+
const { value: a, modifiers: u } = d;
|
|
610
|
+
switch (c) {
|
|
611
611
|
case "model":
|
|
612
|
-
|
|
613
|
-
typeof
|
|
614
|
-
|
|
615
|
-
r,
|
|
612
|
+
ce(
|
|
613
|
+
typeof a == "string" ? a : String(a),
|
|
614
|
+
u,
|
|
616
615
|
i,
|
|
616
|
+
s,
|
|
617
617
|
o,
|
|
618
|
-
|
|
619
|
-
|
|
618
|
+
t,
|
|
619
|
+
r
|
|
620
620
|
);
|
|
621
621
|
break;
|
|
622
622
|
case "bind":
|
|
623
|
-
|
|
623
|
+
fe(a, i, s, t);
|
|
624
624
|
break;
|
|
625
625
|
case "show":
|
|
626
|
-
|
|
626
|
+
de(a, s, t);
|
|
627
627
|
break;
|
|
628
628
|
case "class":
|
|
629
|
-
|
|
629
|
+
ue(a, s, t);
|
|
630
630
|
break;
|
|
631
631
|
case "style":
|
|
632
|
-
|
|
632
|
+
he(a, s, t);
|
|
633
633
|
break;
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
return { props:
|
|
636
|
+
return { props: i, attrs: s, listeners: o };
|
|
637
637
|
}
|
|
638
|
-
function
|
|
639
|
-
if (Array.isArray(
|
|
640
|
-
const
|
|
641
|
-
return
|
|
638
|
+
function J(e, t) {
|
|
639
|
+
if (Array.isArray(e)) {
|
|
640
|
+
const s = /* @__PURE__ */ new Set();
|
|
641
|
+
return e.map((o) => {
|
|
642
642
|
if (!o || typeof o != "object") return o;
|
|
643
|
-
let
|
|
644
|
-
if (!
|
|
645
|
-
const
|
|
646
|
-
|
|
643
|
+
let c = o.props?.key ?? o.key;
|
|
644
|
+
if (!c) {
|
|
645
|
+
const y = o.tag || "node", f = o.props?.attrs?.id ?? o.props?.attrs?.name ?? o.props?.attrs?.["data-key"] ?? "";
|
|
646
|
+
c = f ? `${t}:${y}:${f}` : `${t}:${y}`;
|
|
647
647
|
}
|
|
648
|
-
let
|
|
649
|
-
for (;
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
let
|
|
653
|
-
return Array.isArray(
|
|
648
|
+
let d = c, a = 1;
|
|
649
|
+
for (; s.has(d); )
|
|
650
|
+
d = `${c}#${a++}`;
|
|
651
|
+
s.add(d);
|
|
652
|
+
let u = o.children;
|
|
653
|
+
return Array.isArray(u) && (u = J(u, d)), { ...o, key: d, children: u };
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
const
|
|
657
|
-
let
|
|
658
|
-
return Array.isArray(
|
|
656
|
+
const r = e;
|
|
657
|
+
let n = r.props?.key ?? r.key ?? t, i = r.children;
|
|
658
|
+
return Array.isArray(i) && (i = J(i, n)), { ...r, key: n, children: i };
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
const
|
|
662
|
-
|
|
663
|
-
s,
|
|
660
|
+
function pe(e, t, r, n) {
|
|
661
|
+
const i = r.directives ?? {}, s = re(
|
|
662
|
+
i,
|
|
664
663
|
n,
|
|
665
|
-
|
|
664
|
+
e,
|
|
665
|
+
r.attrs
|
|
666
666
|
), o = {
|
|
667
|
-
...e.props,
|
|
668
667
|
...t.props,
|
|
669
|
-
...
|
|
670
|
-
|
|
671
|
-
|
|
668
|
+
...r.props,
|
|
669
|
+
...s.props
|
|
670
|
+
}, c = {
|
|
672
671
|
...t.attrs,
|
|
673
|
-
...
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
672
|
+
...r.attrs,
|
|
673
|
+
...s.attrs
|
|
674
|
+
}, d = t.props ?? {}, a = o;
|
|
675
|
+
for (const f in { ...d, ...a }) {
|
|
676
|
+
const w = d[f], p = a[f];
|
|
677
|
+
w !== p && (f === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== p && (e.value = p ?? "") : f === "checked" && e instanceof HTMLInputElement ? e.checked = !!p : f.startsWith("on") && typeof p == "function" ? (typeof w == "function" && e.removeEventListener(f.slice(2).toLowerCase(), w), e.addEventListener(f.slice(2).toLowerCase(), p)) : p == null || p === !1 ? e.removeAttribute(f) : e.setAttribute(f, String(p)));
|
|
678
678
|
}
|
|
679
|
-
for (const [
|
|
680
|
-
|
|
679
|
+
for (const [f, w] of Object.entries(
|
|
680
|
+
s.listeners || {}
|
|
681
681
|
))
|
|
682
|
-
|
|
683
|
-
const
|
|
684
|
-
for (const
|
|
685
|
-
const
|
|
686
|
-
|
|
682
|
+
e.addEventListener(f, w);
|
|
683
|
+
const u = t.attrs ?? {}, y = c;
|
|
684
|
+
for (const f in { ...u, ...y }) {
|
|
685
|
+
const w = u[f], p = y[f];
|
|
686
|
+
w !== p && (p == null || p === !1 ? e.removeAttribute(f) : e.setAttribute(f, String(p)));
|
|
687
687
|
}
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
if (typeof
|
|
691
|
-
return document.createTextNode(
|
|
692
|
-
if (
|
|
693
|
-
const
|
|
694
|
-
typeof
|
|
689
|
+
function T(e, t) {
|
|
690
|
+
if (typeof e == "string")
|
|
691
|
+
return document.createTextNode(e);
|
|
692
|
+
if (e.tag === "#text") {
|
|
693
|
+
const a = document.createTextNode(
|
|
694
|
+
typeof e.children == "string" ? e.children : ""
|
|
695
695
|
);
|
|
696
|
-
return
|
|
696
|
+
return e.key != null && (a.key = e.key), a;
|
|
697
697
|
}
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
700
|
-
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
for (const
|
|
704
|
-
|
|
705
|
-
return
|
|
698
|
+
if (e.tag === "#anchor") {
|
|
699
|
+
const a = e, u = Array.isArray(a.children) ? a.children : [], y = document.createTextNode(""), f = document.createTextNode("");
|
|
700
|
+
a.key != null && (y.key = `${a.key}:start`, f.key = `${a.key}:end`), a._startNode = y, a._endNode = f;
|
|
701
|
+
const w = document.createDocumentFragment();
|
|
702
|
+
w.appendChild(y);
|
|
703
|
+
for (const p of u)
|
|
704
|
+
w.appendChild(T(p, t));
|
|
705
|
+
return w.appendChild(f), w;
|
|
706
706
|
}
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
-
const { props:
|
|
710
|
-
...
|
|
707
|
+
const r = document.createElement(e.tag);
|
|
708
|
+
e.key != null && (r.key = e.key);
|
|
709
|
+
const { props: n = {}, attrs: i = {}, directives: s = {} } = e.props ?? {}, o = re(s, t, r, i), c = {
|
|
710
|
+
...n,
|
|
711
711
|
...o.props
|
|
712
|
-
},
|
|
713
|
-
...
|
|
712
|
+
}, d = {
|
|
713
|
+
...i,
|
|
714
714
|
...o.attrs
|
|
715
715
|
};
|
|
716
|
-
for (const
|
|
717
|
-
const
|
|
718
|
-
typeof
|
|
716
|
+
for (const a in d) {
|
|
717
|
+
const u = d[a];
|
|
718
|
+
typeof u == "boolean" ? u && r.setAttribute(a, "") : u != null && r.setAttribute(a, String(u));
|
|
719
719
|
}
|
|
720
|
-
for (const
|
|
721
|
-
const
|
|
722
|
-
if (
|
|
723
|
-
|
|
724
|
-
else if (
|
|
725
|
-
|
|
726
|
-
else if (
|
|
727
|
-
|
|
720
|
+
for (const a in c) {
|
|
721
|
+
const u = c[a];
|
|
722
|
+
if (a === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement))
|
|
723
|
+
r.value = u ?? "";
|
|
724
|
+
else if (a === "checked" && r instanceof HTMLInputElement)
|
|
725
|
+
r.checked = !!u;
|
|
726
|
+
else if (a.startsWith("on") && typeof u == "function")
|
|
727
|
+
r.addEventListener(a.slice(2).toLowerCase(), u);
|
|
728
728
|
else {
|
|
729
|
-
if (
|
|
729
|
+
if (a.startsWith("on") && u === void 0)
|
|
730
730
|
continue;
|
|
731
|
-
|
|
731
|
+
u == null || u === !1 ? r.removeAttribute(a) : r.setAttribute(a, String(u));
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
for (const [
|
|
734
|
+
for (const [a, u] of Object.entries(
|
|
735
735
|
o.listeners || {}
|
|
736
736
|
))
|
|
737
|
-
|
|
738
|
-
if (Array.isArray(
|
|
739
|
-
for (const
|
|
740
|
-
|
|
741
|
-
else typeof
|
|
742
|
-
return
|
|
737
|
+
r.addEventListener(a, u);
|
|
738
|
+
if (Array.isArray(e.children))
|
|
739
|
+
for (const a of e.children)
|
|
740
|
+
r.appendChild(T(a, t));
|
|
741
|
+
else typeof e.children == "string" && (r.textContent = e.children);
|
|
742
|
+
return r;
|
|
743
743
|
}
|
|
744
|
-
function
|
|
745
|
-
if (typeof
|
|
746
|
-
|
|
744
|
+
function ge(e, t, r, n) {
|
|
745
|
+
if (typeof r == "string") {
|
|
746
|
+
e.textContent !== r && (e.textContent = r);
|
|
747
747
|
return;
|
|
748
748
|
}
|
|
749
|
-
if (!Array.isArray(
|
|
750
|
-
const
|
|
751
|
-
for (const
|
|
752
|
-
|
|
753
|
-
const
|
|
754
|
-
for (const
|
|
755
|
-
const
|
|
756
|
-
|
|
749
|
+
if (!Array.isArray(r)) return;
|
|
750
|
+
const i = Array.from(e.childNodes), s = Array.isArray(t) ? t : [], o = /* @__PURE__ */ new Map();
|
|
751
|
+
for (const f of s)
|
|
752
|
+
f && f.key != null && o.set(f.key, f);
|
|
753
|
+
const c = /* @__PURE__ */ new Map();
|
|
754
|
+
for (const f of i) {
|
|
755
|
+
const w = f.key;
|
|
756
|
+
w != null && c.set(w, f);
|
|
757
757
|
}
|
|
758
|
-
const
|
|
759
|
-
let
|
|
760
|
-
function
|
|
761
|
-
let
|
|
762
|
-
for (;
|
|
763
|
-
|
|
758
|
+
const d = /* @__PURE__ */ new Set();
|
|
759
|
+
let a = e.firstChild;
|
|
760
|
+
function u(f, w) {
|
|
761
|
+
let p = f;
|
|
762
|
+
for (; p && (d.add(p), p !== w); )
|
|
763
|
+
p = p.nextSibling;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
const
|
|
767
|
-
let
|
|
768
|
-
for (;
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
772
|
-
const
|
|
773
|
-
for (const
|
|
774
|
-
|
|
775
|
-
for (const
|
|
776
|
-
const
|
|
777
|
-
|
|
765
|
+
function y(f, w, p, C) {
|
|
766
|
+
const g = [];
|
|
767
|
+
let l = f.nextSibling;
|
|
768
|
+
for (; l && l !== w; )
|
|
769
|
+
g.push(l), l = l.nextSibling;
|
|
770
|
+
const b = Array.isArray(p) ? p : [];
|
|
771
|
+
if (C.some((h) => h && h.key != null) || b.some((h) => h && h.key != null)) {
|
|
772
|
+
const h = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
773
|
+
for (const v of b)
|
|
774
|
+
v && v.key != null && h.set(v.key, v);
|
|
775
|
+
for (const v of g) {
|
|
776
|
+
const _ = v.key;
|
|
777
|
+
_ != null && x.set(_, v);
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
let
|
|
781
|
-
for (const
|
|
782
|
-
let
|
|
783
|
-
if (
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
),
|
|
779
|
+
const S = /* @__PURE__ */ new Set();
|
|
780
|
+
let k = f.nextSibling;
|
|
781
|
+
for (const v of C) {
|
|
782
|
+
let _;
|
|
783
|
+
if (v.key != null && x.has(v.key)) {
|
|
784
|
+
const $ = h.get(v.key);
|
|
785
|
+
_ = I(
|
|
786
|
+
x.get(v.key),
|
|
787
|
+
$,
|
|
788
|
+
v,
|
|
789
|
+
n
|
|
790
|
+
), S.add(_), _ !== k && e.contains(_) && e.insertBefore(_, k);
|
|
791
791
|
} else
|
|
792
|
-
|
|
793
|
-
|
|
792
|
+
_ = T(v, n), e.insertBefore(_, k), S.add(_);
|
|
793
|
+
k = _.nextSibling;
|
|
794
794
|
}
|
|
795
|
-
for (const
|
|
796
|
-
!
|
|
795
|
+
for (const v of g)
|
|
796
|
+
!S.has(v) && e.contains(v) && e.removeChild(v);
|
|
797
797
|
} else {
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
|
|
798
|
+
const h = Math.min(
|
|
799
|
+
b.length,
|
|
800
|
+
C.length
|
|
801
801
|
);
|
|
802
|
-
for (let
|
|
803
|
-
const
|
|
804
|
-
|
|
802
|
+
for (let x = 0; x < h; x++) {
|
|
803
|
+
const S = b[x], k = C[x], v = I(g[x], S, k, n);
|
|
804
|
+
v !== g[x] && (e.insertBefore(v, g[x]), e.removeChild(g[x]));
|
|
805
805
|
}
|
|
806
|
-
for (let
|
|
807
|
-
|
|
808
|
-
for (let
|
|
809
|
-
|
|
806
|
+
for (let x = h; x < C.length; x++)
|
|
807
|
+
e.insertBefore(T(C[x], n), w);
|
|
808
|
+
for (let x = h; x < g.length; x++)
|
|
809
|
+
e.removeChild(g[x]);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
for (const
|
|
813
|
-
let
|
|
814
|
-
if (
|
|
815
|
-
const
|
|
816
|
-
let
|
|
817
|
-
const m = Array.isArray(
|
|
818
|
-
if (
|
|
819
|
-
|
|
820
|
-
for (const
|
|
821
|
-
|
|
822
|
-
|
|
812
|
+
for (const f of r) {
|
|
813
|
+
let w;
|
|
814
|
+
if (f.tag === "#anchor") {
|
|
815
|
+
const p = f.key, C = `${p}:start`, g = `${p}:end`;
|
|
816
|
+
let l = c.get(C), b = c.get(g);
|
|
817
|
+
const m = Array.isArray(f.children) ? f.children : [];
|
|
818
|
+
if (l || (l = document.createTextNode(""), l.key = C), b || (b = document.createTextNode(""), b.key = g), f._startNode = l, f._endNode = b, !e.contains(l) || !e.contains(b)) {
|
|
819
|
+
e.insertBefore(l, a);
|
|
820
|
+
for (const h of m)
|
|
821
|
+
e.insertBefore(T(h, n), a);
|
|
822
|
+
e.insertBefore(b, a);
|
|
823
823
|
} else
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
o.get(
|
|
824
|
+
y(
|
|
825
|
+
l,
|
|
826
|
+
b,
|
|
827
|
+
o.get(p)?.children,
|
|
828
828
|
m
|
|
829
829
|
);
|
|
830
|
-
|
|
830
|
+
u(l, b), a = b.nextSibling;
|
|
831
831
|
continue;
|
|
832
832
|
}
|
|
833
|
-
if (
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
),
|
|
833
|
+
if (f.key != null && c.has(f.key)) {
|
|
834
|
+
const p = o.get(f.key);
|
|
835
|
+
w = I(
|
|
836
|
+
c.get(f.key),
|
|
837
|
+
p,
|
|
838
|
+
f,
|
|
839
|
+
n
|
|
840
|
+
), d.add(w), w !== a && e.contains(w) && (a && !e.contains(a) && (a = null), e.insertBefore(w, a));
|
|
841
841
|
} else
|
|
842
|
-
|
|
843
|
-
|
|
842
|
+
w = T(f, n), a && !e.contains(a) && (a = null), e.insertBefore(w, a), d.add(w);
|
|
843
|
+
a = w.nextSibling;
|
|
844
844
|
}
|
|
845
|
-
for (const
|
|
846
|
-
!
|
|
845
|
+
for (const f of i)
|
|
846
|
+
!d.has(f) && e.contains(f) && e.removeChild(f);
|
|
847
847
|
}
|
|
848
|
-
function
|
|
849
|
-
if (
|
|
850
|
-
if (typeof
|
|
851
|
-
if (
|
|
852
|
-
return
|
|
848
|
+
function I(e, t, r, n) {
|
|
849
|
+
if (t === r) return e;
|
|
850
|
+
if (typeof r == "string") {
|
|
851
|
+
if (e.nodeType === Node.TEXT_NODE)
|
|
852
|
+
return e.textContent !== r && (e.textContent = r), e;
|
|
853
853
|
{
|
|
854
|
-
const
|
|
855
|
-
return
|
|
854
|
+
const s = document.createTextNode(r);
|
|
855
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
|
-
if (
|
|
859
|
-
const
|
|
860
|
-
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
for (const
|
|
864
|
-
|
|
865
|
-
return
|
|
858
|
+
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
859
|
+
const s = r, o = Array.isArray(s.children) ? s.children : [], c = s._startNode ?? document.createTextNode(""), d = s._endNode ?? document.createTextNode("");
|
|
860
|
+
s.key != null && (c.key = `${s.key}:start`, d.key = `${s.key}:end`), s._startNode = c, s._endNode = d;
|
|
861
|
+
const a = document.createDocumentFragment();
|
|
862
|
+
a.appendChild(c);
|
|
863
|
+
for (const u of o)
|
|
864
|
+
a.appendChild(T(u, n));
|
|
865
|
+
return a.appendChild(d), e.parentNode?.replaceChild(a, e), c;
|
|
866
866
|
}
|
|
867
|
-
if (!
|
|
868
|
-
const
|
|
869
|
-
return
|
|
867
|
+
if (!r) {
|
|
868
|
+
const s = document.createComment("removed");
|
|
869
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
870
870
|
}
|
|
871
|
-
if (!
|
|
872
|
-
const
|
|
873
|
-
return
|
|
871
|
+
if (!t || typeof t == "string") {
|
|
872
|
+
const s = T(r, n);
|
|
873
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
874
874
|
}
|
|
875
|
-
if (
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
const
|
|
879
|
-
|
|
880
|
-
for (const
|
|
881
|
-
|
|
882
|
-
return
|
|
875
|
+
if (r.tag === "#anchor") {
|
|
876
|
+
const s = Array.isArray(r.children) ? r.children : [], o = r._startNode ?? document.createTextNode(""), c = r._endNode ?? document.createTextNode("");
|
|
877
|
+
r.key != null && (o.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = o, r._endNode = c;
|
|
878
|
+
const d = document.createDocumentFragment();
|
|
879
|
+
d.appendChild(o);
|
|
880
|
+
for (const a of s)
|
|
881
|
+
d.appendChild(T(a, n));
|
|
882
|
+
return d.appendChild(c), e.parentNode?.replaceChild(d, e), o;
|
|
883
883
|
}
|
|
884
|
-
if (typeof
|
|
885
|
-
const
|
|
886
|
-
return
|
|
884
|
+
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
885
|
+
const s = e;
|
|
886
|
+
return pe(s, t.props || {}, r.props || {}, n), ge(s, t.children, r.children, n), s;
|
|
887
887
|
}
|
|
888
|
-
const
|
|
889
|
-
return
|
|
888
|
+
const i = T(r, n);
|
|
889
|
+
return e.parentNode?.replaceChild(i, e), i;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
892
|
-
const
|
|
893
|
-
let
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
-
let
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
for (let
|
|
900
|
-
const
|
|
901
|
-
|
|
891
|
+
function me(e, t, r) {
|
|
892
|
+
const n = (a) => a.key == null ? { ...a, key: "__root__" } : a;
|
|
893
|
+
let i = Array.isArray(t) ? { tag: "div", key: "__root__", children: t } : n(t);
|
|
894
|
+
i = J(i, String(i.key ?? "root"));
|
|
895
|
+
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
896
|
+
let c;
|
|
897
|
+
s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? c = I(o, s, i, r) : (c = T(i, r), e.replaceChild(c, o)) : (c = T(i, r), e.firstChild ? e.replaceChild(c, e.firstChild) : e.appendChild(c));
|
|
898
|
+
const d = [];
|
|
899
|
+
for (let a = 0; a < e.childNodes.length; a++) {
|
|
900
|
+
const u = e.childNodes[a];
|
|
901
|
+
u !== c && u.nodeName !== "STYLE" && d.push(u);
|
|
902
902
|
}
|
|
903
|
-
|
|
903
|
+
d.forEach((a) => e.removeChild(a)), e._prevVNode = i, e._prevDom = c;
|
|
904
904
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
css: t,
|
|
916
|
-
timestamp: Date.now(),
|
|
917
|
-
dependencies: s
|
|
918
|
-
}), this.accessOrder.set(e, ++this.accessCounter);
|
|
919
|
-
}
|
|
920
|
-
get(e) {
|
|
921
|
-
const t = this.cache.get(e);
|
|
922
|
-
return t ? (this.accessOrder.set(e, ++this.accessCounter), t.css) : null;
|
|
923
|
-
}
|
|
924
|
-
has(e) {
|
|
925
|
-
return this.cache.has(e);
|
|
926
|
-
}
|
|
927
|
-
invalidate(e) {
|
|
928
|
-
const t = [];
|
|
929
|
-
for (const [s, r] of this.cache)
|
|
930
|
-
r.dependencies.includes(e) && t.push(s);
|
|
931
|
-
t.forEach((s) => {
|
|
932
|
-
this.cache.delete(s), this.accessOrder.delete(s);
|
|
933
|
-
});
|
|
934
|
-
}
|
|
935
|
-
clear() {
|
|
936
|
-
this.cache.clear(), this.accessOrder.clear(), this.accessCounter = 0;
|
|
937
|
-
}
|
|
938
|
-
evictOldest() {
|
|
939
|
-
let e = "", t = 1 / 0;
|
|
940
|
-
for (const [s, r] of this.accessOrder)
|
|
941
|
-
r < t && (t = r, e = s);
|
|
942
|
-
e && (this.cache.delete(e), this.accessOrder.delete(e));
|
|
905
|
+
function ye(e) {
|
|
906
|
+
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
907
|
+
}
|
|
908
|
+
const be = `
|
|
909
|
+
:host {
|
|
910
|
+
box-sizing:border-box;
|
|
911
|
+
line-height:1.5;
|
|
912
|
+
font-family:ui-sans-serif,system-ui,sans-serif;
|
|
913
|
+
-webkit-text-size-adjust:100%;
|
|
914
|
+
text-size-adjust:100%;
|
|
943
915
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
};
|
|
916
|
+
*,::before,::after {
|
|
917
|
+
box-sizing:inherit;
|
|
918
|
+
margin:0;
|
|
919
|
+
padding:0;
|
|
920
|
+
border:0 solid currentColor;
|
|
950
921
|
}
|
|
922
|
+
`, xe = {
|
|
923
|
+
gray: {
|
|
924
|
+
50: "var(--color-gray-50, #f9fafb)",
|
|
925
|
+
100: "var(--color-gray-100, #f3f4f6)",
|
|
926
|
+
200: "var(--color-gray-200, #e5e7eb)",
|
|
927
|
+
300: "var(--color-gray-300, #d1d5db)",
|
|
928
|
+
400: "var(--color-gray-400, #9ca3af)",
|
|
929
|
+
500: "var(--color-gray-500, #6b7280)",
|
|
930
|
+
600: "var(--color-gray-600, #4b5563)",
|
|
931
|
+
700: "var(--color-gray-700, #374151)",
|
|
932
|
+
800: "var(--color-gray-800, #1f2937)",
|
|
933
|
+
900: "var(--color-gray-900, #111827)"
|
|
934
|
+
},
|
|
935
|
+
slate: {
|
|
936
|
+
50: "var(--color-slate-50, #f8fafc)",
|
|
937
|
+
100: "var(--color-slate-100, #f1f5f9)",
|
|
938
|
+
200: "var(--color-slate-200, #e2e8f0)",
|
|
939
|
+
300: "var(--color-slate-300, #cbd5e1)",
|
|
940
|
+
400: "var(--color-slate-400, #94a3b8)",
|
|
941
|
+
500: "var(--color-slate-500, #64748b)",
|
|
942
|
+
600: "var(--color-slate-600, #475569)",
|
|
943
|
+
700: "var(--color-slate-700, #334155)",
|
|
944
|
+
800: "var(--color-slate-800, #1e293b)",
|
|
945
|
+
900: "var(--color-slate-900, #0f172a)"
|
|
946
|
+
},
|
|
947
|
+
zinc: {
|
|
948
|
+
50: "var(--color-zinc-50, #fafafa)",
|
|
949
|
+
100: "var(--color-zinc-100, #f4f4f5)",
|
|
950
|
+
200: "var(--color-zinc-200, #e4e4e7)",
|
|
951
|
+
300: "var(--color-zinc-300, #d4d4d8)",
|
|
952
|
+
400: "var(--color-zinc-400, #a1a1aa)",
|
|
953
|
+
500: "var(--color-zinc-500, #71717a)",
|
|
954
|
+
600: "var(--color-zinc-600, #52525b)",
|
|
955
|
+
700: "var(--color-zinc-700, #3f3f46)",
|
|
956
|
+
800: "var(--color-zinc-800, #27272a)",
|
|
957
|
+
900: "var(--color-zinc-900, #18181b)"
|
|
958
|
+
},
|
|
959
|
+
red: {
|
|
960
|
+
50: "var(--color-red-50, #fef2f2)",
|
|
961
|
+
100: "var(--color-red-100, #fee2e2)",
|
|
962
|
+
200: "var(--color-red-200, #fecaca)",
|
|
963
|
+
300: "var(--color-red-300, #fca5a5)",
|
|
964
|
+
400: "var(--color-red-400, #f87171)",
|
|
965
|
+
500: "var(--color-red-500, #ef4444)",
|
|
966
|
+
600: "var(--color-red-600, #dc2626)",
|
|
967
|
+
700: "var(--color-red-700, #b91c1c)",
|
|
968
|
+
800: "var(--color-red-800, #991b1b)",
|
|
969
|
+
900: "var(--color-red-900, #7f1d1d)"
|
|
970
|
+
},
|
|
971
|
+
blue: {
|
|
972
|
+
50: "var(--color-blue-50, #eff6ff)",
|
|
973
|
+
100: "var(--color-blue-100, #dbeafe)",
|
|
974
|
+
200: "var(--color-blue-200, #bfdbfe)",
|
|
975
|
+
300: "var(--color-blue-300, #93c5fd)",
|
|
976
|
+
400: "var(--color-blue-400, #60a5fa)",
|
|
977
|
+
500: "var(--color-blue-500, #3b82f6)",
|
|
978
|
+
600: "var(--color-blue-600, #2563eb)",
|
|
979
|
+
700: "var(--color-blue-700, #1d4ed8)",
|
|
980
|
+
800: "var(--color-blue-800, #1e40af)",
|
|
981
|
+
900: "var(--color-blue-900, #1e3a8a)"
|
|
982
|
+
},
|
|
983
|
+
green: {
|
|
984
|
+
50: "var(--color-green-50, #f0fdf4)",
|
|
985
|
+
100: "var(--color-green-100, #dcfce7)",
|
|
986
|
+
200: "var(--color-green-200, #bbf7d0)",
|
|
987
|
+
300: "var(--color-green-300, #86efac)",
|
|
988
|
+
400: "var(--color-green-400, #4ade80)",
|
|
989
|
+
500: "var(--color-green-500, #22c55e)",
|
|
990
|
+
600: "var(--color-green-600, #16a34a)",
|
|
991
|
+
700: "var(--color-green-700, #15803d)",
|
|
992
|
+
800: "var(--color-green-800, #166534)",
|
|
993
|
+
900: "var(--color-green-900, #14532d)"
|
|
994
|
+
},
|
|
995
|
+
amber: {
|
|
996
|
+
50: "var(--color-amber-50, #fffbeb)",
|
|
997
|
+
100: "var(--color-amber-100, #fef3c7)",
|
|
998
|
+
200: "var(--color-amber-200, #fde68a)",
|
|
999
|
+
300: "var(--color-amber-300, #fcd34d)",
|
|
1000
|
+
400: "var(--color-amber-400, #fbbf24)",
|
|
1001
|
+
500: "var(--color-amber-500, #f59e0b)",
|
|
1002
|
+
600: "var(--color-amber-600, #d97706)",
|
|
1003
|
+
700: "var(--color-amber-700, #b45309)",
|
|
1004
|
+
800: "var(--color-amber-800, #92400e)",
|
|
1005
|
+
900: "var(--color-amber-900, #78350f)"
|
|
1006
|
+
},
|
|
1007
|
+
indigo: {
|
|
1008
|
+
50: "var(--color-indigo-50, #eef2ff)",
|
|
1009
|
+
100: "var(--color-indigo-100, #e0e7ff)",
|
|
1010
|
+
200: "var(--color-indigo-200, #c7d2fe)",
|
|
1011
|
+
300: "var(--color-indigo-300, #a5b4fc)",
|
|
1012
|
+
400: "var(--color-indigo-400, #818cf8)",
|
|
1013
|
+
500: "var(--color-indigo-500, #6366f1)",
|
|
1014
|
+
600: "var(--color-indigo-600, #4f46e5)",
|
|
1015
|
+
700: "var(--color-indigo-700, #4338ca)",
|
|
1016
|
+
800: "var(--color-indigo-800, #3730a3)",
|
|
1017
|
+
900: "var(--color-indigo-900, #312e81)"
|
|
1018
|
+
},
|
|
1019
|
+
emerald: {
|
|
1020
|
+
50: "var(--color-emerald-50, #ecfdf5)",
|
|
1021
|
+
100: "var(--color-emerald-100, #d1fae5)",
|
|
1022
|
+
200: "var(--color-emerald-200, #a7f3d0)",
|
|
1023
|
+
300: "var(--color-emerald-300, #6ee7b7)",
|
|
1024
|
+
400: "var(--color-emerald-400, #34d399)",
|
|
1025
|
+
500: "var(--color-emerald-500, #10b981)",
|
|
1026
|
+
600: "var(--color-emerald-600, #059669)",
|
|
1027
|
+
700: "var(--color-emerald-700, #047857)",
|
|
1028
|
+
800: "var(--color-emerald-800, #065f46)",
|
|
1029
|
+
900: "var(--color-emerald-900, #064e3b)"
|
|
1030
|
+
},
|
|
1031
|
+
rose: {
|
|
1032
|
+
50: "var(--color-rose-50, #fff1f2)",
|
|
1033
|
+
100: "var(--color-rose-100, #ffe4e6)",
|
|
1034
|
+
200: "var(--color-rose-200, #fecdd3)",
|
|
1035
|
+
300: "var(--color-rose-300, #fda4af)",
|
|
1036
|
+
400: "var(--color-rose-400, #fb7185)",
|
|
1037
|
+
500: "var(--color-rose-500, #f43f5e)",
|
|
1038
|
+
600: "var(--color-rose-600, #e11d48)",
|
|
1039
|
+
700: "var(--color-rose-700, #be123c)",
|
|
1040
|
+
800: "var(--color-rose-800, #9f1239)",
|
|
1041
|
+
900: "var(--color-rose-900, #881337)"
|
|
1042
|
+
},
|
|
1043
|
+
white: { DEFAULT: "var(--color-white, #ffffff)" },
|
|
1044
|
+
black: { DEFAULT: "var(--color-black, #000000)" }
|
|
1045
|
+
}, W = {
|
|
1046
|
+
/* Display */
|
|
1047
|
+
block: "display:block;",
|
|
1048
|
+
inline: "display:inline;",
|
|
1049
|
+
"inline-block": "display:inline-block;",
|
|
1050
|
+
flex: "display:flex;",
|
|
1051
|
+
"inline-flex": "display:inline-flex;",
|
|
1052
|
+
grid: "display:grid;",
|
|
1053
|
+
hidden: "display:none;",
|
|
1054
|
+
/* Accessibility */
|
|
1055
|
+
"sr-only": "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;",
|
|
1056
|
+
"not-sr-only": "position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;",
|
|
1057
|
+
/* Grid Layout */
|
|
1058
|
+
"grid-cols-1": "grid-template-columns:repeat(1,minmax(0,1fr));",
|
|
1059
|
+
"grid-cols-2": "grid-template-columns:repeat(2,minmax(0,1fr));",
|
|
1060
|
+
"grid-cols-3": "grid-template-columns:repeat(3,minmax(0,1fr));",
|
|
1061
|
+
"grid-cols-4": "grid-template-columns:repeat(4,minmax(0,1fr));",
|
|
1062
|
+
"grid-cols-5": "grid-template-columns:repeat(5,minmax(0,1fr));",
|
|
1063
|
+
"grid-cols-6": "grid-template-columns:repeat(6,minmax(0,1fr));",
|
|
1064
|
+
"grid-cols-12": "grid-template-columns:repeat(12,minmax(0,1fr));",
|
|
1065
|
+
"grid-rows-1": "grid-template-rows:repeat(1,minmax(0,1fr));",
|
|
1066
|
+
"grid-rows-2": "grid-template-rows:repeat(2,minmax(0,1fr));",
|
|
1067
|
+
"grid-rows-3": "grid-template-rows:repeat(3,minmax(0,1fr));",
|
|
1068
|
+
"grid-rows-4": "grid-template-rows:repeat(4,minmax(0,1fr));",
|
|
1069
|
+
"grid-rows-6": "grid-template-rows:repeat(6,minmax(0,1fr));",
|
|
1070
|
+
"grid-rows-12": "grid-template-rows:repeat(12,minmax(0,1fr));",
|
|
1071
|
+
/* Grid Placement */
|
|
1072
|
+
"col-span-1": "grid-column:span 1 / span 1;",
|
|
1073
|
+
"col-span-2": "grid-column:span 2 / span 2;",
|
|
1074
|
+
"col-span-3": "grid-column:span 3 / span 3;",
|
|
1075
|
+
"col-span-4": "grid-column:span 4 / span 4;",
|
|
1076
|
+
"col-span-5": "grid-column:span 5 / span 5;",
|
|
1077
|
+
"col-span-6": "grid-column:span 6 / span 6;",
|
|
1078
|
+
"col-span-12": "grid-column:span 12 / span 12;",
|
|
1079
|
+
"row-span-1": "grid-row:span 1 / span 1;",
|
|
1080
|
+
"row-span-2": "grid-row:span 2 / span 2;",
|
|
1081
|
+
"row-span-3": "grid-row:span 3 / span 3;",
|
|
1082
|
+
"row-span-4": "grid-row:span 4 / span 4;",
|
|
1083
|
+
"row-span-6": "grid-row:span 6 / span 6;",
|
|
1084
|
+
"row-span-12": "grid-row:span 12 / span 12;",
|
|
1085
|
+
/* Positioning */
|
|
1086
|
+
absolute: "position:absolute;",
|
|
1087
|
+
relative: "position:relative;",
|
|
1088
|
+
fixed: "position:fixed;",
|
|
1089
|
+
sticky: "position:sticky;",
|
|
1090
|
+
/* Typography */
|
|
1091
|
+
"font-bold": "font-weight:700;",
|
|
1092
|
+
"font-semibold": "font-weight:600;",
|
|
1093
|
+
"font-medium": "font-weight:500;",
|
|
1094
|
+
"font-light": "font-weight:300;",
|
|
1095
|
+
underline: "text-decoration-line:underline;",
|
|
1096
|
+
overline: "text-decoration-line:overline;",
|
|
1097
|
+
"line-through": "text-decoration-line:line-through;",
|
|
1098
|
+
"no-underline": "text-decoration-line:none;",
|
|
1099
|
+
italic: "font-style:italic;",
|
|
1100
|
+
"not-italic": "font-style:normal;",
|
|
1101
|
+
uppercase: "text-transform:uppercase;",
|
|
1102
|
+
lowercase: "text-transform:lowercase;",
|
|
1103
|
+
capitalize: "text-transform:capitalize;",
|
|
1104
|
+
"normal-case": "text-transform:none;",
|
|
1105
|
+
"text-left": "text-align:left;",
|
|
1106
|
+
"text-center": "text-align:center;",
|
|
1107
|
+
"text-right": "text-align:right;",
|
|
1108
|
+
"text-xs": "font-size:0.75rem;line-height:calc(1 / 0.75)",
|
|
1109
|
+
"text-sm": "font-size:0.875rem;line-height:calc(1.25 / 0.875)",
|
|
1110
|
+
"text-base": "font-size:1rem;line-height:calc(1.5 / 1)",
|
|
1111
|
+
"text-lg": "font-size:1.125rem;line-height:calc(1.75 / 1.125)",
|
|
1112
|
+
"text-xl": "font-size:1.25rem;line-height:calc(1.75 / 1.25)",
|
|
1113
|
+
"text-2xl": "font-size:1.5rem;line-height:calc(2 / 1.5)",
|
|
1114
|
+
"text-3xl": "font-size:1.875rem;line-height:calc(2.25 / 1.875)",
|
|
1115
|
+
"text-4xl": "font-size:2.25rem;line-height:calc(2.5 / 2.25)",
|
|
1116
|
+
"text-5xl": "font-size:3rem;line-height:1",
|
|
1117
|
+
"text-6xl": "font-size:3.75rem;line-height:1",
|
|
1118
|
+
"text-7xl": "font-size:4.5rem;line-height:1",
|
|
1119
|
+
"text-8xl": "font-size:6rem;line-height:1",
|
|
1120
|
+
/* Borders */
|
|
1121
|
+
border: "border-width:1px;",
|
|
1122
|
+
"rounded-none": "border-radius:0;",
|
|
1123
|
+
"rounded-xs": "border-radius:0.125rem;",
|
|
1124
|
+
"rounded-sm": "border-radius:0.25rem;",
|
|
1125
|
+
"rounded-md": "border-radius:0.375rem;",
|
|
1126
|
+
"rounded-lg": "border-radius:0.5rem;",
|
|
1127
|
+
"rounded-full": "border-radius:9999px;",
|
|
1128
|
+
/* Ring (box-shadow for focus) */
|
|
1129
|
+
"ring-0": "box-shadow:none;",
|
|
1130
|
+
"ring-1": "box-shadow:0 0 0 1px rgba(59,130,246,0.5);",
|
|
1131
|
+
"ring-2": "box-shadow:0 0 0 2px rgba(59,130,246,0.5);",
|
|
1132
|
+
"ring-4": "box-shadow:0 0 0 4px rgba(59,130,246,0.5);",
|
|
1133
|
+
"ring-8": "box-shadow:0 0 0 8px rgba(59,130,246,0.5);",
|
|
1134
|
+
/* Shadow and effects */
|
|
1135
|
+
"shadow-none": "box-shadow:0 0 #0000;",
|
|
1136
|
+
"shadow-xs": "box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);",
|
|
1137
|
+
"shadow-sm": "box-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);",
|
|
1138
|
+
"shadow-md": "box-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);",
|
|
1139
|
+
"shadow-lg": "box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);",
|
|
1140
|
+
"shadow-xl": "box-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);",
|
|
1141
|
+
"shadow-2xl": "box-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);",
|
|
1142
|
+
/* Transitions */
|
|
1143
|
+
transition: "transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4,0,0.2,1);",
|
|
1144
|
+
/* Text Overflow & Whitespace */
|
|
1145
|
+
truncate: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",
|
|
1146
|
+
/* Visibility */
|
|
1147
|
+
visible: "visibility:visible;",
|
|
1148
|
+
invisible: "visibility:hidden;",
|
|
1149
|
+
/* Flex Grow/Shrink/Basis */
|
|
1150
|
+
grow: "flex-grow:1;",
|
|
1151
|
+
shrink: "flex-shrink:1;",
|
|
1152
|
+
"grow-0": "flex-grow:0;",
|
|
1153
|
+
"shrink-0": "flex-shrink:0;",
|
|
1154
|
+
/* Font Family */
|
|
1155
|
+
"font-sans": "font-family:ui-sans-serif,system-ui,sans-serif;",
|
|
1156
|
+
"font-serif": "font-family:ui-serif,Georgia,serif;",
|
|
1157
|
+
"font-mono": "font-family:ui-monospace,SFMono-Regular,monospace;",
|
|
1158
|
+
/* Line Clamp (for webkit) */
|
|
1159
|
+
"line-clamp-1": "display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1160
|
+
"line-clamp-2": "display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1161
|
+
"line-clamp-3": "display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1162
|
+
"line-clamp-4": "display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1163
|
+
/* Transition Delay/Property */
|
|
1164
|
+
"transition-colors": "transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;",
|
|
1165
|
+
"transition-opacity": "transition-property:opacity;",
|
|
1166
|
+
"transition-transform": "transition-property:transform;"
|
|
1167
|
+
}, ve = "0.25rem", Y = {
|
|
1168
|
+
m: ["margin"],
|
|
1169
|
+
mx: ["margin-inline"],
|
|
1170
|
+
my: ["margin-block"],
|
|
1171
|
+
mt: ["margin-top"],
|
|
1172
|
+
mr: ["margin-right"],
|
|
1173
|
+
mb: ["margin-bottom"],
|
|
1174
|
+
ml: ["margin-left"],
|
|
1175
|
+
p: ["padding"],
|
|
1176
|
+
px: ["padding-inline"],
|
|
1177
|
+
py: ["padding-block"],
|
|
1178
|
+
pt: ["padding-top"],
|
|
1179
|
+
pr: ["padding-right"],
|
|
1180
|
+
pb: ["padding-bottom"],
|
|
1181
|
+
pl: ["padding-left"],
|
|
1182
|
+
inset: ["inset"],
|
|
1183
|
+
"inset-x": ["inset-inline"],
|
|
1184
|
+
"inset-y": ["inset-block"],
|
|
1185
|
+
top: ["top"],
|
|
1186
|
+
bottom: ["bottom"],
|
|
1187
|
+
left: ["left"],
|
|
1188
|
+
right: ["right"],
|
|
1189
|
+
gap: ["gap"],
|
|
1190
|
+
"gap-x": ["column-gap"],
|
|
1191
|
+
"gap-y": ["row-gap"]
|
|
1192
|
+
}, we = {
|
|
1193
|
+
// State variants
|
|
1194
|
+
before: (e, t) => `${e}::before{${t}}`,
|
|
1195
|
+
after: (e, t) => `${e}::after{${t}}`,
|
|
1196
|
+
hover: (e, t) => `${e}:hover{${t}}`,
|
|
1197
|
+
focus: (e, t) => `${e}:focus{${t}}`,
|
|
1198
|
+
active: (e, t) => `${e}:active{${t}}`,
|
|
1199
|
+
disabled: (e, t) => `${e}:disabled{${t}}`,
|
|
1200
|
+
visited: (e, t) => `${e}:visited{${t}}`,
|
|
1201
|
+
checked: (e, t) => `${e}:checked{${t}}`,
|
|
1202
|
+
first: (e, t) => `${e}:first-child{${t}}`,
|
|
1203
|
+
last: (e, t) => `${e}:last-child{${t}}`,
|
|
1204
|
+
odd: (e, t) => `${e}:nth-child(odd){${t}}`,
|
|
1205
|
+
even: (e, t) => `${e}:nth-child(even){${t}}`,
|
|
1206
|
+
"focus-within": (e, t) => `${e}:focus-within{${t}}`,
|
|
1207
|
+
"focus-visible": (e, t) => `${e}:focus-visible{${t}}`,
|
|
1208
|
+
// Group variants
|
|
1209
|
+
"group-hover": (e, t) => `.group:hover ${e}{${t}}`,
|
|
1210
|
+
"group-focus": (e, t) => `.group:focus ${e}{${t}}`,
|
|
1211
|
+
"group-active": (e, t) => `.group:active ${e}{${t}}`,
|
|
1212
|
+
"group-disabled": (e, t) => `.group:disabled ${e}{${t}}`,
|
|
1213
|
+
// Peer variants
|
|
1214
|
+
"peer-hover": (e, t) => `.peer:hover ~ ${e}{${t}}`,
|
|
1215
|
+
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1216
|
+
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1217
|
+
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1218
|
+
}, G = {
|
|
1219
|
+
// Responsive
|
|
1220
|
+
sm: "(min-width:640px)",
|
|
1221
|
+
md: "(min-width:768px)",
|
|
1222
|
+
lg: "(min-width:1024px)",
|
|
1223
|
+
xl: "(min-width:1280px)",
|
|
1224
|
+
"2xl": "(min-width:1536px)",
|
|
1225
|
+
// Dark mode (now plain string)
|
|
1226
|
+
dark: "(prefers-color-scheme: dark)"
|
|
1227
|
+
}, K = ["sm", "md", "lg", "xl", "2xl"];
|
|
1228
|
+
function F(e) {
|
|
1229
|
+
const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
|
|
1230
|
+
if (n.length < 2) return null;
|
|
1231
|
+
const i = n.slice(0, -1).join("-"), s = n[n.length - 1], o = parseFloat(s);
|
|
1232
|
+
if (Number.isNaN(o) || !Y[i]) return null;
|
|
1233
|
+
const c = t ? "-" : "";
|
|
1234
|
+
return Y[i].map((d) => `${d}:calc(${c}${ve} * ${o});`).join("");
|
|
1235
|
+
}
|
|
1236
|
+
function ee(e) {
|
|
1237
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, i = r >> 8 & 255, s = r & 255;
|
|
1238
|
+
return `${n} ${i} ${s}`;
|
|
951
1239
|
}
|
|
952
|
-
function
|
|
953
|
-
|
|
1240
|
+
function ke(e) {
|
|
1241
|
+
const t = /^(bg|text|border|shadow|outline|caret|accent)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1242
|
+
if (!t) return null;
|
|
1243
|
+
const [, r, n, i = "DEFAULT"] = t, s = xe[n]?.[i];
|
|
1244
|
+
return s ? `${{
|
|
1245
|
+
bg: "background-color",
|
|
1246
|
+
text: "color",
|
|
1247
|
+
border: "border-color",
|
|
1248
|
+
shadow: "box-shadow",
|
|
1249
|
+
outline: "outline-color",
|
|
1250
|
+
caret: "caret-color",
|
|
1251
|
+
accent: "accent-color"
|
|
1252
|
+
}[r]}:${s};` : null;
|
|
954
1253
|
}
|
|
955
|
-
function
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1254
|
+
function _e(e) {
|
|
1255
|
+
const [t, r] = e.split("/");
|
|
1256
|
+
if (!r) return { base: t };
|
|
1257
|
+
const n = parseInt(r, 10);
|
|
1258
|
+
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
1259
|
+
}
|
|
1260
|
+
function U(e) {
|
|
1261
|
+
const { base: t, opacity: r } = _e(e), n = ke(t);
|
|
1262
|
+
if (n) {
|
|
1263
|
+
if (r !== void 0) {
|
|
1264
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1265
|
+
if (s) {
|
|
1266
|
+
const o = ee(s[0]);
|
|
1267
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
965
1268
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
}
|
|
969
|
-
|
|
1269
|
+
}
|
|
1270
|
+
return n;
|
|
1271
|
+
}
|
|
1272
|
+
const i = D(t);
|
|
1273
|
+
if (i && r !== void 0) {
|
|
1274
|
+
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
1275
|
+
if (s) {
|
|
1276
|
+
const o = ee(s[0]);
|
|
1277
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1278
|
+
}
|
|
970
1279
|
}
|
|
1280
|
+
return i;
|
|
971
1281
|
}
|
|
972
|
-
function
|
|
973
|
-
const
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
i
|
|
1282
|
+
function D(e) {
|
|
1283
|
+
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
1284
|
+
if (t > 0 && r) {
|
|
1285
|
+
const n = e.slice(0, t);
|
|
1286
|
+
let i = e.slice(t + 2, -1);
|
|
1287
|
+
i = i.replace(/_/g, " ");
|
|
1288
|
+
const o = {
|
|
1289
|
+
bg: "background-color",
|
|
1290
|
+
text: "color",
|
|
1291
|
+
p: "padding",
|
|
1292
|
+
px: "padding-inline",
|
|
1293
|
+
py: "padding-block",
|
|
1294
|
+
m: "margin",
|
|
1295
|
+
mx: "margin-inline",
|
|
1296
|
+
my: "margin-block",
|
|
1297
|
+
w: "width",
|
|
1298
|
+
h: "height",
|
|
1299
|
+
"min-w": "min-width",
|
|
1300
|
+
"max-w": "max-width",
|
|
1301
|
+
"min-h": "min-height",
|
|
1302
|
+
"max-h": "max-height",
|
|
1303
|
+
"border-t": "border-top",
|
|
1304
|
+
"border-b": "border-bottom",
|
|
1305
|
+
"border-l": "border-left",
|
|
1306
|
+
"border-r": "border-right",
|
|
1307
|
+
"border-x": "border-inline",
|
|
1308
|
+
"border-y": "border-block",
|
|
1309
|
+
shadow: "box-shadow",
|
|
1310
|
+
duration: "transition-duration",
|
|
1311
|
+
list: "list-style",
|
|
1312
|
+
break: "word-break",
|
|
1313
|
+
flex: "flex-direction",
|
|
1314
|
+
items: "align-items",
|
|
1315
|
+
justify: "justify-content",
|
|
1316
|
+
whitespace: "white-space",
|
|
1317
|
+
select: "user-select",
|
|
1318
|
+
content: "align-content",
|
|
1319
|
+
self: "align-self",
|
|
1320
|
+
basis: "flex-basis",
|
|
1321
|
+
tracking: "letter-spacing",
|
|
1322
|
+
scroll: "scroll-behavior",
|
|
1323
|
+
delay: "transition-delay",
|
|
1324
|
+
weight: "font-weight",
|
|
1325
|
+
leading: "line-height",
|
|
1326
|
+
z: "z-index"
|
|
1327
|
+
}[n] ?? n.replace(/_/g, "-");
|
|
1328
|
+
if (o && i) return `${o}:${i};`;
|
|
977
1329
|
}
|
|
978
|
-
return
|
|
1330
|
+
return null;
|
|
979
1331
|
}
|
|
980
|
-
function
|
|
981
|
-
|
|
982
|
-
const s = ((...r) => {
|
|
983
|
-
t !== null && clearTimeout(t), t = setTimeout(() => {
|
|
984
|
-
n(...r), t = null;
|
|
985
|
-
}, e);
|
|
986
|
-
});
|
|
987
|
-
return s.cancel = () => {
|
|
988
|
-
t !== null && (clearTimeout(t), t = null);
|
|
989
|
-
}, s;
|
|
1332
|
+
function $e(e) {
|
|
1333
|
+
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
990
1334
|
}
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1335
|
+
function Ce(e) {
|
|
1336
|
+
const t = /class\s*=\s*["']([^"']+)["']/g, r = [];
|
|
1337
|
+
let n;
|
|
1338
|
+
for (; n = t.exec(e); ) {
|
|
1339
|
+
let i = "", s = !1;
|
|
1340
|
+
for (const o of n[1])
|
|
1341
|
+
o === "[" && (s = !0), o === "]" && (s = !1), o === " " && !s ? (i && r.push(i), i = "") : i += o;
|
|
1342
|
+
i && r.push(i);
|
|
999
1343
|
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1344
|
+
return r.filter(Boolean);
|
|
1345
|
+
}
|
|
1346
|
+
const te = /* @__PURE__ */ new Map(), Se = 16;
|
|
1347
|
+
function Ae(e) {
|
|
1348
|
+
const t = Date.now(), r = te.get(e);
|
|
1349
|
+
if (r && t - r.timestamp < Se) return r.css;
|
|
1350
|
+
const n = Ce(e), i = new Set(n), s = [], o = [], c = [], d = [], a = {};
|
|
1351
|
+
function u(p, C = !1) {
|
|
1352
|
+
const g = (C ? "dark|" : "") + p;
|
|
1353
|
+
if (g in a) return a[g];
|
|
1354
|
+
const l = f(p, C);
|
|
1355
|
+
return a[g] = l, l;
|
|
1004
1356
|
}
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1357
|
+
function y(p) {
|
|
1358
|
+
const C = p.some((l) => K.includes(l)), g = p.includes("dark");
|
|
1359
|
+
return p.length === 0 ? 1 : !C && !g ? 2 : C && !g ? 3 : 4;
|
|
1360
|
+
}
|
|
1361
|
+
function f(p, C = !1) {
|
|
1362
|
+
const g = p.split(":"), l = g.find(
|
|
1363
|
+
($) => W[$] || F($) || U($) || D($)
|
|
1364
|
+
);
|
|
1365
|
+
if (!l) return null;
|
|
1366
|
+
const b = W[l] ?? F(l) ?? U(l) ?? D(l);
|
|
1367
|
+
if (!b) return null;
|
|
1368
|
+
let m = `.${$e(p)}`, h = b;
|
|
1369
|
+
const x = g.indexOf(l);
|
|
1370
|
+
let S = x >= 0 ? g.slice(0, x) : [];
|
|
1371
|
+
C && (S = S.filter(($) => $ !== "dark"));
|
|
1372
|
+
const k = S.filter(($) => K.includes($)), v = k.length ? k[k.length - 1] : null;
|
|
1373
|
+
for (const $ of S) {
|
|
1374
|
+
if (K.includes($)) continue;
|
|
1375
|
+
const A = we[$];
|
|
1376
|
+
typeof A == "function" && (m = A(m, h).replace(/\{.*$/, ""));
|
|
1015
1377
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
r.length > 0 && (t[s] = {
|
|
1019
|
-
count: r.length,
|
|
1020
|
-
average: r.reduce((i, o) => i + o, 0) / r.length,
|
|
1021
|
-
min: Math.min(...r),
|
|
1022
|
-
max: Math.max(...r)
|
|
1023
|
-
});
|
|
1024
|
-
return t;
|
|
1378
|
+
let _ = `${m}{${h}}`;
|
|
1379
|
+
return C && v ? _ = `@media (prefers-color-scheme: dark) and ${G[v]}{${_}}` : C ? _ = `@media (prefers-color-scheme: dark){${_}}` : v && (_ = `@media ${G[v]}{${_}}`), _;
|
|
1025
1380
|
}
|
|
1026
|
-
|
|
1027
|
-
|
|
1381
|
+
for (const p of i) {
|
|
1382
|
+
const C = p.split(":"), g = C.find(
|
|
1383
|
+
(h) => W[h] || F(h) || U(h) || D(h)
|
|
1384
|
+
);
|
|
1385
|
+
if (!g) continue;
|
|
1386
|
+
const l = C.indexOf(g), b = l >= 0 ? C.slice(0, l) : [], m = y(b);
|
|
1387
|
+
if (m === 4) {
|
|
1388
|
+
const h = u(p, !0);
|
|
1389
|
+
h && d.push(h);
|
|
1390
|
+
} else {
|
|
1391
|
+
const h = u(p);
|
|
1392
|
+
h && (m === 1 ? s.push(h) : m === 2 ? o.push(h) : m === 3 && c.push(h));
|
|
1393
|
+
}
|
|
1028
1394
|
}
|
|
1395
|
+
const w = [...s, ...o, ...c, ...d].join("");
|
|
1396
|
+
return te.set(e, { css: w, timestamp: t }), w;
|
|
1029
1397
|
}
|
|
1030
|
-
const
|
|
1031
|
-
function
|
|
1032
|
-
return
|
|
1398
|
+
const Ee = /* @__PURE__ */ new Map();
|
|
1399
|
+
function Z(e) {
|
|
1400
|
+
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1033
1401
|
}
|
|
1034
|
-
function
|
|
1035
|
-
return typeof
|
|
1402
|
+
function q(e) {
|
|
1403
|
+
return typeof e == "string" ? e.replace(
|
|
1036
1404
|
/[&<>"']/g,
|
|
1037
|
-
(
|
|
1405
|
+
(t) => ({
|
|
1038
1406
|
"&": "&",
|
|
1039
1407
|
"<": "<",
|
|
1040
1408
|
">": ">",
|
|
1041
1409
|
'"': """,
|
|
1042
1410
|
"'": "'"
|
|
1043
|
-
})[
|
|
1044
|
-
) :
|
|
1411
|
+
})[t]
|
|
1412
|
+
) : e;
|
|
1045
1413
|
}
|
|
1046
|
-
function
|
|
1047
|
-
return
|
|
1414
|
+
function Te(e) {
|
|
1415
|
+
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
1048
1416
|
}
|
|
1049
|
-
function
|
|
1050
|
-
let
|
|
1051
|
-
for (let
|
|
1052
|
-
|
|
1053
|
-
return
|
|
1417
|
+
function Me(e, ...t) {
|
|
1418
|
+
let r = "";
|
|
1419
|
+
for (let n = 0; n < e.length; n++)
|
|
1420
|
+
r += e[n], n < t.length && (r += t[n]);
|
|
1421
|
+
return r;
|
|
1054
1422
|
}
|
|
1055
|
-
function
|
|
1056
|
-
let
|
|
1057
|
-
|
|
1058
|
-
let
|
|
1059
|
-
typeof
|
|
1060
|
-
console.error(`[${
|
|
1061
|
-
}),
|
|
1423
|
+
function Pe(e, t, r) {
|
|
1424
|
+
let n = Z(e);
|
|
1425
|
+
n.includes("-") || (n = `cer-${n}`);
|
|
1426
|
+
let i;
|
|
1427
|
+
typeof t == "function" ? i = { ...r, render: t } : i = t, typeof i.onError != "function" && (i.onError = (s, o) => {
|
|
1428
|
+
console.error(`[${n}] Error:`, s, o);
|
|
1429
|
+
}), Ee.set(n, i), typeof window < "u" && !customElements.get(n) && customElements.define(n, Le(i));
|
|
1062
1430
|
}
|
|
1063
|
-
function
|
|
1064
|
-
if (!
|
|
1431
|
+
function Le(e) {
|
|
1432
|
+
if (!e.render)
|
|
1065
1433
|
throw new Error(
|
|
1066
1434
|
"Component must have a render function"
|
|
1067
1435
|
);
|
|
@@ -1077,60 +1445,49 @@ function me(n) {
|
|
|
1077
1445
|
_mounted = !1;
|
|
1078
1446
|
_hasError = !1;
|
|
1079
1447
|
_initializing = !0;
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
_lastStyleHash = "";
|
|
1083
|
-
_styleDependencies = /* @__PURE__ */ new Set();
|
|
1084
|
-
_styleUpdateDebounced;
|
|
1448
|
+
_styleSheet = null;
|
|
1449
|
+
_lastHtmlStringForJitCSS = "";
|
|
1085
1450
|
_cfg;
|
|
1086
1451
|
_lastRenderTime = 0;
|
|
1087
1452
|
_renderCount = 0;
|
|
1088
1453
|
_templateLoading = !1;
|
|
1089
1454
|
_templateError = null;
|
|
1090
1455
|
constructor() {
|
|
1091
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
};
|
|
1096
|
-
this._styleUpdateDebounced = he(
|
|
1097
|
-
(t) => this._applyStyle(t),
|
|
1098
|
-
e.debounceMs
|
|
1099
|
-
), this.context = this._initContext(n), Object.keys(n).forEach((t) => {
|
|
1100
|
-
const s = n[t];
|
|
1101
|
-
typeof s == "function" && !t.startsWith("on") && (this.context[t] = (...r) => s(...r, this.context));
|
|
1102
|
-
}), this._applyProps(n), this._applyComputed(n), this._initializing = !1, this._initWatchers(n), this._render(n);
|
|
1456
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = e, this.context = this._initContext(e), Object.keys(e).forEach((t) => {
|
|
1457
|
+
const r = e[t];
|
|
1458
|
+
typeof r == "function" && !t.startsWith("on") && (this.context[t] = (...n) => r(...n, this.context));
|
|
1459
|
+
}), this._applyProps(e), this._applyComputed(e), this._initializing = !1, this._initWatchers(e), this._render(e);
|
|
1103
1460
|
}
|
|
1104
1461
|
connectedCallback() {
|
|
1105
|
-
this._runLogicWithinErrorBoundary(
|
|
1106
|
-
|
|
1462
|
+
this._runLogicWithinErrorBoundary(e, () => {
|
|
1463
|
+
e.onConnected && !this._mounted && (e.onConnected(this.context), this._mounted = !0);
|
|
1107
1464
|
});
|
|
1108
1465
|
}
|
|
1109
1466
|
disconnectedCallback() {
|
|
1110
|
-
this._runLogicWithinErrorBoundary(
|
|
1111
|
-
|
|
1467
|
+
this._runLogicWithinErrorBoundary(e, () => {
|
|
1468
|
+
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;
|
|
1112
1469
|
});
|
|
1113
1470
|
}
|
|
1114
|
-
attributeChangedCallback(
|
|
1115
|
-
this._runLogicWithinErrorBoundary(
|
|
1116
|
-
this._applyProps(
|
|
1117
|
-
e,
|
|
1471
|
+
attributeChangedCallback(t, r, n) {
|
|
1472
|
+
this._runLogicWithinErrorBoundary(e, () => {
|
|
1473
|
+
this._applyProps(e), e.onAttributeChanged && e.onAttributeChanged(
|
|
1118
1474
|
t,
|
|
1119
|
-
|
|
1475
|
+
r,
|
|
1476
|
+
n,
|
|
1120
1477
|
this.context
|
|
1121
1478
|
);
|
|
1122
1479
|
});
|
|
1123
1480
|
}
|
|
1124
1481
|
static get observedAttributes() {
|
|
1125
|
-
return
|
|
1482
|
+
return e.props ? Object.keys(e.props).map(Z) : [];
|
|
1126
1483
|
}
|
|
1127
|
-
_applyComputed(
|
|
1128
|
-
this._runLogicWithinErrorBoundary(
|
|
1129
|
-
|
|
1130
|
-
Object.defineProperty(this.context,
|
|
1484
|
+
_applyComputed(t) {
|
|
1485
|
+
this._runLogicWithinErrorBoundary(e, () => {
|
|
1486
|
+
t.computed && Object.entries(t.computed).forEach(([r, n]) => {
|
|
1487
|
+
Object.defineProperty(this.context, r, {
|
|
1131
1488
|
get: () => {
|
|
1132
|
-
const
|
|
1133
|
-
return
|
|
1489
|
+
const i = n(this.context);
|
|
1490
|
+
return q(i);
|
|
1134
1491
|
},
|
|
1135
1492
|
enumerable: !0
|
|
1136
1493
|
});
|
|
@@ -1138,51 +1495,51 @@ function me(n) {
|
|
|
1138
1495
|
});
|
|
1139
1496
|
}
|
|
1140
1497
|
// --- Render ---
|
|
1141
|
-
_render(
|
|
1142
|
-
this._runLogicWithinErrorBoundary(
|
|
1498
|
+
_render(t) {
|
|
1499
|
+
this._runLogicWithinErrorBoundary(t, () => {
|
|
1143
1500
|
if (!this.shadowRoot) return;
|
|
1144
|
-
if (this.
|
|
1145
|
-
this._renderOutput(
|
|
1501
|
+
if (this._templateLoading && t.loadingTemplate) {
|
|
1502
|
+
this._renderOutput(t.loadingTemplate(this.context));
|
|
1146
1503
|
return;
|
|
1147
1504
|
}
|
|
1148
|
-
if (this._templateError &&
|
|
1149
|
-
this._renderOutput(
|
|
1505
|
+
if (this._templateError && t.errorTemplate) {
|
|
1506
|
+
this._renderOutput(t.errorTemplate(this._templateError, this.context));
|
|
1150
1507
|
return;
|
|
1151
1508
|
}
|
|
1152
|
-
const
|
|
1153
|
-
if (
|
|
1154
|
-
this._templateLoading = !0,
|
|
1155
|
-
if (this._templateLoading = !1, this._templateError =
|
|
1156
|
-
const
|
|
1157
|
-
return this._renderOutput(
|
|
1509
|
+
const r = t.render(this.context);
|
|
1510
|
+
if (r instanceof Promise) {
|
|
1511
|
+
this._templateLoading = !0, r.then((n) => (this._templateLoading = !1, this._templateError = null, this._renderOutput(n), n)).catch((n) => {
|
|
1512
|
+
if (this._templateLoading = !1, this._templateError = n, t.errorTemplate) {
|
|
1513
|
+
const i = t.errorTemplate(n, this.context);
|
|
1514
|
+
return this._renderOutput(i), i;
|
|
1158
1515
|
}
|
|
1159
|
-
throw
|
|
1160
|
-
}),
|
|
1516
|
+
throw n;
|
|
1517
|
+
}), t.loadingTemplate && this._renderOutput(t.loadingTemplate(this.context));
|
|
1161
1518
|
return;
|
|
1162
1519
|
}
|
|
1163
|
-
this._renderOutput(
|
|
1520
|
+
this._renderOutput(r), this._applyStyle(t);
|
|
1164
1521
|
});
|
|
1165
1522
|
}
|
|
1166
1523
|
// --- Helper to render output ---
|
|
1167
|
-
_renderOutput(
|
|
1524
|
+
_renderOutput(t) {
|
|
1168
1525
|
if (!this.shadowRoot) return;
|
|
1169
|
-
const
|
|
1170
|
-
get: (
|
|
1171
|
-
set: (
|
|
1172
|
-
if (typeof
|
|
1173
|
-
const o =
|
|
1174
|
-
if (!
|
|
1175
|
-
const
|
|
1176
|
-
return
|
|
1526
|
+
const r = new Proxy(this.context, {
|
|
1527
|
+
get: (n, i) => i === "_requestRender" ? () => this._requestRender() : i === "context" ? n : typeof i == "string" && i.includes(".") ? i.split(".").reduce((s, o) => s?.[o], n) : n[i],
|
|
1528
|
+
set: (n, i, s) => {
|
|
1529
|
+
if (typeof i == "string" && i.includes(".")) {
|
|
1530
|
+
const o = i.split("."), c = o.pop();
|
|
1531
|
+
if (!c) return !1;
|
|
1532
|
+
const d = o.reduce((a, u) => (u in a || (a[u] = {}), a[u]), n);
|
|
1533
|
+
return d[c] = s, !0;
|
|
1177
1534
|
}
|
|
1178
|
-
return
|
|
1535
|
+
return n[i] = s, !0;
|
|
1179
1536
|
}
|
|
1180
1537
|
});
|
|
1181
|
-
|
|
1538
|
+
me(
|
|
1182
1539
|
this.shadowRoot,
|
|
1183
|
-
Array.isArray(
|
|
1184
|
-
|
|
1185
|
-
), this.
|
|
1540
|
+
Array.isArray(t) ? t : [t],
|
|
1541
|
+
r
|
|
1542
|
+
), this._lastHtmlStringForJitCSS = this.shadowRoot.innerHTML;
|
|
1186
1543
|
}
|
|
1187
1544
|
_requestRender() {
|
|
1188
1545
|
if (this._renderTimeoutId !== null && clearTimeout(this._renderTimeoutId), Date.now() - this._lastRenderTime < 16) {
|
|
@@ -1198,85 +1555,44 @@ function me(n) {
|
|
|
1198
1555
|
this._lastRenderTime = Date.now(), this._render(this._cfg), this._renderTimeoutId = null;
|
|
1199
1556
|
}, 0);
|
|
1200
1557
|
}
|
|
1201
|
-
// Request style-only update (more efficient than full render)
|
|
1202
|
-
_requestStyleUpdate() {
|
|
1203
|
-
this._styleUpdateDebounced(this._cfg);
|
|
1204
|
-
}
|
|
1205
1558
|
// --- Style ---
|
|
1206
|
-
_applyStyle(
|
|
1207
|
-
this._runLogicWithinErrorBoundary(
|
|
1208
|
-
if (!this.shadowRoot)
|
|
1559
|
+
_applyStyle(t) {
|
|
1560
|
+
this._runLogicWithinErrorBoundary(t, () => {
|
|
1561
|
+
if (!this.shadowRoot) return;
|
|
1562
|
+
const r = Ae(this._lastHtmlStringForJitCSS);
|
|
1563
|
+
if (!t.style && (!r || r.trim() === "")) {
|
|
1564
|
+
this._styleSheet = null;
|
|
1209
1565
|
return;
|
|
1210
|
-
const t = pe.startTimer("applyStyle");
|
|
1211
|
-
try {
|
|
1212
|
-
if (this._styleElement || (this._styleElement = this.shadowRoot.querySelector(
|
|
1213
|
-
"style"
|
|
1214
|
-
), this._styleElement || typeof document < "u" && (this._styleElement = document.createElement("style"), this.shadowRoot.prepend(this._styleElement))), !e.style) {
|
|
1215
|
-
this._styleElement.textContent = "";
|
|
1216
|
-
return;
|
|
1217
|
-
}
|
|
1218
|
-
const s = {
|
|
1219
|
-
enableCaching: !0,
|
|
1220
|
-
enableMinification: !1,
|
|
1221
|
-
enableDeduplication: !0,
|
|
1222
|
-
cacheSize: 100,
|
|
1223
|
-
debounceMs: 16,
|
|
1224
|
-
...e.styleOptimizations
|
|
1225
|
-
};
|
|
1226
|
-
let r;
|
|
1227
|
-
typeof e.style == "string" ? r = {
|
|
1228
|
-
css: e.style,
|
|
1229
|
-
cache: s.enableCaching
|
|
1230
|
-
} : typeof e.style == "function" ? r = {
|
|
1231
|
-
css: e.style,
|
|
1232
|
-
cache: s.enableCaching
|
|
1233
|
-
} : r = {
|
|
1234
|
-
cache: s.enableCaching,
|
|
1235
|
-
...e.style
|
|
1236
|
-
};
|
|
1237
|
-
const i = r.dependencies || [], o = r.cache !== !1 && s.enableCaching;
|
|
1238
|
-
let l = "";
|
|
1239
|
-
if (o && i.length > 0) {
|
|
1240
|
-
const h = i.map((d) => this.context[d]);
|
|
1241
|
-
if (l = ue(h), this._lastStyleHash === l && this._styleCache.has(l)) {
|
|
1242
|
-
const d = this._styleCache.get(l);
|
|
1243
|
-
this._styleElement.textContent !== d && (this._styleElement.textContent = d);
|
|
1244
|
-
return;
|
|
1245
|
-
}
|
|
1246
|
-
}
|
|
1247
|
-
(!o || i.length === 0) && (l = "no-deps-" + Date.now());
|
|
1248
|
-
const f = typeof r.css == "function" ? r.css(this.context) : r.css;
|
|
1249
|
-
let c = ge(f);
|
|
1250
|
-
s.enableMinification && (c = ae(c)), s.enableDeduplication && (c = fe(c)), o && i.length > 0 && (this._styleCache.set(
|
|
1251
|
-
l,
|
|
1252
|
-
c,
|
|
1253
|
-
i.map(String)
|
|
1254
|
-
), this._lastStyleHash = l), this._styleElement.textContent !== c && (this._styleElement.textContent = c);
|
|
1255
|
-
} finally {
|
|
1256
|
-
t();
|
|
1257
1566
|
}
|
|
1567
|
+
let n = "";
|
|
1568
|
+
t.style && (typeof t.style == "string" ? n = t.style : typeof t.style == "function" && (n = t.style(this.context)));
|
|
1569
|
+
let i = Te(`${be}
|
|
1570
|
+
${n}
|
|
1571
|
+
${r}
|
|
1572
|
+
`);
|
|
1573
|
+
t.minifyCSS && (i = ye(i)), this._styleSheet || (this._styleSheet = new CSSStyleSheet()), this._styleSheet.replaceSync(i), this.shadowRoot.adoptedStyleSheets = [this._styleSheet];
|
|
1258
1574
|
});
|
|
1259
1575
|
}
|
|
1260
1576
|
// --- Error Boundary function ---
|
|
1261
|
-
_runLogicWithinErrorBoundary(
|
|
1577
|
+
_runLogicWithinErrorBoundary(t, r) {
|
|
1262
1578
|
this._hasError && (this._hasError = !1);
|
|
1263
1579
|
try {
|
|
1264
|
-
|
|
1265
|
-
} catch (
|
|
1266
|
-
this._hasError = !0,
|
|
1267
|
-
|
|
1580
|
+
r();
|
|
1581
|
+
} catch (n) {
|
|
1582
|
+
this._hasError = !0, t.onError && t.onError(n, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(
|
|
1583
|
+
n,
|
|
1268
1584
|
this.context
|
|
1269
1585
|
));
|
|
1270
1586
|
}
|
|
1271
1587
|
}
|
|
1272
1588
|
// --- State, props, computed ---
|
|
1273
|
-
_initContext(
|
|
1589
|
+
_initContext(t) {
|
|
1274
1590
|
try {
|
|
1275
|
-
let
|
|
1276
|
-
return Array.isArray(
|
|
1277
|
-
get(o,
|
|
1278
|
-
const
|
|
1279
|
-
return typeof
|
|
1591
|
+
let r = function(i, s = "") {
|
|
1592
|
+
return Array.isArray(i) ? new Proxy(i, {
|
|
1593
|
+
get(o, c, d) {
|
|
1594
|
+
const a = Reflect.get(o, c, d);
|
|
1595
|
+
return typeof a == "function" && typeof c == "string" && [
|
|
1280
1596
|
"push",
|
|
1281
1597
|
"pop",
|
|
1282
1598
|
"shift",
|
|
@@ -1284,122 +1600,113 @@ function me(n) {
|
|
|
1284
1600
|
"splice",
|
|
1285
1601
|
"sort",
|
|
1286
1602
|
"reverse"
|
|
1287
|
-
].includes(
|
|
1288
|
-
const
|
|
1289
|
-
if (!
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1603
|
+
].includes(c) ? function(...y) {
|
|
1604
|
+
const f = a.apply(o, y);
|
|
1605
|
+
if (!n._initializing) {
|
|
1606
|
+
const w = s || "root";
|
|
1607
|
+
n._triggerWatchers(w, o), n._render(t);
|
|
1292
1608
|
}
|
|
1293
|
-
return
|
|
1294
|
-
} :
|
|
1609
|
+
return f;
|
|
1610
|
+
} : a;
|
|
1295
1611
|
},
|
|
1296
|
-
set(o,
|
|
1297
|
-
if (o[
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
const h = e.style;
|
|
1301
|
-
let d = !1;
|
|
1302
|
-
if (h && typeof h == "object" && "dependencies" in h) {
|
|
1303
|
-
const a = h.dependencies || [];
|
|
1304
|
-
d = a.includes(String(l)) && a.every(
|
|
1305
|
-
(_) => !s._styleDependencies.has(String(_)) || _ === l
|
|
1306
|
-
);
|
|
1307
|
-
}
|
|
1308
|
-
d ? s._requestStyleUpdate() : s._render(e);
|
|
1612
|
+
set(o, c, d) {
|
|
1613
|
+
if (o[c] = d, !n._initializing) {
|
|
1614
|
+
const a = s ? `${s}.${String(c)}` : String(c);
|
|
1615
|
+
n._triggerWatchers(a, d), n._render(t);
|
|
1309
1616
|
}
|
|
1310
1617
|
return !0;
|
|
1311
1618
|
},
|
|
1312
|
-
deleteProperty(o,
|
|
1313
|
-
if (delete o[
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1619
|
+
deleteProperty(o, c) {
|
|
1620
|
+
if (delete o[c], !n._initializing) {
|
|
1621
|
+
const d = s ? `${s}.${String(c)}` : String(c);
|
|
1622
|
+
n._triggerWatchers(d, void 0), n._render(t);
|
|
1316
1623
|
}
|
|
1317
1624
|
return !0;
|
|
1318
1625
|
}
|
|
1319
|
-
}) :
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1322
|
-
}), new Proxy(
|
|
1323
|
-
set(o,
|
|
1324
|
-
const
|
|
1325
|
-
return o[
|
|
1326
|
-
|
|
1327
|
-
o[
|
|
1328
|
-
),
|
|
1626
|
+
}) : i && typeof i == "object" ? (Object.keys(i).forEach((o) => {
|
|
1627
|
+
const c = s ? `${s}.${o}` : o;
|
|
1628
|
+
i[o] = r(i[o], c);
|
|
1629
|
+
}), new Proxy(i, {
|
|
1630
|
+
set(o, c, d) {
|
|
1631
|
+
const a = s ? `${s}.${String(c)}` : String(c);
|
|
1632
|
+
return o[c] = r(d, a), n._initializing || (n._triggerWatchers(
|
|
1633
|
+
a,
|
|
1634
|
+
o[c]
|
|
1635
|
+
), n._render(t)), !0;
|
|
1329
1636
|
},
|
|
1330
|
-
get(o,
|
|
1331
|
-
return Reflect.get(o,
|
|
1637
|
+
get(o, c, d) {
|
|
1638
|
+
return Reflect.get(o, c, d);
|
|
1332
1639
|
}
|
|
1333
|
-
})) :
|
|
1640
|
+
})) : i;
|
|
1334
1641
|
};
|
|
1335
|
-
const
|
|
1336
|
-
return
|
|
1642
|
+
const n = this;
|
|
1643
|
+
return r({ ...t.state });
|
|
1337
1644
|
} catch {
|
|
1338
1645
|
return {};
|
|
1339
1646
|
}
|
|
1340
1647
|
}
|
|
1341
|
-
_initWatchers(
|
|
1342
|
-
if (
|
|
1343
|
-
for (const [
|
|
1344
|
-
let
|
|
1345
|
-
if (Array.isArray(
|
|
1346
|
-
callback:
|
|
1347
|
-
options:
|
|
1348
|
-
oldValue: this._getNestedValue(
|
|
1349
|
-
}),
|
|
1648
|
+
_initWatchers(t) {
|
|
1649
|
+
if (t.watch)
|
|
1650
|
+
for (const [r, n] of Object.entries(t.watch)) {
|
|
1651
|
+
let i, s = {};
|
|
1652
|
+
if (Array.isArray(n) ? (i = n[0], s = n[1] || {}) : i = n, this._watchers.set(r, {
|
|
1653
|
+
callback: i,
|
|
1654
|
+
options: s,
|
|
1655
|
+
oldValue: this._getNestedValue(r)
|
|
1656
|
+
}), s.immediate)
|
|
1350
1657
|
try {
|
|
1351
|
-
const o = this._getNestedValue(
|
|
1352
|
-
|
|
1658
|
+
const o = this._getNestedValue(r);
|
|
1659
|
+
i(o, void 0, this.context);
|
|
1353
1660
|
} catch (o) {
|
|
1354
|
-
console.error(`Error in immediate watcher for "${
|
|
1661
|
+
console.error(`Error in immediate watcher for "${r}":`, o);
|
|
1355
1662
|
}
|
|
1356
1663
|
}
|
|
1357
1664
|
}
|
|
1358
|
-
_getNestedValue(
|
|
1359
|
-
return
|
|
1360
|
-
(
|
|
1665
|
+
_getNestedValue(t) {
|
|
1666
|
+
return t.split(".").reduce(
|
|
1667
|
+
(r, n) => r?.[n],
|
|
1361
1668
|
this.context
|
|
1362
1669
|
);
|
|
1363
1670
|
}
|
|
1364
|
-
_triggerWatchers(
|
|
1365
|
-
const
|
|
1366
|
-
if (
|
|
1367
|
-
if (typeof
|
|
1368
|
-
if (Array.isArray(
|
|
1369
|
-
return
|
|
1370
|
-
const
|
|
1371
|
-
return
|
|
1372
|
-
},
|
|
1373
|
-
if (
|
|
1671
|
+
_triggerWatchers(t, r) {
|
|
1672
|
+
const n = (s, o) => {
|
|
1673
|
+
if (s === o) return !0;
|
|
1674
|
+
if (typeof s != typeof o || typeof s != "object" || s === null || o === null) return !1;
|
|
1675
|
+
if (Array.isArray(s) && Array.isArray(o))
|
|
1676
|
+
return s.length !== o.length ? !1 : s.every((a, u) => n(a, o[u]));
|
|
1677
|
+
const c = Object.keys(s), d = Object.keys(o);
|
|
1678
|
+
return c.length !== d.length ? !1 : c.every((a) => n(s[a], o[a]));
|
|
1679
|
+
}, i = this._watchers.get(t);
|
|
1680
|
+
if (i && !n(r, i.oldValue))
|
|
1374
1681
|
try {
|
|
1375
|
-
|
|
1376
|
-
} catch (
|
|
1377
|
-
console.error(`Error in watcher for "${
|
|
1682
|
+
i.callback(r, i.oldValue, this.context), i.oldValue = r;
|
|
1683
|
+
} catch (s) {
|
|
1684
|
+
console.error(`Error in watcher for "${t}":`, s);
|
|
1378
1685
|
}
|
|
1379
|
-
for (const [
|
|
1380
|
-
if (o.options.deep &&
|
|
1686
|
+
for (const [s, o] of this._watchers.entries())
|
|
1687
|
+
if (o.options.deep && t.startsWith(s + "."))
|
|
1381
1688
|
try {
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1384
|
-
} catch (
|
|
1385
|
-
console.error(`Error in deep watcher for "${
|
|
1689
|
+
const c = this._getNestedValue(s);
|
|
1690
|
+
n(c, o.oldValue) || (o.callback(c, o.oldValue, this.context), o.oldValue = c);
|
|
1691
|
+
} catch (c) {
|
|
1692
|
+
console.error(`Error in deep watcher for "${s}":`, c);
|
|
1386
1693
|
}
|
|
1387
1694
|
}
|
|
1388
|
-
_applyProps(
|
|
1695
|
+
_applyProps(t) {
|
|
1389
1696
|
try {
|
|
1390
|
-
let
|
|
1391
|
-
return
|
|
1697
|
+
let r = function(n, i) {
|
|
1698
|
+
return i === Boolean ? n === "true" : i === Number ? Number(n) : n;
|
|
1392
1699
|
};
|
|
1393
|
-
if (!
|
|
1394
|
-
Object.entries(
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
) : "default" in
|
|
1700
|
+
if (!t.props) return;
|
|
1701
|
+
Object.entries(t.props).forEach(([n, i]) => {
|
|
1702
|
+
const s = this.getAttribute(Z(n));
|
|
1703
|
+
s !== null ? this.context[n] = q(
|
|
1704
|
+
r(s, i.type)
|
|
1705
|
+
) : "default" in i && i.default !== void 0 && (this.context[n] = q(i.default));
|
|
1399
1706
|
});
|
|
1400
|
-
} catch (
|
|
1401
|
-
this._hasError = !0,
|
|
1402
|
-
|
|
1707
|
+
} catch (r) {
|
|
1708
|
+
this._hasError = !0, t.onError && t.onError(r, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(
|
|
1709
|
+
r,
|
|
1403
1710
|
this.context
|
|
1404
1711
|
));
|
|
1405
1712
|
}
|
|
@@ -1407,14 +1714,14 @@ function me(n) {
|
|
|
1407
1714
|
};
|
|
1408
1715
|
}
|
|
1409
1716
|
export {
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1717
|
+
Pe as component,
|
|
1718
|
+
Le as createElementClass,
|
|
1719
|
+
Ne as createStore,
|
|
1720
|
+
Me as css,
|
|
1721
|
+
Be as each,
|
|
1722
|
+
je as eventBus,
|
|
1723
|
+
ze as html,
|
|
1724
|
+
Oe as match,
|
|
1725
|
+
Re as when
|
|
1419
1726
|
};
|
|
1420
1727
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|