@benjavicente/angular-router-experimental 1.142.11 → 1.142.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fesm2022/tanstack-angular-router-experimental-experimental.mjs +192 -187
- package/dist/fesm2022/tanstack-angular-router-experimental.mjs +1145 -1160
- package/dist/types/tanstack-angular-router-experimental-experimental.d.ts +39 -35
- package/dist/types/tanstack-angular-router-experimental.d.ts +56 -42
- package/package.json +5 -4
- package/src/Match.ts +37 -22
- package/src/Matches.ts +5 -2
- package/src/RouterProvider.ts +3 -0
- package/src/document/build-match-managed-document.ts +1 -1
- package/src/document/install-unified-document-sync.ts +6 -3
- package/src/document/provide-tanstack-body-managed-tags.ts +2 -2
- package/src/document/provide-tanstack-document-title.ts +4 -5
- package/src/document/provide-tanstack-head-managed-tags.ts +2 -2
- package/src/index.ts +5 -2
- package/src/injectCanGoBack.ts +2 -2
- package/src/injectLocation.ts +11 -8
- package/src/injectMatch.ts +45 -34
- package/src/injectMatchRoute.ts +4 -5
- package/src/injectMatches.ts +9 -9
- package/src/injectRouterState.ts +15 -10
- package/src/routerStores.ts +25 -52
- package/src/store/injectSelector.ts +62 -0
- package/src/store/injectStore.ts +33 -0
- package/src/transitioner.ts +12 -25
- package/src/injectStore.ts +0 -87
|
@@ -1,91 +1,97 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { batch as e, createAtom as t } from "@tanstack/store";
|
|
2
|
+
import * as n from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy as r, DestroyRef as i, ElementRef as a, EnvironmentInjector as o, InjectionToken as s, Injector as c, Renderer2 as l, ViewContainerRef as u, afterNextRender as d, assertInInjectionContext as f, computed as p, effect as m, inject as h, input as g, inputBinding as _, isDevMode as v, linkedSignal as y, runInInjectionContext as b, signal as x, untracked as S } from "@angular/core";
|
|
4
|
+
import { DOCUMENT as C } from "@angular/common";
|
|
4
5
|
//#region ../router-core/dist/esm/utils.js
|
|
5
|
-
function
|
|
6
|
+
function w(e) {
|
|
6
7
|
return e[e.length - 1];
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
+
function ee(e) {
|
|
9
10
|
return typeof e == "function";
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
12
|
+
function T(e, t) {
|
|
13
|
+
return ee(e) ? e(t) : e;
|
|
13
14
|
}
|
|
14
|
-
var
|
|
15
|
-
function
|
|
15
|
+
var te = Object.prototype.hasOwnProperty, ne = Object.prototype.propertyIsEnumerable;
|
|
16
|
+
function re(e) {
|
|
17
|
+
for (let t in e) if (te.call(e, t)) return !0;
|
|
18
|
+
return !1;
|
|
19
|
+
}
|
|
20
|
+
var ie = () => Object.create(null), E = (e, t) => D(e, t, ie);
|
|
21
|
+
function D(e, t, n = () => ({}), r = 0) {
|
|
16
22
|
if (e === t) return e;
|
|
17
23
|
if (r > 500) return t;
|
|
18
|
-
let i = t, a =
|
|
19
|
-
if (!a && !(
|
|
20
|
-
let o = a ? e :
|
|
24
|
+
let i = t, a = se(e) && se(i);
|
|
25
|
+
if (!a && !(O(e) && O(i))) return i;
|
|
26
|
+
let o = a ? e : ae(e);
|
|
21
27
|
if (!o) return i;
|
|
22
|
-
let s = a ? i :
|
|
28
|
+
let s = a ? i : ae(i);
|
|
23
29
|
if (!s) return i;
|
|
24
30
|
let c = o.length, l = s.length, u = a ? Array(l) : n(), d = 0;
|
|
25
31
|
for (let t = 0; t < l; t++) {
|
|
26
32
|
let o = a ? t : s[t], l = e[o], f = i[o];
|
|
27
33
|
if (l === f) {
|
|
28
|
-
u[o] = l, (a ? t < c :
|
|
34
|
+
u[o] = l, (a ? t < c : te.call(e, o)) && d++;
|
|
29
35
|
continue;
|
|
30
36
|
}
|
|
31
37
|
if (l === null || f === null || typeof l != "object" || typeof f != "object") {
|
|
32
38
|
u[o] = f;
|
|
33
39
|
continue;
|
|
34
40
|
}
|
|
35
|
-
let p =
|
|
41
|
+
let p = D(l, f, n, r + 1);
|
|
36
42
|
u[o] = p, p === l && d++;
|
|
37
43
|
}
|
|
38
44
|
return c === l && d === c ? e : u;
|
|
39
45
|
}
|
|
40
|
-
function
|
|
46
|
+
function ae(e) {
|
|
41
47
|
let t = Object.getOwnPropertyNames(e);
|
|
42
|
-
for (let n of t) if (!
|
|
48
|
+
for (let n of t) if (!ne.call(e, n)) return !1;
|
|
43
49
|
let n = Object.getOwnPropertySymbols(e);
|
|
44
50
|
if (n.length === 0) return t;
|
|
45
51
|
let r = t;
|
|
46
52
|
for (let t of n) {
|
|
47
|
-
if (!
|
|
53
|
+
if (!ne.call(e, t)) return !1;
|
|
48
54
|
r.push(t);
|
|
49
55
|
}
|
|
50
56
|
return r;
|
|
51
57
|
}
|
|
52
|
-
function
|
|
53
|
-
if (!
|
|
58
|
+
function O(e) {
|
|
59
|
+
if (!oe(e)) return !1;
|
|
54
60
|
let t = e.constructor;
|
|
55
61
|
if (t === void 0) return !0;
|
|
56
62
|
let n = t.prototype;
|
|
57
|
-
return !(!
|
|
63
|
+
return !(!oe(n) || !n.hasOwnProperty("isPrototypeOf"));
|
|
58
64
|
}
|
|
59
|
-
function
|
|
65
|
+
function oe(e) {
|
|
60
66
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
61
67
|
}
|
|
62
|
-
function
|
|
68
|
+
function se(e) {
|
|
63
69
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
64
70
|
}
|
|
65
|
-
function
|
|
71
|
+
function k(e, t, n) {
|
|
66
72
|
if (e === t) return !0;
|
|
67
73
|
if (typeof e != typeof t) return !1;
|
|
68
74
|
if (Array.isArray(e) && Array.isArray(t)) {
|
|
69
75
|
if (e.length !== t.length) return !1;
|
|
70
|
-
for (let r = 0, i = e.length; r < i; r++) if (!
|
|
76
|
+
for (let r = 0, i = e.length; r < i; r++) if (!k(e[r], t[r], n)) return !1;
|
|
71
77
|
return !0;
|
|
72
78
|
}
|
|
73
|
-
if (
|
|
79
|
+
if (O(e) && O(t)) {
|
|
74
80
|
let r = n?.ignoreUndefined ?? !0;
|
|
75
81
|
if (n?.partial) {
|
|
76
|
-
for (let i in t) if ((!r || t[i] !== void 0) && !
|
|
82
|
+
for (let i in t) if ((!r || t[i] !== void 0) && !k(e[i], t[i], n)) return !1;
|
|
77
83
|
return !0;
|
|
78
84
|
}
|
|
79
85
|
let i = 0;
|
|
80
86
|
if (!r) i = Object.keys(e).length;
|
|
81
87
|
else for (let t in e) e[t] !== void 0 && i++;
|
|
82
88
|
let a = 0;
|
|
83
|
-
for (let o in t) if ((!r || t[o] !== void 0) && (a++, a > i || !
|
|
89
|
+
for (let o in t) if ((!r || t[o] !== void 0) && (a++, a > i || !k(e[o], t[o], n))) return !1;
|
|
84
90
|
return i === a;
|
|
85
91
|
}
|
|
86
92
|
return !1;
|
|
87
93
|
}
|
|
88
|
-
function
|
|
94
|
+
function A(e) {
|
|
89
95
|
let t, n, r = new Promise((e, r) => {
|
|
90
96
|
t = e, n = r;
|
|
91
97
|
});
|
|
@@ -95,19 +101,19 @@ function k(e) {
|
|
|
95
101
|
r.status = "rejected", n(e);
|
|
96
102
|
}, r;
|
|
97
103
|
}
|
|
98
|
-
function
|
|
104
|
+
function ce(e) {
|
|
99
105
|
return !!(e && typeof e == "object" && typeof e.then == "function");
|
|
100
106
|
}
|
|
101
|
-
function
|
|
107
|
+
function le(e, t) {
|
|
102
108
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
103
109
|
let r = e[n];
|
|
104
110
|
if (t(r)) return r;
|
|
105
111
|
}
|
|
106
112
|
}
|
|
107
|
-
function
|
|
113
|
+
function ue(e) {
|
|
108
114
|
return e.replace(/[\x00-\x1f\x7f]/g, "");
|
|
109
115
|
}
|
|
110
|
-
function
|
|
116
|
+
function de(e) {
|
|
111
117
|
let t;
|
|
112
118
|
try {
|
|
113
119
|
t = decodeURI(e);
|
|
@@ -120,15 +126,15 @@ function se(e) {
|
|
|
120
126
|
}
|
|
121
127
|
});
|
|
122
128
|
}
|
|
123
|
-
return
|
|
129
|
+
return ue(t);
|
|
124
130
|
}
|
|
125
|
-
var
|
|
131
|
+
var fe = [
|
|
126
132
|
"http:",
|
|
127
133
|
"https:",
|
|
128
134
|
"mailto:",
|
|
129
135
|
"tel:"
|
|
130
136
|
];
|
|
131
|
-
function
|
|
137
|
+
function pe(e, t) {
|
|
132
138
|
if (!e) return !1;
|
|
133
139
|
try {
|
|
134
140
|
let n = new URL(e);
|
|
@@ -137,15 +143,15 @@ function le(e, t) {
|
|
|
137
143
|
return !1;
|
|
138
144
|
}
|
|
139
145
|
}
|
|
140
|
-
var
|
|
146
|
+
var me = {
|
|
141
147
|
"&": "\\u0026",
|
|
142
148
|
">": "\\u003e",
|
|
143
149
|
"<": "\\u003c",
|
|
144
150
|
"\u2028": "\\u2028",
|
|
145
151
|
"\u2029": "\\u2029"
|
|
146
|
-
},
|
|
147
|
-
function
|
|
148
|
-
return e.replace(
|
|
152
|
+
}, he = /[&><\u2028\u2029]/g;
|
|
153
|
+
function ge(e) {
|
|
154
|
+
return e.replace(he, (e) => me[e]);
|
|
149
155
|
}
|
|
150
156
|
function j(e) {
|
|
151
157
|
if (!e || !/[%\\\x00-\x1f\x7f]/.test(e) && !e.startsWith("//")) return {
|
|
@@ -153,18 +159,18 @@ function j(e) {
|
|
|
153
159
|
handledProtocolRelativeURL: !1
|
|
154
160
|
};
|
|
155
161
|
let t = /%25|%5C/gi, n = 0, r = "", i;
|
|
156
|
-
for (; (i = t.exec(e)) !== null;) r +=
|
|
157
|
-
r +=
|
|
162
|
+
for (; (i = t.exec(e)) !== null;) r += de(e.slice(n, i.index)) + i[0], n = t.lastIndex;
|
|
163
|
+
r += de(n ? e.slice(n) : e);
|
|
158
164
|
let a = !1;
|
|
159
165
|
return r.startsWith("//") && (a = !0, r = "/" + r.replace(/^\/+/, "")), {
|
|
160
166
|
path: r,
|
|
161
167
|
handledProtocolRelativeURL: a
|
|
162
168
|
};
|
|
163
169
|
}
|
|
164
|
-
function
|
|
170
|
+
function _e(e) {
|
|
165
171
|
return /\s|[^\u0000-\u007F]/.test(e) ? e.replace(/\s|[^\u0000-\u007F]/gu, encodeURIComponent) : e;
|
|
166
172
|
}
|
|
167
|
-
function
|
|
173
|
+
function ve(e, t) {
|
|
168
174
|
if (e === t) return !0;
|
|
169
175
|
if (e.length !== t.length) return !1;
|
|
170
176
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
@@ -172,12 +178,12 @@ function me(e, t) {
|
|
|
172
178
|
}
|
|
173
179
|
//#endregion
|
|
174
180
|
//#region ../router-core/dist/esm/invariant.js
|
|
175
|
-
function
|
|
181
|
+
function ye() {
|
|
176
182
|
throw Error("Invariant failed");
|
|
177
183
|
}
|
|
178
184
|
//#endregion
|
|
179
185
|
//#region ../router-core/dist/esm/lru-cache.js
|
|
180
|
-
function
|
|
186
|
+
function M(e) {
|
|
181
187
|
let t = /* @__PURE__ */ new Map(), n, r, i = (e) => {
|
|
182
188
|
e.next && (e.prev ? (e.prev.next = e.next, e.next.prev = e.prev, e.next = void 0, r && (r.next = e, e.prev = r)) : (e.next.prev = void 0, n = e.next, e.next = void 0, r && (e.prev = r, r.next = e)), r = e);
|
|
183
189
|
};
|
|
@@ -209,14 +215,14 @@ function ge(e) {
|
|
|
209
215
|
}
|
|
210
216
|
//#endregion
|
|
211
217
|
//#region ../router-core/dist/esm/new-process-route-tree.js
|
|
212
|
-
var
|
|
213
|
-
function
|
|
218
|
+
var N = 4, be = 5;
|
|
219
|
+
function xe(e) {
|
|
214
220
|
let t = e.indexOf("{");
|
|
215
221
|
if (t === -1) return null;
|
|
216
222
|
let n = e.indexOf("}", t);
|
|
217
223
|
return n === -1 || t + 1 >= e.length ? null : [t, n];
|
|
218
224
|
}
|
|
219
|
-
function
|
|
225
|
+
function Se(e, t, n = new Uint16Array(6)) {
|
|
220
226
|
let r = e.indexOf("/", t), i = r === -1 ? e.length : r, a = e.substring(t, i);
|
|
221
227
|
if (!a || !a.includes("$")) return n[0] = 0, n[1] = t, n[2] = t, n[3] = i, n[4] = i, n[5] = i, n;
|
|
222
228
|
if (a === "$") {
|
|
@@ -224,7 +230,7 @@ function ye(e, t, n = new Uint16Array(6)) {
|
|
|
224
230
|
return n[0] = 2, n[1] = t, n[2] = t, n[3] = r, n[4] = r, n[5] = r, n;
|
|
225
231
|
}
|
|
226
232
|
if (a.charCodeAt(0) === 36) return n[0] = 1, n[1] = t, n[2] = t + 1, n[3] = i, n[4] = i, n[5] = i, n;
|
|
227
|
-
let o =
|
|
233
|
+
let o = xe(a);
|
|
228
234
|
if (o) {
|
|
229
235
|
let [r, s] = o, c = a.charCodeAt(r + 1);
|
|
230
236
|
if (c === 45) {
|
|
@@ -239,13 +245,13 @@ function ye(e, t, n = new Uint16Array(6)) {
|
|
|
239
245
|
}
|
|
240
246
|
return n[0] = 0, n[1] = t, n[2] = t, n[3] = i, n[4] = i, n[5] = i, n;
|
|
241
247
|
}
|
|
242
|
-
function
|
|
248
|
+
function Ce(e, t, n, r, i, a, o) {
|
|
243
249
|
o?.(n);
|
|
244
250
|
let s = r;
|
|
245
251
|
{
|
|
246
|
-
let r = n.fullPath ?? n.from, o = r.length, c = n.options?.caseSensitive ?? e, l =
|
|
252
|
+
let r = n.fullPath ?? n.from, o = r.length, c = n.options?.caseSensitive ?? e, l = n.options?.params?.parse ?? n.options?.parseParams;
|
|
247
253
|
for (; s < o;) {
|
|
248
|
-
let e =
|
|
254
|
+
let e = Se(r, s, t), o, u = s, d = e[5];
|
|
249
255
|
switch (s = d + 1, a++, e[0]) {
|
|
250
256
|
case 0: {
|
|
251
257
|
let t = r.substring(e[2], e[3]);
|
|
@@ -254,7 +260,7 @@ function be(e, t, n, r, i, a, o) {
|
|
|
254
260
|
if (e) o = e;
|
|
255
261
|
else {
|
|
256
262
|
i.static ??= /* @__PURE__ */ new Map();
|
|
257
|
-
let e =
|
|
263
|
+
let e = F(n.fullPath ?? n.from);
|
|
258
264
|
e.parent = i, e.depth = a, o = e, i.static.set(t, e);
|
|
259
265
|
}
|
|
260
266
|
} else {
|
|
@@ -262,54 +268,53 @@ function be(e, t, n, r, i, a, o) {
|
|
|
262
268
|
if (r) o = r;
|
|
263
269
|
else {
|
|
264
270
|
i.staticInsensitive ??= /* @__PURE__ */ new Map();
|
|
265
|
-
let t =
|
|
271
|
+
let t = F(n.fullPath ?? n.from);
|
|
266
272
|
t.parent = i, t.depth = a, o = t, i.staticInsensitive.set(e, t);
|
|
267
273
|
}
|
|
268
274
|
}
|
|
269
275
|
break;
|
|
270
276
|
}
|
|
271
277
|
case 1: {
|
|
272
|
-
let t = r.substring(u, e[1]), s = r.substring(e[4], d), f = c && !!(t || s), p = t ? f ? t : t.toLowerCase() : void 0, m = s ? f ? s : s.toLowerCase() : void 0, h = !l && i.dynamic?.find((e) => !e.
|
|
278
|
+
let t = r.substring(u, e[1]), s = r.substring(e[4], d), f = c && !!(t || s), p = t ? f ? t : t.toLowerCase() : void 0, m = s ? f ? s : s.toLowerCase() : void 0, h = !l && i.dynamic?.find((e) => !e.parse && e.caseSensitive === f && e.prefix === p && e.suffix === m);
|
|
273
279
|
if (h) o = h;
|
|
274
280
|
else {
|
|
275
|
-
let e =
|
|
281
|
+
let e = Te(1, n.fullPath ?? n.from, f, p, m);
|
|
276
282
|
o = e, e.depth = a, e.parent = i, i.dynamic ??= [], i.dynamic.push(e);
|
|
277
283
|
}
|
|
278
284
|
break;
|
|
279
285
|
}
|
|
280
286
|
case 3: {
|
|
281
|
-
let t = r.substring(u, e[1]), s = r.substring(e[4], d), f = c && !!(t || s), p = t ? f ? t : t.toLowerCase() : void 0, m = s ? f ? s : s.toLowerCase() : void 0, h = !l && i.optional?.find((e) => !e.
|
|
287
|
+
let t = r.substring(u, e[1]), s = r.substring(e[4], d), f = c && !!(t || s), p = t ? f ? t : t.toLowerCase() : void 0, m = s ? f ? s : s.toLowerCase() : void 0, h = !l && i.optional?.find((e) => !e.parse && e.caseSensitive === f && e.prefix === p && e.suffix === m);
|
|
282
288
|
if (h) o = h;
|
|
283
289
|
else {
|
|
284
|
-
let e =
|
|
290
|
+
let e = Te(3, n.fullPath ?? n.from, f, p, m);
|
|
285
291
|
o = e, e.parent = i, e.depth = a, i.optional ??= [], i.optional.push(e);
|
|
286
292
|
}
|
|
287
293
|
break;
|
|
288
294
|
}
|
|
289
295
|
case 2: {
|
|
290
|
-
let t = r.substring(u, e[1]), s = r.substring(e[4], d), l = c && !!(t || s), f = t ? l ? t : t.toLowerCase() : void 0, p = s ? l ? s : s.toLowerCase() : void 0, m =
|
|
296
|
+
let t = r.substring(u, e[1]), s = r.substring(e[4], d), l = c && !!(t || s), f = t ? l ? t : t.toLowerCase() : void 0, p = s ? l ? s : s.toLowerCase() : void 0, m = Te(2, n.fullPath ?? n.from, l, f, p);
|
|
291
297
|
o = m, m.parent = i, m.depth = a, i.wildcard ??= [], i.wildcard.push(m);
|
|
292
298
|
}
|
|
293
299
|
}
|
|
294
300
|
i = o;
|
|
295
301
|
}
|
|
296
302
|
if (l && n.children && !n.isRoot && n.id && n.id.charCodeAt(n.id.lastIndexOf("/") + 1) === 95) {
|
|
297
|
-
let e =
|
|
298
|
-
e.kind =
|
|
303
|
+
let e = F(n.fullPath ?? n.from);
|
|
304
|
+
e.kind = be, e.parent = i, a++, e.depth = a, i.pathless ??= [], i.pathless.push(e), i = e;
|
|
299
305
|
}
|
|
300
306
|
let u = (n.path || !n.children) && !n.isRoot;
|
|
301
307
|
if (u && r.endsWith("/")) {
|
|
302
|
-
let e =
|
|
303
|
-
e.kind =
|
|
308
|
+
let e = F(n.fullPath ?? n.from);
|
|
309
|
+
e.kind = N, e.parent = i, a++, e.depth = a, i.index = e, i = e;
|
|
304
310
|
}
|
|
305
|
-
i.parse =
|
|
311
|
+
i.parse = l ?? null, u && !i.route && (i.route = n, i.fullPath = n.fullPath ?? n.from);
|
|
306
312
|
}
|
|
307
|
-
if (n.children) for (let r of n.children)
|
|
313
|
+
if (n.children) for (let r of n.children) Ce(e, t, r, s, i, a, o);
|
|
308
314
|
}
|
|
309
|
-
function
|
|
310
|
-
if (e.
|
|
311
|
-
if (!e.
|
|
312
|
-
if (e.skipOnParamError && t.skipOnParamError && (e.parsingPriority || t.parsingPriority)) return t.parsingPriority - e.parsingPriority;
|
|
315
|
+
function we(e, t) {
|
|
316
|
+
if (e.parse && !t.parse) return -1;
|
|
317
|
+
if (!e.parse && t.parse) return 1;
|
|
313
318
|
if (e.prefix && t.prefix && e.prefix !== t.prefix) {
|
|
314
319
|
if (e.prefix.startsWith(t.prefix)) return -1;
|
|
315
320
|
if (t.prefix.startsWith(e.prefix)) return 1;
|
|
@@ -320,24 +325,24 @@ function xe(e, t) {
|
|
|
320
325
|
}
|
|
321
326
|
return e.prefix && !t.prefix ? -1 : !e.prefix && t.prefix ? 1 : e.suffix && !t.suffix ? -1 : !e.suffix && t.suffix ? 1 : e.caseSensitive && !t.caseSensitive ? -1 : !e.caseSensitive && t.caseSensitive ? 1 : 0;
|
|
322
327
|
}
|
|
323
|
-
function
|
|
324
|
-
if (e.pathless) for (let t of e.pathless)
|
|
325
|
-
if (e.static) for (let t of e.static.values())
|
|
326
|
-
if (e.staticInsensitive) for (let t of e.staticInsensitive.values())
|
|
328
|
+
function P(e) {
|
|
329
|
+
if (e.pathless) for (let t of e.pathless) P(t);
|
|
330
|
+
if (e.static) for (let t of e.static.values()) P(t);
|
|
331
|
+
if (e.staticInsensitive) for (let t of e.staticInsensitive.values()) P(t);
|
|
327
332
|
if (e.dynamic?.length) {
|
|
328
|
-
e.dynamic.sort(
|
|
329
|
-
for (let t of e.dynamic)
|
|
333
|
+
e.dynamic.sort(we);
|
|
334
|
+
for (let t of e.dynamic) P(t);
|
|
330
335
|
}
|
|
331
336
|
if (e.optional?.length) {
|
|
332
|
-
e.optional.sort(
|
|
333
|
-
for (let t of e.optional)
|
|
337
|
+
e.optional.sort(we);
|
|
338
|
+
for (let t of e.optional) P(t);
|
|
334
339
|
}
|
|
335
340
|
if (e.wildcard?.length) {
|
|
336
|
-
e.wildcard.sort(
|
|
337
|
-
for (let t of e.wildcard)
|
|
341
|
+
e.wildcard.sort(we);
|
|
342
|
+
for (let t of e.wildcard) P(t);
|
|
338
343
|
}
|
|
339
344
|
}
|
|
340
|
-
function
|
|
345
|
+
function F(e) {
|
|
341
346
|
return {
|
|
342
347
|
kind: 0,
|
|
343
348
|
depth: 0,
|
|
@@ -351,12 +356,10 @@ function P(e) {
|
|
|
351
356
|
route: null,
|
|
352
357
|
fullPath: e,
|
|
353
358
|
parent: null,
|
|
354
|
-
parse: null
|
|
355
|
-
skipOnParamError: !1,
|
|
356
|
-
parsingPriority: 0
|
|
359
|
+
parse: null
|
|
357
360
|
};
|
|
358
361
|
}
|
|
359
|
-
function
|
|
362
|
+
function Te(e, t, n, r, i) {
|
|
360
363
|
return {
|
|
361
364
|
kind: e,
|
|
362
365
|
depth: 0,
|
|
@@ -371,63 +374,61 @@ function Se(e, t, n, r, i) {
|
|
|
371
374
|
fullPath: t,
|
|
372
375
|
parent: null,
|
|
373
376
|
parse: null,
|
|
374
|
-
skipOnParamError: !1,
|
|
375
|
-
parsingPriority: 0,
|
|
376
377
|
caseSensitive: n,
|
|
377
378
|
prefix: r,
|
|
378
379
|
suffix: i
|
|
379
380
|
};
|
|
380
381
|
}
|
|
381
|
-
function
|
|
382
|
-
let n =
|
|
383
|
-
for (let t of e)
|
|
384
|
-
|
|
382
|
+
function Ee(e, t) {
|
|
383
|
+
let n = F("/"), r = new Uint16Array(6);
|
|
384
|
+
for (let t of e) Ce(!1, r, t, 1, n, 0);
|
|
385
|
+
P(n), t.masksTree = n, t.flatCache = M(1e3);
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
+
function De(e, t) {
|
|
387
388
|
e ||= "/";
|
|
388
389
|
let n = t.flatCache.get(e);
|
|
389
390
|
if (n) return n;
|
|
390
|
-
let r =
|
|
391
|
+
let r = Me(e, t.masksTree);
|
|
391
392
|
return t.flatCache.set(e, r), r;
|
|
392
393
|
}
|
|
393
|
-
function
|
|
394
|
+
function Oe(e, t, n, r, i) {
|
|
394
395
|
e ||= "/", r ||= "/";
|
|
395
396
|
let a = t ? `case\0${e}` : e, o = i.singleCache.get(a);
|
|
396
|
-
return o || (o =
|
|
397
|
+
return o || (o = F("/"), Ce(t, new Uint16Array(6), { from: e }, 1, o, 0), i.singleCache.set(a, o)), Me(r, o, n);
|
|
397
398
|
}
|
|
398
|
-
function
|
|
399
|
+
function ke(e, t, n = !1) {
|
|
399
400
|
let r = n ? e : `nofuzz\0${e}`, i = t.matchCache.get(r);
|
|
400
401
|
if (i !== void 0) return i;
|
|
401
402
|
e ||= "/";
|
|
402
403
|
let a;
|
|
403
404
|
try {
|
|
404
|
-
a =
|
|
405
|
+
a = Me(e, t.segmentTree, n);
|
|
405
406
|
} catch (e) {
|
|
406
407
|
if (e instanceof URIError) a = null;
|
|
407
408
|
else throw e;
|
|
408
409
|
}
|
|
409
|
-
return a && (a.branch =
|
|
410
|
+
return a && (a.branch = Pe(a.route)), t.matchCache.set(r, a), a;
|
|
410
411
|
}
|
|
411
|
-
function
|
|
412
|
+
function Ae(e) {
|
|
412
413
|
return e === "/" ? e : e.replace(/\/{1,}$/, "");
|
|
413
414
|
}
|
|
414
|
-
function
|
|
415
|
-
let r =
|
|
416
|
-
return
|
|
415
|
+
function je(e, t = !1, n) {
|
|
416
|
+
let r = F(e.fullPath), i = new Uint16Array(6), a = {}, o = {}, s = 0;
|
|
417
|
+
return Ce(t, i, e, 1, r, 0, (e) => {
|
|
417
418
|
if (n?.(e, s), e.id in a) {
|
|
418
419
|
if (process.env.NODE_ENV !== "production") throw Error(`Invariant failed: Duplicate routes found with id: ${String(e.id)}`);
|
|
419
|
-
|
|
420
|
+
ye();
|
|
420
421
|
}
|
|
421
422
|
if (a[e.id] = e, s !== 0 && e.path) {
|
|
422
|
-
let t =
|
|
423
|
+
let t = Ae(e.fullPath);
|
|
423
424
|
(!o[t] || e.fullPath.endsWith("/")) && (o[t] = e);
|
|
424
425
|
}
|
|
425
426
|
s++;
|
|
426
|
-
}),
|
|
427
|
+
}), P(r), {
|
|
427
428
|
processedTree: {
|
|
428
429
|
segmentTree: r,
|
|
429
|
-
singleCache:
|
|
430
|
-
matchCache:
|
|
430
|
+
singleCache: M(1e3),
|
|
431
|
+
matchCache: M(1e3),
|
|
431
432
|
flatCache: null,
|
|
432
433
|
masksTree: null
|
|
433
434
|
},
|
|
@@ -435,22 +436,21 @@ function Oe(e, t = !1, n) {
|
|
|
435
436
|
routesByPath: o
|
|
436
437
|
};
|
|
437
438
|
}
|
|
438
|
-
function
|
|
439
|
-
let r = e.split("/"), i =
|
|
439
|
+
function Me(e, t, n = !1) {
|
|
440
|
+
let r = e.split("/"), i = Ie(e, r, t, n);
|
|
440
441
|
if (!i) return null;
|
|
441
|
-
let [a] =
|
|
442
|
+
let [a] = Ne(e, r, i);
|
|
442
443
|
return {
|
|
443
444
|
route: i.node.route,
|
|
444
|
-
rawParams: a
|
|
445
|
-
parsedParams: i.parsedParams
|
|
445
|
+
rawParams: a
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
|
-
function
|
|
449
|
-
let r =
|
|
448
|
+
function Ne(e, t, n) {
|
|
449
|
+
let r = Fe(n.node), i = null, a = Object.create(null), o = n.extract?.part ?? 0, s = n.extract?.node ?? 0, c = n.extract?.path ?? 0, l = n.extract?.segment ?? 0;
|
|
450
450
|
for (; s < r.length; o++, s++, c++, l++) {
|
|
451
451
|
let u = r[s];
|
|
452
|
-
if (u.kind ===
|
|
453
|
-
if (u.kind ===
|
|
452
|
+
if (u.kind === N) break;
|
|
453
|
+
if (u.kind === be) {
|
|
454
454
|
l--, o--, c--;
|
|
455
455
|
continue;
|
|
456
456
|
}
|
|
@@ -486,239 +486,236 @@ function Ae(e, t, n) {
|
|
|
486
486
|
segment: l
|
|
487
487
|
}];
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Pe(e) {
|
|
490
490
|
let t = [e];
|
|
491
491
|
for (; e.parentRoute;) e = e.parentRoute, t.push(e);
|
|
492
492
|
return t.reverse(), t;
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function Fe(e) {
|
|
495
495
|
let t = Array(e.depth + 1);
|
|
496
496
|
do
|
|
497
497
|
t[e.depth] = e, e = e.parent;
|
|
498
498
|
while (e);
|
|
499
499
|
return t;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function Ie(e, t, n, r) {
|
|
502
502
|
if (e === "/" && n.index) return {
|
|
503
503
|
node: n.index,
|
|
504
504
|
skipped: 0
|
|
505
505
|
};
|
|
506
|
-
let i = !
|
|
506
|
+
let i = !w(t), a = i && e !== "/", o = t.length - (i ? 1 : 0), s = [{
|
|
507
507
|
node: n,
|
|
508
508
|
index: 1,
|
|
509
509
|
skipped: 0,
|
|
510
510
|
depth: 1,
|
|
511
|
-
statics:
|
|
511
|
+
statics: 0,
|
|
512
512
|
dynamics: 0,
|
|
513
513
|
optionals: 0
|
|
514
|
-
}], c = null, l = null
|
|
514
|
+
}], c = null, l = null;
|
|
515
515
|
for (; s.length;) {
|
|
516
|
-
let n = s.pop(), { node: i, index:
|
|
517
|
-
if (i.
|
|
518
|
-
|
|
519
|
-
|
|
516
|
+
let n = s.pop(), { node: i, index: u, skipped: d, depth: f, statics: p, dynamics: m, optionals: h } = n, { extract: g, rawParams: _ } = n;
|
|
517
|
+
if (i.kind === 2 && i.route && !Be(l, n)) continue;
|
|
518
|
+
if (i.parse) {
|
|
519
|
+
if (!ze(e, t, n)) continue;
|
|
520
|
+
_ = n.rawParams, g = n.extract;
|
|
520
521
|
}
|
|
521
|
-
r && i.route && i.kind !==
|
|
522
|
-
let
|
|
523
|
-
if (
|
|
524
|
-
let
|
|
525
|
-
if (
|
|
522
|
+
r && i.route && i.kind !== N && Be(c, n) && (c = n);
|
|
523
|
+
let v = u === o;
|
|
524
|
+
if (v && (i.route && (!a || i.kind === N || i.kind === 2) && Be(l, n) && (l = n), !i.optional && !i.wildcard && !i.index && !i.pathless)) continue;
|
|
525
|
+
let y = v ? void 0 : t[u], b;
|
|
526
|
+
if (v && i.index) {
|
|
526
527
|
let n = {
|
|
527
528
|
node: i.index,
|
|
528
|
-
index:
|
|
529
|
-
skipped:
|
|
530
|
-
depth:
|
|
531
|
-
statics:
|
|
532
|
-
dynamics:
|
|
533
|
-
optionals:
|
|
534
|
-
extract:
|
|
535
|
-
rawParams:
|
|
536
|
-
parsedParams: y
|
|
529
|
+
index: u,
|
|
530
|
+
skipped: d,
|
|
531
|
+
depth: f + 1,
|
|
532
|
+
statics: p,
|
|
533
|
+
dynamics: m,
|
|
534
|
+
optionals: h,
|
|
535
|
+
extract: g,
|
|
536
|
+
rawParams: _
|
|
537
537
|
}, r = !0;
|
|
538
|
-
if (i.index.
|
|
539
|
-
if (m
|
|
540
|
-
|
|
538
|
+
if (i.index.parse && (ze(e, t, n) || (r = !1)), r) {
|
|
539
|
+
if (!m && !h && !d && Re(p, o)) return n;
|
|
540
|
+
Be(l, n) && (l = n);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
if (i.wildcard
|
|
544
|
-
let { prefix: r, suffix:
|
|
545
|
-
if (r && (
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
};
|
|
563
|
-
if (!(n.skipOnParamError && !Pe(e, t, a))) {
|
|
564
|
-
c = a;
|
|
565
|
-
break;
|
|
543
|
+
if (i.wildcard) for (let e = i.wildcard.length - 1; e >= 0; e--) {
|
|
544
|
+
let n = i.wildcard[e], { prefix: r, suffix: a } = n;
|
|
545
|
+
if (!(r && (v || !(n.caseSensitive ? y : b ??= y.toLowerCase()).startsWith(r)))) {
|
|
546
|
+
if (a) {
|
|
547
|
+
if (v) continue;
|
|
548
|
+
let e = t.slice(u).join("/").slice(-a.length);
|
|
549
|
+
if ((n.caseSensitive ? e : e.toLowerCase()) !== a) continue;
|
|
550
|
+
}
|
|
551
|
+
s.push({
|
|
552
|
+
node: n,
|
|
553
|
+
index: o,
|
|
554
|
+
skipped: d,
|
|
555
|
+
depth: f + 1,
|
|
556
|
+
statics: p,
|
|
557
|
+
dynamics: m,
|
|
558
|
+
optionals: h,
|
|
559
|
+
extract: g,
|
|
560
|
+
rawParams: _
|
|
561
|
+
});
|
|
566
562
|
}
|
|
567
563
|
}
|
|
568
564
|
if (i.optional) {
|
|
569
|
-
let e =
|
|
565
|
+
let e = d | 1 << f, t = f + 1;
|
|
570
566
|
for (let n = i.optional.length - 1; n >= 0; n--) {
|
|
571
567
|
let r = i.optional[n];
|
|
572
568
|
s.push({
|
|
573
569
|
node: r,
|
|
574
|
-
index:
|
|
570
|
+
index: u,
|
|
575
571
|
skipped: e,
|
|
576
572
|
depth: t,
|
|
577
|
-
statics:
|
|
578
|
-
dynamics:
|
|
579
|
-
optionals:
|
|
580
|
-
extract:
|
|
581
|
-
rawParams:
|
|
582
|
-
parsedParams: y
|
|
573
|
+
statics: p,
|
|
574
|
+
dynamics: m,
|
|
575
|
+
optionals: h,
|
|
576
|
+
extract: g,
|
|
577
|
+
rawParams: _
|
|
583
578
|
});
|
|
584
579
|
}
|
|
585
|
-
if (!
|
|
580
|
+
if (!v) for (let e = i.optional.length - 1; e >= 0; e--) {
|
|
586
581
|
let n = i.optional[e], { prefix: r, suffix: a } = n;
|
|
587
582
|
if (r || a) {
|
|
588
|
-
let e = n.caseSensitive ?
|
|
583
|
+
let e = n.caseSensitive ? y : b ??= y.toLowerCase();
|
|
589
584
|
if (r && !e.startsWith(r) || a && !e.endsWith(a)) continue;
|
|
590
585
|
}
|
|
591
586
|
s.push({
|
|
592
587
|
node: n,
|
|
593
|
-
index:
|
|
594
|
-
skipped:
|
|
588
|
+
index: u + 1,
|
|
589
|
+
skipped: d,
|
|
595
590
|
depth: t,
|
|
596
|
-
statics:
|
|
597
|
-
dynamics:
|
|
598
|
-
optionals:
|
|
599
|
-
extract:
|
|
600
|
-
rawParams:
|
|
601
|
-
parsedParams: y
|
|
591
|
+
statics: p,
|
|
592
|
+
dynamics: m,
|
|
593
|
+
optionals: h + Le(o, u),
|
|
594
|
+
extract: g,
|
|
595
|
+
rawParams: _
|
|
602
596
|
});
|
|
603
597
|
}
|
|
604
598
|
}
|
|
605
|
-
if (!
|
|
599
|
+
if (!v && i.dynamic && y) for (let e = i.dynamic.length - 1; e >= 0; e--) {
|
|
606
600
|
let t = i.dynamic[e], { prefix: n, suffix: r } = t;
|
|
607
601
|
if (n || r) {
|
|
608
|
-
let e = t.caseSensitive ?
|
|
602
|
+
let e = t.caseSensitive ? y : b ??= y.toLowerCase();
|
|
609
603
|
if (n && !e.startsWith(n) || r && !e.endsWith(r)) continue;
|
|
610
604
|
}
|
|
611
605
|
s.push({
|
|
612
606
|
node: t,
|
|
613
|
-
index:
|
|
614
|
-
skipped:
|
|
615
|
-
depth:
|
|
616
|
-
statics:
|
|
617
|
-
dynamics:
|
|
618
|
-
optionals:
|
|
619
|
-
extract:
|
|
620
|
-
rawParams:
|
|
621
|
-
parsedParams: y
|
|
607
|
+
index: u + 1,
|
|
608
|
+
skipped: d,
|
|
609
|
+
depth: f + 1,
|
|
610
|
+
statics: p,
|
|
611
|
+
dynamics: m + Le(o, u),
|
|
612
|
+
optionals: h,
|
|
613
|
+
extract: g,
|
|
614
|
+
rawParams: _
|
|
622
615
|
});
|
|
623
616
|
}
|
|
624
|
-
if (!
|
|
625
|
-
let e = i.staticInsensitive.get(
|
|
617
|
+
if (!v && i.staticInsensitive) {
|
|
618
|
+
let e = i.staticInsensitive.get(b ??= y.toLowerCase());
|
|
626
619
|
e && s.push({
|
|
627
620
|
node: e,
|
|
628
|
-
index:
|
|
629
|
-
skipped:
|
|
630
|
-
depth:
|
|
631
|
-
statics:
|
|
632
|
-
dynamics:
|
|
633
|
-
optionals:
|
|
634
|
-
extract:
|
|
635
|
-
rawParams:
|
|
636
|
-
parsedParams: y
|
|
621
|
+
index: u + 1,
|
|
622
|
+
skipped: d,
|
|
623
|
+
depth: f + 1,
|
|
624
|
+
statics: p + Le(o, u),
|
|
625
|
+
dynamics: m,
|
|
626
|
+
optionals: h,
|
|
627
|
+
extract: g,
|
|
628
|
+
rawParams: _
|
|
637
629
|
});
|
|
638
630
|
}
|
|
639
|
-
if (!
|
|
640
|
-
let e = i.static.get(
|
|
631
|
+
if (!v && i.static) {
|
|
632
|
+
let e = i.static.get(y);
|
|
641
633
|
e && s.push({
|
|
642
634
|
node: e,
|
|
643
|
-
index:
|
|
644
|
-
skipped:
|
|
645
|
-
depth:
|
|
646
|
-
statics:
|
|
647
|
-
dynamics:
|
|
648
|
-
optionals:
|
|
649
|
-
extract:
|
|
650
|
-
rawParams:
|
|
651
|
-
parsedParams: y
|
|
635
|
+
index: u + 1,
|
|
636
|
+
skipped: d,
|
|
637
|
+
depth: f + 1,
|
|
638
|
+
statics: p + Le(o, u),
|
|
639
|
+
dynamics: m,
|
|
640
|
+
optionals: h,
|
|
641
|
+
extract: g,
|
|
642
|
+
rawParams: _
|
|
652
643
|
});
|
|
653
644
|
}
|
|
654
645
|
if (i.pathless) {
|
|
655
|
-
let e =
|
|
646
|
+
let e = f + 1;
|
|
656
647
|
for (let t = i.pathless.length - 1; t >= 0; t--) {
|
|
657
648
|
let n = i.pathless[t];
|
|
658
649
|
s.push({
|
|
659
650
|
node: n,
|
|
660
|
-
index:
|
|
661
|
-
skipped:
|
|
651
|
+
index: u,
|
|
652
|
+
skipped: d,
|
|
662
653
|
depth: e,
|
|
663
|
-
statics:
|
|
664
|
-
dynamics:
|
|
665
|
-
optionals:
|
|
666
|
-
extract:
|
|
667
|
-
rawParams:
|
|
668
|
-
parsedParams: y
|
|
654
|
+
statics: p,
|
|
655
|
+
dynamics: m,
|
|
656
|
+
optionals: h,
|
|
657
|
+
extract: g,
|
|
658
|
+
rawParams: _
|
|
669
659
|
});
|
|
670
660
|
}
|
|
671
661
|
}
|
|
672
662
|
}
|
|
673
|
-
if (
|
|
674
|
-
if (
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
let n = l.index;
|
|
678
|
-
for (let e = 0; e < l.index; e++) n += t[e].length;
|
|
663
|
+
if (l) return l;
|
|
664
|
+
if (r && c) {
|
|
665
|
+
let n = c.index;
|
|
666
|
+
for (let e = 0; e < c.index; e++) n += t[e].length;
|
|
679
667
|
let r = n === e.length ? "/" : e.slice(n);
|
|
680
|
-
return
|
|
668
|
+
return c.rawParams ??= Object.create(null), c.rawParams["**"] = decodeURIComponent(r), c;
|
|
681
669
|
}
|
|
682
670
|
return null;
|
|
683
671
|
}
|
|
684
|
-
function
|
|
672
|
+
function Le(e, t) {
|
|
673
|
+
return 2 ** (e - t - 1);
|
|
674
|
+
}
|
|
675
|
+
function Re(e, t) {
|
|
676
|
+
return e === 2 ** (t - 1) - 1;
|
|
677
|
+
}
|
|
678
|
+
function ze(e, t, n) {
|
|
679
|
+
let r, i;
|
|
685
680
|
try {
|
|
686
|
-
|
|
687
|
-
n.rawParams = r, n.extract = i;
|
|
688
|
-
let a = n.node.parse(r);
|
|
689
|
-
return n.parsedParams = Object.assign(Object.create(null), n.parsedParams, a), !0;
|
|
681
|
+
[r, i] = Ne(e, t, n);
|
|
690
682
|
} catch {
|
|
691
683
|
return null;
|
|
692
684
|
}
|
|
685
|
+
if (n.rawParams = r, n.extract = i, !n.node.parse) return !0;
|
|
686
|
+
try {
|
|
687
|
+
if (n.node.parse(r) === !1) return null;
|
|
688
|
+
} catch {}
|
|
689
|
+
return !0;
|
|
693
690
|
}
|
|
694
|
-
function
|
|
695
|
-
return e ? t.statics > e.statics || t.statics === e.statics && (t.dynamics > e.dynamics || t.dynamics === e.dynamics && (t.optionals > e.optionals || t.optionals === e.optionals && ((t.node.kind ===
|
|
691
|
+
function Be(e, t) {
|
|
692
|
+
return e ? t.statics > e.statics || t.statics === e.statics && (t.dynamics > e.dynamics || t.dynamics === e.dynamics && (t.optionals > e.optionals || t.optionals === e.optionals && ((t.node.kind === N) > (e.node.kind === N) || t.node.kind === N == (e.node.kind === N) && t.depth > e.depth))) : !0;
|
|
696
693
|
}
|
|
697
694
|
//#endregion
|
|
698
695
|
//#region ../router-core/dist/esm/path.js
|
|
699
|
-
function
|
|
700
|
-
return
|
|
696
|
+
function Ve(e) {
|
|
697
|
+
return He(e.filter((e) => e !== void 0).join("/"));
|
|
701
698
|
}
|
|
702
|
-
function
|
|
699
|
+
function He(e) {
|
|
703
700
|
return e.replace(/\/{2,}/g, "/");
|
|
704
701
|
}
|
|
705
|
-
function
|
|
702
|
+
function Ue(e) {
|
|
706
703
|
return e === "/" ? e : e.replace(/^\/{1,}/, "");
|
|
707
704
|
}
|
|
708
705
|
function I(e) {
|
|
709
706
|
let t = e.length;
|
|
710
707
|
return t > 1 && e[t - 1] === "/" ? e.replace(/\/{1,}$/, "") : e;
|
|
711
708
|
}
|
|
712
|
-
function
|
|
713
|
-
return I(
|
|
709
|
+
function We(e) {
|
|
710
|
+
return I(Ue(e));
|
|
714
711
|
}
|
|
715
|
-
function
|
|
712
|
+
function Ge(e, t) {
|
|
716
713
|
return e?.endsWith("/") && e !== "/" && e !== `${t}/` ? e.slice(0, -1) : e;
|
|
717
714
|
}
|
|
718
|
-
function
|
|
719
|
-
return
|
|
715
|
+
function Ke(e, t, n) {
|
|
716
|
+
return Ge(e, n) === Ge(t, n);
|
|
720
717
|
}
|
|
721
|
-
function
|
|
718
|
+
function qe({ base: e, to: t, trailingSlash: n = "never", cache: r }) {
|
|
722
719
|
let i = t.startsWith("/"), a = !i && t === ".", o;
|
|
723
720
|
if (r) {
|
|
724
721
|
o = i ? t : a ? e : e + "\0" + t;
|
|
@@ -729,41 +726,26 @@ function Ve({ base: e, to: t, trailingSlash: n = "never", cache: r }) {
|
|
|
729
726
|
if (a) s = e.split("/");
|
|
730
727
|
else if (i) s = t.split("/");
|
|
731
728
|
else {
|
|
732
|
-
for (s = e.split("/"); s.length > 1 &&
|
|
729
|
+
for (s = e.split("/"); s.length > 1 && w(s) === "";) s.pop();
|
|
733
730
|
let n = t.split("/");
|
|
734
731
|
for (let e = 0, t = n.length; e < t; e++) {
|
|
735
732
|
let r = n[e];
|
|
736
733
|
r === "" ? e ? e === t - 1 && s.push(r) : s = [r] : r === ".." ? s.pop() : r === "." || s.push(r);
|
|
737
734
|
}
|
|
738
735
|
}
|
|
739
|
-
s.length > 1 && (
|
|
740
|
-
let c
|
|
741
|
-
|
|
742
|
-
e > 0 && (l += "/");
|
|
743
|
-
let t = s[e];
|
|
744
|
-
if (!t) continue;
|
|
745
|
-
c = ye(t, 0, c);
|
|
746
|
-
let n = c[0];
|
|
747
|
-
if (n === 0) {
|
|
748
|
-
l += t;
|
|
749
|
-
continue;
|
|
750
|
-
}
|
|
751
|
-
let r = c[5], i = t.substring(0, c[1]), a = t.substring(c[4], r), o = t.substring(c[2], c[3]);
|
|
752
|
-
n === 1 ? l += i || a ? `${i}{$${o}}${a}` : `$${o}` : n === 2 ? l += i || a ? `${i}{$}${a}` : "$" : l += `${i}{-$${o}}${a}`;
|
|
753
|
-
}
|
|
754
|
-
l = Ie(l);
|
|
755
|
-
let u = l || "/";
|
|
756
|
-
return o && r && r.set(o, u), u;
|
|
736
|
+
s.length > 1 && (w(s) === "" ? n === "never" && s.pop() : n === "always" && s.push(""));
|
|
737
|
+
let c = He(s.join("/")) || "/";
|
|
738
|
+
return o && r && r.set(o, c), c;
|
|
757
739
|
}
|
|
758
|
-
function
|
|
740
|
+
function Je(e) {
|
|
759
741
|
let t = new Map(e.map((e) => [encodeURIComponent(e), e])), n = Array.from(t.keys()).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), r = new RegExp(n, "g");
|
|
760
742
|
return (e) => e.replace(r, (e) => t.get(e) ?? e);
|
|
761
743
|
}
|
|
762
|
-
function
|
|
744
|
+
function Ye(e, t, n) {
|
|
763
745
|
let r = t[e];
|
|
764
|
-
return typeof r == "string" ? e === "_splat" ? /^[a-zA-Z0-9\-._~!/]*$/.test(r) ? r : r.split("/").map((e) =>
|
|
746
|
+
return typeof r == "string" ? e === "_splat" ? /^[a-zA-Z0-9\-._~!/]*$/.test(r) ? r : r.split("/").map((e) => Ze(e, n)).join("/") : Ze(r, n) : r;
|
|
765
747
|
}
|
|
766
|
-
function
|
|
748
|
+
function Xe({ path: e, params: t, decoder: n, ...r }) {
|
|
767
749
|
let i = !1, a = Object.create(null);
|
|
768
750
|
if (!e || e === "/") return {
|
|
769
751
|
interpolatedPath: "/",
|
|
@@ -778,7 +760,7 @@ function We({ path: e, params: t, decoder: n, ...r }) {
|
|
|
778
760
|
let o = e.length, s = 0, c, l = "";
|
|
779
761
|
for (; s < o;) {
|
|
780
762
|
let r = s;
|
|
781
|
-
c =
|
|
763
|
+
c = Se(e, r, c);
|
|
782
764
|
let o = c[5];
|
|
783
765
|
if (s = o + 1, r === o) continue;
|
|
784
766
|
let u = c[0];
|
|
@@ -794,14 +776,14 @@ function We({ path: e, params: t, decoder: n, ...r }) {
|
|
|
794
776
|
i = !0, (u || d) && (l += "/" + u + d);
|
|
795
777
|
continue;
|
|
796
778
|
}
|
|
797
|
-
let f =
|
|
779
|
+
let f = Ye("_splat", t, n);
|
|
798
780
|
l += "/" + u + f + d;
|
|
799
781
|
continue;
|
|
800
782
|
}
|
|
801
783
|
if (u === 1) {
|
|
802
784
|
let s = e.substring(c[2], c[3]);
|
|
803
785
|
!i && !(s in t) && (i = !0), a[s] = t[s];
|
|
804
|
-
let u = e.substring(r, c[1]), d = e.substring(c[4], o), f =
|
|
786
|
+
let u = e.substring(r, c[1]), d = e.substring(c[4], o), f = Ye(s, t, n) ?? "undefined";
|
|
805
787
|
l += "/" + u + f + d;
|
|
806
788
|
continue;
|
|
807
789
|
}
|
|
@@ -809,7 +791,7 @@ function We({ path: e, params: t, decoder: n, ...r }) {
|
|
|
809
791
|
let i = e.substring(c[2], c[3]), s = t[i];
|
|
810
792
|
if (s == null) continue;
|
|
811
793
|
a[i] = s;
|
|
812
|
-
let u = e.substring(r, c[1]), d = e.substring(c[4], o), f =
|
|
794
|
+
let u = e.substring(r, c[1]), d = e.substring(c[4], o), f = Ye(i, t, n) ?? "";
|
|
813
795
|
l += "/" + u + f + d;
|
|
814
796
|
continue;
|
|
815
797
|
}
|
|
@@ -820,69 +802,69 @@ function We({ path: e, params: t, decoder: n, ...r }) {
|
|
|
820
802
|
isMissingParams: i
|
|
821
803
|
};
|
|
822
804
|
}
|
|
823
|
-
function
|
|
805
|
+
function Ze(e, t) {
|
|
824
806
|
let n = encodeURIComponent(e);
|
|
825
807
|
return t?.(n) ?? n;
|
|
826
808
|
}
|
|
827
809
|
//#endregion
|
|
828
810
|
//#region ../router-core/dist/esm/not-found.js
|
|
829
|
-
function
|
|
811
|
+
function Qe(e = {}) {
|
|
830
812
|
if (e.isNotFound = !0, e.throw) throw e;
|
|
831
813
|
return e;
|
|
832
814
|
}
|
|
833
815
|
function L(e) {
|
|
834
|
-
return
|
|
816
|
+
return e?.isNotFound === !0;
|
|
835
817
|
}
|
|
836
818
|
//#endregion
|
|
837
819
|
//#region ../router-core/dist/esm/scroll-restoration.js
|
|
838
|
-
function
|
|
820
|
+
function $e() {
|
|
839
821
|
try {
|
|
840
822
|
return typeof window < "u" && typeof window.sessionStorage == "object" ? window.sessionStorage : void 0;
|
|
841
823
|
} catch {
|
|
842
824
|
return;
|
|
843
825
|
}
|
|
844
826
|
}
|
|
845
|
-
var
|
|
846
|
-
function
|
|
847
|
-
let e =
|
|
827
|
+
var et = "tsr-scroll-restoration-v1_3";
|
|
828
|
+
function tt() {
|
|
829
|
+
let e = $e();
|
|
848
830
|
if (!e) return null;
|
|
849
831
|
let t = {};
|
|
850
832
|
try {
|
|
851
833
|
let n = JSON.parse(e.getItem("tsr-scroll-restoration-v1_3") || "{}");
|
|
852
|
-
|
|
834
|
+
O(n) && (t = n);
|
|
853
835
|
} catch {}
|
|
854
836
|
return {
|
|
855
837
|
get state() {
|
|
856
838
|
return t;
|
|
857
839
|
},
|
|
858
840
|
set: (e) => {
|
|
859
|
-
t =
|
|
841
|
+
t = T(e, t) || t;
|
|
860
842
|
},
|
|
861
843
|
persist: () => {
|
|
862
844
|
try {
|
|
863
|
-
e.setItem(
|
|
845
|
+
e.setItem(et, JSON.stringify(t));
|
|
864
846
|
} catch {
|
|
865
847
|
process.env.NODE_ENV !== "production" && console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.");
|
|
866
848
|
}
|
|
867
849
|
}
|
|
868
850
|
};
|
|
869
851
|
}
|
|
870
|
-
var
|
|
871
|
-
function
|
|
852
|
+
var nt = tt(), rt = (e) => e.state.__TSR_key || e.href;
|
|
853
|
+
function it(e) {
|
|
872
854
|
let t = [], n;
|
|
873
855
|
for (; n = e.parentNode;) t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children, e) + 1})`), e = n;
|
|
874
856
|
return `${t.reverse().join(" > ")}`.toLowerCase();
|
|
875
857
|
}
|
|
876
|
-
var
|
|
877
|
-
function
|
|
878
|
-
if (!
|
|
879
|
-
let n =
|
|
858
|
+
var at = !1, R = "window", ot = "data-scroll-restoration-id";
|
|
859
|
+
function st(e, t) {
|
|
860
|
+
if (!nt) return;
|
|
861
|
+
let n = nt;
|
|
880
862
|
if ((t ?? e.options.scrollRestoration ?? !1) && (e.isScrollRestoring = !0), e.isScrollRestorationSetup || !n) return;
|
|
881
|
-
e.isScrollRestorationSetup = !0,
|
|
882
|
-
let r = e.options.getScrollRestorationKey ||
|
|
863
|
+
e.isScrollRestorationSetup = !0, at = !1;
|
|
864
|
+
let r = e.options.getScrollRestorationKey || rt, i = /* @__PURE__ */ new Map();
|
|
883
865
|
window.history.scrollRestoration = "manual";
|
|
884
866
|
let a = (t) => {
|
|
885
|
-
if (!(
|
|
867
|
+
if (!(at || !e.isScrollRestoring)) if (t.target === document || t.target === window) i.set(R, {
|
|
886
868
|
scrollX: window.scrollX || 0,
|
|
887
869
|
scrollY: window.scrollY || 0
|
|
888
870
|
});
|
|
@@ -898,10 +880,10 @@ function nt(e, t) {
|
|
|
898
880
|
let r = n.state[t] ||= {};
|
|
899
881
|
for (let [e, t] of i) {
|
|
900
882
|
let n;
|
|
901
|
-
if (e ===
|
|
883
|
+
if (e === R) n = R;
|
|
902
884
|
else if (e.isConnected) {
|
|
903
|
-
let t = e.getAttribute(
|
|
904
|
-
n = t ? `[${
|
|
885
|
+
let t = e.getAttribute(ot);
|
|
886
|
+
n = t ? `[${ot}="${t}"]` : it(e);
|
|
905
887
|
}
|
|
906
888
|
n && (r[n] = t);
|
|
907
889
|
}
|
|
@@ -909,7 +891,7 @@ function nt(e, t) {
|
|
|
909
891
|
document.addEventListener("scroll", a, !0), e.subscribe("onBeforeLoad", (e) => {
|
|
910
892
|
o(e.fromLocation ? r(e.fromLocation) : void 0), i.clear();
|
|
911
893
|
}), window.addEventListener("pagehide", () => {
|
|
912
|
-
o(r(e.stores.resolvedLocation.
|
|
894
|
+
o(r(e.stores.resolvedLocation.get() ?? e.stores.location.get())), n.persist();
|
|
913
895
|
}), e.subscribe("onRendered", (t) => {
|
|
914
896
|
let a = r(t.toLocation), o = e.options.scrollRestorationBehavior, s = e.options.scrollToTopSelectors;
|
|
915
897
|
if (i.clear(), !e.resetNextScroll) {
|
|
@@ -917,15 +899,15 @@ function nt(e, t) {
|
|
|
917
899
|
return;
|
|
918
900
|
}
|
|
919
901
|
if (!(typeof e.options.scrollRestoration == "function" && !e.options.scrollRestoration({ location: e.latestLocation }))) {
|
|
920
|
-
|
|
902
|
+
at = !0;
|
|
921
903
|
try {
|
|
922
904
|
let t = e.isScrollRestoring ? n.state[a] : void 0, r = !1;
|
|
923
905
|
if (t) for (let e in t) {
|
|
924
906
|
let n = t[e];
|
|
925
|
-
if (!
|
|
907
|
+
if (!O(n)) continue;
|
|
926
908
|
let { scrollX: i, scrollY: a } = n;
|
|
927
909
|
if (!(!Number.isFinite(i) || !Number.isFinite(a))) {
|
|
928
|
-
if (e ===
|
|
910
|
+
if (e === R) window.scrollTo({
|
|
929
911
|
top: a,
|
|
930
912
|
left: i,
|
|
931
913
|
behavior: o
|
|
@@ -956,14 +938,14 @@ function nt(e, t) {
|
|
|
956
938
|
behavior: o
|
|
957
939
|
};
|
|
958
940
|
if (window.scrollTo(e), s) for (let t of s) {
|
|
959
|
-
if (t ===
|
|
941
|
+
if (t === R) continue;
|
|
960
942
|
let n = typeof t == "function" ? t() : document.querySelector(t);
|
|
961
943
|
n && n.scrollTo(e);
|
|
962
944
|
}
|
|
963
945
|
}
|
|
964
946
|
}
|
|
965
947
|
} finally {
|
|
966
|
-
|
|
948
|
+
at = !1;
|
|
967
949
|
}
|
|
968
950
|
e.isScrollRestoring && n.set((e) => (e[a] ||= {}, e));
|
|
969
951
|
}
|
|
@@ -971,7 +953,7 @@ function nt(e, t) {
|
|
|
971
953
|
}
|
|
972
954
|
//#endregion
|
|
973
955
|
//#region ../router-core/dist/esm/qss.js
|
|
974
|
-
function
|
|
956
|
+
function ct(e, t = String) {
|
|
975
957
|
let n = new URLSearchParams();
|
|
976
958
|
for (let r in e) {
|
|
977
959
|
let i = e[r];
|
|
@@ -979,24 +961,24 @@ function rt(e, t = String) {
|
|
|
979
961
|
}
|
|
980
962
|
return n.toString();
|
|
981
963
|
}
|
|
982
|
-
function
|
|
964
|
+
function lt(e) {
|
|
983
965
|
return e ? e === "false" ? !1 : e === "true" ? !0 : e * 0 == 0 && +e + "" === e ? +e : e : "";
|
|
984
966
|
}
|
|
985
|
-
function
|
|
967
|
+
function ut(e) {
|
|
986
968
|
let t = new URLSearchParams(e), n = Object.create(null);
|
|
987
969
|
for (let [e, r] of t.entries()) {
|
|
988
970
|
let t = n[e];
|
|
989
|
-
t == null ? n[e] =
|
|
971
|
+
t == null ? n[e] = lt(r) : Array.isArray(t) ? t.push(lt(r)) : n[e] = [t, lt(r)];
|
|
990
972
|
}
|
|
991
973
|
return n;
|
|
992
974
|
}
|
|
993
975
|
//#endregion
|
|
994
976
|
//#region ../router-core/dist/esm/searchParams.js
|
|
995
|
-
var
|
|
996
|
-
function
|
|
977
|
+
var dt = pt(JSON.parse), ft = mt(JSON.stringify, JSON.parse);
|
|
978
|
+
function pt(e) {
|
|
997
979
|
return (t) => {
|
|
998
980
|
t[0] === "?" && (t = t.substring(1));
|
|
999
|
-
let n =
|
|
981
|
+
let n = ut(t);
|
|
1000
982
|
for (let t in n) {
|
|
1001
983
|
let r = n[t];
|
|
1002
984
|
if (typeof r == "string") try {
|
|
@@ -1006,7 +988,7 @@ function ct(e) {
|
|
|
1006
988
|
return n;
|
|
1007
989
|
};
|
|
1008
990
|
}
|
|
1009
|
-
function
|
|
991
|
+
function mt(e, t) {
|
|
1010
992
|
let n = typeof t == "function";
|
|
1011
993
|
function r(r) {
|
|
1012
994
|
if (typeof r == "object" && r) try {
|
|
@@ -1018,16 +1000,16 @@ function lt(e, t) {
|
|
|
1018
1000
|
return r;
|
|
1019
1001
|
}
|
|
1020
1002
|
return (e) => {
|
|
1021
|
-
let t =
|
|
1003
|
+
let t = ct(e, r);
|
|
1022
1004
|
return t ? `?${t}` : "";
|
|
1023
1005
|
};
|
|
1024
1006
|
}
|
|
1025
1007
|
//#endregion
|
|
1026
1008
|
//#region ../router-core/dist/esm/root.js
|
|
1027
|
-
var
|
|
1009
|
+
var z = "__root__";
|
|
1028
1010
|
//#endregion
|
|
1029
1011
|
//#region ../router-core/dist/esm/redirect.js
|
|
1030
|
-
function
|
|
1012
|
+
function ht(e) {
|
|
1031
1013
|
if (e.statusCode = e.statusCode || e.code || 307, !e._builtLocation && !e.reloadDocument && typeof e.href == "string") try {
|
|
1032
1014
|
new URL(e.href), e.reloadDocument = !0;
|
|
1033
1015
|
} catch {}
|
|
@@ -1040,38 +1022,38 @@ function ut(e) {
|
|
|
1040
1022
|
if (n.options = e, e.throw) throw n;
|
|
1041
1023
|
return n;
|
|
1042
1024
|
}
|
|
1043
|
-
function
|
|
1025
|
+
function B(e) {
|
|
1044
1026
|
return e instanceof Response && !!e.options;
|
|
1045
1027
|
}
|
|
1046
1028
|
//#endregion
|
|
1047
1029
|
//#region ../router-core/dist/esm/rewrite.js
|
|
1048
|
-
function
|
|
1030
|
+
function gt(e) {
|
|
1049
1031
|
return {
|
|
1050
1032
|
input: ({ url: t }) => {
|
|
1051
|
-
for (let n of e) t =
|
|
1033
|
+
for (let n of e) t = vt(n, t);
|
|
1052
1034
|
return t;
|
|
1053
1035
|
},
|
|
1054
1036
|
output: ({ url: t }) => {
|
|
1055
|
-
for (let n = e.length - 1; n >= 0; n--) t =
|
|
1037
|
+
for (let n = e.length - 1; n >= 0; n--) t = yt(e[n], t);
|
|
1056
1038
|
return t;
|
|
1057
1039
|
}
|
|
1058
1040
|
};
|
|
1059
1041
|
}
|
|
1060
|
-
function
|
|
1061
|
-
let t =
|
|
1042
|
+
function _t(e) {
|
|
1043
|
+
let t = We(e.basepath), n = `/${t}`, r = `${n}/`, i = e.caseSensitive ? n : n.toLowerCase(), a = e.caseSensitive ? r : r.toLowerCase();
|
|
1062
1044
|
return {
|
|
1063
1045
|
input: ({ url: t }) => {
|
|
1064
1046
|
let r = e.caseSensitive ? t.pathname : t.pathname.toLowerCase();
|
|
1065
1047
|
return r === i ? t.pathname = "/" : r.startsWith(a) && (t.pathname = t.pathname.slice(n.length)), t;
|
|
1066
1048
|
},
|
|
1067
|
-
output: ({ url: e }) => (e.pathname =
|
|
1049
|
+
output: ({ url: e }) => (e.pathname = Ve([
|
|
1068
1050
|
"/",
|
|
1069
1051
|
t,
|
|
1070
1052
|
e.pathname
|
|
1071
1053
|
]), e)
|
|
1072
1054
|
};
|
|
1073
1055
|
}
|
|
1074
|
-
function
|
|
1056
|
+
function vt(e, t) {
|
|
1075
1057
|
let n = e?.input?.({ url: t });
|
|
1076
1058
|
if (n) {
|
|
1077
1059
|
if (typeof n == "string") return new URL(n);
|
|
@@ -1079,7 +1061,7 @@ function pt(e, t) {
|
|
|
1079
1061
|
}
|
|
1080
1062
|
return t;
|
|
1081
1063
|
}
|
|
1082
|
-
function
|
|
1064
|
+
function yt(e, t) {
|
|
1083
1065
|
let n = e?.output?.({ url: t });
|
|
1084
1066
|
if (n) {
|
|
1085
1067
|
if (typeof n == "string") return new URL(n);
|
|
@@ -1087,33 +1069,33 @@ function mt(e, t) {
|
|
|
1087
1069
|
}
|
|
1088
1070
|
return t;
|
|
1089
1071
|
}
|
|
1090
|
-
function
|
|
1091
|
-
let { createMutableStore: n, createReadonlyStore: r, batch: i, init: a } = t, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = n(e.status), u = n(e.loadedAt), d = n(e.isLoading), f = n(e.isTransitioning), p = n(e.location), m = n(e.resolvedLocation), h = n(e.statusCode), g = n(e.redirect), _ = n([]), v = n([]), y = n([]), b = r(() =>
|
|
1092
|
-
locationHref: p.
|
|
1093
|
-
resolvedLocationHref: m.
|
|
1094
|
-
status: l.
|
|
1095
|
-
})),
|
|
1096
|
-
status: l.
|
|
1097
|
-
loadedAt: u.
|
|
1098
|
-
isLoading: d.
|
|
1099
|
-
isTransitioning: f.
|
|
1100
|
-
matches: b.
|
|
1101
|
-
location: p.
|
|
1102
|
-
resolvedLocation: m.
|
|
1103
|
-
statusCode: h.
|
|
1104
|
-
redirect: g.
|
|
1105
|
-
})),
|
|
1106
|
-
function
|
|
1107
|
-
let t =
|
|
1072
|
+
function bt(e, t) {
|
|
1073
|
+
let { createMutableStore: n, createReadonlyStore: r, batch: i, init: a } = t, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = n(e.status), u = n(e.loadedAt), d = n(e.isLoading), f = n(e.isTransitioning), p = n(e.location), m = n(e.resolvedLocation), h = n(e.statusCode), g = n(e.redirect), _ = n([]), v = n([]), y = n([]), b = r(() => xt(o, _.get())), x = r(() => xt(s, v.get())), S = r(() => xt(c, y.get())), C = r(() => _.get()[0]), w = r(() => _.get().some((e) => o.get(e)?.get().status === "pending")), ee = r(() => ({
|
|
1074
|
+
locationHref: p.get().href,
|
|
1075
|
+
resolvedLocationHref: m.get()?.href,
|
|
1076
|
+
status: l.get()
|
|
1077
|
+
})), T = r(() => ({
|
|
1078
|
+
status: l.get(),
|
|
1079
|
+
loadedAt: u.get(),
|
|
1080
|
+
isLoading: d.get(),
|
|
1081
|
+
isTransitioning: f.get(),
|
|
1082
|
+
matches: b.get(),
|
|
1083
|
+
location: p.get(),
|
|
1084
|
+
resolvedLocation: m.get(),
|
|
1085
|
+
statusCode: h.get(),
|
|
1086
|
+
redirect: g.get()
|
|
1087
|
+
})), te = M(64);
|
|
1088
|
+
function ne(e) {
|
|
1089
|
+
let t = te.get(e);
|
|
1108
1090
|
return t || (t = r(() => {
|
|
1109
|
-
let t = _.
|
|
1091
|
+
let t = _.get();
|
|
1110
1092
|
for (let n of t) {
|
|
1111
1093
|
let t = o.get(n);
|
|
1112
|
-
if (t && t.routeId === e) return t.
|
|
1094
|
+
if (t && t.routeId === e) return t.get();
|
|
1113
1095
|
}
|
|
1114
|
-
}),
|
|
1096
|
+
}), te.set(e, t)), t;
|
|
1115
1097
|
}
|
|
1116
|
-
let
|
|
1098
|
+
let re = {
|
|
1117
1099
|
status: l,
|
|
1118
1100
|
loadedAt: u,
|
|
1119
1101
|
isLoading: d,
|
|
@@ -1123,44 +1105,44 @@ function ht(e, t) {
|
|
|
1123
1105
|
statusCode: h,
|
|
1124
1106
|
redirect: g,
|
|
1125
1107
|
matchesId: _,
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
__store:
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1108
|
+
pendingIds: v,
|
|
1109
|
+
cachedIds: y,
|
|
1110
|
+
matches: b,
|
|
1111
|
+
pendingMatches: x,
|
|
1112
|
+
cachedMatches: S,
|
|
1113
|
+
firstId: C,
|
|
1114
|
+
hasPending: w,
|
|
1115
|
+
matchRouteDeps: ee,
|
|
1116
|
+
matchStores: o,
|
|
1117
|
+
pendingMatchStores: s,
|
|
1118
|
+
cachedMatchStores: c,
|
|
1119
|
+
__store: T,
|
|
1120
|
+
getRouteMatchStore: ne,
|
|
1121
|
+
setMatches: ie,
|
|
1122
|
+
setPending: E,
|
|
1123
|
+
setCached: D
|
|
1142
1124
|
};
|
|
1143
|
-
|
|
1144
|
-
function
|
|
1145
|
-
|
|
1125
|
+
ie(e.matches), a?.(re);
|
|
1126
|
+
function ie(e) {
|
|
1127
|
+
St(e, o, _, n, i);
|
|
1146
1128
|
}
|
|
1147
|
-
function
|
|
1148
|
-
|
|
1129
|
+
function E(e) {
|
|
1130
|
+
St(e, s, v, n, i);
|
|
1149
1131
|
}
|
|
1150
|
-
function
|
|
1151
|
-
|
|
1132
|
+
function D(e) {
|
|
1133
|
+
St(e, c, y, n, i);
|
|
1152
1134
|
}
|
|
1153
|
-
return
|
|
1135
|
+
return re;
|
|
1154
1136
|
}
|
|
1155
|
-
function
|
|
1137
|
+
function xt(e, t) {
|
|
1156
1138
|
let n = [];
|
|
1157
1139
|
for (let r of t) {
|
|
1158
1140
|
let t = e.get(r);
|
|
1159
|
-
t && n.push(t.
|
|
1141
|
+
t && n.push(t.get());
|
|
1160
1142
|
}
|
|
1161
1143
|
return n;
|
|
1162
1144
|
}
|
|
1163
|
-
function
|
|
1145
|
+
function St(e, t, n, r, i) {
|
|
1164
1146
|
let a = e.map((e) => e.id), o = new Set(a);
|
|
1165
1147
|
i(() => {
|
|
1166
1148
|
for (let e of t.keys()) o.has(e) || t.delete(e);
|
|
@@ -1171,16 +1153,16 @@ function _t(e, t, n, r, i) {
|
|
|
1171
1153
|
e.routeId = n.routeId, t.set(n.id, e);
|
|
1172
1154
|
continue;
|
|
1173
1155
|
}
|
|
1174
|
-
e.routeId = n.routeId, e.
|
|
1156
|
+
e.routeId = n.routeId, e.get() !== n && e.set(n);
|
|
1175
1157
|
}
|
|
1176
|
-
|
|
1158
|
+
ve(n.get(), a) || n.set(a);
|
|
1177
1159
|
});
|
|
1178
1160
|
}
|
|
1179
1161
|
//#endregion
|
|
1180
1162
|
//#region ../router-core/dist/esm/load-matches.js
|
|
1181
|
-
var
|
|
1163
|
+
var Ct = (e) => {
|
|
1182
1164
|
if (!e.rendered) return e.rendered = !0, e.onReady?.();
|
|
1183
|
-
},
|
|
1165
|
+
}, wt = (e) => e.stores.matchesId.get().some((t) => e.stores.matchStores.get(t)?.get()._forcePending), Tt = (e, t) => !!(e.preload && !e.router.stores.matchStores.has(t)), V = (e, t, n = !0) => {
|
|
1184
1166
|
let r = { ...e.router.options.context ?? {} }, i = n ? t : t - 1;
|
|
1185
1167
|
for (let t = 0; t <= i; t++) {
|
|
1186
1168
|
let n = e.matches[t];
|
|
@@ -1189,7 +1171,7 @@ var vt = (e) => {
|
|
|
1189
1171
|
i && Object.assign(r, i.__routeContext, i.__beforeLoadContext);
|
|
1190
1172
|
}
|
|
1191
1173
|
return r;
|
|
1192
|
-
},
|
|
1174
|
+
}, Et = (e, t) => {
|
|
1193
1175
|
if (!e.matches.length) return;
|
|
1194
1176
|
let n = t.routeId, r = e.matches.findIndex((t) => t.routeId === e.router.routeTree.id), i = r >= 0 ? r : 0, a = n ? e.matches.findIndex((e) => e.routeId === n) : e.firstBadMatchIndex ?? e.matches.length - 1;
|
|
1195
1177
|
a < 0 && (a = i);
|
|
@@ -1198,31 +1180,31 @@ var vt = (e) => {
|
|
|
1198
1180
|
if (e.router.looseRoutesById[n.routeId].options.notFoundComponent) return t;
|
|
1199
1181
|
}
|
|
1200
1182
|
return n ? a : i;
|
|
1201
|
-
},
|
|
1202
|
-
if (!(!
|
|
1183
|
+
}, H = (e, t, n) => {
|
|
1184
|
+
if (!(!B(n) && !L(n))) throw B(n) && n.redirectHandled && !n.options.reloadDocument ? n : (t && (t._nonReactive.beforeLoadPromise?.resolve(), t._nonReactive.loaderPromise?.resolve(), t._nonReactive.beforeLoadPromise = void 0, t._nonReactive.loaderPromise = void 0, t._nonReactive.error = n, e.updateMatch(t.id, (r) => ({
|
|
1203
1185
|
...r,
|
|
1204
|
-
status:
|
|
1205
|
-
context:
|
|
1186
|
+
status: B(n) ? "redirected" : L(n) ? "notFound" : r.status === "pending" ? "success" : r.status,
|
|
1187
|
+
context: V(e, t.index),
|
|
1206
1188
|
isFetching: !1,
|
|
1207
1189
|
error: n
|
|
1208
|
-
})), L(n) && !n.routeId && (n.routeId = t.routeId), t._nonReactive.loadPromise?.resolve()),
|
|
1209
|
-
},
|
|
1190
|
+
})), L(n) && !n.routeId && (n.routeId = t.routeId), t._nonReactive.loadPromise?.resolve()), B(n) && (e.rendered = !0, n.options._fromLocation = e.location, n.redirectHandled = !0, n = e.router.resolveRedirect(n)), n);
|
|
1191
|
+
}, Dt = (e, t) => {
|
|
1210
1192
|
let n = e.router.getMatch(t);
|
|
1211
1193
|
return !!(!n || n._nonReactive.dehydrated);
|
|
1212
|
-
},
|
|
1213
|
-
let r =
|
|
1194
|
+
}, Ot = (e, t, n) => {
|
|
1195
|
+
let r = V(e, n);
|
|
1214
1196
|
e.updateMatch(t, (e) => ({
|
|
1215
1197
|
...e,
|
|
1216
1198
|
context: r
|
|
1217
1199
|
}));
|
|
1218
|
-
},
|
|
1200
|
+
}, U = (e, t, n, r) => {
|
|
1219
1201
|
let { id: i, routeId: a } = e.matches[t], o = e.router.looseRoutesById[a];
|
|
1220
1202
|
if (n instanceof Promise) throw n;
|
|
1221
|
-
n.routerCode = r, e.firstBadMatchIndex ??= t,
|
|
1203
|
+
n.routerCode = r, e.firstBadMatchIndex ??= t, H(e, e.router.getMatch(i), n);
|
|
1222
1204
|
try {
|
|
1223
1205
|
o.options.onError?.(n);
|
|
1224
1206
|
} catch (t) {
|
|
1225
|
-
n = t,
|
|
1207
|
+
n = t, H(e, e.router.getMatch(i), n);
|
|
1226
1208
|
}
|
|
1227
1209
|
e.updateMatch(i, (e) => (e._nonReactive.beforeLoadPromise?.resolve(), e._nonReactive.beforeLoadPromise = void 0, e._nonReactive.loadPromise?.resolve(), {
|
|
1228
1210
|
...e,
|
|
@@ -1231,32 +1213,32 @@ var vt = (e) => {
|
|
|
1231
1213
|
isFetching: !1,
|
|
1232
1214
|
updatedAt: Date.now(),
|
|
1233
1215
|
abortController: new AbortController()
|
|
1234
|
-
})), !e.preload && !
|
|
1235
|
-
},
|
|
1216
|
+
})), !e.preload && !B(n) && !L(n) && (e.serialError ??= n);
|
|
1217
|
+
}, kt = (e, t, n, r) => {
|
|
1236
1218
|
if (r._nonReactive.pendingTimeout !== void 0) return;
|
|
1237
1219
|
let i = n.options.pendingMs ?? e.router.options.defaultPendingMs;
|
|
1238
|
-
if (e.onReady && !
|
|
1220
|
+
if (e.onReady && !Tt(e, t) && (n.options.loader || n.options.beforeLoad || Bt(n)) && typeof i == "number" && i !== Infinity && (n.options.pendingComponent ?? e.router.options?.defaultPendingComponent)) {
|
|
1239
1221
|
let t = setTimeout(() => {
|
|
1240
|
-
|
|
1222
|
+
Ct(e);
|
|
1241
1223
|
}, i);
|
|
1242
1224
|
r._nonReactive.pendingTimeout = t;
|
|
1243
1225
|
}
|
|
1244
|
-
},
|
|
1226
|
+
}, At = (e, t, n) => {
|
|
1245
1227
|
let r = e.router.getMatch(t);
|
|
1246
1228
|
if (!r._nonReactive.beforeLoadPromise && !r._nonReactive.loaderPromise) return;
|
|
1247
|
-
|
|
1229
|
+
kt(e, t, n, r);
|
|
1248
1230
|
let i = () => {
|
|
1249
1231
|
let n = e.router.getMatch(t);
|
|
1250
|
-
n.preload && (n.status === "redirected" || n.status === "notFound") &&
|
|
1232
|
+
n.preload && (n.status === "redirected" || n.status === "notFound") && H(e, n, n.error);
|
|
1251
1233
|
};
|
|
1252
1234
|
return r._nonReactive.beforeLoadPromise ? r._nonReactive.beforeLoadPromise.then(i) : i();
|
|
1253
|
-
},
|
|
1235
|
+
}, jt = (e, t, n, r) => {
|
|
1254
1236
|
let i = e.router.getMatch(t), a = i._nonReactive.loadPromise;
|
|
1255
|
-
i._nonReactive.loadPromise =
|
|
1237
|
+
i._nonReactive.loadPromise = A(() => {
|
|
1256
1238
|
a?.resolve(), a = void 0;
|
|
1257
1239
|
});
|
|
1258
1240
|
let { paramsError: o, searchError: s } = i;
|
|
1259
|
-
o &&
|
|
1241
|
+
o && U(e, n, o, "PARSE_PARAMS"), s && U(e, n, s, "VALIDATE_SEARCH"), kt(e, t, r, i);
|
|
1260
1242
|
let c = new AbortController(), l = !1, u = () => {
|
|
1261
1243
|
l || (l = !0, e.updateMatch(t, (e) => ({
|
|
1262
1244
|
...e,
|
|
@@ -1276,11 +1258,11 @@ var vt = (e) => {
|
|
|
1276
1258
|
});
|
|
1277
1259
|
return;
|
|
1278
1260
|
}
|
|
1279
|
-
i._nonReactive.beforeLoadPromise =
|
|
1261
|
+
i._nonReactive.beforeLoadPromise = A();
|
|
1280
1262
|
let f = {
|
|
1281
|
-
...
|
|
1263
|
+
...V(e, n, !1),
|
|
1282
1264
|
...i.__routeContext
|
|
1283
|
-
}, { search: p, params: m, cause: h } = i, g =
|
|
1265
|
+
}, { search: p, params: m, cause: h } = i, g = Tt(e, t), _ = {
|
|
1284
1266
|
search: p,
|
|
1285
1267
|
abortController: c,
|
|
1286
1268
|
params: m,
|
|
@@ -1303,7 +1285,7 @@ var vt = (e) => {
|
|
|
1303
1285
|
});
|
|
1304
1286
|
return;
|
|
1305
1287
|
}
|
|
1306
|
-
(
|
|
1288
|
+
(B(r) || L(r)) && (u(), U(e, n, r, "BEFORE_LOAD")), e.router.batch(() => {
|
|
1307
1289
|
u(), e.updateMatch(t, (e) => ({
|
|
1308
1290
|
...e,
|
|
1309
1291
|
__beforeLoadContext: r
|
|
@@ -1311,21 +1293,21 @@ var vt = (e) => {
|
|
|
1311
1293
|
});
|
|
1312
1294
|
}, y;
|
|
1313
1295
|
try {
|
|
1314
|
-
if (y = r.options.beforeLoad(_),
|
|
1315
|
-
|
|
1296
|
+
if (y = r.options.beforeLoad(_), ce(y)) return u(), y.catch((t) => {
|
|
1297
|
+
U(e, n, t, "BEFORE_LOAD");
|
|
1316
1298
|
}).then(v);
|
|
1317
1299
|
} catch (t) {
|
|
1318
|
-
u(),
|
|
1300
|
+
u(), U(e, n, t, "BEFORE_LOAD");
|
|
1319
1301
|
}
|
|
1320
1302
|
v(y);
|
|
1321
|
-
},
|
|
1322
|
-
let { id: n, routeId: r } = e.matches[t], i = e.router.looseRoutesById[r], a = () => s(), o = () =>
|
|
1323
|
-
if (
|
|
1324
|
-
let t =
|
|
1325
|
-
return
|
|
1303
|
+
}, Mt = (e, t) => {
|
|
1304
|
+
let { id: n, routeId: r } = e.matches[t], i = e.router.looseRoutesById[r], a = () => s(), o = () => jt(e, n, t, i), s = () => {
|
|
1305
|
+
if (Dt(e, n)) return;
|
|
1306
|
+
let t = At(e, n, i);
|
|
1307
|
+
return ce(t) ? t.then(o) : o();
|
|
1326
1308
|
};
|
|
1327
1309
|
return a();
|
|
1328
|
-
},
|
|
1310
|
+
}, Nt = (e, t, n) => {
|
|
1329
1311
|
let r = e.router.getMatch(t);
|
|
1330
1312
|
if (!r || !n.options.head && !n.options.scripts && !n.options.headers) return;
|
|
1331
1313
|
let i = {
|
|
@@ -1347,8 +1329,8 @@ var vt = (e) => {
|
|
|
1347
1329
|
scripts: t,
|
|
1348
1330
|
styles: e?.styles
|
|
1349
1331
|
}));
|
|
1350
|
-
},
|
|
1351
|
-
let a = t[r - 1], { params: o, loaderDeps: s, abortController: c, cause: l } = e.router.getMatch(n), u =
|
|
1332
|
+
}, Pt = (e, t, n, r, i) => {
|
|
1333
|
+
let a = t[r - 1], { params: o, loaderDeps: s, abortController: c, cause: l } = e.router.getMatch(n), u = V(e, r), d = Tt(e, n);
|
|
1352
1334
|
return {
|
|
1353
1335
|
params: o,
|
|
1354
1336
|
deps: s,
|
|
@@ -1365,18 +1347,18 @@ var vt = (e) => {
|
|
|
1365
1347
|
route: i,
|
|
1366
1348
|
...e.router.options.additionalContext
|
|
1367
1349
|
};
|
|
1368
|
-
},
|
|
1350
|
+
}, Ft = async (e, t, n, r, i) => {
|
|
1369
1351
|
try {
|
|
1370
1352
|
let a = e.router.getMatch(n);
|
|
1371
1353
|
try {
|
|
1372
|
-
|
|
1373
|
-
let o = i.options.loader, s = typeof o == "function" ? o : o?.handler, c = s?.(
|
|
1354
|
+
zt(i);
|
|
1355
|
+
let o = i.options.loader, s = typeof o == "function" ? o : o?.handler, c = s?.(Pt(e, t, n, r, i)), l = !!s && ce(c);
|
|
1374
1356
|
if ((l || i._lazyPromise || i._componentsPromise || i.options.head || i.options.scripts || i.options.headers || a._nonReactive.minPendingPromise) && e.updateMatch(n, (e) => ({
|
|
1375
1357
|
...e,
|
|
1376
1358
|
isFetching: "loader"
|
|
1377
1359
|
})), s) {
|
|
1378
1360
|
let t = l ? await c : c;
|
|
1379
|
-
|
|
1361
|
+
H(e, e.router.getMatch(n), t), t !== void 0 && e.updateMatch(n, (e) => ({
|
|
1380
1362
|
...e,
|
|
1381
1363
|
loaderData: t
|
|
1382
1364
|
}));
|
|
@@ -1386,7 +1368,7 @@ var vt = (e) => {
|
|
|
1386
1368
|
u && await u, i._componentsPromise && await i._componentsPromise, e.updateMatch(n, (t) => ({
|
|
1387
1369
|
...t,
|
|
1388
1370
|
error: void 0,
|
|
1389
|
-
context:
|
|
1371
|
+
context: V(e, r),
|
|
1390
1372
|
status: "success",
|
|
1391
1373
|
isFetching: !1,
|
|
1392
1374
|
updatedAt: Date.now()
|
|
@@ -1402,56 +1384,56 @@ var vt = (e) => {
|
|
|
1402
1384
|
...t,
|
|
1403
1385
|
status: t.status === "pending" ? "success" : t.status,
|
|
1404
1386
|
isFetching: !1,
|
|
1405
|
-
context:
|
|
1387
|
+
context: V(e, r)
|
|
1406
1388
|
}));
|
|
1407
1389
|
return;
|
|
1408
1390
|
}
|
|
1409
1391
|
let s = a._nonReactive.minPendingPromise;
|
|
1410
|
-
s && await s, L(t) && await i.options.notFoundComponent?.preload?.(),
|
|
1392
|
+
s && await s, L(t) && await i.options.notFoundComponent?.preload?.(), H(e, e.router.getMatch(n), t);
|
|
1411
1393
|
try {
|
|
1412
1394
|
i.options.onError?.(t);
|
|
1413
1395
|
} catch (t) {
|
|
1414
|
-
o = t,
|
|
1396
|
+
o = t, H(e, e.router.getMatch(n), t);
|
|
1415
1397
|
}
|
|
1416
|
-
!
|
|
1398
|
+
!B(o) && !L(o) && await zt(i, ["errorComponent"]), e.updateMatch(n, (t) => ({
|
|
1417
1399
|
...t,
|
|
1418
1400
|
error: o,
|
|
1419
|
-
context:
|
|
1401
|
+
context: V(e, r),
|
|
1420
1402
|
status: "error",
|
|
1421
1403
|
isFetching: !1
|
|
1422
1404
|
}));
|
|
1423
1405
|
}
|
|
1424
1406
|
} catch (t) {
|
|
1425
1407
|
let r = e.router.getMatch(n);
|
|
1426
|
-
r && (r._nonReactive.loaderPromise = void 0),
|
|
1408
|
+
r && (r._nonReactive.loaderPromise = void 0), H(e, r, t);
|
|
1427
1409
|
}
|
|
1428
|
-
},
|
|
1410
|
+
}, It = async (e, t, n) => {
|
|
1429
1411
|
async function r(r, a, c, l, d) {
|
|
1430
|
-
let f = Date.now() - a.updatedAt, p = r ? d.options.preloadStaleTime ?? e.router.options.defaultPreloadStaleTime ?? 3e4 : d.options.staleTime ?? e.router.options.defaultStaleTime ?? 0, m = d.options.shouldReload, h = typeof m == "function" ? m(
|
|
1412
|
+
let f = Date.now() - a.updatedAt, p = r ? d.options.preloadStaleTime ?? e.router.options.defaultPreloadStaleTime ?? 3e4 : d.options.staleTime ?? e.router.options.defaultStaleTime ?? 0, m = d.options.shouldReload, h = typeof m == "function" ? m(Pt(e, t, i, n, d)) : m, { status: g, invalid: _ } = l, v = f >= p && (!!e.forceStaleReload || l.cause === "enter" || c !== void 0 && c !== l.id);
|
|
1431
1413
|
o = g === "success" && (_ || (h ?? v)), r && d.options.preload === !1 || (o && !e.sync && u ? (s = !0, (async () => {
|
|
1432
1414
|
try {
|
|
1433
|
-
await
|
|
1415
|
+
await Ft(e, t, i, n, d);
|
|
1434
1416
|
let r = e.router.getMatch(i);
|
|
1435
1417
|
r._nonReactive.loaderPromise?.resolve(), r._nonReactive.loadPromise?.resolve(), r._nonReactive.loaderPromise = void 0, r._nonReactive.loadPromise = void 0;
|
|
1436
1418
|
} catch (t) {
|
|
1437
|
-
|
|
1419
|
+
B(t) && await e.router.navigate(t.options);
|
|
1438
1420
|
}
|
|
1439
|
-
})()) : g !== "success" || o ? await
|
|
1421
|
+
})()) : g !== "success" || o ? await Ft(e, t, i, n, d) : Ot(e, i, n));
|
|
1440
1422
|
}
|
|
1441
1423
|
let { id: i, routeId: a } = e.matches[n], o = !1, s = !1, c = e.router.looseRoutesById[a], l = c.options.loader, u = ((typeof l == "function" ? void 0 : l?.staleReloadMode) ?? e.router.options.defaultStaleReloadMode) !== "blocking";
|
|
1442
|
-
if (
|
|
1424
|
+
if (Dt(e, i)) {
|
|
1443
1425
|
if (!e.router.getMatch(i)) return e.matches[n];
|
|
1444
|
-
|
|
1426
|
+
Ot(e, i, n);
|
|
1445
1427
|
} else {
|
|
1446
|
-
let t = e.router.getMatch(i), o = e.router.stores.matchesId.
|
|
1428
|
+
let t = e.router.getMatch(i), o = e.router.stores.matchesId.get()[n], s = (o && e.router.stores.matchStores.get(o) || null)?.routeId === a ? o : e.router.stores.matches.get().find((e) => e.routeId === a)?.id, l = Tt(e, i);
|
|
1447
1429
|
if (t._nonReactive.loaderPromise) {
|
|
1448
1430
|
if (t.status === "success" && !e.sync && !t.preload && u) return t;
|
|
1449
1431
|
await t._nonReactive.loaderPromise;
|
|
1450
1432
|
let n = e.router.getMatch(i), a = n._nonReactive.error || n.error;
|
|
1451
|
-
a &&
|
|
1433
|
+
a && H(e, n, a), n.status === "pending" && await r(l, t, s, n, c);
|
|
1452
1434
|
} else {
|
|
1453
|
-
let n = l && !e.router.stores.
|
|
1454
|
-
a._nonReactive.loaderPromise =
|
|
1435
|
+
let n = l && !e.router.stores.matchStores.has(i), a = e.router.getMatch(i);
|
|
1436
|
+
a._nonReactive.loaderPromise = A(), n !== a.preload && e.updateMatch(i, (e) => ({
|
|
1455
1437
|
...e,
|
|
1456
1438
|
preload: n
|
|
1457
1439
|
})), await r(l, t, s, a, c);
|
|
@@ -1466,24 +1448,24 @@ var vt = (e) => {
|
|
|
1466
1448
|
invalid: !1
|
|
1467
1449
|
})), e.router.getMatch(i)) : d;
|
|
1468
1450
|
};
|
|
1469
|
-
async function
|
|
1451
|
+
async function Lt(e) {
|
|
1470
1452
|
let t = e, n = [];
|
|
1471
|
-
|
|
1453
|
+
wt(t.router) && Ct(t);
|
|
1472
1454
|
let r;
|
|
1473
1455
|
for (let e = 0; e < t.matches.length; e++) {
|
|
1474
1456
|
try {
|
|
1475
|
-
let n =
|
|
1476
|
-
|
|
1457
|
+
let n = Mt(t, e);
|
|
1458
|
+
ce(n) && await n;
|
|
1477
1459
|
} catch (e) {
|
|
1478
|
-
if (
|
|
1460
|
+
if (B(e)) throw e;
|
|
1479
1461
|
if (L(e)) r = e;
|
|
1480
1462
|
else if (!t.preload) throw e;
|
|
1481
1463
|
break;
|
|
1482
1464
|
}
|
|
1483
1465
|
if (t.serialError || t.firstBadMatchIndex != null) break;
|
|
1484
1466
|
}
|
|
1485
|
-
let i = t.firstBadMatchIndex ?? t.matches.length, a = r && !t.preload ?
|
|
1486
|
-
for (let e = 0; e < o; e++) n.push(
|
|
1467
|
+
let i = t.firstBadMatchIndex ?? t.matches.length, a = r && !t.preload ? Et(t, r) : void 0, o = r && t.preload ? 0 : a === void 0 ? i : Math.min(a + 1, i), s, c;
|
|
1468
|
+
for (let e = 0; e < o; e++) n.push(It(t, n, e));
|
|
1487
1469
|
try {
|
|
1488
1470
|
await Promise.all(n);
|
|
1489
1471
|
} catch {
|
|
@@ -1491,7 +1473,7 @@ async function Mt(e) {
|
|
|
1491
1473
|
for (let t of e) {
|
|
1492
1474
|
if (t.status !== "rejected") continue;
|
|
1493
1475
|
let e = t.reason;
|
|
1494
|
-
if (
|
|
1476
|
+
if (B(e)) throw e;
|
|
1495
1477
|
L(e) ? s ??= e : c ??= e;
|
|
1496
1478
|
}
|
|
1497
1479
|
if (c !== void 0) throw c;
|
|
@@ -1499,10 +1481,10 @@ async function Mt(e) {
|
|
|
1499
1481
|
let l = s ?? (r && !t.preload ? r : void 0), u = t.firstBadMatchIndex === void 0 ? t.matches.length - 1 : t.firstBadMatchIndex;
|
|
1500
1482
|
if (!l && r && t.preload) return t.matches;
|
|
1501
1483
|
if (l) {
|
|
1502
|
-
let e =
|
|
1484
|
+
let e = Et(t, l);
|
|
1503
1485
|
if (e === void 0) {
|
|
1504
1486
|
if (process.env.NODE_ENV !== "production") throw Error("Invariant failed: Could not find match for notFound boundary");
|
|
1505
|
-
|
|
1487
|
+
ye();
|
|
1506
1488
|
}
|
|
1507
1489
|
let n = t.matches[e], r = t.router.looseRoutesById[n.routeId], i = t.router.options?.defaultNotFoundComponent;
|
|
1508
1490
|
!r.options.notFoundComponent && i && (r.options.notFoundComponent = i), l.routeId = n.routeId;
|
|
@@ -1518,7 +1500,7 @@ async function Mt(e) {
|
|
|
1518
1500
|
error: l
|
|
1519
1501
|
},
|
|
1520
1502
|
isFetching: !1
|
|
1521
|
-
})), u = e, await
|
|
1503
|
+
})), u = e, await zt(r, ["notFoundComponent"]);
|
|
1522
1504
|
} else if (!t.preload) {
|
|
1523
1505
|
let e = t.matches[0];
|
|
1524
1506
|
e.globalNotFound || t.router.getMatch(e.id)?.globalNotFound && t.updateMatch(e.id, (e) => ({
|
|
@@ -1529,12 +1511,12 @@ async function Mt(e) {
|
|
|
1529
1511
|
}
|
|
1530
1512
|
if (t.serialError && t.firstBadMatchIndex !== void 0) {
|
|
1531
1513
|
let e = t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];
|
|
1532
|
-
await
|
|
1514
|
+
await zt(e, ["errorComponent"]);
|
|
1533
1515
|
}
|
|
1534
1516
|
for (let e = 0; e <= u; e++) {
|
|
1535
1517
|
let { id: n, routeId: r } = t.matches[e], i = t.router.looseRoutesById[r];
|
|
1536
1518
|
try {
|
|
1537
|
-
let e =
|
|
1519
|
+
let e = Nt(t, n, i);
|
|
1538
1520
|
if (e) {
|
|
1539
1521
|
let r = await e;
|
|
1540
1522
|
t.updateMatch(n, (e) => ({
|
|
@@ -1546,42 +1528,42 @@ async function Mt(e) {
|
|
|
1546
1528
|
console.error(`Error executing head for route ${r}:`, e);
|
|
1547
1529
|
}
|
|
1548
1530
|
}
|
|
1549
|
-
let d =
|
|
1550
|
-
if (
|
|
1531
|
+
let d = Ct(t);
|
|
1532
|
+
if (ce(d) && await d, l) throw l;
|
|
1551
1533
|
if (t.serialError && !t.preload && !t.onReady) throw t.serialError;
|
|
1552
1534
|
return t.matches;
|
|
1553
1535
|
}
|
|
1554
|
-
function
|
|
1536
|
+
function Rt(e, t) {
|
|
1555
1537
|
let n = t.map((t) => e.options[t]?.preload?.()).filter(Boolean);
|
|
1556
1538
|
if (n.length !== 0) return Promise.all(n);
|
|
1557
1539
|
}
|
|
1558
|
-
function
|
|
1540
|
+
function zt(e, t = Vt) {
|
|
1559
1541
|
!e._lazyLoaded && e._lazyPromise === void 0 && (e.lazyFn ? e._lazyPromise = e.lazyFn().then((t) => {
|
|
1560
1542
|
let { id: n, ...r } = t.options;
|
|
1561
1543
|
Object.assign(e.options, r), e._lazyLoaded = !0, e._lazyPromise = void 0;
|
|
1562
1544
|
}) : e._lazyLoaded = !0);
|
|
1563
|
-
let n = () => e._componentsLoaded ? void 0 : t ===
|
|
1545
|
+
let n = () => e._componentsLoaded ? void 0 : t === Vt ? (() => {
|
|
1564
1546
|
if (e._componentsPromise === void 0) {
|
|
1565
|
-
let t =
|
|
1547
|
+
let t = Rt(e, Vt);
|
|
1566
1548
|
t ? e._componentsPromise = t.then(() => {
|
|
1567
1549
|
e._componentsLoaded = !0, e._componentsPromise = void 0;
|
|
1568
1550
|
}) : e._componentsLoaded = !0;
|
|
1569
1551
|
}
|
|
1570
1552
|
return e._componentsPromise;
|
|
1571
|
-
})() :
|
|
1553
|
+
})() : Rt(e, t);
|
|
1572
1554
|
return e._lazyPromise ? e._lazyPromise.then(n) : n();
|
|
1573
1555
|
}
|
|
1574
|
-
function
|
|
1575
|
-
for (let t of
|
|
1556
|
+
function Bt(e) {
|
|
1557
|
+
for (let t of Vt) if (e.options[t]?.preload) return !0;
|
|
1576
1558
|
return !1;
|
|
1577
1559
|
}
|
|
1578
|
-
var
|
|
1560
|
+
var Vt = [
|
|
1579
1561
|
"component",
|
|
1580
1562
|
"errorComponent",
|
|
1581
1563
|
"pendingComponent",
|
|
1582
1564
|
"notFoundComponent"
|
|
1583
|
-
], W = "__TSR_index",
|
|
1584
|
-
function
|
|
1565
|
+
], W = "__TSR_index", Ht = "popstate", Ut = "beforeunload";
|
|
1566
|
+
function Wt(e) {
|
|
1585
1567
|
let t = e.getLocation(), n = /* @__PURE__ */ new Set(), r = (r) => {
|
|
1586
1568
|
t = e.getLocation(), n.forEach((e) => e({
|
|
1587
1569
|
location: t,
|
|
@@ -1621,7 +1603,7 @@ function Rt(e) {
|
|
|
1621
1603
|
}),
|
|
1622
1604
|
push: (n, i, o) => {
|
|
1623
1605
|
let s = t.state[W];
|
|
1624
|
-
i =
|
|
1606
|
+
i = Gt(s + 1, i), a({
|
|
1625
1607
|
task: () => {
|
|
1626
1608
|
e.pushState(n, i), r({ type: "PUSH" });
|
|
1627
1609
|
},
|
|
@@ -1633,7 +1615,7 @@ function Rt(e) {
|
|
|
1633
1615
|
},
|
|
1634
1616
|
replace: (n, i, o) => {
|
|
1635
1617
|
let s = t.state[W];
|
|
1636
|
-
i =
|
|
1618
|
+
i = Gt(s, i), a({
|
|
1637
1619
|
task: () => {
|
|
1638
1620
|
e.replaceState(n, i), r({ type: "REPLACE" });
|
|
1639
1621
|
},
|
|
@@ -1688,9 +1670,9 @@ function Rt(e) {
|
|
|
1688
1670
|
notify: r
|
|
1689
1671
|
};
|
|
1690
1672
|
}
|
|
1691
|
-
function
|
|
1673
|
+
function Gt(e, t) {
|
|
1692
1674
|
t ||= {};
|
|
1693
|
-
let n =
|
|
1675
|
+
let n = Xt();
|
|
1694
1676
|
return {
|
|
1695
1677
|
...t,
|
|
1696
1678
|
key: n,
|
|
@@ -1698,10 +1680,10 @@ function zt(e, t) {
|
|
|
1698
1680
|
[W]: e
|
|
1699
1681
|
};
|
|
1700
1682
|
}
|
|
1701
|
-
function
|
|
1683
|
+
function Kt(e) {
|
|
1702
1684
|
let t = e?.window ?? (typeof window < "u" ? window : void 0), n = t.history.pushState, r = t.history.replaceState, i = [], a = () => i, o = (e) => i = e, s = e?.createHref ?? ((e) => e), c = e?.parseLocation ?? (() => G(`${t.location.pathname}${t.location.search}${t.location.hash}`, t.history.state));
|
|
1703
1685
|
if (!t.history.state?.__TSR_key && !t.history.state?.key) {
|
|
1704
|
-
let e =
|
|
1686
|
+
let e = Xt();
|
|
1705
1687
|
t.history.replaceState({
|
|
1706
1688
|
[W]: 0,
|
|
1707
1689
|
key: e,
|
|
@@ -1763,7 +1745,7 @@ function Bt(e) {
|
|
|
1763
1745
|
}
|
|
1764
1746
|
}
|
|
1765
1747
|
if (t) return e.preventDefault(), e.returnValue = "";
|
|
1766
|
-
}, C =
|
|
1748
|
+
}, C = Wt({
|
|
1767
1749
|
getLocation: h,
|
|
1768
1750
|
getLength: () => t.history.length,
|
|
1769
1751
|
pushState: (e, t) => y("push", e, t),
|
|
@@ -1778,7 +1760,7 @@ function Bt(e) {
|
|
|
1778
1760
|
createHref: (e) => s(e),
|
|
1779
1761
|
flush: v,
|
|
1780
1762
|
destroy: () => {
|
|
1781
|
-
t.history.pushState = n, t.history.replaceState = r, t.removeEventListener(
|
|
1763
|
+
t.history.pushState = n, t.history.replaceState = r, t.removeEventListener(Ut, S, { capture: !0 }), t.removeEventListener(Ht, x);
|
|
1782
1764
|
},
|
|
1783
1765
|
onBlocked: () => {
|
|
1784
1766
|
u && l !== u && (l = u);
|
|
@@ -1787,7 +1769,7 @@ function Bt(e) {
|
|
|
1787
1769
|
setBlockers: o,
|
|
1788
1770
|
notifyOnIndexChange: !1
|
|
1789
1771
|
});
|
|
1790
|
-
return t.addEventListener(
|
|
1772
|
+
return t.addEventListener(Ut, S, { capture: !0 }), t.addEventListener(Ht, x), t.history.pushState = function(...e) {
|
|
1791
1773
|
let r = n.apply(t.history, e);
|
|
1792
1774
|
return C._ignoreSubscribers || b("PUSH"), r;
|
|
1793
1775
|
}, t.history.replaceState = function(...e) {
|
|
@@ -1795,9 +1777,9 @@ function Bt(e) {
|
|
|
1795
1777
|
return C._ignoreSubscribers || b("REPLACE"), n;
|
|
1796
1778
|
}, C;
|
|
1797
1779
|
}
|
|
1798
|
-
function
|
|
1780
|
+
function qt(e) {
|
|
1799
1781
|
let t = e?.window ?? (typeof window < "u" ? window : void 0);
|
|
1800
|
-
return
|
|
1782
|
+
return Kt({
|
|
1801
1783
|
window: t,
|
|
1802
1784
|
parseLocation: () => {
|
|
1803
1785
|
let e = t.location.hash.split("#").slice(1), n = e[0] ?? "/", r = t.location.search, i = e.slice(1);
|
|
@@ -1806,9 +1788,9 @@ function Vt(e) {
|
|
|
1806
1788
|
createHref: (e) => `${t.location.pathname}${t.location.search}#${e}`
|
|
1807
1789
|
});
|
|
1808
1790
|
}
|
|
1809
|
-
function
|
|
1810
|
-
let t = e.initialEntries, n = e.initialIndex ? Math.min(Math.max(e.initialIndex, 0), t.length - 1) : t.length - 1, r = t.map((e, t) =>
|
|
1811
|
-
return
|
|
1791
|
+
function Jt(e = { initialEntries: ["/"] }) {
|
|
1792
|
+
let t = e.initialEntries, n = e.initialIndex ? Math.min(Math.max(e.initialIndex, 0), t.length - 1) : t.length - 1, r = t.map((e, t) => Gt(t, void 0)), i = () => G(t[n], r[n]), a = [];
|
|
1793
|
+
return Wt({
|
|
1812
1794
|
getLocation: i,
|
|
1813
1795
|
getLength: () => t.length,
|
|
1814
1796
|
pushState: (e, i) => {
|
|
@@ -1831,12 +1813,12 @@ function Ht(e = { initialEntries: ["/"] }) {
|
|
|
1831
1813
|
setBlockers: (e) => a = e
|
|
1832
1814
|
});
|
|
1833
1815
|
}
|
|
1834
|
-
function
|
|
1816
|
+
function Yt(e) {
|
|
1835
1817
|
let t = e.replace(/[\x00-\x1f\x7f]/g, "");
|
|
1836
1818
|
return t.startsWith("//") && (t = "/" + t.replace(/^\/+/, "")), t;
|
|
1837
1819
|
}
|
|
1838
1820
|
function G(e, t) {
|
|
1839
|
-
let n =
|
|
1821
|
+
let n = Yt(e), r = n.indexOf("#"), i = n.indexOf("?"), a = Xt();
|
|
1840
1822
|
return {
|
|
1841
1823
|
href: n,
|
|
1842
1824
|
pathname: n.substring(0, r > 0 ? i > 0 ? Math.min(r, i) : r : i > 0 ? i : n.length),
|
|
@@ -1849,7 +1831,7 @@ function G(e, t) {
|
|
|
1849
1831
|
}
|
|
1850
1832
|
};
|
|
1851
1833
|
}
|
|
1852
|
-
function
|
|
1834
|
+
function Xt() {
|
|
1853
1835
|
return (Math.random() + 1).toString(36).substring(7);
|
|
1854
1836
|
}
|
|
1855
1837
|
//#endregion
|
|
@@ -1864,41 +1846,41 @@ function K(e, t) {
|
|
|
1864
1846
|
hashChanged: n?.hash !== r.hash
|
|
1865
1847
|
};
|
|
1866
1848
|
}
|
|
1867
|
-
var
|
|
1849
|
+
var Zt = class {
|
|
1868
1850
|
constructor(e, t) {
|
|
1869
|
-
this.tempLocationKey = `${Math.round(Math.random() * 1e7)}`, this.resetNextScroll = !0, this.shouldViewTransition = void 0, this.isViewTransitionTypesSupported = void 0, this.subscribers = /* @__PURE__ */ new Set(), this.isScrollRestoring = !1, this.isScrollRestorationSetup = !1, this.startTransition = (e) => e(), this.update = (e) => {
|
|
1851
|
+
this.tempLocationKey = `${Math.round(Math.random() * 1e7)}`, this.resetNextScroll = !0, this.shouldViewTransition = void 0, this.isViewTransitionTypesSupported = void 0, this.subscribers = /* @__PURE__ */ new Set(), this.isScrollRestoring = !1, this.isScrollRestorationSetup = !1, this.routeBranchCache = /* @__PURE__ */ new WeakMap(), this.startTransition = (e) => e(), this.update = (e) => {
|
|
1870
1852
|
process.env.NODE_ENV !== "production" && e.notFoundRoute && console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");
|
|
1871
1853
|
let t = this.options, n = this.basepath ?? t?.basepath ?? "/", r = this.basepath === void 0, i = t?.rewrite;
|
|
1872
1854
|
if (this.options = {
|
|
1873
1855
|
...t,
|
|
1874
1856
|
...e
|
|
1875
|
-
}, this.isServer = this.options.isServer ?? typeof document > "u", this.protocolAllowlist = new Set(this.options.protocolAllowlist), this.options.pathParamsAllowedCharacters && (this.pathParamsDecoder =
|
|
1857
|
+
}, this.isServer = this.options.isServer ?? typeof document > "u", this.protocolAllowlist = new Set(this.options.protocolAllowlist), this.options.pathParamsAllowedCharacters && (this.pathParamsDecoder = Je(this.options.pathParamsAllowedCharacters)), (!this.history || this.options.history && this.options.history !== this.history) && (this.options.history ? this.history = this.options.history : typeof window < "u" && (this.history = Kt())), this.origin = this.options.origin, !this.origin) {
|
|
1876
1858
|
let e = globalThis.window;
|
|
1877
1859
|
e && e.origin && e.origin !== "null" ? this.origin = e.origin : this.origin = "http://localhost";
|
|
1878
1860
|
}
|
|
1879
1861
|
if (this.history && this.updateLatestLocation(), this.options.routeTree !== this.routeTree) {
|
|
1880
1862
|
this.routeTree = this.options.routeTree;
|
|
1881
1863
|
let e;
|
|
1882
|
-
this.resolvePathCache =
|
|
1864
|
+
this.resolvePathCache = M(1e3), e = this.buildRouteTree(), this.setRoutes(e);
|
|
1883
1865
|
}
|
|
1884
1866
|
if (!this.stores && this.latestLocation) {
|
|
1885
1867
|
let e = this.getStoreConfig(this);
|
|
1886
|
-
this.batch = e.batch, this.stores =
|
|
1868
|
+
this.batch = e.batch, this.stores = bt(rn(this.latestLocation), e), st(this);
|
|
1887
1869
|
}
|
|
1888
1870
|
let a = !1, o = this.options.basepath ?? "/", s = this.options.rewrite;
|
|
1889
1871
|
if (r || n !== o || i !== s) {
|
|
1890
1872
|
this.basepath = o;
|
|
1891
|
-
let e = [], t =
|
|
1892
|
-
t && t !== "/" && e.push(
|
|
1873
|
+
let e = [], t = We(o);
|
|
1874
|
+
t && t !== "/" && e.push(_t({ basepath: o })), s && e.push(s), this.rewrite = e.length === 0 ? void 0 : e.length === 1 ? e[0] : gt(e), this.history && this.updateLatestLocation(), a = !0;
|
|
1893
1875
|
}
|
|
1894
|
-
a && this.stores && this.stores.location.
|
|
1876
|
+
a && this.stores && this.stores.location.set(this.latestLocation), typeof window < "u" && "CSS" in window && typeof window.CSS?.supports == "function" && (this.isViewTransitionTypesSupported = window.CSS.supports("selector(:active-view-transition-type(a))"));
|
|
1895
1877
|
}, this.updateLatestLocation = () => {
|
|
1896
1878
|
this.latestLocation = this.parseLocation(this.history.location, this.latestLocation);
|
|
1897
1879
|
}, this.buildRouteTree = () => {
|
|
1898
|
-
let e =
|
|
1880
|
+
let e = je(this.routeTree, this.options.caseSensitive, (e, t) => {
|
|
1899
1881
|
e.init({ originalIndex: t });
|
|
1900
1882
|
});
|
|
1901
|
-
return this.options.routeMasks &&
|
|
1883
|
+
return this.options.routeMasks && Ee(this.options.routeMasks, e.processedTree), e;
|
|
1902
1884
|
}, this.subscribe = (e, t) => {
|
|
1903
1885
|
let n = {
|
|
1904
1886
|
eventType: e,
|
|
@@ -1921,21 +1903,21 @@ var Gt = class {
|
|
|
1921
1903
|
pathname: j(e).path,
|
|
1922
1904
|
external: !1,
|
|
1923
1905
|
searchStr: o,
|
|
1924
|
-
search:
|
|
1906
|
+
search: E(t?.search, i),
|
|
1925
1907
|
hash: j(r.slice(1)).path,
|
|
1926
|
-
state:
|
|
1908
|
+
state: D(t?.state, a)
|
|
1927
1909
|
};
|
|
1928
1910
|
}
|
|
1929
|
-
let o = new URL(i, this.origin), s =
|
|
1911
|
+
let o = new URL(i, this.origin), s = vt(this.rewrite, o), c = this.options.parseSearch(s.search), l = this.options.stringifySearch(c);
|
|
1930
1912
|
return s.search = l, {
|
|
1931
1913
|
href: s.href.replace(s.origin, ""),
|
|
1932
1914
|
publicHref: i,
|
|
1933
1915
|
pathname: j(s.pathname).path,
|
|
1934
1916
|
external: !!this.rewrite && s.origin !== this.origin,
|
|
1935
1917
|
searchStr: l,
|
|
1936
|
-
search:
|
|
1918
|
+
search: E(t?.search, c),
|
|
1937
1919
|
hash: j(s.hash.slice(1)).path,
|
|
1938
|
-
state:
|
|
1920
|
+
state: D(t?.state, a)
|
|
1939
1921
|
};
|
|
1940
1922
|
}, r = n(e), { __tempLocation: i, __tempKey: a } = r.state;
|
|
1941
1923
|
if (i && (!a || a === this.tempLocationKey)) {
|
|
@@ -1946,15 +1928,15 @@ var Gt = class {
|
|
|
1946
1928
|
};
|
|
1947
1929
|
}
|
|
1948
1930
|
return r;
|
|
1949
|
-
}, this.resolvePathWithBase = (e, t) =>
|
|
1931
|
+
}, this.resolvePathWithBase = (e, t) => qe({
|
|
1950
1932
|
base: e,
|
|
1951
|
-
to:
|
|
1933
|
+
to: t.includes("//") ? He(t) : t,
|
|
1952
1934
|
trailingSlash: this.options.trailingSlash,
|
|
1953
1935
|
cache: this.resolvePathCache
|
|
1954
1936
|
}), this.matchRoutes = (e, t, n) => typeof e == "string" ? this.matchRoutesInternal({
|
|
1955
1937
|
pathname: e,
|
|
1956
1938
|
search: t
|
|
1957
|
-
}, n) : this.matchRoutesInternal(e, t), this.getMatchedRoutes = (e) =>
|
|
1939
|
+
}, n) : this.matchRoutesInternal(e, t), this.getMatchedRoutes = (e) => on({
|
|
1958
1940
|
pathname: e,
|
|
1959
1941
|
routesById: this.routesById,
|
|
1960
1942
|
processedTree: this.processedTree
|
|
@@ -1962,66 +1944,76 @@ var Gt = class {
|
|
|
1962
1944
|
let t = this.getMatch(e);
|
|
1963
1945
|
t && (t.abortController.abort(), clearTimeout(t._nonReactive.pendingTimeout), t._nonReactive.pendingTimeout = void 0);
|
|
1964
1946
|
}, this.cancelMatches = () => {
|
|
1965
|
-
this.stores.
|
|
1947
|
+
this.stores.pendingIds.get().forEach((e) => {
|
|
1966
1948
|
this.cancelMatch(e);
|
|
1967
|
-
}), this.stores.matchesId.
|
|
1968
|
-
if (this.stores.
|
|
1969
|
-
let t = this.stores.
|
|
1949
|
+
}), this.stores.matchesId.get().forEach((e) => {
|
|
1950
|
+
if (this.stores.pendingMatchStores.has(e)) return;
|
|
1951
|
+
let t = this.stores.matchStores.get(e)?.get();
|
|
1970
1952
|
t && (t.status === "pending" || t.isFetching === "loader") && this.cancelMatch(e);
|
|
1971
1953
|
});
|
|
1972
1954
|
}, this.buildLocation = (e) => {
|
|
1973
1955
|
let t = (t = {}) => {
|
|
1974
1956
|
let n = t._fromLocation || this.pendingBuiltLocation || this.latestLocation, r = this.matchRoutesLightweight(n);
|
|
1975
1957
|
if (t.from && process.env.NODE_ENV !== "production" && t._isNavigate) {
|
|
1976
|
-
let e = this.getMatchedRoutes(t.from).matchedRoutes, n =
|
|
1958
|
+
let e = this.getMatchedRoutes(t.from).matchedRoutes, n = le(r.matchedRoutes, (e) => tn(e.fullPath, t.from)), i = le(e, (e) => tn(e.fullPath, r.fullPath));
|
|
1977
1959
|
!n && !i && console.warn(`Could not find match for from: ${t.from}`);
|
|
1978
1960
|
}
|
|
1979
|
-
let i = t.unsafeRelative === "path" ? n.pathname : t.from ?? r.fullPath, a =
|
|
1980
|
-
if (
|
|
1961
|
+
let i = t.unsafeRelative === "path" ? n.pathname : t.from ?? r.fullPath, a = t.to ? `${t.to}` : void 0, o = r.search, s = Object.assign(Object.create(null), r.params), c = a?.charCodeAt(0) === 47 ? "/" : this.resolvePathWithBase(i, "."), l = a ? this.resolvePathWithBase(c, a) : c, u = t.params === !1 || t.params === null ? Object.create(null) : (t.params ?? !0) === !0 ? s : Object.assign(s, T(t.params, s)), d = this.routesByPath[I(l)], f;
|
|
1962
|
+
if (d) f = this.getRouteBranch(d);
|
|
1963
|
+
else if (l.includes("$")) f = [];
|
|
1964
|
+
else {
|
|
1965
|
+
let e = this.getMatchedRoutes(l);
|
|
1966
|
+
f = e.matchedRoutes, this.options.notFoundRoute && (!e.foundRoute || e.foundRoute.path !== "/" && e.routeParams["**"]) && (f = [...f, this.options.notFoundRoute]);
|
|
1967
|
+
}
|
|
1968
|
+
if (f.length && re(u)) for (let e of f) {
|
|
1981
1969
|
let t = e.options.params?.stringify ?? e.options.stringifyParams;
|
|
1982
1970
|
if (t) try {
|
|
1983
|
-
Object.assign(
|
|
1971
|
+
Object.assign(u, t(u));
|
|
1984
1972
|
} catch {}
|
|
1985
1973
|
}
|
|
1986
|
-
let
|
|
1987
|
-
path:
|
|
1988
|
-
params:
|
|
1974
|
+
let p = e.leaveParams ? l : j(Xe({
|
|
1975
|
+
path: l,
|
|
1976
|
+
params: u,
|
|
1989
1977
|
decoder: this.pathParamsDecoder,
|
|
1990
1978
|
server: this.isServer
|
|
1991
|
-
}).interpolatedPath).path
|
|
1979
|
+
}).interpolatedPath).path;
|
|
1980
|
+
if (process.env.NODE_ENV !== "production" && d && !e.leaveParams) try {
|
|
1981
|
+
this.getMatchedRoutes(p).foundRoute?.id !== d.id && console.warn(`Generated path "${p}" for route "${d.id}" did not match the same route after params.stringify.`);
|
|
1982
|
+
} catch {}
|
|
1983
|
+
let m = o;
|
|
1992
1984
|
if (e._includeValidateSearch && this.options.search?.strict) {
|
|
1993
1985
|
let e = {};
|
|
1994
|
-
|
|
1986
|
+
f.forEach((t) => {
|
|
1995
1987
|
if (t.options.validateSearch) try {
|
|
1996
|
-
Object.assign(e,
|
|
1988
|
+
Object.assign(e, an(t.options.validateSearch, {
|
|
1997
1989
|
...e,
|
|
1998
|
-
...
|
|
1990
|
+
...m
|
|
1999
1991
|
}));
|
|
2000
1992
|
} catch {}
|
|
2001
|
-
}),
|
|
1993
|
+
}), m = e;
|
|
2002
1994
|
}
|
|
2003
|
-
|
|
2004
|
-
search:
|
|
1995
|
+
m = sn({
|
|
1996
|
+
search: m,
|
|
2005
1997
|
dest: t,
|
|
2006
|
-
destRoutes:
|
|
1998
|
+
destRoutes: f,
|
|
2007
1999
|
_includeValidateSearch: e._includeValidateSearch
|
|
2008
|
-
}),
|
|
2009
|
-
let
|
|
2010
|
-
|
|
2011
|
-
let
|
|
2000
|
+
}), m = E(o, m);
|
|
2001
|
+
let h = this.options.stringifySearch(m), g = t.hash === !0 ? n.hash : t.hash ? T(t.hash, n.hash) : void 0, _ = g ? `#${g}` : "", v = t.state === !0 ? n.state : t.state ? T(t.state, n.state) : {};
|
|
2002
|
+
v = D(n.state, v);
|
|
2003
|
+
let y = `${p}${h}${_}`, b, x, S = !1;
|
|
2012
2004
|
if (this.rewrite) {
|
|
2013
|
-
let e = new URL(
|
|
2014
|
-
|
|
2015
|
-
} else
|
|
2005
|
+
let e = new URL(y, this.origin), t = yt(this.rewrite, e);
|
|
2006
|
+
b = e.href.replace(e.origin, ""), t.origin === this.origin ? x = t.pathname + t.search + t.hash : (x = t.href, S = !0);
|
|
2007
|
+
} else b = _e(y), x = b;
|
|
2016
2008
|
return {
|
|
2017
|
-
publicHref:
|
|
2018
|
-
href:
|
|
2019
|
-
pathname:
|
|
2020
|
-
search:
|
|
2021
|
-
searchStr:
|
|
2022
|
-
state:
|
|
2023
|
-
hash:
|
|
2024
|
-
external:
|
|
2009
|
+
publicHref: x,
|
|
2010
|
+
href: b,
|
|
2011
|
+
pathname: p,
|
|
2012
|
+
search: m,
|
|
2013
|
+
searchStr: h,
|
|
2014
|
+
state: v,
|
|
2015
|
+
hash: g ?? "",
|
|
2016
|
+
external: S,
|
|
2025
2017
|
unmaskOnReload: t.unmaskOnReload
|
|
2026
2018
|
};
|
|
2027
2019
|
}, n = (n = {}, r) => {
|
|
@@ -2029,10 +2021,10 @@ var Gt = class {
|
|
|
2029
2021
|
if (!a) {
|
|
2030
2022
|
let n = Object.create(null);
|
|
2031
2023
|
if (this.options.routeMasks) {
|
|
2032
|
-
let o =
|
|
2024
|
+
let o = De(i.pathname, this.processedTree);
|
|
2033
2025
|
if (o) {
|
|
2034
2026
|
Object.assign(n, o.rawParams);
|
|
2035
|
-
let { from: i, params: s, ...c } = o.route, l = s === !1 || s === null ? Object.create(null) : (s ?? !0) === !0 ? n : Object.assign(n,
|
|
2027
|
+
let { from: i, params: s, ...c } = o.route, l = s === !1 || s === null ? Object.create(null) : (s ?? !0) === !0 ? n : Object.assign(n, T(s, n));
|
|
2036
2028
|
r = {
|
|
2037
2029
|
from: e.from,
|
|
2038
2030
|
...c,
|
|
@@ -2058,12 +2050,12 @@ var Gt = class {
|
|
|
2058
2050
|
e.forEach((e) => {
|
|
2059
2051
|
n.state[e] = this.latestLocation.state[e];
|
|
2060
2052
|
});
|
|
2061
|
-
let t =
|
|
2053
|
+
let t = k(n.state, this.latestLocation.state);
|
|
2062
2054
|
return e.forEach((e) => {
|
|
2063
2055
|
delete n.state[e];
|
|
2064
2056
|
}), t;
|
|
2065
2057
|
}, i = I(this.latestLocation.href) === I(n.href), a = this.commitLocationPromise;
|
|
2066
|
-
if (this.commitLocationPromise =
|
|
2058
|
+
if (this.commitLocationPromise = A(() => {
|
|
2067
2059
|
a?.resolve(), a = void 0;
|
|
2068
2060
|
}), i && r()) this.load();
|
|
2069
2061
|
else {
|
|
@@ -2091,7 +2083,7 @@ var Gt = class {
|
|
|
2091
2083
|
}, this.buildAndCommitLocation = ({ replace: e, resetScroll: t, hashScrollIntoView: n, viewTransition: r, ignoreBlocker: i, href: a, ...o } = {}) => {
|
|
2092
2084
|
if (a) {
|
|
2093
2085
|
let t = this.history.location.state.__TSR_index, n = G(a, { __TSR_index: e ? t : t + 1 }), r = new URL(n.pathname, this.origin);
|
|
2094
|
-
o.to =
|
|
2086
|
+
o.to = vt(this.rewrite, r).pathname, o.search = this.options.parseSearch(n.search), o.hash = n.hash.slice(1);
|
|
2095
2087
|
}
|
|
2096
2088
|
let s = this.buildLocation({
|
|
2097
2089
|
...o,
|
|
@@ -2123,7 +2115,7 @@ var Gt = class {
|
|
|
2123
2115
|
n ??= t.publicHref, r ??= t.publicHref;
|
|
2124
2116
|
}
|
|
2125
2117
|
let t = !a && r ? r : n;
|
|
2126
|
-
if (
|
|
2118
|
+
if (pe(t, this.protocolAllowlist)) return process.env.NODE_ENV !== "production" && console.warn(`Blocked navigation to dangerous protocol: ${t}`), Promise.resolve();
|
|
2127
2119
|
if (!i.ignoreBlocker) {
|
|
2128
2120
|
let e = this.history.getBlockers?.() ?? [];
|
|
2129
2121
|
for (let t of e) if (t?.blockerFn && await t.blockerFn({
|
|
@@ -2142,28 +2134,28 @@ var Gt = class {
|
|
|
2142
2134
|
});
|
|
2143
2135
|
}, this.beforeLoad = () => {
|
|
2144
2136
|
this.cancelMatches(), this.updateLatestLocation();
|
|
2145
|
-
let e = this.matchRoutes(this.latestLocation), t = this.stores.
|
|
2137
|
+
let e = this.matchRoutes(this.latestLocation), t = this.stores.cachedMatches.get().filter((t) => !e.some((e) => e.id === t.id));
|
|
2146
2138
|
this.batch(() => {
|
|
2147
|
-
this.stores.status.
|
|
2139
|
+
this.stores.status.set("pending"), this.stores.statusCode.set(200), this.stores.isLoading.set(!0), this.stores.location.set(this.latestLocation), this.stores.setPending(e), this.stores.setCached(t);
|
|
2148
2140
|
});
|
|
2149
2141
|
}, this.load = async (e) => {
|
|
2150
|
-
let t, n, r, i = this.stores.resolvedLocation.
|
|
2142
|
+
let t, n, r, i = this.stores.resolvedLocation.get() ?? this.stores.location.get();
|
|
2151
2143
|
for (r = new Promise((a) => {
|
|
2152
2144
|
this.startTransition(async () => {
|
|
2153
2145
|
try {
|
|
2154
2146
|
this.beforeLoad();
|
|
2155
|
-
let t = this.latestLocation, n = this.stores.resolvedLocation.
|
|
2156
|
-
this.stores.redirect.
|
|
2147
|
+
let t = this.latestLocation, n = K(t, this.stores.resolvedLocation.get());
|
|
2148
|
+
this.stores.redirect.get() || this.emit({
|
|
2157
2149
|
type: "onBeforeNavigate",
|
|
2158
|
-
...
|
|
2150
|
+
...n
|
|
2159
2151
|
}), this.emit({
|
|
2160
2152
|
type: "onBeforeLoad",
|
|
2161
|
-
...
|
|
2162
|
-
}), await
|
|
2153
|
+
...n
|
|
2154
|
+
}), await Lt({
|
|
2163
2155
|
router: this,
|
|
2164
2156
|
sync: e?.sync,
|
|
2165
2157
|
forceStaleReload: i.href === t.href,
|
|
2166
|
-
matches: this.stores.
|
|
2158
|
+
matches: this.stores.pendingMatches.get(),
|
|
2167
2159
|
location: t,
|
|
2168
2160
|
updateMatch: this.updateMatch,
|
|
2169
2161
|
onReady: async () => {
|
|
@@ -2171,13 +2163,13 @@ var Gt = class {
|
|
|
2171
2163
|
this.startViewTransition(async () => {
|
|
2172
2164
|
let e = null, t = null, n = null, r = null;
|
|
2173
2165
|
this.batch(() => {
|
|
2174
|
-
let i = this.stores.
|
|
2175
|
-
e = a ? o.filter((e) => !this.stores.
|
|
2166
|
+
let i = this.stores.pendingMatches.get(), a = i.length, o = this.stores.matches.get();
|
|
2167
|
+
e = a ? o.filter((e) => !this.stores.pendingMatchStores.has(e.id)) : null;
|
|
2176
2168
|
let s = /* @__PURE__ */ new Set();
|
|
2177
|
-
for (let e of this.stores.
|
|
2169
|
+
for (let e of this.stores.pendingMatchStores.values()) e.routeId && s.add(e.routeId);
|
|
2178
2170
|
let c = /* @__PURE__ */ new Set();
|
|
2179
|
-
for (let e of this.stores.
|
|
2180
|
-
t = a ? o.filter((e) => !s.has(e.routeId)) : null, n = a ? i.filter((e) => !c.has(e.routeId)) : null, r = a ? i.filter((e) => c.has(e.routeId)) : o, this.stores.isLoading.
|
|
2171
|
+
for (let e of this.stores.matchStores.values()) e.routeId && c.add(e.routeId);
|
|
2172
|
+
t = a ? o.filter((e) => !s.has(e.routeId)) : null, n = a ? i.filter((e) => !c.has(e.routeId)) : null, r = a ? i.filter((e) => c.has(e.routeId)) : o, this.stores.isLoading.set(!1), this.stores.loadedAt.set(Date.now()), a && (this.stores.setMatches(i), this.stores.setPending([]), this.stores.setCached([...this.stores.cachedMatches.get(), ...e.filter((e) => e.status !== "error" && e.status !== "notFound" && e.status !== "redirected")]), this.clearExpiredCache());
|
|
2181
2173
|
});
|
|
2182
2174
|
for (let [e, i] of [
|
|
2183
2175
|
[t, "onLeave"],
|
|
@@ -2189,27 +2181,27 @@ var Gt = class {
|
|
|
2189
2181
|
}
|
|
2190
2182
|
});
|
|
2191
2183
|
} catch (e) {
|
|
2192
|
-
|
|
2184
|
+
B(e) ? (t = e, this.navigate({
|
|
2193
2185
|
...t.options,
|
|
2194
2186
|
replace: !0,
|
|
2195
2187
|
ignoreBlocker: !0
|
|
2196
2188
|
})) : L(e) && (n = e);
|
|
2197
|
-
let r = t ? t.status : n ? 404 : this.stores.
|
|
2189
|
+
let r = t ? t.status : n ? 404 : this.stores.matches.get().some((e) => e.status === "error") ? 500 : 200;
|
|
2198
2190
|
this.batch(() => {
|
|
2199
|
-
this.stores.statusCode.
|
|
2191
|
+
this.stores.statusCode.set(r), this.stores.redirect.set(t);
|
|
2200
2192
|
});
|
|
2201
2193
|
}
|
|
2202
2194
|
this.latestLoadPromise === r && (this.commitLocationPromise?.resolve(), this.latestLoadPromise = void 0, this.commitLocationPromise = void 0), a();
|
|
2203
2195
|
});
|
|
2204
2196
|
}), this.latestLoadPromise = r, await r; this.latestLoadPromise && r !== this.latestLoadPromise;) await this.latestLoadPromise;
|
|
2205
2197
|
let a;
|
|
2206
|
-
this.hasNotFoundMatch() ? a = 404 : this.stores.
|
|
2198
|
+
this.hasNotFoundMatch() ? a = 404 : this.stores.matches.get().some((e) => e.status === "error") && (a = 500), a !== void 0 && this.stores.statusCode.set(a);
|
|
2207
2199
|
}, this.startViewTransition = (e) => {
|
|
2208
2200
|
let t = this.shouldViewTransition ?? this.options.defaultViewTransition;
|
|
2209
2201
|
if (this.shouldViewTransition = void 0, t && typeof document < "u" && "startViewTransition" in document && typeof document.startViewTransition == "function") {
|
|
2210
2202
|
let n;
|
|
2211
2203
|
if (typeof t == "object" && this.isViewTransitionTypesSupported) {
|
|
2212
|
-
let r = this.latestLocation, i = this.stores.resolvedLocation.
|
|
2204
|
+
let r = this.latestLocation, i = this.stores.resolvedLocation.get(), a = typeof t.types == "function" ? t.types(K(r, i)) : t.types;
|
|
2213
2205
|
if (a === !1) {
|
|
2214
2206
|
e();
|
|
2215
2207
|
return;
|
|
@@ -2223,23 +2215,23 @@ var Gt = class {
|
|
|
2223
2215
|
} else e();
|
|
2224
2216
|
}, this.updateMatch = (e, t) => {
|
|
2225
2217
|
this.startTransition(() => {
|
|
2226
|
-
let n = this.stores.
|
|
2218
|
+
let n = this.stores.pendingMatchStores.get(e);
|
|
2227
2219
|
if (n) {
|
|
2228
|
-
n.
|
|
2220
|
+
n.set(t);
|
|
2229
2221
|
return;
|
|
2230
2222
|
}
|
|
2231
|
-
let r = this.stores.
|
|
2223
|
+
let r = this.stores.matchStores.get(e);
|
|
2232
2224
|
if (r) {
|
|
2233
|
-
r.
|
|
2225
|
+
r.set(t);
|
|
2234
2226
|
return;
|
|
2235
2227
|
}
|
|
2236
|
-
let i = this.stores.
|
|
2228
|
+
let i = this.stores.cachedMatchStores.get(e);
|
|
2237
2229
|
if (i) {
|
|
2238
|
-
let n = t(i.
|
|
2239
|
-
n.status === "redirected" ? this.stores.
|
|
2230
|
+
let n = t(i.get());
|
|
2231
|
+
n.status === "redirected" ? this.stores.cachedMatchStores.delete(e) && this.stores.cachedIds.set((t) => t.filter((t) => t !== e)) : i.set(n);
|
|
2240
2232
|
}
|
|
2241
2233
|
});
|
|
2242
|
-
}, this.getMatch = (e) => this.stores.
|
|
2234
|
+
}, this.getMatch = (e) => this.stores.cachedMatchStores.get(e)?.get() ?? this.stores.pendingMatchStores.get(e)?.get() ?? this.stores.matchStores.get(e)?.get(), this.invalidate = (e) => {
|
|
2243
2235
|
let t = (t) => e?.filter?.(t) ?? !0 ? {
|
|
2244
2236
|
...t,
|
|
2245
2237
|
invalid: !0,
|
|
@@ -2249,7 +2241,7 @@ var Gt = class {
|
|
|
2249
2241
|
} : void 0
|
|
2250
2242
|
} : t;
|
|
2251
2243
|
return this.batch(() => {
|
|
2252
|
-
this.stores.
|
|
2244
|
+
this.stores.setMatches(this.stores.matches.get().map(t)), this.stores.setCached(this.stores.cachedMatches.get().map(t)), this.stores.setPending(this.stores.pendingMatches.get().map(t));
|
|
2253
2245
|
}), this.shouldViewTransition = !1, this.load({ sync: e?.sync });
|
|
2254
2246
|
}, this.getParsedLocationHref = (e) => e.publicHref || "/", this.resolveRedirect = (e) => {
|
|
2255
2247
|
let t = e.headers.get("Location");
|
|
@@ -2263,11 +2255,11 @@ var Gt = class {
|
|
|
2263
2255
|
e.options.href = t, e.headers.set("Location", t);
|
|
2264
2256
|
}
|
|
2265
2257
|
} catch {}
|
|
2266
|
-
if (e.options.href && !e.options._builtLocation &&
|
|
2258
|
+
if (e.options.href && !e.options._builtLocation && pe(e.options.href, this.protocolAllowlist)) throw Error(process.env.NODE_ENV === "production" ? "Redirect blocked: unsafe protocol" : `Redirect blocked: unsafe protocol in href "${e.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);
|
|
2267
2259
|
return e.headers.get("Location") || e.headers.set("Location", e.options.href), e;
|
|
2268
2260
|
}, this.clearCache = (e) => {
|
|
2269
2261
|
let t = e?.filter;
|
|
2270
|
-
t === void 0 ? this.stores.
|
|
2262
|
+
t === void 0 ? this.stores.setCached([]) : this.stores.setCached(this.stores.cachedMatches.get().filter((e) => !t(e)));
|
|
2271
2263
|
}, this.clearExpiredCache = () => {
|
|
2272
2264
|
let e = Date.now();
|
|
2273
2265
|
this.clearCache({ filter: (t) => {
|
|
@@ -2276,18 +2268,18 @@ var Gt = class {
|
|
|
2276
2268
|
let r = (t.preload ? n.options.preloadGcTime ?? this.options.defaultPreloadGcTime : n.options.gcTime ?? this.options.defaultGcTime) ?? 300 * 1e3;
|
|
2277
2269
|
return t.status === "error" ? !0 : e - t.updatedAt >= r;
|
|
2278
2270
|
} });
|
|
2279
|
-
}, this.loadRouteChunk =
|
|
2271
|
+
}, this.loadRouteChunk = zt, this.preloadRoute = async (e) => {
|
|
2280
2272
|
let t = e._builtLocation ?? this.buildLocation(e), n = this.matchRoutes(t, {
|
|
2281
2273
|
throwOnError: !0,
|
|
2282
2274
|
preload: !0,
|
|
2283
2275
|
dest: e
|
|
2284
|
-
}), r = new Set([...this.stores.matchesId.
|
|
2276
|
+
}), r = new Set([...this.stores.matchesId.get(), ...this.stores.pendingIds.get()]), i = new Set([...r, ...this.stores.cachedIds.get()]), a = n.filter((e) => !i.has(e.id));
|
|
2285
2277
|
if (a.length) {
|
|
2286
|
-
let e = this.stores.
|
|
2287
|
-
this.stores.
|
|
2278
|
+
let e = this.stores.cachedMatches.get();
|
|
2279
|
+
this.stores.setCached([...e, ...a]);
|
|
2288
2280
|
}
|
|
2289
2281
|
try {
|
|
2290
|
-
return n = await
|
|
2282
|
+
return n = await Lt({
|
|
2291
2283
|
router: this,
|
|
2292
2284
|
matches: n,
|
|
2293
2285
|
location: t,
|
|
@@ -2297,7 +2289,7 @@ var Gt = class {
|
|
|
2297
2289
|
}
|
|
2298
2290
|
}), n;
|
|
2299
2291
|
} catch (e) {
|
|
2300
|
-
if (
|
|
2292
|
+
if (B(e)) return e.options.reloadDocument ? void 0 : await this.preloadRoute({
|
|
2301
2293
|
...e.options,
|
|
2302
2294
|
_fromLocation: t
|
|
2303
2295
|
});
|
|
@@ -2311,10 +2303,10 @@ var Gt = class {
|
|
|
2311
2303
|
params: e.params || {},
|
|
2312
2304
|
leaveParams: !0
|
|
2313
2305
|
}, r = this.buildLocation(n);
|
|
2314
|
-
if (t?.pending && this.stores.status.
|
|
2315
|
-
let i = (t?.pending === void 0 ? !this.stores.isLoading.
|
|
2316
|
-
return !a || e.params && !
|
|
2317
|
-
}, this.hasNotFoundMatch = () => this.stores.
|
|
2306
|
+
if (t?.pending && this.stores.status.get() !== "pending") return !1;
|
|
2307
|
+
let i = (t?.pending === void 0 ? !this.stores.isLoading.get() : t.pending) ? this.latestLocation : this.stores.resolvedLocation.get() || this.stores.location.get(), a = Oe(r.pathname, t?.caseSensitive ?? !1, t?.fuzzy ?? !1, i.pathname, this.processedTree);
|
|
2308
|
+
return !a || e.params && !k(a.rawParams, e.params, { partial: !0 }) ? !1 : t?.includeSearch ?? !0 ? k(i.search, r.search, { partial: !0 }) ? a.rawParams : !1 : a.rawParams;
|
|
2309
|
+
}, this.hasNotFoundMatch = () => this.stores.matches.get().some((e) => e.status === "notFound" || e.globalNotFound), this.getStoreConfig = t, this.update({
|
|
2318
2310
|
defaultPreloadDelay: 50,
|
|
2319
2311
|
defaultPendingMs: 1e3,
|
|
2320
2312
|
defaultPendingMinMs: 500,
|
|
@@ -2322,9 +2314,9 @@ var Gt = class {
|
|
|
2322
2314
|
...e,
|
|
2323
2315
|
caseSensitive: e.caseSensitive ?? !1,
|
|
2324
2316
|
notFoundMode: e.notFoundMode ?? "fuzzy",
|
|
2325
|
-
stringifySearch: e.stringifySearch ??
|
|
2326
|
-
parseSearch: e.parseSearch ??
|
|
2327
|
-
protocolAllowlist: e.protocolAllowlist ??
|
|
2317
|
+
stringifySearch: e.stringifySearch ?? ft,
|
|
2318
|
+
parseSearch: e.parseSearch ?? dt,
|
|
2319
|
+
protocolAllowlist: e.protocolAllowlist ?? fe
|
|
2328
2320
|
}), typeof document < "u" && (self.__TSR_ROUTER__ = this);
|
|
2329
2321
|
}
|
|
2330
2322
|
isShell() {
|
|
@@ -2334,13 +2326,17 @@ var Gt = class {
|
|
|
2334
2326
|
return !!this.options.isPrerendering;
|
|
2335
2327
|
}
|
|
2336
2328
|
get state() {
|
|
2337
|
-
return this.stores.__store.
|
|
2329
|
+
return this.stores.__store.get();
|
|
2338
2330
|
}
|
|
2339
2331
|
setRoutes({ routesById: e, routesByPath: t, processedTree: n }) {
|
|
2340
2332
|
this.routesById = e, this.routesByPath = t, this.processedTree = n;
|
|
2341
2333
|
let r = this.options.notFoundRoute;
|
|
2342
2334
|
r && (r.init({ originalIndex: 99999999999 }), this.routesById[r.id] = r);
|
|
2343
2335
|
}
|
|
2336
|
+
getRouteBranch(e) {
|
|
2337
|
+
let t = this.routeBranchCache.get(e);
|
|
2338
|
+
return t || (t = Pe(e), this.routeBranchCache.set(e, t)), t;
|
|
2339
|
+
}
|
|
2344
2340
|
get looseRoutesById() {
|
|
2345
2341
|
return this.routesById;
|
|
2346
2342
|
}
|
|
@@ -2348,76 +2344,76 @@ var Gt = class {
|
|
|
2348
2344
|
return e?.id ? e.context ?? this.options.context ?? void 0 : this.options.context ?? void 0;
|
|
2349
2345
|
}
|
|
2350
2346
|
matchRoutesInternal(e, t) {
|
|
2351
|
-
let n = this.getMatchedRoutes(e.pathname), { foundRoute: r, routeParams: i
|
|
2352
|
-
(r ? r.path !== "/" && i["**"] : I(e.pathname)) && (this.options.notFoundRoute ?
|
|
2353
|
-
let
|
|
2354
|
-
for (let e of this.stores.
|
|
2355
|
-
for (let n = 0; n <
|
|
2356
|
-
let r =
|
|
2347
|
+
let n = this.getMatchedRoutes(e.pathname), { foundRoute: r, routeParams: i } = n, { matchedRoutes: a } = n, o = !1;
|
|
2348
|
+
(r ? r.path !== "/" && i["**"] : I(e.pathname)) && (this.options.notFoundRoute ? a = [...a, this.options.notFoundRoute] : o = !0);
|
|
2349
|
+
let s = o ? ln(this.options.notFoundMode, a) : void 0, c = Array(a.length), l = /* @__PURE__ */ new Map();
|
|
2350
|
+
for (let e of this.stores.matchStores.values()) e.routeId && l.set(e.routeId, e.get());
|
|
2351
|
+
for (let n = 0; n < a.length; n++) {
|
|
2352
|
+
let r = a[n], o = c[n - 1], u, d, f;
|
|
2357
2353
|
{
|
|
2358
|
-
let n =
|
|
2354
|
+
let n = o?.search ?? e.search, i = o?._strictSearch ?? void 0;
|
|
2359
2355
|
try {
|
|
2360
|
-
let e =
|
|
2361
|
-
|
|
2356
|
+
let e = an(r.options.validateSearch, { ...n }) ?? void 0;
|
|
2357
|
+
u = {
|
|
2362
2358
|
...n,
|
|
2363
2359
|
...e
|
|
2364
|
-
},
|
|
2360
|
+
}, d = {
|
|
2365
2361
|
...i,
|
|
2366
2362
|
...e
|
|
2367
|
-
},
|
|
2363
|
+
}, f = void 0;
|
|
2368
2364
|
} catch (e) {
|
|
2369
2365
|
let r = e;
|
|
2370
|
-
if (e instanceof
|
|
2371
|
-
|
|
2366
|
+
if (e instanceof Qt || (r = new Qt(e.message, { cause: e })), t?.throwOnError) throw r;
|
|
2367
|
+
u = n, d = {}, f = r;
|
|
2372
2368
|
}
|
|
2373
2369
|
}
|
|
2374
|
-
let
|
|
2370
|
+
let p = r.options.loaderDeps?.({ search: u }) ?? "", m = p ? JSON.stringify(p) : "", { interpolatedPath: h, usedParams: g } = Xe({
|
|
2375
2371
|
path: r.fullPath,
|
|
2376
2372
|
params: i,
|
|
2377
2373
|
decoder: this.pathParamsDecoder,
|
|
2378
2374
|
server: this.isServer
|
|
2379
|
-
}),
|
|
2380
|
-
if (!
|
|
2381
|
-
|
|
2375
|
+
}), _ = r.id + h + m, v = this.getMatch(_), y = l.get(r.id), b = v?._strictParams ?? g, x;
|
|
2376
|
+
if (!v) try {
|
|
2377
|
+
un(r, b);
|
|
2382
2378
|
} catch (e) {
|
|
2383
|
-
if (
|
|
2379
|
+
if (x = L(e) || B(e) ? e : new $t(e.message, { cause: e }), t?.throwOnError) throw x;
|
|
2384
2380
|
}
|
|
2385
|
-
Object.assign(i,
|
|
2386
|
-
let
|
|
2387
|
-
if (
|
|
2388
|
-
...
|
|
2389
|
-
cause:
|
|
2390
|
-
params:
|
|
2391
|
-
_strictParams:
|
|
2392
|
-
search:
|
|
2393
|
-
_strictSearch:
|
|
2381
|
+
Object.assign(i, b);
|
|
2382
|
+
let S = y ? "stay" : "enter", C;
|
|
2383
|
+
if (v) C = {
|
|
2384
|
+
...v,
|
|
2385
|
+
cause: S,
|
|
2386
|
+
params: y?.params ?? i,
|
|
2387
|
+
_strictParams: b,
|
|
2388
|
+
search: E(y ? y.search : v.search, u),
|
|
2389
|
+
_strictSearch: d
|
|
2394
2390
|
};
|
|
2395
2391
|
else {
|
|
2396
|
-
let e = r.options.loader || r.options.beforeLoad || r.lazyFn ||
|
|
2397
|
-
|
|
2398
|
-
id:
|
|
2392
|
+
let e = r.options.loader || r.options.beforeLoad || r.lazyFn || Bt(r) ? "pending" : "success";
|
|
2393
|
+
C = {
|
|
2394
|
+
id: _,
|
|
2399
2395
|
ssr: r.options.ssr,
|
|
2400
2396
|
index: n,
|
|
2401
2397
|
routeId: r.id,
|
|
2402
|
-
params:
|
|
2403
|
-
_strictParams:
|
|
2404
|
-
pathname:
|
|
2398
|
+
params: y?.params ?? i,
|
|
2399
|
+
_strictParams: b,
|
|
2400
|
+
pathname: h,
|
|
2405
2401
|
updatedAt: Date.now(),
|
|
2406
|
-
search:
|
|
2407
|
-
_strictSearch:
|
|
2402
|
+
search: y ? E(y.search, u) : u,
|
|
2403
|
+
_strictSearch: d,
|
|
2408
2404
|
searchError: void 0,
|
|
2409
2405
|
status: e,
|
|
2410
2406
|
isFetching: !1,
|
|
2411
2407
|
error: void 0,
|
|
2412
|
-
paramsError:
|
|
2408
|
+
paramsError: x,
|
|
2413
2409
|
__routeContext: void 0,
|
|
2414
|
-
_nonReactive: { loadPromise:
|
|
2410
|
+
_nonReactive: { loadPromise: A() },
|
|
2415
2411
|
__beforeLoadContext: void 0,
|
|
2416
2412
|
context: {},
|
|
2417
2413
|
abortController: new AbortController(),
|
|
2418
2414
|
fetchCount: 0,
|
|
2419
|
-
cause:
|
|
2420
|
-
loaderDeps:
|
|
2415
|
+
cause: S,
|
|
2416
|
+
loaderDeps: y ? D(y.loaderDeps, p) : p,
|
|
2421
2417
|
invalid: !1,
|
|
2422
2418
|
preload: !1,
|
|
2423
2419
|
links: void 0,
|
|
@@ -2428,18 +2424,18 @@ var Gt = class {
|
|
|
2428
2424
|
fullPath: r.fullPath
|
|
2429
2425
|
};
|
|
2430
2426
|
}
|
|
2431
|
-
t?.preload || (
|
|
2432
|
-
let
|
|
2433
|
-
|
|
2434
|
-
...
|
|
2435
|
-
...
|
|
2436
|
-
...
|
|
2437
|
-
},
|
|
2427
|
+
t?.preload || (C.globalNotFound = s === r.id), C.searchError = f;
|
|
2428
|
+
let w = this.getParentContext(o);
|
|
2429
|
+
C.context = {
|
|
2430
|
+
...w,
|
|
2431
|
+
...C.__routeContext,
|
|
2432
|
+
...C.__beforeLoadContext
|
|
2433
|
+
}, c[n] = C;
|
|
2438
2434
|
}
|
|
2439
|
-
for (let t = 0; t <
|
|
2440
|
-
let n =
|
|
2441
|
-
if (n.params = o ?
|
|
2442
|
-
let i =
|
|
2435
|
+
for (let t = 0; t < c.length; t++) {
|
|
2436
|
+
let n = c[t], r = this.looseRoutesById[n.routeId], a = this.getMatch(n.id), o = l.get(n.routeId);
|
|
2437
|
+
if (n.params = o ? E(o.params, i) : i, !a) {
|
|
2438
|
+
let i = c[t - 1], a = this.getParentContext(i);
|
|
2443
2439
|
if (r.options.context) {
|
|
2444
2440
|
let t = {
|
|
2445
2441
|
deps: n.loaderDeps,
|
|
@@ -2454,7 +2450,7 @@ var Gt = class {
|
|
|
2454
2450
|
cause: n.cause,
|
|
2455
2451
|
abortController: n.abortController,
|
|
2456
2452
|
preload: !!n.preload,
|
|
2457
|
-
matches:
|
|
2453
|
+
matches: c,
|
|
2458
2454
|
routeId: r.id
|
|
2459
2455
|
};
|
|
2460
2456
|
n.__routeContext = r.options.context(t) ?? void 0;
|
|
@@ -2466,37 +2462,37 @@ var Gt = class {
|
|
|
2466
2462
|
};
|
|
2467
2463
|
}
|
|
2468
2464
|
}
|
|
2469
|
-
return
|
|
2465
|
+
return c;
|
|
2470
2466
|
}
|
|
2471
2467
|
matchRoutesLightweight(e) {
|
|
2472
|
-
let { matchedRoutes: t, routeParams: n
|
|
2468
|
+
let { matchedRoutes: t, routeParams: n } = this.getMatchedRoutes(e.pathname), r = w(t), i = { ...e.search };
|
|
2473
2469
|
for (let e of t) try {
|
|
2474
|
-
Object.assign(
|
|
2470
|
+
Object.assign(i, an(e.options.validateSearch, i));
|
|
2475
2471
|
} catch {}
|
|
2476
|
-
let
|
|
2477
|
-
if (
|
|
2472
|
+
let a = w(this.stores.matchesId.get()), o = a && this.stores.matchStores.get(a)?.get(), s = o && o.routeId === r.id && o.pathname === e.pathname, c;
|
|
2473
|
+
if (s) c = o.params;
|
|
2478
2474
|
else {
|
|
2479
2475
|
let e = Object.assign(Object.create(null), n);
|
|
2480
|
-
for (let
|
|
2481
|
-
|
|
2476
|
+
for (let n of t) try {
|
|
2477
|
+
un(n, e);
|
|
2482
2478
|
} catch {}
|
|
2483
|
-
|
|
2479
|
+
c = e;
|
|
2484
2480
|
}
|
|
2485
2481
|
return {
|
|
2486
2482
|
matchedRoutes: t,
|
|
2487
|
-
fullPath:
|
|
2488
|
-
search:
|
|
2489
|
-
params:
|
|
2483
|
+
fullPath: r.fullPath,
|
|
2484
|
+
search: i,
|
|
2485
|
+
params: c
|
|
2490
2486
|
};
|
|
2491
2487
|
}
|
|
2492
|
-
},
|
|
2493
|
-
function
|
|
2494
|
-
return
|
|
2488
|
+
}, Qt = class extends Error {}, $t = class extends Error {}, en = (e) => e.endsWith("/") && e.length > 1 ? e.slice(0, -1) : e;
|
|
2489
|
+
function tn(e, t) {
|
|
2490
|
+
return en(e) === en(t);
|
|
2495
2491
|
}
|
|
2496
|
-
function
|
|
2492
|
+
function nn(e, t) {
|
|
2497
2493
|
return async (...n) => (await e())[t || "default"](...n);
|
|
2498
2494
|
}
|
|
2499
|
-
function
|
|
2495
|
+
function rn(e) {
|
|
2500
2496
|
return {
|
|
2501
2497
|
loadedAt: 0,
|
|
2502
2498
|
isLoading: !1,
|
|
@@ -2508,29 +2504,28 @@ function Zt(e) {
|
|
|
2508
2504
|
statusCode: 200
|
|
2509
2505
|
};
|
|
2510
2506
|
}
|
|
2511
|
-
function
|
|
2507
|
+
function an(e, t) {
|
|
2512
2508
|
if (e == null) return {};
|
|
2513
2509
|
if ("~standard" in e) {
|
|
2514
2510
|
let n = e["~standard"].validate(t);
|
|
2515
|
-
if (n instanceof Promise) throw new
|
|
2516
|
-
if (n.issues) throw new
|
|
2511
|
+
if (n instanceof Promise) throw new Qt("Async validation not supported");
|
|
2512
|
+
if (n.issues) throw new Qt(JSON.stringify(n.issues, void 0, 2), { cause: n });
|
|
2517
2513
|
return n.value;
|
|
2518
2514
|
}
|
|
2519
2515
|
return "parse" in e ? e.parse(t) : typeof e == "function" ? e(t) : {};
|
|
2520
2516
|
}
|
|
2521
|
-
function
|
|
2522
|
-
let r = Object.create(null), i = I(e), a, o
|
|
2523
|
-
return
|
|
2524
|
-
matchedRoutes:
|
|
2517
|
+
function on({ pathname: e, routesById: t, processedTree: n }) {
|
|
2518
|
+
let r = Object.create(null), i = I(e), a, o = ke(i, n, !0);
|
|
2519
|
+
return o && (a = o.route, Object.assign(r, o.rawParams)), {
|
|
2520
|
+
matchedRoutes: o?.branch || [t.__root__],
|
|
2525
2521
|
routeParams: r,
|
|
2526
|
-
foundRoute: a
|
|
2527
|
-
parsedParams: o
|
|
2522
|
+
foundRoute: a
|
|
2528
2523
|
};
|
|
2529
2524
|
}
|
|
2530
|
-
function
|
|
2531
|
-
return
|
|
2525
|
+
function sn({ search: e, dest: t, destRoutes: n, _includeValidateSearch: r }) {
|
|
2526
|
+
return cn(n)(e, t, r ?? !1);
|
|
2532
2527
|
}
|
|
2533
|
-
function
|
|
2528
|
+
function cn(e) {
|
|
2534
2529
|
let t = {
|
|
2535
2530
|
dest: null,
|
|
2536
2531
|
_includeValidateSearch: !1,
|
|
@@ -2547,7 +2542,7 @@ function tn(e) {
|
|
|
2547
2542
|
try {
|
|
2548
2543
|
return {
|
|
2549
2544
|
...i,
|
|
2550
|
-
...
|
|
2545
|
+
...an(n.options.validateSearch, i) ?? void 0
|
|
2551
2546
|
};
|
|
2552
2547
|
} catch {
|
|
2553
2548
|
return i;
|
|
@@ -2555,7 +2550,7 @@ function tn(e) {
|
|
|
2555
2550
|
});
|
|
2556
2551
|
t.middlewares.push(({ search: e }) => {
|
|
2557
2552
|
let n = t.dest;
|
|
2558
|
-
return n.search ? n.search === !0 ? e :
|
|
2553
|
+
return n.search ? n.search === !0 ? e : T(n.search, e) : {};
|
|
2559
2554
|
});
|
|
2560
2555
|
let n = (e, t, r) => {
|
|
2561
2556
|
if (e >= r.length) return t;
|
|
@@ -2569,24 +2564,24 @@ function tn(e) {
|
|
|
2569
2564
|
return t.dest = r, t._includeValidateSearch = i, n(0, e, t.middlewares);
|
|
2570
2565
|
};
|
|
2571
2566
|
}
|
|
2572
|
-
function
|
|
2567
|
+
function ln(e, t) {
|
|
2573
2568
|
if (e !== "root") for (let e = t.length - 1; e >= 0; e--) {
|
|
2574
2569
|
let n = t[e];
|
|
2575
2570
|
if (n.children) return n.id;
|
|
2576
2571
|
}
|
|
2577
|
-
return
|
|
2572
|
+
return z;
|
|
2578
2573
|
}
|
|
2579
|
-
function
|
|
2580
|
-
let
|
|
2581
|
-
if (
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
Object.assign(
|
|
2574
|
+
function un(e, t) {
|
|
2575
|
+
let n = e.options.params?.parse ?? e.options.parseParams;
|
|
2576
|
+
if (n) {
|
|
2577
|
+
let e = n(t);
|
|
2578
|
+
if (e === !1) throw Error("Route params.parse returned false for a matched route");
|
|
2579
|
+
Object.assign(t, e);
|
|
2585
2580
|
}
|
|
2586
2581
|
}
|
|
2587
2582
|
//#endregion
|
|
2588
2583
|
//#region ../router-core/dist/esm/link.js
|
|
2589
|
-
var
|
|
2584
|
+
var dn = "Error preloading route! ☝️", fn = class {
|
|
2590
2585
|
get to() {
|
|
2591
2586
|
return this._to;
|
|
2592
2587
|
}
|
|
@@ -2603,43 +2598,43 @@ var an = "Error preloading route! ☝️", on = class {
|
|
|
2603
2598
|
if (this.init = (e) => {
|
|
2604
2599
|
this.originalIndex = e.originalIndex;
|
|
2605
2600
|
let t = this.options, n = !t?.path && !t?.id;
|
|
2606
|
-
if (this.parentRoute = this.options.getParentRoute?.(), n) this._path =
|
|
2601
|
+
if (this.parentRoute = this.options.getParentRoute?.(), n) this._path = z;
|
|
2607
2602
|
else if (!this.parentRoute) {
|
|
2608
2603
|
if (process.env.NODE_ENV !== "production") throw Error("Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");
|
|
2609
|
-
|
|
2604
|
+
ye();
|
|
2610
2605
|
}
|
|
2611
|
-
let r = n ?
|
|
2612
|
-
r && r !== "/" && (r =
|
|
2613
|
-
let i = t?.id || r, a = n ?
|
|
2614
|
-
r === "__root__" && (r = "/"), a !== "__root__" && (a =
|
|
2615
|
-
let o = a === "__root__" ? "/" :
|
|
2606
|
+
let r = n ? z : t?.path;
|
|
2607
|
+
r && r !== "/" && (r = Ue(r));
|
|
2608
|
+
let i = t?.id || r, a = n ? z : Ve([this.parentRoute.id === "__root__" ? "" : this.parentRoute.id, i]);
|
|
2609
|
+
r === "__root__" && (r = "/"), a !== "__root__" && (a = Ve(["/", a]));
|
|
2610
|
+
let o = a === "__root__" ? "/" : Ve([this.parentRoute.fullPath, r]);
|
|
2616
2611
|
this._path = r, this._id = a, this._fullPath = o, this._to = I(o);
|
|
2617
|
-
}, this.addChildren = (e) => this._addFileChildren(e), this._addFileChildren = (e) => (Array.isArray(e) && (this.children = e), typeof e == "object" && e && (this.children = Object.values(e)), this), this._addFileTypes = () => this, this.updateLoader = (e) => (Object.assign(this.options, e), this), this.update = (e) => (Object.assign(this.options, e), this), this.lazy = (e) => (this.lazyFn = e, this), this.redirect = (e) =>
|
|
2612
|
+
}, this.addChildren = (e) => this._addFileChildren(e), this._addFileChildren = (e) => (Array.isArray(e) && (this.children = e), typeof e == "object" && e && (this.children = Object.values(e)), this), this._addFileTypes = () => this, this.updateLoader = (e) => (Object.assign(this.options, e), this), this.update = (e) => (Object.assign(this.options, e), this), this.lazy = (e) => (this.lazyFn = e, this), this.redirect = (e) => ht({
|
|
2618
2613
|
from: this.fullPath,
|
|
2619
2614
|
...e
|
|
2620
2615
|
}), this.options = e || {}, this.isRoot = !e?.getParentRoute, e?.id && e?.path) throw Error("Route cannot have both an 'id' and a 'path' option.");
|
|
2621
2616
|
}
|
|
2622
|
-
},
|
|
2617
|
+
}, pn = class {
|
|
2623
2618
|
constructor({ id: e }) {
|
|
2624
|
-
this.notFound = (e) =>
|
|
2619
|
+
this.notFound = (e) => Qe({
|
|
2625
2620
|
routeId: this.id,
|
|
2626
2621
|
...e
|
|
2627
|
-
}), this.redirect = (e) =>
|
|
2622
|
+
}), this.redirect = (e) => ht({
|
|
2628
2623
|
from: this.id,
|
|
2629
2624
|
...e
|
|
2630
2625
|
}), this.id = e;
|
|
2631
2626
|
}
|
|
2632
|
-
},
|
|
2627
|
+
}, mn = class extends fn {
|
|
2633
2628
|
constructor(e) {
|
|
2634
2629
|
super(e);
|
|
2635
2630
|
}
|
|
2636
|
-
},
|
|
2631
|
+
}, hn = (e) => ({
|
|
2637
2632
|
serializationAdapters: e.serializationAdapters,
|
|
2638
2633
|
defaultSsr: e.defaultSsr
|
|
2639
2634
|
});
|
|
2640
2635
|
//#endregion
|
|
2641
2636
|
//#region ../router-core/dist/esm/searchMiddleware.js
|
|
2642
|
-
function
|
|
2637
|
+
function gn(e) {
|
|
2643
2638
|
return ({ search: t, next: n }) => {
|
|
2644
2639
|
let r = n(t);
|
|
2645
2640
|
if (e === !0) return {
|
|
@@ -2654,9 +2649,9 @@ function un(e) {
|
|
|
2654
2649
|
}
|
|
2655
2650
|
//#endregion
|
|
2656
2651
|
//#region ../router-core/dist/esm/hash-scroll.js
|
|
2657
|
-
function
|
|
2652
|
+
function _n(e) {
|
|
2658
2653
|
if (typeof document < "u" && document.querySelector) {
|
|
2659
|
-
let t = e.stores.location.
|
|
2654
|
+
let t = e.stores.location.get(), n = t.state.__hashScrollIntoViewOptions ?? !0;
|
|
2660
2655
|
if (n && t.hash !== "") {
|
|
2661
2656
|
let e = document.getElementById(t.hash);
|
|
2662
2657
|
e && e.scrollIntoView(n);
|
|
@@ -2665,113 +2660,99 @@ function dn(e) {
|
|
|
2665
2660
|
}
|
|
2666
2661
|
//#endregion
|
|
2667
2662
|
//#region src/routerStores.ts
|
|
2668
|
-
function
|
|
2663
|
+
function vn(e, t) {
|
|
2669
2664
|
e.childMatchIdByRouteId = t(() => {
|
|
2670
|
-
let t = e.matchesId.
|
|
2665
|
+
let t = e.matchesId.get(), n = {};
|
|
2671
2666
|
for (let r = 0; r < t.length - 1; r++) {
|
|
2672
|
-
let i = t[r]
|
|
2673
|
-
|
|
2674
|
-
let o = e.activeMatchStoresById.get(i);
|
|
2675
|
-
o?.routeId && (n[o.routeId] = a);
|
|
2667
|
+
let i = e.matchStores.get(t[r]);
|
|
2668
|
+
i?.routeId && (n[i.routeId] = t[r + 1]);
|
|
2676
2669
|
}
|
|
2677
2670
|
return n;
|
|
2678
2671
|
}), e.pendingRouteIds = t(() => {
|
|
2679
|
-
let t = e.
|
|
2672
|
+
let t = e.pendingIds.get(), n = {};
|
|
2680
2673
|
for (let r of t) {
|
|
2681
|
-
let t = e.
|
|
2674
|
+
let t = e.pendingMatchStores.get(r);
|
|
2682
2675
|
t?.routeId && (n[t.routeId] = !0);
|
|
2683
2676
|
}
|
|
2684
2677
|
return n;
|
|
2685
2678
|
});
|
|
2686
2679
|
}
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
setState(e) {
|
|
2694
|
-
n.update(e);
|
|
2695
|
-
}
|
|
2696
|
-
};
|
|
2697
|
-
}
|
|
2698
|
-
function mn(t) {
|
|
2699
|
-
let n = e.computed(t);
|
|
2700
|
-
return { get state() {
|
|
2701
|
-
return n();
|
|
2702
|
-
} };
|
|
2703
|
-
}
|
|
2704
|
-
var hn = (e) => ({
|
|
2705
|
-
createMutableStore: pn,
|
|
2706
|
-
createReadonlyStore: mn,
|
|
2707
|
-
batch: (e) => e(),
|
|
2708
|
-
init: (e) => fn(e, mn)
|
|
2709
|
-
}), gn = (e) => new _n(e), _n = class extends Gt {
|
|
2680
|
+
var yn = (n) => ({
|
|
2681
|
+
createMutableStore: t,
|
|
2682
|
+
createReadonlyStore: t,
|
|
2683
|
+
batch: e,
|
|
2684
|
+
init: (e) => vn(e, t)
|
|
2685
|
+
}), bn = (e) => new xn(e), xn = class extends Zt {
|
|
2710
2686
|
constructor(e) {
|
|
2711
|
-
super(e,
|
|
2687
|
+
super(e, yn);
|
|
2712
2688
|
}
|
|
2713
|
-
},
|
|
2689
|
+
}, Sn = {
|
|
2714
2690
|
matchId: () => void 0,
|
|
2715
2691
|
routeId: () => void 0,
|
|
2716
2692
|
match: () => void 0,
|
|
2717
2693
|
hasPending: () => !1
|
|
2718
|
-
}, q = new
|
|
2694
|
+
}, q = new n.InjectionToken("MATCH_CONTEXT_INJECTOR", {
|
|
2719
2695
|
providedIn: "root",
|
|
2720
|
-
factory: () =>
|
|
2721
|
-
}),
|
|
2722
|
-
function
|
|
2723
|
-
return typeof document > "u" ?
|
|
2696
|
+
factory: () => Sn
|
|
2697
|
+
}), Cn = new n.InjectionToken("ROUTER");
|
|
2698
|
+
function wn() {
|
|
2699
|
+
return typeof document > "u" ? Cn : window.__TSR_ROUTER_INJECTION_KEY__ ? window.__TSR_ROUTER_INJECTION_KEY__ : (window.__TSR_ROUTER_INJECTION_KEY__ = Cn, Cn);
|
|
2724
2700
|
}
|
|
2725
2701
|
//#endregion
|
|
2726
2702
|
//#region src/injectRouter.ts
|
|
2727
|
-
function J(
|
|
2728
|
-
let
|
|
2729
|
-
return process.env.NODE_ENV !== "production" && (
|
|
2703
|
+
function J(e) {
|
|
2704
|
+
let t = n.inject(wn(), { optional: !0 });
|
|
2705
|
+
return process.env.NODE_ENV !== "production" && (e?.warn ?? !0) && !t && console.warn("Warning: injectRouter must be used inside a <router-provider> component!"), t;
|
|
2730
2706
|
}
|
|
2731
2707
|
//#endregion
|
|
2732
|
-
//#region src/
|
|
2733
|
-
function
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
for (let r of n) if (!Object.prototype.hasOwnProperty.call(t, r) || !Object.is(e[r], t[r])) return !1;
|
|
2757
|
-
return !0;
|
|
2708
|
+
//#region src/store/injectSelector.ts
|
|
2709
|
+
function Tn(e, t) {
|
|
2710
|
+
return t || (f(e), h(c));
|
|
2711
|
+
}
|
|
2712
|
+
function En(e, t = (e) => e, n) {
|
|
2713
|
+
return b(Tn(En, n?.injector), () => {
|
|
2714
|
+
let r = typeof e == "function" ? e : () => e, i = y(() => t(r().get()), { equal: n?.compare });
|
|
2715
|
+
return m((e) => {
|
|
2716
|
+
let { unsubscribe: n } = r().subscribe((e) => {
|
|
2717
|
+
i.set(t(e));
|
|
2718
|
+
});
|
|
2719
|
+
e(n);
|
|
2720
|
+
}), i.asReadonly();
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
//#endregion
|
|
2724
|
+
//#region src/store/injectStore.ts
|
|
2725
|
+
function Y(e, t = (e) => e, n) {
|
|
2726
|
+
let { equal: r, injector: i, ...a } = n ?? {};
|
|
2727
|
+
return En(e, t, {
|
|
2728
|
+
...a,
|
|
2729
|
+
compare: r,
|
|
2730
|
+
injector: i
|
|
2731
|
+
});
|
|
2758
2732
|
}
|
|
2759
2733
|
//#endregion
|
|
2760
2734
|
//#region src/injectMatch.ts
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2735
|
+
var Dn = {
|
|
2736
|
+
get: () => void 0,
|
|
2737
|
+
subscribe: () => ({ unsubscribe: () => {} })
|
|
2738
|
+
};
|
|
2739
|
+
function X(e) {
|
|
2740
|
+
let t = J(), r = e.from ? void 0 : n.inject(q), i = Y(e.from ? t.stores.getRouteMatchStore(e.from) : () => {
|
|
2741
|
+
let e = r?.matchId();
|
|
2742
|
+
return e ? t.stores.matchStores.get(e) ?? Dn : Dn;
|
|
2743
|
+
}, (e) => e), a = Y(t.stores.pendingRouteIds, (e) => e), o = Y(t.stores.isTransitioning, (e) => e);
|
|
2744
|
+
return n.computed(() => {
|
|
2745
|
+
let t = i();
|
|
2746
|
+
if (t !== void 0) return e.select ? e.select(t) : t;
|
|
2747
|
+
if (!(e.from ? a()[e.from] : r?.hasPending() ?? !1) && !o() && (e.shouldThrow ?? !0)) {
|
|
2748
|
+
if (process.env.NODE_ENV !== "production") throw Error(`Invariant failed: Could not find ${e.from ? `an active match from "${e.from}"` : "a nearest match!"}`);
|
|
2749
|
+
ye();
|
|
2769
2750
|
}
|
|
2770
|
-
}, { equal:
|
|
2751
|
+
}, { equal: k });
|
|
2771
2752
|
}
|
|
2772
2753
|
//#endregion
|
|
2773
2754
|
//#region src/injectLoaderData.ts
|
|
2774
|
-
function
|
|
2755
|
+
function On(e) {
|
|
2775
2756
|
return X({
|
|
2776
2757
|
from: e.from,
|
|
2777
2758
|
strict: e.strict,
|
|
@@ -2780,7 +2761,7 @@ function Sn(e) {
|
|
|
2780
2761
|
}
|
|
2781
2762
|
//#endregion
|
|
2782
2763
|
//#region src/injectLoaderDeps.ts
|
|
2783
|
-
function
|
|
2764
|
+
function kn(e) {
|
|
2784
2765
|
let { select: t, ...n } = e;
|
|
2785
2766
|
return X({
|
|
2786
2767
|
...n,
|
|
@@ -2789,7 +2770,7 @@ function Cn(e) {
|
|
|
2789
2770
|
}
|
|
2790
2771
|
//#endregion
|
|
2791
2772
|
//#region src/injectNavigate.ts
|
|
2792
|
-
function
|
|
2773
|
+
function An(e) {
|
|
2793
2774
|
let t = J();
|
|
2794
2775
|
return ((n) => t.navigate({
|
|
2795
2776
|
...n,
|
|
@@ -2798,7 +2779,7 @@ function wn(e) {
|
|
|
2798
2779
|
}
|
|
2799
2780
|
//#endregion
|
|
2800
2781
|
//#region src/injectParams.ts
|
|
2801
|
-
function
|
|
2782
|
+
function jn(e) {
|
|
2802
2783
|
return X({
|
|
2803
2784
|
from: e.from,
|
|
2804
2785
|
strict: e.strict,
|
|
@@ -2808,7 +2789,7 @@ function Tn(e) {
|
|
|
2808
2789
|
}
|
|
2809
2790
|
//#endregion
|
|
2810
2791
|
//#region src/injectRouteContext.ts
|
|
2811
|
-
function
|
|
2792
|
+
function Mn(e) {
|
|
2812
2793
|
return X({
|
|
2813
2794
|
...e,
|
|
2814
2795
|
select: (t) => e.select ? e.select(t.context) : t.context
|
|
@@ -2816,7 +2797,7 @@ function En(e) {
|
|
|
2816
2797
|
}
|
|
2817
2798
|
//#endregion
|
|
2818
2799
|
//#region src/injectSearch.ts
|
|
2819
|
-
function
|
|
2800
|
+
function Nn(e) {
|
|
2820
2801
|
return X({
|
|
2821
2802
|
from: e.from,
|
|
2822
2803
|
strict: e.strict,
|
|
@@ -2826,37 +2807,37 @@ function Dn(e) {
|
|
|
2826
2807
|
}
|
|
2827
2808
|
//#endregion
|
|
2828
2809
|
//#region src/route.ts
|
|
2829
|
-
function
|
|
2830
|
-
return new
|
|
2810
|
+
function Pn(e) {
|
|
2811
|
+
return new Fn({ id: e });
|
|
2831
2812
|
}
|
|
2832
|
-
var
|
|
2813
|
+
var Fn = class extends pn {
|
|
2833
2814
|
constructor({ id: e }) {
|
|
2834
2815
|
super({ id: e }), this.injectMatch = (e) => X({
|
|
2835
2816
|
select: e?.select,
|
|
2836
2817
|
from: this.id
|
|
2837
|
-
}), this.injectRouteContext = (e) =>
|
|
2818
|
+
}), this.injectRouteContext = (e) => Mn({
|
|
2838
2819
|
...e,
|
|
2839
2820
|
from: this.id
|
|
2840
|
-
}), this.injectSearch = (e) =>
|
|
2821
|
+
}), this.injectSearch = (e) => Nn({
|
|
2841
2822
|
select: e?.select,
|
|
2842
2823
|
from: this.id
|
|
2843
|
-
}), this.injectParams = (e) =>
|
|
2824
|
+
}), this.injectParams = (e) => jn({
|
|
2844
2825
|
select: e?.select,
|
|
2845
2826
|
from: this.id
|
|
2846
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2827
|
+
}), this.injectLoaderDeps = (e) => kn({
|
|
2847
2828
|
...e,
|
|
2848
2829
|
from: this.id,
|
|
2849
2830
|
strict: !1
|
|
2850
|
-
}), this.injectLoaderData = (e) =>
|
|
2831
|
+
}), this.injectLoaderData = (e) => On({
|
|
2851
2832
|
...e,
|
|
2852
2833
|
from: this.id,
|
|
2853
2834
|
strict: !1
|
|
2854
|
-
}), this.injectNavigate = () =>
|
|
2835
|
+
}), this.injectNavigate = () => An({ from: J().routesById[this.id].fullPath }), this.notFound = (e) => Qe({
|
|
2855
2836
|
routeId: this.id,
|
|
2856
2837
|
...e
|
|
2857
2838
|
});
|
|
2858
2839
|
}
|
|
2859
|
-
},
|
|
2840
|
+
}, In = class extends fn {
|
|
2860
2841
|
constructor(e) {
|
|
2861
2842
|
super(e), this.injectMatch = (e) => X({
|
|
2862
2843
|
select: e?.select,
|
|
@@ -2865,28 +2846,28 @@ var kn = class extends sn {
|
|
|
2865
2846
|
...e,
|
|
2866
2847
|
from: this.id,
|
|
2867
2848
|
select: (t) => e?.select ? e.select(t.context) : t.context
|
|
2868
|
-
}), this.injectSearch = (e) =>
|
|
2849
|
+
}), this.injectSearch = (e) => Nn({
|
|
2869
2850
|
select: e?.select,
|
|
2870
2851
|
from: this.id
|
|
2871
|
-
}), this.injectParams = (e) =>
|
|
2852
|
+
}), this.injectParams = (e) => jn({
|
|
2872
2853
|
select: e?.select,
|
|
2873
2854
|
from: this.id
|
|
2874
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2855
|
+
}), this.injectLoaderDeps = (e) => kn({
|
|
2875
2856
|
...e,
|
|
2876
2857
|
from: this.id
|
|
2877
|
-
}), this.injectLoaderData = (e) =>
|
|
2858
|
+
}), this.injectLoaderData = (e) => On({
|
|
2878
2859
|
...e,
|
|
2879
2860
|
from: this.id
|
|
2880
|
-
}), this.injectNavigate = () =>
|
|
2861
|
+
}), this.injectNavigate = () => An({ from: this.fullPath });
|
|
2881
2862
|
}
|
|
2882
2863
|
};
|
|
2883
|
-
function
|
|
2884
|
-
return new
|
|
2864
|
+
function Ln(e) {
|
|
2865
|
+
return new In(e);
|
|
2885
2866
|
}
|
|
2886
|
-
function
|
|
2887
|
-
return (e) =>
|
|
2867
|
+
function Rn() {
|
|
2868
|
+
return (e) => Hn(e);
|
|
2888
2869
|
}
|
|
2889
|
-
var
|
|
2870
|
+
var zn = class extends mn {
|
|
2890
2871
|
constructor(e) {
|
|
2891
2872
|
super(e), this.injectMatch = (e) => X({
|
|
2892
2873
|
select: e?.select,
|
|
@@ -2895,25 +2876,25 @@ var Nn = class extends cn {
|
|
|
2895
2876
|
...e,
|
|
2896
2877
|
from: this.id,
|
|
2897
2878
|
select: (t) => e?.select ? e.select(t.context) : t.context
|
|
2898
|
-
}), this.injectSearch = (e) =>
|
|
2879
|
+
}), this.injectSearch = (e) => Nn({
|
|
2899
2880
|
select: e?.select,
|
|
2900
2881
|
from: this.id
|
|
2901
|
-
}), this.injectParams = (e) =>
|
|
2882
|
+
}), this.injectParams = (e) => jn({
|
|
2902
2883
|
select: e?.select,
|
|
2903
2884
|
from: this.id
|
|
2904
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2885
|
+
}), this.injectLoaderDeps = (e) => kn({
|
|
2905
2886
|
...e,
|
|
2906
2887
|
from: this.id
|
|
2907
|
-
}), this.injectLoaderData = (e) =>
|
|
2888
|
+
}), this.injectLoaderData = (e) => On({
|
|
2908
2889
|
...e,
|
|
2909
2890
|
from: this.id
|
|
2910
|
-
}), this.injectNavigate = () =>
|
|
2891
|
+
}), this.injectNavigate = () => An({ from: this.fullPath });
|
|
2911
2892
|
}
|
|
2912
2893
|
};
|
|
2913
|
-
function
|
|
2894
|
+
function Bn(e) {
|
|
2914
2895
|
return e;
|
|
2915
2896
|
}
|
|
2916
|
-
var
|
|
2897
|
+
var Vn = class extends In {
|
|
2917
2898
|
constructor(e) {
|
|
2918
2899
|
super({
|
|
2919
2900
|
...e,
|
|
@@ -2921,98 +2902,98 @@ var Fn = class extends An {
|
|
|
2921
2902
|
});
|
|
2922
2903
|
}
|
|
2923
2904
|
};
|
|
2924
|
-
function
|
|
2925
|
-
return new
|
|
2905
|
+
function Hn(e) {
|
|
2906
|
+
return new zn(e);
|
|
2926
2907
|
}
|
|
2927
2908
|
//#endregion
|
|
2928
2909
|
//#region src/fileRoute.ts
|
|
2929
|
-
function
|
|
2930
|
-
return typeof e == "object" ? new
|
|
2910
|
+
function Un(e) {
|
|
2911
|
+
return typeof e == "object" ? new Wn().createRoute(e) : new Wn().createRoute;
|
|
2931
2912
|
}
|
|
2932
|
-
var
|
|
2913
|
+
var Wn = class {
|
|
2933
2914
|
constructor() {
|
|
2934
2915
|
this.createRoute = (e) => {
|
|
2935
|
-
let t =
|
|
2916
|
+
let t = Ln(e);
|
|
2936
2917
|
return t.isRoot = !1, t;
|
|
2937
2918
|
};
|
|
2938
2919
|
}
|
|
2939
|
-
},
|
|
2920
|
+
}, Gn = class {
|
|
2940
2921
|
constructor(e) {
|
|
2941
2922
|
this.injectMatch = (e) => X({
|
|
2942
2923
|
select: e?.select,
|
|
2943
2924
|
from: this.options.id
|
|
2944
|
-
}), this.injectRouteContext = (e) =>
|
|
2925
|
+
}), this.injectRouteContext = (e) => Mn({
|
|
2945
2926
|
...e,
|
|
2946
2927
|
from: this.options.id
|
|
2947
|
-
}), this.injectSearch = (e) =>
|
|
2928
|
+
}), this.injectSearch = (e) => Nn({
|
|
2948
2929
|
select: e?.select,
|
|
2949
2930
|
from: this.options.id
|
|
2950
|
-
}), this.injectParams = (e) =>
|
|
2931
|
+
}), this.injectParams = (e) => jn({
|
|
2951
2932
|
select: e?.select,
|
|
2952
2933
|
from: this.options.id
|
|
2953
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2934
|
+
}), this.injectLoaderDeps = (e) => kn({
|
|
2954
2935
|
...e,
|
|
2955
2936
|
from: this.options.id
|
|
2956
|
-
}), this.injectLoaderData = (e) =>
|
|
2937
|
+
}), this.injectLoaderData = (e) => On({
|
|
2957
2938
|
...e,
|
|
2958
2939
|
from: this.options.id
|
|
2959
|
-
}), this.injectNavigate = () =>
|
|
2940
|
+
}), this.injectNavigate = () => An({ from: J().routesById[this.options.id].fullPath }), this.options = e;
|
|
2960
2941
|
}
|
|
2961
2942
|
};
|
|
2962
|
-
function
|
|
2963
|
-
return (t) => new
|
|
2943
|
+
function Kn(e) {
|
|
2944
|
+
return (t) => new Gn({
|
|
2964
2945
|
id: e,
|
|
2965
2946
|
...t
|
|
2966
2947
|
});
|
|
2967
2948
|
}
|
|
2968
|
-
function
|
|
2969
|
-
return typeof e == "object" ? new
|
|
2949
|
+
function qn(e) {
|
|
2950
|
+
return typeof e == "object" ? new Gn(e) : (t) => new Gn({
|
|
2970
2951
|
id: e,
|
|
2971
2952
|
...t
|
|
2972
2953
|
});
|
|
2973
2954
|
}
|
|
2974
2955
|
//#endregion
|
|
2975
2956
|
//#region src/renderer/injectRender.ts
|
|
2976
|
-
function
|
|
2977
|
-
let t =
|
|
2978
|
-
|
|
2979
|
-
let
|
|
2980
|
-
if (
|
|
2981
|
-
|
|
2982
|
-
let
|
|
2983
|
-
if (!
|
|
2984
|
-
let
|
|
2985
|
-
providers:
|
|
2986
|
-
parent:
|
|
2987
|
-
}), u = Object.entries(
|
|
2988
|
-
t.createComponent(
|
|
2957
|
+
function Jn(e) {
|
|
2958
|
+
let t = h(u), n = h(c), r = [];
|
|
2959
|
+
m(() => {
|
|
2960
|
+
let i = e(), a = Yn(i);
|
|
2961
|
+
if (Xn(r, a)) return;
|
|
2962
|
+
r.length > 0 && t.clear(), r = a;
|
|
2963
|
+
let o = i?.component;
|
|
2964
|
+
if (!o) return;
|
|
2965
|
+
let s = i.providers ?? [], l = c.create({
|
|
2966
|
+
providers: s,
|
|
2967
|
+
parent: n
|
|
2968
|
+
}), u = Object.entries(i.inputs ?? {}).map(([e, t]) => _(e, t));
|
|
2969
|
+
t.createComponent(o, {
|
|
2989
2970
|
injector: l,
|
|
2990
2971
|
bindings: u
|
|
2991
2972
|
}).changeDetectorRef.markForCheck();
|
|
2992
|
-
}),
|
|
2973
|
+
}), h(i).onDestroy(() => {
|
|
2993
2974
|
t.clear();
|
|
2994
2975
|
});
|
|
2995
2976
|
}
|
|
2996
|
-
function
|
|
2977
|
+
function Yn(e) {
|
|
2997
2978
|
let t = e?.component;
|
|
2998
2979
|
return !e || !t ? [] : [t, e.key];
|
|
2999
2980
|
}
|
|
3000
|
-
function
|
|
2981
|
+
function Xn(e, t) {
|
|
3001
2982
|
if (e.length !== t.length) return !1;
|
|
3002
2983
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
3003
2984
|
return !0;
|
|
3004
2985
|
}
|
|
3005
2986
|
//#endregion
|
|
3006
2987
|
//#region src/DefaultNotFound.ts
|
|
3007
|
-
var
|
|
2988
|
+
var Zn = class e {
|
|
3008
2989
|
static {
|
|
3009
|
-
this.ɵfac = function(
|
|
3010
|
-
return new (
|
|
2990
|
+
this.ɵfac = function(t) {
|
|
2991
|
+
return new (t || e)();
|
|
3011
2992
|
};
|
|
3012
2993
|
}
|
|
3013
2994
|
static {
|
|
3014
|
-
this.ɵcmp = /* @__PURE__ */
|
|
3015
|
-
type:
|
|
2995
|
+
this.ɵcmp = /* @__PURE__ */ n.ɵɵdefineComponent({
|
|
2996
|
+
type: e,
|
|
3016
2997
|
selectors: [["tanstack-angular-router-default-no-found"]],
|
|
3017
2998
|
hostAttrs: [
|
|
3018
2999
|
2,
|
|
@@ -3021,37 +3002,37 @@ var Gn = class n {
|
|
|
3021
3002
|
],
|
|
3022
3003
|
decls: 2,
|
|
3023
3004
|
vars: 0,
|
|
3024
|
-
template: function(
|
|
3025
|
-
|
|
3005
|
+
template: function(e, t) {
|
|
3006
|
+
e & 1 && (n.ɵɵelementStart(0, "p"), n.ɵɵtext(1, "Not found"), n.ɵɵelementEnd());
|
|
3026
3007
|
},
|
|
3027
3008
|
encapsulation: 2,
|
|
3028
|
-
changeDetection:
|
|
3009
|
+
changeDetection: r.OnPush
|
|
3029
3010
|
});
|
|
3030
3011
|
}
|
|
3031
|
-
},
|
|
3032
|
-
function
|
|
3033
|
-
let
|
|
3034
|
-
if (!
|
|
3035
|
-
return
|
|
3012
|
+
}, Qn = new n.InjectionToken("ERROR_STATE_INJECTOR_TOKEN");
|
|
3013
|
+
function $n() {
|
|
3014
|
+
let e = n.inject(Qn, { optional: !0 });
|
|
3015
|
+
if (!e) throw Error("injectErrorState was called outside of an error component");
|
|
3016
|
+
return e;
|
|
3036
3017
|
}
|
|
3037
3018
|
//#endregion
|
|
3038
3019
|
//#region src/injectRouterState.ts
|
|
3039
|
-
function
|
|
3040
|
-
let
|
|
3041
|
-
return e
|
|
3020
|
+
function er(e) {
|
|
3021
|
+
let t = J({ warn: e?.router === void 0 }), n = e?.router ?? t;
|
|
3022
|
+
return e?.select ? Y(n.stores.__store, e.select, { equal: k }) : Y(n.stores.__store);
|
|
3042
3023
|
}
|
|
3043
3024
|
//#endregion
|
|
3044
3025
|
//#region src/renderer/injectIsCatchingError.ts
|
|
3045
|
-
function
|
|
3046
|
-
let
|
|
3047
|
-
return
|
|
3048
|
-
if (
|
|
3026
|
+
function tr({ matchId: e }) {
|
|
3027
|
+
let t = J(), r = er({ select: (e) => e.matches }), i = n.computed(() => r().findIndex((t) => t.id === e()));
|
|
3028
|
+
return n.computed(() => {
|
|
3029
|
+
if (t.options.defaultErrorComponent != null) return !1;
|
|
3049
3030
|
let e = i();
|
|
3050
3031
|
if (e === -1) return !1;
|
|
3051
|
-
let
|
|
3052
|
-
for (let r = e + 1; r <
|
|
3053
|
-
let e =
|
|
3054
|
-
if (
|
|
3032
|
+
let n = r();
|
|
3033
|
+
for (let r = e + 1; r < n.length; r++) {
|
|
3034
|
+
let e = n[r];
|
|
3035
|
+
if (t.routesById[e?.routeId].options.errorComponent != null) return !1;
|
|
3055
3036
|
if (e?.status === "error") return !0;
|
|
3056
3037
|
}
|
|
3057
3038
|
return !1;
|
|
@@ -3059,30 +3040,31 @@ function Yn({ matchId: t }) {
|
|
|
3059
3040
|
}
|
|
3060
3041
|
//#endregion
|
|
3061
3042
|
//#region src/Match.ts
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3043
|
+
var nr = {
|
|
3044
|
+
get: () => void 0,
|
|
3045
|
+
subscribe: () => ({ unsubscribe: () => {} })
|
|
3046
|
+
};
|
|
3047
|
+
function rr({ parentRouteIsRoot: e }) {
|
|
3048
|
+
let t = J({ warn: !1 }), n = h(o), r = h(i), a = Y(t.stores.resolvedLocation, (e) => e?.state?.__TSR_key), s = Y(t.stores.loadedAt, (e) => e), c, l = 0;
|
|
3049
|
+
r.onDestroy(() => {
|
|
3050
|
+
l++;
|
|
3051
|
+
}), m(() => {
|
|
3067
3052
|
if (!e()) return;
|
|
3068
|
-
|
|
3069
|
-
let
|
|
3070
|
-
|
|
3071
|
-
if (
|
|
3072
|
-
let
|
|
3073
|
-
c !== void 0 && c ===
|
|
3053
|
+
a(), s();
|
|
3054
|
+
let r = ++l;
|
|
3055
|
+
d({ read: () => {
|
|
3056
|
+
if (r !== l || !e() || t.isServer) return;
|
|
3057
|
+
let n = t.latestLocation.href;
|
|
3058
|
+
c !== void 0 && c === n || (c = n, t.emit({
|
|
3074
3059
|
type: "onRendered",
|
|
3075
|
-
...K(t.stores.location.
|
|
3060
|
+
...K(t.stores.location.get(), t.stores.resolvedLocation.get())
|
|
3076
3061
|
}));
|
|
3077
|
-
} }, { injector:
|
|
3062
|
+
} }, { injector: n });
|
|
3078
3063
|
});
|
|
3079
3064
|
}
|
|
3080
|
-
var
|
|
3065
|
+
var ir = class e {
|
|
3081
3066
|
constructor() {
|
|
3082
|
-
this.matchId =
|
|
3083
|
-
let e = this.matchId();
|
|
3084
|
-
return e ? this.router.stores.activeMatchStoresById.get(e)?.state : void 0;
|
|
3085
|
-
}), this.matchData = d(() => {
|
|
3067
|
+
this.matchId = g.required(), this.router = J(), this.match = p(() => this.matchSignal()), this.matchSignal = Y(() => this.router.stores.matchStores.get(this.matchId()) ?? nr, (e) => e), this.matchData = p(() => {
|
|
3086
3068
|
let e = this.match();
|
|
3087
3069
|
if (!e) return null;
|
|
3088
3070
|
let t = e.routeId, n = this.router.routesById[t], r = n.parentRoute?.id ?? null, i = (n.options.remountDeps ?? this.router.options.defaultRemountDeps)?.({
|
|
@@ -3097,29 +3079,29 @@ var Zn = class t {
|
|
|
3097
3079
|
match: e,
|
|
3098
3080
|
parentRouteId: r
|
|
3099
3081
|
};
|
|
3100
|
-
}), this.isFistRouteInRouteTree =
|
|
3082
|
+
}), this.isFistRouteInRouteTree = p(() => this.matchData()?.parentRouteId === z), this.resolvedNoSsr = p(() => {
|
|
3101
3083
|
let e = this.matchData()?.match;
|
|
3102
3084
|
return e ? e.ssr === !1 || e.ssr === "data-only" : !0;
|
|
3103
|
-
}), this.shouldClientOnly =
|
|
3085
|
+
}), this.shouldClientOnly = p(() => {
|
|
3104
3086
|
let e = this.matchData()?.match;
|
|
3105
3087
|
return e ? this.resolvedNoSsr() || !!e._displayPending : !0;
|
|
3106
|
-
}), this.parentRouteIdSignal =
|
|
3088
|
+
}), this.parentRouteIdSignal = p(() => this.matchData()?.parentRouteId ?? ""), this.rootRouteIdSignal = p(() => z), this.hasPendingMatch = p(() => {
|
|
3107
3089
|
let e = this.matchData()?.route.id;
|
|
3108
3090
|
return e ? !!this.pendingRouteIds()[e] : !1;
|
|
3109
3091
|
}), this.pendingRouteIds = Y(this.router.stores.pendingRouteIds, (e) => e), this.nearestMatchContext = {
|
|
3110
3092
|
matchId: this.matchId,
|
|
3111
|
-
routeId:
|
|
3093
|
+
routeId: p(() => this.matchData()?.route.id),
|
|
3112
3094
|
match: this.match,
|
|
3113
3095
|
hasPending: this.hasPendingMatch
|
|
3114
|
-
}, this.isCatchingError =
|
|
3096
|
+
}, this.isCatchingError = tr({ matchId: this.matchId }), this.render = Jn(() => {
|
|
3115
3097
|
let e = this.matchData();
|
|
3116
3098
|
if (!e || this.shouldClientOnly() && this.router.isServer) return null;
|
|
3117
3099
|
let { match: t, route: n } = e;
|
|
3118
|
-
if (t.status === "notFound") return { component:
|
|
3100
|
+
if (t.status === "notFound") return { component: or(this.router, n) };
|
|
3119
3101
|
if (t.status === "error" || this.isCatchingError()) return {
|
|
3120
3102
|
component: (Z(n.options.errorComponent) ?? Z(this.router.options.defaultErrorComponent)) || null,
|
|
3121
3103
|
providers: [{
|
|
3122
|
-
provide:
|
|
3104
|
+
provide: Qn,
|
|
3123
3105
|
useValue: {
|
|
3124
3106
|
error: t.error,
|
|
3125
3107
|
reset: () => {
|
|
@@ -3131,7 +3113,7 @@ var Zn = class t {
|
|
|
3131
3113
|
};
|
|
3132
3114
|
if (t.status === "redirected" || t.status === "pending") {
|
|
3133
3115
|
let t = n.isRoot && (Z(n.options.component) ?? Z(this.router.options.defaultComponent));
|
|
3134
|
-
return t && t !==
|
|
3116
|
+
return t && t !== ar ? {
|
|
3135
3117
|
key: e.key,
|
|
3136
3118
|
component: t,
|
|
3137
3119
|
providers: [{
|
|
@@ -3140,7 +3122,7 @@ var Zn = class t {
|
|
|
3140
3122
|
}]
|
|
3141
3123
|
} : { component: Z(n.options.pendingComponent) ?? Z(this.router.options.defaultPendingComponent) };
|
|
3142
3124
|
} else {
|
|
3143
|
-
let t = Z(n.options.component) ?? Z(this.router.options.defaultComponent) ??
|
|
3125
|
+
let t = Z(n.options.component) ?? Z(this.router.options.defaultComponent) ?? ar;
|
|
3144
3126
|
return {
|
|
3145
3127
|
key: e.key,
|
|
3146
3128
|
component: t,
|
|
@@ -3150,24 +3132,25 @@ var Zn = class t {
|
|
|
3150
3132
|
}]
|
|
3151
3133
|
};
|
|
3152
3134
|
}
|
|
3153
|
-
}), this.onRendered =
|
|
3135
|
+
}), this.onRendered = rr({ parentRouteIsRoot: p(() => this.parentRouteIdSignal() === z) });
|
|
3154
3136
|
}
|
|
3155
3137
|
static {
|
|
3156
|
-
this.ɵfac = function(
|
|
3157
|
-
return new (
|
|
3138
|
+
this.ɵfac = function(t) {
|
|
3139
|
+
return new (t || e)();
|
|
3158
3140
|
};
|
|
3159
3141
|
}
|
|
3160
3142
|
static {
|
|
3161
|
-
this.ɵcmp = /* @__PURE__ */
|
|
3162
|
-
type:
|
|
3143
|
+
this.ɵcmp = /* @__PURE__ */ n.ɵɵdefineComponent({
|
|
3144
|
+
type: e,
|
|
3163
3145
|
selectors: [["router-match"], [
|
|
3164
3146
|
"",
|
|
3165
3147
|
"router-match",
|
|
3166
3148
|
""
|
|
3167
3149
|
]],
|
|
3150
|
+
hostAttrs: ["hidden", ""],
|
|
3168
3151
|
hostVars: 1,
|
|
3169
|
-
hostBindings: function(
|
|
3170
|
-
|
|
3152
|
+
hostBindings: function(e, t) {
|
|
3153
|
+
e & 2 && n.ɵɵattribute("data-matchId", t.matchId());
|
|
3171
3154
|
},
|
|
3172
3155
|
inputs: { matchId: [1, "matchId"] },
|
|
3173
3156
|
decls: 0,
|
|
@@ -3176,32 +3159,33 @@ var Zn = class t {
|
|
|
3176
3159
|
encapsulation: 2
|
|
3177
3160
|
});
|
|
3178
3161
|
}
|
|
3179
|
-
},
|
|
3162
|
+
}, ar = class e {
|
|
3180
3163
|
constructor() {
|
|
3181
|
-
this.router = J(), this.nearestMatch =
|
|
3164
|
+
this.router = J(), this.nearestMatch = h(q), this.currentMatch = Y(() => {
|
|
3182
3165
|
let e = this.nearestMatch.matchId();
|
|
3183
|
-
return e ? this.router.stores.
|
|
3184
|
-
}), this.routeId =
|
|
3166
|
+
return e ? this.router.stores.matchStores.get(e) ?? nr : nr;
|
|
3167
|
+
}, (e) => e), this.routeId = p(() => this.currentMatch()?.routeId), this.route = p(() => this.router.routesById[this.routeId()]), this.parentGlobalNotFound = p(() => this.currentMatch()?.globalNotFound ?? !1), this.childMatchIdByRouteId = Y(this.router.stores.childMatchIdByRouteId, (e) => e), this.childMatchId = p(() => {
|
|
3185
3168
|
let e = this.routeId();
|
|
3186
3169
|
return e ? this.childMatchIdByRouteId()[e] ?? null : null;
|
|
3187
|
-
}), this.render =
|
|
3188
|
-
component:
|
|
3170
|
+
}), this.render = Jn(() => this.parentGlobalNotFound() ? { component: or(this.router, this.route()) } : this.childMatchId() ? {
|
|
3171
|
+
component: ir,
|
|
3189
3172
|
inputs: { matchId: () => this.childMatchId() }
|
|
3190
3173
|
} : null);
|
|
3191
3174
|
}
|
|
3192
3175
|
static {
|
|
3193
|
-
this.ɵfac = function(
|
|
3194
|
-
return new (
|
|
3176
|
+
this.ɵfac = function(t) {
|
|
3177
|
+
return new (t || e)();
|
|
3195
3178
|
};
|
|
3196
3179
|
}
|
|
3197
3180
|
static {
|
|
3198
|
-
this.ɵcmp = /* @__PURE__ */
|
|
3199
|
-
type:
|
|
3181
|
+
this.ɵcmp = /* @__PURE__ */ n.ɵɵdefineComponent({
|
|
3182
|
+
type: e,
|
|
3200
3183
|
selectors: [["outlet"], [
|
|
3201
3184
|
"",
|
|
3202
3185
|
"outlet",
|
|
3203
3186
|
""
|
|
3204
3187
|
]],
|
|
3188
|
+
hostAttrs: ["hidden", ""],
|
|
3205
3189
|
decls: 0,
|
|
3206
3190
|
vars: 0,
|
|
3207
3191
|
template: function(e, t) {},
|
|
@@ -3212,181 +3196,182 @@ var Zn = class t {
|
|
|
3212
3196
|
function Z(e) {
|
|
3213
3197
|
return typeof e == "function" ? e() : e;
|
|
3214
3198
|
}
|
|
3215
|
-
function
|
|
3216
|
-
return (Z(t.options.notFoundComponent) ?? Z(e.options.defaultNotFoundComponent)) || (
|
|
3199
|
+
function or(e, t) {
|
|
3200
|
+
return (Z(t.options.notFoundComponent) ?? Z(e.options.defaultNotFoundComponent)) || (v() && !t.options.notFoundComponent && console.warn(`A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Page not found</p>)`), Zn);
|
|
3217
3201
|
}
|
|
3218
3202
|
//#endregion
|
|
3219
3203
|
//#region ../router-core/dist/esm/scroll-restoration-script/client.js
|
|
3220
|
-
function
|
|
3204
|
+
function sr(e) {
|
|
3221
3205
|
return null;
|
|
3222
3206
|
}
|
|
3223
3207
|
//#endregion
|
|
3224
3208
|
//#region src/ssr-scroll-restoration.ts
|
|
3225
|
-
var
|
|
3226
|
-
function
|
|
3227
|
-
let e = J(), t =
|
|
3228
|
-
e.isServer &&
|
|
3209
|
+
var cr = "data-tsr-scroll-restoration-inline";
|
|
3210
|
+
function lr() {
|
|
3211
|
+
let e = J(), t = h(C), n = h(o);
|
|
3212
|
+
e.isServer && d(() => {
|
|
3229
3213
|
let n = e.options.scrollRestoration;
|
|
3230
|
-
if (!n || typeof n == "function" && !n({ location: e.latestLocation }) || t.querySelector(`script[${
|
|
3231
|
-
let r =
|
|
3214
|
+
if (!n || typeof n == "function" && !n({ location: e.latestLocation }) || t.querySelector(`script[${cr}]`)) return;
|
|
3215
|
+
let r = sr(e);
|
|
3232
3216
|
if (!r) return;
|
|
3233
3217
|
let i = t.createElement("script");
|
|
3234
|
-
i.setAttribute(
|
|
3218
|
+
i.setAttribute(cr, ""), i.className = "$tsr", i.text = `${r};document.currentScript.remove()`;
|
|
3235
3219
|
let a = e.options.ssr?.nonce;
|
|
3236
3220
|
a && i.setAttribute("nonce", a), (t.head ?? t.body).appendChild(i);
|
|
3237
3221
|
}, { injector: n });
|
|
3238
3222
|
}
|
|
3239
3223
|
//#endregion
|
|
3240
3224
|
//#region src/transitioner.ts
|
|
3241
|
-
var
|
|
3225
|
+
var ur = {
|
|
3242
3226
|
router: null,
|
|
3243
3227
|
mounted: !1
|
|
3244
3228
|
};
|
|
3245
|
-
function
|
|
3246
|
-
let
|
|
3247
|
-
if (
|
|
3248
|
-
let r =
|
|
3249
|
-
|
|
3250
|
-
|
|
3229
|
+
function dr() {
|
|
3230
|
+
let e = J(), t = n.inject(n.EnvironmentInjector);
|
|
3231
|
+
if (e.isServer) return;
|
|
3232
|
+
let r = n.inject(n.DestroyRef), i = !1, a = Y(e.stores.isLoading, (e) => e), o = Y(e.stores.isTransitioning, (e) => e), s = Y(e.stores.hasPending, (e) => e), c = Y(e.stores.status, (e) => e), l = Y(e.stores.location, (e) => e), u = Y(e.stores.resolvedLocation, (e) => e), d = n.computed(() => a() || o() || s()), f = n.computed(() => a() || s()), p = fr(() => a()), m = fr(() => d()), h = fr(() => f());
|
|
3233
|
+
e.startTransition = (r) => {
|
|
3234
|
+
e.stores.isTransitioning.set(!0);
|
|
3251
3235
|
let a = () => {
|
|
3252
|
-
i ||
|
|
3236
|
+
i || n.afterNextRender({ read: () => {
|
|
3253
3237
|
try {
|
|
3254
|
-
|
|
3238
|
+
e.stores.isTransitioning.set(!1);
|
|
3255
3239
|
} catch {}
|
|
3256
|
-
} }, { injector:
|
|
3240
|
+
} }, { injector: t });
|
|
3257
3241
|
}, o = r();
|
|
3258
3242
|
o instanceof Promise ? o.finally(() => a()) : a();
|
|
3259
3243
|
};
|
|
3260
3244
|
let g;
|
|
3261
|
-
|
|
3262
|
-
g =
|
|
3263
|
-
let
|
|
3264
|
-
to:
|
|
3245
|
+
n.afterNextRender(() => {
|
|
3246
|
+
g = e.history.subscribe(e.load);
|
|
3247
|
+
let t = e.buildLocation({
|
|
3248
|
+
to: e.latestLocation.pathname,
|
|
3265
3249
|
search: !0,
|
|
3266
3250
|
params: !0,
|
|
3267
3251
|
hash: !0,
|
|
3268
3252
|
state: !0,
|
|
3269
3253
|
_includeValidateSearch: !0
|
|
3270
3254
|
});
|
|
3271
|
-
I(
|
|
3272
|
-
...
|
|
3255
|
+
I(e.latestLocation.href) !== I(t.href) && e.commitLocation({
|
|
3256
|
+
...t,
|
|
3273
3257
|
replace: !0
|
|
3274
3258
|
});
|
|
3275
3259
|
});
|
|
3276
|
-
let _ =
|
|
3277
|
-
|
|
3278
|
-
_.set(!0), d() || c() === "pending" && (
|
|
3260
|
+
let _ = n.signal(!1);
|
|
3261
|
+
n.afterNextRender(() => {
|
|
3262
|
+
_.set(!0), d() || c() === "pending" && (e.stores.status.set("idle"), e.stores.resolvedLocation.set(l()));
|
|
3279
3263
|
}), r.onDestroy(() => {
|
|
3280
3264
|
_.set(!1), i = !0, g && g();
|
|
3281
|
-
}),
|
|
3282
|
-
typeof window < "u" &&
|
|
3283
|
-
router:
|
|
3265
|
+
}), n.afterNextRender(() => {
|
|
3266
|
+
typeof window < "u" && e.ssr || ur.router === e && ur.mounted || (ur = {
|
|
3267
|
+
router: e,
|
|
3284
3268
|
mounted: !0
|
|
3285
3269
|
}, (async () => {
|
|
3286
3270
|
try {
|
|
3287
|
-
await
|
|
3271
|
+
await e.load();
|
|
3288
3272
|
} catch (e) {
|
|
3289
3273
|
console.error(e);
|
|
3290
3274
|
}
|
|
3291
3275
|
})());
|
|
3292
|
-
}),
|
|
3276
|
+
}), n.effect(() => {
|
|
3293
3277
|
if (_()) try {
|
|
3294
|
-
p() && !a() &&
|
|
3278
|
+
p() && !a() && e.emit({
|
|
3295
3279
|
type: "onLoad",
|
|
3296
3280
|
...K(l(), u())
|
|
3297
3281
|
});
|
|
3298
3282
|
} catch {}
|
|
3299
|
-
}),
|
|
3283
|
+
}), n.effect(() => {
|
|
3300
3284
|
if (_()) try {
|
|
3301
|
-
h() && !f() &&
|
|
3285
|
+
h() && !f() && e.emit({
|
|
3302
3286
|
type: "onBeforeRouteMount",
|
|
3303
3287
|
...K(l(), u())
|
|
3304
3288
|
});
|
|
3305
3289
|
} catch {}
|
|
3306
|
-
}),
|
|
3290
|
+
}), n.effect(() => {
|
|
3307
3291
|
if (_()) try {
|
|
3308
|
-
if (m() && !d() && c() === "pending" && (
|
|
3309
|
-
let
|
|
3310
|
-
|
|
3292
|
+
if (m() && !d() && c() === "pending" && (e.stores.status.set("idle"), e.stores.resolvedLocation.set(l())), m() && !d()) {
|
|
3293
|
+
let t = K(l(), u());
|
|
3294
|
+
e.emit({
|
|
3311
3295
|
type: "onResolved",
|
|
3312
|
-
...
|
|
3313
|
-
}),
|
|
3296
|
+
...t
|
|
3297
|
+
}), t.hrefChanged && _n(e);
|
|
3314
3298
|
}
|
|
3315
3299
|
} catch {}
|
|
3316
3300
|
});
|
|
3317
3301
|
}
|
|
3318
|
-
function
|
|
3319
|
-
let
|
|
3320
|
-
return
|
|
3302
|
+
function fr(e) {
|
|
3303
|
+
let t = n.computed(e), r = null;
|
|
3304
|
+
return n.computed(() => {
|
|
3321
3305
|
let e = r;
|
|
3322
|
-
return r =
|
|
3306
|
+
return r = t(), e;
|
|
3323
3307
|
});
|
|
3324
3308
|
}
|
|
3325
3309
|
//#endregion
|
|
3326
3310
|
//#region src/Matches.ts
|
|
3327
|
-
var
|
|
3311
|
+
var pr = class e {
|
|
3328
3312
|
constructor() {
|
|
3329
|
-
this.router = J(), this.matchId = Y(this.router.stores.
|
|
3313
|
+
this.router = J(), this.matchId = Y(this.router.stores.firstId, (e) => e), this.ssrScrollRestoration = lr(), this.transitioner = dr(), this.render = Jn(() => {
|
|
3330
3314
|
let e = this.matchId();
|
|
3331
3315
|
return e ? {
|
|
3332
|
-
component:
|
|
3316
|
+
component: ir,
|
|
3333
3317
|
inputs: { matchId: () => e }
|
|
3334
3318
|
} : null;
|
|
3335
3319
|
});
|
|
3336
3320
|
}
|
|
3337
3321
|
static {
|
|
3338
|
-
this.ɵfac = function(
|
|
3339
|
-
return new (
|
|
3322
|
+
this.ɵfac = function(t) {
|
|
3323
|
+
return new (t || e)();
|
|
3340
3324
|
};
|
|
3341
3325
|
}
|
|
3342
3326
|
static {
|
|
3343
|
-
this.ɵcmp = /* @__PURE__ */
|
|
3344
|
-
type:
|
|
3327
|
+
this.ɵcmp = /* @__PURE__ */ n.ɵɵdefineComponent({
|
|
3328
|
+
type: e,
|
|
3345
3329
|
selectors: [["router-matches"]],
|
|
3330
|
+
hostAttrs: ["hidden", ""],
|
|
3346
3331
|
decls: 0,
|
|
3347
3332
|
vars: 0,
|
|
3348
3333
|
template: function(e, t) {},
|
|
3349
3334
|
encapsulation: 2
|
|
3350
3335
|
});
|
|
3351
3336
|
}
|
|
3352
|
-
},
|
|
3337
|
+
}, mr = new s("CONTEXT", {
|
|
3353
3338
|
providedIn: "root",
|
|
3354
3339
|
factory: () => ({})
|
|
3355
|
-
}),
|
|
3340
|
+
}), hr = new s("OPTIONS", {
|
|
3356
3341
|
providedIn: "root",
|
|
3357
3342
|
factory: () => ({})
|
|
3358
3343
|
});
|
|
3359
|
-
function
|
|
3360
|
-
let t =
|
|
3344
|
+
function gr(e) {
|
|
3345
|
+
let t = h(o);
|
|
3361
3346
|
return {
|
|
3362
3347
|
inject: t.get.bind(t),
|
|
3363
3348
|
...e
|
|
3364
3349
|
};
|
|
3365
3350
|
}
|
|
3366
|
-
function
|
|
3351
|
+
function _r({ router: e, context: t, options: n }) {
|
|
3367
3352
|
return [
|
|
3368
3353
|
{
|
|
3369
|
-
provide:
|
|
3354
|
+
provide: wn(),
|
|
3370
3355
|
useValue: e
|
|
3371
3356
|
},
|
|
3372
3357
|
{
|
|
3373
|
-
provide:
|
|
3374
|
-
useFactory: () =>
|
|
3358
|
+
provide: mr,
|
|
3359
|
+
useFactory: () => gr(t ?? {})
|
|
3375
3360
|
},
|
|
3376
3361
|
{
|
|
3377
|
-
provide:
|
|
3362
|
+
provide: hr,
|
|
3378
3363
|
useValue: n ?? {}
|
|
3379
3364
|
}
|
|
3380
3365
|
];
|
|
3381
3366
|
}
|
|
3382
|
-
var
|
|
3367
|
+
var vr = class e {
|
|
3383
3368
|
constructor() {
|
|
3384
|
-
this.injectedContext =
|
|
3369
|
+
this.injectedContext = h(mr), this.injectedOptions = h(hr), this.injectedRouter = h(wn(), { optional: !0 }), this.context = g(this.injectedContext), this.options = g(this.injectedOptions), this.routerInput = g(void 0, { alias: "router" }), this.router = p(() => {
|
|
3385
3370
|
let e = this.routerInput();
|
|
3386
3371
|
if (e) return e;
|
|
3387
3372
|
if (this.injectedRouter) return this.injectedRouter;
|
|
3388
3373
|
throw Error("No router provided to <router-provider>. Provide a router with provideTanstackRouter or the router input");
|
|
3389
|
-
}), this.updateRouter =
|
|
3374
|
+
}), this.updateRouter = m(() => {
|
|
3390
3375
|
let e = this.router(), t = this.context(), n = this.options();
|
|
3391
3376
|
e.update({
|
|
3392
3377
|
...e.options,
|
|
@@ -3396,30 +3381,31 @@ var dr = class t {
|
|
|
3396
3381
|
...t
|
|
3397
3382
|
}
|
|
3398
3383
|
});
|
|
3399
|
-
}), this.render =
|
|
3400
|
-
let e =
|
|
3384
|
+
}), this.render = Jn(() => {
|
|
3385
|
+
let e = S(this.router);
|
|
3401
3386
|
return {
|
|
3402
|
-
component:
|
|
3387
|
+
component: pr,
|
|
3403
3388
|
providers: [{
|
|
3404
|
-
provide:
|
|
3389
|
+
provide: wn(),
|
|
3405
3390
|
useValue: e
|
|
3406
3391
|
}]
|
|
3407
3392
|
};
|
|
3408
3393
|
});
|
|
3409
3394
|
}
|
|
3410
3395
|
static {
|
|
3411
|
-
this.ɵfac = function(
|
|
3412
|
-
return new (
|
|
3396
|
+
this.ɵfac = function(t) {
|
|
3397
|
+
return new (t || e)();
|
|
3413
3398
|
};
|
|
3414
3399
|
}
|
|
3415
3400
|
static {
|
|
3416
|
-
this.ɵcmp = /* @__PURE__ */
|
|
3417
|
-
type:
|
|
3401
|
+
this.ɵcmp = /* @__PURE__ */ n.ɵɵdefineComponent({
|
|
3402
|
+
type: e,
|
|
3418
3403
|
selectors: [["router-provider"], [
|
|
3419
3404
|
"",
|
|
3420
3405
|
"router-provider",
|
|
3421
3406
|
""
|
|
3422
3407
|
]],
|
|
3408
|
+
hostAttrs: ["hidden", ""],
|
|
3423
3409
|
inputs: {
|
|
3424
3410
|
context: [1, "context"],
|
|
3425
3411
|
options: [1, "options"],
|
|
@@ -3435,21 +3421,21 @@ var dr = class t {
|
|
|
3435
3421
|
encapsulation: 2
|
|
3436
3422
|
});
|
|
3437
3423
|
}
|
|
3438
|
-
}, Q = new
|
|
3424
|
+
}, Q = new n.InjectionToken("TANSTACK_DOCUMENT_ROUTER"), yr = "data-tsr-managed", br = "data-tsr-id";
|
|
3439
3425
|
//#endregion
|
|
3440
3426
|
//#region src/document/managed-dom.ts
|
|
3441
|
-
function
|
|
3427
|
+
function xr(e) {
|
|
3442
3428
|
if (!e || e.tag === "title" || e.tag === "script" && !e.attrs?.src && typeof e.children != "string") return [];
|
|
3443
3429
|
let t = {
|
|
3444
3430
|
...e,
|
|
3445
|
-
attrs:
|
|
3431
|
+
attrs: Sr(e.attrs)
|
|
3446
3432
|
};
|
|
3447
3433
|
return [{
|
|
3448
3434
|
...t,
|
|
3449
|
-
id:
|
|
3435
|
+
id: wr(t)
|
|
3450
3436
|
}];
|
|
3451
3437
|
}
|
|
3452
|
-
function
|
|
3438
|
+
function Sr(e) {
|
|
3453
3439
|
if (!e) return {};
|
|
3454
3440
|
let t = {};
|
|
3455
3441
|
for (let n of Object.keys(e).sort()) {
|
|
@@ -3460,27 +3446,27 @@ function hr(e) {
|
|
|
3460
3446
|
}
|
|
3461
3447
|
return t;
|
|
3462
3448
|
}
|
|
3463
|
-
function
|
|
3449
|
+
function Cr(e) {
|
|
3464
3450
|
let t = /* @__PURE__ */ new Set();
|
|
3465
3451
|
return e.filter((e) => t.has(e.id) ? !1 : (t.add(e.id), !0));
|
|
3466
3452
|
}
|
|
3467
|
-
function
|
|
3453
|
+
function wr(e) {
|
|
3468
3454
|
let t = JSON.stringify(e), n = 2166136261;
|
|
3469
3455
|
for (let e = 0; e < t.length; e++) n ^= t.charCodeAt(e), n = Math.imul(n, 16777619);
|
|
3470
3456
|
return `tsr-${(n >>> 0).toString(36)}`;
|
|
3471
3457
|
}
|
|
3472
|
-
function
|
|
3458
|
+
function Tr({ root: e, bucket: t, renderer: n }) {
|
|
3473
3459
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = [];
|
|
3474
3460
|
return {
|
|
3475
|
-
mount(n =
|
|
3461
|
+
mount(n = Er(e, t)) {
|
|
3476
3462
|
r.clear(), i.clear(), a = [], n.forEach((e) => {
|
|
3477
|
-
let t = e.getAttribute(
|
|
3463
|
+
let t = e.getAttribute(br);
|
|
3478
3464
|
t && (r.set(t, e), a.push(t));
|
|
3479
3465
|
});
|
|
3480
3466
|
},
|
|
3481
3467
|
sync(o) {
|
|
3482
3468
|
let s = o.map((e) => e.id);
|
|
3483
|
-
if (
|
|
3469
|
+
if (Nr(a, s)) return;
|
|
3484
3470
|
let c = new Map(o.map((e) => [e.id, {
|
|
3485
3471
|
id: e.id,
|
|
3486
3472
|
tag: e
|
|
@@ -3488,12 +3474,12 @@ function vr({ root: e, bucket: t, renderer: n }) {
|
|
|
3488
3474
|
for (let t of a) {
|
|
3489
3475
|
if (c.has(t)) continue;
|
|
3490
3476
|
let a = r.get(t);
|
|
3491
|
-
a && (
|
|
3477
|
+
a && (Mr(a, e, n), r.delete(t), i.delete(t));
|
|
3492
3478
|
}
|
|
3493
3479
|
let l = e.firstChild;
|
|
3494
3480
|
for (let a of o) {
|
|
3495
3481
|
let o = r.get(a.id);
|
|
3496
|
-
o || (o =
|
|
3482
|
+
o || (o = Dr(a, t, e.ownerDocument, n), r.set(a.id, o)), o !== l && jr(e, o, l, n), i.set(a.id, {
|
|
3497
3483
|
id: a.id,
|
|
3498
3484
|
tag: a
|
|
3499
3485
|
}), l = o.nextSibling;
|
|
@@ -3507,33 +3493,33 @@ function vr({ root: e, bucket: t, renderer: n }) {
|
|
|
3507
3493
|
}
|
|
3508
3494
|
};
|
|
3509
3495
|
}
|
|
3510
|
-
function
|
|
3511
|
-
return Array.from(e.querySelectorAll(`[${
|
|
3496
|
+
function Er(e, t) {
|
|
3497
|
+
return Array.from(e.querySelectorAll(`[${yr}="${t}"]`));
|
|
3512
3498
|
}
|
|
3513
|
-
function
|
|
3514
|
-
let i =
|
|
3515
|
-
|
|
3516
|
-
for (let [t, n] of Object.entries(e.attrs ?? {})) t !== "suppressHydrationWarning" && (n == null || n === !1 ||
|
|
3517
|
-
return "children" in e && typeof e.children == "string" &&
|
|
3499
|
+
function Dr(e, t, n, r) {
|
|
3500
|
+
let i = Or(n, e.tag, r);
|
|
3501
|
+
kr(i, yr, t, r), kr(i, br, e.id, r);
|
|
3502
|
+
for (let [t, n] of Object.entries(e.attrs ?? {})) t !== "suppressHydrationWarning" && (n == null || n === !1 || kr(i, t === "className" ? "class" : t, typeof n == "boolean" ? "" : String(n), r));
|
|
3503
|
+
return "children" in e && typeof e.children == "string" && Ar(i, e.children, r), i;
|
|
3518
3504
|
}
|
|
3519
|
-
function
|
|
3505
|
+
function Or(e, t, n) {
|
|
3520
3506
|
return n ? n.createElement(t) : e.createElement(t);
|
|
3521
3507
|
}
|
|
3522
|
-
function
|
|
3508
|
+
function kr(e, t, n, r) {
|
|
3523
3509
|
if (r) {
|
|
3524
3510
|
r.setAttribute(e, t, n);
|
|
3525
3511
|
return;
|
|
3526
3512
|
}
|
|
3527
3513
|
e.setAttribute(t, n);
|
|
3528
3514
|
}
|
|
3529
|
-
function
|
|
3515
|
+
function Ar(e, t, n) {
|
|
3530
3516
|
if (n) {
|
|
3531
3517
|
n.setProperty(e, "textContent", t);
|
|
3532
3518
|
return;
|
|
3533
3519
|
}
|
|
3534
3520
|
e.textContent = t;
|
|
3535
3521
|
}
|
|
3536
|
-
function
|
|
3522
|
+
function jr(e, t, n, r) {
|
|
3537
3523
|
if (!(t.parentNode === e && t.nextSibling === n)) {
|
|
3538
3524
|
if (r) {
|
|
3539
3525
|
r.insertBefore(e, t, n);
|
|
@@ -3542,51 +3528,51 @@ function wr(e, t, n, r) {
|
|
|
3542
3528
|
e.insertBefore(t, n);
|
|
3543
3529
|
}
|
|
3544
3530
|
}
|
|
3545
|
-
function
|
|
3531
|
+
function Mr(e, t, n) {
|
|
3546
3532
|
if (n) {
|
|
3547
3533
|
n.removeChild(t, e);
|
|
3548
3534
|
return;
|
|
3549
3535
|
}
|
|
3550
3536
|
t.removeChild(e);
|
|
3551
3537
|
}
|
|
3552
|
-
function
|
|
3538
|
+
function Nr(e, t) {
|
|
3553
3539
|
if (e.length !== t.length) return !1;
|
|
3554
3540
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
3555
3541
|
return !0;
|
|
3556
3542
|
}
|
|
3557
3543
|
//#endregion
|
|
3558
3544
|
//#region src/document/document-dehydration.ts
|
|
3559
|
-
function
|
|
3560
|
-
return e.serverSsr ?
|
|
3545
|
+
function Pr(e) {
|
|
3546
|
+
return e.serverSsr ? Cr(xr(e.serverSsr.takeBufferedScripts())) : [];
|
|
3561
3547
|
}
|
|
3562
|
-
function
|
|
3548
|
+
function Fr(e, t) {
|
|
3563
3549
|
return t.length === 0 ? e : {
|
|
3564
3550
|
...e,
|
|
3565
|
-
body:
|
|
3551
|
+
body: Cr([...t, ...e.body])
|
|
3566
3552
|
};
|
|
3567
3553
|
}
|
|
3568
3554
|
//#endregion
|
|
3569
3555
|
//#region src/document/build-match-managed-document.ts
|
|
3570
3556
|
function $(e) {
|
|
3571
|
-
let t = e.options.ssr?.nonce, n = e.stores.
|
|
3557
|
+
let t = e.options.ssr?.nonce, n = e.stores.matches.get(), r = Lr(n), i = Rr(n, t), a = zr(n, t), o = Br(e, n, t), s = Vr(e, n, t), c = Hr(n, t), l = Ur(n, t), u = Wr(n, t), d = Gr(e, n, t);
|
|
3572
3558
|
return {
|
|
3573
3559
|
title: r,
|
|
3574
|
-
head:
|
|
3560
|
+
head: Cr([
|
|
3575
3561
|
...i,
|
|
3576
3562
|
...s,
|
|
3577
3563
|
...a,
|
|
3578
3564
|
...o,
|
|
3579
3565
|
...c,
|
|
3580
3566
|
...l
|
|
3581
|
-
].flatMap((e) =>
|
|
3582
|
-
body:
|
|
3567
|
+
].flatMap((e) => xr(e))),
|
|
3568
|
+
body: Cr([...u, ...d].flatMap((e) => xr(e)))
|
|
3583
3569
|
};
|
|
3584
3570
|
}
|
|
3585
|
-
function
|
|
3586
|
-
return
|
|
3571
|
+
function Ir(e) {
|
|
3572
|
+
return Fr($(e), Pr(e));
|
|
3587
3573
|
}
|
|
3588
|
-
function
|
|
3589
|
-
let t =
|
|
3574
|
+
function Lr(e) {
|
|
3575
|
+
let t = Kr(e);
|
|
3590
3576
|
for (let e = t.length - 1; e >= 0; e--) {
|
|
3591
3577
|
let n = t[e];
|
|
3592
3578
|
for (let e = n.length - 1; e >= 0; e--) {
|
|
@@ -3595,8 +3581,8 @@ function Ar(e) {
|
|
|
3595
3581
|
}
|
|
3596
3582
|
}
|
|
3597
3583
|
}
|
|
3598
|
-
function
|
|
3599
|
-
let n =
|
|
3584
|
+
function Rr(e, t) {
|
|
3585
|
+
let n = Kr(e), r = [], i = {};
|
|
3600
3586
|
for (let e = n.length - 1; e >= 0; e--) {
|
|
3601
3587
|
let a = n[e];
|
|
3602
3588
|
for (let e = a.length - 1; e >= 0; e--) {
|
|
@@ -3611,7 +3597,7 @@ function jr(e, t) {
|
|
|
3611
3597
|
type: "application/ld+json",
|
|
3612
3598
|
nonce: t
|
|
3613
3599
|
},
|
|
3614
|
-
children:
|
|
3600
|
+
children: ge(e)
|
|
3615
3601
|
});
|
|
3616
3602
|
} catch {}
|
|
3617
3603
|
continue;
|
|
@@ -3638,7 +3624,7 @@ function jr(e, t) {
|
|
|
3638
3624
|
}
|
|
3639
3625
|
}), r.reverse(), r;
|
|
3640
3626
|
}
|
|
3641
|
-
function
|
|
3627
|
+
function zr(e, t) {
|
|
3642
3628
|
return e.map((e) => e.links).filter(Boolean).flat(1).map((e) => ({
|
|
3643
3629
|
tag: "link",
|
|
3644
3630
|
attrs: {
|
|
@@ -3647,7 +3633,7 @@ function Mr(e, t) {
|
|
|
3647
3633
|
}
|
|
3648
3634
|
}));
|
|
3649
3635
|
}
|
|
3650
|
-
function
|
|
3636
|
+
function Br(e, t, n) {
|
|
3651
3637
|
return t.map((t) => e.ssr?.manifest?.routes[t.routeId]?.assets ?? []).filter(Boolean).flat(1).filter((e) => e.tag === "link").map((e) => ({
|
|
3652
3638
|
tag: "link",
|
|
3653
3639
|
attrs: {
|
|
@@ -3657,7 +3643,7 @@ function Nr(e, t, n) {
|
|
|
3657
3643
|
}
|
|
3658
3644
|
}));
|
|
3659
3645
|
}
|
|
3660
|
-
function
|
|
3646
|
+
function Vr(e, t, n) {
|
|
3661
3647
|
let r = [];
|
|
3662
3648
|
return t.map((t) => e.looseRoutesById[t.routeId]).forEach((t) => e.ssr?.manifest?.routes[t.id]?.preloads?.filter(Boolean).forEach((e) => {
|
|
3663
3649
|
r.push({
|
|
@@ -3670,7 +3656,7 @@ function Pr(e, t, n) {
|
|
|
3670
3656
|
});
|
|
3671
3657
|
})), r;
|
|
3672
3658
|
}
|
|
3673
|
-
function
|
|
3659
|
+
function Hr(e, t) {
|
|
3674
3660
|
return e.map((e) => e.styles).flat(1).filter(Boolean).map(({ children: e, ...n }) => ({
|
|
3675
3661
|
tag: "style",
|
|
3676
3662
|
attrs: {
|
|
@@ -3680,7 +3666,7 @@ function Fr(e, t) {
|
|
|
3680
3666
|
children: typeof e == "string" ? e : void 0
|
|
3681
3667
|
}));
|
|
3682
3668
|
}
|
|
3683
|
-
function
|
|
3669
|
+
function Ur(e, t) {
|
|
3684
3670
|
return e.map((e) => e.headScripts).flat(1).filter(Boolean).map(({ children: e, ...n }) => ({
|
|
3685
3671
|
tag: "script",
|
|
3686
3672
|
attrs: {
|
|
@@ -3690,7 +3676,7 @@ function Ir(e, t) {
|
|
|
3690
3676
|
children: typeof e == "string" ? e : void 0
|
|
3691
3677
|
}));
|
|
3692
3678
|
}
|
|
3693
|
-
function
|
|
3679
|
+
function Wr(e, t) {
|
|
3694
3680
|
return e.map((e) => e.scripts).flat(1).filter(Boolean).map(({ children: e, ...n }) => ({
|
|
3695
3681
|
tag: "script",
|
|
3696
3682
|
attrs: {
|
|
@@ -3701,7 +3687,7 @@ function Lr(e, t) {
|
|
|
3701
3687
|
children: typeof e == "string" ? e : void 0
|
|
3702
3688
|
}));
|
|
3703
3689
|
}
|
|
3704
|
-
function
|
|
3690
|
+
function Gr(e, t, n) {
|
|
3705
3691
|
return t.map((t) => e.looseRoutesById[t.routeId]).flatMap((t) => e.ssr?.manifest?.routes[t.id]?.assets?.filter((e) => e.tag === "script").map((e) => ({
|
|
3706
3692
|
tag: "script",
|
|
3707
3693
|
attrs: {
|
|
@@ -3711,48 +3697,48 @@ function Rr(e, t, n) {
|
|
|
3711
3697
|
children: e.children
|
|
3712
3698
|
})) ?? []);
|
|
3713
3699
|
}
|
|
3714
|
-
function
|
|
3700
|
+
function Kr(e) {
|
|
3715
3701
|
return e.reduce((e, t) => (t.meta && e.push(t.meta), e), []);
|
|
3716
3702
|
}
|
|
3717
3703
|
//#endregion
|
|
3718
3704
|
//#region src/document/document-equality.ts
|
|
3719
|
-
function
|
|
3720
|
-
return e.title === t.title &&
|
|
3705
|
+
function qr(e, t) {
|
|
3706
|
+
return e.title === t.title && Jr(e.head, t.head) && Jr(e.body, t.body);
|
|
3721
3707
|
}
|
|
3722
|
-
function
|
|
3708
|
+
function Jr(e, t) {
|
|
3723
3709
|
if (e.length !== t.length) return !1;
|
|
3724
3710
|
for (let n = 0; n < e.length; n++) if (e[n]?.id !== t[n]?.id) return !1;
|
|
3725
3711
|
return !0;
|
|
3726
3712
|
}
|
|
3727
3713
|
//#endregion
|
|
3728
3714
|
//#region src/document/install-unified-document-sync.ts
|
|
3729
|
-
function
|
|
3715
|
+
function Yr({ document: e, initialTitle: t, headCollection: n, bodyCollection: r, nextContent: i }) {
|
|
3730
3716
|
i.title === void 0 ? e.title = t : e.title = i.title, n.sync(i.head), r.sync(i.body);
|
|
3731
3717
|
}
|
|
3732
|
-
function
|
|
3733
|
-
let
|
|
3734
|
-
root:
|
|
3718
|
+
function Xr(e) {
|
|
3719
|
+
let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = Y(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = t.title, c = Tr({
|
|
3720
|
+
root: t.head,
|
|
3735
3721
|
bucket: "head",
|
|
3736
3722
|
renderer: o
|
|
3737
|
-
}), l =
|
|
3738
|
-
root:
|
|
3723
|
+
}), l = Tr({
|
|
3724
|
+
root: t.body,
|
|
3739
3725
|
bucket: "body",
|
|
3740
3726
|
renderer: o
|
|
3741
|
-
}), u =
|
|
3727
|
+
}), u = Pr(e), d = () => Fr($(e), u);
|
|
3742
3728
|
c.mount(), l.mount();
|
|
3743
3729
|
let f = d();
|
|
3744
|
-
|
|
3745
|
-
document:
|
|
3730
|
+
Yr({
|
|
3731
|
+
document: t,
|
|
3746
3732
|
initialTitle: s,
|
|
3747
3733
|
headCollection: c,
|
|
3748
3734
|
bodyCollection: l,
|
|
3749
3735
|
nextContent: f
|
|
3750
3736
|
});
|
|
3751
|
-
let p =
|
|
3737
|
+
let p = n.effect(() => {
|
|
3752
3738
|
a();
|
|
3753
3739
|
let e = d();
|
|
3754
|
-
|
|
3755
|
-
document:
|
|
3740
|
+
qr(f, e) || (f = e, Yr({
|
|
3741
|
+
document: t,
|
|
3756
3742
|
initialTitle: s,
|
|
3757
3743
|
headCollection: c,
|
|
3758
3744
|
bodyCollection: l,
|
|
@@ -3760,150 +3746,148 @@ function Ur(t) {
|
|
|
3760
3746
|
}));
|
|
3761
3747
|
});
|
|
3762
3748
|
i.onDestroy(() => {
|
|
3763
|
-
p.destroy(), c.destroy(), l.destroy(),
|
|
3749
|
+
p.destroy(), c.destroy(), l.destroy(), t.title = s;
|
|
3764
3750
|
});
|
|
3765
3751
|
}
|
|
3766
3752
|
//#endregion
|
|
3767
3753
|
//#region src/document/provide-tanstack-body-managed-tags.ts
|
|
3768
|
-
function
|
|
3769
|
-
let
|
|
3770
|
-
root:
|
|
3754
|
+
function Zr(e) {
|
|
3755
|
+
let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = Y(e.stores.matches, (e) => e), o = Pr(e), s = () => o.length === 0 ? $(e).body : Cr([...o, ...$(e).body]), c = r?.createRenderer(null, null) ?? null, l = Tr({
|
|
3756
|
+
root: t.body,
|
|
3771
3757
|
bucket: "body",
|
|
3772
3758
|
renderer: c
|
|
3773
3759
|
});
|
|
3774
3760
|
l.mount();
|
|
3775
3761
|
let u = s();
|
|
3776
3762
|
l.sync(u);
|
|
3777
|
-
let d =
|
|
3763
|
+
let d = n.effect(() => {
|
|
3778
3764
|
a();
|
|
3779
3765
|
let e = s();
|
|
3780
|
-
|
|
3766
|
+
Jr(u, e) || (u = e, l.sync(e));
|
|
3781
3767
|
});
|
|
3782
3768
|
i.onDestroy(() => {
|
|
3783
3769
|
d.destroy(), l.destroy();
|
|
3784
3770
|
});
|
|
3785
3771
|
}
|
|
3786
|
-
function
|
|
3787
|
-
|
|
3772
|
+
function Qr() {
|
|
3773
|
+
Zr(n.inject(Q));
|
|
3788
3774
|
}
|
|
3789
|
-
function
|
|
3790
|
-
return
|
|
3775
|
+
function $r(e) {
|
|
3776
|
+
return n.makeEnvironmentProviders([{
|
|
3791
3777
|
provide: Q,
|
|
3792
|
-
useValue:
|
|
3793
|
-
},
|
|
3778
|
+
useValue: e
|
|
3779
|
+
}, n.provideEnvironmentInitializer(Qr)]);
|
|
3794
3780
|
}
|
|
3795
3781
|
//#endregion
|
|
3796
3782
|
//#region src/document/provide-tanstack-document-title.ts
|
|
3797
|
-
function
|
|
3798
|
-
let
|
|
3799
|
-
e === void 0 ?
|
|
3783
|
+
function ei(e) {
|
|
3784
|
+
let t = n.inject(C), r = n.inject(n.DestroyRef), i = Y(e.stores.matches, (e) => e), a = t.title, o = $(e).title, s = (e) => {
|
|
3785
|
+
e === void 0 ? t.title = a : t.title = e;
|
|
3800
3786
|
};
|
|
3801
3787
|
s(o);
|
|
3802
|
-
let c =
|
|
3788
|
+
let c = n.effect(() => {
|
|
3803
3789
|
i();
|
|
3804
|
-
let
|
|
3805
|
-
|
|
3790
|
+
let t = $(e).title;
|
|
3791
|
+
t !== o && (o = t, s(t));
|
|
3806
3792
|
});
|
|
3807
3793
|
r.onDestroy(() => {
|
|
3808
|
-
c.destroy(),
|
|
3794
|
+
c.destroy(), t.title = a;
|
|
3809
3795
|
});
|
|
3810
3796
|
}
|
|
3811
|
-
function
|
|
3812
|
-
|
|
3797
|
+
function ti() {
|
|
3798
|
+
ei(n.inject(Q));
|
|
3813
3799
|
}
|
|
3814
|
-
function
|
|
3815
|
-
return
|
|
3800
|
+
function ni(e) {
|
|
3801
|
+
return n.makeEnvironmentProviders([{
|
|
3816
3802
|
provide: Q,
|
|
3817
|
-
useValue:
|
|
3818
|
-
},
|
|
3803
|
+
useValue: e
|
|
3804
|
+
}, n.provideEnvironmentInitializer(ti)]);
|
|
3819
3805
|
}
|
|
3820
3806
|
//#endregion
|
|
3821
3807
|
//#region src/document/provide-tanstack-head-managed-tags.ts
|
|
3822
|
-
function
|
|
3823
|
-
let
|
|
3824
|
-
root:
|
|
3808
|
+
function ri(e) {
|
|
3809
|
+
let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = Y(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = Tr({
|
|
3810
|
+
root: t.head,
|
|
3825
3811
|
bucket: "head",
|
|
3826
3812
|
renderer: o
|
|
3827
3813
|
});
|
|
3828
3814
|
s.mount();
|
|
3829
|
-
let c = $(
|
|
3815
|
+
let c = $(e).head;
|
|
3830
3816
|
s.sync(c);
|
|
3831
|
-
let l =
|
|
3817
|
+
let l = n.effect(() => {
|
|
3832
3818
|
a();
|
|
3833
|
-
let
|
|
3834
|
-
|
|
3819
|
+
let t = $(e).head;
|
|
3820
|
+
Jr(c, t) || (c = t, s.sync(t));
|
|
3835
3821
|
});
|
|
3836
3822
|
i.onDestroy(() => {
|
|
3837
3823
|
l.destroy(), s.destroy();
|
|
3838
3824
|
});
|
|
3839
3825
|
}
|
|
3840
|
-
function
|
|
3841
|
-
|
|
3826
|
+
function ii() {
|
|
3827
|
+
ri(n.inject(Q));
|
|
3842
3828
|
}
|
|
3843
|
-
function
|
|
3844
|
-
return
|
|
3829
|
+
function ai(e) {
|
|
3830
|
+
return n.makeEnvironmentProviders([{
|
|
3845
3831
|
provide: Q,
|
|
3846
|
-
useValue:
|
|
3847
|
-
},
|
|
3832
|
+
useValue: e
|
|
3833
|
+
}, n.provideEnvironmentInitializer(ii)]);
|
|
3848
3834
|
}
|
|
3849
3835
|
//#endregion
|
|
3850
3836
|
//#region src/document/provide-tanstack-document.ts
|
|
3851
|
-
var
|
|
3837
|
+
var oi = {
|
|
3852
3838
|
title: !0,
|
|
3853
3839
|
headTags: !0,
|
|
3854
3840
|
bodyScripts: !0
|
|
3855
3841
|
};
|
|
3856
|
-
function
|
|
3842
|
+
function si(e, t = {}) {
|
|
3857
3843
|
let r = {
|
|
3858
|
-
|
|
3859
|
-
...
|
|
3844
|
+
...oi,
|
|
3845
|
+
...t
|
|
3860
3846
|
}, i = r.title && r.headTags && r.bodyScripts;
|
|
3861
|
-
return
|
|
3847
|
+
return n.makeEnvironmentProviders([{
|
|
3862
3848
|
provide: Q,
|
|
3863
|
-
useValue:
|
|
3864
|
-
},
|
|
3849
|
+
useValue: e
|
|
3850
|
+
}, n.provideEnvironmentInitializer(() => {
|
|
3865
3851
|
if (i) {
|
|
3866
|
-
|
|
3852
|
+
Xr(e);
|
|
3867
3853
|
return;
|
|
3868
3854
|
}
|
|
3869
|
-
r.title &&
|
|
3855
|
+
r.title && ei(e), r.headTags && ri(e), r.bodyScripts && Zr(e);
|
|
3870
3856
|
})]);
|
|
3871
3857
|
}
|
|
3872
|
-
function
|
|
3873
|
-
return
|
|
3858
|
+
function ci(e) {
|
|
3859
|
+
return si(e);
|
|
3874
3860
|
}
|
|
3875
3861
|
//#endregion
|
|
3876
3862
|
//#region src/injectMatches.ts
|
|
3877
|
-
function
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
return t?.select ? t.select(r) : r;
|
|
3863
|
+
function li(e) {
|
|
3864
|
+
return Y(J().stores.matches, (t) => {
|
|
3865
|
+
let n = t;
|
|
3866
|
+
return e?.select ? e.select(n) : n;
|
|
3867
|
+
}, { equal: k });
|
|
3868
|
+
}
|
|
3869
|
+
function ui(e) {
|
|
3870
|
+
let t = n.inject(q);
|
|
3871
|
+
return li({ select: (n) => {
|
|
3872
|
+
let r = n.slice(0, n.findIndex((e) => e.id === t.matchId()));
|
|
3873
|
+
return e?.select ? e.select(r) : r;
|
|
3889
3874
|
} });
|
|
3890
3875
|
}
|
|
3891
|
-
function
|
|
3892
|
-
let
|
|
3893
|
-
return
|
|
3894
|
-
let r =
|
|
3895
|
-
return
|
|
3876
|
+
function di(e) {
|
|
3877
|
+
let t = n.inject(q);
|
|
3878
|
+
return li({ select: (n) => {
|
|
3879
|
+
let r = n.slice(n.findIndex((e) => e.id === t.matchId()) + 1);
|
|
3880
|
+
return e?.select ? e.select(r) : r;
|
|
3896
3881
|
} });
|
|
3897
3882
|
}
|
|
3898
3883
|
//#endregion
|
|
3899
3884
|
//#region src/injectMatchRoute.ts
|
|
3900
|
-
function
|
|
3901
|
-
let
|
|
3902
|
-
return (r) =>
|
|
3903
|
-
n
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
pending: e,
|
|
3885
|
+
function fi() {
|
|
3886
|
+
let e = J(), t = Y(e.stores.matchRouteDeps, (e) => e);
|
|
3887
|
+
return (r) => n.computed(() => {
|
|
3888
|
+
let { pending: n, caseSensitive: i, fuzzy: a, includeSearch: o, ...s } = r;
|
|
3889
|
+
return t(), e.matchRoute(s, {
|
|
3890
|
+
pending: n,
|
|
3907
3891
|
caseSensitive: i,
|
|
3908
3892
|
fuzzy: a,
|
|
3909
3893
|
includeSearch: o
|
|
@@ -3912,13 +3896,14 @@ function ai() {
|
|
|
3912
3896
|
}
|
|
3913
3897
|
//#endregion
|
|
3914
3898
|
//#region src/injectLocation.ts
|
|
3915
|
-
function
|
|
3916
|
-
|
|
3899
|
+
function pi(e) {
|
|
3900
|
+
let t = J();
|
|
3901
|
+
return e?.select ? Y(t.stores.location, e.select, { equal: k }) : Y(t.stores.location);
|
|
3917
3902
|
}
|
|
3918
3903
|
//#endregion
|
|
3919
3904
|
//#region src/injectBlocker.ts
|
|
3920
|
-
function
|
|
3921
|
-
let { shouldBlockFn:
|
|
3905
|
+
function mi(e) {
|
|
3906
|
+
let { shouldBlockFn: t, enableBeforeUnload: r = !0, disabled: i = !1, withResolver: a = !1 } = e, o = J(), { history: s } = o, c = n.signal({
|
|
3922
3907
|
status: "idle",
|
|
3923
3908
|
current: void 0,
|
|
3924
3909
|
next: void 0,
|
|
@@ -3926,10 +3911,10 @@ function si(t) {
|
|
|
3926
3911
|
proceed: void 0,
|
|
3927
3912
|
reset: void 0
|
|
3928
3913
|
});
|
|
3929
|
-
return
|
|
3930
|
-
let
|
|
3914
|
+
return n.effect((e) => {
|
|
3915
|
+
let n = (typeof i == "function" ? i() : i) ? void 0 : s.block({
|
|
3931
3916
|
blockerFn: async (e) => {
|
|
3932
|
-
function
|
|
3917
|
+
function n(e) {
|
|
3933
3918
|
let t = o.parseLocation(e), n = o.getMatchedRoutes(t.pathname);
|
|
3934
3919
|
return n.foundRoute === void 0 ? {
|
|
3935
3920
|
routeId: "__notFound__",
|
|
@@ -3945,9 +3930,9 @@ function si(t) {
|
|
|
3945
3930
|
search: t.search
|
|
3946
3931
|
};
|
|
3947
3932
|
}
|
|
3948
|
-
let r =
|
|
3933
|
+
let r = n(e.currentLocation), i = n(e.nextLocation);
|
|
3949
3934
|
if (r.routeId === "__notFound__" && i.routeId !== "__notFound__") return !1;
|
|
3950
|
-
let s = await
|
|
3935
|
+
let s = await t({
|
|
3951
3936
|
action: e.action,
|
|
3952
3937
|
current: r,
|
|
3953
3938
|
next: i
|
|
@@ -3975,80 +3960,80 @@ function si(t) {
|
|
|
3975
3960
|
},
|
|
3976
3961
|
enableBeforeUnload: r
|
|
3977
3962
|
});
|
|
3978
|
-
e(() =>
|
|
3963
|
+
e(() => n?.());
|
|
3979
3964
|
}), c.asReadonly();
|
|
3980
3965
|
}
|
|
3981
3966
|
//#endregion
|
|
3982
3967
|
//#region src/injectCanGoBack.ts
|
|
3983
|
-
function
|
|
3984
|
-
return Y(J().stores.location, (e) => e.state
|
|
3968
|
+
function hi() {
|
|
3969
|
+
return Y(J().stores.location, (e) => (e.state?.__TSR_index ?? 0) !== 0);
|
|
3985
3970
|
}
|
|
3986
3971
|
//#endregion
|
|
3987
3972
|
//#region src/injectIntersectionObserver.ts
|
|
3988
|
-
function
|
|
3989
|
-
let i =
|
|
3990
|
-
|
|
3973
|
+
function gi(e, t, r) {
|
|
3974
|
+
let i = n.inject(n.ElementRef);
|
|
3975
|
+
n.afterRenderEffect((n) => {
|
|
3991
3976
|
let a = typeof IntersectionObserver == "function", o = i.nativeElement;
|
|
3992
3977
|
if (!o || !a || r()) return;
|
|
3993
|
-
let s = new IntersectionObserver(([
|
|
3994
|
-
s.observe(o),
|
|
3978
|
+
let s = new IntersectionObserver(([t]) => e(t), t);
|
|
3979
|
+
s.observe(o), n(() => {
|
|
3995
3980
|
s.disconnect();
|
|
3996
3981
|
});
|
|
3997
3982
|
});
|
|
3998
3983
|
}
|
|
3999
3984
|
//#endregion
|
|
4000
3985
|
//#region src/Link.ts
|
|
4001
|
-
var
|
|
3986
|
+
var _i = class e {
|
|
4002
3987
|
constructor() {
|
|
4003
|
-
this.passiveEvents =
|
|
3988
|
+
this.passiveEvents = yi(() => ({ touchstart: this.handleTouchStart })), this.options = g.required({ alias: "link" }), this.router = J(), this.isTransitioning = x(!1), this.from = p(() => S(() => this.options().from)), this.disabled = p(() => this._options().disabled ?? !1), this.target = p(() => this._options().target), this._options = p(() => ({
|
|
4004
3989
|
...this.options(),
|
|
4005
3990
|
from: this.from()
|
|
4006
|
-
})), this.nextLocation =
|
|
3991
|
+
})), this.nextLocation = p(() => {
|
|
4007
3992
|
let e = this.location();
|
|
4008
3993
|
return this.router.buildLocation({
|
|
4009
3994
|
_fromLocation: e,
|
|
4010
3995
|
...this._options()
|
|
4011
3996
|
});
|
|
4012
|
-
}), this.hrefOption =
|
|
3997
|
+
}), this.hrefOption = p(() => {
|
|
4013
3998
|
if (this._options().disabled) return;
|
|
4014
3999
|
let e = this.nextLocation().maskedLocation ?? this.nextLocation(), t = e.external;
|
|
4015
4000
|
return {
|
|
4016
4001
|
href: t ? e.publicHref : this.router.history.createHref(e.publicHref) || "/",
|
|
4017
4002
|
external: t
|
|
4018
4003
|
};
|
|
4019
|
-
}), this.externalLink =
|
|
4004
|
+
}), this.externalLink = p(() => {
|
|
4020
4005
|
let e = this.hrefOption();
|
|
4021
4006
|
if (e?.external) return e.href;
|
|
4022
4007
|
try {
|
|
4023
4008
|
return new URL(this.options().to), this.options().to;
|
|
4024
4009
|
} catch {}
|
|
4025
|
-
}), this.preload =
|
|
4010
|
+
}), this.preload = p(() => this.options().reloadDocument ? !1 : this.options().preload ?? this.router.options.defaultPreload), this.preloadDelay = p(() => this.options().preloadDelay ?? this.router.options.defaultPreloadDelay ?? 0), this.location = pi(), this.isActiveProps = p(() => {
|
|
4026
4011
|
let e = this.options(), t = this.isActive() ? e.activeProps : e.inactiveProps;
|
|
4027
4012
|
if (!(!t || typeof t != "object")) return t;
|
|
4028
|
-
}), this.isActive =
|
|
4013
|
+
}), this.isActive = p(() => {
|
|
4029
4014
|
if (this.externalLink()) return !1;
|
|
4030
4015
|
let e = this.options().activeOptions;
|
|
4031
4016
|
if (e?.exact) {
|
|
4032
|
-
if (!
|
|
4017
|
+
if (!Ke(this.location().pathname, this.nextLocation().pathname, this.router.basepath)) return !1;
|
|
4033
4018
|
} else {
|
|
4034
|
-
let e =
|
|
4019
|
+
let e = Ge(this.location().pathname, this.router.basepath), t = Ge(this.nextLocation().pathname, this.router.basepath);
|
|
4035
4020
|
if (!(e.startsWith(t) && (e.length === t.length || e[t.length] === "/"))) return !1;
|
|
4036
4021
|
}
|
|
4037
|
-
return (e?.includeSearch ?? !0) && !
|
|
4022
|
+
return (e?.includeSearch ?? !0) && !k(this.location().search, this.nextLocation().search, {
|
|
4038
4023
|
partial: !e?.exact,
|
|
4039
4024
|
ignoreUndefined: !e?.explicitUndefined
|
|
4040
4025
|
}) ? !1 : e?.includeHash ? this.location().hash === this.nextLocation().hash : !0;
|
|
4041
4026
|
}), this.doPreload = () => {
|
|
4042
4027
|
this.router.preloadRoute(this.options()).catch((e) => {
|
|
4043
|
-
console.warn(e), console.warn(
|
|
4028
|
+
console.warn(e), console.warn(dn);
|
|
4044
4029
|
});
|
|
4045
4030
|
}, this.preloadViewportIoCallback = (e) => {
|
|
4046
4031
|
e?.isIntersecting && this.doPreload();
|
|
4047
|
-
}, this.viewportPreloader =
|
|
4032
|
+
}, this.viewportPreloader = gi(this.preloadViewportIoCallback, { rootMargin: "100px" }, () => !!this._options().disabled || this.preload() !== "viewport"), this.hasRenderFetched = !1, this.rendererPreloader = m(() => {
|
|
4048
4033
|
this.hasRenderFetched || !this._options().disabled && this.preload() === "render" && (this.doPreload(), this.hasRenderFetched = !0);
|
|
4049
4034
|
}), this.handleClick = (e) => {
|
|
4050
4035
|
let t = e.currentTarget.getAttribute("target"), n = this._options().target, r = n === void 0 ? t : n;
|
|
4051
|
-
if (!this._options().disabled && !
|
|
4036
|
+
if (!this._options().disabled && !vi(e) && !e.defaultPrevented && (!r || r === "_self") && e.button === 0) {
|
|
4052
4037
|
e.preventDefault(), this.isTransitioning.set(!0);
|
|
4053
4038
|
let t = this.router.subscribe("onResolved", () => {
|
|
4054
4039
|
t(), this.isTransitioning.set(!1);
|
|
@@ -4075,33 +4060,33 @@ var ui = class t {
|
|
|
4075
4060
|
};
|
|
4076
4061
|
}
|
|
4077
4062
|
static {
|
|
4078
|
-
this.ɵfac = function(
|
|
4079
|
-
return new (
|
|
4063
|
+
this.ɵfac = function(t) {
|
|
4064
|
+
return new (t || e)();
|
|
4080
4065
|
};
|
|
4081
4066
|
}
|
|
4082
4067
|
static {
|
|
4083
|
-
this.ɵdir = /* @__PURE__ */
|
|
4084
|
-
type:
|
|
4068
|
+
this.ɵdir = /* @__PURE__ */ n.ɵɵdefineDirective({
|
|
4069
|
+
type: e,
|
|
4085
4070
|
selectors: [[
|
|
4086
4071
|
"a",
|
|
4087
4072
|
"link",
|
|
4088
4073
|
""
|
|
4089
4074
|
]],
|
|
4090
4075
|
hostVars: 11,
|
|
4091
|
-
hostBindings: function(
|
|
4092
|
-
if (
|
|
4093
|
-
return
|
|
4076
|
+
hostBindings: function(e, t) {
|
|
4077
|
+
if (e & 1 && n.ɵɵlistener("click", function(e) {
|
|
4078
|
+
return t.handleClick(e);
|
|
4094
4079
|
})("focus", function() {
|
|
4095
|
-
return
|
|
4080
|
+
return t.handleFocus();
|
|
4096
4081
|
})("mouseenter", function(e) {
|
|
4097
|
-
return
|
|
4082
|
+
return t.handleEnter(e);
|
|
4098
4083
|
})("mouseover", function(e) {
|
|
4099
|
-
return
|
|
4084
|
+
return t.handleEnter(e);
|
|
4100
4085
|
})("mouseleave", function(e) {
|
|
4101
|
-
return
|
|
4102
|
-
}),
|
|
4103
|
-
let
|
|
4104
|
-
|
|
4086
|
+
return t.handleLeave(e);
|
|
4087
|
+
}), e & 2) {
|
|
4088
|
+
let e, r, i;
|
|
4089
|
+
n.ɵɵdomProperty("href", (e = t.hrefOption()) == null ? null : e.href), n.ɵɵattribute("target", t.target())("role", t.disabled() ? "link" : void 0)("aria-disabled", t.disabled())("data-status", t.isActive() ? "active" : void 0)("aria-current", t.isActive() ? "page" : void 0)("data-transitioning", t.isTransitioning() ? "transitioning" : void 0), n.ɵɵstyleMap((r = t.isActiveProps()) == null ? null : r.style), n.ɵɵclassMap((i = t.isActiveProps()) == null ? null : i.class);
|
|
4105
4090
|
}
|
|
4106
4091
|
},
|
|
4107
4092
|
inputs: { options: [
|
|
@@ -4113,19 +4098,19 @@ var ui = class t {
|
|
|
4113
4098
|
});
|
|
4114
4099
|
}
|
|
4115
4100
|
};
|
|
4116
|
-
function
|
|
4101
|
+
function vi(e) {
|
|
4117
4102
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
4118
4103
|
}
|
|
4119
|
-
function
|
|
4120
|
-
let t =
|
|
4121
|
-
|
|
4122
|
-
for (let [n,
|
|
4123
|
-
let e =
|
|
4104
|
+
function yi(e) {
|
|
4105
|
+
let t = h(a).nativeElement, n = h(i), r = h(l), o = [];
|
|
4106
|
+
d(() => {
|
|
4107
|
+
for (let [n, i] of Object.entries(e())) {
|
|
4108
|
+
let e = r.listen(t, n, i, { passive: !0 });
|
|
4124
4109
|
o.push(e);
|
|
4125
4110
|
}
|
|
4126
|
-
}),
|
|
4111
|
+
}), n.onDestroy(() => {
|
|
4127
4112
|
for (; o.length;) o.pop()?.();
|
|
4128
4113
|
});
|
|
4129
4114
|
}
|
|
4130
4115
|
//#endregion
|
|
4131
|
-
export {
|
|
4116
|
+
export { Gn as LazyRoute, _i as Link, pr as Matches, Vn as NotFoundRoute, ar as Outlet, zn as RootRoute, In as Route, Fn as RouteApi, ir as RouteMatch, xn as Router, vr as RouterProvider, Ir as buildManagedDocumentContent, $ as buildMatchManagedDocumentContent, Kt as createBrowserHistory, Un as createFileRoute, qt as createHashHistory, Wt as createHistory, qn as createLazyFileRoute, Kn as createLazyRoute, Jt as createMemoryHistory, Hn as createRootRoute, Rn as createRootRouteWithContext, Ln as createRoute, Bn as createRouteMask, bn as createRouter, hn as createRouterConfig, Pn as getRouteApi, mi as injectBlocker, hi as injectCanGoBack, di as injectChildMatches, $n as injectErrorState, On as injectLoaderData, kn as injectLoaderDeps, pi as injectLocation, X as injectMatch, fi as injectMatchRoute, li as injectMatches, An as injectNavigate, jn as injectParams, ui as injectParentMatches, Mn as injectRouteContext, J as injectRouter, er as injectRouterState, Nn as injectSearch, lr as injectSsrScrollRestorationScript, Y as injectStore, B as isRedirect, nn as lazyFn, Qe as notFound, ci as provideHeadContent, $r as provideTanstackBodyManagedTags, si as provideTanstackDocument, ni as provideTanstackDocumentTitle, ai as provideTanstackHeadManagedTags, _r as provideTanstackRouter, ht as redirect, gn as retainSearchParams };
|