solely 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- var te = Object.defineProperty;
2
- var Nt = (s) => {
3
- throw TypeError(s);
1
+ var Xt = Object.defineProperty;
2
+ var Pt = (n) => {
3
+ throw TypeError(n);
4
4
  };
5
- var ee = (s, t, e) => t in s ? te(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
6
- var C = (s, t, e) => ee(s, typeof t != "symbol" ? t + "" : t, e), vt = (s, t, e) => t.has(s) || Nt("Cannot " + e);
7
- var R = (s, t, e) => (vt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), N = (s, t, e) => t.has(s) ? Nt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), _ = (s, t, e, n) => (vt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), O = (s, t, e) => (vt(s, t, "access private method"), e);
8
- const se = {
5
+ var Qt = (n, t, e) => t in n ? Xt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
6
+ var k = (n, t, e) => Qt(n, typeof t != "symbol" ? t + "" : t, e), gt = (n, t, e) => t.has(n) || Pt("Cannot " + e);
7
+ var P = (n, t, e) => (gt(n, t, "read from private field"), e ? e.call(n) : t.get(n)), T = (n, t, e) => t.has(n) ? Pt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), O = (n, t, e, s) => (gt(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), N = (n, t, e) => (gt(n, t, "access private method"), e);
8
+ const te = {
9
9
  dark: {
10
10
  gutter: "#858585",
11
11
  errorLineBg: "#3c1e1e",
@@ -16,30 +16,31 @@ const se = {
16
16
  exprLabel: "#a0a0a0",
17
17
  exprCode: "#5ddcff"
18
18
  }
19
- }, T = se.dark;
20
- function lt(s) {
19
+ }, W = te.dark;
20
+ function ot(n) {
21
21
  let t = 0;
22
- for (let e = 0; e < s.length; ) {
23
- const n = s.codePointAt(e);
24
- if (s[e] === " ") {
22
+ for (let e = 0; e < n.length; ) {
23
+ const s = n.codePointAt(e);
24
+ if (n[e] === " ") {
25
25
  t += 4, e++;
26
26
  continue;
27
27
  }
28
- n >= 9472 && n <= 9599 || n > 255 ? t += 2 : t += 1, e += n > 65535 ? 2 : 1;
28
+ s >= 9472 && s <= 9599 || s > 255 ? t += 2 : t += 1, e += s > 65535 ? 2 : 1;
29
29
  }
30
30
  return t;
31
31
  }
32
- function _t(s, t) {
33
- return (t ? "~" : "^").repeat(Math.max(1, s));
32
+ function Ot(n, t = {}) {
33
+ const { lineIndex: e = 0, totalLines: s = 1 } = t, r = Math.max(1, Math.floor(n));
34
+ return (s <= 1 || e === 0 ? "^" : "~").repeat(r);
34
35
  }
35
- function ne(s, t = "", e, n = "component") {
36
- var I;
37
- const r = (s == null ? void 0 : s.message) ?? String(s), i = `%cTemplate Error%c in <${n}> → ${r}`, o = [
38
- `color:${T.badgeFg};background:${T.badgeBg};padding:4px 10px;border-radius:6px;font-weight:bold;`,
39
- `color:${T.arrow};font-weight:bold;`
36
+ function ee(n, t = "", e, s = "component") {
37
+ var L;
38
+ const r = (n == null ? void 0 : n.message) ?? String(n), o = `%cTemplate Error%c in <${s}> → ${r}`, i = [
39
+ `color:${W.badgeFg};background:${W.badgeBg};padding:4px 10px;border-radius:6px;font-weight:bold;`,
40
+ `color:${W.arrow};font-weight:bold;`
40
41
  ];
41
42
  if (!t || !(e != null && e.loc) || e.loc.length < 2) {
42
- console.error(i, ...o), e != null && e.expr && console.log(`Expression: ${e.expr.trim()}`);
43
+ console.error(o, ...i), e != null && e.expr && console.log(`Expression: ${e.expr.trim()}`);
43
44
  return;
44
45
  }
45
46
  const c = e.loc;
@@ -51,106 +52,107 @@ function ne(s, t = "", e, n = "component") {
51
52
  console.error(`[Template Error] 行号 ${a} 超出范围`);
52
53
  return;
53
54
  }
54
- const h = a - 1, p = Math.max(0, h - 3), v = Math.min(u.length - 1, h + 3), m = String(v + 1).length, d = ((I = e.expr) == null ? void 0 : I.trim()) ?? "", L = d ? d.split(`
55
- `) : [], b = d ? Math.max(...L.map(lt)) : 0, $ = L.length > 1, S = `color:${T.gutter};`, A = `color:${T.arrow};font-weight:bold;`, f = `color:${T.gutter};`, w = `color:${T.errorLineFg};background:${T.errorLineBg};padding:0 4px;`, E = `color:${T.gutter};`, y = `color:${T.arrow};font-weight:bold;padding:0 4px;`;
55
+ const h = a - 1, d = Math.max(0, h - 3), E = Math.min(u.length - 1, h + 3), m = String(E + 1).length, p = ((L = e.expr) == null ? void 0 : L.trim()) ?? "", R = p ? p.split(`
56
+ `) : [], g = p ? Math.max(...R.map(ot)) : 0, v = R.length > 1, S = `color:${W.gutter};`, A = `color:${W.arrow};font-weight:bold;`, f = `color:${W.gutter};`, w = `color:${W.errorLineFg};background:${W.errorLineBg};padding:0 4px;`, x = `color:${W.gutter};`, b = `color:${W.arrow};font-weight:bold;padding:0 4px;`;
56
57
  console.groupCollapsed(
57
- `${i} %c(Line:${a}, Col:${l})`,
58
- ...o,
59
- `color:${T.gutter};font-weight:normal;`
58
+ `${o} %c(Line:${a}, Col:${l})`,
59
+ ...i,
60
+ `color:${W.gutter};font-weight:normal;`
60
61
  );
61
- for (let x = p; x <= v; x++) {
62
- const M = u[x], P = String(x + 1).padStart(m, " ");
63
- if (!(x === h)) {
64
- console.log(`%c${P} │%c ${M}`, S, f);
62
+ for (let $ = d; $ <= E; $++) {
63
+ const I = u[$], M = String($ + 1).padStart(m, " ");
64
+ if (!($ === h)) {
65
+ console.log(`%c${M} │%c ${I}`, S, f);
65
66
  continue;
66
67
  }
67
- const j = M.slice(0, Math.max(0, l - 1)), D = lt(j), at = " ".repeat(m + 3), Jt = P.padEnd(m, " ");
68
- if (console.log(`%c${Jt} │%c ${M}`, A, w), $)
69
- for (let B = 0; B < L.length; B++) {
70
- const bt = L[B], et = h + B;
71
- let wt = 0;
72
- if (B === 0)
73
- wt = D;
74
- else if (et < u.length) {
75
- const st = u[et], ct = st.search(/\S/), Xt = ct === -1 ? st : st.slice(0, ct);
76
- wt = lt(Xt);
68
+ const D = I.slice(0, Math.max(0, l - 1)), F = ot(D), rt = " ".repeat(m + 3), Yt = M.padEnd(m, " ");
69
+ if (console.log(`%c${Yt} │%c ${I}`, A, w), v)
70
+ for (let j = 0; j < R.length; j++) {
71
+ const pt = R[j], Q = h + j;
72
+ let mt = 0;
73
+ if (j === 0)
74
+ mt = F;
75
+ else if (Q < u.length) {
76
+ const tt = u[Q], it = tt.search(/\S/), Jt = it === -1 ? tt : tt.slice(0, it);
77
+ mt = ot(Jt);
77
78
  }
78
- const Qt = Math.max(1, lt(bt)), Pt = _t(Qt, !0), Ot = at + " ".repeat(wt);
79
- if (B === 0)
80
- console.log(`%c${Ot}%c${Pt}`, E, y);
81
- else if (et < u.length) {
82
- const st = String(et + 1).padEnd(m, " "), ct = u[et];
83
- console.log(`%c${st} │%c ${ct}`, A, w), console.log(`%c${Ot}%c${Pt}`, E, y);
79
+ const Zt = Math.max(1, ot(pt.trim())), It = Ot(Zt, { lineIndex: j, totalLines: R.length }), Mt = rt + " ".repeat(mt);
80
+ if (j === 0)
81
+ console.log(`%c${Mt}%c${It}`, x, b);
82
+ else if (Q < u.length) {
83
+ const tt = String(Q + 1).padEnd(m, " "), it = u[Q];
84
+ console.log(`%c${tt} │%c ${it}`, A, w), console.log(`%c${Mt}%c${It}`, x, b);
84
85
  }
85
86
  }
86
87
  else {
87
- const B = at + " ".repeat(D), bt = _t(b || 1, !1);
88
- console.log(`%c${B}%c${bt}`, E, y);
88
+ const j = rt + " ".repeat(F), pt = Ot(g || 1);
89
+ console.log(`%c${j}%c${pt}`, x, b);
89
90
  }
90
91
  }
91
- d && console.log(
92
- `%cExpression:%c ${d}`,
93
- `color:${T.exprLabel};font-weight:bold;`,
94
- `color:${T.exprCode};font-family:monospace;`
92
+ p && console.log(
93
+ `%cExpression:%c ${p}`,
94
+ `color:${W.exprLabel};font-weight:bold;`,
95
+ `color:${W.exprCode};font-family:monospace;`
95
96
  ), console.groupEnd();
96
97
  }
97
- const Et = {};
98
- function re(s) {
99
- const t = s.map((e) => e.replace(/[',"]/g, "")).join(",");
100
- if (!Et[t]) {
101
- const e = s[s.length - 1];
98
+ const yt = {};
99
+ function ne(n) {
100
+ const t = n.map((e) => e.replace(/[',"]/g, "")).join(",");
101
+ if (!yt[t]) {
102
+ const e = n[n.length - 1];
102
103
  if (e.trim() === "")
103
104
  throw new Error("Function body cannot be empty");
104
- if (oe(e))
105
+ if (re(e))
105
106
  throw new Error("Input contains potentially dangerous code: " + e);
106
- Et[t] = new Function(...s);
107
+ yt[t] = new Function(...n);
107
108
  }
108
- return Et[t];
109
+ return yt[t];
109
110
  }
110
- const ie = ["eval", "Function", "process", "require"];
111
- function oe(s) {
112
- return ie.some((t) => new RegExp(`\\b${t}\\b`, "g").test(s));
111
+ const se = ["eval", "Function", "process", "require"];
112
+ function re(n) {
113
+ return se.some((t) => new RegExp(`\\b${t}\\b`, "g").test(n));
113
114
  }
114
- function ae(s, t) {
115
- if (!(s != null && s.trim())) return "";
116
- if (/\{\{\{\s*.*?\s*\}\}\}/.test(s))
115
+ const ie = /\{\{\{\s*[\s\S]*?\s*\}\}\}/, oe = /\{\{\s*([\s\S]*?)\s*\}\}/g;
116
+ function ae(n, t) {
117
+ if (!(n != null && n.trim())) return "";
118
+ if (ie.test(n))
117
119
  throw new Error("Illegal interpolation syntax: use {{ }} instead of {{{ }}}");
118
- return t === "template" ? s.replace(/\{\{\s*(.*?)\s*\}\}/g, (e, n) => `\${${n.trim()}}`) : s;
120
+ return t === "template" ? n.replace(oe, (e, s) => `\${${s.trim()}}`) : n;
119
121
  }
120
- function ce(s, t) {
121
- const e = (n) => n.endsWith(";") ? n : n + ";";
122
+ function ce(n, t) {
123
+ const e = (s) => s.endsWith(";") ? s : s + ";";
122
124
  switch (t) {
123
125
  case "template":
124
- return `return \`${s}\`;`;
126
+ return `return \`${n}\`;`;
125
127
  case "expression":
126
- return `return (${s});`;
128
+ return `return (${n});`;
127
129
  case "handler":
128
130
  case "lifecycle":
129
- return e(s);
131
+ return e(n);
130
132
  }
131
133
  }
132
- function le(s) {
133
- if (!s.length) return { loopValues: "", loopIndices: "" };
134
- const t = s.map((n) => n.item).join(", "), e = s.map((n) => n.index).join(", ");
134
+ function le(n) {
135
+ if (!n.length) return { loopValues: "", loopIndices: "" };
136
+ const t = n.map((s) => s.item).join(", "), e = n.map((s) => s.index).join(", ");
135
137
  return {
136
138
  loopValues: `var [${t}] = loops.map(l => l.itmVal);`,
137
139
  loopIndices: `var [${e}] = loops.map(l => l.idxVal);`
138
140
  };
139
141
  }
140
- function ue(s, t, e, n) {
141
- const r = s === "lifecycle" ? ["el", "loops"] : s === "handler" ? ["event", "loops"] : ["loops"], o = `
142
+ function ue(n, t, e, s) {
143
+ const r = n === "lifecycle" ? ["el", "loops"] : n === "handler" ? ["event", "loops"] : ["loops"], i = `
142
144
  const { $data } = this;
143
- ${s === "handler" ? "const { value, checked } = event?.target || {};" : ""}
145
+ ${n === "handler" ? "const { value, checked } = event?.target || {};" : ""}
144
146
  ${e}
145
- ${n}
147
+ ${s}
146
148
  ${t}
147
149
  `.replace(/^\s+|\s+$/gm, "");
148
- return r.push(o), r;
150
+ return r.push(i), r;
149
151
  }
150
- function he(s, t, e) {
151
- if (!(s != null && s.trim())) return () => "";
152
- const n = ae(s, t), r = ce(n, t), { loopValues: i, loopIndices: o } = le(e), c = ue(t, r, i, o);
153
- return re(c);
152
+ function he(n, t, e) {
153
+ if (!(n != null && n.trim())) return () => "";
154
+ const s = ae(n, t), r = ce(s, t), { loopValues: o, loopIndices: i } = le(e), c = ue(t, r, o, i);
155
+ return ne(c);
154
156
  }
155
157
  const fe = /* @__PURE__ */ new Set([
156
158
  "onabort",
@@ -215,9 +217,9 @@ const fe = /* @__PURE__ */ new Set([
215
217
  "ontoggle",
216
218
  "onvolumechange",
217
219
  "onwaiting"
218
- ]), Y = (s) => {
219
- if (s === null || typeof s != "object") return !1;
220
- const t = Object.prototype.toString.call(s);
220
+ ]), K = (n) => {
221
+ if (n === null || typeof n != "object") return !1;
222
+ const t = Object.prototype.toString.call(n);
221
223
  return ![
222
224
  "[object Function]",
223
225
  "[object Date]",
@@ -228,39 +230,39 @@ const fe = /* @__PURE__ */ new Set([
228
230
  "[object WeakSet]"
229
231
  ].includes(t);
230
232
  };
231
- function Je(s = window.location) {
233
+ function Ye(n = window.location) {
232
234
  let t;
233
- typeof s == "string" ? t = new URL(s).hash : t = s.hash;
235
+ typeof n == "string" ? t = new URL(n).hash : t = n.hash;
234
236
  const e = t.split("?");
235
- let n = e[0];
236
- const r = e[1], i = {};
237
- return n = n.replace(/^#\/?/, ""), r && r.split("&").forEach((o) => {
238
- const [c, a] = o.split("=");
239
- c && a && (i[decodeURIComponent(c)] = decodeURIComponent(a));
237
+ let s = e[0];
238
+ const r = e[1], o = {};
239
+ return s = s.replace(/^#\/?/, ""), r && r.split("&").forEach((i) => {
240
+ const [c, a] = i.split("=");
241
+ c && a && (o[decodeURIComponent(c)] = decodeURIComponent(a));
240
242
  }), {
241
- path: n.split("/").filter(Boolean),
243
+ path: s.split("/").filter(Boolean),
242
244
  // 将路径分割成数组并过滤空字符串
243
- query: i
245
+ query: o
244
246
  // 查询参数对象
245
247
  };
246
248
  }
247
- var g = /* @__PURE__ */ ((s) => (s[s.Element = 0] = "Element", s[s.Text = 1] = "Text", s[s.Comment = 2] = "Comment", s[s.If = 3] = "If", s[s.ElseIf = 4] = "ElseIf", s[s.Else = 5] = "Else", s[s.For = 6] = "For", s[s.Conditional = 7] = "Conditional", s[s.Other = 99] = "Other", s))(g || {});
249
+ var y = /* @__PURE__ */ ((n) => (n[n.Element = 0] = "Element", n[n.Text = 1] = "Text", n[n.Comment = 2] = "Comment", n[n.If = 3] = "If", n[n.ElseIf = 4] = "ElseIf", n[n.Else = 5] = "Else", n[n.For = 6] = "For", n[n.Conditional = 7] = "Conditional", n[n.Other = 99] = "Other", n))(y || {});
248
250
  const de = {
249
251
  // 可选别名
250
252
  onMounted: "mounted",
251
253
  onUpdated: "updated",
252
254
  onUnmounted: "unmounted"
253
255
  };
254
- function pe(s) {
255
- return de[s] ?? null;
256
+ function pe(n) {
257
+ return de[n] ?? null;
256
258
  }
257
- function me(s) {
258
- return s === "mounted" || s === "updated" || s === "unmounted";
259
+ function me(n) {
260
+ return n === "mounted" || n === "updated" || n === "unmounted";
259
261
  }
260
- const $t = Symbol.for("solely.irMeta"), tt = process.env.NODE_ENV !== "production", ge = /\{\{.*?\}\}/;
262
+ const vt = Symbol.for("solely.irMeta"), X = process.env.NODE_ENV !== "production", ge = /\{\{[\s\S]*?\}\}/;
261
263
  class ye {
262
264
  constructor() {
263
- C(this, "compilers", /* @__PURE__ */ new Map());
265
+ k(this, "compilers", /* @__PURE__ */ new Map());
264
266
  }
265
267
  get(t = "anonymous") {
266
268
  let e = this.compilers.get(t);
@@ -271,36 +273,36 @@ class ye {
271
273
  if (t)
272
274
  (e = this.compilers.get(t)) == null || e.clear(), this.compilers.delete(t);
273
275
  else {
274
- for (const n of this.compilers.values()) n.clear();
276
+ for (const s of this.compilers.values()) s.clear();
275
277
  this.compilers.clear();
276
278
  }
277
279
  }
278
280
  }
279
- const jt = new ye();
281
+ const Wt = new ye();
280
282
  class be {
281
283
  constructor() {
282
- C(this, "cache", /* @__PURE__ */ new Map());
283
- C(this, "functions", []);
284
+ k(this, "cache", /* @__PURE__ */ new Map());
285
+ k(this, "functions", []);
284
286
  }
285
287
  // 缓存 key 生成优化:避免每次都重新分配数组
286
- makeCacheKey(t, e, n) {
287
- if (n.length === 0) return `${t}:${e}`;
288
- const r = n.map((i) => Object.keys(i).sort().join(",")).join(";");
288
+ makeCacheKey(t, e, s) {
289
+ if (s.length === 0) return `${t}:${e}`;
290
+ const r = s.map((o) => Object.keys(o).sort().join(",")).join(";");
289
291
  return `${t}:${e}:${r}`;
290
292
  }
291
- compile(t, e, n) {
293
+ compile(t, e, s) {
292
294
  const r = e == null ? void 0 : e.trim();
293
295
  if (!r) return 0;
294
- const i = this.makeCacheKey(t, r, n), o = this.cache.get(i);
295
- if (o !== void 0) return o;
296
+ const o = this.makeCacheKey(t, r, s), i = this.cache.get(o);
297
+ if (i !== void 0) return i;
296
298
  let c;
297
299
  try {
298
- c = he(r, t, n);
300
+ c = he(r, t, s);
299
301
  } catch (l) {
300
- tt && console.error(`[IR Compile Error] Type: ${t}, Expr: "${r}"`, l), c = () => "";
302
+ X && console.error(`[IR Compile Error] Type: ${t}, Expr: "${r}"`, l), c = () => "";
301
303
  }
302
304
  const a = this.functions.push(c);
303
- return this.cache.set(i, a), a;
305
+ return this.cache.set(o, a), a;
304
306
  }
305
307
  getFunctions() {
306
308
  return this.functions;
@@ -312,29 +314,29 @@ class be {
312
314
  this.cache.clear(), this.functions = [];
313
315
  }
314
316
  }
315
- function Vt(s) {
316
- const t = s[0];
317
- return t === ":" ? { isDynamic: !0, type: "expression" } : t === "@" ? { isDynamic: !0, type: "handler" } : me(s) ? { isDynamic: !0, type: "lifecycle" } : { isDynamic: !1, type: null };
317
+ function Ft(n) {
318
+ const t = n[0];
319
+ return t === ":" ? { isDynamic: !0, type: "expression" } : t === "@" ? { isDynamic: !0, type: "handler" } : me(n) ? { isDynamic: !0, type: "lifecycle" } : { isDynamic: !1, type: null };
318
320
  }
319
- function we(s) {
320
- return s ? ge.test(s) : !1;
321
+ function we(n) {
322
+ return n ? ge.test(n) : !1;
321
323
  }
322
- function St(s, t, e) {
323
- tt && (s[$t] = { expr: t ?? "", loc: e ?? null });
324
+ function xt(n, t, e) {
325
+ X && (n[vt] = { expr: t ?? "", loc: e ?? null });
324
326
  }
325
- function ve(s) {
326
- if (!s.attrs) return;
327
- const t = s.attrs.find((a) => a.key === "s-model");
327
+ function Ee(n) {
328
+ if (!n.attrs) return;
329
+ const t = n.attrs.find((a) => a.key === "s-model");
328
330
  if (!t) return;
329
- const e = "$data." + t.value.replace("this.", "").replace("$data.", ""), n = t.loc, r = (s.tag || "").toLowerCase(), i = s.attrs.find((a) => a.key === "type"), o = (i == null ? void 0 : i.value) ?? "text";
330
- s.attrs = s.attrs.filter((a) => a !== t);
331
+ const e = "$data." + t.value.replace("this.", "").replace("$data.", ""), s = t.loc, r = (n.tag || "").toLowerCase(), o = n.attrs.find((a) => a.key === "type"), i = (o == null ? void 0 : o.value) ?? "text";
332
+ n.attrs = n.attrs.filter((a) => a !== t);
331
333
  const c = (a, l, u) => {
332
334
  var h;
333
- (h = s.attrs) == null || h.push({ key: a, value: l, role: u, loc: n });
335
+ (h = n.attrs) == null || h.push({ key: a, value: l, role: u, loc: s });
334
336
  };
335
337
  if (r === "input") {
336
- if (o === "checkbox") {
337
- const a = s.attrs.find((p) => p.key === "value"), l = a ? JSON.stringify(a.value) : '"on"', u = `Array.isArray(${e}) ? ${e}.includes(${l}) : ${e}`;
338
+ if (i === "checkbox") {
339
+ const a = n.attrs.find((d) => d.key === "value"), l = a ? JSON.stringify(a.value) : '"on"', u = `Array.isArray(${e}) ? ${e}.includes(${l}) : ${e}`;
338
340
  c(":checked", u);
339
341
  const h = `
340
342
  const _v = ${l};
@@ -348,8 +350,8 @@ function ve(s) {
348
350
  c("@change", h, "model");
349
351
  return;
350
352
  }
351
- if (o === "radio") {
352
- const a = s.attrs.find((u) => u.key === "value"), l = (a == null ? void 0 : a.value) ?? "null";
353
+ if (i === "radio") {
354
+ const a = n.attrs.find((u) => u.key === "value"), l = (a == null ? void 0 : a.value) ?? "null";
353
355
  c(":checked", `${e} == ${JSON.stringify(l)}`), c("@change", `if (checked) ${e} = ${JSON.stringify(l)}`, "model");
354
356
  return;
355
357
  }
@@ -361,7 +363,7 @@ function ve(s) {
361
363
  return;
362
364
  }
363
365
  if (r === "select") {
364
- s.attrs.some((l) => l.key === "multiple") ? (c("updated", `
366
+ n.attrs.some((l) => l.key === "multiple") ? (c("updated", `
365
367
  const values = Array.isArray(${e}) ? ${e} : ${e} != null ? [${e}] : [];
366
368
  for (const opt of el.options) {
367
369
  opt.selected = values.includes(opt.value);
@@ -370,124 +372,124 @@ function ve(s) {
370
372
  }
371
373
  c(":value", e), c("@input", `${e} = $event`, "model");
372
374
  }
373
- function ft(s, t, e, n = null) {
374
- if (!s.attrs || s.attrs.length === 0) return [];
375
+ function lt(n, t, e, s = null) {
376
+ if (!n.attrs || n.attrs.length === 0) return [];
375
377
  const r = [];
376
- for (const i of s.attrs) {
377
- if (n && n.has(i.key)) continue;
378
- const { key: o, value: c, role: a } = i, { isDynamic: l, type: u } = Vt(o);
378
+ for (const o of n.attrs) {
379
+ if (s && s.has(o.key)) continue;
380
+ const { key: i, value: c, role: a } = o, { isDynamic: l, type: u } = Ft(i);
379
381
  if (l && u) {
380
- const h = e.compile(u, c ?? "", t), p = { key: o, fid: h, dynamic: 1, role: a };
381
- St(p, c, i.loc ?? s.loc), r.push(p);
382
+ const h = e.compile(u, c ?? "", t), d = { key: i, fid: h, dynamic: 1, role: a };
383
+ xt(d, c, o.loc ?? n.loc), r.push(d);
382
384
  } else
383
- r.push({ key: o, value: c, dynamic: 0, role: a });
385
+ r.push({ key: i, value: c, dynamic: 0, role: a });
384
386
  }
385
387
  return r;
386
388
  }
387
- function Ee(s, t, e) {
388
- var i, o, c, a, l, u;
389
- const n = { type: s.type, dynamic: 0 };
389
+ function ve(n, t, e) {
390
+ var o, i, c, a, l, u;
391
+ const s = { type: n.type, dynamic: 0 };
390
392
  let r = !1;
391
- switch (s.type === g.Text ? we(s.content) && (r = !0) : ((i = s.attrs) != null && i.some((h) => h.key === "s-model" || Vt(h.key).isDynamic) && (r = !0), s.type === g.For && (r = !0)), n.dynamic = r ? 1 : 0, s.type) {
392
- case g.Text: {
393
- const h = s.content ?? "";
394
- r ? (n.fid = e.compile("template", h, t), St(n, h, s.loc)) : n.txt = h;
393
+ switch (n.type === y.Text ? we(n.content) && (r = !0) : ((o = n.attrs) != null && o.some((h) => h.key === "s-model" || Ft(h.key).isDynamic) && (r = !0), n.type === y.For && (r = !0)), s.dynamic = r ? 1 : 0, n.type) {
394
+ case y.Text: {
395
+ const h = n.content ?? "";
396
+ r ? (s.fid = e.compile("template", h, t), xt(s, h, n.loc)) : s.txt = h;
395
397
  break;
396
398
  }
397
- case g.Element: {
398
- n.tag = s.tag, ve(s), n.attrs = ft(s, t, e), s.children && (n.children = nt(s.children, t, e));
399
+ case y.Element: {
400
+ s.tag = n.tag, Ee(n), s.attrs = lt(n, t, e), n.children && (s.children = et(n.children, t, e));
399
401
  break;
400
402
  }
401
- case g.For: {
402
- const h = (o = s.attrs) == null ? void 0 : o.find((d) => d.key === "each"), p = (h == null ? void 0 : h.value) ?? "";
403
- n.fid = e.compile("expression", p, t), n.item = ((a = (c = s.attrs) == null ? void 0 : c.find((d) => d.key === "item")) == null ? void 0 : a.value) ?? "item", n.index = ((u = (l = s.attrs) == null ? void 0 : l.find((d) => d.key === "index")) == null ? void 0 : u.value) ?? "index", St(n, p, (h == null ? void 0 : h.loc) ?? s.loc);
404
- const v = /* @__PURE__ */ new Set(["each", "item", "index"]);
405
- n.attrs = ft(s, t, e, v);
406
- const m = [...t, { item: n.item, index: n.index }];
407
- s.children && (n.children = nt(s.children, m, e));
403
+ case y.For: {
404
+ const h = (i = n.attrs) == null ? void 0 : i.find((p) => p.key === "each"), d = (h == null ? void 0 : h.value) ?? "";
405
+ s.fid = e.compile("expression", d, t), s.item = ((a = (c = n.attrs) == null ? void 0 : c.find((p) => p.key === "item")) == null ? void 0 : a.value) ?? "item", s.index = ((u = (l = n.attrs) == null ? void 0 : l.find((p) => p.key === "index")) == null ? void 0 : u.value) ?? "index", xt(s, d, (h == null ? void 0 : h.loc) ?? n.loc);
406
+ const E = /* @__PURE__ */ new Set(["each", "item", "index"]);
407
+ s.attrs = lt(n, t, e, E);
408
+ const m = [...t, { item: s.item, index: s.index }];
409
+ n.children && (s.children = et(n.children, m, e));
408
410
  break;
409
411
  }
410
- case g.If:
411
- case g.ElseIf:
412
- case g.Else: {
413
- tt && console.warn(`[IR] Orphaned conditional node found: ${g[s.type]}`), n.attrs = ft(s, t, e), s.children && (n.children = nt(s.children, t, e));
412
+ case y.If:
413
+ case y.ElseIf:
414
+ case y.Else: {
415
+ X && console.warn(`[IR] Orphaned conditional node found: ${y[n.type]}`), s.attrs = lt(n, t, e), n.children && (s.children = et(n.children, t, e));
414
416
  break;
415
417
  }
416
- case g.Comment: {
417
- n.txt = s.content ?? "";
418
+ case y.Comment: {
419
+ s.txt = n.content ?? "";
418
420
  break;
419
421
  }
420
422
  }
421
- return n;
423
+ return s;
422
424
  }
423
- function nt(s, t, e) {
424
- var i;
425
- const n = [];
425
+ function et(n, t, e) {
426
+ var o;
427
+ const s = [];
426
428
  let r = 0;
427
- for (; r < s.length; ) {
428
- const o = s[r];
429
- if (o.type === g.If) {
429
+ for (; r < n.length; ) {
430
+ const i = n[r];
431
+ if (i.type === y.If) {
430
432
  const c = [];
431
433
  let a = r;
432
- for (; a < s.length; ) {
433
- const l = s[a], u = l.type;
434
- if (u !== g.If && u !== g.ElseIf && u !== g.Else)
434
+ for (; a < n.length; ) {
435
+ const l = n[a], u = l.type;
436
+ if (u !== y.If && u !== y.ElseIf && u !== y.Else || u === y.If && c.length > 0)
435
437
  break;
436
- let h = null, p = "";
437
- if (u !== g.Else) {
438
- const L = (i = l.attrs) == null ? void 0 : i.find(
439
- (b) => b.key === "test" || b.key === "condition"
438
+ let h = null, d = "", E = null;
439
+ if (u !== y.Else) {
440
+ const g = (o = l.attrs) == null ? void 0 : o.find(
441
+ (v) => v.key === "test" || v.key === "condition"
440
442
  );
441
- p = (L == null ? void 0 : L.value) ?? "false", h = e.compile("expression", p, t);
443
+ d = (g == null ? void 0 : g.value) ?? "false", h = e.compile("expression", d, t), E = (g == null ? void 0 : g.loc) ?? l.loc;
442
444
  }
443
- const v = l.children ? nt(l.children, t, e) : [], d = ft(l, t, e, /* @__PURE__ */ new Set(["test", "condition"]));
445
+ const m = l.children ? et(l.children, t, e) : [], R = lt(l, t, e, /* @__PURE__ */ new Set(["test", "condition"]));
444
446
  if (c.push({
445
447
  condFid: h,
446
- children: v,
447
- attrs: d.length > 0 ? d : void 0,
448
- [$t]: tt ? { expr: p, loc: l.loc } : void 0
449
- }), a++, u === g.Else) break;
448
+ children: m,
449
+ attrs: R.length > 0 ? R : void 0,
450
+ [vt]: X ? { expr: d, loc: E } : void 0
451
+ }), a++, u === y.Else) break;
450
452
  }
451
- n.push({
452
- type: g.Conditional,
453
+ s.push({
454
+ type: y.Conditional,
453
455
  dynamic: 1,
454
456
  branches: c,
455
- ...tt && { [$t]: { loc: o.loc } }
457
+ ...X && { [vt]: { loc: i.loc } }
456
458
  }), r = a;
457
459
  } else
458
- n.push(Ee(o, t, e)), r++;
460
+ s.push(ve(i, t, e)), r++;
459
461
  }
460
- return n;
462
+ return s;
461
463
  }
462
- function xe(s, t = {}) {
463
- const { filename: e = "anonymous", source: n } = t, r = jt.get(e);
464
+ function xe(n, t = {}) {
465
+ const { filename: e = "anonymous", source: s } = t, r = Wt.get(e);
464
466
  r.clear();
465
- const i = performance.now(), o = nt(s, [], r), c = performance.now(), a = r.getStats(), l = o.filter((h) => h.dynamic === 1).length, u = {
467
+ const o = performance.now(), i = et(n, [], r), c = performance.now(), a = r.getStats(), l = i.filter((h) => h.dynamic === 1).length, u = {
466
468
  type: "root",
467
469
  version: "1.1.0",
468
470
  // Bump version
469
471
  functions: r.getFunctions(),
470
472
  // 获取函数列表快照
471
- nodes: o,
473
+ nodes: i,
472
474
  stats: {
473
475
  totalFunctions: a.total,
474
476
  cachedFunctions: a.cached,
475
477
  dynamicNodes: l,
476
- totalNodes: o.length
478
+ totalNodes: i.length
477
479
  },
478
480
  metadata: {
479
481
  compiledAt: (/* @__PURE__ */ new Date()).toISOString(),
480
- astSize: s.length,
482
+ astSize: n.length,
481
483
  filename: e,
482
- ...n && { source: n }
484
+ ...s && { source: s }
483
485
  }
484
486
  };
485
- return tt && console.log(
486
- `[IRBuilder] ${e} | ${(c - i).toFixed(2)}ms | Nodes: ${o.length} | Fns: ${a.total}`
487
+ return X && console.log(
488
+ `[IRBuilder] ${e} | ${(c - o).toFixed(2)}ms | Nodes: ${i.length} | Fns: ${a.total}`
487
489
  ), u;
488
490
  }
489
- function Qe(s) {
490
- jt.clear(s);
491
+ function Ze(n) {
492
+ Wt.clear(n);
491
493
  }
492
494
  const $e = /<\/?([A-Za-z][A-Za-z0-9\-\:]*)[>\s\/]/, Se = /* @__PURE__ */ new Set([
493
495
  "area",
@@ -505,96 +507,96 @@ const $e = /<\/?([A-Za-z][A-Za-z0-9\-\:]*)[>\s\/]/, Se = /* @__PURE__ */ new Set
505
507
  "track",
506
508
  "wbr"
507
509
  ]), ke = /\s*([^\s"'/>=]+)(?:=(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gs;
508
- function Ce(s, t) {
510
+ function Ce(n, t) {
509
511
  const e = [];
510
- let n;
511
- const r = s.replace(/^\s*[^\s"'/>]+/, ""), i = s.length - r.length;
512
- for (; (n = ke.exec(r)) !== null; ) {
513
- const o = n[1];
514
- if (!o) continue;
515
- const c = n[2] ?? n[3] ?? n[4] ?? "";
516
- let a = o;
517
- fe.has(o) && (a = a.replace(/^on/, "@")), a !== "s-model" && (a = a.replace(/^on-/, "@").replace(/^s-/, ":")), a = pe(a) || a;
518
- const l = n[0], u = l.indexOf("=");
512
+ let s;
513
+ const r = n.replace(/^\s*[^\s"'/>]+/, ""), o = n.length - r.length;
514
+ for (; (s = ke.exec(r)) !== null; ) {
515
+ const i = s[1];
516
+ if (!i) continue;
517
+ const c = s[2] ?? s[3] ?? s[4] ?? "";
518
+ let a = i;
519
+ fe.has(i) && (a = a.replace(/^on/, "@")), a !== "s-model" && (a = a.replace(/^on-/, "@").replace(/^s-/, ":")), a = pe(a) || a;
520
+ const l = s[0], u = l.indexOf("=");
519
521
  let h;
520
522
  if (u === -1)
521
- h = l.indexOf(o) + o.length;
523
+ h = l.indexOf(i) + i.length;
522
524
  else {
523
- let b = u + 1;
524
- for (; b < l.length && /\s/.test(l[b]); ) b++;
525
- if (l[b] === '"' || l[b] === "'") {
526
- let $ = b + 1;
527
- for (; $ < l.length && /\s/.test(l[$]); )
528
- $++;
529
- h = $;
525
+ let g = u + 1;
526
+ for (; g < l.length && /\s/.test(l[g]); ) g++;
527
+ if (l[g] === '"' || l[g] === "'") {
528
+ let v = g + 1;
529
+ for (; v < l.length && /\s/.test(l[v]); )
530
+ v++;
531
+ h = v;
530
532
  } else {
531
- let $ = b;
532
- for (; $ < l.length && /\s/.test(l[$]); ) $++;
533
- h = $;
533
+ let v = g;
534
+ for (; v < l.length && /\s/.test(l[v]); ) v++;
535
+ h = v;
534
536
  }
535
537
  }
536
- let p = n.index + h + i;
537
- const m = s.slice(0, p).split(`
538
- `), d = t[0] + m.length - 1, L = m.length > 1 ? m[m.length - 1].length + 1 : t[1] + p;
539
- e.push({ key: a, value: c, loc: [d, L] });
538
+ let d = s.index + h + o;
539
+ const m = n.slice(0, d).split(`
540
+ `), p = t[0] + m.length - 1, R = m.length > 1 ? m[m.length - 1].length + 1 : t[1] + d;
541
+ e.push({ key: a, value: c, loc: [p, R] });
540
542
  }
541
543
  return e;
542
544
  }
543
- function Re(s, t) {
544
- var o;
545
- const e = ((o = (s.match($e) || [])[1]) == null ? void 0 : o.toLowerCase()) ?? "", n = Ce(s, t);
545
+ function Re(n, t) {
546
+ var i;
547
+ const e = ((i = (n.match($e) || [])[1]) == null ? void 0 : i.toLowerCase()) ?? "", s = Ce(n, t);
546
548
  return {
547
549
  type: {
548
- for: g.For,
549
- if: g.If,
550
- elseif: g.ElseIf,
551
- else: g.Else
552
- }[e] ?? g.Element,
550
+ for: y.For,
551
+ if: y.If,
552
+ elseif: y.ElseIf,
553
+ else: y.Else
554
+ }[e] ?? y.Element,
553
555
  tag: e,
554
556
  loc: t,
555
557
  children: [],
556
- attrs: n
558
+ attrs: s
557
559
  };
558
560
  }
559
- function Le(s, t) {
560
- const e = s.length;
561
- if (s.startsWith("!--", t)) {
562
- const o = s.indexOf("-->", t + 3);
563
- return o === -1 ? -1 : o + 2;
564
- }
565
- if (s.startsWith("![CDATA[", t)) {
566
- const o = s.indexOf("]]>", t + 8);
567
- return o === -1 ? -1 : o + 2;
568
- }
569
- if (s[t] === "!")
570
- return s.indexOf(">", t + 1);
571
- if (s[t] === "?") {
572
- const o = s.indexOf("?>", t + 1);
573
- return o === -1 ? -1 : o + 1;
574
- }
575
- let n = !1, r = !1, i = t;
576
- for (; i < e; ) {
577
- const o = s[i];
578
- if (o === "'" && !r)
579
- n = !n;
580
- else if (o === '"' && !n)
561
+ function Ae(n, t) {
562
+ const e = n.length;
563
+ if (n.startsWith("!--", t)) {
564
+ const i = n.indexOf("-->", t + 3);
565
+ return i === -1 ? -1 : i + 2;
566
+ }
567
+ if (n.startsWith("![CDATA[", t)) {
568
+ const i = n.indexOf("]]>", t + 8);
569
+ return i === -1 ? -1 : i + 2;
570
+ }
571
+ if (n[t] === "!")
572
+ return n.indexOf(">", t + 1);
573
+ if (n[t] === "?") {
574
+ const i = n.indexOf("?>", t + 1);
575
+ return i === -1 ? -1 : i + 1;
576
+ }
577
+ let s = !1, r = !1, o = t;
578
+ for (; o < e; ) {
579
+ const i = n[o];
580
+ if (i === "'" && !r)
581
+ s = !s;
582
+ else if (i === '"' && !s)
581
583
  r = !r;
582
- else if (o === ">" && !n && !r)
583
- return i;
584
- i++;
584
+ else if (i === ">" && !s && !r)
585
+ return o;
586
+ o++;
585
587
  }
586
588
  return -1;
587
589
  }
588
- function Ae(s) {
590
+ function Le(n) {
589
591
  const t = [];
590
- if (!s) return [];
591
- const e = [], n = [], r = () => {
592
+ if (!n) return [];
593
+ const e = [], s = [], r = () => {
592
594
  var l;
593
595
  return e.length === 0 ? t : (l = e[e.length - 1]).children || (l.children = []);
594
596
  };
595
- let i = 0;
596
- const o = s.length, c = [0];
597
- for (let l = 0; l < o; l++) s[l] === `
597
+ let o = 0;
598
+ const i = n.length, c = [0];
599
+ for (let l = 0; l < i; l++) n[l] === `
598
600
  ` && c.push(l + 1);
599
601
  function a(l) {
600
602
  let u = 0;
@@ -602,78 +604,78 @@ function Ae(s) {
602
604
  u = h;
603
605
  return [u + 1, l - c[u] + 1];
604
606
  }
605
- for (; i < o; ) {
606
- const l = s.indexOf("<", i);
607
- if (l === -1 || l > i) {
608
- const S = s.substring(i, l === -1 ? void 0 : l), A = S.trim();
607
+ for (; o < i; ) {
608
+ const l = n.indexOf("<", o);
609
+ if (l === -1 || l > o) {
610
+ const S = n.substring(o, l === -1 ? void 0 : l), A = S.trim();
609
611
  if (A) {
610
- const f = S.indexOf(A), w = i + f, E = a(w);
612
+ const f = S.indexOf(A), w = o + f, x = a(w);
611
613
  r().push({
612
- type: g.Text,
614
+ type: y.Text,
613
615
  tag: "text",
614
616
  content: A,
615
- loc: E,
617
+ loc: x,
616
618
  children: []
617
619
  });
618
620
  }
619
621
  if (l === -1) break;
620
- i = l;
622
+ o = l;
621
623
  }
622
- const u = Le(s, i + 1);
624
+ const u = Ae(n, o + 1);
623
625
  if (u === -1) {
624
- const S = s.substring(i);
626
+ const S = n.substring(o);
625
627
  S.trim() && r().push({
626
- type: g.Text,
628
+ type: y.Text,
627
629
  tag: "text",
628
630
  content: S.trim(),
629
631
  children: [],
630
- loc: a(i)
632
+ loc: a(o)
631
633
  });
632
634
  break;
633
635
  }
634
- const h = s.substring(i, u + 1), p = r(), v = a(i);
636
+ const h = n.substring(o, u + 1), d = r(), E = a(o);
635
637
  if (h.startsWith("<!--")) {
636
- p.push({
637
- type: g.Comment,
638
+ d.push({
639
+ type: y.Comment,
638
640
  tag: "comment",
639
641
  content: h.slice(4, -3),
640
- loc: v,
642
+ loc: E,
641
643
  children: []
642
- }), i = u + 1;
644
+ }), o = u + 1;
643
645
  continue;
644
646
  }
645
647
  if (h.startsWith("<![CDATA[")) {
646
- p.push({
647
- type: g.Text,
648
+ d.push({
649
+ type: y.Text,
648
650
  tag: "text",
649
651
  content: h.slice(9, -3),
650
- loc: v,
652
+ loc: E,
651
653
  children: []
652
- }), i = u + 1;
654
+ }), o = u + 1;
653
655
  continue;
654
656
  }
655
657
  if (h.startsWith("<!") && !h.startsWith("<!--")) {
656
- p.push({
657
- type: g.Comment,
658
+ d.push({
659
+ type: y.Comment,
658
660
  tag: "comment",
659
661
  content: h.slice(2, -1),
660
- loc: v,
662
+ loc: E,
661
663
  children: []
662
- }), i = u + 1;
664
+ }), o = u + 1;
663
665
  continue;
664
666
  }
665
667
  if (h.startsWith("<?")) {
666
- p.push({
667
- type: g.Comment,
668
+ d.push({
669
+ type: y.Comment,
668
670
  tag: "comment",
669
671
  content: h.slice(2, -2),
670
- loc: v,
672
+ loc: E,
671
673
  children: []
672
- }), i = u + 1;
674
+ }), o = u + 1;
673
675
  continue;
674
676
  }
675
677
  if (h.startsWith("</")) {
676
- const S = n.pop();
678
+ const S = s.pop();
677
679
  for (; e.length > 0; ) {
678
680
  if ((e[e.length - 1].tag || "").toLowerCase() === (S == null ? void 0 : S.toLowerCase())) {
679
681
  e.pop();
@@ -681,168 +683,168 @@ function Ae(s) {
681
683
  }
682
684
  e.pop();
683
685
  }
684
- i = u + 1;
686
+ o = u + 1;
685
687
  continue;
686
688
  }
687
- const m = Re(h, v);
688
- p.push(m);
689
- const d = m.tag || "", L = d.toLowerCase().startsWith("script"), b = d.toLowerCase().startsWith("style"), $ = h.endsWith("/>") || Se.has(d.toLowerCase());
690
- if ((L || b) && !$) {
691
- const S = `</${d}>`, A = s.toLowerCase().indexOf(S, u + 1);
689
+ const m = Re(h, E);
690
+ d.push(m);
691
+ const p = m.tag || "", R = p.toLowerCase().startsWith("script"), g = p.toLowerCase().startsWith("style"), v = h.endsWith("/>") || Se.has(p.toLowerCase());
692
+ if ((R || g) && !v) {
693
+ const S = `</${p}>`, A = n.toLowerCase().indexOf(S, u + 1);
692
694
  if (A !== -1) {
693
- const f = s.substring(u + 1, A);
695
+ const f = n.substring(u + 1, A);
694
696
  f.length && m.children.push({
695
- type: g.Text,
697
+ type: y.Text,
696
698
  tag: "text",
697
699
  content: f,
698
700
  loc: a(u + 1),
699
701
  children: []
700
- }), i = A + S.length;
702
+ }), o = A + S.length;
701
703
  continue;
702
704
  } else {
703
- const f = s.substring(u + 1);
705
+ const f = n.substring(u + 1);
704
706
  f.length && m.children.push({
705
- type: g.Text,
707
+ type: y.Text,
706
708
  tag: "text",
707
709
  content: f,
708
710
  loc: a(u + 1),
709
711
  children: []
710
- }), i = o;
712
+ }), o = i;
711
713
  continue;
712
714
  }
713
715
  }
714
- !$ && m.type !== g.Text && m.type !== g.Comment && (e.push(m), n.push(d)), i = u + 1;
716
+ !v && m.type !== y.Text && m.type !== y.Comment && (e.push(m), s.push(p)), o = u + 1;
715
717
  }
716
718
  return t;
717
719
  }
718
- const pt = Symbol("solely.raw");
719
- function Bt(s) {
720
- const t = s && s[pt];
721
- return t ? Bt(t) : s;
720
+ const ht = Symbol("solely.raw");
721
+ function Vt(n) {
722
+ const t = n && n[ht];
723
+ return t ? Vt(t) : n;
722
724
  }
723
- function Ie(s) {
724
- return !!(s && s[pt]);
725
+ function Ie(n) {
726
+ return !!(n && n[ht]);
725
727
  }
726
- const kt = (s, t, e = /* @__PURE__ */ new WeakMap()) => {
727
- if (s === t) return !0;
728
- if (s == null || t == null || typeof s != "object" || typeof t != "object") return s === t;
729
- if (Array.isArray(s) && Array.isArray(t)) {
730
- if (s.length !== t.length) return !1;
731
- if (e.has(s)) return e.get(s) === t;
732
- e.set(s, t);
733
- for (let r = 0; r < s.length; r++)
734
- if (!kt(s[r], t[r], e)) return !1;
728
+ const $t = (n, t, e = /* @__PURE__ */ new WeakMap()) => {
729
+ if (n === t) return !0;
730
+ if (n == null || t == null || typeof n != "object" || typeof t != "object") return n === t;
731
+ if (Array.isArray(n) && Array.isArray(t)) {
732
+ if (n.length !== t.length) return !1;
733
+ if (e.has(n)) return e.get(n) === t;
734
+ e.set(n, t);
735
+ for (let r = 0; r < n.length; r++)
736
+ if (!$t(n[r], t[r], e)) return !1;
735
737
  return !0;
736
738
  }
737
- if (Array.isArray(s) !== Array.isArray(t)) return !1;
738
- if (e.has(s)) return e.get(s) === t;
739
- e.set(s, t);
740
- const n = Reflect.ownKeys(s);
741
- if (n.length !== Reflect.ownKeys(t).length) return !1;
742
- for (const r of n)
743
- if (!Reflect.has(t, r) || !kt(s[r], t[r], e)) return !1;
739
+ if (Array.isArray(n) !== Array.isArray(t)) return !1;
740
+ if (e.has(n)) return e.get(n) === t;
741
+ e.set(n, t);
742
+ const s = Reflect.ownKeys(n);
743
+ if (s.length !== Reflect.ownKeys(t).length) return !1;
744
+ for (const r of s)
745
+ if (!Reflect.has(t, r) || !$t(n[r], t[r], e)) return !1;
744
746
  return !0;
745
747
  };
746
- function Me(s, t, e = {}) {
747
- const { throttle: n = 0, onBatch: r, immediate: i = !1, deepCompare: o = !1 } = e;
748
+ function Me(n, t, e = {}) {
749
+ const { throttle: s = 0, onBatch: r, immediate: o = !1, deepCompare: i = !1 } = e;
748
750
  let c = !0, a = null, l = [], u = 0;
749
- const h = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), m = Array.isArray(e.filter) ? e.filter : e.filter ? [e.filter] : [], d = (f) => {
751
+ const h = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), m = Array.isArray(e.filter) ? e.filter : e.filter ? [e.filter] : [], p = (f) => {
750
752
  if (m.length === 0) return !0;
751
753
  const w = f.map(String).join(".");
752
- return m.some((E) => {
753
- if (E === "") return !0;
754
- const y = E.replace(/\./g, "\\.").replace(/\*\*/g, "(.+)").replace(/\*/g, "[^.]+").replace(/\[\d+\]/g, "\\[\\d+\\]");
755
- return new RegExp(`^${y}$`).test(w);
754
+ return m.some((x) => {
755
+ if (x === "") return !0;
756
+ const b = x.replace(/\./g, "\\.").replace(/\*\*/g, "(.+)").replace(/\*/g, "[^.]+").replace(/\[\d+\]/g, "\\[\\d+\\]");
757
+ return new RegExp(`^${b}$`).test(w);
756
758
  });
757
- }, L = (f) => {
759
+ }, R = (f) => {
758
760
  const w = [];
759
- let E = f;
760
- for (; E; ) {
761
- const y = p.get(E);
762
- if (!y || y.key == null) break;
763
- w.unshift(y.key), E = y.parent;
761
+ let x = f;
762
+ for (; x; ) {
763
+ const b = d.get(x);
764
+ if (!b || b.key == null) break;
765
+ w.unshift(b.key), x = b.parent;
764
766
  }
765
767
  return w;
766
- }, b = (f, w) => {
768
+ }, g = (f, w) => {
767
769
  if (!c) return;
768
- const E = L(f);
769
- if (!d(E)) return;
770
- const y = { ...w, path: E };
771
- n > 0 ? (l.push(y), a || (a = setTimeout(() => {
772
- const I = [...l];
773
- l = [], a = null, c && (r == null || r(I), I.forEach(t));
774
- }, n))) : (r == null || r([y]), t(y));
775
- }, $ = (f, w) => {
776
- const E = {};
777
- return ["push", "pop", "shift", "unshift", "splice"].forEach((y) => {
778
- E[y] = function(...I) {
770
+ const x = R(f);
771
+ if (!p(x)) return;
772
+ const b = { ...w, path: x };
773
+ s > 0 ? (l.push(b), a || (a = setTimeout(() => {
774
+ const L = [...l];
775
+ l = [], a = null, c && (r == null || r(L), L.forEach(t));
776
+ }, s))) : (r == null || r([b]), t(b));
777
+ }, v = (f, w) => {
778
+ const x = {};
779
+ return ["push", "pop", "shift", "unshift", "splice"].forEach((b) => {
780
+ x[b] = function(...L) {
779
781
  u++;
780
- const x = f[y].apply(f, I);
781
- if (u--, y === "push")
782
- b(w, { type: "array-push", index: f.length - I.length, values: I });
783
- else if (y === "unshift")
784
- b(w, { type: "array-push", index: 0, values: I });
785
- else if (y === "pop")
786
- b(w, { type: "array-splice", index: f.length, deleteCount: 1, insert: [] });
787
- else if (y === "shift")
788
- b(w, { type: "array-splice", index: 0, deleteCount: 1, insert: [] });
789
- else if (y === "splice") {
790
- const [M, P, ...W] = I;
791
- b(w, { type: "array-splice", index: M, deleteCount: P, insert: W });
782
+ const $ = f[b].apply(f, L);
783
+ if (u--, b === "push")
784
+ g(w, { type: "array-push", index: f.length - L.length, values: L });
785
+ else if (b === "unshift")
786
+ g(w, { type: "array-push", index: 0, values: L });
787
+ else if (b === "pop")
788
+ g(w, { type: "array-splice", index: f.length, deleteCount: 1, insert: [] });
789
+ else if (b === "shift")
790
+ g(w, { type: "array-splice", index: 0, deleteCount: 1, insert: [] });
791
+ else if (b === "splice") {
792
+ const [I, M, ..._] = L;
793
+ g(w, { type: "array-splice", index: I, deleteCount: M, insert: _ });
792
794
  }
793
- return x;
795
+ return $;
794
796
  };
795
- }), ["sort", "reverse", "fill", "copyWithin"].forEach((y) => {
796
- E[y] = function(...I) {
797
+ }), ["sort", "reverse", "fill", "copyWithin"].forEach((b) => {
798
+ x[b] = function(...L) {
797
799
  u++;
798
- const x = f[y].apply(f, I);
799
- return u--, b(w, { type: "array-reset", method: y }), x;
800
+ const $ = f[b].apply(f, L);
801
+ return u--, g(w, { type: "array-reset", method: b }), $;
800
802
  };
801
- }), ["indexOf", "lastIndexOf", "includes"].forEach((y) => {
802
- E[y] = function(I, ...x) {
803
- let M = f[y].apply(f, [I, ...x]);
804
- return (M === -1 || M === !1) && Ie(I) && (M = f[y].apply(f, [Bt(I), ...x])), M;
803
+ }), ["indexOf", "lastIndexOf", "includes"].forEach((b) => {
804
+ x[b] = function(L, ...$) {
805
+ let I = f[b].apply(f, [L, ...$]);
806
+ return (I === -1 || I === !1) && Ie(L) && (I = f[b].apply(f, [Vt(L), ...$])), I;
805
807
  };
806
- }), E;
807
- }, S = (f, w, E) => {
808
- if (!Object.isExtensible(f) || f[pt])
808
+ }), x;
809
+ }, S = (f, w, x) => {
810
+ if (!Object.isExtensible(f) || f[ht])
809
811
  return f;
810
- const y = h.get(f);
811
- if (y)
812
- return p.set(y, { parent: w, key: E }), y;
813
- const I = {
814
- get(M, P, W) {
815
- if (P === pt) return M;
816
- if (Array.isArray(M)) {
817
- const D = v.get(x);
818
- if (D && Object.prototype.hasOwnProperty.call(D, P))
819
- return Reflect.get(D, P, W);
812
+ const b = h.get(f);
813
+ if (b)
814
+ return d.set(b, { parent: w, key: x }), b;
815
+ const L = {
816
+ get(I, M, _) {
817
+ if (M === ht) return I;
818
+ if (Array.isArray(I)) {
819
+ const F = E.get($);
820
+ if (F && Object.prototype.hasOwnProperty.call(F, M))
821
+ return Reflect.get(F, M, _);
820
822
  }
821
- const j = Reflect.get(M, P, W);
822
- return typeof P == "symbol" ? j : Y(j) ? S(j, x, P) : j;
823
+ const D = Reflect.get(I, M, _);
824
+ return typeof M == "symbol" ? D : K(D) ? S(D, $, M) : D;
823
825
  },
824
- set(M, P, W, j) {
825
- const D = M[P];
826
- if (o ? kt(D, W) : D === W) return !0;
827
- const at = Reflect.set(M, P, W, j);
828
- return u === 0 && (Array.isArray(D) && Array.isArray(W) ? b(x, { type: "array-replace", oldValue: D, newValue: W }) : b(x, { type: "set", key: P, newValue: W, oldValue: D })), at;
826
+ set(I, M, _, D) {
827
+ const F = I[M];
828
+ if (i ? $t(F, _) : F === _) return !0;
829
+ const rt = Reflect.set(I, M, _, D);
830
+ return u === 0 && (Array.isArray(F) && Array.isArray(_) ? g($, { type: "array-replace", oldValue: F, newValue: _ }) : g($, { type: "set", key: M, newValue: _, oldValue: F })), rt;
829
831
  },
830
- deleteProperty(M, P) {
831
- if (!Reflect.has(M, P)) return !1;
832
- const W = M[P], j = Reflect.deleteProperty(M, P);
833
- return j && u === 0 && b(x, { type: "delete", key: P, oldValue: W }), j;
832
+ deleteProperty(I, M) {
833
+ if (!Reflect.has(I, M)) return !1;
834
+ const _ = I[M], D = Reflect.deleteProperty(I, M);
835
+ return D && u === 0 && g($, { type: "delete", key: M, oldValue: _ }), D;
834
836
  }
835
- }, x = new Proxy(f, I);
836
- return h.set(f, x), p.set(x, { parent: w, key: E }), Array.isArray(f) && v.set(x, $(f, x)), x;
837
- }, A = S(s, null, null);
838
- if (i) {
839
- const f = (w, E, y = /* @__PURE__ */ new WeakSet()) => {
840
- !Y(w) || y.has(w) || (y.add(w), Reflect.ownKeys(w).forEach((I) => {
841
- const x = w[I];
842
- b(E, { type: "set", key: I, newValue: x, oldValue: void 0 }), Y(x) && f(x, S(x, E, I), y);
837
+ }, $ = new Proxy(f, L);
838
+ return h.set(f, $), d.set($, { parent: w, key: x }), Array.isArray(f) && E.set($, v(f, $)), $;
839
+ }, A = S(n, null, null);
840
+ if (o) {
841
+ const f = (w, x, b = /* @__PURE__ */ new WeakSet()) => {
842
+ !K(w) || b.has(w) || (b.add(w), Reflect.ownKeys(w).forEach((L) => {
843
+ const $ = w[L];
844
+ g(x, { type: "set", key: L, newValue: $, oldValue: void 0 }), K($) && f($, S($, x, L), b);
843
845
  }));
844
846
  };
845
- f(s, A);
847
+ f(n, A);
846
848
  }
847
849
  return {
848
850
  proxy: A,
@@ -854,93 +856,85 @@ function Me(s, t, e = {}) {
854
856
  }
855
857
  };
856
858
  }
857
- const Wt = Symbol.for("solely.manifest");
858
- var q, H, Z, rt, J, G, Q, X, K, it, ot, z, k, qt, Ct, Gt, Rt, Lt, dt, Kt, zt, At, Mt;
859
- const F = class F extends HTMLElement {
859
+ const Nt = Symbol.for("solely.manifest");
860
+ var B, U, H, nt, Y, G, Z, J, q, st, C, Dt, St, jt, Bt, kt, ut, Gt, qt, Ct, Lt;
861
+ class ft extends HTMLElement {
860
862
  /* -------------------- 构造 -------------------- */
861
863
  constructor(e = {}) {
862
- var i;
864
+ var o;
863
865
  super();
864
- N(this, k);
865
- N(this, q);
866
- N(this, H);
867
- N(this, Z);
868
- N(this, rt);
869
- N(this, J);
870
- N(this, G);
871
- N(this, Q, !1);
872
- N(this, X, !1);
873
- N(this, K, !1);
874
- N(this, it, !1);
875
- const n = this.constructor;
876
- _(this, q, n[Wt] || { tagName: "base-element" });
877
- const r = R(this, q);
878
- _(this, J, (i = r.shadowDOM) != null && i.use ? this.attachShadow({ mode: r.shadowDOM.mode || "open" }) : this), O(this, k, Ct).call(this, e), O(this, k, Gt).call(this, r), queueMicrotask(() => O(this, k, At).call(this));
879
- }
866
+ T(this, C);
867
+ T(this, B);
868
+ T(this, U);
869
+ T(this, H);
870
+ T(this, nt);
871
+ T(this, Y);
872
+ T(this, G);
873
+ T(this, Z, !1);
874
+ T(this, J, !1);
875
+ T(this, q, !1);
876
+ T(this, st, !1);
877
+ const s = this.constructor;
878
+ O(this, B, s[Nt] || { tagName: "base-element" });
879
+ const r = P(this, B);
880
+ O(this, Y, (o = r.shadowDOM) != null && o.use ? this.attachShadow({ mode: r.shadowDOM.mode || "open" }) : this), N(this, C, St).call(this, e), N(this, C, Bt).call(this, r), queueMicrotask(() => N(this, C, Ct).call(this));
881
+ }
882
+ // 需要在元素定义前设置的属性列表(Upgrade Property)
883
+ /* -------------------- observedAttributes -------------------- */
880
884
  static get observedAttributes() {
881
- if (R(F, z).has(this))
882
- return R(F, z).get(this);
883
- const e = this[Wt];
884
- if (!(e != null && e.props))
885
- return R(F, z).set(this, []), [];
886
- const n = e.props.map((r) => (typeof r == "string" ? r : r.name).replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase());
887
- return R(F, z).set(this, n), n;
885
+ const e = this[Nt];
886
+ return e != null && e.propMap ? Array.from(e.propMap.keys()) : [];
888
887
  }
889
888
  /* -------------------- $data -------------------- */
890
889
  get $data() {
891
- return R(this, rt);
890
+ return P(this, nt);
892
891
  }
893
892
  set $data(e) {
894
- var n;
895
- Y(e) || (e = {}), (n = R(this, G)) == null || n.call(this), O(this, k, Ct).call(this, e), O(this, k, dt).call(this);
893
+ var s;
894
+ K(e) || (e = {}), (s = P(this, G)) == null || s.call(this), N(this, C, St).call(this, e), N(this, C, ut).call(this);
896
895
  }
897
896
  refresh() {
898
- O(this, k, dt).call(this);
897
+ N(this, C, ut).call(this);
899
898
  }
900
899
  /* -------------------- 生命周期 -------------------- */
901
900
  connectedCallback() {
902
- var i;
901
+ var o;
903
902
  const e = this.constructor;
904
- Array.isArray(e.upgradeProps) && O(this, k, qt).call(this, e.upgradeProps), O(this, k, At).call(this);
905
- const n = R(this, q);
906
- if ((n.className || n.tagName || "").split(" ").forEach((o) => o && this.classList.add(o)), O(this, k, zt).call(this), n.props && Y(this.$data))
907
- for (const o of n.props) {
908
- const c = typeof o == "string" ? o : o.name, a = O(this, k, Rt).call(this, c), l = c.replace(
909
- /-([a-z])/g,
910
- (u, h) => h.toUpperCase()
911
- );
912
- if (this.hasAttribute(c)) {
913
- const u = this.getAttribute(c), h = O(this, k, Lt).call(this, u, a == null ? void 0 : a.default, a == null ? void 0 : a.type);
914
- this.$data[l] = h;
915
- } else a && "default" in a && (this.$data[l] = a.default);
903
+ Array.isArray(e.upgradeProps) && N(this, C, Dt).call(this, e.upgradeProps), N(this, C, Ct).call(this);
904
+ const s = P(this, B);
905
+ if ((s.className || s.tagName || "").split(" ").forEach((i) => i && this.classList.add(i)), N(this, C, qt).call(this), s.propMap && K(this.$data))
906
+ for (const [i, c] of s.propMap) {
907
+ const a = c.name;
908
+ if (this.hasAttribute(i)) {
909
+ const l = this.getAttribute(i), u = N(this, C, kt).call(this, l, c.default, c.type);
910
+ this.$data[a] = u;
911
+ } else "default" in c && (this.$data[a] = c.default);
916
912
  }
917
- R(this, Z) && _(this, H, Ge(
918
- R(this, Z),
919
- R(this, J),
913
+ P(this, H) && O(this, U, Be(
914
+ P(this, H),
915
+ P(this, Y),
920
916
  this
921
- )), this.mounted(), (i = this.onInit) == null || i.call(this);
917
+ )), this.mounted(), (o = this.onInit) == null || o.call(this);
922
918
  }
923
919
  disconnectedCallback() {
924
920
  var e;
925
- this.unmounted(), (e = R(this, G)) == null || e.call(this), _(this, G, void 0);
926
- }
927
- attributeChangedCallback(e, n, r) {
928
- if (n === r || !Y(this.$data)) return;
929
- const i = O(this, k, Rt).call(this, e), o = e.replace(/-([a-z])/g, (l, u) => u.toUpperCase()), c = this.$data[o], a = O(this, k, Lt).call(this, r, (i == null ? void 0 : i.default) ?? c, i == null ? void 0 : i.type);
930
- this.$data[o] = a, _(this, K, !0), this.attributeChanged(e, c, a), this.emit("change", {
931
- source: "attribute",
932
- name: e,
933
- oldValue: c,
934
- newValue: a
935
- });
921
+ this.unmounted(), (e = P(this, G)) == null || e.call(this), O(this, G, void 0);
922
+ }
923
+ attributeChangedCallback(e, s, r) {
924
+ var u;
925
+ if (s === r || !K(this.$data)) return;
926
+ const i = (u = P(this, B).propMap) == null ? void 0 : u.get(e);
927
+ if (!i) return;
928
+ const c = i.name, a = this.$data[c], l = N(this, C, kt).call(this, r, i.default ?? a, i.type);
929
+ this.$data[c] = l, O(this, q, !0), this.attributeChanged(e, a, l);
936
930
  }
937
931
  /* -------------------- 事件派发 -------------------- */
938
- emit(e, n, r) {
932
+ emit(e, s, r) {
939
933
  this.dispatchEvent(
940
934
  new CustomEvent(e, {
941
935
  bubbles: !0,
942
936
  composed: !0,
943
- detail: n,
937
+ detail: s,
944
938
  ...r
945
939
  })
946
940
  );
@@ -958,366 +952,437 @@ const F = class F extends HTMLElement {
958
952
  }
959
953
  unmounted() {
960
954
  }
961
- attributeChanged(e, n, r) {
955
+ attributeChanged(e, s, r) {
962
956
  }
963
957
  beforeAttributesUpdate() {
964
958
  }
965
959
  afterAttributesUpdate() {
966
960
  }
967
- };
968
- q = new WeakMap(), H = new WeakMap(), Z = new WeakMap(), rt = new WeakMap(), J = new WeakMap(), G = new WeakMap(), Q = new WeakMap(), X = new WeakMap(), K = new WeakMap(), it = new WeakMap(), ot = new WeakMap(), z = new WeakMap(), k = new WeakSet(), // 升级属性(Upgrade Property), 保障在元素被定义前设置的属性能正确触发响应式更新
969
- qt = function(e) {
970
- for (const n of e)
971
- if (this.hasOwnProperty(n)) {
972
- const r = this[n];
973
- delete this[n], this[n] = r;
961
+ }
962
+ B = new WeakMap(), U = new WeakMap(), H = new WeakMap(), nt = new WeakMap(), Y = new WeakMap(), G = new WeakMap(), Z = new WeakMap(), J = new WeakMap(), q = new WeakMap(), st = new WeakMap(), C = new WeakSet(), // 升级属性(Upgrade Property), 保障在元素被定义前设置的属性能正确触发响应式更新
963
+ Dt = function(e) {
964
+ for (const s of e)
965
+ if (this.hasOwnProperty(s)) {
966
+ const r = this[s];
967
+ delete this[s], this[s] = r;
974
968
  }
975
969
  }, /* -------------------- 初始化 -------------------- */
976
- Ct = function(e) {
977
- const { proxy: n, unobserve: r } = Me(e, (i) => {
970
+ St = function(e) {
971
+ const { proxy: s, unobserve: r } = Me(e, (o) => {
972
+ var i, c;
973
+ if (o.type === "set") {
974
+ const { key: a, newValue: l } = o, u = P(this, B), h = String(a), d = ((i = u.propMap) == null ? void 0 : i.get(
975
+ h.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()
976
+ )) || Array.from(((c = u.propMap) == null ? void 0 : c.values()) || []).find((E) => E.name === h);
977
+ d != null && d.reflect && N(this, C, jt).call(this, d, l);
978
+ }
978
979
  this.emit("change", {
979
980
  source: "state",
980
- ...i
981
- }), O(this, k, dt).call(this);
981
+ ...o
982
+ }), N(this, C, ut).call(this);
982
983
  });
983
- _(this, rt, n), _(this, G, r);
984
- }, Gt = function(e) {
985
- const n = e.template;
986
- if (typeof n == "string") {
987
- const r = Ae(n);
988
- _(this, Z, xe(r, {
989
- source: n,
990
- filename: e.tagName
991
- }));
992
- }
993
- }, /* -------------------- Prop 工具 -------------------- */
994
- Rt = function(e) {
995
- const n = R(this, q).props;
996
- if (!n) return;
997
- const r = e.replace(/-([a-z])/g, (o, c) => c.toUpperCase()), i = n.find(
998
- (o) => typeof o == "string" ? o === r : o.name === r
999
- );
1000
- if (i)
1001
- return typeof i == "string" ? { name: i } : i;
1002
- }, Lt = function(e, n, r) {
1003
- if (e === null) return n;
984
+ O(this, nt, s), O(this, G, r);
985
+ }, jt = function(e, s) {
986
+ const r = e.name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
987
+ if (e.type === "boolean")
988
+ s ? this.setAttribute(r, "") : this.removeAttribute(r);
989
+ else {
990
+ const o = typeof s == "object" ? JSON.stringify(s) : String(s);
991
+ this.setAttribute(r, o);
992
+ }
993
+ }, Bt = function(e) {
994
+ e.ir && O(this, H, e.ir);
995
+ }, kt = function(e, s, r) {
996
+ if (e === null)
997
+ return r === "boolean" ? s ?? !1 : s;
1004
998
  switch (r) {
999
+ case "boolean":
1000
+ return !0;
1005
1001
  case "number": {
1006
- const i = Number(e);
1007
- return isNaN(i) ? n : i;
1002
+ const o = Number(e);
1003
+ return isNaN(o) ? s : o;
1008
1004
  }
1009
- case "boolean":
1010
- return e !== null && e !== "false";
1011
1005
  case "object":
1012
1006
  try {
1013
1007
  return JSON.parse(e);
1014
1008
  } catch {
1015
- return n;
1009
+ return s;
1016
1010
  }
1017
1011
  default:
1018
1012
  return e;
1019
1013
  }
1020
1014
  }, /* -------------------- 刷新调度 -------------------- */
1021
- dt = function() {
1022
- R(this, X) || !R(this, H) || (_(this, X, !0), queueMicrotask(() => {
1023
- _(this, X, !1), O(this, k, Kt).call(this);
1015
+ ut = function() {
1016
+ P(this, J) || !P(this, U) || (O(this, J, !0), queueMicrotask(() => {
1017
+ O(this, J, !1), N(this, C, Gt).call(this);
1024
1018
  }));
1025
- }, Kt = function() {
1026
- R(this, Q) || !this.isConnected || (_(this, Q, !0), R(this, K) && this.beforeAttributesUpdate(), this.beforeUpdate(), R(this, H).update(), this.updated(), R(this, K) && (this.afterAttributesUpdate(), _(this, K, !1)), _(this, Q, !1));
1027
- }, zt = function() {
1028
- const n = R(this, q).styles;
1029
- if (!n) return;
1030
- const r = R(this, J);
1031
- if ("adoptedStyleSheets" in r) {
1032
- if (r._styleInjected) return;
1033
- let o = R(F, ot).get(n);
1034
- o || (o = new CSSStyleSheet(), o.replaceSync(n), R(F, ot).set(n, o)), r.adoptedStyleSheets = [
1035
- ...r.adoptedStyleSheets,
1036
- o
1037
- ], r._styleInjected = !0;
1019
+ }, Gt = function() {
1020
+ P(this, Z) || !this.isConnected || (O(this, Z, !0), P(this, q) && this.beforeAttributesUpdate(), this.beforeUpdate(), P(this, U).update(), this.updated(), P(this, q) && (this.afterAttributesUpdate(), O(this, q, !1)), O(this, Z, !1));
1021
+ }, qt = function() {
1022
+ const e = P(this, B);
1023
+ if (!e.styles) return;
1024
+ const s = P(this, Y);
1025
+ if (e.sheet && s instanceof ShadowRoot && "adoptedStyleSheets" in s) {
1026
+ s.adoptedStyleSheets.includes(e.sheet) || (s.adoptedStyleSheets = [...s.adoptedStyleSheets, e.sheet]);
1038
1027
  return;
1039
1028
  }
1040
- if (r.querySelector("style[data-manifest-style]")) return;
1041
- const i = document.createElement("style");
1042
- i.dataset.manifestStyle = "true", i.textContent = n, r.appendChild(i);
1029
+ const r = s instanceof ShadowRoot ? s : document.head, o = `solely-style-${e.tagName}`;
1030
+ if (!r.querySelector(`#${o}`)) {
1031
+ const i = document.createElement("style");
1032
+ i.id = o, i.textContent = e.styles, r.appendChild(i);
1033
+ }
1043
1034
  }, /* -------------------- created 保障 -------------------- */
1044
- At = function() {
1045
- R(this, it) || (_(this, it, !0), this.created());
1046
- }, Mt = new WeakMap(), C(F, "upgradeProps"), // 需要在元素定义前设置的属性列表(Upgrade Property)
1047
- N(F, ot, /* @__PURE__ */ new Map()), /* -------------------- observedAttributes -------------------- */
1048
- N(F, z, /* @__PURE__ */ new WeakMap()), /* -------------------- DEV define 保护 -------------------- */
1049
- N(F, Mt, !1);
1050
- let mt = F;
1051
- const Pe = Symbol.for("solely.manifest"), Ut = (s) => (t) => {
1052
- if (customElements.get(s.tagName))
1053
- return console.warn(`标签名称 "${s.tagName}" 已经被注册`), t;
1054
- class e extends t {
1055
- }
1056
- return e[Pe] = s, customElements.define(s.tagName, e), e;
1057
- }, gt = Symbol("solely.isSVG"), ut = Symbol("solely.irCtx"), ht = Symbol("solely.irEvents"), V = Symbol.for("solely.irMeta"), Tt = Symbol("solely.lastDynamicClass"), Dt = Symbol("solely.dynamicStyleLast"), Oe = {
1035
+ Ct = function() {
1036
+ P(this, st) || (O(this, st, !0), this.created());
1037
+ }, Lt = new WeakMap(), k(ft, "upgradeProps"), /* -------------------- DEV define 保护 -------------------- */
1038
+ T(ft, Lt, !1);
1039
+ const Pe = Symbol.for("solely.manifest"), zt = (n) => {
1040
+ const t = n;
1041
+ return (e) => {
1042
+ const { tagName: s } = t;
1043
+ if (customElements.get(s))
1044
+ return e;
1045
+ if (typeof t.template == "string" && !t.ir)
1046
+ try {
1047
+ const o = Le(t.template);
1048
+ t.ir = xe(o, {
1049
+ source: t.template,
1050
+ filename: s
1051
+ });
1052
+ } catch (o) {
1053
+ console.error(`[Compiler Error] <${s}>:`, o);
1054
+ }
1055
+ if (t.styles && !t.sheet && "CSSStyleSheet" in window)
1056
+ try {
1057
+ const o = new CSSStyleSheet();
1058
+ o.replaceSync(t.styles), t.sheet = o;
1059
+ } catch (o) {
1060
+ console.error(`[Style Error] <${s}>:`, o);
1061
+ }
1062
+ if (t.props && !t.propMap) {
1063
+ const o = /* @__PURE__ */ new Map();
1064
+ t.props.forEach((i) => {
1065
+ const c = typeof i == "string" ? { name: i } : i, a = c.name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1066
+ o.set(a, c);
1067
+ }), t.propMap = o;
1068
+ }
1069
+ class r extends e {
1070
+ }
1071
+ return r[Pe] = t, customElements.define(s, r), r;
1072
+ };
1073
+ }, at = Symbol("solely.irCtx"), ct = Symbol("solely.irEvents"), V = Symbol.for("solely.irMeta"), bt = Symbol("solely.prevClassObj"), wt = Symbol("solely.prevStyleObj"), Oe = {
1058
1074
  xml: "http://www.w3.org/XML/1998/namespace",
1059
1075
  xlink: "http://www.w3.org/1999/xlink",
1060
1076
  xmlns: "http://www.w3.org/2000/xmlns/"
1061
- }, Ne = {
1077
+ }, _t = {
1062
1078
  readonly: "readOnly",
1063
1079
  for: "htmlFor",
1064
1080
  tabindex: "tabIndex",
1065
1081
  contenteditable: "contentEditable",
1066
1082
  maxlength: "maxLength"
1067
- }, _e = /* @__PURE__ */ new Set(["data-", "aria-", "role", "form"]), We = /* @__PURE__ */ new Set([
1083
+ }, Ne = /* @__PURE__ */ new Set(["data-", "aria-", "role", "form"]), _e = /* @__PURE__ */ new Set([
1068
1084
  "value",
1069
1085
  "selectedIndex"
1070
1086
  ]);
1071
- function Te(s, t) {
1072
- var i;
1073
- const e = s, n = (i = t.attrs) == null ? void 0 : i.find((o) => o.key === "class" && !o.dynamic), r = n ? n.value : "";
1074
- r && (e[gt] ? e.className.baseVal = r : e.className = r);
1087
+ function Te(n, t) {
1088
+ var s;
1089
+ const e = (s = t.attrs) == null ? void 0 : s.find((r) => r.key === "class" && !r.dynamic);
1090
+ e != null && e.value && n.setAttribute("class", e.value);
1075
1091
  }
1076
- function De(s, t) {
1077
- var r;
1078
- const e = (r = t.attrs) == null ? void 0 : r.find((i) => i.key === "style" && !i.dynamic), n = e ? Yt(e.value) : {};
1079
- for (const i in n) {
1080
- const o = n[i];
1081
- i.startsWith("--") ? s.style.setProperty(i, o) : s.style[i] = o;
1092
+ function We(n, t) {
1093
+ var o;
1094
+ if (!n.style) return;
1095
+ const s = (o = t.attrs) == null ? void 0 : o.find((i) => i.key === "style" && !i.dynamic), r = s ? Kt(s.value) : {};
1096
+ for (const i in r) {
1097
+ const c = r[i];
1098
+ i.startsWith("--") ? n.style.setProperty(i, c) : n.style[i] = c;
1082
1099
  }
1083
1100
  }
1084
- const Fe = (s, t) => {
1085
- const e = s, n = Yt(t), r = e[Dt] || {};
1101
+ const Fe = (n, t) => {
1102
+ const e = n, s = Kt(t), r = e[wt];
1103
+ if (!r) {
1104
+ for (const i in s) {
1105
+ const c = s[i];
1106
+ i.startsWith("--") ? n.style.setProperty(i, c) : n.style[i] = c;
1107
+ }
1108
+ e[wt] = s;
1109
+ return;
1110
+ }
1111
+ let o = !1;
1086
1112
  for (const i in r)
1087
- i in n || (i.startsWith("--") ? s.style.removeProperty(i) : s.style[i] = "");
1088
- for (const i in n) {
1089
- const o = n[i];
1090
- i.startsWith("--") ? s.style.setProperty(i, o) : s.style[i] = o;
1091
- }
1092
- e[Dt] = n;
1093
- }, je = (s, t) => {
1094
- const e = s, n = e[Tt] || {}, r = Ve(t);
1095
- for (const i in n)
1096
- n[i] && !r[i] && (e[gt] ? e.className.baseVal = e.className.baseVal.replace(new RegExp(`\\b${i}\\b`, "g"), "").trim() : e.classList.remove(i));
1113
+ i in s || (i.startsWith("--") ? n.style.removeProperty(i) : n.style[i] = "", o = !0);
1114
+ for (const i in s) {
1115
+ const c = s[i], a = r[i];
1116
+ c !== a && (i.startsWith("--") ? n.style.setProperty(i, c) : n.style[i] = c, o = !0);
1117
+ }
1118
+ o && (e[wt] = s);
1119
+ }, Ve = (n, t) => {
1120
+ const e = n, s = e[bt], r = De(t);
1121
+ if (!s) {
1122
+ for (const i in r)
1123
+ n.classList.add(i);
1124
+ e[bt] = r;
1125
+ return;
1126
+ }
1127
+ let o = !1;
1128
+ for (const i in s)
1129
+ r[i] || (n.classList.remove(i), o = !0);
1097
1130
  for (const i in r)
1098
- if (r[i])
1099
- if (e[gt]) {
1100
- const o = e.className.baseVal.split(/\s+/);
1101
- o.includes(i) || (o.push(i), e.className.baseVal = o.join(" "));
1102
- } else
1103
- e.classList.add(i);
1104
- e[Tt] = r;
1131
+ s[i] || (n.classList.add(i), o = !0);
1132
+ o && (e[bt] = r);
1105
1133
  };
1106
- function Yt(s) {
1107
- const t = {}, e = [[s]];
1134
+ function Kt(n) {
1135
+ const t = {}, e = [[n]];
1108
1136
  for (; e.length; ) {
1109
- const [n, r] = e.pop();
1110
- if (typeof n == "string") {
1111
- n.split(";").forEach((i) => {
1112
- const [o, c] = i.split(":").map((a) => a.trim());
1113
- o && c && (t[o] = c);
1114
- });
1115
- continue;
1116
- }
1117
- if (Array.isArray(n)) {
1118
- n.forEach((i) => e.push([i]));
1119
- continue;
1120
- }
1121
- if (n && typeof n == "object")
1122
- for (const [i, o] of Object.entries(n)) {
1123
- const c = r ? `${r}-${i}` : i;
1124
- o && typeof o == "object" && !Array.isArray(o) ? e.push([o, c]) : t[c] = String(o ?? "");
1137
+ const [s, r] = e.pop();
1138
+ if (s) {
1139
+ if (typeof s == "string") {
1140
+ const o = /([^:;]+)\s*:\s*([^;]*\(.*?\)[^;]*|[^;]+)/g;
1141
+ let i;
1142
+ for (; (i = o.exec(s)) !== null; ) {
1143
+ const c = i[1].trim(), a = i[2].trim();
1144
+ c && a && (t[c] = a);
1145
+ }
1146
+ continue;
1125
1147
  }
1148
+ if (Array.isArray(s)) {
1149
+ for (let o = s.length - 1; o >= 0; o--)
1150
+ e.push([s[o]]);
1151
+ continue;
1152
+ }
1153
+ if (typeof s == "object")
1154
+ for (const o in s) {
1155
+ const i = s[o];
1156
+ if (i == null) continue;
1157
+ const c = r ? `${r}-${o}` : o;
1158
+ typeof i == "object" && !Array.isArray(i) ? e.push([i, c]) : t[c] = String(i);
1159
+ }
1160
+ }
1126
1161
  }
1127
1162
  return t;
1128
1163
  }
1129
- function Ve(s) {
1130
- const t = {}, e = [s];
1164
+ function De(n) {
1165
+ const t = {}, e = [n];
1131
1166
  for (; e.length; ) {
1132
- const n = e.pop();
1133
- if (n) {
1134
- if (typeof n == "string")
1135
- n.split(/\s+/).forEach((r) => r && (t[r] = !0));
1136
- else if (Array.isArray(n))
1137
- e.push(...n);
1138
- else if (typeof n == "object")
1139
- for (const [r, i] of Object.entries(n))
1140
- t[r] = !!i;
1167
+ const s = e.pop();
1168
+ if (s) {
1169
+ if (typeof s == "string") {
1170
+ const r = s.split(" ");
1171
+ for (let o = 0; o < r.length; o++) {
1172
+ const i = r[o].trim();
1173
+ i && (t[i] = !0);
1174
+ }
1175
+ } else if (Array.isArray(s))
1176
+ for (let r = s.length - 1; r >= 0; r--)
1177
+ e.push(s[r]);
1178
+ else if (typeof s == "object")
1179
+ for (const r in s)
1180
+ s[r] && (t[r] = !0);
1141
1181
  }
1142
1182
  }
1143
1183
  return t;
1144
1184
  }
1145
- function Be(s, t, e) {
1146
- const n = t.indexOf(":");
1147
- if (n > 0) {
1148
- const r = t.slice(0, n), i = Oe[r];
1149
- if (i) return s.setAttributeNS(i, t, e);
1185
+ function Rt(n, t, e) {
1186
+ const s = e == null ? "" : String(e), r = t.indexOf(":");
1187
+ if (r > 0) {
1188
+ const o = t.slice(0, r), i = Oe[o];
1189
+ if (i) {
1190
+ n.getAttributeNS(i, t) !== s && n.setAttributeNS(i, t, s);
1191
+ return;
1192
+ }
1150
1193
  }
1151
- s.setAttribute(t, e);
1194
+ n.getAttribute(t) !== s && n.setAttribute(t, s);
1152
1195
  }
1153
- function Ft(s, t, e) {
1154
- if (t.startsWith("data-") || t.startsWith("aria-") || _e.has(t)) {
1155
- s.setAttribute(t, e);
1196
+ function Tt(n, t, e) {
1197
+ const s = _t[t] || t;
1198
+ if (t.startsWith("data-") || t.startsWith("aria-") || Ne.has(t)) {
1199
+ Rt(n, t, e);
1200
+ return;
1201
+ }
1202
+ const r = n, o = r.tagName;
1203
+ if (e == null) {
1204
+ if (typeof r[s] == "boolean")
1205
+ r[s] !== !1 && (r[s] = !1);
1206
+ else {
1207
+ const c = r[s];
1208
+ c !== "" && c !== void 0 && (r[s] = ""), n.hasAttribute(t) && n.removeAttribute(t);
1209
+ }
1210
+ return;
1211
+ }
1212
+ if (s === "src" || s === "href") {
1213
+ const c = String(e);
1214
+ if (r[s] === c || n.getAttribute(s) === c)
1215
+ return;
1216
+ }
1217
+ if (s === "value" && (o === "INPUT" || o === "TEXTAREA") && r.value === e)
1218
+ return;
1219
+ if (typeof e == "boolean") {
1220
+ if (r[s] === e)
1221
+ return;
1222
+ r[s] = e;
1156
1223
  return;
1157
1224
  }
1158
- const n = Ne[t] || t;
1159
- s[n] = e;
1225
+ (n instanceof SVGElement || r.ownerSVGElement !== void 0) && !_t[t] ? Rt(n, t, e) : r[s] !== e && (r[s] = e);
1160
1226
  }
1161
- class qe {
1162
- constructor(t, e, n = {}) {
1163
- C(this, "nodeMap", /* @__PURE__ */ new Map());
1164
- C(this, "marker", !1);
1165
- this.ir = t, this.container = e, this.scope = n;
1166
- }
1167
- evalIR(t, e, n) {
1168
- var i;
1227
+ class je {
1228
+ constructor(t, e, s = {}) {
1229
+ k(this, "nodeMap", /* @__PURE__ */ new Map());
1230
+ k(this, "marker", !1);
1231
+ this.ir = t, this.container = e, this.scope = s;
1232
+ }
1233
+ evalIR(t, e, s) {
1234
+ var o;
1169
1235
  const r = this.ir.functions[t - 1];
1170
1236
  try {
1171
1237
  return r ? r.apply(this.scope, e) : "";
1172
- } catch (o) {
1173
- return ne(o.message || o.toString(), ((i = this.ir.metadata) == null ? void 0 : i.source) || "", n, this.scope.tagName), "";
1238
+ } catch (i) {
1239
+ return ee(i.message || i.toString(), ((o = this.ir.metadata) == null ? void 0 : o.source) || "", s, this.scope.tagName), "";
1174
1240
  }
1175
1241
  }
1176
1242
  // ================ 创建节点 ================
1177
1243
  createElement(t, e) {
1178
- const n = t.tag, r = e instanceof SVGElement || n === "svg", i = r ? document.createElementNS("http://www.w3.org/2000/svg", n) : document.createElement(n);
1179
- return i[gt] = r, i;
1244
+ const s = t.tag;
1245
+ return e instanceof SVGElement || s === "svg" ? document.createElementNS("http://www.w3.org/2000/svg", s) : document.createElement(s);
1180
1246
  }
1181
1247
  createText(t, e) {
1182
- const n = t.dynamic ? this.evalIR(t.fid, [e], t[V]) : t.txt || "";
1183
- return document.createTextNode(n);
1248
+ const s = t.dynamic ? this.evalIR(t.fid, [e], t[V]) : t.txt || "";
1249
+ return document.createTextNode(s);
1184
1250
  }
1185
1251
  createComment(t, e) {
1186
- const n = t.dynamic ? this.evalIR(t.fid, [e], t[V]) : t.txt || "";
1187
- return document.createComment(n);
1252
+ const s = t.dynamic ? this.evalIR(t.fid, [e], t[V]) : t.txt || "";
1253
+ return document.createComment(s);
1188
1254
  }
1189
1255
  // ================ 属性全量应用(创建或更新时用) ================
1190
- applyAttrs(t, e, n, r = !1) {
1191
- const i = [], o = t;
1192
- o[ut] || (o[ut] = {
1256
+ applyAttrs(t, e, s, r = !1) {
1257
+ const o = [], i = t;
1258
+ i[at] || (i[at] = {
1193
1259
  loops: null
1194
- }), o[ut].loops = n, o[ht] || (o[ht] = /* @__PURE__ */ Object.create(null));
1260
+ }), i[at].loops = s, i[ct] || (i[ct] = /* @__PURE__ */ Object.create(null));
1195
1261
  let c, a = !1, l, u = !1;
1196
1262
  for (const h of e) {
1197
- const { key: p, fid: v, dynamic: m, value: d } = h;
1198
- if (p === ":class") {
1199
- c = this.evalIR(v, [n]), a = !0;
1263
+ const { key: d, fid: E, dynamic: m, value: p } = h;
1264
+ if (d === ":class") {
1265
+ c = this.evalIR(E, [s], h[V]), a = !0;
1200
1266
  continue;
1201
1267
  }
1202
- if (p === ":style") {
1203
- l = this.evalIR(v, [n]), u = !0;
1268
+ if (d === ":style") {
1269
+ l = this.evalIR(E, [s], h[V]), u = !0;
1204
1270
  continue;
1205
1271
  }
1206
- if (p === "class" || p === "style")
1272
+ if (d === "class" || d === "style")
1207
1273
  continue;
1208
- const L = p[0];
1209
- if (L === "@") {
1210
- const $ = p.slice(1), S = h.role ?? "user";
1211
- let A = o[ht][$];
1212
- if (A || (A = o[ht][$] = {
1274
+ const R = d[0];
1275
+ if (R === "@") {
1276
+ const v = d.slice(1), S = h.role ?? "user";
1277
+ let A = i[ct][v];
1278
+ if (A || (A = i[ct][v] = {
1213
1279
  model: [],
1214
1280
  user: []
1215
- }, t.addEventListener($, (f) => {
1281
+ }, t.addEventListener(v, (f) => {
1216
1282
  for (const w of A.model)
1217
1283
  w(f);
1218
1284
  for (const w of A.user)
1219
1285
  w(f);
1220
1286
  })), !r) {
1221
1287
  const f = (w) => this.evalIR(
1222
- v,
1223
- [w, o[ut].loops],
1288
+ E,
1289
+ [w, i[at].loops],
1224
1290
  h[V]
1225
1291
  );
1226
1292
  A[S].push(f);
1227
1293
  }
1228
1294
  continue;
1229
1295
  }
1230
- if (p === "mounted") {
1296
+ if (d === "mounted") {
1231
1297
  r || requestAnimationFrame(
1232
- () => this.evalIR(v, [t, n], h[V])
1298
+ () => this.evalIR(E, [t, s], h[V])
1233
1299
  );
1234
1300
  continue;
1235
1301
  }
1236
- if (p === "updated") {
1302
+ if (d === "updated") {
1237
1303
  r && requestAnimationFrame(
1238
- () => this.evalIR(v, [t, n], h[V])
1304
+ () => this.evalIR(E, [t, s], h[V])
1239
1305
  );
1240
1306
  continue;
1241
1307
  }
1242
- if (p === "ref" && d) {
1243
- this.scope.$refs = this.scope.$refs || {}, this.scope.$refs[d] = t;
1308
+ if (d === "ref" && p) {
1309
+ this.scope.$refs = this.scope.$refs || {}, this.scope.$refs[p] = t;
1244
1310
  continue;
1245
1311
  }
1246
- const b = m ? this.evalIR(v, [n], h[V]) : d ?? "";
1247
- if (L === ":") {
1248
- const $ = p.slice(1);
1249
- t.tagName === "SELECT" && We.has($) ? i.push(() => Ft(t, $, b)) : Ft(t, $, b);
1250
- } else
1251
- Be(t, p, String(b));
1312
+ const g = m ? this.evalIR(E, [s], h[V]) : p ?? "";
1313
+ if (R === ":") {
1314
+ const v = d.slice(1);
1315
+ t.tagName === "SELECT" && _e.has(v) ? o.push(() => Tt(t, v, g)) : Tt(t, v, g);
1316
+ } else r || Rt(t, d, String(g));
1252
1317
  }
1253
- return (a || !r) && je(t, c), (u || !r) && Fe(t, l), i;
1318
+ return a && Ve(t, c), u && Fe(t, l), o;
1254
1319
  }
1255
1320
  // ================ 更新已有节点 Text Or Comment ================
1256
- updateNode(t, e, n) {
1257
- const r = e.dynamic ? this.evalIR(e.fid, [n], e[V]) : e.txt || "";
1321
+ updateNode(t, e, s) {
1322
+ const r = e.dynamic ? this.evalIR(e.fid, [s], e[V]) : e.txt || "";
1258
1323
  e.dynamic && t.textContent !== r && (t.textContent = r);
1259
1324
  }
1260
1325
  // ================ 核心遍历 ================
1261
- irToNode(t, e, n, r, i) {
1262
- var l, u, h, p;
1263
- const o = n + "-" + e, c = this.nodeMap.get(o);
1326
+ irToNode(t, e, s, r, o) {
1327
+ var l, u, h, d;
1328
+ const i = s + "-" + e, c = this.nodeMap.get(i);
1264
1329
  let a;
1265
1330
  if (c) {
1266
1331
  a = c.node, c.marker = this.marker;
1267
- let v = [];
1268
- t.dynamic && (t.type === g.Element ? v = this.applyAttrs(
1332
+ let E = [];
1333
+ t.dynamic && (t.type === y.Element ? E = this.applyAttrs(
1269
1334
  a,
1270
1335
  t.attrs ?? [],
1271
- i,
1336
+ o,
1272
1337
  !0
1273
- ) : this.updateNode(a, t, i)), (l = t.children) == null || l.forEach((m, d) => {
1274
- this.irToNode(m, d, o, a, i);
1275
- }), v.forEach((m) => m());
1338
+ ) : this.updateNode(a, t, o)), (l = t.children) == null || l.forEach((m, p) => {
1339
+ this.irToNode(m, p, i, a, o);
1340
+ }), E.forEach((m) => m());
1276
1341
  } else
1277
1342
  switch (t.type) {
1278
- case g.Element:
1279
- a = this.createElement(t, r), Te(a, t), De(a, t);
1280
- const v = this.applyAttrs(a, t.attrs ?? [], i);
1281
- r.appendChild(a), this.nodeMap.set(o, { irNode: t, node: a, loops: i, marker: this.marker }), (u = t.children) == null || u.forEach((m, d) => {
1282
- this.irToNode(m, d, o, a, i);
1283
- }), v.forEach((m) => m());
1343
+ case y.Element:
1344
+ a = this.createElement(t, r), Te(a, t), We(a, t);
1345
+ const E = this.applyAttrs(a, t.attrs ?? [], o);
1346
+ r.appendChild(a), this.nodeMap.set(i, { irNode: t, node: a, loops: o, marker: this.marker }), (u = t.children) == null || u.forEach((m, p) => {
1347
+ this.irToNode(m, p, i, a, o);
1348
+ }), E.forEach((m) => m());
1284
1349
  break;
1285
- case g.Text:
1286
- a = this.createText(t, i), r.appendChild(a), this.nodeMap.set(o, { irNode: t, node: a, loops: i, marker: this.marker });
1350
+ case y.Text:
1351
+ a = this.createText(t, o), r.appendChild(a), this.nodeMap.set(i, { irNode: t, node: a, loops: o, marker: this.marker });
1287
1352
  break;
1288
- case g.Comment:
1289
- a = this.createComment(t, i), r.appendChild(a), this.nodeMap.set(o, { irNode: t, node: a, loops: i, marker: this.marker });
1353
+ case y.Comment:
1354
+ a = this.createComment(t, o), r.appendChild(a), this.nodeMap.set(i, { irNode: t, node: a, loops: o, marker: this.marker });
1290
1355
  break;
1291
- case g.For: {
1292
- const m = `${o}-end`;
1293
- let d = (h = this.nodeMap.get(m)) == null ? void 0 : h.node;
1294
- d ? this.nodeMap.get(m).marker = this.marker : (d = document.createComment(`for:${o}`), r.appendChild(d), this.nodeMap.set(m, {
1295
- irNode: { type: g.Comment },
1296
- node: d,
1297
- loops: i,
1356
+ case y.For: {
1357
+ const m = `${i}-end`;
1358
+ let p = (h = this.nodeMap.get(m)) == null ? void 0 : h.node;
1359
+ p ? this.nodeMap.get(m).marker = this.marker : (p = document.createComment(`for:${i}`), r.appendChild(p), this.nodeMap.set(m, {
1360
+ irNode: { type: y.Comment },
1361
+ node: p,
1362
+ loops: o,
1298
1363
  marker: this.marker
1299
1364
  }));
1300
- const L = this.evalIR(t.fid, [i], t[V]) || [], b = document.createDocumentFragment();
1301
- L.forEach(($, S) => {
1365
+ const R = this.evalIR(t.fid, [o], t[V]) || [], g = document.createDocumentFragment();
1366
+ R.forEach((v, S) => {
1302
1367
  var f;
1303
- const A = [...i, { itmVal: $, idxVal: S }];
1304
- (f = t.children) == null || f.forEach((w, E) => {
1305
- this.irToNode(w, E, `${o}-for-${S}`, b, A);
1368
+ const A = [...o, { itmVal: v, idxVal: S }];
1369
+ (f = t.children) == null || f.forEach((w, x) => {
1370
+ this.irToNode(w, x, `${i}-for-${S}`, g, A);
1306
1371
  });
1307
- }), d.parentNode.insertBefore(b, d);
1372
+ }), p.parentNode.insertBefore(g, p);
1308
1373
  break;
1309
1374
  }
1310
- case g.Conditional: {
1311
- const m = `${o}-end`;
1312
- let d = (p = this.nodeMap.get(m)) == null ? void 0 : p.node;
1313
- d ? this.nodeMap.get(m).marker = this.marker : (d = document.createComment(`if:${o}`), r.appendChild(d), this.nodeMap.set(m, { irNode: {}, node: d, loops: i, marker: this.marker }));
1314
- for (let L = 0; L < (t.branches || []).length; L++) {
1315
- const b = t.branches[L];
1316
- if (b.condFid === null || this.evalIR(b.condFid, [i], b[V])) {
1375
+ case y.Conditional: {
1376
+ const m = `${i}-end`;
1377
+ let p = (d = this.nodeMap.get(m)) == null ? void 0 : d.node;
1378
+ p ? this.nodeMap.get(m).marker = this.marker : (p = document.createComment(`if:${i}`), r.appendChild(p), this.nodeMap.set(m, { irNode: {}, node: p, loops: o, marker: this.marker }));
1379
+ for (let R = 0; R < (t.branches || []).length; R++) {
1380
+ const g = t.branches[R];
1381
+ if (g.condFid === null || this.evalIR(g.condFid, [o], g[V])) {
1317
1382
  const S = document.createDocumentFragment();
1318
- b.children.forEach((A, f) => {
1319
- this.irToNode(A, f, `${o}-if-${L}`, S, i);
1320
- }), d.parentNode.insertBefore(S, d);
1383
+ g.children.forEach((A, f) => {
1384
+ this.irToNode(A, f, `${i}-if-${R}`, S, o);
1385
+ }), p.parentNode.insertBefore(S, p);
1321
1386
  break;
1322
1387
  }
1323
1388
  }
@@ -1329,17 +1394,17 @@ class qe {
1329
1394
  cleanupOldNodes() {
1330
1395
  for (const [t, e] of this.nodeMap.entries())
1331
1396
  if (e.marker !== this.marker) {
1332
- const { irNode: n, node: r, loops: i } = e;
1333
- if (n.attrs) {
1334
- const o = n.attrs.find((a) => a.key === "unmounted");
1335
- o && requestAnimationFrame(() => {
1397
+ const { irNode: s, node: r, loops: o } = e;
1398
+ if (s.attrs) {
1399
+ const i = s.attrs.find((a) => a.key === "unmounted");
1400
+ i && requestAnimationFrame(() => {
1336
1401
  this.evalIR(
1337
- o.fid,
1338
- [r, i],
1339
- o[V]
1402
+ i.fid,
1403
+ [r, o],
1404
+ i[V]
1340
1405
  );
1341
1406
  });
1342
- const c = n.attrs.find((a) => a.key === "ref");
1407
+ const c = s.attrs.find((a) => a.key === "ref");
1343
1408
  c && c.value && delete this.scope.$refs[c.value];
1344
1409
  }
1345
1410
  r == null || r.remove(), this.nodeMap.delete(t);
@@ -1360,38 +1425,38 @@ class qe {
1360
1425
  this.container.innerHTML = "", this.nodeMap.clear();
1361
1426
  }
1362
1427
  }
1363
- const Ge = (s, t, e = {}) => {
1364
- const n = new qe(s, t, e);
1365
- return n.mount(), {
1366
- update: () => n.update(),
1367
- destroy: () => n.destroy()
1428
+ const Be = (n, t, e = {}) => {
1429
+ const s = new je(n, t, e);
1430
+ return s.mount(), {
1431
+ update: () => s.update(),
1432
+ destroy: () => s.destroy()
1368
1433
  };
1369
1434
  };
1370
- let U = null, Ht;
1371
- const Zt = new Promise((s) => {
1372
- Ht = s;
1435
+ let z = null, Ut;
1436
+ const Ht = new Promise((n) => {
1437
+ Ut = n;
1373
1438
  });
1374
- function Xe(s) {
1375
- return U || (U = new Ke(s), Ht(U), U);
1439
+ function Je(n) {
1440
+ return z || (z = new Ge(n), Ut(z), z);
1376
1441
  }
1377
- function xt() {
1378
- return U;
1442
+ function Et() {
1443
+ return z;
1379
1444
  }
1380
- class Ke {
1445
+ class Ge {
1381
1446
  constructor(t) {
1382
- C(this, "routes");
1383
- C(this, "base");
1384
- C(this, "mode");
1385
- C(this, "beforeEachGuard");
1386
- C(this, "afterEachGuard");
1387
- C(this, "currentRoute", null);
1388
- C(this, "listeners", /* @__PURE__ */ new Set());
1389
- C(this, "isStarted", !1);
1447
+ k(this, "routes");
1448
+ k(this, "base");
1449
+ k(this, "mode");
1450
+ k(this, "beforeEachGuard");
1451
+ k(this, "afterEachGuard");
1452
+ k(this, "currentRoute", null);
1453
+ k(this, "listeners", /* @__PURE__ */ new Set());
1454
+ k(this, "isStarted", !1);
1390
1455
  this.routes = t.routes, this.base = t.base ?? "/", this.mode = t.mode || "history", this.beforeEachGuard = t.beforeEach, this.afterEachGuard = t.afterEach;
1391
1456
  }
1392
1457
  // --- 核心匹配逻辑 ---
1393
1458
  matchRoute(t = "/") {
1394
- const e = t.startsWith("/") ? t : "/" + t, [n, r] = e.split("?"), i = n.split("/").filter(Boolean), o = this.parseQuery(r), c = this.recursiveMatch(this.routes, i);
1459
+ const e = t.startsWith("/") ? t : "/" + t, [s, r] = e.split("?"), o = s.split("/").filter(Boolean), i = this.parseQuery(r), c = this.recursiveMatch(this.routes, o);
1395
1460
  if (c) {
1396
1461
  const a = c.matched[c.matched.length - 1];
1397
1462
  return a.config.redirect ? this.matchRoute(a.config.redirect) : {
@@ -1399,7 +1464,7 @@ class Ke {
1399
1464
  // 这里的结构已经是 [{config, params}, ...]
1400
1465
  params: c.params,
1401
1466
  // 全局合并后的 params
1402
- query: o,
1467
+ query: i,
1403
1468
  fullPath: e,
1404
1469
  // 合并所有层级的 meta
1405
1470
  meta: c.matched.reduce((l, u) => ({ ...l, ...u.config.meta || {} }), {})
@@ -1408,23 +1473,23 @@ class Ke {
1408
1473
  return null;
1409
1474
  }
1410
1475
  recursiveMatch(t, e) {
1411
- const n = [...t].sort((r, i) => this.calculateScore(i.path) - this.calculateScore(r.path));
1412
- for (const r of n) {
1413
- const i = r.path.split("/").filter(Boolean), o = {};
1476
+ const s = [...t].sort((r, o) => this.calculateScore(o.path) - this.calculateScore(r.path));
1477
+ for (const r of s) {
1478
+ const o = r.path.split("/").filter(Boolean), i = {};
1414
1479
  let c = !0;
1415
- if (i.length === 0 && e.length === 0)
1480
+ if (o.length === 0 && e.length === 0)
1416
1481
  return {
1417
1482
  matched: [{ config: r, params: {} }],
1418
1483
  params: {}
1419
1484
  };
1420
- for (let a = 0; a < i.length; a++) {
1421
- const l = i[a], u = e[a];
1485
+ for (let a = 0; a < o.length; a++) {
1486
+ const l = o[a], u = e[a];
1422
1487
  if (l.startsWith(":")) {
1423
1488
  if (!u) {
1424
1489
  c = !1;
1425
1490
  break;
1426
1491
  }
1427
- o[l.slice(1)] = u;
1492
+ i[l.slice(1)] = u;
1428
1493
  } else if (l === "*") {
1429
1494
  c = !0;
1430
1495
  break;
@@ -1434,19 +1499,19 @@ class Ke {
1434
1499
  }
1435
1500
  }
1436
1501
  if (c) {
1437
- const a = i.length, l = e.slice(a), u = { config: r, params: o };
1502
+ const a = o.length, l = e.slice(a), u = { config: r, params: i };
1438
1503
  if (l.length > 0 && r.children) {
1439
1504
  const h = this.recursiveMatch(r.children, l);
1440
1505
  if (h)
1441
1506
  return {
1442
1507
  matched: [u, ...h.matched],
1443
- params: { ...o, ...h.params }
1508
+ params: { ...i, ...h.params }
1444
1509
  // 全局合并 params
1445
1510
  };
1446
- } else if (l.length === 0 || i.includes("*"))
1511
+ } else if (l.length === 0 || o.includes("*"))
1447
1512
  return {
1448
1513
  matched: [u],
1449
- params: o
1514
+ params: i
1450
1515
  };
1451
1516
  }
1452
1517
  }
@@ -1454,12 +1519,12 @@ class Ke {
1454
1519
  }
1455
1520
  calculateScore(t = "/") {
1456
1521
  const e = t.split("/").filter(Boolean);
1457
- return e.length === 0 ? 1 : e.reduce((n, r) => r.startsWith(":") ? n + 5 : r === "*" ? n + 0 : n + 10, 0);
1522
+ return e.length === 0 ? 1 : e.reduce((s, r) => r.startsWith(":") ? s + 5 : r === "*" ? s + 0 : s + 10, 0);
1458
1523
  }
1459
1524
  parseQuery(t) {
1460
1525
  const e = {};
1461
- return t && new URLSearchParams(t).forEach((r, i) => {
1462
- e[i] = r;
1526
+ return t && new URLSearchParams(t).forEach((r, o) => {
1527
+ e[o] = r;
1463
1528
  }), e;
1464
1529
  }
1465
1530
  normalizePath(t = "/") {
@@ -1478,30 +1543,30 @@ class Ke {
1478
1543
  return e !== "/" && t.startsWith(e) && (t = t.slice(e.length) || "/"), this.normalizePath(t);
1479
1544
  }
1480
1545
  updateBrowserHistory(t = "/", e) {
1481
- const n = this.normalizePath(t), r = this.base || "/";
1546
+ const s = this.normalizePath(t), r = this.base || "/";
1482
1547
  if (this.mode === "hash")
1483
- e ? window.location.replace(`#${n}`) : window.location.hash = n;
1548
+ e ? window.location.replace(`#${s}`) : window.location.hash = s;
1484
1549
  else {
1485
- const i = r.endsWith("/") ? r.slice(0, -1) : r, o = i === "/" ? n : i + n;
1486
- e ? window.history.replaceState({ path: o }, "", o) : window.history.pushState({ path: o }, "", o);
1550
+ const o = r.endsWith("/") ? r.slice(0, -1) : r, i = o === "/" ? s : o + s;
1551
+ e ? window.history.replaceState({ path: i }, "", i) : window.history.pushState({ path: i }, "", i);
1487
1552
  }
1488
1553
  }
1489
1554
  /**
1490
1555
  * @param fromEvent 标志位:是否由浏览器 popstate 事件触发
1491
1556
  */
1492
- async navigate(t = "/", e = !1, n = !1) {
1493
- const r = this.normalizePath(t), i = this.currentRoute, o = this.matchRoute(r);
1494
- if (!o) return { success: !1, error: `No route matched: ${r}` };
1495
- if (i && i.fullPath === o.fullPath) return { success: !0 };
1557
+ async navigate(t = "/", e = !1, s = !1) {
1558
+ const r = this.normalizePath(t), o = this.currentRoute, i = this.matchRoute(r);
1559
+ if (!i) return { success: !1, error: `No route matched: ${r}` };
1560
+ if (o && o.fullPath === i.fullPath) return { success: !0 };
1496
1561
  if (this.beforeEachGuard)
1497
1562
  try {
1498
- const c = await this.beforeEachGuard(o, i);
1563
+ const c = await this.beforeEachGuard(i, o);
1499
1564
  if (c === !1) return { success: !1, cancelled: !0 };
1500
1565
  if (typeof c == "string") return this.navigate(c, e);
1501
1566
  } catch (c) {
1502
1567
  return { success: !1, error: c instanceof Error ? c.message : "Guard Error" };
1503
1568
  }
1504
- return this.currentRoute = o, n || this.updateBrowserHistory(r, e), this.notifyListeners(), this.afterEachGuard && this.afterEachGuard(o, i), { success: !0 };
1569
+ return this.currentRoute = i, s || this.updateBrowserHistory(r, e), this.notifyListeners(), this.afterEachGuard && this.afterEachGuard(i, o), { success: !0 };
1505
1570
  }
1506
1571
  // --- 路径解析逻辑 ---
1507
1572
  /**
@@ -1511,8 +1576,8 @@ class Ke {
1511
1576
  resolve(t = "/") {
1512
1577
  const e = this.normalizePath(t);
1513
1578
  if (this.mode === "hash") return `#${e}`;
1514
- const n = this.base.endsWith("/") ? this.base.slice(0, -1) : this.base;
1515
- return n === "/" ? e : n + e;
1579
+ const s = this.base.endsWith("/") ? this.base.slice(0, -1) : this.base;
1580
+ return s === "/" ? e : s + e;
1516
1581
  }
1517
1582
  /**
1518
1583
  * 获取当前模式(供外部组件判断,如 RouterLink)
@@ -1521,8 +1586,8 @@ class Ke {
1521
1586
  return this.mode;
1522
1587
  }
1523
1588
  pushWithQuery(t = "/", e) {
1524
- const n = new URLSearchParams(e).toString(), r = t.includes("?") ? "&" : "?";
1525
- return this.push(t + (n ? r + n : ""));
1589
+ const s = new URLSearchParams(e).toString(), r = t.includes("?") ? "&" : "?";
1590
+ return this.push(t + (s ? r + s : ""));
1526
1591
  }
1527
1592
  push(t = "/") {
1528
1593
  return this.navigate(t, !1);
@@ -1550,28 +1615,28 @@ class Ke {
1550
1615
  return this.currentRoute;
1551
1616
  }
1552
1617
  }
1553
- var ze = Object.getOwnPropertyDescriptor, Ue = (s, t, e, n) => {
1554
- for (var r = n > 1 ? void 0 : n ? ze(t, e) : t, i = s.length - 1, o; i >= 0; i--)
1555
- (o = s[i]) && (r = o(r) || r);
1618
+ var qe = Object.getOwnPropertyDescriptor, ze = (n, t, e, s) => {
1619
+ for (var r = s > 1 ? void 0 : s ? qe(t, e) : t, o = n.length - 1, i; o >= 0; o--)
1620
+ (i = n[o]) && (r = i(r) || r);
1556
1621
  return r;
1557
1622
  };
1558
- let yt = class extends mt {
1623
+ let dt = class extends ft {
1559
1624
  constructor() {
1560
1625
  super(...arguments);
1561
- C(this, "unsubscribe");
1562
- C(this, "level", 0);
1563
- C(this, "currentElement", null);
1564
- C(this, "currentTagName", null);
1565
- C(this, "routerAttrs", /* @__PURE__ */ new Set());
1566
- C(this, "prevPropKeys", /* @__PURE__ */ new Set());
1567
- C(this, "scheduled", !1);
1568
- C(this, "cache", /* @__PURE__ */ new Map());
1569
- C(this, "latestLoadId", 0);
1626
+ k(this, "unsubscribe");
1627
+ k(this, "level", 0);
1628
+ k(this, "currentElement", null);
1629
+ k(this, "currentTagName", null);
1630
+ k(this, "routerAttrs", /* @__PURE__ */ new Set());
1631
+ k(this, "prevPropKeys", /* @__PURE__ */ new Set());
1632
+ k(this, "scheduled", !1);
1633
+ k(this, "cache", /* @__PURE__ */ new Map());
1634
+ k(this, "latestLoadId", 0);
1570
1635
  }
1571
1636
  /* -------------------- 生命周期 -------------------- */
1572
1637
  async mounted() {
1573
1638
  this.detectLevel();
1574
- const t = await Zt;
1639
+ const t = await Ht;
1575
1640
  this.unsubscribe = t.listen(() => {
1576
1641
  this.scheduleLoad(t.getCurrentRoute());
1577
1642
  }), this.loadRoute(t.getCurrentRoute());
@@ -1589,52 +1654,52 @@ let yt = class extends mt {
1589
1654
  detectLevel() {
1590
1655
  let t = 0, e = this.parentElement;
1591
1656
  for (; e; )
1592
- e instanceof yt && t++, e = e.parentElement;
1657
+ e instanceof dt && t++, e = e.parentElement;
1593
1658
  this.level = t;
1594
1659
  }
1595
1660
  async loadRoute(t) {
1596
- const e = ++this.latestLoadId, n = t == null ? void 0 : t.matched[this.level];
1597
- if (!n) {
1661
+ const e = ++this.latestLoadId, s = t == null ? void 0 : t.matched[this.level];
1662
+ if (!s) {
1598
1663
  this.handleEmptyRoute();
1599
1664
  return;
1600
1665
  }
1601
- const { config: r } = n;
1602
- let i = r.tagName;
1603
- if (!i && typeof r.component == "function") {
1666
+ const { config: r } = s;
1667
+ let o = r.tagName;
1668
+ if (!o && typeof r.component == "function") {
1604
1669
  this.renderLoading();
1605
1670
  try {
1606
1671
  const c = await r.component();
1607
- i = typeof c == "string" ? c : c.tagName;
1672
+ o = typeof c == "string" ? c : c.tagName;
1608
1673
  } catch (c) {
1609
1674
  this.renderError(`Load Error: ${c}`);
1610
1675
  return;
1611
1676
  }
1612
1677
  }
1613
1678
  if (e !== this.latestLoadId) return;
1614
- if (!i) {
1679
+ if (!o) {
1615
1680
  this.clear();
1616
1681
  return;
1617
1682
  }
1618
- if (!r.forceReload && this.currentElement && this.currentTagName === i.toLowerCase()) {
1683
+ if (!r.forceReload && this.currentElement && this.currentTagName === o.toLowerCase()) {
1619
1684
  this.syncState(this.currentElement, t == null ? void 0 : t.params, (t == null ? void 0 : t.query) || {}, r.props);
1620
1685
  return;
1621
1686
  }
1622
1687
  this.clear(r.keepAlive);
1623
- const o = this.getOrCreateComponent(i, r);
1624
- this.syncState(o, t == null ? void 0 : t.params, (t == null ? void 0 : t.query) || {}, r.props), this.appendChild(o), this.currentElement = o, this.currentTagName = i.toLowerCase();
1688
+ const i = this.getOrCreateComponent(o, r);
1689
+ this.syncState(i, t == null ? void 0 : t.params, (t == null ? void 0 : t.query) || {}, r.props), this.appendChild(i), this.currentElement = i, this.currentTagName = o.toLowerCase();
1625
1690
  }
1626
1691
  getOrCreateComponent(t, e) {
1627
- const n = t.toLowerCase();
1628
- if (e.keepAlive && this.cache.has(n))
1629
- return this.cache.get(n);
1692
+ const s = t.toLowerCase();
1693
+ if (e.keepAlive && this.cache.has(s))
1694
+ return this.cache.get(s);
1630
1695
  const r = document.createElement(t);
1631
- return e.keepAlive && this.cache.set(n, r), r;
1696
+ return e.keepAlive && this.cache.set(s, r), r;
1632
1697
  }
1633
- syncState(t, e, n, r = {}) {
1634
- const i = (a) => a.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), o = /* @__PURE__ */ new Map();
1635
- Object.entries(e).forEach(([a, l]) => o.set(i(a), String(l))), Object.entries(n).forEach(([a, l]) => o.set(`query-${i(a)}`, String(l))), this.routerAttrs.forEach((a) => {
1636
- o.has(a) || (t.removeAttribute(a), this.routerAttrs.delete(a));
1637
- }), o.forEach((a, l) => {
1698
+ syncState(t, e, s, r = {}) {
1699
+ const o = (a) => a.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), i = /* @__PURE__ */ new Map();
1700
+ Object.entries(e).forEach(([a, l]) => i.set(o(a), String(l))), Object.entries(s).forEach(([a, l]) => i.set(`query-${o(a)}`, String(l))), this.routerAttrs.forEach((a) => {
1701
+ i.has(a) || (t.removeAttribute(a), this.routerAttrs.delete(a));
1702
+ }), i.forEach((a, l) => {
1638
1703
  t.getAttribute(l) !== a && t.setAttribute(l, a), this.routerAttrs.add(l);
1639
1704
  });
1640
1705
  const c = new Set(Object.keys(r));
@@ -1657,22 +1722,22 @@ let yt = class extends mt {
1657
1722
  this.currentElement ? this.contains(this.currentElement) && this.removeChild(this.currentElement) : t || (this.innerHTML = ""), this.currentElement = null, this.currentTagName = null, this.routerAttrs.clear(), this.prevPropKeys.clear();
1658
1723
  }
1659
1724
  };
1660
- yt = Ue([
1661
- Ut({
1725
+ dt = ze([
1726
+ zt({
1662
1727
  tagName: "router-view"
1663
1728
  // 注意:删除了 shadowDOM 配置,默认为 false
1664
1729
  })
1665
- ], yt);
1666
- const ts = yt;
1667
- var Ye = Object.getOwnPropertyDescriptor, He = (s, t, e, n) => {
1668
- for (var r = n > 1 ? void 0 : n ? Ye(t, e) : t, i = s.length - 1, o; i >= 0; i--)
1669
- (o = s[i]) && (r = o(r) || r);
1730
+ ], dt);
1731
+ const Xe = dt;
1732
+ var Ke = Object.getOwnPropertyDescriptor, Ue = (n, t, e, s) => {
1733
+ for (var r = s > 1 ? void 0 : s ? Ke(t, e) : t, o = n.length - 1, i; o >= 0; o--)
1734
+ (i = n[o]) && (r = i(r) || r);
1670
1735
  return r;
1671
1736
  };
1672
- let It = class extends mt {
1737
+ let At = class extends ft {
1673
1738
  constructor() {
1674
1739
  super(...arguments);
1675
- C(this, "_prefetched", !1);
1740
+ k(this, "_prefetched", !1);
1676
1741
  }
1677
1742
  set to(t) {
1678
1743
  this.$data.to = t, this.updateState();
@@ -1681,15 +1746,15 @@ let It = class extends mt {
1681
1746
  return this.$data.to;
1682
1747
  }
1683
1748
  async mounted() {
1684
- (await Zt).listen(() => this.updateState()), this.updateState(), this.addEventListener("click", (e) => {
1685
- var r, i;
1686
- e.defaultPrevented || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || e.button !== 0 || (r = e.target.closest("a")) != null && r.getAttribute("target") || (e.preventDefault(), (i = xt()) == null || i.push(this.$data.to));
1749
+ (await Ht).listen(() => this.updateState()), this.updateState(), this.addEventListener("click", (e) => {
1750
+ var r, o;
1751
+ e.defaultPrevented || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || e.button !== 0 || (r = e.target.closest("a")) != null && r.getAttribute("target") || (e.preventDefault(), (o = Et()) == null || o.push(this.$data.to));
1687
1752
  }), this.addEventListener("mouseenter", () => {
1688
1753
  this.prefetchRoute();
1689
1754
  }, { once: !0 });
1690
1755
  }
1691
1756
  updateState() {
1692
- const t = xt();
1757
+ const t = Et();
1693
1758
  if (!t) return;
1694
1759
  this.$data.href = t.resolve(this.$data.to);
1695
1760
  let e = !1;
@@ -1698,23 +1763,23 @@ let It = class extends mt {
1698
1763
  else {
1699
1764
  const r = t.getCurrentRoute();
1700
1765
  if (r) {
1701
- const i = r.fullPath;
1702
- this.hasAttribute("exact") ? e = i === this.$data.to : e = i === this.$data.to || i.startsWith(this.$data.to + "/");
1766
+ const o = r.fullPath;
1767
+ this.hasAttribute("exact") ? e = o === this.$data.to : e = o === this.$data.to || o.startsWith(this.$data.to + "/");
1703
1768
  }
1704
1769
  }
1705
1770
  this.$data.isActive = e;
1706
- const n = this.$data.activeClass || "active";
1707
- this.classList.toggle(n, e);
1771
+ const s = this.$data.activeClass || "active";
1772
+ this.classList.toggle(s, e);
1708
1773
  }
1709
1774
  // 预加载路由的具体实现
1710
1775
  prefetchRoute() {
1711
1776
  if (this._prefetched || !this.hasAttribute("prefetch")) return;
1712
- const t = xt();
1777
+ const t = Et();
1713
1778
  t && typeof t.prefetch == "function" && (t.prefetch(this.$data.to), this._prefetched = !0);
1714
1779
  }
1715
1780
  };
1716
- It = He([
1717
- Ut({
1781
+ At = Ue([
1782
+ zt({
1718
1783
  tagName: "router-link",
1719
1784
  // template 中 slot 包裹 label 作为 fallback:
1720
1785
  // 如果有子节点,显示子节点;如果没有,显示 label 属性的内容。
@@ -1747,32 +1812,32 @@ It = He([
1747
1812
  // 注册所有支持的 props
1748
1813
  props: ["to", "active", "exact", "label", "custom", "activeClass", "prefetch"]
1749
1814
  })
1750
- ], It);
1751
- const es = It;
1815
+ ], At);
1816
+ const Qe = At;
1752
1817
  export {
1753
- g as ASTType,
1754
- mt as BaseElement,
1755
- Ut as CustomElement,
1756
- qe as IRRenderer,
1818
+ y as ASTType,
1819
+ ft as BaseElement,
1820
+ zt as CustomElement,
1821
+ je as IRRenderer,
1757
1822
  de as LIFECYCLE_ATTRS_MAP,
1758
- Ke as Router,
1759
- es as RouterLink,
1760
- ts as RouterView,
1823
+ Ge as Router,
1824
+ Qe as RouterLink,
1825
+ Xe as RouterView,
1761
1826
  xe as buildIR,
1762
- Qe as clearIRCache,
1763
- re as createFunction,
1764
- Ge as createRender,
1765
- Xe as createRouter,
1827
+ Ze as clearIRCache,
1828
+ ne as createFunction,
1829
+ Be as createRender,
1830
+ Je as createRouter,
1766
1831
  he as genFunction,
1767
- xt as getRouter,
1832
+ Et as getRouter,
1768
1833
  me as isLifecycleKind,
1769
- Y as isObject,
1834
+ K as isObject,
1770
1835
  fe as listeners,
1771
1836
  pe as mapAttrKeyToLifecycleKind,
1772
1837
  Me as observe,
1773
- Je as parseHashUrl,
1774
- Ae as parseHtml,
1775
- Zt as routerReady,
1776
- ne as showTemplateError,
1777
- ve as transformModel
1838
+ Ye as parseHashUrl,
1839
+ Le as parseHtml,
1840
+ Ht as routerReady,
1841
+ ee as showTemplateError,
1842
+ Ee as transformModel
1778
1843
  };