react-router 7.13.0 → 7.13.1
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/CHANGELOG.md +69 -0
- package/dist/development/{browser-BEPxnEBW.d.mts → browser-DzsJABDQ.d.mts} +3 -2
- package/dist/{production/browser-BEPxnEBW.d.mts → development/browser-sPQ7eaK4.d.ts} +3 -2
- package/dist/development/{chunk-HMDR2CVH.js → chunk-2YMDXNOJ.js} +124 -107
- package/dist/{production/chunk-GSFLVUYQ.mjs → development/chunk-JPUPSTYD.mjs} +13 -4
- package/dist/{production/chunk-NGWWS4QJ.js → development/chunk-KSEWV2VO.js} +7 -7
- package/dist/development/{chunk-JZWAC4HX.mjs → chunk-LFPYN7LY.mjs} +153 -63
- package/dist/development/{chunk-WICQJKU6.js → chunk-XOLAXE2Z.js} +203 -128
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +34 -27
- package/dist/development/dom-export.mjs +10 -3
- package/dist/development/{index-react-server-client-1TI9M9o1.d.ts → index-react-server-client-C4tCIird.d.ts} +54 -2
- package/dist/development/{index-react-server-client-MKTlCGL3.d.mts → index-react-server-client-EzWJGpN_.d.mts} +54 -2
- package/dist/development/index-react-server-client.d.mts +2 -2
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +12 -1
- package/dist/development/index-react-server.d.ts +12 -1
- package/dist/development/index-react-server.js +80 -44
- package/dist/development/index-react-server.mjs +80 -45
- package/dist/development/index.d.mts +11 -10
- package/dist/development/index.d.ts +11 -10
- package/dist/development/index.js +94 -85
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-DvHY1sgY.d.ts → development/instrumentation--6Pioq_G.d.ts} +14 -2
- package/dist/development/lib/types/internal.d.mts +4 -4
- package/dist/development/lib/types/internal.d.ts +4 -4
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{register-Bm80E9qL.d.ts → register-CBoanF80.d.ts} +1 -1
- package/dist/development/{register-CS_tiXsm.d.mts → register-cRYJ3CjG.d.mts} +1 -1
- package/dist/{production/router-5iOvts3c.d.mts → development/router-cLsU7kHk.d.mts} +14 -2
- package/dist/{development/browser-CJ9_du-U.d.ts → production/browser-DzsJABDQ.d.mts} +3 -2
- package/dist/production/{browser-CJ9_du-U.d.ts → browser-sPQ7eaK4.d.ts} +3 -2
- package/dist/production/{chunk-QSNCZFX5.js → chunk-772H4TVR.js} +203 -128
- package/dist/production/{chunk-N2HZAAIG.js → chunk-B5UMK6O7.js} +124 -107
- package/dist/production/{chunk-Y3R63HEB.mjs → chunk-RJCJ3EYF.mjs} +153 -63
- package/dist/{development/chunk-4LKRSAEJ.mjs → production/chunk-TXB4YXR2.mjs} +13 -4
- package/dist/{development/chunk-7PAHGFS4.js → production/chunk-ZJMCM6KT.js} +7 -7
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +34 -27
- package/dist/production/dom-export.mjs +10 -3
- package/dist/production/{index-react-server-client-1TI9M9o1.d.ts → index-react-server-client-C4tCIird.d.ts} +54 -2
- package/dist/production/{index-react-server-client-MKTlCGL3.d.mts → index-react-server-client-EzWJGpN_.d.mts} +54 -2
- package/dist/production/index-react-server-client.d.mts +2 -2
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +12 -1
- package/dist/production/index-react-server.d.ts +12 -1
- package/dist/production/index-react-server.js +80 -44
- package/dist/production/index-react-server.mjs +80 -45
- package/dist/production/index.d.mts +11 -10
- package/dist/production/index.d.ts +11 -10
- package/dist/production/index.js +94 -85
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-DvHY1sgY.d.ts → production/instrumentation--6Pioq_G.d.ts} +14 -2
- package/dist/production/lib/types/internal.d.mts +4 -4
- package/dist/production/lib/types/internal.d.ts +4 -4
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{register-Bm80E9qL.d.ts → register-CBoanF80.d.ts} +1 -1
- package/dist/production/{register-CS_tiXsm.d.mts → register-cRYJ3CjG.d.mts} +1 -1
- package/dist/{development/router-5iOvts3c.d.mts → production/router-cLsU7kHk.d.mts} +14 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.13.
|
|
2
|
+
* react-router v7.13.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
var _chunkXOLAXE2Zjs = require('./chunk-XOLAXE2Z.js');
|
|
54
55
|
|
|
55
56
|
// lib/dom/dom.ts
|
|
56
57
|
var defaultMethod = "get";
|
|
@@ -121,7 +122,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
|
|
|
121
122
|
]);
|
|
122
123
|
function getFormEncType(encType) {
|
|
123
124
|
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
124
|
-
|
|
125
|
+
_chunkXOLAXE2Zjs.warning.call(void 0,
|
|
125
126
|
false,
|
|
126
127
|
`"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
|
|
127
128
|
);
|
|
@@ -137,7 +138,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
137
138
|
let body;
|
|
138
139
|
if (isFormElement(target)) {
|
|
139
140
|
let attr = target.getAttribute("action");
|
|
140
|
-
action = attr ?
|
|
141
|
+
action = attr ? _chunkXOLAXE2Zjs.stripBasename.call(void 0, attr, basename) : null;
|
|
141
142
|
method = target.getAttribute("method") || defaultMethod;
|
|
142
143
|
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
143
144
|
formData = new FormData(target);
|
|
@@ -149,7 +150,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
149
150
|
);
|
|
150
151
|
}
|
|
151
152
|
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
152
|
-
action = attr ?
|
|
153
|
+
action = attr ? _chunkXOLAXE2Zjs.stripBasename.call(void 0, attr, basename) : null;
|
|
153
154
|
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
154
155
|
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
155
156
|
formData = new FormData(form, target);
|
|
@@ -186,20 +187,20 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
186
187
|
try {
|
|
187
188
|
if (isBrowser) {
|
|
188
189
|
window.__reactRouterVersion = // @ts-expect-error
|
|
189
|
-
"7.13.
|
|
190
|
+
"7.13.1";
|
|
190
191
|
}
|
|
191
192
|
} catch (e) {
|
|
192
193
|
}
|
|
193
194
|
function createBrowserRouter(routes, opts) {
|
|
194
|
-
return
|
|
195
|
+
return _chunkXOLAXE2Zjs.createRouter.call(void 0, {
|
|
195
196
|
basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
|
|
196
197
|
getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
|
|
197
198
|
future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
|
|
198
|
-
history:
|
|
199
|
+
history: _chunkXOLAXE2Zjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
|
|
199
200
|
hydrationData: _optionalChain([opts, 'optionalAccess', _6 => _6.hydrationData]) || parseHydrationData(),
|
|
200
201
|
routes,
|
|
201
|
-
mapRouteProperties:
|
|
202
|
-
hydrationRouteProperties:
|
|
202
|
+
mapRouteProperties: _chunkXOLAXE2Zjs.mapRouteProperties,
|
|
203
|
+
hydrationRouteProperties: _chunkXOLAXE2Zjs.hydrationRouteProperties,
|
|
203
204
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _7 => _7.dataStrategy]),
|
|
204
205
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _8 => _8.patchRoutesOnNavigation]),
|
|
205
206
|
window: _optionalChain([opts, 'optionalAccess', _9 => _9.window]),
|
|
@@ -207,15 +208,15 @@ function createBrowserRouter(routes, opts) {
|
|
|
207
208
|
}).initialize();
|
|
208
209
|
}
|
|
209
210
|
function createHashRouter(routes, opts) {
|
|
210
|
-
return
|
|
211
|
+
return _chunkXOLAXE2Zjs.createRouter.call(void 0, {
|
|
211
212
|
basename: _optionalChain([opts, 'optionalAccess', _11 => _11.basename]),
|
|
212
213
|
getContext: _optionalChain([opts, 'optionalAccess', _12 => _12.getContext]),
|
|
213
214
|
future: _optionalChain([opts, 'optionalAccess', _13 => _13.future]),
|
|
214
|
-
history:
|
|
215
|
+
history: _chunkXOLAXE2Zjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
|
|
215
216
|
hydrationData: _optionalChain([opts, 'optionalAccess', _15 => _15.hydrationData]) || parseHydrationData(),
|
|
216
217
|
routes,
|
|
217
|
-
mapRouteProperties:
|
|
218
|
-
hydrationRouteProperties:
|
|
218
|
+
mapRouteProperties: _chunkXOLAXE2Zjs.mapRouteProperties,
|
|
219
|
+
hydrationRouteProperties: _chunkXOLAXE2Zjs.hydrationRouteProperties,
|
|
219
220
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _16 => _16.dataStrategy]),
|
|
220
221
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _17 => _17.patchRoutesOnNavigation]),
|
|
221
222
|
window: _optionalChain([opts, 'optionalAccess', _18 => _18.window]),
|
|
@@ -238,7 +239,7 @@ function deserializeErrors(errors) {
|
|
|
238
239
|
let serialized = {};
|
|
239
240
|
for (let [key, val] of entries) {
|
|
240
241
|
if (val && val.__type === "RouteErrorResponse") {
|
|
241
|
-
serialized[key] = new (0,
|
|
242
|
+
serialized[key] = new (0, _chunkXOLAXE2Zjs.ErrorResponseImpl)(
|
|
242
243
|
val.status,
|
|
243
244
|
val.statusText,
|
|
244
245
|
val.data,
|
|
@@ -275,7 +276,7 @@ function BrowserRouter({
|
|
|
275
276
|
}) {
|
|
276
277
|
let historyRef = React.useRef();
|
|
277
278
|
if (historyRef.current == null) {
|
|
278
|
-
historyRef.current =
|
|
279
|
+
historyRef.current = _chunkXOLAXE2Zjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
|
|
279
280
|
}
|
|
280
281
|
let history = historyRef.current;
|
|
281
282
|
let [state, setStateImpl] = React.useState({
|
|
@@ -294,7 +295,7 @@ function BrowserRouter({
|
|
|
294
295
|
);
|
|
295
296
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
296
297
|
return /* @__PURE__ */ React.createElement(
|
|
297
|
-
|
|
298
|
+
_chunkXOLAXE2Zjs.Router,
|
|
298
299
|
{
|
|
299
300
|
basename,
|
|
300
301
|
children,
|
|
@@ -313,7 +314,7 @@ function HashRouter({
|
|
|
313
314
|
}) {
|
|
314
315
|
let historyRef = React.useRef();
|
|
315
316
|
if (historyRef.current == null) {
|
|
316
|
-
historyRef.current =
|
|
317
|
+
historyRef.current = _chunkXOLAXE2Zjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
|
|
317
318
|
}
|
|
318
319
|
let history = historyRef.current;
|
|
319
320
|
let [state, setStateImpl] = React.useState({
|
|
@@ -332,7 +333,7 @@ function HashRouter({
|
|
|
332
333
|
);
|
|
333
334
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
334
335
|
return /* @__PURE__ */ React.createElement(
|
|
335
|
-
|
|
336
|
+
_chunkXOLAXE2Zjs.Router,
|
|
336
337
|
{
|
|
337
338
|
basename,
|
|
338
339
|
children,
|
|
@@ -365,7 +366,7 @@ function HistoryRouter({
|
|
|
365
366
|
);
|
|
366
367
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
367
368
|
return /* @__PURE__ */ React.createElement(
|
|
368
|
-
|
|
369
|
+
_chunkXOLAXE2Zjs.Router,
|
|
369
370
|
{
|
|
370
371
|
basename,
|
|
371
372
|
children,
|
|
@@ -386,6 +387,7 @@ var Link = React.forwardRef(
|
|
|
386
387
|
relative,
|
|
387
388
|
reloadDocument,
|
|
388
389
|
replace,
|
|
390
|
+
unstable_mask,
|
|
389
391
|
state,
|
|
390
392
|
target,
|
|
391
393
|
to,
|
|
@@ -394,17 +396,32 @@ var Link = React.forwardRef(
|
|
|
394
396
|
unstable_defaultShouldRevalidate,
|
|
395
397
|
...rest
|
|
396
398
|
}, forwardedRef) {
|
|
397
|
-
let { basename, unstable_useTransitions } = React.useContext(
|
|
399
|
+
let { basename, navigator, unstable_useTransitions } = React.useContext(_chunkXOLAXE2Zjs.NavigationContext);
|
|
398
400
|
let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
|
|
399
|
-
let parsed =
|
|
401
|
+
let parsed = _chunkXOLAXE2Zjs.parseToInfo.call(void 0, to, basename);
|
|
400
402
|
to = parsed.to;
|
|
401
|
-
let href =
|
|
402
|
-
let
|
|
403
|
+
let href = _chunkXOLAXE2Zjs.useHref.call(void 0, to, { relative });
|
|
404
|
+
let location = _chunkXOLAXE2Zjs.useLocation.call(void 0, );
|
|
405
|
+
let maskedHref = null;
|
|
406
|
+
if (unstable_mask) {
|
|
407
|
+
let resolved = _chunkXOLAXE2Zjs.resolveTo.call(void 0,
|
|
408
|
+
unstable_mask,
|
|
409
|
+
[],
|
|
410
|
+
location.unstable_mask ? location.unstable_mask.pathname : "/",
|
|
411
|
+
true
|
|
412
|
+
);
|
|
413
|
+
if (basename !== "/") {
|
|
414
|
+
resolved.pathname = resolved.pathname === "/" ? basename : _chunkXOLAXE2Zjs.joinPaths.call(void 0, [basename, resolved.pathname]);
|
|
415
|
+
}
|
|
416
|
+
maskedHref = navigator.createHref(resolved);
|
|
417
|
+
}
|
|
418
|
+
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkXOLAXE2Zjs.usePrefetchBehavior.call(void 0,
|
|
403
419
|
prefetch,
|
|
404
420
|
rest
|
|
405
421
|
);
|
|
406
422
|
let internalOnClick = useLinkClickHandler(to, {
|
|
407
423
|
replace,
|
|
424
|
+
unstable_mask,
|
|
408
425
|
state,
|
|
409
426
|
target,
|
|
410
427
|
preventScrollReset,
|
|
@@ -419,6 +436,7 @@ var Link = React.forwardRef(
|
|
|
419
436
|
internalOnClick(event);
|
|
420
437
|
}
|
|
421
438
|
}
|
|
439
|
+
let isSpaLink = !(parsed.isExternal || reloadDocument);
|
|
422
440
|
let link = (
|
|
423
441
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
424
442
|
/* @__PURE__ */ React.createElement(
|
|
@@ -426,15 +444,15 @@ var Link = React.forwardRef(
|
|
|
426
444
|
{
|
|
427
445
|
...rest,
|
|
428
446
|
...prefetchHandlers,
|
|
429
|
-
href: parsed.absoluteURL || href,
|
|
430
|
-
onClick:
|
|
431
|
-
ref:
|
|
447
|
+
href: (isSpaLink ? maskedHref : void 0) || parsed.absoluteURL || href,
|
|
448
|
+
onClick: isSpaLink ? handleClick : onClick,
|
|
449
|
+
ref: _chunkXOLAXE2Zjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
|
|
432
450
|
target,
|
|
433
451
|
"data-discover": !isAbsolute && discover === "render" ? "true" : void 0
|
|
434
452
|
}
|
|
435
453
|
)
|
|
436
454
|
);
|
|
437
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(
|
|
455
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunkXOLAXE2Zjs.PrefetchPageLinks, { page: href })) : link;
|
|
438
456
|
}
|
|
439
457
|
);
|
|
440
458
|
Link.displayName = "Link";
|
|
@@ -450,10 +468,10 @@ var NavLink = React.forwardRef(
|
|
|
450
468
|
children,
|
|
451
469
|
...rest
|
|
452
470
|
}, ref) {
|
|
453
|
-
let path =
|
|
454
|
-
let location =
|
|
455
|
-
let routerState = React.useContext(
|
|
456
|
-
let { navigator, basename } = React.useContext(
|
|
471
|
+
let path = _chunkXOLAXE2Zjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
|
|
472
|
+
let location = _chunkXOLAXE2Zjs.useLocation.call(void 0, );
|
|
473
|
+
let routerState = React.useContext(_chunkXOLAXE2Zjs.DataRouterStateContext);
|
|
474
|
+
let { navigator, basename } = React.useContext(_chunkXOLAXE2Zjs.NavigationContext);
|
|
457
475
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
458
476
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
459
477
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -466,7 +484,7 @@ var NavLink = React.forwardRef(
|
|
|
466
484
|
toPathname = toPathname.toLowerCase();
|
|
467
485
|
}
|
|
468
486
|
if (nextLocationPathname && basename) {
|
|
469
|
-
nextLocationPathname =
|
|
487
|
+
nextLocationPathname = _chunkXOLAXE2Zjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
|
|
470
488
|
}
|
|
471
489
|
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
472
490
|
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
@@ -522,7 +540,7 @@ var Form = React.forwardRef(
|
|
|
522
540
|
unstable_defaultShouldRevalidate,
|
|
523
541
|
...props
|
|
524
542
|
}, forwardedRef) => {
|
|
525
|
-
let { unstable_useTransitions } = React.useContext(
|
|
543
|
+
let { unstable_useTransitions } = React.useContext(_chunkXOLAXE2Zjs.NavigationContext);
|
|
526
544
|
let submit = useSubmit();
|
|
527
545
|
let formAction = useFormAction(action, { relative });
|
|
528
546
|
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
@@ -569,10 +587,10 @@ function ScrollRestoration({
|
|
|
569
587
|
storageKey,
|
|
570
588
|
...props
|
|
571
589
|
}) {
|
|
572
|
-
let remixContext = React.useContext(
|
|
573
|
-
let { basename } = React.useContext(
|
|
574
|
-
let location =
|
|
575
|
-
let matches =
|
|
590
|
+
let remixContext = React.useContext(_chunkXOLAXE2Zjs.FrameworkContext);
|
|
591
|
+
let { basename } = React.useContext(_chunkXOLAXE2Zjs.NavigationContext);
|
|
592
|
+
let location = _chunkXOLAXE2Zjs.useLocation.call(void 0, );
|
|
593
|
+
let matches = _chunkXOLAXE2Zjs.useMatches.call(void 0, );
|
|
576
594
|
useScrollRestoration({ getKey, storageKey });
|
|
577
595
|
let ssrKey = React.useMemo(
|
|
578
596
|
() => {
|
|
@@ -614,9 +632,9 @@ function ScrollRestoration({
|
|
|
614
632
|
...props,
|
|
615
633
|
suppressHydrationWarning: true,
|
|
616
634
|
dangerouslySetInnerHTML: {
|
|
617
|
-
__html: `(${restoreScroll})(${
|
|
635
|
+
__html: `(${restoreScroll})(${_chunkXOLAXE2Zjs.escapeHtml.call(void 0,
|
|
618
636
|
JSON.stringify(storageKey || SCROLL_RESTORATION_STORAGE_KEY)
|
|
619
|
-
)}, ${
|
|
637
|
+
)}, ${_chunkXOLAXE2Zjs.escapeHtml.call(void 0, JSON.stringify(ssrKey))})`
|
|
620
638
|
}
|
|
621
639
|
}
|
|
622
640
|
);
|
|
@@ -626,18 +644,19 @@ function getDataRouterConsoleError(hookName) {
|
|
|
626
644
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
627
645
|
}
|
|
628
646
|
function useDataRouterContext(hookName) {
|
|
629
|
-
let ctx = React.useContext(
|
|
630
|
-
|
|
647
|
+
let ctx = React.useContext(_chunkXOLAXE2Zjs.DataRouterContext);
|
|
648
|
+
_chunkXOLAXE2Zjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
|
|
631
649
|
return ctx;
|
|
632
650
|
}
|
|
633
651
|
function useDataRouterState(hookName) {
|
|
634
|
-
let state = React.useContext(
|
|
635
|
-
|
|
652
|
+
let state = React.useContext(_chunkXOLAXE2Zjs.DataRouterStateContext);
|
|
653
|
+
_chunkXOLAXE2Zjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
|
|
636
654
|
return state;
|
|
637
655
|
}
|
|
638
656
|
function useLinkClickHandler(to, {
|
|
639
657
|
target,
|
|
640
658
|
replace: replaceProp,
|
|
659
|
+
unstable_mask,
|
|
641
660
|
state,
|
|
642
661
|
preventScrollReset,
|
|
643
662
|
relative,
|
|
@@ -645,16 +664,17 @@ function useLinkClickHandler(to, {
|
|
|
645
664
|
unstable_defaultShouldRevalidate,
|
|
646
665
|
unstable_useTransitions
|
|
647
666
|
} = {}) {
|
|
648
|
-
let navigate =
|
|
649
|
-
let location =
|
|
650
|
-
let path =
|
|
667
|
+
let navigate = _chunkXOLAXE2Zjs.useNavigate.call(void 0, );
|
|
668
|
+
let location = _chunkXOLAXE2Zjs.useLocation.call(void 0, );
|
|
669
|
+
let path = _chunkXOLAXE2Zjs.useResolvedPath.call(void 0, to, { relative });
|
|
651
670
|
return React.useCallback(
|
|
652
671
|
(event) => {
|
|
653
672
|
if (shouldProcessLinkClick(event, target)) {
|
|
654
673
|
event.preventDefault();
|
|
655
|
-
let replace = replaceProp !== void 0 ? replaceProp :
|
|
674
|
+
let replace = replaceProp !== void 0 ? replaceProp : _chunkXOLAXE2Zjs.createPath.call(void 0, location) === _chunkXOLAXE2Zjs.createPath.call(void 0, path);
|
|
656
675
|
let doNavigate = () => navigate(to, {
|
|
657
676
|
replace,
|
|
677
|
+
unstable_mask,
|
|
658
678
|
state,
|
|
659
679
|
preventScrollReset,
|
|
660
680
|
relative,
|
|
@@ -673,6 +693,7 @@ function useLinkClickHandler(to, {
|
|
|
673
693
|
navigate,
|
|
674
694
|
path,
|
|
675
695
|
replaceProp,
|
|
696
|
+
unstable_mask,
|
|
676
697
|
state,
|
|
677
698
|
target,
|
|
678
699
|
to,
|
|
@@ -685,13 +706,13 @@ function useLinkClickHandler(to, {
|
|
|
685
706
|
);
|
|
686
707
|
}
|
|
687
708
|
function useSearchParams(defaultInit) {
|
|
688
|
-
|
|
709
|
+
_chunkXOLAXE2Zjs.warning.call(void 0,
|
|
689
710
|
typeof URLSearchParams !== "undefined",
|
|
690
711
|
`You cannot use the \`useSearchParams\` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.`
|
|
691
712
|
);
|
|
692
713
|
let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
|
|
693
714
|
let hasSetSearchParamsRef = React.useRef(false);
|
|
694
|
-
let location =
|
|
715
|
+
let location = _chunkXOLAXE2Zjs.useLocation.call(void 0, );
|
|
695
716
|
let searchParams = React.useMemo(
|
|
696
717
|
() => (
|
|
697
718
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
@@ -704,7 +725,7 @@ function useSearchParams(defaultInit) {
|
|
|
704
725
|
),
|
|
705
726
|
[location.search]
|
|
706
727
|
);
|
|
707
|
-
let navigate =
|
|
728
|
+
let navigate = _chunkXOLAXE2Zjs.useNavigate.call(void 0, );
|
|
708
729
|
let setSearchParams = React.useCallback(
|
|
709
730
|
(nextInit, navigateOptions) => {
|
|
710
731
|
const newSearchParams = createSearchParams(
|
|
@@ -721,8 +742,8 @@ var fetcherId = 0;
|
|
|
721
742
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
722
743
|
function useSubmit() {
|
|
723
744
|
let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
|
|
724
|
-
let { basename } = React.useContext(
|
|
725
|
-
let currentRouteId =
|
|
745
|
+
let { basename } = React.useContext(_chunkXOLAXE2Zjs.NavigationContext);
|
|
746
|
+
let currentRouteId = _chunkXOLAXE2Zjs.useRouteId.call(void 0, );
|
|
726
747
|
let routerFetch = router.fetch;
|
|
727
748
|
let routerNavigate = router.navigate;
|
|
728
749
|
return React.useCallback(
|
|
@@ -762,12 +783,12 @@ function useSubmit() {
|
|
|
762
783
|
);
|
|
763
784
|
}
|
|
764
785
|
function useFormAction(action, { relative } = {}) {
|
|
765
|
-
let { basename } = React.useContext(
|
|
766
|
-
let routeContext = React.useContext(
|
|
767
|
-
|
|
786
|
+
let { basename } = React.useContext(_chunkXOLAXE2Zjs.NavigationContext);
|
|
787
|
+
let routeContext = React.useContext(_chunkXOLAXE2Zjs.RouteContext);
|
|
788
|
+
_chunkXOLAXE2Zjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
|
|
768
789
|
let [match] = routeContext.matches.slice(-1);
|
|
769
|
-
let path = { ...
|
|
770
|
-
let location =
|
|
790
|
+
let path = { ..._chunkXOLAXE2Zjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
|
|
791
|
+
let location = _chunkXOLAXE2Zjs.useLocation.call(void 0, );
|
|
771
792
|
if (action == null) {
|
|
772
793
|
path.search = location.search;
|
|
773
794
|
let params = new URLSearchParams(path.search);
|
|
@@ -784,21 +805,21 @@ function useFormAction(action, { relative } = {}) {
|
|
|
784
805
|
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
785
806
|
}
|
|
786
807
|
if (basename !== "/") {
|
|
787
|
-
path.pathname = path.pathname === "/" ? basename :
|
|
808
|
+
path.pathname = path.pathname === "/" ? basename : _chunkXOLAXE2Zjs.joinPaths.call(void 0, [basename, path.pathname]);
|
|
788
809
|
}
|
|
789
|
-
return
|
|
810
|
+
return _chunkXOLAXE2Zjs.createPath.call(void 0, path);
|
|
790
811
|
}
|
|
791
812
|
function useFetcher({
|
|
792
813
|
key
|
|
793
814
|
} = {}) {
|
|
794
815
|
let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
|
|
795
816
|
let state = useDataRouterState("useFetcher" /* UseFetcher */);
|
|
796
|
-
let fetcherData = React.useContext(
|
|
797
|
-
let route = React.useContext(
|
|
817
|
+
let fetcherData = React.useContext(_chunkXOLAXE2Zjs.FetchersContext);
|
|
818
|
+
let route = React.useContext(_chunkXOLAXE2Zjs.RouteContext);
|
|
798
819
|
let routeId = _optionalChain([route, 'access', _23 => _23.matches, 'access', _24 => _24[route.matches.length - 1], 'optionalAccess', _25 => _25.route, 'access', _26 => _26.id]);
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
820
|
+
_chunkXOLAXE2Zjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
821
|
+
_chunkXOLAXE2Zjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
|
|
822
|
+
_chunkXOLAXE2Zjs.invariant.call(void 0,
|
|
802
823
|
routeId != null,
|
|
803
824
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
804
825
|
);
|
|
@@ -814,7 +835,7 @@ function useFetcher({
|
|
|
814
835
|
}, [deleteFetcher, getFetcher, fetcherKey]);
|
|
815
836
|
let load = React.useCallback(
|
|
816
837
|
async (href, opts) => {
|
|
817
|
-
|
|
838
|
+
_chunkXOLAXE2Zjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
|
|
818
839
|
await routerFetch(fetcherKey, routeId, href, opts);
|
|
819
840
|
},
|
|
820
841
|
[fetcherKey, routeId, routerFetch]
|
|
@@ -843,7 +864,7 @@ function useFetcher({
|
|
|
843
864
|
FetcherForm2.displayName = "fetcher.Form";
|
|
844
865
|
return FetcherForm2;
|
|
845
866
|
}, [fetcherKey]);
|
|
846
|
-
let fetcher = state.fetchers.get(fetcherKey) ||
|
|
867
|
+
let fetcher = state.fetchers.get(fetcherKey) || _chunkXOLAXE2Zjs.IDLE_FETCHER;
|
|
847
868
|
let data = fetcherData.get(fetcherKey);
|
|
848
869
|
let fetcherWithComponents = React.useMemo(
|
|
849
870
|
() => ({
|
|
@@ -874,7 +895,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
|
|
|
874
895
|
key = getKey(
|
|
875
896
|
{
|
|
876
897
|
...location,
|
|
877
|
-
pathname:
|
|
898
|
+
pathname: _chunkXOLAXE2Zjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
|
|
878
899
|
},
|
|
879
900
|
matches
|
|
880
901
|
);
|
|
@@ -895,10 +916,10 @@ function useScrollRestoration({
|
|
|
895
916
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
|
|
896
917
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
897
918
|
);
|
|
898
|
-
let { basename } = React.useContext(
|
|
899
|
-
let location =
|
|
900
|
-
let matches =
|
|
901
|
-
let navigation =
|
|
919
|
+
let { basename } = React.useContext(_chunkXOLAXE2Zjs.NavigationContext);
|
|
920
|
+
let location = _chunkXOLAXE2Zjs.useLocation.call(void 0, );
|
|
921
|
+
let matches = _chunkXOLAXE2Zjs.useMatches.call(void 0, );
|
|
922
|
+
let navigation = _chunkXOLAXE2Zjs.useNavigation.call(void 0, );
|
|
902
923
|
React.useEffect(() => {
|
|
903
924
|
window.history.scrollRestoration = "manual";
|
|
904
925
|
return () => {
|
|
@@ -917,7 +938,7 @@ function useScrollRestoration({
|
|
|
917
938
|
JSON.stringify(savedScrollPositions)
|
|
918
939
|
);
|
|
919
940
|
} catch (error) {
|
|
920
|
-
|
|
941
|
+
_chunkXOLAXE2Zjs.warning.call(void 0,
|
|
921
942
|
false,
|
|
922
943
|
`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
|
|
923
944
|
);
|
|
@@ -964,7 +985,7 @@ function useScrollRestoration({
|
|
|
964
985
|
}
|
|
965
986
|
}
|
|
966
987
|
} catch (e2) {
|
|
967
|
-
|
|
988
|
+
_chunkXOLAXE2Zjs.warning.call(void 0,
|
|
968
989
|
false,
|
|
969
990
|
`"${location.hash.slice(
|
|
970
991
|
1
|
|
@@ -1002,7 +1023,7 @@ function usePrompt({
|
|
|
1002
1023
|
when,
|
|
1003
1024
|
message
|
|
1004
1025
|
}) {
|
|
1005
|
-
let blocker =
|
|
1026
|
+
let blocker = _chunkXOLAXE2Zjs.useBlocker.call(void 0, when);
|
|
1006
1027
|
React.useEffect(() => {
|
|
1007
1028
|
if (blocker.state === "blocked") {
|
|
1008
1029
|
let proceed = window.confirm(message);
|
|
@@ -1020,21 +1041,21 @@ function usePrompt({
|
|
|
1020
1041
|
}, [blocker, when]);
|
|
1021
1042
|
}
|
|
1022
1043
|
function useViewTransitionState(to, { relative } = {}) {
|
|
1023
|
-
let vtContext = React.useContext(
|
|
1024
|
-
|
|
1044
|
+
let vtContext = React.useContext(_chunkXOLAXE2Zjs.ViewTransitionContext);
|
|
1045
|
+
_chunkXOLAXE2Zjs.invariant.call(void 0,
|
|
1025
1046
|
vtContext != null,
|
|
1026
1047
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1027
1048
|
);
|
|
1028
1049
|
let { basename } = useDataRouterContext(
|
|
1029
1050
|
"useViewTransitionState" /* useViewTransitionState */
|
|
1030
1051
|
);
|
|
1031
|
-
let path =
|
|
1052
|
+
let path = _chunkXOLAXE2Zjs.useResolvedPath.call(void 0, to, { relative });
|
|
1032
1053
|
if (!vtContext.isTransitioning) {
|
|
1033
1054
|
return false;
|
|
1034
1055
|
}
|
|
1035
|
-
let currentPath =
|
|
1036
|
-
let nextPath =
|
|
1037
|
-
return
|
|
1056
|
+
let currentPath = _chunkXOLAXE2Zjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1057
|
+
let nextPath = _chunkXOLAXE2Zjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1058
|
+
return _chunkXOLAXE2Zjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkXOLAXE2Zjs.matchPath.call(void 0, path.pathname, currentPath) != null;
|
|
1038
1059
|
}
|
|
1039
1060
|
|
|
1040
1061
|
// lib/dom/server.tsx
|
|
@@ -1045,7 +1066,7 @@ function StaticRouter({
|
|
|
1045
1066
|
location: locationProp = "/"
|
|
1046
1067
|
}) {
|
|
1047
1068
|
if (typeof locationProp === "string") {
|
|
1048
|
-
locationProp =
|
|
1069
|
+
locationProp = _chunkXOLAXE2Zjs.parsePath.call(void 0, locationProp);
|
|
1049
1070
|
}
|
|
1050
1071
|
let action = "POP" /* Pop */;
|
|
1051
1072
|
let location = {
|
|
@@ -1053,11 +1074,12 @@ function StaticRouter({
|
|
|
1053
1074
|
search: locationProp.search || "",
|
|
1054
1075
|
hash: locationProp.hash || "",
|
|
1055
1076
|
state: locationProp.state != null ? locationProp.state : null,
|
|
1056
|
-
key: locationProp.key || "default"
|
|
1077
|
+
key: locationProp.key || "default",
|
|
1078
|
+
unstable_mask: void 0
|
|
1057
1079
|
};
|
|
1058
1080
|
let staticNavigator = getStatelessNavigator();
|
|
1059
1081
|
return /* @__PURE__ */ React2.createElement(
|
|
1060
|
-
|
|
1082
|
+
_chunkXOLAXE2Zjs.Router,
|
|
1061
1083
|
{
|
|
1062
1084
|
basename,
|
|
1063
1085
|
children,
|
|
@@ -1075,7 +1097,7 @@ function StaticRouterProvider({
|
|
|
1075
1097
|
hydrate = true,
|
|
1076
1098
|
nonce
|
|
1077
1099
|
}) {
|
|
1078
|
-
|
|
1100
|
+
_chunkXOLAXE2Zjs.invariant.call(void 0,
|
|
1079
1101
|
router && context,
|
|
1080
1102
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1081
1103
|
);
|
|
@@ -1094,12 +1116,12 @@ function StaticRouterProvider({
|
|
|
1094
1116
|
actionData: context.actionData,
|
|
1095
1117
|
errors: serializeErrors(context.errors)
|
|
1096
1118
|
};
|
|
1097
|
-
let json =
|
|
1119
|
+
let json = _chunkXOLAXE2Zjs.escapeHtml.call(void 0, JSON.stringify(JSON.stringify(data)));
|
|
1098
1120
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
1099
1121
|
}
|
|
1100
1122
|
let { state } = dataRouterContext.router;
|
|
1101
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
1102
|
-
|
|
1123
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunkXOLAXE2Zjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunkXOLAXE2Zjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunkXOLAXE2Zjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunkXOLAXE2Zjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
|
|
1124
|
+
_chunkXOLAXE2Zjs.Router,
|
|
1103
1125
|
{
|
|
1104
1126
|
basename: dataRouterContext.basename,
|
|
1105
1127
|
location: state.location,
|
|
@@ -1109,11 +1131,12 @@ function StaticRouterProvider({
|
|
|
1109
1131
|
unstable_useTransitions: false
|
|
1110
1132
|
},
|
|
1111
1133
|
/* @__PURE__ */ React2.createElement(
|
|
1112
|
-
DataRoutes,
|
|
1134
|
+
_chunkXOLAXE2Zjs.DataRoutes,
|
|
1113
1135
|
{
|
|
1114
1136
|
routes: router.routes,
|
|
1115
1137
|
future: router.future,
|
|
1116
|
-
state
|
|
1138
|
+
state,
|
|
1139
|
+
isStatic: true
|
|
1117
1140
|
}
|
|
1118
1141
|
)
|
|
1119
1142
|
))))), hydrateScript ? /* @__PURE__ */ React2.createElement(
|
|
@@ -1125,19 +1148,12 @@ function StaticRouterProvider({
|
|
|
1125
1148
|
}
|
|
1126
1149
|
) : null);
|
|
1127
1150
|
}
|
|
1128
|
-
function DataRoutes({
|
|
1129
|
-
routes,
|
|
1130
|
-
future,
|
|
1131
|
-
state
|
|
1132
|
-
}) {
|
|
1133
|
-
return _chunkWICQJKU6js.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
|
|
1134
|
-
}
|
|
1135
1151
|
function serializeErrors(errors) {
|
|
1136
1152
|
if (!errors) return null;
|
|
1137
1153
|
let entries = Object.entries(errors);
|
|
1138
1154
|
let serialized = {};
|
|
1139
1155
|
for (let [key, val] of entries) {
|
|
1140
|
-
if (
|
|
1156
|
+
if (_chunkXOLAXE2Zjs.isRouteErrorResponse.call(void 0, val)) {
|
|
1141
1157
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
1142
1158
|
} else if (val instanceof Error) {
|
|
1143
1159
|
serialized[key] = {
|
|
@@ -1187,16 +1203,16 @@ function getStatelessNavigator() {
|
|
|
1187
1203
|
};
|
|
1188
1204
|
}
|
|
1189
1205
|
function createStaticHandler2(routes, opts) {
|
|
1190
|
-
return
|
|
1206
|
+
return _chunkXOLAXE2Zjs.createStaticHandler.call(void 0, routes, {
|
|
1191
1207
|
...opts,
|
|
1192
|
-
mapRouteProperties:
|
|
1208
|
+
mapRouteProperties: _chunkXOLAXE2Zjs.mapRouteProperties
|
|
1193
1209
|
});
|
|
1194
1210
|
}
|
|
1195
1211
|
function createStaticRouter(routes, context, opts = {}) {
|
|
1196
1212
|
let manifest = {};
|
|
1197
|
-
let dataRoutes =
|
|
1213
|
+
let dataRoutes = _chunkXOLAXE2Zjs.convertRoutesToDataRoutes.call(void 0,
|
|
1198
1214
|
routes,
|
|
1199
|
-
|
|
1215
|
+
_chunkXOLAXE2Zjs.mapRouteProperties,
|
|
1200
1216
|
void 0,
|
|
1201
1217
|
manifest
|
|
1202
1218
|
);
|
|
@@ -1227,7 +1243,8 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1227
1243
|
actionData: context.actionData,
|
|
1228
1244
|
errors: context.errors,
|
|
1229
1245
|
initialized: true,
|
|
1230
|
-
|
|
1246
|
+
renderFallback: false,
|
|
1247
|
+
navigation: _chunkXOLAXE2Zjs.IDLE_NAVIGATION,
|
|
1231
1248
|
restoreScrollPosition: null,
|
|
1232
1249
|
preventScrollReset: false,
|
|
1233
1250
|
revalidation: "idle",
|
|
@@ -1262,7 +1279,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1262
1279
|
createHref,
|
|
1263
1280
|
encodeLocation,
|
|
1264
1281
|
getFetcher() {
|
|
1265
|
-
return
|
|
1282
|
+
return _chunkXOLAXE2Zjs.IDLE_FETCHER;
|
|
1266
1283
|
},
|
|
1267
1284
|
deleteFetcher() {
|
|
1268
1285
|
throw msg("deleteFetcher");
|
|
@@ -1274,7 +1291,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1274
1291
|
throw msg("dispose");
|
|
1275
1292
|
},
|
|
1276
1293
|
getBlocker() {
|
|
1277
|
-
return
|
|
1294
|
+
return _chunkXOLAXE2Zjs.IDLE_BLOCKER;
|
|
1278
1295
|
},
|
|
1279
1296
|
deleteBlocker() {
|
|
1280
1297
|
throw msg("deleteBlocker");
|
|
@@ -1292,10 +1309,10 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1292
1309
|
};
|
|
1293
1310
|
}
|
|
1294
1311
|
function createHref(to) {
|
|
1295
|
-
return typeof to === "string" ? to :
|
|
1312
|
+
return typeof to === "string" ? to : _chunkXOLAXE2Zjs.createPath.call(void 0, to);
|
|
1296
1313
|
}
|
|
1297
1314
|
function encodeLocation(to) {
|
|
1298
|
-
let href = typeof to === "string" ? to :
|
|
1315
|
+
let href = typeof to === "string" ? to : _chunkXOLAXE2Zjs.createPath.call(void 0, to);
|
|
1299
1316
|
href = href.replace(/ $/, "%20");
|
|
1300
1317
|
let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
1301
1318
|
return {
|