{"version":3,"sources":["../../../src/build/templates/app-page.ts"],"sourcesContent":["import type { LoaderTree } from '../../server/lib/app-dir-module'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport type { FallbackRouteParam } from '../static-paths/types'\n\nimport {\n  AppPageRouteModule,\n  type AppPageRouteHandlerContext,\n} from '../../server/route-modules/app-page/module.compiled' with { 'turbopack-transition': 'next-ssr' }\n\nimport { RouteKind } from '../../server/route-kind' with { 'turbopack-transition': 'next-server-utility' }\n\nimport { getRevalidateReason } from '../../server/instrumentation/utils' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  getTracer,\n  SpanKind,\n  type Span,\n} from '../../server/lib/trace/tracer' with { 'turbopack-transition': 'next-server-utility' }\nimport type { RequestMeta } from '../../server/request-meta'\nimport {\n  addRequestMeta,\n  getRequestMeta,\n  setRequestMeta,\n} from '../../server/request-meta' with { 'turbopack-transition': 'next-server-utility' }\nimport { BaseServerSpan } from '../../server/lib/trace/constants' with { 'turbopack-transition': 'next-server-utility' }\nimport { interopDefault } from '../../server/app-render/interop-default' with { 'turbopack-transition': 'next-server-utility' }\nimport { stripFlightHeaders } from '../../server/app-render/strip-flight-headers' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  NodeNextRequest,\n  NodeNextResponse,\n} from '../../server/base-http/node' with { 'turbopack-transition': 'next-server-utility' }\nimport { checkIsAppPPREnabled } from '../../server/lib/experimental/ppr' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  getFallbackRouteParams,\n  createOpaqueFallbackRouteParams,\n  type OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params' with { 'turbopack-transition': 'next-server-utility' }\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  isHtmlBotRequest,\n  shouldServeStreamingMetadata,\n} from '../../server/lib/streaming-metadata' with { 'turbopack-transition': 'next-server-utility' }\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths' with { 'turbopack-transition': 'next-server-utility' }\nimport { getIsPossibleServerAction } from '../../server/lib/server-action-request-meta' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  RSC_HEADER,\n  NEXT_ROUTER_PREFETCH_HEADER,\n  NEXT_INSTANT_PREFETCH_HEADER,\n  NEXT_INSTANT_TEST_COOKIE,\n  NEXT_IS_PRERENDER_HEADER,\n  NEXT_DID_POSTPONE_HEADER,\n  RSC_CONTENT_TYPE_HEADER,\n} from '../../client/components/app-router-headers' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  getBotType,\n  isBot,\n} from '../../shared/lib/router/utils/is-bot' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  CachedRouteKind,\n  IncrementalCacheKind,\n  type CachedAppPageValue,\n  type CachedPageValue,\n  type ResponseCacheEntry,\n  type ResponseGenerator,\n} from '../../server/response-cache' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  FallbackMode,\n  parseFallbackField,\n} from '../../lib/fallback' with { 'turbopack-transition': 'next-server-utility' }\nimport RenderResult from '../../server/render-result' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  CACHE_ONE_YEAR_SECONDS,\n  HTML_CONTENT_TYPE_HEADER,\n  NEXT_CACHE_TAGS_HEADER,\n  NEXT_NAV_DEPLOYMENT_ID_HEADER,\n  NEXT_RESUME_HEADER,\n  NEXT_RESUME_STATE_LENGTH_HEADER,\n} from '../../lib/constants' with { 'turbopack-transition': 'next-server-utility' }\nimport type { CacheControl } from '../../server/lib/cache-control'\nimport { ENCODED_TAGS } from '../../server/stream-utils/encoded-tags' with { 'turbopack-transition': 'next-server-utility' }\nimport { createInstantTestScriptInsertionTransformStream } from '../../server/stream-utils/node-web-streams-helper' with { 'turbopack-transition': 'next-server-utility' }\nimport { sendRenderResult } from '../../server/send-payload' with { 'turbopack-transition': 'next-server-utility' }\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external' with { 'turbopack-transition': 'next-server-utility' }\nimport { parseMaxPostponedStateSize } from '../../shared/lib/size-limit' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  getMaxPostponedStateSize,\n  getPostponedStateExceededErrorMessage,\n  readBodyWithSizeLimit,\n} from '../../server/lib/postponed-request-body' with { 'turbopack-transition': 'next-server-utility' }\n\n// These are injected by the loader afterwards.\n\n/**\n * The tree created in next-app-loader that holds component segments and modules\n * and I've updated it.\n */\ndeclare const tree: LoaderTree\n\n// These are injected by the loader afterwards.\ndeclare const __next_app_require__: (id: string | number) => unknown\ndeclare const __next_app_load_chunk__: (id: string | number) => Promise<unknown>\n\n// We inject the tree and pages here so that we can use them in the route\n// module.\n// INJECT:tree\n// INJECT:__next_app_require__\n// INJECT:__next_app_load_chunk__\n\nexport const __next_app__ = {\n  require: __next_app_require__,\n  loadChunk: __next_app_load_chunk__,\n}\n\nimport * as entryBase from '../../server/app-render/entry-base' with { 'turbopack-transition': 'next-server-utility' }\nimport { RedirectStatusCode } from '../../client/components/redirect-status-code' with { 'turbopack-transition': 'next-server-utility' }\nimport { InvariantError } from '../../shared/lib/invariant-error' with { 'turbopack-transition': 'next-server-utility' }\nimport { scheduleOnNextTick } from '../../lib/scheduler' with { 'turbopack-transition': 'next-server-utility' }\nimport { isInterceptionRouteAppPath } from '../../shared/lib/router/utils/interception-routes' with { 'turbopack-transition': 'next-server-utility' }\nimport {\n  getParamProperties,\n  getSegmentParam,\n} from '../../shared/lib/router/utils/get-segment-param' with { 'turbopack-transition': 'next-server-utility' }\n\nexport * from '../../server/app-render/entry-base' with { 'turbopack-transition': 'next-server-utility' }\n\n// Create and export the route module that will be consumed.\nexport const routeModule = new AppPageRouteModule({\n  definition: {\n    kind: RouteKind.APP_PAGE,\n    page: 'VAR_DEFINITION_PAGE',\n    pathname: 'VAR_DEFINITION_PATHNAME',\n    // The following aren't used in production.\n    bundlePath: '',\n    filename: '',\n    appPaths: [],\n  },\n  userland: {\n    loaderTree: tree,\n  },\n  distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n  relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n})\n\nfunction buildDynamicSegmentPlaceholder(\n  param: Pick<FallbackRouteParam, 'paramName' | 'paramType'>\n): string {\n  const { repeat, optional } = getParamProperties(param.paramType)\n\n  if (optional) {\n    return `[[...${param.paramName}]]`\n  }\n\n  if (repeat) {\n    return `[...${param.paramName}]`\n  }\n\n  return `[${param.paramName}]`\n}\n\n/**\n * Builds the cache key for the most complete prerenderable shell we can derive\n * from the shell that matched this request. Only params that can still be\n * filled by `generateStaticParams` are substituted; fully dynamic params stay\n * as placeholders so a request like `/c/foo` can complete `/[one]/[two]` into\n * `/c/[two]` rather than `/c/foo`.\n */\nfunction buildCompletedShellCacheKey(\n  fallbackPathname: string,\n  remainingPrerenderableParams: readonly FallbackRouteParam[],\n  params: Record<string, undefined | string | string[]> | undefined\n): string {\n  const prerenderableParamsByName = new Map(\n    remainingPrerenderableParams.map((param) => [param.paramName, param])\n  )\n\n  return (\n    fallbackPathname\n      .split('/')\n      .map((segment) => {\n        const segmentParam = getSegmentParam(segment)\n        if (!segmentParam) {\n          return segment\n        }\n\n        const remainingParam = prerenderableParamsByName.get(\n          segmentParam.paramName\n        )\n        if (!remainingParam) {\n          return segment\n        }\n\n        const value = params?.[remainingParam.paramName]\n        if (!value) {\n          return segment\n        }\n\n        const encodedValue = Array.isArray(value)\n          ? value.map((item) => encodeURIComponent(item)).join('/')\n          : encodeURIComponent(value)\n\n        return segment.replace(\n          buildDynamicSegmentPlaceholder(remainingParam),\n          encodedValue\n        )\n      })\n      .join('/') || '/'\n  )\n}\n\nexport async function handler(\n  req: IncomingMessage,\n  res: ServerResponse,\n  ctx: {\n    waitUntil?: (prom: Promise<void>) => void\n    requestMeta?: RequestMeta\n  }\n) {\n  if (ctx.requestMeta) {\n    setRequestMeta(req, ctx.requestMeta)\n  }\n\n  if (routeModule.isDev) {\n    addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n  }\n  const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'))\n\n  let srcPage = 'VAR_DEFINITION_PAGE'\n\n  // turbopack doesn't normalize `/index` in the page name\n  // so we need to to process dynamic routes properly\n  // TODO: fix turbopack providing differing value from webpack\n  if (process.env.TURBOPACK) {\n    srcPage = srcPage.replace(/\\/index$/, '') || '/'\n  } else if (srcPage === '/index') {\n    // we always normalize /index specifically\n    srcPage = '/'\n  }\n  const multiZoneDraftMode = process.env\n    .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n  const prepareResult = await routeModule.prepare(req, res, {\n    srcPage,\n    multiZoneDraftMode,\n  })\n\n  if (!prepareResult) {\n    res.statusCode = 400\n    res.end('Bad Request')\n    ctx.waitUntil?.(Promise.resolve())\n    return null\n  }\n\n  const {\n    buildId,\n    query,\n    params,\n    pageIsDynamic,\n    buildManifest,\n    nextFontManifest,\n    reactLoadableManifest,\n    serverActionsManifest,\n    clientReferenceManifest,\n    subresourceIntegrityManifest,\n    prerenderManifest,\n    isDraftMode,\n    resolvedPathname,\n    revalidateOnlyGenerated,\n    routerServerContext,\n    nextConfig,\n    parsedUrl,\n    interceptionRoutePatterns,\n    deploymentId,\n    clientAssetToken,\n  } = prepareResult\n\n  const normalizedSrcPage = normalizeAppPath(srcPage)\n\n  let { isOnDemandRevalidate } = prepareResult\n\n  // We use the resolvedPathname instead of the parsedUrl.pathname because it\n  // is not rewritten as resolvedPathname is. This will ensure that the correct\n  // prerender info is used instead of using the original pathname as the\n  // source. If however PPR is enabled and cacheComponents is disabled, we\n  // treat the pathname as dynamic. Currently, there's a bug in the PPR\n  // implementation that incorrectly leaves %%drp placeholders in the output of\n  // parallel routes. This is addressed with cacheComponents.\n  const prerenderMatch =\n    nextConfig.experimental.ppr &&\n    !nextConfig.cacheComponents &&\n    isInterceptionRouteAppPath(resolvedPathname)\n      ? null\n      : routeModule.match(resolvedPathname, prerenderManifest)\n  const prerenderInfo = prerenderMatch?.route ?? null\n\n  const isPrerendered = !!prerenderManifest.routes[resolvedPathname]\n\n  const userAgent = req.headers['user-agent'] || ''\n  const botType = getBotType(userAgent)\n  const isHtmlBot = isHtmlBotRequest(req)\n\n  /**\n   * If true, this indicates that the request being made is for an app\n   * prefetch request.\n   */\n  const isPrefetchRSCRequest =\n    getRequestMeta(req, 'isPrefetchRSCRequest') ??\n    req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2'\n\n  // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later\n\n  const isRSCRequest =\n    getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER])\n\n  const isPossibleServerAction = getIsPossibleServerAction(req)\n\n  /**\n   * If the route being rendered is an app page, and the ppr feature has been\n   * enabled, then the given route _could_ support PPR.\n   */\n  const couldSupportPPR: boolean = checkIsAppPPREnabled(\n    nextConfig.experimental.ppr\n  )\n\n  // Stash postponed state for server actions when in minimal mode.\n  // We extract it here so the RDC is available for the re-render after the action completes.\n  const resumeStateLengthHeader = req.headers[NEXT_RESUME_STATE_LENGTH_HEADER]\n  if (\n    !getRequestMeta(req, 'postponed') &&\n    isMinimalMode &&\n    couldSupportPPR &&\n    isPossibleServerAction &&\n    resumeStateLengthHeader &&\n    typeof resumeStateLengthHeader === 'string'\n  ) {\n    const stateLength = parseInt(resumeStateLengthHeader, 10)\n    const { maxPostponedStateSize, maxPostponedStateSizeBytes } =\n      getMaxPostponedStateSize(nextConfig.experimental.maxPostponedStateSize)\n\n    if (!isNaN(stateLength) && stateLength > 0) {\n      if (stateLength > maxPostponedStateSizeBytes) {\n        res.statusCode = 413\n        res.end(getPostponedStateExceededErrorMessage(maxPostponedStateSize))\n        ctx.waitUntil?.(Promise.resolve())\n        return null\n      }\n\n      // Calculate max total body size to prevent buffering excessively large\n      // payloads before the action handler checks. We use stateLength (not\n      // maxPostponedStateSizeBytes) so the postponed state doesn't eat into\n      // the action body budget - it's already validated above.\n      const defaultActionBodySizeLimit = '1 MB'\n      const actionBodySizeLimit =\n        nextConfig.experimental.serverActions?.bodySizeLimit ??\n        defaultActionBodySizeLimit\n      const actionBodySizeLimitBytes =\n        actionBodySizeLimit !== defaultActionBodySizeLimit\n          ? (\n              require('next/dist/compiled/bytes') as typeof import('next/dist/compiled/bytes')\n            ).parse(actionBodySizeLimit)\n          : 1024 * 1024 // 1 MB\n      const maxTotalBodySize = stateLength + actionBodySizeLimitBytes\n\n      const fullBody = await readBodyWithSizeLimit(req, maxTotalBodySize)\n      if (fullBody === null) {\n        res.statusCode = 413\n        res.end(\n          `Request body exceeded limit. ` +\n            `To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit`\n        )\n        ctx.waitUntil?.(Promise.resolve())\n        return null\n      }\n\n      if (fullBody.length >= stateLength) {\n        // Extract postponed state from the beginning\n        const postponedState = fullBody\n          .subarray(0, stateLength)\n          .toString('utf8')\n        addRequestMeta(req, 'postponed', postponedState)\n\n        // Store the remaining action body for the action handler\n        const actionBody = fullBody.subarray(stateLength)\n        addRequestMeta(req, 'actionBody', actionBody)\n      } else {\n        throw new Error(\n          `invariant: expected ${stateLength} bytes of postponed state but only received ${fullBody.length} bytes`\n        )\n      }\n    }\n  }\n\n  if (\n    !getRequestMeta(req, 'postponed') &&\n    couldSupportPPR &&\n    req.headers[NEXT_RESUME_HEADER] === '1' &&\n    req.method === 'POST'\n  ) {\n    const { maxPostponedStateSize, maxPostponedStateSizeBytes } =\n      getMaxPostponedStateSize(nextConfig.experimental.maxPostponedStateSize)\n\n    // Decode the postponed state from the request body, it will come as\n    // an array of buffers, so collect them and then concat them to form\n    // the string.\n    const body = await readBodyWithSizeLimit(req, maxPostponedStateSizeBytes)\n    if (body === null) {\n      res.statusCode = 413\n      res.end(getPostponedStateExceededErrorMessage(maxPostponedStateSize))\n      ctx.waitUntil?.(Promise.resolve())\n      return null\n    }\n    const postponed = body.toString('utf8')\n\n    addRequestMeta(req, 'postponed', postponed)\n  }\n\n  // When enabled, this will allow the use of the `?__nextppronly` query to\n  // enable debugging of the static shell.\n  const hasDebugStaticShellQuery =\n    process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' &&\n    typeof query.__nextppronly !== 'undefined' &&\n    couldSupportPPR\n\n  // When enabled, this will allow the use of the `?__nextppronly` query\n  // to enable debugging of the fallback shell.\n  const hasDebugFallbackShellQuery =\n    hasDebugStaticShellQuery && query.__nextppronly === 'fallback'\n\n  // Whether the testing API is exposed (dev mode or explicit flag)\n  const exposeTestingApi =\n    routeModule.isDev === true ||\n    nextConfig.experimental.exposeTestingApiInProductionBuild === true\n\n  // Enable the Instant Navigation Testing API. Renders only the prefetched\n  // portion of the page, excluding dynamic content. This allows tests to\n  // assert on the prefetched UI state deterministically.\n  // - Header: Used for client-side navigations where we can set request headers\n  // - Cookie: Used for MPA navigations (page reload, full page load) where we\n  //   can't set request headers. Only applies to document requests (no RSC\n  //   header) - RSC requests should proceed normally even during a locked scope,\n  //   with blocking happening on the client side.\n  const isInstantNavigationTest =\n    exposeTestingApi &&\n    (req.headers[NEXT_INSTANT_PREFETCH_HEADER] === '1' ||\n      (req.headers[RSC_HEADER] === undefined &&\n        typeof req.headers.cookie === 'string' &&\n        req.headers.cookie.includes(NEXT_INSTANT_TEST_COOKIE + '=')))\n\n  // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the\n  // prerender manifest and this is an app page.\n  const isRoutePPREnabled: boolean =\n    // When the instant navigation testing API is active, enable the PPR\n    // prerender path even without Cache Components. In dev mode without CC,\n    // static pages need this path to produce buffered segment data (the\n    // legacy prerender path hangs in dev mode).\n    (couldSupportPPR || isInstantNavigationTest) &&\n    ((\n      prerenderManifest.routes[normalizedSrcPage] ??\n      prerenderManifest.dynamicRoutes[normalizedSrcPage]\n    )?.renderingMode === 'PARTIALLY_STATIC' ||\n      // Ideally we'd want to check the appConfig to see if this page has PPR\n      // enabled or not, but that would require plumbing the appConfig through\n      // to the server during development. We assume that the page supports it\n      // but only during development or when the testing API is exposed.\n      ((hasDebugStaticShellQuery || isInstantNavigationTest) &&\n        (exposeTestingApi ||\n          routerServerContext?.experimentalTestProxy === true)))\n\n  const isDebugStaticShell: boolean =\n    (hasDebugStaticShellQuery || isInstantNavigationTest) && isRoutePPREnabled\n\n  // We should enable debugging dynamic accesses when the static shell\n  // debugging has been enabled and we're also in development mode.\n  const isDebugDynamicAccesses =\n    isDebugStaticShell && routeModule.isDev === true\n\n  const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled\n\n  // If we're in minimal mode, then try to get the postponed information from\n  // the request metadata. If available, use it for resuming the postponed\n  // render.\n  const minimalPostponed = isRoutePPREnabled\n    ? getRequestMeta(req, 'postponed')\n    : undefined\n\n  // If PPR is enabled, and this is a RSC request (but not a prefetch), then\n  // we can use this fact to only generate the flight data for the request\n  // because we can't cache the HTML (as it's also dynamic).\n  const staticPrefetchDataRoute =\n    prerenderManifest.routes[resolvedPathname]?.prefetchDataRoute\n\n  let isDynamicRSCRequest =\n    isRoutePPREnabled &&\n    isRSCRequest &&\n    !isPrefetchRSCRequest &&\n    // If generated at build time, treat the RSC request as static\n    // so we can serve the prebuilt .rsc without a dynamic render.\n    // Only do this for routes that have a concrete prefetchDataRoute.\n    !staticPrefetchDataRoute\n\n  // During a PPR revalidation, the RSC request is not dynamic if we do not have the postponed data.\n  // We only attach the postponed data during a resume. If there's no postponed data, then it must be a revalidation.\n  // This is to ensure that we don't bypass the cache during a revalidation.\n  if (isMinimalMode) {\n    isDynamicRSCRequest = isDynamicRSCRequest && !!minimalPostponed\n  }\n\n  // Need to read this before it's stripped by stripFlightHeaders. We don't\n  // need to transfer it to the request meta because it's only read\n  // within this function; the static segment data should have already been\n  // generated, so we will always either return a static response or a 404.\n  const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest')\n\n  // TODO: investigate existing bug with shouldServeStreamingMetadata always\n  // being true for a revalidate due to modifying the base-server this.renderOpts\n  // when fixing this to correct logic it causes hydration issue since we set\n  // serveStreamingMetadata to true during export\n  const serveStreamingMetadata =\n    botType && isRoutePPREnabled\n      ? false\n      : !userAgent\n        ? true\n        : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots)\n\n  const isSSG = Boolean(\n    (prerenderInfo ||\n      isPrerendered ||\n      prerenderManifest.routes[normalizedSrcPage]) &&\n      // If this is a bot request and PPR is enabled, then we don't want\n      // to serve a static response. This applies to both DOM bots (like Googlebot)\n      // and HTML-limited bots.\n      !(botType && isRoutePPREnabled)\n  )\n\n  // When a page supports cacheComponents, we can support RDC for Navigations\n  const supportsRDCForNavigations =\n    isRoutePPREnabled && nextConfig.cacheComponents === true\n\n  // In development, we always want to generate dynamic HTML.\n  const supportsDynamicResponse: boolean =\n    // If we're in development, we always support dynamic HTML, unless it's\n    // a data request, in which case we only produce static HTML.\n    routeModule.isDev === true ||\n    // If this is not SSG or does not have static paths, then it supports\n    // dynamic HTML.\n    !isSSG ||\n    // If this request has provided postponed data, it supports dynamic\n    // HTML.\n    typeof minimalPostponed === 'string' ||\n    // If this handler supports onCacheEntryV2, then we can only support\n    // dynamic responses if it's a dynamic RSC request and not in minimal mode. If it\n    // doesn't support it we must fallback to the default behavior.\n    (supportsRDCForNavigations && getRequestMeta(req, 'onCacheEntryV2')\n      ? // In minimal mode, we'll always want to generate a static response\n        // which will generate the RDC for the route. When resuming a Dynamic\n        // RSC request, we'll pass the minimal postponed data to the render\n        // which will trigger the `supportsDynamicResponse` to be true.\n        isDynamicRSCRequest && !isMinimalMode\n      : // Otherwise, we can support dynamic responses if it's a dynamic RSC request.\n        isDynamicRSCRequest)\n\n  // When bots request PPR page, perform the full dynamic rendering.\n  // This applies to both DOM bots (like Googlebot) and HTML-limited bots.\n  const shouldWaitOnAllReady = Boolean(botType) && isRoutePPREnabled\n  const remainingPrerenderableParams =\n    prerenderInfo?.remainingPrerenderableParams ?? []\n  const hasUnresolvedRootFallbackParams =\n    prerenderInfo?.fallback === null &&\n    (prerenderInfo.fallbackRootParams?.length ?? 0) > 0\n\n  let ssgCacheKey: string | null = null\n  if (\n    !isDraftMode &&\n    isSSG &&\n    !supportsDynamicResponse &&\n    !isPossibleServerAction &&\n    !minimalPostponed &&\n    !isDynamicRSCRequest\n  ) {\n    // For normal SSG routes we cache by the fully resolved pathname. For\n    // partial fallbacks we instead derive the cache key from the shell\n    // that matched this request so `/prefix/[one]/[two]` can specialize into\n    // `/prefix/c/[two]` without promoting all the way to `/prefix/c/foo`.\n    const fallbackPathname = prerenderMatch\n      ? typeof prerenderInfo?.fallback === 'string'\n        ? prerenderInfo.fallback\n        : prerenderMatch.source\n      : null\n\n    if (\n      nextConfig.experimental.partialFallbacks === true &&\n      fallbackPathname &&\n      prerenderInfo?.fallbackRouteParams &&\n      !hasUnresolvedRootFallbackParams\n    ) {\n      if (remainingPrerenderableParams.length > 0) {\n        const completedShellCacheKey = buildCompletedShellCacheKey(\n          fallbackPathname,\n          remainingPrerenderableParams,\n          params\n        )\n\n        // If applying the current request params doesn't make the shell any\n        // more complete, then this shell is already at its most complete\n        // form and should remain shared rather than creating a new cache entry.\n        ssgCacheKey =\n          completedShellCacheKey !== fallbackPathname\n            ? completedShellCacheKey\n            : null\n      }\n    } else {\n      ssgCacheKey = resolvedPathname\n    }\n  }\n\n  // the staticPathKey differs from ssgCacheKey since\n  // ssgCacheKey is null in dev since we're always in \"dynamic\"\n  // mode in dev to bypass the cache. It can also be null for partial\n  // fallback shells that should remain shared and must not create a\n  // param-specific ISR entry, but we still need to honor fallback handling.\n  let staticPathKey = ssgCacheKey\n  if (\n    !staticPathKey &&\n    (routeModule.isDev ||\n      (isSSG &&\n        pageIsDynamic &&\n        prerenderInfo?.fallbackRouteParams &&\n        // Server action requests must not get a staticPathKey, otherwise they\n        // enter the fallback rendering block below and return the cached HTML\n        // shell with the action result appended, instead of responding with\n        // just the RSC action result.\n        !isPossibleServerAction))\n  ) {\n    staticPathKey = resolvedPathname\n  }\n\n  // If this is a request for an app path that should be statically generated\n  // and we aren't in the edge runtime, strip the flight headers so it will\n  // generate the static response.\n  if (\n    !routeModule.isDev &&\n    !isDraftMode &&\n    isSSG &&\n    isRSCRequest &&\n    !isDynamicRSCRequest\n  ) {\n    stripFlightHeaders(req.headers)\n  }\n\n  const ComponentMod = {\n    ...entryBase,\n    tree,\n    handler,\n    routeModule,\n    __next_app__,\n  }\n\n  // Before rendering (which initializes component tree modules), we have to\n  // set the reference manifests to our global store so Server Action's\n  // encryption util can access to them at the top level of the page module.\n  if (serverActionsManifest && clientReferenceManifest) {\n    setManifestsSingleton({\n      page: srcPage,\n      clientReferenceManifest,\n      serverActionsManifest,\n    })\n  }\n\n  const method = req.method || 'GET'\n  const tracer = getTracer()\n  const activeSpan = tracer.getActiveScopeSpan()\n  const isWrappedByNextServer = Boolean(\n    routerServerContext?.isWrappedByNextServer\n  )\n  const remainingFallbackRouteParams =\n    nextConfig.experimental.partialFallbacks === true &&\n    remainingPrerenderableParams.length > 0\n      ? (prerenderInfo?.fallbackRouteParams?.filter(\n          (param) =>\n            !remainingPrerenderableParams.some(\n              (prerenderableParam) =>\n                prerenderableParam.paramName === param.paramName\n            )\n        ) ?? [])\n      : []\n\n  const render404 = async () => {\n    // TODO: should route-module itself handle rendering the 404\n    if (routerServerContext?.render404) {\n      await routerServerContext.render404(req, res, parsedUrl, false)\n    } else {\n      res.end('This page could not be found')\n    }\n    return null\n  }\n\n  try {\n    const varyHeader = routeModule.getVaryHeader(\n      resolvedPathname,\n      interceptionRoutePatterns\n    )\n    res.setHeader('Vary', varyHeader)\n    let parentSpan: Span | undefined\n    const invokeRouteModule = async (\n      span: Span | undefined,\n      context: AppPageRouteHandlerContext\n    ) => {\n      const nextReq = new NodeNextRequest(req)\n      const nextRes = new NodeNextResponse(res)\n\n      return routeModule.render(nextReq, nextRes, context).finally(() => {\n        if (!span) return\n\n        span.setAttributes({\n          'http.status_code': res.statusCode,\n          'next.rsc': false,\n        })\n\n        const rootSpanAttributes = tracer.getRootSpanAttributes()\n        // We were unable to get attributes, probably OTEL is not enabled\n        if (!rootSpanAttributes) {\n          return\n        }\n\n        if (\n          rootSpanAttributes.get('next.span_type') !==\n          BaseServerSpan.handleRequest\n        ) {\n          console.warn(\n            `Unexpected root span type '${rootSpanAttributes.get(\n              'next.span_type'\n            )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n          )\n          return\n        }\n\n        const route = rootSpanAttributes.get('next.route')\n        if (route) {\n          const name = `${method} ${route}`\n\n          span.setAttributes({\n            'next.route': route,\n            'http.route': route,\n            'next.span_name': name,\n          })\n          span.updateName(name)\n\n          // Propagate http.route to the parent span if one exists (e.g.\n          // a platform-created HTTP span in adapter deployments).\n          if (parentSpan && parentSpan !== span) {\n            parentSpan.setAttribute('http.route', route)\n            parentSpan.updateName(name)\n          }\n        } else {\n          span.updateName(`${method} ${srcPage}`)\n        }\n      })\n    }\n\n    const incrementalCache =\n      getRequestMeta(req, 'incrementalCache') ||\n      (await routeModule.getIncrementalCache(\n        req,\n        nextConfig,\n        prerenderManifest,\n        isMinimalMode\n      ))\n\n    incrementalCache?.resetRequestCache()\n    ;(globalThis as any).__incrementalCache = incrementalCache\n\n    const doRender = async ({\n      span,\n      postponed,\n      fallbackRouteParams,\n      forceStaticRender,\n    }: {\n      span?: Span\n\n      /**\n       * The postponed data for this render. This is only provided when resuming\n       * a render that has been postponed.\n       */\n      postponed: string | undefined\n\n      /**\n       * The unknown route params for this render.\n       */\n      fallbackRouteParams: OpaqueFallbackRouteParams | null\n\n      /**\n       * When true, this indicates that the response generator is being called\n       * in a context where the response must be generated statically.\n       *\n       * CRITICAL: This should only currently be used when revalidating due to a\n       * dynamic RSC request.\n       */\n      forceStaticRender: boolean\n    }): Promise<ResponseCacheEntry> => {\n      const context: AppPageRouteHandlerContext = {\n        query,\n        params,\n        page: normalizedSrcPage,\n        sharedContext: {\n          buildId,\n          deploymentId,\n          clientAssetToken,\n        },\n        serverComponentsHmrCache: getRequestMeta(\n          req,\n          'serverComponentsHmrCache'\n        ),\n        fallbackRouteParams,\n        renderOpts: {\n          App: () => null,\n          Document: () => null,\n          pageConfig: {},\n          ComponentMod,\n          Component: interopDefault(ComponentMod),\n\n          params,\n          routeModule,\n          page: srcPage,\n          postponed,\n          shouldWaitOnAllReady,\n          serveStreamingMetadata,\n          supportsDynamicResponse:\n            typeof postponed === 'string' || supportsDynamicResponse,\n          buildManifest,\n          nextFontManifest,\n          reactLoadableManifest,\n          subresourceIntegrityManifest,\n          setCacheStatus: routerServerContext?.setCacheStatus,\n          setIsrStatus: routerServerContext?.setIsrStatus,\n          setReactDebugChannel: routerServerContext?.setReactDebugChannel,\n          sendErrorsToBrowser: routerServerContext?.sendErrorsToBrowser,\n\n          dir:\n            process.env.NEXT_RUNTIME === 'nodejs'\n              ? (require('path') as typeof import('path')).join(\n                  /* turbopackIgnore: true */\n                  process.cwd(),\n                  routeModule.relativeProjectDir\n                )\n              : `${process.cwd()}/${routeModule.relativeProjectDir}`,\n          isDraftMode,\n          botType,\n          isOnDemandRevalidate,\n          isPossibleServerAction,\n          assetPrefix: nextConfig.assetPrefix,\n          nextConfigOutput: nextConfig.output,\n          crossOrigin: nextConfig.crossOrigin,\n          trailingSlash: nextConfig.trailingSlash,\n          images: nextConfig.images,\n          previewProps: prerenderManifest.preview,\n          enableTainting: nextConfig.experimental.taint,\n          htmlLimitedBots: nextConfig.htmlLimitedBots,\n          reactMaxHeadersLength: nextConfig.reactMaxHeadersLength,\n\n          multiZoneDraftMode,\n          incrementalCache,\n          cacheLifeProfiles: nextConfig.cacheLife,\n          basePath: nextConfig.basePath,\n          serverActions: nextConfig.experimental.serverActions,\n          logServerFunctions:\n            typeof nextConfig.logging === 'object' &&\n            Boolean(nextConfig.logging.serverFunctions),\n\n          ...(isDebugStaticShell ||\n          isDebugDynamicAccesses ||\n          isDebugFallbackShell\n            ? {\n                isBuildTimePrerendering: true,\n                supportsDynamicResponse: false,\n                isStaticGeneration: true,\n                isDebugDynamicAccesses: isDebugDynamicAccesses,\n              }\n            : {}),\n          cacheComponents: Boolean(nextConfig.cacheComponents),\n          experimental: {\n            isRoutePPREnabled,\n            expireTime: nextConfig.expireTime,\n            staleTimes: nextConfig.experimental.staleTimes,\n            dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover),\n            optimisticRouting: Boolean(\n              nextConfig.experimental.optimisticRouting\n            ),\n            inlineCss: Boolean(nextConfig.experimental.inlineCss),\n            prefetchInlining: nextConfig.experimental.prefetchInlining ?? false,\n            authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n            cachedNavigations: Boolean(\n              nextConfig.experimental.cachedNavigations\n            ),\n            clientTraceMetadata:\n              nextConfig.experimental.clientTraceMetadata || ([] as any),\n            clientParamParsingOrigins:\n              nextConfig.experimental.clientParamParsingOrigins,\n            maxPostponedStateSizeBytes: parseMaxPostponedStateSize(\n              nextConfig.experimental.maxPostponedStateSize\n            ),\n          },\n\n          waitUntil: ctx.waitUntil,\n          onClose: (cb) => {\n            res.on('close', cb)\n          },\n          onAfterTaskError: () => {},\n\n          onInstrumentationRequestError: (\n            error,\n            _request,\n            errorContext,\n            silenceLog\n          ) =>\n            routeModule.onRequestError(\n              req,\n              error,\n              errorContext,\n              silenceLog,\n              routerServerContext\n            ),\n          err: getRequestMeta(req, 'invokeError'),\n        },\n      }\n\n      // When we're revalidating in the background, we should not allow dynamic\n      // responses.\n      if (forceStaticRender) {\n        context.renderOpts.supportsDynamicResponse = false\n      }\n\n      const result = await invokeRouteModule(span, context)\n\n      const { metadata } = result\n\n      const {\n        cacheControl,\n        headers = {},\n        // Add any fetch tags that were on the page to the response headers.\n        fetchTags: cacheTags,\n        fetchMetrics,\n      } = metadata\n\n      if (cacheTags) {\n        headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n      }\n\n      // Pull any fetch metrics from the render onto the request.\n      ;(req as any).fetchMetrics = fetchMetrics\n\n      // we don't throw static to dynamic errors in dev as isSSG\n      // is a best guess in dev since we don't have the prerender pass\n      // to know whether the path is actually static or not\n      if (\n        isSSG &&\n        cacheControl?.revalidate === 0 &&\n        !routeModule.isDev &&\n        !isRoutePPREnabled\n      ) {\n        const staticBailoutInfo = metadata.staticBailoutInfo\n\n        const err = new Error(\n          `Page changed from static to dynamic at runtime ${resolvedPathname}${\n            staticBailoutInfo?.description\n              ? `, reason: ${staticBailoutInfo.description}`\n              : ``\n          }` +\n            `\\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`\n        )\n\n        if (staticBailoutInfo?.stack) {\n          const stack = staticBailoutInfo.stack\n          err.stack = err.message + stack.substring(stack.indexOf('\\n'))\n        }\n\n        throw err\n      }\n\n      return {\n        value: {\n          kind: CachedRouteKind.APP_PAGE,\n          html: result,\n          headers,\n          rscData: metadata.flightData,\n          postponed: metadata.postponed,\n          status: metadata.statusCode,\n          segmentData: metadata.segmentData,\n        } satisfies CachedAppPageValue,\n        cacheControl,\n      } satisfies ResponseCacheEntry\n    }\n\n    const responseGenerator: ResponseGenerator = async ({\n      hasResolved,\n      previousCacheEntry: previousIncrementalCacheEntry,\n      isRevalidating,\n      span,\n      forceStaticRender = false,\n    }) => {\n      const isProduction = routeModule.isDev === false\n      const didRespond = hasResolved || res.writableEnded\n\n      // skip on-demand revalidate if cache is not present and\n      // revalidate-if-generated is set\n      if (\n        isOnDemandRevalidate &&\n        revalidateOnlyGenerated &&\n        !previousIncrementalCacheEntry &&\n        !isMinimalMode\n      ) {\n        if (routerServerContext?.render404) {\n          await routerServerContext.render404(req, res)\n        } else {\n          res.statusCode = 404\n          res.end('This page could not be found')\n        }\n        return null\n      }\n\n      let fallbackMode: FallbackMode | undefined\n\n      if (prerenderInfo) {\n        fallbackMode = parseFallbackField(prerenderInfo.fallback)\n      }\n\n      if (\n        nextConfig.experimental.partialFallbacks === true &&\n        prerenderInfo?.fallback === null &&\n        !hasUnresolvedRootFallbackParams &&\n        remainingPrerenderableParams.length > 0\n      ) {\n        // Generic source shells without unresolved root params don't have a\n        // concrete fallback file of their own, so they're marked as blocking.\n        // When we can complete the shell into a more specific\n        // prerendered shell for this request, treat it like a prerender\n        // fallback so we can serve that shell instead of blocking on the full\n        // route. Root-param shells stay blocking, since unknown root branches\n        // should not inherit a shell from another generated branch.\n        fallbackMode = FallbackMode.PRERENDER\n      }\n\n      // When serving a HTML bot request, we want to serve a blocking render and\n      // not the prerendered page. This ensures that the correct content is served\n      // to the bot in the head.\n      if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) {\n        if (!isRoutePPREnabled || isHtmlBot) {\n          fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER\n        }\n      }\n\n      if (previousIncrementalCacheEntry?.isStale === -1) {\n        isOnDemandRevalidate = true\n      }\n\n      // TODO: adapt for PPR\n      // only allow on-demand revalidate for fallback: true/blocking\n      // or for prerendered fallback: false paths\n      if (\n        isOnDemandRevalidate &&\n        (fallbackMode !== FallbackMode.NOT_FOUND ||\n          previousIncrementalCacheEntry)\n      ) {\n        fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER\n      }\n\n      if (\n        !isMinimalMode &&\n        fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER &&\n        staticPathKey &&\n        !didRespond &&\n        !isDraftMode &&\n        pageIsDynamic &&\n        (isProduction || !isPrerendered)\n      ) {\n        // if the page has dynamicParams: false and this pathname wasn't\n        // prerendered trigger the no fallback handling\n        if (\n          // In development, fall through to render to handle missing\n          // getStaticPaths.\n          (isProduction || prerenderInfo) &&\n          // When fallback isn't present, abort this render so we 404\n          fallbackMode === FallbackMode.NOT_FOUND\n        ) {\n          if (nextConfig.adapterPath) {\n            return await render404()\n          }\n          throw new NoFallbackError()\n        }\n\n        // When cacheComponents is enabled, we can use the fallback\n        // response if the request is not a dynamic RSC request because the\n        // RSC data when this feature flag is enabled does not contain any\n        // param references. Without this feature flag enabled, the RSC data\n        // contains param references, and therefore we can't use the fallback.\n        if (\n          isRoutePPREnabled &&\n          (nextConfig.cacheComponents ? !isDynamicRSCRequest : !isRSCRequest)\n        ) {\n          const cacheKey =\n            isProduction && typeof prerenderInfo?.fallback === 'string'\n              ? prerenderInfo.fallback\n              : normalizedSrcPage\n\n          const fallbackRouteParams =\n            // In production or when debugging the static shell (e.g. instant\n            // navigation testing), use the prerender manifest's fallback\n            // route params which correctly identifies which params are\n            // unknown. Note: in dev, this block is only entered for\n            // non-prerendered URLs (guarded by the outer condition).\n            (isProduction || isDebugStaticShell) &&\n            prerenderInfo?.fallbackRouteParams\n              ? createOpaqueFallbackRouteParams(\n                  prerenderInfo.fallbackRouteParams\n                )\n              : // When debugging the fallback shell, treat all params as\n                // fallback (simulating the worst-case shell).\n                isDebugFallbackShell\n                ? getFallbackRouteParams(normalizedSrcPage, routeModule)\n                : null\n\n          // When rendering a debug static shell, override the fallback\n          // params on the request so that the staged rendering correctly\n          // defers params that are not statically known.\n          if (isDebugStaticShell && fallbackRouteParams) {\n            addRequestMeta(req, 'fallbackParams', fallbackRouteParams)\n          }\n\n          // We use the response cache here to handle the revalidation and\n          // management of the fallback shell.\n          const fallbackResponse = await routeModule.handleResponse({\n            cacheKey,\n            req,\n            nextConfig,\n            routeKind: RouteKind.APP_PAGE,\n            isFallback: true,\n            prerenderManifest,\n            isRoutePPREnabled,\n            responseGenerator: async () =>\n              doRender({\n                span,\n                // We pass `undefined` as rendering a fallback isn't resumed\n                // here.\n                postponed: undefined,\n                // Always serve the shell that matched this request\n                // immediately. If there are still prerenderable params left,\n                // the background path below will complete the shell into a\n                // more specific cache entry for later requests.\n                fallbackRouteParams,\n                forceStaticRender: true,\n              }),\n            waitUntil: ctx.waitUntil,\n            isMinimalMode,\n          })\n\n          // If the fallback response was set to null, then we should return null.\n          if (fallbackResponse === null) return null\n\n          // Otherwise, if we did get a fallback response, we should return it.\n          if (fallbackResponse) {\n            if (\n              !isMinimalMode &&\n              isRoutePPREnabled &&\n              // Match the build-time contract: only fallback shells that can\n              // still be completed with prerenderable params should upgrade.\n              remainingPrerenderableParams.length > 0 &&\n              nextConfig.experimental.partialFallbacks === true &&\n              ssgCacheKey &&\n              incrementalCache &&\n              !isOnDemandRevalidate &&\n              !isDebugFallbackShell &&\n              // The testing API relies on deterministic shell behavior, so\n              // don't upgrade fallback shells in the background when it's\n              // exposed.\n              !exposeTestingApi &&\n              // Instant Navigation Testing API requests intentionally keep\n              // the route in shell mode; don't upgrade these in background.\n              !isInstantNavigationTest &&\n              // Avoid background revalidate during prefetches; this can trigger\n              // static prerender errors that surface as 500s for the prefetch\n              // request itself.\n              !isPrefetchRSCRequest\n            ) {\n              scheduleOnNextTick(async () => {\n                const responseCache = routeModule.getResponseCache(req)\n\n                try {\n                  // Only the params that were just specialized should be\n                  // removed from the fallback render. Any remaining fallback\n                  // params stay deferred so the revalidated result is a more\n                  // specific shell (e.g. `/prefix/c/[two]`), not a fully\n                  // concrete route (`/prefix/c/foo`).\n                  await responseCache.revalidate(\n                    ssgCacheKey,\n                    incrementalCache,\n                    isRoutePPREnabled,\n                    false,\n                    (c) => {\n                      return doRender({\n                        span: c.span,\n                        postponed: undefined,\n                        fallbackRouteParams:\n                          remainingFallbackRouteParams.length > 0\n                            ? createOpaqueFallbackRouteParams(\n                                remainingFallbackRouteParams\n                              )\n                            : null,\n                        forceStaticRender: true,\n                      })\n                    },\n                    // We don't have a prior entry for this param-specific shell.\n                    null,\n                    hasResolved,\n                    ctx.waitUntil\n                  )\n                } catch (err) {\n                  console.error(\n                    'Error revalidating the page in the background',\n                    err\n                  )\n                }\n              })\n            }\n\n            // Remove the cache control from the response to prevent it from being\n            // used in the surrounding cache.\n            delete fallbackResponse.cacheControl\n\n            return fallbackResponse\n          }\n        }\n      }\n\n      // Only requests that aren't revalidating can be resumed. If we have the\n      // minimal postponed data, then we should resume the render with it.\n      let postponed =\n        !isOnDemandRevalidate && !isRevalidating && minimalPostponed\n          ? minimalPostponed\n          : undefined\n\n      // If this is a dynamic RSC request or a server action request, we should\n      // use the postponed data from the static render (if available). This\n      // ensures that we can utilize the resume data cache (RDC) from the static\n      // render to ensure that the data is consistent between the static and\n      // dynamic renders (for navigations) or when re-rendering after a server\n      // action.\n      if (\n        // Only enable RDC for Navigations if the feature is enabled.\n        supportsRDCForNavigations &&\n        process.env.NEXT_RUNTIME !== 'edge' &&\n        !isMinimalMode &&\n        incrementalCache &&\n        // Include both dynamic RSC requests (navigations) and server actions\n        (isDynamicRSCRequest || isPossibleServerAction) &&\n        // We don't typically trigger an on-demand revalidation for dynamic RSC\n        // requests, as we're typically revalidating the page in the background\n        // instead. However, if the cache entry is stale, we should trigger a\n        // background revalidation on dynamic RSC requests. This prevents us\n        // from entering an infinite loop of revalidations.\n        !forceStaticRender\n      ) {\n        const incrementalCacheEntry = await incrementalCache.get(\n          resolvedPathname,\n          {\n            kind: IncrementalCacheKind.APP_PAGE,\n            isRoutePPREnabled: true,\n            isFallback: false,\n          }\n        )\n\n        // If the cache entry is found, we should use the postponed data from\n        // the cache.\n        if (\n          incrementalCacheEntry &&\n          incrementalCacheEntry.value &&\n          incrementalCacheEntry.value.kind === CachedRouteKind.APP_PAGE\n        ) {\n          // CRITICAL: we're assigning the postponed data from the cache entry\n          // here as we're using the RDC to resume the render.\n          postponed = incrementalCacheEntry.value.postponed\n\n          // If the cache entry is stale, we should trigger a background\n          // revalidation so that subsequent requests will get a fresh response.\n          if (\n            incrementalCacheEntry &&\n            // We want to trigger this flow if the cache entry is stale and if\n            // the requested revalidation flow is either foreground or\n            // background.\n            (incrementalCacheEntry.isStale === -1 ||\n              incrementalCacheEntry.isStale === true)\n          ) {\n            // We want to schedule this on the next tick to ensure that the\n            // render is not blocked on it.\n            scheduleOnNextTick(async () => {\n              const responseCache = routeModule.getResponseCache(req)\n\n              try {\n                await responseCache.revalidate(\n                  resolvedPathname,\n                  incrementalCache,\n                  isRoutePPREnabled,\n                  false,\n                  (c) =>\n                    responseGenerator({\n                      ...c,\n                      // CRITICAL: we need to set this to true as we're\n                      // revalidating in the background and typically this dynamic\n                      // RSC request is not treated as static.\n                      forceStaticRender: true,\n                    }),\n                  // CRITICAL: we need to pass null here because passing the\n                  // previous cache entry here (which is stale) will switch on\n                  // isOnDemandRevalidate and break the prerendering.\n                  null,\n                  hasResolved,\n                  ctx.waitUntil\n                )\n              } catch (err) {\n                console.error(\n                  'Error revalidating the page in the background',\n                  err\n                )\n              }\n            })\n          }\n        }\n      }\n\n      // When we're in minimal mode, if we're trying to debug the static shell,\n      // we should just return nothing instead of resuming the dynamic render.\n      if (\n        (isDebugStaticShell || isDebugDynamicAccesses) &&\n        typeof postponed !== 'undefined'\n      ) {\n        return {\n          cacheControl: { revalidate: 1, expire: undefined },\n          value: {\n            kind: CachedRouteKind.PAGES,\n            html: RenderResult.EMPTY,\n            pageData: {},\n            headers: undefined,\n            status: undefined,\n          } satisfies CachedPageValue,\n        }\n      }\n\n      const fallbackRouteParams =\n        // In production or when debugging the static shell for a\n        // non-prerendered URL, use the prerender manifest's fallback route\n        // params which correctly identifies which params are unknown.\n        ((isProduction && getRequestMeta(req, 'renderFallbackShell')) ||\n          (isDebugStaticShell && !isPrerendered)) &&\n        prerenderInfo?.fallbackRouteParams\n          ? createOpaqueFallbackRouteParams(prerenderInfo.fallbackRouteParams)\n          : isDebugFallbackShell\n            ? getFallbackRouteParams(normalizedSrcPage, routeModule)\n            : null\n\n      // For staged dynamic rendering (Cached Navigations) and debug static\n      // shell rendering, pass the fallback params via request meta so the\n      // RequestStore knows which params to defer. We don't pass them as\n      // fallbackRouteParams because that would replace actual param values\n      // with opaque placeholders during segment resolution.\n      if (\n        (isProduction || isDebugStaticShell) &&\n        nextConfig.cacheComponents &&\n        !isPrerendered &&\n        prerenderInfo?.fallbackRouteParams\n      ) {\n        const fallbackParams = createOpaqueFallbackRouteParams(\n          prerenderInfo.fallbackRouteParams\n        )\n\n        if (fallbackParams) {\n          addRequestMeta(req, 'fallbackParams', fallbackParams)\n        }\n      }\n\n      // Perform the render.\n      return doRender({\n        span,\n        postponed,\n        fallbackRouteParams,\n        forceStaticRender,\n      })\n    }\n\n    const handleResponse = async (span?: Span): Promise<null | void> => {\n      const cacheEntry = await routeModule.handleResponse({\n        cacheKey: ssgCacheKey,\n        responseGenerator: (c) =>\n          responseGenerator({\n            span,\n            ...c,\n          }),\n        routeKind: RouteKind.APP_PAGE,\n        isOnDemandRevalidate,\n        isRoutePPREnabled,\n        req,\n        nextConfig,\n        prerenderManifest,\n        waitUntil: ctx.waitUntil,\n        isMinimalMode,\n      })\n\n      if (isDraftMode) {\n        res.setHeader(\n          'Cache-Control',\n          'private, no-cache, no-store, max-age=0, must-revalidate'\n        )\n      }\n\n      // In dev, we should not cache pages for any reason.\n      if (routeModule.isDev) {\n        res.setHeader('Cache-Control', 'no-cache, must-revalidate')\n      }\n\n      if (!cacheEntry) {\n        if (ssgCacheKey) {\n          // A cache entry might not be generated if a response is written\n          // in `getInitialProps` or `getServerSideProps`, but those shouldn't\n          // have a cache key. If we do have a cache key but we don't end up\n          // with a cache entry, then either Next.js or the application has a\n          // bug that needs fixing.\n          throw new Error('invariant: cache entry required but not generated')\n        }\n        return null\n      }\n\n      if (cacheEntry.value?.kind !== CachedRouteKind.APP_PAGE) {\n        throw new Error(\n          `Invariant app-page handler received invalid cache entry ${cacheEntry.value?.kind}`\n        )\n      }\n\n      const didPostpone = typeof cacheEntry.value.postponed === 'string'\n\n      // Set the build ID header for RSC navigation requests when deploymentId is configured. This\n      // corresponds with maybeAppendBuildIdToRSCPayload in app-render.tsx which omits the build ID\n      // from the RSC payload when deploymentId is set (relying on this header instead). Server\n      // actions are excluded here because action redirect responses get the deployment ID header\n      // from the pre-fetched redirect target (via createRedirectRenderResult in action-handler.ts\n      // which copies headers from the internal RSC fetch).\n      // For static prerenders served from CDN, routes-manifest.json adds a header.\n      if (isRSCRequest && !isPossibleServerAction && deploymentId) {\n        res.setHeader(NEXT_NAV_DEPLOYMENT_ID_HEADER, deploymentId)\n      }\n\n      if (\n        isSSG &&\n        // We don't want to send a cache header for requests that contain dynamic\n        // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC\n        // request, then we should set the cache header.\n        !isDynamicRSCRequest &&\n        (!didPostpone || isPrefetchRSCRequest)\n      ) {\n        if (!isMinimalMode) {\n          // set x-nextjs-cache header to match the header\n          // we set for the image-optimizer\n          res.setHeader(\n            'x-nextjs-cache',\n            isOnDemandRevalidate\n              ? 'REVALIDATED'\n              : cacheEntry.isMiss\n                ? 'MISS'\n                : cacheEntry.isStale\n                  ? 'STALE'\n                  : 'HIT'\n          )\n        }\n        // Set a header used by the client router to signal the response is static\n        // and should respect the `static` cache staleTime value.\n        res.setHeader(NEXT_IS_PRERENDER_HEADER, '1')\n      }\n      const { value: cachedData } = cacheEntry\n\n      // Coerce the cache control parameter from the render.\n      let cacheControl: CacheControl | undefined\n\n      // If this is a resume request in minimal mode it is streamed with dynamic\n      // content and should not be cached.\n      if (minimalPostponed) {\n        cacheControl = { revalidate: 0, expire: undefined }\n      }\n\n      // If this is in minimal mode and this is a flight request that isn't a\n      // prefetch request while PPR is enabled, it cannot be cached as it contains\n      // dynamic content.\n      else if (isDynamicRSCRequest) {\n        cacheControl = { revalidate: 0, expire: undefined }\n      } else if (!routeModule.isDev) {\n        // If this is a preview mode request, we shouldn't cache it\n        if (isDraftMode) {\n          cacheControl = { revalidate: 0, expire: undefined }\n        }\n\n        // If this isn't SSG, then we should set change the header only if it is\n        // not set already.\n        else if (!isSSG) {\n          if (!res.getHeader('Cache-Control')) {\n            cacheControl = { revalidate: 0, expire: undefined }\n          }\n        } else if (cacheEntry.cacheControl) {\n          // If the cache entry has a cache control with a revalidate value that's\n          // a number, use it.\n          if (typeof cacheEntry.cacheControl.revalidate === 'number') {\n            if (cacheEntry.cacheControl.revalidate < 1) {\n              throw new Error(\n                `Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`\n              )\n            }\n\n            cacheControl = {\n              revalidate: cacheEntry.cacheControl.revalidate,\n              expire: cacheEntry.cacheControl?.expire ?? nextConfig.expireTime,\n            }\n          }\n          // Otherwise if the revalidate value is false, then we should use the\n          // cache time of one year.\n          else {\n            cacheControl = {\n              revalidate: CACHE_ONE_YEAR_SECONDS,\n              expire: undefined,\n            }\n          }\n        }\n      }\n\n      cacheEntry.cacheControl = cacheControl\n\n      if (\n        typeof segmentPrefetchHeader === 'string' &&\n        cachedData?.kind === CachedRouteKind.APP_PAGE &&\n        cachedData.segmentData\n      ) {\n        // This is a prefetch request issued by the client Segment Cache. These\n        // should never reach the application layer (lambda). We should either\n        // respond from the cache (HIT) or respond with 204 No Content (MISS).\n\n        // Set a header to indicate that PPR is enabled for this route. This\n        // lets the client distinguish between a regular cache miss and a cache\n        // miss due to PPR being disabled. In other contexts this header is used\n        // to indicate that the response contains dynamic data, but here we're\n        // only using it to indicate that the feature is enabled — the segment\n        // response itself contains whether the data is dynamic.\n        res.setHeader(NEXT_DID_POSTPONE_HEADER, '2')\n\n        // Add the cache tags header to the response if it exists and we're in\n        // minimal mode while rendering a static page.\n        const tags = cachedData.headers?.[NEXT_CACHE_TAGS_HEADER]\n        if (isMinimalMode && isSSG && tags && typeof tags === 'string') {\n          res.setHeader(NEXT_CACHE_TAGS_HEADER, tags)\n        }\n\n        const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader)\n        if (matchedSegment !== undefined) {\n          // Cache hit\n          return sendRenderResult({\n            req,\n            res,\n            generateEtags: nextConfig.generateEtags,\n            poweredByHeader: nextConfig.poweredByHeader,\n            result: RenderResult.fromStatic(\n              matchedSegment,\n              RSC_CONTENT_TYPE_HEADER\n            ),\n            cacheControl: cacheEntry.cacheControl,\n          })\n        }\n\n        // Cache miss. Either a cache entry for this route has not been generated\n        // (which technically should not be possible when PPR is enabled, because\n        // at a minimum there should always be a fallback entry) or there's no\n        // match for the requested segment. Respond with a 204 No Content. We\n        // don't bother to respond with 404, because these requests are only\n        // issued as part of a prefetch.\n        res.statusCode = 204\n        return sendRenderResult({\n          req,\n          res,\n          generateEtags: nextConfig.generateEtags,\n          poweredByHeader: nextConfig.poweredByHeader,\n          result: RenderResult.EMPTY,\n          cacheControl: cacheEntry.cacheControl,\n        })\n      }\n\n      // If there's a callback for `onCacheEntry`, call it with the cache entry\n      // and the revalidate options. If we support RDC for Navigations, we\n      // prefer the `onCacheEntryV2` callback. Once RDC for Navigations is the\n      // default, we can remove the fallback to `onCacheEntry` as\n      // `onCacheEntryV2` is now fully supported.\n      const onCacheEntry = supportsRDCForNavigations\n        ? (getRequestMeta(req, 'onCacheEntryV2') ??\n          getRequestMeta(req, 'onCacheEntry'))\n        : getRequestMeta(req, 'onCacheEntry')\n      if (onCacheEntry) {\n        const finished = await onCacheEntry(cacheEntry, {\n          url: getRequestMeta(req, 'initURL') ?? req.url,\n        })\n        if (finished) return null\n      }\n\n      if (cachedData.headers) {\n        const headers = { ...cachedData.headers }\n\n        if (!isMinimalMode || !isSSG) {\n          delete headers[NEXT_CACHE_TAGS_HEADER]\n        }\n\n        for (let [key, value] of Object.entries(headers)) {\n          if (typeof value === 'undefined') continue\n\n          if (Array.isArray(value)) {\n            for (const v of value) {\n              res.appendHeader(key, v)\n            }\n          } else if (typeof value === 'number') {\n            value = value.toString()\n            res.appendHeader(key, value)\n          } else {\n            res.appendHeader(key, value)\n          }\n        }\n      }\n\n      // Add the cache tags header to the response if it exists and we're in\n      // minimal mode while rendering a static page.\n      const tags = cachedData.headers?.[NEXT_CACHE_TAGS_HEADER]\n      if (isMinimalMode && isSSG && tags && typeof tags === 'string') {\n        res.setHeader(NEXT_CACHE_TAGS_HEADER, tags)\n      }\n\n      // If the request is a data request, then we shouldn't set the status code\n      // from the response because it should always be 200. This should be gated\n      // behind the experimental PPR flag.\n      if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) {\n        res.statusCode = cachedData.status\n      }\n\n      // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes\n      if (\n        !isMinimalMode &&\n        cachedData.status &&\n        RedirectStatusCode[cachedData.status] &&\n        isRSCRequest\n      ) {\n        res.statusCode = 200\n      }\n\n      // Mark that the request did postpone.\n      if (didPostpone && !isDynamicRSCRequest) {\n        res.setHeader(NEXT_DID_POSTPONE_HEADER, '1')\n      }\n\n      // we don't go through this block when preview mode is true\n      // as preview mode is a dynamic request (bypasses cache) and doesn't\n      // generate both HTML and payloads in the same request so continue to just\n      // return the generated payload\n      if (isRSCRequest && !isDraftMode) {\n        // If this is a dynamic RSC request, then stream the response.\n        if (typeof cachedData.rscData === 'undefined') {\n          // If the response is not an RSC response, then we can't serve it.\n          if (cachedData.html.contentType !== RSC_CONTENT_TYPE_HEADER) {\n            if (nextConfig.cacheComponents) {\n              res.statusCode = 404\n              return sendRenderResult({\n                req,\n                res,\n                generateEtags: nextConfig.generateEtags,\n                poweredByHeader: nextConfig.poweredByHeader,\n                result: RenderResult.EMPTY,\n                cacheControl: cacheEntry.cacheControl,\n              })\n            } else {\n              // Otherwise this case is not expected.\n              throw new InvariantError(\n                `Expected RSC response, got ${cachedData.html.contentType}`\n              )\n            }\n          }\n\n          return sendRenderResult({\n            req,\n            res,\n            generateEtags: nextConfig.generateEtags,\n            poweredByHeader: nextConfig.poweredByHeader,\n            result: cachedData.html,\n            cacheControl: cacheEntry.cacheControl,\n          })\n        }\n\n        // As this isn't a prefetch request, we should serve the static flight\n        // data.\n        return sendRenderResult({\n          req,\n          res,\n          generateEtags: nextConfig.generateEtags,\n          poweredByHeader: nextConfig.poweredByHeader,\n          result: RenderResult.fromStatic(\n            cachedData.rscData,\n            RSC_CONTENT_TYPE_HEADER\n          ),\n          cacheControl: cacheEntry.cacheControl,\n        })\n      }\n\n      // This is a request for HTML data.\n      const body = cachedData.html\n\n      // Instant Navigation Testing API: serve the static shell with an\n      // injected script that sets self.__next_instant_test and kicks off a\n      // static RSC fetch for hydration. The transform stream also appends\n      // closing </body></html> tags so the browser can parse the full document.\n      // In dev mode, also inject self.__next_r so the HMR WebSocket and\n      // debug channel can initialize.\n      if (isInstantNavigationTest && isDebugStaticShell) {\n        const instantTestRequestId =\n          routeModule.isDev === true ? crypto.randomUUID() : null\n        body.pipeThrough(\n          createInstantTestScriptInsertionTransformStream(instantTestRequestId)\n        )\n        return sendRenderResult({\n          req,\n          res,\n          generateEtags: nextConfig.generateEtags,\n          poweredByHeader: nextConfig.poweredByHeader,\n          result: body,\n          cacheControl: { revalidate: 0, expire: undefined },\n        })\n      }\n\n      // If there's no postponed state, we should just serve the HTML. This\n      // should also be the case for a resume request because it's completed\n      // as a server render (rather than a static render).\n      if (!didPostpone || isMinimalMode || isRSCRequest) {\n        // If we're in test mode, we should add a sentinel chunk to the response\n        // that's between the static and dynamic parts so we can compare the\n        // chunks and add assertions.\n        if (\n          process.env.__NEXT_TEST_MODE &&\n          isMinimalMode &&\n          isRoutePPREnabled &&\n          body.contentType === HTML_CONTENT_TYPE_HEADER\n        ) {\n          // As we're in minimal mode, the static part would have already been\n          // streamed first. The only part that this streams is the dynamic part\n          // so we should FIRST stream the sentinel and THEN the dynamic part.\n          body.unshift(createPPRBoundarySentinel())\n        }\n\n        return sendRenderResult({\n          req,\n          res,\n          generateEtags: nextConfig.generateEtags,\n          poweredByHeader: nextConfig.poweredByHeader,\n          result: body,\n          cacheControl: cacheEntry.cacheControl,\n        })\n      }\n\n      // If we're debugging the static shell or the dynamic API accesses, we\n      // should just serve the HTML without resuming the render. The returned\n      // HTML will be the static shell so all the Dynamic API's will be used\n      // during static generation.\n      if (isDebugStaticShell || isDebugDynamicAccesses) {\n        // Since we're not resuming the render, we need to at least add the\n        // closing body and html tags to create valid HTML.\n        body.push(\n          new ReadableStream({\n            start(controller) {\n              controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n              controller.close()\n            },\n          })\n        )\n\n        return sendRenderResult({\n          req,\n          res,\n          generateEtags: nextConfig.generateEtags,\n          poweredByHeader: nextConfig.poweredByHeader,\n          result: body,\n          cacheControl: { revalidate: 0, expire: undefined },\n        })\n      }\n\n      // If we're in test mode, we should add a sentinel chunk to the response\n      // that's between the static and dynamic parts so we can compare the\n      // chunks and add assertions.\n      if (process.env.__NEXT_TEST_MODE) {\n        body.push(createPPRBoundarySentinel())\n      }\n\n      // This request has postponed, so let's create a new transformer that the\n      // dynamic data can pipe to that will attach the dynamic data to the end\n      // of the response.\n      const transformer = new TransformStream<Uint8Array, Uint8Array>()\n      body.push(transformer.readable)\n\n      // Perform the render again, but this time, provide the postponed state.\n      // We don't await because we want the result to start streaming now, and\n      // we've already chained the transformer's readable to the render result.\n      doRender({\n        span,\n        postponed: cachedData.postponed,\n        // This is a resume render, not a fallback render, so we don't need to\n        // set this.\n        fallbackRouteParams: null,\n        forceStaticRender: false,\n      })\n        .then(async (result) => {\n          if (!result) {\n            throw new Error('Invariant: expected a result to be returned')\n          }\n\n          if (result.value?.kind !== CachedRouteKind.APP_PAGE) {\n            throw new Error(\n              `Invariant: expected a page response, got ${result.value?.kind}`\n            )\n          }\n\n          // Pipe the resume result to the transformer.\n          await result.value.html.pipeTo(transformer.writable)\n        })\n        .catch((err) => {\n          // An error occurred during piping or preparing the render, abort\n          // the transformers writer so we can terminate the stream.\n          transformer.writable.abort(err).catch((e) => {\n            console.error(\"couldn't abort transformer\", e)\n          })\n        })\n\n      return sendRenderResult({\n        req,\n        res,\n        generateEtags: nextConfig.generateEtags,\n        poweredByHeader: nextConfig.poweredByHeader,\n        result: body,\n        // We don't want to cache the response if it has postponed data because\n        // the response being sent to the client it's dynamic parts are streamed\n        // to the client on the same request.\n        cacheControl: { revalidate: 0, expire: undefined },\n      })\n    }\n\n    // TODO: activeSpan code path is for when wrapped by\n    // next-server can be removed when this is no longer used\n    if (isWrappedByNextServer && activeSpan) {\n      await handleResponse(activeSpan)\n    } else {\n      parentSpan = tracer.getActiveScopeSpan()\n      return await tracer.withPropagatedContext(\n        req.headers,\n        () =>\n          tracer.trace(\n            BaseServerSpan.handleRequest,\n            {\n              spanName: `${method} ${srcPage}`,\n              kind: SpanKind.SERVER,\n              attributes: {\n                'http.method': method,\n                'http.target': req.url,\n              },\n            },\n            handleResponse\n          ),\n        undefined,\n        !isWrappedByNextServer\n      )\n    }\n  } catch (err) {\n    if (!(err instanceof NoFallbackError)) {\n      const silenceLog = false\n      await routeModule.onRequestError(\n        req,\n        err,\n        {\n          routerKind: 'App Router',\n          routePath: srcPage,\n          routeType: 'render',\n          revalidateReason: getRevalidateReason({\n            isStaticGeneration: isSSG,\n            isOnDemandRevalidate,\n          }),\n        },\n        silenceLog,\n        routerServerContext\n      )\n    }\n\n    // rethrow so that we can handle serving error page\n    throw err\n  }\n}\n\n// TODO: omit this from production builds, only test builds should include it\n/**\n * Creates a readable stream that emits a PPR boundary sentinel.\n *\n * @returns A readable stream that emits a PPR boundary sentinel.\n */\nfunction createPPRBoundarySentinel() {\n  return new ReadableStream({\n    start(controller) {\n      controller.enqueue(\n        new TextEncoder().encode('<!-- PPR_BOUNDARY_SENTINEL -->')\n      )\n      controller.close()\n    },\n  })\n}\n"],"names":["__next_app__","handler","routeModule","require","__next_app_require__","loadChunk","__next_app_load_chunk__","AppPageRouteModule","definition","kind","RouteKind","APP_PAGE","page","pathname","bundlePath","filename","appPaths","userland","loaderTree","tree","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","buildDynamicSegmentPlaceholder","param","repeat","optional","getParamProperties","paramType","paramName","buildCompletedShellCacheKey","fallbackPathname","remainingPrerenderableParams","params","prerenderableParamsByName","Map","map","split","segment","segmentParam","getSegmentParam","remainingParam","get","value","encodedValue","Array","isArray","item","encodeURIComponent","join","replace","req","res","ctx","prerenderManifest","prerenderInfo","requestMeta","setRequestMeta","isDev","addRequestMeta","hrtime","bigint","isMinimalMode","Boolean","getRequestMeta","srcPage","TURBOPACK","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","query","pageIsDynamic","buildManifest","nextFontManifest","reactLoadableManifest","serverActionsManifest","clientReferenceManifest","subresourceIntegrityManifest","isDraftMode","resolvedPathname","revalidateOnlyGenerated","routerServerContext","nextConfig","parsedUrl","interceptionRoutePatterns","deploymentId","clientAssetToken","normalizedSrcPage","normalizeAppPath","isOnDemandRevalidate","prerenderMatch","experimental","ppr","cacheComponents","isInterceptionRouteAppPath","match","route","isPrerendered","routes","userAgent","headers","botType","getBotType","isHtmlBot","isHtmlBotRequest","isPrefetchRSCRequest","NEXT_ROUTER_PREFETCH_HEADER","isRSCRequest","RSC_HEADER","isPossibleServerAction","getIsPossibleServerAction","couldSupportPPR","checkIsAppPPREnabled","resumeStateLengthHeader","NEXT_RESUME_STATE_LENGTH_HEADER","stateLength","parseInt","maxPostponedStateSize","maxPostponedStateSizeBytes","getMaxPostponedStateSize","isNaN","getPostponedStateExceededErrorMessage","defaultActionBodySizeLimit","actionBodySizeLimit","serverActions","bodySizeLimit","actionBodySizeLimitBytes","parse","maxTotalBodySize","fullBody","readBodyWithSizeLimit","length","postponedState","subarray","toString","actionBody","Error","NEXT_RESUME_HEADER","method","body","postponed","hasDebugStaticShellQuery","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","__nextppronly","hasDebugFallbackShellQuery","exposeTestingApi","exposeTestingApiInProductionBuild","isInstantNavigationTest","NEXT_INSTANT_PREFETCH_HEADER","undefined","cookie","includes","NEXT_INSTANT_TEST_COOKIE","isRoutePPREnabled","dynamicRoutes","renderingMode","experimentalTestProxy","isDebugStaticShell","isDebugDynamicAccesses","isDebugFallbackShell","minimalPostponed","staticPrefetchDataRoute","prefetchDataRoute","isDynamicRSCRequest","segmentPrefetchHeader","serveStreamingMetadata","shouldServeStreamingMetadata","htmlLimitedBots","isSSG","supportsRDCForNavigations","supportsDynamicResponse","shouldWaitOnAllReady","hasUnresolvedRootFallbackParams","fallback","fallbackRootParams","ssgCacheKey","source","partialFallbacks","fallbackRouteParams","completedShellCacheKey","staticPathKey","stripFlightHeaders","ComponentMod","entryBase","setManifestsSingleton","tracer","getTracer","activeSpan","getActiveScopeSpan","isWrappedByNextServer","remainingFallbackRouteParams","filter","some","prerenderableParam","render404","varyHeader","getVaryHeader","setHeader","parentSpan","invokeRouteModule","span","context","nextReq","NodeNextRequest","nextRes","NodeNextResponse","render","finally","setAttributes","rootSpanAttributes","getRootSpanAttributes","BaseServerSpan","handleRequest","console","warn","name","updateName","setAttribute","incrementalCache","getIncrementalCache","resetRequestCache","globalThis","__incrementalCache","doRender","forceStaticRender","sharedContext","serverComponentsHmrCache","renderOpts","App","Document","pageConfig","Component","interopDefault","setCacheStatus","setIsrStatus","setReactDebugChannel","sendErrorsToBrowser","dir","NEXT_RUNTIME","cwd","assetPrefix","nextConfigOutput","output","crossOrigin","trailingSlash","images","previewProps","preview","enableTainting","taint","reactMaxHeadersLength","cacheLifeProfiles","cacheLife","basePath","logServerFunctions","logging","serverFunctions","isBuildTimePrerendering","isStaticGeneration","expireTime","staleTimes","dynamicOnHover","optimisticRouting","inlineCss","prefetchInlining","authInterrupts","cachedNavigations","clientTraceMetadata","clientParamParsingOrigins","parseMaxPostponedStateSize","onClose","cb","on","onAfterTaskError","onInstrumentationRequestError","error","_request","errorContext","silenceLog","onRequestError","err","result","metadata","cacheControl","fetchTags","cacheTags","fetchMetrics","NEXT_CACHE_TAGS_HEADER","revalidate","staticBailoutInfo","description","stack","message","substring","indexOf","CachedRouteKind","html","rscData","flightData","status","segmentData","responseGenerator","hasResolved","previousCacheEntry","previousIncrementalCacheEntry","isRevalidating","isProduction","didRespond","writableEnded","fallbackMode","parseFallbackField","FallbackMode","PRERENDER","isBot","BLOCKING_STATIC_RENDER","isStale","NOT_FOUND","adapterPath","NoFallbackError","cacheKey","createOpaqueFallbackRouteParams","getFallbackRouteParams","fallbackResponse","handleResponse","routeKind","isFallback","scheduleOnNextTick","responseCache","getResponseCache","c","incrementalCacheEntry","IncrementalCacheKind","expire","PAGES","RenderResult","EMPTY","pageData","fallbackParams","cacheEntry","cachedData","didPostpone","NEXT_NAV_DEPLOYMENT_ID_HEADER","isMiss","NEXT_IS_PRERENDER_HEADER","getHeader","CACHE_ONE_YEAR_SECONDS","NEXT_DID_POSTPONE_HEADER","tags","matchedSegment","sendRenderResult","generateEtags","poweredByHeader","fromStatic","RSC_CONTENT_TYPE_HEADER","onCacheEntry","finished","url","key","Object","entries","v","appendHeader","RedirectStatusCode","contentType","InvariantError","instantTestRequestId","crypto","randomUUID","pipeThrough","createInstantTestScriptInsertionTransformStream","__NEXT_TEST_MODE","HTML_CONTENT_TYPE_HEADER","unshift","createPPRBoundarySentinel","push","ReadableStream","start","controller","enqueue","ENCODED_TAGS","CLOSED","BODY_AND_HTML","close","transformer","TransformStream","readable","then","pipeTo","writable","catch","abort","e","withPropagatedContext","trace","spanName","SpanKind","SERVER","attributes","routerKind","routePath","routeType","revalidateReason","getRevalidateReason","TextEncoder","encode"],"mappings":";;;;;;;;;;;;;;;;IA2GaA,YAAY;eAAZA;;IAqGSC,OAAO;eAAPA;;IAnFTC,WAAW;eAAXA;;;;gCAtHN;2BAEmB;uBAEU;wBAK7B;6BAMA;2BACwB;gCACA;oCACI;sBAI5B;qBAC8B;gCAK9B;oCAC+B;mCAI/B;0BAC0B;yCACS;kCASnC;uBAIA;+BAQA;0BAIA;qEACkB;4BAQlB;6BAEsB;sCACmC;6BAC/B;yCACD;2BACW;sCAKpC;gFAyBoB;oCACQ;gCACJ;2BACI;oCACQ;iCAIpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAbA,MAAMF,eAAe;IAC1BG,SAASC;IACTC,WAAWC;AACb;AAeO,MAAMJ,cAAc,IAAIK,kCAAkB,CAAC;IAChDC,YAAY;QACVC,MAAMC,oBAAS,CAACC,QAAQ;QACxBC,MAAM;QACNC,UAAU;QACV,2CAA2C;QAC3CC,YAAY;QACZC,UAAU;QACVC,UAAU,EAAE;IACd;IACAC,UAAU;QACRC,YAAYC;IACd;IACAC,SAASC,QAAQC,GAAG,CAACC,wBAAwB,IAAI;IACjDC,oBAAoBH,QAAQC,GAAG,CAACG,2BAA2B,IAAI;AACjE;AAEA,SAASC,+BACPC,KAA0D;IAE1D,MAAM,EAAEC,MAAM,EAAEC,QAAQ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