react-router 7.18.5 → 7.18.6
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 +14 -0
- package/dist/{production/chunk-K3NA4NUH.js → development/chunk-3QTLHDUO.js} +7 -7
- package/dist/{production/chunk-IAM5GYT3.mjs → development/chunk-E2PF4K4Z.mjs} +14 -5
- package/dist/development/{chunk-NDF5KBLP.js → chunk-QM7ETCUK.js} +109 -104
- package/dist/development/{chunk-2ZBLYC7V.js → chunk-S47XUPN5.js} +105 -65
- package/dist/development/{chunk-6KYCQHYJ.mjs → chunk-YDNE64FV.mjs} +107 -63
- package/dist/development/dom-export.js +37 -35
- package/dist/development/dom-export.mjs +6 -4
- 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.js +72 -3
- package/dist/development/index-react-server.mjs +72 -3
- package/dist/development/index.d.mts +1 -1
- package/dist/development/index.d.ts +1 -1
- package/dist/development/index.js +111 -102
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{chunk-75HN637G.js → chunk-2WUBOUFU.js} +109 -104
- package/dist/{development/chunk-IFHLIXZW.js → production/chunk-3IBQ4CTZ.js} +7 -7
- package/dist/production/{chunk-HNBICOIU.js → chunk-AC65NKOP.js} +105 -65
- package/dist/production/{chunk-7RTFRKQW.mjs → chunk-HEAXLYUI.mjs} +107 -63
- package/dist/{development/chunk-JAHXRPFV.mjs → production/chunk-JRCXCPLA.mjs} +14 -5
- package/dist/production/dom-export.js +37 -35
- package/dist/production/dom-export.mjs +6 -4
- 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.js +72 -3
- package/dist/production/index-react-server.mjs +72 -3
- package/dist/production/index.d.mts +1 -1
- package/dist/production/index.d.ts +1 -1
- package/dist/production/index.js +111 -102
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
package/dist/production/index.js
CHANGED
|
@@ -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 _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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.18.
|
|
2
|
+
* react-router v7.18.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk3IBQ4CTZjs = require('./chunk-3IBQ4CTZ.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -40,7 +40,7 @@ var _chunkK3NA4NUHjs = require('./chunk-K3NA4NUH.js');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunk2WUBOUFUjs = require('./chunk-2WUBOUFU.js');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -157,7 +157,8 @@ var _chunk75HN637Gjs = require('./chunk-75HN637G.js');
|
|
|
157
157
|
|
|
158
158
|
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
|
|
161
|
+
var _chunkAC65NKOPjs = require('./chunk-AC65NKOP.js');
|
|
161
162
|
|
|
162
163
|
// lib/dom/ssr/server.tsx
|
|
163
164
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -170,7 +171,7 @@ function ServerRouter({
|
|
|
170
171
|
url = new URL(url);
|
|
171
172
|
}
|
|
172
173
|
let { manifest, routeModules, criticalCss, serverHandoffString } = context;
|
|
173
|
-
let routes =
|
|
174
|
+
let routes = _chunkAC65NKOPjs.createServerRoutes.call(void 0,
|
|
174
175
|
manifest.routes,
|
|
175
176
|
routeModules,
|
|
176
177
|
context.future,
|
|
@@ -183,7 +184,7 @@ function ServerRouter({
|
|
|
183
184
|
let routeId = match.route.id;
|
|
184
185
|
let route = routeModules[routeId];
|
|
185
186
|
let manifestRoute = context.manifest.routes[routeId];
|
|
186
|
-
if (route && manifestRoute &&
|
|
187
|
+
if (route && manifestRoute && _chunkAC65NKOPjs.shouldHydrateRouteLoader.call(void 0,
|
|
187
188
|
routeId,
|
|
188
189
|
route.clientLoader,
|
|
189
190
|
manifestRoute.hasLoader,
|
|
@@ -192,11 +193,11 @@ function ServerRouter({
|
|
|
192
193
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
|
-
let router =
|
|
196
|
+
let router = _chunk2WUBOUFUjs.createStaticRouter.call(void 0, routes, context.staticHandlerContext, {
|
|
196
197
|
branches: context.branches
|
|
197
198
|
});
|
|
198
199
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
199
|
-
|
|
200
|
+
_chunkAC65NKOPjs.FrameworkContext.Provider,
|
|
200
201
|
{
|
|
201
202
|
value: {
|
|
202
203
|
manifest,
|
|
@@ -212,8 +213,8 @@ function ServerRouter({
|
|
|
212
213
|
renderMeta: context.renderMeta
|
|
213
214
|
}
|
|
214
215
|
},
|
|
215
|
-
/* @__PURE__ */ React.createElement(
|
|
216
|
-
|
|
216
|
+
/* @__PURE__ */ React.createElement(_chunkAC65NKOPjs.RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
217
|
+
_chunk2WUBOUFUjs.StaticRouterProvider,
|
|
217
218
|
{
|
|
218
219
|
router,
|
|
219
220
|
context: context.staticHandlerContext,
|
|
@@ -221,7 +222,7 @@ function ServerRouter({
|
|
|
221
222
|
}
|
|
222
223
|
))
|
|
223
224
|
), context.serverHandoffStream ? /* @__PURE__ */ React.createElement(React.Suspense, null, /* @__PURE__ */ React.createElement(
|
|
224
|
-
|
|
225
|
+
_chunkAC65NKOPjs.StreamTransfer,
|
|
225
226
|
{
|
|
226
227
|
context,
|
|
227
228
|
identifier: 0,
|
|
@@ -264,18 +265,18 @@ function createRoutesStub(routes, _context) {
|
|
|
264
265
|
let patched = processRoutes(
|
|
265
266
|
// @ts-expect-error `StubRouteObject` is stricter about `loader`/`action`
|
|
266
267
|
// types compared to `RouteObject`
|
|
267
|
-
|
|
268
|
-
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _5 => _5.v8_middleware]) ? new (0,
|
|
268
|
+
_chunkAC65NKOPjs.convertRoutesToDataRoutes.call(void 0, routes, (r) => r),
|
|
269
|
+
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _5 => _5.v8_middleware]) ? new (0, _chunkAC65NKOPjs.RouterContextProvider)() : {},
|
|
269
270
|
frameworkContextRef.current.manifest,
|
|
270
271
|
frameworkContextRef.current.routeModules
|
|
271
272
|
);
|
|
272
|
-
routerRef.current =
|
|
273
|
+
routerRef.current = _chunkAC65NKOPjs.createMemoryRouter.call(void 0, patched, {
|
|
273
274
|
initialEntries,
|
|
274
275
|
initialIndex,
|
|
275
276
|
hydrationData
|
|
276
277
|
});
|
|
277
278
|
}
|
|
278
|
-
return /* @__PURE__ */ React2.createElement(
|
|
279
|
+
return /* @__PURE__ */ React2.createElement(_chunkAC65NKOPjs.FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(_chunkAC65NKOPjs.RouterProvider, { router: routerRef.current }));
|
|
279
280
|
};
|
|
280
281
|
}
|
|
281
282
|
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
@@ -289,9 +290,9 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
289
290
|
id: route.id,
|
|
290
291
|
path: route.path,
|
|
291
292
|
index: route.index,
|
|
292
|
-
Component: route.Component ?
|
|
293
|
-
HydrateFallback: route.HydrateFallback ?
|
|
294
|
-
ErrorBoundary: route.ErrorBoundary ?
|
|
293
|
+
Component: route.Component ? _chunkAC65NKOPjs.withComponentProps.call(void 0, route.Component) : void 0,
|
|
294
|
+
HydrateFallback: route.HydrateFallback ? _chunkAC65NKOPjs.withHydrateFallbackProps.call(void 0, route.HydrateFallback) : void 0,
|
|
295
|
+
ErrorBoundary: route.ErrorBoundary ? _chunkAC65NKOPjs.withErrorBoundaryProps.call(void 0, route.ErrorBoundary) : void 0,
|
|
295
296
|
action: route.action ? (args) => route.action({ ...args, context }) : void 0,
|
|
296
297
|
loader: route.loader ? (args) => route.loader({ ...args, context }) : void 0,
|
|
297
298
|
middleware: route.middleware ? route.middleware.map(
|
|
@@ -326,7 +327,7 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
326
327
|
};
|
|
327
328
|
manifest.routes[newRoute.id] = entryRoute;
|
|
328
329
|
routeModules[route.id] = {
|
|
329
|
-
default: newRoute.Component ||
|
|
330
|
+
default: newRoute.Component || _chunkAC65NKOPjs.Outlet,
|
|
330
331
|
ErrorBoundary: newRoute.ErrorBoundary || void 0,
|
|
331
332
|
handle: route.handle,
|
|
332
333
|
links: route.links,
|
|
@@ -521,7 +522,7 @@ function myUnescape(value) {
|
|
|
521
522
|
return result;
|
|
522
523
|
}
|
|
523
524
|
function warnOnceAboutExpiresCookie(name, expires) {
|
|
524
|
-
|
|
525
|
+
_chunkAC65NKOPjs.warnOnce.call(void 0,
|
|
525
526
|
!expires,
|
|
526
527
|
`The "${name}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`
|
|
527
528
|
);
|
|
@@ -583,7 +584,7 @@ function invariant2(value, message) {
|
|
|
583
584
|
|
|
584
585
|
// lib/server-runtime/routeMatching.ts
|
|
585
586
|
function matchServerRoutes(manifest, dataRoutes, branches, pathname, basename) {
|
|
586
|
-
let matches =
|
|
587
|
+
let matches = _chunkAC65NKOPjs.matchRoutesImpl.call(void 0,
|
|
587
588
|
dataRoutes,
|
|
588
589
|
pathname,
|
|
589
590
|
_nullishCoalesce(basename, () => ( "/")),
|
|
@@ -614,7 +615,7 @@ async function callRouteHandler(handler, args, future) {
|
|
|
614
615
|
context: args.context,
|
|
615
616
|
pattern: args.pattern
|
|
616
617
|
});
|
|
617
|
-
if (
|
|
618
|
+
if (_chunkAC65NKOPjs.isDataWithResponseInit.call(void 0, result) && result.init && result.init.status && _chunkAC65NKOPjs.isRedirectStatusCode.call(void 0, result.init.status)) {
|
|
618
619
|
throw new Response(null, result.init);
|
|
619
620
|
}
|
|
620
621
|
return result;
|
|
@@ -717,17 +718,17 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
717
718
|
controller.close();
|
|
718
719
|
}
|
|
719
720
|
});
|
|
720
|
-
let decoded = await
|
|
721
|
+
let decoded = await _chunkAC65NKOPjs.decodeViaTurboStream.call(void 0, stream, global);
|
|
721
722
|
let data2 = decoded.value;
|
|
722
|
-
if (data2 &&
|
|
723
|
-
let result = data2[
|
|
723
|
+
if (data2 && _chunkAC65NKOPjs.SingleFetchRedirectSymbol in data2) {
|
|
724
|
+
let result = data2[_chunkAC65NKOPjs.SingleFetchRedirectSymbol];
|
|
724
725
|
let init = { status: result.status };
|
|
725
726
|
if (result.reload) {
|
|
726
|
-
throw
|
|
727
|
+
throw _chunkAC65NKOPjs.redirectDocument.call(void 0, result.redirect, init);
|
|
727
728
|
} else if (result.replace) {
|
|
728
|
-
throw
|
|
729
|
+
throw _chunkAC65NKOPjs.replace.call(void 0, result.redirect, init);
|
|
729
730
|
} else {
|
|
730
|
-
throw
|
|
731
|
+
throw _chunkAC65NKOPjs.redirect.call(void 0, result.redirect, init);
|
|
731
732
|
}
|
|
732
733
|
} else {
|
|
733
734
|
invariant2(
|
|
@@ -770,7 +771,7 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
770
771
|
|
|
771
772
|
// lib/server-runtime/serverHandoff.ts
|
|
772
773
|
function createServerHandoffString(serverHandoff) {
|
|
773
|
-
return
|
|
774
|
+
return _chunkAC65NKOPjs.escapeHtml.call(void 0, JSON.stringify(serverHandoff));
|
|
774
775
|
}
|
|
775
776
|
|
|
776
777
|
// lib/server-runtime/headers.ts
|
|
@@ -929,12 +930,12 @@ function getNormalizedPath(request, basename, future) {
|
|
|
929
930
|
pathname = pathname.replace(/\.data$/, "");
|
|
930
931
|
}
|
|
931
932
|
} else {
|
|
932
|
-
if (
|
|
933
|
+
if (_chunkAC65NKOPjs.stripBasename.call(void 0, pathname, basename) === "/_root.data") {
|
|
933
934
|
pathname = basename;
|
|
934
935
|
} else if (pathname.endsWith(".data")) {
|
|
935
936
|
pathname = pathname.replace(/\.data$/, "");
|
|
936
937
|
}
|
|
937
|
-
if (
|
|
938
|
+
if (_chunkAC65NKOPjs.stripBasename.call(void 0, pathname, basename) !== "/" && pathname.endsWith("/")) {
|
|
938
939
|
pathname = pathname.slice(0, -1);
|
|
939
940
|
}
|
|
940
941
|
}
|
|
@@ -954,7 +955,7 @@ function getNormalizedPath(request, basename, future) {
|
|
|
954
955
|
|
|
955
956
|
// lib/server-runtime/single-fetch.ts
|
|
956
957
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
957
|
-
...
|
|
958
|
+
..._chunkAC65NKOPjs.NO_BODY_STATUS_CODES,
|
|
958
959
|
304
|
|
959
960
|
]);
|
|
960
961
|
async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
|
|
@@ -986,14 +987,16 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
986
987
|
return handleQueryError(error);
|
|
987
988
|
}
|
|
988
989
|
} : void 0,
|
|
989
|
-
|
|
990
|
+
// Normalize the original request because handlerRequest may already have
|
|
991
|
+
// its .data suffix removed when v8_passThroughRequests is disabled.
|
|
992
|
+
normalizePath: () => getNormalizedPath(request, build.basename, build.future)
|
|
990
993
|
});
|
|
991
994
|
return handleQueryResult(result);
|
|
992
995
|
} catch (error) {
|
|
993
996
|
return handleQueryError(error);
|
|
994
997
|
}
|
|
995
998
|
function handleQueryResult(result) {
|
|
996
|
-
return
|
|
999
|
+
return _chunkAC65NKOPjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
997
1000
|
}
|
|
998
1001
|
function handleQueryError(error, status = 500) {
|
|
999
1002
|
handleError(error);
|
|
@@ -1005,12 +1008,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
1005
1008
|
}
|
|
1006
1009
|
function staticContextToResponse(context) {
|
|
1007
1010
|
let headers = getDocumentHeaders(context, build);
|
|
1008
|
-
if (
|
|
1011
|
+
if (_chunkAC65NKOPjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
1009
1012
|
return new Response(null, { status: context.statusCode, headers });
|
|
1010
1013
|
}
|
|
1011
1014
|
if (context.errors) {
|
|
1012
1015
|
Object.values(context.errors).forEach((err) => {
|
|
1013
|
-
if (!
|
|
1016
|
+
if (!_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1014
1017
|
handleError(err);
|
|
1015
1018
|
}
|
|
1016
1019
|
});
|
|
@@ -1051,14 +1054,16 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
1051
1054
|
return handleQueryError(error);
|
|
1052
1055
|
}
|
|
1053
1056
|
} : void 0,
|
|
1054
|
-
|
|
1057
|
+
// Normalize the original request because handlerRequest may already have
|
|
1058
|
+
// its .data suffix removed when v8_passThroughRequests is disabled.
|
|
1059
|
+
normalizePath: () => getNormalizedPath(request, build.basename, build.future)
|
|
1055
1060
|
});
|
|
1056
1061
|
return handleQueryResult(result);
|
|
1057
1062
|
} catch (error) {
|
|
1058
1063
|
return handleQueryError(error);
|
|
1059
1064
|
}
|
|
1060
1065
|
function handleQueryResult(result) {
|
|
1061
|
-
return
|
|
1066
|
+
return _chunkAC65NKOPjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
1062
1067
|
}
|
|
1063
1068
|
function handleQueryError(error) {
|
|
1064
1069
|
handleError(error);
|
|
@@ -1070,12 +1075,12 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
1070
1075
|
}
|
|
1071
1076
|
function staticContextToResponse(context) {
|
|
1072
1077
|
let headers = getDocumentHeaders(context, build);
|
|
1073
|
-
if (
|
|
1078
|
+
if (_chunkAC65NKOPjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
1074
1079
|
return new Response(null, { status: context.statusCode, headers });
|
|
1075
1080
|
}
|
|
1076
1081
|
if (context.errors) {
|
|
1077
1082
|
Object.values(context.errors).forEach((err) => {
|
|
1078
|
-
if (!
|
|
1083
|
+
if (!_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1079
1084
|
handleError(err);
|
|
1080
1085
|
}
|
|
1081
1086
|
});
|
|
@@ -1139,15 +1144,15 @@ function generateSingleFetchRedirectResponse(redirectResponse, request, build, s
|
|
|
1139
1144
|
headers.delete("Location");
|
|
1140
1145
|
headers.set("Content-Type", "text/x-script");
|
|
1141
1146
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
1142
|
-
result: request.method === "GET" ? { [
|
|
1147
|
+
result: request.method === "GET" ? { [_chunkAC65NKOPjs.SingleFetchRedirectSymbol]: redirect2 } : redirect2,
|
|
1143
1148
|
headers,
|
|
1144
|
-
status:
|
|
1149
|
+
status: _chunkAC65NKOPjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1145
1150
|
});
|
|
1146
1151
|
}
|
|
1147
1152
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
1148
1153
|
let redirect2 = headers.get("Location");
|
|
1149
1154
|
if (basename) {
|
|
1150
|
-
redirect2 =
|
|
1155
|
+
redirect2 = _chunkAC65NKOPjs.stripBasename.call(void 0, redirect2, basename) || redirect2;
|
|
1151
1156
|
}
|
|
1152
1157
|
return {
|
|
1153
1158
|
redirect: redirect2,
|
|
@@ -1184,7 +1189,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1184
1189
|
clearTimeout(timeoutId);
|
|
1185
1190
|
requestSignal.removeEventListener("abort", abortControllerOnRequestAbort);
|
|
1186
1191
|
};
|
|
1187
|
-
return
|
|
1192
|
+
return _chunkAC65NKOPjs.encode.call(void 0, data2, {
|
|
1188
1193
|
signal: controller.signal,
|
|
1189
1194
|
onComplete: cleanupCallbacks,
|
|
1190
1195
|
plugins: [
|
|
@@ -1193,12 +1198,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1193
1198
|
let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
|
|
1194
1199
|
return ["SanitizedError", name, message, stack];
|
|
1195
1200
|
}
|
|
1196
|
-
if (value instanceof
|
|
1201
|
+
if (value instanceof _chunkAC65NKOPjs.ErrorResponseImpl) {
|
|
1197
1202
|
let { data: data3, status, statusText } = value;
|
|
1198
1203
|
return ["ErrorResponse", data3, status, statusText];
|
|
1199
1204
|
}
|
|
1200
|
-
if (value && typeof value === "object" &&
|
|
1201
|
-
return ["SingleFetchRedirect", value[
|
|
1205
|
+
if (value && typeof value === "object" && _chunkAC65NKOPjs.SingleFetchRedirectSymbol in value) {
|
|
1206
|
+
return ["SingleFetchRedirect", value[_chunkAC65NKOPjs.SingleFetchRedirectSymbol]];
|
|
1202
1207
|
}
|
|
1203
1208
|
}
|
|
1204
1209
|
],
|
|
@@ -1220,7 +1225,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1220
1225
|
function derive(build, mode) {
|
|
1221
1226
|
let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
|
|
1222
1227
|
let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
|
|
1223
|
-
let staticHandler =
|
|
1228
|
+
let staticHandler = _chunkAC65NKOPjs.createStaticHandler.call(void 0, dataRoutes, {
|
|
1224
1229
|
basename: build.basename,
|
|
1225
1230
|
instrumentations: build.entry.module.instrumentations,
|
|
1226
1231
|
future: build.future
|
|
@@ -1229,7 +1234,7 @@ function derive(build, mode) {
|
|
|
1229
1234
|
if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
|
|
1230
1235
|
console.error(
|
|
1231
1236
|
// @ts-expect-error This is "private" from users but intended for internal use
|
|
1232
|
-
|
|
1237
|
+
_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, error) && error.error ? error.error : error
|
|
1233
1238
|
);
|
|
1234
1239
|
}
|
|
1235
1240
|
});
|
|
@@ -1247,14 +1252,14 @@ function derive(build, mode) {
|
|
|
1247
1252
|
});
|
|
1248
1253
|
};
|
|
1249
1254
|
if (build.future.v8_middleware) {
|
|
1250
|
-
if (initialContext && !(initialContext instanceof
|
|
1255
|
+
if (initialContext && !(initialContext instanceof _chunkAC65NKOPjs.RouterContextProvider)) {
|
|
1251
1256
|
let error = new Error(
|
|
1252
1257
|
"Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function."
|
|
1253
1258
|
);
|
|
1254
1259
|
handleError(error);
|
|
1255
1260
|
return returnLastResortErrorResponse(error, serverMode);
|
|
1256
1261
|
}
|
|
1257
|
-
loadContext = initialContext || new (0,
|
|
1262
|
+
loadContext = initialContext || new (0, _chunkAC65NKOPjs.RouterContextProvider)();
|
|
1258
1263
|
} else {
|
|
1259
1264
|
loadContext = initialContext || {};
|
|
1260
1265
|
}
|
|
@@ -1268,10 +1273,10 @@ function derive(build, mode) {
|
|
|
1268
1273
|
if (!build.ssr) {
|
|
1269
1274
|
let decodedPath = decodeURI(normalizedPathname);
|
|
1270
1275
|
if (build.basename && build.basename !== "/") {
|
|
1271
|
-
let strippedPath =
|
|
1276
|
+
let strippedPath = _chunkAC65NKOPjs.stripBasename.call(void 0, decodedPath, build.basename);
|
|
1272
1277
|
if (strippedPath == null) {
|
|
1273
1278
|
errorHandler(
|
|
1274
|
-
new (0,
|
|
1279
|
+
new (0, _chunkAC65NKOPjs.ErrorResponseImpl)(
|
|
1275
1280
|
404,
|
|
1276
1281
|
"Not Found",
|
|
1277
1282
|
`Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${build.basename}\``
|
|
@@ -1294,7 +1299,7 @@ function derive(build, mode) {
|
|
|
1294
1299
|
} else if (!build.prerender.includes(decodedPath.replace(/\/$/, "")) && !build.prerender.includes(decodedPath.replace(/[^/]$/, "/"))) {
|
|
1295
1300
|
if (requestUrl.pathname.endsWith(".data")) {
|
|
1296
1301
|
errorHandler(
|
|
1297
|
-
new (0,
|
|
1302
|
+
new (0, _chunkAC65NKOPjs.ErrorResponseImpl)(
|
|
1298
1303
|
404,
|
|
1299
1304
|
"Not Found",
|
|
1300
1305
|
`Refusing to SSR the path \`${decodedPath}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`
|
|
@@ -1314,7 +1319,7 @@ function derive(build, mode) {
|
|
|
1314
1319
|
}
|
|
1315
1320
|
}
|
|
1316
1321
|
}
|
|
1317
|
-
let manifestUrl =
|
|
1322
|
+
let manifestUrl = _chunkAC65NKOPjs.getManifestPath.call(void 0,
|
|
1318
1323
|
build.routeDiscovery.manifestPath,
|
|
1319
1324
|
build.basename
|
|
1320
1325
|
);
|
|
@@ -1353,7 +1358,7 @@ function derive(build, mode) {
|
|
|
1353
1358
|
loadContext,
|
|
1354
1359
|
handleError
|
|
1355
1360
|
);
|
|
1356
|
-
if (
|
|
1361
|
+
if (_chunkAC65NKOPjs.isRedirectResponse.call(void 0, response)) {
|
|
1357
1362
|
response = generateSingleFetchRedirectResponse(
|
|
1358
1363
|
response,
|
|
1359
1364
|
request,
|
|
@@ -1367,7 +1372,7 @@ function derive(build, mode) {
|
|
|
1367
1372
|
params: matches ? matches[0].params : {},
|
|
1368
1373
|
request
|
|
1369
1374
|
});
|
|
1370
|
-
if (
|
|
1375
|
+
if (_chunkAC65NKOPjs.isRedirectResponse.call(void 0, response)) {
|
|
1371
1376
|
response = generateSingleFetchRedirectResponse(
|
|
1372
1377
|
response,
|
|
1373
1378
|
request,
|
|
@@ -1406,6 +1411,8 @@ function derive(build, mode) {
|
|
|
1406
1411
|
);
|
|
1407
1412
|
}
|
|
1408
1413
|
if (request.method === "HEAD") {
|
|
1414
|
+
_optionalChain([response, 'access', _15 => _15.body, 'optionalAccess', _16 => _16.cancel, 'call', _17 => _17(), 'access', _18 => _18.catch, 'call', _19 => _19(() => {
|
|
1415
|
+
})]);
|
|
1409
1416
|
return new Response(null, {
|
|
1410
1417
|
headers: response.headers,
|
|
1411
1418
|
status: response.status,
|
|
@@ -1415,7 +1422,7 @@ function derive(build, mode) {
|
|
|
1415
1422
|
return response;
|
|
1416
1423
|
};
|
|
1417
1424
|
if (build.entry.module.instrumentations) {
|
|
1418
|
-
requestHandler =
|
|
1425
|
+
requestHandler = _chunkAC65NKOPjs.instrumentHandler.call(void 0,
|
|
1419
1426
|
requestHandler,
|
|
1420
1427
|
build.entry.module.instrumentations.map((i) => i.handler).filter(Boolean)
|
|
1421
1428
|
);
|
|
@@ -1452,7 +1459,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1452
1459
|
};
|
|
1453
1460
|
};
|
|
1454
1461
|
async function handleManifestRequest(build, dataRoutes, branches, url) {
|
|
1455
|
-
if (url.toString().length >
|
|
1462
|
+
if (url.toString().length > _chunkAC65NKOPjs.URL_LIMIT) {
|
|
1456
1463
|
return new Response(null, {
|
|
1457
1464
|
statusText: "Bad Request",
|
|
1458
1465
|
status: 400
|
|
@@ -1502,7 +1509,7 @@ async function handleManifestRequest(build, dataRoutes, branches, url) {
|
|
|
1502
1509
|
async function handleSingleFetchRequest(serverMode, build, staticHandler, request, normalizedPath, loadContext, handleError) {
|
|
1503
1510
|
let handlerUrl = new URL(request.url);
|
|
1504
1511
|
handlerUrl.pathname = normalizedPath;
|
|
1505
|
-
let response =
|
|
1512
|
+
let response = _chunkAC65NKOPjs.isMutationMethod.call(void 0, request.method) ? await singleFetchAction(
|
|
1506
1513
|
build,
|
|
1507
1514
|
serverMode,
|
|
1508
1515
|
staticHandler,
|
|
@@ -1523,7 +1530,7 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
|
|
|
1523
1530
|
}
|
|
1524
1531
|
async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, isSpaMode, criticalCss) {
|
|
1525
1532
|
try {
|
|
1526
|
-
if (
|
|
1533
|
+
if (_chunkAC65NKOPjs.isMutationMethod.call(void 0, request.method)) {
|
|
1527
1534
|
try {
|
|
1528
1535
|
throwIfPotentialCSRFAttack(
|
|
1529
1536
|
request,
|
|
@@ -1539,7 +1546,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1539
1546
|
generateMiddlewareResponse: build.future.v8_middleware ? async (query) => {
|
|
1540
1547
|
try {
|
|
1541
1548
|
let innerResult = await query(request);
|
|
1542
|
-
if (!
|
|
1549
|
+
if (!_chunkAC65NKOPjs.isResponse.call(void 0, innerResult)) {
|
|
1543
1550
|
innerResult = await renderHtml(innerResult, isSpaMode);
|
|
1544
1551
|
}
|
|
1545
1552
|
return innerResult;
|
|
@@ -1550,7 +1557,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1550
1557
|
} : void 0,
|
|
1551
1558
|
normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
|
|
1552
1559
|
});
|
|
1553
|
-
if (!
|
|
1560
|
+
if (!_chunkAC65NKOPjs.isResponse.call(void 0, result)) {
|
|
1554
1561
|
result = await renderHtml(result, isSpaMode);
|
|
1555
1562
|
}
|
|
1556
1563
|
return result;
|
|
@@ -1565,7 +1572,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1565
1572
|
}
|
|
1566
1573
|
if (context.errors) {
|
|
1567
1574
|
Object.values(context.errors).forEach((err) => {
|
|
1568
|
-
if (!
|
|
1575
|
+
if (!_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1569
1576
|
handleError(err);
|
|
1570
1577
|
}
|
|
1571
1578
|
});
|
|
@@ -1577,7 +1584,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1577
1584
|
errors: context.errors
|
|
1578
1585
|
};
|
|
1579
1586
|
let routeDiscovery = build.routeDiscovery;
|
|
1580
|
-
if (
|
|
1587
|
+
if (_chunkAC65NKOPjs.isFogOfWarEnabled.call(void 0, routeDiscovery, build.ssr) && _chunkAC65NKOPjs.shouldUseInitialRouteDiscovery.call(void 0,
|
|
1581
1588
|
context.location.pathname,
|
|
1582
1589
|
staticHandler._matchCost
|
|
1583
1590
|
)) {
|
|
@@ -1625,10 +1632,10 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1625
1632
|
} catch (error) {
|
|
1626
1633
|
handleError(error);
|
|
1627
1634
|
let errorForSecondRender = error;
|
|
1628
|
-
if (
|
|
1635
|
+
if (_chunkAC65NKOPjs.isResponse.call(void 0, error)) {
|
|
1629
1636
|
try {
|
|
1630
1637
|
let data2 = await unwrapResponse(error);
|
|
1631
|
-
errorForSecondRender = new (0,
|
|
1638
|
+
errorForSecondRender = new (0, _chunkAC65NKOPjs.ErrorResponseImpl)(
|
|
1632
1639
|
error.status,
|
|
1633
1640
|
error.statusText,
|
|
1634
1641
|
data2
|
|
@@ -1636,7 +1643,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1636
1643
|
} catch (e) {
|
|
1637
1644
|
}
|
|
1638
1645
|
}
|
|
1639
|
-
context =
|
|
1646
|
+
context = _chunkAC65NKOPjs.getStaticContextFromError.call(void 0,
|
|
1640
1647
|
staticHandler.dataRoutes,
|
|
1641
1648
|
context,
|
|
1642
1649
|
errorForSecondRender
|
|
@@ -1696,7 +1703,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1696
1703
|
return handleQueryRouteError(error);
|
|
1697
1704
|
}
|
|
1698
1705
|
function handleQueryRouteResult(result) {
|
|
1699
|
-
if (
|
|
1706
|
+
if (_chunkAC65NKOPjs.isResponse.call(void 0, result)) {
|
|
1700
1707
|
return result;
|
|
1701
1708
|
}
|
|
1702
1709
|
if (typeof result === "string") {
|
|
@@ -1705,10 +1712,10 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1705
1712
|
return Response.json(result);
|
|
1706
1713
|
}
|
|
1707
1714
|
function handleQueryRouteError(error) {
|
|
1708
|
-
if (
|
|
1715
|
+
if (_chunkAC65NKOPjs.isResponse.call(void 0, error)) {
|
|
1709
1716
|
return error;
|
|
1710
1717
|
}
|
|
1711
|
-
if (
|
|
1718
|
+
if (_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1712
1719
|
handleError(error);
|
|
1713
1720
|
return errorResponseToJson(error, serverMode);
|
|
1714
1721
|
}
|
|
@@ -1802,7 +1809,7 @@ function createSessionStorage({
|
|
|
1802
1809
|
updateData,
|
|
1803
1810
|
deleteData
|
|
1804
1811
|
}) {
|
|
1805
|
-
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess',
|
|
1812
|
+
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess', _20 => _20.name]) || "__session", cookieArg);
|
|
1806
1813
|
warnOnceAboutSigningSessionCookie(cookie);
|
|
1807
1814
|
return {
|
|
1808
1815
|
async getSession(cookieHeader, options) {
|
|
@@ -1812,7 +1819,7 @@ function createSessionStorage({
|
|
|
1812
1819
|
},
|
|
1813
1820
|
async commitSession(session, options) {
|
|
1814
1821
|
let { id, data: data2 } = session;
|
|
1815
|
-
let expires = _optionalChain([options, 'optionalAccess',
|
|
1822
|
+
let expires = _optionalChain([options, 'optionalAccess', _21 => _21.maxAge]) != null ? new Date(Date.now() + options.maxAge * 1e3) : _optionalChain([options, 'optionalAccess', _22 => _22.expires]) != null ? options.expires : cookie.expires;
|
|
1816
1823
|
if (id) {
|
|
1817
1824
|
await updateData(id, data2, expires);
|
|
1818
1825
|
} else {
|
|
@@ -1831,7 +1838,7 @@ function createSessionStorage({
|
|
|
1831
1838
|
};
|
|
1832
1839
|
}
|
|
1833
1840
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
1834
|
-
|
|
1841
|
+
_chunkAC65NKOPjs.warnOnce.call(void 0,
|
|
1835
1842
|
cookie.isSigned,
|
|
1836
1843
|
`The "${cookie.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.`
|
|
1837
1844
|
);
|
|
@@ -1839,7 +1846,7 @@ function warnOnceAboutSigningSessionCookie(cookie) {
|
|
|
1839
1846
|
|
|
1840
1847
|
// lib/server-runtime/sessions/cookieStorage.ts
|
|
1841
1848
|
function createCookieSessionStorage({ cookie: cookieArg } = {}) {
|
|
1842
|
-
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess',
|
|
1849
|
+
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess', _23 => _23.name]) || "__session", cookieArg);
|
|
1843
1850
|
warnOnceAboutSigningSessionCookie(cookie);
|
|
1844
1851
|
return {
|
|
1845
1852
|
async getSession(cookieHeader, options) {
|
|
@@ -1903,7 +1910,7 @@ function href(path, ...args) {
|
|
|
1903
1910
|
// same regex as in .\router\utils.ts: compilePath().
|
|
1904
1911
|
(_, param, questionMark) => {
|
|
1905
1912
|
const isRequired = questionMark === void 0;
|
|
1906
|
-
const value = _optionalChain([params, 'optionalAccess',
|
|
1913
|
+
const value = _optionalChain([params, 'optionalAccess', _24 => _24[param]]);
|
|
1907
1914
|
if (isRequired && value === void 0) {
|
|
1908
1915
|
throw new Error(
|
|
1909
1916
|
`Path '${path}' requires param '${param}' but it was not provided`
|
|
@@ -1913,12 +1920,14 @@ function href(path, ...args) {
|
|
|
1913
1920
|
}
|
|
1914
1921
|
);
|
|
1915
1922
|
if (path.endsWith("*")) {
|
|
1916
|
-
const value = _optionalChain([params, 'optionalAccess',
|
|
1923
|
+
const value = _optionalChain([params, 'optionalAccess', _25 => _25["*"]]);
|
|
1917
1924
|
if (value !== void 0) {
|
|
1918
1925
|
result += "/" + value;
|
|
1919
1926
|
}
|
|
1920
1927
|
}
|
|
1921
|
-
|
|
1928
|
+
result = result.replace(/^[\\/]{2,}/, "/") || "/";
|
|
1929
|
+
_chunkAC65NKOPjs.validateDocumentNavigationTarget.call(void 0, result);
|
|
1930
|
+
return result;
|
|
1922
1931
|
}
|
|
1923
1932
|
function trimTrailingSplat(path) {
|
|
1924
1933
|
let i = path.length - 1;
|
|
@@ -2112,8 +2121,8 @@ async function routeRSCServerRequest({
|
|
|
2112
2121
|
const payload = await createFromReadableStream(
|
|
2113
2122
|
detectRedirectResponse.body
|
|
2114
2123
|
);
|
|
2115
|
-
if (serverResponse.status ===
|
|
2116
|
-
if (
|
|
2124
|
+
if (serverResponse.status === _chunkAC65NKOPjs.SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
|
|
2125
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, payload.location)) {
|
|
2117
2126
|
throw new Error("Invalid redirect location");
|
|
2118
2127
|
}
|
|
2119
2128
|
const headers2 = new Headers(serverResponse.headers);
|
|
@@ -2122,7 +2131,7 @@ async function routeRSCServerRequest({
|
|
|
2122
2131
|
headers2.delete("Content-Type");
|
|
2123
2132
|
headers2.delete("X-Remix-Response");
|
|
2124
2133
|
headers2.set("Location", payload.location);
|
|
2125
|
-
return new Response(_optionalChain([serverResponseB, 'optionalAccess',
|
|
2134
|
+
return new Response(_optionalChain([serverResponseB, 'optionalAccess', _26 => _26.body]) || "", {
|
|
2126
2135
|
headers: headers2,
|
|
2127
2136
|
status: payload.status,
|
|
2128
2137
|
statusText: serverResponse.statusText
|
|
@@ -2134,11 +2143,11 @@ async function routeRSCServerRequest({
|
|
|
2134
2143
|
let html = await renderHTML(getPayload, {
|
|
2135
2144
|
onError(error) {
|
|
2136
2145
|
if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
|
|
2137
|
-
renderRedirect =
|
|
2146
|
+
renderRedirect = _chunkAC65NKOPjs.decodeRedirectErrorDigest.call(void 0, error.digest);
|
|
2138
2147
|
if (renderRedirect) {
|
|
2139
2148
|
return error.digest;
|
|
2140
2149
|
}
|
|
2141
|
-
let routeErrorResponse =
|
|
2150
|
+
let routeErrorResponse = _chunkAC65NKOPjs.decodeRouteErrorResponseDigest.call(void 0, error.digest);
|
|
2142
2151
|
if (routeErrorResponse) {
|
|
2143
2152
|
renderError = routeErrorResponse;
|
|
2144
2153
|
status = routeErrorResponse.status;
|
|
@@ -2159,7 +2168,7 @@ async function routeRSCServerRequest({
|
|
|
2159
2168
|
}
|
|
2160
2169
|
headers.set("Content-Type", "text/html; charset=utf-8");
|
|
2161
2170
|
if (renderRedirect) {
|
|
2162
|
-
if (
|
|
2171
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, renderRedirect.location)) {
|
|
2163
2172
|
throw new Error("Invalid redirect location");
|
|
2164
2173
|
}
|
|
2165
2174
|
headers.set("Location", renderRedirect.location);
|
|
@@ -2171,12 +2180,12 @@ async function routeRSCServerRequest({
|
|
|
2171
2180
|
const redirectTransform = new TransformStream({
|
|
2172
2181
|
flush(controller) {
|
|
2173
2182
|
if (renderRedirect) {
|
|
2174
|
-
if (
|
|
2183
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, renderRedirect.location)) {
|
|
2175
2184
|
return;
|
|
2176
2185
|
}
|
|
2177
2186
|
controller.enqueue(
|
|
2178
2187
|
new TextEncoder().encode(
|
|
2179
|
-
`<meta http-equiv="refresh" content="0;url=${
|
|
2188
|
+
`<meta http-equiv="refresh" content="0;url=${_chunkAC65NKOPjs.escapeAttribute.call(void 0, renderRedirect.location)}"/>`
|
|
2180
2189
|
)
|
|
2181
2190
|
);
|
|
2182
2191
|
}
|
|
@@ -2189,7 +2198,7 @@ async function routeRSCServerRequest({
|
|
|
2189
2198
|
headers
|
|
2190
2199
|
});
|
|
2191
2200
|
}
|
|
2192
|
-
if (!_optionalChain([serverResponseB, 'optionalAccess',
|
|
2201
|
+
if (!_optionalChain([serverResponseB, 'optionalAccess', _27 => _27.body])) {
|
|
2193
2202
|
throw new Error("Failed to clone server response");
|
|
2194
2203
|
}
|
|
2195
2204
|
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(redirectTransform);
|
|
@@ -2203,7 +2212,7 @@ async function routeRSCServerRequest({
|
|
|
2203
2212
|
return error;
|
|
2204
2213
|
}
|
|
2205
2214
|
if (renderRedirect) {
|
|
2206
|
-
if (
|
|
2215
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, renderRedirect.location)) {
|
|
2207
2216
|
throw new Error("Invalid redirect location");
|
|
2208
2217
|
}
|
|
2209
2218
|
return new Response(`Redirect: ${renderRedirect.location}`, {
|
|
@@ -2215,7 +2224,7 @@ async function routeRSCServerRequest({
|
|
|
2215
2224
|
}
|
|
2216
2225
|
try {
|
|
2217
2226
|
let normalizedError = _nullishCoalesce(renderError, () => ( error));
|
|
2218
|
-
let [status, statusText] =
|
|
2227
|
+
let [status, statusText] = _chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, normalizedError) ? [normalizedError.status, normalizedError.statusText] : [500, ""];
|
|
2219
2228
|
let retryRedirect;
|
|
2220
2229
|
let reactHeaders = new Headers();
|
|
2221
2230
|
const html = await renderHTML(
|
|
@@ -2252,11 +2261,11 @@ async function routeRSCServerRequest({
|
|
|
2252
2261
|
{
|
|
2253
2262
|
onError(error2) {
|
|
2254
2263
|
if (typeof error2 === "object" && error2 && "digest" in error2 && typeof error2.digest === "string") {
|
|
2255
|
-
retryRedirect =
|
|
2264
|
+
retryRedirect = _chunkAC65NKOPjs.decodeRedirectErrorDigest.call(void 0, error2.digest);
|
|
2256
2265
|
if (retryRedirect) {
|
|
2257
2266
|
return error2.digest;
|
|
2258
2267
|
}
|
|
2259
|
-
let routeErrorResponse =
|
|
2268
|
+
let routeErrorResponse = _chunkAC65NKOPjs.decodeRouteErrorResponseDigest.call(void 0,
|
|
2260
2269
|
error2.digest
|
|
2261
2270
|
);
|
|
2262
2271
|
if (routeErrorResponse) {
|
|
@@ -2279,7 +2288,7 @@ async function routeRSCServerRequest({
|
|
|
2279
2288
|
}
|
|
2280
2289
|
headers.set("Content-Type", "text/html; charset=utf-8");
|
|
2281
2290
|
if (retryRedirect) {
|
|
2282
|
-
if (
|
|
2291
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, retryRedirect.location)) {
|
|
2283
2292
|
throw new Error("Invalid redirect location");
|
|
2284
2293
|
}
|
|
2285
2294
|
headers.set("Location", retryRedirect.location);
|
|
@@ -2291,12 +2300,12 @@ async function routeRSCServerRequest({
|
|
|
2291
2300
|
const retryRedirectTransform = new TransformStream({
|
|
2292
2301
|
flush(controller) {
|
|
2293
2302
|
if (retryRedirect) {
|
|
2294
|
-
if (
|
|
2303
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, retryRedirect.location)) {
|
|
2295
2304
|
return;
|
|
2296
2305
|
}
|
|
2297
2306
|
controller.enqueue(
|
|
2298
2307
|
new TextEncoder().encode(
|
|
2299
|
-
`<meta http-equiv="refresh" content="0;url=${
|
|
2308
|
+
`<meta http-equiv="refresh" content="0;url=${_chunkAC65NKOPjs.escapeAttribute.call(void 0, retryRedirect.location)}"/>`
|
|
2300
2309
|
)
|
|
2301
2310
|
);
|
|
2302
2311
|
}
|
|
@@ -2309,7 +2318,7 @@ async function routeRSCServerRequest({
|
|
|
2309
2318
|
headers
|
|
2310
2319
|
});
|
|
2311
2320
|
}
|
|
2312
|
-
if (!_optionalChain([serverResponseB, 'optionalAccess',
|
|
2321
|
+
if (!_optionalChain([serverResponseB, 'optionalAccess', _28 => _28.body])) {
|
|
2313
2322
|
throw new Error("Failed to clone server response");
|
|
2314
2323
|
}
|
|
2315
2324
|
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(retryRedirectTransform);
|
|
@@ -2327,7 +2336,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2327
2336
|
const decoded = getPayload();
|
|
2328
2337
|
const payload = useSafe(decoded);
|
|
2329
2338
|
if (payload.type === "redirect") {
|
|
2330
|
-
if (
|
|
2339
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, payload.location)) {
|
|
2331
2340
|
throw new Error("Invalid redirect location");
|
|
2332
2341
|
}
|
|
2333
2342
|
throw new Response(null, {
|
|
@@ -2340,7 +2349,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2340
2349
|
if (payload.type !== "render") return null;
|
|
2341
2350
|
let patchedLoaderData = { ...payload.loaderData };
|
|
2342
2351
|
for (const match of payload.matches) {
|
|
2343
|
-
if (
|
|
2352
|
+
if (_chunkAC65NKOPjs.shouldHydrateRouteLoader.call(void 0,
|
|
2344
2353
|
match.id,
|
|
2345
2354
|
match.clientLoader,
|
|
2346
2355
|
match.hasLoader,
|
|
@@ -2380,7 +2389,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2380
2389
|
}
|
|
2381
2390
|
}))
|
|
2382
2391
|
};
|
|
2383
|
-
const router =
|
|
2392
|
+
const router = _chunk2WUBOUFUjs.createStaticRouter.call(void 0,
|
|
2384
2393
|
payload.matches.reduceRight((previous, match) => {
|
|
2385
2394
|
const route = {
|
|
2386
2395
|
id: match.id,
|
|
@@ -2428,10 +2437,10 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2428
2437
|
mode: "lazy",
|
|
2429
2438
|
manifestPath: payload.routeDiscovery.manifestPath || defaultManifestPath
|
|
2430
2439
|
},
|
|
2431
|
-
routeModules:
|
|
2440
|
+
routeModules: _chunk3IBQ4CTZjs.createRSCRouteModules.call(void 0, payload)
|
|
2432
2441
|
};
|
|
2433
|
-
return /* @__PURE__ */ React3.createElement(
|
|
2434
|
-
|
|
2442
|
+
return /* @__PURE__ */ React3.createElement(_chunkAC65NKOPjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunk3IBQ4CTZjs.RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React3.createElement(_chunkAC65NKOPjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
2443
|
+
_chunk2WUBOUFUjs.StaticRouterProvider,
|
|
2435
2444
|
{
|
|
2436
2445
|
context,
|
|
2437
2446
|
router,
|
|
@@ -2576,4 +2585,4 @@ function isManifestRequest(url) {
|
|
|
2576
2585
|
|
|
2577
2586
|
|
|
2578
2587
|
|
|
2579
|
-
exports.Await =
|
|
2588
|
+
exports.Await = _chunkAC65NKOPjs.Await; exports.BrowserRouter = _chunk2WUBOUFUjs.BrowserRouter; exports.Form = _chunk2WUBOUFUjs.Form; exports.HashRouter = _chunk2WUBOUFUjs.HashRouter; exports.IDLE_BLOCKER = _chunkAC65NKOPjs.IDLE_BLOCKER; exports.IDLE_FETCHER = _chunkAC65NKOPjs.IDLE_FETCHER; exports.IDLE_NAVIGATION = _chunkAC65NKOPjs.IDLE_NAVIGATION; exports.Link = _chunk2WUBOUFUjs.Link; exports.Links = _chunkAC65NKOPjs.Links; exports.MemoryRouter = _chunkAC65NKOPjs.MemoryRouter; exports.Meta = _chunkAC65NKOPjs.Meta; exports.NavLink = _chunk2WUBOUFUjs.NavLink; exports.Navigate = _chunkAC65NKOPjs.Navigate; exports.NavigationType = _chunkAC65NKOPjs.Action; exports.Outlet = _chunkAC65NKOPjs.Outlet; exports.PrefetchPageLinks = _chunkAC65NKOPjs.PrefetchPageLinks; exports.Route = _chunkAC65NKOPjs.Route; exports.Router = _chunkAC65NKOPjs.Router; exports.RouterContextProvider = _chunkAC65NKOPjs.RouterContextProvider; exports.RouterProvider = _chunkAC65NKOPjs.RouterProvider; exports.Routes = _chunkAC65NKOPjs.Routes; exports.Scripts = _chunkAC65NKOPjs.Scripts; exports.ScrollRestoration = _chunk2WUBOUFUjs.ScrollRestoration; exports.ServerRouter = ServerRouter; exports.StaticRouter = _chunk2WUBOUFUjs.StaticRouter; exports.StaticRouterProvider = _chunk2WUBOUFUjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkAC65NKOPjs.AwaitContextProvider; exports.UNSAFE_DataRouterContext = _chunkAC65NKOPjs.DataRouterContext; exports.UNSAFE_DataRouterStateContext = _chunkAC65NKOPjs.DataRouterStateContext; exports.UNSAFE_ErrorResponseImpl = _chunkAC65NKOPjs.ErrorResponseImpl; exports.UNSAFE_FetchersContext = _chunkAC65NKOPjs.FetchersContext; exports.UNSAFE_FrameworkContext = _chunkAC65NKOPjs.FrameworkContext; exports.UNSAFE_LocationContext = _chunkAC65NKOPjs.LocationContext; exports.UNSAFE_NavigationContext = _chunkAC65NKOPjs.NavigationContext; exports.UNSAFE_RSCDefaultRootErrorBoundary = _chunk3IBQ4CTZjs.RSCDefaultRootErrorBoundary; exports.UNSAFE_RemixErrorBoundary = _chunkAC65NKOPjs.RemixErrorBoundary; exports.UNSAFE_RouteContext = _chunkAC65NKOPjs.RouteContext; exports.UNSAFE_ServerMode = ServerMode; exports.UNSAFE_SingleFetchRedirectSymbol = _chunkAC65NKOPjs.SingleFetchRedirectSymbol; exports.UNSAFE_ViewTransitionContext = _chunkAC65NKOPjs.ViewTransitionContext; exports.UNSAFE_WithComponentProps = _chunkAC65NKOPjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkAC65NKOPjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkAC65NKOPjs.WithHydrateFallbackProps; exports.UNSAFE_createBrowserHistory = _chunkAC65NKOPjs.createBrowserHistory; exports.UNSAFE_createClientRoutes = _chunkAC65NKOPjs.createClientRoutes; exports.UNSAFE_createClientRoutesWithHMRRevalidationOptOut = _chunkAC65NKOPjs.createClientRoutesWithHMRRevalidationOptOut; exports.UNSAFE_createHashHistory = _chunkAC65NKOPjs.createHashHistory; exports.UNSAFE_createMemoryHistory = _chunkAC65NKOPjs.createMemoryHistory; exports.UNSAFE_createRouter = _chunkAC65NKOPjs.createRouter; exports.UNSAFE_decodeViaTurboStream = _chunkAC65NKOPjs.decodeViaTurboStream; exports.UNSAFE_getHydrationData = _chunk3IBQ4CTZjs.getHydrationData; exports.UNSAFE_getPatchRoutesOnNavigationFunction = _chunkAC65NKOPjs.getPatchRoutesOnNavigationFunction; exports.UNSAFE_getTurboStreamSingleFetchDataStrategy = _chunkAC65NKOPjs.getTurboStreamSingleFetchDataStrategy; exports.UNSAFE_hydrationRouteProperties = _chunkAC65NKOPjs.hydrationRouteProperties; exports.UNSAFE_invariant = _chunkAC65NKOPjs.invariant; exports.UNSAFE_mapRouteProperties = _chunkAC65NKOPjs.mapRouteProperties; exports.UNSAFE_shouldHydrateRouteLoader = _chunkAC65NKOPjs.shouldHydrateRouteLoader; exports.UNSAFE_useFogOFWarDiscovery = _chunkAC65NKOPjs.useFogOFWarDiscovery; exports.UNSAFE_useScrollRestoration = _chunk2WUBOUFUjs.useScrollRestoration; exports.UNSAFE_withComponentProps = _chunkAC65NKOPjs.withComponentProps; exports.UNSAFE_withErrorBoundaryProps = _chunkAC65NKOPjs.withErrorBoundaryProps; exports.UNSAFE_withHydrateFallbackProps = _chunkAC65NKOPjs.withHydrateFallbackProps; exports.createBrowserRouter = _chunk2WUBOUFUjs.createBrowserRouter; exports.createContext = _chunkAC65NKOPjs.createContext; exports.createCookie = createCookie; exports.createCookieSessionStorage = createCookieSessionStorage; exports.createHashRouter = _chunk2WUBOUFUjs.createHashRouter; exports.createMemoryRouter = _chunkAC65NKOPjs.createMemoryRouter; exports.createMemorySessionStorage = createMemorySessionStorage; exports.createPath = _chunkAC65NKOPjs.createPath; exports.createRequestHandler = createRequestHandler; exports.createRoutesFromChildren = _chunkAC65NKOPjs.createRoutesFromChildren; exports.createRoutesFromElements = _chunkAC65NKOPjs.createRoutesFromElements; exports.createRoutesStub = createRoutesStub; exports.createSearchParams = _chunk2WUBOUFUjs.createSearchParams; exports.createSession = createSession; exports.createSessionStorage = createSessionStorage; exports.createStaticHandler = _chunk2WUBOUFUjs.createStaticHandler; exports.createStaticRouter = _chunk2WUBOUFUjs.createStaticRouter; exports.data = _chunkAC65NKOPjs.data; exports.generatePath = _chunkAC65NKOPjs.generatePath; exports.href = href; exports.isCookie = isCookie; exports.isRouteErrorResponse = _chunkAC65NKOPjs.isRouteErrorResponse; exports.isSession = isSession; exports.matchPath = _chunkAC65NKOPjs.matchPath; exports.matchRoutes = _chunkAC65NKOPjs.matchRoutes; exports.parsePath = _chunkAC65NKOPjs.parsePath; exports.redirect = _chunkAC65NKOPjs.redirect; exports.redirectDocument = _chunkAC65NKOPjs.redirectDocument; exports.renderMatches = _chunkAC65NKOPjs.renderMatches; exports.replace = _chunkAC65NKOPjs.replace; exports.resolvePath = _chunkAC65NKOPjs.resolvePath; exports.unstable_HistoryRouter = _chunk2WUBOUFUjs.HistoryRouter; exports.unstable_RSCStaticRouter = RSCStaticRouter; exports.unstable_routeRSCServerRequest = routeRSCServerRequest; exports.unstable_setDevServerHooks = setDevServerHooks; exports.unstable_usePrompt = _chunk2WUBOUFUjs.usePrompt; exports.unstable_useRoute = _chunkAC65NKOPjs.useRoute; exports.unstable_useRouterState = _chunkAC65NKOPjs.useRouterState; exports.useActionData = _chunkAC65NKOPjs.useActionData; exports.useAsyncError = _chunkAC65NKOPjs.useAsyncError; exports.useAsyncValue = _chunkAC65NKOPjs.useAsyncValue; exports.useBeforeUnload = _chunk2WUBOUFUjs.useBeforeUnload; exports.useBlocker = _chunkAC65NKOPjs.useBlocker; exports.useFetcher = _chunk2WUBOUFUjs.useFetcher; exports.useFetchers = _chunk2WUBOUFUjs.useFetchers; exports.useFormAction = _chunk2WUBOUFUjs.useFormAction; exports.useHref = _chunkAC65NKOPjs.useHref; exports.useInRouterContext = _chunkAC65NKOPjs.useInRouterContext; exports.useLinkClickHandler = _chunk2WUBOUFUjs.useLinkClickHandler; exports.useLoaderData = _chunkAC65NKOPjs.useLoaderData; exports.useLocation = _chunkAC65NKOPjs.useLocation; exports.useMatch = _chunkAC65NKOPjs.useMatch; exports.useMatches = _chunkAC65NKOPjs.useMatches; exports.useNavigate = _chunkAC65NKOPjs.useNavigate; exports.useNavigation = _chunkAC65NKOPjs.useNavigation; exports.useNavigationType = _chunkAC65NKOPjs.useNavigationType; exports.useOutlet = _chunkAC65NKOPjs.useOutlet; exports.useOutletContext = _chunkAC65NKOPjs.useOutletContext; exports.useParams = _chunkAC65NKOPjs.useParams; exports.useResolvedPath = _chunkAC65NKOPjs.useResolvedPath; exports.useRevalidator = _chunkAC65NKOPjs.useRevalidator; exports.useRouteError = _chunkAC65NKOPjs.useRouteError; exports.useRouteLoaderData = _chunkAC65NKOPjs.useRouteLoaderData; exports.useRoutes = _chunkAC65NKOPjs.useRoutes; exports.useSearchParams = _chunk2WUBOUFUjs.useSearchParams; exports.useSubmit = _chunk2WUBOUFUjs.useSubmit; exports.useViewTransitionState = _chunk2WUBOUFUjs.useViewTransitionState;
|