@fox-js/fox 3.0.1-2 → 3.0.1-21

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.
@@ -0,0 +1,3347 @@
1
+ import { ref as vr, getCurrentInstance as Lt, onUnmounted as st, shallowRef as Dr, defineComponent as gr, inject as G, provide as re, h as fe } from "vue";
2
+ /*!
3
+ * fox v3.0.0 Tue Mar 21 2023 19:14:24 GMT+0800 (China Standard Time)
4
+ */
5
+ const Yn = Array.isArray, Zn = (r) => Mt(r) === "[object Map]", es = (r) => Mt(r) === "[object Set]", ts = (r) => r instanceof Date, R = (r) => typeof r == "function", rs = (r) => typeof r == "string", ns = (r) => typeof r == "symbol", Vr = (r) => r !== null && typeof r == "object", ss = (r) => Vr(r) && R(r.then) && R(r.catch), Br = Object.prototype.toString, Mt = (r) => Br.call(r), kt = (r) => Mt(r) === "[object Object]", Ur = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
6
+ function wr(r) {
7
+ return r.__esModule || Ur && r[Symbol.toStringTag] === "Module";
8
+ }
9
+ const kr = typeof Promise < "u" && Promise.toString().indexOf("[native code]") !== -1;
10
+ function $(...r) {
11
+ let e = r[0] !== void 0 && r[0] !== null ? r[0] : {}, t = 1, n = r.length, s = !1;
12
+ for (typeof e == "boolean" && (s = e, e = r[t] ?? {}, t++), typeof e != "object" && (e = {}); t < n; t++)
13
+ if (r[t] !== null && r[t] !== void 0) {
14
+ let i = r[t];
15
+ for (let o in i) {
16
+ let a = e[o], l = i[o];
17
+ if (a !== l)
18
+ if (s === !0 && l && typeof l == "object") {
19
+ let u;
20
+ Array.isArray(l) ? u = a && Array.isArray(a) ? a : [] : u = a && typeof a == "object" ? a : {}, e[o] = $(s, u, l);
21
+ } else
22
+ l !== void 0 && (e[o] = l);
23
+ }
24
+ }
25
+ return e;
26
+ }
27
+ function et(r, e, t = !1) {
28
+ if (!t)
29
+ $(!0, r, e);
30
+ else {
31
+ if (typeof e != "object")
32
+ return {};
33
+ typeof r != "object" && (r = {});
34
+ for (let s in e) {
35
+ let i = r[s], o = e[s];
36
+ if (i !== o)
37
+ if (typeof o == "object") {
38
+ if (!Array.isArray(o) && !kt(o))
39
+ continue;
40
+ i = et(i, o, t), r[s] = i;
41
+ } else {
42
+ if (typeof o == "function")
43
+ continue;
44
+ r[s] = o;
45
+ }
46
+ }
47
+ const n = Object.getOwnPropertySymbols(e);
48
+ for (let s of n) {
49
+ let i = r[s], o = e[s];
50
+ if (i !== o)
51
+ if (typeof o == "object") {
52
+ if (!Array.isArray(o) && !kt(o))
53
+ continue;
54
+ i = et(i, o, t), r[s] = i;
55
+ } else {
56
+ if (typeof o == "function")
57
+ continue;
58
+ r[s] = o;
59
+ }
60
+ }
61
+ }
62
+ return r;
63
+ }
64
+ class oe {
65
+ static seed = new Date().getTime();
66
+ static get() {
67
+ let e = ++oe.seed;
68
+ return e >= Number.MAX_VALUE && (oe.seed = 0), e;
69
+ }
70
+ }
71
+ const at = kr ? Promise.resolve() : null;
72
+ function Oe(r, ...e) {
73
+ at !== null ? e && e.length > 0 ? at.then(() => {
74
+ r(e);
75
+ }) : at.then(r) : e && e.length > 0 ? setTimeout(() => {
76
+ r(e);
77
+ }) : setTimeout(r);
78
+ }
79
+ function br(r) {
80
+ return r == null ? !1 : typeof r == "boolean" ? r : typeof r == "string" ? r.toLocaleLowerCase() === "true" : Boolean(r);
81
+ }
82
+ function is(r) {
83
+ return typeof r == "number" ? r : Number(r);
84
+ }
85
+ const Wr = {
86
+ "[object Boolean]": "boolean",
87
+ "[object Number]": "number",
88
+ "[object String]": "string",
89
+ "[object Function]": "function",
90
+ "[object Array]": "array",
91
+ "[object Date]": "date",
92
+ "[object RegExp]": "regExp",
93
+ "[object Object]": "object"
94
+ };
95
+ function Wt(r) {
96
+ let t = Object.prototype.toString.call(r);
97
+ return r == null ? String(r) : Wr[t] || "object";
98
+ }
99
+ function zt(r, e) {
100
+ if (r == e)
101
+ return !0;
102
+ if (r === void 0 || e === void 0)
103
+ return !1;
104
+ let t = Wt(r), n = Wt(e);
105
+ if (t !== n)
106
+ return !1;
107
+ if (t === "object") {
108
+ let s = Object.keys(r), i = Object.keys(e);
109
+ if (s.length !== i.length)
110
+ return !1;
111
+ for (let o = 0; o < s.length; o++) {
112
+ let a = s[o], l = r[a], u = e[a];
113
+ if (!zt(l, u))
114
+ return !1;
115
+ }
116
+ return !0;
117
+ } else if (t === "array") {
118
+ if (r.length !== e.length)
119
+ return !1;
120
+ for (let s = 0; s < r.length; s++) {
121
+ let i = r[s], o = e[s];
122
+ if (!zt(i, o))
123
+ return !1;
124
+ }
125
+ return !0;
126
+ }
127
+ return !1;
128
+ }
129
+ const Jt = Symbol("idKey"), he = Symbol("valueKey"), x = Symbol("childrenKey"), Q = Symbol("growKey");
130
+ class xr {
131
+ [Q] = !0;
132
+ [Jt];
133
+ [he] = vr();
134
+ [x] = /* @__PURE__ */ new Map();
135
+ constructor(e) {
136
+ this[Jt] = e;
137
+ }
138
+ }
139
+ class zr {
140
+ get(e, t) {
141
+ if (t == "value")
142
+ return e[he].value;
143
+ if (t === "grow")
144
+ return e[Q];
145
+ let n = e[x].get(t);
146
+ if (n)
147
+ return Me(n);
148
+ if (e[Q])
149
+ return n = It(t), n[Q] = e[Q], e[x].set(t, n), Me(n);
150
+ }
151
+ set(e, t, n) {
152
+ return t == "value" ? (e[he].value = n, !0) : t === "grow" ? (e[Q] = br(n), !0) : n == null ? (e[x].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
153
+ }
154
+ deleteProperty(e, t) {
155
+ return t === "value" || t == "grow" ? (console.error(`can not delete property:${String(t)}`), !1) : (e[x].delete(t), !0);
156
+ }
157
+ }
158
+ const Nt = "__proxy__";
159
+ function It(r) {
160
+ let e = new xr(r);
161
+ return Reflect.set(e, Nt, new Proxy(e, new zr())), e;
162
+ }
163
+ function Me(r) {
164
+ return Reflect.get(r, Nt);
165
+ }
166
+ class Rr extends xr {
167
+ constructor() {
168
+ super("__root__");
169
+ }
170
+ put(...e) {
171
+ let t = e.length;
172
+ if (t < 2)
173
+ return console.error("参数至少包括一个(key, value)"), !1;
174
+ let n = this;
175
+ for (let s = 0; s < t - 1; s++) {
176
+ let i = e[s], o;
177
+ n[x].has(i) ? o = n[x].get(i) : (o = It(i), n[x].set(i, o)), n = o;
178
+ }
179
+ return n[he].value = e[t - 1], !0;
180
+ }
181
+ get(...e) {
182
+ let t = e.length;
183
+ if (t === 0)
184
+ return;
185
+ let n = this;
186
+ for (let s = 0; s < t; s++) {
187
+ let i = e[s];
188
+ if (n[x].has(i))
189
+ n = n[x].get(i);
190
+ else
191
+ return;
192
+ }
193
+ return n[he].value;
194
+ }
195
+ remove(...e) {
196
+ let t = e.length;
197
+ if (t == 0)
198
+ return !1;
199
+ let n = this;
200
+ for (let i = 0; i < t - 1; i++) {
201
+ let o = e[i];
202
+ if (n[x].has(o))
203
+ n = n[x].get(o);
204
+ else
205
+ return !1;
206
+ }
207
+ let s = e[t - 1];
208
+ return n[x].has(s) ? (n[x].delete(s), !0) : !1;
209
+ }
210
+ contains(...e) {
211
+ let t = e.length;
212
+ if (t == 0)
213
+ return !1;
214
+ let n = this;
215
+ for (let i = 0; i < t - 1; i++) {
216
+ let o = e[i];
217
+ if (n[x].has(o))
218
+ n = n[x].get(o);
219
+ else
220
+ return !1;
221
+ }
222
+ let s = e[t - 1];
223
+ return n[x].has(s);
224
+ }
225
+ clear() {
226
+ this[x].clear();
227
+ }
228
+ }
229
+ const Jr = ["put", "get", "contains", "remove", "clear"];
230
+ function Gt(r) {
231
+ return Jr.includes(r);
232
+ }
233
+ class Gr {
234
+ get(e, t) {
235
+ if (t == "value")
236
+ return e[he].value;
237
+ if (t === "grow")
238
+ return e[Q];
239
+ if (t === x)
240
+ return e[x];
241
+ if (typeof t == "string" && Gt(t))
242
+ return e[t];
243
+ let n = String(t), s = e[x].get(n);
244
+ if (s)
245
+ return Me(s);
246
+ if (e[Q])
247
+ return s = It(n), s[Q] = e[Q], e[x].set(n, s), Me(s);
248
+ }
249
+ set(e, t, n) {
250
+ return t == "value" ? (e[he].value = n, !0) : t === "grow" ? (e[Q] = br(n), !0) : Gt(t) ? !1 : n == null ? (e[x].delete(t), !0) : (console.error(`illegal property:${t}`), !1);
251
+ }
252
+ deleteProperty(e, t) {
253
+ return t === "value" || t == "grow" ? (console.error(`can not delete property:${String(t)}`), !1) : (e[x].delete(t), !0);
254
+ }
255
+ }
256
+ function Qr() {
257
+ let r = new Rr(), e = new Gr(), t = new Proxy(r, e);
258
+ return Object.assign({
259
+ put(...s) {
260
+ return Reflect.apply(r.put, r, s);
261
+ },
262
+ get(...s) {
263
+ return Reflect.apply(r.get, r, s);
264
+ },
265
+ remove(...s) {
266
+ return Reflect.apply(r.remove, r, s);
267
+ },
268
+ contains(...s) {
269
+ return Reflect.apply(r.contains, r, s);
270
+ },
271
+ clear() {
272
+ return Reflect.apply(r.clear, r, []);
273
+ }
274
+ }, t), Reflect.set(r, Nt, t), r;
275
+ }
276
+ let Qt = new Proxy(Rr, {
277
+ construct(r, ...e) {
278
+ let t = Qr();
279
+ return Me(t);
280
+ }
281
+ });
282
+ const ee = "default", Sr = Symbol("sync"), I = Symbol("resolveRoute");
283
+ function Xt(r) {
284
+ let e = !1;
285
+ return function(...t) {
286
+ if (!e)
287
+ return e = !0, Reflect.apply(r, {}, t);
288
+ };
289
+ }
290
+ function Xr(r) {
291
+ let e = r.src;
292
+ return new Promise((t, n) => {
293
+ const s = Xt((a) => {
294
+ wr(a) && (a = a.default), r.component = a, console.debug("success load async module"), t();
295
+ }), i = Xt((a) => {
296
+ console.debug("reject load async module"), n(a);
297
+ });
298
+ let o;
299
+ try {
300
+ o = e(s, i);
301
+ } catch (a) {
302
+ i(a);
303
+ }
304
+ if (o)
305
+ if (typeof o.then == "function")
306
+ o.then(s, i);
307
+ else {
308
+ const a = o.component;
309
+ a && typeof a.then == "function" && a.then(s, i);
310
+ }
311
+ });
312
+ }
313
+ class Yr {
314
+ name;
315
+ level;
316
+ rootName;
317
+ rootIndex = 0;
318
+ constructor(e, t, n, s) {
319
+ this.name = e, this.level = t, this.rootName = n, this.rootIndex = s;
320
+ }
321
+ }
322
+ class tt {
323
+ to;
324
+ routeModel;
325
+ from;
326
+ data = {};
327
+ constructor(e, t) {
328
+ this.to = e, this.from = t;
329
+ }
330
+ static from(e) {
331
+ let t = new tt(e.to, e.from), n = e.data ?? {};
332
+ return $(!0, t.data, n), t;
333
+ }
334
+ }
335
+ class K {
336
+ path;
337
+ get fullPath() {
338
+ const e = this.path ?? `/${this.name}`;
339
+ return `${this.root ?? ee}!${e}`;
340
+ }
341
+ alias;
342
+ name;
343
+ root;
344
+ params;
345
+ query;
346
+ matched;
347
+ meta;
348
+ success;
349
+ error;
350
+ destroy;
351
+ opsType;
352
+ updateType;
353
+ viewTagAttrs;
354
+ index;
355
+ active;
356
+ slot;
357
+ session;
358
+ static clone(e, t) {
359
+ let n = new K();
360
+ return et(n, e, t), n;
361
+ }
362
+ static isSame(e, t) {
363
+ 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);
364
+ }
365
+ static isSameForRouteModel(e, t) {
366
+ return e === t ? !0 : !(e == null || t == null || e.path && e.path != t.path || e.name && e.name != t.name);
367
+ }
368
+ static from(e) {
369
+ let t = new K();
370
+ if (e == null)
371
+ return t;
372
+ let n = t;
373
+ for (let i in e) {
374
+ let o = e[i];
375
+ n[i] = o;
376
+ }
377
+ const s = Object.getOwnPropertySymbols(e);
378
+ if (Array.isArray(s) && s.length > 0)
379
+ for (let i of s)
380
+ n[i] = e[i];
381
+ return t;
382
+ }
383
+ }
384
+ class Zr {
385
+ id;
386
+ name;
387
+ props;
388
+ meta;
389
+ src;
390
+ component;
391
+ constructor(e, t, n, s) {
392
+ this.id = oe.get(), this.name = e, this.src = t, typeof t != "function" && (this.component = t), this.props = n, this.meta = s;
393
+ }
394
+ get isResolved() {
395
+ return this.component !== void 0;
396
+ }
397
+ resolve() {
398
+ return Xr(this);
399
+ }
400
+ }
401
+ class Yt {
402
+ models = [];
403
+ }
404
+ class ut {
405
+ path;
406
+ match;
407
+ redirect;
408
+ name;
409
+ layers = [];
410
+ }
411
+ const D = Symbol("chainKey"), N = Symbol("cursorKey"), ft = Symbol("$persistentModeKey"), F = Symbol("statusKey"), Y = Symbol("argsKey"), Ie = Symbol("exArgsKey"), ye = Symbol("successFnsKey"), Pe = Symbol("errorFnsKey"), le = Symbol("sessionKey"), Z = Symbol("_go");
412
+ class rt {
413
+ [D] = [];
414
+ [N] = 0;
415
+ [ft] = !1;
416
+ [F] = "Free";
417
+ [Y] = [];
418
+ [Ie] = [];
419
+ [ye] = [];
420
+ [Pe] = [];
421
+ [le];
422
+ get session() {
423
+ return this[le];
424
+ }
425
+ constructor(e, t = !1) {
426
+ this[le] = e, this[ft] = t;
427
+ }
428
+ [Z](e, ...t) {
429
+ let n = this[F];
430
+ if (this[F] = "Busy", this[N] += e, this[N] < 0 && (this[N] = 0), this[Y] = t, n === "Exception" || n === "Reject") {
431
+ let a = [{
432
+ session: this[le]
433
+ }, ...this[Ie]];
434
+ for (; this[Pe].length > 0; )
435
+ try {
436
+ let l = this[Pe].shift();
437
+ typeof l == "function" && Oe(() => {
438
+ Reflect.apply(l, {}, a);
439
+ });
440
+ } catch (l) {
441
+ console.error(l.message, l);
442
+ }
443
+ return this[F] = n, this[D] = [], this[N] = 0, this;
444
+ } else if (n === "Finished" || this[N] >= this[D].length) {
445
+ let a = [{
446
+ session: this[le]
447
+ }, ...this[Y]];
448
+ for (; this[ye].length > 0; ) {
449
+ let l = this[ye].shift();
450
+ typeof l == "function" && Oe(() => {
451
+ Reflect.apply(l, {}, a);
452
+ });
453
+ }
454
+ return this[F] = "Free", this;
455
+ }
456
+ if (this[N] >= this[D].length)
457
+ return this[F] = "Free", this;
458
+ let s = this[D][this[N]];
459
+ this[ft] || (this[D].splice(0, this[N] + 1), this[N] = -1);
460
+ let i = this[N] + 1;
461
+ try {
462
+ let o = !1, a = {
463
+ go: (l, ...u) => {
464
+ o || (o = !0, Reflect.apply(this[Z], this, [l, ...u]));
465
+ },
466
+ resolve: (...l) => {
467
+ o || (o = !0, Reflect.apply(this[Z], this, [1, ...l]));
468
+ },
469
+ reject: (...l) => {
470
+ o || (o = !0, Reflect.apply(this.reject, this, [...l]));
471
+ },
472
+ insert: (l) => {
473
+ o || (this[D].splice(i, 0, l), i++);
474
+ },
475
+ session: this[le]
476
+ };
477
+ Oe(() => {
478
+ Reflect.apply(s, {}, [a, ...this[Y]]);
479
+ });
480
+ } catch (o) {
481
+ this.throw(o);
482
+ }
483
+ return this;
484
+ }
485
+ go(e, ...t) {
486
+ return Reflect.apply(this[Z], this, [e, ...t]);
487
+ }
488
+ finish(...e) {
489
+ return this[F] = "Finished", this[Y] = e, Reflect.apply(this[Z], this, [0]);
490
+ }
491
+ reject(...e) {
492
+ return this[F] = "Reject", this[Ie] = e, Reflect.apply(this[Z], this, [0]);
493
+ }
494
+ throw(...e) {
495
+ return this[F] = "Exception", this[Ie] = e, Reflect.apply(this[Z], this, [0]);
496
+ }
497
+ reset(...e) {
498
+ this[F] = "Busy", this[Y] = e, this[D] = [], this[N] = 0;
499
+ let n = [{
500
+ session: this[le]
501
+ }, ...this[Y]];
502
+ for (; this[ye].length > 0; ) {
503
+ let s = this[ye].shift();
504
+ Oe(() => {
505
+ Reflect.apply(s, this, n);
506
+ });
507
+ }
508
+ return this[F] = "Free", this;
509
+ }
510
+ post(e) {
511
+ return this[F] === "Reject" || this[F] === "Exception" ? this : (Array.isArray(e) ? this[D] = [...this[D], ...e] : this[D].push(e), this[F] === "Busy" ? this : (Reflect.apply(this[Z], this, [0, ...this[Y]]), this));
512
+ }
513
+ wait(e, t) {
514
+ return e && typeof e == "function" && this[ye].push(e), t && typeof t == "function" && this[Pe].push(t), this[F] === "Busy" ? this : (Reflect.apply(this[Z], this, [0, ...this[Y]]), this);
515
+ }
516
+ exception(e) {
517
+ return e && typeof e == "function" && this[Pe].push(e), this[F] === "Busy" ? this : Reflect.apply(this[Z], this, [0, ...this[Y]]);
518
+ }
519
+ isFinish() {
520
+ return this[F] == "Reject" || this[F] == "Free" && this[N] >= this[D].length;
521
+ }
522
+ }
523
+ const pe = Symbol("registerKey");
524
+ class en {
525
+ policy;
526
+ callback;
527
+ constructor(e, t) {
528
+ this.callback = e, this.policy = t;
529
+ }
530
+ }
531
+ class Zt {
532
+ [pe] = /* @__PURE__ */ new Map();
533
+ constructor() {
534
+ }
535
+ on(e, t, n = !1) {
536
+ let s = this[pe].get(e);
537
+ s || (s = new Array(), this[pe].set(e, s));
538
+ let i = n === !0 ? 1 : 0, o = new en(t, i);
539
+ return s.push(o), this;
540
+ }
541
+ off(e, t) {
542
+ if (!t)
543
+ return this[pe].delete(e), this;
544
+ let n = this[pe].get(e);
545
+ if (n) {
546
+ for (let s = 0; s < n.length; s++)
547
+ if (n[s].callback === t) {
548
+ n.splice(s, 1);
549
+ break;
550
+ }
551
+ }
552
+ return this;
553
+ }
554
+ bind(e, t, n = !1) {
555
+ return this.on(e, t, n);
556
+ }
557
+ unbind(e, t) {
558
+ return this.off(e, t);
559
+ }
560
+ once(e, t) {
561
+ return this.on(e, t, !0);
562
+ }
563
+ all(...e) {
564
+ let t = e.length;
565
+ if (t < 1)
566
+ return this;
567
+ let n = e[t - 1];
568
+ if (typeof n != "function")
569
+ return console.error("callback can not benn empty"), this;
570
+ let s = t - 1, i = new Array(s), o = [].splice.call(e, 0, s);
571
+ for (let a = 0; a < o.length; a++)
572
+ this.once(o[a], (l) => {
573
+ i[a] = l, s -= 1, s == 0 && Reflect.apply(n, {}, i);
574
+ });
575
+ return this;
576
+ }
577
+ emit(e, ...t) {
578
+ let n = this[pe].get(e);
579
+ if (!n)
580
+ return this;
581
+ for (let s = 0; s < n.length; ) {
582
+ let i = n[s];
583
+ if (i.policy == 1 ? n.splice(s, 1) : s++, typeof i.callback == "function")
584
+ try {
585
+ Oe(() => {
586
+ Reflect.apply(i.callback, {}, t);
587
+ });
588
+ } catch (o) {
589
+ console.error(o.message, o);
590
+ }
591
+ }
592
+ return this;
593
+ }
594
+ trigger(e, ...t) {
595
+ return Reflect.apply(this.emit, this, [e, ...t]);
596
+ }
597
+ }
598
+ const Ce = Symbol("registerKey");
599
+ class tn {
600
+ [Ce] = /* @__PURE__ */ new Map();
601
+ constructor() {
602
+ }
603
+ set(e, t) {
604
+ this[Ce].set(e, t);
605
+ }
606
+ get(e) {
607
+ return this[Ce].get(e);
608
+ }
609
+ has(e) {
610
+ return this[Ce].has(e);
611
+ }
612
+ delete(e) {
613
+ return this[Ce].delete(e);
614
+ }
615
+ }
616
+ const Le = Symbol("lc");
617
+ function _t(r, e = !1) {
618
+ let t = r;
619
+ if (Reflect.has(t, Le))
620
+ return t[Le];
621
+ if (e) {
622
+ const n = new tn();
623
+ return t[Le] = n, n;
624
+ }
625
+ return null;
626
+ }
627
+ function Pr(r, e) {
628
+ let t = r;
629
+ for (; t; ) {
630
+ if (Reflect.has(t, Le)) {
631
+ const n = t[Le];
632
+ if (n.has(e))
633
+ return n.get(e);
634
+ }
635
+ t = t.$parent;
636
+ }
637
+ return null;
638
+ }
639
+ function er(r) {
640
+ if (Array.isArray(r.children) && r.children.length > 0) {
641
+ let e = r.children[0];
642
+ if (e != null && e.component != null && e.component.proxy != null)
643
+ return _t(e.component.proxy, !1);
644
+ }
645
+ return null;
646
+ }
647
+ const nt = Symbol("hooksKey");
648
+ function rn(r) {
649
+ let e = r.get(nt);
650
+ e || (e = [], r.set(nt, e));
651
+ }
652
+ function tr(r, e) {
653
+ let t = r.get(nt);
654
+ if (t != null)
655
+ for (let n = t.length - 1; n >= 0; n--) {
656
+ let s = t[n];
657
+ if (s.type === e)
658
+ try {
659
+ Reflect.apply(s.hook, s.target, []);
660
+ } catch (i) {
661
+ console.error(i.message, i);
662
+ }
663
+ }
664
+ }
665
+ var Tt = /* @__PURE__ */ ((r) => (r.DEACTIVATED = "da", r.ACTIVATED = "a", r))(Tt || {});
666
+ class nn {
667
+ type;
668
+ hook;
669
+ target;
670
+ constructor(e, t, n) {
671
+ this.target = n, this.hook = t, this.type = e;
672
+ }
673
+ }
674
+ function sn(r, e, t, n) {
675
+ let s = new nn(e, t, n);
676
+ return r.push(s), !0;
677
+ }
678
+ function on(r, e, t, n) {
679
+ let s = -1;
680
+ for (let i = 0; i < r.length; i++) {
681
+ let o = r[i];
682
+ if (o.type === e && o.hook === t && o.target === n) {
683
+ s = i;
684
+ break;
685
+ }
686
+ }
687
+ return s != -1 ? (r.splice(s, 1), !0) : !1;
688
+ }
689
+ function Cr(r) {
690
+ return (e, t) => {
691
+ let n;
692
+ if (t)
693
+ n = t;
694
+ else {
695
+ let i = Lt();
696
+ if (i == null || i.proxy == null) {
697
+ console.error("can not get current instance or proxy");
698
+ return;
699
+ }
700
+ n = i.proxy;
701
+ }
702
+ let s = Pr(n, nt);
703
+ if (s == null) {
704
+ console.warn("can not get hooks context");
705
+ return;
706
+ }
707
+ st(() => {
708
+ on(s, r, e, n);
709
+ }), sn(s, r, e, n);
710
+ };
711
+ }
712
+ let os = Cr("a"), ls = Cr("da");
713
+ const $t = Symbol("routeKey");
714
+ function rr(r, e) {
715
+ r.set($t, e);
716
+ }
717
+ function Ht(r) {
718
+ let e = Pr(r, $t);
719
+ return typeof e == "function" ? e() : e ?? null;
720
+ }
721
+ const it = Symbol("rk"), ct = Symbol("vd"), nr = Symbol("rv"), ht = Symbol("rvi"), sr = Symbol("pv"), dt = Symbol("pvi");
722
+ function ln(r) {
723
+ for (var e = [], t = 0; t < r.length; ) {
724
+ var n = r[t];
725
+ if (n === "*" || n === "+" || n === "?") {
726
+ e.push({ type: "MODIFIER", index: t, value: r[t++] });
727
+ continue;
728
+ }
729
+ if (n === "\\") {
730
+ e.push({ type: "ESCAPED_CHAR", index: t++, value: r[t++] });
731
+ continue;
732
+ }
733
+ if (n === "{") {
734
+ e.push({ type: "OPEN", index: t, value: r[t++] });
735
+ continue;
736
+ }
737
+ if (n === "}") {
738
+ e.push({ type: "CLOSE", index: t, value: r[t++] });
739
+ continue;
740
+ }
741
+ if (n === ":") {
742
+ for (var s = "", i = t + 1; i < r.length; ) {
743
+ var o = r.charCodeAt(i);
744
+ if (o >= 48 && o <= 57 || o >= 65 && o <= 90 || o >= 97 && o <= 122 || o === 95) {
745
+ s += r[i++];
746
+ continue;
747
+ }
748
+ break;
749
+ }
750
+ if (!s)
751
+ throw new TypeError("Missing parameter name at ".concat(t));
752
+ e.push({ type: "NAME", index: t, value: s }), t = i;
753
+ continue;
754
+ }
755
+ if (n === "(") {
756
+ var a = 1, l = "", i = t + 1;
757
+ if (r[i] === "?")
758
+ throw new TypeError('Pattern cannot start with "?" at '.concat(i));
759
+ for (; i < r.length; ) {
760
+ if (r[i] === "\\") {
761
+ l += r[i++] + r[i++];
762
+ continue;
763
+ }
764
+ if (r[i] === ")") {
765
+ if (a--, a === 0) {
766
+ i++;
767
+ break;
768
+ }
769
+ } else if (r[i] === "(" && (a++, r[i + 1] !== "?"))
770
+ throw new TypeError("Capturing groups are not allowed at ".concat(i));
771
+ l += r[i++];
772
+ }
773
+ if (a)
774
+ throw new TypeError("Unbalanced pattern at ".concat(t));
775
+ if (!l)
776
+ throw new TypeError("Missing pattern at ".concat(t));
777
+ e.push({ type: "PATTERN", index: t, value: l }), t = i;
778
+ continue;
779
+ }
780
+ e.push({ type: "CHAR", index: t, value: r[t++] });
781
+ }
782
+ return e.push({ type: "END", index: t, value: "" }), e;
783
+ }
784
+ function Ar(r, e) {
785
+ e === void 0 && (e = {});
786
+ for (var t = ln(r), n = e.prefixes, s = n === void 0 ? "./" : n, i = "[^".concat(we(e.delimiter || "/#?"), "]+?"), o = [], a = 0, l = 0, u = "", f = function(A) {
787
+ if (l < t.length && t[l].type === A)
788
+ return t[l++].value;
789
+ }, c = function(A) {
790
+ var S = f(A);
791
+ if (S !== void 0)
792
+ return S;
793
+ var P = t[l], k = P.type, L = P.index;
794
+ throw new TypeError("Unexpected ".concat(k, " at ").concat(L, ", expected ").concat(A));
795
+ }, h = function() {
796
+ for (var A = "", S; S = f("CHAR") || f("ESCAPED_CHAR"); )
797
+ A += S;
798
+ return A;
799
+ }; l < t.length; ) {
800
+ var d = f("CHAR"), m = f("NAME"), p = f("PATTERN");
801
+ if (m || p) {
802
+ var y = d || "";
803
+ s.indexOf(y) === -1 && (u += y, y = ""), u && (o.push(u), u = ""), o.push({
804
+ name: m || a++,
805
+ prefix: y,
806
+ suffix: "",
807
+ pattern: p || i,
808
+ modifier: f("MODIFIER") || ""
809
+ });
810
+ continue;
811
+ }
812
+ var v = d || f("ESCAPED_CHAR");
813
+ if (v) {
814
+ u += v;
815
+ continue;
816
+ }
817
+ u && (o.push(u), u = "");
818
+ var g = f("OPEN");
819
+ if (g) {
820
+ var y = h(), _ = f("NAME") || "", b = f("PATTERN") || "", T = h();
821
+ c("CLOSE"), o.push({
822
+ name: _ || (b ? a++ : ""),
823
+ pattern: _ && !b ? i : b,
824
+ prefix: y,
825
+ suffix: T,
826
+ modifier: f("MODIFIER") || ""
827
+ });
828
+ continue;
829
+ }
830
+ c("END");
831
+ }
832
+ return o;
833
+ }
834
+ function an(r, e) {
835
+ return un(Ar(r, e), e);
836
+ }
837
+ function un(r, e) {
838
+ e === void 0 && (e = {});
839
+ var t = Dt(e), n = e.encode, s = n === void 0 ? function(l) {
840
+ return l;
841
+ } : n, i = e.validate, o = i === void 0 ? !0 : i, a = r.map(function(l) {
842
+ if (typeof l == "object")
843
+ return new RegExp("^(?:".concat(l.pattern, ")$"), t);
844
+ });
845
+ return function(l) {
846
+ for (var u = "", f = 0; f < r.length; f++) {
847
+ var c = r[f];
848
+ if (typeof c == "string") {
849
+ u += c;
850
+ continue;
851
+ }
852
+ var h = l ? l[c.name] : void 0, d = c.modifier === "?" || c.modifier === "*", m = c.modifier === "*" || c.modifier === "+";
853
+ if (Array.isArray(h)) {
854
+ if (!m)
855
+ throw new TypeError('Expected "'.concat(c.name, '" to not repeat, but got an array'));
856
+ if (h.length === 0) {
857
+ if (d)
858
+ continue;
859
+ throw new TypeError('Expected "'.concat(c.name, '" to not be empty'));
860
+ }
861
+ for (var p = 0; p < h.length; p++) {
862
+ var y = s(h[p], c);
863
+ if (o && !a[f].test(y))
864
+ throw new TypeError('Expected all "'.concat(c.name, '" to match "').concat(c.pattern, '", but got "').concat(y, '"'));
865
+ u += c.prefix + y + c.suffix;
866
+ }
867
+ continue;
868
+ }
869
+ if (typeof h == "string" || typeof h == "number") {
870
+ var y = s(String(h), c);
871
+ if (o && !a[f].test(y))
872
+ throw new TypeError('Expected "'.concat(c.name, '" to match "').concat(c.pattern, '", but got "').concat(y, '"'));
873
+ u += c.prefix + y + c.suffix;
874
+ continue;
875
+ }
876
+ if (!d) {
877
+ var v = m ? "an array" : "a string";
878
+ throw new TypeError('Expected "'.concat(c.name, '" to be ').concat(v));
879
+ }
880
+ }
881
+ return u;
882
+ };
883
+ }
884
+ function fn(r, e) {
885
+ var t = [], n = Er(r, t, e);
886
+ return cn(n, t, e);
887
+ }
888
+ function cn(r, e, t) {
889
+ t === void 0 && (t = {});
890
+ var n = t.decode, s = n === void 0 ? function(i) {
891
+ return i;
892
+ } : n;
893
+ return function(i) {
894
+ var o = r.exec(i);
895
+ if (!o)
896
+ return !1;
897
+ for (var a = o[0], l = o.index, u = /* @__PURE__ */ Object.create(null), f = function(h) {
898
+ if (o[h] === void 0)
899
+ return "continue";
900
+ var d = e[h - 1];
901
+ d.modifier === "*" || d.modifier === "+" ? u[d.name] = o[h].split(d.prefix + d.suffix).map(function(m) {
902
+ return s(m, d);
903
+ }) : u[d.name] = s(o[h], d);
904
+ }, c = 1; c < o.length; c++)
905
+ f(c);
906
+ return { path: a, index: l, params: u };
907
+ };
908
+ }
909
+ function we(r) {
910
+ return r.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
911
+ }
912
+ function Dt(r) {
913
+ return r && r.sensitive ? "" : "i";
914
+ }
915
+ function hn(r, e) {
916
+ if (!e)
917
+ return r;
918
+ for (var t = /\((?:\?<(.*?)>)?(?!\?)/g, n = 0, s = t.exec(r.source); s; )
919
+ e.push({
920
+ name: s[1] || n++,
921
+ prefix: "",
922
+ suffix: "",
923
+ modifier: "",
924
+ pattern: ""
925
+ }), s = t.exec(r.source);
926
+ return r;
927
+ }
928
+ function dn(r, e, t) {
929
+ var n = r.map(function(s) {
930
+ return Er(s, e, t).source;
931
+ });
932
+ return new RegExp("(?:".concat(n.join("|"), ")"), Dt(t));
933
+ }
934
+ function yn(r, e, t) {
935
+ return pn(Ar(r, t), e, t);
936
+ }
937
+ function pn(r, e, t) {
938
+ t === void 0 && (t = {});
939
+ for (var n = t.strict, s = n === void 0 ? !1 : n, 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) {
940
+ return L;
941
+ } : u, c = t.delimiter, h = c === void 0 ? "/#?" : c, d = t.endsWith, m = d === void 0 ? "" : d, p = "[".concat(we(m), "]|$"), y = "[".concat(we(h), "]"), v = o ? "^" : "", g = 0, _ = r; g < _.length; g++) {
942
+ var b = _[g];
943
+ if (typeof b == "string")
944
+ v += we(f(b));
945
+ else {
946
+ var T = we(f(b.prefix)), A = we(f(b.suffix));
947
+ if (b.pattern)
948
+ if (e && e.push(b), T || A)
949
+ if (b.modifier === "+" || b.modifier === "*") {
950
+ var S = b.modifier === "*" ? "?" : "";
951
+ v += "(?:".concat(T, "((?:").concat(b.pattern, ")(?:").concat(A).concat(T, "(?:").concat(b.pattern, "))*)").concat(A, ")").concat(S);
952
+ } else
953
+ v += "(?:".concat(T, "(").concat(b.pattern, ")").concat(A, ")").concat(b.modifier);
954
+ else
955
+ b.modifier === "+" || b.modifier === "*" ? v += "((?:".concat(b.pattern, ")").concat(b.modifier, ")") : v += "(".concat(b.pattern, ")").concat(b.modifier);
956
+ else
957
+ v += "(?:".concat(T).concat(A, ")").concat(b.modifier);
958
+ }
959
+ }
960
+ if (l)
961
+ s || (v += "".concat(y, "?")), v += t.endsWith ? "(?=".concat(p, ")") : "$";
962
+ else {
963
+ var P = r[r.length - 1], k = typeof P == "string" ? y.indexOf(P[P.length - 1]) > -1 : P === void 0;
964
+ s || (v += "(?:".concat(y, "(?=").concat(p, "))?")), k || (v += "(?=".concat(y, "|").concat(p, ")"));
965
+ }
966
+ return new RegExp(v, Dt(t));
967
+ }
968
+ function Er(r, e, t) {
969
+ return r instanceof RegExp ? hn(r, e) : Array.isArray(r) ? dn(r, e, t) : yn(r, e, t);
970
+ }
971
+ var E = /* @__PURE__ */ ((r) => (r[r.Push = 0] = "Push", r[r.Replace = 1] = "Replace", r[r.Put = 2] = "Put", r[r.Append = 3] = "Append", r[r.Open = 4] = "Open", r))(E || {}), Xe = /* @__PURE__ */ ((r) => (r[r.Part = 0] = "Part", r[r.All = 1] = "All", r))(Xe || {});
972
+ const J = Symbol("rootKey"), z = Symbol("rootNodeKey"), ce = Symbol("parentNodeKey"), Ye = Symbol("nameKey");
973
+ class ne {
974
+ instance = null;
975
+ model;
976
+ route;
977
+ active = !0;
978
+ index = 0;
979
+ constructor(e, t, n = 0, s = !0) {
980
+ this.route = e, this.model = t, this.index = n, this.active = s;
981
+ }
982
+ }
983
+ class Ae {
984
+ _slots;
985
+ get slots() {
986
+ return this._slots == null && (this._slots = Dr([])), this._slots;
987
+ }
988
+ get empty() {
989
+ return this._slots == null || this._slots.value.length == 0;
990
+ }
991
+ [Ye];
992
+ [J];
993
+ [z] = null;
994
+ [ce] = null;
995
+ get name() {
996
+ return this[Ye];
997
+ }
998
+ constructor(e, t, n) {
999
+ this[Ye] = e, this[J] = t, n && (this[z] = n);
1000
+ }
1001
+ }
1002
+ class V {
1003
+ view;
1004
+ index;
1005
+ level;
1006
+ constructor(e, t, n) {
1007
+ this.view = e, this.index = t, this.level = n;
1008
+ }
1009
+ static include(e, t) {
1010
+ for (let n = 0; n < e.length; n++) {
1011
+ let s = e[n];
1012
+ if (s.view === t.view && (t.index == -1 || s.index === t.index) && s.level === t.level)
1013
+ return !0;
1014
+ }
1015
+ return !1;
1016
+ }
1017
+ }
1018
+ class yt {
1019
+ views = [];
1020
+ }
1021
+ class mn {
1022
+ layers = [];
1023
+ }
1024
+ class vn {
1025
+ time;
1026
+ route;
1027
+ }
1028
+ class gn {
1029
+ forbidTime = 300;
1030
+ submitRecorder = new vn();
1031
+ isSameRoute(e, t) {
1032
+ return e == null || t == null ? !1 : e.name === t.name && e.path === t.path && e.root === t.root;
1033
+ }
1034
+ acquire(e) {
1035
+ let t = new Date().getTime();
1036
+ if (this.isSameRoute(e, this.submitRecorder.route) && this.submitRecorder.time && t - this.submitRecorder.time <= this.forbidTime) {
1037
+ this.submitRecorder.time = t;
1038
+ return;
1039
+ }
1040
+ return this.submitRecorder.route = e, this.submitRecorder.time = t, t;
1041
+ }
1042
+ release(e) {
1043
+ this.submitRecorder.time === e && (this.submitRecorder.route = void 0);
1044
+ }
1045
+ }
1046
+ const be = Symbol("_notifyChange");
1047
+ class ir {
1048
+ currentRoute;
1049
+ routes;
1050
+ constructor(e, t) {
1051
+ this.currentRoute = e, this.routes = t;
1052
+ }
1053
+ }
1054
+ const Ne = typeof window < "u", O = function() {
1055
+ return window;
1056
+ }, He = function() {
1057
+ return window.document;
1058
+ };
1059
+ function wn(r) {
1060
+ let e = r, t = e.lastIndexOf("/");
1061
+ 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;
1062
+ }
1063
+ function pt() {
1064
+ if (!Ne)
1065
+ return "/";
1066
+ let r = O().location, e = `${r.protocol}//${r.host}`;
1067
+ return e += wn(r.pathname), e;
1068
+ }
1069
+ function qt(r, e, t) {
1070
+ r.addEventListener ? r.addEventListener(e, t, !1) : r.attachEvent ? r.attachEvent(`on${e}`, t) : r[`on${e}`] = t;
1071
+ }
1072
+ function Kt(r, e, t) {
1073
+ r.removeEventListener ? r.removeEventListener(e, t) : r.detachEvent ? r.detachEvent(`on${e}`, t) : r[`on${e}`] = null;
1074
+ }
1075
+ const De = Symbol("ignoreHistoryChangeOnceKey"), or = Symbol("_navigateFirstRoute"), Ve = Symbol("_getRouteMark"), mt = Symbol("_getUrlSearch"), vt = Symbol("_generateLocation"), Ee = Symbol("_setRouteMarkRecorder"), Fe = Symbol("beforeRestoreFiltersKey"), lr = Symbol("_beforeRestore"), ar = "Symbol(_fox_restore_point)";
1076
+ function gt(r, ...e) {
1077
+ return typeof r == "function" ? Reflect.apply(r, null, [...e]) : r;
1078
+ }
1079
+ class Fr {
1080
+ base;
1081
+ storage;
1082
+ mode;
1083
+ query;
1084
+ firstNavigate = !0;
1085
+ historyMonitor;
1086
+ traceless = !1;
1087
+ changeHandler;
1088
+ historyChange;
1089
+ [De] = !1;
1090
+ [Fe] = new Array();
1091
+ constructor(e = "hash", t = "", n = "", s = !0, i = !0, o = !1, a) {
1092
+ this.mode = e, this.base = t, this.query = n, this.firstNavigate = s, this.historyMonitor = i, this.traceless = o, this.storage = a ?? O().sessionStorage;
1093
+ }
1094
+ init(e = !0) {
1095
+ const t = O();
1096
+ return typeof this.historyChange != "function" && (this.historyChange = () => {
1097
+ if (this[De]) {
1098
+ this[De] = !1;
1099
+ return;
1100
+ }
1101
+ if (gt(this.historyMonitor)) {
1102
+ const n = t.history.state;
1103
+ this[be](n);
1104
+ try {
1105
+ let s = [];
1106
+ if (typeof n == "string" ? s = JSON.parse(n) : s = n, Array.isArray(s) && s.length > 0) {
1107
+ const i = this[Ve]() ?? "/";
1108
+ this[Ee](i, s);
1109
+ }
1110
+ } catch {
1111
+ }
1112
+ }
1113
+ }), qt(t, "popstate", this.historyChange), this.firstNavigate && e && this[or](), Promise.resolve();
1114
+ }
1115
+ destroy() {
1116
+ if (this.historyChange) {
1117
+ const e = O();
1118
+ Kt(e, "popstate", this.historyChange);
1119
+ }
1120
+ }
1121
+ [lr](e, t, n, s) {
1122
+ for (let i of this[Fe])
1123
+ try {
1124
+ const o = [], a = Reflect.apply(i, {}, [e, t, n, s]);
1125
+ if (a === !1)
1126
+ return a;
1127
+ } catch (o) {
1128
+ console.error(o.message, o);
1129
+ }
1130
+ return !0;
1131
+ }
1132
+ beforeRestoreEach(e) {
1133
+ this[Fe].push(e);
1134
+ }
1135
+ removeBeforeRestoreEach(e) {
1136
+ const t = this[Fe].indexOf(e);
1137
+ return t !== -1 ? (this[Fe].splice(t, 1), !0) : !1;
1138
+ }
1139
+ [or]() {
1140
+ const e = this[Ve]() ?? "/", t = this.storage.getItem(ar);
1141
+ if (t)
1142
+ try {
1143
+ const o = JSON.parse(t);
1144
+ if (o.mark === e && Array.isArray(o.routes) && o.routes.length > 0) {
1145
+ const a = o.routes.filter((l, u) => this[lr](l, u, e, o.routes));
1146
+ if (a.length > 0) {
1147
+ const l = this[mt](), u = a.length - 1;
1148
+ a[u].query = l || a[u].query, this[be](a);
1149
+ return;
1150
+ }
1151
+ }
1152
+ } catch {
1153
+ }
1154
+ const n = e.indexOf("!");
1155
+ let s;
1156
+ n != -1 ? s = e.substring(n + 1) : s = e;
1157
+ const i = new K();
1158
+ i.path = s, i.query = this[mt](), this[be]([i]);
1159
+ }
1160
+ [Ee](e, t) {
1161
+ try {
1162
+ const n = {
1163
+ mark: e,
1164
+ routes: t
1165
+ }, s = JSON.stringify(n);
1166
+ this.storage.setItem(ar, s);
1167
+ } catch (n) {
1168
+ console.error(n.message, n);
1169
+ }
1170
+ }
1171
+ setRestorePoint(e) {
1172
+ const t = this[Ve]() ?? "/";
1173
+ this[Ee](t, e);
1174
+ }
1175
+ [be](e) {
1176
+ typeof this.changeHandler == "function" && this.changeHandler(e);
1177
+ }
1178
+ [Ve]() {
1179
+ const e = O();
1180
+ if (this.mode === "path") {
1181
+ let t = e.location.pathname;
1182
+ return this.base && t.indexOf(this.base) === 0 && (t = t.substring(this.base.length)), t;
1183
+ } else {
1184
+ const t = e.location.hash, n = t.indexOf("#");
1185
+ if (n != -1)
1186
+ return t.substring(n + 1);
1187
+ }
1188
+ return null;
1189
+ }
1190
+ [mt]() {
1191
+ let t = O().location.search;
1192
+ return t.length > 0 && t.indexOf("?") === 0 && (t = t.substring(1)), t;
1193
+ }
1194
+ listen(e) {
1195
+ this.changeHandler = e;
1196
+ }
1197
+ go(e, t = !0) {
1198
+ const n = O();
1199
+ this[De] = !t, n.history.go(e);
1200
+ }
1201
+ push(e) {
1202
+ const t = this[vt](e.currentRoute);
1203
+ gt(this.traceless, e.currentRoute) || O().history.pushState(e.routes, "", t);
1204
+ const n = e.currentRoute.fullPath;
1205
+ this[Ee](n, e.routes);
1206
+ }
1207
+ replace(e) {
1208
+ const t = this[vt](e.currentRoute);
1209
+ gt(this.traceless, e.currentRoute) || O().history.replaceState(e.routes, "", t);
1210
+ const n = e.currentRoute.fullPath;
1211
+ this[Ee](n, e.routes);
1212
+ }
1213
+ [vt](e) {
1214
+ const t = O();
1215
+ let n = "";
1216
+ if (e.query) {
1217
+ let a = "";
1218
+ if (typeof e.query == "object")
1219
+ for (let l of Reflect.ownKeys(e.query)) {
1220
+ let u = encodeURIComponent(e.query[l]), f = `${encodeURIComponent(String(l))}=${u}`;
1221
+ a.length > 0 && (a += "&"), a += f;
1222
+ }
1223
+ else
1224
+ a = e.query;
1225
+ this.query ? (n = a.length > 0 ? `${this.query}&${a}` : this.query, n.length > 0 && n.charAt(0) !== "?" && (n = `?${n}`)) : a.length > 0 && (n = `?${a}`);
1226
+ }
1227
+ const s = t.location;
1228
+ let i = e.alias ?? e.fullPath;
1229
+ i.startsWith(ee) && (i = i.substring(ee.length + 1));
1230
+ let o;
1231
+ return n ? this.mode == "path" ? i.indexOf("/") === 0 ? o = `${this.base}${i}${n}` : o = `${this.base}/${i}${n}` : o = `${s.pathname}${n}#${i}` : this.mode == "path" ? i.indexOf("/") === 0 ? o = `${this.base}${i}` : o = `${this.base}/${i}` : o = `${s.pathname}#${i}`, `${s.origin}${o}`;
1232
+ }
1233
+ }
1234
+ function as(r = !0, e = null, t = "", n = !0, s = !1, i) {
1235
+ return e !== null && (e = O().location.pathname), e && e.endsWith("/") && (e = e.substring(0, e.length - 1)), new Fr("path", e ?? "", t, r, n, s, i);
1236
+ }
1237
+ function bn(r = !0, e = "", t = !0, n = !1, s) {
1238
+ return new Fr("hash", "", e, r, t, n, s);
1239
+ }
1240
+ class xn {
1241
+ maxSize = 50;
1242
+ cursor = -1;
1243
+ queue = [];
1244
+ changeHandler;
1245
+ base;
1246
+ historyMonitor = !1;
1247
+ traceless = !1;
1248
+ constructor(e, t = 50) {
1249
+ this.base = e, this.maxSize = t;
1250
+ }
1251
+ init(e = !0) {
1252
+ return Promise.resolve();
1253
+ }
1254
+ destroy() {
1255
+ this.queue = [];
1256
+ }
1257
+ beforeRestoreEach(e) {
1258
+ }
1259
+ removeBeforeRestoreEach(e) {
1260
+ return !1;
1261
+ }
1262
+ listen(e) {
1263
+ this.changeHandler = e;
1264
+ }
1265
+ [be](e) {
1266
+ typeof this.changeHandler == "function" && this.changeHandler(e);
1267
+ }
1268
+ go(e, t = !0) {
1269
+ if (this.queue.length == 0 || this.cursor <= 0 || this.cursor >= this.queue.length - 1)
1270
+ return;
1271
+ let n = this.cursor + e;
1272
+ if (n < 0 ? n = 0 : n > this.queue.length - 1 && (n = this.queue.length - 1), n != this.cursor && (this.cursor = n, t)) {
1273
+ const s = this.queue[n];
1274
+ this[be](s.routes);
1275
+ }
1276
+ }
1277
+ push(e) {
1278
+ this.queue.length >= this.maxSize && this.queue.splice(0, 1), this.queue.push(e), this.cursor = this.queue.length - 1;
1279
+ }
1280
+ replace(e) {
1281
+ let t = this.queue.length - this.cursor;
1282
+ this.queue.splice(this.cursor, t), this.queue[this.cursor] = e;
1283
+ }
1284
+ setRestorePoint(e) {
1285
+ }
1286
+ }
1287
+ function Rn(r = "", e = 50) {
1288
+ return new xn(r, e);
1289
+ }
1290
+ const Be = Symbol("_constructRouteModel"), Ue = Symbol("_findRouteModel"), wt = Symbol("_findRootView"), ur = Symbol("_getFirstView"), ae = Symbol("_removeView"), fr = Symbol("_buildPage"), cr = Symbol("_resolveComponent"), hr = Symbol("_update"), se = Symbol("_merge"), bt = Symbol("_handleHistoryChange"), ke = Symbol("_handleRouteUpdated"), We = Symbol("routeUpdatedCallback"), w = Symbol("currentRoutes"), me = Symbol("current"), dr = Symbol("_addRouteRecorder"), _e = Symbol("_removeRouteRecorder"), ze = Symbol("_cloneRouteRecorder"), q = Symbol("_handleError"), Je = Symbol("errorCallback"), B = Symbol("registerKey"), Ge = Symbol("notFoundKey"), xt = Symbol("notFoundPathKey"), U = Symbol("forestKey"), C = Symbol("historyKey"), Te = Symbol("beforeFiltersKey"), $e = Symbol("afterFiltersKey"), qe = Symbol("destroyFiltersKey"), ve = Symbol("mainDispatcherKey"), Rt = Symbol("initKey"), ue = Symbol("readyKey"), St = Symbol("readyHandlersKey"), Qe = Symbol("_markReady"), yr = Symbol("_createNextFn"), Pt = Symbol("_start"), Ct = Symbol("_before"), At = Symbol("_after"), pr = Symbol("_destroy"), Et = Symbol("_load"), Ke = Symbol("_unload"), je = Symbol("routerGuardKey");
1291
+ function Sn(r) {
1292
+ return r.layers.length == 0 || r.layers[0].views.length == 0;
1293
+ }
1294
+ function Pn(r) {
1295
+ let e = [];
1296
+ return r.layers.forEach((t) => {
1297
+ t.models == null || t.models == null || t.models.forEach((n) => {
1298
+ if (!(n == null || n == null))
1299
+ if (typeof n.meta == "object") {
1300
+ let s = $(!0, {}, n.meta);
1301
+ e.push(s);
1302
+ } else
1303
+ n.meta && e.push(n.meta);
1304
+ });
1305
+ }), e;
1306
+ }
1307
+ class Cn {
1308
+ [B] = new Array();
1309
+ [Ge];
1310
+ [xt] = "*";
1311
+ [ue] = !1;
1312
+ [St] = [];
1313
+ [U] = new mn();
1314
+ [C];
1315
+ [w] = new Array();
1316
+ [Je] = null;
1317
+ [We] = null;
1318
+ [Te] = new Array();
1319
+ [$e] = new Array();
1320
+ [qe] = new Array();
1321
+ [ve] = new rt();
1322
+ [je] = new gn();
1323
+ [Rt] = !1;
1324
+ [me] = vr(null);
1325
+ get current() {
1326
+ return this[me].value;
1327
+ }
1328
+ options;
1329
+ constructor(e) {
1330
+ this.options = e ?? {}, this.options.notFoundPath && this.setNotFoundPath(this.options.notFoundPath);
1331
+ let t = this.options.routes || [];
1332
+ this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[C] = e.history : this[C] = Ne ? bn() : Rn(), this[C]?.listen(async (n) => {
1333
+ let s = !0;
1334
+ try {
1335
+ if (typeof n == "string") {
1336
+ const i = this[I](n);
1337
+ i && await this[bt]([i]);
1338
+ } else
1339
+ await this[bt](n);
1340
+ } catch (i) {
1341
+ console.error(i.message, i), s = !1;
1342
+ }
1343
+ this[ue] === !1 && this[Qe](s);
1344
+ });
1345
+ }
1346
+ [q](e = "error", t) {
1347
+ if (t && typeof t.error == "function")
1348
+ try {
1349
+ t.error(e);
1350
+ } catch {
1351
+ }
1352
+ if (typeof this[Je] == "function")
1353
+ try {
1354
+ this[Je](e, t);
1355
+ } catch {
1356
+ }
1357
+ console.error(e);
1358
+ }
1359
+ init() {
1360
+ this[Rt] !== !0 && (this[C]?.init(!this[ue]), this[Rt] = !0);
1361
+ }
1362
+ isReady() {
1363
+ return this[ue] ? Promise.resolve() : new Promise((e, t) => {
1364
+ this[St].push([e, t]);
1365
+ });
1366
+ }
1367
+ [Qe](e) {
1368
+ this[ue] = !0, this[St].forEach(([t, n]) => {
1369
+ try {
1370
+ e ? t() : n();
1371
+ } catch (s) {
1372
+ console.error(s.message, s);
1373
+ }
1374
+ });
1375
+ }
1376
+ [bt](e) {
1377
+ try {
1378
+ if (!e) {
1379
+ let o = [...this[w]].reverse();
1380
+ return this[Ke](o), Ne && O().location.reload(), Promise.resolve();
1381
+ }
1382
+ let t = null, n = [], s = [], i = 0;
1383
+ for (; i < e.length && i < this[w].length && K.isSame(e[i], this[w][i]); i++)
1384
+ e[i].active === !0 && e[i].active !== this[w][i].active && (t = e[i]);
1385
+ if (i < e.length && (n = e.slice(i)), i < this[w].length && (s = this[w].slice(i).reverse()), s.length === 0 && n.length === 0) {
1386
+ if (t !== null)
1387
+ return this.restore([t]);
1388
+ } else if (s.length > 0) {
1389
+ if (this[Ke](s)) {
1390
+ if (n.length > 0)
1391
+ return this.restore(n);
1392
+ if (t !== null)
1393
+ return this.restore([t]);
1394
+ }
1395
+ } else
1396
+ return this.restore(n);
1397
+ } catch (t) {
1398
+ this[q](t);
1399
+ }
1400
+ return Promise.resolve();
1401
+ }
1402
+ [ke](e) {
1403
+ if (e)
1404
+ this[me].value = e;
1405
+ else {
1406
+ let t = this[w].length;
1407
+ t > 0 ? this[me].value = this[w][t - 1] : this[me].value = null;
1408
+ }
1409
+ if (typeof this[We] == "function")
1410
+ try {
1411
+ this[We](this[me].value);
1412
+ } catch {
1413
+ }
1414
+ }
1415
+ [dr](e) {
1416
+ if (e.opsType === E.Open) {
1417
+ let t = !1;
1418
+ const n = this[w].length - 1;
1419
+ for (let s = n; s >= 0; s--) {
1420
+ const i = this[w][s];
1421
+ if (e.root == i.root) {
1422
+ if (e.path === i.path) {
1423
+ this[w].splice(s, 1, e), t = !0;
1424
+ continue;
1425
+ }
1426
+ e.active && (i.active = !1);
1427
+ }
1428
+ }
1429
+ t || this[w].push(e);
1430
+ } else
1431
+ this[w].push(e);
1432
+ }
1433
+ [ze]() {
1434
+ let e = [];
1435
+ for (let t of this[w]) {
1436
+ let n = K.clone(t, !0);
1437
+ e.push(n);
1438
+ }
1439
+ return e;
1440
+ }
1441
+ [_e](e) {
1442
+ if (!this[w])
1443
+ return;
1444
+ let t = -1;
1445
+ for (let n = 0; n < this[w].length; n++)
1446
+ if (K.isSame(this[w][n], e)) {
1447
+ t = n;
1448
+ break;
1449
+ }
1450
+ if (t != -1) {
1451
+ let n = this[w][t];
1452
+ this[w].splice(t, 1), this[pr](n, n.session);
1453
+ }
1454
+ }
1455
+ set historyMonitor(e) {
1456
+ this[C] && (this[C].historyMonitor = e);
1457
+ }
1458
+ get historyMonitor() {
1459
+ return this[C] ? this[C].historyMonitor : !1;
1460
+ }
1461
+ set traceless(e) {
1462
+ this[C] && (this[C].traceless = e);
1463
+ }
1464
+ get traceless() {
1465
+ return this[C] ? this[C].traceless : !1;
1466
+ }
1467
+ setRestorePoint() {
1468
+ const e = this[ze]();
1469
+ this[C]?.setRestorePoint(e);
1470
+ }
1471
+ onRouteUpdated(e) {
1472
+ this[We] = e;
1473
+ }
1474
+ onError(e) {
1475
+ this[Je] = e;
1476
+ }
1477
+ beforeEach(e) {
1478
+ this[Te].push(e);
1479
+ }
1480
+ removeBeforeEach(e) {
1481
+ const t = this[Te].indexOf(e);
1482
+ return t !== -1 ? (this[Te].splice(t, 1), !0) : !1;
1483
+ }
1484
+ afterEach(e) {
1485
+ this[$e].push(e);
1486
+ }
1487
+ removeAfterEach(e) {
1488
+ const t = this[$e].indexOf(e);
1489
+ return t !== -1 ? (this[$e].splice(t, 1), !0) : !1;
1490
+ }
1491
+ destroyEach(e) {
1492
+ this[qe].push(e);
1493
+ }
1494
+ removeDestroyEach(e) {
1495
+ const t = this[qe].indexOf(e);
1496
+ return t !== -1 ? (this[qe].splice(t, 1), !0) : !1;
1497
+ }
1498
+ beforeRestoreEach(e) {
1499
+ this[C]?.beforeRestoreEach(e);
1500
+ }
1501
+ removeBeforeRestoreEach(e) {
1502
+ return this[C]?.removeBeforeRestoreEach(e) ?? !1;
1503
+ }
1504
+ addRoutes(e) {
1505
+ for (let t of e)
1506
+ this.addRoute(t);
1507
+ }
1508
+ addRoute(e, t = -1) {
1509
+ if (e.path === this[xt]) {
1510
+ this.setNotFoundRoute(e);
1511
+ return;
1512
+ }
1513
+ const n = this[Be](e);
1514
+ if (t == -1)
1515
+ this[B] = [...this[B], ...n];
1516
+ else
1517
+ for (let s = n.length - 1; s >= 0; s--)
1518
+ this[B].splice(t, 0, n[s]);
1519
+ }
1520
+ removeRoute(e) {
1521
+ const t = this[I](e);
1522
+ if (t === null)
1523
+ return console.warn("route格式错误", e), !1;
1524
+ for (let n = 0; n < this[B].length; n++) {
1525
+ const s = this[B][n];
1526
+ if (t?.path && s.path === t.path)
1527
+ return this[B].splice(n, 1), !0;
1528
+ if (t?.name && s.name === t.name)
1529
+ return this[B].splice(n, 1), !0;
1530
+ }
1531
+ return !1;
1532
+ }
1533
+ hasRoute(e) {
1534
+ const t = this[I](e);
1535
+ return t === null ? (console.warn("route格式错误", e), !1) : this[B].findIndex((s) => {
1536
+ if (t?.path && s.path === t.path || t?.name && s.name === t.name)
1537
+ return !0;
1538
+ }) !== -1;
1539
+ }
1540
+ setNotFoundPath(e) {
1541
+ this[xt] = e;
1542
+ }
1543
+ setNotFoundRoute(e) {
1544
+ const t = this[Be](e);
1545
+ this[Ge] = t[0];
1546
+ }
1547
+ getRoutes() {
1548
+ return [...this[B]];
1549
+ }
1550
+ [Be](e) {
1551
+ let t = e.path ?? "";
1552
+ t.length > 0 && t.charAt(0) !== "/" && (t = `/${t}`);
1553
+ let n = e.components ?? (e.component && { "": e.component });
1554
+ if (n == null) {
1555
+ const a = new ut();
1556
+ return a.path = t, a.redirect = e.redirect, [a];
1557
+ }
1558
+ let s = [];
1559
+ for (let a in n) {
1560
+ let l = n[a];
1561
+ a.length === 0 && (a = ee);
1562
+ let u = new Zr(a, l, e.props, e.meta);
1563
+ s.push(u);
1564
+ }
1565
+ let i = !1, o = [];
1566
+ if (e.children)
1567
+ for (let a of e.children) {
1568
+ let l = this[Be](a);
1569
+ for (let u of l) {
1570
+ let f = new ut();
1571
+ 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);
1572
+ let c = new Yt();
1573
+ c.models = [...s], f.layers = [c, ...u.layers], o.push(f);
1574
+ }
1575
+ }
1576
+ if (!i) {
1577
+ const a = new Yt();
1578
+ a.models = s;
1579
+ const l = new ut();
1580
+ l.name = e.name, l.path = t, l.layers = [a], o.splice(0, 0, l);
1581
+ }
1582
+ return o;
1583
+ }
1584
+ [Ue](e) {
1585
+ const t = e.route;
1586
+ try {
1587
+ for (let n of this[B])
1588
+ if (t.path && n.path) {
1589
+ let s = n.match;
1590
+ s || (s = n.match = fn(n.path));
1591
+ let i = s(t.path);
1592
+ if (!i)
1593
+ continue;
1594
+ if (n.redirect) {
1595
+ let o = new K();
1596
+ $(!0, o, t), o.path = n.redirect;
1597
+ let a = {
1598
+ route: o,
1599
+ find: void 0
1600
+ };
1601
+ return this[Ue](a) ? (e.route = a.route, e.find = a.find, !0) : !1;
1602
+ }
1603
+ if (t.params = t.params ?? {}, $(!0, t.params, i.params), t.query) {
1604
+ let o = t.query;
1605
+ if (typeof o == "string") {
1606
+ let a = {}, l = o.split("&");
1607
+ for (let u of l) {
1608
+ let f = u.split("=");
1609
+ if (f.length !== 2)
1610
+ continue;
1611
+ let c = decodeURIComponent(f[0].trim()), h = decodeURIComponent(f[1].trim());
1612
+ a[c] = h;
1613
+ }
1614
+ $(!0, t.params, a);
1615
+ } else
1616
+ typeof o == "object" && $(!0, t.params, o);
1617
+ }
1618
+ return e.find = n, !0;
1619
+ } else if (t.name === n.name) {
1620
+ t.params = t.params ?? {};
1621
+ let s = an(n.path);
1622
+ return t.path = s(t.params), e.find = n, !0;
1623
+ }
1624
+ } catch (n) {
1625
+ console.error(n.message, n), typeof t.error == "function" && t.error(n.message);
1626
+ }
1627
+ return !1;
1628
+ }
1629
+ [I](e) {
1630
+ let t = null;
1631
+ if (Array.isArray(e))
1632
+ if (t = new K(), typeof e[0] == "object")
1633
+ t = K.from(e[0]);
1634
+ else
1635
+ for (let n = 0; n < e.length; n++)
1636
+ n === 0 ? e[n].charAt(0) === "/" ? t.path = e[n] : t.name = e[n] : n === 1 ? t.params = e[n] : n === 2 ? t.root = e[n] : n === 3 && $(!1, t, e[n]);
1637
+ else
1638
+ typeof e == "object" ? t = K.from(e) : typeof e == "string" && (t = new K(), e.charAt(0) == "/" ? t.path = e : t.name = e);
1639
+ if (t) {
1640
+ if (t.path) {
1641
+ let n = t.path.indexOf("?");
1642
+ n !== -1 && n < t.path.length - 1 && (t.query = t.path.substring(n + 1), t.path = t.path.substring(0, n));
1643
+ }
1644
+ t.root = t.root ?? ee, t.opsType = t.opsType ?? this.options.defaultOperationType ?? E.Push;
1645
+ }
1646
+ return t;
1647
+ }
1648
+ push(...e) {
1649
+ let t = this[I](e);
1650
+ return t ? (t.opsType = t.opsType || E.Push, this.to(t)) : (this[q]("resolve route fail", t), this);
1651
+ }
1652
+ put(...e) {
1653
+ let t = this[I](e);
1654
+ return t ? (t.opsType = E.Put, this.to(t)) : (this[q]("resolve route fail", t), this);
1655
+ }
1656
+ replace(...e) {
1657
+ let t = this[I](e);
1658
+ return t ? (t.opsType = E.Replace, this.to(t)) : (this[q]("resolve route fail", t), this);
1659
+ }
1660
+ append(...e) {
1661
+ let t = this[I](e);
1662
+ return t ? (t.opsType = E.Append, this.to(t)) : (this[q]("resolve route fail", t), this);
1663
+ }
1664
+ remove(e) {
1665
+ return new Promise((t) => {
1666
+ this[ve].post((n) => {
1667
+ try {
1668
+ if (this[w].length === 0) {
1669
+ n.resolve(), t(!1);
1670
+ return;
1671
+ }
1672
+ let s = -1, i, o = [];
1673
+ if (e) {
1674
+ if (e.root ? i = e.root : i = this[w][0].root ?? ee, e.all)
1675
+ for (let l = this[w].length - 1; l > 0; l--) {
1676
+ let u = this[w][l];
1677
+ u.opsType === E.Append && u.root === i && (o.splice(0, 0, u), s = l - 1);
1678
+ }
1679
+ else if (e.until)
1680
+ for (let l = this[w].length - 1; l > 0; l--) {
1681
+ let u = this[w][l];
1682
+ if (u.opsType === E.Append && u.root === i) {
1683
+ if (e.until.charAt(0) === "/" && e.until === u.path) {
1684
+ s = l;
1685
+ break;
1686
+ } else if (e.until === u.name) {
1687
+ s = l;
1688
+ break;
1689
+ }
1690
+ o.splice(0, 0, u);
1691
+ }
1692
+ }
1693
+ } else {
1694
+ i = ee;
1695
+ let l = this[ur](this[U]);
1696
+ l && (i = l.name);
1697
+ for (let u = this[w].length - 1; u > 0; u--) {
1698
+ let f = this[w][u];
1699
+ if (f.opsType === E.Append && f.root === i) {
1700
+ o.push(f), s = u - 1;
1701
+ break;
1702
+ }
1703
+ }
1704
+ }
1705
+ if (o.length === 0) {
1706
+ let l = "can not find route";
1707
+ console.warn(l), n.resolve(l), t(!1);
1708
+ return;
1709
+ }
1710
+ let a = 0;
1711
+ if (this[w].forEach((l) => {
1712
+ l.opsType !== E.Put && a++;
1713
+ }), this[Ke](o)) {
1714
+ let l = 0;
1715
+ this[w].forEach((f) => {
1716
+ f.opsType !== E.Put && l++;
1717
+ });
1718
+ const u = l - a;
1719
+ this[C]?.go(u, !1), n.resolve(), t(!0);
1720
+ }
1721
+ } catch (s) {
1722
+ this[q](s), n.resolve(), t(!1);
1723
+ }
1724
+ });
1725
+ });
1726
+ }
1727
+ open(...e) {
1728
+ let t = this[I](e);
1729
+ return t ? (t.opsType = E.Open, this.to(t)) : (this[q]("resolve route fail", t), this);
1730
+ }
1731
+ close(e) {
1732
+ return this[ve].post((t) => {
1733
+ try {
1734
+ let n = this[I](e);
1735
+ if (!n) {
1736
+ t.reject("resolve route fail");
1737
+ return;
1738
+ }
1739
+ let s = [];
1740
+ for (let i = 0; i < this[w].length; i++) {
1741
+ let o = this[w][i];
1742
+ if (o.root === n.root) {
1743
+ if (!n.path && !n.name) {
1744
+ s.push(o);
1745
+ continue;
1746
+ }
1747
+ if (n.path && n.path === o.path) {
1748
+ s.push(o);
1749
+ break;
1750
+ } else if (n.name && n.name === o.name) {
1751
+ s.push(o);
1752
+ break;
1753
+ }
1754
+ }
1755
+ }
1756
+ if (s.length === 0) {
1757
+ t.resolve();
1758
+ return;
1759
+ }
1760
+ this[Ke](s) && this[ke](), t.resolve();
1761
+ } catch (n) {
1762
+ this[q](n), t.resolve();
1763
+ }
1764
+ }), this;
1765
+ }
1766
+ to(...e) {
1767
+ let t = this[I](e);
1768
+ if (!t)
1769
+ return this[q]("resolve route fail", t), this;
1770
+ let n = this[je].acquire(t);
1771
+ return n == null ? (this[q]("route forbid", t), this) : (this[ve].post((s) => {
1772
+ try {
1773
+ let i = this[Pt](t);
1774
+ this[Ct](i), this[Et](i), this[At](i), i.wait(
1775
+ (o, a) => {
1776
+ const l = o.session.to;
1777
+ try {
1778
+ let u = K.clone(l, !0);
1779
+ const f = new ir(u, this[ze]());
1780
+ l.opsType === E.Replace ? this[C]?.replace(f) : this[C]?.push(f);
1781
+ } catch (u) {
1782
+ console.error(u.message, u);
1783
+ }
1784
+ if (this[je].release(n), this[ke](l), typeof t.success == "function")
1785
+ try {
1786
+ Reflect.apply(t.success, {}, []);
1787
+ } catch (u) {
1788
+ console.error(u.message, u);
1789
+ }
1790
+ this[ue] === !1 && this[Qe](!0), s.resolve();
1791
+ },
1792
+ (o, a) => {
1793
+ this[je].release(n), a !== null && this[q](a, t), this[ue] === !1 && this[Qe](!1), s.resolve();
1794
+ }
1795
+ );
1796
+ } catch (i) {
1797
+ this[je].release(n), this[q](i, t), s.resolve();
1798
+ }
1799
+ }), this);
1800
+ }
1801
+ back(e = 1) {
1802
+ this[C]?.go(-e);
1803
+ }
1804
+ [yr](e) {
1805
+ return (t, n) => {
1806
+ if (typeof t == "boolean")
1807
+ e.session.redirect = !1, t ? e.resolve() : e.reject(n ?? null);
1808
+ else if (t) {
1809
+ const s = this[I](t);
1810
+ if (s) {
1811
+ const i = e.session.to;
1812
+ s.success = i.success, s.error = i.error, e.session.to = s, e.session.redirect = !0, e.session.routeModel = null, e.resolve();
1813
+ } else
1814
+ e.session.redirect = !1, e.reject("route resolve fail");
1815
+ } else
1816
+ e.session.redirect = !1, e.resolve();
1817
+ };
1818
+ }
1819
+ [Pt](e) {
1820
+ let t = this[w].length > 0 ? this[w][0] : void 0, n = new tt(e, t), s = {
1821
+ route: e,
1822
+ find: null
1823
+ };
1824
+ return this[Ue](s), s.find && (n.routeModel = s.find, e.matched = Pn(s.find), Array.isArray(e.matched) && e.matched.length > 0 && (e.meta = s.find.layers[0].models[0].meta)), new rt(n);
1825
+ }
1826
+ [Ct](e) {
1827
+ for (let t of this[Te])
1828
+ e.post((n) => {
1829
+ let s = this[yr](n);
1830
+ Reflect.apply(t, {}, [n.session.to, n.session.from, s, n.session]);
1831
+ });
1832
+ }
1833
+ [At](e) {
1834
+ e.post((t) => {
1835
+ for (let n of this[$e])
1836
+ try {
1837
+ Reflect.apply(n, {}, [t.session.to, t.session.from, t.session]);
1838
+ } catch (s) {
1839
+ console.error(s.message, s);
1840
+ }
1841
+ t.resolve();
1842
+ });
1843
+ }
1844
+ [pr](e, t) {
1845
+ for (let n of this[qe])
1846
+ try {
1847
+ Reflect.apply(n, {}, [e, t]);
1848
+ } catch (s) {
1849
+ console.error(s.message, s);
1850
+ }
1851
+ typeof e.destroy == "function" && Reflect.apply(e.destroy, e, []);
1852
+ }
1853
+ [Et](e) {
1854
+ e.post((t) => {
1855
+ let n = t.session.to, s = t.session.routeModel;
1856
+ if (s == null) {
1857
+ let o = {
1858
+ route: n,
1859
+ find: null
1860
+ };
1861
+ if (this[Ue](o))
1862
+ s = o.find, t.session.routeModel = s;
1863
+ else if (this[Ge])
1864
+ s = this[Ge];
1865
+ else {
1866
+ t.reject(`not find route model, path:${n.path ?? n.name}`);
1867
+ return;
1868
+ }
1869
+ }
1870
+ let i = tt.from(t.session);
1871
+ this[fr](n, s, i).then(
1872
+ (o) => {
1873
+ this[U], t.resolve();
1874
+ },
1875
+ (o) => {
1876
+ t.reject(o);
1877
+ }
1878
+ );
1879
+ });
1880
+ }
1881
+ [Ke](e) {
1882
+ if (e.length == 0)
1883
+ return !0;
1884
+ let t = this[U], n = [];
1885
+ for (let s of e) {
1886
+ let i = this[wt](t, s);
1887
+ i != null && n.push({
1888
+ ...i,
1889
+ route: s
1890
+ });
1891
+ }
1892
+ if (n.length == 0) {
1893
+ let s = "can not find view index";
1894
+ return this[q](s), !1;
1895
+ }
1896
+ for (let s of n.reverse())
1897
+ this[ae](t, { x: s.x, y: s.y }, [s.route.index ?? 0], !0);
1898
+ return !0;
1899
+ }
1900
+ [wt](e, t) {
1901
+ const n = t.root ?? ee;
1902
+ let s;
1903
+ for (let i = 0; i < e.layers.length; i++) {
1904
+ const o = e.layers[i];
1905
+ for (let a = o.views.length - 1; a >= 0; a--) {
1906
+ const l = o.views[a];
1907
+ if (l[J] && l[Ye] === n)
1908
+ return s = { x: a, y: i }, s;
1909
+ }
1910
+ }
1911
+ return null;
1912
+ }
1913
+ [ur](e) {
1914
+ return e.layers.length > 0 && e.layers[0].views.length > 0 ? e.layers[0].views[0] : null;
1915
+ }
1916
+ [ae](e, t, n = null, s = !0) {
1917
+ if (t.y >= e.layers.length || t.x >= e.layers[t.y].views.length)
1918
+ return;
1919
+ let i = e.layers[t.y].views[t.x], o = !1, a = [], l = !1, u = [...i.slots.value];
1920
+ for (let c = u.length - 1; c >= 0; c--) {
1921
+ let h = u[c];
1922
+ (!n || n.indexOf(h.index) != -1) && (h.route && i[J] && (this[_e](h.route), h.active === !0 && h.route.opsType == E.Append && (l = !0)), a.push(new V(i, h.index, t.y)), u.splice(c, 1));
1923
+ }
1924
+ if (u.length == 0)
1925
+ s ? i.slots.value = u : e.layers[t.y].views.splice(t.x, 1);
1926
+ else {
1927
+ if (l) {
1928
+ let c = u.length - 1, h = u[c];
1929
+ h.active = !0, h.route && (h.route.active = h.active);
1930
+ }
1931
+ i.slots.value = u;
1932
+ }
1933
+ e.layers[t.y].views.length == 0 && (o = !0);
1934
+ let f = t.y + 1;
1935
+ for (; f < e.layers.length; f++) {
1936
+ let c = e.layers[f].views, h = [];
1937
+ for (let d = c.length - 1; (o || a.length > 0) && d >= 0; d--) {
1938
+ let m = c[d];
1939
+ if (m[ce] && (o || V.include(a, m[ce]))) {
1940
+ let p = m.slots.value;
1941
+ for (let y = p.length - 1; y >= 0; y--) {
1942
+ let v = p[y];
1943
+ v.route && m[J] && this[_e](v.route), h.push(new V(m, v.index, f)), p.splice(y, 1);
1944
+ }
1945
+ e.layers[f].views.splice(d, 1);
1946
+ }
1947
+ }
1948
+ a = h, e.layers[f].views.length == 0 && (o = !0);
1949
+ }
1950
+ }
1951
+ restore(e) {
1952
+ if (!e || this[B].length == 0) {
1953
+ let t = this[U];
1954
+ if (t.layers.length > 0) {
1955
+ let n = t.layers[0].views;
1956
+ n.length > 0 && (n[0].slots.value = []);
1957
+ }
1958
+ return this[w] = [], this[ke](), Promise.resolve();
1959
+ } else
1960
+ return new Promise((n, s) => {
1961
+ let i = null, o = !1;
1962
+ for (let a = 0; a < e.length; a++) {
1963
+ const l = e[a];
1964
+ this[ve].post((u) => {
1965
+ const f = this[Pt](l);
1966
+ this[Ct](f), this[Et](f), this[At](f), f.wait(
1967
+ (c, h) => {
1968
+ i = c.session.to, o = c.session.redirect, u.resolve();
1969
+ },
1970
+ (c, h) => {
1971
+ i = null, h !== null && this[q](h), u.resolve();
1972
+ }
1973
+ );
1974
+ });
1975
+ }
1976
+ this[ve].post((a) => {
1977
+ if (i && o === !0) {
1978
+ const l = K.clone(i, !0), u = new ir(l, this[ze]());
1979
+ this[C]?.replace(u);
1980
+ }
1981
+ a.resolve(), n();
1982
+ });
1983
+ });
1984
+ }
1985
+ [fr](e, t, n) {
1986
+ let s = e.updateType ?? Xe.Part;
1987
+ return this[cr](t).then(() => {
1988
+ this[hr](t, e, n, s);
1989
+ });
1990
+ }
1991
+ [cr](e) {
1992
+ let t = [];
1993
+ for (let n = 0; n < e.layers.length; n++) {
1994
+ let s = e.layers[n];
1995
+ for (let i = 0; i < s.models.length; i++) {
1996
+ let o = s.models[i];
1997
+ o.isResolved || t.push(o.resolve());
1998
+ }
1999
+ }
2000
+ return t.length > 0 ? Promise.all(t) : Promise.resolve();
2001
+ }
2002
+ [hr](e, t, n, s) {
2003
+ if (e.layers[0].models.length !== 1)
2004
+ return Promise.reject("illegal route structure(multi root node)");
2005
+ const i = e.layers[0].models[0];
2006
+ let o = this[U], a = Sn(o), l = t.root ?? ee, u;
2007
+ !a && s == Xe.Part && (u = this[wt](o, t));
2008
+ let f, c = 0;
2009
+ if (u == null || u == null)
2010
+ if (a || s === Xe.All) {
2011
+ if (o.layers.length == 0 && (o.layers[0] = new yt()), o.layers[0].views.length == 0) {
2012
+ let h = t.root ?? ee;
2013
+ f = new Ae(h, !0, null), o.layers[0].views = [f];
2014
+ } else
2015
+ f = o.layers[0].views[0];
2016
+ u = { x: 0, y: 0 };
2017
+ } else {
2018
+ let h = t.slot;
2019
+ if (!h)
2020
+ return Promise.reject("can not rebuild view(because not route slot)");
2021
+ let d = h.level;
2022
+ if (d > o.layers.length)
2023
+ return Promise.reject("can not insert view(override level)");
2024
+ let m;
2025
+ if (h.rootName) {
2026
+ let p = o.layers[d - 1];
2027
+ for (let y of p.views) {
2028
+ if (y[J] && y.name === h.rootName) {
2029
+ m = new V(y, h.rootIndex ?? 0, d - 1);
2030
+ break;
2031
+ }
2032
+ if (y[z] && y[z].view.name === h.rootName && y[z].index === h.rootIndex) {
2033
+ m = y[z];
2034
+ break;
2035
+ }
2036
+ }
2037
+ }
2038
+ if (!m)
2039
+ return Promise.reject("can not insert view(not find root node ref)");
2040
+ f = new Ae(l, !0, m), o.layers[d].views.push(f), u = { x: o.layers[d].views.length - 1, y: d };
2041
+ }
2042
+ else
2043
+ f = o.layers[u.y].views[u.x];
2044
+ if (c = u.y, f[J] = !0, t.opsType === E.Append) {
2045
+ t.index = oe.get(), t.active = !0;
2046
+ let h = f.slots.value;
2047
+ if (h.length > 0) {
2048
+ let v = h[h.length - 1];
2049
+ v.active = !1, v.route && (v.route.active = v.active);
2050
+ }
2051
+ let d = new ne(t, i, t.index, !0);
2052
+ f.slots.value = [...h, d];
2053
+ let m = c + 1, p = 1, y = new V(f, t.index, c);
2054
+ this[se](o, m, e, p, y);
2055
+ } else if (t.opsType === E.Open) {
2056
+ let h = f.slots.value;
2057
+ const d = t.active ?? !0;
2058
+ let m = !1;
2059
+ for (let p of h) {
2060
+ if (p.route !== null && K.isSameForRouteModel(p.route, t)) {
2061
+ if (p.active === d)
2062
+ return t.index = p.index, t.active = d, p.route = t, Promise.resolve();
2063
+ p.active = d, m = !0, t.index = p.index, t.active = d, p.route = t;
2064
+ } else
2065
+ d && (p.active = !1);
2066
+ p.route && (p.route.active = p.active);
2067
+ }
2068
+ if (!m) {
2069
+ t.index = oe.get(), t.active = d;
2070
+ let p = new ne(t, i, t.index, d);
2071
+ h.push(p);
2072
+ let y = c + 1, v = 1, g = new V(f, t.index, c);
2073
+ this[se](o, y, e, v, g);
2074
+ }
2075
+ f.slots.value = [...h];
2076
+ } else {
2077
+ let h = f.slots.value;
2078
+ if (h.length == 0) {
2079
+ t.index = oe.get(), t.active = !0, f.slots.value = [new ne(t, i, t.index)];
2080
+ let d = c + 1, m = 1, p = new V(f, t.index, c);
2081
+ this[se](o, d, e, m, p);
2082
+ } else {
2083
+ let d = h[0];
2084
+ if (d.model !== i) {
2085
+ this[ae](o, u, null, !0), t.index = oe.get(), t.active = !0, f.slots.value = [new ne(t, i, t.index)];
2086
+ let m = c + 1, p = 1, y = new V(f, t.index, c);
2087
+ this[se](o, m, e, p, y);
2088
+ } else {
2089
+ d.route !== null && this[_e](d.route);
2090
+ let m = !1;
2091
+ const p = t.active ?? !0;
2092
+ d.active !== p && (d.active = p, m = !0), t.active = p, t.index = d.index, d.route = t;
2093
+ let y = [];
2094
+ for (let T = 1; T < h.length; T++)
2095
+ y.push(h[T].index);
2096
+ y.length > 0 ? this[ae](o, u, y, !0) : m && (f.slots.value = [...h]);
2097
+ let v = [new V(f, t.index, c)], g = c + 1, _ = 1, b = new V(f, t.index, c);
2098
+ for (; v.length > 0 && g < o.layers.length && _ < e.layers.length; g++, _++) {
2099
+ let T = [];
2100
+ for (let S = 0; S < o.layers[g].views.length; S++) {
2101
+ let P = o.layers[g].views[S];
2102
+ P[ce] && V.include(v, P[ce]) && T.unshift(S);
2103
+ }
2104
+ let A = [];
2105
+ for (let S of T) {
2106
+ let P = o.layers[g].views[S], k = e.layers[_].models, L;
2107
+ for (let M = 0; M < k.length; M++)
2108
+ if (P.name === k[M].name) {
2109
+ L = k[M];
2110
+ break;
2111
+ }
2112
+ if (!L)
2113
+ this[ae](o, { x: S, y: g }, null, !1);
2114
+ else {
2115
+ let M = P.slots.value;
2116
+ if (M.length == 0) {
2117
+ let X = 0;
2118
+ P.slots.value = [new ne(null, L, X)];
2119
+ let W = g + 1, te = _ + 1;
2120
+ this[se](o, W, e, te, b);
2121
+ } else {
2122
+ let X = M[0];
2123
+ if (X.model !== L) {
2124
+ this[ae](o, { x: S, y: g }, null, !0), P.slots.value = [new ne(null, L, 0)];
2125
+ let W = g + 1, te = _ + 1;
2126
+ this[se](o, W, e, te, b);
2127
+ } else {
2128
+ P[J] && X.route !== null && this[_e](X.route);
2129
+ let W = [];
2130
+ for (let te = 1; te < M.length; te++)
2131
+ W.push(M[te].index);
2132
+ W.length > 0 && this[ae](o, { x: S, y: g }, W, !0), A.push(new V(P, X.index, g));
2133
+ }
2134
+ }
2135
+ P[J] = !1;
2136
+ }
2137
+ }
2138
+ v = A;
2139
+ }
2140
+ this[se](o, g, e, _, b);
2141
+ }
2142
+ }
2143
+ }
2144
+ if (f && f[z]) {
2145
+ let h = f[z];
2146
+ h && (t.slot = new Yr(l, c, h?.view.name, h?.index ?? 0));
2147
+ }
2148
+ n.to = void 0, n.routeModel = void 0, t.session = n, this[dr](t);
2149
+ }
2150
+ [se](e, t, n, s, i) {
2151
+ let o = s, a = t;
2152
+ for (; a < e.layers.length && o < n.layers.length; a++, o++) {
2153
+ let l = e.layers[a].views;
2154
+ for (let u of n.layers[o].models) {
2155
+ let f = new Ae(u.name, !1, i), c = new ne(null, u);
2156
+ f.slots.value = [c], l.push(f);
2157
+ }
2158
+ }
2159
+ for (; o < n.layers.length; o++) {
2160
+ let l = new yt();
2161
+ l.views = [];
2162
+ for (let u of n.layers[o].models) {
2163
+ let f = new Ae(u.name, !1, i), c = new ne(null, u);
2164
+ f.slots.value = [c], l.views.push(f);
2165
+ }
2166
+ e.layers.push(l);
2167
+ }
2168
+ }
2169
+ [Sr](e, t, n, s, i, o) {
2170
+ if (t < 0 || t > this[U].layers.length)
2171
+ return null;
2172
+ if (t < this[U].layers.length) {
2173
+ let f = this[U].layers[t], c = null;
2174
+ for (let h of f.views) {
2175
+ let d = !1;
2176
+ if (n !== null ? (d = h.name === e && h[z]?.view === n, d && s !== -1 && (d = h[z]?.index === s)) : d = h.name === e, !!d) {
2177
+ i !== null && (h[ce] = {
2178
+ view: i,
2179
+ index: o,
2180
+ level: t - 1
2181
+ }), c = h;
2182
+ break;
2183
+ }
2184
+ }
2185
+ if (c !== null)
2186
+ return c;
2187
+ }
2188
+ let a = null, l = null;
2189
+ i !== null && (i[J] ? a = {
2190
+ view: i,
2191
+ index: o,
2192
+ level: t - 1
2193
+ } : a = i[z], l = {
2194
+ view: i,
2195
+ index: o,
2196
+ level: t - 1
2197
+ });
2198
+ let u = new Ae(e, !0, a);
2199
+ if (u[ce] = l, t == this[U].layers.length) {
2200
+ let f = new yt();
2201
+ f.views = [u], this[U].layers.push(f);
2202
+ } else
2203
+ this[U].layers[t].views.push(u);
2204
+ return u;
2205
+ }
2206
+ }
2207
+ const An = "fox-router-view", En = "fox-router-link";
2208
+ function _r(r, e = !1) {
2209
+ let t = null;
2210
+ return e ? t = r.showFromClass ?? r.enterFromClass : t = r.enterFromClass, t || (t = r.transitionName, t ? e ? `${t}-show-from` : `${t}-enter-from` : null);
2211
+ }
2212
+ function Tr(r, e = !1) {
2213
+ let t = null;
2214
+ return e ? t = r.showActiveClass ?? r.enterActiveClass : t = r.enterActiveClass, t || (t = r.transitionName, t ? e ? `${t}-show-active` : `${t}-enter-active` : null);
2215
+ }
2216
+ function Fn(r, e = !1) {
2217
+ let t = null;
2218
+ return e ? t = r.showToClass ?? r.enterToClass : t = r.enterToClass, t || (t = r.transitionName, t ? e ? `${t}-show-to` : `${t}-enter-to` : null);
2219
+ }
2220
+ function _n(r, e = !1) {
2221
+ let t = null;
2222
+ return e ? t = r.hideFromClass ?? r.leaveFromClass : t = r.leaveFromClass, t || (t = r.transitionName, t ? e ? `${t}-hide-from` : `${t}-leave-from` : null);
2223
+ }
2224
+ function Tn(r, e = !1) {
2225
+ let t = null;
2226
+ return e ? t = r.hideActiveClass ?? r.leaveActiveClass : t = r.leaveActiveClass, t || (t = r.transitionName, t ? e ? `${t}-hide-active` : `${t}-leave-active` : null);
2227
+ }
2228
+ function $n(r, e = !1) {
2229
+ let t = null;
2230
+ return e ? t = r.hideToClass ?? r.leaveToClass : t = r.leaveToClass, t || (t = r.transitionName, t ? e ? `${t}-hide-to` : `${t}-leave-to` : null);
2231
+ }
2232
+ function qn(r, e = !1) {
2233
+ let t = null;
2234
+ return e ? t = r.beforeShow ?? r.beforeEnter : t = r.beforeEnter, t;
2235
+ }
2236
+ function Kn(r, e = !1) {
2237
+ let t = null;
2238
+ return e ? t = r.show ?? r.enter : t = r.enter, t;
2239
+ }
2240
+ function jn(r, e = !1) {
2241
+ let t = null;
2242
+ return e ? t = r.afterShow ?? r.afterEnter : t = r.afterEnter, t;
2243
+ }
2244
+ function On(r, e = !1) {
2245
+ let t = null;
2246
+ return e ? t = r.showCancelled ?? r.enterCancelled : t = r.enterCancelled, t;
2247
+ }
2248
+ function Ln(r, e = !1) {
2249
+ let t = null;
2250
+ return e ? t = r.hide ?? r.leave : t = r.leave, t;
2251
+ }
2252
+ function Mn(r, e = !1) {
2253
+ let t = null;
2254
+ return e ? t = r.afterHide ?? r.afterLeave : t = r.afterLeave, t;
2255
+ }
2256
+ function Nn(r, e = !1) {
2257
+ let t = null;
2258
+ return e ? t = r.hideCancelled ?? r.leaveCancelled : t = r.leaveCancelled, t;
2259
+ }
2260
+ function Vt(r) {
2261
+ let e, t = r.duration;
2262
+ return typeof t == "object" ? e = {
2263
+ enter: t.enter ?? -1,
2264
+ leave: t.leave ?? -1,
2265
+ show: t.show ?? -1,
2266
+ hide: t.hide ?? -1
2267
+ } : (typeof t == "string" && (t = t.length == 0 ? -1 : Number(t)), e = {
2268
+ enter: t,
2269
+ leave: t,
2270
+ show: t,
2271
+ hide: t
2272
+ }), e;
2273
+ }
2274
+ function xe(r, e) {
2275
+ r.classList.contains(e) || r.classList.add(e);
2276
+ }
2277
+ function Re(r, e) {
2278
+ r.classList.remove(e);
2279
+ }
2280
+ const In = Ne && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
2281
+ function Bt(r) {
2282
+ In(r);
2283
+ }
2284
+ function H(r, e, t) {
2285
+ R(e) && (r == null && (r = {}), Reflect.apply(e, r, t));
2286
+ }
2287
+ function $r(r, e, t, n = -1, s, i, o, a) {
2288
+ if (R(i)) {
2289
+ if (s !== void 0 && s >= 0) {
2290
+ setTimeout(() => {
2291
+ Reflect.apply(i, r, [e, t, n]), R(a) && Reflect.apply(a, r, []);
2292
+ }, s);
2293
+ return;
2294
+ }
2295
+ const l = ["animationend", "transitionend"], u = (f) => {
2296
+ l.forEach((c) => {
2297
+ Kt(e, c, u);
2298
+ }), Reflect.apply(i, r, [e, t, n]), a && Reflect.apply(a, r, []);
2299
+ };
2300
+ l.forEach((f) => {
2301
+ qt(e, f, u);
2302
+ });
2303
+ }
2304
+ if (R(o)) {
2305
+ const l = "animationcancel", u = (f) => {
2306
+ Reflect.apply(o, r, [e, t, n]), Kt(e, l, u);
2307
+ };
2308
+ qt(e, l, u);
2309
+ }
2310
+ }
2311
+ function Ut(r) {
2312
+ return !Ne || r === null ? !1 : r.opsType === E.Append || r.opsType === E.Open;
2313
+ }
2314
+ function qr(r, e, t, n = {}, s, i = -1) {
2315
+ if (e || Ut(s)) {
2316
+ const o = _r(n, e);
2317
+ o && xe(t, o);
2318
+ const a = Tr(n, e);
2319
+ a && xe(t, a);
2320
+ const l = qn(n, e);
2321
+ H(r, l, [t, e, s, i]);
2322
+ }
2323
+ }
2324
+ function Kr(r, e, t, n = {}, s, i, o, a) {
2325
+ if (!Ut(i) && !e) {
2326
+ R(a) && a(r, a, [t]);
2327
+ return;
2328
+ }
2329
+ const l = _r(n, e), u = Tr(n, e), f = Fn(n, e), c = Kn(n, e), h = jn(n, e), d = On(n, e);
2330
+ Bt(() => {
2331
+ $r(r, t, i, o, s, () => {
2332
+ u && Re(t, u), f && Re(t, f), R(h) && H(r, h, [t, e, i, o]), R(a) && a(r, a, [t]);
2333
+ }, () => {
2334
+ R(d) && H(r, d, [t, e, i, o]);
2335
+ }), l && Re(t, l), f && xe(t, f), R(c) && H(r, c, [t, e, i, o]);
2336
+ });
2337
+ }
2338
+ function jr(r, e, t, n = {}, s, i, o, a, l) {
2339
+ if (!Ut(o) && !e) {
2340
+ !e && R(i) && i();
2341
+ return;
2342
+ }
2343
+ const u = _n(n, e), f = Tn(n, e), c = $n(n, e), h = Ln(n, e), d = Mn(n, e), m = Nn(n, e);
2344
+ u && xe(t, u), f && xe(t, f), R(h) && H(r, h, [t, e, o, a]), Bt(() => {
2345
+ $r(r, t, o, a, s, () => {
2346
+ f && Re(t, f), c && Re(t, c), R(d) && H(r, d, [t, e, o, a]), R(l) && H(r, l, [t]), !e && R(i) && i();
2347
+ }, () => {
2348
+ R(m) && H(r, m, [t, e, o, a]), R(l) && H(r, l, [t]), !e && R(i) && i();
2349
+ }), u && Re(t, u), c && xe(t, c);
2350
+ });
2351
+ }
2352
+ function jt(r, e = {}, t, n = -1) {
2353
+ const s = e.mode ?? "default", i = Vt(e);
2354
+ return {
2355
+ mode: s,
2356
+ persisted: !1,
2357
+ beforeEnter: (a) => {
2358
+ qr(r, !1, a, e, t, n);
2359
+ },
2360
+ enter: (a) => {
2361
+ Kr(r, !1, a, e, i.enter, t, n);
2362
+ },
2363
+ leave: (a, l) => {
2364
+ jr(r, !1, a, e, i.leave, l, t, n);
2365
+ },
2366
+ clone: (a) => jt(r, e, t, n)
2367
+ };
2368
+ }
2369
+ function Or(r) {
2370
+ return r.el;
2371
+ }
2372
+ function Hn(r, e, t = {}, n, s, i, o) {
2373
+ if (i) {
2374
+ const a = Or(e);
2375
+ if (a == null)
2376
+ return;
2377
+ const l = Vt(t);
2378
+ qr(r, !0, a, t, n, s), Kr(r, !0, a, t, l.show, n, s, (u) => {
2379
+ R(o) && H(r, o, [u]);
2380
+ });
2381
+ } else
2382
+ R(o) && H(r, o, []);
2383
+ }
2384
+ function Dn(r, e, t = {}, n, s, i, o) {
2385
+ if (i) {
2386
+ const a = Or(e);
2387
+ if (a == null)
2388
+ return;
2389
+ const l = Vt(t);
2390
+ jr(r, !0, a, t, l.hide, null, n, s, (u) => {
2391
+ R(o) && H(r, o, [u]);
2392
+ });
2393
+ } else
2394
+ R(o) && H(r, o, []);
2395
+ }
2396
+ function Vn(r, e = {}) {
2397
+ Bt(() => {
2398
+ for (let t = 0; t < r.length; t++)
2399
+ Reflect.apply(r[t], e, []);
2400
+ });
2401
+ }
2402
+ function ie(r, e, t) {
2403
+ return typeof r == "function" ? Reflect.apply(r, {}, [e, t]) : r;
2404
+ }
2405
+ function Ft(r, e) {
2406
+ if (!r)
2407
+ return null;
2408
+ const t = r(e);
2409
+ return t.length === 1 ? t[0] : t;
2410
+ }
2411
+ class Bn {
2412
+ node;
2413
+ state;
2414
+ constructor(e, t) {
2415
+ this.node = e, this.state = t;
2416
+ }
2417
+ }
2418
+ const Ot = gr({
2419
+ name: "RouterView",
2420
+ inheritAttrs: !1,
2421
+ props: {
2422
+ name: {
2423
+ type: String,
2424
+ required: !1,
2425
+ default: "default"
2426
+ },
2427
+ modelSlot: {
2428
+ type: [Object],
2429
+ required: !1
2430
+ },
2431
+ multi: {
2432
+ type: Boolean,
2433
+ required: !1,
2434
+ default: !1
2435
+ },
2436
+ tag: {
2437
+ type: [String, Object, Function],
2438
+ required: !1,
2439
+ default: "div"
2440
+ },
2441
+ viewTag: {
2442
+ type: [String, Object, Function],
2443
+ required: !1,
2444
+ default: "div"
2445
+ },
2446
+ viewTagProps: {
2447
+ type: [Object, Function],
2448
+ required: !1,
2449
+ default() {
2450
+ return {};
2451
+ }
2452
+ },
2453
+ viewClass: {
2454
+ type: [String, Function],
2455
+ required: !1
2456
+ },
2457
+ viewActiveClass: {
2458
+ type: [String, Function],
2459
+ required: !1
2460
+ },
2461
+ viewInactiveClass: {
2462
+ type: [String, Function],
2463
+ required: !1
2464
+ },
2465
+ transition: {
2466
+ type: [Boolean, String, Function],
2467
+ required: !1,
2468
+ default: !1
2469
+ },
2470
+ transitionName: {
2471
+ type: String,
2472
+ required: !1
2473
+ },
2474
+ enterFromClass: {
2475
+ type: String,
2476
+ required: !1
2477
+ },
2478
+ enterActiveClass: {
2479
+ type: String,
2480
+ required: !1
2481
+ },
2482
+ enterToClass: {
2483
+ type: String,
2484
+ required: !1
2485
+ },
2486
+ leaveFromClass: {
2487
+ type: String,
2488
+ required: !1
2489
+ },
2490
+ leaveActiveClass: {
2491
+ type: String,
2492
+ required: !1
2493
+ },
2494
+ leaveToClass: {
2495
+ type: String,
2496
+ required: !1
2497
+ },
2498
+ showFromClass: {
2499
+ type: String,
2500
+ required: !1
2501
+ },
2502
+ showActiveClass: {
2503
+ type: String,
2504
+ required: !1
2505
+ },
2506
+ showToClass: {
2507
+ type: String,
2508
+ required: !1
2509
+ },
2510
+ hideFromClass: {
2511
+ type: String,
2512
+ required: !1
2513
+ },
2514
+ hideActiveClass: {
2515
+ type: String,
2516
+ required: !1
2517
+ },
2518
+ hideToClass: {
2519
+ type: String,
2520
+ required: !1
2521
+ },
2522
+ beforeEnter: {
2523
+ type: Function,
2524
+ required: !1
2525
+ },
2526
+ enter: {
2527
+ type: Function,
2528
+ required: !1
2529
+ },
2530
+ afterEnter: {
2531
+ type: Function,
2532
+ required: !1
2533
+ },
2534
+ enterCancelled: {
2535
+ type: Function,
2536
+ required: !1
2537
+ },
2538
+ beforeLeave: {
2539
+ type: Function,
2540
+ required: !1
2541
+ },
2542
+ leave: {
2543
+ type: Function,
2544
+ required: !1
2545
+ },
2546
+ afterLeave: {
2547
+ type: Function,
2548
+ required: !1
2549
+ },
2550
+ leaveCancelled: {
2551
+ type: Function,
2552
+ required: !1
2553
+ },
2554
+ beforeShow: {
2555
+ type: Function,
2556
+ required: !1
2557
+ },
2558
+ show: {
2559
+ type: Function,
2560
+ required: !1
2561
+ },
2562
+ afterShow: {
2563
+ type: Function,
2564
+ required: !1
2565
+ },
2566
+ showCancelled: {
2567
+ type: Function,
2568
+ required: !1
2569
+ },
2570
+ beforeHide: {
2571
+ type: Function,
2572
+ required: !1
2573
+ },
2574
+ hide: {
2575
+ type: Function,
2576
+ required: !1
2577
+ },
2578
+ afterHide: {
2579
+ type: Function,
2580
+ required: !1
2581
+ },
2582
+ hideCancelled: {
2583
+ type: Function,
2584
+ required: !1
2585
+ }
2586
+ },
2587
+ setup(r, e) {
2588
+ const t = Lt();
2589
+ if (t === null || t.proxy === null) {
2590
+ console.error("instance or instance.proxy not exist");
2591
+ return;
2592
+ }
2593
+ const n = r.multi === !0, s = G(it, null), i = G(ct, 0), o = G(nr, null), a = G(ht, -1);
2594
+ let l = null;
2595
+ const u = r.modelSlot;
2596
+ if (u) {
2597
+ if (re(ct, i + 1), re(ht, u.index), re(dt, u.index), !u.route) {
2598
+ console.warn("child view render error, route not exist");
2599
+ return;
2600
+ }
2601
+ const h = _t(t.proxy, !0);
2602
+ rn(h), rr(h, () => u.route ?? null);
2603
+ } else {
2604
+ if (s == null) {
2605
+ console.error("router is not been injected");
2606
+ return;
2607
+ }
2608
+ const c = r.name, h = G(sr, null), d = G(dt, 0);
2609
+ if (l = s[Sr](c, i, o, a, h, d), l === null)
2610
+ return;
2611
+ re(sr, l);
2612
+ const m = l[J] === !0;
2613
+ if (m && re(nr, l), !n && (re(ht, -1), re(ct, i + 1), re(dt, -1), m)) {
2614
+ const p = _t(t.proxy, !0);
2615
+ rr(p, () => {
2616
+ const y = l.slots.value;
2617
+ return y.length > 0 ? y[0].route : null;
2618
+ });
2619
+ }
2620
+ }
2621
+ const f = { value: /* @__PURE__ */ new Map() };
2622
+ return st(() => {
2623
+ f.value && f.value.clear();
2624
+ }), () => {
2625
+ if (n) {
2626
+ const c = /* @__PURE__ */ new Map(), h = [], d = l?.slots.value, m = [];
2627
+ for (let v = 0; v < d.length; v++) {
2628
+ const g = d[v], _ = `${r.name}_${g.index}`, b = ie(r.transition, g.route, v) ?? !0, T = { modelSlot: g };
2629
+ let A;
2630
+ e.slots.default ? A = fe(Ot, T, { default: e.slots.default }) : A = fe(Ot, T);
2631
+ const S = {}, P = ie(r.viewClass, g.route, v);
2632
+ typeof P == "string" && P.length > 0 && (S[P] = !0);
2633
+ const k = ie(r.viewActiveClass, g.route, v), L = ie(r.viewInactiveClass, g.route, v), M = f.value.get(_);
2634
+ 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) {
2635
+ const de = M.node;
2636
+ g.active ? m.unshift(() => {
2637
+ const lt = () => {
2638
+ let Se = er(de);
2639
+ Se != null && tr(Se, Tt.ACTIVATED);
2640
+ };
2641
+ Hn(t, de, r, g.route, v, b, lt);
2642
+ }) : m.push(() => {
2643
+ const lt = () => {
2644
+ const Se = er(de);
2645
+ Se != null && tr(Se, Tt.DEACTIVATED);
2646
+ };
2647
+ Dn(t, de, r, g.route, v, b, lt);
2648
+ });
2649
+ }
2650
+ const X = {
2651
+ class: S,
2652
+ key: _
2653
+ }, W = ie(r.viewTagProps, g.route, v);
2654
+ W !== null && typeof W == "object" && $(!0, X, W), g.route?.viewTagAttrs && typeof g.route?.viewTagAttrs == "object" && $(!0, X, g.route.viewTagAttrs);
2655
+ const te = ie(r.viewTag, g.route, v), ot = fe(te, X, { default: () => [A] });
2656
+ if (c.set(_, new Bn(ot, g.active)), f.value.delete(_), b) {
2657
+ const de = jt(t, r, g.route, v);
2658
+ ot.transition = de;
2659
+ }
2660
+ h.push(ot);
2661
+ }
2662
+ f.value.forEach((v) => {
2663
+ v.node.transition = null;
2664
+ }), f.value = c, Vn(m, t);
2665
+ const p = ie(r.tag, null, -1), y = {};
2666
+ return Object.assign(y, e.attrs), fe(p, y, { default: () => h });
2667
+ } else if (u != null) {
2668
+ const c = u.model, h = {};
2669
+ c.props && (typeof c.props == "object" ? $(!1, h, c.props) : c.props === !0 && typeof u.route?.params == "object" && $(!1, h, u.route?.params));
2670
+ const d = fe(c.component, h);
2671
+ return Ft(e.slots.default, { Component: d, route: u.route }) ?? d;
2672
+ } else {
2673
+ const c = l.slots.value;
2674
+ if (c.length > 0) {
2675
+ const h = c[0], d = h.route ?? (t.proxy && Ht(t.proxy)) ?? null, m = h.model, p = {};
2676
+ m.props && (typeof m.props == "object" ? $(!1, p, m.props) : m.props === !0 && typeof d?.params == "object" && $(!1, p, d?.params));
2677
+ const y = fe(m.component, p);
2678
+ if (ie(r.transition, d, -1) ?? !0) {
2679
+ const g = jt(t, r, d, -1);
2680
+ y.transition = g;
2681
+ }
2682
+ return Ft(e.slots.default, { Component: y, route: d }) ?? y;
2683
+ } else
2684
+ return Ft(e.slots.fallback, {});
2685
+ }
2686
+ };
2687
+ }
2688
+ });
2689
+ function Un(r) {
2690
+ if (!(r.metaKey || r.altKey || r.ctrlKey || r.shiftKey) && !r.defaultPrevented && !(r.button != null && r.button !== 0)) {
2691
+ if (r.currentTarget && r.currentTarget.getAttribute) {
2692
+ const e = r.currentTarget.getAttribute("target");
2693
+ if (/\b_blank\b/i.test(e))
2694
+ return;
2695
+ }
2696
+ return r.preventDefault && r.preventDefault(), !0;
2697
+ }
2698
+ }
2699
+ function kn(r, e) {
2700
+ return r == null || e == null ? !1 : !!(r === e || r.path && r.path === e.path || r.name && r.name === e.name);
2701
+ }
2702
+ function Wn(r, e) {
2703
+ return r == null || e == null ? !1 : !!(r.path && e.path && e.path.startsWith(r.path) || r.name && r.name == e.name);
2704
+ }
2705
+ function ge(r, e) {
2706
+ return typeof r == "function" ? Reflect.apply(r, {}, [e]) : r;
2707
+ }
2708
+ let zn = gr({
2709
+ name: "RouterLink",
2710
+ inheritAttrs: !1,
2711
+ props: {
2712
+ tag: {
2713
+ type: [String, Object, Function],
2714
+ required: !1,
2715
+ default: "a"
2716
+ },
2717
+ to: {
2718
+ type: [String, Object, Function],
2719
+ required: !0
2720
+ },
2721
+ root: {
2722
+ type: String
2723
+ },
2724
+ activeClass: {
2725
+ type: [String, Function],
2726
+ required: !1,
2727
+ default: "fox-router-link-active"
2728
+ },
2729
+ exact: {
2730
+ type: [String, Boolean, Function],
2731
+ required: !1
2732
+ },
2733
+ exactActiveClass: {
2734
+ type: [String, Function],
2735
+ required: !1,
2736
+ default: "fox-router-link-exact-active"
2737
+ },
2738
+ event: {
2739
+ type: [String, Function],
2740
+ required: !1,
2741
+ default: "onClick"
2742
+ }
2743
+ },
2744
+ setup(r, e) {
2745
+ const t = G(it, null);
2746
+ return () => {
2747
+ let n = ge(r.to, null), s = ge(r.tag, n);
2748
+ if (s == null) {
2749
+ console.warn("can not resolve link tag");
2750
+ return;
2751
+ }
2752
+ let i = null, o = null;
2753
+ t !== null && (i = t[I](n), r.root && (i.root = r.root), o = t.current);
2754
+ let a = {}, l = ge(r.activeClass, i);
2755
+ if (typeof l == "string" && l.length > 0 && (a[l] = Wn(i, o)), ge(r.exact, i) === !0) {
2756
+ let h = ge(r.exactActiveClass, i);
2757
+ typeof h == "string" && h.length > 0 && (a[h] = kn(i, o));
2758
+ }
2759
+ let f = {
2760
+ class: a
2761
+ };
2762
+ (s === "a" || s === "A") && (f.href = i?.path ?? i?.name ?? "#"), $(!0, f, e.attrs);
2763
+ let c = ge(r.event, i);
2764
+ if (typeof c == "string") {
2765
+ const h = (d) => {
2766
+ if (t == null) {
2767
+ console.warn("router is not been injected");
2768
+ return;
2769
+ }
2770
+ if (i == null) {
2771
+ console.warn("route is not been resolved");
2772
+ return;
2773
+ }
2774
+ Un(d) && t.to(i);
2775
+ };
2776
+ f[c] = h;
2777
+ }
2778
+ return fe(s, f, e.slots);
2779
+ };
2780
+ }
2781
+ });
2782
+ var j = /* @__PURE__ */ ((r) => (r[r.Loading = 0] = "Loading", r[r.Loaded = 1] = "Loaded", r[r.Defining = 2] = "Defining", r[r.Defined = 3] = "Defined", r))(j || {}), Ze = /* @__PURE__ */ ((r) => (r[r.normal = 0] = "normal", r[r.factory = 1] = "factory", r))(Ze || {});
2783
+ class Jn {
2784
+ register = /* @__PURE__ */ new Map();
2785
+ constructor() {
2786
+ }
2787
+ get(e) {
2788
+ return this.register.get(e) ?? null;
2789
+ }
2790
+ set(e, t) {
2791
+ this.register.set(e, t);
2792
+ }
2793
+ remove(e) {
2794
+ let t = this.register.get(e);
2795
+ return this.register.delete(e), t ?? null;
2796
+ }
2797
+ has(e) {
2798
+ return this.register.has(e);
2799
+ }
2800
+ clear() {
2801
+ this.register.clear();
2802
+ }
2803
+ }
2804
+ class mr {
2805
+ moduleManager = new Jn();
2806
+ options = {
2807
+ paths: {},
2808
+ alias: {},
2809
+ nature: [],
2810
+ timeout: 3e3
2811
+ };
2812
+ set paths(e) {
2813
+ this.options.paths = e;
2814
+ }
2815
+ get paths() {
2816
+ return this.options.paths;
2817
+ }
2818
+ set alias(e) {
2819
+ this.options.alias = e;
2820
+ }
2821
+ get alias() {
2822
+ return this.options.alias;
2823
+ }
2824
+ set naturePaths(e) {
2825
+ this.options.nature = e;
2826
+ }
2827
+ get naturePaths() {
2828
+ return this.options.nature;
2829
+ }
2830
+ set timeout(e) {
2831
+ this.options.timeout = e;
2832
+ }
2833
+ get timeout() {
2834
+ return this.options.timeout;
2835
+ }
2836
+ _query;
2837
+ set query(e) {
2838
+ this._query = e;
2839
+ }
2840
+ get query() {
2841
+ return this._query;
2842
+ }
2843
+ get head() {
2844
+ return He().head;
2845
+ }
2846
+ constructor() {
2847
+ }
2848
+ setModule(e, t) {
2849
+ const n = {
2850
+ id: e,
2851
+ src: "",
2852
+ status: j.Defined
2853
+ };
2854
+ typeof t == "function" ? (n.exports = t, n.type = Ze.factory) : n.exports = t, this.moduleManager.set(e, n);
2855
+ }
2856
+ removeModule(e) {
2857
+ this.moduleManager.remove(e);
2858
+ }
2859
+ ensure(...e) {
2860
+ const t = [];
2861
+ let n = e.length - 1;
2862
+ const s = {};
2863
+ typeof e[n] == "object" && (Object.assign(s, e[n]), n--);
2864
+ let i = null;
2865
+ typeof e[n] == "function" && (i = e[n], n--);
2866
+ for (let l = 0; l <= n; l++)
2867
+ if (Array.isArray(e[l])) {
2868
+ let u = e[l];
2869
+ for (let f = 0; f < u.length; f++)
2870
+ u[f] && t.push(this.resolvePath(u[f]));
2871
+ } else if (typeof e[l] == "string") {
2872
+ let u = e[l].split(",");
2873
+ for (let f = 0; f < u.length; f++)
2874
+ u[f] && t.push(this.resolvePath(u[f]));
2875
+ }
2876
+ const o = new Gn(t.length, (l, u) => {
2877
+ if (o.isOK())
2878
+ try {
2879
+ typeof i == "function" && Reflect.apply(i, {}, u);
2880
+ } catch (f) {
2881
+ console.error(f.message, f);
2882
+ }
2883
+ else
2884
+ try {
2885
+ console.error(l), typeof i == "function" && Reflect.apply(i, {}, []);
2886
+ } catch (f) {
2887
+ console.error(f.message, f);
2888
+ }
2889
+ }), a = new rt();
2890
+ for (let l = 0; l < t.length; l++) {
2891
+ const u = new Qn(l, t[l], s, o);
2892
+ this.mount(a, u);
2893
+ }
2894
+ return this;
2895
+ }
2896
+ remove(...e) {
2897
+ let t = [], n = e.length - 1, s = {};
2898
+ typeof e[n] == "object" && (Object.assign(s, e[n]), n--);
2899
+ let i = null;
2900
+ typeof e[n] == "function" && (i = e[n], n--);
2901
+ for (let o = 0; o <= n; o++)
2902
+ if (Array.isArray(e[o])) {
2903
+ let a = e[o];
2904
+ for (let l = 0; l < a.length; l++)
2905
+ a[l] && t.push(this.resolvePath(a[l]));
2906
+ } else {
2907
+ let a = e[o].split(",");
2908
+ for (let l = 0; l < a.length; l++)
2909
+ a[l] && t.push(this.resolvePath(a[l]));
2910
+ }
2911
+ return t.forEach((o) => {
2912
+ this.unmount(o, s);
2913
+ }), typeof i == "function" && Reflect.apply(i, {}, []), this;
2914
+ }
2915
+ mount(e, t) {
2916
+ if (t.src === "exports") {
2917
+ e.post((s) => {
2918
+ t.progress.work(!0, t.index, "exports"), s.resolve();
2919
+ });
2920
+ return;
2921
+ } else if (t.src === "module") {
2922
+ e.post((s) => {
2923
+ t.progress.work(!0, t.index, "module"), s.resolve();
2924
+ });
2925
+ return;
2926
+ }
2927
+ if (this.isNaturePath(t.src)) {
2928
+ let s = t.params.jsPoint;
2929
+ s || (s = this.head), this.mountJS(e, t, s);
2930
+ return;
2931
+ } else if (this.isNaturePath(t.src)) {
2932
+ let s = t.params.cssPoint;
2933
+ s || (s = this.head), this.mountCSS(e, t, s);
2934
+ return;
2935
+ }
2936
+ let n = this.getFileNamePostfix(t.src);
2937
+ if (n === "js" || n.length === 0) {
2938
+ let s = t.params.jsPoint;
2939
+ s || (s = this.head), this.mountJS(e, t, s);
2940
+ return;
2941
+ } else if (n === "css") {
2942
+ let s = t.params.cssPoint;
2943
+ s || (s = this.head), this.mountCSS(e, t, s);
2944
+ return;
2945
+ }
2946
+ }
2947
+ mountCSS(e, t, n) {
2948
+ e.post((s) => {
2949
+ const i = t.src, o = this.moduleManager.get(i);
2950
+ if (o && (o.status == j.Defined || o.status == j.Loaded) && o.exports) {
2951
+ o.type === Ze.factory && typeof o.exports == "function" ? t.progress.work(!0, t.index, o.exports()) : t.progress.work(!0, t.index, o.exports), s.resolve();
2952
+ return;
2953
+ }
2954
+ const a = He(), l = a.createElement("link");
2955
+ if (Reflect.has(l, "onload"))
2956
+ l.onload = () => {
2957
+ l.onload = null, l.onerror = null, t.progress.work(!0, t.index, t.src), s.resolve();
2958
+ }, l.onerror = () => {
2959
+ try {
2960
+ n.removeChild(l);
2961
+ } catch (c) {
2962
+ console.error(c.message, c);
2963
+ }
2964
+ l.onload = null, l.onerror = null, t.progress.work(!1, t.index, null), s.reject();
2965
+ };
2966
+ else {
2967
+ const c = {
2968
+ timeout: this.options.timeout ?? 3e3,
2969
+ time: 0,
2970
+ success: () => {
2971
+ t.progress.work(!0, t.index, t.src), s.resolve();
2972
+ },
2973
+ error: () => {
2974
+ try {
2975
+ n.removeChild(l);
2976
+ } catch (h) {
2977
+ console.error(h.message, h);
2978
+ }
2979
+ t.progress.work(!1, t.index, null), s.resolve();
2980
+ }
2981
+ };
2982
+ setTimeout(() => {
2983
+ Lr(l, c);
2984
+ }, 1);
2985
+ }
2986
+ let f = a.getElementById(i);
2987
+ f && f.parentNode && f.parentNode.removeChild(f), l.rel = "stylesheet", l.type = "text/css", l.id = i, l.href = i, n.appendChild(l);
2988
+ });
2989
+ }
2990
+ mountJS(e, t, n) {
2991
+ e.post((s) => {
2992
+ const i = t.src;
2993
+ let o = this.moduleManager.get(i);
2994
+ if (o && (o.status == j.Defined || o.status == j.Loaded)) {
2995
+ if (o.exports) {
2996
+ o.type === Ze.factory && typeof o.exports == "function" ? t.progress.work(!0, t.index, o.exports()) : t.progress.work(!0, t.index, o.exports), s.resolve();
2997
+ return;
2998
+ }
2999
+ if (document.querySelector(`script[src='${i}`)) {
3000
+ t.progress.work(!0, t.index, o.exports), s.resolve();
3001
+ return;
3002
+ }
3003
+ }
3004
+ o = {
3005
+ id: i,
3006
+ src: i,
3007
+ status: j.Loading
3008
+ }, this.moduleManager.set(i, o);
3009
+ const l = He().createElement("script");
3010
+ if ("onload" in l)
3011
+ l.onload = () => {
3012
+ l.onload = null, l.onerror = null, o.status == j.Loading && (o.status = j.Loaded, t.progress.work(!0, t.index, i)), s.resolve();
3013
+ }, l.onerror = () => {
3014
+ try {
3015
+ n.removeChild(l);
3016
+ } catch (c) {
3017
+ console.error(c.message, c);
3018
+ }
3019
+ l.onload = null, l.onerror = null, this.moduleManager.remove(i), t.progress.work(!1, t.index, null), s.resolve();
3020
+ };
3021
+ else {
3022
+ const c = l;
3023
+ c.onreadystatechange = () => {
3024
+ /loaded|complete/.test(c.readyState) && (c.onreadystatechange = null, o.status == j.Loading && (o.status = j.Loaded, t.progress.work(!0, t.index, i)), s.resolve());
3025
+ };
3026
+ }
3027
+ l.defer = !0, l.src = i;
3028
+ const f = O();
3029
+ f.define = this.createDefine(o, t), n.appendChild(l);
3030
+ });
3031
+ }
3032
+ unmount(e, t = {}) {
3033
+ const n = He(), s = this.getFileNamePostfix(e);
3034
+ if (s === "js" || s.length === 0) {
3035
+ const i = n.querySelector(`script[src="${e}"]`);
3036
+ i && i.parentNode && i.parentNode.removeChild(i), this.moduleManager.remove(e);
3037
+ return;
3038
+ } else if (s === "css") {
3039
+ const i = n.querySelector(`style[href="${e}"]`);
3040
+ i && i.parentNode && i.parentNode.removeChild(i);
3041
+ return;
3042
+ }
3043
+ }
3044
+ trimEmptyElement(e) {
3045
+ let t = [];
3046
+ for (let n = 0; n < e.length; n++) {
3047
+ if (e[n] === void 0 || e[n] === null)
3048
+ continue;
3049
+ const s = e[n].trim();
3050
+ s.length !== 0 && t.push(s);
3051
+ }
3052
+ return t;
3053
+ }
3054
+ createDefine(e, t) {
3055
+ const n = this, s = function(...i) {
3056
+ e.status = j.Defining;
3057
+ let o, a, l, u = i.length;
3058
+ u === 1 ? (l = i[0], o = void 0) : u === 2 ? (l = i[1], Array.isArray(i[0]) ? (a = n.trimEmptyElement(i[0]), o = void 0) : a = void 0) : (o = i[0], a = n.trimEmptyElement(i[1]), l = i[2]), o && (e.id = o, n.options.alias[o] = e.src), a && a.length > 0 ? n.ensure(a, (...f) => {
3059
+ const c = f.map((h) => h === "exports" ? ((!e.exports || typeof e.exports != "object") && (e.exports = {}), e.exports) : h === "module" ? e : h);
3060
+ if (typeof l == "function") {
3061
+ const h = Reflect.apply(l, e, c);
3062
+ h && typeof h == "object" && (e.exports = h);
3063
+ } else
3064
+ e.exports = l;
3065
+ e.status = j.Defined, t.progress.work(!0, t.index, e.exports);
3066
+ }) : (typeof l == "function" ? e.exports = Reflect.apply(l, e, []) : e.exports = l, e.status = j.Defined, t.progress.work(!0, t.index, e.exports));
3067
+ };
3068
+ return s.amd = !0, s;
3069
+ }
3070
+ resolvePath(e) {
3071
+ try {
3072
+ if (e === "exports" || e === "module" || this.isNaturePath(e))
3073
+ return e;
3074
+ e = this.parserPath(e, !0);
3075
+ let t = this.getFileNamePostfix(e);
3076
+ t = t.toLowerCase();
3077
+ let n = this.createSearch(this.query);
3078
+ return e.indexOf("?") == -1 ? (t !== "js" && t !== "css" && (e += ".js"), n.length > 0 && (e += `?${n}`)) : n.length > 0 && (e += `&${n}`), e;
3079
+ } catch (t) {
3080
+ throw console.error(`resolve path[${e}] fail`, t), t;
3081
+ }
3082
+ }
3083
+ createSearch(e) {
3084
+ let t = "";
3085
+ if (e) {
3086
+ for (let n in e) {
3087
+ let s = `${e[n]}`;
3088
+ t += `${encodeURIComponent(n)}=${encodeURIComponent(s)}&`;
3089
+ }
3090
+ t.length > 0 && (t = t.substring(0, t.length - 1));
3091
+ }
3092
+ return t;
3093
+ }
3094
+ getFileNamePostfix(e) {
3095
+ let t = e.lastIndexOf("?");
3096
+ t == -1 && (t = e.length);
3097
+ let n = e.lastIndexOf(".", t);
3098
+ return n == -1 ? "" : e.substring(n + 1, t);
3099
+ }
3100
+ isNaturePath(e) {
3101
+ if (!this.options.nature)
3102
+ return !1;
3103
+ if (typeof this.options.nature == "function")
3104
+ return this.options.nature(e);
3105
+ const t = this.options.nature;
3106
+ if (t && Array.isArray(t))
3107
+ for (let n = 0; n < t.length; n++) {
3108
+ const s = t[n];
3109
+ if (e.indexOf(s) === 0)
3110
+ return !0;
3111
+ }
3112
+ return !1;
3113
+ }
3114
+ parserPath(e, t) {
3115
+ if (e.indexOf("http://") == 0 || e.indexOf("https://") == 0 || e.indexOf("file:///") == 0)
3116
+ return e;
3117
+ if (e.indexOf("/") == 0)
3118
+ return `${pt()}${e.slice(1)}`;
3119
+ if (e.indexOf("./") == 0)
3120
+ return `${pt()}${e.slice(2)}`;
3121
+ if (e.indexOf("//") == 0)
3122
+ return `${O().location.protocol}${e}`;
3123
+ if (t) {
3124
+ let s = this.options.alias[e];
3125
+ if (!s) {
3126
+ let i = e.indexOf("/");
3127
+ if (i == -1)
3128
+ s = e;
3129
+ else {
3130
+ let o = e.slice(0, i), a = this.options.paths[o];
3131
+ a ? s = a + e.slice(i) : s = e;
3132
+ }
3133
+ }
3134
+ return this.parserPath(s, !1);
3135
+ }
3136
+ return `${pt()}${e}`;
3137
+ }
3138
+ }
3139
+ function Lr(r, e) {
3140
+ let t = r.sheet, n = !1;
3141
+ if (e.isOldWebKit)
3142
+ t && (n = !0);
3143
+ else if (t)
3144
+ try {
3145
+ t.cssRules && (n = !0);
3146
+ } catch (s) {
3147
+ s.name === "NS_ERROR_DOM_SECURITY_ERR" && (n = !0);
3148
+ }
3149
+ setTimeout(() => {
3150
+ e.time += 20, n ? e.success() : e.timeout > e.timeout ? e.error() : Lr(r, e);
3151
+ }, 20);
3152
+ }
3153
+ class Gn {
3154
+ callback;
3155
+ values;
3156
+ status;
3157
+ size;
3158
+ lastIndex;
3159
+ constructor(e, t) {
3160
+ this.size = e, this.callback = t, this.status = !0, this.values = [], this.lastIndex = -1;
3161
+ }
3162
+ work(e, t, n) {
3163
+ if (this.status = e, this.status === !0 && (this.lastIndex !== t && this.size--, this.lastIndex = t, this.values.push(n)), this.size === 0 || this.status === !1)
3164
+ try {
3165
+ Reflect.apply(this.callback, this, [this.status, this.values]);
3166
+ } catch (s) {
3167
+ console.error(s.message, s);
3168
+ }
3169
+ }
3170
+ isOK() {
3171
+ return this.status;
3172
+ }
3173
+ }
3174
+ class Qn {
3175
+ index;
3176
+ src;
3177
+ params;
3178
+ progress;
3179
+ constructor(e, t, n, s) {
3180
+ this.index = e, this.src = t, this.params = n, this.progress = s;
3181
+ }
3182
+ }
3183
+ const Mr = Symbol("fk"), Nr = Symbol("fbk"), Ir = Symbol("fepk");
3184
+ function us(r = {}) {
3185
+ const e = new Cn(r), t = new Qt(), n = new Zt(), s = new mr(), i = {
3186
+ get router() {
3187
+ return e;
3188
+ },
3189
+ get bus() {
3190
+ return t;
3191
+ },
3192
+ get Bus() {
3193
+ return Qt;
3194
+ },
3195
+ get EventProxy() {
3196
+ return Zt;
3197
+ },
3198
+ get eventproxy() {
3199
+ return n;
3200
+ },
3201
+ get EventChain() {
3202
+ return rt;
3203
+ },
3204
+ get Require() {
3205
+ return mr;
3206
+ },
3207
+ get require() {
3208
+ return s;
3209
+ },
3210
+ get extend() {
3211
+ return $;
3212
+ },
3213
+ get clone() {
3214
+ return et;
3215
+ },
3216
+ get isESModule() {
3217
+ return wr;
3218
+ },
3219
+ install(o) {
3220
+ o.provide(it, e), o.provide(Mr, i), o.provide(Nr, t), o.provide(Ir, n), o.component(An, Ot), o.component(En, zn), Reflect.defineProperty(o.config.globalProperties, "$fox", {
3221
+ get() {
3222
+ return i;
3223
+ }
3224
+ }), Reflect.defineProperty(o.config.globalProperties, "$router", {
3225
+ get() {
3226
+ return e;
3227
+ }
3228
+ }), Reflect.defineProperty(o.config.globalProperties, "$bus", {
3229
+ get() {
3230
+ return t;
3231
+ }
3232
+ }), Reflect.defineProperty(o.config.globalProperties, "$bus", {
3233
+ get() {
3234
+ return t;
3235
+ }
3236
+ }), Reflect.defineProperty(o.config.globalProperties, "$eventProxy", {
3237
+ get() {
3238
+ return n;
3239
+ }
3240
+ }), o.config.globalProperties.$fox_on = function(a, l, u = !1) {
3241
+ n.on(a, l, u);
3242
+ }, o.config.globalProperties.$fox_off = function(a, l) {
3243
+ n.off(a, l);
3244
+ }, o.config.globalProperties.$fox_once = function(a, l) {
3245
+ n.once(a, l);
3246
+ }, o.config.globalProperties.$fox_all = function(...a) {
3247
+ let l = n;
3248
+ Reflect.apply(l.all, l, a);
3249
+ }, o.config.globalProperties.$fox_trigger = function(a, ...l) {
3250
+ let u = n;
3251
+ Reflect.apply(u.trigger, u, [a, ...l]);
3252
+ }, o.config.globalProperties.$fox_emit = function(a, ...l) {
3253
+ let u = n;
3254
+ Reflect.apply(u.trigger, u, [a, ...l]);
3255
+ }, o.mixin({
3256
+ computed: {
3257
+ $route() {
3258
+ return Ht(this);
3259
+ }
3260
+ }
3261
+ }), e.init();
3262
+ }
3263
+ };
3264
+ return i;
3265
+ }
3266
+ function Hr(r) {
3267
+ return r ? r.$router : G(it);
3268
+ }
3269
+ function fs(r) {
3270
+ return r || (r = Lt()?.proxy ?? void 0), r ? Ht(r) : null;
3271
+ }
3272
+ function cs(r) {
3273
+ return r ? r.$fox : G(Mr);
3274
+ }
3275
+ function hs(r) {
3276
+ return r ? r.$bus : G(Nr);
3277
+ }
3278
+ function ds(r) {
3279
+ return r ? r.$eventProxy : G(Ir);
3280
+ }
3281
+ function ys(r) {
3282
+ const e = Hr(), t = (n, s, i) => {
3283
+ try {
3284
+ Reflect.apply(r, {}, [n, s]);
3285
+ } catch (o) {
3286
+ console.error(o);
3287
+ }
3288
+ i();
3289
+ };
3290
+ e.beforeEach(t), st(() => {
3291
+ e.removeBeforeEach(t);
3292
+ });
3293
+ }
3294
+ function ps(r) {
3295
+ const e = Hr(), t = (n, s, i) => {
3296
+ try {
3297
+ Reflect.apply(r, {}, [n, s]);
3298
+ } catch (o) {
3299
+ console.error(o);
3300
+ }
3301
+ i();
3302
+ };
3303
+ e.afterEach(t), st(() => {
3304
+ e.removeAfterEach(t);
3305
+ });
3306
+ }
3307
+ export {
3308
+ Qt as Bus,
3309
+ rt as EventChain,
3310
+ Zt as EventProxy,
3311
+ K as Route,
3312
+ et as clone,
3313
+ us as createFox,
3314
+ Rn as createMemoryHistory,
3315
+ bn as createWebHashHistory,
3316
+ as as createWebHistory,
3317
+ $ as extend,
3318
+ Nr as foxBusKey,
3319
+ Ir as foxEventProxyKey,
3320
+ Mr as foxKey,
3321
+ Yn as isArray,
3322
+ ts as isDate,
3323
+ wr as isESModule,
3324
+ zt as isEqual,
3325
+ R as isFunction,
3326
+ Zn as isMap,
3327
+ Vr as isObject,
3328
+ kt as isPlainObject,
3329
+ ss as isPromise,
3330
+ es as isSet,
3331
+ rs as isString,
3332
+ ns as isSymbol,
3333
+ ps as onAfterRouteUpdate,
3334
+ ys as onBeforeRouteUpdate,
3335
+ os as onFoxActivated,
3336
+ ls as onFoxInactivated,
3337
+ le as sessionKey,
3338
+ br as toBoolean,
3339
+ is as toNumber,
3340
+ Mt as toTypeString,
3341
+ Wt as typeOf,
3342
+ hs as useBus,
3343
+ ds as useEventProxy,
3344
+ cs as useFox,
3345
+ fs as useRoute,
3346
+ Hr as useRouter
3347
+ };