Duffer Derek

Current Path : /var/www/sitesecurity.bitkit.dk/httpdocs/node_modules/next/dist/server/
Upload File :
Current File : /var/www/sitesecurity.bitkit.dk/httpdocs/node_modules/next/dist/server/render.js.map

{"version":3,"sources":["../../src/server/render.tsx"],"sourcesContent":["/* eslint-disable @next/internal/no-ambiguous-jsx -- Pages router doesn't use react-server */\nimport type { IncomingMessage, ServerResponse } from 'http'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { ReactDOMServerReadableStream } from 'react-dom/server'\nimport type { NextRouter } from '../shared/lib/router/router'\nimport type { HtmlProps } from '../shared/lib/html-context.shared-runtime'\nimport type { DomainLocale } from './config'\nimport type {\n  AppType,\n  DocumentInitialProps,\n  DocumentType,\n  DocumentProps,\n  DocumentContext,\n  NextComponentType,\n  RenderPage,\n  RenderPageResult,\n} from '../shared/lib/utils'\nimport type { ImageConfigComplete } from '../shared/lib/image-config'\nimport type { Redirect } from '../lib/load-custom-routes'\nimport {\n  type NextApiRequestCookies,\n  type __ApiPreviewProps,\n  setLazyProp,\n} from './api-utils'\nimport { getCookieParser } from './api-utils/get-cookie-parser'\nimport type { LoadComponentsReturnType } from './load-components'\nimport type {\n  GetServerSideProps,\n  GetStaticProps,\n  PreviewData,\n  ServerRuntime,\n  SizeLimit,\n} from '../types'\nimport type { UnwrapPromise } from '../lib/coalesced-function'\nimport type { ClientReferenceManifest } from '../build/webpack/plugins/flight-manifest-plugin'\nimport type { NextFontManifest } from '../build/webpack/plugins/next-font-manifest-plugin'\nimport type { PagesModule } from './route-modules/pages/module'\nimport type { ComponentsEnhancer } from '../shared/lib/utils'\nimport type { NextParsedUrlQuery } from './request-meta'\nimport type { Revalidate } from './lib/cache-control'\nimport type { COMPILER_NAMES } from '../shared/lib/constants'\n\nimport React, { type JSX } from 'react'\nimport ReactDOMServerPages from 'next/dist/server/ReactDOMServerPages'\nimport { StyleRegistry, createStyleRegistry } from 'styled-jsx'\nimport {\n  GSP_NO_RETURNED_VALUE,\n  GSSP_COMPONENT_MEMBER_ERROR,\n  GSSP_NO_RETURNED_VALUE,\n  STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR,\n  SERVER_PROPS_GET_INIT_PROPS_CONFLICT,\n  SERVER_PROPS_SSG_CONFLICT,\n  SSG_GET_INITIAL_PROPS_CONFLICT,\n  UNSTABLE_REVALIDATE_RENAME_ERROR,\n  HTML_CONTENT_TYPE_HEADER,\n  JSON_CONTENT_TYPE_HEADER,\n} from '../lib/constants'\nimport {\n  NEXT_BUILTIN_DOCUMENT,\n  SERVER_PROPS_ID,\n  STATIC_PROPS_ID,\n  STATIC_STATUS_PAGES,\n} from '../shared/lib/constants'\nimport { isSerializableProps } from '../lib/is-serializable-props'\nimport { defaultHead } from '../shared/lib/head'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport Loadable from '../shared/lib/loadable.shared-runtime'\nimport { LoadableContext } from '../shared/lib/loadable-context.shared-runtime'\nimport { RouterContext } from '../shared/lib/router-context.shared-runtime'\nimport { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'\nimport {\n  getDisplayName,\n  isResSent,\n  loadGetInitialProps,\n} from '../shared/lib/utils'\nimport { HtmlContext } from '../shared/lib/html-context.shared-runtime'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path'\nimport { getRequestMeta } from './request-meta'\nimport { allowedStatusCodes, getRedirectStatus } from '../lib/redirect-status'\nimport RenderResult, { type PagesRenderResultMetadata } from './render-result'\nimport isError from '../lib/is-error'\nimport {\n  streamToString,\n  renderToInitialFizzStream,\n} from './stream-utils/node-web-streams-helper'\nimport { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime'\nimport stripAnsi from 'next/dist/compiled/strip-ansi'\nimport { stripInternalQueries } from './internal-utils'\nimport {\n  adaptForAppRouterInstance,\n  adaptForPathParams,\n  adaptForSearchParams,\n  PathnameContextProviderAdapter,\n} from '../shared/lib/router/adapters'\nimport { AppRouterContext } from '../shared/lib/app-router-context.shared-runtime'\nimport {\n  SearchParamsContext,\n  PathParamsContext,\n} from '../shared/lib/hooks-client-context.shared-runtime'\nimport { getTracer } from './lib/trace/tracer'\nimport { RenderSpan } from './lib/trace/constants'\nimport { ReflectAdapter } from './web/spec-extension/adapters/reflect'\nimport { getCacheControlHeader } from './lib/cache-control'\nimport { getErrorSource } from '../shared/lib/error-source'\nimport type { DeepReadonly } from '../shared/lib/deep-readonly'\nimport type { PagesDevOverlayBridgeType } from '../next-devtools/userspace/pages/pages-dev-overlay-setup'\nimport { getScriptNonceFromHeader } from './app-render/get-script-nonce-from-header'\n\nlet tryGetPreviewData: typeof import('./api-utils/node/try-get-preview-data').tryGetPreviewData\nlet warn: typeof import('../build/output/log').warn\nlet postProcessHTML: typeof import('./post-process').postProcessHTML\n\nconst DOCTYPE = '<!DOCTYPE html>'\n\nif (process.env.NEXT_RUNTIME !== 'edge') {\n  tryGetPreviewData = (\n    require('./api-utils/node/try-get-preview-data') as typeof import('./api-utils/node/try-get-preview-data')\n  ).tryGetPreviewData\n  warn = (\n    require('../build/output/log') as typeof import('../build/output/log')\n  ).warn\n  postProcessHTML = (\n    require('./post-process') as typeof import('./post-process')\n  ).postProcessHTML\n} else {\n  warn = console.warn.bind(console)\n  postProcessHTML = async (html: string) => html\n}\n\nfunction noRouter() {\n  const message =\n    'No router instance found. you should only use \"next/router\" inside the client side of your app. https://nextjs.org/docs/messages/no-router-instance'\n  throw new Error(message)\n}\n\nasync function renderToString(element: React.ReactElement) {\n  const renderStream = await ReactDOMServerPages.renderToReadableStream(element)\n  await renderStream.allReady\n  return streamToString(renderStream)\n}\n\nclass ServerRouter implements NextRouter {\n  route: string\n  pathname: string\n  query: ParsedUrlQuery\n  asPath: string\n  basePath: string\n  events: any\n  isFallback: boolean\n  locale?: string\n  isReady: boolean\n  locales?: readonly string[]\n  defaultLocale?: string\n  domainLocales?: readonly DomainLocale[]\n  isPreview: boolean\n  isLocaleDomain: boolean\n\n  constructor(\n    pathname: string,\n    query: ParsedUrlQuery,\n    as: string,\n    { isFallback }: { isFallback: boolean },\n    isReady: boolean,\n    basePath: string,\n    locale?: string,\n    locales?: readonly string[],\n    defaultLocale?: string,\n    domainLocales?: readonly DomainLocale[],\n    isPreview?: boolean,\n    isLocaleDomain?: boolean\n  ) {\n    this.route = pathname.replace(/\\/$/, '') || '/'\n    this.pathname = pathname\n    this.query = query\n    this.asPath = as\n    this.isFallback = isFallback\n    this.basePath = basePath\n    this.locale = locale\n    this.locales = locales\n    this.defaultLocale = defaultLocale\n    this.isReady = isReady\n    this.domainLocales = domainLocales\n    this.isPreview = !!isPreview\n    this.isLocaleDomain = !!isLocaleDomain\n  }\n\n  push(): any {\n    noRouter()\n  }\n  replace(): any {\n    noRouter()\n  }\n  reload() {\n    noRouter()\n  }\n  back() {\n    noRouter()\n  }\n  forward(): void {\n    noRouter()\n  }\n  prefetch(): any {\n    noRouter()\n  }\n  beforePopState() {\n    noRouter()\n  }\n}\n\nfunction enhanceComponents(\n  options: ComponentsEnhancer,\n  App: AppType,\n  Component: NextComponentType\n): {\n  App: AppType\n  Component: NextComponentType\n} {\n  // For backwards compatibility\n  if (typeof options === 'function') {\n    return {\n      App,\n      Component: options(Component),\n    }\n  }\n\n  return {\n    App: options.enhanceApp ? options.enhanceApp(App) : App,\n    Component: options.enhanceComponent\n      ? options.enhanceComponent(Component)\n      : Component,\n  }\n}\n\nfunction renderPageTree(\n  App: AppType,\n  Component: NextComponentType,\n  props: any\n) {\n  return <App Component={Component} {...props} />\n}\n\nexport type RenderOptsPartial = {\n  assetPrefix?: string\n  err?: Error | null\n  isBuildTimePrerendering?: boolean\n  ErrorDebug?: PagesDevOverlayBridgeType\n  isNextDataRequest?: boolean\n  params?: ParsedUrlQuery\n  previewProps: __ApiPreviewProps | undefined\n  basePath: string\n  unstable_runtimeJS?: false\n  unstable_JsPreload?: false\n  optimizeCss: any\n  nextConfigOutput?: 'standalone' | 'export'\n  nextScriptWorkers: any\n  resolvedUrl?: string\n  resolvedAsPath?: string\n  setIsrStatus?: (key: string, value: boolean | undefined) => void\n  clientReferenceManifest?: DeepReadonly<ClientReferenceManifest>\n  nextFontManifest?: DeepReadonly<NextFontManifest>\n  distDir?: string\n  locale?: string\n  locales?: readonly string[]\n  defaultLocale?: string\n  domainLocales?: readonly DomainLocale[]\n  disableOptimizedLoading?: boolean\n  supportsDynamicResponse: boolean\n  botType?: 'dom' | 'html' | undefined\n  serveStreamingMetadata?: boolean\n  runtime?: ServerRuntime\n  serverComponents?: boolean\n  serverActions?: {\n    bodySizeLimit?: SizeLimit\n    allowedOrigins?: string[]\n  }\n  crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined\n  images: ImageConfigComplete\n  largePageDataBytes?: number\n  isOnDemandRevalidate?: boolean\n  isPossibleServerAction?: boolean\n  isExperimentalCompile?: boolean\n  isPrefetch?: boolean\n  isBot?: boolean\n  expireTime?: number\n  experimental: {\n    clientTraceMetadata?: string[]\n  }\n}\n\nexport type RenderOpts = LoadComponentsReturnType<PagesModule> &\n  RenderOptsPartial\n\n/**\n * Shared context used for all page renders.\n */\nexport type PagesSharedContext = {\n  /**\n   * Used to facilitate caching of page bundles, we send it to the client so\n   * that pageloader knows where to load bundles.\n   */\n  buildId: string\n\n  /**\n   * See NextConfig.deploymentId\n   */\n  deploymentId: string | undefined\n\n  /**\n   * Either NextConfig.experimental.immutableAssetToken or NextConfig.deploymentId\n   */\n  clientAssetToken: string | undefined\n\n  /**\n   * True if the user is using a custom server.\n   */\n  customServer: true | undefined\n}\n\n/**\n * The context for the given request.\n */\nexport type PagesRenderContext = {\n  /**\n   * Whether this should be rendered as a fallback page.\n   */\n  isFallback: boolean\n\n  /**\n   * Whether this is in draft mode.\n   */\n  isDraftMode: boolean | undefined\n\n  /**\n   * In development, the original source page that returned a 404.\n   */\n  developmentNotFoundSourcePage: string | undefined\n}\n\n/**\n * RenderOptsExtra is being used to split away functionality that's within the\n * renderOpts. Eventually we can have more explicit render options for each\n * route kind.\n */\nexport type RenderOptsExtra = {\n  App: AppType\n  Document: DocumentType\n}\n\nconst invalidKeysMsg = (\n  methodName: 'getServerSideProps' | 'getStaticProps',\n  invalidKeys: string[]\n) => {\n  const docsPathname = `invalid-${methodName.toLocaleLowerCase()}-value`\n\n  return (\n    `Additional keys were returned from \\`${methodName}\\`. Properties intended for your component must be nested under the \\`props\\` key, e.g.:` +\n    `\\n\\n\\treturn { props: { title: 'My Title', content: '...' } }` +\n    `\\n\\nKeys that need to be moved: ${invalidKeys.join(', ')}.` +\n    `\\nRead more: https://nextjs.org/docs/messages/${docsPathname}`\n  )\n}\n\nfunction checkRedirectValues(\n  redirect: Redirect,\n  req: IncomingMessage,\n  method: 'getStaticProps' | 'getServerSideProps'\n) {\n  const { destination, permanent, statusCode, basePath } = redirect\n  let errors: string[] = []\n\n  const hasStatusCode = typeof statusCode !== 'undefined'\n  const hasPermanent = typeof permanent !== 'undefined'\n\n  if (hasPermanent && hasStatusCode) {\n    errors.push(`\\`permanent\\` and \\`statusCode\\` can not both be provided`)\n  } else if (hasPermanent && typeof permanent !== 'boolean') {\n    errors.push(`\\`permanent\\` must be \\`true\\` or \\`false\\``)\n  } else if (hasStatusCode && !allowedStatusCodes.has(statusCode!)) {\n    errors.push(\n      `\\`statusCode\\` must undefined or one of ${[...allowedStatusCodes].join(\n        ', '\n      )}`\n    )\n  }\n  const destinationType = typeof destination\n\n  if (destinationType !== 'string') {\n    errors.push(\n      `\\`destination\\` should be string but received ${destinationType}`\n    )\n  }\n\n  const basePathType = typeof basePath\n\n  if (basePathType !== 'undefined' && basePathType !== 'boolean') {\n    errors.push(\n      `\\`basePath\\` should be undefined or a false, received ${basePathType}`\n    )\n  }\n\n  if (errors.length > 0) {\n    throw new Error(\n      `Invalid redirect object returned from ${method} for ${req.url}\\n` +\n        errors.join(' and ') +\n        '\\n' +\n        `See more info here: https://nextjs.org/docs/messages/invalid-redirect-gssp`\n    )\n  }\n}\n\nexport function errorToJSON(err: Error) {\n  let source: typeof COMPILER_NAMES.server | typeof COMPILER_NAMES.edgeServer =\n    'server'\n\n  if (process.env.NEXT_RUNTIME !== 'edge') {\n    source = getErrorSource(err) || 'server'\n  }\n\n  return {\n    name: err.name,\n    source,\n    message: stripAnsi(err.message),\n    stack: err.stack,\n    digest: (err as any).digest,\n  }\n}\n\nfunction serializeError(\n  dev: boolean | undefined,\n  err: Error\n): Error & {\n  statusCode?: number\n  source?: typeof COMPILER_NAMES.server | typeof COMPILER_NAMES.edgeServer\n} {\n  if (dev) {\n    return errorToJSON(err)\n  }\n\n  return {\n    name: 'Internal Server Error.',\n    message: '500 - Internal Server Error.',\n    statusCode: 500,\n  }\n}\n\nfunction getSafariCacheBusterQueryString(req: IncomingMessage): string {\n  if (process.env.__NEXT_DEV_SERVER) {\n    const userAgent = (req.headers['user-agent'] || '').toLowerCase()\n    if (userAgent.includes('safari') && !userAgent.includes('chrome')) {\n      return `?ts=${Date.now()}`\n    }\n  }\n  return ''\n}\n\nexport async function renderToHTMLImpl(\n  req: IncomingMessage,\n  res: ServerResponse,\n  pathname: string,\n  query: NextParsedUrlQuery,\n  renderOpts: Omit<RenderOpts, keyof RenderOptsExtra>,\n  extra: RenderOptsExtra,\n  sharedContext: PagesSharedContext,\n  renderContext: PagesRenderContext\n): Promise<RenderResult> {\n  // Adds support for reading `cookies` in `getServerSideProps` when SSR.\n  setLazyProp({ req: req as any }, 'cookies', getCookieParser(req.headers))\n\n  // cssCacheBuster is a workaround for a Safari bug\n  // (https://bugs.webkit.org/show_bug.cgi?id=187726) where preloaded CSS\n  // resources are cached and not re-fetched on HMR. It must only be applied\n  // to CSS and font assets — not to script tags — because the Turbopack\n  // runtime infers ASSET_SUFFIX from the executing script's query string and\n  // leaks it onto all static asset URLs (including images), causing\n  // next/image validation errors.\n  // See https://github.com/vercel/next.js/issues/92118.\n  const cssCacheBuster = getSafariCacheBusterQueryString(req)\n\n  const mutableAssetQueryString = sharedContext.deploymentId\n    ? `?dpl=${sharedContext.deploymentId}`\n    : ''\n  const assetQueryString = sharedContext.clientAssetToken\n    ? `?dpl=${sharedContext.clientAssetToken}`\n    : ''\n  // cssAssetQueryString is assetQueryString with the cacheBuster prepended.\n  // Use this for CSS and font URLs; use assetQueryString for script URLs.\n  const cssAssetQueryString =\n    cssCacheBuster +\n    (sharedContext.clientAssetToken\n      ? `${cssCacheBuster ? '&' : '?'}dpl=${sharedContext.clientAssetToken}`\n      : '')\n  const metadata: PagesRenderResultMetadata = {}\n\n  // don't modify original query object\n  query = Object.assign({}, query)\n\n  const {\n    err,\n    pageConfig = {},\n    buildManifest,\n    reactLoadableManifest,\n    ErrorDebug,\n    getStaticProps,\n    getStaticPaths,\n    getServerSideProps,\n    isNextDataRequest,\n    params,\n    previewProps,\n    basePath,\n    images,\n    runtime: globalRuntime,\n    isExperimentalCompile,\n    expireTime,\n  } = renderOpts\n  const { App } = extra\n\n  let Document = extra.Document\n\n  let Component: React.ComponentType<{}> | ((props: any) => JSX.Element) =\n    renderOpts.Component\n  const OriginComponent = Component\n\n  const isFallback = renderContext.isFallback ?? false\n  const notFoundSrcPage = renderContext.developmentNotFoundSourcePage\n\n  // next internal queries should be stripped out\n  stripInternalQueries(query)\n\n  const isSSG = !!getStaticProps\n  const isBuildTimeSSG = isSSG && renderOpts.isBuildTimePrerendering\n  const defaultAppGetInitialProps =\n    App.getInitialProps === (App as any).origGetInitialProps\n\n  const hasPageGetInitialProps = !!(Component as any)?.getInitialProps\n  const hasPageScripts = (Component as any)?.unstable_scriptLoader\n\n  const pageIsDynamic = isDynamicRoute(pathname)\n\n  const defaultErrorGetInitialProps =\n    pathname === '/_error' &&\n    (Component as any).getInitialProps ===\n      (Component as any).origGetInitialProps\n\n  if (\n    renderOpts.isBuildTimePrerendering &&\n    hasPageGetInitialProps &&\n    !defaultErrorGetInitialProps\n  ) {\n    warn(\n      `Detected getInitialProps on page '${pathname}'` +\n        ` while running export. It's recommended to use getStaticProps` +\n        ` which has a more correct behavior for static exporting.` +\n        `\\nRead more: https://nextjs.org/docs/messages/get-initial-props-export`\n    )\n  }\n\n  let isAutoExport =\n    !hasPageGetInitialProps &&\n    defaultAppGetInitialProps &&\n    !isSSG &&\n    !getServerSideProps\n\n  // if we are running from experimental compile and the page\n  // would normally be automatically statically optimized\n  // ensure we set cache header so it's not rendered on-demand\n  // every request\n  if (isAutoExport && !process.env.__NEXT_DEV_SERVER && isExperimentalCompile) {\n    res.setHeader(\n      'Cache-Control',\n      getCacheControlHeader({ revalidate: false, expire: expireTime })\n    )\n    isAutoExport = false\n  }\n\n  if (hasPageGetInitialProps && isSSG) {\n    throw new Error(SSG_GET_INITIAL_PROPS_CONFLICT + ` ${pathname}`)\n  }\n\n  if (hasPageGetInitialProps && getServerSideProps) {\n    throw new Error(SERVER_PROPS_GET_INIT_PROPS_CONFLICT + ` ${pathname}`)\n  }\n\n  if (getServerSideProps && isSSG) {\n    throw new Error(SERVER_PROPS_SSG_CONFLICT + ` ${pathname}`)\n  }\n\n  if (getServerSideProps && renderOpts.nextConfigOutput === 'export') {\n    throw new Error(\n      'getServerSideProps cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'\n    )\n  }\n\n  if (getStaticPaths && !pageIsDynamic) {\n    throw new Error(\n      `getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.` +\n        `\\nRead more: https://nextjs.org/docs/messages/non-dynamic-getstaticpaths-usage`\n    )\n  }\n\n  if (!!getStaticPaths && !isSSG) {\n    throw new Error(\n      `getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`\n    )\n  }\n\n  if (isSSG && pageIsDynamic && !getStaticPaths) {\n    throw new Error(\n      `getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.` +\n        `\\nRead more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`\n    )\n  }\n\n  let asPath: string = renderOpts.resolvedAsPath || (req.url as string)\n\n  if (process.env.__NEXT_DEV_SERVER) {\n    const { isValidElementType } =\n      require('next/dist/compiled/react-is') as typeof import('next/dist/compiled/react-is')\n    if (!isValidElementType(Component)) {\n      throw new Error(\n        `The default export is not a React Component in page: \"${pathname}\"`\n      )\n    }\n\n    if (!isValidElementType(App)) {\n      throw new Error(\n        `The default export is not a React Component in page: \"/_app\"`\n      )\n    }\n\n    if (!isValidElementType(Document)) {\n      throw new Error(\n        `The default export is not a React Component in page: \"/_document\"`\n      )\n    }\n\n    if (isAutoExport || isFallback) {\n      // remove query values except ones that will be set during export\n      query = {}\n      asPath = `${pathname}${\n        // ensure trailing slash is present for non-dynamic auto-export pages\n        req.url!.endsWith('/') && pathname !== '/' && !pageIsDynamic ? '/' : ''\n      }`\n      req.url = pathname\n    }\n\n    if (pathname === '/404' && (hasPageGetInitialProps || getServerSideProps)) {\n      throw new Error(\n        `\\`pages/404\\` ${STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`\n      )\n    }\n    if (\n      STATIC_STATUS_PAGES.includes(pathname) &&\n      (hasPageGetInitialProps || getServerSideProps)\n    ) {\n      throw new Error(\n        `\\`pages${pathname}\\` ${STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`\n      )\n    }\n\n    if (renderOpts?.setIsrStatus) {\n      renderOpts.setIsrStatus(asPath, isSSG || isAutoExport)\n    }\n  }\n\n  for (const methodName of [\n    'getStaticProps',\n    'getServerSideProps',\n    'getStaticPaths',\n  ]) {\n    if ((Component as any)?.[methodName]) {\n      throw new Error(\n        `page ${pathname} ${methodName} ${GSSP_COMPONENT_MEMBER_ERROR}`\n      )\n    }\n  }\n\n  await Loadable.preloadAll() // Make sure all dynamic imports are loaded\n\n  let isPreview: boolean | undefined = undefined\n  let previewData: PreviewData\n\n  if (\n    (isSSG || getServerSideProps) &&\n    !isFallback &&\n    process.env.NEXT_RUNTIME !== 'edge' &&\n    previewProps\n  ) {\n    // Reads of this are cached on the `req` object, so this should resolve\n    // instantly. There's no need to pass this data down from a previous\n    // invoke.\n    previewData = tryGetPreviewData(\n      req,\n      res,\n      previewProps,\n      !!renderOpts.multiZoneDraftMode\n    )\n    isPreview = previewData !== false\n  }\n\n  // url will always be set\n  const routerIsReady = !!(\n    getServerSideProps ||\n    hasPageGetInitialProps ||\n    (!defaultAppGetInitialProps && !isSSG) ||\n    isExperimentalCompile\n  )\n  const router = new ServerRouter(\n    pathname,\n    query,\n    asPath,\n    {\n      isFallback: isFallback,\n    },\n    routerIsReady,\n    basePath,\n    renderOpts.locale,\n    renderOpts.locales,\n    renderOpts.defaultLocale,\n    renderOpts.domainLocales,\n    isPreview,\n    getRequestMeta(req, 'isLocaleDomain')\n  )\n\n  const appRouter = adaptForAppRouterInstance(router)\n\n  let scriptLoader: any = {}\n  const jsxStyleRegistry = createStyleRegistry()\n\n  let head: JSX.Element[] = defaultHead()\n  const reactLoadableModules: string[] = []\n\n  let initialScripts: any = {}\n  if (hasPageScripts) {\n    initialScripts.beforeInteractive = []\n      .concat(hasPageScripts())\n      .filter((script: any) => script.props.strategy === 'beforeInteractive')\n      .map((script: any) => script.props)\n  }\n\n  const csp =\n    req.headers['content-security-policy'] ||\n    req.headers['content-security-policy-report-only']\n\n  const nonce =\n    typeof csp === 'string' ? getScriptNonceFromHeader(csp) : undefined\n\n  const AppContainer = ({ children }: { children: JSX.Element }) => (\n    <AppRouterContext.Provider value={appRouter}>\n      <SearchParamsContext.Provider value={adaptForSearchParams(router)}>\n        <PathnameContextProviderAdapter\n          router={router}\n          isAutoExport={isAutoExport}\n        >\n          <PathParamsContext.Provider value={adaptForPathParams(router)}>\n            <RouterContext.Provider value={router}>\n              <HeadManagerContext.Provider\n                value={{\n                  updateHead: (state) => {\n                    head = state\n                  },\n                  updateScripts: (scripts) => {\n                    scriptLoader = scripts\n                  },\n                  scripts: initialScripts,\n                  mountedInstances: new Set(),\n                  nonce,\n                }}\n              >\n                <LoadableContext.Provider\n                  value={(moduleName) => reactLoadableModules.push(moduleName)}\n                >\n                  <StyleRegistry registry={jsxStyleRegistry}>\n                    <ImageConfigContext.Provider value={images}>\n                      {children}\n                    </ImageConfigContext.Provider>\n                  </StyleRegistry>\n                </LoadableContext.Provider>\n              </HeadManagerContext.Provider>\n            </RouterContext.Provider>\n          </PathParamsContext.Provider>\n        </PathnameContextProviderAdapter>\n      </SearchParamsContext.Provider>\n    </AppRouterContext.Provider>\n  )\n\n  // The `useId` API uses the path indexes to generate an ID for each node.\n  // To guarantee the match of hydration, we need to ensure that the structure\n  // of wrapper nodes is isomorphic in server and client.\n  // TODO: With `enhanceApp` and `enhanceComponents` options, this approach may\n  // not be useful.\n  // https://github.com/facebook/react/pull/22644\n  const Noop = () => null\n  const AppContainerWithIsomorphicFiberStructure: React.FC<{\n    children: JSX.Element\n  }> = ({ children }) => {\n    return (\n      <>\n        {/* <Head/> */}\n        <Noop />\n        <AppContainer>\n          <>\n            {children}\n            {/* <RouteAnnouncer/> */}\n            <Noop />\n          </>\n        </AppContainer>\n      </>\n    )\n  }\n\n  const ctx = {\n    err,\n    req: isAutoExport ? undefined : req,\n    res: isAutoExport ? undefined : res,\n    pathname,\n    query,\n    asPath,\n    locale: renderOpts.locale,\n    locales: renderOpts.locales,\n    defaultLocale: renderOpts.defaultLocale,\n    AppTree: (props: any) => {\n      return (\n        <AppContainerWithIsomorphicFiberStructure>\n          {renderPageTree(App, OriginComponent, { ...props, router })}\n        </AppContainerWithIsomorphicFiberStructure>\n      )\n    },\n    defaultGetInitialProps: async (\n      docCtx: DocumentContext,\n      options: { nonce?: string } = {}\n    ): Promise<DocumentInitialProps> => {\n      const enhanceApp = (AppComp: any) => {\n        return (props: any) => <AppComp {...props} />\n      }\n\n      const { html, head: renderPageHead } = await docCtx.renderPage({\n        enhanceApp,\n      })\n      const styles = jsxStyleRegistry.styles({ nonce: options.nonce || nonce })\n      jsxStyleRegistry.flush()\n      return { html, head: renderPageHead, styles }\n    },\n  }\n  let props: any\n\n  const nextExport =\n    !isSSG &&\n    (renderOpts.isBuildTimePrerendering ||\n      (process.env.__NEXT_DEV_SERVER && (isAutoExport || isFallback)))\n\n  const styledJsxInsertedHTML = () => {\n    const styles = jsxStyleRegistry.styles()\n    jsxStyleRegistry.flush()\n    return <>{styles}</>\n  }\n\n  props = await loadGetInitialProps(App, {\n    AppTree: ctx.AppTree,\n    Component,\n    router,\n    ctx,\n  })\n\n  if ((isSSG || getServerSideProps) && isPreview) {\n    props.__N_PREVIEW = true\n  }\n\n  if (isSSG) {\n    props[STATIC_PROPS_ID] = true\n  }\n\n  if (isSSG && !isFallback) {\n    let data: Readonly<UnwrapPromise<ReturnType<GetStaticProps>>>\n\n    try {\n      data = await getTracer().trace(\n        RenderSpan.getStaticProps,\n        {\n          spanName: `getStaticProps ${pathname}`,\n          attributes: {\n            'next.route': pathname,\n          },\n        },\n        () =>\n          getStaticProps({\n            ...(pageIsDynamic ? { params } : undefined),\n            ...(isPreview\n              ? { draftMode: true, preview: true, previewData: previewData }\n              : undefined),\n            locales: [...(renderOpts.locales ?? [])],\n            locale: renderOpts.locale,\n            defaultLocale: renderOpts.defaultLocale,\n            revalidateReason: renderOpts.isOnDemandRevalidate\n              ? 'on-demand'\n              : isBuildTimeSSG\n                ? 'build'\n                : 'stale',\n          })\n      )\n    } catch (staticPropsError: any) {\n      // remove not found error code to prevent triggering legacy\n      // 404 rendering\n      if (staticPropsError && staticPropsError.code === 'ENOENT') {\n        delete staticPropsError.code\n      }\n      throw staticPropsError\n    }\n\n    if (data == null) {\n      throw new Error(GSP_NO_RETURNED_VALUE)\n    }\n\n    const invalidKeys = Object.keys(data).filter(\n      (key) =>\n        key !== 'revalidate' &&\n        key !== 'props' &&\n        key !== 'redirect' &&\n        key !== 'notFound'\n    )\n\n    if (invalidKeys.includes('unstable_revalidate')) {\n      throw new Error(UNSTABLE_REVALIDATE_RENAME_ERROR)\n    }\n\n    if (invalidKeys.length) {\n      throw new Error(invalidKeysMsg('getStaticProps', invalidKeys))\n    }\n\n    if (process.env.NODE_ENV !== 'production') {\n      if (\n        typeof (data as any).notFound !== 'undefined' &&\n        typeof (data as any).redirect !== 'undefined'\n      ) {\n        throw new Error(\n          `\\`redirect\\` and \\`notFound\\` can not both be returned from ${\n            isSSG ? 'getStaticProps' : 'getServerSideProps'\n          } at the same time. Page: ${pathname}\\nSee more info here: https://nextjs.org/docs/messages/gssp-mixed-not-found-redirect`\n        )\n      }\n    }\n\n    if ('notFound' in data && data.notFound) {\n      if (pathname === '/404') {\n        throw new Error(\n          `The /404 page can not return notFound in \"getStaticProps\", please remove it to continue!`\n        )\n      }\n\n      metadata.isNotFound = true\n    }\n\n    if (\n      'redirect' in data &&\n      data.redirect &&\n      typeof data.redirect === 'object'\n    ) {\n      checkRedirectValues(data.redirect as Redirect, req, 'getStaticProps')\n\n      if (isBuildTimeSSG) {\n        throw new Error(\n          `\\`redirect\\` can not be returned from getStaticProps during prerendering (${req.url})\\n` +\n            `See more info here: https://nextjs.org/docs/messages/gsp-redirect-during-prerender`\n        )\n      }\n\n      ;(data as any).props = {\n        __N_REDIRECT: data.redirect.destination,\n        __N_REDIRECT_STATUS: getRedirectStatus(data.redirect),\n      }\n      if (typeof data.redirect.basePath !== 'undefined') {\n        ;(data as any).props.__N_REDIRECT_BASE_PATH = data.redirect.basePath\n      }\n      metadata.isRedirect = true\n    }\n\n    if (\n      (process.env.__NEXT_DEV_SERVER || isBuildTimeSSG) &&\n      !metadata.isNotFound &&\n      !isSerializableProps(pathname, 'getStaticProps', (data as any).props)\n    ) {\n      // this fn should throw an error instead of ever returning `false`\n      throw new Error(\n        'invariant: getStaticProps did not return valid props. Please report this.'\n      )\n    }\n\n    let revalidate: Revalidate\n    if ('revalidate' in data) {\n      if (data.revalidate && renderOpts.nextConfigOutput === 'export') {\n        throw new Error(\n          'ISR cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'\n        )\n      }\n      if (typeof data.revalidate === 'number') {\n        if (!Number.isInteger(data.revalidate)) {\n          throw new Error(\n            `A page's revalidate option must be seconds expressed as a natural number for ${req.url}. Mixed numbers, such as '${data.revalidate}', cannot be used.` +\n              `\\nTry changing the value to '${Math.ceil(\n                data.revalidate\n              )}' or using \\`Math.ceil()\\` if you're computing the value.`\n          )\n        } else if (data.revalidate <= 0) {\n          throw new Error(\n            `A page's revalidate option can not be less than or equal to zero for ${req.url}. A revalidate option of zero means to revalidate after _every_ request, and implies stale data cannot be tolerated.` +\n              `\\n\\nTo never revalidate, you can set revalidate to \\`false\\` (only ran once at build-time).` +\n              `\\nTo revalidate as soon as possible, you can set the value to \\`1\\`.`\n          )\n        } else {\n          if (data.revalidate > 31536000) {\n            // if it's greater than a year for some reason error\n            console.warn(\n              `Warning: A page's revalidate option was set to more than a year for ${req.url}. This may have been done in error.` +\n                `\\nTo only run getStaticProps at build-time and not revalidate at runtime, you can set \\`revalidate\\` to \\`false\\`!`\n            )\n          }\n\n          revalidate = data.revalidate\n        }\n      } else if (data.revalidate === true) {\n        // When enabled, revalidate after 1 second. This value is optimal for\n        // the most up-to-date page possible, but without a 1-to-1\n        // request-refresh ratio.\n        revalidate = 1\n      } else if (\n        data.revalidate === false ||\n        typeof data.revalidate === 'undefined'\n      ) {\n        // By default, we never revalidate.\n        revalidate = false\n      } else {\n        throw new Error(\n          `A page's revalidate option must be seconds expressed as a natural number. Mixed numbers and strings cannot be used. Received '${JSON.stringify(\n            data.revalidate\n          )}' for ${req.url}`\n        )\n      }\n    } else {\n      // By default, we never revalidate.\n      revalidate = false\n    }\n\n    props.pageProps = Object.assign(\n      {},\n      props.pageProps,\n      'props' in data ? data.props : undefined\n    )\n\n    // pass up cache control and props for export\n    metadata.cacheControl = { revalidate, expire: undefined }\n    metadata.pageData = props\n\n    // this must come after revalidate is added to renderResultMeta\n    if (metadata.isNotFound) {\n      return new RenderResult(null, {\n        metadata,\n        contentType: null,\n      })\n    }\n  }\n\n  if (getServerSideProps) {\n    props[SERVER_PROPS_ID] = true\n  }\n\n  if (getServerSideProps && !isFallback) {\n    let data: UnwrapPromise<ReturnType<GetServerSideProps>>\n\n    let canAccessRes = true\n    let resOrProxy = res\n    let deferredContent = false\n    if (process.env.NODE_ENV !== 'production') {\n      resOrProxy = new Proxy<ServerResponse>(res, {\n        get: function (obj, prop) {\n          if (!canAccessRes) {\n            const message =\n              `You should not access 'res' after getServerSideProps resolves.` +\n              `\\nRead more: https://nextjs.org/docs/messages/gssp-no-mutating-res`\n\n            if (deferredContent) {\n              throw new Error(message)\n            } else {\n              warn(message)\n            }\n          }\n\n          if (typeof prop === 'symbol') {\n            return ReflectAdapter.get(obj, prop, res)\n          }\n\n          return ReflectAdapter.get(obj, prop, res)\n        },\n      })\n    }\n\n    try {\n      data = await getTracer().trace(\n        RenderSpan.getServerSideProps,\n        {\n          spanName: `getServerSideProps ${pathname}`,\n          attributes: {\n            'next.route': pathname,\n          },\n        },\n        async () =>\n          getServerSideProps({\n            req: req as IncomingMessage & {\n              cookies: NextApiRequestCookies\n            },\n            res: resOrProxy,\n            query,\n            resolvedUrl: renderOpts.resolvedUrl as string,\n            ...(pageIsDynamic ? { params } : undefined),\n            ...(previewData !== false\n              ? { draftMode: true, preview: true, previewData: previewData }\n              : undefined),\n            // We create a copy here to avoid having the types of\n            // `getServerSideProps` change. This ensures that users can't\n            // mutate this array and have it poison the reference.\n            locales: [...(renderOpts.locales ?? [])],\n            locale: renderOpts.locale,\n            defaultLocale: renderOpts.defaultLocale,\n          })\n      )\n      canAccessRes = false\n      metadata.cacheControl = { revalidate: 0, expire: undefined }\n    } catch (serverSidePropsError: any) {\n      // remove not found error code to prevent triggering legacy\n      // 404 rendering\n      if (\n        isError(serverSidePropsError) &&\n        serverSidePropsError.code === 'ENOENT'\n      ) {\n        delete serverSidePropsError.code\n      }\n      throw serverSidePropsError\n    }\n\n    if (data == null) {\n      throw new Error(GSSP_NO_RETURNED_VALUE)\n    }\n\n    if ((data as any).props instanceof Promise) {\n      deferredContent = true\n    }\n\n    const invalidKeys = Object.keys(data).filter(\n      (key) => key !== 'props' && key !== 'redirect' && key !== 'notFound'\n    )\n\n    if ((data as any).unstable_notFound) {\n      throw new Error(\n        `unstable_notFound has been renamed to notFound, please update the field to continue. Page: ${pathname}`\n      )\n    }\n    if ((data as any).unstable_redirect) {\n      throw new Error(\n        `unstable_redirect has been renamed to redirect, please update the field to continue. Page: ${pathname}`\n      )\n    }\n\n    if (invalidKeys.length) {\n      throw new Error(invalidKeysMsg('getServerSideProps', invalidKeys))\n    }\n\n    if ('notFound' in data && data.notFound) {\n      if (pathname === '/404') {\n        throw new Error(\n          `The /404 page can not return notFound in \"getStaticProps\", please remove it to continue!`\n        )\n      }\n\n      metadata.isNotFound = true\n      return new RenderResult(null, {\n        metadata,\n        contentType: null,\n      })\n    }\n\n    if ('redirect' in data && typeof data.redirect === 'object') {\n      checkRedirectValues(data.redirect as Redirect, req, 'getServerSideProps')\n      ;(data as any).props = {\n        __N_REDIRECT: data.redirect.destination,\n        __N_REDIRECT_STATUS: getRedirectStatus(data.redirect),\n      }\n      if (typeof data.redirect.basePath !== 'undefined') {\n        ;(data as any).props.__N_REDIRECT_BASE_PATH = data.redirect.basePath\n      }\n      metadata.isRedirect = true\n    }\n\n    if (deferredContent) {\n      ;(data as any).props = await (data as any).props\n    }\n\n    if (\n      (process.env.__NEXT_DEV_SERVER || isBuildTimeSSG) &&\n      !isSerializableProps(pathname, 'getServerSideProps', (data as any).props)\n    ) {\n      // this fn should throw an error instead of ever returning `false`\n      throw new Error(\n        'invariant: getServerSideProps did not return valid props. Please report this.'\n      )\n    }\n\n    props.pageProps = Object.assign({}, props.pageProps, (data as any).props)\n    metadata.pageData = props\n  }\n\n  if (\n    !isSSG && // we only show this warning for legacy pages\n    !getServerSideProps &&\n    process.env.NODE_ENV !== 'production' &&\n    Object.keys(props?.pageProps || {}).includes('url')\n  ) {\n    console.warn(\n      `The prop \\`url\\` is a reserved prop in Next.js for legacy reasons and will be overridden on page ${pathname}\\n` +\n        `See more info here: https://nextjs.org/docs/messages/reserved-page-prop`\n    )\n  }\n\n  // Avoid rendering page un-necessarily for getServerSideProps data request\n  // and getServerSideProps/getStaticProps redirects\n  if ((isNextDataRequest && !isSSG) || metadata.isRedirect) {\n    return new RenderResult(JSON.stringify(props), {\n      metadata,\n      contentType: JSON_CONTENT_TYPE_HEADER,\n    })\n  }\n\n  // We don't call getStaticProps or getServerSideProps while generating\n  // the fallback so make sure to set pageProps to an empty object\n  if (isFallback) {\n    props.pageProps = {}\n  }\n\n  // the response might be finished on the getInitialProps call\n  if (isResSent(res) && !isSSG) return RenderResult.EMPTY\n\n  // we preload the buildManifest for auto-export dynamic pages\n  // to speed up hydrating query values\n  let filteredBuildManifest = buildManifest\n  if (isAutoExport && pageIsDynamic) {\n    const page = denormalizePagePath(normalizePagePath(pathname))\n    // This code would be much cleaner using `immer` and directly pushing into\n    // the result from `getPageFiles`, we could maybe consider that in the\n    // future.\n    if (page in filteredBuildManifest.pages) {\n      filteredBuildManifest = {\n        ...filteredBuildManifest,\n        pages: {\n          ...filteredBuildManifest.pages,\n          [page]: [\n            ...filteredBuildManifest.pages[page],\n            ...filteredBuildManifest.lowPriorityFiles.filter((f) =>\n              f.includes('_buildManifest')\n            ),\n          ],\n        },\n        lowPriorityFiles: filteredBuildManifest.lowPriorityFiles.filter(\n          (f) => !f.includes('_buildManifest')\n        ),\n      }\n    }\n  }\n\n  const Body = ({ children }: { children: JSX.Element }) => {\n    return <div id=\"__next\">{children}</div>\n  }\n\n  const renderDocument = async () => {\n    // For `Document`, there are two cases that we don't support:\n    // 1. Using `Document.getInitialProps` in the Edge runtime.\n    // 2. Using the class component `Document` with concurrent features.\n\n    const BuiltinFunctionalDocument: DocumentType | undefined = (\n      Document as any\n    )[NEXT_BUILTIN_DOCUMENT]\n\n    if (process.env.NEXT_RUNTIME === 'edge' && Document.getInitialProps) {\n      // In the Edge runtime, `Document.getInitialProps` isn't supported.\n      // We throw an error here if it's customized.\n      if (BuiltinFunctionalDocument) {\n        Document = BuiltinFunctionalDocument\n      } else {\n        throw new Error(\n          '`getInitialProps` in Document component is not supported with the Edge Runtime.'\n        )\n      }\n    }\n\n    async function loadDocumentInitialProps(\n      renderShell: (\n        _App: AppType,\n        _Component: NextComponentType\n      ) => Promise<ReactDOMServerReadableStream>\n    ) {\n      const renderPage: RenderPage = async (\n        options: ComponentsEnhancer = {}\n      ): Promise<RenderPageResult> => {\n        if (ctx.err && ErrorDebug) {\n          // Always start rendering the shell even if there's an error.\n          if (renderShell) {\n            renderShell(App, Component)\n          }\n\n          const html = await renderToString(\n            <Body>\n              <ErrorDebug />\n            </Body>\n          )\n          return { html, head }\n        }\n\n        if (\n          process.env.__NEXT_DEV_SERVER &&\n          (props.router || props.Component)\n        ) {\n          throw new Error(\n            `'router' and 'Component' can not be returned in getInitialProps from _app.js https://nextjs.org/docs/messages/cant-override-next-props`\n          )\n        }\n\n        const { App: EnhancedApp, Component: EnhancedComponent } =\n          enhanceComponents(options, App, Component)\n\n        const stream = await renderShell(EnhancedApp, EnhancedComponent)\n        await stream.allReady\n        const html = await streamToString(stream)\n\n        return { html, head }\n      }\n      const documentCtx = { ...ctx, renderPage }\n      const docProps: DocumentInitialProps = await loadGetInitialProps(\n        Document,\n        documentCtx\n      )\n      // the response might be finished on the getInitialProps call\n      if (isResSent(res) && !isSSG) return null\n\n      if (!docProps || typeof docProps.html !== 'string') {\n        const message = `\"${getDisplayName(\n          Document\n        )}.getInitialProps()\" should resolve to an object with a \"html\" prop set with a valid html string`\n        throw new Error(message)\n      }\n\n      return { docProps, documentCtx }\n    }\n\n    const renderContent = (_App: AppType, _Component: NextComponentType) => {\n      const EnhancedApp = _App || App\n      const EnhancedComponent = _Component || Component\n\n      return ctx.err && ErrorDebug ? (\n        <Body>\n          <ErrorDebug />\n        </Body>\n      ) : (\n        <Body>\n          <AppContainerWithIsomorphicFiberStructure>\n            {renderPageTree(EnhancedApp, EnhancedComponent, {\n              ...props,\n              router,\n            })}\n          </AppContainerWithIsomorphicFiberStructure>\n        </Body>\n      )\n    }\n\n    // Always using react concurrent rendering mode with required react version 18.x\n    const renderShell = async (\n      EnhancedApp: AppType,\n      EnhancedComponent: NextComponentType\n    ) => {\n      const content = renderContent(EnhancedApp, EnhancedComponent)\n      return await renderToInitialFizzStream({\n        ReactDOMServer: ReactDOMServerPages,\n        element: content,\n      })\n    }\n\n    const hasDocumentGetInitialProps =\n      process.env.NEXT_RUNTIME !== 'edge' && !!Document.getInitialProps\n\n    // If it has getInitialProps, we will render the shell in `renderPage`.\n    // Otherwise we do it right now.\n    let documentInitialPropsRes:\n      | {}\n      | Awaited<ReturnType<typeof loadDocumentInitialProps>>\n\n    let content: string | null\n    if (hasDocumentGetInitialProps) {\n      documentInitialPropsRes = await loadDocumentInitialProps(renderShell)\n      if (documentInitialPropsRes === null) {\n        content = null\n      } else {\n        const { docProps } = documentInitialPropsRes as any\n        content = docProps.html\n      }\n    } else {\n      documentInitialPropsRes = {}\n      const stream = await renderShell(App, Component)\n      await stream.allReady\n      content = await streamToString(stream)\n    }\n\n    // @ts-ignore: documentInitialPropsRes is set\n    const { docProps } = (documentInitialPropsRes as any) || {}\n    const documentElement = (htmlProps: any) => {\n      if (process.env.NEXT_RUNTIME === 'edge') {\n        return (Document as any)()\n      } else {\n        return <Document {...htmlProps} {...docProps} />\n      }\n    }\n\n    let styles\n    if (hasDocumentGetInitialProps) {\n      styles = docProps.styles\n      head = docProps.head\n    } else {\n      styles = jsxStyleRegistry.styles()\n      jsxStyleRegistry.flush()\n    }\n\n    // Registry is now flushed; rawStyledJsxInsertedHTML will be empty.\n    const rawStyledJsxInsertedHTML = await renderToString(\n      styledJsxInsertedHTML()\n    )\n\n    if (content === null) {\n      return null\n    }\n\n    const contentHTML = rawStyledJsxInsertedHTML + content\n\n    return {\n      contentHTML,\n      documentElement,\n      head,\n      headTags: [],\n      styles,\n    }\n  }\n\n  getTracer().setRootSpanAttribute('next.route', renderOpts.page)\n  const documentResult = await getTracer().trace(\n    RenderSpan.renderDocument,\n    {\n      spanName: `render route (pages) ${renderOpts.page}`,\n      attributes: {\n        'next.route': renderOpts.page,\n      },\n    },\n    async () => renderDocument()\n  )\n  if (!documentResult) {\n    return new RenderResult(null, {\n      metadata,\n      contentType: HTML_CONTENT_TYPE_HEADER,\n    })\n  }\n\n  const dynamicImportsIds = new Set<string | number>()\n  const dynamicImports = new Set<string>()\n\n  for (const mod of reactLoadableModules) {\n    const manifestItem = reactLoadableManifest[mod]\n\n    if (manifestItem) {\n      dynamicImportsIds.add(manifestItem.id)\n      manifestItem.files.forEach((item) => {\n        dynamicImports.add(item)\n      })\n    }\n  }\n\n  const docComponentsRendered: DocumentProps['docComponentsRendered'] = {}\n\n  const {\n    assetPrefix,\n    defaultLocale,\n    disableOptimizedLoading,\n    domainLocales,\n    locale,\n    locales,\n  } = renderOpts\n  const htmlProps: HtmlProps = {\n    __NEXT_DATA__: {\n      props, // The result of getInitialProps\n      page: pathname, // The rendered page\n      query, // querystring parsed / passed by the user\n      buildId: sharedContext.buildId,\n      assetPrefix: assetPrefix === '' ? undefined : assetPrefix, // send assetPrefix to the client side when configured, otherwise don't sent in the resulting HTML\n      nextExport: nextExport === true ? true : undefined, // If this is a page exported by `next export`\n      autoExport: isAutoExport === true ? true : undefined, // If this is an auto exported page\n      isFallback,\n      isExperimentalCompile,\n      dynamicIds:\n        dynamicImportsIds.size === 0\n          ? undefined\n          : Array.from(dynamicImportsIds),\n      err: renderOpts.err\n        ? serializeError(!!process.env.__NEXT_DEV_SERVER, renderOpts.err)\n        : undefined, // Error if one happened, otherwise don't sent in the resulting HTML\n      gsp: !!getStaticProps ? true : undefined, // whether the page is getStaticProps\n      gssp: !!getServerSideProps ? true : undefined, // whether the page is getServerSideProps\n      customServer: sharedContext.customServer,\n      gip: hasPageGetInitialProps ? true : undefined, // whether the page has getInitialProps\n      appGip: !defaultAppGetInitialProps ? true : undefined, // whether the _app has getInitialProps\n      locale,\n      locales,\n      defaultLocale,\n      domainLocales,\n      isPreview: isPreview === true ? true : undefined,\n      notFoundSrcPage:\n        notFoundSrcPage && process.env.__NEXT_DEV_SERVER\n          ? notFoundSrcPage\n          : undefined,\n    },\n    nonce,\n    buildManifest: filteredBuildManifest,\n    docComponentsRendered,\n    dangerousAsPath: router.asPath,\n    isDevelopment: !!process.env.__NEXT_DEV_SERVER,\n    deploymentId: sharedContext.deploymentId,\n    dynamicImports: Array.from(dynamicImports),\n    dynamicCssManifest: new Set(renderOpts.dynamicCssManifest || []),\n    assetPrefix,\n    // Only enabled in production as development mode has features relying on HMR (style injection for example)\n    unstable_runtimeJS:\n      process.env.NODE_ENV === 'production'\n        ? pageConfig.unstable_runtimeJS\n        : undefined,\n    unstable_JsPreload: pageConfig.unstable_JsPreload,\n    assetQueryString,\n    cssAssetQueryString,\n    mutableAssetQueryString,\n    scriptLoader,\n    locale,\n    disableOptimizedLoading,\n    head: documentResult.head,\n    headTags: documentResult.headTags,\n    styles: documentResult.styles,\n    crossOrigin: renderOpts.crossOrigin,\n    optimizeCss: renderOpts.optimizeCss,\n    nextConfigOutput: renderOpts.nextConfigOutput,\n    nextScriptWorkers: renderOpts.nextScriptWorkers,\n    runtime: globalRuntime,\n    largePageDataBytes: renderOpts.largePageDataBytes,\n    nextFontManifest: renderOpts.nextFontManifest,\n    experimentalClientTraceMetadata:\n      renderOpts.experimental.clientTraceMetadata,\n  }\n\n  const document = (\n    <HtmlContext.Provider value={htmlProps}>\n      {documentResult.documentElement(htmlProps)}\n    </HtmlContext.Provider>\n  )\n\n  const documentHTML = await getTracer().trace(\n    RenderSpan.renderToString,\n    async () => renderToString(document)\n  )\n\n  if (process.env.NODE_ENV !== 'production') {\n    const nonRenderedComponents = []\n    const expectedDocComponents = ['Main', 'Head', 'NextScript', 'Html']\n\n    for (const comp of expectedDocComponents) {\n      if (!(docComponentsRendered as any)[comp]) {\n        nonRenderedComponents.push(comp)\n      }\n    }\n\n    if (nonRenderedComponents.length) {\n      const missingComponentList = nonRenderedComponents\n        .map((e) => `<${e} />`)\n        .join(', ')\n      const plural = nonRenderedComponents.length !== 1 ? 's' : ''\n      console.warn(\n        `Your custom Document (pages/_document) did not render all the required subcomponent${plural}.\\n` +\n          `Missing component${plural}: ${missingComponentList}\\n` +\n          'Read how to fix here: https://nextjs.org/docs/messages/missing-document-component'\n      )\n    }\n  }\n\n  const [renderTargetPrefix, renderTargetSuffix] = documentHTML.split(\n    '<next-js-internal-body-render-target></next-js-internal-body-render-target>',\n    2\n  )\n\n  let prefix = ''\n  if (!documentHTML.startsWith(DOCTYPE)) {\n    prefix += DOCTYPE\n  }\n  prefix += renderTargetPrefix\n\n  const content = prefix + documentResult.contentHTML + renderTargetSuffix\n\n  const optimizedHtml = await postProcessHTML(content, renderOpts)\n\n  return new RenderResult(optimizedHtml, {\n    metadata,\n    contentType: HTML_CONTENT_TYPE_HEADER,\n  })\n}\n\nexport type PagesRender = (\n  req: IncomingMessage,\n  res: ServerResponse,\n  pathname: string,\n  query: NextParsedUrlQuery,\n  renderOpts: RenderOpts,\n  sharedContext: PagesSharedContext,\n  renderContext: PagesRenderContext\n) => Promise<RenderResult>\n\nexport const renderToHTML: PagesRender = (\n  req,\n  res,\n  pathname,\n  query,\n  renderOpts,\n  sharedContext,\n  renderContext\n) => {\n  return renderToHTMLImpl(\n    req,\n    res,\n    pathname,\n    query,\n    renderOpts,\n    renderOpts,\n    sharedContext,\n    renderContext\n  )\n}\n"],"names":["errorToJSON","renderToHTML","renderToHTMLImpl","tryGetPreviewData","warn","postProcessHTML","DOCTYPE","process","env","NEXT_RUNTIME","require","console","bind","html","noRouter","message","Error","renderToString","element","renderStream","ReactDOMServerPages","renderToReadableStream","allReady","streamToString","ServerRouter","constructor","pathname","query","as","isFallback","isReady","basePath","locale","locales","defaultLocale","domainLocales","isPreview","isLocaleDomain","route","replace","asPath","push","reload","back","forward","prefetch","beforePopState","enhanceComponents","options","App","Component","enhanceApp","enhanceComponent","renderPageTree","props","invalidKeysMsg","methodName","invalidKeys","docsPathname","toLocaleLowerCase","join","checkRedirectValues","redirect","req","method","destination","permanent","statusCode","errors","hasStatusCode","hasPermanent","allowedStatusCodes","has","destinationType","basePathType","length","url","err","source","getErrorSource","name","stripAnsi","stack","digest","serializeError","dev","getSafariCacheBusterQueryString","__NEXT_DEV_SERVER","userAgent","headers","toLowerCase","includes","Date","now","res","renderOpts","extra","sharedContext","renderContext","setLazyProp","getCookieParser","cssCacheBuster","mutableAssetQueryString","deploymentId","assetQueryString","clientAssetToken","cssAssetQueryString","metadata","Object","assign","pageConfig","buildManifest","reactLoadableManifest","ErrorDebug","getStaticProps","getStaticPaths","getServerSideProps","isNextDataRequest","params","previewProps","images","runtime","globalRuntime","isExperimentalCompile","expireTime","Document","OriginComponent","notFoundSrcPage","developmentNotFoundSourcePage","stripInternalQueries","isSSG","isBuildTimeSSG","isBuildTimePrerendering","defaultAppGetInitialProps","getInitialProps","origGetInitialProps","hasPageGetInitialProps","hasPageScripts","unstable_scriptLoader","pageIsDynamic","isDynamicRoute","defaultErrorGetInitialProps","isAutoExport","setHeader","getCacheControlHeader","revalidate","expire","SSG_GET_INITIAL_PROPS_CONFLICT","SERVER_PROPS_GET_INIT_PROPS_CONFLICT","SERVER_PROPS_SSG_CONFLICT","nextConfigOutput","resolvedAsPath","isValidElementType","endsWith","STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR","STATIC_STATUS_PAGES","setIsrStatus","GSSP_COMPONENT_MEMBER_ERROR","Loadable","preloadAll","undefined","previewData","multiZoneDraftMode","routerIsReady","router","getRequestMeta","appRouter","adaptForAppRouterInstance","scriptLoader","jsxStyleRegistry","createStyleRegistry","head","defaultHead","reactLoadableModules","initialScripts","beforeInteractive","concat","filter","script","strategy","map","csp","nonce","getScriptNonceFromHeader","AppContainer","children","AppRouterContext","Provider","value","SearchParamsContext","adaptForSearchParams","PathnameContextProviderAdapter","PathParamsContext","adaptForPathParams","RouterContext","HeadManagerContext","updateHead","state","updateScripts","scripts","mountedInstances","Set","LoadableContext","moduleName","StyleRegistry","registry","ImageConfigContext","Noop","AppContainerWithIsomorphicFiberStructure","ctx","AppTree","defaultGetInitialProps","docCtx","AppComp","renderPageHead","renderPage","styles","flush","nextExport","styledJsxInsertedHTML","loadGetInitialProps","__N_PREVIEW","STATIC_PROPS_ID","data","getTracer","trace","RenderSpan","spanName","attributes","draftMode","preview","revalidateReason","isOnDemandRevalidate","staticPropsError","code","GSP_NO_RETURNED_VALUE","keys","key","UNSTABLE_REVALIDATE_RENAME_ERROR","NODE_ENV","notFound","isNotFound","__N_REDIRECT","__N_REDIRECT_STATUS","getRedirectStatus","__N_REDIRECT_BASE_PATH","isRedirect","isSerializableProps","Number","isInteger","Math","ceil","JSON","stringify","pageProps","cacheControl","pageData","RenderResult","contentType","SERVER_PROPS_ID","canAccessRes","resOrProxy","deferredContent","Proxy","get","obj","prop","ReflectAdapter","resolvedUrl","serverSidePropsError","isError","GSSP_NO_RETURNED_VALUE","Promise","unstable_notFound","unstable_redirect","JSON_CONTENT_TYPE_HEADER","isResSent","EMPTY","filteredBuildManifest","page","denormalizePagePath","normalizePagePath","pages","lowPriorityFiles","f","Body","div","id","renderDocument","BuiltinFunctionalDocument","NEXT_BUILTIN_DOCUMENT","loadDocumentInitialProps","renderShell","EnhancedApp","EnhancedComponent","stream","documentCtx","docProps","getDisplayName","renderContent","_App","_Component","content","renderToInitialFizzStream","ReactDOMServer","hasDocumentGetInitialProps","documentInitialPropsRes","documentElement","htmlProps","rawStyledJsxInsertedHTML","contentHTML","headTags","setRootSpanAttribute","documentResult","HTML_CONTENT_TYPE_HEADER","dynamicImportsIds","dynamicImports","mod","manifestItem","add","files","forEach","item","docComponentsRendered","assetPrefix","disableOptimizedLoading","__NEXT_DATA__","buildId","autoExport","dynamicIds","size","Array","from","gsp","gssp","customServer","gip","appGip","dangerousAsPath","isDevelopment","dynamicCssManifest","unstable_runtimeJS","unstable_JsPreload","crossOrigin","optimizeCss","nextScriptWorkers","largePageDataBytes","nextFontManifest","experimentalClientTraceMetadata","experimental","clientTraceMetadata","document","HtmlContext","documentHTML","nonRenderedComponents","expectedDocComponents","comp","missingComponentList","e","plural","renderTargetPrefix","renderTargetSuffix","split","prefix","startsWith","optimizedHtml"],"mappings":"AAAA,2FAA2F;;;;;;;;;;;;;;;;IA2Z3EA,WAAW;eAAXA;;IA0rCHC,YAAY;eAAZA;;IA7oCSC,gBAAgB;eAAhBA;;;;0BAjbf;iCACyB;8DAkBA;4EACA;2BACmB;2BAY5C;4BAMA;qCAC6B;sBACR;iDACO;8EACd;8CACW;4CACF;2BACC;uBAKxB;0CACqB;mCACM;qCACE;6BACL;gCACuB;qEACO;gEACzC;sCAIb;iDAC4B;kEACb;+BACe;0BAM9B;+CAC0B;iDAI1B;wBACmB;4BACC;yBACI;8BACO;6BACP;0CAGU;;;;;;AAEzC,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AAEJ,MAAMC,UAAU;AAEhB,IAAIC,QAAQC,GAAG,CAACC,YAAY,KAAK,QAAQ;IACvCN,oBAAoB,AAClBO,QAAQ,yCACRP,iBAAiB;IACnBC,OAAO,AACLM,QAAQ,uBACRN,IAAI;IACNC,kBAAkB,AAChBK,QAAQ,kBACRL,eAAe;AACnB,OAAO;IACLD,OAAOO,QAAQP,IAAI,CAACQ,IAAI,CAACD;IACzBN,kBAAkB,OAAOQ,OAAiBA;AAC5C;AAEA,SAASC;IACP,MAAMC,UACJ;IACF,MAAM,qBAAkB,CAAlB,IAAIC,MAAMD,UAAV,qBAAA;eAAA;oBAAA;sBAAA;IAAiB;AACzB;AAEA,eAAeE,eAAeC,OAA2B;IACvD,MAAMC,eAAe,MAAMC,4BAAmB,CAACC,sBAAsB,CAACH;IACtE,MAAMC,aAAaG,QAAQ;IAC3B,OAAOC,IAAAA,oCAAc,EAACJ;AACxB;AAEA,MAAMK;IAgBJC,YACEC,QAAgB,EAChBC,KAAqB,EACrBC,EAAU,EACV,EAAEC,UAAU,EAA2B,EACvCC,OAAgB,EAChBC,QAAgB,EAChBC,MAAe,EACfC,OAA2B,EAC3BC,aAAsB,EACtBC,aAAuC,EACvCC,SAAmB,EACnBC,cAAwB,CAC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