@koppajs/koppajs-core 3.0.6 → 3.0.8
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/CHANGELOG.md +34 -4
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +847 -795
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var Ie = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e[e.NONE = 4] = "NONE", e))(Ie || {});
|
|
2
|
+
const q = {
|
|
3
3
|
ERROR: "❌",
|
|
4
4
|
WARN: "⚠️",
|
|
5
5
|
INFO: "ℹ️",
|
|
6
6
|
DEBUG: "🔍"
|
|
7
7
|
};
|
|
8
|
-
class
|
|
8
|
+
class Le {
|
|
9
9
|
level = 3;
|
|
10
10
|
isDevelopment = !1;
|
|
11
11
|
/**
|
|
@@ -34,57 +34,57 @@ class Pe {
|
|
|
34
34
|
shouldLog(t) {
|
|
35
35
|
return t >= this.level;
|
|
36
36
|
}
|
|
37
|
-
formatMessage(t,
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
const
|
|
41
|
-
|
|
37
|
+
formatMessage(t, o, n) {
|
|
38
|
+
const i = [t, o];
|
|
39
|
+
if (n) {
|
|
40
|
+
const l = Object.entries(n).map(([r, s]) => `${r}: ${s}`).join(", ");
|
|
41
|
+
l && i.push(`[${l}]`);
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return i.join(" ");
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Log an error message.
|
|
47
47
|
* @param message - Error message
|
|
48
48
|
* @param args - Additional arguments to log
|
|
49
49
|
*/
|
|
50
|
-
error(t, ...
|
|
50
|
+
error(t, ...o) {
|
|
51
51
|
this.shouldLog(
|
|
52
52
|
3
|
|
53
53
|
/* ERROR */
|
|
54
|
-
) && console.error(this.formatMessage(
|
|
54
|
+
) && console.error(this.formatMessage(q.ERROR, t), ...o);
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Log a warning message.
|
|
58
58
|
* @param message - Warning message
|
|
59
59
|
* @param args - Additional arguments to log
|
|
60
60
|
*/
|
|
61
|
-
warn(t, ...
|
|
61
|
+
warn(t, ...o) {
|
|
62
62
|
this.shouldLog(
|
|
63
63
|
2
|
|
64
64
|
/* WARN */
|
|
65
|
-
) && console.warn(this.formatMessage(
|
|
65
|
+
) && console.warn(this.formatMessage(q.WARN, t), ...o);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Log an info message.
|
|
69
69
|
* @param message - Info message
|
|
70
70
|
* @param args - Additional arguments to log
|
|
71
71
|
*/
|
|
72
|
-
info(t, ...
|
|
72
|
+
info(t, ...o) {
|
|
73
73
|
this.shouldLog(
|
|
74
74
|
1
|
|
75
75
|
/* INFO */
|
|
76
|
-
) && console.info(this.formatMessage(
|
|
76
|
+
) && console.info(this.formatMessage(q.INFO, t), ...o);
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Log a debug message.
|
|
80
80
|
* @param message - Debug message
|
|
81
81
|
* @param args - Additional arguments to log
|
|
82
82
|
*/
|
|
83
|
-
debug(t, ...
|
|
83
|
+
debug(t, ...o) {
|
|
84
84
|
this.shouldLog(
|
|
85
85
|
0
|
|
86
86
|
/* DEBUG */
|
|
87
|
-
) && console.debug(this.formatMessage(
|
|
87
|
+
) && console.debug(this.formatMessage(q.DEBUG, t), ...o);
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* Log an error with context information.
|
|
@@ -92,29 +92,29 @@ class Pe {
|
|
|
92
92
|
* @param context - Context object with additional information
|
|
93
93
|
* @param error - Optional error object
|
|
94
94
|
*/
|
|
95
|
-
errorWithContext(t,
|
|
95
|
+
errorWithContext(t, o, n) {
|
|
96
96
|
if (!this.shouldLog(
|
|
97
97
|
3
|
|
98
98
|
/* ERROR */
|
|
99
99
|
)) return;
|
|
100
|
-
const
|
|
101
|
-
|
|
100
|
+
const i = this.formatMessage(q.ERROR, t, o);
|
|
101
|
+
n ? console.error(i, n) : console.error(i);
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* Log a warning with context information.
|
|
105
105
|
* @param message - Warning message
|
|
106
106
|
* @param context - Context object with additional information
|
|
107
107
|
*/
|
|
108
|
-
warnWithContext(t,
|
|
108
|
+
warnWithContext(t, o) {
|
|
109
109
|
this.shouldLog(
|
|
110
110
|
2
|
|
111
111
|
/* WARN */
|
|
112
|
-
) && console.warn(this.formatMessage(
|
|
112
|
+
) && console.warn(this.formatMessage(q.WARN, t, o));
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
const
|
|
115
|
+
const S = new Le();
|
|
116
|
+
S.init();
|
|
117
|
+
const fe = /* @__PURE__ */ Symbol("isBounded"), ge = /* @__PURE__ */ Symbol("isProxy"), De = [
|
|
118
118
|
"created",
|
|
119
119
|
"beforeMount",
|
|
120
120
|
"mounted",
|
|
@@ -124,22 +124,22 @@ const ce = /* @__PURE__ */ Symbol("isBounded"), pe = /* @__PURE__ */ Symbol("isP
|
|
|
124
124
|
"destroyed",
|
|
125
125
|
"processed"
|
|
126
126
|
];
|
|
127
|
-
function
|
|
128
|
-
if (typeof e != "function" || e[
|
|
129
|
-
const
|
|
130
|
-
return
|
|
127
|
+
function Y(e, t) {
|
|
128
|
+
if (typeof e != "function" || e[fe]) return e;
|
|
129
|
+
const n = e.bind(t);
|
|
130
|
+
return n[fe] = !0, n;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
for (const
|
|
134
|
-
const
|
|
135
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
132
|
+
function We(e, t) {
|
|
133
|
+
for (const o in e) {
|
|
134
|
+
const n = e[o];
|
|
135
|
+
if (Object.prototype.hasOwnProperty.call(e, o) && typeof n == "function")
|
|
136
136
|
try {
|
|
137
|
-
e[
|
|
138
|
-
} catch (
|
|
139
|
-
|
|
140
|
-
`Failed to bind method "${
|
|
141
|
-
{ methodName:
|
|
142
|
-
|
|
137
|
+
e[o] = Y(n, t);
|
|
138
|
+
} catch (i) {
|
|
139
|
+
S.errorWithContext(
|
|
140
|
+
`Failed to bind method "${o}"`,
|
|
141
|
+
{ methodName: o },
|
|
142
|
+
i
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -147,69 +147,69 @@ function Le(e, t) {
|
|
|
147
147
|
function Fe(e) {
|
|
148
148
|
return /<\/?[a-z][^>]*>/i.test(e);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function re(e, t) {
|
|
151
151
|
if (e == null || typeof t != "string") return;
|
|
152
|
-
const
|
|
152
|
+
const o = t.trim().replace(/\[(\w+)\]/g, ".$1").split(".").filter(Boolean);
|
|
153
153
|
try {
|
|
154
|
-
return
|
|
155
|
-
if (
|
|
156
|
-
return
|
|
154
|
+
return o.reduce((n, i) => {
|
|
155
|
+
if (n != null)
|
|
156
|
+
return n[i];
|
|
157
157
|
}, e);
|
|
158
158
|
} catch {
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Ve(e) {
|
|
163
163
|
return typeof e == "string" ? e.toLowerCase() : typeof e == "function" && typeof e.name == "string" ? e.name.toLowerCase() : "unknown";
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function be(e) {
|
|
166
166
|
const t = e.trim();
|
|
167
167
|
return /^[a-zA-Z_$][0-9a-zA-Z_$]*(?:\[(?:\d+|\w+)\]|\.[a-zA-Z_$][0-9a-zA-Z_$]*)*$/.test(
|
|
168
168
|
t
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function je(e, t, o) {
|
|
172
172
|
if (e == null || typeof e != "object" && typeof e != "function")
|
|
173
173
|
throw new Error("❌ setValueByPath: target must be an object.");
|
|
174
174
|
if (typeof t != "string" || !t.trim())
|
|
175
175
|
throw new Error("❌ setValueByPath: path must be a non-empty string.");
|
|
176
|
-
const
|
|
177
|
-
if (
|
|
176
|
+
const n = t.trim().replace(/\[(\w+)\]/g, ".$1").split(".").filter(Boolean);
|
|
177
|
+
if (n.length === 0)
|
|
178
178
|
throw new Error(`❌ setValueByPath: invalid path "${t}".`);
|
|
179
|
-
const
|
|
180
|
-
let
|
|
181
|
-
for (const c of
|
|
182
|
-
if (
|
|
179
|
+
const i = (c, a) => Object.prototype.hasOwnProperty.call(c, a), l = n.pop();
|
|
180
|
+
let r = e;
|
|
181
|
+
for (const c of n) {
|
|
182
|
+
if (r == null || typeof r != "object" && typeof r != "function")
|
|
183
183
|
throw new Error(
|
|
184
184
|
`❌ setValueByPath: invalid path "${t}". Segment "${c}" is not an object.`
|
|
185
185
|
);
|
|
186
|
-
if (!r
|
|
186
|
+
if (!i(r, c))
|
|
187
187
|
throw new Error(
|
|
188
188
|
`❌ setValueByPath: invalid path "${t}". Missing segment "${c}".`
|
|
189
189
|
);
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
190
|
+
const a = r[c];
|
|
191
|
+
if (a == null || typeof a != "object" && typeof a != "function")
|
|
192
192
|
throw new Error(
|
|
193
193
|
`❌ setValueByPath: invalid path "${t}". Segment "${c}" is not an object.`
|
|
194
194
|
);
|
|
195
|
-
|
|
195
|
+
r = a;
|
|
196
196
|
}
|
|
197
|
-
if (
|
|
197
|
+
if (r == null || typeof r != "object" && typeof r != "function")
|
|
198
198
|
throw new Error(
|
|
199
199
|
`❌ setValueByPath: invalid path "${t}". Final target is not an object.`
|
|
200
200
|
);
|
|
201
|
-
if (!r
|
|
201
|
+
if (!i(r, l))
|
|
202
202
|
throw new Error(
|
|
203
|
-
`❌ setValueByPath: invalid path "${t}". Final key "${
|
|
203
|
+
`❌ setValueByPath: invalid path "${t}". Final key "${l}" does not exist.`
|
|
204
204
|
);
|
|
205
|
-
const s = Object.getOwnPropertyDescriptor(
|
|
205
|
+
const s = Object.getOwnPropertyDescriptor(r, l);
|
|
206
206
|
if (s && s.writable === !1 && !s.set)
|
|
207
207
|
throw new Error(
|
|
208
|
-
`❌ setValueByPath: cannot write "${t}". Property "${
|
|
208
|
+
`❌ setValueByPath: cannot write "${t}". Property "${l}" is read-only.`
|
|
209
209
|
);
|
|
210
|
-
|
|
210
|
+
r[l] = o;
|
|
211
211
|
}
|
|
212
|
-
const
|
|
212
|
+
const He = {
|
|
213
213
|
select: {
|
|
214
214
|
get() {
|
|
215
215
|
return (e) => this instanceof HTMLInputElement || this instanceof HTMLTextAreaElement ? (this.select(), null) : this.querySelector(e);
|
|
@@ -252,9 +252,9 @@ const je = {
|
|
|
252
252
|
return (e) => {
|
|
253
253
|
if (!this.parentNode) return [];
|
|
254
254
|
const t = [];
|
|
255
|
-
let
|
|
256
|
-
for (;
|
|
257
|
-
|
|
255
|
+
let o = this.parentNode.firstChild;
|
|
256
|
+
for (; o; )
|
|
257
|
+
o.nodeType === Node.ELEMENT_NODE && o !== this && o instanceof HTMLElement && (e?.(o), t.push(o)), o = o.nextSibling;
|
|
258
258
|
return t;
|
|
259
259
|
};
|
|
260
260
|
}
|
|
@@ -278,51 +278,51 @@ const je = {
|
|
|
278
278
|
return (e, t) => (t !== void 0 && this.setAttribute(e, t || "true"), this.getAttribute(e));
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
},
|
|
282
|
-
function
|
|
281
|
+
}, Be = {};
|
|
282
|
+
function qe(e) {
|
|
283
283
|
return e.replace(/-./g, (t) => t[1].toUpperCase());
|
|
284
284
|
}
|
|
285
|
-
const
|
|
286
|
-
function
|
|
287
|
-
const t = Object.keys(e),
|
|
288
|
-
if (
|
|
289
|
-
return
|
|
290
|
-
const
|
|
291
|
-
return
|
|
285
|
+
const ze = /(?:\bwindow\b|\bdocument\b|\bglobalThis\b|\bFunction\b|\beval\b|\bsetTimeout\b|\bsetInterval\b|\bfetch\b|\bXMLHttpRequest\b|\bimport\b|\brequire\b|\bthis\b)/, z = /* @__PURE__ */ new Map(), Ue = 1e3, ue = /* @__PURE__ */ new WeakMap();
|
|
286
|
+
function Xe(e) {
|
|
287
|
+
const t = Object.keys(e), o = t.join("\0"), n = ue.get(e);
|
|
288
|
+
if (n && n.fingerprint === o)
|
|
289
|
+
return n.keys;
|
|
290
|
+
const i = t.sort();
|
|
291
|
+
return ue.set(e, { keys: i, fingerprint: o }), i;
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
293
|
+
function B(e, t = {}) {
|
|
294
|
+
const o = (e ?? "").trim();
|
|
295
|
+
if (o)
|
|
296
296
|
try {
|
|
297
|
-
if (
|
|
297
|
+
if (ze.test(o))
|
|
298
298
|
return;
|
|
299
|
-
if (
|
|
300
|
-
const
|
|
301
|
-
return typeof
|
|
299
|
+
if (be(o)) {
|
|
300
|
+
const r = re(t, o);
|
|
301
|
+
return typeof r == "function" ? r.call(t) : r;
|
|
302
302
|
}
|
|
303
|
-
const
|
|
304
|
-
let
|
|
305
|
-
if (!
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
const s =
|
|
309
|
-
s &&
|
|
303
|
+
const n = Xe(t), i = `${o}|${n.join(",")}`;
|
|
304
|
+
let l = z.get(i);
|
|
305
|
+
if (!l) {
|
|
306
|
+
const r = `"use strict"; return (${o});`;
|
|
307
|
+
if (l = new Function(...n, r), z.size >= Ue) {
|
|
308
|
+
const s = z.keys().next().value;
|
|
309
|
+
s && z.delete(s);
|
|
310
310
|
}
|
|
311
|
-
|
|
311
|
+
z.set(i, l);
|
|
312
312
|
}
|
|
313
|
-
return
|
|
314
|
-
} catch (
|
|
315
|
-
|
|
313
|
+
return l(...n.map((r) => t[r]));
|
|
314
|
+
} catch (n) {
|
|
315
|
+
S.debug(`Expression evaluation failed: ${o}`, n);
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function Ge(e) {
|
|
320
320
|
return e.length === 0 ? "" : e.map((t) => `var ${t} = __deps.${t};`).join(`
|
|
321
321
|
`) + `
|
|
322
322
|
`;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
const
|
|
324
|
+
function Ke(e, t) {
|
|
325
|
+
const o = e.replace(/\$-\{/g, "${"), n = t ? Object.keys(t) : [], l = `
|
|
326
326
|
const { $refs, $parent, $emit, $take, $handleEventFromChild, ...rest } = context;
|
|
327
327
|
|
|
328
328
|
// Expose all $*-prefixed context entries (e.g. $router, $store) as local variables
|
|
@@ -335,356 +335,356 @@ function Xe(e, t) {
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
// Inject resolved dependencies as local variables
|
|
338
|
-
${
|
|
338
|
+
${Ge(n)}
|
|
339
339
|
|
|
340
|
-
return (${
|
|
340
|
+
return (${o});
|
|
341
341
|
`;
|
|
342
342
|
try {
|
|
343
|
-
const
|
|
344
|
-
return ((c) => t ?
|
|
345
|
-
} catch (
|
|
346
|
-
throw
|
|
343
|
+
const r = t ? new Function("context", "__deps", l) : new Function("context", l);
|
|
344
|
+
return ((c) => t ? r(c, t) : r(c));
|
|
345
|
+
} catch (r) {
|
|
346
|
+
throw S.errorWithContext("Failed to compile dynamic code", { functionBody: l }, r), r;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function Ee() {
|
|
350
350
|
return /* @__PURE__ */ new Map();
|
|
351
351
|
}
|
|
352
|
-
const
|
|
353
|
-
function
|
|
354
|
-
e === "global" && (e =
|
|
352
|
+
const ve = Ee();
|
|
353
|
+
function we(e, t, o) {
|
|
354
|
+
e === "global" && (e = ve), e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(o);
|
|
355
355
|
}
|
|
356
|
-
async function
|
|
357
|
-
e === "global" && (e =
|
|
358
|
-
const
|
|
359
|
-
for (const
|
|
356
|
+
async function P(e, t, o) {
|
|
357
|
+
e === "global" && (e = ve);
|
|
358
|
+
const n = Array.from(e.get(t) ?? []);
|
|
359
|
+
for (const i of n)
|
|
360
360
|
try {
|
|
361
|
-
await
|
|
362
|
-
} catch (
|
|
363
|
-
|
|
361
|
+
await i(o);
|
|
362
|
+
} catch (l) {
|
|
363
|
+
S.errorWithContext(`Hook "${t}" callback failed`, { hook: t }, l);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
const
|
|
366
|
+
const Z = {
|
|
367
367
|
modules: {},
|
|
368
368
|
plugins: {}
|
|
369
369
|
};
|
|
370
|
-
function
|
|
370
|
+
function Ze(e) {
|
|
371
371
|
if (e == null || typeof e != "object") return !1;
|
|
372
372
|
const t = e;
|
|
373
373
|
return typeof t.template == "string" && typeof t.script == "string" && typeof t.style == "string";
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function J(e) {
|
|
376
376
|
if (e == null || typeof e != "object") return !1;
|
|
377
377
|
const t = e;
|
|
378
378
|
return typeof t.setup == "function" && t.attach === void 0;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function Ye(e) {
|
|
381
381
|
if (e == null || typeof e != "object") return !1;
|
|
382
382
|
const t = e;
|
|
383
383
|
return typeof t.attach == "function" && t.setup === void 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Je(e) {
|
|
386
386
|
return e instanceof HTMLElement && "instance" in e && e.instance !== void 0;
|
|
387
387
|
}
|
|
388
|
-
const
|
|
389
|
-
Object.defineProperties(Object.prototype,
|
|
388
|
+
const Qe = () => {
|
|
389
|
+
Object.defineProperties(Object.prototype, Be), typeof HTMLElement < "u" && Object.defineProperties(HTMLElement.prototype, He);
|
|
390
390
|
};
|
|
391
|
-
function
|
|
391
|
+
function U(e) {
|
|
392
392
|
return e.nodeType === Node.ELEMENT_NODE && e.tagName.includes("-");
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
const
|
|
396
|
-
acceptNode: (
|
|
394
|
+
function et(e, t) {
|
|
395
|
+
const o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
396
|
+
acceptNode: (i) => U(i) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
397
397
|
});
|
|
398
|
-
let
|
|
399
|
-
for (;
|
|
400
|
-
const
|
|
401
|
-
|
|
398
|
+
let n = o.nextNode();
|
|
399
|
+
for (; n; ) {
|
|
400
|
+
const i = n.getAttribute(t);
|
|
401
|
+
i !== null && (Ae(n) === void 0 && Ce(n, i), n.removeAttribute(t)), n = o.nextNode();
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
if (!
|
|
406
|
-
const
|
|
407
|
-
let
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
410
|
-
const
|
|
411
|
-
|
|
404
|
+
function de(e, t) {
|
|
405
|
+
if (!U(e)) return null;
|
|
406
|
+
const o = e.tagName;
|
|
407
|
+
let n = Ae(e);
|
|
408
|
+
const i = rt(e);
|
|
409
|
+
if (n === void 0 && t) {
|
|
410
|
+
const l = e.getAttribute(t);
|
|
411
|
+
l !== null && (Ce(e, l), n = l, e.removeAttribute(t));
|
|
412
412
|
}
|
|
413
|
-
return
|
|
413
|
+
return n === void 0 ? null : i !== void 0 ? `${o}:${String(n)}:${String(i)}` : `${o}:${String(n)}`;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function tt(e, t) {
|
|
416
416
|
return e.nodeType !== t.nodeType ? !1 : e.nodeType === Node.TEXT_NODE || e.nodeType === Node.COMMENT_NODE ? !0 : e.nodeType === Node.ELEMENT_NODE ? e.tagName === t.tagName : !1;
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
const
|
|
420
|
-
for (const
|
|
421
|
-
!
|
|
422
|
-
for (const
|
|
423
|
-
const
|
|
424
|
-
|
|
418
|
+
function Q(e, t) {
|
|
419
|
+
const o = new Set(e.getAttributeNames()), n = new Set(t.getAttributeNames());
|
|
420
|
+
for (const i of o)
|
|
421
|
+
!n.has(i) && !i.startsWith("@") && e.removeAttribute(i);
|
|
422
|
+
for (const i of n) {
|
|
423
|
+
const l = t.getAttribute(i), r = e.getAttribute(i);
|
|
424
|
+
l !== r && (l === null ? e.removeAttribute(i) : e.setAttribute(i, l));
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
const
|
|
429
|
-
for (const s of
|
|
430
|
-
const c =
|
|
431
|
-
c !== null && !
|
|
427
|
+
function Ne(e, t, o) {
|
|
428
|
+
const n = Array.from(e.childNodes), i = Array.from(t.childNodes), l = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
429
|
+
for (const s of n) {
|
|
430
|
+
const c = de(s, o);
|
|
431
|
+
c !== null && !l.has(c) && l.set(c, s);
|
|
432
432
|
}
|
|
433
|
-
for (let s = 0; s <
|
|
434
|
-
const c =
|
|
435
|
-
let
|
|
436
|
-
if (
|
|
437
|
-
|
|
433
|
+
for (let s = 0; s < i.length; s++) {
|
|
434
|
+
const c = i[s], a = n[s], u = de(c, o);
|
|
435
|
+
let d = null;
|
|
436
|
+
if (u !== null && l.has(u) && (d = l.get(u), r.add(d)), d && U(d)) {
|
|
437
|
+
a !== d && (s < e.childNodes.length ? e.insertBefore(d, e.childNodes[s]) : e.appendChild(d)), Q(d, c);
|
|
438
438
|
continue;
|
|
439
439
|
}
|
|
440
|
-
if (
|
|
441
|
-
|
|
440
|
+
if (U(c) && u !== null) {
|
|
441
|
+
a ? e.replaceChild(c, a) : e.appendChild(c);
|
|
442
442
|
continue;
|
|
443
443
|
}
|
|
444
|
-
if (!
|
|
444
|
+
if (!a) {
|
|
445
445
|
e.appendChild(c);
|
|
446
446
|
continue;
|
|
447
447
|
}
|
|
448
|
-
if (!
|
|
449
|
-
e.replaceChild(c,
|
|
448
|
+
if (!tt(a, c)) {
|
|
449
|
+
e.replaceChild(c, a);
|
|
450
450
|
continue;
|
|
451
451
|
}
|
|
452
|
-
if (
|
|
453
|
-
|
|
452
|
+
if (a.nodeType === Node.TEXT_NODE) {
|
|
453
|
+
a.textContent !== c.textContent && (a.textContent = c.textContent);
|
|
454
454
|
continue;
|
|
455
455
|
}
|
|
456
|
-
if (
|
|
457
|
-
|
|
456
|
+
if (a.nodeType === Node.COMMENT_NODE) {
|
|
457
|
+
a.textContent !== c.textContent && (a.textContent = c.textContent);
|
|
458
458
|
continue;
|
|
459
459
|
}
|
|
460
|
-
if (
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
463
|
-
|
|
460
|
+
if (a.nodeType === Node.ELEMENT_NODE) {
|
|
461
|
+
const v = a, x = c;
|
|
462
|
+
if (U(v)) {
|
|
463
|
+
Q(v, x);
|
|
464
464
|
continue;
|
|
465
465
|
}
|
|
466
|
-
|
|
466
|
+
Q(v, x), Ne(v, x, o);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
for (; e.childNodes.length >
|
|
469
|
+
for (; e.childNodes.length > i.length; ) {
|
|
470
470
|
const s = e.lastChild;
|
|
471
471
|
s && e.removeChild(s);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
if (
|
|
476
|
-
|
|
474
|
+
function nt(e, t, o, n) {
|
|
475
|
+
if (o || e.childNodes.length === 0) {
|
|
476
|
+
n && et(t, n), e.replaceChildren(t);
|
|
477
477
|
return;
|
|
478
478
|
}
|
|
479
|
-
const
|
|
480
|
-
|
|
479
|
+
const i = document.createElement("div");
|
|
480
|
+
i.appendChild(t), Ne(e, i, n);
|
|
481
481
|
}
|
|
482
|
-
const
|
|
483
|
-
function
|
|
482
|
+
const ie = /* @__PURE__ */ Symbol("STRUCT_ID"), se = /* @__PURE__ */ Symbol("SLOT_ID");
|
|
483
|
+
function _e(e, t, o) {
|
|
484
484
|
Object.defineProperty(e, t, {
|
|
485
|
-
value:
|
|
485
|
+
value: o,
|
|
486
486
|
writable: !0,
|
|
487
487
|
configurable: !0,
|
|
488
488
|
enumerable: !1
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
|
|
491
|
+
function Ce(e, t) {
|
|
492
|
+
_e(e, ie, t);
|
|
493
493
|
}
|
|
494
|
-
function
|
|
495
|
-
return Object.prototype.hasOwnProperty.call(e,
|
|
494
|
+
function Ae(e) {
|
|
495
|
+
return Object.prototype.hasOwnProperty.call(e, ie) ? e[ie] : void 0;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
|
|
497
|
+
function ot(e, t) {
|
|
498
|
+
_e(e, se, t);
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
return Object.prototype.hasOwnProperty.call(e,
|
|
500
|
+
function rt(e) {
|
|
501
|
+
return Object.prototype.hasOwnProperty.call(e, se) ? e[se] : void 0;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function it(e, t, o, n) {
|
|
504
504
|
if (!Array.isArray(t)) return () => {
|
|
505
505
|
};
|
|
506
|
-
const
|
|
507
|
-
return t.forEach(([
|
|
508
|
-
if (typeof
|
|
509
|
-
|
|
506
|
+
const i = [];
|
|
507
|
+
return t.forEach(([l, r, s]) => {
|
|
508
|
+
if (typeof l != "string" || typeof s != "function") {
|
|
509
|
+
S.error("Provided handler is not a function", s);
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
512
|
let c = [];
|
|
513
|
-
if (
|
|
513
|
+
if (r === "window")
|
|
514
514
|
c = [window];
|
|
515
|
-
else if (typeof
|
|
516
|
-
if (
|
|
517
|
-
const [
|
|
518
|
-
|
|
515
|
+
else if (typeof r == "string")
|
|
516
|
+
if (r.startsWith("$refs.")) {
|
|
517
|
+
const [a, ...u] = r.slice(6).split(" "), d = n[a];
|
|
518
|
+
d && (c = u.length ? Array.from(d.querySelectorAll(u.join(" "))) : [d]);
|
|
519
519
|
} else
|
|
520
|
-
c = Array.from(
|
|
521
|
-
else if (
|
|
522
|
-
c = [
|
|
523
|
-
else if (typeof
|
|
524
|
-
const { ref:
|
|
525
|
-
|
|
520
|
+
c = Array.from(o.querySelectorAll(r));
|
|
521
|
+
else if (r instanceof Element || r instanceof Window)
|
|
522
|
+
c = [r];
|
|
523
|
+
else if (typeof r == "object" && r && "ref" in r) {
|
|
524
|
+
const { ref: a, selector: u } = r, d = n[a];
|
|
525
|
+
d && (c = u ? Array.from(d.querySelectorAll(u)) : [d]);
|
|
526
526
|
}
|
|
527
|
-
for (const
|
|
528
|
-
const
|
|
529
|
-
|
|
527
|
+
for (const a of c) {
|
|
528
|
+
const u = Y(s, e);
|
|
529
|
+
a.addEventListener(l, u), i.push({ target: a, type: l, handler: u });
|
|
530
530
|
}
|
|
531
531
|
}), () => {
|
|
532
|
-
for (const { target:
|
|
533
|
-
|
|
534
|
-
|
|
532
|
+
for (const { target: l, type: r, handler: s } of i)
|
|
533
|
+
l.removeEventListener(r, s);
|
|
534
|
+
i.length = 0;
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
|
-
const
|
|
538
|
-
function
|
|
539
|
-
const
|
|
540
|
-
let
|
|
541
|
-
for (;
|
|
542
|
-
for (const
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
const
|
|
537
|
+
const Te = /^on([a-z]+)$/i;
|
|
538
|
+
function st(e, t) {
|
|
539
|
+
const o = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT);
|
|
540
|
+
let n = o.nextNode();
|
|
541
|
+
for (; n; ) {
|
|
542
|
+
for (const i of Array.from(n.attributes)) {
|
|
543
|
+
const l = i.name.match(Te);
|
|
544
|
+
if (l) {
|
|
545
|
+
const r = l[1].toLowerCase(), s = i.value;
|
|
546
546
|
if (s) {
|
|
547
547
|
const c = e[s];
|
|
548
|
-
typeof c == "function" && (
|
|
548
|
+
typeof c == "function" && (n.removeAttribute(i.name), n.addEventListener(r, c));
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
|
|
552
|
+
n = o.nextNode();
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
const
|
|
557
|
-
let
|
|
558
|
-
for (;
|
|
559
|
-
for (const
|
|
560
|
-
const
|
|
561
|
-
if (
|
|
562
|
-
const
|
|
555
|
+
function ct(e, t) {
|
|
556
|
+
const o = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT);
|
|
557
|
+
let n = o.nextNode();
|
|
558
|
+
for (; n; ) {
|
|
559
|
+
for (const i of Array.from(n.attributes)) {
|
|
560
|
+
const l = i.name.match(Te);
|
|
561
|
+
if (l) {
|
|
562
|
+
const r = l[1].toLowerCase(), s = i.value;
|
|
563
563
|
if (s) {
|
|
564
564
|
const c = e[s];
|
|
565
|
-
typeof c == "function" && (
|
|
565
|
+
typeof c == "function" && (n.removeAttribute(i.name), n.addEventListener(r, c));
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
|
|
569
|
+
n = o.nextNode();
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
function
|
|
573
|
-
if (!Array.isArray(
|
|
572
|
+
function at(e, t, o, n, i) {
|
|
573
|
+
if (!Array.isArray(o)) return () => {
|
|
574
574
|
};
|
|
575
|
-
const
|
|
576
|
-
return
|
|
577
|
-
if (typeof
|
|
578
|
-
|
|
575
|
+
const l = [];
|
|
576
|
+
return o.forEach(([r, s, c]) => {
|
|
577
|
+
if (typeof r != "string" || typeof c != "function") {
|
|
578
|
+
S.error("Provided handler is not a function", c);
|
|
579
579
|
return;
|
|
580
580
|
}
|
|
581
|
-
let
|
|
581
|
+
let a = [];
|
|
582
582
|
if (s === "window")
|
|
583
|
-
|
|
583
|
+
a = [window];
|
|
584
584
|
else if (typeof s == "string")
|
|
585
585
|
if (s.startsWith("$refs.")) {
|
|
586
|
-
const [
|
|
587
|
-
|
|
586
|
+
const [u, ...d] = s.slice(6).split(" "), v = i[u];
|
|
587
|
+
v && (a = d.length ? Array.from(v.querySelectorAll(d.join(" "))) : [v]);
|
|
588
588
|
} else
|
|
589
|
-
|
|
589
|
+
a = Array.from(n.querySelectorAll(s));
|
|
590
590
|
else if (s instanceof Element || s instanceof Window)
|
|
591
|
-
|
|
591
|
+
a = [s];
|
|
592
592
|
else if (typeof s == "object" && s && "ref" in s) {
|
|
593
|
-
const { ref:
|
|
594
|
-
|
|
593
|
+
const { ref: u, selector: d } = s, v = i[u];
|
|
594
|
+
v && (a = d ? Array.from(v.querySelectorAll(d)) : [v]);
|
|
595
595
|
}
|
|
596
|
-
for (const
|
|
597
|
-
const
|
|
598
|
-
|
|
596
|
+
for (const u of a) {
|
|
597
|
+
const d = Y(c, t);
|
|
598
|
+
u.addEventListener(r, d), l.push({ target: u, type: r, handler: d });
|
|
599
599
|
}
|
|
600
600
|
}), () => {
|
|
601
|
-
for (const { target:
|
|
602
|
-
|
|
603
|
-
|
|
601
|
+
for (const { target: r, type: s, handler: c } of l)
|
|
602
|
+
r.removeEventListener(s, c);
|
|
603
|
+
l.length = 0;
|
|
604
604
|
};
|
|
605
605
|
}
|
|
606
|
-
const
|
|
607
|
-
let
|
|
608
|
-
function
|
|
606
|
+
const V = /* @__PURE__ */ new WeakMap();
|
|
607
|
+
let ee;
|
|
608
|
+
function lt() {
|
|
609
609
|
if (typeof EventTarget > "u") return;
|
|
610
610
|
const e = globalThis;
|
|
611
611
|
if (e.__koppajsEventTrackingPatched) return;
|
|
612
612
|
e.__koppajsEventTrackingPatched = !0;
|
|
613
|
-
const t = EventTarget.prototype.addEventListener,
|
|
614
|
-
EventTarget.prototype.addEventListener = function(
|
|
615
|
-
return
|
|
616
|
-
}, EventTarget.prototype.removeEventListener = function(
|
|
617
|
-
const
|
|
618
|
-
if (
|
|
619
|
-
for (const s of
|
|
620
|
-
if (s.type ===
|
|
621
|
-
|
|
613
|
+
const t = EventTarget.prototype.addEventListener, o = EventTarget.prototype.removeEventListener;
|
|
614
|
+
EventTarget.prototype.addEventListener = function(n, i, l) {
|
|
615
|
+
return V.has(this) || V.set(this, /* @__PURE__ */ new Set()), V.get(this).add({ type: n, listener: i, options: l }), t.call(this, n, i, l);
|
|
616
|
+
}, EventTarget.prototype.removeEventListener = function(n, i, l) {
|
|
617
|
+
const r = V.get(this);
|
|
618
|
+
if (r) {
|
|
619
|
+
for (const s of r)
|
|
620
|
+
if (s.type === n && s.listener === i) {
|
|
621
|
+
r.delete(s);
|
|
622
622
|
break;
|
|
623
623
|
}
|
|
624
|
-
|
|
624
|
+
r.size === 0 && V.delete(this);
|
|
625
625
|
}
|
|
626
|
-
return
|
|
626
|
+
return o.call(this, n, i, l);
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
const t =
|
|
629
|
+
function ft(e) {
|
|
630
|
+
const t = V.get(e);
|
|
631
631
|
if (t) {
|
|
632
|
-
for (const { type:
|
|
633
|
-
e.removeEventListener(
|
|
634
|
-
|
|
632
|
+
for (const { type: o, listener: n, options: i } of t)
|
|
633
|
+
e.removeEventListener(o, n, i);
|
|
634
|
+
V.delete(e);
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function Se(e) {
|
|
638
638
|
if (typeof document > "u" || typeof NodeFilter > "u" || typeof Element > "u")
|
|
639
639
|
return;
|
|
640
640
|
const t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT);
|
|
641
|
-
let
|
|
642
|
-
for (;
|
|
643
|
-
|
|
641
|
+
let o = e instanceof Element ? e : null;
|
|
642
|
+
for (; o; )
|
|
643
|
+
V.has(o) && ft(o), o = t.nextNode();
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
|
|
645
|
+
function ut() {
|
|
646
|
+
ee || typeof MutationObserver > "u" || typeof document > "u" || document.body && (ee = new MutationObserver((e) => {
|
|
647
647
|
for (const t of e)
|
|
648
|
-
t.removedNodes.forEach((
|
|
649
|
-
|
|
648
|
+
t.removedNodes.forEach((o) => {
|
|
649
|
+
o.nodeType === Node.ELEMENT_NODE && Se(o);
|
|
650
650
|
});
|
|
651
|
-
}),
|
|
651
|
+
}), ee.observe(document.body, { childList: !0, subtree: !0 }));
|
|
652
652
|
}
|
|
653
|
-
const
|
|
654
|
-
let
|
|
655
|
-
const
|
|
656
|
-
const t =
|
|
653
|
+
const xe = /* @__PURE__ */ new WeakMap(), Me = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap();
|
|
654
|
+
let dt = 0;
|
|
655
|
+
const H = () => `slot-${++dt}`, W = (e) => typeof e == "object" && e !== null, te = (e) => typeof e == "symbol" ? e.toString() : String(e), ht = (e) => {
|
|
656
|
+
const t = xe.get(e);
|
|
657
657
|
return t && W(t) ? t : void 0;
|
|
658
658
|
};
|
|
659
|
-
function
|
|
660
|
-
const t =
|
|
659
|
+
function Oe(e) {
|
|
660
|
+
const t = Me.get(e);
|
|
661
661
|
return t || e;
|
|
662
662
|
}
|
|
663
|
-
const
|
|
664
|
-
function
|
|
665
|
-
const t =
|
|
666
|
-
return
|
|
663
|
+
const F = (e) => W(e) ? Reflect.get(e, ge) === !0 : !1;
|
|
664
|
+
function pt(e) {
|
|
665
|
+
const t = F(e) ? Oe(e) : e;
|
|
666
|
+
return X.get(t);
|
|
667
667
|
}
|
|
668
|
-
const
|
|
669
|
-
let t =
|
|
670
|
-
return t || (t = e.map(() =>
|
|
671
|
-
},
|
|
672
|
-
const t =
|
|
668
|
+
const mt = (e) => e !== null && (typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "function" || typeof e > "u"), K = (e) => {
|
|
669
|
+
let t = X.get(e);
|
|
670
|
+
return t || (t = e.map(() => H()), X.set(e, t)), t;
|
|
671
|
+
}, he = (e) => {
|
|
672
|
+
const t = X.get(e);
|
|
673
673
|
if (t && t.length !== e.length)
|
|
674
674
|
throw new Error(
|
|
675
675
|
`Slot sidecar invariant violation: slotIds length (${t.length}) does not match array length (${e.length})`
|
|
676
676
|
);
|
|
677
677
|
};
|
|
678
|
-
function
|
|
679
|
-
const t = /* @__PURE__ */ new Set(),
|
|
680
|
-
let
|
|
681
|
-
const
|
|
682
|
-
const b =
|
|
678
|
+
function yt(e) {
|
|
679
|
+
const t = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new WeakMap();
|
|
680
|
+
let n = 0, i = /* @__PURE__ */ new Set();
|
|
681
|
+
const l = /* @__PURE__ */ new Map(), r = (f, y) => !!(f === y || f.startsWith(y + ".")), s = (f, y) => {
|
|
682
|
+
const b = o.get(f) ?? "";
|
|
683
683
|
return b ? `${b}.${y}` : y;
|
|
684
684
|
};
|
|
685
685
|
let c = !1;
|
|
686
|
-
const
|
|
687
|
-
|
|
686
|
+
const a = (f) => {
|
|
687
|
+
i.add(f), n++, c || (c = !0, queueMicrotask(() => {
|
|
688
688
|
c = !1, t.forEach((y) => {
|
|
689
689
|
try {
|
|
690
690
|
y();
|
|
@@ -693,55 +693,55 @@ function pt(e) {
|
|
|
693
693
|
}
|
|
694
694
|
});
|
|
695
695
|
}));
|
|
696
|
-
},
|
|
696
|
+
}, u = (f, y, b) => {
|
|
697
697
|
if (f === y) return;
|
|
698
698
|
let w = f.length !== y.length;
|
|
699
699
|
if (!w) {
|
|
700
|
-
for (let
|
|
701
|
-
if (f[
|
|
700
|
+
for (let h = 0; h < f.length; h++)
|
|
701
|
+
if (f[h] !== y[h]) {
|
|
702
702
|
w = !0;
|
|
703
703
|
break;
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
|
-
f.splice(0, f.length, ...y), w &&
|
|
707
|
-
},
|
|
708
|
-
const w = new Set(f),
|
|
709
|
-
let
|
|
710
|
-
for (const
|
|
711
|
-
if (!
|
|
712
|
-
|
|
706
|
+
f.splice(0, f.length, ...y), w && a(b);
|
|
707
|
+
}, d = (f, y, b) => {
|
|
708
|
+
const w = new Set(f), h = new Set(y);
|
|
709
|
+
let m = !1;
|
|
710
|
+
for (const E of w)
|
|
711
|
+
if (!h.has(E)) {
|
|
712
|
+
m = !0;
|
|
713
713
|
break;
|
|
714
714
|
}
|
|
715
|
-
if (!
|
|
716
|
-
for (const
|
|
717
|
-
if (!w.has(
|
|
718
|
-
|
|
715
|
+
if (!m) {
|
|
716
|
+
for (const E of h)
|
|
717
|
+
if (!w.has(E)) {
|
|
718
|
+
m = !0;
|
|
719
719
|
break;
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
|
|
723
|
-
},
|
|
724
|
-
const w = new Set(f),
|
|
725
|
-
f.length !== y.length || [...w].some((
|
|
722
|
+
m && (f.splice(0, f.length, ...y), a(b));
|
|
723
|
+
}, v = (f, y, b) => {
|
|
724
|
+
const w = new Set(f), h = new Set(y);
|
|
725
|
+
f.length !== y.length || [...w].some((E) => !h.has(E)) || [...h].some((E) => !w.has(E)) ? d(f, y, b) : u(f, y, b);
|
|
726
726
|
}, x = (f, y, b) => {
|
|
727
727
|
if (f === y) return !1;
|
|
728
728
|
let w = !1;
|
|
729
|
-
for (const
|
|
730
|
-
|
|
731
|
-
for (const
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
) && (w = !0),
|
|
729
|
+
for (const h of Object.keys(f))
|
|
730
|
+
h in y || (w = !0, Reflect.deleteProperty(f, h));
|
|
731
|
+
for (const h of Object.keys(y)) {
|
|
732
|
+
const m = f[h], E = y[h];
|
|
733
|
+
m !== E && (W(m) && F(m) && W(E) && !F(E) ? (x(
|
|
734
|
+
m,
|
|
735
|
+
E
|
|
736
|
+
) && (w = !0), m !== E && (w = !0, Reflect.set(f, h, E))) : (w = !0, Reflect.set(f, h, E)));
|
|
737
737
|
}
|
|
738
738
|
return w;
|
|
739
|
-
},
|
|
740
|
-
const w =
|
|
739
|
+
}, M = (f, y, b) => {
|
|
740
|
+
const w = K(f);
|
|
741
741
|
switch (y) {
|
|
742
742
|
case "push": {
|
|
743
|
-
const
|
|
744
|
-
w.push(...
|
|
743
|
+
const h = Array.from({ length: b.length }, () => H());
|
|
744
|
+
w.push(...h);
|
|
745
745
|
break;
|
|
746
746
|
}
|
|
747
747
|
case "pop": {
|
|
@@ -753,16 +753,16 @@ function pt(e) {
|
|
|
753
753
|
break;
|
|
754
754
|
}
|
|
755
755
|
case "unshift": {
|
|
756
|
-
const
|
|
757
|
-
w.unshift(...
|
|
756
|
+
const h = Array.from({ length: b.length }, () => H());
|
|
757
|
+
w.unshift(...h);
|
|
758
758
|
break;
|
|
759
759
|
}
|
|
760
760
|
case "splice": {
|
|
761
|
-
const
|
|
762
|
-
{ length:
|
|
763
|
-
() =>
|
|
761
|
+
const h = b[0] ?? 0, m = b[1] !== void 0 ? b[1] : f.length - h, E = b.slice(2), T = Array.from(
|
|
762
|
+
{ length: E.length },
|
|
763
|
+
() => H()
|
|
764
764
|
);
|
|
765
|
-
w.splice(
|
|
765
|
+
w.splice(h, m, ...T);
|
|
766
766
|
break;
|
|
767
767
|
}
|
|
768
768
|
case "reverse": {
|
|
@@ -770,21 +770,21 @@ function pt(e) {
|
|
|
770
770
|
break;
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
|
|
774
|
-
},
|
|
773
|
+
he(f);
|
|
774
|
+
}, N = (f, y = "") => {
|
|
775
775
|
if (f instanceof Node || f instanceof Window || f instanceof Document)
|
|
776
776
|
return f;
|
|
777
|
-
const b =
|
|
777
|
+
const b = ht(f);
|
|
778
778
|
if (b) return b;
|
|
779
|
-
y &&
|
|
779
|
+
y && o.set(f, y), Array.isArray(f) && K(f);
|
|
780
780
|
const w = new Proxy(f, {
|
|
781
|
-
get: (
|
|
782
|
-
if (
|
|
783
|
-
if (
|
|
781
|
+
get: (h, m, E) => {
|
|
782
|
+
if (m === ge) return !0;
|
|
783
|
+
if (m === "toJSON")
|
|
784
784
|
return function() {
|
|
785
|
-
return
|
|
785
|
+
return Oe(h);
|
|
786
786
|
};
|
|
787
|
-
if (Array.isArray(
|
|
787
|
+
if (Array.isArray(h) && typeof m == "string" && [
|
|
788
788
|
"push",
|
|
789
789
|
"pop",
|
|
790
790
|
"shift",
|
|
@@ -792,86 +792,86 @@ function pt(e) {
|
|
|
792
792
|
"splice",
|
|
793
793
|
"reverse",
|
|
794
794
|
"sort"
|
|
795
|
-
].includes(
|
|
796
|
-
const
|
|
797
|
-
if (typeof
|
|
798
|
-
return function(...
|
|
799
|
-
if (
|
|
800
|
-
const k =
|
|
801
|
-
el:
|
|
802
|
-
slotId: k[
|
|
803
|
-
})),
|
|
804
|
-
for (let
|
|
805
|
-
const
|
|
806
|
-
let
|
|
807
|
-
|
|
795
|
+
].includes(m)) {
|
|
796
|
+
const R = h[m];
|
|
797
|
+
if (typeof R == "function")
|
|
798
|
+
return function(...D) {
|
|
799
|
+
if (m === "sort") {
|
|
800
|
+
const k = K(h), $ = h.map((p, _) => ({
|
|
801
|
+
el: p,
|
|
802
|
+
slotId: k[_] || H()
|
|
803
|
+
})), G = R.apply(this, D), g = /* @__PURE__ */ new Map();
|
|
804
|
+
for (let p = 0; p < $.length; p++) {
|
|
805
|
+
const _ = $[p].el;
|
|
806
|
+
let O = g.get(_);
|
|
807
|
+
O || (O = [], g.set(_, O)), O.push(p);
|
|
808
808
|
}
|
|
809
|
-
for (let
|
|
810
|
-
const
|
|
811
|
-
if (
|
|
812
|
-
const
|
|
813
|
-
k[
|
|
809
|
+
for (let p = 0; p < h.length; p++) {
|
|
810
|
+
const _ = h[p], O = g.get(_);
|
|
811
|
+
if (O && O.length > 0) {
|
|
812
|
+
const L = O.shift();
|
|
813
|
+
k[p] = $[L].slotId;
|
|
814
814
|
} else
|
|
815
|
-
k[
|
|
815
|
+
k[p] = H();
|
|
816
816
|
}
|
|
817
|
-
return
|
|
817
|
+
return he(h), G;
|
|
818
818
|
} else {
|
|
819
|
-
const k =
|
|
820
|
-
return
|
|
819
|
+
const k = R.apply(this, D);
|
|
820
|
+
return M(h, m, D), k;
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
823
|
}
|
|
824
|
-
const T = Reflect.get(
|
|
825
|
-
if (W(T) && !
|
|
826
|
-
const
|
|
827
|
-
return
|
|
824
|
+
const T = Reflect.get(h, m, E), A = Array.isArray(h) && typeof m == "string" && /^\d+$/.test(m);
|
|
825
|
+
if (W(T) && !F(T) && !A && (Array.isArray(T) || !Array.isArray(h))) {
|
|
826
|
+
const I = te(m), R = s(h, I);
|
|
827
|
+
return N(T, R);
|
|
828
828
|
}
|
|
829
829
|
return T;
|
|
830
830
|
},
|
|
831
|
-
set: (
|
|
832
|
-
const
|
|
833
|
-
if (
|
|
834
|
-
const
|
|
835
|
-
if (Array.isArray(
|
|
836
|
-
const k = parseInt(
|
|
837
|
-
if (k >= 0 && k <
|
|
838
|
-
const
|
|
839
|
-
return
|
|
831
|
+
set: (h, m, E, T) => {
|
|
832
|
+
const A = Reflect.get(h, m, T);
|
|
833
|
+
if (A === E) return !0;
|
|
834
|
+
const I = te(m), R = s(h, I);
|
|
835
|
+
if (Array.isArray(h) && typeof m == "string" && /^\d+$/.test(m)) {
|
|
836
|
+
const k = parseInt(m, 10);
|
|
837
|
+
if (k >= 0 && k < h.length) {
|
|
838
|
+
const $ = Reflect.set(h, m, E, T);
|
|
839
|
+
return a(R), $;
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
if (Array.isArray(
|
|
843
|
-
|
|
844
|
-
const k =
|
|
845
|
-
return
|
|
842
|
+
if (Array.isArray(A) && !mt(E) && Array.isArray(E)) {
|
|
843
|
+
v(A, E, R);
|
|
844
|
+
const k = A.map(() => H());
|
|
845
|
+
return X.set(A, k), !0;
|
|
846
846
|
}
|
|
847
|
-
if (W(
|
|
847
|
+
if (W(A) && F(A) && W(E) && !F(E)) {
|
|
848
848
|
if (x(
|
|
849
|
-
|
|
850
|
-
|
|
849
|
+
A,
|
|
850
|
+
E
|
|
851
851
|
)) {
|
|
852
|
-
let
|
|
853
|
-
W(
|
|
852
|
+
let $ = E;
|
|
853
|
+
W($) && !F($) && ($ = N($, R)), Reflect.set(h, m, $, T), a(R);
|
|
854
854
|
}
|
|
855
855
|
return !0;
|
|
856
856
|
}
|
|
857
|
-
const
|
|
858
|
-
if (W(
|
|
859
|
-
const k =
|
|
860
|
-
Reflect.set(
|
|
857
|
+
const D = Reflect.set(h, m, E, T);
|
|
858
|
+
if (W(E) && !F(E)) {
|
|
859
|
+
const k = N(E, R);
|
|
860
|
+
Reflect.set(h, m, k, T), Array.isArray(E) && K(E);
|
|
861
861
|
}
|
|
862
|
-
return
|
|
862
|
+
return a(R), D;
|
|
863
863
|
},
|
|
864
|
-
deleteProperty: (
|
|
865
|
-
if (
|
|
866
|
-
return Reflect.deleteProperty(
|
|
867
|
-
const
|
|
868
|
-
return
|
|
864
|
+
deleteProperty: (h, m) => {
|
|
865
|
+
if (m === "changedPaths")
|
|
866
|
+
return Reflect.deleteProperty(h, m);
|
|
867
|
+
const E = te(m), T = s(h, E), A = Reflect.get(h, m), I = Reflect.deleteProperty(h, m);
|
|
868
|
+
return I && A !== void 0 && a(T), I;
|
|
869
869
|
}
|
|
870
870
|
});
|
|
871
|
-
return
|
|
871
|
+
return xe.set(f, w), Me.set(w, f), w;
|
|
872
872
|
};
|
|
873
873
|
return {
|
|
874
|
-
state:
|
|
874
|
+
state: N(e),
|
|
875
875
|
/**
|
|
876
876
|
* Registers a watcher for a path prefix.
|
|
877
877
|
* The callback is called at most once per flush cycle with the subset of
|
|
@@ -885,14 +885,14 @@ function pt(e) {
|
|
|
885
885
|
* @returns A cleanup function stop() that unregisters this watcher (idempotent)
|
|
886
886
|
*/
|
|
887
887
|
watch(f, y) {
|
|
888
|
-
let b =
|
|
889
|
-
b || (b = /* @__PURE__ */ new Set(),
|
|
888
|
+
let b = l.get(f);
|
|
889
|
+
b || (b = /* @__PURE__ */ new Set(), l.set(f, b)), b.add(y);
|
|
890
890
|
let w = !1;
|
|
891
891
|
return () => {
|
|
892
892
|
if (w) return;
|
|
893
893
|
w = !0;
|
|
894
|
-
const
|
|
895
|
-
|
|
894
|
+
const h = l.get(f);
|
|
895
|
+
h && (h.delete(y), h.size === 0 && l.delete(f));
|
|
896
896
|
};
|
|
897
897
|
},
|
|
898
898
|
addObserver(f) {
|
|
@@ -902,7 +902,7 @@ function pt(e) {
|
|
|
902
902
|
t.delete(f);
|
|
903
903
|
},
|
|
904
904
|
getStateVersion() {
|
|
905
|
-
return
|
|
905
|
+
return n;
|
|
906
906
|
},
|
|
907
907
|
/**
|
|
908
908
|
* Checks if any pending changed path matches one of the given prefixes.
|
|
@@ -911,7 +911,7 @@ function pt(e) {
|
|
|
911
911
|
* @returns True if at least one pending change matches a prefix
|
|
912
912
|
*/
|
|
913
913
|
hasPendingChangesFor(f) {
|
|
914
|
-
for (const y of
|
|
914
|
+
for (const y of i)
|
|
915
915
|
for (const b of f)
|
|
916
916
|
if (y === b || y.startsWith(b + ".")) return !0;
|
|
917
917
|
return !1;
|
|
@@ -924,50 +924,50 @@ function pt(e) {
|
|
|
924
924
|
* @returns A copy of all changed paths since the last flush
|
|
925
925
|
*/
|
|
926
926
|
flushChanges() {
|
|
927
|
-
const f = new Set(
|
|
928
|
-
if (f.size > 0 &&
|
|
927
|
+
const f = new Set(i);
|
|
928
|
+
if (f.size > 0 && l.size > 0) {
|
|
929
929
|
const y = /* @__PURE__ */ new Map();
|
|
930
|
-
for (const [b, w] of
|
|
931
|
-
const
|
|
932
|
-
for (const
|
|
933
|
-
|
|
934
|
-
if (
|
|
935
|
-
for (const
|
|
936
|
-
const
|
|
937
|
-
if (
|
|
938
|
-
for (const T of
|
|
939
|
-
|
|
930
|
+
for (const [b, w] of l) {
|
|
931
|
+
const h = /* @__PURE__ */ new Set();
|
|
932
|
+
for (const m of f)
|
|
933
|
+
r(m, b) && h.add(m);
|
|
934
|
+
if (h.size > 0)
|
|
935
|
+
for (const m of w) {
|
|
936
|
+
const E = y.get(m);
|
|
937
|
+
if (E)
|
|
938
|
+
for (const T of h)
|
|
939
|
+
E.add(T);
|
|
940
940
|
else
|
|
941
|
-
y.set(
|
|
941
|
+
y.set(m, new Set(h));
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
944
|
for (const [b, w] of y)
|
|
945
945
|
b({ changedPaths: w });
|
|
946
946
|
}
|
|
947
|
-
return
|
|
947
|
+
return i = /* @__PURE__ */ new Set(), f;
|
|
948
948
|
}
|
|
949
949
|
};
|
|
950
950
|
}
|
|
951
|
-
const
|
|
952
|
-
function
|
|
951
|
+
const ne = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
952
|
+
function gt(e) {
|
|
953
953
|
const t = e.trim();
|
|
954
954
|
if (t.startsWith("[") && t.endsWith("]")) {
|
|
955
|
-
const
|
|
956
|
-
if (
|
|
955
|
+
const n = t.slice(1, -1).split(",").map((r) => r.trim());
|
|
956
|
+
if (n.length !== 2)
|
|
957
957
|
throw new Error("Invalid loop binding: expected <id> or [<id>, <id>]");
|
|
958
|
-
const [
|
|
959
|
-
if (!
|
|
958
|
+
const [i, l] = n;
|
|
959
|
+
if (!ne.test(i) || !ne.test(l))
|
|
960
960
|
throw new Error("Invalid loop binding: expected <id> or [<id>, <id>]");
|
|
961
|
-
return { type: "tuple", keyVar:
|
|
961
|
+
return { type: "tuple", keyVar: i, itemVar: l };
|
|
962
962
|
}
|
|
963
|
-
if (!
|
|
963
|
+
if (!ne.test(t))
|
|
964
964
|
throw new Error("Invalid loop binding: expected <id> or [<id>, <id>]");
|
|
965
965
|
return { type: "single", itemVar: t };
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function bt(e) {
|
|
968
968
|
const t = {
|
|
969
|
-
acceptNode(
|
|
970
|
-
return
|
|
969
|
+
acceptNode(o) {
|
|
970
|
+
return o.nodeType === Node.ELEMENT_NODE || o.nodeType === Node.TEXT_NODE && /\{\{(.+?)\}\}/g.test(o.nodeValue || "") ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
971
971
|
}
|
|
972
972
|
};
|
|
973
973
|
return document.createTreeWalker(
|
|
@@ -976,186 +976,186 @@ function yt(e) {
|
|
|
976
976
|
t
|
|
977
977
|
);
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function Et(e) {
|
|
980
980
|
const t = e.currentNode;
|
|
981
981
|
return t?.nextSibling ? e.currentNode = t.nextSibling : e.nextNode();
|
|
982
982
|
}
|
|
983
|
-
function
|
|
984
|
-
let
|
|
985
|
-
if (!
|
|
986
|
-
let
|
|
987
|
-
for (;
|
|
988
|
-
if (
|
|
989
|
-
|
|
983
|
+
function vt(e, t) {
|
|
984
|
+
let o = t.nextSibling;
|
|
985
|
+
if (!o) {
|
|
986
|
+
let n = t.parentNode;
|
|
987
|
+
for (; n && n !== e.root; ) {
|
|
988
|
+
if (n.nextSibling) {
|
|
989
|
+
o = n.nextSibling;
|
|
990
990
|
break;
|
|
991
991
|
}
|
|
992
|
-
|
|
992
|
+
n = n.parentNode;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
return
|
|
995
|
+
return o ? (e.currentNode = o, o) : null;
|
|
996
996
|
}
|
|
997
|
-
function
|
|
997
|
+
function wt(e) {
|
|
998
998
|
return e == null || e === !0 || e === !1 ? "" : String(e);
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1001
|
-
return e.replace(/\{\{(.+?)\}\}/g, (
|
|
1002
|
-
const
|
|
1003
|
-
return
|
|
1000
|
+
function ke(e, t) {
|
|
1001
|
+
return e.replace(/\{\{(.+?)\}\}/g, (o, n) => {
|
|
1002
|
+
const i = B(n.trim(), t);
|
|
1003
|
+
return wt(i);
|
|
1004
1004
|
});
|
|
1005
1005
|
}
|
|
1006
|
-
async function
|
|
1007
|
-
const
|
|
1008
|
-
if (!
|
|
1006
|
+
async function Nt(e, t, o) {
|
|
1007
|
+
const n = e.getAttribute("loop");
|
|
1008
|
+
if (!n) return;
|
|
1009
1009
|
e.removeAttribute("loop");
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
const
|
|
1013
|
-
if (!
|
|
1010
|
+
const i = e.getAttribute("if");
|
|
1011
|
+
i && e.removeAttribute("if");
|
|
1012
|
+
const l = n.match(/^(.+?)\s+in\s+(.+)$/);
|
|
1013
|
+
if (!l)
|
|
1014
1014
|
throw new Error("Invalid loop binding: expected <id> or [<id>, <id>]");
|
|
1015
|
-
const [,
|
|
1016
|
-
if (
|
|
1015
|
+
const [, r, s] = l, c = gt(r), a = B(s.trim(), t);
|
|
1016
|
+
if (a == null) {
|
|
1017
1017
|
e.remove();
|
|
1018
1018
|
return;
|
|
1019
1019
|
}
|
|
1020
|
-
if (typeof
|
|
1021
|
-
|
|
1020
|
+
if (typeof a != "object") {
|
|
1021
|
+
S.error("State source is not iterable", { collectionExp: s, raw: a });
|
|
1022
1022
|
return;
|
|
1023
1023
|
}
|
|
1024
|
-
const
|
|
1025
|
-
let
|
|
1026
|
-
for (const [f, y] of
|
|
1027
|
-
if (
|
|
1028
|
-
|
|
1024
|
+
const u = Array.isArray(a), d = u ? a.map((f, y) => [String(y), f]) : Object.entries(a), v = d.length, x = document.createDocumentFragment(), M = u ? pt(a) : void 0, N = { ...t };
|
|
1025
|
+
let C = 0;
|
|
1026
|
+
for (const [f, y] of d) {
|
|
1027
|
+
if (N.index = C, N.key = f, N.isFirst = C === 0, N.isLast = C === v - 1, N.isEven = C % 2 === 0, N.isOdd = C % 2 !== 0, c.type === "single" || (N[c.keyVar] = f), N[c.itemVar] = y, i && !B(i, N)) {
|
|
1028
|
+
C++;
|
|
1029
1029
|
continue;
|
|
1030
1030
|
}
|
|
1031
1031
|
const b = e.cloneNode(!0);
|
|
1032
|
-
|
|
1032
|
+
u && b instanceof HTMLElement && M && M[C] !== void 0 && ot(b, M[C]), b instanceof HTMLElement && (await $e(b, N, o), x.appendChild(b)), C++;
|
|
1033
1033
|
}
|
|
1034
1034
|
x.childNodes.length > 0 && e.parentNode ? e.parentNode.replaceChild(x, e) : e.remove();
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1037
|
-
const
|
|
1038
|
-
if (
|
|
1039
|
-
return
|
|
1040
|
-
},
|
|
1041
|
-
|
|
1042
|
-
},
|
|
1043
|
-
|
|
1036
|
+
function _t(e, t, o) {
|
|
1037
|
+
const n = e.parentNode, i = () => {
|
|
1038
|
+
if (n)
|
|
1039
|
+
return o.get(n);
|
|
1040
|
+
}, l = (a) => {
|
|
1041
|
+
n && o.set(n, a);
|
|
1042
|
+
}, r = () => {
|
|
1043
|
+
n && o.delete(n);
|
|
1044
1044
|
}, s = e.getAttribute("if");
|
|
1045
1045
|
if (s !== null) {
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1046
|
+
const a = !!B(s, t);
|
|
1047
|
+
l({ hasHead: !0, resolved: a }), a ? e.removeAttribute("if") : e.remove();
|
|
1048
1048
|
return;
|
|
1049
1049
|
}
|
|
1050
1050
|
const c = e.getAttribute("else-if");
|
|
1051
1051
|
if (c !== null) {
|
|
1052
|
-
const
|
|
1053
|
-
if (!
|
|
1052
|
+
const a = i();
|
|
1053
|
+
if (!a?.hasHead) {
|
|
1054
1054
|
e.remove();
|
|
1055
1055
|
return;
|
|
1056
1056
|
}
|
|
1057
|
-
if (
|
|
1057
|
+
if (a.resolved) {
|
|
1058
1058
|
e.remove();
|
|
1059
1059
|
return;
|
|
1060
1060
|
}
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1061
|
+
const u = !!B(c, t);
|
|
1062
|
+
l({ hasHead: !0, resolved: u }), u ? e.removeAttribute("else-if") : e.remove();
|
|
1063
1063
|
return;
|
|
1064
1064
|
}
|
|
1065
1065
|
if (e.hasAttribute("else")) {
|
|
1066
|
-
const
|
|
1067
|
-
if (!
|
|
1066
|
+
const a = i();
|
|
1067
|
+
if (!a?.hasHead) {
|
|
1068
1068
|
e.remove();
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
|
-
|
|
1071
|
+
a.resolved ? e.remove() : e.removeAttribute("else"), r();
|
|
1072
1072
|
return;
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
|
-
async function
|
|
1076
|
-
const
|
|
1077
|
-
for (let
|
|
1078
|
-
const
|
|
1079
|
-
for (const { node:
|
|
1080
|
-
if (
|
|
1081
|
-
if (
|
|
1082
|
-
await
|
|
1075
|
+
async function Ct(e, t, o = 50) {
|
|
1076
|
+
const n = /* @__PURE__ */ new WeakMap();
|
|
1077
|
+
for (let i = 0; i < e.length; i += o) {
|
|
1078
|
+
const l = e.slice(i, i + o);
|
|
1079
|
+
for (const { node: r, state: s } of l) {
|
|
1080
|
+
if (r instanceof HTMLElement) {
|
|
1081
|
+
if (r.hasAttribute("loop")) {
|
|
1082
|
+
await Nt(r, s, t);
|
|
1083
1083
|
continue;
|
|
1084
1084
|
}
|
|
1085
|
-
if (
|
|
1086
|
-
|
|
1085
|
+
if (r.hasAttribute("if") || r.hasAttribute("else") || r.hasAttribute("else-if")) {
|
|
1086
|
+
_t(r, s, n);
|
|
1087
1087
|
continue;
|
|
1088
1088
|
}
|
|
1089
1089
|
continue;
|
|
1090
1090
|
}
|
|
1091
|
-
const c =
|
|
1091
|
+
const c = ke(r.nodeValue, s);
|
|
1092
1092
|
if (Fe(c)) {
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1093
|
+
const a = document.createRange().createContextualFragment(c);
|
|
1094
|
+
r.replaceWith(a);
|
|
1095
1095
|
} else
|
|
1096
|
-
|
|
1096
|
+
r.nodeValue = c;
|
|
1097
1097
|
}
|
|
1098
|
-
|
|
1098
|
+
i + o < e.length && await new Promise(requestAnimationFrame);
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
async function
|
|
1101
|
+
async function $e(e, t, o) {
|
|
1102
1102
|
try {
|
|
1103
|
-
const
|
|
1104
|
-
let
|
|
1105
|
-
for (;
|
|
1106
|
-
if (
|
|
1107
|
-
|
|
1103
|
+
const n = bt(e), i = /* @__PURE__ */ new Set(), l = [];
|
|
1104
|
+
let r = n.currentNode;
|
|
1105
|
+
for (; r; ) {
|
|
1106
|
+
if (i.has(r)) {
|
|
1107
|
+
r = n.nextNode();
|
|
1108
1108
|
continue;
|
|
1109
1109
|
}
|
|
1110
|
-
if (
|
|
1111
|
-
const s =
|
|
1110
|
+
if (i.add(r), r.nodeType === Node.ELEMENT_NODE && r instanceof HTMLElement) {
|
|
1111
|
+
const s = r;
|
|
1112
1112
|
if (s.hasAttribute("loop")) {
|
|
1113
|
-
|
|
1113
|
+
l.push({ node: s, state: t }), r = vt(n, s);
|
|
1114
1114
|
continue;
|
|
1115
1115
|
}
|
|
1116
|
-
(s.hasAttribute("if") || s.hasAttribute("else") || s.hasAttribute("else-if")) &&
|
|
1116
|
+
(s.hasAttribute("if") || s.hasAttribute("else") || s.hasAttribute("else-if")) && l.push({ node: s, state: t });
|
|
1117
1117
|
for (const c of Array.from(s.attributes)) {
|
|
1118
|
-
if (c.name === "ref" && (
|
|
1119
|
-
const
|
|
1118
|
+
if (c.name === "ref" && (o[c.value] = s), c.name.startsWith(":")) {
|
|
1119
|
+
const a = c.name.slice(1), u = c.value.trim();
|
|
1120
1120
|
try {
|
|
1121
|
-
const
|
|
1122
|
-
if (
|
|
1123
|
-
const
|
|
1124
|
-
for (const [x,
|
|
1125
|
-
|
|
1126
|
-
if (
|
|
1127
|
-
const x = s.getAttribute("class") || "",
|
|
1128
|
-
s.setAttribute("class",
|
|
1121
|
+
const d = B(u, t);
|
|
1122
|
+
if (a === "class" && typeof d == "object" && d !== null) {
|
|
1123
|
+
const v = [];
|
|
1124
|
+
for (const [x, M] of Object.entries(d))
|
|
1125
|
+
M && v.push(x);
|
|
1126
|
+
if (v.length > 0) {
|
|
1127
|
+
const x = s.getAttribute("class") || "", M = x ? `${x} ${v.join(" ")}` : v.join(" ");
|
|
1128
|
+
s.setAttribute("class", M);
|
|
1129
1129
|
}
|
|
1130
|
-
} else
|
|
1130
|
+
} else d != null && d !== !1 && (d === !0 ? s.setAttribute(a, "") : s.setAttribute(a, String(d)));
|
|
1131
1131
|
s.removeAttribute(c.name);
|
|
1132
|
-
} catch (
|
|
1133
|
-
|
|
1132
|
+
} catch (d) {
|
|
1133
|
+
S.errorWithContext(
|
|
1134
1134
|
`Error evaluating dynamic attribute "${c.name}"`,
|
|
1135
|
-
{ attributeName: c.name, expression:
|
|
1136
|
-
|
|
1135
|
+
{ attributeName: c.name, expression: u },
|
|
1136
|
+
d
|
|
1137
1137
|
);
|
|
1138
1138
|
}
|
|
1139
1139
|
continue;
|
|
1140
1140
|
}
|
|
1141
1141
|
if (c.value.includes("{{"))
|
|
1142
1142
|
try {
|
|
1143
|
-
let
|
|
1144
|
-
c.name === "class" && (
|
|
1145
|
-
} catch (
|
|
1146
|
-
|
|
1143
|
+
let a = ke(c.value, t);
|
|
1144
|
+
c.name === "class" && (a = a.replace(/\s+/g, " ").trim()), a !== c.value && s.setAttribute(c.name, a);
|
|
1145
|
+
} catch (a) {
|
|
1146
|
+
S.errorWithContext(
|
|
1147
1147
|
`Error replacing attribute "${c.name}"`,
|
|
1148
1148
|
{ attributeName: c.name },
|
|
1149
|
-
|
|
1149
|
+
a
|
|
1150
1150
|
);
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
if (s.tagName.includes("-")) {
|
|
1154
|
-
|
|
1154
|
+
r = Et(n) || n.nextNode();
|
|
1155
1155
|
continue;
|
|
1156
1156
|
}
|
|
1157
|
-
} else if (
|
|
1158
|
-
let s =
|
|
1157
|
+
} else if (r.nodeType === Node.TEXT_NODE && r instanceof Text) {
|
|
1158
|
+
let s = r.parentElement, c = !1;
|
|
1159
1159
|
for (; s; ) {
|
|
1160
1160
|
if (s.tagName.includes("-")) {
|
|
1161
1161
|
c = !0;
|
|
@@ -1163,154 +1163,200 @@ async function Oe(e, t, n) {
|
|
|
1163
1163
|
}
|
|
1164
1164
|
s = s.parentElement;
|
|
1165
1165
|
}
|
|
1166
|
-
c ||
|
|
1166
|
+
c || l.push({ node: r, state: t });
|
|
1167
1167
|
}
|
|
1168
|
-
|
|
1168
|
+
r = n.nextNode();
|
|
1169
1169
|
}
|
|
1170
|
-
await
|
|
1171
|
-
} catch (
|
|
1172
|
-
throw
|
|
1170
|
+
await Ct(l, o);
|
|
1171
|
+
} catch (n) {
|
|
1172
|
+
throw S.errorWithContext("Error processing template", {}, n), n;
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function At(e, t = {}) {
|
|
1176
1176
|
if (!Array.isArray(e) || e.length === 0)
|
|
1177
1177
|
throw new Error("composeBySource: layers must be a non-empty array");
|
|
1178
1178
|
if (e.some((s) => s == null || typeof s != "object"))
|
|
1179
1179
|
throw new Error("composeBySource: all layers must be objects");
|
|
1180
|
-
const { defaultWriteIndex:
|
|
1181
|
-
|
|
1182
|
-
`Invalid defaultWriteIndex ${
|
|
1183
|
-
{ defaultWriteIndex:
|
|
1180
|
+
const { defaultWriteIndex: o = e.length - 1, includePrototype: n = !1 } = t, i = o >= 0 && o < e.length && Number.isInteger(o) ? o : e.length - 1;
|
|
1181
|
+
o !== i && S.warnWithContext(
|
|
1182
|
+
`Invalid defaultWriteIndex ${o}, using ${i}`,
|
|
1183
|
+
{ defaultWriteIndex: o, validWriteIndex: i, layersLength: e.length }
|
|
1184
1184
|
);
|
|
1185
|
-
const
|
|
1185
|
+
const l = (s, c) => n ? c in s : Object.prototype.hasOwnProperty.call(s, c), r = (s) => {
|
|
1186
1186
|
for (let c = 0; c < e.length; c++)
|
|
1187
|
-
if (
|
|
1187
|
+
if (l(e[c], s)) return c;
|
|
1188
1188
|
return -1;
|
|
1189
1189
|
};
|
|
1190
|
-
return new Proxy(e[
|
|
1190
|
+
return new Proxy(e[i], {
|
|
1191
1191
|
get(s, c) {
|
|
1192
|
-
const
|
|
1193
|
-
if (
|
|
1192
|
+
const a = r(c);
|
|
1193
|
+
if (a !== -1) return e[a][c];
|
|
1194
1194
|
},
|
|
1195
|
-
set(s, c,
|
|
1196
|
-
const
|
|
1197
|
-
return e[
|
|
1195
|
+
set(s, c, a) {
|
|
1196
|
+
const u = r(c), d = u !== -1 ? u : i;
|
|
1197
|
+
return e[d][c] = a, !0;
|
|
1198
1198
|
},
|
|
1199
1199
|
deleteProperty(s, c) {
|
|
1200
|
-
const
|
|
1201
|
-
return
|
|
1200
|
+
const a = r(c);
|
|
1201
|
+
return a === -1 ? !0 : delete e[a][c];
|
|
1202
1202
|
},
|
|
1203
1203
|
has(s, c) {
|
|
1204
|
-
return
|
|
1204
|
+
return r(c) !== -1;
|
|
1205
1205
|
},
|
|
1206
1206
|
ownKeys() {
|
|
1207
1207
|
const s = /* @__PURE__ */ new Set();
|
|
1208
1208
|
for (const c of e)
|
|
1209
|
-
Reflect.ownKeys(c).forEach((
|
|
1210
|
-
typeof
|
|
1209
|
+
Reflect.ownKeys(c).forEach((a) => {
|
|
1210
|
+
typeof a != "number" && s.add(a);
|
|
1211
1211
|
});
|
|
1212
1212
|
return Array.from(s);
|
|
1213
1213
|
},
|
|
1214
1214
|
getOwnPropertyDescriptor(s, c) {
|
|
1215
|
-
for (const
|
|
1216
|
-
const
|
|
1217
|
-
if (
|
|
1215
|
+
for (const a of e) {
|
|
1216
|
+
const u = Object.getOwnPropertyDescriptor(a, c);
|
|
1217
|
+
if (u) return u;
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1223
|
-
const t = e.getRootNode(),
|
|
1224
|
-
if (
|
|
1225
|
-
return
|
|
1222
|
+
function pe(e) {
|
|
1223
|
+
const t = e.getRootNode(), o = e.parentElement ?? (t instanceof ShadowRoot ? t.host : void 0);
|
|
1224
|
+
if (Je(o))
|
|
1225
|
+
return o.instance;
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function Tt({
|
|
1228
1228
|
container: e,
|
|
1229
1229
|
host: t
|
|
1230
1230
|
}) {
|
|
1231
|
-
const
|
|
1232
|
-
(
|
|
1233
|
-
),
|
|
1234
|
-
for (const
|
|
1235
|
-
const
|
|
1236
|
-
|
|
1231
|
+
const o = Array.from(t.childNodes).filter(
|
|
1232
|
+
(i) => i.nodeType === Node.ELEMENT_NODE || i.nodeType === Node.TEXT_NODE
|
|
1233
|
+
), n = {};
|
|
1234
|
+
for (const i of o) {
|
|
1235
|
+
const l = i instanceof HTMLElement && i.hasAttribute("slot") ? i.getAttribute("slot") : "default";
|
|
1236
|
+
n[l] || (n[l] = []), n[l].push(i);
|
|
1237
1237
|
}
|
|
1238
|
-
e.querySelectorAll("slot").forEach((
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
}),
|
|
1238
|
+
e.querySelectorAll("slot").forEach((i) => {
|
|
1239
|
+
const l = i.getAttribute("name") || "default", r = n[l];
|
|
1240
|
+
r && r.length > 0 && r.forEach((s) => {
|
|
1241
|
+
i.parentNode.insertBefore(s, i);
|
|
1242
|
+
}), i.remove();
|
|
1243
1243
|
});
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function St(e, t, o) {
|
|
1246
|
+
const n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = () => {
|
|
1247
|
+
for (const a of Object.keys(o)) {
|
|
1248
|
+
const u = n.get(o[a]);
|
|
1249
|
+
u instanceof HTMLElement && (o[a] = u);
|
|
1250
|
+
}
|
|
1251
|
+
};
|
|
1252
|
+
if (!e.querySelector("slot")) return { commit: () => {
|
|
1253
|
+
}, remapRefs: l };
|
|
1254
|
+
const r = document.createElement("div"), s = (a) => {
|
|
1255
|
+
const u = a.cloneNode(!1);
|
|
1256
|
+
if (n.set(u, a), !(a instanceof HTMLElement && a.tagName.includes("-")))
|
|
1257
|
+
for (const d of a.childNodes) u.appendChild(s(d));
|
|
1258
|
+
return i.set(u, {
|
|
1259
|
+
attributes: new Map(
|
|
1260
|
+
a instanceof HTMLElement ? Array.from(a.attributes, (d) => [d.name, d.value]) : []
|
|
1261
|
+
),
|
|
1262
|
+
children: Array.from(u.childNodes),
|
|
1263
|
+
value: u.nodeValue
|
|
1264
|
+
}), u;
|
|
1265
|
+
};
|
|
1266
|
+
for (const a of t.childNodes) r.appendChild(s(a));
|
|
1267
|
+
return Tt({ container: e, host: r }), { commit: () => {
|
|
1268
|
+
const a = (u) => {
|
|
1269
|
+
const d = n.get(u), v = i.get(u), x = Array.from(u.childNodes), M = x.map(a);
|
|
1270
|
+
if (!d || !v)
|
|
1271
|
+
return x.forEach((N, C) => {
|
|
1272
|
+
M[C] !== N && N.replaceWith(M[C]);
|
|
1273
|
+
}), u;
|
|
1274
|
+
if (d instanceof HTMLElement && u instanceof HTMLElement) {
|
|
1275
|
+
for (const N of v.attributes.keys())
|
|
1276
|
+
u.hasAttribute(N) || d.removeAttribute(N);
|
|
1277
|
+
for (const N of Array.from(u.attributes))
|
|
1278
|
+
v.attributes.get(N.name) !== N.value && d.setAttribute(N.name, N.value);
|
|
1279
|
+
!d.tagName.includes("-") && (x.length !== v.children.length || x.some((N, C) => N !== v.children[C])) && d.replaceChildren(...M);
|
|
1280
|
+
} else u.nodeValue !== v.value && (d.nodeValue = u.nodeValue);
|
|
1281
|
+
return d;
|
|
1282
|
+
};
|
|
1283
|
+
for (const u of Array.from(e.childNodes)) {
|
|
1284
|
+
const d = a(u);
|
|
1285
|
+
d !== u && u.replaceWith(d);
|
|
1286
|
+
}
|
|
1287
|
+
l();
|
|
1288
|
+
}, remapRefs: l };
|
|
1289
|
+
}
|
|
1290
|
+
function oe({
|
|
1246
1291
|
propName: e,
|
|
1247
1292
|
propValue: t,
|
|
1248
|
-
props:
|
|
1293
|
+
props: o
|
|
1249
1294
|
}) {
|
|
1250
|
-
const
|
|
1251
|
-
if (!
|
|
1252
|
-
const
|
|
1253
|
-
string:
|
|
1254
|
-
number:
|
|
1255
|
-
boolean:
|
|
1256
|
-
array: Array.isArray(
|
|
1257
|
-
object:
|
|
1258
|
-
function:
|
|
1295
|
+
const n = o[e], i = t ?? n?.default;
|
|
1296
|
+
if (!n) return !0;
|
|
1297
|
+
const l = Ve(n.type), r = Array.isArray(i) ? "array" : typeof i, s = {
|
|
1298
|
+
string: r === "string",
|
|
1299
|
+
number: r === "number",
|
|
1300
|
+
boolean: r === "boolean",
|
|
1301
|
+
array: Array.isArray(i),
|
|
1302
|
+
object: r === "object" && i !== null && !Array.isArray(i),
|
|
1303
|
+
function: r === "function"
|
|
1259
1304
|
};
|
|
1260
|
-
return (
|
|
1261
|
-
`Prop "${e}" should be of type "${
|
|
1262
|
-
|
|
1305
|
+
return (l === "unknown" ? !0 : s[l] ?? !1) ? n.regex && typeof i == "string" && !new RegExp(n.regex).test(i) ? (S.error(`Prop "${e}" does not match regex "${n.regex}".`), !1) : !0 : (S.error(
|
|
1306
|
+
`Prop "${e}" should be of type "${l}", but got "${r}".`,
|
|
1307
|
+
i
|
|
1263
1308
|
), !1);
|
|
1264
1309
|
}
|
|
1265
|
-
function
|
|
1310
|
+
function me({
|
|
1266
1311
|
ele: e,
|
|
1267
1312
|
parent: t,
|
|
1268
|
-
props:
|
|
1269
|
-
state:
|
|
1313
|
+
props: o,
|
|
1314
|
+
state: n
|
|
1270
1315
|
}) {
|
|
1271
|
-
const
|
|
1272
|
-
Object.defineProperty(
|
|
1316
|
+
const i = Object.keys(o).length > 0, l = (r, s) => {
|
|
1317
|
+
Object.defineProperty(n, r, {
|
|
1273
1318
|
enumerable: !0,
|
|
1274
1319
|
configurable: !0,
|
|
1275
1320
|
get() {
|
|
1276
1321
|
if (t)
|
|
1277
|
-
return
|
|
1322
|
+
return re(t.state, s);
|
|
1278
1323
|
},
|
|
1279
1324
|
set(c) {
|
|
1280
1325
|
if (!(!t || !t.state))
|
|
1281
1326
|
try {
|
|
1282
|
-
|
|
1283
|
-
} catch (
|
|
1284
|
-
|
|
1285
|
-
`Failed to set bound prop "${
|
|
1286
|
-
{ propName:
|
|
1287
|
-
|
|
1327
|
+
je(t.state, s, c);
|
|
1328
|
+
} catch (a) {
|
|
1329
|
+
S.errorWithContext(
|
|
1330
|
+
`Failed to set bound prop "${r}" → "${s}"`,
|
|
1331
|
+
{ propName: r, parentPath: s },
|
|
1332
|
+
a
|
|
1288
1333
|
);
|
|
1289
1334
|
}
|
|
1290
1335
|
}
|
|
1291
1336
|
});
|
|
1292
1337
|
};
|
|
1293
|
-
for (const
|
|
1294
|
-
const s =
|
|
1295
|
-
if (s && !t || !(!
|
|
1338
|
+
for (const r of e.attributes) {
|
|
1339
|
+
const s = r.name.startsWith(":"), c = qe(r.name.substring(s ? 1 : 0));
|
|
1340
|
+
if (s && !t || !(!i || o[c] && o[c] !== void 0)) continue;
|
|
1296
1341
|
if (!s) {
|
|
1297
|
-
const
|
|
1298
|
-
(!
|
|
1342
|
+
const v = r.value !== "" ? r.value : !0;
|
|
1343
|
+
(!i || oe({ propName: c, propValue: v, props: o })) && (n[c] = v);
|
|
1299
1344
|
continue;
|
|
1300
1345
|
}
|
|
1301
|
-
const
|
|
1302
|
-
if (
|
|
1303
|
-
const
|
|
1304
|
-
(!
|
|
1346
|
+
const u = r.value?.trim() ?? "";
|
|
1347
|
+
if (u && be(u)) {
|
|
1348
|
+
const v = re(t.state, u);
|
|
1349
|
+
(!i || oe({ propName: c, propValue: v, props: o })) && l(c, u);
|
|
1305
1350
|
continue;
|
|
1306
1351
|
}
|
|
1307
|
-
const
|
|
1308
|
-
(!
|
|
1352
|
+
const d = u ? B(u, t.state) : void 0;
|
|
1353
|
+
(!i || oe({ propName: c, propValue: d, props: o })) && (n[c] = d);
|
|
1309
1354
|
}
|
|
1310
|
-
for (const [
|
|
1311
|
-
|
|
1355
|
+
for (const [r, s] of Object.entries(o))
|
|
1356
|
+
r in n || (s.default !== void 0 ? n[r] = s.default : s.required && S.error(`Required prop "${r}" is missing.`));
|
|
1312
1357
|
}
|
|
1313
|
-
function
|
|
1358
|
+
function xt(e, t) {
|
|
1359
|
+
const o = /* @__PURE__ */ new Set();
|
|
1314
1360
|
customElements.define(
|
|
1315
1361
|
e,
|
|
1316
1362
|
class extends HTMLElement {
|
|
@@ -1320,6 +1366,7 @@ function _t(e, t) {
|
|
|
1320
1366
|
*/
|
|
1321
1367
|
instance;
|
|
1322
1368
|
// Cleanup state for deterministic teardown
|
|
1369
|
+
_connectionVersion = 0;
|
|
1323
1370
|
_isDisconnected = !1;
|
|
1324
1371
|
_isMounted = !1;
|
|
1325
1372
|
// Track if component has been mounted (persists across connectedCallback calls)
|
|
@@ -1333,176 +1380,176 @@ function _t(e, t) {
|
|
|
1333
1380
|
super(), this.template = document.createElement("template"), this.template.innerHTML = t.template;
|
|
1334
1381
|
}
|
|
1335
1382
|
async connectedCallback() {
|
|
1336
|
-
const n = this;
|
|
1383
|
+
const n = this, i = ++this._connectionVersion;
|
|
1384
|
+
if (this._isDisconnected = !1, this._renderAborted = !1, this._pendingRender = null, o.add(this), !document.head.querySelector(`style#style-${e}`)) {
|
|
1385
|
+
const g = document.createElement("style");
|
|
1386
|
+
g.id = `style-${e}`, g.textContent = t.style, document.head.appendChild(g);
|
|
1387
|
+
}
|
|
1337
1388
|
if (n.instance && this._model && this._observerFn) {
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1389
|
+
const g = n.instance, p = pe(n);
|
|
1390
|
+
g.$parent = p, this._isDisconnected = !1, this._renderAborted = !1, this._pendingRender = null, this._model.addObserver(this._observerFn), g.props && g.state && me({
|
|
1340
1391
|
ele: n,
|
|
1341
|
-
parent:
|
|
1342
|
-
props:
|
|
1343
|
-
state:
|
|
1392
|
+
parent: p,
|
|
1393
|
+
props: g.props,
|
|
1394
|
+
state: g.state
|
|
1344
1395
|
});
|
|
1345
1396
|
return;
|
|
1346
1397
|
}
|
|
1347
|
-
const r = (t.type || "options") === "options",
|
|
1348
|
-
let
|
|
1398
|
+
const r = (t.type || "options") === "options", s = pe(n), c = this.template.cloneNode(!0);
|
|
1399
|
+
let a;
|
|
1349
1400
|
if (t.deps) {
|
|
1350
|
-
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1401
|
+
a = {};
|
|
1402
|
+
const g = Object.entries(t.deps), p = await Promise.all(
|
|
1403
|
+
g.map(([, _]) => _())
|
|
1353
1404
|
);
|
|
1354
|
-
for (let
|
|
1355
|
-
|
|
1405
|
+
for (let _ = 0; _ < g.length; _++)
|
|
1406
|
+
a[g[_][0]] = p[_];
|
|
1356
1407
|
}
|
|
1357
|
-
|
|
1358
|
-
|
|
1408
|
+
if (i !== this._connectionVersion || this._isDisconnected) return;
|
|
1409
|
+
const u = Ke(t.script, a), d = {};
|
|
1410
|
+
let v = !1, x = -1;
|
|
1359
1411
|
this._isDisconnected = !1, this._renderAborted = !1, this._pendingRender = null;
|
|
1360
|
-
const
|
|
1361
|
-
let
|
|
1362
|
-
return { promise: new Promise((
|
|
1363
|
-
|
|
1364
|
-
}), resolve:
|
|
1412
|
+
const M = Ee(), N = (() => {
|
|
1413
|
+
let g;
|
|
1414
|
+
return { promise: new Promise((_) => {
|
|
1415
|
+
g = _;
|
|
1416
|
+
}), resolve: g };
|
|
1365
1417
|
})();
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
if (!E || typeof E.setup != "function") {
|
|
1374
|
-
_.warnWithContext(
|
|
1375
|
-
`Plugin "${h}" not found or has no setup method`,
|
|
1376
|
-
{ pluginName: h }
|
|
1418
|
+
let C, f;
|
|
1419
|
+
const y = (g) => {
|
|
1420
|
+
const p = Z.plugins[g];
|
|
1421
|
+
if (!p || typeof p.setup != "function") {
|
|
1422
|
+
S.warnWithContext(
|
|
1423
|
+
`Plugin "${g}" not found or has no setup method`,
|
|
1424
|
+
{ pluginName: g }
|
|
1377
1425
|
);
|
|
1378
1426
|
return;
|
|
1379
1427
|
}
|
|
1380
1428
|
try {
|
|
1381
|
-
const
|
|
1382
|
-
return
|
|
1383
|
-
} catch (
|
|
1384
|
-
|
|
1385
|
-
`Plugin "${
|
|
1386
|
-
{ pluginName:
|
|
1387
|
-
|
|
1429
|
+
const _ = r && f ? f : C;
|
|
1430
|
+
return p.setup.call(_);
|
|
1431
|
+
} catch (_) {
|
|
1432
|
+
S.errorWithContext(
|
|
1433
|
+
`Plugin "${g}" setup failed`,
|
|
1434
|
+
{ pluginName: g },
|
|
1435
|
+
_
|
|
1388
1436
|
);
|
|
1389
1437
|
return;
|
|
1390
1438
|
}
|
|
1391
|
-
},
|
|
1392
|
-
for (const [
|
|
1393
|
-
if (typeof
|
|
1394
|
-
const
|
|
1439
|
+
}, b = {};
|
|
1440
|
+
for (const [g, p] of Object.entries(Z.modules))
|
|
1441
|
+
if (typeof p.attach == "function") {
|
|
1442
|
+
const _ = p.attach.call({
|
|
1395
1443
|
element: n,
|
|
1396
|
-
parent:
|
|
1397
|
-
core: { take:
|
|
1444
|
+
parent: s,
|
|
1445
|
+
core: { take: Pe.take }
|
|
1398
1446
|
});
|
|
1399
|
-
|
|
1447
|
+
_ && (b[`$${g}`] = _);
|
|
1400
1448
|
}
|
|
1401
|
-
const
|
|
1402
|
-
let
|
|
1403
|
-
return
|
|
1404
|
-
},
|
|
1405
|
-
const
|
|
1406
|
-
let
|
|
1407
|
-
for (;
|
|
1408
|
-
const
|
|
1409
|
-
if (
|
|
1410
|
-
const
|
|
1411
|
-
typeof
|
|
1412
|
-
} else if (
|
|
1413
|
-
const
|
|
1414
|
-
typeof
|
|
1449
|
+
const w = /* @__PURE__ */ new Map(), h = (g) => {
|
|
1450
|
+
let p = w.get(g);
|
|
1451
|
+
return p || (p = `on${g.charAt(0).toUpperCase()}${g.slice(1)}`, w.set(g, p)), p;
|
|
1452
|
+
}, m = (g, ...p) => {
|
|
1453
|
+
const _ = h(g);
|
|
1454
|
+
let O = s;
|
|
1455
|
+
for (; O; ) {
|
|
1456
|
+
const L = O.userContext;
|
|
1457
|
+
if (L) {
|
|
1458
|
+
const j = L[_];
|
|
1459
|
+
typeof j == "function" && j(...p);
|
|
1460
|
+
} else if (O.methods) {
|
|
1461
|
+
const j = O.methods[_];
|
|
1462
|
+
typeof j == "function" && j(...p);
|
|
1415
1463
|
}
|
|
1416
|
-
|
|
1464
|
+
O = O.$parent;
|
|
1417
1465
|
}
|
|
1418
|
-
},
|
|
1419
|
-
$refs:
|
|
1420
|
-
$parent:
|
|
1421
|
-
$emit:
|
|
1422
|
-
$take:
|
|
1423
|
-
...
|
|
1424
|
-
},
|
|
1425
|
-
|
|
1426
|
-
const
|
|
1427
|
-
let
|
|
1428
|
-
r && (
|
|
1466
|
+
}, E = {
|
|
1467
|
+
$refs: d,
|
|
1468
|
+
$parent: s,
|
|
1469
|
+
$emit: m,
|
|
1470
|
+
$take: y,
|
|
1471
|
+
...b
|
|
1472
|
+
}, T = u(E), A = yt(T.state ?? {});
|
|
1473
|
+
C = A.state;
|
|
1474
|
+
const I = T.methods || {}, R = T.props || {}, D = T.events || [];
|
|
1475
|
+
let k = T.watchList || [];
|
|
1476
|
+
r && (f = At([I, C])), me({
|
|
1429
1477
|
ele: n,
|
|
1430
|
-
parent:
|
|
1431
|
-
props:
|
|
1432
|
-
state:
|
|
1433
|
-
}), r &&
|
|
1434
|
-
for (const
|
|
1435
|
-
const
|
|
1436
|
-
if (typeof
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1478
|
+
parent: s,
|
|
1479
|
+
props: R,
|
|
1480
|
+
state: C
|
|
1481
|
+
}), r && f && We(I, f);
|
|
1482
|
+
for (const g of De) {
|
|
1483
|
+
const p = T[g];
|
|
1484
|
+
if (typeof p == "function") {
|
|
1485
|
+
const _ = r && f ? Y(p, f) : p;
|
|
1486
|
+
we(M, g, async () => {
|
|
1487
|
+
const O = _();
|
|
1488
|
+
O instanceof Promise && await O;
|
|
1441
1489
|
});
|
|
1442
1490
|
}
|
|
1443
1491
|
}
|
|
1444
|
-
this._model =
|
|
1445
|
-
const
|
|
1492
|
+
this._model = A;
|
|
1493
|
+
const $ = async () => {
|
|
1446
1494
|
if (this._isDisconnected)
|
|
1447
1495
|
return;
|
|
1448
|
-
if (
|
|
1449
|
-
this._renderAborted = !0, this._pendingRender =
|
|
1496
|
+
if (v) {
|
|
1497
|
+
this._renderAborted = !0, this._pendingRender = $;
|
|
1450
1498
|
return;
|
|
1451
1499
|
}
|
|
1452
|
-
const
|
|
1453
|
-
if (
|
|
1454
|
-
|
|
1500
|
+
const g = A.getStateVersion();
|
|
1501
|
+
if (x !== g) {
|
|
1502
|
+
v = !0, this._renderAborted = !1, n.instance && (n.instance.isRendering = !0);
|
|
1455
1503
|
try {
|
|
1456
|
-
const
|
|
1457
|
-
if (
|
|
1458
|
-
this._pendingRender =
|
|
1504
|
+
const p = c.content.cloneNode(!0), _ = St(p, n, d);
|
|
1505
|
+
if (await $e(p, r && f ? f : C, d), _.remapRefs(), this._renderAborted || this._model !== A) {
|
|
1506
|
+
this._pendingRender = $;
|
|
1459
1507
|
return;
|
|
1460
1508
|
}
|
|
1461
|
-
const
|
|
1462
|
-
if (await
|
|
1463
|
-
this._pendingRender =
|
|
1509
|
+
const L = r && f ? f : C;
|
|
1510
|
+
if (await P("global", "processed", L), await P(M, "processed"), this._renderAborted || this._model !== A) {
|
|
1511
|
+
this._pendingRender = $;
|
|
1464
1512
|
return;
|
|
1465
1513
|
}
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
L,
|
|
1470
|
-
E,
|
|
1471
|
-
l
|
|
1472
|
-
));
|
|
1473
|
-
const F = g.flushChanges();
|
|
1474
|
-
Object.defineProperty(C, "changedPaths", {
|
|
1475
|
-
value: F,
|
|
1514
|
+
const j = A.flushChanges();
|
|
1515
|
+
Object.defineProperty(L, "changedPaths", {
|
|
1516
|
+
value: j,
|
|
1476
1517
|
writable: !0,
|
|
1477
1518
|
configurable: !0,
|
|
1478
1519
|
enumerable: !1
|
|
1479
1520
|
});
|
|
1480
|
-
const
|
|
1481
|
-
if (await
|
|
1521
|
+
const le = !this._isMounted;
|
|
1522
|
+
if (await P(
|
|
1482
1523
|
"global",
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
), await
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
), this._renderAborted) {
|
|
1490
|
-
delete
|
|
1524
|
+
le ? "beforeMount" : "beforeUpdate",
|
|
1525
|
+
L
|
|
1526
|
+
), await P(
|
|
1527
|
+
M,
|
|
1528
|
+
le ? "beforeMount" : "beforeUpdate",
|
|
1529
|
+
L
|
|
1530
|
+
), this._renderAborted || this._model !== A) {
|
|
1531
|
+
delete L.changedPaths, this._pendingRender = $;
|
|
1491
1532
|
return;
|
|
1492
1533
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1534
|
+
_.commit(), r && f ? (st(f, p), this._eventCleanup && this._eventCleanup(), this._eventCleanup = it(f, D, p, d)) : (ct(I, p), this._eventCleanup && this._eventCleanup(), this._eventCleanup = at(
|
|
1535
|
+
I,
|
|
1536
|
+
C,
|
|
1537
|
+
D,
|
|
1538
|
+
p,
|
|
1539
|
+
d
|
|
1540
|
+
)), nt(n, p, !this._isMounted, t.structAttr), this._isMounted && (await P("global", "updated", L), await P(M, "updated", L)), delete L.changedPaths, x = g, n.instance && (n.instance._lastRenderedStateVersion = x);
|
|
1541
|
+
} catch (p) {
|
|
1542
|
+
S.errorWithContext("Error during render", { componentName: e }, p);
|
|
1496
1543
|
} finally {
|
|
1497
|
-
const
|
|
1498
|
-
if (delete
|
|
1499
|
-
const
|
|
1544
|
+
const p = r && f ? f : C;
|
|
1545
|
+
if (delete p.changedPaths, v = !1, n.instance && (n.instance.isRendering = !1), this._pendingRender && !this._isDisconnected) {
|
|
1546
|
+
const _ = this._pendingRender;
|
|
1500
1547
|
this._pendingRender = null, requestAnimationFrame(() => {
|
|
1501
|
-
this._isDisconnected ||
|
|
1502
|
-
|
|
1548
|
+
this._isDisconnected || _().catch((O) => {
|
|
1549
|
+
S.errorWithContext(
|
|
1503
1550
|
"Error during pending render",
|
|
1504
1551
|
{ componentName: e },
|
|
1505
|
-
|
|
1552
|
+
O
|
|
1506
1553
|
);
|
|
1507
1554
|
});
|
|
1508
1555
|
});
|
|
@@ -1512,104 +1559,109 @@ function _t(e, t) {
|
|
|
1512
1559
|
};
|
|
1513
1560
|
n.instance = {
|
|
1514
1561
|
element: n,
|
|
1515
|
-
template:
|
|
1516
|
-
state:
|
|
1517
|
-
userContext: r ?
|
|
1518
|
-
props:
|
|
1519
|
-
methods:
|
|
1520
|
-
events:
|
|
1521
|
-
watchList:
|
|
1522
|
-
$refs:
|
|
1523
|
-
$parent:
|
|
1524
|
-
$emit:
|
|
1525
|
-
$take:
|
|
1526
|
-
readyPromise:
|
|
1527
|
-
lifecycleRegistry:
|
|
1528
|
-
...
|
|
1562
|
+
template: c,
|
|
1563
|
+
state: C,
|
|
1564
|
+
userContext: r ? f : void 0,
|
|
1565
|
+
props: R,
|
|
1566
|
+
methods: I,
|
|
1567
|
+
events: D,
|
|
1568
|
+
watchList: k,
|
|
1569
|
+
$refs: d,
|
|
1570
|
+
$parent: s,
|
|
1571
|
+
$emit: m,
|
|
1572
|
+
$take: y,
|
|
1573
|
+
readyPromise: N.promise,
|
|
1574
|
+
lifecycleRegistry: M,
|
|
1575
|
+
...b,
|
|
1529
1576
|
isRendering: !1
|
|
1530
1577
|
}, this._observerFn = () => {
|
|
1531
|
-
if (this._isDisconnected ||
|
|
1578
|
+
if (this._isDisconnected || k && k.length > 0 && !A.hasPendingChangesFor(k))
|
|
1532
1579
|
return;
|
|
1533
|
-
let
|
|
1534
|
-
for (;
|
|
1535
|
-
if (
|
|
1580
|
+
let g = s;
|
|
1581
|
+
for (; g; ) {
|
|
1582
|
+
if (g.isRendering)
|
|
1536
1583
|
return;
|
|
1537
|
-
|
|
1584
|
+
g = g.$parent;
|
|
1538
1585
|
}
|
|
1539
1586
|
requestAnimationFrame(() => {
|
|
1540
|
-
this._isDisconnected ||
|
|
1541
|
-
|
|
1587
|
+
this._isDisconnected || $().catch((p) => {
|
|
1588
|
+
S.errorWithContext(
|
|
1542
1589
|
"Error during render (observer)",
|
|
1543
1590
|
{ componentName: e },
|
|
1544
|
-
|
|
1591
|
+
p
|
|
1545
1592
|
);
|
|
1546
1593
|
});
|
|
1547
1594
|
});
|
|
1548
|
-
},
|
|
1549
|
-
const
|
|
1550
|
-
await
|
|
1595
|
+
}, A.addObserver(this._observerFn);
|
|
1596
|
+
const G = r && f ? f : C;
|
|
1597
|
+
if (await P("global", "created", G), await P(M, "created"), !(this._isDisconnected || this._model !== A) && (await $(), !(this._isDisconnected || this._model !== A))) {
|
|
1598
|
+
if (!this._isMounted) {
|
|
1599
|
+
if (await P("global", "mounted", G), this._isDisconnected || this._model !== A || (await P(M, "mounted"), this._isDisconnected || this._model !== A)) return;
|
|
1600
|
+
this._isMounted = !0;
|
|
1601
|
+
}
|
|
1602
|
+
N.resolve();
|
|
1603
|
+
}
|
|
1551
1604
|
}
|
|
1552
1605
|
async disconnectedCallback() {
|
|
1553
|
-
const n = this;
|
|
1554
|
-
if (!n.instance) return;
|
|
1555
|
-
|
|
1556
|
-
const o = n.instance;
|
|
1606
|
+
const n = this, i = ++this._connectionVersion;
|
|
1607
|
+
if (this._isDisconnected = !0, this._renderAborted = !0, this._pendingRender = null, o.delete(this), o.size === 0 && document.head.querySelector(`style#style-${e}`)?.remove(), !n.instance) return;
|
|
1608
|
+
const l = n.instance;
|
|
1557
1609
|
this._isDisconnected = !0, this._renderAborted = !0, this._pendingRender = null, this._model && this._observerFn && this._model.removeObserver(this._observerFn);
|
|
1558
|
-
const r =
|
|
1559
|
-
await
|
|
1610
|
+
const r = l.userContext || l.state;
|
|
1611
|
+
await P("global", "beforeDestroy", r), await P(l.lifecycleRegistry, "beforeDestroy"), !(!this._isDisconnected || i !== this._connectionVersion) && (Se(this), this._eventCleanup && (this._eventCleanup(), this._eventCleanup = null), await P("global", "destroyed", r), await P(l.lifecycleRegistry, "destroyed"), !(!this._isDisconnected || i !== this._connectionVersion) && (this._isMounted = !1, this._model = void 0, this._observerFn = void 0, this._eventCleanup = null, n.instance = void 0));
|
|
1560
1612
|
}
|
|
1561
1613
|
}
|
|
1562
1614
|
);
|
|
1563
1615
|
}
|
|
1564
|
-
let
|
|
1565
|
-
function
|
|
1566
|
-
|
|
1616
|
+
let ce = !1, ye = !1, ae = [];
|
|
1617
|
+
function Mt() {
|
|
1618
|
+
ye || (ye = !0, !(typeof document > "u" || typeof HTMLElement > "u") && (lt(), Qe(), ut()));
|
|
1567
1619
|
}
|
|
1568
|
-
function
|
|
1569
|
-
const t = e[0],
|
|
1570
|
-
if (
|
|
1571
|
-
if (!
|
|
1572
|
-
|
|
1620
|
+
function Re(...e) {
|
|
1621
|
+
const t = e[0], o = e[1];
|
|
1622
|
+
if (Ze(t)) {
|
|
1623
|
+
if (!o) {
|
|
1624
|
+
S.error("ComponentSource requires a component name when calling take()");
|
|
1573
1625
|
return;
|
|
1574
1626
|
}
|
|
1575
|
-
|
|
1627
|
+
xt(o, t);
|
|
1576
1628
|
return;
|
|
1577
1629
|
}
|
|
1578
|
-
if (
|
|
1579
|
-
const
|
|
1580
|
-
registerHook: (
|
|
1581
|
-
|
|
1630
|
+
if (J(t) || Ye(t)) {
|
|
1631
|
+
const n = {
|
|
1632
|
+
registerHook: (i, l) => {
|
|
1633
|
+
we("global", i, l);
|
|
1582
1634
|
},
|
|
1583
|
-
take:
|
|
1635
|
+
take: Pe.take
|
|
1584
1636
|
};
|
|
1585
1637
|
try {
|
|
1586
|
-
t.install(
|
|
1587
|
-
} catch (
|
|
1588
|
-
|
|
1638
|
+
t.install(n), J(t) ? Z.plugins[t.name] = t : Z.modules[t.name] = t;
|
|
1639
|
+
} catch (i) {
|
|
1640
|
+
S.errorWithContext(
|
|
1589
1641
|
"Failed to install extension",
|
|
1590
|
-
{ name: t.name, type:
|
|
1591
|
-
|
|
1642
|
+
{ name: t.name, type: J(t) ? "plugin" : "module" },
|
|
1643
|
+
i
|
|
1592
1644
|
);
|
|
1593
1645
|
}
|
|
1594
1646
|
return;
|
|
1595
1647
|
}
|
|
1596
|
-
|
|
1648
|
+
S.error("Unknown extension type", t);
|
|
1597
1649
|
}
|
|
1598
|
-
function
|
|
1599
|
-
|
|
1650
|
+
function Ot() {
|
|
1651
|
+
ce || (ce = !0, ae.forEach((e) => Re(...e)), ae = [], S.info("Core initialized"));
|
|
1600
1652
|
}
|
|
1601
|
-
const
|
|
1653
|
+
const Pe = Object.assign(
|
|
1602
1654
|
() => {
|
|
1603
|
-
|
|
1655
|
+
Mt(), Ot();
|
|
1604
1656
|
},
|
|
1605
1657
|
{
|
|
1606
1658
|
take: (...t) => {
|
|
1607
|
-
|
|
1659
|
+
ce ? Re(...t) : ae.push(t);
|
|
1608
1660
|
}
|
|
1609
1661
|
}
|
|
1610
1662
|
);
|
|
1611
1663
|
export {
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1664
|
+
Pe as Core,
|
|
1665
|
+
Ie as LogLevel,
|
|
1666
|
+
S as logger
|
|
1615
1667
|
};
|