@fox-js/fox 3.1.1-27 → 3.1.1-28
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.cjs.js +1 -1
- package/libs/index.esm.js +189 -193
- package/libs/index.umd.js +1 -1
- package/package.json +1 -1
package/libs/index.esm.js
CHANGED
|
@@ -7,7 +7,7 @@ var Ee = typeof window < "u", C = function() {
|
|
|
7
7
|
function ft(e, t, r, s = !1) {
|
|
8
8
|
e.addEventListener ? e.addEventListener(t, r, s) : e.attachEvent ? e.attachEvent(`on${t}`, r) : e[`on${t}`] = r;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Qt(e, t, r) {
|
|
11
11
|
e.removeEventListener ? e.removeEventListener(t, r) : e.detachEvent ? e.detachEvent(`on${t}`, r) : e[`on${t}`] = null;
|
|
12
12
|
}
|
|
13
13
|
var ze = (e, t, r) => {
|
|
@@ -20,8 +20,8 @@ var ze = (e, t, r) => {
|
|
|
20
20
|
let i = !0, n = !0;
|
|
21
21
|
for (let o in t) o === "bubbles" ? i = !!t[o] : o === "cancelable" ? n = !!t[o] : s[o] = t[o];
|
|
22
22
|
s.initEvent(e, i, n), (r ?? document).dispatchEvent(s);
|
|
23
|
-
},
|
|
24
|
-
function
|
|
23
|
+
}, nr = Array.isArray, Li = (e) => Zt(e) === "[object Map]", Mi = (e) => Zt(e) === "[object Set]", Ti = (e) => e instanceof Date, w = (e) => typeof e == "function", ki = (e) => typeof e == "string", Ii = (e) => typeof e == "symbol", gs = (e) => e !== null && typeof e == "object", Oi = (e) => gs(e) && w(e.then) && w(e.catch), We = (e) => e == null, bs = Object.prototype.toString, Zt = (e) => bs.call(e), ws = (e) => Zt(e) === "[object Object]", Rs = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
|
|
24
|
+
function Yt(e) {
|
|
25
25
|
return e.__esModule || Rs && e[Symbol.toStringTag] === "Module";
|
|
26
26
|
}
|
|
27
27
|
var xs = typeof Promise < "u" && Promise.toString().indexOf("[native code]") !== -1;
|
|
@@ -70,10 +70,10 @@ function He(e, ...t) {
|
|
|
70
70
|
e(t);
|
|
71
71
|
}) : setTimeout(e);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Tr(e) {
|
|
74
74
|
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e.toLocaleLowerCase() === "true" : !!e;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Bi(e) {
|
|
77
77
|
return typeof e == "number" ? e : Number(e);
|
|
78
78
|
}
|
|
79
79
|
var Ss = {
|
|
@@ -86,38 +86,38 @@ var Ss = {
|
|
|
86
86
|
"[object RegExp]": "regExp",
|
|
87
87
|
"[object Object]": "object"
|
|
88
88
|
};
|
|
89
|
-
function
|
|
89
|
+
function or(e) {
|
|
90
90
|
let t = Object.prototype.toString.call(e);
|
|
91
91
|
return e == null ? String(e) : Ss[t] || "object";
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function lr(e, t) {
|
|
94
94
|
if (e == t) return !0;
|
|
95
95
|
if (e === void 0 || t === void 0) return !1;
|
|
96
|
-
let r =
|
|
97
|
-
if (r !==
|
|
96
|
+
let r = or(e);
|
|
97
|
+
if (r !== or(t)) return !1;
|
|
98
98
|
if (r === "object") {
|
|
99
99
|
let s = Object.keys(e), i = Object.keys(t);
|
|
100
100
|
if (s.length !== i.length) return !1;
|
|
101
101
|
for (let n = 0; n < s.length; n++) {
|
|
102
102
|
let o = s[n], l = e[o], a = t[o];
|
|
103
|
-
if (!
|
|
103
|
+
if (!lr(l, a)) return !1;
|
|
104
104
|
}
|
|
105
105
|
return !0;
|
|
106
106
|
} else if (r === "array") {
|
|
107
107
|
if (e.length !== t.length) return !1;
|
|
108
108
|
for (let s = 0; s < e.length; s++) {
|
|
109
109
|
let i = e[s], n = t[s];
|
|
110
|
-
if (!
|
|
110
|
+
if (!lr(i, n)) return !1;
|
|
111
111
|
}
|
|
112
112
|
return !0;
|
|
113
113
|
}
|
|
114
114
|
return !1;
|
|
115
115
|
}
|
|
116
|
-
var
|
|
116
|
+
var kr = (e) => {
|
|
117
117
|
const t = {};
|
|
118
118
|
for (let r of Reflect.ownKeys(e)) {
|
|
119
119
|
let s = e[r];
|
|
120
|
-
s && !Array.isArray(s) && typeof s == "object" && (s =
|
|
120
|
+
s && !Array.isArray(s) && typeof s == "object" && (s = kr(s)), typeof r == "symbol" ? t[String(r)] = s : t[r] = s;
|
|
121
121
|
}
|
|
122
122
|
return t;
|
|
123
123
|
}, Es = /^Symbol\((.*)\)$/, Ir = (e) => {
|
|
@@ -141,13 +141,13 @@ function Or(e, t) {
|
|
|
141
141
|
}, t);
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
var
|
|
144
|
+
var ar = /* @__PURE__ */ Symbol("idKey"), me = /* @__PURE__ */ Symbol("valueKey"), R = /* @__PURE__ */ Symbol("childrenKey"), X = /* @__PURE__ */ Symbol("growKey"), Br = class {
|
|
145
145
|
[X] = !0;
|
|
146
|
-
[
|
|
146
|
+
[ar];
|
|
147
147
|
[me] = ms();
|
|
148
148
|
[R] = /* @__PURE__ */ new Map();
|
|
149
149
|
constructor(e) {
|
|
150
|
-
this[
|
|
150
|
+
this[ar] = e;
|
|
151
151
|
}
|
|
152
152
|
}, Ps = class {
|
|
153
153
|
get(e, t) {
|
|
@@ -156,21 +156,21 @@ var ur = /* @__PURE__ */ Symbol("idKey"), me = /* @__PURE__ */ Symbol("valueKey"
|
|
|
156
156
|
let r = e[R].get(t);
|
|
157
157
|
if (r) return Ue(r);
|
|
158
158
|
if (e[X])
|
|
159
|
-
return r =
|
|
159
|
+
return r = tr(t), r[X] = e[X], e[R].set(t, r), Ue(r);
|
|
160
160
|
}
|
|
161
161
|
set(e, t, r) {
|
|
162
|
-
return t == "value" ? (e[me].value = r, !0) : t === "grow" ? (e[X] =
|
|
162
|
+
return t == "value" ? (e[me].value = r, !0) : t === "grow" ? (e[X] = Tr(r), !0) : r == null ? (e[R].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
163
163
|
}
|
|
164
164
|
deleteProperty(e, t) {
|
|
165
165
|
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[R].delete(t), !0);
|
|
166
166
|
}
|
|
167
|
-
},
|
|
168
|
-
function
|
|
167
|
+
}, er = "__proxy__";
|
|
168
|
+
function tr(e) {
|
|
169
169
|
const t = new Br(e);
|
|
170
|
-
return Reflect.set(t,
|
|
170
|
+
return Reflect.set(t, er, new Proxy(t, new Ps())), t;
|
|
171
171
|
}
|
|
172
172
|
function Ue(e) {
|
|
173
|
-
return Reflect.get(e,
|
|
173
|
+
return Reflect.get(e, er);
|
|
174
174
|
}
|
|
175
175
|
var _s = class {
|
|
176
176
|
name = "";
|
|
@@ -263,7 +263,7 @@ var _s = class {
|
|
|
263
263
|
let r = this;
|
|
264
264
|
for (let s = 0; s < t - 1; s++) {
|
|
265
265
|
let i = e[s], n;
|
|
266
|
-
r[R].has(i) ? n = r[R].get(i) : (n =
|
|
266
|
+
r[R].has(i) ? n = r[R].get(i) : (n = tr(i), r[R].set(i, n)), r = n;
|
|
267
267
|
}
|
|
268
268
|
return r[me].value = e[t - 1], this._persistHandler.put(e), !0;
|
|
269
269
|
}
|
|
@@ -313,7 +313,7 @@ var _s = class {
|
|
|
313
313
|
"clear",
|
|
314
314
|
"_persistHandler"
|
|
315
315
|
];
|
|
316
|
-
function
|
|
316
|
+
function ur(e) {
|
|
317
317
|
return Fs.includes(e);
|
|
318
318
|
}
|
|
319
319
|
var Cs = class {
|
|
@@ -321,15 +321,15 @@ var Cs = class {
|
|
|
321
321
|
if (t == "value") return e[me].value;
|
|
322
322
|
if (t === "grow") return e[X];
|
|
323
323
|
if (t === R) return e[R];
|
|
324
|
-
if (typeof t == "string" &&
|
|
324
|
+
if (typeof t == "string" && ur(t)) return e[t];
|
|
325
325
|
const r = String(t);
|
|
326
326
|
let s = e[R].get(r);
|
|
327
327
|
if (s) return Ue(s);
|
|
328
328
|
if (e[X])
|
|
329
|
-
return s =
|
|
329
|
+
return s = tr(r), s[X] = e[X], e[R].set(r, s), Ue(s);
|
|
330
330
|
}
|
|
331
331
|
set(e, t, r) {
|
|
332
|
-
return t == "value" ? (e[me].value = r, !0) : t === "grow" ? (e[X] =
|
|
332
|
+
return t == "value" ? (e[me].value = r, !0) : t === "grow" ? (e[X] = Tr(r), !0) : ur(t) ? !1 : r == null ? (e[R].delete(t), !0) : (console.error(`[Fox]illegal property:${t}`), !1);
|
|
333
333
|
}
|
|
334
334
|
deleteProperty(e, t) {
|
|
335
335
|
return t === "value" || t == "grow" ? (console.error(`[Fox]can not delete property:${String(t)}`), !1) : (e[R].delete(t), !0);
|
|
@@ -337,12 +337,12 @@ var Cs = class {
|
|
|
337
337
|
};
|
|
338
338
|
function As(e, t) {
|
|
339
339
|
const r = new Dr(e, t), s = new Cs(), i = new Proxy(r, s);
|
|
340
|
-
return Reflect.set(r,
|
|
340
|
+
return Reflect.set(r, er, i), r;
|
|
341
341
|
}
|
|
342
|
-
var
|
|
342
|
+
var fr = new Proxy(Dr, { construct(e, t) {
|
|
343
343
|
const r = t[0] ?? {}, s = t[1];
|
|
344
344
|
return Ue(As(r, s));
|
|
345
|
-
} }),
|
|
345
|
+
} }), rr = (e) => !e || typeof e != "object" ? !0 : Reflect.ownKeys(e).length === 0, Hr = class {
|
|
346
346
|
name = "";
|
|
347
347
|
persistPolicy = "memory";
|
|
348
348
|
storage;
|
|
@@ -363,7 +363,7 @@ var cr = new Proxy(Dr, { construct(e, t) {
|
|
|
363
363
|
saveState(e) {
|
|
364
364
|
if (!this.persistPolicy || this.persistPolicy === "memory") return;
|
|
365
365
|
let t = this.getStorage();
|
|
366
|
-
if (t === null ||
|
|
366
|
+
if (t === null || rr(e)) return;
|
|
367
367
|
const r = `_state_${this.name}`, s = JSON.stringify(e ?? {});
|
|
368
368
|
t.setItem(r, s);
|
|
369
369
|
}
|
|
@@ -394,7 +394,7 @@ function Nr(e, t, r) {
|
|
|
394
394
|
const c = a[f];
|
|
395
395
|
We(c) || (u[f] = c);
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
rr(u) ? s.removeState() : s.saveState(u);
|
|
398
398
|
};
|
|
399
399
|
let n = null;
|
|
400
400
|
r && r.debounce === !1 ? n = i : n = Or(i, r && r.debounceDelay ? r.debounceDelay : 250);
|
|
@@ -406,10 +406,10 @@ function Nr(e, t, r) {
|
|
|
406
406
|
});
|
|
407
407
|
}), o;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function Di(e, t) {
|
|
410
410
|
return Nr(!1, e, t);
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Hi(e, t) {
|
|
413
413
|
return Nr(!0, e, t);
|
|
414
414
|
}
|
|
415
415
|
function qs(e, t) {
|
|
@@ -421,7 +421,7 @@ function qs(e, t) {
|
|
|
421
421
|
const u = o[a];
|
|
422
422
|
We(u) || (l[a] = u);
|
|
423
423
|
}
|
|
424
|
-
|
|
424
|
+
rr(l) ? r.removeState() : r.saveState(l);
|
|
425
425
|
};
|
|
426
426
|
let i = null;
|
|
427
427
|
return t && t.debounce === !1 ? i = s : i = Or(s, t && t.debounceDelay ? t.debounceDelay : 250), new Proxy(e, {
|
|
@@ -433,7 +433,7 @@ function qs(e, t) {
|
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function Ni(e, t) {
|
|
437
437
|
return qs(e, t);
|
|
438
438
|
}
|
|
439
439
|
var de = /* @__PURE__ */ (function(e) {
|
|
@@ -501,7 +501,7 @@ function Ks(e) {
|
|
|
501
501
|
}
|
|
502
502
|
return r === P.ParamRegExp && t(`Unfinished custom RegExp for param "${u}"`), c(), o(), i;
|
|
503
503
|
}
|
|
504
|
-
var
|
|
504
|
+
var cr = "[^/]+?", Ls = {
|
|
505
505
|
sensitive: !1,
|
|
506
506
|
strict: !1,
|
|
507
507
|
start: !0,
|
|
@@ -509,7 +509,7 @@ var hr = "[^/]+?", Ls = {
|
|
|
509
509
|
}, J = /* @__PURE__ */ (function(e) {
|
|
510
510
|
return e[e._multiplier = 10] = "_multiplier", e[e.Root = 9 * e._multiplier] = "Root", e[e.Segment = 4 * e._multiplier] = "Segment", e[e.SubSegment = 3 * e._multiplier] = "SubSegment", e[e.Static = 4 * e._multiplier] = "Static", e[e.Dynamic = 2 * e._multiplier] = "Dynamic", e[e.BonusCustomRegExp = 1 * e._multiplier] = "BonusCustomRegExp", e[e.BonusWildcard = -4 * e._multiplier - e.BonusCustomRegExp] = "BonusWildcard", e[e.BonusRepeatable = -2 * e._multiplier] = "BonusRepeatable", e[e.BonusOptional = -0.8 * e._multiplier] = "BonusOptional", e[e.BonusStrict = 0.07 * e._multiplier] = "BonusStrict", e[e.BonusCaseSensitive = 0.025 * e._multiplier] = "BonusCaseSensitive", e;
|
|
511
511
|
})(J || {}), Ms = /[.+*?^${}()[\]/\\]/g;
|
|
512
|
-
function
|
|
512
|
+
function Ts(e, t) {
|
|
513
513
|
const r = j(!0, {}, Ls, t), s = [];
|
|
514
514
|
let i = r.start ? "^" : "";
|
|
515
515
|
const n = [];
|
|
@@ -528,8 +528,8 @@ function ks(e, t) {
|
|
|
528
528
|
repeatable: m,
|
|
529
529
|
optional: b
|
|
530
530
|
});
|
|
531
|
-
const v = g ||
|
|
532
|
-
if (v !==
|
|
531
|
+
const v = g || cr;
|
|
532
|
+
if (v !== cr) {
|
|
533
533
|
y += J.BonusCustomRegExp;
|
|
534
534
|
try {
|
|
535
535
|
new RegExp(`(${v})`);
|
|
@@ -566,8 +566,8 @@ function ks(e, t) {
|
|
|
566
566
|
for (const y of h) if (y.type === de.Static) f += y.value;
|
|
567
567
|
else if (y.type === de.Param) {
|
|
568
568
|
const { value: d, repeatable: m, optional: b } = y, g = d in u ? u[d] : "";
|
|
569
|
-
if (
|
|
570
|
-
const v =
|
|
569
|
+
if (nr(g) && !m) throw new Error(`Provided param "${d}" is an array but it is not repeatable (* or + modifiers)`);
|
|
570
|
+
const v = nr(g) ? g.join("/") : g;
|
|
571
571
|
if (!v) if (b)
|
|
572
572
|
h.length < 2 && (f.endsWith("/") ? f = f.slice(0, -1) : c = !0);
|
|
573
573
|
else throw new Error(`Missing required param "${d}"`);
|
|
@@ -584,8 +584,8 @@ function ks(e, t) {
|
|
|
584
584
|
stringify: a
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
|
-
function
|
|
588
|
-
const r =
|
|
587
|
+
function ks(e, t) {
|
|
588
|
+
const r = Ts(Ks(e), t);
|
|
589
589
|
return function(s) {
|
|
590
590
|
const i = r.parse(s);
|
|
591
591
|
return i ? {
|
|
@@ -595,7 +595,7 @@ function Ts(e, t) {
|
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
597
|
var Ur = "default", Vr = /* @__PURE__ */ Symbol("sync"), I = /* @__PURE__ */ Symbol("normalizeRoute");
|
|
598
|
-
function
|
|
598
|
+
function hr(e) {
|
|
599
599
|
let t = !1;
|
|
600
600
|
return function(...r) {
|
|
601
601
|
if (!t)
|
|
@@ -605,9 +605,9 @@ function yr(e) {
|
|
|
605
605
|
function Is(e) {
|
|
606
606
|
let t = e.src;
|
|
607
607
|
return new Promise((r, s) => {
|
|
608
|
-
const i =
|
|
609
|
-
|
|
610
|
-
}), n =
|
|
608
|
+
const i = hr((l) => {
|
|
609
|
+
Yt(l) && (l = l.default), e.component = l, console.debug("success load async module"), r();
|
|
610
|
+
}), n = hr((l) => {
|
|
611
611
|
`${l}`, console.debug("reject load async module"), s(l);
|
|
612
612
|
});
|
|
613
613
|
let o;
|
|
@@ -705,7 +705,7 @@ var Os = class {
|
|
|
705
705
|
resolve() {
|
|
706
706
|
return Is(this);
|
|
707
707
|
}
|
|
708
|
-
},
|
|
708
|
+
}, yr = class {
|
|
709
709
|
models = [];
|
|
710
710
|
}, bt = class {
|
|
711
711
|
path;
|
|
@@ -785,9 +785,9 @@ var Os = class {
|
|
|
785
785
|
}
|
|
786
786
|
}, E = /* @__PURE__ */ (function(e) {
|
|
787
787
|
return e.Busy = "Busy", e.Free = "Free", e.Reject = "Reject", e.Exception = "Exception", e.Finished = "Finished", e;
|
|
788
|
-
})(E || {}), B = /* @__PURE__ */ Symbol("chainKey"),
|
|
788
|
+
})(E || {}), B = /* @__PURE__ */ Symbol("chainKey"), k = /* @__PURE__ */ Symbol("cursorKey"), xt = /* @__PURE__ */ Symbol("$persistentModeKey"), _ = /* @__PURE__ */ Symbol("statusKey"), Z = /* @__PURE__ */ Symbol("argsKey"), Xe = /* @__PURE__ */ Symbol("exArgsKey"), pe = /* @__PURE__ */ Symbol("successFnsKey"), $e = /* @__PURE__ */ Symbol("errorFnsKey"), le = /* @__PURE__ */ Symbol("sessionKey"), Y = /* @__PURE__ */ Symbol("_go"), ct = class {
|
|
789
789
|
[B] = [];
|
|
790
|
-
[
|
|
790
|
+
[k] = 0;
|
|
791
791
|
[xt] = !1;
|
|
792
792
|
[_] = E.Free;
|
|
793
793
|
[Z] = [];
|
|
@@ -803,7 +803,7 @@ var Os = class {
|
|
|
803
803
|
}
|
|
804
804
|
[Y](e, ...t) {
|
|
805
805
|
let r = this[_];
|
|
806
|
-
if (this[_] = E.Busy, this[
|
|
806
|
+
if (this[_] = E.Busy, this[k] += e, this[k] < 0 && (this[k] = 0), this[Z] = t, r === E.Exception || r === E.Reject) {
|
|
807
807
|
let n = [{ session: this[le] }, ...this[Xe]];
|
|
808
808
|
for (; this[$e].length > 0; ) try {
|
|
809
809
|
let o = this[$e].shift();
|
|
@@ -813,8 +813,8 @@ var Os = class {
|
|
|
813
813
|
} catch (o) {
|
|
814
814
|
console.error(o.message, o);
|
|
815
815
|
}
|
|
816
|
-
return this[_] = r, this[B] = [], this[
|
|
817
|
-
} else if (r === E.Finished || this[
|
|
816
|
+
return this[_] = r, this[B] = [], this[k] = 0, this;
|
|
817
|
+
} else if (r === E.Finished || this[k] >= this[B].length) {
|
|
818
818
|
let n = [{ session: this[le] }, ...this[Z]];
|
|
819
819
|
for (; this[pe].length > 0; ) {
|
|
820
820
|
let o = this[pe].shift();
|
|
@@ -824,11 +824,11 @@ var Os = class {
|
|
|
824
824
|
}
|
|
825
825
|
return this[_] = E.Free, this;
|
|
826
826
|
}
|
|
827
|
-
if (this[
|
|
827
|
+
if (this[k] >= this[B].length)
|
|
828
828
|
return this[_] = E.Free, this;
|
|
829
|
-
let s = this[B][this[
|
|
830
|
-
this[xt] || (this[B].splice(0, this[
|
|
831
|
-
let i = this[
|
|
829
|
+
let s = this[B][this[k]];
|
|
830
|
+
this[xt] || (this[B].splice(0, this[k] + 1), this[k] = -1);
|
|
831
|
+
let i = this[k] + 1;
|
|
832
832
|
try {
|
|
833
833
|
let n = !1, o = {
|
|
834
834
|
go: (l, ...a) => {
|
|
@@ -866,7 +866,7 @@ var Os = class {
|
|
|
866
866
|
return this[_] = E.Exception, this[Xe] = e, Reflect.apply(this[Y], this, [0]);
|
|
867
867
|
}
|
|
868
868
|
reset(...e) {
|
|
869
|
-
this[_] = E.Busy, this[Z] = e, this[B] = [], this[
|
|
869
|
+
this[_] = E.Busy, this[Z] = e, this[B] = [], this[k] = 0;
|
|
870
870
|
let t = [{ session: this[le] }, ...this[Z]];
|
|
871
871
|
for (; this[pe].length > 0; ) {
|
|
872
872
|
let r = this[pe].shift();
|
|
@@ -886,7 +886,7 @@ var Os = class {
|
|
|
886
886
|
return e && typeof e == "function" && this[$e].push(e), this[_] === E.Busy ? this : Reflect.apply(this[Y], this, [0, ...this[Z]]);
|
|
887
887
|
}
|
|
888
888
|
isFinish() {
|
|
889
|
-
return this[_] == E.Reject || this[_] == E.Free && this[
|
|
889
|
+
return this[_] == E.Reject || this[_] == E.Free && this[k] >= this[B].length;
|
|
890
890
|
}
|
|
891
891
|
}, xe = /* @__PURE__ */ Symbol("_notifyChange"), St = class {
|
|
892
892
|
currentRoute;
|
|
@@ -894,11 +894,11 @@ var Os = class {
|
|
|
894
894
|
constructor(e, t) {
|
|
895
895
|
this.currentRoute = e, this.routes = t;
|
|
896
896
|
}
|
|
897
|
-
}, ae = /* @__PURE__ */ Symbol("historyChangeConsumerKey"),
|
|
897
|
+
}, ae = /* @__PURE__ */ Symbol("historyChangeConsumerKey"), dr = /* @__PURE__ */ Symbol("_navigateFirstRoute"), Qe = /* @__PURE__ */ Symbol("_getRouteMark"), Et = /* @__PURE__ */ Symbol("_getUrlSearch"), Pt = /* @__PURE__ */ Symbol("_generateLocation"), Ze = /* @__PURE__ */ Symbol("_setRouteMarkRecorder"), je = /* @__PURE__ */ Symbol("beforeRestoreFiltersKey"), mr = /* @__PURE__ */ Symbol("_beforeRestore"), vr = "Symbol(_fox_restore_point)";
|
|
898
898
|
function Ye(e, ...t) {
|
|
899
899
|
return typeof e == "function" ? Reflect.apply(e, null, [...t]) : e;
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function pr(e) {
|
|
902
902
|
if (!Array.isArray(e)) return !1;
|
|
903
903
|
if (e.length === 0) return !0;
|
|
904
904
|
const t = e[0];
|
|
@@ -942,12 +942,12 @@ var Jr = class {
|
|
|
942
942
|
} catch {
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
}), ft(t, "popstate", this.historyChange), this.firstNavigate && e && this[
|
|
945
|
+
}), ft(t, "popstate", this.historyChange), this.firstNavigate && e && this[dr](), Promise.resolve();
|
|
946
946
|
}
|
|
947
947
|
destroy() {
|
|
948
|
-
this.historyChange &&
|
|
948
|
+
this.historyChange && Qt(C(), "popstate", this.historyChange);
|
|
949
949
|
}
|
|
950
|
-
[
|
|
950
|
+
[mr](e, t, r, s) {
|
|
951
951
|
for (let i of this[je]) try {
|
|
952
952
|
const n = Reflect.apply(i, {}, [
|
|
953
953
|
e,
|
|
@@ -968,12 +968,12 @@ var Jr = class {
|
|
|
968
968
|
const t = this[je].indexOf(e);
|
|
969
969
|
return t !== -1 ? (this[je].splice(t, 1), !0) : !1;
|
|
970
970
|
}
|
|
971
|
-
[
|
|
972
|
-
const e = this[Qe]() ?? "/", t = this.storage.getItem(
|
|
971
|
+
[dr]() {
|
|
972
|
+
const e = this[Qe]() ?? "/", t = this.storage.getItem(vr);
|
|
973
973
|
if (t) try {
|
|
974
974
|
const n = JSON.parse(t);
|
|
975
975
|
if (n.mark === e && Array.isArray(n.routes) && n.routes.length > 0) {
|
|
976
|
-
const o = n.routes.filter((l, a) => (l.params = l.params ? Ir(l.params) : {}, this[
|
|
976
|
+
const o = n.routes.filter((l, a) => (l.params = l.params ? Ir(l.params) : {}, this[mr](l, a, e, n.routes)));
|
|
977
977
|
if (o.length > 0) {
|
|
978
978
|
const l = this[Et](), a = o.length - 1;
|
|
979
979
|
o[a].query = l || o[a].query, this[xe](o);
|
|
@@ -991,13 +991,13 @@ var Jr = class {
|
|
|
991
991
|
[Ze](e, t) {
|
|
992
992
|
try {
|
|
993
993
|
t.forEach((s) => {
|
|
994
|
-
s.params = s.params ?
|
|
994
|
+
s.params = s.params ? kr(s.params) : {};
|
|
995
995
|
});
|
|
996
996
|
const r = JSON.stringify({
|
|
997
997
|
mark: e,
|
|
998
998
|
routes: t
|
|
999
999
|
});
|
|
1000
|
-
this.storage.setItem(
|
|
1000
|
+
this.storage.setItem(vr, r);
|
|
1001
1001
|
} catch (r) {
|
|
1002
1002
|
console.error(r.message, r);
|
|
1003
1003
|
}
|
|
@@ -1033,7 +1033,7 @@ var Jr = class {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
goBack(e, t) {
|
|
1035
1035
|
const r = C(), s = r.history.state;
|
|
1036
|
-
if (
|
|
1036
|
+
if (pr(s) && s.length > 0) {
|
|
1037
1037
|
let i = !1;
|
|
1038
1038
|
for (let u = s.length - 1; u >= 0; u--) {
|
|
1039
1039
|
const f = x.from(s[u]);
|
|
@@ -1053,7 +1053,7 @@ var Jr = class {
|
|
|
1053
1053
|
}, a = () => {
|
|
1054
1054
|
clearTimeout(o);
|
|
1055
1055
|
const u = C().history.state;
|
|
1056
|
-
if (
|
|
1056
|
+
if (pr(u) && u.length > 0) {
|
|
1057
1057
|
let f = u.length;
|
|
1058
1058
|
const c = u[f - 1], h = x.from(c);
|
|
1059
1059
|
if (x.isSame(h, e))
|
|
@@ -1108,7 +1108,7 @@ var Jr = class {
|
|
|
1108
1108
|
return r ? this.mode == "path" ? i.indexOf("/") === 0 ? n = `${this.base}${i}${r}` : n = `${this.base}/${i}${r}` : n = `${s.pathname}${r}#${i}` : this.mode == "path" ? i.indexOf("/") === 0 ? n = `${this.base}${i}` : n = `${this.base}/${i}` : n = `${s.pathname}#${i}`, `${s.origin}${n}`;
|
|
1109
1109
|
}
|
|
1110
1110
|
};
|
|
1111
|
-
function
|
|
1111
|
+
function Ui(e = !0, t = null, r = "", s = !0, i = !1, n) {
|
|
1112
1112
|
return t !== null && (t = C().location.pathname), t && t.endsWith("/") && (t = t.substring(0, t.length - 1)), new Jr("path", t ?? "", r, e, s, i, n);
|
|
1113
1113
|
}
|
|
1114
1114
|
function Us(e = !0, t = "", r = !0, s = !1, i) {
|
|
@@ -1184,7 +1184,7 @@ var Vs = class {
|
|
|
1184
1184
|
function Ws(e = "", t = 50) {
|
|
1185
1185
|
return new Vs(e, t);
|
|
1186
1186
|
}
|
|
1187
|
-
var et = /* @__PURE__ */ Symbol("_constructRouteModel"), tt = /* @__PURE__ */ Symbol("_findRouteModel"), _t = /* @__PURE__ */ Symbol("_findRootView"), Js = /* @__PURE__ */ Symbol("_getFirstView"), ue = /* @__PURE__ */ Symbol("_removeView"),
|
|
1187
|
+
var et = /* @__PURE__ */ Symbol("_constructRouteModel"), tt = /* @__PURE__ */ Symbol("_findRouteModel"), _t = /* @__PURE__ */ Symbol("_findRootView"), Js = /* @__PURE__ */ Symbol("_getFirstView"), ue = /* @__PURE__ */ Symbol("_removeView"), gr = /* @__PURE__ */ Symbol("_buildPage"), br = /* @__PURE__ */ Symbol("_resolveComponent"), wr = /* @__PURE__ */ Symbol("_update"), se = /* @__PURE__ */ Symbol("_merge"), Ft = /* @__PURE__ */ Symbol("_handleHistoryChange"), fe = /* @__PURE__ */ Symbol("_handleRouteUpdated"), rt = /* @__PURE__ */ Symbol("routeUpdatedCallback"), Ct = /* @__PURE__ */ Symbol("currentRoute"), p = /* @__PURE__ */ Symbol("currentRoutes"), st = /* @__PURE__ */ Symbol("routeSessionCacheKey"), Rr = /* @__PURE__ */ Symbol("_addRouteRecorder"), Ke = /* @__PURE__ */ Symbol("_removeRouteRecorder"), Le = /* @__PURE__ */ Symbol("_cloneRouteRecorder"), $ = /* @__PURE__ */ Symbol("_handleError"), it = /* @__PURE__ */ Symbol("errorCallback"), D = /* @__PURE__ */ Symbol("registerKey"), nt = /* @__PURE__ */ Symbol("notFoundKey"), At = /* @__PURE__ */ Symbol("notFoundPathKey"), W = /* @__PURE__ */ Symbol("forestKey"), S = /* @__PURE__ */ Symbol("historyKey"), Me = /* @__PURE__ */ Symbol("beforeFiltersKey"), Te = /* @__PURE__ */ Symbol("afterFiltersKey"), ke = /* @__PURE__ */ Symbol("destroyFiltersKey"), qt = /* @__PURE__ */ Symbol("propsFilterKey"), ge = /* @__PURE__ */ Symbol("mainDispatcherKey"), $t = /* @__PURE__ */ Symbol("initKey"), ce = /* @__PURE__ */ Symbol("readyKey"), jt = /* @__PURE__ */ Symbol("readyHandlersKey"), ot = /* @__PURE__ */ Symbol("_markReady"), xr = /* @__PURE__ */ Symbol("_createNextFn"), Kt = /* @__PURE__ */ Symbol("_start"), Lt = /* @__PURE__ */ Symbol("_before"), Mt = /* @__PURE__ */ Symbol("_after"), Sr = /* @__PURE__ */ Symbol("_destroy"), Tt = /* @__PURE__ */ Symbol("_load"), Ie = /* @__PURE__ */ Symbol("_unload"), Oe = /* @__PURE__ */ Symbol("routerGuardKey");
|
|
1188
1188
|
function zs(e) {
|
|
1189
1189
|
return e.layers.length == 0 || e.layers[0].views.length == 0;
|
|
1190
1190
|
}
|
|
@@ -1202,8 +1202,8 @@ var Gs = class {
|
|
|
1202
1202
|
[it] = null;
|
|
1203
1203
|
[rt] = null;
|
|
1204
1204
|
[Me] = new Array();
|
|
1205
|
-
[ke] = new Array();
|
|
1206
1205
|
[Te] = new Array();
|
|
1206
|
+
[ke] = new Array();
|
|
1207
1207
|
[qt] = null;
|
|
1208
1208
|
[ge] = new ct();
|
|
1209
1209
|
[Oe] = new Ns();
|
|
@@ -1287,7 +1287,7 @@ var Gs = class {
|
|
|
1287
1287
|
} catch {
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
|
-
[
|
|
1290
|
+
[Rr](e, t) {
|
|
1291
1291
|
if (e.opsType === F.Open) {
|
|
1292
1292
|
let r = !1;
|
|
1293
1293
|
const s = this[p].length - 1;
|
|
@@ -1327,7 +1327,7 @@ var Gs = class {
|
|
|
1327
1327
|
const r = this[p][t];
|
|
1328
1328
|
this[p].splice(t, 1);
|
|
1329
1329
|
const s = this[st].get(r);
|
|
1330
|
-
if (this[st].delete(r), this[
|
|
1330
|
+
if (this[st].delete(r), this[Sr](r, s), r.opsType === F.Append) {
|
|
1331
1331
|
const i = this[p].length - 1;
|
|
1332
1332
|
this[fe](this[p][i] ?? null);
|
|
1333
1333
|
} else this[fe](null);
|
|
@@ -1369,18 +1369,18 @@ var Gs = class {
|
|
|
1369
1369
|
return t !== -1 ? (this[Me].splice(t, 1), !0) : !1;
|
|
1370
1370
|
}
|
|
1371
1371
|
afterEach(e) {
|
|
1372
|
-
this[
|
|
1372
|
+
this[Te].push(e);
|
|
1373
1373
|
}
|
|
1374
1374
|
removeAfterEach(e) {
|
|
1375
|
-
const t = this[
|
|
1376
|
-
return t !== -1 ? (this[
|
|
1375
|
+
const t = this[Te].indexOf(e);
|
|
1376
|
+
return t !== -1 ? (this[Te].splice(t, 1), !0) : !1;
|
|
1377
1377
|
}
|
|
1378
1378
|
destroyEach(e) {
|
|
1379
|
-
this[
|
|
1379
|
+
this[ke].push(e);
|
|
1380
1380
|
}
|
|
1381
1381
|
removeDestroyEach(e) {
|
|
1382
|
-
const t = this[
|
|
1383
|
-
return t !== -1 ? (this[
|
|
1382
|
+
const t = this[ke].indexOf(e);
|
|
1383
|
+
return t !== -1 ? (this[ke].splice(t, 1), !0) : !1;
|
|
1384
1384
|
}
|
|
1385
1385
|
beforeRestoreEach(e) {
|
|
1386
1386
|
this[S]?.beforeRestoreEach(e);
|
|
@@ -1452,12 +1452,12 @@ var Gs = class {
|
|
|
1452
1452
|
for (let u of a) {
|
|
1453
1453
|
let f = new bt();
|
|
1454
1454
|
f.name = u.name, u.path && u.path.length > 0 ? t !== "/" ? f.path = `${t}${u.path}` : f.path = u.path : (n = !0, f.path = t);
|
|
1455
|
-
let c = new
|
|
1455
|
+
let c = new yr();
|
|
1456
1456
|
c.models = [...i], f.layers = [c, ...u.layers], f.matchedRoutes = [s, ...u.matchedRoutes ?? []], o.push(f);
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
1459
|
if (!n) {
|
|
1460
|
-
const l = new
|
|
1460
|
+
const l = new yr();
|
|
1461
1461
|
l.models = i;
|
|
1462
1462
|
const a = new bt();
|
|
1463
1463
|
a.name = e.name, a.path = t, a.matchedRoutes = [s], a.layers = [l], o.splice(0, 0, a);
|
|
@@ -1471,7 +1471,7 @@ var Gs = class {
|
|
|
1471
1471
|
const s = t.path ? t.template ?? t.path : null, i = t.name ? t.template ?? t.name : null;
|
|
1472
1472
|
if (s && r.path) {
|
|
1473
1473
|
let n = r.match;
|
|
1474
|
-
n || (n = r.match =
|
|
1474
|
+
n || (n = r.match = ks(r.path));
|
|
1475
1475
|
const o = n(s);
|
|
1476
1476
|
if (!o) continue;
|
|
1477
1477
|
if (r.redirect) {
|
|
@@ -1660,7 +1660,7 @@ var Gs = class {
|
|
|
1660
1660
|
return r == null ? (this[$]("route forbid", t), this) : (this[ge].post((s) => {
|
|
1661
1661
|
try {
|
|
1662
1662
|
let i = this[Kt](t);
|
|
1663
|
-
this[Lt](i), this[
|
|
1663
|
+
this[Lt](i), this[Tt](i), this[Mt](i), i.wait((n, o) => {
|
|
1664
1664
|
const l = n.session.to;
|
|
1665
1665
|
if (n.session.updateResult && n.session.updateResult.status === "success") try {
|
|
1666
1666
|
const a = new St(x.clone(l, !0), this[Le]());
|
|
@@ -1685,7 +1685,7 @@ var Gs = class {
|
|
|
1685
1685
|
back(e = 1) {
|
|
1686
1686
|
this[S]?.go(-e, !1);
|
|
1687
1687
|
}
|
|
1688
|
-
[
|
|
1688
|
+
[xr](e) {
|
|
1689
1689
|
return (t, r) => {
|
|
1690
1690
|
if (typeof t == "boolean")
|
|
1691
1691
|
e.session.redirect = !1, t ? e.resolve() : e.reject(r ?? null);
|
|
@@ -1718,7 +1718,7 @@ var Gs = class {
|
|
|
1718
1718
|
}
|
|
1719
1719
|
[Lt](e) {
|
|
1720
1720
|
for (let t of this[Me]) e.post((r) => {
|
|
1721
|
-
const s = this[
|
|
1721
|
+
const s = this[xr](r);
|
|
1722
1722
|
Reflect.apply(t, {}, [
|
|
1723
1723
|
r.session.to,
|
|
1724
1724
|
r.session.from,
|
|
@@ -1729,7 +1729,7 @@ var Gs = class {
|
|
|
1729
1729
|
}
|
|
1730
1730
|
[Mt](e) {
|
|
1731
1731
|
e.post((t) => {
|
|
1732
|
-
for (let r of this[
|
|
1732
|
+
for (let r of this[Te]) try {
|
|
1733
1733
|
Reflect.apply(r, {}, [
|
|
1734
1734
|
t.session.to,
|
|
1735
1735
|
t.session.from,
|
|
@@ -1741,15 +1741,15 @@ var Gs = class {
|
|
|
1741
1741
|
t.resolve();
|
|
1742
1742
|
});
|
|
1743
1743
|
}
|
|
1744
|
-
[
|
|
1745
|
-
for (let r of this[
|
|
1744
|
+
[Sr](e, t) {
|
|
1745
|
+
for (let r of this[ke]) try {
|
|
1746
1746
|
Reflect.apply(r, {}, [e, t]);
|
|
1747
1747
|
} catch (s) {
|
|
1748
1748
|
console.error(s.message, s);
|
|
1749
1749
|
}
|
|
1750
1750
|
typeof e.destroy == "function" && Reflect.apply(e.destroy, e, []);
|
|
1751
1751
|
}
|
|
1752
|
-
[
|
|
1752
|
+
[Tt](e) {
|
|
1753
1753
|
e.post((t) => {
|
|
1754
1754
|
const r = t.session.to;
|
|
1755
1755
|
let s = t.session.routeModel;
|
|
@@ -1766,7 +1766,7 @@ var Gs = class {
|
|
|
1766
1766
|
}
|
|
1767
1767
|
}
|
|
1768
1768
|
const i = Ge.from(t.session);
|
|
1769
|
-
this[
|
|
1769
|
+
this[gr](r, s, i).then((n) => {
|
|
1770
1770
|
this[W], t.session.updateResult = n ?? {
|
|
1771
1771
|
status: "success",
|
|
1772
1772
|
message: ""
|
|
@@ -1860,7 +1860,7 @@ var Gs = class {
|
|
|
1860
1860
|
const o = e[n];
|
|
1861
1861
|
this[ge].post((l) => {
|
|
1862
1862
|
const a = this[Kt](o);
|
|
1863
|
-
this[Lt](a), this[
|
|
1863
|
+
this[Lt](a), this[Tt](a), this[Mt](a), a.wait((u, f) => {
|
|
1864
1864
|
s = u.session.to, i = u.session.redirect, l.resolve();
|
|
1865
1865
|
}, (u, f) => {
|
|
1866
1866
|
s = null, f !== null && this[$](f), l.resolve();
|
|
@@ -1876,14 +1876,14 @@ var Gs = class {
|
|
|
1876
1876
|
});
|
|
1877
1877
|
});
|
|
1878
1878
|
}
|
|
1879
|
-
async [
|
|
1879
|
+
async [gr](e, t, r) {
|
|
1880
1880
|
const s = e.updateType ?? wt.Part;
|
|
1881
|
-
await this[
|
|
1882
|
-
const i = this[
|
|
1881
|
+
await this[br](t);
|
|
1882
|
+
const i = this[wr](t, e, r, s);
|
|
1883
1883
|
if (i.status === "error") throw Error(i.message);
|
|
1884
1884
|
return i;
|
|
1885
1885
|
}
|
|
1886
|
-
[
|
|
1886
|
+
[br](e) {
|
|
1887
1887
|
let t = [];
|
|
1888
1888
|
for (let r = 0; r < e.layers.length; r++) {
|
|
1889
1889
|
let s = e.layers[r];
|
|
@@ -1894,7 +1894,7 @@ var Gs = class {
|
|
|
1894
1894
|
}
|
|
1895
1895
|
return t.length > 0 ? Promise.all(t) : Promise.resolve();
|
|
1896
1896
|
}
|
|
1897
|
-
[
|
|
1897
|
+
[wr](e, t, r, s) {
|
|
1898
1898
|
if (e.layers[0].models.length !== 1) return {
|
|
1899
1899
|
status: "error",
|
|
1900
1900
|
message: "illegal route structure(multi root node)"
|
|
@@ -2007,8 +2007,8 @@ var Gs = class {
|
|
|
2007
2007
|
let Ce = [];
|
|
2008
2008
|
for (let M of L) {
|
|
2009
2009
|
let q = n.layers[g].views[M], oe = e.layers[v].models, ee;
|
|
2010
|
-
for (let
|
|
2011
|
-
ee = oe[
|
|
2010
|
+
for (let T = 0; T < oe.length; T++) if (q.name === oe[T].name) {
|
|
2011
|
+
ee = oe[T];
|
|
2012
2012
|
break;
|
|
2013
2013
|
}
|
|
2014
2014
|
if (!ee) this[ue](n, {
|
|
@@ -2016,14 +2016,14 @@ var Gs = class {
|
|
|
2016
2016
|
y: g
|
|
2017
2017
|
}, null, !1);
|
|
2018
2018
|
else {
|
|
2019
|
-
let
|
|
2020
|
-
if (
|
|
2019
|
+
let T = q.slots.value;
|
|
2020
|
+
if (T.length == 0) {
|
|
2021
2021
|
let Q = 0;
|
|
2022
2022
|
q.slots.value = [new re(null, ee, Q)];
|
|
2023
2023
|
let U = g + 1, V = v + 1;
|
|
2024
2024
|
this[se](n, U, e, V, K);
|
|
2025
2025
|
} else {
|
|
2026
|
-
let Q =
|
|
2026
|
+
let Q = T[0];
|
|
2027
2027
|
if (Q.model !== ee) {
|
|
2028
2028
|
this[ue](n, {
|
|
2029
2029
|
x: M,
|
|
@@ -2034,7 +2034,7 @@ var Gs = class {
|
|
|
2034
2034
|
} else {
|
|
2035
2035
|
q[G] && Q.route !== null && this[Ke](Q.route);
|
|
2036
2036
|
let U = [];
|
|
2037
|
-
for (let V = 1; V <
|
|
2037
|
+
for (let V = 1; V < T.length; V++) U.push(T[V].index);
|
|
2038
2038
|
U.length > 0 && this[ue](n, {
|
|
2039
2039
|
x: M,
|
|
2040
2040
|
y: g
|
|
@@ -2054,7 +2054,7 @@ var Gs = class {
|
|
|
2054
2054
|
let c = u[z];
|
|
2055
2055
|
c && (t.slot = new Os(l, f, c?.view.name, c?.index ?? 0));
|
|
2056
2056
|
}
|
|
2057
|
-
return r.to = void 0, r.routeModel = void 0, this[
|
|
2057
|
+
return r.to = void 0, r.routeModel = void 0, this[Rr](t, r), {
|
|
2058
2058
|
status: "success",
|
|
2059
2059
|
message: ""
|
|
2060
2060
|
};
|
|
@@ -2112,7 +2112,7 @@ var Gs = class {
|
|
|
2112
2112
|
} else this[W].layers[t].views.push(a);
|
|
2113
2113
|
return a;
|
|
2114
2114
|
}
|
|
2115
|
-
}, Ve = /* @__PURE__ */ Symbol("rk"),
|
|
2115
|
+
}, Ve = /* @__PURE__ */ Symbol("rk"), kt = /* @__PURE__ */ Symbol("vd"), Er = /* @__PURE__ */ Symbol("rv"), It = /* @__PURE__ */ Symbol("rvi"), Pr = /* @__PURE__ */ Symbol("pv"), Ot = /* @__PURE__ */ Symbol("pvi"), Be = /* @__PURE__ */ Symbol("registerKey"), zr = /* @__PURE__ */ Symbol("lc"), Xs = class {
|
|
2116
2116
|
[Be] = /* @__PURE__ */ new Map();
|
|
2117
2117
|
constructor() {
|
|
2118
2118
|
}
|
|
@@ -2147,7 +2147,7 @@ async function Qs(e, t) {
|
|
|
2147
2147
|
Ne.pop();
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
|
-
function
|
|
2150
|
+
function Vi(e) {
|
|
2151
2151
|
const t = Kr();
|
|
2152
2152
|
if (!t) return !1;
|
|
2153
2153
|
const r = dt();
|
|
@@ -2162,10 +2162,10 @@ function Ui(e) {
|
|
|
2162
2162
|
function Gr(e, t) {
|
|
2163
2163
|
return dt(e)?.get(t) ?? null;
|
|
2164
2164
|
}
|
|
2165
|
-
function
|
|
2165
|
+
function Wi(e, t, r) {
|
|
2166
2166
|
dt(e)?.set(t, r);
|
|
2167
2167
|
}
|
|
2168
|
-
function
|
|
2168
|
+
function Ji(e, t, r) {
|
|
2169
2169
|
dt(e)?.delete(t);
|
|
2170
2170
|
}
|
|
2171
2171
|
var ht = /* @__PURE__ */ Symbol("hooksKey");
|
|
@@ -2173,7 +2173,7 @@ function Zs(e) {
|
|
|
2173
2173
|
let t = e.get(ht);
|
|
2174
2174
|
t || (t = [], e.set(ht, t));
|
|
2175
2175
|
}
|
|
2176
|
-
function
|
|
2176
|
+
function _r(e, t) {
|
|
2177
2177
|
const r = e.get(ht);
|
|
2178
2178
|
r != null && Qs(e, async () => {
|
|
2179
2179
|
for (let s = r.length - 1; s >= 0; s--) {
|
|
@@ -2214,28 +2214,24 @@ function ti(e, t, r) {
|
|
|
2214
2214
|
function Xr(e) {
|
|
2215
2215
|
return (t) => {
|
|
2216
2216
|
const r = Gr(null, ht);
|
|
2217
|
-
|
|
2218
|
-
console.warn("[Fox]hooks context not found");
|
|
2219
|
-
return;
|
|
2220
|
-
}
|
|
2221
|
-
Fe(() => {
|
|
2217
|
+
r && (Fe(() => {
|
|
2222
2218
|
ti(r, e, t);
|
|
2223
|
-
}), ei(r, e, t);
|
|
2219
|
+
}), ei(r, e, t));
|
|
2224
2220
|
};
|
|
2225
2221
|
}
|
|
2226
|
-
var
|
|
2222
|
+
var zi = function(e) {
|
|
2227
2223
|
cs(e), Xr(yt.ACTIVATED)(e);
|
|
2228
|
-
},
|
|
2224
|
+
}, Gi = function(e) {
|
|
2229
2225
|
hs(e), Xr(yt.INACTIVATED)(e);
|
|
2230
2226
|
}, Qr = /* @__PURE__ */ Symbol("routeKey");
|
|
2231
|
-
function
|
|
2227
|
+
function Fr(e, t) {
|
|
2232
2228
|
e.set(Qr, t);
|
|
2233
2229
|
}
|
|
2234
|
-
function
|
|
2230
|
+
function Cr(e) {
|
|
2235
2231
|
const t = Gr(e ?? null, Qr);
|
|
2236
2232
|
return typeof t == "function" ? t() : t;
|
|
2237
2233
|
}
|
|
2238
|
-
var ri = "FoxBeforeEnter", si = "FoxEnter", ii = "FoxLeave", ni = "FoxLeave",
|
|
2234
|
+
var ri = "FoxBeforeEnter", si = "FoxEnter", ii = "FoxLeave", ni = "FoxLeave", Vt = "FoxLeaveEnd";
|
|
2239
2235
|
function Zr(e, t = !1) {
|
|
2240
2236
|
let r = null;
|
|
2241
2237
|
return t ? r = e.showFromClass ?? e.enterFromClass : r = e.enterFromClass, r || (r = e.transitionName, r ? t ? `${r}-show-from` : `${r}-enter-from` : null);
|
|
@@ -2292,7 +2288,7 @@ function mi(e, t = !1) {
|
|
|
2292
2288
|
let r = null;
|
|
2293
2289
|
return t ? r = e.hideCancelled ?? e.leaveCancelled : r = e.leaveCancelled, r;
|
|
2294
2290
|
}
|
|
2295
|
-
function
|
|
2291
|
+
function sr(e) {
|
|
2296
2292
|
let t, r = e.transitionDuration;
|
|
2297
2293
|
return typeof r == "object" ? t = {
|
|
2298
2294
|
enter: r.enter ?? -1,
|
|
@@ -2322,7 +2318,7 @@ function A(e, t) {
|
|
|
2322
2318
|
function rs(e, t, r = -1, s, i, n) {
|
|
2323
2319
|
let o = [];
|
|
2324
2320
|
const l = () => {
|
|
2325
|
-
for (let a of o)
|
|
2321
|
+
for (let a of o) Qt(e, a.type, a.listener);
|
|
2326
2322
|
o = [];
|
|
2327
2323
|
};
|
|
2328
2324
|
if (w(i)) {
|
|
@@ -2339,7 +2335,7 @@ function rs(e, t, r = -1, s, i, n) {
|
|
|
2339
2335
|
const a = [
|
|
2340
2336
|
"animationend",
|
|
2341
2337
|
"transitionend",
|
|
2342
|
-
|
|
2338
|
+
Vt
|
|
2343
2339
|
], u = (f) => {
|
|
2344
2340
|
(f.target || f.srcElement) === f.currentTarget && (l(), Reflect.apply(i, null, [
|
|
2345
2341
|
e,
|
|
@@ -2471,8 +2467,8 @@ function os(e, t, r = {}, s, i, n, o, l) {
|
|
|
2471
2467
|
]);
|
|
2472
2468
|
});
|
|
2473
2469
|
}
|
|
2474
|
-
function
|
|
2475
|
-
const i = t.mode ?? "default", n =
|
|
2470
|
+
function Wt(e, t = {}, r, s = -1) {
|
|
2471
|
+
const i = t.mode ?? "default", n = sr(t);
|
|
2476
2472
|
return {
|
|
2477
2473
|
mode: i,
|
|
2478
2474
|
persisted: !1,
|
|
@@ -2487,7 +2483,7 @@ function Jt(e, t = {}, r, s = -1) {
|
|
|
2487
2483
|
e.transition = null;
|
|
2488
2484
|
});
|
|
2489
2485
|
},
|
|
2490
|
-
clone: (o) =>
|
|
2486
|
+
clone: (o) => Wt(e, t, r, s)
|
|
2491
2487
|
};
|
|
2492
2488
|
}
|
|
2493
2489
|
function ls(e) {
|
|
@@ -2497,7 +2493,7 @@ function pi(e, t = {}, r, s, i, n) {
|
|
|
2497
2493
|
if (i === !0) {
|
|
2498
2494
|
const o = ls(e);
|
|
2499
2495
|
if (o == null) return;
|
|
2500
|
-
const l =
|
|
2496
|
+
const l = sr(t);
|
|
2501
2497
|
ss(!0, o, t, r, s), is(!0, o, t, l.show, r, s, (a) => {
|
|
2502
2498
|
w(n) && A(n, [a]);
|
|
2503
2499
|
});
|
|
@@ -2507,7 +2503,7 @@ function gi(e, t = {}, r, s, i, n) {
|
|
|
2507
2503
|
if (i === !0) {
|
|
2508
2504
|
const o = ls(e);
|
|
2509
2505
|
if (o == null) return;
|
|
2510
|
-
const l =
|
|
2506
|
+
const l = sr(t);
|
|
2511
2507
|
ns(!0, o, t, r, s), os(!0, o, t, l.hide, null, r, s, (a) => {
|
|
2512
2508
|
w(n) && A(n, [a]);
|
|
2513
2509
|
});
|
|
@@ -2531,9 +2527,9 @@ function as(e, t = {}, r, s = -1) {
|
|
|
2531
2527
|
leave: (i, n) => {
|
|
2532
2528
|
ze(ii, {}, i), mt(() => {
|
|
2533
2529
|
const o = (l) => {
|
|
2534
|
-
(l.target || l.srcElement) === l.currentTarget && (
|
|
2530
|
+
(l.target || l.srcElement) === l.currentTarget && (Qt(i, Vt, o), n && Reflect.apply(n, null, []), e.transition = null);
|
|
2535
2531
|
};
|
|
2536
|
-
ft(i,
|
|
2532
|
+
ft(i, Vt, o), ze(ni, {}, i);
|
|
2537
2533
|
});
|
|
2538
2534
|
},
|
|
2539
2535
|
clone: (i) => as(e, t, r, s)
|
|
@@ -2556,7 +2552,7 @@ var wi = class {
|
|
|
2556
2552
|
constructor(e, t) {
|
|
2557
2553
|
this.node = e, this.state = t;
|
|
2558
2554
|
}
|
|
2559
|
-
},
|
|
2555
|
+
}, Jt = jr({
|
|
2560
2556
|
name: "RouterView",
|
|
2561
2557
|
inheritAttrs: !1,
|
|
2562
2558
|
props: {
|
|
@@ -2746,27 +2742,27 @@ var wi = class {
|
|
|
2746
2742
|
}
|
|
2747
2743
|
},
|
|
2748
2744
|
setup(e, t) {
|
|
2749
|
-
const r = Kr(), s = e.multi === !0, i = N(Ve, null), n = N(
|
|
2745
|
+
const r = Kr(), s = e.multi === !0, i = N(Ve, null), n = N(kt, 0), o = N(Er, null), l = N(It, -1);
|
|
2750
2746
|
let a = null, u = e.modelSlot ?? null;
|
|
2751
2747
|
if (u) {
|
|
2752
|
-
if (te(
|
|
2748
|
+
if (te(kt, n + 1), te(It, u.index), te(Ot, u.index), !u.route) {
|
|
2753
2749
|
console.warn("[Fox]child view render error, route not exist");
|
|
2754
2750
|
return;
|
|
2755
2751
|
}
|
|
2756
2752
|
const c = lt(u, !0);
|
|
2757
|
-
c && (Zs(c),
|
|
2753
|
+
c && (Zs(c), Fr(c, () => u?.route ?? null));
|
|
2758
2754
|
} else {
|
|
2759
2755
|
if (i == null) {
|
|
2760
2756
|
console.error("[Fox]router is not been injected");
|
|
2761
2757
|
return;
|
|
2762
2758
|
}
|
|
2763
|
-
const c = e.name, h = N(
|
|
2759
|
+
const c = e.name, h = N(Pr, null), y = N(Ot, 0);
|
|
2764
2760
|
if (a = i[Vr](c, n, o, l, h, y), a === null) return;
|
|
2765
|
-
te(
|
|
2761
|
+
te(Pr, a);
|
|
2766
2762
|
const d = a[G] === !0;
|
|
2767
|
-
if (d && te(
|
|
2763
|
+
if (d && te(Er, a), !s && (te(It, -1), te(kt, n + 1), te(Ot, -1), d && r)) {
|
|
2768
2764
|
const m = lt(r, !0);
|
|
2769
|
-
m &&
|
|
2765
|
+
m && Fr(m, () => {
|
|
2770
2766
|
const b = a?.slots.value ?? [];
|
|
2771
2767
|
return b.length > 0 ? b[0].route : null;
|
|
2772
2768
|
});
|
|
@@ -2784,24 +2780,24 @@ var wi = class {
|
|
|
2784
2780
|
for (let g = 0; g < y.length; g++) {
|
|
2785
2781
|
const v = y[g], K = `${e.name}_${v.index}`, L = ie(e.transition, v.route, g) ?? !0, Ce = { modelSlot: v };
|
|
2786
2782
|
let M;
|
|
2787
|
-
t.slots.default ? M = he(
|
|
2783
|
+
t.slots.default ? M = he(Jt, Ce, { default: t.slots.default }) : M = he(Jt, Ce);
|
|
2788
2784
|
const q = {}, oe = ie(e.viewClass, v.route, g);
|
|
2789
2785
|
typeof oe == "string" && oe.length > 0 && (q[oe] = !0);
|
|
2790
|
-
const ee = ie(e.viewActiveClass, v.route, g),
|
|
2791
|
-
if (typeof ee == "string" && ee.length > 0 && (q[ee] = v.active), typeof
|
|
2792
|
-
const
|
|
2786
|
+
const ee = ie(e.viewActiveClass, v.route, g), T = ie(e.viewInactiveClass, v.route, g), Q = f.value.get(K);
|
|
2787
|
+
if (typeof ee == "string" && ee.length > 0 && (q[ee] = v.active), typeof T == "string" && T.length > 0 && (q[T] = !v.active), Q && v.active !== Q.state) {
|
|
2788
|
+
const ir = Q.node;
|
|
2793
2789
|
v.active ? d.unshift(() => {
|
|
2794
2790
|
const pt = () => {
|
|
2795
2791
|
const Ae = lt(v);
|
|
2796
|
-
Ae != null &&
|
|
2792
|
+
Ae != null && _r(Ae, yt.ACTIVATED);
|
|
2797
2793
|
};
|
|
2798
|
-
pi(
|
|
2794
|
+
pi(ir, e, v.route, g, L, pt);
|
|
2799
2795
|
}) : d.push(() => {
|
|
2800
2796
|
const pt = () => {
|
|
2801
2797
|
const Ae = lt(v);
|
|
2802
|
-
Ae != null &&
|
|
2798
|
+
Ae != null && _r(Ae, yt.INACTIVATED);
|
|
2803
2799
|
};
|
|
2804
|
-
gi(
|
|
2800
|
+
gi(ir, e, v.route, g, L, pt);
|
|
2805
2801
|
});
|
|
2806
2802
|
}
|
|
2807
2803
|
const U = {
|
|
@@ -2810,7 +2806,7 @@ var wi = class {
|
|
|
2810
2806
|
}, V = ie(e.viewTagProps, v.route, g);
|
|
2811
2807
|
V !== null && typeof V == "object" && j(!0, U, be(V, i?.propsFilter)), v.route?.viewTagAttrs && typeof v.route?.viewTagAttrs == "object" && j(!0, U, be(v.route.viewTagAttrs, i?.propsFilter));
|
|
2812
2808
|
const ve = he(ie(e.viewTag, v.route, g), U, { default: () => [M] });
|
|
2813
|
-
c.set(K, new wi(ve, v.active)), f.value.delete(K), L === !0 ? ve.transition =
|
|
2809
|
+
c.set(K, new wi(ve, v.active)), f.value.delete(K), L === !0 ? ve.transition = Wt(ve, e, v.route, g) : L === "custom" && (ve.transition = as(ve, e, v.route, g)), h.push(ve);
|
|
2814
2810
|
}
|
|
2815
2811
|
f.value = c, bi(d);
|
|
2816
2812
|
const m = ie(e.tag, null, -1), b = {};
|
|
@@ -2829,7 +2825,7 @@ var wi = class {
|
|
|
2829
2825
|
const h = c[0], y = h.route, d = h.model, m = {};
|
|
2830
2826
|
d.props && (typeof d.props == "object" ? j(!1, m, be(d.props, i?.propsFilter)) : d.props === !0 && typeof y?.params == "object" && j(!1, m, be(y.params, i?.propsFilter)));
|
|
2831
2827
|
const b = he(d.component, m);
|
|
2832
|
-
return (ie(e.transition, y, -1) ?? !0) && (b.transition =
|
|
2828
|
+
return (ie(e.transition, y, -1) ?? !0) && (b.transition = Wt(b, e, y, -1)), Bt(t.slots.default, {
|
|
2833
2829
|
Component: b,
|
|
2834
2830
|
route: y
|
|
2835
2831
|
}) ?? b;
|
|
@@ -3321,7 +3317,7 @@ var $r = class {
|
|
|
3321
3317
|
}
|
|
3322
3318
|
try {
|
|
3323
3319
|
let n = await Ai(s.path);
|
|
3324
|
-
if (
|
|
3320
|
+
if (Yt(n) && (n = n.default ?? n), We(n)) {
|
|
3325
3321
|
t.progress.work(!1, t.index, n), r.resolve();
|
|
3326
3322
|
return;
|
|
3327
3323
|
}
|
|
@@ -3445,9 +3441,9 @@ var $r = class {
|
|
|
3445
3441
|
constructor(e, t, r) {
|
|
3446
3442
|
this.index = e, this.resource = t, this.progress = r;
|
|
3447
3443
|
}
|
|
3448
|
-
},
|
|
3449
|
-
function
|
|
3450
|
-
const t = new Gs(e), r = new
|
|
3444
|
+
}, zt = /* @__PURE__ */ Symbol("fk"), Gt = /* @__PURE__ */ Symbol("fbk"), Xt = /* @__PURE__ */ Symbol("fepk");
|
|
3445
|
+
function Xi(e = {}) {
|
|
3446
|
+
const t = new Gs(e), r = new fr(), s = new Ar(), i = new $r(), n = {
|
|
3451
3447
|
get router() {
|
|
3452
3448
|
return t;
|
|
3453
3449
|
},
|
|
@@ -3455,7 +3451,7 @@ function Gi(e = {}) {
|
|
|
3455
3451
|
return r;
|
|
3456
3452
|
},
|
|
3457
3453
|
get Bus() {
|
|
3458
|
-
return
|
|
3454
|
+
return fr;
|
|
3459
3455
|
},
|
|
3460
3456
|
get EventProxy() {
|
|
3461
3457
|
return Ar;
|
|
@@ -3473,10 +3469,10 @@ function Gi(e = {}) {
|
|
|
3473
3469
|
return i;
|
|
3474
3470
|
},
|
|
3475
3471
|
get isESModule() {
|
|
3476
|
-
return
|
|
3472
|
+
return Yt;
|
|
3477
3473
|
},
|
|
3478
3474
|
install(o, l = {}) {
|
|
3479
|
-
o.provide(Ve, t), o.provide(
|
|
3475
|
+
o.provide(Ve, t), o.provide(zt, n), o.provide(Gt, r), o.provide(Xt, s), l.install !== !1 && (o.component(Pi, Jt), o.component(_i, Si)), l.optionsApi !== !1 && (Reflect.defineProperty(o.config.globalProperties, "$fox", { get() {
|
|
3480
3476
|
return n;
|
|
3481
3477
|
} }), Reflect.defineProperty(o.config.globalProperties, "$router", { get() {
|
|
3482
3478
|
return t;
|
|
@@ -3501,9 +3497,9 @@ function Gi(e = {}) {
|
|
|
3501
3497
|
}, o.config.globalProperties.$fox_emit = function(a, ...u) {
|
|
3502
3498
|
let f = s;
|
|
3503
3499
|
Reflect.apply(f.trigger, f, [a, ...u]);
|
|
3504
|
-
}, o.mixin({
|
|
3505
|
-
return
|
|
3506
|
-
} })), t.init();
|
|
3500
|
+
}, o.mixin({ computed: { $route() {
|
|
3501
|
+
return ji(this);
|
|
3502
|
+
} } })), t.init();
|
|
3507
3503
|
}
|
|
3508
3504
|
};
|
|
3509
3505
|
return n;
|
|
@@ -3511,23 +3507,23 @@ function Gi(e = {}) {
|
|
|
3511
3507
|
function us(e) {
|
|
3512
3508
|
return _e() ? N(Ve, null) : e ? e.$?.appContext?.provides?.[Ve] ?? null : null;
|
|
3513
3509
|
}
|
|
3514
|
-
function
|
|
3515
|
-
let t =
|
|
3510
|
+
function ji(e) {
|
|
3511
|
+
let t = Cr(e);
|
|
3516
3512
|
if (!t && e && !_e()) {
|
|
3517
3513
|
let r = e;
|
|
3518
|
-
for (r = r.$parent; r && (t =
|
|
3514
|
+
for (r = r.$parent; r && (t = Cr(r), !t); )
|
|
3519
3515
|
r = r.$parent;
|
|
3520
3516
|
}
|
|
3521
3517
|
return t;
|
|
3522
3518
|
}
|
|
3523
3519
|
function Qi(e) {
|
|
3524
|
-
return _e() ? N(
|
|
3520
|
+
return _e() ? N(zt, null) : e ? e.$?.appContext?.provides?.[zt] ?? null : null;
|
|
3525
3521
|
}
|
|
3526
3522
|
function Zi(e) {
|
|
3527
|
-
return _e() ? N(
|
|
3523
|
+
return _e() ? N(Gt, null) : e ? e.$?.appContext?.provides?.[Gt] ?? null : null;
|
|
3528
3524
|
}
|
|
3529
3525
|
function Yi(e) {
|
|
3530
|
-
return _e() ? N(
|
|
3526
|
+
return _e() ? N(Xt, null) : e ? e.$?.appContext?.provides?.[Xt] ?? null : null;
|
|
3531
3527
|
}
|
|
3532
3528
|
function en(e) {
|
|
3533
3529
|
const t = us();
|
|
@@ -3566,57 +3562,57 @@ function tn(e) {
|
|
|
3566
3562
|
});
|
|
3567
3563
|
}
|
|
3568
3564
|
export {
|
|
3569
|
-
|
|
3565
|
+
fr as Bus,
|
|
3570
3566
|
ct as EventChain,
|
|
3571
3567
|
Ar as EventProxy,
|
|
3572
3568
|
ri as FoxBeforeEnter,
|
|
3573
3569
|
ii as FoxBeforeLeave,
|
|
3574
3570
|
si as FoxEnter,
|
|
3575
3571
|
ni as FoxLeave,
|
|
3576
|
-
|
|
3572
|
+
Vt as FoxLeaveEnd,
|
|
3577
3573
|
F as OperationType,
|
|
3578
3574
|
x as Route,
|
|
3579
3575
|
Gs as Router,
|
|
3580
3576
|
Si as RouterLink,
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3577
|
+
Jt as RouterView,
|
|
3578
|
+
Vi as bindLifecycleContextToCurrentScope,
|
|
3579
|
+
Xi as createFox,
|
|
3584
3580
|
Ws as createMemoryHistory,
|
|
3585
3581
|
Us as createWebHashHistory,
|
|
3586
|
-
|
|
3587
|
-
|
|
3582
|
+
Ui as createWebHistory,
|
|
3583
|
+
Ji as deleteContextValue,
|
|
3588
3584
|
j as extend,
|
|
3589
3585
|
Gr as injectContextValue,
|
|
3590
3586
|
dt as injectLifecycleContext,
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3587
|
+
nr as isArray,
|
|
3588
|
+
Ti as isDate,
|
|
3589
|
+
Yt as isESModule,
|
|
3590
|
+
lr as isEqual,
|
|
3595
3591
|
w as isFunction,
|
|
3596
|
-
|
|
3592
|
+
Li as isMap,
|
|
3597
3593
|
We as isNil,
|
|
3598
3594
|
gs as isObject,
|
|
3599
3595
|
ws as isPlainObject,
|
|
3600
|
-
|
|
3601
|
-
|
|
3596
|
+
Oi as isPromise,
|
|
3597
|
+
Mi as isSet,
|
|
3602
3598
|
ki as isString,
|
|
3603
|
-
|
|
3599
|
+
Ii as isSymbol,
|
|
3604
3600
|
tn as onAfterRouteUpdate,
|
|
3605
3601
|
en as onBeforeRouteUpdate,
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3602
|
+
zi as onFoxActivated,
|
|
3603
|
+
Gi as onFoxInactivated,
|
|
3604
|
+
Wi as provideContextValue,
|
|
3605
|
+
Ni as rawState,
|
|
3606
|
+
Di as reactiveState,
|
|
3607
|
+
Hi as shallowReactiveState,
|
|
3608
|
+
Tr as toBoolean,
|
|
3609
|
+
Bi as toNumber,
|
|
3610
|
+
Zt as toTypeString,
|
|
3611
|
+
or as typeOf,
|
|
3616
3612
|
Zi as useBus,
|
|
3617
3613
|
Yi as useEventProxy,
|
|
3618
3614
|
Qi as useFox,
|
|
3619
|
-
|
|
3615
|
+
ji as useRoute,
|
|
3620
3616
|
us as useRouter,
|
|
3621
3617
|
Qs as withLifecycleContext
|
|
3622
3618
|
};
|