@toothfairyai/tfdesign 0.4.7 → 0.4.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/apps/web/out/404/index.html +1 -1
  2. package/apps/web/out/404.html +1 -1
  3. package/apps/web/out/__next.$oc$slug.__PAGE__.txt +3 -3
  4. package/apps/web/out/__next.$oc$slug.txt +3 -3
  5. package/apps/web/out/__next._full.txt +16 -16
  6. package/apps/web/out/__next._head.txt +4 -4
  7. package/apps/web/out/__next._index.txt +6 -7
  8. package/apps/web/out/__next._tree.txt +3 -3
  9. package/apps/web/out/_next/static/chunks/0-94cql6nl0jv.css +2 -0
  10. package/apps/web/out/_next/static/chunks/0-_4nyrx9a0p_.js +4586 -0
  11. package/apps/web/out/_next/static/chunks/012el4mxdksfa.js +1 -0
  12. package/apps/web/out/_next/static/chunks/033hdyh92lap-.js +1 -0
  13. package/apps/web/out/_next/static/chunks/{0~saitcv01ulm.js → 09kj3eb8dudq..js} +1 -3
  14. package/apps/web/out/_next/static/chunks/0eyc01y70gfu8.js +5 -0
  15. package/apps/web/out/_next/static/chunks/0gfud9-ayub5k.css +1 -0
  16. package/apps/web/out/_next/static/chunks/0otg4bwz5am.y.css +2 -0
  17. package/apps/web/out/_next/static/chunks/0qgizcmqgdduz.js +1 -0
  18. package/apps/web/out/_next/static/chunks/0rjd9p0m-xust.js +31 -0
  19. package/apps/web/out/_next/static/chunks/111k.piti8qwb.js +1 -0
  20. package/apps/web/out/_next/static/chunks/1434omkut_t67.js +1 -0
  21. package/apps/web/out/_next/static/chunks/{turbopack-0qjykn58ffuft.js → turbopack-15aa1bhzoau.r.js} +1 -3
  22. package/apps/web/out/_not-found/__next._full.txt +23 -19
  23. package/apps/web/out/_not-found/__next._head.txt +4 -4
  24. package/apps/web/out/_not-found/__next._index.txt +6 -7
  25. package/apps/web/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
  26. package/apps/web/out/_not-found/__next._not-found.txt +3 -3
  27. package/apps/web/out/_not-found/__next._tree.txt +3 -3
  28. package/apps/web/out/_not-found/index.html +1 -1
  29. package/apps/web/out/_not-found/index.txt +23 -19
  30. package/apps/web/out/align-center.png +0 -0
  31. package/apps/web/out/align-right.png +0 -0
  32. package/apps/web/out/align-text.png +0 -0
  33. package/apps/web/out/app-icon.png +0 -0
  34. package/apps/web/out/app-icon.svg +1 -1
  35. package/apps/web/out/bottom-alignment.png +0 -0
  36. package/apps/web/out/fonts/Gilroy-Regular.woff2 +0 -0
  37. package/apps/web/out/fonts/Gilroy-SemiBold.woff2 +0 -0
  38. package/apps/web/out/html2canvas.min.js +20 -0
  39. package/apps/web/out/icon-add-file.png +0 -0
  40. package/apps/web/out/icon-copy.png +0 -0
  41. package/apps/web/out/icon-remove.png +0 -0
  42. package/apps/web/out/index.html +1 -1
  43. package/apps/web/out/index.txt +16 -16
  44. package/apps/web/out/left-alignment.png +0 -0
  45. package/apps/web/out/logo.svg +14 -5
  46. package/apps/web/out/top-alignment.png +0 -0
  47. package/dist/{chunk-VIER63EE.js → chunk-Q2ALQSZX.js} +590 -110
  48. package/dist/cli.js +29 -6
  49. package/dist/{server-RXVSJGZG.js → server-PZVSL7GD.js} +1 -1
  50. package/package.json +11 -1
  51. package/apps/web/out/_next/static/chunks/00.vhdzyqgugx.js.map +0 -1
  52. package/apps/web/out/_next/static/chunks/026q~go~dh3ct.js.map +0 -1
  53. package/apps/web/out/_next/static/chunks/03lp76x6ml3q7.js.map +0 -1
  54. package/apps/web/out/_next/static/chunks/03rwb84ufo-ml.css +0 -2
  55. package/apps/web/out/_next/static/chunks/03~yq9q893hmn.js.map +0 -1
  56. package/apps/web/out/_next/static/chunks/05z1ica28h4v4.js.map +0 -1
  57. package/apps/web/out/_next/static/chunks/06pwisw_r78h0.js.map +0 -1
  58. package/apps/web/out/_next/static/chunks/07e0~_ag4wd_2.js +0 -3
  59. package/apps/web/out/_next/static/chunks/0856t9l8e24kl.js +0 -3459
  60. package/apps/web/out/_next/static/chunks/09dn2kc7uy573.css +0 -3
  61. package/apps/web/out/_next/static/chunks/0_h7u0wcctdvf.js.map +0 -1
  62. package/apps/web/out/_next/static/chunks/0bfs9u56d4mzi.js.map +0 -1
  63. package/apps/web/out/_next/static/chunks/0bnhnqs10zvm0.js +0 -3
  64. package/apps/web/out/_next/static/chunks/0b~oqibb-klk8.js.map +0 -1
  65. package/apps/web/out/_next/static/chunks/0dlz0h-q.e8t5.js.map +0 -1
  66. package/apps/web/out/_next/static/chunks/0e2qn3b70-t2i.js +0 -34
  67. package/apps/web/out/_next/static/chunks/0fv_wqm4-r1hb.js +0 -12
  68. package/apps/web/out/_next/static/chunks/0fysc_wo2kzsu.js.map +0 -1
  69. package/apps/web/out/_next/static/chunks/0i-mjuoftnsa3.js +0 -3
  70. package/apps/web/out/_next/static/chunks/0ix3s5zdxhkjq.js +0 -12
  71. package/apps/web/out/_next/static/chunks/0ovz1kz3yt45_.js +0 -33
  72. package/apps/web/out/_next/static/chunks/0ps7zql~4nu4c.js.map +0 -1
  73. package/apps/web/out/_next/static/chunks/0qans9q_q-pop.js +0 -7
  74. package/apps/web/out/_next/static/chunks/0t3k3fodzjqbk.js +0 -3
  75. package/apps/web/out/_next/static/chunks/0vh07vpip-7jr.js.map +0 -1
  76. package/apps/web/out/_next/static/chunks/0weq586uhw-26.js.map +0 -1
  77. package/apps/web/out/_next/static/chunks/0y1f9xlua9~_u.css +0 -2
  78. package/apps/web/out/_next/static/chunks/0zvsnz1lw0thi.js.map +0 -1
  79. package/apps/web/out/_next/static/chunks/0~ge_azerwvf9.css.map +0 -6
  80. package/apps/web/out/_next/static/chunks/0~wbkak703p3z.js +0 -3
  81. package/apps/web/out/_next/static/chunks/11uef98fc_tfp.css.map +0 -1
  82. package/apps/web/out/_next/static/chunks/14hojq718_2.u.js +0 -34
  83. package/apps/web/out/_next/static/chunks/15j8a~eyh6.eg.css.map +0 -1
  84. package/apps/web/out/_next/static/chunks/16cm9w~y8~hqh.js.map +0 -1
  85. package/apps/web/out/_next/static/chunks/17p64lujxa85m.js +0 -3
  86. package/apps/web/out/agent-icons/aider.png +0 -0
  87. package/apps/web/out/agent-icons/amr.svg +0 -8
  88. package/apps/web/out/agent-icons/antigravity.svg +0 -1
  89. package/apps/web/out/agent-icons/claude.svg +0 -1
  90. package/apps/web/out/agent-icons/codex.svg +0 -1
  91. package/apps/web/out/agent-icons/copilot.svg +0 -1
  92. package/apps/web/out/agent-icons/cursor-agent.svg +0 -1
  93. package/apps/web/out/agent-icons/deepseek.svg +0 -1
  94. package/apps/web/out/agent-icons/devin.png +0 -0
  95. package/apps/web/out/agent-icons/gemini.svg +0 -1
  96. package/apps/web/out/agent-icons/grok-build.svg +0 -15
  97. package/apps/web/out/agent-icons/hermes.svg +0 -1
  98. package/apps/web/out/agent-icons/kilo.svg +0 -1
  99. package/apps/web/out/agent-icons/kimi.svg +0 -1
  100. package/apps/web/out/agent-icons/kiro.svg +0 -1
  101. package/apps/web/out/agent-icons/mimo.svg +0 -1
  102. package/apps/web/out/agent-icons/opencode.svg +0 -1
  103. package/apps/web/out/agent-icons/pi.svg +0 -1
  104. package/apps/web/out/agent-icons/qoder.svg +0 -1
  105. package/apps/web/out/agent-icons/qwen.svg +0 -1
  106. package/apps/web/out/agent-icons/reasonix.svg +0 -37
  107. package/apps/web/out/agent-icons/trae-cli.png +0 -0
  108. package/apps/web/out/agent-icons/vibe.svg +0 -1
  109. package/apps/web/out/brand-icon.svg +0 -5
  110. package/apps/web/out/desktop-pet/__next._full.txt +0 -20
  111. package/apps/web/out/desktop-pet/__next._head.txt +0 -6
  112. package/apps/web/out/desktop-pet/__next._index.txt +0 -8
  113. package/apps/web/out/desktop-pet/__next._tree.txt +0 -3
  114. package/apps/web/out/desktop-pet/__next.desktop-pet.__PAGE__.txt +0 -6
  115. package/apps/web/out/desktop-pet/__next.desktop-pet.txt +0 -5
  116. package/apps/web/out/desktop-pet/index.html +0 -1
  117. package/apps/web/out/desktop-pet/index.txt +0 -20
  118. package/apps/web/out/logo.png +0 -0
  119. package/apps/web/out/model-icons/black-forest-labs.svg +0 -10
  120. package/apps/web/out/model-icons/bytedance.svg +0 -1
  121. package/apps/web/out/model-icons/elevenlabs.svg +0 -1
  122. package/apps/web/out/model-icons/fishaudio.svg +0 -1
  123. package/apps/web/out/model-icons/flux.svg +0 -1
  124. package/apps/web/out/model-icons/google-gemini.svg +0 -1
  125. package/apps/web/out/model-icons/minimax.svg +0 -1
  126. package/apps/web/out/model-icons/openai.svg +0 -1
  127. package/apps/web/out/model-icons/openrouter.svg +0 -1
  128. package/apps/web/out/model-icons/suno.svg +0 -1
  129. package/apps/web/out/model-icons/x.svg +0 -1
  130. package/apps/web/out/official_badge.svg +0 -48
  131. package/apps/web/out/remixicon.woff2 +0 -0
  132. /package/apps/web/out/_next/static/{EOfAKklAkTBpVS50QG3jX → LZdEU9ZvDchB9VDyfg54d}/_buildManifest.js +0 -0
  133. /package/apps/web/out/_next/static/{EOfAKklAkTBpVS50QG3jX → LZdEU9ZvDchB9VDyfg54d}/_clientMiddlewareManifest.js +0 -0
  134. /package/apps/web/out/_next/static/{EOfAKklAkTBpVS50QG3jX → LZdEU9ZvDchB9VDyfg54d}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/shared/lib/utils/warn-once.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/shared/lib/router/utils/disable-smooth-scroll.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/components/http-access-fallback/error-boundary.tsx","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/components/bfcache-state-manager.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/components/layout-router.tsx","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/components/render-from-template-context.tsx","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/request/search-params.browser.prod.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/request/search-params.browser.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/request/params.browser.prod.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/request/params.browser.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/app-render/vary-params.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/web/spec-extension/adapters/reflect.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/create-deduped-by-callsite-server-error-logger.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/shared/lib/utils/reflect-utils.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/app-render/after-task-async-storage-instance.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/app-render/after-task-async-storage.external.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/request/utils.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/web/spec-extension/cookies.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/web/spec-extension/adapters/request-cookies.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/web/spec-extension/adapters/headers.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/shared/lib/router/utils/get-segment-param.tsx","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/shared/lib/utils.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/shared/lib/router/utils/querystring.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/shared/lib/router/utils/parse-relative-url.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/app-render/instant-validation/instant-validation-error.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/app-render/instant-validation/instant-samples.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/request/search-params.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/app-render/dynamic-access-async-storage-instance.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/app-render/dynamic-access-async-storage.external.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/server/request/params.ts","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/components/client-page.tsx","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/client/components/client-segment.tsx","turbopack:///[project]/node_modules/.pnpm/next@16.2.6_@opentelemetry+api@1.9.1_@playwright+test@1.60.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/src/lib/metadata/generate/icon-mark.tsx"],"sourcesContent":["let warnOnce = (_: string) => {}\nif (process.env.NODE_ENV !== 'production') {\n const warnings = new Set<string>()\n warnOnce = (msg: string) => {\n if (!warnings.has(msg)) {\n console.warn(msg)\n }\n warnings.add(msg)\n }\n}\n\nexport { warnOnce }\n","import { warnOnce } from '../../utils/warn-once'\n\n/**\n * Run function with `scroll-behavior: auto` applied to `<html/>`.\n * This css change will be reverted after the function finishes.\n */\nexport function disableSmoothScrollDuringRouteTransition(\n fn: () => void,\n options: { dontForceLayout?: boolean; onlyHashChange?: boolean } = {}\n) {\n // if only the hash is changed, we don't need to disable smooth scrolling\n // we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX\n if (options.onlyHashChange) {\n fn()\n return\n }\n\n const htmlElement = document.documentElement\n const hasDataAttribute = htmlElement.dataset.scrollBehavior === 'smooth'\n\n if (!hasDataAttribute) {\n // Warn if smooth scrolling is detected but no data attribute is present\n if (\n process.env.NODE_ENV === 'development' &&\n getComputedStyle(htmlElement).scrollBehavior === 'smooth'\n ) {\n warnOnce(\n 'Detected `scroll-behavior: smooth` on the `<html>` element. To disable smooth scrolling during route transitions, ' +\n 'add `data-scroll-behavior=\"smooth\"` to your <html> element. ' +\n 'Learn more: https://nextjs.org/docs/messages/missing-data-scroll-behavior'\n )\n }\n // No smooth scrolling configured, run directly without style manipulation\n fn()\n return\n }\n\n // Proceed with temporarily disabling smooth scrolling\n const existing = htmlElement.style.scrollBehavior\n htmlElement.style.scrollBehavior = 'auto'\n if (!options.dontForceLayout) {\n // In Chrome-based browsers we need to force reflow before calling `scrollTo`.\n // Otherwise it will not pickup the change in scrollBehavior\n // More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042\n htmlElement.getClientRects()\n }\n fn()\n htmlElement.style.scrollBehavior = existing\n}\n","'use client'\n\n/**\n * HTTPAccessFallbackBoundary is a boundary that catches errors and renders a\n * fallback component for HTTP errors.\n *\n * It receives the status code, and determine if it should render fallbacks for few HTTP 4xx errors.\n *\n * e.g. 404\n * 404 represents not found, and the fallback component pair contains the component and its styles.\n *\n */\n\nimport React, { useContext } from 'react'\nimport { useUntrackedPathname } from '../navigation-untracked'\nimport {\n HTTPAccessErrorStatus,\n getAccessFallbackHTTPStatus,\n getAccessFallbackErrorTypeByStatus,\n isHTTPAccessFallbackError,\n} from './http-access-fallback'\nimport { warnOnce } from '../../../shared/lib/utils/warn-once'\nimport { MissingSlotContext } from '../../../shared/lib/app-router-context.shared-runtime'\n\ninterface HTTPAccessFallbackBoundaryProps {\n notFound?: React.ReactNode\n forbidden?: React.ReactNode\n unauthorized?: React.ReactNode\n // TODO: Make this required once `React.createElement` understands that positional args go into children\n children?: React.ReactNode\n missingSlots?: Set<string>\n}\n\ninterface HTTPAccessFallbackErrorBoundaryProps\n extends HTTPAccessFallbackBoundaryProps {\n pathname: string | null\n missingSlots?: Set<string>\n}\n\ninterface HTTPAccessBoundaryState {\n triggeredStatus: number | undefined\n previousPathname: string | null\n}\n\nclass HTTPAccessFallbackErrorBoundary extends React.Component<\n HTTPAccessFallbackErrorBoundaryProps,\n HTTPAccessBoundaryState\n> {\n constructor(props: HTTPAccessFallbackErrorBoundaryProps) {\n super(props)\n this.state = {\n triggeredStatus: undefined,\n previousPathname: props.pathname,\n }\n }\n\n componentDidCatch(): void {\n if (\n process.env.NODE_ENV === 'development' &&\n this.props.missingSlots &&\n this.props.missingSlots.size > 0 &&\n // A missing children slot is the typical not-found case, so no need to warn\n !this.props.missingSlots.has('children')\n ) {\n let warningMessage =\n 'No default component was found for a parallel route rendered on this page. Falling back to nearest NotFound boundary.\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs\\n\\n'\n\n const formattedSlots = Array.from(this.props.missingSlots)\n .sort((a, b) => a.localeCompare(b))\n .map((slot) => `@${slot}`)\n .join(', ')\n\n warningMessage += 'Missing slots: ' + formattedSlots\n\n warnOnce(warningMessage)\n }\n }\n\n static getDerivedStateFromError(error: any) {\n if (isHTTPAccessFallbackError(error)) {\n const httpStatus = getAccessFallbackHTTPStatus(error)\n return {\n triggeredStatus: httpStatus,\n }\n }\n // Re-throw if error is not for 404\n throw error\n }\n\n static getDerivedStateFromProps(\n props: HTTPAccessFallbackErrorBoundaryProps,\n state: HTTPAccessBoundaryState\n ): HTTPAccessBoundaryState | null {\n /**\n * Handles reset of the error boundary when a navigation happens.\n * Ensures the error boundary does not stay enabled when navigating to a new page.\n * Approach of setState in render is safe as it checks the previous pathname and then overrides\n * it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\n if (props.pathname !== state.previousPathname && state.triggeredStatus) {\n return {\n triggeredStatus: undefined,\n previousPathname: props.pathname,\n }\n }\n return {\n triggeredStatus: state.triggeredStatus,\n previousPathname: props.pathname,\n }\n }\n\n render() {\n const { notFound, forbidden, unauthorized, children } = this.props\n const { triggeredStatus } = this.state\n const errorComponents = {\n [HTTPAccessErrorStatus.NOT_FOUND]: notFound,\n [HTTPAccessErrorStatus.FORBIDDEN]: forbidden,\n [HTTPAccessErrorStatus.UNAUTHORIZED]: unauthorized,\n }\n\n if (triggeredStatus) {\n const isNotFound =\n triggeredStatus === HTTPAccessErrorStatus.NOT_FOUND && notFound\n const isForbidden =\n triggeredStatus === HTTPAccessErrorStatus.FORBIDDEN && forbidden\n const isUnauthorized =\n triggeredStatus === HTTPAccessErrorStatus.UNAUTHORIZED && unauthorized\n\n // If there's no matched boundary in this layer, keep throwing the error by rendering the children\n if (!(isNotFound || isForbidden || isUnauthorized)) {\n return children\n }\n\n return (\n <>\n <meta name=\"robots\" content=\"noindex\" />\n {process.env.NODE_ENV === 'development' && (\n <meta\n name=\"boundary-next-error\"\n content={getAccessFallbackErrorTypeByStatus(triggeredStatus)}\n />\n )}\n {errorComponents[triggeredStatus]}\n </>\n )\n }\n\n return children\n }\n}\n\nexport function HTTPAccessFallbackBoundary({\n notFound,\n forbidden,\n unauthorized,\n children,\n}: HTTPAccessFallbackBoundaryProps) {\n // When we're rendering the missing params shell, this will return null. This\n // is because we won't be rendering any not found boundaries or error\n // boundaries for the missing params shell. When this runs on the client\n // (where these error can occur), we will get the correct pathname.\n const pathname = useUntrackedPathname()\n const missingSlots = useContext(MissingSlotContext)\n const hasErrorFallback = !!(notFound || forbidden || unauthorized)\n\n if (hasErrorFallback) {\n return (\n <HTTPAccessFallbackErrorBoundary\n pathname={pathname}\n notFound={notFound}\n forbidden={forbidden}\n unauthorized={unauthorized}\n missingSlots={missingSlots}\n >\n {children}\n </HTTPAccessFallbackErrorBoundary>\n )\n }\n\n return <>{children}</>\n}\n","import type {\n CacheNode,\n FlightRouterState,\n} from '../../shared/lib/app-router-types'\nimport { useState } from 'react'\n\n// When the flag is disabled, only track the currently active tree\nconst MAX_BF_CACHE_ENTRIES = process.env.__NEXT_CACHE_COMPONENTS ? 3 : 1\n\nexport type RouterBFCacheEntry = {\n tree: FlightRouterState\n cacheNode: CacheNode\n stateKey: string\n // The entries form a linked list, sorted in order of most recently active.\n next: RouterBFCacheEntry | null\n}\n\n/**\n * Keeps track of the most recent N trees (FlightRouterStates) that were active\n * at a certain segment level. E.g. for a segment \"/a/b/[param]\", this hook\n * tracks the last N param values that the router rendered for N.\n *\n * The result of this hook precisely determines the number and order of\n * trees that are rendered in parallel at their segment level.\n *\n * The purpose of this cache is to we can preserve the React and DOM state of\n * some number of inactive trees, by rendering them in an <Activity> boundary.\n * That means it would not make sense for the the lifetime of the cache to be\n * any longer than the lifetime of the React tree; e.g. if the hook were\n * unmounted, then the React tree would be, too. So, we use React state to\n * manage it.\n *\n * Note that we don't store the RSC data for the cache entries in this hook —\n * the data for inactive segments is stored in the parent CacheNode, which\n * *does* have a longer lifetime than the React tree. This hook only determines\n * which of those trees should have their *state* preserved, by <Activity>.\n */\nexport function useRouterBFCache(\n activeTree: FlightRouterState,\n activeCacheNode: CacheNode,\n activeStateKey: string\n): RouterBFCacheEntry {\n // The currently active entry. The entries form a linked list, sorted in\n // order of most recently active. This allows us to reuse parts of the list\n // without cloning, unless there's a reordering or removal.\n // TODO: Once we start tracking back/forward history at each route level,\n // we should use the history order instead. In other words, when traversing\n // to an existing entry as a result of a popstate event, we should maintain\n // the existing order instead of moving it to the front of the list. I think\n // an initial implementation of this could be to pass an incrementing id\n // to history.pushState/replaceState, then use that here for ordering.\n const [prevActiveEntry, setPrevActiveEntry] = useState<RouterBFCacheEntry>(\n () => {\n const initialEntry: RouterBFCacheEntry = {\n tree: activeTree,\n cacheNode: activeCacheNode,\n stateKey: activeStateKey,\n next: null,\n }\n return initialEntry\n }\n )\n\n if (prevActiveEntry.tree === activeTree) {\n // Fast path. The active tree hasn't changed, so we can reuse the\n // existing state.\n return prevActiveEntry\n }\n\n // The route tree changed. Note that this doesn't mean that the tree changed\n // *at this level* — the change may be due to a child route. Either way, we\n // need to either add or update the router tree in the bfcache.\n //\n // The rest of the code looks more complicated than it actually is because we\n // can't mutate the state in place; we have to copy-on-write.\n\n // Create a new entry for the active cache key. This is the head of the new\n // linked list.\n const newActiveEntry: RouterBFCacheEntry = {\n tree: activeTree,\n cacheNode: activeCacheNode,\n stateKey: activeStateKey,\n next: null,\n }\n\n // We need to append the old list onto the new list. If the head of the new\n // list was already present in the cache, then we'll need to clone everything\n // that came before it. Then we can reuse the rest.\n let n = 1\n let oldEntry: RouterBFCacheEntry | null = prevActiveEntry\n let clonedEntry: RouterBFCacheEntry = newActiveEntry\n while (oldEntry !== null && n < MAX_BF_CACHE_ENTRIES) {\n if (oldEntry.stateKey === activeStateKey) {\n // Fast path. This entry in the old list that corresponds to the key that\n // is now active. We've already placed a clone of this entry at the front\n // of the new list. We can reuse the rest of the old list without cloning.\n // NOTE: We don't need to worry about eviction in this case because we\n // haven't increased the size of the cache, and we assume the max size\n // is constant across renders. If we were to change it to a dynamic limit,\n // then the implementation would need to account for that.\n clonedEntry.next = oldEntry.next\n break\n } else {\n // Clone the entry and append it to the list.\n n++\n const entry: RouterBFCacheEntry = {\n tree: oldEntry.tree,\n cacheNode: oldEntry.cacheNode,\n stateKey: oldEntry.stateKey,\n next: null,\n }\n clonedEntry.next = entry\n clonedEntry = entry\n }\n oldEntry = oldEntry.next\n }\n\n setPrevActiveEntry(newActiveEntry)\n return newActiveEntry\n}\n","'use client'\n\nimport type { CacheNode } from '../../shared/lib/app-router-types'\nimport type { LoadingModuleData } from '../../shared/lib/app-router-types'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../../shared/lib/app-router-types'\nimport type { ErrorComponent } from './error-boundary'\nimport type { FocusAndScrollRef } from './router-reducer/router-reducer-types'\n\nimport React, {\n Activity,\n Fragment,\n useContext,\n use,\n Suspense,\n useDeferredValue,\n useLayoutEffect,\n type FragmentInstance,\n type JSX,\n type ActivityProps,\n} from 'react'\nimport ReactDOM from 'react-dom'\nimport {\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n TemplateContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { ErrorBoundary } from './error-boundary'\nimport { disableSmoothScrollDuringRouteTransition } from '../../shared/lib/router/utils/disable-smooth-scroll'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { HTTPAccessFallbackBoundary } from './http-access-fallback/error-boundary'\nimport { createRouterCacheKey } from './router-reducer/create-router-cache-key'\nimport {\n useRouterBFCache,\n type RouterBFCacheEntry,\n} from './bfcache-state-manager'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport {\n NavigationPromisesContext,\n type NavigationPromises,\n} from '../../shared/lib/hooks-client-context.shared-runtime'\nimport { getParamValueFromCacheKey } from '../route-params'\nimport type { Params } from '../../server/request/params'\nimport { isDeferredRsc } from './router-reducer/ppr-navigations'\n\nconst enableNewScrollHandler = process.env.__NEXT_APP_NEW_SCROLL_HANDLER\n\nconst __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = (\n ReactDOM as any\n).__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE\n\n// TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available\n/**\n * Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning\n */\nfunction findDOMNode(\n instance: React.ReactInstance | null | undefined\n): Element | Text | null {\n // Tree-shake for server bundle\n if (typeof window === 'undefined') return null\n\n // __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode is null during module init.\n // We need to lazily reference it.\n const internal_reactDOMfindDOMNode =\n __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode\n return internal_reactDOMfindDOMNode(instance)\n}\n\nconst rectProperties = [\n 'bottom',\n 'height',\n 'left',\n 'right',\n 'top',\n 'width',\n 'x',\n 'y',\n] as const\n/**\n * Check if a HTMLElement is hidden or fixed/sticky position\n */\nfunction shouldSkipElement(element: HTMLElement) {\n // we ignore fixed or sticky positioned elements since they'll likely pass the \"in-viewport\" check\n // and will result in a situation we bail on scroll because of something like a fixed nav,\n // even though the actual page content is offscreen\n if (['sticky', 'fixed'].includes(getComputedStyle(element).position)) {\n return true\n }\n\n // Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent`\n // because `offsetParent` doesn't consider document/body\n const rect = element.getBoundingClientRect()\n return rectProperties.every((item) => rect[item] === 0)\n}\n\n/**\n * Check if the top corner of the HTMLElement is in the viewport.\n */\nfunction topOfElementInViewport(\n instance: HTMLElement | FragmentInstance,\n viewportHeight: number\n): boolean {\n const rects = instance.getClientRects()\n if (rects.length === 0) {\n // Just to be explicit.\n return false\n }\n let elementTop = Number.POSITIVE_INFINITY\n for (let i = 0; i < rects.length; i++) {\n const rect = rects[i]\n if (rect.top < elementTop) {\n elementTop = rect.top\n }\n }\n return elementTop >= 0 && elementTop <= viewportHeight\n}\n\n/**\n * Find the DOM node for a hash fragment.\n * If `top` the page has to scroll to the top of the page. This mirrors the browser's behavior.\n * If the hash fragment is an id, the page has to scroll to the element with that id.\n * If the hash fragment is a name, the page has to scroll to the first element with that name.\n */\nfunction getHashFragmentDomNode(hashFragment: string) {\n // If the hash fragment is `top` the page has to scroll to the top of the page.\n if (hashFragment === 'top') {\n return document.body\n }\n\n // If the hash fragment is an id, the page has to scroll to the element with that id.\n return (\n document.getElementById(hashFragment) ??\n // If the hash fragment is a name, the page has to scroll to the first element with that name.\n document.getElementsByName(hashFragment)[0]\n )\n}\ninterface ScrollAndMaybeFocusHandlerProps {\n focusAndScrollRef: FocusAndScrollRef\n children: React.ReactNode\n cacheNode: CacheNode\n}\nclass InnerScrollAndFocusHandlerOld extends React.Component<ScrollAndMaybeFocusHandlerProps> {\n handlePotentialScroll = () => {\n // Handle scroll and focus, it's only applied once.\n const { focusAndScrollRef, cacheNode } = this.props\n\n const scrollRef = focusAndScrollRef.forceScroll\n ? focusAndScrollRef.scrollRef\n : cacheNode.scrollRef\n if (scrollRef === null || !scrollRef.current) return\n\n let domNode:\n | ReturnType<typeof getHashFragmentDomNode>\n | ReturnType<typeof findDOMNode> = null\n const hashFragment = focusAndScrollRef.hashFragment\n\n if (hashFragment) {\n domNode = getHashFragmentDomNode(hashFragment)\n }\n\n // `findDOMNode` is tricky because it returns just the first child if the component is a fragment.\n // This already caused a bug where the first child was a <link/> in head.\n if (!domNode) {\n domNode = findDOMNode(this)\n }\n\n // If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.\n if (!(domNode instanceof Element)) {\n return\n }\n\n // Verify if the element is a HTMLElement and if we want to consider it for scroll behavior.\n // If the element is skipped, try to select the next sibling and try again.\n while (!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)) {\n if (process.env.NODE_ENV !== 'production') {\n if (domNode.parentElement?.localName === 'head') {\n // We enter this state when metadata was rendered as part of the page or via Next.js.\n // This is always a bug in Next.js and caused by React hoisting metadata.\n // Fixed with `experimental.appNewScrollHandler`\n }\n }\n\n // No siblings found that match the criteria are found, so handle scroll higher up in the tree instead.\n if (domNode.nextElementSibling === null) {\n return\n }\n domNode = domNode.nextElementSibling\n }\n\n // Mark as scrolled so no other segment scrolls for this navigation.\n scrollRef.current = false\n\n disableSmoothScrollDuringRouteTransition(\n () => {\n // In case of hash scroll, we only need to scroll the element into view\n if (hashFragment) {\n domNode.scrollIntoView()\n\n return\n }\n // Store the current viewport height because reading `clientHeight` causes a reflow,\n // and it won't change during this function.\n const htmlElement = document.documentElement\n const viewportHeight = htmlElement.clientHeight\n\n // If the element's top edge is already in the viewport, exit early.\n if (topOfElementInViewport(domNode, viewportHeight)) {\n return\n }\n\n // Otherwise, try scrolling go the top of the document to be backward compatible with pages\n // scrollIntoView() called on `<html/>` element scrolls horizontally on chrome and firefox (that shouldn't happen)\n // We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left\n // scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically\n htmlElement.scrollTop = 0\n\n // Scroll to domNode if domNode is not in viewport when scrolled to top of document\n if (!topOfElementInViewport(domNode, viewportHeight)) {\n // Scroll into view doesn't scroll horizontally by default when not needed\n domNode.scrollIntoView()\n }\n },\n {\n // We will force layout by querying domNode position\n dontForceLayout: true,\n onlyHashChange: focusAndScrollRef.onlyHashChange,\n }\n )\n\n // Mutate after scrolling so that it can be read by `disableSmoothScrollDuringRouteTransition`\n focusAndScrollRef.onlyHashChange = false\n focusAndScrollRef.hashFragment = null\n\n // Set focus on the element\n domNode.focus()\n }\n\n componentDidMount() {\n this.handlePotentialScroll()\n }\n\n componentDidUpdate() {\n this.handlePotentialScroll()\n }\n\n render() {\n return this.props.children\n }\n}\n\n/**\n * Fork of InnerScrollAndFocusHandlerOld using Fragment refs for scrolling.\n * No longer focuses the first host descendant.\n */\nfunction InnerScrollHandlerNew(props: ScrollAndMaybeFocusHandlerProps) {\n const childrenRef = React.useRef<FragmentInstance>(null)\n\n useLayoutEffect(\n () => {\n const { focusAndScrollRef, cacheNode } = props\n\n const scrollRef = focusAndScrollRef.forceScroll\n ? focusAndScrollRef.scrollRef\n : cacheNode.scrollRef\n if (scrollRef === null || !scrollRef.current) return\n\n let instance: FragmentInstance | HTMLElement | null = null\n const hashFragment = focusAndScrollRef.hashFragment\n\n if (hashFragment) {\n instance = getHashFragmentDomNode(hashFragment)\n }\n\n if (!instance) {\n instance = childrenRef.current\n }\n\n // If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.\n if (instance === null) {\n return\n }\n\n // Mark as scrolled so no other segment scrolls for this navigation.\n scrollRef.current = false\n\n const activeElement = document.activeElement\n if (\n activeElement !== null &&\n 'blur' in activeElement &&\n typeof activeElement.blur === 'function'\n ) {\n // Trying to match hard navigations.\n // Ideally we'd move the internal focus cursor either to the top\n // or at least before the segment. But there's no DOM API to do that,\n // so we just blur.\n // We could workaround this by moving focus to a temporary element in\n // the body. But adding elements might trigger layout or other effects\n // so it should be well motivated.\n activeElement.blur()\n }\n\n disableSmoothScrollDuringRouteTransition(\n () => {\n // In case of hash scroll, we only need to scroll the element into view\n if (hashFragment) {\n instance.scrollIntoView()\n\n return\n }\n // Store the current viewport height because reading `clientHeight` causes a reflow,\n // and it won't change during this function.\n const htmlElement = document.documentElement\n const viewportHeight = htmlElement.clientHeight\n\n // If the element's top edge is already in the viewport, exit early.\n if (topOfElementInViewport(instance, viewportHeight)) {\n return\n }\n\n // Otherwise, try scrolling go the top of the document to be backward compatible with pages\n // scrollIntoView() called on `<html/>` element scrolls horizontally on chrome and firefox (that shouldn't happen)\n // We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left\n // scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically\n htmlElement.scrollTop = 0\n\n // Scroll to domNode if domNode is not in viewport when scrolled to top of document\n if (!topOfElementInViewport(instance, viewportHeight)) {\n // Scroll into view doesn't scroll horizontally by default when not needed\n instance.scrollIntoView()\n }\n },\n {\n // We will force layout by querying domNode position\n dontForceLayout: true,\n onlyHashChange: focusAndScrollRef.onlyHashChange,\n }\n )\n\n // Mutate after scrolling so that it can be read by `disableSmoothScrollDuringRouteTransition`\n focusAndScrollRef.onlyHashChange = false\n focusAndScrollRef.hashFragment = null\n },\n // Used to run on every commit. We may be able to be smarter about this\n // but be prepared for lots of manual testing.\n undefined\n )\n\n return <Fragment ref={childrenRef}>{props.children}</Fragment>\n}\n\nconst InnerScrollAndMaybeFocusHandler = enableNewScrollHandler\n ? InnerScrollHandlerNew\n : InnerScrollAndFocusHandlerOld\n\nfunction ScrollAndMaybeFocusHandler({\n children,\n cacheNode,\n}: {\n children: React.ReactNode\n cacheNode: CacheNode\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n return (\n <InnerScrollAndMaybeFocusHandler\n focusAndScrollRef={context.focusAndScrollRef}\n cacheNode={cacheNode}\n >\n {children}\n </InnerScrollAndMaybeFocusHandler>\n )\n}\n\n/**\n * InnerLayoutRouter handles rendering the provided segment based on the cache.\n */\nfunction InnerLayoutRouter({\n tree,\n segmentPath,\n debugNameContext,\n cacheNode: maybeCacheNode,\n params,\n url,\n isActive,\n}: {\n tree: FlightRouterState\n segmentPath: FlightSegmentPath\n debugNameContext: string\n cacheNode: CacheNode | null\n params: Params\n url: string\n isActive: boolean\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n const parentNavPromises = useContext(NavigationPromisesContext)\n\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n const cacheNode =\n maybeCacheNode !== null\n ? maybeCacheNode\n : // This segment is not in the cache. Suspend indefinitely.\n //\n // This should only be reachable for inactive/hidden segments, during\n // prerendering The active segment should always be consistent with the\n // CacheNode tree. Regardless, if we don't have a matching CacheNode, we\n // must suspend rather than render nothing, to prevent showing an\n // inconsistent route.\n\n (use(unresolvedThenable) as never)\n\n // `rsc` represents the renderable node for this segment.\n\n // If this segment has a `prefetchRsc`, it's the statically prefetched data.\n // We should use that on initial render instead of `rsc`. Then we'll switch\n // to `rsc` when the dynamic response streams in.\n //\n // If no prefetch data is available, then we go straight to rendering `rsc`.\n const resolvedPrefetchRsc =\n cacheNode.prefetchRsc !== null ? cacheNode.prefetchRsc : cacheNode.rsc\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n const rsc: any = useDeferredValue(cacheNode.rsc, resolvedPrefetchRsc)\n\n // `rsc` is either a React node or a promise for a React node, except we\n // special case `null` to represent that this segment's data is missing. If\n // it's a promise, we need to unwrap it so we can determine whether or not the\n // data is missing.\n let resolvedRsc: React.ReactNode\n if (isDeferredRsc(rsc)) {\n const unwrappedRsc = use(rsc)\n if (unwrappedRsc === null) {\n // If the promise was resolved to `null`, it means the data for this\n // segment was not returned by the server. Suspend indefinitely. When this\n // happens, the router is responsible for triggering a new state update to\n // un-suspend this segment.\n use(unresolvedThenable) as never\n }\n resolvedRsc = unwrappedRsc\n } else {\n // This is not a deferred RSC promise. Don't need to unwrap it.\n if (rsc === null) {\n use(unresolvedThenable) as never\n }\n resolvedRsc = rsc\n }\n\n // In dev, we create a NavigationPromisesContext containing the instrumented promises that provide\n // `useSelectedLayoutSegment` and `useSelectedLayoutSegments`.\n // Promises are cached outside of render to survive suspense retries.\n let navigationPromises: NavigationPromises | null = null\n if (process.env.NODE_ENV !== 'production') {\n const { createNestedLayoutNavigationPromises } =\n require('./navigation-devtools') as typeof import('./navigation-devtools')\n\n navigationPromises = createNestedLayoutNavigationPromises(\n tree,\n parentNavPromises\n )\n }\n\n let children = resolvedRsc\n\n if (navigationPromises) {\n children = (\n <NavigationPromisesContext.Provider value={navigationPromises}>\n {resolvedRsc}\n </NavigationPromisesContext.Provider>\n )\n }\n\n children = (\n // The layout router context narrows down tree and childNodes at each level.\n <LayoutRouterContext.Provider\n value={{\n parentTree: tree,\n parentCacheNode: cacheNode,\n parentSegmentPath: segmentPath,\n parentParams: params,\n // This is always set to null as we enter a child segment. It's\n // populated by LoadingBoundaryProvider the next time we reach a\n // loading boundary.\n parentLoadingData: null,\n debugNameContext: debugNameContext,\n\n // TODO-APP: overriding of url for parallel routes\n url: url,\n isActive: isActive,\n }}\n >\n {children}\n </LayoutRouterContext.Provider>\n )\n\n return children\n}\n\nexport function LoadingBoundaryProvider({\n loading,\n children,\n}: {\n loading: LoadingModuleData\n children: React.ReactNode\n}) {\n // Provides the data needed to render a loading.tsx boundary, via context.\n //\n // loading.tsx creates a Suspense boundary around each of a layout's child\n // slots. (Might be bit confusing to think about the data flow, but: if\n // loading.tsx and layout.tsx are in the same directory, they are assigned\n // to the same CacheNode.)\n //\n // This provider component does not render the Suspense boundary directly;\n // that's handled by LoadingBoundary.\n //\n // TODO: For simplicity, we should combine this provider with LoadingBoundary\n // and render the Suspense boundary directly. The only real benefit of doing\n // it separately is so that when there are multiple parallel routes, we only\n // send the boundary data once, rather than once per child. But that's a\n // negligible benefit and can be achieved via caching instead.\n const parentContext = use(LayoutRouterContext)\n if (parentContext === null) {\n return children\n }\n // All values except for parentLoadingData are the same as the parent context.\n return (\n <LayoutRouterContext.Provider\n value={{\n parentTree: parentContext.parentTree,\n parentCacheNode: parentContext.parentCacheNode,\n parentSegmentPath: parentContext.parentSegmentPath,\n parentParams: parentContext.parentParams,\n parentLoadingData: loading,\n debugNameContext: parentContext.debugNameContext,\n url: parentContext.url,\n isActive: parentContext.isActive,\n }}\n >\n {children}\n </LayoutRouterContext.Provider>\n )\n}\n\n/**\n * Renders suspense boundary with the provided \"loading\" property as the fallback.\n * If no loading property is provided it renders the children without a suspense boundary.\n */\nfunction LoadingBoundary({\n name,\n loading,\n children,\n}: {\n name: ActivityProps['name']\n loading: LoadingModuleData | null\n children: React.ReactNode\n}): JSX.Element {\n // TODO: For LoadingBoundary, and the other built-in boundary types, don't\n // wrap in an extra function component if no user-defined boundary is\n // provided. In other words, inline this conditional wrapping logic into\n // the parent component. More efficient and keeps unnecessary junk out of\n // the component stack.\n if (loading !== null) {\n const loadingRsc = loading[0]\n const loadingStyles = loading[1]\n const loadingScripts = loading[2]\n return (\n <Suspense\n name={name}\n fallback={\n <>\n {loadingStyles}\n {loadingScripts}\n {loadingRsc}\n </>\n }\n >\n {children}\n </Suspense>\n )\n }\n\n return <>{children}</>\n}\n\n/**\n * OuterLayoutRouter handles the current segment as well as <Offscreen> rendering of other segments.\n * It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.\n */\nexport default function OuterLayoutRouter({\n parallelRouterKey,\n error,\n errorStyles,\n errorScripts,\n templateStyles,\n templateScripts,\n template,\n notFound,\n forbidden,\n unauthorized,\n segmentViewBoundaries,\n}: {\n parallelRouterKey: string\n error: ErrorComponent | undefined\n errorStyles: React.ReactNode | undefined\n errorScripts: React.ReactNode | undefined\n templateStyles: React.ReactNode | undefined\n templateScripts: React.ReactNode | undefined\n template: React.ReactNode\n notFound: React.ReactNode | undefined\n forbidden: React.ReactNode | undefined\n unauthorized: React.ReactNode | undefined\n segmentViewBoundaries?: React.ReactNode\n}) {\n const context = useContext(LayoutRouterContext)\n if (!context) {\n throw new Error('invariant expected layout router to be mounted')\n }\n\n const {\n parentTree,\n parentCacheNode,\n parentSegmentPath,\n parentParams,\n parentLoadingData,\n url,\n isActive,\n debugNameContext,\n } = context\n\n // Get the CacheNode for this segment by reading it from the parent segment's\n // child map.\n const parentTreeSegment = parentTree[0]\n const segmentPath =\n parentSegmentPath === null\n ? // TODO: The root segment value is currently omitted from the segment\n // path. This has led to a bunch of special cases scattered throughout\n // the code. We should clean this up.\n [parallelRouterKey]\n : parentSegmentPath.concat([parentTreeSegment, parallelRouterKey])\n\n // The \"state\" key of a segment is the one passed to React — it represents the\n // identity of the UI tree. Whenever the state key changes, the tree is\n // recreated and the state is reset. In the App Router model, search params do\n // not cause state to be lost, so two segments with the same segment path but\n // different search params should have the same state key.\n //\n // The \"cache\" key of a segment, however, *does* include the search params, if\n // it's possible that the segment accessed the search params on the server.\n // (This only applies to page segments; layout segments cannot access search\n // params on the server.)\n const activeTree = parentTree[1][parallelRouterKey]\n const maybeParentSlots = parentCacheNode.slots\n if (activeTree === undefined || maybeParentSlots === null) {\n // Could not find a matching segment. The client tree is inconsistent with\n // the server tree. Suspend indefinitely; the router will have already\n // detected the inconsistency when handling the server response, and\n // triggered a refresh of the page to recover.\n use(unresolvedThenable) as never\n }\n\n let maybeValidationBoundaryId: string | null = null\n if (typeof window === 'undefined' && process.env.__NEXT_CACHE_COMPONENTS) {\n const { InstantValidationBoundaryContext } =\n require('./instant-validation/boundary') as typeof import('./instant-validation/boundary')\n maybeValidationBoundaryId = use(InstantValidationBoundaryContext)\n }\n\n const activeSegment = activeTree[0]\n const activeCacheNode = maybeParentSlots![parallelRouterKey] ?? null\n const activeStateKey = createRouterCacheKey(activeSegment, true) // no search params\n\n // At each level of the route tree, not only do we render the currently\n // active segment — we also render the last N segments that were active at\n // this level inside a hidden <Activity> boundary, to preserve their state\n // if or when the user navigates to them again.\n //\n // bfcacheEntry is a linked list of FlightRouterStates.\n let bfcacheEntry: RouterBFCacheEntry | null = useRouterBFCache(\n activeTree,\n activeCacheNode,\n activeStateKey\n )\n let children: Array<React.ReactNode> = []\n do {\n const tree = bfcacheEntry.tree\n const cacheNode = bfcacheEntry.cacheNode\n const stateKey = bfcacheEntry.stateKey\n const segment = tree[0]\n\n /*\n - Error boundary\n - Only renders error boundary if error component is provided.\n - Rendered for each segment to ensure they have their own error state.\n - When gracefully degrade for bots, skip rendering error boundary.\n - Loading boundary\n - Only renders suspense boundary if loading components is provided.\n - Rendered for each segment to ensure they have their own loading state.\n - Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch.\n */\n\n let segmentBoundaryTriggerNode: React.ReactNode = null\n let segmentViewStateNode: React.ReactNode = null\n if (process.env.NODE_ENV !== 'production') {\n const { SegmentBoundaryTriggerNode, SegmentViewStateNode } =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n\n const pagePrefix = normalizeAppPath(url)\n segmentViewStateNode = (\n <SegmentViewStateNode key={pagePrefix} page={pagePrefix} />\n )\n\n segmentBoundaryTriggerNode = (\n <>\n <SegmentBoundaryTriggerNode />\n </>\n )\n }\n\n let params = parentParams\n if (Array.isArray(segment)) {\n // This segment contains a route param. Accumulate these as we traverse\n // down the router tree. The result represents the set of params that\n // the layout/page components are permitted to access below this point.\n const paramName = segment[0]\n const paramCacheKey = segment[1]\n const paramType = segment[2]\n const paramValue = getParamValueFromCacheKey(paramCacheKey, paramType)\n if (paramValue !== null) {\n params = {\n ...parentParams,\n [paramName]: paramValue,\n }\n }\n }\n\n const debugName = getBoundaryDebugNameFromSegment(segment)\n // `debugNameContext` represents the nearest non-\"virtual\" parent segment.\n // `getBoundaryDebugNameFromSegment` returns undefined for virtual segments.\n // So if `debugName` is undefined, the context is passed through unchanged.\n const childDebugNameContext = debugName ?? debugNameContext\n\n // In practical terms, clicking this name in the Suspense DevTools\n // should select the child slots of that layout.\n //\n // So the name we apply to the Activity boundary is actually based on\n // the nearest parent segments.\n //\n // We skip over \"virtual\" parents, i.e. ones inserted by Next.js that\n // don't correspond to application-defined code.\n const isVirtual = debugName === undefined\n const debugNameToDisplay = isVirtual ? undefined : debugNameContext\n\n let templateValue = (\n <ScrollAndMaybeFocusHandler cacheNode={cacheNode}>\n <ErrorBoundary\n errorComponent={error}\n errorStyles={errorStyles}\n errorScripts={errorScripts}\n >\n <LoadingBoundary\n name={debugNameToDisplay}\n // TODO: The loading module data for a segment is stored on the\n // parent, then applied to each of that parent segment's\n // parallel route slots. In the simple case where there's only\n // one parallel route (the `children` slot), this is no\n // different from if the loading module data were stored on the\n // child directly. But I'm not sure this actually makes sense\n // when there are multiple parallel routes. It's not a huge\n // issue because you always have the option to define a narrower\n // loading boundary for a particular slot. But this sort of\n // smells like an implementation accident to me.\n loading={parentLoadingData}\n >\n <HTTPAccessFallbackBoundary\n notFound={notFound}\n forbidden={forbidden}\n unauthorized={unauthorized}\n >\n <RedirectBoundary>\n <InnerLayoutRouter\n url={url}\n tree={tree}\n params={params}\n cacheNode={cacheNode}\n segmentPath={segmentPath}\n debugNameContext={childDebugNameContext}\n isActive={isActive && stateKey === activeStateKey}\n />\n {segmentBoundaryTriggerNode}\n </RedirectBoundary>\n </HTTPAccessFallbackBoundary>\n </LoadingBoundary>\n </ErrorBoundary>\n {segmentViewStateNode}\n </ScrollAndMaybeFocusHandler>\n )\n\n if (\n typeof window === 'undefined' &&\n process.env.__NEXT_CACHE_COMPONENTS &&\n typeof maybeValidationBoundaryId === 'string'\n ) {\n const { RenderValidationBoundaryAtThisLevel } =\n require('./instant-validation/boundary') as typeof import('./instant-validation/boundary')\n templateValue = (\n <RenderValidationBoundaryAtThisLevel id={maybeValidationBoundaryId}>\n {templateValue}\n </RenderValidationBoundaryAtThisLevel>\n )\n }\n\n let child = (\n <TemplateContext.Provider key={stateKey} value={templateValue}>\n {templateStyles}\n {templateScripts}\n {template}\n </TemplateContext.Provider>\n )\n\n if (process.env.NODE_ENV !== 'production') {\n const { SegmentStateProvider } =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n\n child = (\n <SegmentStateProvider key={stateKey}>\n {child}\n {segmentViewBoundaries}\n </SegmentStateProvider>\n )\n }\n\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n child = (\n <Activity\n name={debugNameToDisplay}\n key={stateKey}\n mode={stateKey === activeStateKey ? 'visible' : 'hidden'}\n >\n {child}\n </Activity>\n )\n }\n\n children.push(child)\n\n bfcacheEntry = bfcacheEntry.next\n } while (bfcacheEntry !== null)\n\n return children\n}\n\nfunction getBoundaryDebugNameFromSegment(segment: Segment): string | undefined {\n if (segment === '/') {\n // Reached the root\n return '/'\n }\n if (typeof segment === 'string') {\n if (isVirtualLayout(segment)) {\n return undefined\n } else {\n return segment + '/'\n }\n }\n const paramCacheKey = segment[1]\n return paramCacheKey + '/'\n}\n\nfunction isVirtualLayout(segment: string): boolean {\n return (\n // This is inserted by the loader. Uses double-underscore convention\n // (like __PAGE__ and __DEFAULT__) to avoid collisions with\n // user-defined route groups.\n segment === '(__SLOT__)'\n )\n}\n","'use client'\n\nimport React, { useContext, type JSX } from 'react'\nimport { TemplateContext } from '../../shared/lib/app-router-context.shared-runtime'\n\nexport default function RenderFromTemplateContext(): JSX.Element {\n const children = useContext(TemplateContext)\n return <>{children}</>\n}\n","import type { SearchParams } from '../../server/request/search-params'\n\ninterface CacheLifetime {}\nconst CachedSearchParams = new WeakMap<CacheLifetime, Promise<SearchParams>>()\n\nfunction makeUntrackedSearchParams(\n underlyingSearchParams: SearchParams\n): Promise<SearchParams> {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams)\n if (cachedSearchParams) {\n return cachedSearchParams\n }\n\n const promise = Promise.resolve(underlyingSearchParams)\n CachedSearchParams.set(underlyingSearchParams, promise)\n\n return promise\n}\n\nexport function createRenderSearchParamsFromClient(\n underlyingSearchParams: SearchParams\n): Promise<SearchParams> {\n return makeUntrackedSearchParams(underlyingSearchParams)\n}\n","export const createRenderSearchParamsFromClient =\n process.env.NODE_ENV === 'development'\n ? (\n require('./search-params.browser.dev') as typeof import('./search-params.browser.dev')\n ).createRenderSearchParamsFromClient\n : (\n require('./search-params.browser.prod') as typeof import('./search-params.browser.prod')\n ).createRenderSearchParamsFromClient\n","import type { Params } from '../../server/request/params'\n\ninterface CacheLifetime {}\nconst CachedParams = new WeakMap<CacheLifetime, Promise<Params>>()\n\nfunction makeUntrackedParams(underlyingParams: Params): Promise<Params> {\n const cachedParams = CachedParams.get(underlyingParams)\n if (cachedParams) {\n return cachedParams\n }\n\n const promise = Promise.resolve(underlyingParams)\n CachedParams.set(underlyingParams, promise)\n\n return promise\n}\n\nexport function createRenderParamsFromClient(\n clientParams: Params\n): Promise<Params> {\n return makeUntrackedParams(clientParams)\n}\n","export const createRenderParamsFromClient =\n process.env.NODE_ENV === 'development'\n ? (require('./params.browser.dev') as typeof import('./params.browser.dev'))\n .createRenderParamsFromClient\n : (\n require('./params.browser.prod') as typeof import('./params.browser.prod')\n ).createRenderParamsFromClient\n","import type { Params } from '../request/params'\nimport type { SearchParams } from '../request/search-params'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport type {\n VaryParamsThenable,\n VaryParams,\n} from '../../shared/lib/segment-cache/vary-params-decoding'\n\n/**\n * Accumulates vary params for a single segment (or for metadata/rootParams).\n *\n * VaryParamsAccumulator is also a thenable that can be serialized by React\n * Flight. The accumulator starts as 'pending' and accumulates param accesses\n * during render. Call `finishTrackingVaryParams()` after rendering to resolve\n * all accumulators.\n *\n * The `status` and `value` fields follow the React Flight thenable protocol:\n * when `status === 'fulfilled'`, Flight can read `value` synchronously without\n * scheduling a microtask via `.then()`.\n */\nexport type VaryParamsAccumulator = {\n // Mutable during render - accumulates param access\n varyParams: VaryParams\n\n // React thenable protocol fields\n status: 'pending' | 'fulfilled'\n value: VaryParams\n then(\n onfulfilled?: ((value: Set<string>) => unknown) | null,\n onrejected?: ((reason: unknown) => unknown) | null\n ): void\n\n // Internal - callbacks waiting for resolution\n resolvers: Array<(value: Set<string>) => void>\n}\n\n/**\n * A mutable data structure for accumulating per-segment vary params for an\n * entire server response. It's only used during prerenders. It describes\n * metadata about the response itself.\n */\nexport type ResponseVaryParamsAccumulator = {\n /** Vary params accumulator for metadata/viewport (the \"head\" segment) */\n head: VaryParamsAccumulator\n /** Vary params accumulator for root params access */\n rootParams: VaryParamsAccumulator\n /** Vary params accumulators for each route segment */\n segments: Set<VaryParamsAccumulator>\n}\n\nfunction createSegmentVaryParamsAccumulator(): VaryParamsAccumulator {\n const accumulator: VaryParamsAccumulator = {\n varyParams: new Set(),\n status: 'pending',\n value: new Set(),\n then(onfulfilled: ((value: Set<string>) => unknown) | null | undefined) {\n if (onfulfilled) {\n if (accumulator.status === 'pending') {\n accumulator.resolvers.push(onfulfilled)\n } else {\n onfulfilled(accumulator.value)\n }\n }\n },\n resolvers: [],\n }\n return accumulator\n}\n\n/**\n * A singleton accumulator that's already resolved to an empty Set. Use this for\n * segments where we know upfront that no params will be accessed, such as\n * client components or segments without user code.\n *\n * Benefits:\n * - No need to accumulate or resolve later\n * - Resilient: resolves correctly even if other tracking fails\n * - Memory efficient: reuses the same object\n */\nconst emptySet: VaryParams = new Set()\nexport const emptyVaryParamsAccumulator: VaryParamsAccumulator = {\n varyParams: emptySet,\n status: 'fulfilled',\n value: emptySet,\n then(onfulfilled: ((value: Set<string>) => unknown) | null | undefined) {\n if (onfulfilled) {\n onfulfilled(emptySet)\n }\n },\n resolvers: [],\n}\n\nexport function createResponseVaryParamsAccumulator(): ResponseVaryParamsAccumulator {\n // Create the head and rootParams accumulators as top-level fields.\n // Segment accumulators are added to the segments set as they are created.\n const head = createSegmentVaryParamsAccumulator()\n const rootParams = createSegmentVaryParamsAccumulator()\n const segments = new Set<VaryParamsAccumulator>()\n\n return {\n head,\n rootParams,\n segments,\n }\n}\n\n/**\n * Allocates a new VaryParamsAccumulator and adds it to the response accumulator\n * associated with the current WorkUnitStore.\n *\n * Returns a thenable that resolves to the segment's vary params once rendering\n * is complete. The thenable can be passed directly to React Flight for\n * serialization.\n */\nexport function createVaryParamsAccumulator(): VaryParamsAccumulator | null {\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-runtime': {\n const responseAccumulator = workUnitStore.varyParamsAccumulator\n if (responseAccumulator !== null) {\n const accumulator = createSegmentVaryParamsAccumulator()\n responseAccumulator.segments.add(accumulator)\n return accumulator\n }\n return null\n }\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'prerender-client':\n case 'validation-client':\n case 'unstable-cache':\n case 'generate-static-params':\n break\n default:\n workUnitStore satisfies never\n }\n }\n return null\n}\n\nexport function getMetadataVaryParamsAccumulator(): VaryParamsAccumulator | null {\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-runtime': {\n const responseAccumulator = workUnitStore.varyParamsAccumulator\n if (responseAccumulator !== null) {\n return responseAccumulator.head\n }\n return null\n }\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'prerender-client':\n case 'validation-client':\n case 'unstable-cache':\n case 'generate-static-params':\n return null\n default:\n workUnitStore satisfies never\n }\n }\n return null\n}\n\nexport function getVaryParamsThenable(\n accumulator: VaryParamsAccumulator\n): VaryParamsThenable | null {\n return accumulator as unknown as VaryParamsThenable | null\n}\n\nexport function getMetadataVaryParamsThenable(): VaryParamsThenable | null {\n const accumulator = getMetadataVaryParamsAccumulator()\n if (accumulator !== null) {\n return getVaryParamsThenable(accumulator)\n }\n return null\n}\n\n// The metadata and viewport are always delivered in a single payload, so they\n// don't need to be tracked separately. This may change in the future, but for\n// now this is just an alias.\nexport const getViewportVaryParamsAccumulator = getMetadataVaryParamsAccumulator\n\nexport function getRootParamsVaryParamsAccumulator(): VaryParamsAccumulator | null {\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-runtime': {\n const responseAccumulator = workUnitStore.varyParamsAccumulator\n if (responseAccumulator !== null) {\n return responseAccumulator.rootParams\n }\n return null\n }\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'prerender-client':\n case 'validation-client':\n case 'unstable-cache':\n case 'generate-static-params':\n return null\n default:\n workUnitStore satisfies never\n }\n }\n return null\n}\n\n/**\n * Records that a param was accessed. Adds the param name to the accumulator's\n * varyParams set.\n */\nexport function accumulateVaryParam(\n accumulator: VaryParamsAccumulator,\n paramName: string\n): void {\n accumulator.varyParams.add(paramName)\n}\n\n/**\n * Records a root param access.\n */\nexport function accumulateRootVaryParam(paramName: string): void {\n const rootParamsAccumulator = getRootParamsVaryParamsAccumulator()\n if (rootParamsAccumulator !== null) {\n accumulateVaryParam(rootParamsAccumulator, paramName)\n }\n}\n\nexport function createVaryingParams(\n accumulator: VaryParamsAccumulator,\n originalParamsObject: Params,\n optionalCatchAllParamName: string | null\n): Params {\n if (optionalCatchAllParamName !== null) {\n // When there's an optional catch-all param with no value (e.g.,\n // [[...slug]] at /), the param doesn't exist as a property on the params\n // object. Use a Proxy to track all param access — both existing params\n // and the missing optional param — including enumeration patterns like\n // Object.keys(), spread, for...in, and `in` checks.\n return new Proxy(originalParamsObject, {\n get(target, prop, receiver) {\n if (typeof prop === 'string') {\n if (\n prop === optionalCatchAllParamName ||\n Object.prototype.hasOwnProperty.call(target, prop)\n ) {\n accumulateVaryParam(accumulator, prop)\n }\n }\n return Reflect.get(target, prop, receiver)\n },\n has(target, prop) {\n if (prop === optionalCatchAllParamName) {\n accumulateVaryParam(accumulator, optionalCatchAllParamName)\n }\n return Reflect.has(target, prop)\n },\n ownKeys(target) {\n // Enumerating the params object means the user's code may depend on\n // which params are present, so conservatively track the optional\n // param as accessed.\n accumulateVaryParam(accumulator, optionalCatchAllParamName)\n return Reflect.ownKeys(target)\n },\n })\n }\n\n // When there's no optional catch-all, all params exist as properties on the\n // object, so we can use defineProperty getters instead of a Proxy. This is\n // faster because the engine can optimize property access on regular objects\n // more aggressively than Proxy trap calls.\n const underlyingParamsWithVarying: Params = {}\n for (const paramName in originalParamsObject) {\n Object.defineProperty(underlyingParamsWithVarying, paramName, {\n get() {\n accumulateVaryParam(accumulator, paramName)\n return originalParamsObject[paramName]\n },\n enumerable: true,\n })\n }\n return underlyingParamsWithVarying\n}\n\nexport function createVaryingSearchParams(\n accumulator: VaryParamsAccumulator,\n originalSearchParamsObject: SearchParams\n): SearchParams {\n const underlyingSearchParamsWithVarying: SearchParams = {}\n for (const searchParamName in originalSearchParamsObject) {\n Object.defineProperty(underlyingSearchParamsWithVarying, searchParamName, {\n get() {\n // TODO: Unlike path params, we don't vary track each search param\n // individually. The entire search string is treated as a single param.\n // This may change in the future.\n accumulateVaryParam(accumulator, '?')\n return originalSearchParamsObject[searchParamName]\n },\n enumerable: true,\n })\n }\n return underlyingSearchParamsWithVarying\n}\n\n/**\n * Resolves all segment accumulators in a ResponseVaryParamsAccumulator with\n * their final vary params. Call this after rendering is complete.\n *\n * Each segment's thenable is resolved with its vary params merged with the\n * root params. If we can't track vary params (e.g., legacy prerender), simply\n * don't call this function - the client treats unresolved thenables as\n * \"unknown\" vary params.\n */\nexport async function finishAccumulatingVaryParams(\n responseAccumulator: ResponseVaryParamsAccumulator\n): Promise<void> {\n const rootVaryParams = responseAccumulator.rootParams.varyParams\n\n // Resolve head\n finishSegmentAccumulator(responseAccumulator.head, rootVaryParams)\n\n // Resolve each segment\n for (const segmentAccumulator of responseAccumulator.segments) {\n finishSegmentAccumulator(segmentAccumulator, rootVaryParams)\n }\n\n // Now that the thenables are resolved, Flight should be able to flush the\n // vary params into the response stream. This work gets scheduled internally\n // by Flight using a microtask as soon as we notify the thenable listeners.\n //\n // We need to ensure that Flight's pending queues are emptied before this\n // function returns; the caller will abort the prerender immediately after.\n // We can't use a macrotask, because that would allow dynamic IO to sneak\n // into the response. So we use microtasks instead.\n //\n // The exact number of awaits here isn't important (indeed, one seems to be\n // sufficient, at the time of writing), as long as we wait enough ticks for\n // Flight to finish writing the response.\n //\n // Anything that remains in Flight's internal queue after these awaits must\n // be actual dynamic IO, not caused by pending vary params tasks. In other\n // words, failing to do this would cause us to treat a fully static prerender\n // as if it were partially dynamic.\n await Promise.resolve()\n await Promise.resolve()\n await Promise.resolve()\n}\n\nfunction finishSegmentAccumulator(\n accumulator: VaryParamsAccumulator,\n rootVaryParams: VaryParams\n): void {\n if (accumulator.status !== 'pending') {\n return\n }\n const merged = new Set<string>(accumulator.varyParams)\n for (const param of rootVaryParams) {\n merged.add(param)\n }\n accumulator.value = merged\n accumulator.status = 'fulfilled'\n for (const resolver of accumulator.resolvers) {\n resolver(merged)\n }\n accumulator.resolvers = []\n}\n","export class ReflectAdapter {\n static get<T extends object>(\n target: T,\n prop: string | symbol,\n receiver: unknown\n ): any {\n const value = Reflect.get(target, prop, receiver)\n if (typeof value === 'function') {\n return value.bind(target)\n }\n\n return value\n }\n\n static set<T extends object>(\n target: T,\n prop: string | symbol,\n value: any,\n receiver: any\n ): boolean {\n return Reflect.set(target, prop, value, receiver)\n }\n\n static has<T extends object>(target: T, prop: string | symbol): boolean {\n return Reflect.has(target, prop)\n }\n\n static deleteProperty<T extends object>(\n target: T,\n prop: string | symbol\n ): boolean {\n return Reflect.deleteProperty(target, prop)\n }\n}\n","import * as React from 'react'\n\nconst errorRef: { current: null | Error } = { current: null }\n\n// React.cache is currently only available in canary/experimental React channels.\nconst cache =\n typeof React.cache === 'function'\n ? React.cache\n : (fn: (key: unknown) => void) => fn\n\n// When Cache Components is enabled, we record these as errors so that they\n// are captured by the dev overlay as it's more critical to fix these\n// when enabled.\nconst logErrorOrWarn = process.env.__NEXT_CACHE_COMPONENTS\n ? console.error\n : console.warn\n\n// We don't want to dedupe across requests.\n// The developer might've just attempted to fix the warning so we should warn again if it still happens.\nconst flushCurrentErrorIfNew = cache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key\n (key: unknown) => {\n try {\n logErrorOrWarn(errorRef.current)\n } finally {\n errorRef.current = null\n }\n }\n)\n\n/**\n * Creates a function that logs an error message that is deduped by the userland\n * callsite.\n * This requires no indirection between the call of this function and the userland\n * callsite i.e. there's only a single library frame above this.\n * Do not use on the Client where sourcemaps and ignore listing might be enabled.\n * Only use that for warnings need a fix independent of the callstack.\n *\n * @param getMessage\n * @returns\n */\nexport function createDedupedByCallsiteServerErrorLoggerDev<Args extends any[]>(\n getMessage: (...args: Args) => Error\n) {\n return function logDedupedError(...args: Args) {\n const message = getMessage(...args)\n\n if (process.env.NODE_ENV !== 'production') {\n const callStackFrames = new Error().stack?.split('\\n')\n if (callStackFrames === undefined || callStackFrames.length < 4) {\n logErrorOrWarn(message)\n } else {\n // Error:\n // logDedupedError\n // asyncApiBeingAccessedSynchronously\n // <userland callsite>\n // TODO: This breaks if sourcemaps with ignore lists are enabled.\n const key = callStackFrames[4]\n errorRef.current = message\n flushCurrentErrorIfNew(key)\n }\n } else {\n logErrorOrWarn(message)\n }\n }\n}\n","// This regex will have fast negatives meaning valid identifiers may not pass\n// this test. However this is only used during static generation to provide hints\n// about why a page bailed out of some or all prerendering and we can use bracket notation\n// for example while `ಠ_ಠ` is a valid identifier it's ok to print `searchParams['ಠ_ಠ']`\n// even if this would have been fine too `searchParams.ಠ_ಠ`\nconst isDefinitelyAValidIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/\n\nexport function describeStringPropertyAccess(target: string, prop: string) {\n if (isDefinitelyAValidIdentifier.test(prop)) {\n return `\\`${target}.${prop}\\``\n }\n return `\\`${target}[${JSON.stringify(prop)}]\\``\n}\n\nexport function describeHasCheckingStringProperty(\n target: string,\n prop: string\n) {\n const stringifiedProp = JSON.stringify(prop)\n return `\\`Reflect.has(${target}, ${stringifiedProp})\\`, \\`${stringifiedProp} in ${target}\\`, or similar`\n}\n\nexport const wellKnownProperties = new Set([\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toString',\n 'valueOf',\n 'toLocaleString',\n\n // Promise prototype\n 'then',\n 'catch',\n 'finally',\n\n // React Promise extension\n 'status',\n // 'value',\n // 'error',\n\n // React introspection\n 'displayName',\n '_debugInfo',\n\n // Common tested properties\n 'toJSON',\n '$$typeof',\n '__esModule',\n\n // Tested by flight when checking for iterables\n '@@iterator',\n])\n","import type { AfterTaskAsyncStorage } from './after-task-async-storage.external'\nimport { createAsyncLocalStorage } from './async-local-storage'\n\nexport const afterTaskAsyncStorageInstance: AfterTaskAsyncStorage =\n createAsyncLocalStorage()\n","import type { AsyncLocalStorage } from 'async_hooks'\n\n// Share the instance module in the next-shared layer\nimport { afterTaskAsyncStorageInstance as afterTaskAsyncStorage } from './after-task-async-storage-instance' with { 'turbopack-transition': 'next-shared' }\nimport type { WorkUnitStore } from './work-unit-async-storage.external'\n\nexport interface AfterTaskStore {\n /** The phase in which the topmost `after` was called.\n *\n * NOTE: Can be undefined when running `generateStaticParams`,\n * where we only have a `workStore`, no `workUnitStore`.\n */\n readonly rootTaskSpawnPhase: WorkUnitStore['phase'] | undefined\n}\n\nexport type AfterTaskAsyncStorage = AsyncLocalStorage<AfterTaskStore>\n\nexport { afterTaskAsyncStorage }\n","import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport type { WorkStore } from '../app-render/work-async-storage.external'\n\nexport function throwWithStaticGenerationBailoutErrorWithDynamicError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwForSearchParamsAccessInUseCache(\n workStore: WorkStore,\n constructorOpt: Function\n): never {\n const error = new Error(\n `Route ${workStore.route} used \\`searchParams\\` inside \"use cache\". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \\`searchParams\\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n\n Error.captureStackTrace(error, constructorOpt)\n workStore.invalidDynamicUsageError ??= error\n\n throw error\n}\n\nexport function isRequestAPICallableInsideAfter() {\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n return afterTaskStore?.rootTaskSpawnPhase === 'action'\n}\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n RequestCookies: () => RequestCookies,\n ResponseCookies: () => ResponseCookies,\n parseCookie: () => parseCookie,\n parseSetCookie: () => parseSetCookie,\n stringifyCookie: () => stringifyCookie\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/serialize.ts\nfunction stringifyCookie(c) {\n var _a;\n const attrs = [\n \"path\" in c && c.path && `Path=${c.path}`,\n \"expires\" in c && (c.expires || c.expires === 0) && `Expires=${(typeof c.expires === \"number\" ? new Date(c.expires) : c.expires).toUTCString()}`,\n \"maxAge\" in c && typeof c.maxAge === \"number\" && `Max-Age=${c.maxAge}`,\n \"domain\" in c && c.domain && `Domain=${c.domain}`,\n \"secure\" in c && c.secure && \"Secure\",\n \"httpOnly\" in c && c.httpOnly && \"HttpOnly\",\n \"sameSite\" in c && c.sameSite && `SameSite=${c.sameSite}`,\n \"partitioned\" in c && c.partitioned && \"Partitioned\",\n \"priority\" in c && c.priority && `Priority=${c.priority}`\n ].filter(Boolean);\n const stringified = `${c.name}=${encodeURIComponent((_a = c.value) != null ? _a : \"\")}`;\n return attrs.length === 0 ? stringified : `${stringified}; ${attrs.join(\"; \")}`;\n}\nfunction parseCookie(cookie) {\n const map = /* @__PURE__ */ new Map();\n for (const pair of cookie.split(/; */)) {\n if (!pair)\n continue;\n const splitAt = pair.indexOf(\"=\");\n if (splitAt === -1) {\n map.set(pair, \"true\");\n continue;\n }\n const [key, value] = [pair.slice(0, splitAt), pair.slice(splitAt + 1)];\n try {\n map.set(key, decodeURIComponent(value != null ? value : \"true\"));\n } catch {\n }\n }\n return map;\n}\nfunction parseSetCookie(setCookie) {\n if (!setCookie) {\n return void 0;\n }\n const [[name, value], ...attributes] = parseCookie(setCookie);\n const {\n domain,\n expires,\n httponly,\n maxage,\n path,\n samesite,\n secure,\n partitioned,\n priority\n } = Object.fromEntries(\n attributes.map(([key, value2]) => [\n key.toLowerCase().replace(/-/g, \"\"),\n value2\n ])\n );\n const cookie = {\n name,\n value: decodeURIComponent(value),\n domain,\n ...expires && { expires: new Date(expires) },\n ...httponly && { httpOnly: true },\n ...typeof maxage === \"string\" && { maxAge: Number(maxage) },\n path,\n ...samesite && { sameSite: parseSameSite(samesite) },\n ...secure && { secure: true },\n ...priority && { priority: parsePriority(priority) },\n ...partitioned && { partitioned: true }\n };\n return compact(cookie);\n}\nfunction compact(t) {\n const newT = {};\n for (const key in t) {\n if (t[key]) {\n newT[key] = t[key];\n }\n }\n return newT;\n}\nvar SAME_SITE = [\"strict\", \"lax\", \"none\"];\nfunction parseSameSite(string) {\n string = string.toLowerCase();\n return SAME_SITE.includes(string) ? string : void 0;\n}\nvar PRIORITY = [\"low\", \"medium\", \"high\"];\nfunction parsePriority(string) {\n string = string.toLowerCase();\n return PRIORITY.includes(string) ? string : void 0;\n}\nfunction splitCookiesString(cookiesString) {\n if (!cookiesString)\n return [];\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n function skipWhitespace() {\n while (pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))) {\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n while (pos < cookiesString.length) {\n start = pos;\n cookiesSeparatorFound = false;\n while (skipWhitespace()) {\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n lastComma = pos;\n pos += 1;\n skipWhitespace();\n nextStart = pos;\n while (pos < cookiesString.length && notSpecialChar()) {\n pos += 1;\n }\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n cookiesSeparatorFound = true;\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n return cookiesStrings;\n}\n\n// src/request-cookies.ts\nvar RequestCookies = class {\n constructor(requestHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n this._headers = requestHeaders;\n const header = requestHeaders.get(\"cookie\");\n if (header) {\n const parsed = parseCookie(header);\n for (const [name, value] of parsed) {\n this._parsed.set(name, { name, value });\n }\n }\n }\n [Symbol.iterator]() {\n return this._parsed[Symbol.iterator]();\n }\n /**\n * The amount of cookies received from the client\n */\n get size() {\n return this._parsed.size;\n }\n get(...args) {\n const name = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(name);\n }\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed);\n if (!args.length) {\n return all.map(([_, value]) => value);\n }\n const name = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter(([n]) => n === name).map(([_, value]) => value);\n }\n has(name) {\n return this._parsed.has(name);\n }\n set(...args) {\n const [name, value] = args.length === 1 ? [args[0].name, args[0].value] : args;\n const map = this._parsed;\n map.set(name, { name, value });\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value2]) => stringifyCookie(value2)).join(\"; \")\n );\n return this;\n }\n /**\n * Delete the cookies matching the passed name or names in the request.\n */\n delete(names) {\n const map = this._parsed;\n const result = !Array.isArray(names) ? map.delete(names) : names.map((name) => map.delete(name));\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value]) => stringifyCookie(value)).join(\"; \")\n );\n return result;\n }\n /**\n * Delete all the cookies in the cookies in the request.\n */\n clear() {\n this.delete(Array.from(this._parsed.keys()));\n return this;\n }\n /**\n * Format the cookies in the request as a string for logging\n */\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map((v) => `${v.name}=${encodeURIComponent(v.value)}`).join(\"; \");\n }\n};\n\n// src/response-cookies.ts\nvar ResponseCookies = class {\n constructor(responseHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n var _a, _b, _c;\n this._headers = responseHeaders;\n const setCookie = (_c = (_b = (_a = responseHeaders.getSetCookie) == null ? void 0 : _a.call(responseHeaders)) != null ? _b : responseHeaders.get(\"set-cookie\")) != null ? _c : [];\n const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie);\n for (const cookieString of cookieStrings) {\n const parsed = parseSetCookie(cookieString);\n if (parsed)\n this._parsed.set(parsed.name, parsed);\n }\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.\n */\n get(...args) {\n const key = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(key);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.\n */\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed.values());\n if (!args.length) {\n return all;\n }\n const key = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter((c) => c.name === key);\n }\n has(name) {\n return this._parsed.has(name);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.\n */\n set(...args) {\n const [name, value, cookie] = args.length === 1 ? [args[0].name, args[0].value, args[0]] : args;\n const map = this._parsed;\n map.set(name, normalizeCookie({ name, value, ...cookie }));\n replace(map, this._headers);\n return this;\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.\n */\n delete(...args) {\n const [name, options] = typeof args[0] === \"string\" ? [args[0]] : [args[0].name, args[0]];\n return this.set({ ...options, name, value: \"\", expires: /* @__PURE__ */ new Date(0) });\n }\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map(stringifyCookie).join(\"; \");\n }\n};\nfunction replace(bag, headers) {\n headers.delete(\"set-cookie\");\n for (const [, value] of bag) {\n const serialized = stringifyCookie(value);\n headers.append(\"set-cookie\", serialized);\n }\n}\nfunction normalizeCookie(cookie = { name: \"\", value: \"\" }) {\n if (typeof cookie.expires === \"number\") {\n cookie.expires = new Date(cookie.expires);\n }\n if (cookie.maxAge) {\n cookie.expires = new Date(Date.now() + cookie.maxAge * 1e3);\n }\n if (cookie.path === null || cookie.path === void 0) {\n cookie.path = \"/\";\n }\n return cookie;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n RequestCookies,\n ResponseCookies,\n parseCookie,\n parseSetCookie,\n stringifyCookie\n});\n","export {\n RequestCookies,\n ResponseCookies,\n stringifyCookie,\n} from 'next/dist/compiled/@edge-runtime/cookies'\n","import { RequestCookies } from '../cookies'\n\nimport { ResponseCookies } from '../cookies'\nimport { ReflectAdapter } from './reflect'\nimport { workAsyncStorage } from '../../../app-render/work-async-storage.external'\nimport type { RequestStore } from '../../../app-render/work-unit-async-storage.external'\nimport { ActionDidRevalidateStaticAndDynamic } from '../../../../shared/lib/action-revalidation-kind'\n\n/**\n * @internal\n */\nexport class ReadonlyRequestCookiesError extends Error {\n constructor() {\n super(\n 'Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'\n )\n }\n\n public static callable() {\n throw new ReadonlyRequestCookiesError()\n }\n}\n\n// We use this to type some APIs but we don't construct instances directly\nexport type { ResponseCookies }\n\n// The `cookies()` API is a mix of request and response cookies. For `.get()` methods,\n// we want to return the request cookie if it exists. For mutative methods like `.set()`,\n// we want to return the response cookie.\nexport type ReadonlyRequestCookies = Omit<\n RequestCookies,\n 'set' | 'clear' | 'delete'\n> &\n Pick<ResponseCookies, 'set' | 'delete'>\n\nexport class RequestCookiesAdapter {\n public static seal(cookies: RequestCookies): ReadonlyRequestCookies {\n return new Proxy(cookies as any, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'clear':\n case 'delete':\n case 'set':\n return ReadonlyRequestCookiesError.callable\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n }\n}\n\nconst SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies')\n\nexport function getModifiedCookieValues(\n cookies: ResponseCookies\n): ResponseCookie[] {\n const modified: ResponseCookie[] | undefined = (cookies as unknown as any)[\n SYMBOL_MODIFY_COOKIE_VALUES\n ]\n if (!modified || !Array.isArray(modified) || modified.length === 0) {\n return []\n }\n\n return modified\n}\n\ntype SetCookieArgs =\n | [key: string, value: string, cookie?: Partial<ResponseCookie>]\n | [options: ResponseCookie]\n\nexport function appendMutableCookies(\n headers: Headers,\n mutableCookies: ResponseCookies\n): boolean {\n const modifiedCookieValues = getModifiedCookieValues(mutableCookies)\n if (modifiedCookieValues.length === 0) {\n return false\n }\n\n // Return a new response that extends the response with\n // the modified cookies as fallbacks. `res` cookies\n // will still take precedence.\n const resCookies = new ResponseCookies(headers)\n const returnedCookies = resCookies.getAll()\n\n // Set the modified cookies as fallbacks.\n for (const cookie of modifiedCookieValues) {\n resCookies.set(cookie)\n }\n\n // Set the original cookies as the final values.\n for (const cookie of returnedCookies) {\n resCookies.set(cookie)\n }\n\n return true\n}\n\ntype ResponseCookie = NonNullable<\n ReturnType<InstanceType<typeof ResponseCookies>['get']>\n>\n\nexport class MutableRequestCookiesAdapter {\n public static wrap(\n cookies: RequestCookies,\n onUpdateCookies?: (cookies: string[]) => void\n ): ResponseCookies {\n const responseCookies = new ResponseCookies(new Headers())\n for (const cookie of cookies.getAll()) {\n responseCookies.set(cookie)\n }\n\n let modifiedValues: ResponseCookie[] = []\n const modifiedCookies = new Set<string>()\n const updateResponseCookies = () => {\n // TODO-APP: change method of getting workStore\n const workStore = workAsyncStorage.getStore()\n if (workStore) {\n workStore.pathWasRevalidated = ActionDidRevalidateStaticAndDynamic\n }\n\n const allCookies = responseCookies.getAll()\n modifiedValues = allCookies.filter((c) => modifiedCookies.has(c.name))\n if (onUpdateCookies) {\n const serializedCookies: string[] = []\n for (const cookie of modifiedValues) {\n const tempCookies = new ResponseCookies(new Headers())\n tempCookies.set(cookie)\n serializedCookies.push(tempCookies.toString())\n }\n\n onUpdateCookies(serializedCookies)\n }\n }\n\n const wrappedCookies = new Proxy(responseCookies, {\n get(target, prop, receiver) {\n switch (prop) {\n // A special symbol to get the modified cookie values\n case SYMBOL_MODIFY_COOKIE_VALUES:\n return modifiedValues\n\n // TODO: Throw error if trying to set a cookie after the response\n // headers have been set.\n case 'delete':\n return function (...args: [string] | [ResponseCookie]) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.delete(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.set(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n\n return wrappedCookies\n }\n}\n\nexport function createCookiesWithMutableAccessCheck(\n requestStore: RequestStore\n): ResponseCookies {\n const wrappedCookies = new Proxy(requestStore.mutableCookies, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'delete':\n return function (...args: [string] | [ResponseCookie]) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().delete')\n target.delete(...args)\n return wrappedCookies\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().set')\n target.set(...args)\n return wrappedCookies\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n return wrappedCookies\n}\n\nexport function areCookiesMutableInCurrentPhase(requestStore: RequestStore) {\n return requestStore.phase === 'action'\n}\n\n/** Ensure that cookies() starts throwing on mutation\n * if we changed phases and can no longer mutate.\n *\n * This can happen when going:\n * 'render' -> 'after'\n * 'action' -> 'render'\n * */\nfunction ensureCookiesAreStillMutable(\n requestStore: RequestStore,\n _callingExpression: string\n) {\n if (!areCookiesMutableInCurrentPhase(requestStore)) {\n // TODO: maybe we can give a more precise error message based on callingExpression?\n throw new ReadonlyRequestCookiesError()\n }\n}\n\nexport function responseCookiesToRequestCookies(\n responseCookies: ResponseCookies\n): RequestCookies {\n const requestCookies = new RequestCookies(new Headers())\n for (const cookie of responseCookies.getAll()) {\n requestCookies.set(cookie)\n }\n return requestCookies\n}\n","import type { IncomingHttpHeaders } from 'http'\n\nimport { ReflectAdapter } from './reflect'\n\n/**\n * @internal\n */\nexport class ReadonlyHeadersError extends Error {\n constructor() {\n super(\n 'Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'\n )\n }\n\n public static callable() {\n throw new ReadonlyHeadersError()\n }\n}\n\nexport type ReadonlyHeaders = Headers & {\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n append(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n set(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n delete(...args: any[]): void\n}\nexport class HeadersAdapter extends Headers {\n private readonly headers: IncomingHttpHeaders\n\n constructor(headers: IncomingHttpHeaders) {\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super()\n\n this.headers = new Proxy(headers, {\n get(target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return\n\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'symbol') {\n return ReflectAdapter.set(target, prop, value, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.has(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false\n\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original)\n },\n deleteProperty(target, prop) {\n if (typeof prop === 'symbol')\n return ReflectAdapter.deleteProperty(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true\n\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original)\n },\n })\n }\n\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n */\n public static seal(headers: Headers): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'append':\n case 'delete':\n case 'set':\n return ReadonlyHeadersError.callable\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n }\n\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */\n private merge(value: string | string[]): string {\n if (Array.isArray(value)) return value.join(', ')\n\n return value\n }\n\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */\n public static from(headers: IncomingHttpHeaders | Headers): Headers {\n if (headers instanceof Headers) return headers\n\n return new HeadersAdapter(headers)\n }\n\n public append(name: string, value: string): void {\n const existing = this.headers[name]\n if (typeof existing === 'string') {\n this.headers[name] = [existing, value]\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n this.headers[name] = value\n }\n }\n\n public delete(name: string): void {\n delete this.headers[name]\n }\n\n public get(name: string): string | null {\n const value = this.headers[name]\n if (typeof value !== 'undefined') return this.merge(value)\n\n return null\n }\n\n public has(name: string): boolean {\n return typeof this.headers[name] !== 'undefined'\n }\n\n public set(name: string, value: string): void {\n this.headers[name] = value\n }\n\n public forEach(\n callbackfn: (value: string, name: string, parent: Headers) => void,\n thisArg?: any\n ): void {\n for (const [name, value] of this.entries()) {\n callbackfn.call(thisArg, value, name, this)\n }\n }\n\n public *entries(): HeadersIterator<[string, string]> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name) as string\n\n yield [name, value] as [string, string]\n }\n }\n\n public *keys(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n yield name\n }\n }\n\n public *values(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key) as string\n\n yield value\n }\n }\n\n public [Symbol.iterator](): HeadersIterator<[string, string]> {\n return this.entries()\n }\n}\n","import { INTERCEPTION_ROUTE_MARKERS } from './interception-routes'\nimport type { DynamicParamTypes } from '../../app-router-types'\n\nexport type SegmentParam = {\n paramName: string\n paramType: DynamicParamTypes\n}\n\n/**\n * Parse dynamic route segment to type of parameter\n */\nexport function getSegmentParam(segment: string): SegmentParam | null {\n const interceptionMarker = INTERCEPTION_ROUTE_MARKERS.find((marker) =>\n segment.startsWith(marker)\n )\n\n // if an interception marker is part of the path segment, we need to jump ahead\n // to the relevant portion for param parsing\n if (interceptionMarker) {\n segment = segment.slice(interceptionMarker.length)\n }\n\n if (segment.startsWith('[[...') && segment.endsWith(']]')) {\n return {\n // TODO-APP: Optional catchall does not currently work with parallel routes,\n // so for now aren't handling a potential interception marker.\n paramType: 'optional-catchall',\n paramName: segment.slice(5, -2),\n }\n }\n\n if (segment.startsWith('[...') && segment.endsWith(']')) {\n return {\n paramType: interceptionMarker\n ? `catchall-intercepted-${interceptionMarker}`\n : 'catchall',\n paramName: segment.slice(4, -1),\n }\n }\n\n if (segment.startsWith('[') && segment.endsWith(']')) {\n return {\n paramType: interceptionMarker\n ? `dynamic-intercepted-${interceptionMarker}`\n : 'dynamic',\n paramName: segment.slice(1, -1),\n }\n }\n\n return null\n}\n\nexport function isCatchAll(\n type: DynamicParamTypes\n): type is\n | 'catchall'\n | 'catchall-intercepted-(..)(..)'\n | 'catchall-intercepted-(.)'\n | 'catchall-intercepted-(..)'\n | 'catchall-intercepted-(...)'\n | 'optional-catchall' {\n return (\n type === 'catchall' ||\n type === 'catchall-intercepted-(..)(..)' ||\n type === 'catchall-intercepted-(.)' ||\n type === 'catchall-intercepted-(..)' ||\n type === 'catchall-intercepted-(...)' ||\n type === 'optional-catchall'\n )\n}\n\nexport function getParamProperties(paramType: DynamicParamTypes): {\n repeat: boolean\n optional: boolean\n} {\n let repeat = false\n let optional = false\n\n switch (paramType) {\n case 'catchall':\n case 'catchall-intercepted-(..)(..)':\n case 'catchall-intercepted-(.)':\n case 'catchall-intercepted-(..)':\n case 'catchall-intercepted-(...)':\n repeat = true\n break\n case 'optional-catchall':\n repeat = true\n optional = true\n break\n case 'dynamic':\n case 'dynamic-intercepted-(..)(..)':\n case 'dynamic-intercepted-(.)':\n case 'dynamic-intercepted-(..)':\n case 'dynamic-intercepted-(...)':\n break\n default:\n paramType satisfies never\n }\n\n return { repeat, optional }\n}\n","import type { HtmlProps } from './html-context.shared-runtime'\nimport type { ComponentType, JSX } from 'react'\nimport type { DomainLocale } from '../../server/config'\nimport type { Env } from '@next/env'\nimport type { IncomingMessage, ServerResponse } from 'http'\nimport type { NextRouter } from './router/router'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { PreviewData } from '../../types'\nimport type { COMPILER_NAMES } from './constants'\nimport type fs from 'fs'\n\nexport type NextComponentType<\n Context extends BaseContext = NextPageContext,\n InitialProps = {},\n Props = {},\n> = ComponentType<Props> & {\n /**\n * Used for initial page load data population. Data returned from `getInitialProps` is serialized when server rendered.\n * Make sure to return plain `Object` without using `Date`, `Map`, `Set`.\n * @param context Context of `page`\n */\n getInitialProps?(context: Context): InitialProps | Promise<InitialProps>\n}\n\nexport type DocumentType = NextComponentType<\n DocumentContext,\n DocumentInitialProps,\n DocumentProps\n>\n\nexport type AppType<P = {}> = NextComponentType<\n AppContextType,\n P,\n AppPropsType<any, P>\n>\n\nexport type AppTreeType = ComponentType<\n AppInitialProps & { [name: string]: any }\n>\n\n/**\n * Web vitals provided to _app.reportWebVitals by Core Web Vitals plugin developed by Google Chrome team.\n * https://nextjs.org/blog/next-9-4#integrated-web-vitals-reporting\n */\nexport const WEB_VITALS = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'] as const\nexport type NextWebVitalsMetric = {\n id: string\n startTime: number\n value: number\n attribution?: { [key: string]: unknown }\n} & (\n | {\n label: 'web-vital'\n name: (typeof WEB_VITALS)[number]\n }\n | {\n label: 'custom'\n name:\n | 'Next.js-hydration'\n | 'Next.js-route-change-to-render'\n | 'Next.js-render'\n }\n)\n\nexport type Enhancer<C> = (Component: C) => C\n\nexport type ComponentsEnhancer =\n | {\n enhanceApp?: Enhancer<AppType>\n enhanceComponent?: Enhancer<NextComponentType>\n }\n | Enhancer<NextComponentType>\n\nexport type RenderPageResult = {\n html: string\n head?: Array<JSX.Element | null>\n}\n\nexport type RenderPage = (\n options?: ComponentsEnhancer\n) => DocumentInitialProps | Promise<DocumentInitialProps>\n\nexport type BaseContext = {\n res?: ServerResponse\n [k: string]: any\n}\n\nexport type NEXT_DATA = {\n props: Record<string, any>\n page: string\n query: ParsedUrlQuery\n buildId: string\n assetPrefix?: string\n nextExport?: boolean\n autoExport?: boolean\n isFallback?: boolean\n isExperimentalCompile?: boolean\n dynamicIds?: (string | number)[]\n err?: Error & {\n statusCode?: number\n source?: typeof COMPILER_NAMES.server | typeof COMPILER_NAMES.edgeServer\n }\n gsp?: boolean\n gssp?: boolean\n customServer?: boolean\n gip?: boolean\n appGip?: boolean\n locale?: string\n locales?: readonly string[]\n defaultLocale?: string\n domainLocales?: readonly DomainLocale[]\n scriptLoader?: any[]\n isPreview?: boolean\n notFoundSrcPage?: string\n}\n\n/**\n * `Next` context\n */\nexport interface NextPageContext {\n /**\n * Error object if encountered during rendering\n */\n err?: (Error & { statusCode?: number }) | null\n /**\n * `HTTP` request object.\n */\n req?: IncomingMessage\n /**\n * `HTTP` response object.\n */\n res?: ServerResponse\n /**\n * Path section of `URL`.\n */\n pathname: string\n /**\n * Query string section of `URL` parsed as an object.\n */\n query: ParsedUrlQuery\n /**\n * `String` of the actual path including query.\n */\n asPath?: string\n /**\n * The currently active locale\n */\n locale?: string\n /**\n * All configured locales\n */\n locales?: readonly string[]\n /**\n * The configured default locale\n */\n defaultLocale?: string\n /**\n * `Component` the tree of the App to use if needing to render separately\n */\n AppTree: AppTreeType\n}\n\nexport type AppContextType<Router extends NextRouter = NextRouter> = {\n Component: NextComponentType<NextPageContext>\n AppTree: AppTreeType\n ctx: NextPageContext\n router: Router\n}\n\nexport type AppInitialProps<PageProps = any> = {\n pageProps: PageProps\n}\n\nexport type AppPropsType<\n Router extends NextRouter = NextRouter,\n PageProps = {},\n> = AppInitialProps<PageProps> & {\n Component: NextComponentType<NextPageContext, any, any>\n router: Router\n __N_SSG?: boolean\n __N_SSP?: boolean\n}\n\nexport type DocumentContext = NextPageContext & {\n renderPage: RenderPage\n defaultGetInitialProps(\n ctx: DocumentContext,\n options?: { nonce?: string }\n ): Promise<DocumentInitialProps>\n}\n\nexport type DocumentInitialProps = RenderPageResult & {\n styles?: React.ReactElement[] | Iterable<React.ReactNode> | JSX.Element\n}\n\nexport type DocumentProps = DocumentInitialProps & HtmlProps\n\n/**\n * Next `API` route request\n */\nexport interface NextApiRequest extends IncomingMessage {\n /**\n * Object of `query` values from url\n */\n query: Partial<{\n [key: string]: string | string[]\n }>\n /**\n * Object of `cookies` from header\n */\n cookies: Partial<{\n [key: string]: string\n }>\n\n body: any\n\n env: Env\n\n draftMode?: boolean\n\n preview?: boolean\n /**\n * Preview data set on the request, if any\n * */\n previewData?: PreviewData\n}\n\n/**\n * Send body of response\n */\ntype Send<T> = (body: T) => void\n\n/**\n * Next `API` route response\n */\nexport type NextApiResponse<Data = any> = ServerResponse & {\n /**\n * Send data `any` data in response\n */\n send: Send<Data>\n /**\n * Send data `json` data in response\n */\n json: Send<Data>\n status: (statusCode: number) => NextApiResponse<Data>\n redirect(url: string): NextApiResponse<Data>\n redirect(status: number, url: string): NextApiResponse<Data>\n\n /**\n * Set draft mode\n */\n setDraftMode: (options: { enable: boolean }) => NextApiResponse<Data>\n\n /**\n * Set preview data for Next.js' prerender mode\n */\n setPreviewData: (\n data: object | string,\n options?: {\n /**\n * Specifies the number (in seconds) for the preview session to last for.\n * The given number will be converted to an integer by rounding down.\n * By default, no maximum age is set and the preview session finishes\n * when the client shuts down (browser is closed).\n */\n maxAge?: number\n /**\n * Specifies the path for the preview session to work under. By default,\n * the path is considered the \"default path\", i.e., any pages under \"/\".\n */\n path?: string\n }\n ) => NextApiResponse<Data>\n\n /**\n * Clear preview data for Next.js' prerender mode\n */\n clearPreviewData: (options?: { path?: string }) => NextApiResponse<Data>\n\n /**\n * Revalidate a specific page and regenerate it using On-Demand Incremental\n * Static Regeneration.\n * The path should be an actual path, not a rewritten path. E.g. for\n * \"/blog/[slug]\" this should be \"/blog/post-1\".\n * @link https://nextjs.org/docs/app/building-your-application/data-fetching/incremental-static-regeneration#on-demand-revalidation-with-revalidatepath\n */\n revalidate: (\n urlPath: string,\n opts?: {\n unstable_onlyGenerated?: boolean\n }\n ) => Promise<void>\n}\n\n/**\n * Next `API` route handler\n */\nexport type NextApiHandler<T = any> = (\n req: NextApiRequest,\n res: NextApiResponse<T>\n) => unknown | Promise<unknown>\n\n/**\n * Utils\n */\nexport function execOnce<T extends (...args: any[]) => ReturnType<T>>(\n fn: T\n): T {\n let used = false\n let result: ReturnType<T>\n\n return ((...args: any[]) => {\n if (!used) {\n used = true\n result = fn(...args)\n }\n return result\n }) as T\n}\n\n// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1\n// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\nconst ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\\d+\\-.]*?:/\nexport const isAbsoluteUrl = (url: string) => ABSOLUTE_URL_REGEX.test(url)\n\nexport function getLocationOrigin() {\n const { protocol, hostname, port } = window.location\n return `${protocol}//${hostname}${port ? ':' + port : ''}`\n}\n\nexport function getURL() {\n const { href } = window.location\n const origin = getLocationOrigin()\n return href.substring(origin.length)\n}\n\nexport function getDisplayName<P>(Component: ComponentType<P>) {\n return typeof Component === 'string'\n ? Component\n : Component.displayName || Component.name || 'Unknown'\n}\n\nexport function isResSent(res: ServerResponse) {\n return res.finished || res.headersSent\n}\n\nexport function normalizeRepeatedSlashes(url: string) {\n const urlParts = url.split('?')\n const urlNoQuery = urlParts[0]\n\n return (\n urlNoQuery\n // first we replace any non-encoded backslashes with forward\n // then normalize repeated forward slashes\n .replace(/\\\\/g, '/')\n .replace(/\\/\\/+/g, '/') +\n (urlParts[1] ? `?${urlParts.slice(1).join('?')}` : '')\n )\n}\n\nexport async function loadGetInitialProps<\n C extends BaseContext,\n IP = {},\n P = {},\n>(App: NextComponentType<C, IP, P>, ctx: C): Promise<IP> {\n if (process.env.NODE_ENV !== 'production') {\n if (App.prototype?.getInitialProps) {\n const message = `\"${getDisplayName(\n App\n )}.getInitialProps()\" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.`\n throw new Error(message)\n }\n }\n // when called from _app `ctx` is nested in `ctx`\n const res = ctx.res || (ctx.ctx && ctx.ctx.res)\n\n if (!App.getInitialProps) {\n if (ctx.ctx && ctx.Component) {\n // @ts-ignore pageProps default\n return {\n pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx),\n }\n }\n return {} as IP\n }\n\n const props = await App.getInitialProps(ctx)\n\n if (res && isResSent(res)) {\n return props\n }\n\n if (!props) {\n const message = `\"${getDisplayName(\n App\n )}.getInitialProps()\" should resolve to an object. But found \"${props}\" instead.`\n throw new Error(message)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (Object.keys(props).length === 0 && !ctx.ctx) {\n console.warn(\n `${getDisplayName(\n App\n )} returned an empty object from \\`getInitialProps\\`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps`\n )\n }\n }\n\n return props\n}\n\nexport const SP = typeof performance !== 'undefined'\nexport const ST =\n SP &&\n (['mark', 'measure', 'getEntriesByName'] as const).every(\n (method) => typeof performance[method] === 'function'\n )\n\nexport class DecodeError extends Error {}\nexport class NormalizeError extends Error {}\nexport class PageNotFoundError extends Error {\n code: string\n\n constructor(page: string) {\n super()\n this.code = 'ENOENT'\n this.name = 'PageNotFoundError'\n this.message = `Cannot find module for page: ${page}`\n }\n}\n\nexport class MissingStaticPage extends Error {\n constructor(page: string, message: string) {\n super()\n this.message = `Failed to load static file for page: ${page} ${message}`\n }\n}\n\nexport class MiddlewareNotFoundError extends Error {\n code: string\n constructor() {\n super()\n this.code = 'ENOENT'\n this.message = `Cannot find the middleware module`\n }\n}\n\nexport interface CacheFs {\n existsSync: typeof fs.existsSync\n readFile: typeof fs.promises.readFile\n readFileSync: typeof fs.readFileSync\n writeFile(f: string, d: any): Promise<void>\n mkdir(dir: string): Promise<void | string>\n stat(f: string): Promise<{ mtime: Date }>\n}\n\nexport function stringifyError(error: Error) {\n return JSON.stringify({ message: error.message, stack: error.stack })\n}\n","import type { ParsedUrlQuery } from 'querystring'\n\nexport function searchParamsToUrlQuery(\n searchParams: URLSearchParams\n): ParsedUrlQuery {\n const query: ParsedUrlQuery = {}\n for (const [key, value] of searchParams.entries()) {\n const existing = query[key]\n if (typeof existing === 'undefined') {\n query[key] = value\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n query[key] = [existing, value]\n }\n }\n return query\n}\n\nfunction stringifyUrlQueryParam(param: unknown): string {\n if (typeof param === 'string') {\n return param\n }\n\n if (\n (typeof param === 'number' && !isNaN(param)) ||\n typeof param === 'boolean'\n ) {\n return String(param)\n } else {\n return ''\n }\n}\n\nexport function urlQueryToSearchParams(query: ParsedUrlQuery): URLSearchParams {\n const searchParams = new URLSearchParams()\n for (const [key, value] of Object.entries(query)) {\n if (Array.isArray(value)) {\n for (const item of value) {\n searchParams.append(key, stringifyUrlQueryParam(item))\n }\n } else {\n searchParams.set(key, stringifyUrlQueryParam(value))\n }\n }\n return searchParams\n}\n\nexport function assign(\n target: URLSearchParams,\n ...searchParamsList: URLSearchParams[]\n): URLSearchParams {\n for (const searchParams of searchParamsList) {\n for (const key of searchParams.keys()) {\n target.delete(key)\n }\n\n for (const [key, value] of searchParams.entries()) {\n target.append(key, value)\n }\n }\n\n return target\n}\n","import type { ParsedUrlQuery } from 'querystring'\nimport { getLocationOrigin } from '../../utils'\nimport { searchParamsToUrlQuery } from './querystring'\n\nexport interface ParsedRelativeUrl {\n auth: string | null\n hash: string\n host: string | null\n hostname: string | null\n href: string\n pathname: string\n port: string | null\n protocol: string | null\n query: ParsedUrlQuery\n search: string\n slashes: null\n}\n\n/**\n * Parses path-relative urls (e.g. `/hello/world?foo=bar`). If url isn't path-relative\n * (e.g. `./hello`) then at least base must be.\n * Absolute urls are rejected with one exception, in the browser, absolute urls that are on\n * the current origin will be parsed as relative\n */\nexport function parseRelativeUrl(\n url: string,\n base?: string,\n parseQuery?: true\n): ParsedRelativeUrl\nexport function parseRelativeUrl(\n url: string,\n base: string | undefined,\n parseQuery: false\n): Omit<ParsedRelativeUrl, 'query'>\nexport function parseRelativeUrl(\n url: string,\n base?: string,\n parseQuery = true\n): ParsedRelativeUrl | Omit<ParsedRelativeUrl, 'query'> {\n const globalBase = new URL(\n typeof window === 'undefined' ? 'http://n' : getLocationOrigin()\n )\n\n const resolvedBase = base\n ? new URL(base, globalBase)\n : url.startsWith('.')\n ? new URL(\n typeof window === 'undefined' ? 'http://n' : window.location.href\n )\n : globalBase\n\n const { pathname, searchParams, search, hash, href, origin } = url.startsWith(\n '/'\n )\n ? // 'http://localhost:3000///' would be received as '///' in Node.js' IncomingMessage\n // See https://nodejs.org/api/http.html#messageurl\n // Not using `origin` to support other protocols\n new URL(`${resolvedBase.protocol}//${resolvedBase.host}${url}`)\n : new URL(url, resolvedBase)\n\n if (origin !== globalBase.origin) {\n throw new Error(`invariant: invalid relative URL, router received ${url}`)\n }\n\n return {\n auth: null,\n host: null,\n hostname: null,\n pathname,\n port: null,\n protocol: null,\n query: parseQuery ? searchParamsToUrlQuery(searchParams) : undefined,\n search,\n hash,\n href: href.slice(origin.length),\n // We don't know for relative URLs at this point since we set a custom, internal\n // base that isn't surfaced to users.\n slashes: null,\n }\n}\n","const INSTANT_VALIDATION_ERROR_DIGEST = 'INSTANT_VALIDATION_ERROR'\n\n/** Check if an error is an exhaustive samples validation error (by digest). */\nexport function isInstantValidationError(\n err: unknown\n): err is InstantValidationError {\n return !!(\n err &&\n typeof err === 'object' &&\n err instanceof Error &&\n (err as any).digest === INSTANT_VALIDATION_ERROR_DIGEST\n )\n}\n\nexport class InstantValidationError extends Error {\n digest = INSTANT_VALIDATION_ERROR_DIGEST\n}\n","import type { InstantSample } from '../../../build/segment-config/app/app-segment-config'\nimport type { ReadonlyRequestCookies } from '../../web/spec-extension/adapters/request-cookies'\nimport type { ReadonlyHeaders } from '../../web/spec-extension/adapters/headers'\nimport type { DraftModeProvider } from '../../async-storage/draft-mode-provider'\nimport type { Params } from '../../request/params'\n\nimport { RequestCookies } from '../../web/spec-extension/cookies'\nimport { RequestCookiesAdapter } from '../../web/spec-extension/adapters/request-cookies'\nimport { HeadersAdapter } from '../../web/spec-extension/adapters/headers'\nimport type { SearchParams } from '../../request/search-params'\nimport { getSegmentParam } from '../../../shared/lib/router/utils/get-segment-param'\nimport { parseRelativeUrl } from '../../../shared/lib/router/utils/parse-relative-url'\nimport { InvariantError } from '../../../shared/lib/invariant-error'\nimport { InstantValidationError } from './instant-validation-error'\nimport { workUnitAsyncStorage } from '../work-unit-async-storage.external'\nimport { wellKnownProperties } from '../../../shared/lib/utils/reflect-utils'\nimport type { WorkStore } from '../work-async-storage.external'\n\nexport type InstantValidationSampleTracking = {\n // TODO(instant-validation-build): track which samples config we used and attribute errors\n missingSampleErrors: InstantValidationError[]\n}\n\nexport function createValidationSampleTracking(): InstantValidationSampleTracking {\n return {\n missingSampleErrors: [],\n }\n}\n\nfunction getExpectedSampleTracking(): InstantValidationSampleTracking {\n let validationSampleTracking: InstantValidationSampleTracking | null = null\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'request':\n case 'validation-client':\n // TODO(instant-validation-build): do we need any special handling for caches?\n validationSampleTracking =\n workUnitStore.validationSampleTracking ?? null\n break\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-legacy':\n case 'prerender-ppr':\n case 'prerender-client':\n case 'prerender':\n case 'prerender-runtime':\n case 'generate-static-params':\n break\n default:\n workUnitStore satisfies never\n }\n }\n if (!validationSampleTracking) {\n throw new InvariantError(\n 'Expected to have a workUnitStore that provides validationSampleTracking'\n )\n }\n return validationSampleTracking\n}\n\nexport function trackMissingSampleError(error: InstantValidationError): void {\n const validationSampleTracking = getExpectedSampleTracking()\n validationSampleTracking.missingSampleErrors.push(error)\n}\n\nexport function trackMissingSampleErrorAndThrow(\n error: InstantValidationError\n): never {\n // TODO(instant-validation-build): this should abort the render\n trackMissingSampleError(error)\n throw error\n}\n\n/**\n * Creates ReadonlyRequestCookies from sample cookie data.\n * Accessing a cookie not declared in the sample will throw an error.\n * Cookies with `value: null` are declared (allowed to access) but return no value.\n */\nexport function createCookiesFromSample(\n sampleCookies: InstantSample['cookies'],\n route: string\n): ReadonlyRequestCookies {\n const declaredNames = new Set<string>()\n\n const cookies = new RequestCookies(new Headers())\n if (sampleCookies) {\n for (const cookie of sampleCookies) {\n declaredNames.add(cookie.name)\n if (cookie.value !== null) {\n cookies.set(cookie.name, cookie.value)\n }\n }\n }\n\n const sealed = RequestCookiesAdapter.seal(cookies)\n\n return new Proxy(sealed, {\n get(target, prop, receiver) {\n if (prop === 'has') {\n const originalMethod = Reflect.get(target, prop, receiver)\n const wrappedMethod: typeof originalMethod = function (name) {\n if (!declaredNames.has(name)) {\n trackMissingSampleErrorAndThrow(\n createMissingCookieSampleError(route, name)\n )\n }\n return originalMethod.call(target, name)\n }\n return wrappedMethod\n }\n if (prop === 'get') {\n const originalMethod = Reflect.get(target, prop, receiver)\n const wrappedMethod: typeof originalMethod = function (nameOrCookie) {\n let name: string\n if (typeof nameOrCookie === 'string') {\n name = nameOrCookie\n } else if (\n nameOrCookie &&\n typeof nameOrCookie === 'object' &&\n typeof nameOrCookie.name === 'string'\n ) {\n name = nameOrCookie.name\n } else {\n // This is an invalid input. Pass it through to the original method so it can error.\n return originalMethod.call(target, nameOrCookie)\n }\n\n if (!declaredNames.has(name)) {\n trackMissingSampleErrorAndThrow(\n createMissingCookieSampleError(route, name)\n )\n }\n return originalMethod.call(target, name)\n }\n return wrappedMethod\n }\n\n // TODO(instant-validation-build): what should getAll do?\n // Maybe we should only allow it if there's an array (possibly empty?)\n\n return Reflect.get(target, prop, receiver)\n },\n })\n}\n\nfunction createMissingCookieSampleError(\n route: string,\n name: string\n): InstantValidationError {\n return new InstantValidationError(\n `Route \"${route}\" accessed cookie \"${name}\" which is not defined in the \\`samples\\` ` +\n `of \\`unstable_instant\\`. Add it to the sample's \\`cookies\\` array, ` +\n `or \\`{ name: \"${name}\", value: null }\\` if it should be absent.`\n )\n}\n\n/**\n * Creates ReadonlyHeaders from sample header data.\n * Accessing a header not declared in the sample will throw an error.\n * Headers with `value: null` are declared (allowed to access) but return null.\n */\nexport function createHeadersFromSample(\n rawSampleHeaders: InstantSample['headers'],\n sampleCookies: InstantSample['cookies'],\n route: string\n): ReadonlyHeaders {\n // If we have cookie samples, add a `cookie` header to match.\n // Accessing it will be implicitly allowed by the proxy --\n // if the user defined some cookies, accessing the \"cookie\" header is also fine.\n const sampleHeaders = rawSampleHeaders ? [...rawSampleHeaders] : []\n if (sampleHeaders.find(([name]) => name.toLowerCase() === 'cookie')) {\n throw new InstantValidationError(\n 'Invalid sample: Defining cookies via a \"cookie\" header is not supported. Use `cookies: [{ name: ..., value: ... }]` instead.'\n )\n }\n if (sampleCookies) {\n const cookieHeaderValue = sampleCookies.toString()\n sampleHeaders.push([\n 'cookie',\n // if the `cookies` samples were empty, or they were all `null`, then we have no cookies,\n // and the header isn't present, but should remains readable, so we set it to null.\n cookieHeaderValue !== '' ? cookieHeaderValue : null,\n ])\n }\n\n const declaredNames = new Set<string>()\n const headersInit: Record<string, string> = {}\n\n for (const [name, value] of sampleHeaders) {\n declaredNames.add(name.toLowerCase())\n if (value !== null) {\n headersInit[name.toLowerCase()] = value\n }\n }\n\n const sealed = HeadersAdapter.seal(HeadersAdapter.from(headersInit))\n\n return new Proxy(sealed, {\n get(target, prop, receiver) {\n if (prop === 'get' || prop === 'has') {\n const originalMethod = Reflect.get(target, prop, receiver)\n const patchedMethod: typeof originalMethod = function (rawName) {\n const name = rawName.toLowerCase()\n if (!declaredNames.has(name)) {\n trackMissingSampleErrorAndThrow(\n new InstantValidationError(\n `Route \"${route}\" accessed header \"${name}\" which is not defined in the \\`samples\\` ` +\n `of \\`unstable_instant\\`. Add it to the sample's \\`headers\\` array, ` +\n `or \\`[\"${name}\", null]\\` if it should be absent.`\n )\n )\n }\n // typescript can't reconcile a union of functions with a union of return types,\n // so we have to cast the original return type away\n return (originalMethod as (...args: any[]) => any).call(target, name)\n }\n return patchedMethod\n }\n return Reflect.get(target, prop, receiver)\n },\n })\n}\n\n/**\n * Creates a DraftModeProvider that always returns isEnabled: false.\n */\nexport function createDraftModeForValidation(): DraftModeProvider {\n // Create a minimal DraftModeProvider-compatible object\n // that always reports draft mode as disabled.\n //\n // private properties that can't be set from outside the class.\n return {\n get isEnabled() {\n return false\n },\n enable() {\n throw new Error(\n 'Draft mode cannot be enabled during build-time instant validation.'\n )\n },\n disable() {\n throw new Error(\n 'Draft mode cannot be disabled during build-time instant validation.'\n )\n },\n } as Partial<DraftModeProvider> as DraftModeProvider\n}\n\n/**\n * Creates params wrapped with an exhaustive proxy.\n * Accessing a param not declared in the sample will throw an error.\n */\nexport function createExhaustiveParamsProxy<TParams extends Params>(\n underlyingParams: TParams,\n declaredParamNames: Set<string>,\n route: string\n): TParams {\n return new Proxy(underlyingParams, {\n get(target, prop, receiver) {\n if (\n typeof prop === 'string' &&\n !wellKnownProperties.has(prop) &&\n // Only error when accessing a param that is part of the route but wasn't provided.\n // accessing properties that aren't expected to be a valid param value is fine.\n prop in underlyingParams &&\n !declaredParamNames.has(prop)\n ) {\n trackMissingSampleErrorAndThrow(\n new InstantValidationError(\n `Route \"${route}\" accessed param \"${prop}\" which is not defined in the \\`samples\\` ` +\n `of \\`unstable_instant\\`. Add it to the sample's \\`params\\` object.`\n )\n )\n }\n return Reflect.get(target, prop, receiver)\n },\n // We don't need to override `has` or `ownKeys`.\n // the shape of the params object is determined by the routing structure\n // and independent of the samples. We only need to instrument accessing the values.\n })\n}\n\n/**\n * Creates searchParams wrapped with an exhaustive proxy.\n * Accessing a searchParam not declared in the sample will throw an error.\n * A searchParam with `value: undefined` means \"declared but absent\" (allowed to access, returns undefined).\n */\nexport function createExhaustiveSearchParamsProxy(\n searchParams: SearchParams,\n declaredSearchParamNames: Set<string>,\n route: string\n): SearchParams {\n return new Proxy(searchParams, {\n get(target, prop, receiver) {\n if (\n typeof prop === 'string' &&\n !wellKnownProperties.has(prop) &&\n !declaredSearchParamNames.has(prop)\n ) {\n trackMissingSampleErrorAndThrow(\n createMissingSearchParamSampleError(route, prop)\n )\n }\n return Reflect.get(target, prop, receiver)\n },\n has(target, prop) {\n if (\n typeof prop === 'string' &&\n !wellKnownProperties.has(prop) &&\n !declaredSearchParamNames.has(prop)\n ) {\n trackMissingSampleErrorAndThrow(\n createMissingSearchParamSampleError(route, prop)\n )\n }\n return Reflect.has(target, prop)\n },\n })\n}\n\n/**\n * Wraps a URLSearchParams (or subclass like ReadonlyURLSearchParams) with an\n * exhaustive proxy. Accessing a search param not declared in the sample via\n * get/getAll/has will throw an error.\n */\nexport function createExhaustiveURLSearchParamsProxy<T extends URLSearchParams>(\n searchParams: T,\n declaredSearchParamNames: Set<string>,\n route: string\n): T {\n return new Proxy(searchParams, {\n get(target, prop, receiver) {\n // Intercept method calls that access specific param names\n if (prop === 'get' || prop === 'getAll' || prop === 'has') {\n const originalMathod = Reflect.get(target, prop, receiver)\n return (name: string) => {\n if (typeof name === 'string' && !declaredSearchParamNames.has(name)) {\n trackMissingSampleErrorAndThrow(\n createMissingSearchParamSampleError(route, name)\n )\n }\n return (originalMathod as (...args: any[]) => any).call(target, name)\n }\n }\n const value = Reflect.get(target, prop, receiver)\n // Prevent `TypeError: Value of \"this\" must be of type URLSearchParams` for methods\n if (typeof value === 'function' && !Object.hasOwn(target, prop)) {\n return value.bind(target)\n }\n return value\n },\n })\n}\n\nfunction createMissingSearchParamSampleError(\n route: string,\n name: string\n): InstantValidationError {\n return new InstantValidationError(\n `Route \"${route}\" accessed searchParam \"${name}\" which is not defined in the \\`samples\\` ` +\n `of \\`unstable_instant\\`. Add it to the sample's \\`searchParams\\` object, ` +\n `or \\`{ \"${name}\": null }\\` if it should be absent.`\n )\n}\n\nexport function createRelativeURLFromSamples(\n route: string,\n sampleParams: InstantSample['params'],\n sampleSearchParams: InstantSample['searchParams']\n) {\n // Build searchParams query object and URL search string from sample\n const pathname = createPathnameFromRouteAndSampleParams(\n route,\n sampleParams ?? {}\n )\n\n let search = ''\n if (sampleSearchParams) {\n const qs = createURLSearchParamsFromSample(sampleSearchParams).toString()\n if (qs) {\n search = '?' + qs\n }\n }\n\n return parseRelativeUrl(pathname + search, undefined, true)\n}\n\nfunction createURLSearchParamsFromSample(\n sampleSearchParams: InstantSample['searchParams']\n) {\n const result = new URLSearchParams()\n if (sampleSearchParams) {\n for (const [key, value] of Object.entries(sampleSearchParams)) {\n if (value === null || value === undefined) continue\n if (Array.isArray(value)) {\n for (const v of value) {\n result.append(key, v)\n }\n } else {\n result.set(key, value)\n }\n }\n }\n return result\n}\n\n/**\n * Substitute sample params into `workStore.route` to create a plausible pathname.\n * TODO(instant-validation-build): this logic is somewhat hacky and likely incomplete,\n * but it should be good enough for some initial testing.\n */\nfunction createPathnameFromRouteAndSampleParams(route: string, params: Params) {\n let interpolatedSegments: string[] = []\n const rawSegments = route.split('/')\n for (const rawSegment of rawSegments) {\n const param = getSegmentParam(rawSegment)\n if (param) {\n switch (param.paramType) {\n case 'catchall':\n case 'optional-catchall': {\n let paramValue = params[param.paramName]\n if (paramValue === undefined) {\n // The value for the param was not provided. `usePathname` will detect this and throw\n // before this can surface to userspace. Use `[...NAME]` as a placeholder for the param value\n // in case it pops up somewhere unexpectedly.\n paramValue = [rawSegment]\n } else if (!Array.isArray(paramValue)) {\n // NOTE: this happens outside of render, so we don't need `trackMissingSampleErrorAndThrow`\n throw new InstantValidationError(\n `Expected sample param value for segment '${rawSegment}' to be an array of strings, got ${typeof paramValue}`\n )\n }\n interpolatedSegments.push(\n ...paramValue.map((v) => encodeURIComponent(v))\n )\n break\n }\n case 'dynamic': {\n let paramValue = params[param.paramName]\n if (paramValue === undefined) {\n // The value for the param was not provided. `usePathname` will detect this and throw\n // before this can surface to userspace. Use `[NAME]` as a placeholder for the param value\n // in case it pops up somewhere unexpectedly.\n paramValue = rawSegment\n } else if (typeof paramValue !== 'string') {\n // NOTE: this happens outside of render, so we don't need `trackMissingSampleErrorAndThrow`\n throw new InstantValidationError(\n `Expected sample param value for segment '${rawSegment}' to be a string, got ${typeof paramValue}`\n )\n }\n interpolatedSegments.push(encodeURIComponent(paramValue))\n break\n }\n case 'catchall-intercepted-(..)(..)':\n case 'catchall-intercepted-(.)':\n case 'catchall-intercepted-(..)':\n case 'catchall-intercepted-(...)':\n case 'dynamic-intercepted-(..)(..)':\n case 'dynamic-intercepted-(.)':\n case 'dynamic-intercepted-(..)':\n case 'dynamic-intercepted-(...)': {\n // TODO(instant-validation-build): i don't know how these are supposed to work, or if we can even get them here\n throw new InvariantError(\n 'Not implemented: Validation of interception routes'\n )\n }\n default: {\n param.paramType satisfies never\n }\n }\n } else {\n interpolatedSegments.push(rawSegment)\n }\n }\n return interpolatedSegments.join('/')\n}\n\nexport function assertRootParamInSamples(\n workStore: WorkStore,\n sampleParams: Params | undefined,\n paramName: string\n) {\n if (sampleParams && paramName in sampleParams) {\n // The param is defined in the samples.\n } else {\n const route = workStore.route\n trackMissingSampleErrorAndThrow(\n new InstantValidationError(\n `Route \"${route}\" accessed root param \"${paramName}\" which is not defined in the \\`samples\\` ` +\n `of \\`unstable_instant\\`. Add it to the sample's \\`params\\` object.`\n )\n )\n }\n}\n","import {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport type { VaryParamsAccumulator } from '../app-render/vary-params'\nimport {\n createVaryingSearchParams,\n getMetadataVaryParamsAccumulator,\n} from '../app-render/vary-params'\n\nimport { ReflectAdapter } from '../web/spec-extension/adapters/reflect'\nimport {\n throwToInterruptStaticGeneration,\n postponeWithTracking,\n annotateDynamicAccess,\n} from '../app-render/dynamic-rendering'\n\nimport {\n workUnitAsyncStorage,\n type PrerenderStoreLegacy,\n type PrerenderStorePPR,\n type PrerenderStoreModern,\n type PrerenderStoreModernRuntime,\n type StaticPrerenderStore,\n throwInvariantForMissingStore,\n type RequestStore,\n type ValidationStoreClient,\n} from '../app-render/work-unit-async-storage.external'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport {\n describeStringPropertyAccess,\n describeHasCheckingStringProperty,\n wellKnownProperties,\n} from '../../shared/lib/utils/reflect-utils'\nimport {\n throwWithStaticGenerationBailoutErrorWithDynamicError,\n throwForSearchParamsAccessInUseCache,\n} from './utils'\nimport { RenderStage } from '../app-render/staged-rendering'\n\nexport type SearchParams = { [key: string]: string | string[] | undefined }\n\nexport function createSearchParamsFromClient(\n underlyingSearchParams: SearchParams\n): Promise<SearchParams> {\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Expected workStore to be initialized')\n }\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createStaticPrerenderSearchParams(workStore, workUnitStore)\n case 'validation-client': {\n return createClientSearchParamsInValidation(\n underlyingSearchParams,\n workStore,\n workUnitStore\n )\n }\n case 'prerender-runtime':\n throw new InvariantError(\n 'createSearchParamsFromClient should not be called in a runtime prerender.'\n )\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n throw new InvariantError(\n 'createSearchParamsFromClient should not be called in cache contexts.'\n )\n case 'generate-static-params':\n throw new InvariantError(\n 'createSearchParamsFromClient should not be called inside generateStaticParams.'\n )\n case 'request':\n // Client searchParams are not runtime prefetchable\n const isRuntimePrefetchable = false\n return createRenderSearchParams(\n underlyingSearchParams,\n workStore,\n workUnitStore,\n isRuntimePrefetchable\n )\n default:\n workUnitStore satisfies never\n }\n }\n throwInvariantForMissingStore()\n}\n\n// generateMetadata always runs in RSC context so it is equivalent to a Server Page Component\nexport function createServerSearchParamsForMetadata(\n underlyingSearchParams: SearchParams,\n isRuntimePrefetchable: boolean\n): Promise<SearchParams> {\n const metadataVaryParamsAccumulator = getMetadataVaryParamsAccumulator()\n return createServerSearchParamsForServerPage(\n underlyingSearchParams,\n metadataVaryParamsAccumulator,\n isRuntimePrefetchable\n )\n}\n\nexport function createServerSearchParamsForServerPage(\n underlyingSearchParams: SearchParams,\n varyParamsAccumulator: VaryParamsAccumulator | null,\n isRuntimePrefetchable: boolean\n): Promise<SearchParams> {\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Expected workStore to be initialized')\n }\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createStaticPrerenderSearchParams(workStore, workUnitStore)\n case 'validation-client':\n throw new InvariantError(\n 'createServerSearchParamsForServerPage should not be called in a client validation.'\n )\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n throw new InvariantError(\n 'createServerSearchParamsForServerPage should not be called in cache contexts.'\n )\n case 'generate-static-params':\n throw new InvariantError(\n 'createServerSearchParamsForServerPage should not be called inside generateStaticParams.'\n )\n case 'prerender-runtime':\n return createRuntimePrerenderSearchParams(\n underlyingSearchParams,\n workUnitStore,\n varyParamsAccumulator,\n isRuntimePrefetchable\n )\n case 'request':\n return createRenderSearchParams(\n underlyingSearchParams,\n workStore,\n workUnitStore,\n isRuntimePrefetchable\n )\n default:\n workUnitStore satisfies never\n }\n }\n throwInvariantForMissingStore()\n}\n\nexport function createPrerenderSearchParamsForClientPage(): Promise<SearchParams> {\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Expected workStore to be initialized')\n }\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // dictionary object.\n return Promise.resolve({})\n }\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n // We're prerendering in a mode that aborts (cacheComponents) and should stall\n // the promise to ensure the RSC side is considered dynamic\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`searchParams`'\n )\n case 'validation-client':\n throw new InvariantError(\n 'createPrerenderSearchParamsForClientPage should not be called in a client validation.'\n )\n case 'prerender-runtime':\n throw new InvariantError(\n 'createPrerenderSearchParamsForClientPage should not be called in a runtime prerender.'\n )\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n throw new InvariantError(\n 'createPrerenderSearchParamsForClientPage should not be called in cache contexts.'\n )\n case 'generate-static-params':\n throw new InvariantError(\n 'createPrerenderSearchParamsForClientPage should not be called inside generateStaticParams.'\n )\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n return Promise.resolve({})\n default:\n workUnitStore satisfies never\n }\n }\n throwInvariantForMissingStore()\n}\n\nfunction createStaticPrerenderSearchParams(\n workStore: WorkStore,\n prerenderStore: StaticPrerenderStore\n): Promise<SearchParams> {\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // dictionary object.\n return Promise.resolve({})\n }\n\n switch (prerenderStore.type) {\n case 'prerender':\n case 'prerender-client':\n // We are in a cacheComponents (PPR or otherwise) prerender\n return makeHangingSearchParams(workStore, prerenderStore)\n case 'prerender-ppr':\n case 'prerender-legacy':\n // We are in a legacy static generation and need to interrupt the\n // prerender when search params are accessed.\n return makeErroringSearchParams(workStore, prerenderStore)\n default:\n return prerenderStore satisfies never\n }\n}\n\nfunction createRuntimePrerenderSearchParams(\n underlyingSearchParams: SearchParams,\n workUnitStore: PrerenderStoreModernRuntime,\n varyParamsAccumulator: VaryParamsAccumulator | null,\n isRuntimePrefetchable: boolean\n): Promise<SearchParams> {\n const underlyingSearchParamsWithVarying =\n varyParamsAccumulator !== null\n ? createVaryingSearchParams(varyParamsAccumulator, underlyingSearchParams)\n : underlyingSearchParams\n\n const result = makeUntrackedSearchParams(underlyingSearchParamsWithVarying)\n const { stagedRendering } = workUnitStore\n if (!stagedRendering) {\n return result\n }\n const stage = isRuntimePrefetchable\n ? RenderStage.EarlyRuntime\n : RenderStage.Runtime\n return stagedRendering.waitForStage(stage).then(() => result)\n}\n\nfunction createRenderSearchParams(\n underlyingSearchParams: SearchParams,\n workStore: WorkStore,\n requestStore: RequestStore,\n isRuntimePrefetchable: boolean\n): Promise<SearchParams> {\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // dictionary object.\n return Promise.resolve({})\n } else {\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedSearchParamsWithDevWarnings(\n underlyingSearchParams,\n workStore,\n requestStore,\n isRuntimePrefetchable\n )\n } else if (requestStore.asyncApiPromises) {\n if (requestStore.validationSamples) {\n const { createExhaustiveSearchParamsProxy } =\n require('../app-render/instant-validation/instant-samples') as typeof import('../app-render/instant-validation/instant-samples')\n const declaredKeys = new Set(\n Object.keys(requestStore.validationSamples.searchParams ?? {})\n )\n underlyingSearchParams = createExhaustiveSearchParamsProxy(\n underlyingSearchParams,\n declaredKeys,\n workStore.route\n )\n }\n\n return (\n isRuntimePrefetchable\n ? requestStore.asyncApiPromises.earlySharedSearchParamsParent\n : requestStore.asyncApiPromises.sharedSearchParamsParent\n ).then(() => underlyingSearchParams)\n } else {\n return makeUntrackedSearchParams(underlyingSearchParams)\n }\n }\n}\n\ninterface CacheLifetime {}\nconst CachedSearchParams = new WeakMap<CacheLifetime, Promise<SearchParams>>()\n\nconst CachedSearchParamsForUseCache = new WeakMap<\n CacheLifetime,\n Promise<SearchParams>\n>()\n\nfunction makeHangingSearchParams(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<SearchParams> {\n const cachedSearchParams = CachedSearchParams.get(prerenderStore)\n if (cachedSearchParams) {\n return cachedSearchParams\n }\n\n const promise = makeHangingPromise<SearchParams>(\n prerenderStore.renderSignal,\n workStore.route,\n '`searchParams`'\n )\n\n const proxiedPromise = new Proxy(promise, {\n get(target, prop, receiver) {\n if (Object.hasOwn(promise, prop)) {\n // The promise has this property directly. we must return it.\n // We know it isn't a dynamic access because it can only be something\n // that was previously written to the promise and thus not an underlying searchParam value\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n switch (prop) {\n case 'then': {\n const expression =\n '`await searchParams`, `searchParams.then`, or similar'\n annotateDynamicAccess(expression, prerenderStore)\n return ReflectAdapter.get(target, prop, receiver)\n }\n case 'status': {\n const expression =\n '`use(searchParams)`, `searchParams.status`, or similar'\n annotateDynamicAccess(expression, prerenderStore)\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n default: {\n return ReflectAdapter.get(target, prop, receiver)\n }\n }\n },\n })\n\n CachedSearchParams.set(prerenderStore, proxiedPromise)\n return proxiedPromise\n}\n\nfunction makeErroringSearchParams(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreLegacy | PrerenderStorePPR\n): Promise<SearchParams> {\n const cachedSearchParams = CachedSearchParams.get(workStore)\n if (cachedSearchParams) {\n return cachedSearchParams\n }\n\n const underlyingSearchParams = {}\n // For search params we don't construct a ReactPromise because we want to interrupt\n // rendering on any property access that was not set from outside and so we only want\n // to have properties like value and status if React sets them.\n const promise = Promise.resolve(underlyingSearchParams)\n\n const proxiedPromise = new Proxy(promise, {\n get(target, prop, receiver) {\n if (Object.hasOwn(promise, prop)) {\n // The promise has this property directly. we must return it.\n // We know it isn't a dynamic access because it can only be something\n // that was previously written to the promise and thus not an underlying searchParam value\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n if (typeof prop === 'string' && prop === 'then') {\n const expression =\n '`await searchParams`, `searchParams.then`, or similar'\n if (workStore.dynamicShouldError) {\n throwWithStaticGenerationBailoutErrorWithDynamicError(\n workStore.route,\n expression\n )\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no cacheComponents)\n postponeWithTracking(\n workStore.route,\n expression,\n prerenderStore.dynamicTracking\n )\n } else {\n // Legacy Prerender\n throwToInterruptStaticGeneration(\n expression,\n workStore,\n prerenderStore\n )\n }\n }\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n\n CachedSearchParams.set(workStore, proxiedPromise)\n return proxiedPromise\n}\n\n/**\n * This is a variation of `makeErroringSearchParams` that always throws an\n * error on access, because accessing searchParams inside of `\"use cache\"` is\n * not allowed.\n */\nexport function makeErroringSearchParamsForUseCache(): Promise<SearchParams> {\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Expected workStore to be initialized')\n }\n const cachedSearchParams = CachedSearchParamsForUseCache.get(workStore)\n if (cachedSearchParams) {\n return cachedSearchParams\n }\n\n const promise = Promise.resolve({})\n\n const proxiedPromise = new Proxy(promise, {\n get: function get(target, prop, receiver) {\n if (Object.hasOwn(promise, prop)) {\n // The promise has this property directly. we must return it. We know it\n // isn't a dynamic access because it can only be something that was\n // previously written to the promise and thus not an underlying\n // searchParam value\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n if (\n typeof prop === 'string' &&\n (prop === 'then' || !wellKnownProperties.has(prop))\n ) {\n throwForSearchParamsAccessInUseCache(workStore, get)\n }\n\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n\n CachedSearchParamsForUseCache.set(workStore, proxiedPromise)\n return proxiedPromise\n}\n\nfunction makeUntrackedSearchParams(\n underlyingSearchParams: SearchParams\n): Promise<SearchParams> {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams)\n if (cachedSearchParams) {\n return cachedSearchParams\n }\n\n const promise = Promise.resolve(underlyingSearchParams)\n CachedSearchParams.set(underlyingSearchParams, promise)\n\n return promise\n}\n\nfunction makeUntrackedSearchParamsWithDevWarnings(\n underlyingSearchParams: SearchParams,\n workStore: WorkStore,\n requestStore: RequestStore,\n isRuntimePrefetchable: boolean\n): Promise<SearchParams> {\n if (requestStore.asyncApiPromises) {\n // Do not cache the resulting promise. If we do, we'll only show the first \"awaited at\"\n // across all segments that receive searchParams.\n return makeUntrackedSearchParamsWithDevWarningsImpl(\n underlyingSearchParams,\n workStore,\n requestStore,\n isRuntimePrefetchable\n )\n } else {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams)\n if (cachedSearchParams) {\n return cachedSearchParams\n }\n const promise = makeUntrackedSearchParamsWithDevWarningsImpl(\n underlyingSearchParams,\n workStore,\n requestStore,\n isRuntimePrefetchable\n )\n CachedSearchParams.set(requestStore, promise)\n return promise\n }\n}\n\nfunction makeUntrackedSearchParamsWithDevWarningsImpl(\n underlyingSearchParams: SearchParams,\n workStore: WorkStore,\n requestStore: RequestStore,\n isRuntimePrefetchable: boolean\n): Promise<SearchParams> {\n const promiseInitialized = { current: false }\n const proxiedUnderlying = instrumentSearchParamsObjectWithDevWarnings(\n underlyingSearchParams,\n workStore,\n promiseInitialized\n )\n\n let promise: Promise<SearchParams>\n if (requestStore.asyncApiPromises) {\n // We wrap each instance of searchParams in a `new Promise()`.\n // This is important when all awaits are in third party which would otherwise\n // track all the way to the internal params.\n const sharedSearchParamsParent = isRuntimePrefetchable\n ? requestStore.asyncApiPromises.earlySharedSearchParamsParent\n : requestStore.asyncApiPromises.sharedSearchParamsParent\n promise = new Promise((resolve, reject) => {\n sharedSearchParamsParent.then(() => resolve(proxiedUnderlying), reject)\n })\n // @ts-expect-error\n promise.displayName = 'searchParams'\n } else {\n promise = makeDevtoolsIOAwarePromise(\n proxiedUnderlying,\n requestStore,\n RenderStage.Runtime\n )\n }\n promise.then(\n () => {\n promiseInitialized.current = true\n },\n // If we're in staged rendering, this promise will reject if the render\n // is aborted before it can reach the runtime stage.\n // In that case, we have to prevent an unhandled rejection from the promise\n // created by this `.then()` call.\n // This does not affect the `promiseInitialized` logic above,\n // because `proxiedUnderlying` will not be used to resolve the promise,\n // so there's no risk of any of its properties being accessed and triggering\n // an undesireable warning.\n ignoreReject\n )\n\n return instrumentSearchParamsPromiseWithDevWarnings(\n underlyingSearchParams,\n promise,\n workStore\n )\n}\n\nfunction ignoreReject() {}\n\nfunction instrumentSearchParamsObjectWithDevWarnings(\n underlyingSearchParams: SearchParams,\n workStore: WorkStore,\n promiseInitialized: { current: boolean }\n) {\n // We have an unfortunate sequence of events that requires this initialization logic. We want to instrument the underlying\n // searchParams object to detect if you are accessing values in dev. This is used for warnings and for things like the static prerender\n // indicator. However when we pass this proxy to our Promise.resolve() below the VM checks if the resolved value is a promise by looking\n // at the `.then` property. To our dynamic tracking logic this is indistinguishable from a `then` searchParam and so we would normally trigger\n // dynamic tracking. However we know that this .then is not real dynamic access, it's just how thenables resolve in sequence. So we introduce\n // this initialization concept so we omit the dynamic check until after we've constructed our resolved promise.\n return new Proxy(underlyingSearchParams, {\n get(target, prop, receiver) {\n if (typeof prop === 'string' && promiseInitialized.current) {\n if (workStore.dynamicShouldError) {\n const expression = describeStringPropertyAccess('searchParams', prop)\n throwWithStaticGenerationBailoutErrorWithDynamicError(\n workStore.route,\n expression\n )\n }\n }\n return ReflectAdapter.get(target, prop, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'string') {\n if (workStore.dynamicShouldError) {\n const expression = describeHasCheckingStringProperty(\n 'searchParams',\n prop\n )\n throwWithStaticGenerationBailoutErrorWithDynamicError(\n workStore.route,\n expression\n )\n }\n }\n return Reflect.has(target, prop)\n },\n ownKeys(target) {\n if (workStore.dynamicShouldError) {\n const expression =\n '`{...searchParams}`, `Object.keys(searchParams)`, or similar'\n throwWithStaticGenerationBailoutErrorWithDynamicError(\n workStore.route,\n expression\n )\n }\n return Reflect.ownKeys(target)\n },\n })\n}\n\nfunction instrumentSearchParamsPromiseWithDevWarnings(\n underlyingSearchParams: SearchParams,\n promise: Promise<SearchParams>,\n workStore: WorkStore\n) {\n // Track which properties we should warn for.\n const proxiedProperties = new Set<string>()\n\n Object.keys(underlyingSearchParams).forEach((prop) => {\n if (wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n proxiedProperties.add(prop)\n }\n })\n\n return new Proxy(promise, {\n get(target, prop, receiver) {\n if (prop === 'then' && workStore.dynamicShouldError) {\n const expression = '`searchParams.then`'\n throwWithStaticGenerationBailoutErrorWithDynamicError(\n workStore.route,\n expression\n )\n }\n if (typeof prop === 'string') {\n if (\n !wellKnownProperties.has(prop) &&\n (proxiedProperties.has(prop) ||\n // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)\n ) {\n const expression = describeStringPropertyAccess('searchParams', prop)\n warnForSyncAccess(workStore.route, expression)\n }\n }\n return ReflectAdapter.get(target, prop, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop)\n }\n return Reflect.set(target, prop, value, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'string') {\n if (\n !wellKnownProperties.has(prop) &&\n (proxiedProperties.has(prop) ||\n // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)\n ) {\n const expression = describeHasCheckingStringProperty(\n 'searchParams',\n prop\n )\n warnForSyncAccess(workStore.route, expression)\n }\n }\n return Reflect.has(target, prop)\n },\n ownKeys(target) {\n const expression = '`Object.keys(searchParams)` or similar'\n warnForSyncAccess(workStore.route, expression)\n return Reflect.ownKeys(target)\n },\n })\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createSearchAccessError\n)\n\nfunction createSearchAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`searchParams\\` is a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n\nfunction createClientSearchParamsInValidation(\n underlyingSearchParams: SearchParams,\n workStore: WorkStore,\n workUnitStore: ValidationStoreClient\n) {\n const { createExhaustiveSearchParamsProxy } =\n require('../app-render/instant-validation/instant-samples') as typeof import('../app-render/instant-validation/instant-samples')\n const declaredKeys = new Set(\n Object.keys(workUnitStore.validationSamples?.searchParams ?? {})\n )\n underlyingSearchParams = createExhaustiveSearchParamsProxy(\n underlyingSearchParams,\n declaredKeys,\n workStore.route\n )\n return Promise.resolve(underlyingSearchParams)\n}\n","import { createAsyncLocalStorage } from './async-local-storage'\nimport type { DynamicAccessStorage } from './dynamic-access-async-storage.external'\n\nexport const dynamicAccessAsyncStorageInstance: DynamicAccessStorage =\n createAsyncLocalStorage()\n","import type { AsyncLocalStorage } from 'async_hooks'\n\n// Share the instance module in the next-shared layer\nimport { dynamicAccessAsyncStorageInstance } from './dynamic-access-async-storage-instance' with { 'turbopack-transition': 'next-shared' }\n\nexport interface DynamicAccessAsyncStore {\n readonly abortController: AbortController\n}\n\nexport type DynamicAccessStorage = AsyncLocalStorage<DynamicAccessAsyncStore>\nexport { dynamicAccessAsyncStorageInstance as dynamicAccessAsyncStorage }\n","import {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport type { OpaqueFallbackRouteParams } from './fallback-params'\nimport type { VaryParamsAccumulator } from '../app-render/vary-params'\nimport {\n createVaryingParams,\n getMetadataVaryParamsAccumulator,\n} from '../app-render/vary-params'\n\nimport { ReflectAdapter } from '../web/spec-extension/adapters/reflect'\nimport {\n throwToInterruptStaticGeneration,\n postponeWithTracking,\n} from '../app-render/dynamic-rendering'\n\nimport {\n workUnitAsyncStorage,\n type PrerenderStorePPR,\n type PrerenderStoreLegacy,\n type StaticPrerenderStoreModern,\n type StaticPrerenderStore,\n throwInvariantForMissingStore,\n type PrerenderStoreModernRuntime,\n type RequestStore,\n type ValidationStoreClient,\n} from '../app-render/work-unit-async-storage.external'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport {\n describeStringPropertyAccess,\n wellKnownProperties,\n} from '../../shared/lib/utils/reflect-utils'\nimport {\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { dynamicAccessAsyncStorage } from '../app-render/dynamic-access-async-storage.external'\nimport { RenderStage } from '../app-render/staged-rendering'\n\nexport type ParamValue = string | Array<string> | undefined\nexport type Params = Record<string, ParamValue>\n\nexport function createParamsFromClient(\n underlyingParams: Params\n): Promise<Params> {\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Expected workStore to be initialized')\n }\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n // Client params don't need additional vary tracking because by the\n // time they reach the client, the access would have already been\n // tracked by the server.\n const varyParamsAccumulator = null\n return createStaticPrerenderParams(\n underlyingParams,\n null,\n workStore,\n workUnitStore,\n varyParamsAccumulator\n )\n case 'validation-client':\n return createClientParamsInInstantValidation(\n underlyingParams,\n workStore,\n workUnitStore.validationSamples\n )\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n throw new InvariantError(\n 'createParamsFromClient should not be called in cache contexts.'\n )\n case 'prerender-runtime':\n throw new InvariantError(\n 'createParamsFromClient should not be called in a runtime prerender.'\n )\n case 'generate-static-params':\n throw new InvariantError(\n 'createParamsFromClient should not be called inside generateStaticParams.'\n )\n case 'request':\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n const fallbackParams = workUnitStore.fallbackParams\n // Client params are not runtime prefetchable\n const isRuntimePrefetchable = false\n return createRenderParamsInDev(\n underlyingParams,\n fallbackParams,\n workStore,\n workUnitStore,\n isRuntimePrefetchable\n )\n } else if (workUnitStore.validationSamples) {\n return createClientParamsInInstantValidation(\n underlyingParams,\n workStore,\n workUnitStore.validationSamples\n )\n } else {\n return createRenderParamsInProd(underlyingParams)\n }\n default:\n workUnitStore satisfies never\n }\n }\n throwInvariantForMissingStore()\n}\n\n// generateMetadata always runs in RSC context so it is equivalent to a Server Page Component\nexport type CreateServerParamsForMetadata = typeof createServerParamsForMetadata\nexport function createServerParamsForMetadata(\n underlyingParams: Params,\n optionalCatchAllParamName: string | null,\n isRuntimePrefetchable: boolean\n): Promise<Params> {\n const metadataVaryParamsAccumulator = getMetadataVaryParamsAccumulator()\n return createServerParamsForServerSegment(\n underlyingParams,\n optionalCatchAllParamName,\n metadataVaryParamsAccumulator,\n isRuntimePrefetchable\n )\n}\n\n// routes always runs in RSC context so it is equivalent to a Server Page Component\nexport function createServerParamsForRoute(\n underlyingParams: Params,\n varyParamsAccumulator: VaryParamsAccumulator | null = null\n): Promise<Params> {\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Expected workStore to be initialized')\n }\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createStaticPrerenderParams(\n underlyingParams,\n null,\n workStore,\n workUnitStore,\n varyParamsAccumulator\n )\n case 'prerender-client':\n case 'validation-client':\n throw new InvariantError(\n 'createServerParamsForRoute should not be called in client contexts.'\n )\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n throw new InvariantError(\n 'createServerParamsForRoute should not be called in cache contexts.'\n )\n case 'generate-static-params':\n throw new InvariantError(\n 'createServerParamsForRoute should not be called inside generateStaticParams.'\n )\n case 'prerender-runtime': {\n // Route params are not runtime prefetchable\n const isRuntimePrefetchable = false\n return createRuntimePrerenderParams(\n underlyingParams,\n null,\n workUnitStore,\n varyParamsAccumulator,\n isRuntimePrefetchable\n )\n }\n case 'request':\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n const fallbackParams = workUnitStore.fallbackParams\n // Route params are not runtime prefetchable\n const isRuntimePrefetchable = false\n return createRenderParamsInDev(\n underlyingParams,\n fallbackParams,\n workStore,\n workUnitStore,\n isRuntimePrefetchable\n )\n } else {\n return createRenderParamsInProd(underlyingParams)\n }\n default:\n workUnitStore satisfies never\n }\n }\n throwInvariantForMissingStore()\n}\n\nexport function createServerParamsForServerSegment(\n underlyingParams: Params,\n optionalCatchAllParamName: string | null,\n varyParamsAccumulator: VaryParamsAccumulator | null,\n isRuntimePrefetchable: boolean\n): Promise<Params> {\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Expected workStore to be initialized')\n }\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createStaticPrerenderParams(\n underlyingParams,\n optionalCatchAllParamName,\n workStore,\n workUnitStore,\n varyParamsAccumulator\n )\n case 'validation-client':\n throw new InvariantError(\n 'createServerParamsForServerSegment should not be called in client contexts.'\n )\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n throw new InvariantError(\n 'createServerParamsForServerSegment should not be called in cache contexts.'\n )\n case 'generate-static-params':\n throw new InvariantError(\n 'createServerParamsForServerSegment should not be called inside generateStaticParams.'\n )\n case 'prerender-runtime':\n return createRuntimePrerenderParams(\n underlyingParams,\n optionalCatchAllParamName,\n workUnitStore,\n varyParamsAccumulator,\n isRuntimePrefetchable\n )\n case 'request':\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n const fallbackParams = workUnitStore.fallbackParams\n return createRenderParamsInDev(\n underlyingParams,\n fallbackParams,\n workStore,\n workUnitStore,\n isRuntimePrefetchable\n )\n } else if (\n workUnitStore.asyncApiPromises &&\n workUnitStore.validationSamples\n ) {\n return createServerParamsInInstantValidation(\n underlyingParams,\n workStore,\n workUnitStore.validationSamples,\n workUnitStore.asyncApiPromises,\n isRuntimePrefetchable\n )\n } else if (\n workUnitStore.asyncApiPromises &&\n hasFallbackRouteParams(underlyingParams, workUnitStore.fallbackParams)\n ) {\n return (\n isRuntimePrefetchable\n ? workUnitStore.asyncApiPromises.earlySharedParamsParent\n : workUnitStore.asyncApiPromises.sharedParamsParent\n ).then(() => underlyingParams)\n } else {\n return createRenderParamsInProd(underlyingParams)\n }\n default:\n workUnitStore satisfies never\n }\n }\n throwInvariantForMissingStore()\n}\n\nexport function createPrerenderParamsForClientSegment(\n underlyingParams: Params\n): Promise<Params> {\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError(\n 'Missing workStore in createPrerenderParamsForClientSegment'\n )\n }\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n const fallbackParams = workUnitStore.fallbackRouteParams\n if (fallbackParams) {\n for (let key in underlyingParams) {\n if (fallbackParams.has(key)) {\n // This params object has one or more fallback params, so we need\n // to consider the awaiting of this params object \"dynamic\". Since\n // we are in cacheComponents mode we encode this as a promise that never\n // resolves.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`params`'\n )\n }\n }\n }\n break\n case 'validation-client':\n throw new InvariantError(\n 'createPrerenderParamsForClientSegment should not be called in validation contexts.'\n )\n break\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n throw new InvariantError(\n 'createPrerenderParamsForClientSegment should not be called in cache contexts.'\n )\n case 'generate-static-params':\n throw new InvariantError(\n 'createPrerenderParamsForClientSegment should not be called inside generateStaticParams.'\n )\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'prerender-runtime':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n // We're prerendering in a mode that does not abort. We resolve the promise without\n // any tracking because we're just transporting a value from server to client where the tracking\n // will be applied.\n return Promise.resolve(underlyingParams)\n}\n\nfunction createStaticPrerenderParams(\n underlyingParams: Params,\n optionalCatchAllParamName: string | null,\n workStore: WorkStore,\n prerenderStore: StaticPrerenderStore,\n varyParamsAccumulator: VaryParamsAccumulator | null\n): Promise<Params> {\n const underlyingParamsWithVarying =\n varyParamsAccumulator !== null\n ? createVaryingParams(\n varyParamsAccumulator,\n underlyingParams,\n optionalCatchAllParamName\n )\n : underlyingParams\n\n switch (prerenderStore.type) {\n case 'prerender':\n case 'prerender-client': {\n const fallbackParams = prerenderStore.fallbackRouteParams\n if (fallbackParams) {\n for (const key in underlyingParams) {\n if (fallbackParams.has(key)) {\n // This params object has one or more fallback params, so we need\n // to consider the awaiting of this params object \"dynamic\". Since\n // we are in cacheComponents mode we encode this as a promise that never\n // resolves.\n return makeHangingParams(\n underlyingParamsWithVarying,\n workStore,\n prerenderStore\n )\n }\n }\n }\n break\n }\n case 'prerender-ppr': {\n const fallbackParams = prerenderStore.fallbackRouteParams\n if (fallbackParams) {\n for (const key in underlyingParams) {\n if (fallbackParams.has(key)) {\n return makeErroringParams(\n underlyingParamsWithVarying,\n fallbackParams,\n workStore,\n prerenderStore\n )\n }\n }\n }\n break\n }\n case 'prerender-legacy':\n break\n default:\n prerenderStore satisfies never\n }\n\n return makeUntrackedParams(underlyingParamsWithVarying)\n}\n\nfunction createRuntimePrerenderParams(\n underlyingParams: Params,\n optionalCatchAllParamName: string | null,\n workUnitStore: PrerenderStoreModernRuntime,\n varyParamsAccumulator: VaryParamsAccumulator | null,\n isRuntimePrefetchable: boolean\n): Promise<Params> {\n const underlyingParamsWithVarying =\n varyParamsAccumulator !== null\n ? createVaryingParams(\n varyParamsAccumulator,\n underlyingParams,\n optionalCatchAllParamName\n )\n : underlyingParams\n\n const result = makeUntrackedParams(underlyingParamsWithVarying)\n const { stagedRendering } = workUnitStore\n if (!stagedRendering) {\n return result\n }\n const stage = isRuntimePrefetchable\n ? RenderStage.EarlyRuntime\n : RenderStage.Runtime\n return stagedRendering.waitForStage(stage).then(() => result)\n}\n\nfunction hasFallbackRouteParams(\n underlyingParams: Params,\n fallbackParams: OpaqueFallbackRouteParams | null | undefined\n): boolean {\n if (fallbackParams) {\n for (let key in underlyingParams) {\n if (fallbackParams.has(key)) {\n return true\n }\n }\n }\n return false\n}\n\nfunction createServerParamsInInstantValidation(\n underlyingParams: Params,\n workStore: WorkStore,\n validationSamples: NonNullable<RequestStore['validationSamples']>,\n asyncApiPromises: NonNullable<RequestStore['asyncApiPromises']>,\n isRuntimePrefetchable: boolean\n): Promise<Params> {\n const { createExhaustiveParamsProxy } =\n require('../app-render/instant-validation/instant-samples') as typeof import('../app-render/instant-validation/instant-samples')\n const declaredParams = new Set(Object.keys(validationSamples.params ?? {}))\n const proxiedUnderlying = createExhaustiveParamsProxy(\n underlyingParams,\n declaredParams,\n workStore.route\n )\n return (\n isRuntimePrefetchable\n ? asyncApiPromises.earlySharedParamsParent\n : asyncApiPromises.sharedParamsParent\n ).then(() => proxiedUnderlying)\n}\n\nfunction createClientParamsInInstantValidation(\n underlyingParams: Params,\n workStore: WorkStore,\n validationSamples: ValidationStoreClient['validationSamples']\n): Promise<Params> {\n const { createExhaustiveParamsProxy } =\n require('../app-render/instant-validation/instant-samples') as typeof import('../app-render/instant-validation/instant-samples')\n const declaredParams = new Set(Object.keys(validationSamples?.params ?? {}))\n const proxiedUnderlying = createExhaustiveParamsProxy(\n underlyingParams,\n declaredParams,\n workStore.route\n )\n return Promise.resolve(proxiedUnderlying)\n}\n\nfunction createRenderParamsInProd(underlyingParams: Params): Promise<Params> {\n return makeUntrackedParams(underlyingParams)\n}\n\nfunction createRenderParamsInDev(\n underlyingParams: Params,\n fallbackParams: OpaqueFallbackRouteParams | null | undefined,\n workStore: WorkStore,\n requestStore: RequestStore,\n isRuntimePrefetchable: boolean\n): Promise<Params> {\n return makeDynamicallyTrackedParamsWithDevWarnings(\n underlyingParams,\n hasFallbackRouteParams(underlyingParams, fallbackParams),\n workStore,\n requestStore,\n isRuntimePrefetchable\n )\n}\n\ninterface CacheLifetime {}\nconst CachedParams = new WeakMap<CacheLifetime, Promise<Params>>()\n\nconst fallbackParamsProxyHandler: ProxyHandler<Promise<Params>> = {\n get: function get(target, prop, receiver) {\n if (prop === 'then' || prop === 'catch' || prop === 'finally') {\n const originalMethod = ReflectAdapter.get(target, prop, receiver)\n\n return {\n [prop]: (...args: unknown[]) => {\n const store = dynamicAccessAsyncStorage.getStore()\n\n if (store) {\n store.abortController.abort(\n new Error(`Accessed fallback \\`params\\` during prerendering.`)\n )\n }\n\n return new Proxy(\n originalMethod.apply(target, args),\n fallbackParamsProxyHandler\n )\n },\n }[prop]\n }\n\n return ReflectAdapter.get(target, prop, receiver)\n },\n}\n\nfunction makeHangingParams(\n underlyingParams: Params,\n workStore: WorkStore,\n prerenderStore: StaticPrerenderStoreModern\n): Promise<Params> {\n const cachedParams = CachedParams.get(underlyingParams)\n if (cachedParams) {\n return cachedParams\n }\n\n const promise = new Proxy(\n makeHangingPromise<Params>(\n prerenderStore.renderSignal,\n workStore.route,\n '`params`'\n ),\n fallbackParamsProxyHandler\n )\n\n CachedParams.set(underlyingParams, promise)\n\n return promise\n}\n\nfunction makeErroringParams(\n underlyingParams: Params,\n fallbackParams: OpaqueFallbackRouteParams,\n workStore: WorkStore,\n prerenderStore: PrerenderStorePPR | PrerenderStoreLegacy\n): Promise<Params> {\n const cachedParams = CachedParams.get(underlyingParams)\n if (cachedParams) {\n return cachedParams\n }\n\n const augmentedUnderlying = { ...underlyingParams }\n\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(augmentedUnderlying)\n CachedParams.set(underlyingParams, promise)\n\n Object.keys(underlyingParams).forEach((prop) => {\n if (wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n if (fallbackParams.has(prop)) {\n Object.defineProperty(augmentedUnderlying, prop, {\n get() {\n const expression = describeStringPropertyAccess('params', prop)\n // In most dynamic APIs we also throw if `dynamic = \"error\"` however\n // for params is only dynamic when we're generating a fallback shell\n // and even when `dynamic = \"error\"` we still support generating dynamic\n // fallback shells\n // TODO remove this comment when cacheComponents is the default since there\n // will be no `dynamic = \"error\"`\n if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no cacheComponents)\n postponeWithTracking(\n workStore.route,\n expression,\n prerenderStore.dynamicTracking\n )\n } else {\n // Legacy Prerender\n throwToInterruptStaticGeneration(\n expression,\n workStore,\n prerenderStore\n )\n }\n },\n enumerable: true,\n })\n }\n }\n })\n\n return promise\n}\n\nfunction makeUntrackedParams(underlyingParams: Params): Promise<Params> {\n const cachedParams = CachedParams.get(underlyingParams)\n if (cachedParams) {\n return cachedParams\n }\n\n const promise = Promise.resolve(underlyingParams)\n CachedParams.set(underlyingParams, promise)\n\n return promise\n}\n\nfunction makeDynamicallyTrackedParamsWithDevWarnings(\n underlyingParams: Params,\n hasFallbackParams: boolean,\n workStore: WorkStore,\n requestStore: RequestStore,\n isRuntimePrefetchable: boolean\n): Promise<Params> {\n if (requestStore.asyncApiPromises && hasFallbackParams) {\n // We wrap each instance of params in a `new Promise()`, because deduping\n // them across requests doesn't work anyway and this let us show each\n // await a different set of values. This is important when all awaits\n // are in third party which would otherwise track all the way to the\n // internal params.\n const sharedParamsParent = isRuntimePrefetchable\n ? requestStore.asyncApiPromises.earlySharedParamsParent\n : requestStore.asyncApiPromises.sharedParamsParent\n const promise: Promise<Params> = new Promise((resolve, reject) => {\n sharedParamsParent.then(() => resolve(underlyingParams), reject)\n })\n // @ts-expect-error\n promise.displayName = 'params'\n return instrumentParamsPromiseWithDevWarnings(\n underlyingParams,\n promise,\n workStore\n )\n }\n\n const cachedParams = CachedParams.get(underlyingParams)\n if (cachedParams) {\n return cachedParams\n }\n\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = hasFallbackParams\n ? makeDevtoolsIOAwarePromise(\n underlyingParams,\n requestStore,\n RenderStage.Runtime\n )\n : // We don't want to force an environment transition when this params is not part of the fallback params set\n Promise.resolve(underlyingParams)\n\n const proxiedPromise = instrumentParamsPromiseWithDevWarnings(\n underlyingParams,\n promise,\n workStore\n )\n CachedParams.set(underlyingParams, proxiedPromise)\n return proxiedPromise\n}\n\nfunction instrumentParamsPromiseWithDevWarnings(\n underlyingParams: Params,\n promise: Promise<Params>,\n workStore: WorkStore\n): Promise<Params> {\n // Track which properties we should warn for.\n const proxiedProperties = new Set<string>()\n\n Object.keys(underlyingParams).forEach((prop) => {\n if (wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n proxiedProperties.add(prop)\n }\n })\n\n return new Proxy(promise, {\n get(target, prop, receiver) {\n if (typeof prop === 'string') {\n if (\n // We are accessing a property that was proxied to the promise instance\n proxiedProperties.has(prop)\n ) {\n const expression = describeStringPropertyAccess('params', prop)\n warnForSyncAccess(workStore.route, expression)\n }\n }\n return ReflectAdapter.get(target, prop, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop)\n }\n return ReflectAdapter.set(target, prop, value, receiver)\n },\n ownKeys(target) {\n const expression = '`...params` or similar expression'\n warnForSyncAccess(workStore.route, expression)\n return Reflect.ownKeys(target)\n },\n })\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createParamsAccessError\n)\n\nfunction createParamsAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`params\\` is a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n","'use client'\n\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { Params } from '../../server/request/params'\nimport { LayoutRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { use } from 'react'\nimport { urlSearchParamsToParsedUrlQuery } from '../route-params'\nimport { SearchParamsContext } from '../../shared/lib/hooks-client-context.shared-runtime'\n\n/**\n * When the Page is a client component we send the params and searchParams to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Page component.\n *\n * additionally we may send promises representing the params and searchParams. We don't ever use these passed\n * values but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations.\n * It is up to the caller to decide if the promises are needed.\n */\nexport function ClientPageRoot({\n Component,\n serverProvidedParams,\n}: {\n Component: React.ComponentType<any>\n serverProvidedParams: null | {\n searchParams: ParsedUrlQuery\n params: Params\n promises: Array<Promise<any>> | null\n }\n}) {\n let searchParams: ParsedUrlQuery\n let params: Params\n if (serverProvidedParams !== null) {\n searchParams = serverProvidedParams.searchParams\n params = serverProvidedParams.params\n } else {\n // When Cache Components is enabled, the server does not pass the params as\n // props; they are parsed on the client and passed via context.\n const layoutRouterContext = use(LayoutRouterContext)\n params =\n layoutRouterContext !== null ? layoutRouterContext.parentParams : {}\n\n // This is an intentional behavior change: when Cache Components is enabled,\n // client segments receive the \"canonical\" search params, not the\n // rewritten ones. Users should either call useSearchParams directly or pass\n // the rewritten ones in from a Server Component.\n // TODO: Log a deprecation error when this object is accessed\n searchParams = urlSearchParamsToParsedUrlQuery(use(SearchParamsContext)!)\n }\n\n if (typeof window === 'undefined') {\n let clientSearchParams: Promise<ParsedUrlQuery>\n let clientParams: Promise<Params>\n\n const { createSearchParamsFromClient } =\n require('../../server/request/search-params') as typeof import('../../server/request/search-params')\n clientSearchParams = createSearchParamsFromClient(searchParams)\n\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n clientParams = createParamsFromClient(params)\n\n return <Component params={clientParams} searchParams={clientSearchParams} />\n } else {\n const { createRenderSearchParamsFromClient } =\n require('../request/search-params.browser') as typeof import('../request/search-params.browser')\n const clientSearchParams = createRenderSearchParamsFromClient(searchParams)\n const { createRenderParamsFromClient } =\n require('../request/params.browser') as typeof import('../request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n\n return <Component params={clientParams} searchParams={clientSearchParams} />\n }\n}\n","'use client'\n\nimport type { Params } from '../../server/request/params'\nimport { LayoutRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { use } from 'react'\n\n/**\n * When the Page is a client component we send the params to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Segment component.\n *\n * additionally we may send a promise representing params. We don't ever use this passed\n * value but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations\n * such as when cacheComponents is enabled. It is up to the caller to decide if the promises are needed.\n */\nexport function ClientSegmentRoot({\n Component,\n slots,\n serverProvidedParams,\n}: {\n Component: React.ComponentType<any>\n slots: { [key: string]: React.ReactNode }\n serverProvidedParams: null | {\n params: Params\n promises: Array<Promise<any>> | null\n }\n}) {\n let params: Params\n if (serverProvidedParams !== null) {\n params = serverProvidedParams.params\n } else {\n // When Cache Components is enabled, the server does not pass the params\n // as props; they are parsed on the client and passed via context.\n const layoutRouterContext = use(LayoutRouterContext)\n params =\n layoutRouterContext !== null ? layoutRouterContext.parentParams : {}\n }\n\n if (typeof window === 'undefined') {\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n const clientParams: Promise<Params> = createParamsFromClient(params)\n\n return <Component {...slots} params={clientParams} />\n } else {\n const { createRenderParamsFromClient } =\n require('../request/params.browser') as typeof import('../request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n return <Component {...slots} params={clientParams} />\n }\n}\n","'use client'\n\n// This is a client component that only renders during SSR,\n// but will be replaced during streaming with an icon insertion script tag.\n// We don't want it to be presented anywhere so it's only visible during streaming,\n// right after the icon meta tags so that browser can pick it up as soon as it's rendered.\n// Note: we don't just emit the script here because we only need the script if it's not in the head,\n// and we need it to be hoistable alongside the other metadata but sync scripts are not hoistable.\nexport const IconMark = () => {\n if (typeof window !== 'undefined') {\n return null\n }\n return <meta name=\"«nxt-icon»\" />\n}\n"],"names":["warnOnce","_","process","env","NODE_ENV","warnings","Set","msg","has","console","warn","add","disableSmoothScrollDuringRouteTransition","fn","options","onlyHashChange","htmlElement","document","documentElement","hasDataAttribute","dataset","scrollBehavior","getComputedStyle","existing","style","dontForceLayout","getClientRects","HTTPAccessFallbackBoundary","HTTPAccessFallbackErrorBoundary","React","Component","constructor","props","state","triggeredStatus","undefined","previousPathname","pathname","componentDidCatch","missingSlots","size","warningMessage","formattedSlots","Array","from","sort","a","b","localeCompare","map","slot","join","getDerivedStateFromError","error","isHTTPAccessFallbackError","httpStatus","getAccessFallbackHTTPStatus","getDerivedStateFromProps","render","notFound","forbidden","unauthorized","children","errorComponents","HTTPAccessErrorStatus","NOT_FOUND","FORBIDDEN","UNAUTHORIZED","isNotFound","isForbidden","isUnauthorized","meta","name","content","getAccessFallbackErrorTypeByStatus","useUntrackedPathname","useContext","MissingSlotContext","hasErrorFallback","useRouterBFCache","MAX_BF_CACHE_ENTRIES","__NEXT_CACHE_COMPONENTS","activeTree","activeCacheNode","activeStateKey","prevActiveEntry","setPrevActiveEntry","useState","initialEntry","tree","cacheNode","stateKey","next","newActiveEntry","n","oldEntry","clonedEntry","entry","LoadingBoundaryProvider","OuterLayoutRouter","enableNewScrollHandler","__NEXT_APP_NEW_SCROLL_HANDLER","__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","ReactDOM","findDOMNode","instance","window","internal_reactDOMfindDOMNode","rectProperties","shouldSkipElement","element","includes","position","rect","getBoundingClientRect","every","item","topOfElementInViewport","viewportHeight","rects","length","elementTop","Number","POSITIVE_INFINITY","i","top","getHashFragmentDomNode","hashFragment","body","getElementById","getElementsByName","InnerScrollAndFocusHandlerOld","componentDidMount","handlePotentialScroll","componentDidUpdate","focusAndScrollRef","scrollRef","forceScroll","current","domNode","Element","HTMLElement","parentElement","localName","nextElementSibling","scrollIntoView","clientHeight","scrollTop","focus","InnerScrollHandlerNew","childrenRef","useRef","useLayoutEffect","activeElement","blur","Fragment","ref","InnerScrollAndMaybeFocusHandler","ScrollAndMaybeFocusHandler","context","GlobalLayoutRouterContext","Error","InnerLayoutRouter","segmentPath","debugNameContext","maybeCacheNode","params","url","isActive","parentNavPromises","NavigationPromisesContext","use","unresolvedThenable","resolvedPrefetchRsc","prefetchRsc","rsc","useDeferredValue","resolvedRsc","isDeferredRsc","unwrappedRsc","navigationPromises","createNestedLayoutNavigationPromises","require","Provider","value","LayoutRouterContext","parentTree","parentCacheNode","parentSegmentPath","parentParams","parentLoadingData","loading","parentContext","LoadingBoundary","loadingRsc","loadingStyles","loadingScripts","Suspense","fallback","parallelRouterKey","errorStyles","errorScripts","templateStyles","templateScripts","template","segmentViewBoundaries","parentTreeSegment","concat","maybeParentSlots","slots","maybeValidationBoundaryId","InstantValidationBoundaryContext","activeSegment","createRouterCacheKey","bfcacheEntry","segment","segmentBoundaryTriggerNode","segmentViewStateNode","SegmentBoundaryTriggerNode","SegmentViewStateNode","pagePrefix","normalizeAppPath","page","isArray","paramName","paramCacheKey","paramType","paramValue","getParamValueFromCacheKey","debugName","getBoundaryDebugNameFromSegment","childDebugNameContext","isVirtual","debugNameToDisplay","templateValue","ErrorBoundary","errorComponent","RedirectBoundary","RenderValidationBoundaryAtThisLevel","id","child","TemplateContext","SegmentStateProvider","Activity","mode","push","isVirtualLayout","RenderFromTemplateContext","createRenderSearchParamsFromClient","CachedSearchParams","WeakMap","makeUntrackedSearchParams","underlyingSearchParams","cachedSearchParams","get","promise","Promise","resolve","set","createRenderParamsFromClient","CachedParams","makeUntrackedParams","underlyingParams","cachedParams","clientParams","accumulateRootVaryParam","accumulateVaryParam","createResponseVaryParamsAccumulator","createVaryParamsAccumulator","createVaryingParams","createVaryingSearchParams","emptyVaryParamsAccumulator","finishAccumulatingVaryParams","getMetadataVaryParamsAccumulator","getMetadataVaryParamsThenable","getRootParamsVaryParamsAccumulator","getVaryParamsThenable","getViewportVaryParamsAccumulator","createSegmentVaryParamsAccumulator","accumulator","varyParams","status","then","onfulfilled","resolvers","emptySet","head","rootParams","segments","workUnitStore","workUnitAsyncStorage","getStore","type","responseAccumulator","varyParamsAccumulator","rootParamsAccumulator","originalParamsObject","optionalCatchAllParamName","Proxy","target","prop","receiver","Object","prototype","hasOwnProperty","call","Reflect","ownKeys","underlyingParamsWithVarying","defineProperty","enumerable","originalSearchParamsObject","underlyingSearchParamsWithVarying","searchParamName","rootVaryParams","finishSegmentAccumulator","segmentAccumulator","merged","param","resolver","ReflectAdapter","bind","deleteProperty","createDedupedByCallsiteServerErrorLoggerDev","errorRef","cache","logErrorOrWarn","flushCurrentErrorIfNew","key","getMessage","logDedupedError","args","message","callStackFrames","stack","split","describeHasCheckingStringProperty","describeStringPropertyAccess","wellKnownProperties","isDefinitelyAValidIdentifier","test","JSON","stringify","stringifiedProp","afterTaskAsyncStorageInstance","createAsyncLocalStorage","afterTaskAsyncStorage","isRequestAPICallableInsideAfter","throwForSearchParamsAccessInUseCache","throwWithStaticGenerationBailoutErrorWithDynamicError","route","expression","StaticGenBailoutError","workStore","constructorOpt","captureStackTrace","invalidDynamicUsageError","afterTaskStore","rootTaskSpawnPhase","__defProp","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","__export","all","__copyProps","to","except","desc","__toCommonJS","mod","src_exports","RequestCookies","ResponseCookies","parseCookie","parseSetCookie","stringifyCookie","module","exports","c","_a","attrs","path","expires","Date","toUTCString","maxAge","domain","secure","httpOnly","sameSite","partitioned","priority","filter","Boolean","stringified","encodeURIComponent","cookie","Map","pair","splitAt","indexOf","slice","decodeURIComponent","setCookie","attributes","httponly","maxage","samesite","fromEntries","value2","toLowerCase","replace","parseSameSite","parsePriority","compact","t","newT","SAME_SITE","string","PRIORITY","splitCookiesString","cookiesString","cookiesStrings","pos","start","ch","lastComma","nextStart","cookiesSeparatorFound","skipWhitespace","charAt","notSpecialChar","substring","requestHeaders","_parsed","_headers","header","parsed","Symbol","iterator","getAll","delete","names","result","clear","keys","for","toString","values","v","responseHeaders","_b","_c","getSetCookie","cookieStrings","cookieString","normalizeCookie","bag","headers","serialized","append","now","MutableRequestCookiesAdapter","ReadonlyRequestCookiesError","RequestCookiesAdapter","appendMutableCookies","areCookiesMutableInCurrentPhase","createCookiesWithMutableAccessCheck","getModifiedCookieValues","responseCookiesToRequestCookies","callable","seal","cookies","SYMBOL_MODIFY_COOKIE_VALUES","modified","mutableCookies","modifiedCookieValues","resCookies","returnedCookies","wrap","onUpdateCookies","responseCookies","Headers","modifiedValues","modifiedCookies","updateResponseCookies","workAsyncStorage","pathWasRevalidated","ActionDidRevalidateStaticAndDynamic","allCookies","serializedCookies","tempCookies","wrappedCookies","requestStore","ensureCookiesAreStillMutable","phase","_callingExpression","requestCookies","HeadersAdapter","ReadonlyHeadersError","lowercased","original","find","o","merge","forEach","callbackfn","thisArg","entries","getParamProperties","getSegmentParam","isCatchAll","interceptionMarker","INTERCEPTION_ROUTE_MARKERS","marker","startsWith","endsWith","repeat","optional","DecodeError","MiddlewareNotFoundError","MissingStaticPage","NormalizeError","PageNotFoundError","SP","ST","WEB_VITALS","execOnce","getDisplayName","getLocationOrigin","getURL","isAbsoluteUrl","isResSent","loadGetInitialProps","normalizeRepeatedSlashes","stringifyError","used","ABSOLUTE_URL_REGEX","protocol","hostname","port","location","href","origin","displayName","res","finished","headersSent","urlParts","urlNoQuery","App","ctx","getInitialProps","pageProps","performance","method","code","assign","searchParamsToUrlQuery","urlQueryToSearchParams","searchParams","query","stringifyUrlQueryParam","isNaN","String","URLSearchParams","searchParamsList","parseRelativeUrl","base","parseQuery","globalBase","URL","resolvedBase","search","hash","host","auth","slashes","InstantValidationError","isInstantValidationError","INSTANT_VALIDATION_ERROR_DIGEST","err","digest","assertRootParamInSamples","createCookiesFromSample","createDraftModeForValidation","createExhaustiveParamsProxy","createExhaustiveSearchParamsProxy","createExhaustiveURLSearchParamsProxy","createHeadersFromSample","createRelativeURLFromSamples","createValidationSampleTracking","trackMissingSampleError","trackMissingSampleErrorAndThrow","missingSampleErrors","getExpectedSampleTracking","validationSampleTracking","InvariantError","sampleCookies","declaredNames","sealed","originalMethod","wrappedMethod","createMissingCookieSampleError","nameOrCookie","rawSampleHeaders","sampleHeaders","cookieHeaderValue","headersInit","patchedMethod","rawName","isEnabled","enable","disable","declaredParamNames","declaredSearchParamNames","createMissingSearchParamSampleError","originalMathod","hasOwn","sampleParams","sampleSearchParams","createPathnameFromRouteAndSampleParams","qs","createURLSearchParamsFromSample","interpolatedSegments","rawSegments","rawSegment","createPrerenderSearchParamsForClientPage","createSearchParamsFromClient","createServerSearchParamsForMetadata","createServerSearchParamsForServerPage","makeErroringSearchParamsForUseCache","createStaticPrerenderSearchParams","createClientSearchParamsInValidation","isRuntimePrefetchable","createRenderSearchParams","throwInvariantForMissingStore","metadataVaryParamsAccumulator","createRuntimePrerenderSearchParams","forceStatic","makeHangingPromise","renderSignal","prerenderStore","makeHangingSearchParams","makeErroringSearchParams","stagedRendering","stage","RenderStage","EarlyRuntime","Runtime","waitForStage","makeUntrackedSearchParamsWithDevWarnings","asyncApiPromises","validationSamples","declaredKeys","earlySharedSearchParamsParent","sharedSearchParamsParent","CachedSearchParamsForUseCache","proxiedPromise","annotateDynamicAccess","dynamicShouldError","postponeWithTracking","dynamicTracking","throwToInterruptStaticGeneration","makeUntrackedSearchParamsWithDevWarningsImpl","promiseInitialized","proxiedUnderlying","instrumentSearchParamsObjectWithDevWarnings","reject","makeDevtoolsIOAwarePromise","ignoreReject","instrumentSearchParamsPromiseWithDevWarnings","proxiedProperties","warnForSyncAccess","createSearchAccessError","prefix","dynamicAccessAsyncStorageInstance","dynamicAccessAsyncStorage","createParamsFromClient","createPrerenderParamsForClientSegment","createServerParamsForMetadata","createServerParamsForRoute","createServerParamsForServerSegment","createStaticPrerenderParams","createClientParamsInInstantValidation","fallbackParams","createRenderParamsInDev","createRenderParamsInProd","createRuntimePrerenderParams","createServerParamsInInstantValidation","hasFallbackRouteParams","earlySharedParamsParent","sharedParamsParent","fallbackRouteParams","makeHangingParams","makeErroringParams","declaredParams","makeDynamicallyTrackedParamsWithDevWarnings","fallbackParamsProxyHandler","store","abortController","abort","apply","augmentedUnderlying","hasFallbackParams","instrumentParamsPromiseWithDevWarnings","createParamsAccessError","ClientPageRoot","serverProvidedParams","layoutRouterContext","urlSearchParamsToParsedUrlQuery","SearchParamsContext","clientSearchParams","ClientSegmentRoot","IconMark"],"mappings":"oNAWSA,WAAAA,qCAAAA,KAXT,IAAIA,EAAYC,AAAD,IAAgB,gCCMxB,SAASW,EACdC,CAAc,CACdC,EAAmE,CAAC,CAAC,EAIrE,GAAIA,EAAQC,cAAc,CAAE,YAC1BF,IAIF,IAAMG,EAAcC,SAASC,eAAe,CAG5C,GAFgE,CAE5D,CAACC,SAFoBH,EAAYI,OAAO,CAACC,cAAc,CAEpC,YAarBR,IAKF,IAAMU,EAAWP,EAAYQ,KAAK,CAACH,cAAc,AACjDL,GAAYQ,K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