@fox-js/fox 3.0.1-29 → 3.0.1-30

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/libs/index.esm.js CHANGED
@@ -1,21 +1,21 @@
1
- import { ref as gr, getCurrentInstance as Mt, onUnmounted as it, shallowRef as kr, defineComponent as wr, inject as G, provide as se, h as he } from "vue";
1
+ import { ref as wr, getCurrentInstance as Mt, onUnmounted as it, shallowRef as Wr, defineComponent as br, inject as G, provide as se, h as he } from "vue";
2
2
  /*!
3
- * fox v3.0.0 Wed Sep 06 2023 22:50:12 GMT+0800 (中国标准时间)
3
+ * fox v3.0.0 Mon Oct 30 2023 12:41:11 GMT+0800 (中国标准时间)
4
4
  */
5
- const Ee = typeof window < "u", j = function() {
5
+ const Ae = typeof window < "u", T = function() {
6
6
  return window;
7
7
  }, De = function() {
8
8
  return window.document;
9
9
  };
10
- function Wr(s) {
10
+ function zr(s) {
11
11
  let e = s, t = e.lastIndexOf("/");
12
12
  return t > 0 && t < e.length - 1 ? e = e.substring(0, t + 1) : t === 0 && e.indexOf(".") !== -1 ? e = "/" : t === -1 && (e.indexOf(".") == -1 ? e = `/${e}/` : e = "/"), e.indexOf("/") !== 0 && (e = `/${e}`), e;
13
13
  }
14
- function ft() {
15
- if (!Ee)
14
+ function ut() {
15
+ if (!Ae)
16
16
  return "/";
17
- let s = j().location, e = `${s.protocol}//${s.host}`;
18
- return e += Wr(s.pathname), e;
17
+ let s = T().location, e = `${s.protocol}//${s.host}`;
18
+ return e += zr(s.pathname), e;
19
19
  }
20
20
  function $t(s, e, t) {
21
21
  s.addEventListener ? s.addEventListener(e, t, !1) : s.attachEvent ? s.attachEvent(`on${e}`, t) : s[`on${e}`] = t;
@@ -23,12 +23,12 @@ function $t(s, e, t) {
23
23
  function Tt(s, e, t) {
24
24
  s.removeEventListener ? s.removeEventListener(e, t) : s.detachEvent ? s.detachEvent(`on${e}`, t) : s[`on${e}`] = null;
25
25
  }
26
- const on = Array.isArray, ln = (s) => Nt(s) === "[object Map]", an = (s) => Nt(s) === "[object Set]", fn = (s) => s instanceof Date, R = (s) => typeof s == "function", un = (s) => typeof s == "string", cn = (s) => typeof s == "symbol", zr = (s) => s !== null && typeof s == "object", hn = (s) => zr(s) && R(s.then) && R(s.catch), Jr = (s) => s == null, Gr = Object.prototype.toString, Nt = (s) => Gr.call(s), Qr = (s) => Nt(s) === "[object Object]", Xr = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
27
- function br(s) {
28
- return s.__esModule || Xr && s[Symbol.toStringTag] === "Module";
26
+ const ln = Array.isArray, an = (s) => Nt(s) === "[object Map]", un = (s) => Nt(s) === "[object Set]", fn = (s) => s instanceof Date, S = (s) => typeof s == "function", cn = (s) => typeof s == "string", hn = (s) => typeof s == "symbol", Jr = (s) => s !== null && typeof s == "object", yn = (s) => Jr(s) && S(s.then) && S(s.catch), Gr = (s) => s == null, Qr = Object.prototype.toString, Nt = (s) => Qr.call(s), Xr = (s) => Nt(s) === "[object Object]", Yr = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
27
+ function xr(s) {
28
+ return s.__esModule || Yr && s[Symbol.toStringTag] === "Module";
29
29
  }
30
- const Yr = typeof Promise < "u" && Promise.toString().indexOf("[native code]") !== -1;
31
- function $(...s) {
30
+ const Zr = typeof Promise < "u" && Promise.toString().indexOf("[native code]") !== -1;
31
+ function q(...s) {
32
32
  let e = s[0] !== void 0 && s[0] !== null ? s[0] : {}, t = 1, r = s.length, n = !1;
33
33
  for (typeof e == "boolean" && (n = e, e = s[t] ?? {}, t++), typeof e != "object" && (e = {}); t < r; t++)
34
34
  if (s[t] !== null && s[t] !== void 0) {
@@ -37,8 +37,8 @@ function $(...s) {
37
37
  let a = e[o], l = i[o];
38
38
  if (a !== l)
39
39
  if (n === !0 && l && typeof l == "object") {
40
- let f;
41
- Array.isArray(l) ? f = a && Array.isArray(a) ? a : [] : f = a && typeof a == "object" ? a : {}, e[o] = $(n, f, l);
40
+ let u;
41
+ Array.isArray(l) ? u = a && Array.isArray(a) ? a : [] : u = a && typeof a == "object" ? a : {}, e[o] = q(n, u, l);
42
42
  } else
43
43
  l !== void 0 && (e[o] = l);
44
44
  }
@@ -47,7 +47,7 @@ function $(...s) {
47
47
  }
48
48
  function It(s, e, t = !1) {
49
49
  if (!t)
50
- $(!0, s, e);
50
+ q(!0, s, e);
51
51
  else {
52
52
  if (typeof e != "object")
53
53
  return {};
@@ -56,7 +56,7 @@ function It(s, e, t = !1) {
56
56
  let n = s[r], i = e[r];
57
57
  if (n !== i)
58
58
  if (typeof i == "object") {
59
- if (!Array.isArray(i) && !Qr(i))
59
+ if (!Array.isArray(i) && !Xr(i))
60
60
  continue;
61
61
  n = It(n, i, t), s[r] = n;
62
62
  } else {
@@ -81,21 +81,21 @@ class le {
81
81
  return e >= Number.MAX_VALUE && (le.seed = 0), e;
82
82
  }
83
83
  }
84
- const ut = Yr ? Promise.resolve() : null;
84
+ const ft = Zr ? Promise.resolve() : null;
85
85
  function Ie(s, ...e) {
86
- ut !== null ? e && e.length > 0 ? ut.then(() => {
86
+ ft !== null ? e && e.length > 0 ? ft.then(() => {
87
87
  s(e);
88
- }) : ut.then(s) : e && e.length > 0 ? setTimeout(() => {
88
+ }) : ft.then(s) : e && e.length > 0 ? setTimeout(() => {
89
89
  s(e);
90
90
  }) : setTimeout(s);
91
91
  }
92
- function xr(s) {
92
+ function Rr(s) {
93
93
  return s == null ? !1 : typeof s == "boolean" ? s : typeof s == "string" ? s.toLocaleLowerCase() === "true" : !!s;
94
94
  }
95
- function yn(s) {
95
+ function dn(s) {
96
96
  return typeof s == "number" ? s : Number(s);
97
97
  }
98
- const Zr = {
98
+ const es = {
99
99
  "[object Boolean]": "boolean",
100
100
  "[object Number]": "number",
101
101
  "[object String]": "string",
@@ -107,7 +107,7 @@ const Zr = {
107
107
  };
108
108
  function zt(s) {
109
109
  let t = Object.prototype.toString.call(s);
110
- return s == null ? String(s) : Zr[t] || "object";
110
+ return s == null ? String(s) : es[t] || "object";
111
111
  }
112
112
  function Jt(s, e) {
113
113
  if (s == e)
@@ -122,8 +122,8 @@ function Jt(s, e) {
122
122
  if (n.length !== i.length)
123
123
  return !1;
124
124
  for (let o = 0; o < n.length; o++) {
125
- let a = n[o], l = s[a], f = e[a];
126
- if (!Jt(l, f))
125
+ let a = n[o], l = s[a], u = e[a];
126
+ if (!Jt(l, u))
127
127
  return !1;
128
128
  }
129
129
  return !0;
@@ -139,19 +139,19 @@ function Jt(s, e) {
139
139
  }
140
140
  return !1;
141
141
  }
142
- const Rr = (s) => {
142
+ const Sr = (s) => {
143
143
  const e = {};
144
144
  for (let t of Reflect.ownKeys(s)) {
145
145
  let r = s[t];
146
- r && !Array.isArray(r) && typeof r == "object" && (r = Rr(r)), typeof t == "symbol" ? e[String(t)] = r : e[t] = r;
146
+ r && !Array.isArray(r) && typeof r == "object" && (r = Sr(r)), typeof t == "symbol" ? e[String(t)] = r : e[t] = r;
147
147
  }
148
148
  return e;
149
- }, es = /^Symbol\((.*)\)$/, Sr = (s) => {
149
+ }, ts = /^Symbol\((.*)\)$/, Pr = (s) => {
150
150
  const e = {};
151
151
  for (let t of Reflect.ownKeys(s)) {
152
152
  let r = s[t];
153
- r && !Array.isArray(r) && typeof r == "object" && (r = Sr(r));
154
- const n = es.exec(t);
153
+ r && !Array.isArray(r) && typeof r == "object" && (r = Pr(r));
154
+ const n = ts.exec(t);
155
155
  if (n && n[1]) {
156
156
  const i = Symbol.for(n[1]);
157
157
  e[i] = r;
@@ -160,7 +160,7 @@ const Rr = (s) => {
160
160
  }
161
161
  return e;
162
162
  }, Gt = Symbol("idKey"), pe = Symbol("valueKey"), x = Symbol("childrenKey"), Q = Symbol("growKey");
163
- class Pr {
163
+ class Cr {
164
164
  /**
165
165
  * 自动创建解决策略
166
166
  */
@@ -172,7 +172,7 @@ class Pr {
172
172
  /**
173
173
  * value
174
174
  */
175
- [pe] = gr();
175
+ [pe] = wr();
176
176
  /**
177
177
  * children
178
178
  */
@@ -185,7 +185,7 @@ class Pr {
185
185
  this[Gt] = e;
186
186
  }
187
187
  }
188
- class ts {
188
+ class rs {
189
189
  /**
190
190
  * 拦截get操作
191
191
  * @param target
@@ -210,7 +210,7 @@ class ts {
210
210
  * @returns
211
211
  */
212
212
  set(e, t, r) {
213
- return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[Q] = xr(r), !0) : r == null ? (e[x].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
213
+ return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[Q] = Rr(r), !0) : r == null ? (e[x].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
214
214
  }
215
215
  /**
216
216
  * 拦截删除property属性
@@ -224,13 +224,13 @@ class ts {
224
224
  }
225
225
  const Ht = "__proxy__";
226
226
  function Dt(s) {
227
- const e = new Pr(s);
228
- return Reflect.set(e, Ht, new Proxy(e, new ts())), e;
227
+ const e = new Cr(s);
228
+ return Reflect.set(e, Ht, new Proxy(e, new rs())), e;
229
229
  }
230
230
  function He(s) {
231
231
  return Reflect.get(s, Ht);
232
232
  }
233
- class rs {
233
+ class ss {
234
234
  /**
235
235
  * 名称
236
236
  */
@@ -257,7 +257,7 @@ class rs {
257
257
  * @param options
258
258
  */
259
259
  constructor(e = {}) {
260
- if (e.persistPolicy && e.persistPolicy !== "momery" && Jr(e.name))
260
+ if (e.persistPolicy && e.persistPolicy !== "momery" && Gr(e.name))
261
261
  throw new Error("name can not be empty, where persistPolicy is not momery.");
262
262
  this.name = e.name ?? "", this.persistPolicy = e.persistPolicy ?? "momery", this.storage = e.storage;
263
263
  }
@@ -278,8 +278,8 @@ class rs {
278
278
  let e = null;
279
279
  if (this.persistPolicy === "custom")
280
280
  e = this.storage;
281
- else if (Ee) {
282
- const t = j();
281
+ else if (Ae) {
282
+ const t = T();
283
283
  e = this.persistPolicy === "session" ? t.sessionStorage : t.localStorage;
284
284
  }
285
285
  return e;
@@ -365,7 +365,7 @@ class rs {
365
365
  }
366
366
  }
367
367
  }
368
- class Cr extends Pr {
368
+ class Ar extends Cr {
369
369
  /**
370
370
  * 持久化处理器
371
371
  */
@@ -374,7 +374,7 @@ class Cr extends Pr {
374
374
  * 默认构造函数
375
375
  */
376
376
  constructor(e = {}) {
377
- super("__root__"), this._persistHandler = new rs(e), this._persistHandler.init(this);
377
+ super("__root__"), this._persistHandler = new ss(e), this._persistHandler.init(this);
378
378
  }
379
379
  /**
380
380
  * 加入数据
@@ -458,11 +458,11 @@ class Cr extends Pr {
458
458
  this[x].clear(), this._persistHandler.clear();
459
459
  }
460
460
  }
461
- const ss = ["put", "get", "contains", "remove", "clear", "_persistHandler"];
461
+ const ns = ["put", "get", "contains", "remove", "clear", "_persistHandler"];
462
462
  function Qt(s) {
463
- return ss.includes(s);
463
+ return ns.includes(s);
464
464
  }
465
- class ns {
465
+ class is {
466
466
  /**
467
467
  * 拦截get操作
468
468
  * @param target
@@ -491,7 +491,7 @@ class ns {
491
491
  * @returns
492
492
  */
493
493
  set(e, t, r) {
494
- return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[Q] = xr(r), !0) : Qt(t) ? !1 : r == null ? (e[x].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
494
+ return t == "value" ? (e[pe].value = r, !0) : t === "grow" ? (e[Q] = Rr(r), !0) : Qt(t) ? !1 : r == null ? (e[x].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
495
495
  }
496
496
  /**
497
497
  * 拦截删除property属性
@@ -503,11 +503,11 @@ class ns {
503
503
  return t === "value" || t == "grow" ? (console.error(`can not delete property:${String(t)}`), !1) : (e[x].delete(t), !0);
504
504
  }
505
505
  }
506
- function is(s) {
507
- const e = new Cr(s), t = new ns(), r = new Proxy(e, t);
506
+ function os(s) {
507
+ const e = new Ar(s), t = new is(), r = new Proxy(e, t);
508
508
  return Reflect.set(e, Ht, r), e;
509
509
  }
510
- const Xt = new Proxy(Cr, {
510
+ const Xt = new Proxy(Ar, {
511
511
  /**
512
512
  * 拦截构造函数
513
513
  * @param target
@@ -515,7 +515,7 @@ const Xt = new Proxy(Cr, {
515
515
  * @returns
516
516
  */
517
517
  construct(s, e) {
518
- const t = is(e[0] ?? {});
518
+ const t = os(e[0] ?? {});
519
519
  return He(t);
520
520
  }
521
521
  }), te = "default", Er = Symbol("sync"), I = Symbol("resolveRoute");
@@ -526,11 +526,11 @@ function Yt(s) {
526
526
  return e = !0, Reflect.apply(s, {}, t);
527
527
  };
528
528
  }
529
- function os(s) {
529
+ function ls(s) {
530
530
  let e = s.src;
531
531
  return new Promise((t, r) => {
532
532
  const n = Yt((a) => {
533
- br(a) && (a = a.default), s.component = a, console.debug("success load async module"), t();
533
+ xr(a) && (a = a.default), s.component = a, console.debug("success load async module"), t();
534
534
  }), i = Yt((a) => {
535
535
  console.debug("reject load async module"), r(a);
536
536
  });
@@ -549,7 +549,7 @@ function os(s) {
549
549
  }
550
550
  });
551
551
  }
552
- class ls {
552
+ class as {
553
553
  /**
554
554
  * 插槽名称
555
555
  */
@@ -608,10 +608,10 @@ class tt {
608
608
  */
609
609
  static from(e) {
610
610
  let t = new tt(e.to, e.from), r = e.data ?? {};
611
- return $(!0, t.data, r), t;
611
+ return q(!0, t.data, r), t;
612
612
  }
613
613
  }
614
- class q {
614
+ class R {
615
615
  /**
616
616
  * 路径
617
617
  */
@@ -643,6 +643,10 @@ class q {
643
643
  * 查询
644
644
  */
645
645
  query;
646
+ /**
647
+ * 无痕迹模式
648
+ */
649
+ traceless;
646
650
  /**
647
651
  * 模版path(设置了该属性后,设置了template属性后,会使用template指向的ruteModel作为模版创建新的ruote页面)
648
652
  */
@@ -701,7 +705,7 @@ class q {
701
705
  * @param plain 是否只克隆plain对象
702
706
  */
703
707
  static clone(e, t) {
704
- let r = new q();
708
+ let r = new R();
705
709
  return It(r, e, t), r;
706
710
  }
707
711
  /**
@@ -713,6 +717,15 @@ class q {
713
717
  static isSame(e, t) {
714
718
  return e === t ? !0 : !(e == null || t == null || e.path && e.path !== t.path || e.name && e.name !== t.name || e.root !== t.root || e.index !== t.index);
715
719
  }
720
+ /**
721
+ * 判断路由的路径是否相同
722
+ * @param x
723
+ * @param y
724
+ * @returns
725
+ */
726
+ static isSameForRoute(e, t) {
727
+ return e === t ? !0 : !(e == null || t == null || e.path && e.path !== t.path || e.name && e.name !== t.name || e.root !== t.root);
728
+ }
716
729
  /**
717
730
  * 判断路由对应的route model是否一致
718
731
  * @param x
@@ -728,7 +741,7 @@ class q {
728
741
  * @returns
729
742
  */
730
743
  static from(e) {
731
- let t = new q();
744
+ let t = new R();
732
745
  if (e == null)
733
746
  return t;
734
747
  let r = t;
@@ -743,7 +756,7 @@ class q {
743
756
  return t;
744
757
  }
745
758
  }
746
- class as {
759
+ class us {
747
760
  /**
748
761
  * 唯一ID(用于区分model)
749
762
  */
@@ -789,7 +802,7 @@ class as {
789
802
  * 解析组件
790
803
  */
791
804
  resolve() {
792
- return os(this);
805
+ return ls(this);
793
806
  }
794
807
  }
795
808
  class Zt {
@@ -914,8 +927,8 @@ class rt {
914
927
  try {
915
928
  let o = !1, a = {
916
929
  //go
917
- go: (l, ...f) => {
918
- o || (o = !0, Reflect.apply(this[ee], this, [l, ...f]));
930
+ go: (l, ...u) => {
931
+ o || (o = !0, Reflect.apply(this[ee], this, [l, ...u]));
919
932
  },
920
933
  //resolve
921
934
  resolve: (...l) => {
@@ -1159,7 +1172,7 @@ class er {
1159
1172
  }
1160
1173
  }
1161
1174
  const _e = Symbol("registerKey");
1162
- class us {
1175
+ class cs {
1163
1176
  /**
1164
1177
  * 数据列表
1165
1178
  */
@@ -1208,12 +1221,12 @@ function st(s, e = !1) {
1208
1221
  if (Reflect.has(t, de))
1209
1222
  return t[de];
1210
1223
  if (e) {
1211
- const r = new us();
1224
+ const r = new cs();
1212
1225
  return t[de] = r, r;
1213
1226
  }
1214
1227
  return null;
1215
1228
  }
1216
- function Ar(s, e = !1) {
1229
+ function Fr(s, e = !1) {
1217
1230
  let t = null, r = s;
1218
1231
  for (; r && !(Reflect.has(r, de) && (t = r[de], t)); )
1219
1232
  r = r.$parent;
@@ -1223,7 +1236,7 @@ function Ar(s, e = !1) {
1223
1236
  }
1224
1237
  return t;
1225
1238
  }
1226
- function Fr(s, e) {
1239
+ function _r(s, e) {
1227
1240
  let t = s;
1228
1241
  for (; t; ) {
1229
1242
  if (Reflect.has(t, de)) {
@@ -1235,11 +1248,11 @@ function Fr(s, e) {
1235
1248
  }
1236
1249
  return null;
1237
1250
  }
1238
- function dn(s, e, t) {
1239
- Ar(s, !0)?.set(e, t);
1251
+ function pn(s, e, t) {
1252
+ Fr(s, !0)?.set(e, t);
1240
1253
  }
1241
- function pn(s, e) {
1242
- Ar(s, !0)?.delete(e);
1254
+ function mn(s, e) {
1255
+ Fr(s, !0)?.delete(e);
1243
1256
  }
1244
1257
  function tr(s) {
1245
1258
  if (Array.isArray(s.children) && s.children.length > 0) {
@@ -1250,7 +1263,7 @@ function tr(s) {
1250
1263
  return null;
1251
1264
  }
1252
1265
  const nt = Symbol("hooksKey");
1253
- function cs(s) {
1266
+ function hs(s) {
1254
1267
  let e = s.get(nt);
1255
1268
  e || (e = [], s.set(nt, e));
1256
1269
  }
@@ -1268,7 +1281,7 @@ function rr(s, e) {
1268
1281
  }
1269
1282
  }
1270
1283
  var qt = /* @__PURE__ */ ((s) => (s.DEACTIVATED = "da", s.ACTIVATED = "a", s))(qt || {});
1271
- class hs {
1284
+ class ys {
1272
1285
  /**
1273
1286
  * 类型
1274
1287
  */
@@ -1291,11 +1304,11 @@ class hs {
1291
1304
  this.target = r, this.hook = t, this.type = e;
1292
1305
  }
1293
1306
  }
1294
- function ys(s, e, t, r) {
1295
- let n = new hs(e, t, r);
1307
+ function ds(s, e, t, r) {
1308
+ let n = new ys(e, t, r);
1296
1309
  return s.push(n), !0;
1297
1310
  }
1298
- function ds(s, e, t, r) {
1311
+ function ps(s, e, t, r) {
1299
1312
  let n = -1;
1300
1313
  for (let i = 0; i < s.length; i++) {
1301
1314
  let o = s[i];
@@ -1306,7 +1319,7 @@ function ds(s, e, t, r) {
1306
1319
  }
1307
1320
  return n != -1 ? (s.splice(n, 1), !0) : !1;
1308
1321
  }
1309
- function _r(s) {
1322
+ function Kr(s) {
1310
1323
  return (e, t) => {
1311
1324
  let r;
1312
1325
  if (t)
@@ -1319,20 +1332,20 @@ function _r(s) {
1319
1332
  }
1320
1333
  r = i.proxy;
1321
1334
  }
1322
- const n = Fr(r, nt);
1335
+ const n = _r(r, nt);
1323
1336
  if (n == null) {
1324
1337
  console.warn("can not get hooks context");
1325
1338
  return;
1326
1339
  }
1327
1340
  it(() => {
1328
- ds(n, s, e, r);
1329
- }), ys(n, s, e, r);
1341
+ ps(n, s, e, r);
1342
+ }), ds(n, s, e, r);
1330
1343
  };
1331
1344
  }
1332
- const mn = _r(
1345
+ const vn = Kr(
1333
1346
  "a"
1334
1347
  /* ACTIVATED */
1335
- ), vn = _r(
1348
+ ), gn = Kr(
1336
1349
  "da"
1337
1350
  /* DEACTIVATED */
1338
1351
  ), jt = Symbol("routeKey");
@@ -1340,11 +1353,11 @@ function sr(s, e) {
1340
1353
  s.set(jt, e);
1341
1354
  }
1342
1355
  function Vt(s) {
1343
- let e = Fr(s, jt);
1356
+ let e = _r(s, jt);
1344
1357
  return typeof e == "function" ? e() : e ?? null;
1345
1358
  }
1346
1359
  const ot = Symbol("rk"), yt = Symbol("vd"), nr = Symbol("rv"), dt = Symbol("rvi"), ir = Symbol("pv"), pt = Symbol("pvi");
1347
- function ps(s) {
1360
+ function ms(s) {
1348
1361
  for (var e = [], t = 0; t < s.length; ) {
1349
1362
  var r = s[t];
1350
1363
  if (r === "*" || r === "+" || r === "?") {
@@ -1412,49 +1425,49 @@ function ps(s) {
1412
1425
  }
1413
1426
  return e.push({ type: "END", index: t, value: "" }), e;
1414
1427
  }
1415
- function Kr(s, e) {
1428
+ function $r(s, e) {
1416
1429
  e === void 0 && (e = {});
1417
- for (var t = ps(s), r = e.prefixes, n = r === void 0 ? "./" : r, i = "[^".concat(Re(e.delimiter || "/#?"), "]+?"), o = [], a = 0, l = 0, f = "", u = function(E) {
1430
+ for (var t = ms(s), r = e.prefixes, n = r === void 0 ? "./" : r, i = "[^".concat(Re(e.delimiter || "/#?"), "]+?"), o = [], a = 0, l = 0, u = "", f = function(E) {
1418
1431
  if (l < t.length && t[l].type === E)
1419
1432
  return t[l++].value;
1420
1433
  }, c = function(E) {
1421
- var S = u(E);
1422
- if (S !== void 0)
1423
- return S;
1424
- var P = t[l], k = P.type, L = P.index;
1425
- throw new TypeError("Unexpected ".concat(k, " at ").concat(L, ", expected ").concat(E));
1434
+ var P = f(E);
1435
+ if (P !== void 0)
1436
+ return P;
1437
+ var C = t[l], U = C.type, L = C.index;
1438
+ throw new TypeError("Unexpected ".concat(U, " at ").concat(L, ", expected ").concat(E));
1426
1439
  }, h = function() {
1427
- for (var E = "", S; S = u("CHAR") || u("ESCAPED_CHAR"); )
1428
- E += S;
1440
+ for (var E = "", P; P = f("CHAR") || f("ESCAPED_CHAR"); )
1441
+ E += P;
1429
1442
  return E;
1430
1443
  }; l < t.length; ) {
1431
- var y = u("CHAR"), d = u("NAME"), m = u("PATTERN");
1444
+ var y = f("CHAR"), d = f("NAME"), m = f("PATTERN");
1432
1445
  if (d || m) {
1433
1446
  var p = y || "";
1434
- n.indexOf(p) === -1 && (f += p, p = ""), f && (o.push(f), f = ""), o.push({
1447
+ n.indexOf(p) === -1 && (u += p, p = ""), u && (o.push(u), u = ""), o.push({
1435
1448
  name: d || a++,
1436
1449
  prefix: p,
1437
1450
  suffix: "",
1438
1451
  pattern: m || i,
1439
- modifier: u("MODIFIER") || ""
1452
+ modifier: f("MODIFIER") || ""
1440
1453
  });
1441
1454
  continue;
1442
1455
  }
1443
- var v = y || u("ESCAPED_CHAR");
1456
+ var v = y || f("ESCAPED_CHAR");
1444
1457
  if (v) {
1445
- f += v;
1458
+ u += v;
1446
1459
  continue;
1447
1460
  }
1448
- f && (o.push(f), f = "");
1449
- var g = u("OPEN");
1461
+ u && (o.push(u), u = "");
1462
+ var g = f("OPEN");
1450
1463
  if (g) {
1451
- var p = h(), _ = u("NAME") || "", b = u("PATTERN") || "", K = h();
1464
+ var p = h(), _ = f("NAME") || "", b = f("PATTERN") || "", K = h();
1452
1465
  c("CLOSE"), o.push({
1453
1466
  name: _ || (b ? a++ : ""),
1454
1467
  pattern: _ && !b ? i : b,
1455
1468
  prefix: p,
1456
1469
  suffix: K,
1457
- modifier: u("MODIFIER") || ""
1470
+ modifier: f("MODIFIER") || ""
1458
1471
  });
1459
1472
  continue;
1460
1473
  }
@@ -1462,10 +1475,10 @@ function Kr(s, e) {
1462
1475
  }
1463
1476
  return o;
1464
1477
  }
1465
- function ms(s, e) {
1466
- return vs(Kr(s, e), e);
1467
- }
1468
1478
  function vs(s, e) {
1479
+ return gs($r(s, e), e);
1480
+ }
1481
+ function gs(s, e) {
1469
1482
  e === void 0 && (e = {});
1470
1483
  var t = Bt(e), r = e.encode, n = r === void 0 ? function(l) {
1471
1484
  return l;
@@ -1474,10 +1487,10 @@ function vs(s, e) {
1474
1487
  return new RegExp("^(?:".concat(l.pattern, ")$"), t);
1475
1488
  });
1476
1489
  return function(l) {
1477
- for (var f = "", u = 0; u < s.length; u++) {
1478
- var c = s[u];
1490
+ for (var u = "", f = 0; f < s.length; f++) {
1491
+ var c = s[f];
1479
1492
  if (typeof c == "string") {
1480
- f += c;
1493
+ u += c;
1481
1494
  continue;
1482
1495
  }
1483
1496
  var h = l ? l[c.name] : void 0, y = c.modifier === "?" || c.modifier === "*", d = c.modifier === "*" || c.modifier === "+";
@@ -1491,17 +1504,17 @@ function vs(s, e) {
1491
1504
  }
1492
1505
  for (var m = 0; m < h.length; m++) {
1493
1506
  var p = n(h[m], c);
1494
- if (o && !a[u].test(p))
1507
+ if (o && !a[f].test(p))
1495
1508
  throw new TypeError('Expected all "'.concat(c.name, '" to match "').concat(c.pattern, '", but got "').concat(p, '"'));
1496
- f += c.prefix + p + c.suffix;
1509
+ u += c.prefix + p + c.suffix;
1497
1510
  }
1498
1511
  continue;
1499
1512
  }
1500
1513
  if (typeof h == "string" || typeof h == "number") {
1501
1514
  var p = n(String(h), c);
1502
- if (o && !a[u].test(p))
1515
+ if (o && !a[f].test(p))
1503
1516
  throw new TypeError('Expected "'.concat(c.name, '" to match "').concat(c.pattern, '", but got "').concat(p, '"'));
1504
- f += c.prefix + p + c.suffix;
1517
+ u += c.prefix + p + c.suffix;
1505
1518
  continue;
1506
1519
  }
1507
1520
  if (!y) {
@@ -1509,14 +1522,14 @@ function vs(s, e) {
1509
1522
  throw new TypeError('Expected "'.concat(c.name, '" to be ').concat(v));
1510
1523
  }
1511
1524
  }
1512
- return f;
1525
+ return u;
1513
1526
  };
1514
1527
  }
1515
- function gs(s, e) {
1516
- var t = [], r = $r(s, t, e);
1517
- return ws(r, t, e);
1528
+ function ws(s, e) {
1529
+ var t = [], r = Tr(s, t, e);
1530
+ return bs(r, t, e);
1518
1531
  }
1519
- function ws(s, e, t) {
1532
+ function bs(s, e, t) {
1520
1533
  t === void 0 && (t = {});
1521
1534
  var r = t.decode, n = r === void 0 ? function(i) {
1522
1535
  return i;
@@ -1525,16 +1538,16 @@ function ws(s, e, t) {
1525
1538
  var o = s.exec(i);
1526
1539
  if (!o)
1527
1540
  return !1;
1528
- for (var a = o[0], l = o.index, f = /* @__PURE__ */ Object.create(null), u = function(h) {
1541
+ for (var a = o[0], l = o.index, u = /* @__PURE__ */ Object.create(null), f = function(h) {
1529
1542
  if (o[h] === void 0)
1530
1543
  return "continue";
1531
1544
  var y = e[h - 1];
1532
- y.modifier === "*" || y.modifier === "+" ? f[y.name] = o[h].split(y.prefix + y.suffix).map(function(d) {
1545
+ y.modifier === "*" || y.modifier === "+" ? u[y.name] = o[h].split(y.prefix + y.suffix).map(function(d) {
1533
1546
  return n(d, y);
1534
- }) : f[y.name] = n(o[h], y);
1547
+ }) : u[y.name] = n(o[h], y);
1535
1548
  }, c = 1; c < o.length; c++)
1536
- u(c);
1537
- return { path: a, index: l, params: f };
1549
+ f(c);
1550
+ return { path: a, index: l, params: u };
1538
1551
  };
1539
1552
  }
1540
1553
  function Re(s) {
@@ -1543,7 +1556,7 @@ function Re(s) {
1543
1556
  function Bt(s) {
1544
1557
  return s && s.sensitive ? "" : "i";
1545
1558
  }
1546
- function bs(s, e) {
1559
+ function xs(s, e) {
1547
1560
  if (!e)
1548
1561
  return s;
1549
1562
  for (var t = /\((?:\?<(.*?)>)?(?!\?)/g, r = 0, n = t.exec(s.source); n; )
@@ -1557,30 +1570,30 @@ function bs(s, e) {
1557
1570
  }), n = t.exec(s.source);
1558
1571
  return s;
1559
1572
  }
1560
- function xs(s, e, t) {
1573
+ function Rs(s, e, t) {
1561
1574
  var r = s.map(function(n) {
1562
- return $r(n, e, t).source;
1575
+ return Tr(n, e, t).source;
1563
1576
  });
1564
1577
  return new RegExp("(?:".concat(r.join("|"), ")"), Bt(t));
1565
1578
  }
1566
- function Rs(s, e, t) {
1567
- return Ss(Kr(s, t), e, t);
1568
- }
1569
1579
  function Ss(s, e, t) {
1580
+ return Ps($r(s, t), e, t);
1581
+ }
1582
+ function Ps(s, e, t) {
1570
1583
  t === void 0 && (t = {});
1571
- for (var r = t.strict, n = r === void 0 ? !1 : r, i = t.start, o = i === void 0 ? !0 : i, a = t.end, l = a === void 0 ? !0 : a, f = t.encode, u = f === void 0 ? function(L) {
1584
+ for (var r = t.strict, n = r === void 0 ? !1 : r, i = t.start, o = i === void 0 ? !0 : i, a = t.end, l = a === void 0 ? !0 : a, u = t.encode, f = u === void 0 ? function(L) {
1572
1585
  return L;
1573
- } : f, c = t.delimiter, h = c === void 0 ? "/#?" : c, y = t.endsWith, d = y === void 0 ? "" : y, m = "[".concat(Re(d), "]|$"), p = "[".concat(Re(h), "]"), v = o ? "^" : "", g = 0, _ = s; g < _.length; g++) {
1586
+ } : u, c = t.delimiter, h = c === void 0 ? "/#?" : c, y = t.endsWith, d = y === void 0 ? "" : y, m = "[".concat(Re(d), "]|$"), p = "[".concat(Re(h), "]"), v = o ? "^" : "", g = 0, _ = s; g < _.length; g++) {
1574
1587
  var b = _[g];
1575
1588
  if (typeof b == "string")
1576
- v += Re(u(b));
1589
+ v += Re(f(b));
1577
1590
  else {
1578
- var K = Re(u(b.prefix)), E = Re(u(b.suffix));
1591
+ var K = Re(f(b.prefix)), E = Re(f(b.suffix));
1579
1592
  if (b.pattern)
1580
1593
  if (e && e.push(b), K || E)
1581
1594
  if (b.modifier === "+" || b.modifier === "*") {
1582
- var S = b.modifier === "*" ? "?" : "";
1583
- v += "(?:".concat(K, "((?:").concat(b.pattern, ")(?:").concat(E).concat(K, "(?:").concat(b.pattern, "))*)").concat(E, ")").concat(S);
1595
+ var P = b.modifier === "*" ? "?" : "";
1596
+ v += "(?:".concat(K, "((?:").concat(b.pattern, ")(?:").concat(E).concat(K, "(?:").concat(b.pattern, "))*)").concat(E, ")").concat(P);
1584
1597
  } else
1585
1598
  v += "(?:".concat(K, "(").concat(b.pattern, ")").concat(E, ")").concat(b.modifier);
1586
1599
  else
@@ -1592,15 +1605,15 @@ function Ss(s, e, t) {
1592
1605
  if (l)
1593
1606
  n || (v += "".concat(p, "?")), v += t.endsWith ? "(?=".concat(m, ")") : "$";
1594
1607
  else {
1595
- var P = s[s.length - 1], k = typeof P == "string" ? p.indexOf(P[P.length - 1]) > -1 : P === void 0;
1596
- n || (v += "(?:".concat(p, "(?=").concat(m, "))?")), k || (v += "(?=".concat(p, "|").concat(m, ")"));
1608
+ var C = s[s.length - 1], U = typeof C == "string" ? p.indexOf(C[C.length - 1]) > -1 : C === void 0;
1609
+ n || (v += "(?:".concat(p, "(?=").concat(m, "))?")), U || (v += "(?=".concat(p, "|").concat(m, ")"));
1597
1610
  }
1598
1611
  return new RegExp(v, Bt(t));
1599
1612
  }
1600
- function $r(s, e, t) {
1601
- return s instanceof RegExp ? bs(s, e) : Array.isArray(s) ? xs(s, e, t) : Rs(s, e, t);
1613
+ function Tr(s, e, t) {
1614
+ return s instanceof RegExp ? xs(s, e) : Array.isArray(s) ? Rs(s, e, t) : Ss(s, e, t);
1602
1615
  }
1603
- var A = /* @__PURE__ */ ((s) => (s[s.Push = 0] = "Push", s[s.Replace = 1] = "Replace", s[s.Put = 2] = "Put", s[s.Append = 3] = "Append", s[s.Open = 4] = "Open", s))(A || {}), Ye = /* @__PURE__ */ ((s) => (s[s.Part = 0] = "Part", s[s.All = 1] = "All", s))(Ye || {});
1616
+ var $ = /* @__PURE__ */ ((s) => (s[s.Push = 0] = "Push", s[s.Replace = 1] = "Replace", s[s.Put = 2] = "Put", s[s.Append = 3] = "Append", s[s.Open = 4] = "Open", s))($ || {}), Ye = /* @__PURE__ */ ((s) => (s[s.Part = 0] = "Part", s[s.All = 1] = "All", s))(Ye || {});
1604
1617
  const J = Symbol("rootKey"), z = Symbol("rootNodeKey"), ye = Symbol("parentNodeKey"), Ze = Symbol("nameKey");
1605
1618
  class ne {
1606
1619
  /**
@@ -1643,7 +1656,7 @@ class Ke {
1643
1656
  * getter for models
1644
1657
  */
1645
1658
  get slots() {
1646
- return this._slots == null && (this._slots = kr([])), this._slots;
1659
+ return this._slots == null && (this._slots = Wr([])), this._slots;
1647
1660
  }
1648
1661
  /**
1649
1662
  * 是否为空视图
@@ -1725,13 +1738,13 @@ class mt {
1725
1738
  */
1726
1739
  views = [];
1727
1740
  }
1728
- class Ps {
1741
+ class Cs {
1729
1742
  /**
1730
1743
  * 层
1731
1744
  */
1732
1745
  layers = [];
1733
1746
  }
1734
- class Cs {
1747
+ class As {
1735
1748
  /**
1736
1749
  * time
1737
1750
  */
@@ -1749,7 +1762,7 @@ class Es {
1749
1762
  /**
1750
1763
  * 提交路由记录
1751
1764
  */
1752
- submitRecorder = new Cs();
1765
+ submitRecorder = new As();
1753
1766
  /**
1754
1767
  * 判断是否为同一个路由(只判断name、path和root是否一致)
1755
1768
  * @param x
@@ -1794,11 +1807,19 @@ class or {
1794
1807
  this.currentRoute = e, this.routes = t;
1795
1808
  }
1796
1809
  }
1797
- const fe = Symbol("historyChangeConsumerKey"), lr = Symbol("_navigateFirstRoute"), Be = Symbol("_getRouteMark"), vt = Symbol("_getUrlSearch"), gt = Symbol("_generateLocation"), $e = Symbol("_setRouteMarkRecorder"), Te = Symbol("beforeRestoreFiltersKey"), ar = Symbol("_beforeRestore"), fr = "Symbol(_fox_restore_point)";
1810
+ const ue = Symbol("historyChangeConsumerKey"), lr = Symbol("_navigateFirstRoute"), Be = Symbol("_getRouteMark"), vt = Symbol("_getUrlSearch"), gt = Symbol("_generateLocation"), $e = Symbol("_setRouteMarkRecorder"), Te = Symbol("beforeRestoreFiltersKey"), ar = Symbol("_beforeRestore"), ur = "Symbol(_fox_restore_point)";
1798
1811
  function wt(s, ...e) {
1799
1812
  return typeof s == "function" ? Reflect.apply(s, null, [...e]) : s;
1800
1813
  }
1801
- class Tr {
1814
+ function fr(s) {
1815
+ if (!Array.isArray(s))
1816
+ return !1;
1817
+ if (s.length === 0)
1818
+ return !0;
1819
+ const e = s[0];
1820
+ return !!(Reflect.has(e, "path") && Reflect.has(e, "root"));
1821
+ }
1822
+ class qr {
1802
1823
  /**
1803
1824
  * 基础路径
1804
1825
  */
@@ -1838,11 +1859,15 @@ class Tr {
1838
1859
  /**
1839
1860
  * history change消费者标志
1840
1861
  */
1841
- [fe] = !1;
1862
+ [ue] = !1;
1842
1863
  /**
1843
1864
  * before restore 过滤器队列(用于刷新还原)
1844
1865
  */
1845
1866
  [Te] = new Array();
1867
+ /**
1868
+ * 回退timeout
1869
+ */
1870
+ backTimeout = 320;
1846
1871
  /**
1847
1872
  * 构造函数
1848
1873
  * @param mode
@@ -1851,9 +1876,11 @@ class Tr {
1851
1876
  * @param firstNavigate
1852
1877
  * @param historyMonitor
1853
1878
  * @param traceless
1879
+ * @param storage
1880
+ * @param backTimeout
1854
1881
  */
1855
- constructor(e = "hash", t = "", r = "", n = !0, i = !0, o = !1, a) {
1856
- this.mode = e, this.base = t, this.query = r, this.firstNavigate = n, this.historyMonitor = i, this.traceless = o, this.storage = a ?? j().sessionStorage;
1882
+ constructor(e = "hash", t = "", r = "", n = !0, i = !0, o = !1, a, l) {
1883
+ this.mode = e, this.base = t, this.query = r, this.firstNavigate = n, this.historyMonitor = i, this.traceless = o, this.storage = a ?? T().sessionStorage, this.backTimeout = l ?? 320;
1857
1884
  }
1858
1885
  /**
1859
1886
  * 初始化
@@ -1861,14 +1888,14 @@ class Tr {
1861
1888
  * @returns
1862
1889
  */
1863
1890
  init(e = !0) {
1864
- const t = j();
1891
+ const t = T();
1865
1892
  return typeof this.historyChange != "function" && (this.historyChange = () => {
1866
- if (typeof this[fe] == "function") {
1867
- const r = this[fe]();
1868
- if (this[fe] = !1, r)
1893
+ if (typeof this[ue] == "function") {
1894
+ const r = this[ue]();
1895
+ if (this[ue] = !1, r)
1869
1896
  return;
1870
- } else if (this[fe] === !0) {
1871
- this[fe] = !1;
1897
+ } else if (this[ue] === !0) {
1898
+ this[ue] = !1;
1872
1899
  return;
1873
1900
  }
1874
1901
  if (wt(this.historyMonitor)) {
@@ -1890,7 +1917,7 @@ class Tr {
1890
1917
  */
1891
1918
  destroy() {
1892
1919
  if (this.historyChange) {
1893
- const e = j();
1920
+ const e = T();
1894
1921
  Tt(e, "popstate", this.historyChange);
1895
1922
  }
1896
1923
  }
@@ -1932,15 +1959,15 @@ class Tr {
1932
1959
  * 导航到第一个route
1933
1960
  */
1934
1961
  [lr]() {
1935
- const e = this[Be]() ?? "/", t = this.storage.getItem(fr);
1962
+ const e = this[Be]() ?? "/", t = this.storage.getItem(ur);
1936
1963
  if (t)
1937
1964
  try {
1938
1965
  const o = JSON.parse(t);
1939
1966
  if (o.mark === e && Array.isArray(o.routes) && o.routes.length > 0) {
1940
- const a = o.routes.filter((l, f) => (l.params = l.params ? Sr(l.params) : {}, this[ar](l, f, e, o.routes)));
1967
+ const a = o.routes.filter((l, u) => (l.params = l.params ? Pr(l.params) : {}, this[ar](l, u, e, o.routes)));
1941
1968
  if (a.length > 0) {
1942
- const l = this[vt](), f = a.length - 1;
1943
- a[f].query = l || a[f].query, this[Se](a);
1969
+ const l = this[vt](), u = a.length - 1;
1970
+ a[u].query = l || a[u].query, this[Se](a);
1944
1971
  return;
1945
1972
  }
1946
1973
  }
@@ -1949,7 +1976,7 @@ class Tr {
1949
1976
  const r = e.indexOf("!");
1950
1977
  let n;
1951
1978
  r != -1 ? n = e.substring(r + 1) : n = e;
1952
- const i = new q();
1979
+ const i = new R();
1953
1980
  i.path = n, i.query = this[vt](), this[Se]([i]);
1954
1981
  }
1955
1982
  /**
@@ -1960,13 +1987,13 @@ class Tr {
1960
1987
  [$e](e, t) {
1961
1988
  try {
1962
1989
  t.forEach((i) => {
1963
- i.params = i.params ? Rr(i.params) : {};
1990
+ i.params = i.params ? Sr(i.params) : {};
1964
1991
  });
1965
1992
  const n = JSON.stringify({
1966
1993
  mark: e,
1967
1994
  routes: t
1968
1995
  });
1969
- this.storage.setItem(fr, n);
1996
+ this.storage.setItem(ur, n);
1970
1997
  } catch (r) {
1971
1998
  console.error(r.message, r);
1972
1999
  }
@@ -1990,7 +2017,7 @@ class Tr {
1990
2017
  * 获取当前标志
1991
2018
  */
1992
2019
  [Be]() {
1993
- const e = j();
2020
+ const e = T();
1994
2021
  if (this.mode === "path") {
1995
2022
  let t = e.location.pathname;
1996
2023
  return this.base && t.indexOf(this.base) === 0 && (t = t.substring(this.base.length)), t;
@@ -2005,7 +2032,7 @@ class Tr {
2005
2032
  * 获取当前search
2006
2033
  */
2007
2034
  [vt]() {
2008
- let t = j().location.search;
2035
+ let t = T().location.search;
2009
2036
  return t.length > 0 && t.indexOf("?") === 0 && (t = t.substring(1)), t;
2010
2037
  }
2011
2038
  /**
@@ -2021,8 +2048,63 @@ class Tr {
2021
2048
  * @param consume
2022
2049
  */
2023
2050
  go(e, t = !1) {
2024
- const r = j();
2025
- this[fe] = t, r.history.go(e);
2051
+ const r = T();
2052
+ this[ue] = t, r.history.go(e);
2053
+ }
2054
+ /**
2055
+ * 回退到指定路由
2056
+ * @param target
2057
+ * @param trigger
2058
+ */
2059
+ goBack(e, t) {
2060
+ const r = T(), n = r.history.state;
2061
+ if (fr(n) && n.length > 0) {
2062
+ let i = 0;
2063
+ if (e === null)
2064
+ i = n.length;
2065
+ else
2066
+ for (let c = n.length - 1; c >= 0; c--) {
2067
+ const h = R.from(n[c]);
2068
+ if (R.isSameForRoute(h, e))
2069
+ break;
2070
+ i++;
2071
+ }
2072
+ let o = n.length - i;
2073
+ if (e !== null && o === 0) {
2074
+ t();
2075
+ return;
2076
+ }
2077
+ const a = this.backTimeout;
2078
+ let l = null;
2079
+ const u = () => {
2080
+ r.history.go(-1), l = setTimeout(u, a);
2081
+ };
2082
+ l = setTimeout(u, a);
2083
+ const f = () => {
2084
+ clearTimeout(l);
2085
+ const h = T().history.state;
2086
+ if (fr(h) && h.length > 0) {
2087
+ let y = h.length;
2088
+ const d = h[y - 1], m = R.from(d);
2089
+ if (e == null || R.isSameForRoute(m, e))
2090
+ return t(), !0;
2091
+ if (y > o) {
2092
+ let p = 0;
2093
+ for (let v = y - 1; v >= 0; v--) {
2094
+ const g = R.from(h[v]);
2095
+ if (R.isSameForRoute(g, e))
2096
+ break;
2097
+ p++;
2098
+ }
2099
+ if (o = y - p, o > 0)
2100
+ return l = setTimeout(u, a), this.go(-p, f), !0;
2101
+ }
2102
+ }
2103
+ return t(), !0;
2104
+ };
2105
+ this.go(-i, f);
2106
+ } else
2107
+ t();
2026
2108
  }
2027
2109
  /**
2028
2110
  * 加入记录
@@ -2030,7 +2112,7 @@ class Tr {
2030
2112
  */
2031
2113
  push(e) {
2032
2114
  const t = this[gt](e.currentRoute);
2033
- wt(this.traceless, e.currentRoute) || j().history.pushState(e.routes, "", t);
2115
+ e.currentRoute.traceless !== !0 && !wt(this.traceless, e.currentRoute) && T().history.pushState(e.routes, "", t);
2034
2116
  const r = e.currentRoute.fullPath;
2035
2117
  this[$e](r, e.routes);
2036
2118
  }
@@ -2040,7 +2122,7 @@ class Tr {
2040
2122
  */
2041
2123
  replace(e) {
2042
2124
  const t = this[gt](e.currentRoute);
2043
- wt(this.traceless, e.currentRoute) || j().history.replaceState(e.routes, "", t);
2125
+ e.currentRoute.traceless !== !0 && !wt(this.traceless, e.currentRoute) && T().history.replaceState(e.routes, "", t);
2044
2126
  const r = e.currentRoute.fullPath;
2045
2127
  this[$e](r, e.routes);
2046
2128
  }
@@ -2049,14 +2131,14 @@ class Tr {
2049
2131
  * @param route
2050
2132
  */
2051
2133
  [gt](e) {
2052
- const t = j();
2134
+ const t = T();
2053
2135
  let r = "";
2054
2136
  if (e.query) {
2055
2137
  let a = "";
2056
2138
  if (typeof e.query == "object")
2057
2139
  for (let l of Reflect.ownKeys(e.query)) {
2058
- let f = encodeURIComponent(e.query[l]), u = `${encodeURIComponent(String(l))}=${f}`;
2059
- a.length > 0 && (a += "&"), a += u;
2140
+ let u = encodeURIComponent(e.query[l]), f = `${encodeURIComponent(String(l))}=${u}`;
2141
+ a.length > 0 && (a += "&"), a += f;
2060
2142
  }
2061
2143
  else
2062
2144
  a = e.query;
@@ -2069,13 +2151,13 @@ class Tr {
2069
2151
  return r ? this.mode == "path" ? i.indexOf("/") === 0 ? o = `${this.base}${i}${r}` : o = `${this.base}/${i}${r}` : o = `${n.pathname}${r}#${i}` : this.mode == "path" ? i.indexOf("/") === 0 ? o = `${this.base}${i}` : o = `${this.base}/${i}` : o = `${n.pathname}#${i}`, `${n.origin}${o}`;
2070
2152
  }
2071
2153
  }
2072
- function gn(s = !0, e = null, t = "", r = !0, n = !1, i) {
2073
- return e !== null && (e = j().location.pathname), e && e.endsWith("/") && (e = e.substring(0, e.length - 1)), new Tr("path", e ?? "", t, s, r, n, i);
2154
+ function wn(s = !0, e = null, t = "", r = !0, n = !1, i) {
2155
+ return e !== null && (e = T().location.pathname), e && e.endsWith("/") && (e = e.substring(0, e.length - 1)), new qr("path", e ?? "", t, s, r, n, i);
2074
2156
  }
2075
- function As(s = !0, e = "", t = !0, r = !1, n) {
2076
- return new Tr("hash", "", e, s, t, r, n);
2157
+ function Fs(s = !0, e = "", t = !0, r = !1, n) {
2158
+ return new qr("hash", "", e, s, t, r, n);
2077
2159
  }
2078
- class Fs {
2160
+ class _s {
2079
2161
  /**
2080
2162
  * 历史最大记录
2081
2163
  */
@@ -2159,7 +2241,7 @@ class Fs {
2159
2241
  * @param consume 是否消费事件
2160
2242
  */
2161
2243
  go(e, t = !1) {
2162
- if (this.queue.length == 0 || this.cursor <= 0 || this.cursor >= this.queue.length - 1)
2244
+ if (this.queue.length == 0 || this.cursor <= 0)
2163
2245
  return;
2164
2246
  let r = this.cursor + e;
2165
2247
  if (r < 0 ? r = 0 : r > this.queue.length - 1 && (r = this.queue.length - 1), r != this.cursor) {
@@ -2171,6 +2253,26 @@ class Fs {
2171
2253
  }
2172
2254
  }
2173
2255
  }
2256
+ /**
2257
+ * 回退到指定路由
2258
+ * @param target
2259
+ * @param trigger
2260
+ */
2261
+ goBack(e, t) {
2262
+ if (this.queue.length == 0 || this.cursor <= 0)
2263
+ return;
2264
+ let r = 0;
2265
+ if (e === null)
2266
+ r = this.cursor + 1;
2267
+ else
2268
+ for (let n = this.cursor; n >= 0; n--) {
2269
+ r++;
2270
+ const i = this.queue[n];
2271
+ if (R.isSameForRoute(i.currentRoute, e))
2272
+ break;
2273
+ }
2274
+ this.go(-r, () => (t(), !0));
2275
+ }
2174
2276
  /**
2175
2277
  * 加入记录
2176
2278
  * @param record
@@ -2194,27 +2296,27 @@ class Fs {
2194
2296
  setRestorePoint(e) {
2195
2297
  }
2196
2298
  }
2197
- function _s(s = "", e = 50) {
2198
- return new Fs(s, e);
2299
+ function Ks(s = "", e = 50) {
2300
+ return new _s(s, e);
2199
2301
  }
2200
- const Ue = Symbol("_constructRouteModel"), ke = Symbol("_findRouteModel"), bt = Symbol("_findRootView"), ur = Symbol("_getFirstView"), ue = Symbol("_removeView"), cr = Symbol("_buildPage"), hr = Symbol("_resolveComponent"), yr = Symbol("_update"), ie = Symbol("_merge"), xt = Symbol("_handleHistoryChange"), We = Symbol("_handleRouteUpdated"), ze = Symbol("routeUpdatedCallback"), w = Symbol("currentRoutes"), ge = Symbol("current"), dr = Symbol("_addRouteRecorder"), qe = Symbol("_removeRouteRecorder"), Je = Symbol("_cloneRouteRecorder"), T = Symbol("_handleError"), Ge = Symbol("errorCallback"), B = Symbol("registerKey"), Qe = Symbol("notFoundKey"), Rt = Symbol("notFoundPathKey"), U = Symbol("forestKey"), C = Symbol("historyKey"), je = Symbol("beforeFiltersKey"), Oe = Symbol("afterFiltersKey"), Le = Symbol("destroyFiltersKey"), St = Symbol("propsFilterKey"), we = Symbol("mainDispatcherKey"), Pt = Symbol("initKey"), ce = Symbol("readyKey"), Ct = Symbol("readyHandlersKey"), Xe = Symbol("_markReady"), pr = Symbol("_createNextFn"), Et = Symbol("_start"), At = Symbol("_before"), Ft = Symbol("_after"), mr = Symbol("_destroy"), _t = Symbol("_load"), Me = Symbol("_unload"), Ne = Symbol("routerGuardKey");
2201
- function Ks(s) {
2302
+ const ke = Symbol("_constructRouteModel"), Ue = Symbol("_findRouteModel"), bt = Symbol("_findRootView"), cr = Symbol("_getFirstView"), fe = Symbol("_removeView"), hr = Symbol("_buildPage"), yr = Symbol("_resolveComponent"), dr = Symbol("_update"), ie = Symbol("_merge"), xt = Symbol("_handleHistoryChange"), We = Symbol("_handleRouteUpdated"), ze = Symbol("routeUpdatedCallback"), w = Symbol("currentRoutes"), ge = Symbol("current"), pr = Symbol("_addRouteRecorder"), qe = Symbol("_removeRouteRecorder"), Je = Symbol("_cloneRouteRecorder"), j = Symbol("_handleError"), Ge = Symbol("errorCallback"), B = Symbol("registerKey"), Qe = Symbol("notFoundKey"), Rt = Symbol("notFoundPathKey"), k = Symbol("forestKey"), A = Symbol("historyKey"), je = Symbol("beforeFiltersKey"), Oe = Symbol("afterFiltersKey"), Le = Symbol("destroyFiltersKey"), St = Symbol("propsFilterKey"), we = Symbol("mainDispatcherKey"), Pt = Symbol("initKey"), ce = Symbol("readyKey"), Ct = Symbol("readyHandlersKey"), Xe = Symbol("_markReady"), mr = Symbol("_createNextFn"), At = Symbol("_start"), Et = Symbol("_before"), Ft = Symbol("_after"), vr = Symbol("_destroy"), _t = Symbol("_load"), Me = Symbol("_unload"), Ne = Symbol("routerGuardKey");
2303
+ function $s(s) {
2202
2304
  return s.layers.length == 0 || s.layers[0].views.length == 0;
2203
2305
  }
2204
- function $s(s) {
2306
+ function Ts(s) {
2205
2307
  let e = [];
2206
2308
  return s.layers.forEach((t) => {
2207
2309
  t.models == null || t.models == null || t.models.forEach((r) => {
2208
2310
  if (!(r == null || r == null))
2209
2311
  if (typeof r.meta == "object") {
2210
- let n = $(!0, {}, r.meta);
2312
+ let n = q(!0, {}, r.meta);
2211
2313
  e.push(n);
2212
2314
  } else
2213
2315
  r.meta && e.push(r.meta);
2214
2316
  });
2215
2317
  }), e;
2216
2318
  }
2217
- class Ts {
2319
+ class qs {
2218
2320
  /**
2219
2321
  * 注册表
2220
2322
  */
@@ -2238,11 +2340,11 @@ class Ts {
2238
2340
  /**
2239
2341
  * 页面根节点
2240
2342
  */
2241
- [U] = new Ps();
2343
+ [k] = new Cs();
2242
2344
  /**
2243
2345
  * 历史记录控制器
2244
2346
  */
2245
- [C];
2347
+ [A];
2246
2348
  /**
2247
2349
  * 当前路由集合
2248
2350
  */
@@ -2286,7 +2388,7 @@ class Ts {
2286
2388
  /**
2287
2389
  * 当前最新路由
2288
2390
  */
2289
- [ge] = gr(null);
2391
+ [ge] = wr(null);
2290
2392
  /**
2291
2393
  * 获取当前最新route
2292
2394
  */
@@ -2302,7 +2404,7 @@ class Ts {
2302
2404
  constructor(e) {
2303
2405
  this.options = e ?? {}, this.options.notFoundPath && this.setNotFoundPath(this.options.notFoundPath);
2304
2406
  let t = this.options.routes || [];
2305
- this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[C] = e.history : this[C] = Ee ? As() : _s(), this[C]?.listen(async (r) => {
2407
+ this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[A] = e.history : this[A] = Ae ? Fs() : Ks(), this[A]?.listen(async (r) => {
2306
2408
  let n = !0;
2307
2409
  try {
2308
2410
  if (typeof r == "string") {
@@ -2321,7 +2423,7 @@ class Ts {
2321
2423
  * @param error
2322
2424
  * @param route
2323
2425
  */
2324
- [T](e = "error", t) {
2426
+ [j](e = "error", t) {
2325
2427
  if (t && typeof t.error == "function")
2326
2428
  try {
2327
2429
  t.error(e);
@@ -2338,7 +2440,7 @@ class Ts {
2338
2440
  * 初始化
2339
2441
  */
2340
2442
  init() {
2341
- this[Pt] !== !0 && (this[C]?.init(!this[ce]), this[Pt] = !0);
2443
+ this[Pt] !== !0 && (this[A]?.init(!this[ce]), this[Pt] = !0);
2342
2444
  }
2343
2445
  /**
2344
2446
  * 第一次导航是否完成
@@ -2368,10 +2470,10 @@ class Ts {
2368
2470
  try {
2369
2471
  if (!e) {
2370
2472
  let o = [...this[w]].reverse();
2371
- return this[Me](o), Ee && j().location.reload(), Promise.resolve();
2473
+ return this[Me](o), Ae && T().location.reload(), Promise.resolve();
2372
2474
  }
2373
2475
  let t = null, r = [], n = [], i = 0;
2374
- for (; i < e.length && i < this[w].length && q.isSame(e[i], this[w][i]); i++)
2476
+ for (; i < e.length && i < this[w].length && R.isSame(e[i], this[w][i]); i++)
2375
2477
  e[i].active === !0 && e[i].active !== this[w][i].active && (t = e[i]);
2376
2478
  if (i < e.length && (r = e.slice(i)), i < this[w].length && (n = this[w].slice(i).reverse()), n.length === 0 && r.length === 0) {
2377
2479
  if (t !== null)
@@ -2386,7 +2488,7 @@ class Ts {
2386
2488
  } else
2387
2489
  return this.restore(r);
2388
2490
  } catch (t) {
2389
- this[T](t);
2491
+ this[j](t);
2390
2492
  }
2391
2493
  return Promise.resolve();
2392
2494
  }
@@ -2411,8 +2513,8 @@ class Ts {
2411
2513
  * 加入路由记录
2412
2514
  * @param route
2413
2515
  */
2414
- [dr](e) {
2415
- if (e.opsType === A.Open) {
2516
+ [pr](e) {
2517
+ if (e.opsType === $.Open) {
2416
2518
  let t = !1;
2417
2519
  const r = this[w].length - 1;
2418
2520
  for (let n = r; n >= 0; n--) {
@@ -2436,7 +2538,7 @@ class Ts {
2436
2538
  [Je]() {
2437
2539
  let e = [];
2438
2540
  for (let t of this[w]) {
2439
- let r = q.clone(t, !0);
2541
+ let r = R.clone(t, !0);
2440
2542
  e.push(r);
2441
2543
  }
2442
2544
  return e;
@@ -2451,38 +2553,38 @@ class Ts {
2451
2553
  return;
2452
2554
  let t = -1;
2453
2555
  for (let r = 0; r < this[w].length; r++)
2454
- if (q.isSame(this[w][r], e)) {
2556
+ if (R.isSame(this[w][r], e)) {
2455
2557
  t = r;
2456
2558
  break;
2457
2559
  }
2458
2560
  if (t != -1) {
2459
2561
  let r = this[w][t];
2460
- this[w].splice(t, 1), this[mr](r, r.session);
2562
+ this[w].splice(t, 1), this[vr](r, r.session);
2461
2563
  }
2462
2564
  }
2463
2565
  /**
2464
2566
  * 设置history monitor是否启动
2465
2567
  */
2466
2568
  set historyMonitor(e) {
2467
- this[C] && (this[C].historyMonitor = e);
2569
+ this[A] && (this[A].historyMonitor = e);
2468
2570
  }
2469
2571
  /**
2470
2572
  * 获取history monitor
2471
2573
  */
2472
2574
  get historyMonitor() {
2473
- return this[C] ? this[C].historyMonitor : !1;
2575
+ return this[A] ? this[A].historyMonitor : !1;
2474
2576
  }
2475
2577
  /**
2476
2578
  * 设置无痕模式,不改变历史记录
2477
2579
  */
2478
2580
  set traceless(e) {
2479
- this[C] && (this[C].traceless = e);
2581
+ this[A] && (this[A].traceless = e);
2480
2582
  }
2481
2583
  /**
2482
2584
  * 获取无痕模式(不改变历史记录)
2483
2585
  */
2484
2586
  get traceless() {
2485
- return this[C] ? this[C].traceless : !1;
2587
+ return this[A] ? this[A].traceless : !1;
2486
2588
  }
2487
2589
  /**
2488
2590
  * 设置属性传递过滤器
@@ -2502,7 +2604,7 @@ class Ts {
2502
2604
  */
2503
2605
  setRestorePoint() {
2504
2606
  const e = this[Je]();
2505
- this[C]?.setRestorePoint(e);
2607
+ this[A]?.setRestorePoint(e);
2506
2608
  }
2507
2609
  /**
2508
2610
  * 注册route updated处理函数
@@ -2570,7 +2672,7 @@ class Ts {
2570
2672
  * @param filter
2571
2673
  */
2572
2674
  beforeRestoreEach(e) {
2573
- this[C]?.beforeRestoreEach(e);
2675
+ this[A]?.beforeRestoreEach(e);
2574
2676
  }
2575
2677
  /**
2576
2678
  * 移除before restore filter
@@ -2578,7 +2680,7 @@ class Ts {
2578
2680
  * @returns
2579
2681
  */
2580
2682
  removeBeforeRestoreEach(e) {
2581
- return this[C]?.removeBeforeRestoreEach(e) ?? !1;
2683
+ return this[A]?.removeBeforeRestoreEach(e) ?? !1;
2582
2684
  }
2583
2685
  /**
2584
2686
  * 加入路由配置列表
@@ -2598,7 +2700,7 @@ class Ts {
2598
2700
  this.setNotFoundRoute(e);
2599
2701
  return;
2600
2702
  }
2601
- const r = this[Ue](e);
2703
+ const r = this[ke](e);
2602
2704
  if (t == -1)
2603
2705
  this[B] = [...this[B], ...r];
2604
2706
  else
@@ -2647,7 +2749,7 @@ class Ts {
2647
2749
  * @param routeConfig
2648
2750
  */
2649
2751
  setNotFoundRoute(e) {
2650
- const t = this[Ue](e);
2752
+ const t = this[ke](e);
2651
2753
  this[Qe] = t[0];
2652
2754
  }
2653
2755
  /**
@@ -2661,7 +2763,7 @@ class Ts {
2661
2763
  *
2662
2764
  * @param routeConfig
2663
2765
  */
2664
- [Ue](e) {
2766
+ [ke](e) {
2665
2767
  let t = e.path ?? "";
2666
2768
  t.length > 0 && t.charAt(0) !== "/" && (t = `/${t}`);
2667
2769
  let r = e.components ?? (e.component && { "": e.component });
@@ -2673,18 +2775,18 @@ class Ts {
2673
2775
  for (let a in r) {
2674
2776
  let l = r[a];
2675
2777
  a.length === 0 && (a = te);
2676
- let f = new as(a, l, e.props, e.meta);
2677
- n.push(f);
2778
+ let u = new us(a, l, e.props, e.meta);
2779
+ n.push(u);
2678
2780
  }
2679
2781
  let i = !1, o = [];
2680
2782
  if (e.children)
2681
2783
  for (let a of e.children) {
2682
- let l = this[Ue](a);
2683
- for (let f of l) {
2684
- let u = new ct();
2685
- u.name = f.name, f.path && f.path.length > 0 ? t !== "/" ? u.path = `${t}${f.path}` : u.path = f.path : (i = !0, u.path = t);
2784
+ let l = this[ke](a);
2785
+ for (let u of l) {
2786
+ let f = new ct();
2787
+ f.name = u.name, u.path && u.path.length > 0 ? t !== "/" ? f.path = `${t}${u.path}` : f.path = u.path : (i = !0, f.path = t);
2686
2788
  let c = new Zt();
2687
- c.models = [...n], u.layers = [c, ...f.layers], o.push(u);
2789
+ c.models = [...n], f.layers = [c, ...u.layers], o.push(f);
2688
2790
  }
2689
2791
  }
2690
2792
  if (!i) {
@@ -2699,45 +2801,45 @@ class Ts {
2699
2801
  * 查找route model
2700
2802
  * @param cite
2701
2803
  */
2702
- [ke](e) {
2804
+ [Ue](e) {
2703
2805
  const t = e.route;
2704
2806
  try {
2705
2807
  for (let r of this[B]) {
2706
2808
  const n = t.template ?? t.path, i = t.template ?? t.name;
2707
2809
  if (n && r.path) {
2708
2810
  let o = r.match;
2709
- o || (o = r.match = gs(r.path));
2811
+ o || (o = r.match = ws(r.path));
2710
2812
  const a = o(n);
2711
2813
  if (!a)
2712
2814
  continue;
2713
2815
  if (r.redirect) {
2714
- const l = new q();
2715
- $(!0, l, t), l.path = r.redirect;
2716
- const f = {
2816
+ const l = new R();
2817
+ q(!0, l, t), l.path = r.redirect;
2818
+ const u = {
2717
2819
  route: l,
2718
2820
  find: void 0
2719
2821
  };
2720
- return this[ke](f) ? (e.route = f.route, e.find = f.find, t.template && e.find && (e.find = { ...e.find }, e.find.path = t.path), !0) : !1;
2822
+ return this[Ue](u) ? (e.route = u.route, e.find = u.find, t.template && e.find && (e.find = { ...e.find }, e.find.path = t.path), !0) : !1;
2721
2823
  }
2722
- if (t.params = t.params ?? {}, $(!0, t.params, a.params), t.query) {
2824
+ if (t.params = t.params ?? {}, q(!0, t.params, a.params), t.query) {
2723
2825
  const l = t.query;
2724
2826
  if (typeof l == "string") {
2725
- const f = {}, u = l.split("&");
2726
- for (let c of u) {
2827
+ const u = {}, f = l.split("&");
2828
+ for (let c of f) {
2727
2829
  const h = c.split("=");
2728
2830
  if (h.length !== 2)
2729
2831
  continue;
2730
2832
  const y = decodeURIComponent(h[0].trim()), d = decodeURIComponent(h[1].trim());
2731
- f[y] = d;
2833
+ u[y] = d;
2732
2834
  }
2733
- $(!0, t.params, f);
2835
+ q(!0, t.params, u);
2734
2836
  } else
2735
- typeof l == "object" && $(!0, t.params, l);
2837
+ typeof l == "object" && q(!0, t.params, l);
2736
2838
  }
2737
2839
  return e.find = r, t.template && e.find && (e.find = { ...e.find }, e.find.path = t.path), !0;
2738
2840
  } else if (i === r.name) {
2739
2841
  t.params = t.params ?? {};
2740
- const o = ms(r.path);
2842
+ const o = vs(r.path);
2741
2843
  return t.path = o(t.params), e.find = r, t.template && e.find && (e.find = { ...e.find }, e.find.name = t.name), !0;
2742
2844
  }
2743
2845
  }
@@ -2754,19 +2856,19 @@ class Ts {
2754
2856
  [I](e) {
2755
2857
  let t = null;
2756
2858
  if (Array.isArray(e))
2757
- if (t = new q(), typeof e[0] == "object")
2758
- t = q.from(e[0]);
2859
+ if (t = new R(), typeof e[0] == "object")
2860
+ t = R.from(e[0]);
2759
2861
  else
2760
2862
  for (let r = 0; r < e.length; r++)
2761
- r === 0 ? e[r].charAt(0) === "/" ? t.path = e[r] : t.name = e[r] : r === 1 ? t.params = e[r] : r === 2 ? t.root = e[r] : r === 3 && $(!1, t, e[r]);
2863
+ r === 0 ? e[r].charAt(0) === "/" ? t.path = e[r] : t.name = e[r] : r === 1 ? t.params = e[r] : r === 2 ? t.root = e[r] : r === 3 && q(!1, t, e[r]);
2762
2864
  else
2763
- typeof e == "object" ? t = q.from(e) : typeof e == "string" && (t = new q(), e.charAt(0) == "/" ? t.path = e : t.name = e);
2865
+ typeof e == "object" ? t = R.from(e) : typeof e == "string" && (t = new R(), e.charAt(0) == "/" ? t.path = e : t.name = e);
2764
2866
  if (t) {
2765
2867
  if (t.path) {
2766
2868
  let r = t.path.indexOf("?");
2767
2869
  r !== -1 && r < t.path.length - 1 && (t.query = t.path.substring(r + 1), t.path = t.path.substring(0, r));
2768
2870
  }
2769
- t.root = t.root ?? te, t.opsType = t.opsType ?? this.options.defaultOperationType ?? A.Push;
2871
+ t.root = t.root ?? te, t.opsType = t.opsType ?? this.options.defaultOperationType ?? $.Push;
2770
2872
  }
2771
2873
  return t;
2772
2874
  }
@@ -2776,7 +2878,7 @@ class Ts {
2776
2878
  */
2777
2879
  push(...e) {
2778
2880
  let t = this[I](e);
2779
- return t ? (t.opsType = t.opsType || A.Push, this.to(t)) : (this[T]("resolve route fail", t), this);
2881
+ return t ? (t.opsType = t.opsType || $.Push, this.to(t)) : (this[j]("resolve route fail", t), this);
2780
2882
  }
2781
2883
  /**
2782
2884
  * 路由跳转(operation类型为Put)
@@ -2784,7 +2886,7 @@ class Ts {
2784
2886
  */
2785
2887
  put(...e) {
2786
2888
  let t = this[I](e);
2787
- return t ? (t.opsType = A.Put, this.to(t)) : (this[T]("resolve route fail", t), this);
2889
+ return t ? (t.opsType = $.Put, t.traceless = !0, this.to(t)) : (this[j]("resolve route fail", t), this);
2788
2890
  }
2789
2891
  /**
2790
2892
  * 路由跳转(operation类型为Replace)
@@ -2792,7 +2894,7 @@ class Ts {
2792
2894
  */
2793
2895
  replace(...e) {
2794
2896
  let t = this[I](e);
2795
- return t ? (t.opsType = A.Replace, this.to(t)) : (this[T]("resolve route fail", t), this);
2897
+ return t ? (t.opsType = $.Replace, this.to(t)) : (this[j]("resolve route fail", t), this);
2796
2898
  }
2797
2899
  /**
2798
2900
  * 路由跳转(operation类型为Append)
@@ -2800,7 +2902,7 @@ class Ts {
2800
2902
  */
2801
2903
  append(...e) {
2802
2904
  let t = this[I](e);
2803
- return t ? (t.opsType = A.Append, this.to(t)) : (this[T]("resolve route fail", t), this);
2905
+ return t ? (t.opsType = $.Append, this.to(t)) : (this[j]("resolve route fail", t), this);
2804
2906
  }
2805
2907
  /**
2806
2908
  * 移除
@@ -2818,56 +2920,58 @@ class Ts {
2818
2920
  let i = -1, o, a = [];
2819
2921
  if (e) {
2820
2922
  if (e.root ? o = e.root : o = this[w][0].root ?? te, e.all)
2821
- for (let f = this[w].length - 1; f > 0; f--) {
2822
- let u = this[w][f];
2823
- u.opsType === A.Append && u.root === o && (a.splice(0, 0, u), i = f - 1);
2923
+ for (let u = this[w].length - 1; u > 0; u--) {
2924
+ let f = this[w][u];
2925
+ f.opsType === $.Append && f.root === o && (a.splice(0, 0, f), i = u - 1);
2824
2926
  }
2825
2927
  else if (e.until)
2826
- for (let f = this[w].length - 1; f > 0; f--) {
2827
- let u = this[w][f];
2828
- if (u.opsType === A.Append && u.root === o) {
2829
- if (e.until.charAt(0) === "/" && e.until === u.path) {
2830
- i = f;
2928
+ for (let u = this[w].length - 1; u > 0; u--) {
2929
+ let f = this[w][u];
2930
+ if (f.opsType === $.Append && f.root === o) {
2931
+ if (e.until.charAt(0) === "/" && e.until === f.path) {
2932
+ i = u;
2831
2933
  break;
2832
- } else if (e.until === u.name) {
2833
- i = f;
2934
+ } else if (e.until === f.name) {
2935
+ i = u;
2834
2936
  break;
2835
2937
  }
2836
- a.splice(0, 0, u);
2938
+ a.splice(0, 0, f);
2837
2939
  }
2838
2940
  }
2839
2941
  } else {
2840
2942
  o = te;
2841
- let f = this[ur](this[U]);
2842
- f && (o = f.name);
2843
- for (let u = this[w].length - 1; u > 0; u--) {
2844
- let c = this[w][u];
2845
- if (c.opsType === A.Append && c.root === o) {
2846
- a.push(c), i = u - 1;
2943
+ let u = this[cr](this[k]);
2944
+ u && (o = u.name);
2945
+ for (let f = this[w].length - 1; f > 0; f--) {
2946
+ let c = this[w][f];
2947
+ if (c.opsType === $.Append && c.root === o) {
2948
+ a.push(c), i = f - 1;
2847
2949
  break;
2848
2950
  }
2849
2951
  }
2850
2952
  }
2851
2953
  if (a.length === 0) {
2852
- let f = "can not find route";
2853
- console.warn(f), n.resolve(f), r(!1);
2954
+ let u = "can not find route";
2955
+ console.warn(u), n.resolve(u), r(!1);
2854
2956
  return;
2855
2957
  }
2856
- let l = 0;
2857
- if (this[w].forEach((f) => {
2858
- f.opsType !== A.Put && l++;
2859
- }), this[Me](a)) {
2958
+ let l = null;
2959
+ if (i !== -1 && (l = this[w][i]), this[Me](a)) {
2860
2960
  if (t === !1)
2861
2961
  return n.resolve(), r(!0), !0;
2862
- let f = 0;
2863
- this[w].forEach((c) => {
2864
- c.opsType !== A.Put && f++;
2865
- });
2866
- const u = f - l;
2867
- this[C]?.go(u, () => (n.resolve(), r(!0), !0));
2962
+ const u = this[w].length, f = () => (n.resolve(), r(!0), !0);
2963
+ if (l && u > 0 && R.isSame(l, this[w][u - 1])) {
2964
+ this[A]?.goBack(l, f);
2965
+ return;
2966
+ }
2967
+ if (l === null && u === 0) {
2968
+ this[A]?.goBack(null, f);
2969
+ return;
2970
+ }
2971
+ f();
2868
2972
  }
2869
2973
  } catch (i) {
2870
- this[T](i), n.resolve(), r(!1);
2974
+ this[j](i), n.resolve(), r(!1);
2871
2975
  }
2872
2976
  });
2873
2977
  });
@@ -2878,7 +2982,7 @@ class Ts {
2878
2982
  */
2879
2983
  open(...e) {
2880
2984
  let t = this[I](e);
2881
- return t ? (t.opsType = A.Open, this.to(t)) : (this[T]("resolve route fail", t), this);
2985
+ return t ? (t.opsType = $.Open, this.to(t)) : (this[j]("resolve route fail", t), this);
2882
2986
  }
2883
2987
  /**
2884
2988
  * 关闭路由跳转的页面
@@ -2915,7 +3019,7 @@ class Ts {
2915
3019
  }
2916
3020
  this[Me](n) && this[We](), t.resolve();
2917
3021
  } catch (r) {
2918
- this[T](r), t.resolve();
3022
+ this[j](r), t.resolve();
2919
3023
  }
2920
3024
  }), this;
2921
3025
  }
@@ -2926,35 +3030,36 @@ class Ts {
2926
3030
  to(...e) {
2927
3031
  let t = this[I](e);
2928
3032
  if (!t)
2929
- return this[T]("resolve route fail", t), this;
3033
+ return this[j]("resolve route fail", t), this;
2930
3034
  let r = this[Ne].acquire(t);
2931
- return r == null ? (this[T]("route forbid", t), this) : (this[we].post((n) => {
3035
+ return r == null ? (this[j]("route forbid", t), this) : (this[we].post((n) => {
2932
3036
  try {
2933
- let i = this[Et](t);
2934
- this[At](i), this[_t](i), this[Ft](i), i.wait(
3037
+ let i = this[At](t);
3038
+ this[Et](i), this[_t](i), this[Ft](i), i.wait(
2935
3039
  (o, a) => {
2936
3040
  const l = o.session.to;
2937
- try {
2938
- let f = q.clone(l, !0);
2939
- const u = new or(f, this[Je]());
2940
- l.opsType === A.Replace ? this[C]?.replace(u) : this[C]?.push(u);
2941
- } catch (f) {
2942
- console.error(f.message, f);
2943
- }
3041
+ if (o.session.updateResult && o.session.updateResult.status === "success")
3042
+ try {
3043
+ let u = R.clone(l, !0);
3044
+ const f = new or(u, this[Je]());
3045
+ l.opsType === $.Replace ? this[A]?.replace(f) : this[A]?.push(f);
3046
+ } catch (u) {
3047
+ console.error(u.message, u);
3048
+ }
2944
3049
  if (this[Ne].release(r), this[We](l), typeof t.success == "function")
2945
3050
  try {
2946
3051
  Reflect.apply(t.success, {}, []);
2947
- } catch (f) {
2948
- console.error(f.message, f);
3052
+ } catch (u) {
3053
+ console.error(u.message, u);
2949
3054
  }
2950
3055
  this[ce] === !1 && this[Xe](!0), n.resolve();
2951
3056
  },
2952
3057
  (o, a) => {
2953
- this[Ne].release(r), a !== null && this[T](a, t), this[ce] === !1 && this[Xe](!1), n.resolve();
3058
+ this[Ne].release(r), a !== null && this[j](a, t), this[ce] === !1 && this[Xe](!1), n.resolve();
2954
3059
  }
2955
3060
  );
2956
3061
  } catch (i) {
2957
- this[Ne].release(r), this[T](i, t), n.resolve();
3062
+ this[Ne].release(r), this[j](i, t), n.resolve();
2958
3063
  }
2959
3064
  }), this);
2960
3065
  }
@@ -2963,12 +3068,12 @@ class Ts {
2963
3068
  * @param delta
2964
3069
  */
2965
3070
  back(e = 1) {
2966
- this[C]?.go(-e, !1);
3071
+ this[A]?.go(-e, !1);
2967
3072
  }
2968
3073
  /**
2969
3074
  * 创建next函数
2970
3075
  */
2971
- [pr](e) {
3076
+ [mr](e) {
2972
3077
  return (t, r) => {
2973
3078
  if (typeof t == "boolean")
2974
3079
  e.session.redirect = !1, t ? e.resolve() : e.reject(r ?? null);
@@ -2988,23 +3093,23 @@ class Ts {
2988
3093
  * @param route
2989
3094
  * @returns {EventChain}
2990
3095
  */
2991
- [Et](e) {
3096
+ [At](e) {
2992
3097
  let t = this[w].length > 0 ? this[w][0] : void 0, r = new tt(e, t), n = {
2993
3098
  //路由
2994
3099
  route: e,
2995
3100
  //查找结果
2996
3101
  find: null
2997
3102
  };
2998
- return this[ke](n), n.find && (r.routeModel = n.find, e.matched = $s(n.find), Array.isArray(e.matched) && e.matched.length > 0 && (e.meta = n.find.layers[0].models[0].meta)), new rt(r);
3103
+ return this[Ue](n), n.find && (r.routeModel = n.find, e.matched = Ts(n.find), Array.isArray(e.matched) && e.matched.length > 0 && (e.meta = n.find.layers[0].models[0].meta)), new rt(r);
2999
3104
  }
3000
3105
  /**
3001
3106
  * 执行before事件
3002
3107
  * @param chain
3003
3108
  */
3004
- [At](e) {
3109
+ [Et](e) {
3005
3110
  for (let t of this[je])
3006
3111
  e.post((r) => {
3007
- const n = this[pr](r);
3112
+ const n = this[mr](r);
3008
3113
  Reflect.apply(t, {}, [r.session.to, r.session.from, n, r.session]);
3009
3114
  });
3010
3115
  }
@@ -3028,7 +3133,7 @@ class Ts {
3028
3133
  * @param route
3029
3134
  * @param session
3030
3135
  */
3031
- [mr](e, t) {
3136
+ [vr](e, t) {
3032
3137
  for (let r of this[Le])
3033
3138
  try {
3034
3139
  Reflect.apply(r, {}, [e, t]);
@@ -3051,7 +3156,7 @@ class Ts {
3051
3156
  //查找结果
3052
3157
  find: null
3053
3158
  };
3054
- if (this[ke](o))
3159
+ if (this[Ue](o))
3055
3160
  n = o.find, t.session.routeModel = n;
3056
3161
  else if (this[Qe])
3057
3162
  n = this[Qe];
@@ -3061,9 +3166,12 @@ class Ts {
3061
3166
  }
3062
3167
  }
3063
3168
  let i = tt.from(t.session);
3064
- this[cr](r, n, i).then(
3169
+ this[hr](r, n, i).then(
3065
3170
  (o) => {
3066
- this[U], t.resolve();
3171
+ this[k], t.session.updateResult = o ?? {
3172
+ status: "success",
3173
+ message: ""
3174
+ }, t.resolve();
3067
3175
  },
3068
3176
  (o) => {
3069
3177
  t.reject(o);
@@ -3079,7 +3187,7 @@ class Ts {
3079
3187
  [Me](e) {
3080
3188
  if (e.length == 0)
3081
3189
  return !0;
3082
- let t = this[U], r = [];
3190
+ let t = this[k], r = [];
3083
3191
  for (let n of e) {
3084
3192
  let i = this[bt](t, n);
3085
3193
  i != null && r.push({
@@ -3089,10 +3197,10 @@ class Ts {
3089
3197
  }
3090
3198
  if (r.length == 0) {
3091
3199
  let n = "can not find view index";
3092
- return this[T](n), !1;
3200
+ return this[j](n), !1;
3093
3201
  }
3094
3202
  for (let n of r.reverse())
3095
- this[ue](t, { x: n.x, y: n.y }, [n.route.index ?? 0], !0);
3203
+ this[fe](t, { x: n.x, y: n.y }, [n.route.index ?? 0], !0);
3096
3204
  return !0;
3097
3205
  }
3098
3206
  /**
@@ -3117,7 +3225,7 @@ class Ts {
3117
3225
  * 查找first view
3118
3226
  * @param page
3119
3227
  */
3120
- [ur](e) {
3228
+ [cr](e) {
3121
3229
  return e.layers.length > 0 && e.layers[0].views.length > 0 ? e.layers[0].views[0] : null;
3122
3230
  }
3123
3231
  /**
@@ -3127,39 +3235,39 @@ class Ts {
3127
3235
  * @param indexList
3128
3236
  * @param retainRoot
3129
3237
  */
3130
- [ue](e, t, r = null, n = !0) {
3238
+ [fe](e, t, r = null, n = !0) {
3131
3239
  if (t.y >= e.layers.length || t.x >= e.layers[t.y].views.length)
3132
3240
  return;
3133
- let i = e.layers[t.y].views[t.x], o = !1, a = [], l = !1, f = [...i.slots.value];
3134
- for (let c = f.length - 1; c >= 0; c--) {
3135
- let h = f[c];
3136
- (!r || r.indexOf(h.index) != -1) && (h.route && i[J] && (this[qe](h.route), h.active === !0 && h.route.opsType == A.Append && (l = !0)), a.push(new V(i, h.index, t.y)), f.splice(c, 1));
3241
+ let i = e.layers[t.y].views[t.x], o = !1, a = [], l = !1, u = [...i.slots.value];
3242
+ for (let c = u.length - 1; c >= 0; c--) {
3243
+ let h = u[c];
3244
+ (!r || r.indexOf(h.index) != -1) && (h.route && i[J] && (this[qe](h.route), h.active === !0 && h.route.opsType == $.Append && (l = !0)), a.push(new V(i, h.index, t.y)), u.splice(c, 1));
3137
3245
  }
3138
- if (f.length == 0)
3139
- n ? i.slots.value = f : e.layers[t.y].views.splice(t.x, 1);
3246
+ if (u.length == 0)
3247
+ n ? i.slots.value = u : e.layers[t.y].views.splice(t.x, 1);
3140
3248
  else {
3141
3249
  if (l) {
3142
- let c = f.length - 1, h = f[c];
3250
+ let c = u.length - 1, h = u[c];
3143
3251
  h.active = !0, h.route && (h.route.active = h.active);
3144
3252
  }
3145
- i.slots.value = f;
3253
+ i.slots.value = u;
3146
3254
  }
3147
3255
  e.layers[t.y].views.length == 0 && (o = !0);
3148
- let u = t.y + 1;
3149
- for (; u < e.layers.length; u++) {
3150
- let c = e.layers[u].views, h = [];
3256
+ let f = t.y + 1;
3257
+ for (; f < e.layers.length; f++) {
3258
+ let c = e.layers[f].views, h = [];
3151
3259
  for (let y = c.length - 1; (o || a.length > 0) && y >= 0; y--) {
3152
3260
  let d = c[y];
3153
3261
  if (d[ye] && (o || V.include(a, d[ye]))) {
3154
3262
  let m = d.slots.value;
3155
3263
  for (let p = m.length - 1; p >= 0; p--) {
3156
3264
  let v = m[p];
3157
- v.route && d[J] && this[qe](v.route), h.push(new V(d, v.index, u)), m.splice(p, 1);
3265
+ v.route && d[J] && this[qe](v.route), h.push(new V(d, v.index, f)), m.splice(p, 1);
3158
3266
  }
3159
- e.layers[u].views.splice(y, 1);
3267
+ e.layers[f].views.splice(y, 1);
3160
3268
  }
3161
3269
  }
3162
- a = h, e.layers[u].views.length == 0 && (o = !0);
3270
+ a = h, e.layers[f].views.length == 0 && (o = !0);
3163
3271
  }
3164
3272
  }
3165
3273
  /**
@@ -3170,7 +3278,7 @@ class Ts {
3170
3278
  */
3171
3279
  restore(e) {
3172
3280
  if (!e || this[B].length == 0) {
3173
- let t = this[U];
3281
+ let t = this[k];
3174
3282
  if (t.layers.length > 0) {
3175
3283
  let r = t.layers[0].views;
3176
3284
  r.length > 0 && (r[0].slots.value = []);
@@ -3181,22 +3289,22 @@ class Ts {
3181
3289
  let i = null, o = !1;
3182
3290
  for (let a = 0; a < e.length; a++) {
3183
3291
  const l = e[a];
3184
- this[we].post((f) => {
3185
- const u = this[Et](l);
3186
- this[At](u), this[_t](u), this[Ft](u), u.wait(
3292
+ this[we].post((u) => {
3293
+ const f = this[At](l);
3294
+ this[Et](f), this[_t](f), this[Ft](f), f.wait(
3187
3295
  (c, h) => {
3188
- i = c.session.to, o = c.session.redirect, f.resolve();
3296
+ i = c.session.to, o = c.session.redirect, u.resolve();
3189
3297
  },
3190
3298
  (c, h) => {
3191
- i = null, h !== null && this[T](h), f.resolve();
3299
+ i = null, h !== null && this[j](h), u.resolve();
3192
3300
  }
3193
3301
  );
3194
3302
  });
3195
3303
  }
3196
3304
  this[we].post((a) => {
3197
3305
  if (i && o === !0) {
3198
- const l = q.clone(i, !0), f = new or(l, this[Je]());
3199
- this[C]?.replace(f);
3306
+ const l = R.clone(i, !0), u = new or(l, this[Je]());
3307
+ this[A]?.replace(u);
3200
3308
  }
3201
3309
  a.resolve(), r();
3202
3310
  });
@@ -3208,16 +3316,19 @@ class Ts {
3208
3316
  * @param routeModel
3209
3317
  * @returns
3210
3318
  */
3211
- [cr](e, t, r) {
3212
- let n = e.updateType ?? Ye.Part;
3213
- return this[hr](t).then(() => {
3214
- this[yr](t, e, r, n);
3319
+ [hr](e, t, r) {
3320
+ const n = e.updateType ?? Ye.Part;
3321
+ return this[yr](t).then(() => {
3322
+ const o = this[dr](t, e, r, n);
3323
+ if (o.status === "error")
3324
+ throw Error(o.message);
3325
+ return o;
3215
3326
  });
3216
3327
  }
3217
3328
  /**
3218
3329
  * 解析组件
3219
3330
  */
3220
- [hr](e) {
3331
+ [yr](e) {
3221
3332
  let t = [];
3222
3333
  for (let r = 0; r < e.layers.length; r++) {
3223
3334
  let n = e.layers[r];
@@ -3236,28 +3347,37 @@ class Ts {
3236
3347
  * @param updateType
3237
3348
  * @returns
3238
3349
  */
3239
- [yr](e, t, r, n) {
3350
+ [dr](e, t, r, n) {
3240
3351
  if (e.layers[0].models.length !== 1)
3241
- return Promise.reject("illegal route structure(multi root node)");
3352
+ return {
3353
+ status: "error",
3354
+ message: "illegal route structure(multi root node)"
3355
+ };
3242
3356
  const i = e.layers[0].models[0];
3243
- let o = this[U], a = Ks(o), l = t.root ?? te, f;
3244
- !a && n == Ye.Part && (f = this[bt](o, t));
3245
- let u, c = 0;
3246
- if (f == null || f == null)
3357
+ let o = this[k], a = $s(o), l = t.root ?? te, u;
3358
+ !a && n == Ye.Part && (u = this[bt](o, t));
3359
+ let f, c = 0;
3360
+ if (u == null || u == null)
3247
3361
  if (a || n === Ye.All) {
3248
3362
  if (o.layers.length == 0 && (o.layers[0] = new mt()), o.layers[0].views.length == 0) {
3249
3363
  let h = t.root ?? te;
3250
- u = new Ke(h, !0, null), o.layers[0].views = [u];
3364
+ f = new Ke(h, !0, null), o.layers[0].views = [f];
3251
3365
  } else
3252
- u = o.layers[0].views[0];
3253
- f = { x: 0, y: 0 };
3366
+ f = o.layers[0].views[0];
3367
+ u = { x: 0, y: 0 };
3254
3368
  } else {
3255
3369
  let h = t.slot;
3256
3370
  if (!h)
3257
- return Promise.reject("can not rebuild view(because not route slot)");
3371
+ return {
3372
+ status: "error",
3373
+ message: "can not rebuild view(because not route slot)"
3374
+ };
3258
3375
  let y = h.level;
3259
3376
  if (y > o.layers.length)
3260
- return Promise.reject("can not insert view(override level)");
3377
+ return {
3378
+ status: "error",
3379
+ message: "can not insert view(override level)"
3380
+ };
3261
3381
  let d;
3262
3382
  if (h.rootName) {
3263
3383
  let m = o.layers[y - 1];
@@ -3273,30 +3393,36 @@ class Ts {
3273
3393
  }
3274
3394
  }
3275
3395
  if (!d)
3276
- return Promise.reject("can not insert view(not find root node ref)");
3277
- u = new Ke(l, !0, d), o.layers[y].views.push(u), f = { x: o.layers[y].views.length - 1, y };
3396
+ return {
3397
+ status: "error",
3398
+ message: "can not insert view(not find root node ref)"
3399
+ };
3400
+ f = new Ke(l, !0, d), o.layers[y].views.push(f), u = { x: o.layers[y].views.length - 1, y };
3278
3401
  }
3279
3402
  else
3280
- u = o.layers[f.y].views[f.x];
3281
- if (c = f.y, u[J] = !0, t.opsType === A.Append) {
3403
+ f = o.layers[u.y].views[u.x];
3404
+ if (c = u.y, f[J] = !0, t.opsType === $.Append) {
3282
3405
  t.index = le.get(), t.active = !0;
3283
- let h = u.slots.value;
3406
+ let h = f.slots.value;
3284
3407
  if (h.length > 0) {
3285
3408
  let v = h[h.length - 1];
3286
3409
  v.active = !1, v.route && (v.route.active = v.active);
3287
3410
  }
3288
3411
  let y = new ne(t, i, t.index, !0);
3289
- u.slots.value = [...h, y];
3290
- let d = c + 1, m = 1, p = new V(u, t.index, c);
3412
+ f.slots.value = [...h, y];
3413
+ let d = c + 1, m = 1, p = new V(f, t.index, c);
3291
3414
  this[ie](o, d, e, m, p);
3292
- } else if (t.opsType === A.Open) {
3293
- let h = u.slots.value;
3415
+ } else if (t.opsType === $.Open) {
3416
+ let h = f.slots.value;
3294
3417
  const y = t.active ?? !0;
3295
3418
  let d = !1;
3296
3419
  for (let m of h) {
3297
- if (m.route !== null && q.isSameForRouteModel(m.route, t)) {
3420
+ if (m.route !== null && R.isSameForRouteModel(m.route, t)) {
3298
3421
  if (m.active === y)
3299
- return t.index = m.index, t.active = y, m.route = t, Promise.resolve();
3422
+ return t.index = m.index, t.active = y, m.route = t, {
3423
+ status: "no-change",
3424
+ message: ""
3425
+ };
3300
3426
  m.active = y, d = !0, t.index = m.index, t.active = y, m.route = t;
3301
3427
  } else
3302
3428
  y && (m.active = !1);
@@ -3306,21 +3432,21 @@ class Ts {
3306
3432
  t.index = le.get(), t.active = y;
3307
3433
  let m = new ne(t, i, t.index, y);
3308
3434
  h.push(m);
3309
- let p = c + 1, v = 1, g = new V(u, t.index, c);
3435
+ let p = c + 1, v = 1, g = new V(f, t.index, c);
3310
3436
  this[ie](o, p, e, v, g);
3311
3437
  }
3312
- u.slots.value = [...h];
3438
+ f.slots.value = [...h];
3313
3439
  } else {
3314
- let h = u.slots.value;
3440
+ let h = f.slots.value;
3315
3441
  if (h.length == 0) {
3316
- t.index = le.get(), t.active = !0, u.slots.value = [new ne(t, i, t.index)];
3317
- let y = c + 1, d = 1, m = new V(u, t.index, c);
3442
+ t.index = le.get(), t.active = !0, f.slots.value = [new ne(t, i, t.index)];
3443
+ let y = c + 1, d = 1, m = new V(f, t.index, c);
3318
3444
  this[ie](o, y, e, d, m);
3319
3445
  } else {
3320
3446
  let y = h[0];
3321
3447
  if (y.model !== i) {
3322
- this[ue](o, f, null, !0), t.index = le.get(), t.active = !0, u.slots.value = [new ne(t, i, t.index)];
3323
- let d = c + 1, m = 1, p = new V(u, t.index, c);
3448
+ this[fe](o, u, null, !0), t.index = le.get(), t.active = !0, f.slots.value = [new ne(t, i, t.index)];
3449
+ let d = c + 1, m = 1, p = new V(f, t.index, c);
3324
3450
  this[ie](o, d, e, m, p);
3325
3451
  } else {
3326
3452
  y.route !== null && this[qe](y.route);
@@ -3330,46 +3456,46 @@ class Ts {
3330
3456
  let p = [];
3331
3457
  for (let K = 1; K < h.length; K++)
3332
3458
  p.push(h[K].index);
3333
- p.length > 0 ? this[ue](o, f, p, !0) : d && (u.slots.value = [...h]);
3334
- let v = [new V(u, t.index, c)], g = c + 1, _ = 1, b = new V(u, t.index, c);
3459
+ p.length > 0 ? this[fe](o, u, p, !0) : d && (f.slots.value = [...h]);
3460
+ let v = [new V(f, t.index, c)], g = c + 1, _ = 1, b = new V(f, t.index, c);
3335
3461
  for (; v.length > 0 && g < o.layers.length && _ < e.layers.length; g++, _++) {
3336
3462
  let K = [];
3337
- for (let S = 0; S < o.layers[g].views.length; S++) {
3338
- let P = o.layers[g].views[S];
3339
- P[ye] && V.include(v, P[ye]) && K.unshift(S);
3463
+ for (let P = 0; P < o.layers[g].views.length; P++) {
3464
+ let C = o.layers[g].views[P];
3465
+ C[ye] && V.include(v, C[ye]) && K.unshift(P);
3340
3466
  }
3341
3467
  let E = [];
3342
- for (let S of K) {
3343
- let P = o.layers[g].views[S], k = e.layers[_].models, L;
3344
- for (let M = 0; M < k.length; M++)
3345
- if (P.name === k[M].name) {
3346
- L = k[M];
3468
+ for (let P of K) {
3469
+ let C = o.layers[g].views[P], U = e.layers[_].models, L;
3470
+ for (let M = 0; M < U.length; M++)
3471
+ if (C.name === U[M].name) {
3472
+ L = U[M];
3347
3473
  break;
3348
3474
  }
3349
3475
  if (!L)
3350
- this[ue](o, { x: S, y: g }, null, !1);
3476
+ this[fe](o, { x: P, y: g }, null, !1);
3351
3477
  else {
3352
- let M = P.slots.value;
3478
+ let M = C.slots.value;
3353
3479
  if (M.length == 0) {
3354
3480
  let X = 0;
3355
- P.slots.value = [new ne(null, L, X)];
3481
+ C.slots.value = [new ne(null, L, X)];
3356
3482
  let W = g + 1, re = _ + 1;
3357
3483
  this[ie](o, W, e, re, b);
3358
3484
  } else {
3359
3485
  let X = M[0];
3360
3486
  if (X.model !== L) {
3361
- this[ue](o, { x: S, y: g }, null, !0), P.slots.value = [new ne(null, L, 0)];
3487
+ this[fe](o, { x: P, y: g }, null, !0), C.slots.value = [new ne(null, L, 0)];
3362
3488
  let W = g + 1, re = _ + 1;
3363
3489
  this[ie](o, W, e, re, b);
3364
3490
  } else {
3365
- P[J] && X.route !== null && this[qe](X.route);
3491
+ C[J] && X.route !== null && this[qe](X.route);
3366
3492
  let W = [];
3367
3493
  for (let re = 1; re < M.length; re++)
3368
3494
  W.push(M[re].index);
3369
- W.length > 0 && this[ue](o, { x: S, y: g }, W, !0), E.push(new V(P, X.index, g));
3495
+ W.length > 0 && this[fe](o, { x: P, y: g }, W, !0), E.push(new V(C, X.index, g));
3370
3496
  }
3371
3497
  }
3372
- P[J] = !1;
3498
+ C[J] = !1;
3373
3499
  }
3374
3500
  }
3375
3501
  v = E;
@@ -3378,11 +3504,14 @@ class Ts {
3378
3504
  }
3379
3505
  }
3380
3506
  }
3381
- if (u && u[z]) {
3382
- let h = u[z];
3383
- h && (t.slot = new ls(l, c, h?.view.name, h?.index ?? 0));
3507
+ if (f && f[z]) {
3508
+ let h = f[z];
3509
+ h && (t.slot = new as(l, c, h?.view.name, h?.index ?? 0));
3384
3510
  }
3385
- r.to = void 0, r.routeModel = void 0, t.session = r, this[dr](t);
3511
+ return r.to = void 0, r.routeModel = void 0, t.session = r, this[pr](t), {
3512
+ status: "success",
3513
+ message: ""
3514
+ };
3386
3515
  }
3387
3516
  /**
3388
3517
  * 合并view
@@ -3396,17 +3525,17 @@ class Ts {
3396
3525
  let o = n, a = t;
3397
3526
  for (; a < e.layers.length && o < r.layers.length; a++, o++) {
3398
3527
  let l = e.layers[a].views;
3399
- for (let f of r.layers[o].models) {
3400
- let u = new Ke(f.name, !1, i), c = new ne(null, f);
3401
- u.slots.value = [c], l.push(u);
3528
+ for (let u of r.layers[o].models) {
3529
+ let f = new Ke(u.name, !1, i), c = new ne(null, u);
3530
+ f.slots.value = [c], l.push(f);
3402
3531
  }
3403
3532
  }
3404
3533
  for (; o < r.layers.length; o++) {
3405
3534
  let l = new mt();
3406
3535
  l.views = [];
3407
- for (let f of r.layers[o].models) {
3408
- let u = new Ke(f.name, !1, i), c = new ne(null, f);
3409
- u.slots.value = [c], l.views.push(u);
3536
+ for (let u of r.layers[o].models) {
3537
+ let f = new Ke(u.name, !1, i), c = new ne(null, u);
3538
+ f.slots.value = [c], l.views.push(f);
3410
3539
  }
3411
3540
  e.layers.push(l);
3412
3541
  }
@@ -3422,11 +3551,11 @@ class Ts {
3422
3551
  * @returns
3423
3552
  */
3424
3553
  [Er](e, t, r, n, i, o) {
3425
- if (t < 0 || t > this[U].layers.length)
3554
+ if (t < 0 || t > this[k].layers.length)
3426
3555
  return null;
3427
- if (t < this[U].layers.length) {
3428
- let u = this[U].layers[t], c = null;
3429
- for (let h of u.views) {
3556
+ if (t < this[k].layers.length) {
3557
+ let f = this[k].layers[t], c = null;
3558
+ for (let h of f.views) {
3430
3559
  let y = !1;
3431
3560
  if (r !== null ? (y = h.name === e && h[z]?.view === r, y && n !== -1 && (y = h[z]?.index === n)) : y = h.name === e, !!y) {
3432
3561
  i !== null && (h[ye] = {
@@ -3450,57 +3579,57 @@ class Ts {
3450
3579
  index: o,
3451
3580
  level: t - 1
3452
3581
  });
3453
- let f = new Ke(e, !0, a);
3454
- if (f[ye] = l, t == this[U].layers.length) {
3455
- let u = new mt();
3456
- u.views = [f], this[U].layers.push(u);
3582
+ let u = new Ke(e, !0, a);
3583
+ if (u[ye] = l, t == this[k].layers.length) {
3584
+ let f = new mt();
3585
+ f.views = [u], this[k].layers.push(f);
3457
3586
  } else
3458
- this[U].layers[t].views.push(f);
3459
- return f;
3587
+ this[k].layers[t].views.push(u);
3588
+ return u;
3460
3589
  }
3461
3590
  }
3462
- const qs = "fox-router-view", js = "fox-router-link";
3463
- function qr(s, e = !1) {
3591
+ const js = "fox-router-view", Os = "fox-router-link";
3592
+ function jr(s, e = !1) {
3464
3593
  let t = null;
3465
3594
  return e ? t = s.showFromClass ?? s.enterFromClass : t = s.enterFromClass, t || (t = s.transitionName, t ? e ? `${t}-show-from` : `${t}-enter-from` : null);
3466
3595
  }
3467
- function jr(s, e = !1) {
3596
+ function Or(s, e = !1) {
3468
3597
  let t = null;
3469
3598
  return e ? t = s.showActiveClass ?? s.enterActiveClass : t = s.enterActiveClass, t || (t = s.transitionName, t ? e ? `${t}-show-active` : `${t}-enter-active` : null);
3470
3599
  }
3471
- function Os(s, e = !1) {
3600
+ function Ls(s, e = !1) {
3472
3601
  let t = null;
3473
3602
  return e ? t = s.showToClass ?? s.enterToClass : t = s.enterToClass, t || (t = s.transitionName, t ? e ? `${t}-show-to` : `${t}-enter-to` : null);
3474
3603
  }
3475
- function Ls(s, e = !1) {
3604
+ function Ms(s, e = !1) {
3476
3605
  let t = null;
3477
3606
  return e ? t = s.hideFromClass ?? s.leaveFromClass : t = s.leaveFromClass, t || (t = s.transitionName, t ? e ? `${t}-hide-from` : `${t}-leave-from` : null);
3478
3607
  }
3479
- function Ms(s, e = !1) {
3608
+ function Ns(s, e = !1) {
3480
3609
  let t = null;
3481
3610
  return e ? t = s.hideActiveClass ?? s.leaveActiveClass : t = s.leaveActiveClass, t || (t = s.transitionName, t ? e ? `${t}-hide-active` : `${t}-leave-active` : null);
3482
3611
  }
3483
- function Ns(s, e = !1) {
3612
+ function Is(s, e = !1) {
3484
3613
  let t = null;
3485
3614
  return e ? t = s.hideToClass ?? s.leaveToClass : t = s.leaveToClass, t || (t = s.transitionName, t ? e ? `${t}-hide-to` : `${t}-leave-to` : null);
3486
3615
  }
3487
- function Is(s, e = !1) {
3616
+ function Hs(s, e = !1) {
3488
3617
  let t = null;
3489
3618
  return e ? t = s.beforeShow ?? s.beforeEnter : t = s.beforeEnter, t;
3490
3619
  }
3491
- function Hs(s, e = !1) {
3620
+ function Ds(s, e = !1) {
3492
3621
  let t = null;
3493
3622
  return e ? t = s.show ?? s.enter : t = s.enter, t;
3494
3623
  }
3495
- function Ds(s, e = !1) {
3624
+ function Vs(s, e = !1) {
3496
3625
  let t = null;
3497
3626
  return e ? t = s.afterShow ?? s.afterEnter : t = s.afterEnter, t;
3498
3627
  }
3499
- function Vs(s, e = !1) {
3628
+ function Bs(s, e = !1) {
3500
3629
  let t = null;
3501
3630
  return e ? t = s.showCancelled ?? s.enterCancelled : t = s.enterCancelled, t;
3502
3631
  }
3503
- function Bs(s, e = !1) {
3632
+ function ks(s, e = !1) {
3504
3633
  let t = null;
3505
3634
  return e ? t = s.hide ?? s.leave : t = s.leave, t;
3506
3635
  }
@@ -3508,11 +3637,11 @@ function Us(s, e = !1) {
3508
3637
  let t = null;
3509
3638
  return e ? t = s.afterHide ?? s.afterLeave : t = s.afterLeave, t;
3510
3639
  }
3511
- function ks(s, e = !1) {
3640
+ function Ws(s, e = !1) {
3512
3641
  let t = null;
3513
3642
  return e ? t = s.hideCancelled ?? s.leaveCancelled : t = s.leaveCancelled, t;
3514
3643
  }
3515
- function Ut(s) {
3644
+ function kt(s) {
3516
3645
  let e, t = s.duration;
3517
3646
  return typeof t == "object" ? e = {
3518
3647
  enter: t.enter ?? -1,
@@ -3532,80 +3661,80 @@ function Pe(s, e) {
3532
3661
  function Ce(s, e) {
3533
3662
  s.classList.remove(e);
3534
3663
  }
3535
- const Ws = Ee && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
3536
- function kt(s) {
3537
- Ws(s);
3664
+ const zs = Ae && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
3665
+ function Ut(s) {
3666
+ zs(s);
3538
3667
  }
3539
3668
  function H(s, e, t) {
3540
- R(e) && (s == null && (s = {}), Reflect.apply(e, s, t));
3669
+ S(e) && (s == null && (s = {}), Reflect.apply(e, s, t));
3541
3670
  }
3542
- function Or(s, e, t, r = -1, n, i, o, a) {
3543
- if (R(i)) {
3671
+ function Lr(s, e, t, r = -1, n, i, o, a) {
3672
+ if (S(i)) {
3544
3673
  if (n !== void 0 && n >= 0) {
3545
3674
  setTimeout(() => {
3546
- Reflect.apply(i, s, [e, t, r]), R(a) && Reflect.apply(a, s, []);
3675
+ Reflect.apply(i, s, [e, t, r]), S(a) && Reflect.apply(a, s, []);
3547
3676
  }, n);
3548
3677
  return;
3549
3678
  }
3550
- const l = ["animationend", "transitionend"], f = (u) => {
3679
+ const l = ["animationend", "transitionend"], u = (f) => {
3551
3680
  l.forEach((c) => {
3552
- Tt(e, c, f);
3681
+ Tt(e, c, u);
3553
3682
  }), Reflect.apply(i, s, [e, t, r]), a && Reflect.apply(a, s, []);
3554
3683
  };
3555
- l.forEach((u) => {
3556
- $t(e, u, f);
3684
+ l.forEach((f) => {
3685
+ $t(e, f, u);
3557
3686
  });
3558
3687
  }
3559
- if (R(o)) {
3560
- const l = "animationcancel", f = (u) => {
3561
- Reflect.apply(o, s, [e, t, r]), Tt(e, l, f);
3688
+ if (S(o)) {
3689
+ const l = "animationcancel", u = (f) => {
3690
+ Reflect.apply(o, s, [e, t, r]), Tt(e, l, u);
3562
3691
  };
3563
- $t(e, l, f);
3692
+ $t(e, l, u);
3564
3693
  }
3565
3694
  }
3566
3695
  function Wt(s) {
3567
- return !Ee || s === null ? !1 : s.opsType === A.Append || s.opsType === A.Open;
3696
+ return !Ae || s === null ? !1 : s.opsType === $.Append || s.opsType === $.Open;
3568
3697
  }
3569
- function Lr(s, e, t, r = {}, n, i = -1) {
3698
+ function Mr(s, e, t, r = {}, n, i = -1) {
3570
3699
  if (e || Wt(n)) {
3571
- const o = qr(r, e);
3700
+ const o = jr(r, e);
3572
3701
  o && Pe(t, o);
3573
- const a = jr(r, e);
3702
+ const a = Or(r, e);
3574
3703
  a && Pe(t, a);
3575
- const l = Is(r, e);
3704
+ const l = Hs(r, e);
3576
3705
  H(s, l, [t, e, n, i]);
3577
3706
  }
3578
3707
  }
3579
- function Mr(s, e, t, r = {}, n, i, o, a) {
3708
+ function Nr(s, e, t, r = {}, n, i, o, a) {
3580
3709
  if (!Wt(i) && !e) {
3581
- R(a) && a(s, a, [t]);
3710
+ S(a) && a(s, a, [t]);
3582
3711
  return;
3583
3712
  }
3584
- const l = qr(r, e), f = jr(r, e), u = Os(r, e), c = Hs(r, e), h = Ds(r, e), y = Vs(r, e);
3585
- kt(() => {
3586
- Or(s, t, i, o, n, () => {
3587
- f && Ce(t, f), u && Ce(t, u), R(h) && H(s, h, [t, e, i, o]), R(a) && a(s, a, [t]);
3713
+ const l = jr(r, e), u = Or(r, e), f = Ls(r, e), c = Ds(r, e), h = Vs(r, e), y = Bs(r, e);
3714
+ Ut(() => {
3715
+ Lr(s, t, i, o, n, () => {
3716
+ u && Ce(t, u), f && Ce(t, f), S(h) && H(s, h, [t, e, i, o]), S(a) && a(s, a, [t]);
3588
3717
  }, () => {
3589
- R(y) && H(s, y, [t, e, i, o]);
3590
- }), l && Ce(t, l), u && Pe(t, u), R(c) && H(s, c, [t, e, i, o]);
3718
+ S(y) && H(s, y, [t, e, i, o]);
3719
+ }), l && Ce(t, l), f && Pe(t, f), S(c) && H(s, c, [t, e, i, o]);
3591
3720
  });
3592
3721
  }
3593
- function Nr(s, e, t, r = {}, n, i, o, a, l) {
3722
+ function Ir(s, e, t, r = {}, n, i, o, a, l) {
3594
3723
  if (!Wt(o) && !e) {
3595
- !e && R(i) && i();
3724
+ !e && S(i) && i();
3596
3725
  return;
3597
3726
  }
3598
- const f = Ls(r, e), u = Ms(r, e), c = Ns(r, e), h = Bs(r, e), y = Us(r, e), d = ks(r, e);
3599
- f && Pe(t, f), u && Pe(t, u), R(h) && H(s, h, [t, e, o, a]), kt(() => {
3600
- Or(s, t, o, a, n, () => {
3601
- u && Ce(t, u), c && Ce(t, c), R(y) && H(s, y, [t, e, o, a]), R(l) && H(s, l, [t]), !e && R(i) && i();
3727
+ const u = Ms(r, e), f = Ns(r, e), c = Is(r, e), h = ks(r, e), y = Us(r, e), d = Ws(r, e);
3728
+ u && Pe(t, u), f && Pe(t, f), S(h) && H(s, h, [t, e, o, a]), Ut(() => {
3729
+ Lr(s, t, o, a, n, () => {
3730
+ f && Ce(t, f), c && Ce(t, c), S(y) && H(s, y, [t, e, o, a]), S(l) && H(s, l, [t]), !e && S(i) && i();
3602
3731
  }, () => {
3603
- R(d) && H(s, d, [t, e, o, a]), R(l) && H(s, l, [t]), !e && R(i) && i();
3604
- }), f && Ce(t, f), c && Pe(t, c);
3732
+ S(d) && H(s, d, [t, e, o, a]), S(l) && H(s, l, [t]), !e && S(i) && i();
3733
+ }), u && Ce(t, u), c && Pe(t, c);
3605
3734
  });
3606
3735
  }
3607
3736
  function Ot(s, e = {}, t, r = -1) {
3608
- const n = e.mode ?? "default", i = Ut(e);
3737
+ const n = e.mode ?? "default", i = kt(e);
3609
3738
  return {
3610
3739
  //mode
3611
3740
  mode: n,
@@ -3613,49 +3742,49 @@ function Ot(s, e = {}, t, r = -1) {
3613
3742
  persisted: !1,
3614
3743
  //before enter
3615
3744
  beforeEnter: (a) => {
3616
- Lr(s, !1, a, e, t, r);
3745
+ Mr(s, !1, a, e, t, r);
3617
3746
  },
3618
3747
  //enter
3619
3748
  enter: (a) => {
3620
- Mr(s, !1, a, e, i.enter, t, r);
3749
+ Nr(s, !1, a, e, i.enter, t, r);
3621
3750
  },
3622
3751
  //leave
3623
3752
  leave: (a, l) => {
3624
- Nr(s, !1, a, e, i.leave, l, t, r);
3753
+ Ir(s, !1, a, e, i.leave, l, t, r);
3625
3754
  },
3626
3755
  //clone
3627
3756
  clone: (a) => Ot(s, e, t, r)
3628
3757
  };
3629
3758
  }
3630
- function Ir(s) {
3759
+ function Hr(s) {
3631
3760
  return s.el;
3632
3761
  }
3633
- function zs(s, e, t = {}, r, n, i, o) {
3762
+ function Js(s, e, t = {}, r, n, i, o) {
3634
3763
  if (i) {
3635
- const a = Ir(e);
3764
+ const a = Hr(e);
3636
3765
  if (a == null)
3637
3766
  return;
3638
- const l = Ut(t);
3639
- Lr(s, !0, a, t, r, n), Mr(s, !0, a, t, l.show, r, n, (f) => {
3640
- R(o) && H(s, o, [f]);
3767
+ const l = kt(t);
3768
+ Mr(s, !0, a, t, r, n), Nr(s, !0, a, t, l.show, r, n, (u) => {
3769
+ S(o) && H(s, o, [u]);
3641
3770
  });
3642
3771
  } else
3643
- R(o) && H(s, o, []);
3772
+ S(o) && H(s, o, []);
3644
3773
  }
3645
- function Js(s, e, t = {}, r, n, i, o) {
3774
+ function Gs(s, e, t = {}, r, n, i, o) {
3646
3775
  if (i) {
3647
- const a = Ir(e);
3776
+ const a = Hr(e);
3648
3777
  if (a == null)
3649
3778
  return;
3650
- const l = Ut(t);
3651
- Nr(s, !0, a, t, l.hide, null, r, n, (f) => {
3652
- R(o) && H(s, o, [f]);
3779
+ const l = kt(t);
3780
+ Ir(s, !0, a, t, l.hide, null, r, n, (u) => {
3781
+ S(o) && H(s, o, [u]);
3653
3782
  });
3654
3783
  } else
3655
- R(o) && H(s, o, []);
3784
+ S(o) && H(s, o, []);
3656
3785
  }
3657
- function Gs(s, e = {}) {
3658
- kt(() => {
3786
+ function Qs(s, e = {}) {
3787
+ Ut(() => {
3659
3788
  for (let t = 0; t < s.length; t++)
3660
3789
  Reflect.apply(s[t], e, []);
3661
3790
  });
@@ -3672,7 +3801,7 @@ function Kt(s, e) {
3672
3801
  function be(s, e) {
3673
3802
  return typeof e == "function" ? e(s) : s;
3674
3803
  }
3675
- class Qs {
3804
+ class Xs {
3676
3805
  /**
3677
3806
  * vue node
3678
3807
  */
@@ -3688,7 +3817,7 @@ class Qs {
3688
3817
  this.node = e, this.state = t;
3689
3818
  }
3690
3819
  }
3691
- const Lt = wr({
3820
+ const Lt = br({
3692
3821
  //名称
3693
3822
  name: "RouterView",
3694
3823
  //继承特性
@@ -3908,14 +4037,14 @@ const Lt = wr({
3908
4037
  }
3909
4038
  const r = s.multi === !0, n = G(ot, null), i = G(yt, 0), o = G(nr, null), a = G(dt, -1);
3910
4039
  let l = null;
3911
- const f = s.modelSlot;
3912
- if (f) {
3913
- if (se(yt, i + 1), se(dt, f.index), se(pt, f.index), !f.route) {
4040
+ const u = s.modelSlot;
4041
+ if (u) {
4042
+ if (se(yt, i + 1), se(dt, u.index), se(pt, u.index), !u.route) {
3914
4043
  console.warn("child view render error, route not exist");
3915
4044
  return;
3916
4045
  }
3917
4046
  const h = st(t.proxy, !0);
3918
- cs(h), sr(h, () => f.route ?? null);
4047
+ hs(h), sr(h, () => u.route ?? null);
3919
4048
  } else {
3920
4049
  if (n == null) {
3921
4050
  console.error("router is not been injected");
@@ -3934,9 +4063,9 @@ const Lt = wr({
3934
4063
  });
3935
4064
  }
3936
4065
  }
3937
- const u = { value: /* @__PURE__ */ new Map() };
4066
+ const f = { value: /* @__PURE__ */ new Map() };
3938
4067
  return it(() => {
3939
- u.value && u.value.clear();
4068
+ f.value && f.value.clear();
3940
4069
  }), () => {
3941
4070
  if (r) {
3942
4071
  const c = /* @__PURE__ */ new Map(), h = [], y = l?.slots.value, d = [];
@@ -3944,62 +4073,62 @@ const Lt = wr({
3944
4073
  const g = y[v], _ = `${s.name}_${g.index}`, b = oe(s.transition, g.route, v) ?? !0, K = { modelSlot: g };
3945
4074
  let E;
3946
4075
  e.slots.default ? E = he(Lt, K, { default: e.slots.default }) : E = he(Lt, K);
3947
- const S = {}, P = oe(s.viewClass, g.route, v);
3948
- typeof P == "string" && P.length > 0 && (S[P] = !0);
3949
- const k = oe(s.viewActiveClass, g.route, v), L = oe(s.viewInactiveClass, g.route, v), M = u.value.get(_);
3950
- if (typeof k == "string" && k.length > 0 && (S[k] = g.active), typeof L == "string" && L.length > 0 && (S[L] = !g.active), M && g.active !== M.state) {
4076
+ const P = {}, C = oe(s.viewClass, g.route, v);
4077
+ typeof C == "string" && C.length > 0 && (P[C] = !0);
4078
+ const U = oe(s.viewActiveClass, g.route, v), L = oe(s.viewInactiveClass, g.route, v), M = f.value.get(_);
4079
+ if (typeof U == "string" && U.length > 0 && (P[U] = g.active), typeof L == "string" && L.length > 0 && (P[L] = !g.active), M && g.active !== M.state) {
3951
4080
  const Y = M.node;
3952
4081
  g.active ? d.unshift(() => {
3953
4082
  const at = () => {
3954
- let Ae = tr(Y);
3955
- Ae != null && rr(Ae, qt.ACTIVATED);
4083
+ let Ee = tr(Y);
4084
+ Ee != null && rr(Ee, qt.ACTIVATED);
3956
4085
  };
3957
- zs(t, Y, s, g.route, v, b, at);
4086
+ Js(t, Y, s, g.route, v, b, at);
3958
4087
  }) : d.push(() => {
3959
4088
  const at = () => {
3960
- const Ae = tr(Y);
3961
- Ae != null && rr(Ae, qt.DEACTIVATED);
4089
+ const Ee = tr(Y);
4090
+ Ee != null && rr(Ee, qt.DEACTIVATED);
3962
4091
  };
3963
- Js(t, Y, s, g.route, v, b, at);
4092
+ Gs(t, Y, s, g.route, v, b, at);
3964
4093
  });
3965
4094
  }
3966
4095
  const X = {
3967
- class: S,
4096
+ class: P,
3968
4097
  key: _
3969
4098
  }, W = oe(s.viewTagProps, g.route, v);
3970
4099
  if (W !== null && typeof W == "object") {
3971
4100
  const Y = be(W, n?.propsFilter);
3972
- $(!0, X, Y);
4101
+ q(!0, X, Y);
3973
4102
  }
3974
4103
  if (g.route?.viewTagAttrs && typeof g.route?.viewTagAttrs == "object") {
3975
4104
  const Y = be(g.route.viewTagAttrs, n?.propsFilter);
3976
- $(!0, X, Y);
4105
+ q(!0, X, Y);
3977
4106
  }
3978
4107
  const re = oe(s.viewTag, g.route, v), lt = he(re, X, { default: () => [E] });
3979
- if (c.set(_, new Qs(lt, g.active)), u.value.delete(_), b) {
4108
+ if (c.set(_, new Xs(lt, g.active)), f.value.delete(_), b) {
3980
4109
  const Y = Ot(t, s, g.route, v);
3981
4110
  lt.transition = Y;
3982
4111
  }
3983
4112
  h.push(lt);
3984
4113
  }
3985
- u.value.forEach((v) => {
4114
+ f.value.forEach((v) => {
3986
4115
  v.node.transition = null;
3987
- }), u.value = c, Gs(d, t);
4116
+ }), f.value = c, Qs(d, t);
3988
4117
  const m = oe(s.tag, null, -1), p = {};
3989
4118
  return Object.assign(p, e.attrs), he(m, p, { default: () => h });
3990
- } else if (f != null) {
3991
- const c = f.model, h = {};
4119
+ } else if (u != null) {
4120
+ const c = u.model, h = {};
3992
4121
  if (c.props) {
3993
4122
  if (typeof c.props == "object") {
3994
4123
  const d = be(c.props, n?.propsFilter);
3995
- $(!1, h, d);
3996
- } else if (c.props === !0 && typeof f.route?.params == "object") {
3997
- const d = be(f.route.params, n?.propsFilter);
3998
- $(!1, h, d);
4124
+ q(!1, h, d);
4125
+ } else if (c.props === !0 && typeof u.route?.params == "object") {
4126
+ const d = be(u.route.params, n?.propsFilter);
4127
+ q(!1, h, d);
3999
4128
  }
4000
4129
  }
4001
4130
  const y = he(c.component, h);
4002
- return Kt(e.slots.default, { Component: y, route: f.route }) ?? y;
4131
+ return Kt(e.slots.default, { Component: y, route: u.route }) ?? y;
4003
4132
  } else {
4004
4133
  const c = l.slots.value;
4005
4134
  if (c.length > 0) {
@@ -4007,10 +4136,10 @@ const Lt = wr({
4007
4136
  if (d.props) {
4008
4137
  if (typeof d.props == "object") {
4009
4138
  const g = be(d.props, n?.propsFilter);
4010
- $(!1, m, g);
4139
+ q(!1, m, g);
4011
4140
  } else if (d.props === !0 && typeof y?.params == "object") {
4012
4141
  const g = be(y.params, n?.propsFilter);
4013
- $(!1, m, g);
4142
+ q(!1, m, g);
4014
4143
  }
4015
4144
  }
4016
4145
  const p = he(d.component, m);
@@ -4025,7 +4154,7 @@ const Lt = wr({
4025
4154
  };
4026
4155
  }
4027
4156
  });
4028
- function Xs(s) {
4157
+ function Ys(s) {
4029
4158
  if (!(s.metaKey || s.altKey || s.ctrlKey || s.shiftKey) && !s.defaultPrevented && !(s.button != null && s.button !== 0)) {
4030
4159
  if (s.currentTarget && s.currentTarget.getAttribute) {
4031
4160
  const e = s.currentTarget.getAttribute("target");
@@ -4035,16 +4164,16 @@ function Xs(s) {
4035
4164
  return s.preventDefault && s.preventDefault(), !0;
4036
4165
  }
4037
4166
  }
4038
- function Ys(s, e) {
4167
+ function Zs(s, e) {
4039
4168
  return s == null || e == null ? !1 : !!(s === e || s.path && s.path === e.path || s.name && s.name === e.name);
4040
4169
  }
4041
- function Zs(s, e) {
4170
+ function en(s, e) {
4042
4171
  return s == null || e == null ? !1 : !!(s.path && e.path && e.path.startsWith(s.path) || s.name && s.name == e.name);
4043
4172
  }
4044
4173
  function xe(s, e) {
4045
4174
  return typeof s == "function" ? Reflect.apply(s, {}, [e]) : s;
4046
4175
  }
4047
- let en = wr({
4176
+ let tn = br({
4048
4177
  //名称
4049
4178
  name: "RouterLink",
4050
4179
  //继承特性
@@ -4102,14 +4231,14 @@ let en = wr({
4102
4231
  let i = null, o = null;
4103
4232
  t !== null && (i = t[I](r), s.root && (i.root = s.root), o = t.current);
4104
4233
  let a = {}, l = xe(s.activeClass, i);
4105
- if (typeof l == "string" && l.length > 0 && (a[l] = Zs(i, o)), xe(s.exact, i) === !0) {
4234
+ if (typeof l == "string" && l.length > 0 && (a[l] = en(i, o)), xe(s.exact, i) === !0) {
4106
4235
  let h = xe(s.exactActiveClass, i);
4107
- typeof h == "string" && h.length > 0 && (a[h] = Ys(i, o));
4236
+ typeof h == "string" && h.length > 0 && (a[h] = Zs(i, o));
4108
4237
  }
4109
- let u = {
4238
+ let f = {
4110
4239
  class: a
4111
4240
  };
4112
- (n === "a" || n === "A") && (u.href = i?.path ?? i?.name ?? "#"), $(!0, u, e.attrs);
4241
+ (n === "a" || n === "A") && (f.href = i?.path ?? i?.name ?? "#"), q(!0, f, e.attrs);
4113
4242
  let c = xe(s.event, i);
4114
4243
  if (typeof c == "string") {
4115
4244
  const h = (y) => {
@@ -4121,16 +4250,16 @@ let en = wr({
4121
4250
  console.warn("route is not been resolved");
4122
4251
  return;
4123
4252
  }
4124
- Xs(y) && t.to(i);
4253
+ Ys(y) && t.to(i);
4125
4254
  };
4126
- u[c] = h;
4255
+ f[c] = h;
4127
4256
  }
4128
- return he(n, u, e.slots);
4257
+ return he(n, f, e.slots);
4129
4258
  };
4130
4259
  }
4131
4260
  });
4132
4261
  var O = /* @__PURE__ */ ((s) => (s[s.Loading = 0] = "Loading", s[s.Loaded = 1] = "Loaded", s[s.Defining = 2] = "Defining", s[s.Defined = 3] = "Defined", s))(O || {}), et = /* @__PURE__ */ ((s) => (s[s.normal = 0] = "normal", s[s.factory = 1] = "factory", s))(et || {});
4133
- class tn {
4262
+ class rn {
4134
4263
  /**
4135
4264
  * 注册表
4136
4265
  */
@@ -4179,11 +4308,11 @@ class tn {
4179
4308
  this.register.clear();
4180
4309
  }
4181
4310
  }
4182
- class vr {
4311
+ class gr {
4183
4312
  /**
4184
4313
  * module manager
4185
4314
  */
4186
- moduleManager = new tn();
4315
+ moduleManager = new rn();
4187
4316
  /**
4188
4317
  * 参数配置
4189
4318
  */
@@ -4294,31 +4423,31 @@ class vr {
4294
4423
  typeof e[r] == "function" && (i = e[r], r--);
4295
4424
  for (let l = 0; l <= r; l++)
4296
4425
  if (Array.isArray(e[l])) {
4297
- let f = e[l];
4298
- for (let u = 0; u < f.length; u++)
4299
- f[u] && t.push(this.resolvePath(f[u]));
4426
+ let u = e[l];
4427
+ for (let f = 0; f < u.length; f++)
4428
+ u[f] && t.push(this.resolvePath(u[f]));
4300
4429
  } else if (typeof e[l] == "string") {
4301
- let f = e[l].split(",");
4302
- for (let u = 0; u < f.length; u++)
4303
- f[u] && t.push(this.resolvePath(f[u]));
4430
+ let u = e[l].split(",");
4431
+ for (let f = 0; f < u.length; f++)
4432
+ u[f] && t.push(this.resolvePath(u[f]));
4304
4433
  }
4305
- const o = new rn(t.length, (l, f) => {
4434
+ const o = new sn(t.length, (l, u) => {
4306
4435
  if (o.isOK())
4307
4436
  try {
4308
- typeof i == "function" && Reflect.apply(i, {}, f);
4309
- } catch (u) {
4310
- console.error(u.message, u);
4437
+ typeof i == "function" && Reflect.apply(i, {}, u);
4438
+ } catch (f) {
4439
+ console.error(f.message, f);
4311
4440
  }
4312
4441
  else
4313
4442
  try {
4314
4443
  console.error(l), typeof i == "function" && Reflect.apply(i, {}, []);
4315
- } catch (u) {
4316
- console.error(u.message, u);
4444
+ } catch (f) {
4445
+ console.error(f.message, f);
4317
4446
  }
4318
4447
  }), a = new rt();
4319
4448
  for (let l = 0; l < t.length; l++) {
4320
- const f = new sn(l, t[l], n, o);
4321
- this.mount(a, f);
4449
+ const u = new nn(l, t[l], n, o);
4450
+ this.mount(a, u);
4322
4451
  }
4323
4452
  return this;
4324
4453
  }
@@ -4428,11 +4557,11 @@ class vr {
4428
4557
  }
4429
4558
  };
4430
4559
  setTimeout(() => {
4431
- Hr(l, c);
4560
+ Dr(l, c);
4432
4561
  }, 1);
4433
4562
  }
4434
- let u = a.getElementById(i);
4435
- u && u.parentNode && u.parentNode.removeChild(u), l.rel = "stylesheet", l.type = "text/css", l.id = i, l.href = i, r.appendChild(l);
4563
+ let f = a.getElementById(i);
4564
+ f && f.parentNode && f.parentNode.removeChild(f), l.rel = "stylesheet", l.type = "text/css", l.id = i, l.href = i, r.appendChild(l);
4436
4565
  });
4437
4566
  }
4438
4567
  /**
@@ -4467,7 +4596,7 @@ class vr {
4467
4596
  const l = De().createElement("script");
4468
4597
  if ("onload" in l)
4469
4598
  l.onload = () => {
4470
- l.onload = null, l.onerror = null, o.status == O.Loading && (o.status = O.Loaded, t.progress.work(!0, t.index, i)), n.resolve();
4599
+ l.onload = null, l.onerror = null, o.status === O.Loading && (o.status = O.Loaded, t.progress.work(!0, t.index, i)), n.resolve();
4471
4600
  }, l.onerror = () => {
4472
4601
  try {
4473
4602
  r.removeChild(l);
@@ -4483,8 +4612,8 @@ class vr {
4483
4612
  };
4484
4613
  }
4485
4614
  l.defer = !0, l.src = i;
4486
- const u = j();
4487
- u.define = this.createDefine(o, t), r.appendChild(l);
4615
+ const f = T();
4616
+ f.define = this.createDefine(o, t), r.appendChild(l);
4488
4617
  });
4489
4618
  }
4490
4619
  /**
@@ -4524,9 +4653,9 @@ class vr {
4524
4653
  createDefine(e, t) {
4525
4654
  const r = this, n = function(...i) {
4526
4655
  e.status = O.Defining;
4527
- let o, a, l, f = i.length;
4528
- f === 1 ? (l = i[0], o = void 0) : f === 2 ? (l = i[1], Array.isArray(i[0]) ? (a = r.trimEmptyElement(i[0]), o = void 0) : a = void 0) : (o = i[0], a = r.trimEmptyElement(i[1]), l = i[2]), o && (e.id = o, r.options.alias[o] = e.src), a && a.length > 0 ? r.ensure(a, (...u) => {
4529
- const c = u.map((h) => h === "exports" ? ((!e.exports || typeof e.exports != "object") && (e.exports = {}), e.exports) : h === "module" ? e : h);
4656
+ let o, a, l, u = i.length;
4657
+ u === 1 ? (l = i[0], o = void 0) : u === 2 ? (l = i[1], Array.isArray(i[0]) ? (a = r.trimEmptyElement(i[0]), o = void 0) : a = void 0) : (o = i[0], a = r.trimEmptyElement(i[1]), l = i[2]), o && (e.id = o, r.options.alias[o] = e.src), a && a.length > 0 ? r.ensure(a, (...f) => {
4658
+ const c = f.map((h) => h === "exports" ? ((!e.exports || typeof e.exports != "object") && (e.exports = {}), e.exports) : h === "module" ? e : h);
4530
4659
  if (typeof l == "function") {
4531
4660
  const h = Reflect.apply(l, e, c);
4532
4661
  h && typeof h == "object" && (e.exports = h);
@@ -4608,11 +4737,11 @@ class vr {
4608
4737
  if (e.indexOf("http://") == 0 || e.indexOf("https://") == 0 || e.indexOf("file:///") == 0)
4609
4738
  return e;
4610
4739
  if (e.indexOf("/") == 0)
4611
- return `${ft()}${e.slice(1)}`;
4740
+ return `${ut()}${e.slice(1)}`;
4612
4741
  if (e.indexOf("./") == 0)
4613
- return `${ft()}${e.slice(2)}`;
4742
+ return `${ut()}${e.slice(2)}`;
4614
4743
  if (e.indexOf("//") == 0)
4615
- return `${j().location.protocol}${e}`;
4744
+ return `${T().location.protocol}${e}`;
4616
4745
  if (t) {
4617
4746
  let n = this.options.alias[e];
4618
4747
  if (!n) {
@@ -4626,10 +4755,10 @@ class vr {
4626
4755
  }
4627
4756
  return this.parserPath(n, !1);
4628
4757
  }
4629
- return `${ft()}${e}`;
4758
+ return `${ut()}${e}`;
4630
4759
  }
4631
4760
  }
4632
- function Hr(s, e) {
4761
+ function Dr(s, e) {
4633
4762
  let t = s.sheet, r = !1;
4634
4763
  if (e.isOldWebKit)
4635
4764
  t && (r = !0);
@@ -4640,10 +4769,10 @@ function Hr(s, e) {
4640
4769
  n.name === "NS_ERROR_DOM_SECURITY_ERR" && (r = !0);
4641
4770
  }
4642
4771
  setTimeout(() => {
4643
- e.time += 20, r ? e.success() : e.timeout > e.timeout ? e.error() : Hr(s, e);
4772
+ e.time += 20, r ? e.success() : e.timeout > e.timeout ? e.error() : Dr(s, e);
4644
4773
  }, 20);
4645
4774
  }
4646
- class rn {
4775
+ class sn {
4647
4776
  /**
4648
4777
  * 回调函数
4649
4778
  */
@@ -4691,7 +4820,7 @@ class rn {
4691
4820
  return this.status;
4692
4821
  }
4693
4822
  }
4694
- class sn {
4823
+ class nn {
4695
4824
  /**
4696
4825
  * 索引
4697
4826
  */
@@ -4719,9 +4848,9 @@ class sn {
4719
4848
  this.index = e, this.src = t, this.params = r, this.progress = n;
4720
4849
  }
4721
4850
  }
4722
- const Dr = Symbol("fk"), Vr = Symbol("fbk"), Br = Symbol("fepk");
4723
- function wn(s = {}) {
4724
- const e = new Ts(s), t = new Xt(), r = new er(), n = new vr(), i = {
4851
+ const Vr = Symbol("fk"), Br = Symbol("fbk"), kr = Symbol("fepk");
4852
+ function bn(s = {}) {
4853
+ const e = new qs(s), t = new Xt(), r = new er(), n = new gr(), i = {
4725
4854
  /**
4726
4855
  * 返回router
4727
4856
  */
@@ -4762,7 +4891,7 @@ function wn(s = {}) {
4762
4891
  * 返回Require构造函数
4763
4892
  */
4764
4893
  get Require() {
4765
- return vr;
4894
+ return gr;
4766
4895
  },
4767
4896
  /**
4768
4897
  * 返回require
@@ -4774,7 +4903,7 @@ function wn(s = {}) {
4774
4903
  * 返回extend
4775
4904
  */
4776
4905
  get extend() {
4777
- return $;
4906
+ return q;
4778
4907
  },
4779
4908
  /**
4780
4909
  * 返回clone
@@ -4786,13 +4915,13 @@ function wn(s = {}) {
4786
4915
  * 判断是否为es模块
4787
4916
  */
4788
4917
  get isESModule() {
4789
- return br;
4918
+ return xr;
4790
4919
  },
4791
4920
  /**
4792
4921
  * 安装
4793
4922
  */
4794
4923
  install(o) {
4795
- o.provide(ot, e), o.provide(Dr, i), o.provide(Vr, t), o.provide(Br, r), o.component(qs, Lt), o.component(js, en), Reflect.defineProperty(o.config.globalProperties, "$fox", {
4924
+ o.provide(ot, e), o.provide(Vr, i), o.provide(Br, t), o.provide(kr, r), o.component(js, Lt), o.component(Os, tn), Reflect.defineProperty(o.config.globalProperties, "$fox", {
4796
4925
  get() {
4797
4926
  return i;
4798
4927
  }
@@ -4812,8 +4941,8 @@ function wn(s = {}) {
4812
4941
  get() {
4813
4942
  return r;
4814
4943
  }
4815
- }), o.config.globalProperties.$fox_on = function(a, l, f = !1) {
4816
- r.on(a, l, f);
4944
+ }), o.config.globalProperties.$fox_on = function(a, l, u = !1) {
4945
+ r.on(a, l, u);
4817
4946
  }, o.config.globalProperties.$fox_off = function(a, l) {
4818
4947
  r.off(a, l);
4819
4948
  }, o.config.globalProperties.$fox_once = function(a, l) {
@@ -4822,11 +4951,11 @@ function wn(s = {}) {
4822
4951
  let l = r;
4823
4952
  Reflect.apply(l.all, l, a);
4824
4953
  }, o.config.globalProperties.$fox_trigger = function(a, ...l) {
4825
- let f = r;
4826
- Reflect.apply(f.trigger, f, [a, ...l]);
4954
+ let u = r;
4955
+ Reflect.apply(u.trigger, u, [a, ...l]);
4827
4956
  }, o.config.globalProperties.$fox_emit = function(a, ...l) {
4828
- let f = r;
4829
- Reflect.apply(f.trigger, f, [a, ...l]);
4957
+ let u = r;
4958
+ Reflect.apply(u.trigger, u, [a, ...l]);
4830
4959
  }, o.mixin({
4831
4960
  //计算属性
4832
4961
  computed: {
@@ -4843,19 +4972,19 @@ function wn(s = {}) {
4843
4972
  function Ur(s) {
4844
4973
  return s ? s.$router : G(ot);
4845
4974
  }
4846
- function bn(s) {
4847
- return s || (s = Mt()?.proxy ?? void 0), s ? Vt(s) : null;
4848
- }
4849
4975
  function xn(s) {
4850
- return s ? s.$fox : G(Dr);
4976
+ return s || (s = Mt()?.proxy ?? void 0), s ? Vt(s) : null;
4851
4977
  }
4852
4978
  function Rn(s) {
4853
- return s ? s.$bus : G(Vr);
4979
+ return s ? s.$fox : G(Vr);
4854
4980
  }
4855
4981
  function Sn(s) {
4856
- return s ? s.$eventProxy : G(Br);
4982
+ return s ? s.$bus : G(Br);
4857
4983
  }
4858
4984
  function Pn(s) {
4985
+ return s ? s.$eventProxy : G(kr);
4986
+ }
4987
+ function Cn(s) {
4859
4988
  const e = Ur(), t = (r, n, i) => {
4860
4989
  try {
4861
4990
  Reflect.apply(s, {}, [r, n]);
@@ -4868,7 +4997,7 @@ function Pn(s) {
4868
4997
  e.removeBeforeEach(t);
4869
4998
  });
4870
4999
  }
4871
- function Cn(s) {
5000
+ function An(s) {
4872
5001
  const e = Ur(), t = (r, n, i) => {
4873
5002
  try {
4874
5003
  Reflect.apply(s, {}, [r, n]);
@@ -4885,44 +5014,44 @@ export {
4885
5014
  Xt as Bus,
4886
5015
  rt as EventChain,
4887
5016
  er as EventProxy,
4888
- q as Route,
5017
+ R as Route,
4889
5018
  It as clone,
4890
- wn as createFox,
4891
- _s as createMemoryHistory,
4892
- As as createWebHashHistory,
4893
- gn as createWebHistory,
4894
- pn as deleteContextValue,
4895
- $ as extend,
4896
- Vr as foxBusKey,
4897
- Br as foxEventProxyKey,
4898
- Dr as foxKey,
4899
- Fr as injectContextValue,
4900
- on as isArray,
5019
+ bn as createFox,
5020
+ Ks as createMemoryHistory,
5021
+ Fs as createWebHashHistory,
5022
+ wn as createWebHistory,
5023
+ mn as deleteContextValue,
5024
+ q as extend,
5025
+ Br as foxBusKey,
5026
+ kr as foxEventProxyKey,
5027
+ Vr as foxKey,
5028
+ _r as injectContextValue,
5029
+ ln as isArray,
4901
5030
  fn as isDate,
4902
- br as isESModule,
5031
+ xr as isESModule,
4903
5032
  Jt as isEqual,
4904
- R as isFunction,
4905
- ln as isMap,
4906
- Jr as isNil,
4907
- zr as isObject,
4908
- Qr as isPlainObject,
4909
- hn as isPromise,
4910
- an as isSet,
4911
- un as isString,
4912
- cn as isSymbol,
4913
- Cn as onAfterRouteUpdate,
4914
- Pn as onBeforeRouteUpdate,
4915
- mn as onFoxActivated,
4916
- vn as onFoxInactivated,
4917
- dn as provideContextValue,
5033
+ S as isFunction,
5034
+ an as isMap,
5035
+ Gr as isNil,
5036
+ Jr as isObject,
5037
+ Xr as isPlainObject,
5038
+ yn as isPromise,
5039
+ un as isSet,
5040
+ cn as isString,
5041
+ hn as isSymbol,
5042
+ An as onAfterRouteUpdate,
5043
+ Cn as onBeforeRouteUpdate,
5044
+ vn as onFoxActivated,
5045
+ gn as onFoxInactivated,
5046
+ pn as provideContextValue,
4918
5047
  ae as sessionKey,
4919
- xr as toBoolean,
4920
- yn as toNumber,
5048
+ Rr as toBoolean,
5049
+ dn as toNumber,
4921
5050
  Nt as toTypeString,
4922
5051
  zt as typeOf,
4923
- Rn as useBus,
4924
- Sn as useEventProxy,
4925
- xn as useFox,
4926
- bn as useRoute,
5052
+ Sn as useBus,
5053
+ Pn as useEventProxy,
5054
+ Rn as useFox,
5055
+ xn as useRoute,
4927
5056
  Ur as useRouter
4928
5057
  };