Area restrita - Questionario
This commit is contained in:
+59
-64
@@ -1,5 +1,5 @@
|
||||
"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; }/**
|
||||
* react-router v7.14.0
|
||||
* react-router v7.17.0
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
|
||||
var _chunkWAVMRYR2js = require('./chunk-WAVMRYR2.js');
|
||||
var _chunkPBLBZ3QUjs = require('./chunk-PBLBZ3QU.js');
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@ var _chunkWAVMRYR2js = require('./chunk-WAVMRYR2.js');
|
||||
|
||||
|
||||
|
||||
var _chunkIK6APEEGjs = require('./chunk-IK6APEEG.js');
|
||||
|
||||
var _chunkKFNXW4ALjs = require('./chunk-KFNXW4AL.js');
|
||||
|
||||
// lib/dom-export/dom-router-provider.tsx
|
||||
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
||||
@@ -90,7 +91,7 @@ function initSsrInfo() {
|
||||
}
|
||||
function createHydratedRouter({
|
||||
getContext,
|
||||
unstable_instrumentations
|
||||
instrumentations
|
||||
}) {
|
||||
initSsrInfo();
|
||||
if (!ssrInfo) {
|
||||
@@ -163,10 +164,10 @@ function createHydratedRouter({
|
||||
getContext,
|
||||
hydrationData,
|
||||
hydrationRouteProperties: _reactrouter.UNSAFE_hydrationRouteProperties,
|
||||
unstable_instrumentations,
|
||||
instrumentations,
|
||||
mapRouteProperties: _reactrouter.UNSAFE_mapRouteProperties,
|
||||
future: {
|
||||
unstable_passThroughRequests: ssrInfo.context.future.unstable_passThroughRequests
|
||||
v8_passThroughRequests: ssrInfo.context.future.v8_passThroughRequests
|
||||
},
|
||||
dataStrategy: _reactrouter.UNSAFE_getTurboStreamSingleFetchDataStrategy.call(void 0,
|
||||
() => router2,
|
||||
@@ -174,7 +175,7 @@ function createHydratedRouter({
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.basename,
|
||||
ssrInfo.context.future.unstable_trailingSlashAwareDataRequests
|
||||
ssrInfo.context.future.v8_trailingSlashAwareDataRequests
|
||||
),
|
||||
patchRoutesOnNavigation: _reactrouter.UNSAFE_getPatchRoutesOnNavigationFunction.call(void 0,
|
||||
() => router2,
|
||||
@@ -200,7 +201,7 @@ function HydratedRouter(props) {
|
||||
if (!router) {
|
||||
router = createHydratedRouter({
|
||||
getContext: props.getContext,
|
||||
unstable_instrumentations: props.unstable_instrumentations
|
||||
instrumentations: props.instrumentations
|
||||
});
|
||||
}
|
||||
let [criticalCss, setCriticalCss] = React2.useState(
|
||||
@@ -213,7 +214,7 @@ function HydratedRouter(props) {
|
||||
}, []);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
||||
document.querySelectorAll(`[${_chunkIK6APEEGjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
||||
document.querySelectorAll(`[${_chunkKFNXW4ALjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
||||
}
|
||||
}, [criticalCss]);
|
||||
let [location2, setLocation] = React2.useState(router.state.location);
|
||||
@@ -261,7 +262,7 @@ function HydratedRouter(props) {
|
||||
RouterProvider2,
|
||||
{
|
||||
router,
|
||||
unstable_useTransitions: props.unstable_useTransitions,
|
||||
useTransitions: props.useTransitions,
|
||||
onError: props.onError
|
||||
}
|
||||
))
|
||||
@@ -392,7 +393,7 @@ function createRouterFromPayload({
|
||||
};
|
||||
if (payload.type !== "render") throw new Error("Invalid payload type");
|
||||
globalVar.__reactRouterRouteModules = _nullishCoalesce(globalVar.__reactRouterRouteModules, () => ( {}));
|
||||
_chunkWAVMRYR2js.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
|
||||
_chunkPBLBZ3QUjs.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
|
||||
let routes = payload.matches.reduceRight((previous, match) => {
|
||||
const route = createRouteFromServerManifest(
|
||||
match,
|
||||
@@ -406,12 +407,12 @@ function createRouterFromPayload({
|
||||
return [route];
|
||||
}, []);
|
||||
let applyPatchesPromise;
|
||||
globalVar.__reactRouterDataRouter = _chunkIK6APEEGjs.createRouter.call(void 0, {
|
||||
globalVar.__reactRouterDataRouter = _chunkKFNXW4ALjs.createRouter.call(void 0, {
|
||||
routes,
|
||||
getContext,
|
||||
basename: payload.basename,
|
||||
history: _chunkIK6APEEGjs.createBrowserHistory.call(void 0, ),
|
||||
hydrationData: _chunkWAVMRYR2js.getHydrationData.call(void 0, {
|
||||
history: _chunkKFNXW4ALjs.createBrowserHistory.call(void 0, ),
|
||||
hydrationData: _chunkPBLBZ3QUjs.getHydrationData.call(void 0, {
|
||||
state: {
|
||||
loaderData: payload.loaderData,
|
||||
actionData: payload.actionData,
|
||||
@@ -420,7 +421,7 @@ function createRouterFromPayload({
|
||||
routes,
|
||||
getRouteInfo: (routeId) => {
|
||||
let match = payload.matches.find((m) => m.id === routeId);
|
||||
_chunkIK6APEEGjs.invariant.call(void 0, match, "Route not found in payload");
|
||||
_chunkKFNXW4ALjs.invariant.call(void 0, match, "Route not found in payload");
|
||||
return {
|
||||
clientLoader: match.clientLoader,
|
||||
hasLoader: match.hasLoader,
|
||||
@@ -535,9 +536,9 @@ function createRouterFromPayload({
|
||||
routeModules: globalVar.__reactRouterRouteModules
|
||||
};
|
||||
}
|
||||
var renderedRoutesContext = _chunkIK6APEEGjs.createContext.call(void 0, );
|
||||
var renderedRoutesContext = _chunkKFNXW4ALjs.createContext.call(void 0, );
|
||||
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
||||
let dataStrategy = _chunkIK6APEEGjs.getSingleFetchDataStrategyImpl.call(void 0,
|
||||
let dataStrategy = _chunkKFNXW4ALjs.getSingleFetchDataStrategyImpl.call(void 0,
|
||||
getRouter,
|
||||
(match) => {
|
||||
let M = match;
|
||||
@@ -546,8 +547,7 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
||||
hasClientLoader: M.route.hasClientLoader,
|
||||
hasComponent: M.route.hasComponent,
|
||||
hasAction: M.route.hasAction,
|
||||
hasClientAction: M.route.hasClientAction,
|
||||
hasShouldRevalidate: M.route.hasShouldRevalidate
|
||||
hasClientAction: M.route.hasClientAction
|
||||
};
|
||||
},
|
||||
// pass map into fetchAndDecode so it can add payloads
|
||||
@@ -595,20 +595,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
||||
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
||||
return async (args, basename, trailingSlashAware, targetRoutes) => {
|
||||
let { request, context } = args;
|
||||
let url = _chunkIK6APEEGjs.singleFetchUrl.call(void 0, request.url, basename, trailingSlashAware, "rsc");
|
||||
let url = _chunkKFNXW4ALjs.singleFetchUrl.call(void 0, request.url, basename, trailingSlashAware, "rsc");
|
||||
if (request.method === "GET") {
|
||||
url = _chunkIK6APEEGjs.stripIndexParam.call(void 0, url);
|
||||
url = _chunkKFNXW4ALjs.stripIndexParam.call(void 0, url);
|
||||
if (targetRoutes) {
|
||||
url.searchParams.set("_routes", targetRoutes.join(","));
|
||||
}
|
||||
}
|
||||
let res = await fetchImplementation(
|
||||
new Request(url, await _chunkIK6APEEGjs.createRequestInit.call(void 0, request))
|
||||
new Request(url, await _chunkKFNXW4ALjs.createRequestInit.call(void 0, request))
|
||||
);
|
||||
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
|
||||
throw new (0, _chunkIK6APEEGjs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
||||
throw new (0, _chunkKFNXW4ALjs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
||||
}
|
||||
_chunkIK6APEEGjs.invariant.call(void 0, res.body, "No response body to decode");
|
||||
_chunkKFNXW4ALjs.invariant.call(void 0, res.body, "No response body to decode");
|
||||
try {
|
||||
const payload = await createFromReadableStream(res.body, {
|
||||
temporaryReferences: void 0
|
||||
@@ -632,7 +632,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
||||
}
|
||||
context.get(renderedRoutesContext).push(...payload.matches);
|
||||
let results = { routes: {} };
|
||||
const dataKey = _chunkIK6APEEGjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
||||
const dataKey = _chunkKFNXW4ALjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
||||
for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
|
||||
results.routes[routeId] = { data };
|
||||
}
|
||||
@@ -665,7 +665,7 @@ function RSCHydratedRouter({
|
||||
[createFromReadableStream, payload, fetchImplementation, getContext]
|
||||
);
|
||||
React3.useEffect(() => {
|
||||
_chunkIK6APEEGjs.setIsHydrated.call(void 0, );
|
||||
_chunkKFNXW4ALjs.setIsHydrated.call(void 0, );
|
||||
}, []);
|
||||
React3.useLayoutEffect(() => {
|
||||
const globalVar = window;
|
||||
@@ -750,10 +750,9 @@ function RSCHydratedRouter({
|
||||
// These flags have no runtime impact so can always be false. If we add
|
||||
// flags that drive runtime behavior they'll need to be proxied through.
|
||||
v8_middleware: false,
|
||||
unstable_subResourceIntegrity: false,
|
||||
unstable_trailingSlashAwareDataRequests: true,
|
||||
v8_trailingSlashAwareDataRequests: true,
|
||||
// always on for RSC
|
||||
unstable_passThroughRequests: true
|
||||
v8_passThroughRequests: true
|
||||
// always on for RSC
|
||||
},
|
||||
isSpaMode: false,
|
||||
@@ -774,8 +773,8 @@ function RSCHydratedRouter({
|
||||
},
|
||||
routeModules
|
||||
};
|
||||
return /* @__PURE__ */ React3.createElement(_chunkIK6APEEGjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkWAVMRYR2js.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunkIK6APEEGjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
||||
_chunkIK6APEEGjs.RouterProvider,
|
||||
return /* @__PURE__ */ React3.createElement(_chunkKFNXW4ALjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkPBLBZ3QUjs.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunkKFNXW4ALjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
||||
_chunkKFNXW4ALjs.RouterProvider,
|
||||
{
|
||||
router: transitionEnabledRouter,
|
||||
flushSync: ReactDOM2.flushSync
|
||||
@@ -791,8 +790,8 @@ function createRouteFromServerManifest(match, payload) {
|
||||
// the server loader flow regardless of whether the client loader calls
|
||||
// `serverLoader` or not, otherwise we'll have nothing to render.
|
||||
match.hasComponent && !match.element;
|
||||
_chunkIK6APEEGjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
||||
_chunkWAVMRYR2js.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
||||
_chunkKFNXW4ALjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
||||
_chunkPBLBZ3QUjs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
||||
let dataRoute = {
|
||||
id: match.id,
|
||||
element: match.element,
|
||||
@@ -802,30 +801,28 @@ function createRouteFromServerManifest(match, payload) {
|
||||
hydrateFallbackElement: match.hydrateFallbackElement,
|
||||
index: match.index,
|
||||
loader: match.clientLoader ? async (args, singleFetch) => {
|
||||
try {
|
||||
let result = await match.clientLoader({
|
||||
...args,
|
||||
serverLoader: () => {
|
||||
preventInvalidServerHandlerCall(
|
||||
"loader",
|
||||
match.id,
|
||||
match.hasLoader
|
||||
);
|
||||
if (isHydrationRequest) {
|
||||
if (hasInitialData) {
|
||||
return initialData;
|
||||
}
|
||||
if (hasInitialError) {
|
||||
throw initialError;
|
||||
}
|
||||
let _isHydrationRequest = isHydrationRequest;
|
||||
isHydrationRequest = false;
|
||||
let result = await match.clientLoader({
|
||||
...args,
|
||||
serverLoader: () => {
|
||||
preventInvalidServerHandlerCall(
|
||||
"loader",
|
||||
match.id,
|
||||
match.hasLoader
|
||||
);
|
||||
if (_isHydrationRequest) {
|
||||
if (hasInitialData) {
|
||||
return initialData;
|
||||
}
|
||||
if (hasInitialError) {
|
||||
throw initialError;
|
||||
}
|
||||
return callSingleFetch(singleFetch);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
} finally {
|
||||
isHydrationRequest = false;
|
||||
}
|
||||
return callSingleFetch(singleFetch);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
} : (
|
||||
// We always make the call in this RSC world since even if we don't
|
||||
// have a `loader` we may need to get the `element` implementation
|
||||
@@ -842,7 +839,7 @@ function createRouteFromServerManifest(match, payload) {
|
||||
return await callSingleFetch(singleFetch);
|
||||
}
|
||||
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
||||
throw _chunkIK6APEEGjs.noActionDefinedError.call(void 0, "action", match.id);
|
||||
throw _chunkKFNXW4ALjs.noActionDefinedError.call(void 0, "action", match.id);
|
||||
},
|
||||
path: match.path,
|
||||
shouldRevalidate: match.shouldRevalidate,
|
||||
@@ -851,11 +848,10 @@ function createRouteFromServerManifest(match, payload) {
|
||||
hasLoader: true,
|
||||
hasClientLoader: match.clientLoader != null,
|
||||
hasAction: match.hasAction,
|
||||
hasClientAction: match.clientAction != null,
|
||||
hasShouldRevalidate: match.shouldRevalidate != null
|
||||
hasClientAction: match.clientAction != null
|
||||
};
|
||||
if (typeof dataRoute.loader === "function") {
|
||||
dataRoute.loader.hydrate = _chunkIK6APEEGjs.shouldHydrateRouteLoader.call(void 0,
|
||||
dataRoute.loader.hydrate = _chunkKFNXW4ALjs.shouldHydrateRouteLoader.call(void 0,
|
||||
match.id,
|
||||
match.clientLoader,
|
||||
match.hasLoader,
|
||||
@@ -865,7 +861,7 @@ function createRouteFromServerManifest(match, payload) {
|
||||
return dataRoute;
|
||||
}
|
||||
function callSingleFetch(singleFetch) {
|
||||
_chunkIK6APEEGjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
||||
_chunkKFNXW4ALjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
||||
return singleFetch();
|
||||
}
|
||||
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
||||
@@ -873,13 +869,12 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
||||
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
||||
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
||||
console.error(msg);
|
||||
throw new (0, _chunkIK6APEEGjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
||||
throw new (0, _chunkKFNXW4ALjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
||||
}
|
||||
}
|
||||
var nextPaths = /* @__PURE__ */ new Set();
|
||||
var discoveredPathsMaxSize = 1e3;
|
||||
var discoveredPaths = /* @__PURE__ */ new Set();
|
||||
var URL_LIMIT = 7680;
|
||||
function getManifestUrl(paths) {
|
||||
if (paths.length === 0) {
|
||||
return null;
|
||||
@@ -901,7 +896,7 @@ async function fetchAndApplyManifestPatches(paths, createFromReadableStream, fet
|
||||
if (url == null) {
|
||||
return;
|
||||
}
|
||||
if (url.toString().length > URL_LIMIT) {
|
||||
if (url.toString().length > _chunkKFNXW4ALjs.URL_LIMIT) {
|
||||
nextPaths.clear();
|
||||
return;
|
||||
}
|
||||
@@ -946,7 +941,7 @@ function isExternalLocation(location2) {
|
||||
}
|
||||
function hasInvalidProtocol(location2) {
|
||||
try {
|
||||
return _chunkIK6APEEGjs.invalidProtocols.includes(new URL(location2).protocol);
|
||||
return _chunkKFNXW4ALjs.invalidProtocols.includes(new URL(location2).protocol);
|
||||
} catch (e2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user