@benjavicente/angular-router-experimental 1.142.12 → 1.142.13
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 +199 -166
- package/dist/fesm2022/tanstack-angular-router-experimental.mjs +645 -606
- package/dist/types/tanstack-angular-router-experimental-experimental.d.ts +0 -3
- package/dist/types/tanstack-angular-router-experimental.d.ts +4 -5
- package/package.json +4 -4
- package/src/Match.ts +53 -11
- package/src/index.ts +1 -0
- package/src/injectIsShell.ts +7 -0
- package/src/renderer/injectIsCatchingError.ts +20 -8
- package/src/renderer/injectRender.ts +4 -2
- package/src/route.ts +0 -3
|
@@ -101,19 +101,19 @@ function A(e) {
|
|
|
101
101
|
r.status = "rejected", n(e);
|
|
102
102
|
}, r;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function j(e) {
|
|
105
105
|
return !!(e && typeof e == "object" && typeof e.then == "function");
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function ce(e, t) {
|
|
108
108
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
109
109
|
let r = e[n];
|
|
110
110
|
if (t(r)) return r;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function le(e) {
|
|
114
114
|
return e.replace(/[\x00-\x1f\x7f]/g, "");
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function ue(e) {
|
|
117
117
|
let t;
|
|
118
118
|
try {
|
|
119
119
|
t = decodeURI(e);
|
|
@@ -126,15 +126,15 @@ function de(e) {
|
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
return
|
|
129
|
+
return le(t);
|
|
130
130
|
}
|
|
131
|
-
var
|
|
131
|
+
var de = [
|
|
132
132
|
"http:",
|
|
133
133
|
"https:",
|
|
134
134
|
"mailto:",
|
|
135
135
|
"tel:"
|
|
136
136
|
];
|
|
137
|
-
function
|
|
137
|
+
function fe(e, t) {
|
|
138
138
|
if (!e) return !1;
|
|
139
139
|
try {
|
|
140
140
|
let n = new URL(e);
|
|
@@ -143,24 +143,24 @@ function pe(e, t) {
|
|
|
143
143
|
return !1;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
var
|
|
146
|
+
var pe = {
|
|
147
147
|
"&": "\\u0026",
|
|
148
148
|
">": "\\u003e",
|
|
149
149
|
"<": "\\u003c",
|
|
150
150
|
"\u2028": "\\u2028",
|
|
151
151
|
"\u2029": "\\u2029"
|
|
152
|
-
},
|
|
153
|
-
function
|
|
154
|
-
return e.replace(
|
|
152
|
+
}, me = /[&><\u2028\u2029]/g;
|
|
153
|
+
function he(e) {
|
|
154
|
+
return e.replace(me, (e) => pe[e]);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function ge(e) {
|
|
157
157
|
if (!e || !/[%\\\x00-\x1f\x7f]/.test(e) && !e.startsWith("//")) return {
|
|
158
158
|
path: e,
|
|
159
159
|
handledProtocolRelativeURL: !1
|
|
160
160
|
};
|
|
161
161
|
let t = /%25|%5C/gi, n = 0, r = "", i;
|
|
162
|
-
for (; (i = t.exec(e)) !== null;) r +=
|
|
163
|
-
r +=
|
|
162
|
+
for (; (i = t.exec(e)) !== null;) r += ue(e.slice(n, i.index)) + i[0], n = t.lastIndex;
|
|
163
|
+
r += ue(n ? e.slice(n) : e);
|
|
164
164
|
let a = !1;
|
|
165
165
|
return r.startsWith("//") && (a = !0, r = "/" + r.replace(/^\/+/, "")), {
|
|
166
166
|
path: r,
|
|
@@ -183,7 +183,7 @@ function ye() {
|
|
|
183
183
|
}
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region ../router-core/dist/esm/lru-cache.js
|
|
186
|
-
function
|
|
186
|
+
function be(e) {
|
|
187
187
|
let t = /* @__PURE__ */ new Map(), n, r, i = (e) => {
|
|
188
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);
|
|
189
189
|
};
|
|
@@ -215,14 +215,14 @@ function M(e) {
|
|
|
215
215
|
}
|
|
216
216
|
//#endregion
|
|
217
217
|
//#region ../router-core/dist/esm/new-process-route-tree.js
|
|
218
|
-
var
|
|
219
|
-
function
|
|
218
|
+
var M = 4, xe = 5;
|
|
219
|
+
function Se(e) {
|
|
220
220
|
let t = e.indexOf("{");
|
|
221
221
|
if (t === -1) return null;
|
|
222
222
|
let n = e.indexOf("}", t);
|
|
223
223
|
return n === -1 || t + 1 >= e.length ? null : [t, n];
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Ce(e, t, n = new Uint16Array(6)) {
|
|
226
226
|
let r = e.indexOf("/", t), i = r === -1 ? e.length : r, a = e.substring(t, i);
|
|
227
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;
|
|
228
228
|
if (a === "$") {
|
|
@@ -230,7 +230,7 @@ function Se(e, t, n = new Uint16Array(6)) {
|
|
|
230
230
|
return n[0] = 2, n[1] = t, n[2] = t, n[3] = r, n[4] = r, n[5] = r, n;
|
|
231
231
|
}
|
|
232
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;
|
|
233
|
-
let o =
|
|
233
|
+
let o = Se(a);
|
|
234
234
|
if (o) {
|
|
235
235
|
let [r, s] = o, c = a.charCodeAt(r + 1);
|
|
236
236
|
if (c === 45) {
|
|
@@ -245,13 +245,13 @@ function Se(e, t, n = new Uint16Array(6)) {
|
|
|
245
245
|
}
|
|
246
246
|
return n[0] = 0, n[1] = t, n[2] = t, n[3] = i, n[4] = i, n[5] = i, n;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function we(e, t, n, r, i, a, o) {
|
|
249
249
|
o?.(n);
|
|
250
250
|
let s = r;
|
|
251
251
|
{
|
|
252
252
|
let r = n.fullPath ?? n.from, o = r.length, c = n.options?.caseSensitive ?? e, l = n.options?.params?.parse ?? n.options?.parseParams;
|
|
253
253
|
for (; s < o;) {
|
|
254
|
-
let e =
|
|
254
|
+
let e = Ce(r, s, t), o, u = s, d = e[5];
|
|
255
255
|
switch (s = d + 1, a++, e[0]) {
|
|
256
256
|
case 0: {
|
|
257
257
|
let t = r.substring(e[2], e[3]);
|
|
@@ -260,7 +260,7 @@ function Ce(e, t, n, r, i, a, o) {
|
|
|
260
260
|
if (e) o = e;
|
|
261
261
|
else {
|
|
262
262
|
i.static ??= /* @__PURE__ */ new Map();
|
|
263
|
-
let e =
|
|
263
|
+
let e = P(n.fullPath ?? n.from);
|
|
264
264
|
e.parent = i, e.depth = a, o = e, i.static.set(t, e);
|
|
265
265
|
}
|
|
266
266
|
} else {
|
|
@@ -268,7 +268,7 @@ function Ce(e, t, n, r, i, a, o) {
|
|
|
268
268
|
if (r) o = r;
|
|
269
269
|
else {
|
|
270
270
|
i.staticInsensitive ??= /* @__PURE__ */ new Map();
|
|
271
|
-
let t =
|
|
271
|
+
let t = P(n.fullPath ?? n.from);
|
|
272
272
|
t.parent = i, t.depth = a, o = t, i.staticInsensitive.set(e, t);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
@@ -278,7 +278,7 @@ function Ce(e, t, n, r, i, a, o) {
|
|
|
278
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);
|
|
279
279
|
if (h) o = h;
|
|
280
280
|
else {
|
|
281
|
-
let e =
|
|
281
|
+
let e = Ee(1, n.fullPath ?? n.from, f, p, m);
|
|
282
282
|
o = e, e.depth = a, e.parent = i, i.dynamic ??= [], i.dynamic.push(e);
|
|
283
283
|
}
|
|
284
284
|
break;
|
|
@@ -287,32 +287,32 @@ function Ce(e, t, n, r, i, a, o) {
|
|
|
287
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);
|
|
288
288
|
if (h) o = h;
|
|
289
289
|
else {
|
|
290
|
-
let e =
|
|
290
|
+
let e = Ee(3, n.fullPath ?? n.from, f, p, m);
|
|
291
291
|
o = e, e.parent = i, e.depth = a, i.optional ??= [], i.optional.push(e);
|
|
292
292
|
}
|
|
293
293
|
break;
|
|
294
294
|
}
|
|
295
295
|
case 2: {
|
|
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 =
|
|
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 = Ee(2, n.fullPath ?? n.from, l, f, p);
|
|
297
297
|
o = m, m.parent = i, m.depth = a, i.wildcard ??= [], i.wildcard.push(m);
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
i = o;
|
|
301
301
|
}
|
|
302
302
|
if (l && n.children && !n.isRoot && n.id && n.id.charCodeAt(n.id.lastIndexOf("/") + 1) === 95) {
|
|
303
|
-
let e =
|
|
304
|
-
e.kind =
|
|
303
|
+
let e = P(n.fullPath ?? n.from);
|
|
304
|
+
e.kind = xe, e.parent = i, a++, e.depth = a, i.pathless ??= [], i.pathless.push(e), i = e;
|
|
305
305
|
}
|
|
306
306
|
let u = (n.path || !n.children) && !n.isRoot;
|
|
307
307
|
if (u && r.endsWith("/")) {
|
|
308
|
-
let e =
|
|
309
|
-
e.kind =
|
|
308
|
+
let e = P(n.fullPath ?? n.from);
|
|
309
|
+
e.kind = M, e.parent = i, a++, e.depth = a, i.index = e, i = e;
|
|
310
310
|
}
|
|
311
311
|
i.parse = l ?? null, u && !i.route && (i.route = n, i.fullPath = n.fullPath ?? n.from);
|
|
312
312
|
}
|
|
313
|
-
if (n.children) for (let r of n.children)
|
|
313
|
+
if (n.children) for (let r of n.children) we(e, t, r, s, i, a, o);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function Te(e, t) {
|
|
316
316
|
if (e.parse && !t.parse) return -1;
|
|
317
317
|
if (!e.parse && t.parse) return 1;
|
|
318
318
|
if (e.prefix && t.prefix && e.prefix !== t.prefix) {
|
|
@@ -325,24 +325,24 @@ function we(e, t) {
|
|
|
325
325
|
}
|
|
326
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;
|
|
327
327
|
}
|
|
328
|
-
function
|
|
329
|
-
if (e.pathless) for (let t of e.pathless)
|
|
330
|
-
if (e.static) for (let t of e.static.values())
|
|
331
|
-
if (e.staticInsensitive) for (let t of e.staticInsensitive.values())
|
|
328
|
+
function N(e) {
|
|
329
|
+
if (e.pathless) for (let t of e.pathless) N(t);
|
|
330
|
+
if (e.static) for (let t of e.static.values()) N(t);
|
|
331
|
+
if (e.staticInsensitive) for (let t of e.staticInsensitive.values()) N(t);
|
|
332
332
|
if (e.dynamic?.length) {
|
|
333
|
-
e.dynamic.sort(
|
|
334
|
-
for (let t of e.dynamic)
|
|
333
|
+
e.dynamic.sort(Te);
|
|
334
|
+
for (let t of e.dynamic) N(t);
|
|
335
335
|
}
|
|
336
336
|
if (e.optional?.length) {
|
|
337
|
-
e.optional.sort(
|
|
338
|
-
for (let t of e.optional)
|
|
337
|
+
e.optional.sort(Te);
|
|
338
|
+
for (let t of e.optional) N(t);
|
|
339
339
|
}
|
|
340
340
|
if (e.wildcard?.length) {
|
|
341
|
-
e.wildcard.sort(
|
|
342
|
-
for (let t of e.wildcard)
|
|
341
|
+
e.wildcard.sort(Te);
|
|
342
|
+
for (let t of e.wildcard) N(t);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function P(e) {
|
|
346
346
|
return {
|
|
347
347
|
kind: 0,
|
|
348
348
|
depth: 0,
|
|
@@ -359,7 +359,7 @@ function F(e) {
|
|
|
359
359
|
parse: null
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Ee(e, t, n, r, i) {
|
|
363
363
|
return {
|
|
364
364
|
kind: e,
|
|
365
365
|
depth: 0,
|
|
@@ -379,56 +379,56 @@ function Te(e, t, n, r, i) {
|
|
|
379
379
|
suffix: i
|
|
380
380
|
};
|
|
381
381
|
}
|
|
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);
|
|
386
|
-
}
|
|
387
382
|
function De(e, t) {
|
|
383
|
+
let n = P("/"), r = new Uint16Array(6);
|
|
384
|
+
for (let t of e) we(!1, r, t, 1, n, 0);
|
|
385
|
+
N(n), t.masksTree = n, t.flatCache = be(1e3);
|
|
386
|
+
}
|
|
387
|
+
function Oe(e, t) {
|
|
388
388
|
e ||= "/";
|
|
389
389
|
let n = t.flatCache.get(e);
|
|
390
390
|
if (n) return n;
|
|
391
|
-
let r =
|
|
391
|
+
let r = Ne(e, t.masksTree);
|
|
392
392
|
return t.flatCache.set(e, r), r;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function ke(e, t, n, r, i) {
|
|
395
395
|
e ||= "/", r ||= "/";
|
|
396
396
|
let a = t ? `case\0${e}` : e, o = i.singleCache.get(a);
|
|
397
|
-
return o || (o =
|
|
397
|
+
return o || (o = P("/"), we(t, new Uint16Array(6), { from: e }, 1, o, 0), i.singleCache.set(a, o)), Ne(r, o, n);
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function Ae(e, t, n = !1) {
|
|
400
400
|
let r = n ? e : `nofuzz\0${e}`, i = t.matchCache.get(r);
|
|
401
401
|
if (i !== void 0) return i;
|
|
402
402
|
e ||= "/";
|
|
403
403
|
let a;
|
|
404
404
|
try {
|
|
405
|
-
a =
|
|
405
|
+
a = Ne(e, t.segmentTree, n);
|
|
406
406
|
} catch (e) {
|
|
407
407
|
if (e instanceof URIError) a = null;
|
|
408
408
|
else throw e;
|
|
409
409
|
}
|
|
410
|
-
return a && (a.branch =
|
|
410
|
+
return a && (a.branch = Fe(a.route)), t.matchCache.set(r, a), a;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function je(e) {
|
|
413
413
|
return e === "/" ? e : e.replace(/\/{1,}$/, "");
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
let r =
|
|
417
|
-
return
|
|
415
|
+
function Me(e, t = !1, n) {
|
|
416
|
+
let r = P(e.fullPath), i = new Uint16Array(6), a = {}, o = {}, s = 0;
|
|
417
|
+
return we(t, i, e, 1, r, 0, (e) => {
|
|
418
418
|
if (n?.(e, s), e.id in a) {
|
|
419
419
|
if (process.env.NODE_ENV !== "production") throw Error(`Invariant failed: Duplicate routes found with id: ${String(e.id)}`);
|
|
420
420
|
ye();
|
|
421
421
|
}
|
|
422
422
|
if (a[e.id] = e, s !== 0 && e.path) {
|
|
423
|
-
let t =
|
|
423
|
+
let t = je(e.fullPath);
|
|
424
424
|
(!o[t] || e.fullPath.endsWith("/")) && (o[t] = e);
|
|
425
425
|
}
|
|
426
426
|
s++;
|
|
427
|
-
}),
|
|
427
|
+
}), N(r), {
|
|
428
428
|
processedTree: {
|
|
429
429
|
segmentTree: r,
|
|
430
|
-
singleCache:
|
|
431
|
-
matchCache:
|
|
430
|
+
singleCache: be(1e3),
|
|
431
|
+
matchCache: be(1e3),
|
|
432
432
|
flatCache: null,
|
|
433
433
|
masksTree: null
|
|
434
434
|
},
|
|
@@ -436,21 +436,21 @@ function je(e, t = !1, n) {
|
|
|
436
436
|
routesByPath: o
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
let r = e.split("/"), i =
|
|
439
|
+
function Ne(e, t, n = !1) {
|
|
440
|
+
let r = e.split("/"), i = Le(e, r, t, n);
|
|
441
441
|
if (!i) return null;
|
|
442
|
-
let [a] =
|
|
442
|
+
let [a] = Pe(e, r, i);
|
|
443
443
|
return {
|
|
444
444
|
route: i.node.route,
|
|
445
445
|
rawParams: a
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
|
-
function
|
|
449
|
-
let r =
|
|
448
|
+
function Pe(e, t, n) {
|
|
449
|
+
let r = Ie(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 === M) break;
|
|
453
|
+
if (u.kind === xe) {
|
|
454
454
|
l--, o--, c--;
|
|
455
455
|
continue;
|
|
456
456
|
}
|
|
@@ -486,19 +486,19 @@ function Ne(e, t, n) {
|
|
|
486
486
|
segment: l
|
|
487
487
|
}];
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Fe(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 Ie(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 Le(e, t, n, r) {
|
|
502
502
|
if (e === "/" && n.index) return {
|
|
503
503
|
node: n.index,
|
|
504
504
|
skipped: 0
|
|
@@ -514,14 +514,14 @@ function Ie(e, t, n, r) {
|
|
|
514
514
|
}], c = null, l = null;
|
|
515
515
|
for (; s.length;) {
|
|
516
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 && !
|
|
517
|
+
if (i.kind === 2 && i.route && !Ve(l, n)) continue;
|
|
518
518
|
if (i.parse) {
|
|
519
|
-
if (!
|
|
519
|
+
if (!Be(e, t, n)) continue;
|
|
520
520
|
_ = n.rawParams, g = n.extract;
|
|
521
521
|
}
|
|
522
|
-
r && i.route && i.kind !==
|
|
522
|
+
r && i.route && i.kind !== M && Ve(c, n) && (c = n);
|
|
523
523
|
let v = u === o;
|
|
524
|
-
if (v && (i.route && (!a || i.kind ===
|
|
524
|
+
if (v && (i.route && (!a || i.kind === M || i.kind === 2) && Ve(l, n) && (l = n), !i.optional && !i.wildcard && !i.index && !i.pathless)) continue;
|
|
525
525
|
let y = v ? void 0 : t[u], b;
|
|
526
526
|
if (v && i.index) {
|
|
527
527
|
let n = {
|
|
@@ -535,9 +535,9 @@ function Ie(e, t, n, r) {
|
|
|
535
535
|
extract: g,
|
|
536
536
|
rawParams: _
|
|
537
537
|
}, r = !0;
|
|
538
|
-
if (i.index.parse && (
|
|
539
|
-
if (!m && !h && !d &&
|
|
540
|
-
|
|
538
|
+
if (i.index.parse && (Be(e, t, n) || (r = !1)), r) {
|
|
539
|
+
if (!m && !h && !d && ze(p, o)) return n;
|
|
540
|
+
Ve(l, n) && (l = n);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
if (i.wildcard) for (let e = i.wildcard.length - 1; e >= 0; e--) {
|
|
@@ -590,7 +590,7 @@ function Ie(e, t, n, r) {
|
|
|
590
590
|
depth: t,
|
|
591
591
|
statics: p,
|
|
592
592
|
dynamics: m,
|
|
593
|
-
optionals: h +
|
|
593
|
+
optionals: h + Re(o, u),
|
|
594
594
|
extract: g,
|
|
595
595
|
rawParams: _
|
|
596
596
|
});
|
|
@@ -608,7 +608,7 @@ function Ie(e, t, n, r) {
|
|
|
608
608
|
skipped: d,
|
|
609
609
|
depth: f + 1,
|
|
610
610
|
statics: p,
|
|
611
|
-
dynamics: m +
|
|
611
|
+
dynamics: m + Re(o, u),
|
|
612
612
|
optionals: h,
|
|
613
613
|
extract: g,
|
|
614
614
|
rawParams: _
|
|
@@ -621,7 +621,7 @@ function Ie(e, t, n, r) {
|
|
|
621
621
|
index: u + 1,
|
|
622
622
|
skipped: d,
|
|
623
623
|
depth: f + 1,
|
|
624
|
-
statics: p +
|
|
624
|
+
statics: p + Re(o, u),
|
|
625
625
|
dynamics: m,
|
|
626
626
|
optionals: h,
|
|
627
627
|
extract: g,
|
|
@@ -635,7 +635,7 @@ function Ie(e, t, n, r) {
|
|
|
635
635
|
index: u + 1,
|
|
636
636
|
skipped: d,
|
|
637
637
|
depth: f + 1,
|
|
638
|
-
statics: p +
|
|
638
|
+
statics: p + Re(o, u),
|
|
639
639
|
dynamics: m,
|
|
640
640
|
optionals: h,
|
|
641
641
|
extract: g,
|
|
@@ -669,16 +669,16 @@ function Ie(e, t, n, r) {
|
|
|
669
669
|
}
|
|
670
670
|
return null;
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function Re(e, t) {
|
|
673
673
|
return 2 ** (e - t - 1);
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function ze(e, t) {
|
|
676
676
|
return e === 2 ** (t - 1) - 1;
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function Be(e, t, n) {
|
|
679
679
|
let r, i;
|
|
680
680
|
try {
|
|
681
|
-
[r, i] =
|
|
681
|
+
[r, i] = Pe(e, t, n);
|
|
682
682
|
} catch {
|
|
683
683
|
return null;
|
|
684
684
|
}
|
|
@@ -688,34 +688,34 @@ function ze(e, t, n) {
|
|
|
688
688
|
} catch {}
|
|
689
689
|
return !0;
|
|
690
690
|
}
|
|
691
|
-
function
|
|
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 ===
|
|
691
|
+
function Ve(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 === M) > (e.node.kind === M) || t.node.kind === M == (e.node.kind === M) && t.depth > e.depth))) : !0;
|
|
693
693
|
}
|
|
694
694
|
//#endregion
|
|
695
695
|
//#region ../router-core/dist/esm/path.js
|
|
696
|
-
function Ve(e) {
|
|
697
|
-
return He(e.filter((e) => e !== void 0).join("/"));
|
|
698
|
-
}
|
|
699
696
|
function He(e) {
|
|
700
|
-
return e.
|
|
697
|
+
return Ue(e.filter((e) => e !== void 0).join("/"));
|
|
701
698
|
}
|
|
702
699
|
function Ue(e) {
|
|
700
|
+
return e.replace(/\/{2,}/g, "/");
|
|
701
|
+
}
|
|
702
|
+
function We(e) {
|
|
703
703
|
return e === "/" ? e : e.replace(/^\/{1,}/, "");
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function F(e) {
|
|
706
706
|
let t = e.length;
|
|
707
707
|
return t > 1 && e[t - 1] === "/" ? e.replace(/\/{1,}$/, "") : e;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
return
|
|
709
|
+
function Ge(e) {
|
|
710
|
+
return F(We(e));
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function Ke(e, t) {
|
|
713
713
|
return e?.endsWith("/") && e !== "/" && e !== `${t}/` ? e.slice(0, -1) : e;
|
|
714
714
|
}
|
|
715
|
-
function
|
|
716
|
-
return
|
|
715
|
+
function qe(e, t, n) {
|
|
716
|
+
return Ke(e, n) === Ke(t, n);
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function Je({ base: e, to: t, trailingSlash: n = "never", cache: r }) {
|
|
719
719
|
let i = t.startsWith("/"), a = !i && t === ".", o;
|
|
720
720
|
if (r) {
|
|
721
721
|
o = i ? t : a ? e : e + "\0" + t;
|
|
@@ -734,18 +734,18 @@ function qe({ base: e, to: t, trailingSlash: n = "never", cache: r }) {
|
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
s.length > 1 && (w(s) === "" ? n === "never" && s.pop() : n === "always" && s.push(""));
|
|
737
|
-
let c =
|
|
737
|
+
let c = Ue(s.join("/")) || "/";
|
|
738
738
|
return o && r && r.set(o, c), c;
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function Ye(e) {
|
|
741
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");
|
|
742
742
|
return (e) => e.replace(r, (e) => t.get(e) ?? e);
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function Xe(e, t, n) {
|
|
745
745
|
let r = t[e];
|
|
746
|
-
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) => Qe(e, n)).join("/") : Qe(r, n) : r;
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function Ze({ path: e, params: t, decoder: n, ...r }) {
|
|
749
749
|
let i = !1, a = Object.create(null);
|
|
750
750
|
if (!e || e === "/") return {
|
|
751
751
|
interpolatedPath: "/",
|
|
@@ -760,7 +760,7 @@ function Xe({ path: e, params: t, decoder: n, ...r }) {
|
|
|
760
760
|
let o = e.length, s = 0, c, l = "";
|
|
761
761
|
for (; s < o;) {
|
|
762
762
|
let r = s;
|
|
763
|
-
c =
|
|
763
|
+
c = Ce(e, r, c);
|
|
764
764
|
let o = c[5];
|
|
765
765
|
if (s = o + 1, r === o) continue;
|
|
766
766
|
let u = c[0];
|
|
@@ -776,14 +776,14 @@ function Xe({ path: e, params: t, decoder: n, ...r }) {
|
|
|
776
776
|
i = !0, (u || d) && (l += "/" + u + d);
|
|
777
777
|
continue;
|
|
778
778
|
}
|
|
779
|
-
let f =
|
|
779
|
+
let f = Xe("_splat", t, n);
|
|
780
780
|
l += "/" + u + f + d;
|
|
781
781
|
continue;
|
|
782
782
|
}
|
|
783
783
|
if (u === 1) {
|
|
784
784
|
let s = e.substring(c[2], c[3]);
|
|
785
785
|
!i && !(s in t) && (i = !0), a[s] = t[s];
|
|
786
|
-
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 = Xe(s, t, n) ?? "undefined";
|
|
787
787
|
l += "/" + u + f + d;
|
|
788
788
|
continue;
|
|
789
789
|
}
|
|
@@ -791,7 +791,7 @@ function Xe({ path: e, params: t, decoder: n, ...r }) {
|
|
|
791
791
|
let i = e.substring(c[2], c[3]), s = t[i];
|
|
792
792
|
if (s == null) continue;
|
|
793
793
|
a[i] = s;
|
|
794
|
-
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 = Xe(i, t, n) ?? "";
|
|
795
795
|
l += "/" + u + f + d;
|
|
796
796
|
continue;
|
|
797
797
|
}
|
|
@@ -802,31 +802,31 @@ function Xe({ path: e, params: t, decoder: n, ...r }) {
|
|
|
802
802
|
isMissingParams: i
|
|
803
803
|
};
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function Qe(e, t) {
|
|
806
806
|
let n = encodeURIComponent(e);
|
|
807
807
|
return t?.(n) ?? n;
|
|
808
808
|
}
|
|
809
809
|
//#endregion
|
|
810
810
|
//#region ../router-core/dist/esm/not-found.js
|
|
811
|
-
function
|
|
811
|
+
function $e(e = {}) {
|
|
812
812
|
if (e.isNotFound = !0, e.throw) throw e;
|
|
813
813
|
return e;
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function I(e) {
|
|
816
816
|
return e?.isNotFound === !0;
|
|
817
817
|
}
|
|
818
818
|
//#endregion
|
|
819
819
|
//#region ../router-core/dist/esm/scroll-restoration.js
|
|
820
|
-
function
|
|
820
|
+
function et() {
|
|
821
821
|
try {
|
|
822
822
|
return typeof window < "u" && typeof window.sessionStorage == "object" ? window.sessionStorage : void 0;
|
|
823
823
|
} catch {
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
|
-
var
|
|
828
|
-
function
|
|
829
|
-
let e =
|
|
827
|
+
var tt = "tsr-scroll-restoration-v1_3";
|
|
828
|
+
function nt() {
|
|
829
|
+
let e = et();
|
|
830
830
|
if (!e) return null;
|
|
831
831
|
let t = {};
|
|
832
832
|
try {
|
|
@@ -842,29 +842,29 @@ function tt() {
|
|
|
842
842
|
},
|
|
843
843
|
persist: () => {
|
|
844
844
|
try {
|
|
845
|
-
e.setItem(
|
|
845
|
+
e.setItem(tt, JSON.stringify(t));
|
|
846
846
|
} catch {
|
|
847
847
|
process.env.NODE_ENV !== "production" && console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.");
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
|
-
var
|
|
853
|
-
function
|
|
852
|
+
var rt = nt(), it = (e) => e.state.__TSR_key || e.href;
|
|
853
|
+
function at(e) {
|
|
854
854
|
let t = [], n;
|
|
855
855
|
for (; n = e.parentNode;) t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children, e) + 1})`), e = n;
|
|
856
856
|
return `${t.reverse().join(" > ")}`.toLowerCase();
|
|
857
857
|
}
|
|
858
|
-
var
|
|
859
|
-
function
|
|
860
|
-
if (!
|
|
861
|
-
let n =
|
|
858
|
+
var ot = !1, st = "window", ct = "data-scroll-restoration-id";
|
|
859
|
+
function lt(e, t) {
|
|
860
|
+
if (!rt) return;
|
|
861
|
+
let n = rt;
|
|
862
862
|
if ((t ?? e.options.scrollRestoration ?? !1) && (e.isScrollRestoring = !0), e.isScrollRestorationSetup || !n) return;
|
|
863
|
-
e.isScrollRestorationSetup = !0,
|
|
864
|
-
let r = e.options.getScrollRestorationKey ||
|
|
863
|
+
e.isScrollRestorationSetup = !0, ot = !1;
|
|
864
|
+
let r = e.options.getScrollRestorationKey || it, i = /* @__PURE__ */ new Map();
|
|
865
865
|
window.history.scrollRestoration = "manual";
|
|
866
866
|
let a = (t) => {
|
|
867
|
-
if (!(
|
|
867
|
+
if (!(ot || !e.isScrollRestoring)) if (t.target === document || t.target === window) i.set(st, {
|
|
868
868
|
scrollX: window.scrollX || 0,
|
|
869
869
|
scrollY: window.scrollY || 0
|
|
870
870
|
});
|
|
@@ -880,10 +880,10 @@ function st(e, t) {
|
|
|
880
880
|
let r = n.state[t] ||= {};
|
|
881
881
|
for (let [e, t] of i) {
|
|
882
882
|
let n;
|
|
883
|
-
if (e ===
|
|
883
|
+
if (e === st) n = st;
|
|
884
884
|
else if (e.isConnected) {
|
|
885
|
-
let t = e.getAttribute(
|
|
886
|
-
n = t ? `[${
|
|
885
|
+
let t = e.getAttribute(ct);
|
|
886
|
+
n = t ? `[${ct}="${t}"]` : at(e);
|
|
887
887
|
}
|
|
888
888
|
n && (r[n] = t);
|
|
889
889
|
}
|
|
@@ -899,7 +899,7 @@ function st(e, t) {
|
|
|
899
899
|
return;
|
|
900
900
|
}
|
|
901
901
|
if (!(typeof e.options.scrollRestoration == "function" && !e.options.scrollRestoration({ location: e.latestLocation }))) {
|
|
902
|
-
|
|
902
|
+
ot = !0;
|
|
903
903
|
try {
|
|
904
904
|
let t = e.isScrollRestoring ? n.state[a] : void 0, r = !1;
|
|
905
905
|
if (t) for (let e in t) {
|
|
@@ -907,7 +907,7 @@ function st(e, t) {
|
|
|
907
907
|
if (!O(n)) continue;
|
|
908
908
|
let { scrollX: i, scrollY: a } = n;
|
|
909
909
|
if (!(!Number.isFinite(i) || !Number.isFinite(a))) {
|
|
910
|
-
if (e ===
|
|
910
|
+
if (e === st) window.scrollTo({
|
|
911
911
|
top: a,
|
|
912
912
|
left: i,
|
|
913
913
|
behavior: o
|
|
@@ -938,14 +938,14 @@ function st(e, t) {
|
|
|
938
938
|
behavior: o
|
|
939
939
|
};
|
|
940
940
|
if (window.scrollTo(e), s) for (let t of s) {
|
|
941
|
-
if (t ===
|
|
941
|
+
if (t === st) continue;
|
|
942
942
|
let n = typeof t == "function" ? t() : document.querySelector(t);
|
|
943
943
|
n && n.scrollTo(e);
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
947
|
} finally {
|
|
948
|
-
|
|
948
|
+
ot = !1;
|
|
949
949
|
}
|
|
950
950
|
e.isScrollRestoring && n.set((e) => (e[a] ||= {}, e));
|
|
951
951
|
}
|
|
@@ -953,7 +953,7 @@ function st(e, t) {
|
|
|
953
953
|
}
|
|
954
954
|
//#endregion
|
|
955
955
|
//#region ../router-core/dist/esm/qss.js
|
|
956
|
-
function
|
|
956
|
+
function ut(e, t = String) {
|
|
957
957
|
let n = new URLSearchParams();
|
|
958
958
|
for (let r in e) {
|
|
959
959
|
let i = e[r];
|
|
@@ -961,24 +961,24 @@ function ct(e, t = String) {
|
|
|
961
961
|
}
|
|
962
962
|
return n.toString();
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function dt(e) {
|
|
965
965
|
return e ? e === "false" ? !1 : e === "true" ? !0 : e * 0 == 0 && +e + "" === e ? +e : e : "";
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function ft(e) {
|
|
968
968
|
let t = new URLSearchParams(e), n = Object.create(null);
|
|
969
969
|
for (let [e, r] of t.entries()) {
|
|
970
970
|
let t = n[e];
|
|
971
|
-
t == null ? n[e] =
|
|
971
|
+
t == null ? n[e] = dt(r) : Array.isArray(t) ? t.push(dt(r)) : n[e] = [t, dt(r)];
|
|
972
972
|
}
|
|
973
973
|
return n;
|
|
974
974
|
}
|
|
975
975
|
//#endregion
|
|
976
976
|
//#region ../router-core/dist/esm/searchParams.js
|
|
977
|
-
var
|
|
978
|
-
function
|
|
977
|
+
var pt = ht(JSON.parse), mt = gt(JSON.stringify, JSON.parse);
|
|
978
|
+
function ht(e) {
|
|
979
979
|
return (t) => {
|
|
980
980
|
t[0] === "?" && (t = t.substring(1));
|
|
981
|
-
let n =
|
|
981
|
+
let n = ft(t);
|
|
982
982
|
for (let t in n) {
|
|
983
983
|
let r = n[t];
|
|
984
984
|
if (typeof r == "string") try {
|
|
@@ -988,7 +988,7 @@ function pt(e) {
|
|
|
988
988
|
return n;
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function gt(e, t) {
|
|
992
992
|
let n = typeof t == "function";
|
|
993
993
|
function r(r) {
|
|
994
994
|
if (typeof r == "object" && r) try {
|
|
@@ -1000,16 +1000,16 @@ function mt(e, t) {
|
|
|
1000
1000
|
return r;
|
|
1001
1001
|
}
|
|
1002
1002
|
return (e) => {
|
|
1003
|
-
let t =
|
|
1003
|
+
let t = ut(e, r);
|
|
1004
1004
|
return t ? `?${t}` : "";
|
|
1005
1005
|
};
|
|
1006
1006
|
}
|
|
1007
1007
|
//#endregion
|
|
1008
1008
|
//#region ../router-core/dist/esm/root.js
|
|
1009
|
-
var
|
|
1009
|
+
var L = "__root__";
|
|
1010
1010
|
//#endregion
|
|
1011
1011
|
//#region ../router-core/dist/esm/redirect.js
|
|
1012
|
-
function
|
|
1012
|
+
function _t(e) {
|
|
1013
1013
|
if (e.statusCode = e.statusCode || e.code || 307, !e._builtLocation && !e.reloadDocument && typeof e.href == "string") try {
|
|
1014
1014
|
new URL(e.href), e.reloadDocument = !0;
|
|
1015
1015
|
} catch {}
|
|
@@ -1022,38 +1022,38 @@ function ht(e) {
|
|
|
1022
1022
|
if (n.options = e, e.throw) throw n;
|
|
1023
1023
|
return n;
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function R(e) {
|
|
1026
1026
|
return e instanceof Response && !!e.options;
|
|
1027
1027
|
}
|
|
1028
1028
|
//#endregion
|
|
1029
1029
|
//#region ../router-core/dist/esm/rewrite.js
|
|
1030
|
-
function
|
|
1030
|
+
function vt(e) {
|
|
1031
1031
|
return {
|
|
1032
1032
|
input: ({ url: t }) => {
|
|
1033
|
-
for (let n of e) t =
|
|
1033
|
+
for (let n of e) t = bt(n, t);
|
|
1034
1034
|
return t;
|
|
1035
1035
|
},
|
|
1036
1036
|
output: ({ url: t }) => {
|
|
1037
|
-
for (let n = e.length - 1; n >= 0; n--) t =
|
|
1037
|
+
for (let n = e.length - 1; n >= 0; n--) t = xt(e[n], t);
|
|
1038
1038
|
return t;
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1043
|
-
let t =
|
|
1042
|
+
function yt(e) {
|
|
1043
|
+
let t = Ge(e.basepath), n = `/${t}`, r = `${n}/`, i = e.caseSensitive ? n : n.toLowerCase(), a = e.caseSensitive ? r : r.toLowerCase();
|
|
1044
1044
|
return {
|
|
1045
1045
|
input: ({ url: t }) => {
|
|
1046
1046
|
let r = e.caseSensitive ? t.pathname : t.pathname.toLowerCase();
|
|
1047
1047
|
return r === i ? t.pathname = "/" : r.startsWith(a) && (t.pathname = t.pathname.slice(n.length)), t;
|
|
1048
1048
|
},
|
|
1049
|
-
output: ({ url: e }) => (e.pathname =
|
|
1049
|
+
output: ({ url: e }) => (e.pathname = He([
|
|
1050
1050
|
"/",
|
|
1051
1051
|
t,
|
|
1052
1052
|
e.pathname
|
|
1053
1053
|
]), e)
|
|
1054
1054
|
};
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function bt(e, t) {
|
|
1057
1057
|
let n = e?.input?.({ url: t });
|
|
1058
1058
|
if (n) {
|
|
1059
1059
|
if (typeof n == "string") return new URL(n);
|
|
@@ -1061,7 +1061,7 @@ function vt(e, t) {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
return t;
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1064
|
+
function xt(e, t) {
|
|
1065
1065
|
let n = e?.output?.({ url: t });
|
|
1066
1066
|
if (n) {
|
|
1067
1067
|
if (typeof n == "string") return new URL(n);
|
|
@@ -1069,8 +1069,8 @@ function yt(e, t) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
return t;
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
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(() =>
|
|
1072
|
+
function St(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(() => Ct(o, _.get())), x = r(() => Ct(s, v.get())), S = r(() => Ct(c, y.get())), C = r(() => _.get()[0]), w = r(() => _.get().some((e) => o.get(e)?.get().status === "pending")), ee = r(() => ({
|
|
1074
1074
|
locationHref: p.get().href,
|
|
1075
1075
|
resolvedLocationHref: m.get()?.href,
|
|
1076
1076
|
status: l.get()
|
|
@@ -1084,7 +1084,7 @@ function bt(e, t) {
|
|
|
1084
1084
|
resolvedLocation: m.get(),
|
|
1085
1085
|
statusCode: h.get(),
|
|
1086
1086
|
redirect: g.get()
|
|
1087
|
-
})), te =
|
|
1087
|
+
})), te = be(64);
|
|
1088
1088
|
function ne(e) {
|
|
1089
1089
|
let t = te.get(e);
|
|
1090
1090
|
return t || (t = r(() => {
|
|
@@ -1124,17 +1124,17 @@ function bt(e, t) {
|
|
|
1124
1124
|
};
|
|
1125
1125
|
ie(e.matches), a?.(re);
|
|
1126
1126
|
function ie(e) {
|
|
1127
|
-
|
|
1127
|
+
wt(e, o, _, n, i);
|
|
1128
1128
|
}
|
|
1129
1129
|
function E(e) {
|
|
1130
|
-
|
|
1130
|
+
wt(e, s, v, n, i);
|
|
1131
1131
|
}
|
|
1132
1132
|
function D(e) {
|
|
1133
|
-
|
|
1133
|
+
wt(e, c, y, n, i);
|
|
1134
1134
|
}
|
|
1135
1135
|
return re;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function Ct(e, t) {
|
|
1138
1138
|
let n = [];
|
|
1139
1139
|
for (let r of t) {
|
|
1140
1140
|
let t = e.get(r);
|
|
@@ -1142,7 +1142,7 @@ function xt(e, t) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
return n;
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1145
|
+
function wt(e, t, n, r, i) {
|
|
1146
1146
|
let a = e.map((e) => e.id), o = new Set(a);
|
|
1147
1147
|
i(() => {
|
|
1148
1148
|
for (let e of t.keys()) o.has(e) || t.delete(e);
|
|
@@ -1160,9 +1160,9 @@ function St(e, t, n, r, i) {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
//#endregion
|
|
1162
1162
|
//#region ../router-core/dist/esm/load-matches.js
|
|
1163
|
-
var
|
|
1163
|
+
var Tt = (e) => {
|
|
1164
1164
|
if (!e.rendered) return e.rendered = !0, e.onReady?.();
|
|
1165
|
-
},
|
|
1165
|
+
}, Et = (e) => e.stores.matchesId.get().some((t) => e.stores.matchStores.get(t)?.get()._forcePending), Dt = (e, t) => !!(e.preload && !e.router.stores.matchStores.has(t)), z = (e, t, n = !0) => {
|
|
1166
1166
|
let r = { ...e.router.options.context ?? {} }, i = n ? t : t - 1;
|
|
1167
1167
|
for (let t = 0; t <= i; t++) {
|
|
1168
1168
|
let n = e.matches[t];
|
|
@@ -1171,7 +1171,7 @@ var Ct = (e) => {
|
|
|
1171
1171
|
i && Object.assign(r, i.__routeContext, i.__beforeLoadContext);
|
|
1172
1172
|
}
|
|
1173
1173
|
return r;
|
|
1174
|
-
},
|
|
1174
|
+
}, Ot = (e, t) => {
|
|
1175
1175
|
if (!e.matches.length) return;
|
|
1176
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;
|
|
1177
1177
|
a < 0 && (a = i);
|
|
@@ -1180,31 +1180,31 @@ var Ct = (e) => {
|
|
|
1180
1180
|
if (e.router.looseRoutesById[n.routeId].options.notFoundComponent) return t;
|
|
1181
1181
|
}
|
|
1182
1182
|
return n ? a : i;
|
|
1183
|
-
},
|
|
1184
|
-
if (!(!
|
|
1183
|
+
}, B = (e, t, n) => {
|
|
1184
|
+
if (!(!R(n) && !I(n))) throw R(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) => ({
|
|
1185
1185
|
...r,
|
|
1186
|
-
status:
|
|
1187
|
-
context:
|
|
1186
|
+
status: R(n) ? "redirected" : I(n) ? "notFound" : r.status === "pending" ? "success" : r.status,
|
|
1187
|
+
context: z(e, t.index),
|
|
1188
1188
|
isFetching: !1,
|
|
1189
1189
|
error: n
|
|
1190
|
-
})),
|
|
1191
|
-
},
|
|
1190
|
+
})), I(n) && !n.routeId && (n.routeId = t.routeId), t._nonReactive.loadPromise?.resolve()), R(n) && (e.rendered = !0, n.options._fromLocation = e.location, n.redirectHandled = !0, n = e.router.resolveRedirect(n)), n);
|
|
1191
|
+
}, kt = (e, t) => {
|
|
1192
1192
|
let n = e.router.getMatch(t);
|
|
1193
1193
|
return !!(!n || n._nonReactive.dehydrated);
|
|
1194
|
-
},
|
|
1195
|
-
let r =
|
|
1194
|
+
}, At = (e, t, n) => {
|
|
1195
|
+
let r = z(e, n);
|
|
1196
1196
|
e.updateMatch(t, (e) => ({
|
|
1197
1197
|
...e,
|
|
1198
1198
|
context: r
|
|
1199
1199
|
}));
|
|
1200
|
-
},
|
|
1200
|
+
}, V = (e, t, n, r) => {
|
|
1201
1201
|
let { id: i, routeId: a } = e.matches[t], o = e.router.looseRoutesById[a];
|
|
1202
1202
|
if (n instanceof Promise) throw n;
|
|
1203
|
-
n.routerCode = r, e.firstBadMatchIndex ??= t,
|
|
1203
|
+
n.routerCode = r, e.firstBadMatchIndex ??= t, B(e, e.router.getMatch(i), n);
|
|
1204
1204
|
try {
|
|
1205
1205
|
o.options.onError?.(n);
|
|
1206
1206
|
} catch (t) {
|
|
1207
|
-
n = t,
|
|
1207
|
+
n = t, B(e, e.router.getMatch(i), n);
|
|
1208
1208
|
}
|
|
1209
1209
|
e.updateMatch(i, (e) => (e._nonReactive.beforeLoadPromise?.resolve(), e._nonReactive.beforeLoadPromise = void 0, e._nonReactive.loadPromise?.resolve(), {
|
|
1210
1210
|
...e,
|
|
@@ -1213,32 +1213,32 @@ var Ct = (e) => {
|
|
|
1213
1213
|
isFetching: !1,
|
|
1214
1214
|
updatedAt: Date.now(),
|
|
1215
1215
|
abortController: new AbortController()
|
|
1216
|
-
})), !e.preload && !
|
|
1217
|
-
},
|
|
1216
|
+
})), !e.preload && !R(n) && !I(n) && (e.serialError ??= n);
|
|
1217
|
+
}, jt = (e, t, n, r) => {
|
|
1218
1218
|
if (r._nonReactive.pendingTimeout !== void 0) return;
|
|
1219
1219
|
let i = n.options.pendingMs ?? e.router.options.defaultPendingMs;
|
|
1220
|
-
if (e.onReady && !
|
|
1220
|
+
if (e.onReady && !Dt(e, t) && (n.options.loader || n.options.beforeLoad || Vt(n)) && typeof i == "number" && i !== Infinity && (n.options.pendingComponent ?? e.router.options?.defaultPendingComponent)) {
|
|
1221
1221
|
let t = setTimeout(() => {
|
|
1222
|
-
|
|
1222
|
+
Tt(e);
|
|
1223
1223
|
}, i);
|
|
1224
1224
|
r._nonReactive.pendingTimeout = t;
|
|
1225
1225
|
}
|
|
1226
|
-
},
|
|
1226
|
+
}, Mt = (e, t, n) => {
|
|
1227
1227
|
let r = e.router.getMatch(t);
|
|
1228
1228
|
if (!r._nonReactive.beforeLoadPromise && !r._nonReactive.loaderPromise) return;
|
|
1229
|
-
|
|
1229
|
+
jt(e, t, n, r);
|
|
1230
1230
|
let i = () => {
|
|
1231
1231
|
let n = e.router.getMatch(t);
|
|
1232
|
-
n.preload && (n.status === "redirected" || n.status === "notFound") &&
|
|
1232
|
+
n.preload && (n.status === "redirected" || n.status === "notFound") && B(e, n, n.error);
|
|
1233
1233
|
};
|
|
1234
1234
|
return r._nonReactive.beforeLoadPromise ? r._nonReactive.beforeLoadPromise.then(i) : i();
|
|
1235
|
-
},
|
|
1235
|
+
}, Nt = (e, t, n, r) => {
|
|
1236
1236
|
let i = e.router.getMatch(t), a = i._nonReactive.loadPromise;
|
|
1237
1237
|
i._nonReactive.loadPromise = A(() => {
|
|
1238
1238
|
a?.resolve(), a = void 0;
|
|
1239
1239
|
});
|
|
1240
1240
|
let { paramsError: o, searchError: s } = i;
|
|
1241
|
-
o &&
|
|
1241
|
+
o && V(e, n, o, "PARSE_PARAMS"), s && V(e, n, s, "VALIDATE_SEARCH"), jt(e, t, r, i);
|
|
1242
1242
|
let c = new AbortController(), l = !1, u = () => {
|
|
1243
1243
|
l || (l = !0, e.updateMatch(t, (e) => ({
|
|
1244
1244
|
...e,
|
|
@@ -1260,9 +1260,9 @@ var Ct = (e) => {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
i._nonReactive.beforeLoadPromise = A();
|
|
1262
1262
|
let f = {
|
|
1263
|
-
...
|
|
1263
|
+
...z(e, n, !1),
|
|
1264
1264
|
...i.__routeContext
|
|
1265
|
-
}, { search: p, params: m, cause: h } = i, g =
|
|
1265
|
+
}, { search: p, params: m, cause: h } = i, g = Dt(e, t), _ = {
|
|
1266
1266
|
search: p,
|
|
1267
1267
|
abortController: c,
|
|
1268
1268
|
params: m,
|
|
@@ -1285,7 +1285,7 @@ var Ct = (e) => {
|
|
|
1285
1285
|
});
|
|
1286
1286
|
return;
|
|
1287
1287
|
}
|
|
1288
|
-
(
|
|
1288
|
+
(R(r) || I(r)) && (u(), V(e, n, r, "BEFORE_LOAD")), e.router.batch(() => {
|
|
1289
1289
|
u(), e.updateMatch(t, (e) => ({
|
|
1290
1290
|
...e,
|
|
1291
1291
|
__beforeLoadContext: r
|
|
@@ -1293,21 +1293,21 @@ var Ct = (e) => {
|
|
|
1293
1293
|
});
|
|
1294
1294
|
}, y;
|
|
1295
1295
|
try {
|
|
1296
|
-
if (y = r.options.beforeLoad(_),
|
|
1297
|
-
|
|
1296
|
+
if (y = r.options.beforeLoad(_), j(y)) return u(), y.catch((t) => {
|
|
1297
|
+
V(e, n, t, "BEFORE_LOAD");
|
|
1298
1298
|
}).then(v);
|
|
1299
1299
|
} catch (t) {
|
|
1300
|
-
u(),
|
|
1300
|
+
u(), V(e, n, t, "BEFORE_LOAD");
|
|
1301
1301
|
}
|
|
1302
1302
|
v(y);
|
|
1303
|
-
},
|
|
1304
|
-
let { id: n, routeId: r } = e.matches[t], i = e.router.looseRoutesById[r], a = () => s(), o = () =>
|
|
1305
|
-
if (
|
|
1306
|
-
let t =
|
|
1307
|
-
return
|
|
1303
|
+
}, Pt = (e, t) => {
|
|
1304
|
+
let { id: n, routeId: r } = e.matches[t], i = e.router.looseRoutesById[r], a = () => s(), o = () => Nt(e, n, t, i), s = () => {
|
|
1305
|
+
if (kt(e, n)) return;
|
|
1306
|
+
let t = Mt(e, n, i);
|
|
1307
|
+
return j(t) ? t.then(o) : o();
|
|
1308
1308
|
};
|
|
1309
1309
|
return a();
|
|
1310
|
-
},
|
|
1310
|
+
}, Ft = (e, t, n) => {
|
|
1311
1311
|
let r = e.router.getMatch(t);
|
|
1312
1312
|
if (!r || !n.options.head && !n.options.scripts && !n.options.headers) return;
|
|
1313
1313
|
let i = {
|
|
@@ -1329,8 +1329,8 @@ var Ct = (e) => {
|
|
|
1329
1329
|
scripts: t,
|
|
1330
1330
|
styles: e?.styles
|
|
1331
1331
|
}));
|
|
1332
|
-
},
|
|
1333
|
-
let a = t[r - 1], { params: o, loaderDeps: s, abortController: c, cause: l } = e.router.getMatch(n), u =
|
|
1332
|
+
}, It = (e, t, n, r, i) => {
|
|
1333
|
+
let a = t[r - 1], { params: o, loaderDeps: s, abortController: c, cause: l } = e.router.getMatch(n), u = z(e, r), d = Dt(e, n);
|
|
1334
1334
|
return {
|
|
1335
1335
|
params: o,
|
|
1336
1336
|
deps: s,
|
|
@@ -1347,18 +1347,18 @@ var Ct = (e) => {
|
|
|
1347
1347
|
route: i,
|
|
1348
1348
|
...e.router.options.additionalContext
|
|
1349
1349
|
};
|
|
1350
|
-
},
|
|
1350
|
+
}, Lt = async (e, t, n, r, i) => {
|
|
1351
1351
|
try {
|
|
1352
1352
|
let a = e.router.getMatch(n);
|
|
1353
1353
|
try {
|
|
1354
|
-
|
|
1355
|
-
let o = i.options.loader, s = typeof o == "function" ? o : o?.handler, c = s?.(
|
|
1354
|
+
H(i);
|
|
1355
|
+
let o = i.options.loader, s = typeof o == "function" ? o : o?.handler, c = s?.(It(e, t, n, r, i)), l = !!s && j(c);
|
|
1356
1356
|
if ((l || i._lazyPromise || i._componentsPromise || i.options.head || i.options.scripts || i.options.headers || a._nonReactive.minPendingPromise) && e.updateMatch(n, (e) => ({
|
|
1357
1357
|
...e,
|
|
1358
1358
|
isFetching: "loader"
|
|
1359
1359
|
})), s) {
|
|
1360
1360
|
let t = l ? await c : c;
|
|
1361
|
-
|
|
1361
|
+
B(e, e.router.getMatch(n), t), t !== void 0 && e.updateMatch(n, (e) => ({
|
|
1362
1362
|
...e,
|
|
1363
1363
|
loaderData: t
|
|
1364
1364
|
}));
|
|
@@ -1368,7 +1368,7 @@ var Ct = (e) => {
|
|
|
1368
1368
|
u && await u, i._componentsPromise && await i._componentsPromise, e.updateMatch(n, (t) => ({
|
|
1369
1369
|
...t,
|
|
1370
1370
|
error: void 0,
|
|
1371
|
-
context:
|
|
1371
|
+
context: z(e, r),
|
|
1372
1372
|
status: "success",
|
|
1373
1373
|
isFetching: !1,
|
|
1374
1374
|
updatedAt: Date.now()
|
|
@@ -1384,53 +1384,53 @@ var Ct = (e) => {
|
|
|
1384
1384
|
...t,
|
|
1385
1385
|
status: t.status === "pending" ? "success" : t.status,
|
|
1386
1386
|
isFetching: !1,
|
|
1387
|
-
context:
|
|
1387
|
+
context: z(e, r)
|
|
1388
1388
|
}));
|
|
1389
1389
|
return;
|
|
1390
1390
|
}
|
|
1391
1391
|
let s = a._nonReactive.minPendingPromise;
|
|
1392
|
-
s && await s,
|
|
1392
|
+
s && await s, I(t) && await i.options.notFoundComponent?.preload?.(), B(e, e.router.getMatch(n), t);
|
|
1393
1393
|
try {
|
|
1394
1394
|
i.options.onError?.(t);
|
|
1395
1395
|
} catch (t) {
|
|
1396
|
-
o = t,
|
|
1396
|
+
o = t, B(e, e.router.getMatch(n), t);
|
|
1397
1397
|
}
|
|
1398
|
-
!
|
|
1398
|
+
!R(o) && !I(o) && await H(i, ["errorComponent"]), e.updateMatch(n, (t) => ({
|
|
1399
1399
|
...t,
|
|
1400
1400
|
error: o,
|
|
1401
|
-
context:
|
|
1401
|
+
context: z(e, r),
|
|
1402
1402
|
status: "error",
|
|
1403
1403
|
isFetching: !1
|
|
1404
1404
|
}));
|
|
1405
1405
|
}
|
|
1406
1406
|
} catch (t) {
|
|
1407
1407
|
let r = e.router.getMatch(n);
|
|
1408
|
-
r && (r._nonReactive.loaderPromise = void 0),
|
|
1408
|
+
r && (r._nonReactive.loaderPromise = void 0), B(e, r, t);
|
|
1409
1409
|
}
|
|
1410
|
-
},
|
|
1410
|
+
}, Rt = async (e, t, n) => {
|
|
1411
1411
|
async function r(r, a, c, l, d) {
|
|
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(
|
|
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(It(e, t, i, n, d)) : m, { status: g, invalid: _ } = l, v = f >= p && (!!e.forceStaleReload || l.cause === "enter" || c !== void 0 && c !== l.id);
|
|
1413
1413
|
o = g === "success" && (_ || (h ?? v)), r && d.options.preload === !1 || (o && !e.sync && u ? (s = !0, (async () => {
|
|
1414
1414
|
try {
|
|
1415
|
-
await
|
|
1415
|
+
await Lt(e, t, i, n, d);
|
|
1416
1416
|
let r = e.router.getMatch(i);
|
|
1417
1417
|
r._nonReactive.loaderPromise?.resolve(), r._nonReactive.loadPromise?.resolve(), r._nonReactive.loaderPromise = void 0, r._nonReactive.loadPromise = void 0;
|
|
1418
1418
|
} catch (t) {
|
|
1419
|
-
|
|
1419
|
+
R(t) && await e.router.navigate(t.options);
|
|
1420
1420
|
}
|
|
1421
|
-
})()) : g !== "success" || o ? await
|
|
1421
|
+
})()) : g !== "success" || o ? await Lt(e, t, i, n, d) : At(e, i, n));
|
|
1422
1422
|
}
|
|
1423
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";
|
|
1424
|
-
if (
|
|
1424
|
+
if (kt(e, i)) {
|
|
1425
1425
|
if (!e.router.getMatch(i)) return e.matches[n];
|
|
1426
|
-
|
|
1426
|
+
At(e, i, n);
|
|
1427
1427
|
} else {
|
|
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 =
|
|
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 = Dt(e, i);
|
|
1429
1429
|
if (t._nonReactive.loaderPromise) {
|
|
1430
1430
|
if (t.status === "success" && !e.sync && !t.preload && u) return t;
|
|
1431
1431
|
await t._nonReactive.loaderPromise;
|
|
1432
1432
|
let n = e.router.getMatch(i), a = n._nonReactive.error || n.error;
|
|
1433
|
-
a &&
|
|
1433
|
+
a && B(e, n, a), n.status === "pending" && await r(l, t, s, n, c);
|
|
1434
1434
|
} else {
|
|
1435
1435
|
let n = l && !e.router.stores.matchStores.has(i), a = e.router.getMatch(i);
|
|
1436
1436
|
a._nonReactive.loaderPromise = A(), n !== a.preload && e.updateMatch(i, (e) => ({
|
|
@@ -1448,24 +1448,24 @@ var Ct = (e) => {
|
|
|
1448
1448
|
invalid: !1
|
|
1449
1449
|
})), e.router.getMatch(i)) : d;
|
|
1450
1450
|
};
|
|
1451
|
-
async function
|
|
1451
|
+
async function zt(e) {
|
|
1452
1452
|
let t = e, n = [];
|
|
1453
|
-
|
|
1453
|
+
Et(t.router) && Tt(t);
|
|
1454
1454
|
let r;
|
|
1455
1455
|
for (let e = 0; e < t.matches.length; e++) {
|
|
1456
1456
|
try {
|
|
1457
|
-
let n =
|
|
1458
|
-
|
|
1457
|
+
let n = Pt(t, e);
|
|
1458
|
+
j(n) && await n;
|
|
1459
1459
|
} catch (e) {
|
|
1460
|
-
if (
|
|
1461
|
-
if (
|
|
1460
|
+
if (R(e)) throw e;
|
|
1461
|
+
if (I(e)) r = e;
|
|
1462
1462
|
else if (!t.preload) throw e;
|
|
1463
1463
|
break;
|
|
1464
1464
|
}
|
|
1465
1465
|
if (t.serialError || t.firstBadMatchIndex != null) break;
|
|
1466
1466
|
}
|
|
1467
|
-
let i = t.firstBadMatchIndex ?? t.matches.length, a = r && !t.preload ?
|
|
1468
|
-
for (let e = 0; e < o; e++) n.push(
|
|
1467
|
+
let i = t.firstBadMatchIndex ?? t.matches.length, a = r && !t.preload ? Ot(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(Rt(t, n, e));
|
|
1469
1469
|
try {
|
|
1470
1470
|
await Promise.all(n);
|
|
1471
1471
|
} catch {
|
|
@@ -1473,15 +1473,15 @@ async function Lt(e) {
|
|
|
1473
1473
|
for (let t of e) {
|
|
1474
1474
|
if (t.status !== "rejected") continue;
|
|
1475
1475
|
let e = t.reason;
|
|
1476
|
-
if (
|
|
1477
|
-
|
|
1476
|
+
if (R(e)) throw e;
|
|
1477
|
+
I(e) ? s ??= e : c ??= e;
|
|
1478
1478
|
}
|
|
1479
1479
|
if (c !== void 0) throw c;
|
|
1480
1480
|
}
|
|
1481
1481
|
let l = s ?? (r && !t.preload ? r : void 0), u = t.firstBadMatchIndex === void 0 ? t.matches.length - 1 : t.firstBadMatchIndex;
|
|
1482
1482
|
if (!l && r && t.preload) return t.matches;
|
|
1483
1483
|
if (l) {
|
|
1484
|
-
let e =
|
|
1484
|
+
let e = Ot(t, l);
|
|
1485
1485
|
if (e === void 0) {
|
|
1486
1486
|
if (process.env.NODE_ENV !== "production") throw Error("Invariant failed: Could not find match for notFound boundary");
|
|
1487
1487
|
ye();
|
|
@@ -1500,7 +1500,7 @@ async function Lt(e) {
|
|
|
1500
1500
|
error: l
|
|
1501
1501
|
},
|
|
1502
1502
|
isFetching: !1
|
|
1503
|
-
})), u = e, await
|
|
1503
|
+
})), u = e, await H(r, ["notFoundComponent"]);
|
|
1504
1504
|
} else if (!t.preload) {
|
|
1505
1505
|
let e = t.matches[0];
|
|
1506
1506
|
e.globalNotFound || t.router.getMatch(e.id)?.globalNotFound && t.updateMatch(e.id, (e) => ({
|
|
@@ -1511,12 +1511,12 @@ async function Lt(e) {
|
|
|
1511
1511
|
}
|
|
1512
1512
|
if (t.serialError && t.firstBadMatchIndex !== void 0) {
|
|
1513
1513
|
let e = t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];
|
|
1514
|
-
await
|
|
1514
|
+
await H(e, ["errorComponent"]);
|
|
1515
1515
|
}
|
|
1516
1516
|
for (let e = 0; e <= u; e++) {
|
|
1517
1517
|
let { id: n, routeId: r } = t.matches[e], i = t.router.looseRoutesById[r];
|
|
1518
1518
|
try {
|
|
1519
|
-
let e =
|
|
1519
|
+
let e = Ft(t, n, i);
|
|
1520
1520
|
if (e) {
|
|
1521
1521
|
let r = await e;
|
|
1522
1522
|
t.updateMatch(n, (e) => ({
|
|
@@ -1528,42 +1528,42 @@ async function Lt(e) {
|
|
|
1528
1528
|
console.error(`Error executing head for route ${r}:`, e);
|
|
1529
1529
|
}
|
|
1530
1530
|
}
|
|
1531
|
-
let d =
|
|
1532
|
-
if (
|
|
1531
|
+
let d = Tt(t);
|
|
1532
|
+
if (j(d) && await d, l) throw l;
|
|
1533
1533
|
if (t.serialError && !t.preload && !t.onReady) throw t.serialError;
|
|
1534
1534
|
return t.matches;
|
|
1535
1535
|
}
|
|
1536
|
-
function
|
|
1536
|
+
function Bt(e, t) {
|
|
1537
1537
|
let n = t.map((t) => e.options[t]?.preload?.()).filter(Boolean);
|
|
1538
1538
|
if (n.length !== 0) return Promise.all(n);
|
|
1539
1539
|
}
|
|
1540
|
-
function
|
|
1540
|
+
function H(e, t = Ht) {
|
|
1541
1541
|
!e._lazyLoaded && e._lazyPromise === void 0 && (e.lazyFn ? e._lazyPromise = e.lazyFn().then((t) => {
|
|
1542
1542
|
let { id: n, ...r } = t.options;
|
|
1543
1543
|
Object.assign(e.options, r), e._lazyLoaded = !0, e._lazyPromise = void 0;
|
|
1544
1544
|
}) : e._lazyLoaded = !0);
|
|
1545
|
-
let n = () => e._componentsLoaded ? void 0 : t ===
|
|
1545
|
+
let n = () => e._componentsLoaded ? void 0 : t === Ht ? (() => {
|
|
1546
1546
|
if (e._componentsPromise === void 0) {
|
|
1547
|
-
let t =
|
|
1547
|
+
let t = Bt(e, Ht);
|
|
1548
1548
|
t ? e._componentsPromise = t.then(() => {
|
|
1549
1549
|
e._componentsLoaded = !0, e._componentsPromise = void 0;
|
|
1550
1550
|
}) : e._componentsLoaded = !0;
|
|
1551
1551
|
}
|
|
1552
1552
|
return e._componentsPromise;
|
|
1553
|
-
})() :
|
|
1553
|
+
})() : Bt(e, t);
|
|
1554
1554
|
return e._lazyPromise ? e._lazyPromise.then(n) : n();
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1557
|
-
for (let t of
|
|
1556
|
+
function Vt(e) {
|
|
1557
|
+
for (let t of Ht) if (e.options[t]?.preload) return !0;
|
|
1558
1558
|
return !1;
|
|
1559
1559
|
}
|
|
1560
|
-
var
|
|
1560
|
+
var Ht = [
|
|
1561
1561
|
"component",
|
|
1562
1562
|
"errorComponent",
|
|
1563
1563
|
"pendingComponent",
|
|
1564
1564
|
"notFoundComponent"
|
|
1565
|
-
],
|
|
1566
|
-
function
|
|
1565
|
+
], U = "__TSR_index", Ut = "popstate", Wt = "beforeunload";
|
|
1566
|
+
function Gt(e) {
|
|
1567
1567
|
let t = e.getLocation(), n = /* @__PURE__ */ new Set(), r = (r) => {
|
|
1568
1568
|
t = e.getLocation(), n.forEach((e) => e({
|
|
1569
1569
|
location: t,
|
|
@@ -1578,7 +1578,7 @@ function Wt(e) {
|
|
|
1578
1578
|
}
|
|
1579
1579
|
let a = e.getBlockers?.() ?? [], o = i.type === "PUSH" || i.type === "REPLACE";
|
|
1580
1580
|
if (typeof document < "u" && a.length && o) for (let n of a) {
|
|
1581
|
-
let r =
|
|
1581
|
+
let r = W(i.path, i.state);
|
|
1582
1582
|
if (await n.blockerFn({
|
|
1583
1583
|
currentLocation: t,
|
|
1584
1584
|
nextLocation: r,
|
|
@@ -1602,8 +1602,8 @@ function Wt(e) {
|
|
|
1602
1602
|
n.delete(e);
|
|
1603
1603
|
}),
|
|
1604
1604
|
push: (n, i, o) => {
|
|
1605
|
-
let s = t.state[
|
|
1606
|
-
i =
|
|
1605
|
+
let s = t.state[U];
|
|
1606
|
+
i = Kt(s + 1, i), a({
|
|
1607
1607
|
task: () => {
|
|
1608
1608
|
e.pushState(n, i), r({ type: "PUSH" });
|
|
1609
1609
|
},
|
|
@@ -1614,8 +1614,8 @@ function Wt(e) {
|
|
|
1614
1614
|
});
|
|
1615
1615
|
},
|
|
1616
1616
|
replace: (n, i, o) => {
|
|
1617
|
-
let s = t.state[
|
|
1618
|
-
i =
|
|
1617
|
+
let s = t.state[U];
|
|
1618
|
+
i = Kt(s, i), a({
|
|
1619
1619
|
task: () => {
|
|
1620
1620
|
e.replaceState(n, i), r({ type: "REPLACE" });
|
|
1621
1621
|
},
|
|
@@ -1655,7 +1655,7 @@ function Wt(e) {
|
|
|
1655
1655
|
type: "FORWARD"
|
|
1656
1656
|
});
|
|
1657
1657
|
},
|
|
1658
|
-
canGoBack: () => t.state[
|
|
1658
|
+
canGoBack: () => t.state[U] !== 0,
|
|
1659
1659
|
createHref: (t) => e.createHref(t),
|
|
1660
1660
|
block: (t) => {
|
|
1661
1661
|
if (!e.setBlockers) return () => {};
|
|
@@ -1670,22 +1670,22 @@ function Wt(e) {
|
|
|
1670
1670
|
notify: r
|
|
1671
1671
|
};
|
|
1672
1672
|
}
|
|
1673
|
-
function
|
|
1673
|
+
function Kt(e, t) {
|
|
1674
1674
|
t ||= {};
|
|
1675
|
-
let n =
|
|
1675
|
+
let n = Zt();
|
|
1676
1676
|
return {
|
|
1677
1677
|
...t,
|
|
1678
1678
|
key: n,
|
|
1679
1679
|
__TSR_key: n,
|
|
1680
|
-
[
|
|
1680
|
+
[U]: e
|
|
1681
1681
|
};
|
|
1682
1682
|
}
|
|
1683
|
-
function
|
|
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 ?? (() =>
|
|
1683
|
+
function qt(e) {
|
|
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 ?? (() => W(`${t.location.pathname}${t.location.search}${t.location.hash}`, t.history.state));
|
|
1685
1685
|
if (!t.history.state?.__TSR_key && !t.history.state?.key) {
|
|
1686
|
-
let e =
|
|
1686
|
+
let e = Zt();
|
|
1687
1687
|
t.history.replaceState({
|
|
1688
|
-
[
|
|
1688
|
+
[U]: 0,
|
|
1689
1689
|
key: e,
|
|
1690
1690
|
__TSR_key: e
|
|
1691
1691
|
}, "");
|
|
@@ -1694,7 +1694,7 @@ function Kt(e) {
|
|
|
1694
1694
|
g && (C._ignoreSubscribers = !0, (g.isPush ? t.history.pushState : t.history.replaceState)(g.state, "", g.href), C._ignoreSubscribers = !1, g = void 0, _ = void 0, u = void 0);
|
|
1695
1695
|
}, y = (e, t, n) => {
|
|
1696
1696
|
let r = s(t);
|
|
1697
|
-
_ || (u = l), l =
|
|
1697
|
+
_ || (u = l), l = W(t, n), g = {
|
|
1698
1698
|
href: r,
|
|
1699
1699
|
state: n,
|
|
1700
1700
|
isPush: g?.isPush || e === "push"
|
|
@@ -1706,7 +1706,7 @@ function Kt(e) {
|
|
|
1706
1706
|
f = !1;
|
|
1707
1707
|
return;
|
|
1708
1708
|
}
|
|
1709
|
-
let e = c(), n = e.state[
|
|
1709
|
+
let e = c(), n = e.state[U] - l.state[U], r = n === 1, i = n === -1, o = !r && !i || d;
|
|
1710
1710
|
d = !1;
|
|
1711
1711
|
let s = o ? "GO" : i ? "BACK" : "FORWARD", u = o ? {
|
|
1712
1712
|
type: "GO",
|
|
@@ -1745,7 +1745,7 @@ function Kt(e) {
|
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
1747
|
if (t) return e.preventDefault(), e.returnValue = "";
|
|
1748
|
-
}, C =
|
|
1748
|
+
}, C = Gt({
|
|
1749
1749
|
getLocation: h,
|
|
1750
1750
|
getLength: () => t.history.length,
|
|
1751
1751
|
pushState: (e, t) => y("push", e, t),
|
|
@@ -1760,7 +1760,7 @@ function Kt(e) {
|
|
|
1760
1760
|
createHref: (e) => s(e),
|
|
1761
1761
|
flush: v,
|
|
1762
1762
|
destroy: () => {
|
|
1763
|
-
t.history.pushState = n, t.history.replaceState = r, t.removeEventListener(
|
|
1763
|
+
t.history.pushState = n, t.history.replaceState = r, t.removeEventListener(Wt, S, { capture: !0 }), t.removeEventListener(Ut, x);
|
|
1764
1764
|
},
|
|
1765
1765
|
onBlocked: () => {
|
|
1766
1766
|
u && l !== u && (l = u);
|
|
@@ -1769,7 +1769,7 @@ function Kt(e) {
|
|
|
1769
1769
|
setBlockers: o,
|
|
1770
1770
|
notifyOnIndexChange: !1
|
|
1771
1771
|
});
|
|
1772
|
-
return t.addEventListener(
|
|
1772
|
+
return t.addEventListener(Wt, S, { capture: !0 }), t.addEventListener(Ut, x), t.history.pushState = function(...e) {
|
|
1773
1773
|
let r = n.apply(t.history, e);
|
|
1774
1774
|
return C._ignoreSubscribers || b("PUSH"), r;
|
|
1775
1775
|
}, t.history.replaceState = function(...e) {
|
|
@@ -1777,20 +1777,20 @@ function Kt(e) {
|
|
|
1777
1777
|
return C._ignoreSubscribers || b("REPLACE"), n;
|
|
1778
1778
|
}, C;
|
|
1779
1779
|
}
|
|
1780
|
-
function
|
|
1780
|
+
function Jt(e) {
|
|
1781
1781
|
let t = e?.window ?? (typeof window < "u" ? window : void 0);
|
|
1782
|
-
return
|
|
1782
|
+
return qt({
|
|
1783
1783
|
window: t,
|
|
1784
1784
|
parseLocation: () => {
|
|
1785
1785
|
let e = t.location.hash.split("#").slice(1), n = e[0] ?? "/", r = t.location.search, i = e.slice(1);
|
|
1786
|
-
return
|
|
1786
|
+
return W(`${n}${r}${i.length === 0 ? "" : `#${i.join("#")}`}`, t.history.state);
|
|
1787
1787
|
},
|
|
1788
1788
|
createHref: (e) => `${t.location.pathname}${t.location.search}#${e}`
|
|
1789
1789
|
});
|
|
1790
1790
|
}
|
|
1791
|
-
function
|
|
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) =>
|
|
1793
|
-
return
|
|
1791
|
+
function Yt(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) => Kt(t, void 0)), i = () => W(t[n], r[n]), a = [];
|
|
1793
|
+
return Gt({
|
|
1794
1794
|
getLocation: i,
|
|
1795
1795
|
getLength: () => t.length,
|
|
1796
1796
|
pushState: (e, i) => {
|
|
@@ -1813,30 +1813,30 @@ function Jt(e = { initialEntries: ["/"] }) {
|
|
|
1813
1813
|
setBlockers: (e) => a = e
|
|
1814
1814
|
});
|
|
1815
1815
|
}
|
|
1816
|
-
function
|
|
1816
|
+
function Xt(e) {
|
|
1817
1817
|
let t = e.replace(/[\x00-\x1f\x7f]/g, "");
|
|
1818
1818
|
return t.startsWith("//") && (t = "/" + t.replace(/^\/+/, "")), t;
|
|
1819
1819
|
}
|
|
1820
|
-
function
|
|
1821
|
-
let n =
|
|
1820
|
+
function W(e, t) {
|
|
1821
|
+
let n = Xt(e), r = n.indexOf("#"), i = n.indexOf("?"), a = Zt();
|
|
1822
1822
|
return {
|
|
1823
1823
|
href: n,
|
|
1824
1824
|
pathname: n.substring(0, r > 0 ? i > 0 ? Math.min(r, i) : r : i > 0 ? i : n.length),
|
|
1825
1825
|
hash: r > -1 ? n.substring(r) : "",
|
|
1826
1826
|
search: i > -1 ? n.slice(i, r === -1 ? void 0 : r) : "",
|
|
1827
1827
|
state: t || {
|
|
1828
|
-
[
|
|
1828
|
+
[U]: 0,
|
|
1829
1829
|
key: a,
|
|
1830
1830
|
__TSR_key: a
|
|
1831
1831
|
}
|
|
1832
1832
|
};
|
|
1833
1833
|
}
|
|
1834
|
-
function
|
|
1834
|
+
function Zt() {
|
|
1835
1835
|
return (Math.random() + 1).toString(36).substring(7);
|
|
1836
1836
|
}
|
|
1837
1837
|
//#endregion
|
|
1838
1838
|
//#region ../router-core/dist/esm/router.js
|
|
1839
|
-
function
|
|
1839
|
+
function G(e, t) {
|
|
1840
1840
|
let n = t, r = e;
|
|
1841
1841
|
return {
|
|
1842
1842
|
fromLocation: n,
|
|
@@ -1846,7 +1846,7 @@ function K(e, t) {
|
|
|
1846
1846
|
hashChanged: n?.hash !== r.hash
|
|
1847
1847
|
};
|
|
1848
1848
|
}
|
|
1849
|
-
var
|
|
1849
|
+
var Qt = class {
|
|
1850
1850
|
constructor(e, t) {
|
|
1851
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) => {
|
|
1852
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.");
|
|
@@ -1854,33 +1854,33 @@ var Zt = class {
|
|
|
1854
1854
|
if (this.options = {
|
|
1855
1855
|
...t,
|
|
1856
1856
|
...e
|
|
1857
|
-
}, 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 = Ye(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 = qt())), this.origin = this.options.origin, !this.origin) {
|
|
1858
1858
|
let e = globalThis.window;
|
|
1859
1859
|
e && e.origin && e.origin !== "null" ? this.origin = e.origin : this.origin = "http://localhost";
|
|
1860
1860
|
}
|
|
1861
1861
|
if (this.history && this.updateLatestLocation(), this.options.routeTree !== this.routeTree) {
|
|
1862
1862
|
this.routeTree = this.options.routeTree;
|
|
1863
1863
|
let e;
|
|
1864
|
-
this.resolvePathCache =
|
|
1864
|
+
this.resolvePathCache = be(1e3), e = this.buildRouteTree(), this.setRoutes(e);
|
|
1865
1865
|
}
|
|
1866
1866
|
if (!this.stores && this.latestLocation) {
|
|
1867
1867
|
let e = this.getStoreConfig(this);
|
|
1868
|
-
this.batch = e.batch, this.stores =
|
|
1868
|
+
this.batch = e.batch, this.stores = St(an(this.latestLocation), e), lt(this);
|
|
1869
1869
|
}
|
|
1870
1870
|
let a = !1, o = this.options.basepath ?? "/", s = this.options.rewrite;
|
|
1871
1871
|
if (r || n !== o || i !== s) {
|
|
1872
1872
|
this.basepath = o;
|
|
1873
|
-
let e = [], t =
|
|
1874
|
-
t && t !== "/" && e.push(
|
|
1873
|
+
let e = [], t = Ge(o);
|
|
1874
|
+
t && t !== "/" && e.push(yt({ basepath: o })), s && e.push(s), this.rewrite = e.length === 0 ? void 0 : e.length === 1 ? e[0] : vt(e), this.history && this.updateLatestLocation(), a = !0;
|
|
1875
1875
|
}
|
|
1876
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))"));
|
|
1877
1877
|
}, this.updateLatestLocation = () => {
|
|
1878
1878
|
this.latestLocation = this.parseLocation(this.history.location, this.latestLocation);
|
|
1879
1879
|
}, this.buildRouteTree = () => {
|
|
1880
|
-
let e =
|
|
1880
|
+
let e = Me(this.routeTree, this.options.caseSensitive, (e, t) => {
|
|
1881
1881
|
e.init({ originalIndex: t });
|
|
1882
1882
|
});
|
|
1883
|
-
return this.options.routeMasks &&
|
|
1883
|
+
return this.options.routeMasks && De(this.options.routeMasks, e.processedTree), e;
|
|
1884
1884
|
}, this.subscribe = (e, t) => {
|
|
1885
1885
|
let n = {
|
|
1886
1886
|
eventType: e,
|
|
@@ -1900,23 +1900,23 @@ var Zt = class {
|
|
|
1900
1900
|
return {
|
|
1901
1901
|
href: e + o + r,
|
|
1902
1902
|
publicHref: e + o + r,
|
|
1903
|
-
pathname:
|
|
1903
|
+
pathname: ge(e).path,
|
|
1904
1904
|
external: !1,
|
|
1905
1905
|
searchStr: o,
|
|
1906
1906
|
search: E(t?.search, i),
|
|
1907
|
-
hash:
|
|
1907
|
+
hash: ge(r.slice(1)).path,
|
|
1908
1908
|
state: D(t?.state, a)
|
|
1909
1909
|
};
|
|
1910
1910
|
}
|
|
1911
|
-
let o = new URL(i, this.origin), s =
|
|
1911
|
+
let o = new URL(i, this.origin), s = bt(this.rewrite, o), c = this.options.parseSearch(s.search), l = this.options.stringifySearch(c);
|
|
1912
1912
|
return s.search = l, {
|
|
1913
1913
|
href: s.href.replace(s.origin, ""),
|
|
1914
1914
|
publicHref: i,
|
|
1915
|
-
pathname:
|
|
1915
|
+
pathname: ge(s.pathname).path,
|
|
1916
1916
|
external: !!this.rewrite && s.origin !== this.origin,
|
|
1917
1917
|
searchStr: l,
|
|
1918
1918
|
search: E(t?.search, c),
|
|
1919
|
-
hash:
|
|
1919
|
+
hash: ge(s.hash.slice(1)).path,
|
|
1920
1920
|
state: D(t?.state, a)
|
|
1921
1921
|
};
|
|
1922
1922
|
}, r = n(e), { __tempLocation: i, __tempKey: a } = r.state;
|
|
@@ -1928,15 +1928,15 @@ var Zt = class {
|
|
|
1928
1928
|
};
|
|
1929
1929
|
}
|
|
1930
1930
|
return r;
|
|
1931
|
-
}, this.resolvePathWithBase = (e, t) =>
|
|
1931
|
+
}, this.resolvePathWithBase = (e, t) => Je({
|
|
1932
1932
|
base: e,
|
|
1933
|
-
to: t.includes("//") ?
|
|
1933
|
+
to: t.includes("//") ? Ue(t) : t,
|
|
1934
1934
|
trailingSlash: this.options.trailingSlash,
|
|
1935
1935
|
cache: this.resolvePathCache
|
|
1936
1936
|
}), this.matchRoutes = (e, t, n) => typeof e == "string" ? this.matchRoutesInternal({
|
|
1937
1937
|
pathname: e,
|
|
1938
1938
|
search: t
|
|
1939
|
-
}, n) : this.matchRoutesInternal(e, t), this.getMatchedRoutes = (e) =>
|
|
1939
|
+
}, n) : this.matchRoutesInternal(e, t), this.getMatchedRoutes = (e) => sn({
|
|
1940
1940
|
pathname: e,
|
|
1941
1941
|
routesById: this.routesById,
|
|
1942
1942
|
processedTree: this.processedTree
|
|
@@ -1955,10 +1955,10 @@ var Zt = class {
|
|
|
1955
1955
|
let t = (t = {}) => {
|
|
1956
1956
|
let n = t._fromLocation || this.pendingBuiltLocation || this.latestLocation, r = this.matchRoutesLightweight(n);
|
|
1957
1957
|
if (t.from && process.env.NODE_ENV !== "production" && t._isNavigate) {
|
|
1958
|
-
let e = this.getMatchedRoutes(t.from).matchedRoutes, n =
|
|
1958
|
+
let e = this.getMatchedRoutes(t.from).matchedRoutes, n = ce(r.matchedRoutes, (e) => nn(e.fullPath, t.from)), i = ce(e, (e) => nn(e.fullPath, r.fullPath));
|
|
1959
1959
|
!n && !i && console.warn(`Could not find match for from: ${t.from}`);
|
|
1960
1960
|
}
|
|
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[
|
|
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[F(l)], f;
|
|
1962
1962
|
if (d) f = this.getRouteBranch(d);
|
|
1963
1963
|
else if (l.includes("$")) f = [];
|
|
1964
1964
|
else {
|
|
@@ -1971,7 +1971,7 @@ var Zt = class {
|
|
|
1971
1971
|
Object.assign(u, t(u));
|
|
1972
1972
|
} catch {}
|
|
1973
1973
|
}
|
|
1974
|
-
let p = e.leaveParams ? l :
|
|
1974
|
+
let p = e.leaveParams ? l : ge(Ze({
|
|
1975
1975
|
path: l,
|
|
1976
1976
|
params: u,
|
|
1977
1977
|
decoder: this.pathParamsDecoder,
|
|
@@ -1985,14 +1985,14 @@ var Zt = class {
|
|
|
1985
1985
|
let e = {};
|
|
1986
1986
|
f.forEach((t) => {
|
|
1987
1987
|
if (t.options.validateSearch) try {
|
|
1988
|
-
Object.assign(e,
|
|
1988
|
+
Object.assign(e, on(t.options.validateSearch, {
|
|
1989
1989
|
...e,
|
|
1990
1990
|
...m
|
|
1991
1991
|
}));
|
|
1992
1992
|
} catch {}
|
|
1993
1993
|
}), m = e;
|
|
1994
1994
|
}
|
|
1995
|
-
m =
|
|
1995
|
+
m = cn({
|
|
1996
1996
|
search: m,
|
|
1997
1997
|
dest: t,
|
|
1998
1998
|
destRoutes: f,
|
|
@@ -2002,7 +2002,7 @@ var Zt = class {
|
|
|
2002
2002
|
v = D(n.state, v);
|
|
2003
2003
|
let y = `${p}${h}${_}`, b, x, S = !1;
|
|
2004
2004
|
if (this.rewrite) {
|
|
2005
|
-
let e = new URL(y, this.origin), t =
|
|
2005
|
+
let e = new URL(y, this.origin), t = xt(this.rewrite, e);
|
|
2006
2006
|
b = e.href.replace(e.origin, ""), t.origin === this.origin ? x = t.pathname + t.search + t.hash : (x = t.href, S = !0);
|
|
2007
2007
|
} else b = _e(y), x = b;
|
|
2008
2008
|
return {
|
|
@@ -2021,7 +2021,7 @@ var Zt = class {
|
|
|
2021
2021
|
if (!a) {
|
|
2022
2022
|
let n = Object.create(null);
|
|
2023
2023
|
if (this.options.routeMasks) {
|
|
2024
|
-
let o =
|
|
2024
|
+
let o = Oe(i.pathname, this.processedTree);
|
|
2025
2025
|
if (o) {
|
|
2026
2026
|
Object.assign(n, o.rawParams);
|
|
2027
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));
|
|
@@ -2054,7 +2054,7 @@ var Zt = class {
|
|
|
2054
2054
|
return e.forEach((e) => {
|
|
2055
2055
|
delete n.state[e];
|
|
2056
2056
|
}), t;
|
|
2057
|
-
}, i =
|
|
2057
|
+
}, i = F(this.latestLocation.href) === F(n.href), a = this.commitLocationPromise;
|
|
2058
2058
|
if (this.commitLocationPromise = A(() => {
|
|
2059
2059
|
a?.resolve(), a = void 0;
|
|
2060
2060
|
}), i && r()) this.load();
|
|
@@ -2082,8 +2082,8 @@ var Zt = class {
|
|
|
2082
2082
|
return this.resetNextScroll = n.resetScroll ?? !0, this.history.subscribers.size || this.load(), this.commitLocationPromise;
|
|
2083
2083
|
}, this.buildAndCommitLocation = ({ replace: e, resetScroll: t, hashScrollIntoView: n, viewTransition: r, ignoreBlocker: i, href: a, ...o } = {}) => {
|
|
2084
2084
|
if (a) {
|
|
2085
|
-
let t = this.history.location.state.__TSR_index, n =
|
|
2086
|
-
o.to =
|
|
2085
|
+
let t = this.history.location.state.__TSR_index, n = W(a, { __TSR_index: e ? t : t + 1 }), r = new URL(n.pathname, this.origin);
|
|
2086
|
+
o.to = bt(this.rewrite, r).pathname, o.search = this.options.parseSearch(n.search), o.hash = n.hash.slice(1);
|
|
2087
2087
|
}
|
|
2088
2088
|
let s = this.buildLocation({
|
|
2089
2089
|
...o,
|
|
@@ -2115,7 +2115,7 @@ var Zt = class {
|
|
|
2115
2115
|
n ??= t.publicHref, r ??= t.publicHref;
|
|
2116
2116
|
}
|
|
2117
2117
|
let t = !a && r ? r : n;
|
|
2118
|
-
if (
|
|
2118
|
+
if (fe(t, this.protocolAllowlist)) return process.env.NODE_ENV !== "production" && console.warn(`Blocked navigation to dangerous protocol: ${t}`), Promise.resolve();
|
|
2119
2119
|
if (!i.ignoreBlocker) {
|
|
2120
2120
|
let e = this.history.getBlockers?.() ?? [];
|
|
2121
2121
|
for (let t of e) if (t?.blockerFn && await t.blockerFn({
|
|
@@ -2144,14 +2144,14 @@ var Zt = class {
|
|
|
2144
2144
|
this.startTransition(async () => {
|
|
2145
2145
|
try {
|
|
2146
2146
|
this.beforeLoad();
|
|
2147
|
-
let t = this.latestLocation, n =
|
|
2147
|
+
let t = this.latestLocation, n = G(t, this.stores.resolvedLocation.get());
|
|
2148
2148
|
this.stores.redirect.get() || this.emit({
|
|
2149
2149
|
type: "onBeforeNavigate",
|
|
2150
2150
|
...n
|
|
2151
2151
|
}), this.emit({
|
|
2152
2152
|
type: "onBeforeLoad",
|
|
2153
2153
|
...n
|
|
2154
|
-
}), await
|
|
2154
|
+
}), await zt({
|
|
2155
2155
|
router: this,
|
|
2156
2156
|
sync: e?.sync,
|
|
2157
2157
|
forceStaleReload: i.href === t.href,
|
|
@@ -2181,11 +2181,11 @@ var Zt = class {
|
|
|
2181
2181
|
}
|
|
2182
2182
|
});
|
|
2183
2183
|
} catch (e) {
|
|
2184
|
-
|
|
2184
|
+
R(e) ? (t = e, this.navigate({
|
|
2185
2185
|
...t.options,
|
|
2186
2186
|
replace: !0,
|
|
2187
2187
|
ignoreBlocker: !0
|
|
2188
|
-
})) :
|
|
2188
|
+
})) : I(e) && (n = e);
|
|
2189
2189
|
let r = t ? t.status : n ? 404 : this.stores.matches.get().some((e) => e.status === "error") ? 500 : 200;
|
|
2190
2190
|
this.batch(() => {
|
|
2191
2191
|
this.stores.statusCode.set(r), this.stores.redirect.set(t);
|
|
@@ -2201,7 +2201,7 @@ var Zt = class {
|
|
|
2201
2201
|
if (this.shouldViewTransition = void 0, t && typeof document < "u" && "startViewTransition" in document && typeof document.startViewTransition == "function") {
|
|
2202
2202
|
let n;
|
|
2203
2203
|
if (typeof t == "object" && this.isViewTransitionTypesSupported) {
|
|
2204
|
-
let r = this.latestLocation, i = this.stores.resolvedLocation.get(), a = typeof t.types == "function" ? t.types(
|
|
2204
|
+
let r = this.latestLocation, i = this.stores.resolvedLocation.get(), a = typeof t.types == "function" ? t.types(G(r, i)) : t.types;
|
|
2205
2205
|
if (a === !1) {
|
|
2206
2206
|
e();
|
|
2207
2207
|
return;
|
|
@@ -2255,7 +2255,7 @@ var Zt = class {
|
|
|
2255
2255
|
e.options.href = t, e.headers.set("Location", t);
|
|
2256
2256
|
}
|
|
2257
2257
|
} catch {}
|
|
2258
|
-
if (e.options.href && !e.options._builtLocation &&
|
|
2258
|
+
if (e.options.href && !e.options._builtLocation && fe(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(", ")}.`);
|
|
2259
2259
|
return e.headers.get("Location") || e.headers.set("Location", e.options.href), e;
|
|
2260
2260
|
}, this.clearCache = (e) => {
|
|
2261
2261
|
let t = e?.filter;
|
|
@@ -2268,7 +2268,7 @@ var Zt = class {
|
|
|
2268
2268
|
let r = (t.preload ? n.options.preloadGcTime ?? this.options.defaultPreloadGcTime : n.options.gcTime ?? this.options.defaultGcTime) ?? 300 * 1e3;
|
|
2269
2269
|
return t.status === "error" ? !0 : e - t.updatedAt >= r;
|
|
2270
2270
|
} });
|
|
2271
|
-
}, this.loadRouteChunk =
|
|
2271
|
+
}, this.loadRouteChunk = H, this.preloadRoute = async (e) => {
|
|
2272
2272
|
let t = e._builtLocation ?? this.buildLocation(e), n = this.matchRoutes(t, {
|
|
2273
2273
|
throwOnError: !0,
|
|
2274
2274
|
preload: !0,
|
|
@@ -2279,7 +2279,7 @@ var Zt = class {
|
|
|
2279
2279
|
this.stores.setCached([...e, ...a]);
|
|
2280
2280
|
}
|
|
2281
2281
|
try {
|
|
2282
|
-
return n = await
|
|
2282
|
+
return n = await zt({
|
|
2283
2283
|
router: this,
|
|
2284
2284
|
matches: n,
|
|
2285
2285
|
location: t,
|
|
@@ -2289,11 +2289,11 @@ var Zt = class {
|
|
|
2289
2289
|
}
|
|
2290
2290
|
}), n;
|
|
2291
2291
|
} catch (e) {
|
|
2292
|
-
if (
|
|
2292
|
+
if (R(e)) return e.options.reloadDocument ? void 0 : await this.preloadRoute({
|
|
2293
2293
|
...e.options,
|
|
2294
2294
|
_fromLocation: t
|
|
2295
2295
|
});
|
|
2296
|
-
|
|
2296
|
+
I(e) || console.error(e);
|
|
2297
2297
|
return;
|
|
2298
2298
|
}
|
|
2299
2299
|
}, this.matchRoute = (e, t) => {
|
|
@@ -2304,7 +2304,7 @@ var Zt = class {
|
|
|
2304
2304
|
leaveParams: !0
|
|
2305
2305
|
}, r = this.buildLocation(n);
|
|
2306
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 =
|
|
2307
|
+
let i = (t?.pending === void 0 ? !this.stores.isLoading.get() : t.pending) ? this.latestLocation : this.stores.resolvedLocation.get() || this.stores.location.get(), a = ke(r.pathname, t?.caseSensitive ?? !1, t?.fuzzy ?? !1, i.pathname, this.processedTree);
|
|
2308
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
2309
|
}, this.hasNotFoundMatch = () => this.stores.matches.get().some((e) => e.status === "notFound" || e.globalNotFound), this.getStoreConfig = t, this.update({
|
|
2310
2310
|
defaultPreloadDelay: 50,
|
|
@@ -2314,9 +2314,9 @@ var Zt = class {
|
|
|
2314
2314
|
...e,
|
|
2315
2315
|
caseSensitive: e.caseSensitive ?? !1,
|
|
2316
2316
|
notFoundMode: e.notFoundMode ?? "fuzzy",
|
|
2317
|
-
stringifySearch: e.stringifySearch ??
|
|
2318
|
-
parseSearch: e.parseSearch ??
|
|
2319
|
-
protocolAllowlist: e.protocolAllowlist ??
|
|
2317
|
+
stringifySearch: e.stringifySearch ?? mt,
|
|
2318
|
+
parseSearch: e.parseSearch ?? pt,
|
|
2319
|
+
protocolAllowlist: e.protocolAllowlist ?? de
|
|
2320
2320
|
}), typeof document < "u" && (self.__TSR_ROUTER__ = this);
|
|
2321
2321
|
}
|
|
2322
2322
|
isShell() {
|
|
@@ -2335,7 +2335,7 @@ var Zt = class {
|
|
|
2335
2335
|
}
|
|
2336
2336
|
getRouteBranch(e) {
|
|
2337
2337
|
let t = this.routeBranchCache.get(e);
|
|
2338
|
-
return t || (t =
|
|
2338
|
+
return t || (t = Fe(e), this.routeBranchCache.set(e, t)), t;
|
|
2339
2339
|
}
|
|
2340
2340
|
get looseRoutesById() {
|
|
2341
2341
|
return this.routesById;
|
|
@@ -2345,15 +2345,15 @@ var Zt = class {
|
|
|
2345
2345
|
}
|
|
2346
2346
|
matchRoutesInternal(e, t) {
|
|
2347
2347
|
let n = this.getMatchedRoutes(e.pathname), { foundRoute: r, routeParams: i } = n, { matchedRoutes: a } = n, o = !1;
|
|
2348
|
-
(r ? r.path !== "/" && i["**"] :
|
|
2349
|
-
let s = o ?
|
|
2348
|
+
(r ? r.path !== "/" && i["**"] : F(e.pathname)) && (this.options.notFoundRoute ? a = [...a, this.options.notFoundRoute] : o = !0);
|
|
2349
|
+
let s = o ? un(this.options.notFoundMode, a) : void 0, c = Array(a.length), l = /* @__PURE__ */ new Map();
|
|
2350
2350
|
for (let e of this.stores.matchStores.values()) e.routeId && l.set(e.routeId, e.get());
|
|
2351
2351
|
for (let n = 0; n < a.length; n++) {
|
|
2352
2352
|
let r = a[n], o = c[n - 1], u, d, f;
|
|
2353
2353
|
{
|
|
2354
2354
|
let n = o?.search ?? e.search, i = o?._strictSearch ?? void 0;
|
|
2355
2355
|
try {
|
|
2356
|
-
let e =
|
|
2356
|
+
let e = on(r.options.validateSearch, { ...n }) ?? void 0;
|
|
2357
2357
|
u = {
|
|
2358
2358
|
...n,
|
|
2359
2359
|
...e
|
|
@@ -2363,20 +2363,20 @@ var Zt = class {
|
|
|
2363
2363
|
}, f = void 0;
|
|
2364
2364
|
} catch (e) {
|
|
2365
2365
|
let r = e;
|
|
2366
|
-
if (e instanceof
|
|
2366
|
+
if (e instanceof $t || (r = new $t(e.message, { cause: e })), t?.throwOnError) throw r;
|
|
2367
2367
|
u = n, d = {}, f = r;
|
|
2368
2368
|
}
|
|
2369
2369
|
}
|
|
2370
|
-
let p = r.options.loaderDeps?.({ search: u }) ?? "", m = p ? JSON.stringify(p) : "", { interpolatedPath: h, usedParams: g } =
|
|
2370
|
+
let p = r.options.loaderDeps?.({ search: u }) ?? "", m = p ? JSON.stringify(p) : "", { interpolatedPath: h, usedParams: g } = Ze({
|
|
2371
2371
|
path: r.fullPath,
|
|
2372
2372
|
params: i,
|
|
2373
2373
|
decoder: this.pathParamsDecoder,
|
|
2374
2374
|
server: this.isServer
|
|
2375
2375
|
}), _ = r.id + h + m, v = this.getMatch(_), y = l.get(r.id), b = v?._strictParams ?? g, x;
|
|
2376
2376
|
if (!v) try {
|
|
2377
|
-
|
|
2377
|
+
dn(r, b);
|
|
2378
2378
|
} catch (e) {
|
|
2379
|
-
if (x =
|
|
2379
|
+
if (x = I(e) || R(e) ? e : new en(e.message, { cause: e }), t?.throwOnError) throw x;
|
|
2380
2380
|
}
|
|
2381
2381
|
Object.assign(i, b);
|
|
2382
2382
|
let S = y ? "stay" : "enter", C;
|
|
@@ -2389,7 +2389,7 @@ var Zt = class {
|
|
|
2389
2389
|
_strictSearch: d
|
|
2390
2390
|
};
|
|
2391
2391
|
else {
|
|
2392
|
-
let e = r.options.loader || r.options.beforeLoad || r.lazyFn ||
|
|
2392
|
+
let e = r.options.loader || r.options.beforeLoad || r.lazyFn || Vt(r) ? "pending" : "success";
|
|
2393
2393
|
C = {
|
|
2394
2394
|
id: _,
|
|
2395
2395
|
ssr: r.options.ssr,
|
|
@@ -2467,14 +2467,14 @@ var Zt = class {
|
|
|
2467
2467
|
matchRoutesLightweight(e) {
|
|
2468
2468
|
let { matchedRoutes: t, routeParams: n } = this.getMatchedRoutes(e.pathname), r = w(t), i = { ...e.search };
|
|
2469
2469
|
for (let e of t) try {
|
|
2470
|
-
Object.assign(i,
|
|
2470
|
+
Object.assign(i, on(e.options.validateSearch, i));
|
|
2471
2471
|
} catch {}
|
|
2472
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
2473
|
if (s) c = o.params;
|
|
2474
2474
|
else {
|
|
2475
2475
|
let e = Object.assign(Object.create(null), n);
|
|
2476
2476
|
for (let n of t) try {
|
|
2477
|
-
|
|
2477
|
+
dn(n, e);
|
|
2478
2478
|
} catch {}
|
|
2479
2479
|
c = e;
|
|
2480
2480
|
}
|
|
@@ -2485,14 +2485,14 @@ var Zt = class {
|
|
|
2485
2485
|
params: c
|
|
2486
2486
|
};
|
|
2487
2487
|
}
|
|
2488
|
-
},
|
|
2489
|
-
function tn(e, t) {
|
|
2490
|
-
return en(e) === en(t);
|
|
2491
|
-
}
|
|
2488
|
+
}, $t = class extends Error {}, en = class extends Error {}, tn = (e) => e.endsWith("/") && e.length > 1 ? e.slice(0, -1) : e;
|
|
2492
2489
|
function nn(e, t) {
|
|
2490
|
+
return tn(e) === tn(t);
|
|
2491
|
+
}
|
|
2492
|
+
function rn(e, t) {
|
|
2493
2493
|
return async (...n) => (await e())[t || "default"](...n);
|
|
2494
2494
|
}
|
|
2495
|
-
function
|
|
2495
|
+
function an(e) {
|
|
2496
2496
|
return {
|
|
2497
2497
|
loadedAt: 0,
|
|
2498
2498
|
isLoading: !1,
|
|
@@ -2504,28 +2504,28 @@ function rn(e) {
|
|
|
2504
2504
|
statusCode: 200
|
|
2505
2505
|
};
|
|
2506
2506
|
}
|
|
2507
|
-
function
|
|
2507
|
+
function on(e, t) {
|
|
2508
2508
|
if (e == null) return {};
|
|
2509
2509
|
if ("~standard" in e) {
|
|
2510
2510
|
let n = e["~standard"].validate(t);
|
|
2511
|
-
if (n instanceof Promise) throw new
|
|
2512
|
-
if (n.issues) throw new
|
|
2511
|
+
if (n instanceof Promise) throw new $t("Async validation not supported");
|
|
2512
|
+
if (n.issues) throw new $t(JSON.stringify(n.issues, void 0, 2), { cause: n });
|
|
2513
2513
|
return n.value;
|
|
2514
2514
|
}
|
|
2515
2515
|
return "parse" in e ? e.parse(t) : typeof e == "function" ? e(t) : {};
|
|
2516
2516
|
}
|
|
2517
|
-
function
|
|
2518
|
-
let r = Object.create(null), i =
|
|
2517
|
+
function sn({ pathname: e, routesById: t, processedTree: n }) {
|
|
2518
|
+
let r = Object.create(null), i = F(e), a, o = Ae(i, n, !0);
|
|
2519
2519
|
return o && (a = o.route, Object.assign(r, o.rawParams)), {
|
|
2520
2520
|
matchedRoutes: o?.branch || [t.__root__],
|
|
2521
2521
|
routeParams: r,
|
|
2522
2522
|
foundRoute: a
|
|
2523
2523
|
};
|
|
2524
2524
|
}
|
|
2525
|
-
function
|
|
2526
|
-
return
|
|
2525
|
+
function cn({ search: e, dest: t, destRoutes: n, _includeValidateSearch: r }) {
|
|
2526
|
+
return ln(n)(e, t, r ?? !1);
|
|
2527
2527
|
}
|
|
2528
|
-
function
|
|
2528
|
+
function ln(e) {
|
|
2529
2529
|
let t = {
|
|
2530
2530
|
dest: null,
|
|
2531
2531
|
_includeValidateSearch: !1,
|
|
@@ -2542,7 +2542,7 @@ function cn(e) {
|
|
|
2542
2542
|
try {
|
|
2543
2543
|
return {
|
|
2544
2544
|
...i,
|
|
2545
|
-
...
|
|
2545
|
+
...on(n.options.validateSearch, i) ?? void 0
|
|
2546
2546
|
};
|
|
2547
2547
|
} catch {
|
|
2548
2548
|
return i;
|
|
@@ -2564,14 +2564,14 @@ function cn(e) {
|
|
|
2564
2564
|
return t.dest = r, t._includeValidateSearch = i, n(0, e, t.middlewares);
|
|
2565
2565
|
};
|
|
2566
2566
|
}
|
|
2567
|
-
function
|
|
2567
|
+
function un(e, t) {
|
|
2568
2568
|
if (e !== "root") for (let e = t.length - 1; e >= 0; e--) {
|
|
2569
2569
|
let n = t[e];
|
|
2570
2570
|
if (n.children) return n.id;
|
|
2571
2571
|
}
|
|
2572
|
-
return
|
|
2572
|
+
return L;
|
|
2573
2573
|
}
|
|
2574
|
-
function
|
|
2574
|
+
function dn(e, t) {
|
|
2575
2575
|
let n = e.options.params?.parse ?? e.options.parseParams;
|
|
2576
2576
|
if (n) {
|
|
2577
2577
|
let e = n(t);
|
|
@@ -2581,7 +2581,7 @@ function un(e, t) {
|
|
|
2581
2581
|
}
|
|
2582
2582
|
//#endregion
|
|
2583
2583
|
//#region ../router-core/dist/esm/link.js
|
|
2584
|
-
var
|
|
2584
|
+
var fn = "Error preloading route! ☝️", pn = class {
|
|
2585
2585
|
get to() {
|
|
2586
2586
|
return this._to;
|
|
2587
2587
|
}
|
|
@@ -2598,43 +2598,43 @@ var dn = "Error preloading route! ☝️", fn = class {
|
|
|
2598
2598
|
if (this.init = (e) => {
|
|
2599
2599
|
this.originalIndex = e.originalIndex;
|
|
2600
2600
|
let t = this.options, n = !t?.path && !t?.id;
|
|
2601
|
-
if (this.parentRoute = this.options.getParentRoute?.(), n) this._path =
|
|
2601
|
+
if (this.parentRoute = this.options.getParentRoute?.(), n) this._path = L;
|
|
2602
2602
|
else if (!this.parentRoute) {
|
|
2603
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.");
|
|
2604
2604
|
ye();
|
|
2605
2605
|
}
|
|
2606
|
-
let r = n ?
|
|
2607
|
-
r && r !== "/" && (r =
|
|
2608
|
-
let i = t?.id || r, a = n ?
|
|
2609
|
-
r === "__root__" && (r = "/"), a !== "__root__" && (a =
|
|
2610
|
-
let o = a === "__root__" ? "/" :
|
|
2611
|
-
this._path = r, this._id = a, this._fullPath = o, this._to =
|
|
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) =>
|
|
2606
|
+
let r = n ? L : t?.path;
|
|
2607
|
+
r && r !== "/" && (r = We(r));
|
|
2608
|
+
let i = t?.id || r, a = n ? L : He([this.parentRoute.id === "__root__" ? "" : this.parentRoute.id, i]);
|
|
2609
|
+
r === "__root__" && (r = "/"), a !== "__root__" && (a = He(["/", a]));
|
|
2610
|
+
let o = a === "__root__" ? "/" : He([this.parentRoute.fullPath, r]);
|
|
2611
|
+
this._path = r, this._id = a, this._fullPath = o, this._to = F(o);
|
|
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) => _t({
|
|
2613
2613
|
from: this.fullPath,
|
|
2614
2614
|
...e
|
|
2615
2615
|
}), this.options = e || {}, this.isRoot = !e?.getParentRoute, e?.id && e?.path) throw Error("Route cannot have both an 'id' and a 'path' option.");
|
|
2616
2616
|
}
|
|
2617
|
-
},
|
|
2617
|
+
}, mn = class {
|
|
2618
2618
|
constructor({ id: e }) {
|
|
2619
|
-
this.notFound = (e) =>
|
|
2619
|
+
this.notFound = (e) => $e({
|
|
2620
2620
|
routeId: this.id,
|
|
2621
2621
|
...e
|
|
2622
|
-
}), this.redirect = (e) =>
|
|
2622
|
+
}), this.redirect = (e) => _t({
|
|
2623
2623
|
from: this.id,
|
|
2624
2624
|
...e
|
|
2625
2625
|
}), this.id = e;
|
|
2626
2626
|
}
|
|
2627
|
-
},
|
|
2627
|
+
}, hn = class extends pn {
|
|
2628
2628
|
constructor(e) {
|
|
2629
2629
|
super(e);
|
|
2630
2630
|
}
|
|
2631
|
-
},
|
|
2631
|
+
}, gn = (e) => ({
|
|
2632
2632
|
serializationAdapters: e.serializationAdapters,
|
|
2633
2633
|
defaultSsr: e.defaultSsr
|
|
2634
2634
|
});
|
|
2635
2635
|
//#endregion
|
|
2636
2636
|
//#region ../router-core/dist/esm/searchMiddleware.js
|
|
2637
|
-
function
|
|
2637
|
+
function _n(e) {
|
|
2638
2638
|
return ({ search: t, next: n }) => {
|
|
2639
2639
|
let r = n(t);
|
|
2640
2640
|
if (e === !0) return {
|
|
@@ -2649,7 +2649,7 @@ function gn(e) {
|
|
|
2649
2649
|
}
|
|
2650
2650
|
//#endregion
|
|
2651
2651
|
//#region ../router-core/dist/esm/hash-scroll.js
|
|
2652
|
-
function
|
|
2652
|
+
function vn(e) {
|
|
2653
2653
|
if (typeof document < "u" && document.querySelector) {
|
|
2654
2654
|
let t = e.stores.location.get(), n = t.state.__hashScrollIntoViewOptions ?? !0;
|
|
2655
2655
|
if (n && t.hash !== "") {
|
|
@@ -2660,7 +2660,7 @@ function _n(e) {
|
|
|
2660
2660
|
}
|
|
2661
2661
|
//#endregion
|
|
2662
2662
|
//#region src/routerStores.ts
|
|
2663
|
-
function
|
|
2663
|
+
function yn(e, t) {
|
|
2664
2664
|
e.childMatchIdByRouteId = t(() => {
|
|
2665
2665
|
let t = e.matchesId.get(), n = {};
|
|
2666
2666
|
for (let r = 0; r < t.length - 1; r++) {
|
|
@@ -2677,40 +2677,40 @@ function vn(e, t) {
|
|
|
2677
2677
|
return n;
|
|
2678
2678
|
});
|
|
2679
2679
|
}
|
|
2680
|
-
var
|
|
2680
|
+
var bn = (n) => ({
|
|
2681
2681
|
createMutableStore: t,
|
|
2682
2682
|
createReadonlyStore: t,
|
|
2683
2683
|
batch: e,
|
|
2684
|
-
init: (e) =>
|
|
2685
|
-
}),
|
|
2684
|
+
init: (e) => yn(e, t)
|
|
2685
|
+
}), xn = (e) => new Sn(e), Sn = class extends Qt {
|
|
2686
2686
|
constructor(e) {
|
|
2687
|
-
super(e,
|
|
2687
|
+
super(e, bn);
|
|
2688
2688
|
}
|
|
2689
|
-
},
|
|
2689
|
+
}, Cn = {
|
|
2690
2690
|
matchId: () => void 0,
|
|
2691
2691
|
routeId: () => void 0,
|
|
2692
2692
|
match: () => void 0,
|
|
2693
2693
|
hasPending: () => !1
|
|
2694
|
-
},
|
|
2694
|
+
}, K = new n.InjectionToken("MATCH_CONTEXT_INJECTOR", {
|
|
2695
2695
|
providedIn: "root",
|
|
2696
|
-
factory: () =>
|
|
2697
|
-
}),
|
|
2698
|
-
function
|
|
2699
|
-
return typeof document > "u" ?
|
|
2696
|
+
factory: () => Cn
|
|
2697
|
+
}), wn = new n.InjectionToken("ROUTER");
|
|
2698
|
+
function Tn() {
|
|
2699
|
+
return typeof document > "u" ? wn : window.__TSR_ROUTER_INJECTION_KEY__ ? window.__TSR_ROUTER_INJECTION_KEY__ : (window.__TSR_ROUTER_INJECTION_KEY__ = wn, wn);
|
|
2700
2700
|
}
|
|
2701
2701
|
//#endregion
|
|
2702
2702
|
//#region src/injectRouter.ts
|
|
2703
|
-
function
|
|
2704
|
-
let t = n.inject(
|
|
2703
|
+
function q(e) {
|
|
2704
|
+
let t = n.inject(Tn(), { optional: !0 });
|
|
2705
2705
|
return process.env.NODE_ENV !== "production" && (e?.warn ?? !0) && !t && console.warn("Warning: injectRouter must be used inside a <router-provider> component!"), t;
|
|
2706
2706
|
}
|
|
2707
2707
|
//#endregion
|
|
2708
2708
|
//#region src/store/injectSelector.ts
|
|
2709
|
-
function
|
|
2709
|
+
function En(e, t) {
|
|
2710
2710
|
return t || (f(e), h(c));
|
|
2711
2711
|
}
|
|
2712
|
-
function
|
|
2713
|
-
return b(
|
|
2712
|
+
function Dn(e, t = (e) => e, n) {
|
|
2713
|
+
return b(En(Dn, n?.injector), () => {
|
|
2714
2714
|
let r = typeof e == "function" ? e : () => e, i = y(() => t(r().get()), { equal: n?.compare });
|
|
2715
2715
|
return m((e) => {
|
|
2716
2716
|
let { unsubscribe: n } = r().subscribe((e) => {
|
|
@@ -2722,9 +2722,9 @@ function En(e, t = (e) => e, n) {
|
|
|
2722
2722
|
}
|
|
2723
2723
|
//#endregion
|
|
2724
2724
|
//#region src/store/injectStore.ts
|
|
2725
|
-
function
|
|
2725
|
+
function J(e, t = (e) => e, n) {
|
|
2726
2726
|
let { equal: r, injector: i, ...a } = n ?? {};
|
|
2727
|
-
return
|
|
2727
|
+
return Dn(e, t, {
|
|
2728
2728
|
...a,
|
|
2729
2729
|
compare: r,
|
|
2730
2730
|
injector: i
|
|
@@ -2732,15 +2732,15 @@ function Y(e, t = (e) => e, n) {
|
|
|
2732
2732
|
}
|
|
2733
2733
|
//#endregion
|
|
2734
2734
|
//#region src/injectMatch.ts
|
|
2735
|
-
var
|
|
2735
|
+
var On = {
|
|
2736
2736
|
get: () => void 0,
|
|
2737
2737
|
subscribe: () => ({ unsubscribe: () => {} })
|
|
2738
2738
|
};
|
|
2739
|
-
function
|
|
2740
|
-
let t =
|
|
2739
|
+
function Y(e) {
|
|
2740
|
+
let t = q(), r = e.from ? void 0 : n.inject(K), i = J(e.from ? t.stores.getRouteMatchStore(e.from) : () => {
|
|
2741
2741
|
let e = r?.matchId();
|
|
2742
|
-
return e ? t.stores.matchStores.get(e) ??
|
|
2743
|
-
}, (e) => e), a =
|
|
2742
|
+
return e ? t.stores.matchStores.get(e) ?? On : On;
|
|
2743
|
+
}, (e) => e), a = J(t.stores.pendingRouteIds, (e) => e), o = J(t.stores.isTransitioning, (e) => e);
|
|
2744
2744
|
return n.computed(() => {
|
|
2745
2745
|
let t = i();
|
|
2746
2746
|
if (t !== void 0) return e.select ? e.select(t) : t;
|
|
@@ -2752,8 +2752,8 @@ function X(e) {
|
|
|
2752
2752
|
}
|
|
2753
2753
|
//#endregion
|
|
2754
2754
|
//#region src/injectLoaderData.ts
|
|
2755
|
-
function
|
|
2756
|
-
return
|
|
2755
|
+
function kn(e) {
|
|
2756
|
+
return Y({
|
|
2757
2757
|
from: e.from,
|
|
2758
2758
|
strict: e.strict,
|
|
2759
2759
|
select: (t) => e.select ? e.select(t.loaderData) : t.loaderData
|
|
@@ -2761,17 +2761,17 @@ function On(e) {
|
|
|
2761
2761
|
}
|
|
2762
2762
|
//#endregion
|
|
2763
2763
|
//#region src/injectLoaderDeps.ts
|
|
2764
|
-
function
|
|
2764
|
+
function An(e) {
|
|
2765
2765
|
let { select: t, ...n } = e;
|
|
2766
|
-
return
|
|
2766
|
+
return Y({
|
|
2767
2767
|
...n,
|
|
2768
2768
|
select: (e) => t ? t(e.loaderDeps) : e.loaderDeps
|
|
2769
2769
|
});
|
|
2770
2770
|
}
|
|
2771
2771
|
//#endregion
|
|
2772
2772
|
//#region src/injectNavigate.ts
|
|
2773
|
-
function
|
|
2774
|
-
let t =
|
|
2773
|
+
function X(e) {
|
|
2774
|
+
let t = q();
|
|
2775
2775
|
return ((n) => t.navigate({
|
|
2776
2776
|
...n,
|
|
2777
2777
|
from: n.from ?? e?.from
|
|
@@ -2780,7 +2780,7 @@ function An(e) {
|
|
|
2780
2780
|
//#endregion
|
|
2781
2781
|
//#region src/injectParams.ts
|
|
2782
2782
|
function jn(e) {
|
|
2783
|
-
return
|
|
2783
|
+
return Y({
|
|
2784
2784
|
from: e.from,
|
|
2785
2785
|
strict: e.strict,
|
|
2786
2786
|
shouldThrow: e.shouldThrow,
|
|
@@ -2790,7 +2790,7 @@ function jn(e) {
|
|
|
2790
2790
|
//#endregion
|
|
2791
2791
|
//#region src/injectRouteContext.ts
|
|
2792
2792
|
function Mn(e) {
|
|
2793
|
-
return
|
|
2793
|
+
return Y({
|
|
2794
2794
|
...e,
|
|
2795
2795
|
select: (t) => e.select ? e.select(t.context) : t.context
|
|
2796
2796
|
});
|
|
@@ -2798,7 +2798,7 @@ function Mn(e) {
|
|
|
2798
2798
|
//#endregion
|
|
2799
2799
|
//#region src/injectSearch.ts
|
|
2800
2800
|
function Nn(e) {
|
|
2801
|
-
return
|
|
2801
|
+
return Y({
|
|
2802
2802
|
from: e.from,
|
|
2803
2803
|
strict: e.strict,
|
|
2804
2804
|
shouldThrow: e.shouldThrow,
|
|
@@ -2810,9 +2810,9 @@ function Nn(e) {
|
|
|
2810
2810
|
function Pn(e) {
|
|
2811
2811
|
return new Fn({ id: e });
|
|
2812
2812
|
}
|
|
2813
|
-
var Fn = class extends
|
|
2813
|
+
var Fn = class extends mn {
|
|
2814
2814
|
constructor({ id: e }) {
|
|
2815
|
-
super({ id: e }), this.injectMatch = (e) =>
|
|
2815
|
+
super({ id: e }), this.injectMatch = (e) => Y({
|
|
2816
2816
|
select: e?.select,
|
|
2817
2817
|
from: this.id
|
|
2818
2818
|
}), this.injectRouteContext = (e) => Mn({
|
|
@@ -2824,25 +2824,25 @@ var Fn = class extends pn {
|
|
|
2824
2824
|
}), this.injectParams = (e) => jn({
|
|
2825
2825
|
select: e?.select,
|
|
2826
2826
|
from: this.id
|
|
2827
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2827
|
+
}), this.injectLoaderDeps = (e) => An({
|
|
2828
2828
|
...e,
|
|
2829
2829
|
from: this.id,
|
|
2830
2830
|
strict: !1
|
|
2831
|
-
}), this.injectLoaderData = (e) =>
|
|
2831
|
+
}), this.injectLoaderData = (e) => kn({
|
|
2832
2832
|
...e,
|
|
2833
2833
|
from: this.id,
|
|
2834
2834
|
strict: !1
|
|
2835
|
-
}), this.injectNavigate = () =>
|
|
2835
|
+
}), this.injectNavigate = () => X({ from: q().routesById[this.id].fullPath }), this.notFound = (e) => $e({
|
|
2836
2836
|
routeId: this.id,
|
|
2837
2837
|
...e
|
|
2838
2838
|
});
|
|
2839
2839
|
}
|
|
2840
|
-
}, In = class extends
|
|
2840
|
+
}, In = class extends pn {
|
|
2841
2841
|
constructor(e) {
|
|
2842
|
-
super(e), this.injectMatch = (e) =>
|
|
2842
|
+
super(e), this.injectMatch = (e) => Y({
|
|
2843
2843
|
select: e?.select,
|
|
2844
2844
|
from: this.id
|
|
2845
|
-
}), this.injectRouteContext = (e) =>
|
|
2845
|
+
}), this.injectRouteContext = (e) => Y({
|
|
2846
2846
|
...e,
|
|
2847
2847
|
from: this.id,
|
|
2848
2848
|
select: (t) => e?.select ? e.select(t.context) : t.context
|
|
@@ -2852,13 +2852,13 @@ var Fn = class extends pn {
|
|
|
2852
2852
|
}), this.injectParams = (e) => jn({
|
|
2853
2853
|
select: e?.select,
|
|
2854
2854
|
from: this.id
|
|
2855
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2855
|
+
}), this.injectLoaderDeps = (e) => An({
|
|
2856
2856
|
...e,
|
|
2857
2857
|
from: this.id
|
|
2858
|
-
}), this.injectLoaderData = (e) =>
|
|
2858
|
+
}), this.injectLoaderData = (e) => kn({
|
|
2859
2859
|
...e,
|
|
2860
2860
|
from: this.id
|
|
2861
|
-
}), this.injectNavigate = () =>
|
|
2861
|
+
}), this.injectNavigate = () => X({ from: this.fullPath });
|
|
2862
2862
|
}
|
|
2863
2863
|
};
|
|
2864
2864
|
function Ln(e) {
|
|
@@ -2867,12 +2867,12 @@ function Ln(e) {
|
|
|
2867
2867
|
function Rn() {
|
|
2868
2868
|
return (e) => Hn(e);
|
|
2869
2869
|
}
|
|
2870
|
-
var zn = class extends
|
|
2870
|
+
var zn = class extends hn {
|
|
2871
2871
|
constructor(e) {
|
|
2872
|
-
super(e), this.injectMatch = (e) =>
|
|
2872
|
+
super(e), this.injectMatch = (e) => Y({
|
|
2873
2873
|
select: e?.select,
|
|
2874
2874
|
from: this.id
|
|
2875
|
-
}), this.injectRouteContext = (e) =>
|
|
2875
|
+
}), this.injectRouteContext = (e) => Y({
|
|
2876
2876
|
...e,
|
|
2877
2877
|
from: this.id,
|
|
2878
2878
|
select: (t) => e?.select ? e.select(t.context) : t.context
|
|
@@ -2882,13 +2882,13 @@ var zn = class extends mn {
|
|
|
2882
2882
|
}), this.injectParams = (e) => jn({
|
|
2883
2883
|
select: e?.select,
|
|
2884
2884
|
from: this.id
|
|
2885
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2885
|
+
}), this.injectLoaderDeps = (e) => An({
|
|
2886
2886
|
...e,
|
|
2887
2887
|
from: this.id
|
|
2888
|
-
}), this.injectLoaderData = (e) =>
|
|
2888
|
+
}), this.injectLoaderData = (e) => kn({
|
|
2889
2889
|
...e,
|
|
2890
2890
|
from: this.id
|
|
2891
|
-
}), this.injectNavigate = () =>
|
|
2891
|
+
}), this.injectNavigate = () => X({ from: this.fullPath });
|
|
2892
2892
|
}
|
|
2893
2893
|
};
|
|
2894
2894
|
function Bn(e) {
|
|
@@ -2919,7 +2919,7 @@ var Wn = class {
|
|
|
2919
2919
|
}
|
|
2920
2920
|
}, Gn = class {
|
|
2921
2921
|
constructor(e) {
|
|
2922
|
-
this.injectMatch = (e) =>
|
|
2922
|
+
this.injectMatch = (e) => Y({
|
|
2923
2923
|
select: e?.select,
|
|
2924
2924
|
from: this.options.id
|
|
2925
2925
|
}), this.injectRouteContext = (e) => Mn({
|
|
@@ -2931,13 +2931,13 @@ var Wn = class {
|
|
|
2931
2931
|
}), this.injectParams = (e) => jn({
|
|
2932
2932
|
select: e?.select,
|
|
2933
2933
|
from: this.options.id
|
|
2934
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2934
|
+
}), this.injectLoaderDeps = (e) => An({
|
|
2935
2935
|
...e,
|
|
2936
2936
|
from: this.options.id
|
|
2937
|
-
}), this.injectLoaderData = (e) =>
|
|
2937
|
+
}), this.injectLoaderData = (e) => kn({
|
|
2938
2938
|
...e,
|
|
2939
2939
|
from: this.options.id
|
|
2940
|
-
}), this.injectNavigate = () =>
|
|
2940
|
+
}), this.injectNavigate = () => X({ from: q().routesById[this.options.id].fullPath }), this.options = e;
|
|
2941
2941
|
}
|
|
2942
2942
|
};
|
|
2943
2943
|
function Kn(e) {
|
|
@@ -2976,7 +2976,7 @@ function Jn(e) {
|
|
|
2976
2976
|
}
|
|
2977
2977
|
function Yn(e) {
|
|
2978
2978
|
let t = e?.component;
|
|
2979
|
-
return !e || !t ? [] : [t, e.key];
|
|
2979
|
+
return !e || !t ? [] : Array.isArray(e.key) ? [t, ...e.key] : [t, e.key];
|
|
2980
2980
|
}
|
|
2981
2981
|
function Xn(e, t) {
|
|
2982
2982
|
if (e.length !== t.length) return !1;
|
|
@@ -3018,24 +3018,23 @@ function $n() {
|
|
|
3018
3018
|
//#endregion
|
|
3019
3019
|
//#region src/injectRouterState.ts
|
|
3020
3020
|
function er(e) {
|
|
3021
|
-
let t =
|
|
3022
|
-
return e?.select ?
|
|
3021
|
+
let t = q({ warn: e?.router === void 0 }), n = e?.router ?? t;
|
|
3022
|
+
return e?.select ? J(n.stores.__store, e.select, { equal: k }) : J(n.stores.__store);
|
|
3023
3023
|
}
|
|
3024
3024
|
//#endregion
|
|
3025
3025
|
//#region src/renderer/injectIsCatchingError.ts
|
|
3026
3026
|
function tr({ matchId: e }) {
|
|
3027
|
-
let t =
|
|
3027
|
+
let t = q(), r = er({ select: (e) => e.matches }), i = n.computed(() => r().findIndex((t) => t.id === e()));
|
|
3028
3028
|
return n.computed(() => {
|
|
3029
|
-
if (t.options.defaultErrorComponent != null) return
|
|
3029
|
+
if (t.options.defaultErrorComponent != null) return;
|
|
3030
3030
|
let e = i();
|
|
3031
|
-
if (e === -1) return
|
|
3031
|
+
if (e === -1) return;
|
|
3032
3032
|
let n = r();
|
|
3033
3033
|
for (let r = e + 1; r < n.length; r++) {
|
|
3034
3034
|
let e = n[r];
|
|
3035
|
-
if (t.routesById[e?.routeId].options.errorComponent != null) return
|
|
3036
|
-
if (e?.status === "error") return
|
|
3035
|
+
if (t.routesById[e?.routeId].options.errorComponent != null) return;
|
|
3036
|
+
if (e?.status === "error") return e;
|
|
3037
3037
|
}
|
|
3038
|
-
return !1;
|
|
3039
3038
|
});
|
|
3040
3039
|
}
|
|
3041
3040
|
//#endregion
|
|
@@ -3043,9 +3042,34 @@ function tr({ matchId: e }) {
|
|
|
3043
3042
|
var nr = {
|
|
3044
3043
|
get: () => void 0,
|
|
3045
3044
|
subscribe: () => ({ unsubscribe: () => {} })
|
|
3045
|
+
}, rr = class e {
|
|
3046
|
+
constructor() {
|
|
3047
|
+
this.state = h(Qn), this.message = p(() => {
|
|
3048
|
+
let e = this.state.error;
|
|
3049
|
+
return e instanceof Error ? e.stack ?? e.message : String(e);
|
|
3050
|
+
});
|
|
3051
|
+
}
|
|
3052
|
+
static {
|
|
3053
|
+
this.ɵfac = function(t) {
|
|
3054
|
+
return new (t || e)();
|
|
3055
|
+
};
|
|
3056
|
+
}
|
|
3057
|
+
static {
|
|
3058
|
+
this.ɵcmp = /* @__PURE__ */ n.ɵɵdefineComponent({
|
|
3059
|
+
type: e,
|
|
3060
|
+
selectors: [["tanstack-router-default-error"]],
|
|
3061
|
+
decls: 5,
|
|
3062
|
+
vars: 1,
|
|
3063
|
+
consts: [["role", "alert"]],
|
|
3064
|
+
template: function(e, t) {
|
|
3065
|
+
e & 1 && (n.ɵɵelementStart(0, "div", 0)(1, "p"), n.ɵɵtext(2, "Something went wrong."), n.ɵɵelementEnd(), n.ɵɵelementStart(3, "pre"), n.ɵɵtext(4), n.ɵɵelementEnd()()), e & 2 && (n.ɵɵadvance(4), n.ɵɵtextInterpolate(t.message()));
|
|
3066
|
+
},
|
|
3067
|
+
encapsulation: 2
|
|
3068
|
+
});
|
|
3069
|
+
}
|
|
3046
3070
|
};
|
|
3047
|
-
function
|
|
3048
|
-
let t =
|
|
3071
|
+
function ir({ parentRouteIsRoot: e }) {
|
|
3072
|
+
let t = q({ warn: !1 }), n = h(o), r = h(i), a = J(t.stores.resolvedLocation, (e) => e?.state?.__TSR_key), s = J(t.stores.loadedAt, (e) => e), c, l = 0;
|
|
3049
3073
|
r.onDestroy(() => {
|
|
3050
3074
|
l++;
|
|
3051
3075
|
}), m(() => {
|
|
@@ -3057,14 +3081,14 @@ function rr({ parentRouteIsRoot: e }) {
|
|
|
3057
3081
|
let n = t.latestLocation.href;
|
|
3058
3082
|
c !== void 0 && c === n || (c = n, t.emit({
|
|
3059
3083
|
type: "onRendered",
|
|
3060
|
-
...
|
|
3084
|
+
...G(t.stores.location.get(), t.stores.resolvedLocation.get())
|
|
3061
3085
|
}));
|
|
3062
3086
|
} }, { injector: n });
|
|
3063
3087
|
});
|
|
3064
3088
|
}
|
|
3065
|
-
var
|
|
3089
|
+
var ar = class e {
|
|
3066
3090
|
constructor() {
|
|
3067
|
-
this.matchId = g.required(), this.router =
|
|
3091
|
+
this.matchId = g.required(), this.router = q(), this.match = p(() => this.matchSignal()), this.matchSignal = J(() => this.router.stores.matchStores.get(this.matchId()) ?? nr, (e) => e), this.matchData = p(() => {
|
|
3068
3092
|
let e = this.match();
|
|
3069
3093
|
if (!e) return null;
|
|
3070
3094
|
let t = e.routeId, n = this.router.routesById[t], r = n.parentRoute?.id ?? null, i = (n.options.remountDeps ?? this.router.options.defaultRemountDeps)?.({
|
|
@@ -3079,60 +3103,66 @@ var ir = class e {
|
|
|
3079
3103
|
match: e,
|
|
3080
3104
|
parentRouteId: r
|
|
3081
3105
|
};
|
|
3082
|
-
}), this.isFistRouteInRouteTree = p(() => this.matchData()?.parentRouteId ===
|
|
3106
|
+
}), this.isFistRouteInRouteTree = p(() => this.matchData()?.parentRouteId === L), this.resolvedNoSsr = p(() => {
|
|
3083
3107
|
let e = this.matchData()?.match;
|
|
3084
3108
|
return e ? e.ssr === !1 || e.ssr === "data-only" : !0;
|
|
3085
3109
|
}), this.shouldClientOnly = p(() => {
|
|
3086
3110
|
let e = this.matchData()?.match;
|
|
3087
3111
|
return e ? this.resolvedNoSsr() || !!e._displayPending : !0;
|
|
3088
|
-
}), this.parentRouteIdSignal = p(() => this.matchData()?.parentRouteId ?? ""), this.rootRouteIdSignal = p(() =>
|
|
3112
|
+
}), this.parentRouteIdSignal = p(() => this.matchData()?.parentRouteId ?? ""), this.rootRouteIdSignal = p(() => L), this.hasPendingMatch = p(() => {
|
|
3089
3113
|
let e = this.matchData()?.route.id;
|
|
3090
3114
|
return e ? !!this.pendingRouteIds()[e] : !1;
|
|
3091
|
-
}), this.pendingRouteIds =
|
|
3115
|
+
}), this.pendingRouteIds = J(this.router.stores.pendingRouteIds, (e) => e), this.nearestMatchContext = {
|
|
3092
3116
|
matchId: this.matchId,
|
|
3093
3117
|
routeId: p(() => this.matchData()?.route.id),
|
|
3094
3118
|
match: this.match,
|
|
3095
3119
|
hasPending: this.hasPendingMatch
|
|
3096
|
-
}, this.
|
|
3120
|
+
}, this.catchingErrorMatch = tr({ matchId: this.matchId }), this.render = Jn(() => {
|
|
3097
3121
|
let e = this.matchData();
|
|
3098
|
-
if (!e
|
|
3122
|
+
if (!e) return null;
|
|
3099
3123
|
let { match: t, route: n } = e;
|
|
3100
|
-
if (
|
|
3101
|
-
|
|
3102
|
-
component:
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3124
|
+
if (this.shouldClientOnly() && this.router.isServer) {
|
|
3125
|
+
let e = Z(n.options.pendingComponent) ?? Z(this.router.options.defaultPendingComponent);
|
|
3126
|
+
return e ? { component: e } : null;
|
|
3127
|
+
}
|
|
3128
|
+
if (t.status === "notFound") return { component: sr(this.router, n) };
|
|
3129
|
+
if (t.status === "error" || this.catchingErrorMatch()) {
|
|
3130
|
+
let e = this.catchingErrorMatch();
|
|
3131
|
+
return {
|
|
3132
|
+
component: cr(this.router, n),
|
|
3133
|
+
providers: [{
|
|
3134
|
+
provide: Qn,
|
|
3135
|
+
useValue: {
|
|
3136
|
+
error: t.status === "error" ? t.error : e?.error,
|
|
3137
|
+
reset: () => {
|
|
3138
|
+
this.router.invalidate();
|
|
3139
|
+
},
|
|
3140
|
+
info: { componentStack: "" }
|
|
3141
|
+
}
|
|
3142
|
+
}]
|
|
3143
|
+
};
|
|
3144
|
+
} else if (t.status === "redirected" || t.status === "pending") {
|
|
3115
3145
|
let t = n.isRoot && (Z(n.options.component) ?? Z(this.router.options.defaultComponent));
|
|
3116
|
-
return t && t !==
|
|
3146
|
+
return t && t !== or ? {
|
|
3117
3147
|
key: e.key,
|
|
3118
3148
|
component: t,
|
|
3119
3149
|
providers: [{
|
|
3120
|
-
provide:
|
|
3150
|
+
provide: K,
|
|
3121
3151
|
useValue: this.nearestMatchContext
|
|
3122
3152
|
}]
|
|
3123
3153
|
} : { component: Z(n.options.pendingComponent) ?? Z(this.router.options.defaultPendingComponent) };
|
|
3124
3154
|
} else {
|
|
3125
|
-
let t = Z(n.options.component) ?? Z(this.router.options.defaultComponent) ??
|
|
3155
|
+
let t = Z(n.options.component) ?? Z(this.router.options.defaultComponent) ?? or;
|
|
3126
3156
|
return {
|
|
3127
3157
|
key: e.key,
|
|
3128
3158
|
component: t,
|
|
3129
3159
|
providers: [{
|
|
3130
|
-
provide:
|
|
3160
|
+
provide: K,
|
|
3131
3161
|
useValue: this.nearestMatchContext
|
|
3132
3162
|
}]
|
|
3133
3163
|
};
|
|
3134
3164
|
}
|
|
3135
|
-
}), this.onRendered =
|
|
3165
|
+
}), this.onRendered = ir({ parentRouteIsRoot: p(() => this.parentRouteIdSignal() === L) });
|
|
3136
3166
|
}
|
|
3137
3167
|
static {
|
|
3138
3168
|
this.ɵfac = function(t) {
|
|
@@ -3159,16 +3189,16 @@ var ir = class e {
|
|
|
3159
3189
|
encapsulation: 2
|
|
3160
3190
|
});
|
|
3161
3191
|
}
|
|
3162
|
-
},
|
|
3192
|
+
}, or = class e {
|
|
3163
3193
|
constructor() {
|
|
3164
|
-
this.router =
|
|
3194
|
+
this.router = q(), this.nearestMatch = h(K), this.currentMatch = J(() => {
|
|
3165
3195
|
let e = this.nearestMatch.matchId();
|
|
3166
3196
|
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 =
|
|
3197
|
+
}, (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 = J(this.router.stores.childMatchIdByRouteId, (e) => e), this.childMatchId = p(() => {
|
|
3168
3198
|
let e = this.routeId();
|
|
3169
3199
|
return e ? this.childMatchIdByRouteId()[e] ?? null : null;
|
|
3170
|
-
}), this.render = Jn(() => this.parentGlobalNotFound() ? { component:
|
|
3171
|
-
component:
|
|
3200
|
+
}), this.render = Jn(() => this.parentGlobalNotFound() ? { component: sr(this.router, this.route()) } : this.childMatchId() ? {
|
|
3201
|
+
component: ar,
|
|
3172
3202
|
inputs: { matchId: () => this.childMatchId() }
|
|
3173
3203
|
} : null);
|
|
3174
3204
|
}
|
|
@@ -3196,40 +3226,43 @@ var ir = class e {
|
|
|
3196
3226
|
function Z(e) {
|
|
3197
3227
|
return typeof e == "function" ? e() : e;
|
|
3198
3228
|
}
|
|
3199
|
-
function
|
|
3229
|
+
function sr(e, t) {
|
|
3200
3230
|
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);
|
|
3201
3231
|
}
|
|
3232
|
+
function cr(e, t) {
|
|
3233
|
+
return (Z(t.options.errorComponent) ?? Z(e.options.defaultErrorComponent)) || (v() && !t.options.errorComponent && console.warn(`An error was encountered on the route with ID "${t.id}", but an errorComponent option was not configured, nor was a router level defaultErrorComponent configured. Consider configuring at least one of these to avoid TanStack Router's generic defaultErrorComponent.`), rr);
|
|
3234
|
+
}
|
|
3202
3235
|
//#endregion
|
|
3203
3236
|
//#region ../router-core/dist/esm/scroll-restoration-script/client.js
|
|
3204
|
-
function
|
|
3237
|
+
function lr(e) {
|
|
3205
3238
|
return null;
|
|
3206
3239
|
}
|
|
3207
3240
|
//#endregion
|
|
3208
3241
|
//#region src/ssr-scroll-restoration.ts
|
|
3209
|
-
var
|
|
3210
|
-
function
|
|
3211
|
-
let e =
|
|
3242
|
+
var ur = "data-tsr-scroll-restoration-inline";
|
|
3243
|
+
function dr() {
|
|
3244
|
+
let e = q(), t = h(C), n = h(o);
|
|
3212
3245
|
e.isServer && d(() => {
|
|
3213
3246
|
let n = e.options.scrollRestoration;
|
|
3214
|
-
if (!n || typeof n == "function" && !n({ location: e.latestLocation }) || t.querySelector(`script[${
|
|
3215
|
-
let r =
|
|
3247
|
+
if (!n || typeof n == "function" && !n({ location: e.latestLocation }) || t.querySelector(`script[${ur}]`)) return;
|
|
3248
|
+
let r = lr(e);
|
|
3216
3249
|
if (!r) return;
|
|
3217
3250
|
let i = t.createElement("script");
|
|
3218
|
-
i.setAttribute(
|
|
3251
|
+
i.setAttribute(ur, ""), i.className = "$tsr", i.text = `${r};document.currentScript.remove()`;
|
|
3219
3252
|
let a = e.options.ssr?.nonce;
|
|
3220
3253
|
a && i.setAttribute("nonce", a), (t.head ?? t.body).appendChild(i);
|
|
3221
3254
|
}, { injector: n });
|
|
3222
3255
|
}
|
|
3223
3256
|
//#endregion
|
|
3224
3257
|
//#region src/transitioner.ts
|
|
3225
|
-
var
|
|
3258
|
+
var fr = {
|
|
3226
3259
|
router: null,
|
|
3227
3260
|
mounted: !1
|
|
3228
3261
|
};
|
|
3229
|
-
function
|
|
3230
|
-
let e =
|
|
3262
|
+
function pr() {
|
|
3263
|
+
let e = q(), t = n.inject(n.EnvironmentInjector);
|
|
3231
3264
|
if (e.isServer) return;
|
|
3232
|
-
let r = n.inject(n.DestroyRef), i = !1, a =
|
|
3265
|
+
let r = n.inject(n.DestroyRef), i = !1, a = J(e.stores.isLoading, (e) => e), o = J(e.stores.isTransitioning, (e) => e), s = J(e.stores.hasPending, (e) => e), c = J(e.stores.status, (e) => e), l = J(e.stores.location, (e) => e), u = J(e.stores.resolvedLocation, (e) => e), d = n.computed(() => a() || o() || s()), f = n.computed(() => a() || s()), p = mr(() => a()), m = mr(() => d()), h = mr(() => f());
|
|
3233
3266
|
e.startTransition = (r) => {
|
|
3234
3267
|
e.stores.isTransitioning.set(!0);
|
|
3235
3268
|
let a = () => {
|
|
@@ -3252,7 +3285,7 @@ function dr() {
|
|
|
3252
3285
|
state: !0,
|
|
3253
3286
|
_includeValidateSearch: !0
|
|
3254
3287
|
});
|
|
3255
|
-
|
|
3288
|
+
F(e.latestLocation.href) !== F(t.href) && e.commitLocation({
|
|
3256
3289
|
...t,
|
|
3257
3290
|
replace: !0
|
|
3258
3291
|
});
|
|
@@ -3263,7 +3296,7 @@ function dr() {
|
|
|
3263
3296
|
}), r.onDestroy(() => {
|
|
3264
3297
|
_.set(!1), i = !0, g && g();
|
|
3265
3298
|
}), n.afterNextRender(() => {
|
|
3266
|
-
typeof window < "u" && e.ssr ||
|
|
3299
|
+
typeof window < "u" && e.ssr || fr.router === e && fr.mounted || (fr = {
|
|
3267
3300
|
router: e,
|
|
3268
3301
|
mounted: !0
|
|
3269
3302
|
}, (async () => {
|
|
@@ -3277,29 +3310,29 @@ function dr() {
|
|
|
3277
3310
|
if (_()) try {
|
|
3278
3311
|
p() && !a() && e.emit({
|
|
3279
3312
|
type: "onLoad",
|
|
3280
|
-
...
|
|
3313
|
+
...G(l(), u())
|
|
3281
3314
|
});
|
|
3282
3315
|
} catch {}
|
|
3283
3316
|
}), n.effect(() => {
|
|
3284
3317
|
if (_()) try {
|
|
3285
3318
|
h() && !f() && e.emit({
|
|
3286
3319
|
type: "onBeforeRouteMount",
|
|
3287
|
-
...
|
|
3320
|
+
...G(l(), u())
|
|
3288
3321
|
});
|
|
3289
3322
|
} catch {}
|
|
3290
3323
|
}), n.effect(() => {
|
|
3291
3324
|
if (_()) try {
|
|
3292
3325
|
if (m() && !d() && c() === "pending" && (e.stores.status.set("idle"), e.stores.resolvedLocation.set(l())), m() && !d()) {
|
|
3293
|
-
let t =
|
|
3326
|
+
let t = G(l(), u());
|
|
3294
3327
|
e.emit({
|
|
3295
3328
|
type: "onResolved",
|
|
3296
3329
|
...t
|
|
3297
|
-
}), t.hrefChanged &&
|
|
3330
|
+
}), t.hrefChanged && vn(e);
|
|
3298
3331
|
}
|
|
3299
3332
|
} catch {}
|
|
3300
3333
|
});
|
|
3301
3334
|
}
|
|
3302
|
-
function
|
|
3335
|
+
function mr(e) {
|
|
3303
3336
|
let t = n.computed(e), r = null;
|
|
3304
3337
|
return n.computed(() => {
|
|
3305
3338
|
let e = r;
|
|
@@ -3308,12 +3341,12 @@ function fr(e) {
|
|
|
3308
3341
|
}
|
|
3309
3342
|
//#endregion
|
|
3310
3343
|
//#region src/Matches.ts
|
|
3311
|
-
var
|
|
3344
|
+
var hr = class e {
|
|
3312
3345
|
constructor() {
|
|
3313
|
-
this.router =
|
|
3346
|
+
this.router = q(), this.matchId = J(this.router.stores.firstId, (e) => e), this.ssrScrollRestoration = dr(), this.transitioner = pr(), this.render = Jn(() => {
|
|
3314
3347
|
let e = this.matchId();
|
|
3315
3348
|
return e ? {
|
|
3316
|
-
component:
|
|
3349
|
+
component: ar,
|
|
3317
3350
|
inputs: { matchId: () => e }
|
|
3318
3351
|
} : null;
|
|
3319
3352
|
});
|
|
@@ -3334,39 +3367,39 @@ var pr = class e {
|
|
|
3334
3367
|
encapsulation: 2
|
|
3335
3368
|
});
|
|
3336
3369
|
}
|
|
3337
|
-
},
|
|
3370
|
+
}, gr = new s("CONTEXT", {
|
|
3338
3371
|
providedIn: "root",
|
|
3339
3372
|
factory: () => ({})
|
|
3340
|
-
}),
|
|
3373
|
+
}), _r = new s("OPTIONS", {
|
|
3341
3374
|
providedIn: "root",
|
|
3342
3375
|
factory: () => ({})
|
|
3343
3376
|
});
|
|
3344
|
-
function
|
|
3377
|
+
function vr(e) {
|
|
3345
3378
|
let t = h(o);
|
|
3346
3379
|
return {
|
|
3347
3380
|
inject: t.get.bind(t),
|
|
3348
3381
|
...e
|
|
3349
3382
|
};
|
|
3350
3383
|
}
|
|
3351
|
-
function
|
|
3384
|
+
function yr({ router: e, context: t, options: n }) {
|
|
3352
3385
|
return [
|
|
3353
3386
|
{
|
|
3354
|
-
provide:
|
|
3387
|
+
provide: Tn(),
|
|
3355
3388
|
useValue: e
|
|
3356
3389
|
},
|
|
3357
3390
|
{
|
|
3358
|
-
provide:
|
|
3359
|
-
useFactory: () =>
|
|
3391
|
+
provide: gr,
|
|
3392
|
+
useFactory: () => vr(t ?? {})
|
|
3360
3393
|
},
|
|
3361
3394
|
{
|
|
3362
|
-
provide:
|
|
3395
|
+
provide: _r,
|
|
3363
3396
|
useValue: n ?? {}
|
|
3364
3397
|
}
|
|
3365
3398
|
];
|
|
3366
3399
|
}
|
|
3367
|
-
var
|
|
3400
|
+
var br = class e {
|
|
3368
3401
|
constructor() {
|
|
3369
|
-
this.injectedContext = h(
|
|
3402
|
+
this.injectedContext = h(gr), this.injectedOptions = h(_r), this.injectedRouter = h(Tn(), { optional: !0 }), this.context = g(this.injectedContext), this.options = g(this.injectedOptions), this.routerInput = g(void 0, { alias: "router" }), this.router = p(() => {
|
|
3370
3403
|
let e = this.routerInput();
|
|
3371
3404
|
if (e) return e;
|
|
3372
3405
|
if (this.injectedRouter) return this.injectedRouter;
|
|
@@ -3384,9 +3417,9 @@ var vr = class e {
|
|
|
3384
3417
|
}), this.render = Jn(() => {
|
|
3385
3418
|
let e = S(this.router);
|
|
3386
3419
|
return {
|
|
3387
|
-
component:
|
|
3420
|
+
component: hr,
|
|
3388
3421
|
providers: [{
|
|
3389
|
-
provide:
|
|
3422
|
+
provide: Tn(),
|
|
3390
3423
|
useValue: e
|
|
3391
3424
|
}]
|
|
3392
3425
|
};
|
|
@@ -3421,21 +3454,21 @@ var vr = class e {
|
|
|
3421
3454
|
encapsulation: 2
|
|
3422
3455
|
});
|
|
3423
3456
|
}
|
|
3424
|
-
}, Q = new n.InjectionToken("TANSTACK_DOCUMENT_ROUTER"),
|
|
3457
|
+
}, Q = new n.InjectionToken("TANSTACK_DOCUMENT_ROUTER"), xr = "data-tsr-managed", Sr = "data-tsr-id";
|
|
3425
3458
|
//#endregion
|
|
3426
3459
|
//#region src/document/managed-dom.ts
|
|
3427
|
-
function
|
|
3460
|
+
function Cr(e) {
|
|
3428
3461
|
if (!e || e.tag === "title" || e.tag === "script" && !e.attrs?.src && typeof e.children != "string") return [];
|
|
3429
3462
|
let t = {
|
|
3430
3463
|
...e,
|
|
3431
|
-
attrs:
|
|
3464
|
+
attrs: wr(e.attrs)
|
|
3432
3465
|
};
|
|
3433
3466
|
return [{
|
|
3434
3467
|
...t,
|
|
3435
|
-
id:
|
|
3468
|
+
id: Er(t)
|
|
3436
3469
|
}];
|
|
3437
3470
|
}
|
|
3438
|
-
function
|
|
3471
|
+
function wr(e) {
|
|
3439
3472
|
if (!e) return {};
|
|
3440
3473
|
let t = {};
|
|
3441
3474
|
for (let n of Object.keys(e).sort()) {
|
|
@@ -3446,27 +3479,27 @@ function Sr(e) {
|
|
|
3446
3479
|
}
|
|
3447
3480
|
return t;
|
|
3448
3481
|
}
|
|
3449
|
-
function
|
|
3482
|
+
function Tr(e) {
|
|
3450
3483
|
let t = /* @__PURE__ */ new Set();
|
|
3451
3484
|
return e.filter((e) => t.has(e.id) ? !1 : (t.add(e.id), !0));
|
|
3452
3485
|
}
|
|
3453
|
-
function
|
|
3486
|
+
function Er(e) {
|
|
3454
3487
|
let t = JSON.stringify(e), n = 2166136261;
|
|
3455
3488
|
for (let e = 0; e < t.length; e++) n ^= t.charCodeAt(e), n = Math.imul(n, 16777619);
|
|
3456
3489
|
return `tsr-${(n >>> 0).toString(36)}`;
|
|
3457
3490
|
}
|
|
3458
|
-
function
|
|
3491
|
+
function Dr({ root: e, bucket: t, renderer: n }) {
|
|
3459
3492
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = [];
|
|
3460
3493
|
return {
|
|
3461
|
-
mount(n =
|
|
3494
|
+
mount(n = Or(e, t)) {
|
|
3462
3495
|
r.clear(), i.clear(), a = [], n.forEach((e) => {
|
|
3463
|
-
let t = e.getAttribute(
|
|
3496
|
+
let t = e.getAttribute(Sr);
|
|
3464
3497
|
t && (r.set(t, e), a.push(t));
|
|
3465
3498
|
});
|
|
3466
3499
|
},
|
|
3467
3500
|
sync(o) {
|
|
3468
3501
|
let s = o.map((e) => e.id);
|
|
3469
|
-
if (
|
|
3502
|
+
if (Fr(a, s)) return;
|
|
3470
3503
|
let c = new Map(o.map((e) => [e.id, {
|
|
3471
3504
|
id: e.id,
|
|
3472
3505
|
tag: e
|
|
@@ -3474,12 +3507,12 @@ function Tr({ root: e, bucket: t, renderer: n }) {
|
|
|
3474
3507
|
for (let t of a) {
|
|
3475
3508
|
if (c.has(t)) continue;
|
|
3476
3509
|
let a = r.get(t);
|
|
3477
|
-
a && (
|
|
3510
|
+
a && (Pr(a, e, n), r.delete(t), i.delete(t));
|
|
3478
3511
|
}
|
|
3479
3512
|
let l = e.firstChild;
|
|
3480
3513
|
for (let a of o) {
|
|
3481
3514
|
let o = r.get(a.id);
|
|
3482
|
-
o || (o =
|
|
3515
|
+
o || (o = kr(a, t, e.ownerDocument, n), r.set(a.id, o)), o !== l && Nr(e, o, l, n), i.set(a.id, {
|
|
3483
3516
|
id: a.id,
|
|
3484
3517
|
tag: a
|
|
3485
3518
|
}), l = o.nextSibling;
|
|
@@ -3493,33 +3526,33 @@ function Tr({ root: e, bucket: t, renderer: n }) {
|
|
|
3493
3526
|
}
|
|
3494
3527
|
};
|
|
3495
3528
|
}
|
|
3496
|
-
function
|
|
3497
|
-
return Array.from(e.querySelectorAll(`[${
|
|
3529
|
+
function Or(e, t) {
|
|
3530
|
+
return Array.from(e.querySelectorAll(`[${xr}="${t}"]`));
|
|
3498
3531
|
}
|
|
3499
|
-
function
|
|
3500
|
-
let i =
|
|
3501
|
-
|
|
3502
|
-
for (let [t, n] of Object.entries(e.attrs ?? {})) t !== "suppressHydrationWarning" && (n == null || n === !1 ||
|
|
3503
|
-
return "children" in e && typeof e.children == "string" &&
|
|
3532
|
+
function kr(e, t, n, r) {
|
|
3533
|
+
let i = Ar(n, e.tag, r);
|
|
3534
|
+
jr(i, xr, t, r), jr(i, Sr, e.id, r);
|
|
3535
|
+
for (let [t, n] of Object.entries(e.attrs ?? {})) t !== "suppressHydrationWarning" && (n == null || n === !1 || jr(i, t === "className" ? "class" : t, typeof n == "boolean" ? "" : String(n), r));
|
|
3536
|
+
return "children" in e && typeof e.children == "string" && Mr(i, e.children, r), i;
|
|
3504
3537
|
}
|
|
3505
|
-
function
|
|
3538
|
+
function Ar(e, t, n) {
|
|
3506
3539
|
return n ? n.createElement(t) : e.createElement(t);
|
|
3507
3540
|
}
|
|
3508
|
-
function
|
|
3541
|
+
function jr(e, t, n, r) {
|
|
3509
3542
|
if (r) {
|
|
3510
3543
|
r.setAttribute(e, t, n);
|
|
3511
3544
|
return;
|
|
3512
3545
|
}
|
|
3513
3546
|
e.setAttribute(t, n);
|
|
3514
3547
|
}
|
|
3515
|
-
function
|
|
3548
|
+
function Mr(e, t, n) {
|
|
3516
3549
|
if (n) {
|
|
3517
3550
|
n.setProperty(e, "textContent", t);
|
|
3518
3551
|
return;
|
|
3519
3552
|
}
|
|
3520
3553
|
e.textContent = t;
|
|
3521
3554
|
}
|
|
3522
|
-
function
|
|
3555
|
+
function Nr(e, t, n, r) {
|
|
3523
3556
|
if (!(t.parentNode === e && t.nextSibling === n)) {
|
|
3524
3557
|
if (r) {
|
|
3525
3558
|
r.insertBefore(e, t, n);
|
|
@@ -3528,51 +3561,51 @@ function jr(e, t, n, r) {
|
|
|
3528
3561
|
e.insertBefore(t, n);
|
|
3529
3562
|
}
|
|
3530
3563
|
}
|
|
3531
|
-
function
|
|
3564
|
+
function Pr(e, t, n) {
|
|
3532
3565
|
if (n) {
|
|
3533
3566
|
n.removeChild(t, e);
|
|
3534
3567
|
return;
|
|
3535
3568
|
}
|
|
3536
3569
|
t.removeChild(e);
|
|
3537
3570
|
}
|
|
3538
|
-
function
|
|
3571
|
+
function Fr(e, t) {
|
|
3539
3572
|
if (e.length !== t.length) return !1;
|
|
3540
3573
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
3541
3574
|
return !0;
|
|
3542
3575
|
}
|
|
3543
3576
|
//#endregion
|
|
3544
3577
|
//#region src/document/document-dehydration.ts
|
|
3545
|
-
function
|
|
3546
|
-
return e.serverSsr ? Cr(
|
|
3578
|
+
function Ir(e) {
|
|
3579
|
+
return e.serverSsr ? Tr(Cr(e.serverSsr.takeBufferedScripts())) : [];
|
|
3547
3580
|
}
|
|
3548
|
-
function
|
|
3581
|
+
function Lr(e, t) {
|
|
3549
3582
|
return t.length === 0 ? e : {
|
|
3550
3583
|
...e,
|
|
3551
|
-
body:
|
|
3584
|
+
body: Tr([...t, ...e.body])
|
|
3552
3585
|
};
|
|
3553
3586
|
}
|
|
3554
3587
|
//#endregion
|
|
3555
3588
|
//#region src/document/build-match-managed-document.ts
|
|
3556
3589
|
function $(e) {
|
|
3557
|
-
let t = e.options.ssr?.nonce, n = e.stores.matches.get(), r =
|
|
3590
|
+
let t = e.options.ssr?.nonce, n = e.stores.matches.get(), r = zr(n), i = Br(n, t), a = Vr(n, t), o = Hr(e, n, t), s = Ur(e, n, t), c = Wr(n, t), l = Gr(n, t), u = Kr(n, t), d = qr(e, n, t);
|
|
3558
3591
|
return {
|
|
3559
3592
|
title: r,
|
|
3560
|
-
head:
|
|
3593
|
+
head: Tr([
|
|
3561
3594
|
...i,
|
|
3562
3595
|
...s,
|
|
3563
3596
|
...a,
|
|
3564
3597
|
...o,
|
|
3565
3598
|
...c,
|
|
3566
3599
|
...l
|
|
3567
|
-
].flatMap((e) =>
|
|
3568
|
-
body:
|
|
3600
|
+
].flatMap((e) => Cr(e))),
|
|
3601
|
+
body: Tr([...u, ...d].flatMap((e) => Cr(e)))
|
|
3569
3602
|
};
|
|
3570
3603
|
}
|
|
3571
|
-
function
|
|
3572
|
-
return
|
|
3604
|
+
function Rr(e) {
|
|
3605
|
+
return Lr($(e), Ir(e));
|
|
3573
3606
|
}
|
|
3574
|
-
function
|
|
3575
|
-
let t =
|
|
3607
|
+
function zr(e) {
|
|
3608
|
+
let t = Jr(e);
|
|
3576
3609
|
for (let e = t.length - 1; e >= 0; e--) {
|
|
3577
3610
|
let n = t[e];
|
|
3578
3611
|
for (let e = n.length - 1; e >= 0; e--) {
|
|
@@ -3581,8 +3614,8 @@ function Lr(e) {
|
|
|
3581
3614
|
}
|
|
3582
3615
|
}
|
|
3583
3616
|
}
|
|
3584
|
-
function
|
|
3585
|
-
let n =
|
|
3617
|
+
function Br(e, t) {
|
|
3618
|
+
let n = Jr(e), r = [], i = {};
|
|
3586
3619
|
for (let e = n.length - 1; e >= 0; e--) {
|
|
3587
3620
|
let a = n[e];
|
|
3588
3621
|
for (let e = a.length - 1; e >= 0; e--) {
|
|
@@ -3597,7 +3630,7 @@ function Rr(e, t) {
|
|
|
3597
3630
|
type: "application/ld+json",
|
|
3598
3631
|
nonce: t
|
|
3599
3632
|
},
|
|
3600
|
-
children:
|
|
3633
|
+
children: he(e)
|
|
3601
3634
|
});
|
|
3602
3635
|
} catch {}
|
|
3603
3636
|
continue;
|
|
@@ -3624,7 +3657,7 @@ function Rr(e, t) {
|
|
|
3624
3657
|
}
|
|
3625
3658
|
}), r.reverse(), r;
|
|
3626
3659
|
}
|
|
3627
|
-
function
|
|
3660
|
+
function Vr(e, t) {
|
|
3628
3661
|
return e.map((e) => e.links).filter(Boolean).flat(1).map((e) => ({
|
|
3629
3662
|
tag: "link",
|
|
3630
3663
|
attrs: {
|
|
@@ -3633,7 +3666,7 @@ function zr(e, t) {
|
|
|
3633
3666
|
}
|
|
3634
3667
|
}));
|
|
3635
3668
|
}
|
|
3636
|
-
function
|
|
3669
|
+
function Hr(e, t, n) {
|
|
3637
3670
|
return t.map((t) => e.ssr?.manifest?.routes[t.routeId]?.assets ?? []).filter(Boolean).flat(1).filter((e) => e.tag === "link").map((e) => ({
|
|
3638
3671
|
tag: "link",
|
|
3639
3672
|
attrs: {
|
|
@@ -3643,7 +3676,7 @@ function Br(e, t, n) {
|
|
|
3643
3676
|
}
|
|
3644
3677
|
}));
|
|
3645
3678
|
}
|
|
3646
|
-
function
|
|
3679
|
+
function Ur(e, t, n) {
|
|
3647
3680
|
let r = [];
|
|
3648
3681
|
return t.map((t) => e.looseRoutesById[t.routeId]).forEach((t) => e.ssr?.manifest?.routes[t.id]?.preloads?.filter(Boolean).forEach((e) => {
|
|
3649
3682
|
r.push({
|
|
@@ -3656,7 +3689,7 @@ function Vr(e, t, n) {
|
|
|
3656
3689
|
});
|
|
3657
3690
|
})), r;
|
|
3658
3691
|
}
|
|
3659
|
-
function
|
|
3692
|
+
function Wr(e, t) {
|
|
3660
3693
|
return e.map((e) => e.styles).flat(1).filter(Boolean).map(({ children: e, ...n }) => ({
|
|
3661
3694
|
tag: "style",
|
|
3662
3695
|
attrs: {
|
|
@@ -3666,7 +3699,7 @@ function Hr(e, t) {
|
|
|
3666
3699
|
children: typeof e == "string" ? e : void 0
|
|
3667
3700
|
}));
|
|
3668
3701
|
}
|
|
3669
|
-
function
|
|
3702
|
+
function Gr(e, t) {
|
|
3670
3703
|
return e.map((e) => e.headScripts).flat(1).filter(Boolean).map(({ children: e, ...n }) => ({
|
|
3671
3704
|
tag: "script",
|
|
3672
3705
|
attrs: {
|
|
@@ -3676,7 +3709,7 @@ function Ur(e, t) {
|
|
|
3676
3709
|
children: typeof e == "string" ? e : void 0
|
|
3677
3710
|
}));
|
|
3678
3711
|
}
|
|
3679
|
-
function
|
|
3712
|
+
function Kr(e, t) {
|
|
3680
3713
|
return e.map((e) => e.scripts).flat(1).filter(Boolean).map(({ children: e, ...n }) => ({
|
|
3681
3714
|
tag: "script",
|
|
3682
3715
|
attrs: {
|
|
@@ -3687,7 +3720,7 @@ function Wr(e, t) {
|
|
|
3687
3720
|
children: typeof e == "string" ? e : void 0
|
|
3688
3721
|
}));
|
|
3689
3722
|
}
|
|
3690
|
-
function
|
|
3723
|
+
function qr(e, t, n) {
|
|
3691
3724
|
return t.map((t) => e.looseRoutesById[t.routeId]).flatMap((t) => e.ssr?.manifest?.routes[t.id]?.assets?.filter((e) => e.tag === "script").map((e) => ({
|
|
3692
3725
|
tag: "script",
|
|
3693
3726
|
attrs: {
|
|
@@ -3697,37 +3730,37 @@ function Gr(e, t, n) {
|
|
|
3697
3730
|
children: e.children
|
|
3698
3731
|
})) ?? []);
|
|
3699
3732
|
}
|
|
3700
|
-
function
|
|
3733
|
+
function Jr(e) {
|
|
3701
3734
|
return e.reduce((e, t) => (t.meta && e.push(t.meta), e), []);
|
|
3702
3735
|
}
|
|
3703
3736
|
//#endregion
|
|
3704
3737
|
//#region src/document/document-equality.ts
|
|
3705
|
-
function
|
|
3706
|
-
return e.title === t.title &&
|
|
3738
|
+
function Yr(e, t) {
|
|
3739
|
+
return e.title === t.title && Xr(e.head, t.head) && Xr(e.body, t.body);
|
|
3707
3740
|
}
|
|
3708
|
-
function
|
|
3741
|
+
function Xr(e, t) {
|
|
3709
3742
|
if (e.length !== t.length) return !1;
|
|
3710
3743
|
for (let n = 0; n < e.length; n++) if (e[n]?.id !== t[n]?.id) return !1;
|
|
3711
3744
|
return !0;
|
|
3712
3745
|
}
|
|
3713
3746
|
//#endregion
|
|
3714
3747
|
//#region src/document/install-unified-document-sync.ts
|
|
3715
|
-
function
|
|
3748
|
+
function Zr({ document: e, initialTitle: t, headCollection: n, bodyCollection: r, nextContent: i }) {
|
|
3716
3749
|
i.title === void 0 ? e.title = t : e.title = i.title, n.sync(i.head), r.sync(i.body);
|
|
3717
3750
|
}
|
|
3718
|
-
function
|
|
3719
|
-
let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a =
|
|
3751
|
+
function Qr(e) {
|
|
3752
|
+
let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = J(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = t.title, c = Dr({
|
|
3720
3753
|
root: t.head,
|
|
3721
3754
|
bucket: "head",
|
|
3722
3755
|
renderer: o
|
|
3723
|
-
}), l =
|
|
3756
|
+
}), l = Dr({
|
|
3724
3757
|
root: t.body,
|
|
3725
3758
|
bucket: "body",
|
|
3726
3759
|
renderer: o
|
|
3727
|
-
}), u =
|
|
3760
|
+
}), u = Ir(e), d = () => Lr($(e), u);
|
|
3728
3761
|
c.mount(), l.mount();
|
|
3729
3762
|
let f = d();
|
|
3730
|
-
|
|
3763
|
+
Zr({
|
|
3731
3764
|
document: t,
|
|
3732
3765
|
initialTitle: s,
|
|
3733
3766
|
headCollection: c,
|
|
@@ -3737,7 +3770,7 @@ function Xr(e) {
|
|
|
3737
3770
|
let p = n.effect(() => {
|
|
3738
3771
|
a();
|
|
3739
3772
|
let e = d();
|
|
3740
|
-
|
|
3773
|
+
Yr(f, e) || (f = e, Zr({
|
|
3741
3774
|
document: t,
|
|
3742
3775
|
initialTitle: s,
|
|
3743
3776
|
headCollection: c,
|
|
@@ -3751,8 +3784,8 @@ function Xr(e) {
|
|
|
3751
3784
|
}
|
|
3752
3785
|
//#endregion
|
|
3753
3786
|
//#region src/document/provide-tanstack-body-managed-tags.ts
|
|
3754
|
-
function
|
|
3755
|
-
let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a =
|
|
3787
|
+
function $r(e) {
|
|
3788
|
+
let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = J(e.stores.matches, (e) => e), o = Ir(e), s = () => o.length === 0 ? $(e).body : Tr([...o, ...$(e).body]), c = r?.createRenderer(null, null) ?? null, l = Dr({
|
|
3756
3789
|
root: t.body,
|
|
3757
3790
|
bucket: "body",
|
|
3758
3791
|
renderer: c
|
|
@@ -3763,25 +3796,25 @@ function Zr(e) {
|
|
|
3763
3796
|
let d = n.effect(() => {
|
|
3764
3797
|
a();
|
|
3765
3798
|
let e = s();
|
|
3766
|
-
|
|
3799
|
+
Xr(u, e) || (u = e, l.sync(e));
|
|
3767
3800
|
});
|
|
3768
3801
|
i.onDestroy(() => {
|
|
3769
3802
|
d.destroy(), l.destroy();
|
|
3770
3803
|
});
|
|
3771
3804
|
}
|
|
3772
|
-
function
|
|
3773
|
-
|
|
3805
|
+
function ei() {
|
|
3806
|
+
$r(n.inject(Q));
|
|
3774
3807
|
}
|
|
3775
|
-
function
|
|
3808
|
+
function ti(e) {
|
|
3776
3809
|
return n.makeEnvironmentProviders([{
|
|
3777
3810
|
provide: Q,
|
|
3778
3811
|
useValue: e
|
|
3779
|
-
}, n.provideEnvironmentInitializer(
|
|
3812
|
+
}, n.provideEnvironmentInitializer(ei)]);
|
|
3780
3813
|
}
|
|
3781
3814
|
//#endregion
|
|
3782
3815
|
//#region src/document/provide-tanstack-document-title.ts
|
|
3783
|
-
function
|
|
3784
|
-
let t = n.inject(C), r = n.inject(n.DestroyRef), i =
|
|
3816
|
+
function ni(e) {
|
|
3817
|
+
let t = n.inject(C), r = n.inject(n.DestroyRef), i = J(e.stores.matches, (e) => e), a = t.title, o = $(e).title, s = (e) => {
|
|
3785
3818
|
e === void 0 ? t.title = a : t.title = e;
|
|
3786
3819
|
};
|
|
3787
3820
|
s(o);
|
|
@@ -3794,19 +3827,19 @@ function ei(e) {
|
|
|
3794
3827
|
c.destroy(), t.title = a;
|
|
3795
3828
|
});
|
|
3796
3829
|
}
|
|
3797
|
-
function
|
|
3798
|
-
|
|
3830
|
+
function ri() {
|
|
3831
|
+
ni(n.inject(Q));
|
|
3799
3832
|
}
|
|
3800
|
-
function
|
|
3833
|
+
function ii(e) {
|
|
3801
3834
|
return n.makeEnvironmentProviders([{
|
|
3802
3835
|
provide: Q,
|
|
3803
3836
|
useValue: e
|
|
3804
|
-
}, n.provideEnvironmentInitializer(
|
|
3837
|
+
}, n.provideEnvironmentInitializer(ri)]);
|
|
3805
3838
|
}
|
|
3806
3839
|
//#endregion
|
|
3807
3840
|
//#region src/document/provide-tanstack-head-managed-tags.ts
|
|
3808
|
-
function
|
|
3809
|
-
let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a =
|
|
3841
|
+
function ai(e) {
|
|
3842
|
+
let t = n.inject(C), r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = J(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = Dr({
|
|
3810
3843
|
root: t.head,
|
|
3811
3844
|
bucket: "head",
|
|
3812
3845
|
renderer: o
|
|
@@ -3817,31 +3850,31 @@ function ri(e) {
|
|
|
3817
3850
|
let l = n.effect(() => {
|
|
3818
3851
|
a();
|
|
3819
3852
|
let t = $(e).head;
|
|
3820
|
-
|
|
3853
|
+
Xr(c, t) || (c = t, s.sync(t));
|
|
3821
3854
|
});
|
|
3822
3855
|
i.onDestroy(() => {
|
|
3823
3856
|
l.destroy(), s.destroy();
|
|
3824
3857
|
});
|
|
3825
3858
|
}
|
|
3826
|
-
function
|
|
3827
|
-
|
|
3859
|
+
function oi() {
|
|
3860
|
+
ai(n.inject(Q));
|
|
3828
3861
|
}
|
|
3829
|
-
function
|
|
3862
|
+
function si(e) {
|
|
3830
3863
|
return n.makeEnvironmentProviders([{
|
|
3831
3864
|
provide: Q,
|
|
3832
3865
|
useValue: e
|
|
3833
|
-
}, n.provideEnvironmentInitializer(
|
|
3866
|
+
}, n.provideEnvironmentInitializer(oi)]);
|
|
3834
3867
|
}
|
|
3835
3868
|
//#endregion
|
|
3836
3869
|
//#region src/document/provide-tanstack-document.ts
|
|
3837
|
-
var
|
|
3870
|
+
var ci = {
|
|
3838
3871
|
title: !0,
|
|
3839
3872
|
headTags: !0,
|
|
3840
3873
|
bodyScripts: !0
|
|
3841
3874
|
};
|
|
3842
|
-
function
|
|
3875
|
+
function li(e, t = {}) {
|
|
3843
3876
|
let r = {
|
|
3844
|
-
...
|
|
3877
|
+
...ci,
|
|
3845
3878
|
...t
|
|
3846
3879
|
}, i = r.title && r.headTags && r.bodyScripts;
|
|
3847
3880
|
return n.makeEnvironmentProviders([{
|
|
@@ -3849,41 +3882,41 @@ function si(e, t = {}) {
|
|
|
3849
3882
|
useValue: e
|
|
3850
3883
|
}, n.provideEnvironmentInitializer(() => {
|
|
3851
3884
|
if (i) {
|
|
3852
|
-
|
|
3885
|
+
Qr(e);
|
|
3853
3886
|
return;
|
|
3854
3887
|
}
|
|
3855
|
-
r.title &&
|
|
3888
|
+
r.title && ni(e), r.headTags && ai(e), r.bodyScripts && $r(e);
|
|
3856
3889
|
})]);
|
|
3857
3890
|
}
|
|
3858
|
-
function
|
|
3859
|
-
return
|
|
3891
|
+
function ui(e) {
|
|
3892
|
+
return li(e);
|
|
3860
3893
|
}
|
|
3861
3894
|
//#endregion
|
|
3862
3895
|
//#region src/injectMatches.ts
|
|
3863
|
-
function
|
|
3864
|
-
return
|
|
3896
|
+
function di(e) {
|
|
3897
|
+
return J(q().stores.matches, (t) => {
|
|
3865
3898
|
let n = t;
|
|
3866
3899
|
return e?.select ? e.select(n) : n;
|
|
3867
3900
|
}, { equal: k });
|
|
3868
3901
|
}
|
|
3869
|
-
function
|
|
3870
|
-
let t = n.inject(
|
|
3871
|
-
return
|
|
3902
|
+
function fi(e) {
|
|
3903
|
+
let t = n.inject(K);
|
|
3904
|
+
return di({ select: (n) => {
|
|
3872
3905
|
let r = n.slice(0, n.findIndex((e) => e.id === t.matchId()));
|
|
3873
3906
|
return e?.select ? e.select(r) : r;
|
|
3874
3907
|
} });
|
|
3875
3908
|
}
|
|
3876
|
-
function
|
|
3877
|
-
let t = n.inject(
|
|
3878
|
-
return
|
|
3909
|
+
function pi(e) {
|
|
3910
|
+
let t = n.inject(K);
|
|
3911
|
+
return di({ select: (n) => {
|
|
3879
3912
|
let r = n.slice(n.findIndex((e) => e.id === t.matchId()) + 1);
|
|
3880
3913
|
return e?.select ? e.select(r) : r;
|
|
3881
3914
|
} });
|
|
3882
3915
|
}
|
|
3883
3916
|
//#endregion
|
|
3884
3917
|
//#region src/injectMatchRoute.ts
|
|
3885
|
-
function
|
|
3886
|
-
let e =
|
|
3918
|
+
function mi() {
|
|
3919
|
+
let e = q(), t = J(e.stores.matchRouteDeps, (e) => e);
|
|
3887
3920
|
return (r) => n.computed(() => {
|
|
3888
3921
|
let { pending: n, caseSensitive: i, fuzzy: a, includeSearch: o, ...s } = r;
|
|
3889
3922
|
return t(), e.matchRoute(s, {
|
|
@@ -3895,15 +3928,21 @@ function fi() {
|
|
|
3895
3928
|
});
|
|
3896
3929
|
}
|
|
3897
3930
|
//#endregion
|
|
3931
|
+
//#region src/injectIsShell.ts
|
|
3932
|
+
function hi() {
|
|
3933
|
+
let e = q();
|
|
3934
|
+
return p(() => e.isShell());
|
|
3935
|
+
}
|
|
3936
|
+
//#endregion
|
|
3898
3937
|
//#region src/injectLocation.ts
|
|
3899
|
-
function
|
|
3900
|
-
let t =
|
|
3901
|
-
return e?.select ?
|
|
3938
|
+
function gi(e) {
|
|
3939
|
+
let t = q();
|
|
3940
|
+
return e?.select ? J(t.stores.location, e.select, { equal: k }) : J(t.stores.location);
|
|
3902
3941
|
}
|
|
3903
3942
|
//#endregion
|
|
3904
3943
|
//#region src/injectBlocker.ts
|
|
3905
|
-
function
|
|
3906
|
-
let { shouldBlockFn: t, enableBeforeUnload: r = !0, disabled: i = !1, withResolver: a = !1 } = e, o =
|
|
3944
|
+
function _i(e) {
|
|
3945
|
+
let { shouldBlockFn: t, enableBeforeUnload: r = !0, disabled: i = !1, withResolver: a = !1 } = e, o = q(), { history: s } = o, c = n.signal({
|
|
3907
3946
|
status: "idle",
|
|
3908
3947
|
current: void 0,
|
|
3909
3948
|
next: void 0,
|
|
@@ -3965,12 +4004,12 @@ function mi(e) {
|
|
|
3965
4004
|
}
|
|
3966
4005
|
//#endregion
|
|
3967
4006
|
//#region src/injectCanGoBack.ts
|
|
3968
|
-
function
|
|
3969
|
-
return
|
|
4007
|
+
function vi() {
|
|
4008
|
+
return J(q().stores.location, (e) => (e.state?.__TSR_index ?? 0) !== 0);
|
|
3970
4009
|
}
|
|
3971
4010
|
//#endregion
|
|
3972
4011
|
//#region src/injectIntersectionObserver.ts
|
|
3973
|
-
function
|
|
4012
|
+
function yi(e, t, r) {
|
|
3974
4013
|
let i = n.inject(n.ElementRef);
|
|
3975
4014
|
n.afterRenderEffect((n) => {
|
|
3976
4015
|
let a = typeof IntersectionObserver == "function", o = i.nativeElement;
|
|
@@ -3983,9 +4022,9 @@ function gi(e, t, r) {
|
|
|
3983
4022
|
}
|
|
3984
4023
|
//#endregion
|
|
3985
4024
|
//#region src/Link.ts
|
|
3986
|
-
var
|
|
4025
|
+
var bi = class e {
|
|
3987
4026
|
constructor() {
|
|
3988
|
-
this.passiveEvents =
|
|
4027
|
+
this.passiveEvents = Si(() => ({ touchstart: this.handleTouchStart })), this.options = g.required({ alias: "link" }), this.router = q(), 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(() => ({
|
|
3989
4028
|
...this.options(),
|
|
3990
4029
|
from: this.from()
|
|
3991
4030
|
})), this.nextLocation = p(() => {
|
|
@@ -4007,16 +4046,16 @@ var _i = class e {
|
|
|
4007
4046
|
try {
|
|
4008
4047
|
return new URL(this.options().to), this.options().to;
|
|
4009
4048
|
} catch {}
|
|
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 =
|
|
4049
|
+
}), 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 = gi(), this.isActiveProps = p(() => {
|
|
4011
4050
|
let e = this.options(), t = this.isActive() ? e.activeProps : e.inactiveProps;
|
|
4012
4051
|
if (!(!t || typeof t != "object")) return t;
|
|
4013
4052
|
}), this.isActive = p(() => {
|
|
4014
4053
|
if (this.externalLink()) return !1;
|
|
4015
4054
|
let e = this.options().activeOptions;
|
|
4016
4055
|
if (e?.exact) {
|
|
4017
|
-
if (!
|
|
4056
|
+
if (!qe(this.location().pathname, this.nextLocation().pathname, this.router.basepath)) return !1;
|
|
4018
4057
|
} else {
|
|
4019
|
-
let e =
|
|
4058
|
+
let e = Ke(this.location().pathname, this.router.basepath), t = Ke(this.nextLocation().pathname, this.router.basepath);
|
|
4020
4059
|
if (!(e.startsWith(t) && (e.length === t.length || e[t.length] === "/"))) return !1;
|
|
4021
4060
|
}
|
|
4022
4061
|
return (e?.includeSearch ?? !0) && !k(this.location().search, this.nextLocation().search, {
|
|
@@ -4025,15 +4064,15 @@ var _i = class e {
|
|
|
4025
4064
|
}) ? !1 : e?.includeHash ? this.location().hash === this.nextLocation().hash : !0;
|
|
4026
4065
|
}), this.doPreload = () => {
|
|
4027
4066
|
this.router.preloadRoute(this.options()).catch((e) => {
|
|
4028
|
-
console.warn(e), console.warn(
|
|
4067
|
+
console.warn(e), console.warn(fn);
|
|
4029
4068
|
});
|
|
4030
4069
|
}, this.preloadViewportIoCallback = (e) => {
|
|
4031
4070
|
e?.isIntersecting && this.doPreload();
|
|
4032
|
-
}, this.viewportPreloader =
|
|
4071
|
+
}, this.viewportPreloader = yi(this.preloadViewportIoCallback, { rootMargin: "100px" }, () => !!this._options().disabled || this.preload() !== "viewport"), this.hasRenderFetched = !1, this.rendererPreloader = m(() => {
|
|
4033
4072
|
this.hasRenderFetched || !this._options().disabled && this.preload() === "render" && (this.doPreload(), this.hasRenderFetched = !0);
|
|
4034
4073
|
}), this.handleClick = (e) => {
|
|
4035
4074
|
let t = e.currentTarget.getAttribute("target"), n = this._options().target, r = n === void 0 ? t : n;
|
|
4036
|
-
if (!this._options().disabled && !
|
|
4075
|
+
if (!this._options().disabled && !xi(e) && !e.defaultPrevented && (!r || r === "_self") && e.button === 0) {
|
|
4037
4076
|
e.preventDefault(), this.isTransitioning.set(!0);
|
|
4038
4077
|
let t = this.router.subscribe("onResolved", () => {
|
|
4039
4078
|
t(), this.isTransitioning.set(!1);
|
|
@@ -4098,10 +4137,10 @@ var _i = class e {
|
|
|
4098
4137
|
});
|
|
4099
4138
|
}
|
|
4100
4139
|
};
|
|
4101
|
-
function
|
|
4140
|
+
function xi(e) {
|
|
4102
4141
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
4103
4142
|
}
|
|
4104
|
-
function
|
|
4143
|
+
function Si(e) {
|
|
4105
4144
|
let t = h(a).nativeElement, n = h(i), r = h(l), o = [];
|
|
4106
4145
|
d(() => {
|
|
4107
4146
|
for (let [n, i] of Object.entries(e())) {
|
|
@@ -4113,4 +4152,4 @@ function yi(e) {
|
|
|
4113
4152
|
});
|
|
4114
4153
|
}
|
|
4115
4154
|
//#endregion
|
|
4116
|
-
export { Gn as LazyRoute,
|
|
4155
|
+
export { Gn as LazyRoute, bi as Link, hr as Matches, Vn as NotFoundRoute, or as Outlet, zn as RootRoute, In as Route, Fn as RouteApi, ar as RouteMatch, Sn as Router, br as RouterProvider, Rr as buildManagedDocumentContent, $ as buildMatchManagedDocumentContent, qt as createBrowserHistory, Un as createFileRoute, Jt as createHashHistory, Gt as createHistory, qn as createLazyFileRoute, Kn as createLazyRoute, Yt as createMemoryHistory, Hn as createRootRoute, Rn as createRootRouteWithContext, Ln as createRoute, Bn as createRouteMask, xn as createRouter, gn as createRouterConfig, Pn as getRouteApi, _i as injectBlocker, vi as injectCanGoBack, pi as injectChildMatches, $n as injectErrorState, hi as injectIsShell, kn as injectLoaderData, An as injectLoaderDeps, gi as injectLocation, Y as injectMatch, mi as injectMatchRoute, di as injectMatches, X as injectNavigate, jn as injectParams, fi as injectParentMatches, Mn as injectRouteContext, q as injectRouter, er as injectRouterState, Nn as injectSearch, dr as injectSsrScrollRestorationScript, J as injectStore, R as isRedirect, rn as lazyFn, $e as notFound, ui as provideHeadContent, ti as provideTanstackBodyManagedTags, li as provideTanstackDocument, ii as provideTanstackDocumentTitle, si as provideTanstackHeadManagedTags, yr as provideTanstackRouter, _t as redirect, _n as retainSearchParams };
|