@jasonshimmy/custom-elements-runtime 3.2.1 → 3.3.0
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as y, t as
|
|
2
|
-
import { J as nt, R as
|
|
3
|
-
import { n as
|
|
4
|
-
import { match as
|
|
5
|
-
import { createStore as
|
|
6
|
-
var
|
|
1
|
+
import { r as y, t as k } from "./logger-L25axmB-.js";
|
|
2
|
+
import { J as nt, R as L, V as et, _ as St, h as st, i as it, m as ct, y as Rt } from "./hooks-_3xP4G2N.js";
|
|
3
|
+
import { n as lt, t as U } from "./template-compiler-Cs5axmn4.js";
|
|
4
|
+
import { match as Et } from "./custom-elements-runtime.directives.es.js";
|
|
5
|
+
import { createStore as ut } from "./custom-elements-runtime.store.es.js";
|
|
6
|
+
var ft = {
|
|
7
7
|
enabled: !0,
|
|
8
8
|
offset: 0,
|
|
9
9
|
timeoutMs: 2e3
|
|
@@ -14,32 +14,32 @@ var ut = {
|
|
|
14
14
|
} catch {
|
|
15
15
|
return "";
|
|
16
16
|
}
|
|
17
|
-
},
|
|
17
|
+
}, ht = (t) => t ? /^\s*javascript\s*:/i.test(t) : !1, K = (t) => /^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t) || t.startsWith("//"), Ct = (t) => {
|
|
18
18
|
try {
|
|
19
19
|
return decodeURIComponent(t);
|
|
20
20
|
} catch {
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function C(t) {
|
|
25
25
|
if (!t) return "/";
|
|
26
26
|
let r = t.replace(/\/+/g, "/");
|
|
27
27
|
return r.startsWith("/") || (r = "/" + r), r.length > 1 && r.endsWith("/") && (r = r.slice(0, -1)), r;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
29
|
+
var xt = (t) => {
|
|
30
30
|
if (!t) return "";
|
|
31
|
-
const r =
|
|
31
|
+
const r = C(t);
|
|
32
32
|
return r === "/" ? "" : r;
|
|
33
|
-
},
|
|
34
|
-
function
|
|
33
|
+
}, pt = /* @__PURE__ */ new WeakMap();
|
|
34
|
+
function At(t) {
|
|
35
35
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const r =
|
|
39
|
-
for (let m = 0; m <
|
|
40
|
-
const g =
|
|
37
|
+
function kt(t) {
|
|
38
|
+
const r = C(t.path || "/"), h = r === "/" ? [] : r.split("/").filter(Boolean), a = [], i = [];
|
|
39
|
+
for (let m = 0; m < h.length; m++) {
|
|
40
|
+
const g = h[m];
|
|
41
41
|
if (g === "*") {
|
|
42
|
-
if (m !==
|
|
42
|
+
if (m !== h.length - 1)
|
|
43
43
|
return y(`Route '${t.path}' contains a '*' splat in a non-terminal position; splats must be the last segment. This route will be ignored.`), { invalid: !0 };
|
|
44
44
|
const c = `splat${a.length}`;
|
|
45
45
|
a.push(c), i.push("__SPLAT__");
|
|
@@ -47,13 +47,13 @@ function At(t) {
|
|
|
47
47
|
}
|
|
48
48
|
const v = g.match(/^:([A-Za-z0-9_-]+)(\*)?$/);
|
|
49
49
|
if (v) {
|
|
50
|
-
const c = v[1],
|
|
51
|
-
if (
|
|
50
|
+
const c = v[1], R = !!v[2];
|
|
51
|
+
if (R && m !== h.length - 1)
|
|
52
52
|
return y(`Route '${t.path}' contains a splat param ':${c}*' in a non-terminal position; splats must be the last segment. This route will be ignored.`), { invalid: !0 };
|
|
53
|
-
a.push(c), i.push(
|
|
53
|
+
a.push(c), i.push(R ? "__SPLAT__" : "([^/]+)");
|
|
54
54
|
continue;
|
|
55
55
|
}
|
|
56
|
-
i.push(
|
|
56
|
+
i.push(At(g));
|
|
57
57
|
}
|
|
58
58
|
let o;
|
|
59
59
|
if (i.length === 0) o = "^/$";
|
|
@@ -71,16 +71,16 @@ function At(t) {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
var Q = (t, r) => {
|
|
74
|
-
const
|
|
74
|
+
const h = C(r);
|
|
75
75
|
for (const a of t) {
|
|
76
|
-
let i =
|
|
77
|
-
if (i || (i =
|
|
78
|
-
const { regex: o, paramNames: m } = i, g = o.exec(
|
|
76
|
+
let i = pt.get(a);
|
|
77
|
+
if (i || (i = kt(a), pt.set(a, i)), i.invalid) continue;
|
|
78
|
+
const { regex: o, paramNames: m } = i, g = o.exec(h);
|
|
79
79
|
if (g) {
|
|
80
80
|
const v = {};
|
|
81
81
|
for (let c = 0; c < m.length; c++) {
|
|
82
|
-
const
|
|
83
|
-
v[m[c]] =
|
|
82
|
+
const R = g[c + 1] || "";
|
|
83
|
+
v[m[c]] = R ? Ct(R) : "";
|
|
84
84
|
}
|
|
85
85
|
return {
|
|
86
86
|
route: a,
|
|
@@ -94,34 +94,34 @@ var Q = (t, r) => {
|
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
function rt(t, r) {
|
|
97
|
-
for (const
|
|
97
|
+
for (const h of t) if (Q([h], r).route !== null) return h;
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
100
100
|
function Ft(t, r) {
|
|
101
|
-
const
|
|
102
|
-
return Q(t,
|
|
101
|
+
const h = r.split("?")[0].split("#")[0];
|
|
102
|
+
return Q(t, h);
|
|
103
103
|
}
|
|
104
|
-
var
|
|
105
|
-
function
|
|
104
|
+
var dt = 50, J = {}, B = {};
|
|
105
|
+
function Pt() {
|
|
106
106
|
J = {}, B = {};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function _t() {
|
|
109
109
|
const t = Object.entries(J);
|
|
110
|
-
if (t.length <=
|
|
111
|
-
const r = t.sort(([,
|
|
112
|
-
for (const [
|
|
110
|
+
if (t.length <= dt) return;
|
|
111
|
+
const r = t.sort(([, h], [, a]) => h.lastAccessed - a.lastAccessed).slice(0, t.length - dt);
|
|
112
|
+
for (const [h] of r) delete J[h];
|
|
113
113
|
}
|
|
114
|
-
async function
|
|
114
|
+
async function gt(t) {
|
|
115
115
|
if (t.component) return t.component;
|
|
116
116
|
if (t.load) {
|
|
117
117
|
const r = J[t.path];
|
|
118
118
|
if (r)
|
|
119
119
|
return r.lastAccessed = Date.now(), r.component;
|
|
120
120
|
if (B[t.path] !== void 0) return B[t.path];
|
|
121
|
-
const
|
|
121
|
+
const h = typeof window > "u";
|
|
122
122
|
try {
|
|
123
123
|
const a = t.load().then((i) => {
|
|
124
|
-
|
|
124
|
+
_t();
|
|
125
125
|
const o = i.default;
|
|
126
126
|
return J[t.path] = {
|
|
127
127
|
component: o,
|
|
@@ -130,7 +130,7 @@ async function _t(t) {
|
|
|
130
130
|
}).catch((i) => {
|
|
131
131
|
delete B[t.path];
|
|
132
132
|
const o = i instanceof Error ? i.message : String(i);
|
|
133
|
-
throw
|
|
133
|
+
throw h && k(`SSR component load failed for route: ${t.path}. ${o}`), new Error(`Failed to load component for route: ${t.path}. ${o}`);
|
|
134
134
|
});
|
|
135
135
|
return B[t.path] = a, await a;
|
|
136
136
|
} catch (a) {
|
|
@@ -144,41 +144,41 @@ var d = null;
|
|
|
144
144
|
function qt(t) {
|
|
145
145
|
d = t;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function yt() {
|
|
148
148
|
return d;
|
|
149
149
|
}
|
|
150
|
-
var
|
|
151
|
-
function
|
|
152
|
-
if (
|
|
150
|
+
var V = /* @__PURE__ */ new Set(), D = null;
|
|
151
|
+
function bt() {
|
|
152
|
+
if (D) {
|
|
153
153
|
try {
|
|
154
|
-
|
|
154
|
+
D();
|
|
155
155
|
} catch {
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
D = null;
|
|
158
158
|
}
|
|
159
159
|
if (d) try {
|
|
160
160
|
let t = !1;
|
|
161
|
-
|
|
161
|
+
D = d.subscribe((r) => {
|
|
162
162
|
t = !0;
|
|
163
|
-
for (const
|
|
164
|
-
|
|
163
|
+
for (const h of V) try {
|
|
164
|
+
h(r);
|
|
165
165
|
} catch {
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
try {
|
|
169
|
-
|
|
169
|
+
x.base = d.base;
|
|
170
170
|
} catch {
|
|
171
171
|
}
|
|
172
172
|
if (t) {
|
|
173
173
|
const r = d.getCurrent();
|
|
174
|
-
for (const
|
|
175
|
-
|
|
174
|
+
for (const h of V) try {
|
|
175
|
+
h(r);
|
|
176
176
|
} catch {
|
|
177
177
|
}
|
|
178
178
|
} else {
|
|
179
179
|
const r = d.getCurrent();
|
|
180
|
-
for (const
|
|
181
|
-
|
|
180
|
+
for (const h of V) try {
|
|
181
|
+
h(r);
|
|
182
182
|
} catch {
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -187,13 +187,13 @@ function vt() {
|
|
|
187
187
|
} catch {
|
|
188
188
|
}
|
|
189
189
|
} catch {
|
|
190
|
-
|
|
190
|
+
D = null;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
function Tt() {
|
|
194
|
-
|
|
194
|
+
bt();
|
|
195
195
|
}
|
|
196
|
-
var
|
|
196
|
+
var x = {
|
|
197
197
|
store: {
|
|
198
198
|
subscribe(t) {
|
|
199
199
|
if (d) return d.store.subscribe(t);
|
|
@@ -227,7 +227,7 @@ var A = {
|
|
|
227
227
|
if (typeof t != "function")
|
|
228
228
|
return y("activeRouterProxy.subscribe: listener must be a function"), () => {
|
|
229
229
|
};
|
|
230
|
-
if (
|
|
230
|
+
if (V.add(t), d) if (!D) bt();
|
|
231
231
|
else try {
|
|
232
232
|
const r = d.getCurrent();
|
|
233
233
|
r && t(r);
|
|
@@ -245,13 +245,13 @@ var A = {
|
|
|
245
245
|
}
|
|
246
246
|
return () => {
|
|
247
247
|
try {
|
|
248
|
-
if (
|
|
248
|
+
if (V.delete(t), V.size === 0 && D) {
|
|
249
249
|
try {
|
|
250
|
-
|
|
250
|
+
D();
|
|
251
251
|
} catch (r) {
|
|
252
252
|
y("activeRouterProxy inner unsubscribe failed", r);
|
|
253
253
|
}
|
|
254
|
-
|
|
254
|
+
D = null;
|
|
255
255
|
}
|
|
256
256
|
} catch (r) {
|
|
257
257
|
y("activeRouterProxy unsubscribe failed", r);
|
|
@@ -293,29 +293,29 @@ var A = {
|
|
|
293
293
|
}
|
|
294
294
|
};
|
|
295
295
|
function It(t) {
|
|
296
|
-
const { routes: r, base:
|
|
297
|
-
...
|
|
296
|
+
const { routes: r, base: h = "", initialUrl: a, scrollToFragment: i = !0 } = t, o = xt(h), m = typeof i == "boolean" ? {
|
|
297
|
+
...ft,
|
|
298
298
|
enabled: i
|
|
299
299
|
} : {
|
|
300
|
-
...
|
|
300
|
+
...ft,
|
|
301
301
|
...i
|
|
302
302
|
};
|
|
303
|
-
let g, v, c,
|
|
303
|
+
let g, v, c, R, M, z, H, X = () => {
|
|
304
304
|
};
|
|
305
|
-
const
|
|
306
|
-
let
|
|
305
|
+
const T = /* @__PURE__ */ new Set(), W = 10;
|
|
306
|
+
let P = 0;
|
|
307
307
|
const G = async (s, l) => {
|
|
308
308
|
const e = rt(r, s.path);
|
|
309
309
|
if (!e || !e.beforeEnter) return !0;
|
|
310
310
|
try {
|
|
311
311
|
const n = await e.beforeEnter(s, l);
|
|
312
312
|
if (typeof n == "string") {
|
|
313
|
-
const
|
|
314
|
-
return
|
|
313
|
+
const f = `${s.path}->${n}`;
|
|
314
|
+
return T.has(f) || P >= W ? (k(`Redirect loop detected: ${f}`), !1) : n;
|
|
315
315
|
}
|
|
316
316
|
return n !== !1;
|
|
317
317
|
} catch (n) {
|
|
318
|
-
|
|
318
|
+
k("beforeEnter error", n);
|
|
319
319
|
try {
|
|
320
320
|
c.setState(l);
|
|
321
321
|
} catch {
|
|
@@ -328,12 +328,12 @@ function It(t) {
|
|
|
328
328
|
try {
|
|
329
329
|
const n = await e.onEnter(s, l);
|
|
330
330
|
if (typeof n == "string") {
|
|
331
|
-
const
|
|
332
|
-
return
|
|
331
|
+
const f = `${s.path}->${n}`;
|
|
332
|
+
return T.has(f) || P >= W ? (k(`Redirect loop detected: ${f}`), !1) : n;
|
|
333
333
|
}
|
|
334
334
|
return n !== !1;
|
|
335
335
|
} catch (n) {
|
|
336
|
-
|
|
336
|
+
k("onEnter error", n);
|
|
337
337
|
try {
|
|
338
338
|
c.setState(l);
|
|
339
339
|
} catch {
|
|
@@ -345,20 +345,20 @@ function It(t) {
|
|
|
345
345
|
if (!(!e || !e.afterEnter))
|
|
346
346
|
try {
|
|
347
347
|
const n = e.afterEnter(s, l);
|
|
348
|
-
n instanceof Promise && n.catch((
|
|
349
|
-
|
|
348
|
+
n instanceof Promise && n.catch((f) => {
|
|
349
|
+
k("afterEnter async error", f);
|
|
350
350
|
});
|
|
351
351
|
} catch (n) {
|
|
352
|
-
|
|
352
|
+
k("afterEnter error", n);
|
|
353
353
|
}
|
|
354
|
-
},
|
|
355
|
-
if (
|
|
354
|
+
}, A = /* @__PURE__ */ new Map(), j = 100, N = (s) => {
|
|
355
|
+
if (A.has(s)) return A.get(s);
|
|
356
356
|
const l = Q(r, s);
|
|
357
|
-
if (
|
|
358
|
-
const e = Math.floor(j * 0.25), n = Array.from(
|
|
359
|
-
for (let
|
|
357
|
+
if (A.size >= j) {
|
|
358
|
+
const e = Math.floor(j * 0.25), n = Array.from(A.keys());
|
|
359
|
+
for (let f = 0; f < e && f < n.length; f++) A.delete(n[f]);
|
|
360
360
|
}
|
|
361
|
-
return
|
|
361
|
+
return A.set(s, l), l;
|
|
362
362
|
}, tt = () => {
|
|
363
363
|
};
|
|
364
364
|
async function p(s, l = 0) {
|
|
@@ -366,9 +366,9 @@ function It(t) {
|
|
|
366
366
|
const e = document.getElementById(s);
|
|
367
367
|
if (!e) return !1;
|
|
368
368
|
if (l > 0) try {
|
|
369
|
-
const n = e.getBoundingClientRect(),
|
|
369
|
+
const n = e.getBoundingClientRect(), f = Math.max(0, window.scrollY + n.top - l);
|
|
370
370
|
typeof window.scrollTo == "function" && window.scrollTo({
|
|
371
|
-
top:
|
|
371
|
+
top: f,
|
|
372
372
|
behavior: "auto"
|
|
373
373
|
});
|
|
374
374
|
} catch {
|
|
@@ -396,105 +396,105 @@ function It(t) {
|
|
|
396
396
|
return !1;
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function w(s, l = 0, e = 2e3) {
|
|
400
400
|
return new Promise((n) => {
|
|
401
|
-
let
|
|
402
|
-
const
|
|
403
|
-
|
|
401
|
+
let f = !1, E = null, S = null;
|
|
402
|
+
const q = Date.now(), b = (O) => {
|
|
403
|
+
f || (f = !0, E && clearTimeout(E), S !== null && cancelAnimationFrame(S), n(O));
|
|
404
404
|
}, F = async () => {
|
|
405
|
-
if (!
|
|
405
|
+
if (!f)
|
|
406
406
|
try {
|
|
407
407
|
if (await p(s, l)) return b(!0);
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
410
|
-
if (Date.now() -
|
|
408
|
+
const O = async () => {
|
|
409
|
+
if (!f) {
|
|
410
|
+
if (Date.now() - q >= e) return b(!1);
|
|
411
411
|
try {
|
|
412
412
|
if (await p(s, l)) return b(!0);
|
|
413
|
-
|
|
414
|
-
} catch (
|
|
415
|
-
y("Scroll retry attempt failed:",
|
|
413
|
+
S = requestAnimationFrame(O);
|
|
414
|
+
} catch (wt) {
|
|
415
|
+
y("Scroll retry attempt failed:", wt), S = requestAnimationFrame(O);
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
|
-
|
|
420
|
-
} catch (
|
|
421
|
-
y("Initial scroll attempt failed:",
|
|
419
|
+
S = requestAnimationFrame(O);
|
|
420
|
+
} catch (O) {
|
|
421
|
+
y("Initial scroll attempt failed:", O), b(!1);
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
|
-
|
|
424
|
+
E = setTimeout(() => {
|
|
425
425
|
b(!1);
|
|
426
|
-
}, e), F().catch((
|
|
427
|
-
y("Scroll attempt failed:",
|
|
426
|
+
}, e), F().catch((O) => {
|
|
427
|
+
y("Scroll attempt failed:", O), b(!1);
|
|
428
428
|
});
|
|
429
429
|
});
|
|
430
430
|
}
|
|
431
|
-
let
|
|
432
|
-
const
|
|
433
|
-
if (
|
|
431
|
+
let _ = !1;
|
|
432
|
+
const I = async (s, l = !1) => {
|
|
433
|
+
if (_) {
|
|
434
434
|
y(`Navigation to ${s} blocked - navigation already in progress`);
|
|
435
435
|
return;
|
|
436
436
|
}
|
|
437
|
-
|
|
437
|
+
_ = !0, P = 0, T.clear();
|
|
438
438
|
try {
|
|
439
|
-
await
|
|
439
|
+
await $(s, l);
|
|
440
440
|
} finally {
|
|
441
|
-
|
|
441
|
+
_ = !1, P = 0, T.clear();
|
|
442
442
|
}
|
|
443
|
-
},
|
|
444
|
-
const l = s.indexOf("#"), e = l >= 0 ? s.slice(l + 1) : "", n = l >= 0 ? s.slice(0, l) : s,
|
|
443
|
+
}, u = (s) => {
|
|
444
|
+
const l = s.indexOf("#"), e = l >= 0 ? s.slice(l + 1) : "", n = l >= 0 ? s.slice(0, l) : s, f = n.indexOf("?"), E = f >= 0 ? n.slice(0, f) : n, S = f >= 0 ? ot(n.slice(f)) : {};
|
|
445
445
|
return {
|
|
446
|
-
path:
|
|
447
|
-
query:
|
|
446
|
+
path: C((E.startsWith(o) ? E.slice(o.length) : E) || "/"),
|
|
447
|
+
query: S,
|
|
448
448
|
fragment: e
|
|
449
449
|
};
|
|
450
|
-
},
|
|
450
|
+
}, $ = async (s, l = !1) => {
|
|
451
451
|
try {
|
|
452
|
-
const e =
|
|
452
|
+
const e = u(s), n = N(e.path);
|
|
453
453
|
if (!n.route) throw new Error(`No route found for ${e.path}`);
|
|
454
|
-
const
|
|
454
|
+
const f = c.getState(), E = {
|
|
455
455
|
path: e.path,
|
|
456
456
|
params: n.params,
|
|
457
457
|
query: e.query,
|
|
458
458
|
fragment: e.fragment
|
|
459
|
-
},
|
|
460
|
-
if (
|
|
461
|
-
if (typeof
|
|
462
|
-
|
|
463
|
-
const b = `${
|
|
464
|
-
|
|
459
|
+
}, S = await G(E, f);
|
|
460
|
+
if (S === !1) return;
|
|
461
|
+
if (typeof S == "string") {
|
|
462
|
+
P++;
|
|
463
|
+
const b = `${E.path}->${S}`;
|
|
464
|
+
T.add(b), await $(S, !0);
|
|
465
465
|
return;
|
|
466
466
|
}
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
if (typeof
|
|
470
|
-
|
|
471
|
-
const b = `${
|
|
472
|
-
|
|
467
|
+
const q = await at(E, f);
|
|
468
|
+
if (q === !1) return;
|
|
469
|
+
if (typeof q == "string") {
|
|
470
|
+
P++;
|
|
471
|
+
const b = `${E.path}->${q}`;
|
|
472
|
+
T.add(b), await $(q, !0);
|
|
473
473
|
return;
|
|
474
474
|
}
|
|
475
475
|
if (typeof window < "u" && typeof document < "u") {
|
|
476
476
|
const b = $t(e.query), F = o + e.path + (b || "") + (e.fragment ? "#" + e.fragment : "");
|
|
477
477
|
l ? window.history.replaceState({}, "", F) : window.history.pushState({}, "", F);
|
|
478
478
|
}
|
|
479
|
-
if (c.setState(
|
|
480
|
-
const b =
|
|
481
|
-
m.enabled && b &&
|
|
479
|
+
if (c.setState(E), Y(E, f), typeof window < "u" && typeof document < "u") try {
|
|
480
|
+
const b = E.fragment;
|
|
481
|
+
m.enabled && b && w(String(b), m.offset, m.timeoutMs).catch(() => {
|
|
482
482
|
});
|
|
483
483
|
} catch {
|
|
484
484
|
}
|
|
485
485
|
} catch (e) {
|
|
486
|
-
if (
|
|
486
|
+
if (k("Navigation error:", e), e instanceof Error && (e.stack?.includes("runBeforeEnter") || e.stack?.includes("runOnEnter"))) throw e;
|
|
487
487
|
try {
|
|
488
488
|
if (!Q(r, c.getState().path).route) {
|
|
489
|
-
let n = r.find((
|
|
490
|
-
if (n || (n = r.find((
|
|
491
|
-
const
|
|
489
|
+
let n = r.find((f) => f.path === "/");
|
|
490
|
+
if (n || (n = r.find((f) => !f.path.includes(":") && !f.path.includes("*"))), !n && r.length > 0 && (n = r[0]), n) {
|
|
491
|
+
const f = Q(r, n.path);
|
|
492
492
|
c.setState({
|
|
493
493
|
path: n.path,
|
|
494
|
-
params:
|
|
494
|
+
params: f.params,
|
|
495
495
|
query: {}
|
|
496
496
|
});
|
|
497
|
-
} else
|
|
497
|
+
} else k("No fallback route available for error recovery");
|
|
498
498
|
}
|
|
499
499
|
} catch (n) {
|
|
500
500
|
y("State recovery failed during navigation error:", n);
|
|
@@ -503,16 +503,16 @@ function It(t) {
|
|
|
503
503
|
};
|
|
504
504
|
if (((s) => {
|
|
505
505
|
if (!s || s.length === 0)
|
|
506
|
-
return
|
|
506
|
+
return k("Router configuration error: No routes provided"), !1;
|
|
507
507
|
const l = /* @__PURE__ */ new Set();
|
|
508
508
|
for (const e of s) {
|
|
509
509
|
if (!e.path)
|
|
510
|
-
return
|
|
510
|
+
return k("Router configuration error: Route missing path", e), !1;
|
|
511
511
|
l.has(e.path) && y(`Duplicate route path detected: ${e.path}`), l.add(e.path), !e.component && !e.load && y(`Route '${e.path}' has no component or load function`);
|
|
512
512
|
}
|
|
513
513
|
return !0;
|
|
514
514
|
})(r), typeof window > "u" || typeof a < "u") {
|
|
515
|
-
for (const s of r)
|
|
515
|
+
for (const s of r) N(s.path);
|
|
516
516
|
y(`Pre-compiled ${r.length} routes for SSR`);
|
|
517
517
|
}
|
|
518
518
|
if (typeof window < "u" && typeof document < "u" && typeof a > "u") {
|
|
@@ -520,7 +520,7 @@ function It(t) {
|
|
|
520
520
|
try {
|
|
521
521
|
const e = new URL(window.location.href), n = e.pathname;
|
|
522
522
|
return {
|
|
523
|
-
path:
|
|
523
|
+
path: C((n.startsWith(o) ? n.slice(o.length) : n) || "/"),
|
|
524
524
|
query: ot(e.search),
|
|
525
525
|
fragment: e.hash && e.hash.length ? e.hash.slice(1) : ""
|
|
526
526
|
};
|
|
@@ -532,19 +532,19 @@ function It(t) {
|
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
534
|
}, v = g();
|
|
535
|
-
const s =
|
|
536
|
-
c =
|
|
535
|
+
const s = N(v.path);
|
|
536
|
+
c = ut({
|
|
537
537
|
path: v.path,
|
|
538
538
|
params: s.params,
|
|
539
539
|
query: v.query,
|
|
540
540
|
fragment: v.fragment
|
|
541
|
-
}),
|
|
542
|
-
await
|
|
541
|
+
}), R = async (e = !1) => {
|
|
542
|
+
await I(g().path, e);
|
|
543
543
|
};
|
|
544
|
-
const l = () =>
|
|
545
|
-
window.addEventListener("popstate", l), X = () => window.removeEventListener("popstate", l),
|
|
546
|
-
|
|
547
|
-
|
|
544
|
+
const l = () => R(!0);
|
|
545
|
+
window.addEventListener("popstate", l), X = () => window.removeEventListener("popstate", l), M = (e) => I(e, !1), z = (e) => I(e, !0), H = () => window.history.back(), queueMicrotask(() => {
|
|
546
|
+
I(v.path, !0).catch((e) => {
|
|
547
|
+
k("Initial navigation error:", e);
|
|
548
548
|
});
|
|
549
549
|
});
|
|
550
550
|
} else {
|
|
@@ -552,7 +552,7 @@ function It(t) {
|
|
|
552
552
|
try {
|
|
553
553
|
const e = new URL(a || "/", "http://localhost"), n = e.pathname;
|
|
554
554
|
return {
|
|
555
|
-
path:
|
|
555
|
+
path: C((n.startsWith(o) ? n.slice(o.length) : n) || "/"),
|
|
556
556
|
query: ot(e.search),
|
|
557
557
|
fragment: e.hash && e.hash.length ? e.hash.slice(1) : ""
|
|
558
558
|
};
|
|
@@ -564,83 +564,83 @@ function It(t) {
|
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
566
|
}, v = g();
|
|
567
|
-
const s =
|
|
568
|
-
c =
|
|
567
|
+
const s = N(v.path);
|
|
568
|
+
c = ut({
|
|
569
569
|
path: v.path,
|
|
570
570
|
params: s.params,
|
|
571
571
|
query: v.query,
|
|
572
572
|
fragment: v.fragment
|
|
573
|
-
}),
|
|
573
|
+
}), R = async () => {
|
|
574
574
|
await l(g().path);
|
|
575
575
|
};
|
|
576
576
|
const l = async (e) => {
|
|
577
|
-
if (
|
|
578
|
-
|
|
577
|
+
if (P++, P > W) {
|
|
578
|
+
k(`SSR redirect depth exceeded for path: ${e}`);
|
|
579
579
|
return;
|
|
580
580
|
}
|
|
581
581
|
try {
|
|
582
|
-
const n =
|
|
583
|
-
if (!
|
|
584
|
-
const
|
|
582
|
+
const n = u(e), f = N(n.path);
|
|
583
|
+
if (!f.route) throw new Error(`No route found for ${n.path}`);
|
|
584
|
+
const E = c.getState(), S = {
|
|
585
585
|
path: n.path,
|
|
586
|
-
params:
|
|
586
|
+
params: f.params,
|
|
587
587
|
query: n.query,
|
|
588
588
|
fragment: n.fragment
|
|
589
|
-
},
|
|
590
|
-
if (
|
|
591
|
-
const b = await
|
|
589
|
+
}, q = rt(r, S.path);
|
|
590
|
+
if (q?.beforeEnter) {
|
|
591
|
+
const b = await q.beforeEnter(S, E);
|
|
592
592
|
if (typeof b == "string") {
|
|
593
|
-
const F = `${
|
|
594
|
-
|
|
593
|
+
const F = `${S.path}->${b}`;
|
|
594
|
+
T.add(F), await l(b);
|
|
595
595
|
return;
|
|
596
596
|
}
|
|
597
597
|
if (b === !1) return;
|
|
598
598
|
}
|
|
599
|
-
if (
|
|
600
|
-
const b = await
|
|
599
|
+
if (q?.onEnter) {
|
|
600
|
+
const b = await q.onEnter(S, E);
|
|
601
601
|
if (typeof b == "string") {
|
|
602
|
-
const F = `${
|
|
603
|
-
|
|
602
|
+
const F = `${S.path}->${b}`;
|
|
603
|
+
T.add(F), await l(b);
|
|
604
604
|
return;
|
|
605
605
|
}
|
|
606
606
|
if (b === !1) return;
|
|
607
607
|
}
|
|
608
|
-
c.setState(
|
|
608
|
+
c.setState(S), q?.afterEnter && q.afterEnter(S, E);
|
|
609
609
|
} catch (n) {
|
|
610
|
-
throw
|
|
610
|
+
throw k("SSR navigation error:", n), n;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
|
|
613
|
+
M = async (e) => (P = 0, T.clear(), l(e)), z = async (e) => (P = 0, T.clear(), l(e)), H = () => {
|
|
614
614
|
};
|
|
615
615
|
}
|
|
616
616
|
return {
|
|
617
617
|
_cleanupScrollState: tt,
|
|
618
618
|
destroy: X,
|
|
619
619
|
store: c,
|
|
620
|
-
push:
|
|
620
|
+
push: M,
|
|
621
621
|
replace: z,
|
|
622
|
-
back:
|
|
622
|
+
back: H,
|
|
623
623
|
subscribe: c.subscribe,
|
|
624
|
-
matchRoute: (s) =>
|
|
624
|
+
matchRoute: (s) => N(s),
|
|
625
625
|
getCurrent: () => c.getState(),
|
|
626
|
-
resolveRouteComponent:
|
|
626
|
+
resolveRouteComponent: gt,
|
|
627
627
|
base: o,
|
|
628
628
|
scrollToFragment: (s) => {
|
|
629
629
|
const l = s || c.getState().fragment;
|
|
630
|
-
return !l || typeof window > "u" || typeof document > "u" ? Promise.resolve(!1) :
|
|
630
|
+
return !l || typeof window > "u" || typeof document > "u" ? Promise.resolve(!1) : w(l, m.offset, m.timeoutMs);
|
|
631
631
|
}
|
|
632
632
|
};
|
|
633
633
|
}
|
|
634
634
|
function zt(t) {
|
|
635
|
-
|
|
636
|
-
const r = It(t),
|
|
637
|
-
if (
|
|
635
|
+
Pt();
|
|
636
|
+
const r = It(t), h = yt();
|
|
637
|
+
if (h) {
|
|
638
638
|
try {
|
|
639
|
-
|
|
639
|
+
h.destroy();
|
|
640
640
|
} catch {
|
|
641
641
|
}
|
|
642
642
|
try {
|
|
643
|
-
|
|
643
|
+
h._cleanupScrollState?.();
|
|
644
644
|
} catch {
|
|
645
645
|
}
|
|
646
646
|
}
|
|
@@ -662,12 +662,12 @@ function zt(t) {
|
|
|
662
662
|
}
|
|
663
663
|
} catch {
|
|
664
664
|
}
|
|
665
|
-
return
|
|
666
|
-
const a =
|
|
667
|
-
if (!
|
|
665
|
+
return lt("router-view", async () => {
|
|
666
|
+
const a = it()?._router, i = a ?? x;
|
|
667
|
+
if (!yt() && !a) return U`<div>Router not initialized.</div>`;
|
|
668
668
|
const o = et(i.getCurrent()), m = typeof window > "u";
|
|
669
669
|
let g;
|
|
670
|
-
m || (
|
|
670
|
+
m || (ct(() => {
|
|
671
671
|
try {
|
|
672
672
|
typeof i.subscribe == "function" && (g = i.subscribe((c) => {
|
|
673
673
|
try {
|
|
@@ -676,8 +676,8 @@ function zt(t) {
|
|
|
676
676
|
params: {},
|
|
677
677
|
query: {}
|
|
678
678
|
});
|
|
679
|
-
} catch (
|
|
680
|
-
y("router-view subscription update failed",
|
|
679
|
+
} catch (R) {
|
|
680
|
+
y("router-view subscription update failed", R);
|
|
681
681
|
try {
|
|
682
682
|
o.value = {
|
|
683
683
|
path: "/",
|
|
@@ -711,19 +711,19 @@ function zt(t) {
|
|
|
711
711
|
children: []
|
|
712
712
|
};
|
|
713
713
|
if (typeof c == "function") {
|
|
714
|
-
const
|
|
715
|
-
return (
|
|
716
|
-
tag:
|
|
714
|
+
const R = c();
|
|
715
|
+
return (R instanceof Promise ? R : Promise.resolve(R)).then((M) => typeof M == "string" ? {
|
|
716
|
+
tag: M,
|
|
717
717
|
props: {},
|
|
718
718
|
children: []
|
|
719
|
-
} :
|
|
719
|
+
} : M);
|
|
720
720
|
}
|
|
721
721
|
return U`<div>Invalid route component</div>`;
|
|
722
722
|
} catch {
|
|
723
723
|
return U`<div>Invalid route component</div>`;
|
|
724
724
|
}
|
|
725
|
-
}),
|
|
726
|
-
const a =
|
|
725
|
+
}), lt("router-link", () => {
|
|
726
|
+
const a = St({
|
|
727
727
|
to: "",
|
|
728
728
|
tag: "a",
|
|
729
729
|
replace: !1,
|
|
@@ -735,28 +735,38 @@ function zt(t) {
|
|
|
735
735
|
external: !1,
|
|
736
736
|
class: "",
|
|
737
737
|
style: ""
|
|
738
|
-
}), i = typeof window > "u", o = et(
|
|
739
|
-
isExactActive:
|
|
740
|
-
isActive:
|
|
741
|
-
isExternal:
|
|
738
|
+
}), i = typeof window > "u", o = et(x.getCurrent()), m = o.value?.path || "/", g = String(a.to || ""), v = i ? {
|
|
739
|
+
isExactActive: mt(m, g, x.base),
|
|
740
|
+
isActive: vt(m, g, x.base),
|
|
741
|
+
isExternal: K(g) || !!a.external
|
|
742
742
|
} : null;
|
|
743
743
|
let c;
|
|
744
|
-
|
|
745
|
-
const
|
|
744
|
+
Rt(() => "a,button{display:inline-block;}");
|
|
745
|
+
const R = et(a.class || ""), M = et(a.style || "");
|
|
746
746
|
if (!i) {
|
|
747
|
-
|
|
748
|
-
|
|
747
|
+
const p = it(), w = p?._host ?? null;
|
|
748
|
+
let _ = null, I = null;
|
|
749
|
+
ct(() => {
|
|
750
|
+
w instanceof HTMLElement && (I = () => {
|
|
751
|
+
const u = String(a.to || "");
|
|
752
|
+
if (u && !K(u)) try {
|
|
753
|
+
const { route: $ } = x.matchRoute(u);
|
|
754
|
+
$?.load && gt($).catch(() => {
|
|
755
|
+
});
|
|
756
|
+
} catch {
|
|
757
|
+
}
|
|
758
|
+
}, w.addEventListener("mouseenter", I, { once: !0 }));
|
|
749
759
|
try {
|
|
750
|
-
if (typeof
|
|
751
|
-
c =
|
|
760
|
+
if (typeof x.subscribe == "function") {
|
|
761
|
+
c = x.subscribe((u) => {
|
|
752
762
|
try {
|
|
753
|
-
|
|
763
|
+
u && typeof u == "object" && typeof u.path == "string" ? o.value = u : (y("router-link received invalid state", u), o.value = {
|
|
754
764
|
path: "/",
|
|
755
765
|
params: {},
|
|
756
766
|
query: {}
|
|
757
767
|
});
|
|
758
|
-
} catch (
|
|
759
|
-
y("router-link subscription update failed",
|
|
768
|
+
} catch ($) {
|
|
769
|
+
y("router-link subscription update failed", $);
|
|
760
770
|
try {
|
|
761
771
|
o.value = {
|
|
762
772
|
path: "/",
|
|
@@ -768,29 +778,28 @@ function zt(t) {
|
|
|
768
778
|
}
|
|
769
779
|
});
|
|
770
780
|
try {
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
} catch (
|
|
774
|
-
y("router-link initial state sync failed",
|
|
781
|
+
const u = x.getCurrent();
|
|
782
|
+
u && typeof u.path == "string" && (o.value = u);
|
|
783
|
+
} catch (u) {
|
|
784
|
+
y("router-link initial state sync failed", u);
|
|
775
785
|
}
|
|
776
|
-
|
|
786
|
+
_ = setInterval(() => {
|
|
777
787
|
try {
|
|
778
|
-
const
|
|
779
|
-
|
|
788
|
+
const u = x.getCurrent();
|
|
789
|
+
u && typeof u.path == "string" && JSON.stringify(o.value) !== JSON.stringify(u) && (o.value = u);
|
|
780
790
|
} catch {
|
|
781
791
|
}
|
|
782
792
|
}, 100);
|
|
783
793
|
}
|
|
784
|
-
} catch (
|
|
785
|
-
y("router-link subscribe failed",
|
|
794
|
+
} catch (u) {
|
|
795
|
+
y("router-link subscribe failed", u);
|
|
786
796
|
}
|
|
787
797
|
try {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
q && (S.value = q), N && (I.value = N), q !== null && h.removeAttribute("class"), N !== null && h.removeAttribute("style");
|
|
798
|
+
if (w instanceof HTMLElement) {
|
|
799
|
+
const u = w.getAttribute("class"), $ = w.getAttribute("style");
|
|
800
|
+
u && (R.value = u), $ && (M.value = $), u !== null && w.removeAttribute("class"), $ !== null && w.removeAttribute("style");
|
|
792
801
|
try {
|
|
793
|
-
|
|
802
|
+
p?._requestRender?.();
|
|
794
803
|
try {
|
|
795
804
|
nt();
|
|
796
805
|
} catch {
|
|
@@ -798,68 +807,74 @@ function zt(t) {
|
|
|
798
807
|
} catch {
|
|
799
808
|
}
|
|
800
809
|
}
|
|
801
|
-
} catch (
|
|
802
|
-
y("router-link host migration failed",
|
|
810
|
+
} catch (u) {
|
|
811
|
+
y("router-link host migration failed", u);
|
|
803
812
|
}
|
|
804
813
|
}), st(() => {
|
|
814
|
+
if (I && w instanceof HTMLElement) try {
|
|
815
|
+
w.removeEventListener("mouseenter", I);
|
|
816
|
+
} catch {
|
|
817
|
+
} finally {
|
|
818
|
+
I = null;
|
|
819
|
+
}
|
|
805
820
|
if (typeof c == "function") try {
|
|
806
821
|
c();
|
|
807
|
-
} catch (
|
|
808
|
-
y("router-link unsubscribe failed",
|
|
822
|
+
} catch (u) {
|
|
823
|
+
y("router-link unsubscribe failed", u);
|
|
809
824
|
} finally {
|
|
810
825
|
c = void 0;
|
|
811
826
|
}
|
|
812
|
-
if (
|
|
813
|
-
clearInterval(
|
|
814
|
-
} catch (
|
|
815
|
-
y("router-link sync interval cleanup failed",
|
|
827
|
+
if (_) try {
|
|
828
|
+
clearInterval(_);
|
|
829
|
+
} catch (u) {
|
|
830
|
+
y("router-link sync interval cleanup failed", u);
|
|
816
831
|
} finally {
|
|
817
|
-
|
|
832
|
+
_ = null;
|
|
818
833
|
}
|
|
819
834
|
});
|
|
820
835
|
}
|
|
821
|
-
const z =
|
|
836
|
+
const z = L(() => {
|
|
822
837
|
if (i && v) return v.isExactActive;
|
|
823
838
|
try {
|
|
824
|
-
const p =
|
|
825
|
-
return !o.value || typeof o.value.path != "string" ? !1 :
|
|
839
|
+
const p = x.base ?? "", w = a.to || "";
|
|
840
|
+
return !o.value || typeof o.value.path != "string" ? !1 : mt(o.value.path, w, p);
|
|
826
841
|
} catch (p) {
|
|
827
842
|
return y("isExactActive computation error", p), !1;
|
|
828
843
|
}
|
|
829
|
-
}),
|
|
844
|
+
}), H = L(() => {
|
|
830
845
|
if (i && v) return v.isActive;
|
|
831
846
|
try {
|
|
832
|
-
const p =
|
|
833
|
-
return !o.value || typeof o.value.path != "string" ? !1 : a.exact ? z.value :
|
|
847
|
+
const p = x.base ?? "", w = a.to || "";
|
|
848
|
+
return !o.value || typeof o.value.path != "string" ? !1 : a.exact ? z.value : vt(o.value.path, w, p);
|
|
834
849
|
} catch (p) {
|
|
835
850
|
return y("isActive computation error", p), !1;
|
|
836
851
|
}
|
|
837
|
-
}), X =
|
|
852
|
+
}), X = L(() => {
|
|
838
853
|
const p = String(a.to || "");
|
|
839
|
-
if (
|
|
840
|
-
if (
|
|
841
|
-
const [
|
|
842
|
-
let
|
|
843
|
-
if (
|
|
844
|
-
const s =
|
|
845
|
-
l.startsWith(s) ?
|
|
854
|
+
if (ht(p)) return null;
|
|
855
|
+
if (K(p)) return p;
|
|
856
|
+
const [w, _] = p.split("#"), [I, u] = (w || "").split("?"), $ = x.base ?? "";
|
|
857
|
+
let Z = I || "/";
|
|
858
|
+
if ($ && $ !== "/") {
|
|
859
|
+
const s = C($), l = C(Z);
|
|
860
|
+
l.startsWith(s) ? Z = l.slice(s.length) || "/" : Z = l;
|
|
846
861
|
}
|
|
847
|
-
return
|
|
848
|
-
}),
|
|
849
|
-
const p = (
|
|
850
|
-
for (const
|
|
851
|
-
return
|
|
852
|
-
}), W =
|
|
853
|
-
...
|
|
854
|
-
[a.activeClass || "active"]:
|
|
862
|
+
return $ + C(Z || "/") + (u ? "?" + u : "") + (_ ? "#" + _ : "");
|
|
863
|
+
}), T = L(() => {
|
|
864
|
+
const p = (R && R.value || a.class || "").split(/\s+/).filter(Boolean), w = {};
|
|
865
|
+
for (const _ of p) w[_] = !0;
|
|
866
|
+
return w;
|
|
867
|
+
}), W = L(() => ({
|
|
868
|
+
...T.value,
|
|
869
|
+
[a.activeClass || "active"]: H.value,
|
|
855
870
|
[a.exactActiveClass || "exact-active"]: z.value
|
|
856
|
-
})),
|
|
871
|
+
})), P = L(() => Object.keys(W.value).filter((p) => W.value[p]).join(" ")), G = L(() => a.tag || "a"), at = L(() => G.value === "button"), Y = L(() => z.value ? a.ariaCurrentValue : null), A = L(() => !!a.disabled), j = L(() => (K(String(a.to || "")) || !!a.external) && G.value === "a"), N = L(() => M && M.value || a.style || ""), tt = (p) => {
|
|
857
872
|
if (!(p.defaultPrevented || p.button !== 0 || p.metaKey || p.altKey || p.ctrlKey || p.shiftKey)) {
|
|
858
|
-
if (
|
|
873
|
+
if (A.value) {
|
|
859
874
|
p.preventDefault();
|
|
860
875
|
return;
|
|
861
876
|
}
|
|
862
|
-
if (
|
|
877
|
+
if (ht(String(a.to || ""))) {
|
|
863
878
|
try {
|
|
864
879
|
p.preventDefault();
|
|
865
880
|
} catch {
|
|
@@ -867,19 +882,19 @@ function zt(t) {
|
|
|
867
882
|
y("Blocked unsafe javascript: URI in router-link.to");
|
|
868
883
|
return;
|
|
869
884
|
}
|
|
870
|
-
j.value || (p.preventDefault(), a.replace ?
|
|
885
|
+
j.value || (p.preventDefault(), a.replace ? x.replace(a.to) : x.push(a.to));
|
|
871
886
|
}
|
|
872
887
|
};
|
|
873
888
|
return U`
|
|
874
|
-
${
|
|
889
|
+
${Et().when(at.value, U`
|
|
875
890
|
<button
|
|
876
891
|
part="button"
|
|
877
|
-
class="${
|
|
878
|
-
style="${
|
|
892
|
+
class="${P.value}"
|
|
893
|
+
style="${N.value || null}"
|
|
879
894
|
aria-current="${Y.value}"
|
|
880
|
-
disabled="${
|
|
881
|
-
aria-disabled="${
|
|
882
|
-
tabindex="${
|
|
895
|
+
disabled="${A.value ? "" : null}"
|
|
896
|
+
aria-disabled="${A.value ? "true" : null}"
|
|
897
|
+
tabindex="${A.value ? "-1" : null}"
|
|
883
898
|
@click="${tt}"
|
|
884
899
|
>
|
|
885
900
|
<slot></slot>
|
|
@@ -887,12 +902,12 @@ function zt(t) {
|
|
|
887
902
|
`).otherwise(U`
|
|
888
903
|
<a
|
|
889
904
|
part="link"
|
|
890
|
-
href="${
|
|
891
|
-
class="${
|
|
892
|
-
style="${
|
|
905
|
+
href="${A.value ? null : X.value}"
|
|
906
|
+
class="${P.value}"
|
|
907
|
+
style="${N.value || null}"
|
|
893
908
|
aria-current="${Y.value}"
|
|
894
|
-
aria-disabled="${
|
|
895
|
-
tabindex="${
|
|
909
|
+
aria-disabled="${A.value ? "true" : null}"
|
|
910
|
+
tabindex="${A.value ? "-1" : null}"
|
|
896
911
|
target="${j.value ? "_blank" : null}"
|
|
897
912
|
rel="${j.value ? "noopener noreferrer" : null}"
|
|
898
913
|
@click="${tt}"
|
|
@@ -902,40 +917,40 @@ function zt(t) {
|
|
|
902
917
|
`;
|
|
903
918
|
}), r;
|
|
904
919
|
}
|
|
905
|
-
function
|
|
906
|
-
if (
|
|
920
|
+
function mt(t, r, h) {
|
|
921
|
+
if (K(r)) return !1;
|
|
907
922
|
let a = (r.split("#")[0] || "/").split("?")[0];
|
|
908
|
-
if (
|
|
909
|
-
const i =
|
|
923
|
+
if (h && h !== "/") {
|
|
924
|
+
const i = C(h), o = C(a);
|
|
910
925
|
o.startsWith(i) ? a = o.slice(i.length) || "/" : a = o;
|
|
911
926
|
}
|
|
912
|
-
return
|
|
927
|
+
return C(t) === C(a);
|
|
913
928
|
}
|
|
914
|
-
function
|
|
915
|
-
if (
|
|
929
|
+
function vt(t, r, h) {
|
|
930
|
+
if (K(r)) return !1;
|
|
916
931
|
let a = (r.split("#")[0] || "/").split("?")[0];
|
|
917
|
-
if (
|
|
918
|
-
const m =
|
|
932
|
+
if (h && h !== "/") {
|
|
933
|
+
const m = C(h), g = C(a);
|
|
919
934
|
g.startsWith(m) ? a = g.slice(m.length) || "/" : a = g;
|
|
920
935
|
}
|
|
921
|
-
const i =
|
|
936
|
+
const i = C(t), o = C(a);
|
|
922
937
|
return o === "/" ? i === "/" : i === o ? !0 : i.startsWith(o.endsWith("/") ? o : o + "/");
|
|
923
938
|
}
|
|
924
939
|
export {
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
940
|
+
ft as DEFAULT_SCROLL_CONFIG,
|
|
941
|
+
x as activeRouterProxy,
|
|
942
|
+
xt as canonicalizeBase,
|
|
943
|
+
Pt as clearComponentCache,
|
|
929
944
|
rt as findMatchedRoute,
|
|
930
945
|
zt as initRouter,
|
|
931
|
-
|
|
932
|
-
|
|
946
|
+
K as isAbsoluteUrl,
|
|
947
|
+
ht as isDangerousScheme,
|
|
933
948
|
Q as matchRoute,
|
|
934
949
|
Ft as matchRouteSSR,
|
|
935
|
-
|
|
950
|
+
C as normalizePathForRoute,
|
|
936
951
|
ot as parseQuery,
|
|
937
|
-
|
|
938
|
-
|
|
952
|
+
gt as resolveRouteComponent,
|
|
953
|
+
Ct as safeDecode,
|
|
939
954
|
$t as serializeQuery,
|
|
940
955
|
It as useRouter
|
|
941
956
|
};
|