@codelionapps/unharness 0.0.0-stage → 0.1.0

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 (1288) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +330 -2
  3. package/bin/unharness.js +15 -0
  4. package/dashboard/.next/standalone/dashboard/.next/BUILD_ID +1 -0
  5. package/dashboard/.next/standalone/dashboard/.next/UNHARNESS_BUILD_DONE +0 -0
  6. package/dashboard/.next/standalone/dashboard/.next/app-path-routes-manifest.json +11 -0
  7. package/dashboard/.next/standalone/dashboard/.next/build-manifest.json +94 -0
  8. package/dashboard/.next/standalone/dashboard/.next/package.json +1 -0
  9. package/dashboard/.next/standalone/dashboard/.next/prerender-manifest.json +72 -0
  10. package/dashboard/.next/standalone/dashboard/.next/required-server-files.json +368 -0
  11. package/dashboard/.next/standalone/dashboard/.next/routes-manifest.json +102 -0
  12. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  13. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page/build-manifest.json +21 -0
  14. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  15. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  16. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  17. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page.js +11 -0
  18. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page.js.map +5 -0
  19. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page.js.nft.json +1 -0
  20. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
  21. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.html +1 -0
  22. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.meta +30 -0
  23. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.rsc +18 -0
  24. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +23 -0
  25. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +18 -0
  26. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +2 -0
  27. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  28. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page/build-manifest.json +21 -0
  29. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page/next-font-manifest.json +6 -0
  30. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  31. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  32. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page.js +14 -0
  33. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page.js.map +5 -0
  34. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -0
  35. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
  36. package/dashboard/.next/standalone/dashboard/.next/server/app/api/unharness/route/app-paths-manifest.json +3 -0
  37. package/dashboard/.next/standalone/dashboard/.next/server/app/api/unharness/route/build-manifest.json +12 -0
  38. package/dashboard/.next/standalone/dashboard/.next/server/app/api/unharness/route/server-reference-manifest.json +4 -0
  39. package/dashboard/.next/standalone/dashboard/.next/server/app/api/unharness/route.js +7 -0
  40. package/dashboard/.next/standalone/dashboard/.next/server/app/api/unharness/route.js.map +5 -0
  41. package/dashboard/.next/standalone/dashboard/.next/server/app/api/unharness/route.js.nft.json +1 -0
  42. package/dashboard/.next/standalone/dashboard/.next/server/app/api/unharness/route_client-reference-manifest.js +3 -0
  43. package/dashboard/.next/standalone/dashboard/.next/server/app/compare/page/app-paths-manifest.json +3 -0
  44. package/dashboard/.next/standalone/dashboard/.next/server/app/compare/page/build-manifest.json +21 -0
  45. package/dashboard/.next/standalone/dashboard/.next/server/app/compare/page/next-font-manifest.json +6 -0
  46. package/dashboard/.next/standalone/dashboard/.next/server/app/compare/page/react-loadable-manifest.json +1 -0
  47. package/dashboard/.next/standalone/dashboard/.next/server/app/compare/page/server-reference-manifest.json +4 -0
  48. package/dashboard/.next/standalone/dashboard/.next/server/app/compare/page.js +18 -0
  49. package/dashboard/.next/standalone/dashboard/.next/server/app/compare/page.js.map +5 -0
  50. package/dashboard/.next/standalone/dashboard/.next/server/app/compare/page.js.nft.json +1 -0
  51. package/dashboard/.next/standalone/dashboard/.next/server/app/compare/page_client-reference-manifest.js +3 -0
  52. package/dashboard/.next/standalone/dashboard/.next/server/app/icon.svg/route/app-paths-manifest.json +3 -0
  53. package/dashboard/.next/standalone/dashboard/.next/server/app/icon.svg/route/build-manifest.json +12 -0
  54. package/dashboard/.next/standalone/dashboard/.next/server/app/icon.svg/route.js +7 -0
  55. package/dashboard/.next/standalone/dashboard/.next/server/app/icon.svg/route.js.map +5 -0
  56. package/dashboard/.next/standalone/dashboard/.next/server/app/icon.svg/route.js.nft.json +1 -0
  57. package/dashboard/.next/standalone/dashboard/.next/server/app/icon.svg.body +1 -0
  58. package/dashboard/.next/standalone/dashboard/.next/server/app/icon.svg.meta +1 -0
  59. package/dashboard/.next/standalone/dashboard/.next/server/app/page/app-paths-manifest.json +3 -0
  60. package/dashboard/.next/standalone/dashboard/.next/server/app/page/build-manifest.json +21 -0
  61. package/dashboard/.next/standalone/dashboard/.next/server/app/page/next-font-manifest.json +6 -0
  62. package/dashboard/.next/standalone/dashboard/.next/server/app/page/react-loadable-manifest.json +1 -0
  63. package/dashboard/.next/standalone/dashboard/.next/server/app/page/server-reference-manifest.json +4 -0
  64. package/dashboard/.next/standalone/dashboard/.next/server/app/page.js +18 -0
  65. package/dashboard/.next/standalone/dashboard/.next/server/app/page.js.map +5 -0
  66. package/dashboard/.next/standalone/dashboard/.next/server/app/page.js.nft.json +1 -0
  67. package/dashboard/.next/standalone/dashboard/.next/server/app/page_client-reference-manifest.js +3 -0
  68. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/[id]/page/app-paths-manifest.json +3 -0
  69. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/[id]/page/build-manifest.json +21 -0
  70. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/[id]/page/next-font-manifest.json +6 -0
  71. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/[id]/page/react-loadable-manifest.json +1 -0
  72. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/[id]/page/server-reference-manifest.json +4 -0
  73. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/[id]/page.js +18 -0
  74. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/[id]/page.js.map +5 -0
  75. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/[id]/page.js.nft.json +1 -0
  76. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/[id]/page_client-reference-manifest.js +3 -0
  77. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/page/app-paths-manifest.json +3 -0
  78. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/page/build-manifest.json +21 -0
  79. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/page/next-font-manifest.json +6 -0
  80. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/page/react-loadable-manifest.json +1 -0
  81. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/page/server-reference-manifest.json +4 -0
  82. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/page.js +17 -0
  83. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/page.js.map +5 -0
  84. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/page.js.nft.json +1 -0
  85. package/dashboard/.next/standalone/dashboard/.next/server/app/runs/page_client-reference-manifest.js +3 -0
  86. package/dashboard/.next/standalone/dashboard/.next/server/app/setup/page/app-paths-manifest.json +3 -0
  87. package/dashboard/.next/standalone/dashboard/.next/server/app/setup/page/build-manifest.json +21 -0
  88. package/dashboard/.next/standalone/dashboard/.next/server/app/setup/page/next-font-manifest.json +6 -0
  89. package/dashboard/.next/standalone/dashboard/.next/server/app/setup/page/react-loadable-manifest.json +1 -0
  90. package/dashboard/.next/standalone/dashboard/.next/server/app/setup/page/server-reference-manifest.json +4 -0
  91. package/dashboard/.next/standalone/dashboard/.next/server/app/setup/page.js +17 -0
  92. package/dashboard/.next/standalone/dashboard/.next/server/app/setup/page.js.map +5 -0
  93. package/dashboard/.next/standalone/dashboard/.next/server/app/setup/page.js.nft.json +1 -0
  94. package/dashboard/.next/standalone/dashboard/.next/server/app/setup/page_client-reference-manifest.js +3 -0
  95. package/dashboard/.next/standalone/dashboard/.next/server/app-paths-manifest.json +11 -0
  96. package/dashboard/.next/standalone/dashboard/.next/server/chunks/[externals]__01t2nd50u5k0d._.js +3 -0
  97. package/dashboard/.next/standalone/dashboard/.next/server/chunks/[externals]__0bwf06g0pqv3h._.js +3 -0
  98. package/dashboard/.next/standalone/dashboard/.next/server/chunks/[externals]__1p2j9_5g429uh._.js +3 -0
  99. package/dashboard/.next/standalone/dashboard/.next/server/chunks/[root-of-the-server]__0et0fkanwxxur._.js +68 -0
  100. package/dashboard/.next/standalone/dashboard/.next/server/chunks/[root-of-the-server]__15bjnu5yieigz._.js +5 -0
  101. package/dashboard/.next/standalone/dashboard/.next/server/chunks/[turbopack]_runtime.js +937 -0
  102. package/dashboard/.next/standalone/dashboard/.next/server/chunks/_1-uxi_ka-dy7f._.js +61 -0
  103. package/dashboard/.next/standalone/dashboard/.next/server/chunks/_1cf_ofyvvip7w._.js +3 -0
  104. package/dashboard/.next/standalone/dashboard/.next/server/chunks/dashboard__next-internal_server_app_api_unharness_route_actions_0idahp0hszu62.js +3 -0
  105. package/dashboard/.next/standalone/dashboard/.next/server/chunks/dashboard__next-internal_server_app_icon_svg_route_actions_04_c50qf4s1__.js +3 -0
  106. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0e4r8nifm7acf._.js +3 -0
  107. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0iouqk55sdstw._.js +3 -0
  108. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0py1t7q9ntzgc._.js +3 -0
  109. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0qcba441g9j7r._.js +3 -0
  110. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0wa-x71951lbx._.js +3 -0
  111. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__19fljo_8kk85l._.js +3 -0
  112. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__1u6lhnfk61fw4._.js +3 -0
  113. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__1uyyd8v8upnf3._.js +14 -0
  114. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__20ejk3g6jcji-._.js +110 -0
  115. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[turbopack]_runtime.js +937 -0
  116. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/_01bzqkhgvulml._.js +3 -0
  117. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard__next-internal_server_app__global-error_page_actions_1tjktvdwype04.js +3 -0
  118. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard__next-internal_server_app__not-found_page_actions_1chp6c-vsqob8.js +3 -0
  119. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard__next-internal_server_app_compare_page_actions_0yvj-bxnypqy9.js +3 -0
  120. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard__next-internal_server_app_page_actions_1wdlm_33hg0oy.js +3 -0
  121. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard__next-internal_server_app_runs_[id]_page_actions_1yv7i200qm874.js +3 -0
  122. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard__next-internal_server_app_runs_page_actions_0j5zwb1ilucsr.js +3 -0
  123. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard__next-internal_server_app_setup_page_actions_0oowi28yqn1aa.js +3 -0
  124. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_app_charts_tsx_0tszf3h61tpzg._.js +3 -0
  125. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_app_compare_page_tsx_0f6y9yl_umbwg._.js +3 -0
  126. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_app_page_tsx_0ih6_j2n6j4ya._.js +3 -0
  127. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_app_runs_page_tsx_0uftws_qldjqo._.js +3 -0
  128. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_app_setup_page_tsx_0k3bphpyf611u._.js +3 -0
  129. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_01xbj_9zg44kw._.js +33 -0
  130. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_0gxlxpuufujz9._.js +33 -0
  131. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_0janj0i6dqko7._.js +6 -0
  132. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_0vn8q0im74u1u._.js +3 -0
  133. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j32_ibz4._.js +3 -0
  134. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9mbf-fh.js +3 -0
  135. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892nagajq.js +3 -0
  136. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0xky89qu.js +3 -0
  137. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_compiled_@edge-runtime_cookies_index_1kiz_an963mbg.js +3 -0
  138. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0_ozp0yuu4qg1.js +3 -0
  139. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0j87yuz4ra2av.js +3 -0
  140. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0tu9pkc8da8u2.js +3 -0
  141. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z4y02i7.js +3 -0
  142. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1e2gs9uhe-2mi.js +3 -0
  143. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1s_41xd6mnrrx.js +3 -0
  144. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1yvj-i4d766aw.js +3 -0
  145. package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/src_queries_ts_1qvec252dciw9._.js +17 -0
  146. package/dashboard/.next/standalone/dashboard/.next/server/functions-config-manifest.json +14 -0
  147. package/dashboard/.next/standalone/dashboard/.next/server/middleware-build-manifest.js +94 -0
  148. package/dashboard/.next/standalone/dashboard/.next/server/middleware-manifest.json +6 -0
  149. package/dashboard/.next/standalone/dashboard/.next/server/middleware.js +5 -0
  150. package/dashboard/.next/standalone/dashboard/.next/server/next-font-manifest.js +1 -0
  151. package/dashboard/.next/standalone/dashboard/.next/server/next-font-manifest.json +6 -0
  152. package/dashboard/.next/standalone/dashboard/.next/server/pages/500.html +1 -0
  153. package/dashboard/.next/standalone/dashboard/.next/server/pages-manifest.json +3 -0
  154. package/dashboard/.next/standalone/dashboard/.next/server/prefetch-hints.json +11 -0
  155. package/dashboard/.next/standalone/dashboard/.next/server/preview-props.json +5 -0
  156. package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.js +1 -0
  157. package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.json +5 -0
  158. package/dashboard/.next/standalone/dashboard/.next/static/A2wd-rlgRPwFBSGiEbhBO/_buildManifest.js +11 -0
  159. package/dashboard/.next/standalone/dashboard/.next/static/A2wd-rlgRPwFBSGiEbhBO/_clientMiddlewareManifest.js +6 -0
  160. package/dashboard/.next/standalone/dashboard/.next/static/A2wd-rlgRPwFBSGiEbhBO/_ssgManifest.js +1 -0
  161. package/dashboard/.next/standalone/dashboard/.next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  162. package/dashboard/.next/standalone/dashboard/.next/static/chunks/0r-yur70-ku2o.js +22 -0
  163. package/dashboard/.next/standalone/dashboard/.next/static/chunks/0umf92h1sb77c.js +1 -0
  164. package/dashboard/.next/standalone/dashboard/.next/static/chunks/27_tnesx4_7-4.js +1 -0
  165. package/dashboard/.next/standalone/dashboard/.next/static/chunks/2bs2_lhv9t90b.css +1 -0
  166. package/dashboard/.next/standalone/dashboard/.next/static/chunks/3cfn99dbrcvvp.js +31 -0
  167. package/dashboard/.next/standalone/dashboard/.next/static/chunks/3wbm-994r45kr.js +1 -0
  168. package/dashboard/.next/standalone/dashboard/.next/static/chunks/turbopack-3-ry682tkyiqk.js +1 -0
  169. package/dashboard/.next/standalone/dashboard/.next/static/media/icon.2s3751p6y-0bd.svg +1 -0
  170. package/dashboard/.next/standalone/dashboard/.next/static/media/pricing-snapshot.2oehiifqte0u8.json +886 -0
  171. package/dashboard/.next/standalone/dashboard/server.js +38 -0
  172. package/dashboard/.next/standalone/dashboard/tsconfig.json +38 -0
  173. package/dashboard/.next/standalone/node_modules/@next/env/dist/index.js +1 -0
  174. package/dashboard/.next/standalone/node_modules/@next/env/package.json +36 -0
  175. package/dashboard/.next/standalone/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +6 -0
  176. package/dashboard/.next/standalone/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +38 -0
  177. package/dashboard/.next/standalone/node_modules/@swc/helpers/esm/_interop_require_default.js +4 -0
  178. package/dashboard/.next/standalone/node_modules/@swc/helpers/esm/_interop_require_wildcard.js +36 -0
  179. package/dashboard/.next/standalone/node_modules/@swc/helpers/package.json +705 -0
  180. package/dashboard/.next/standalone/node_modules/client-only/index.js +0 -0
  181. package/dashboard/.next/standalone/node_modules/client-only/package.json +19 -0
  182. package/dashboard/.next/standalone/node_modules/detect-libc/lib/detect-libc.js +313 -0
  183. package/dashboard/.next/standalone/node_modules/detect-libc/lib/elf.js +39 -0
  184. package/dashboard/.next/standalone/node_modules/detect-libc/lib/filesystem.js +51 -0
  185. package/dashboard/.next/standalone/node_modules/detect-libc/lib/process.js +24 -0
  186. package/dashboard/.next/standalone/node_modules/detect-libc/package.json +44 -0
  187. package/dashboard/.next/standalone/node_modules/next/dist/build/adapter/setup-node-env.external.js +15 -0
  188. package/dashboard/.next/standalone/node_modules/next/dist/build/define-env.js +257 -0
  189. package/dashboard/.next/standalone/node_modules/next/dist/build/duration-to-string.js +98 -0
  190. package/dashboard/.next/standalone/node_modules/next/dist/build/get-supported-browsers.js +38 -0
  191. package/dashboard/.next/standalone/node_modules/next/dist/build/next-config-ts/require-hook.js +85 -0
  192. package/dashboard/.next/standalone/node_modules/next/dist/build/next-config-ts/transpile-config.js +136 -0
  193. package/dashboard/.next/standalone/node_modules/next/dist/build/nft.js +119 -0
  194. package/dashboard/.next/standalone/node_modules/next/dist/build/output/format.js +84 -0
  195. package/dashboard/.next/standalone/node_modules/next/dist/build/output/log.js +135 -0
  196. package/dashboard/.next/standalone/node_modules/next/dist/build/segment-config/app/app-segment-config.js +192 -0
  197. package/dashboard/.next/standalone/node_modules/next/dist/build/segment-config/app/app-segments.js +238 -0
  198. package/dashboard/.next/standalone/node_modules/next/dist/build/segment-config/app/collect-root-param-keys.js +48 -0
  199. package/dashboard/.next/standalone/node_modules/next/dist/build/static-paths/app/extract-pathname-route-param-segments-from-loader-tree.js +143 -0
  200. package/dashboard/.next/standalone/node_modules/next/dist/build/static-paths/app.js +880 -0
  201. package/dashboard/.next/standalone/node_modules/next/dist/build/static-paths/pages.js +137 -0
  202. package/dashboard/.next/standalone/node_modules/next/dist/build/static-paths/param-matching.js +200 -0
  203. package/dashboard/.next/standalone/node_modules/next/dist/build/static-paths/utils.js +119 -0
  204. package/dashboard/.next/standalone/node_modules/next/dist/build/swc/helpers.js +15 -0
  205. package/dashboard/.next/standalone/node_modules/next/dist/build/swc/index.js +1339 -0
  206. package/dashboard/.next/standalone/node_modules/next/dist/build/swc/install-bindings.js +30 -0
  207. package/dashboard/.next/standalone/node_modules/next/dist/build/swc/jest-transformer.js +77 -0
  208. package/dashboard/.next/standalone/node_modules/next/dist/build/swc/loaderWorkerPool.js +40 -0
  209. package/dashboard/.next/standalone/node_modules/next/dist/build/swc/options.js +411 -0
  210. package/dashboard/.next/standalone/node_modules/next/dist/build/swc/types.js +6 -0
  211. package/dashboard/.next/standalone/node_modules/next/dist/build/utils.js +1348 -0
  212. package/dashboard/.next/standalone/node_modules/next/dist/cli/next-test.js +175 -0
  213. package/dashboard/.next/standalone/node_modules/next/dist/client/add-base-path.js +24 -0
  214. package/dashboard/.next/standalone/node_modules/next/dist/client/app-call-server.js +32 -0
  215. package/dashboard/.next/standalone/node_modules/next/dist/client/app-find-source-map-url.js +39 -0
  216. package/dashboard/.next/standalone/node_modules/next/dist/client/assign-location.js +29 -0
  217. package/dashboard/.next/standalone/node_modules/next/dist/client/components/app-router-announcer.js +78 -0
  218. package/dashboard/.next/standalone/node_modules/next/dist/client/components/app-router-headers.js +128 -0
  219. package/dashboard/.next/standalone/node_modules/next/dist/client/components/app-router-instance.js +263 -0
  220. package/dashboard/.next/standalone/node_modules/next/dist/client/components/app-router-state.js +527 -0
  221. package/dashboard/.next/standalone/node_modules/next/dist/client/components/app-router-utils.js +58 -0
  222. package/dashboard/.next/standalone/node_modules/next/dist/client/components/app-router.js +531 -0
  223. package/dashboard/.next/standalone/node_modules/next/dist/client/components/builtin/default.js +35 -0
  224. package/dashboard/.next/standalone/node_modules/next/dist/client/components/builtin/error-styles.js +165 -0
  225. package/dashboard/.next/standalone/node_modules/next/dist/client/components/builtin/global-error.js +100 -0
  226. package/dashboard/.next/standalone/node_modules/next/dist/client/components/dev-root-http-access-fallback-boundary.js +48 -0
  227. package/dashboard/.next/standalone/node_modules/next/dist/client/components/error-boundary.js +148 -0
  228. package/dashboard/.next/standalone/node_modules/next/dist/client/components/errors/graceful-degrade-boundary.js +86 -0
  229. package/dashboard/.next/standalone/node_modules/next/dist/client/components/errors/root-error-boundary.js +41 -0
  230. package/dashboard/.next/standalone/node_modules/next/dist/client/components/forbidden.js +40 -0
  231. package/dashboard/.next/standalone/node_modules/next/dist/client/components/handle-isr-error.js +45 -0
  232. package/dashboard/.next/standalone/node_modules/next/dist/client/components/hooks-server-context.js +42 -0
  233. package/dashboard/.next/standalone/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js +125 -0
  234. package/dashboard/.next/standalone/node_modules/next/dist/client/components/http-access-fallback/http-access-fallback.js +72 -0
  235. package/dashboard/.next/standalone/node_modules/next/dist/client/components/instant-samples.js +127 -0
  236. package/dashboard/.next/standalone/node_modules/next/dist/client/components/is-next-router-error.js +23 -0
  237. package/dashboard/.next/standalone/node_modules/next/dist/client/components/links.js +315 -0
  238. package/dashboard/.next/standalone/node_modules/next/dist/client/components/nav-failure-handler.js +61 -0
  239. package/dashboard/.next/standalone/node_modules/next/dist/client/components/navigation-devtools.js +126 -0
  240. package/dashboard/.next/standalone/node_modules/next/dist/client/components/navigation-dynamic-rendering.js +38 -0
  241. package/dashboard/.next/standalone/node_modules/next/dist/client/components/navigation-untracked.js +68 -0
  242. package/dashboard/.next/standalone/node_modules/next/dist/client/components/navigation.js +242 -0
  243. package/dashboard/.next/standalone/node_modules/next/dist/client/components/navigation.react-server.js +71 -0
  244. package/dashboard/.next/standalone/node_modules/next/dist/client/components/navigator.js +73 -0
  245. package/dashboard/.next/standalone/node_modules/next/dist/client/components/not-found.js +38 -0
  246. package/dashboard/.next/standalone/node_modules/next/dist/client/components/offline.js +172 -0
  247. package/dashboard/.next/standalone/node_modules/next/dist/client/components/prefetch.js +83 -0
  248. package/dashboard/.next/standalone/node_modules/next/dist/client/components/readonly-url-search-params.js +41 -0
  249. package/dashboard/.next/standalone/node_modules/next/dist/client/components/redirect-boundary.js +107 -0
  250. package/dashboard/.next/standalone/node_modules/next/dist/client/components/redirect-error.js +43 -0
  251. package/dashboard/.next/standalone/node_modules/next/dist/client/components/redirect-status-code.js +24 -0
  252. package/dashboard/.next/standalone/node_modules/next/dist/client/components/redirect.js +79 -0
  253. package/dashboard/.next/standalone/node_modules/next/dist/client/components/render-tree.js +1439 -0
  254. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/compute-changed-path.js +213 -0
  255. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js +21 -0
  256. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/create-initial-router-state.js +174 -0
  257. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/create-router-cache-key.js +26 -0
  258. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/create-segment-key.js +42 -0
  259. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +624 -0
  260. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/is-navigating-to-new-root-layout.js +70 -0
  261. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/reducers/committed-state.js +49 -0
  262. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/reducers/has-interception-route-in-current-tree.js +38 -0
  263. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/reducers/hmr-refresh-reducer.js +29 -0
  264. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js +56 -0
  265. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/reducers/refresh-reducer.js +93 -0
  266. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js +78 -0
  267. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/reducers/server-action-reducer.js +350 -0
  268. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/reducers/server-patch-reducer.js +67 -0
  269. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js +70 -0
  270. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/router-reducer.js +66 -0
  271. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js +66 -0
  272. package/dashboard/.next/standalone/node_modules/next/dist/client/components/router-transition.js +135 -0
  273. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/bfcache.js +120 -0
  274. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/cache-key.js +56 -0
  275. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/cache-map.js +326 -0
  276. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/cache.js +2671 -0
  277. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/decode-server-response.js +419 -0
  278. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/fetch.js +37 -0
  279. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/lru.js +152 -0
  280. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/navigation-testing-lock.js +415 -0
  281. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/optimistic-routes.js +643 -0
  282. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/scheduler.js +1809 -0
  283. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/types.js +93 -0
  284. package/dashboard/.next/standalone/node_modules/next/dist/client/components/segment-cache/vary-path.js +340 -0
  285. package/dashboard/.next/standalone/node_modules/next/dist/client/components/sequential-router-queue.js +163 -0
  286. package/dashboard/.next/standalone/node_modules/next/dist/client/components/server-async-storage.js +43 -0
  287. package/dashboard/.next/standalone/node_modules/next/dist/client/components/static-generation-bailout.js +42 -0
  288. package/dashboard/.next/standalone/node_modules/next/dist/client/components/unauthorized.js +41 -0
  289. package/dashboard/.next/standalone/node_modules/next/dist/client/components/unrecognized-action-error.js +39 -0
  290. package/dashboard/.next/standalone/node_modules/next/dist/client/components/unresolved-thenable.js +23 -0
  291. package/dashboard/.next/standalone/node_modules/next/dist/client/components/unstable-rethrow.js +31 -0
  292. package/dashboard/.next/standalone/node_modules/next/dist/client/components/use-action-queue.js +140 -0
  293. package/dashboard/.next/standalone/node_modules/next/dist/client/components/use-offline.js +68 -0
  294. package/dashboard/.next/standalone/node_modules/next/dist/client/dev/debug-channel.js +111 -0
  295. package/dashboard/.next/standalone/node_modules/next/dist/client/flight-data-helpers.js +182 -0
  296. package/dashboard/.next/standalone/node_modules/next/dist/client/has-base-path.js +23 -0
  297. package/dashboard/.next/standalone/node_modules/next/dist/client/lib/console.js +177 -0
  298. package/dashboard/.next/standalone/node_modules/next/dist/client/lib/javascript-url.js +32 -0
  299. package/dashboard/.next/standalone/node_modules/next/dist/client/navigation-build-id.js +53 -0
  300. package/dashboard/.next/standalone/node_modules/next/dist/client/normalize-trailing-slash.js +37 -0
  301. package/dashboard/.next/standalone/node_modules/next/dist/client/remove-base-path.js +32 -0
  302. package/dashboard/.next/standalone/node_modules/next/dist/client/route-params.js +271 -0
  303. package/dashboard/.next/standalone/node_modules/next/dist/client/sequential-call-server.js +45 -0
  304. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js +339 -0
  305. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/cookies/package.json +1 -0
  306. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/ponyfill/index.js +46 -0
  307. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/ponyfill/package.json +1 -0
  308. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/primitives/abort-controller.js.text.js +1 -0
  309. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/primitives/console.js.text.js +1 -0
  310. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/primitives/events.js.text.js +1 -0
  311. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/primitives/index.js +5 -0
  312. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/primitives/load.js +18713 -0
  313. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/primitives/package.json +1 -0
  314. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/primitives/stream.js +44 -0
  315. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/primitives/timers.js.text.js +1 -0
  316. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@edge-runtime/primitives/url.js.text.js +1 -0
  317. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@hapi/accept/index.js +1 -0
  318. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@hapi/accept/package.json +1 -0
  319. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/index.js +1 -0
  320. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/package.json +1 -0
  321. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@napi-rs/triples/index.js +1 -0
  322. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@napi-rs/triples/package.json +1 -0
  323. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@opentelemetry/api/index.js +1 -0
  324. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@opentelemetry/api/package.json +1 -0
  325. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@vercel/detect-agent/index.js +1 -0
  326. package/dashboard/.next/standalone/node_modules/next/dist/compiled/@vercel/detect-agent/package.json +1 -0
  327. package/dashboard/.next/standalone/node_modules/next/dist/compiled/async-retry/index.js +1 -0
  328. package/dashboard/.next/standalone/node_modules/next/dist/compiled/async-retry/package.json +1 -0
  329. package/dashboard/.next/standalone/node_modules/next/dist/compiled/async-sema/index.js +1 -0
  330. package/dashboard/.next/standalone/node_modules/next/dist/compiled/async-sema/package.json +1 -0
  331. package/dashboard/.next/standalone/node_modules/next/dist/compiled/busboy/index.js +1 -0
  332. package/dashboard/.next/standalone/node_modules/next/dist/compiled/busboy/package.json +1 -0
  333. package/dashboard/.next/standalone/node_modules/next/dist/compiled/bytes/index.js +8 -0
  334. package/dashboard/.next/standalone/node_modules/next/dist/compiled/bytes/package.json +1 -0
  335. package/dashboard/.next/standalone/node_modules/next/dist/compiled/ci-info/index.js +1 -0
  336. package/dashboard/.next/standalone/node_modules/next/dist/compiled/ci-info/package.json +1 -0
  337. package/dashboard/.next/standalone/node_modules/next/dist/compiled/commander/index.js +1 -0
  338. package/dashboard/.next/standalone/node_modules/next/dist/compiled/commander/package.json +1 -0
  339. package/dashboard/.next/standalone/node_modules/next/dist/compiled/comment-json/index.js +7 -0
  340. package/dashboard/.next/standalone/node_modules/next/dist/compiled/comment-json/package.json +1 -0
  341. package/dashboard/.next/standalone/node_modules/next/dist/compiled/compression/index.js +58 -0
  342. package/dashboard/.next/standalone/node_modules/next/dist/compiled/compression/package.json +1 -0
  343. package/dashboard/.next/standalone/node_modules/next/dist/compiled/conf/index.js +3 -0
  344. package/dashboard/.next/standalone/node_modules/next/dist/compiled/conf/package.json +1 -0
  345. package/dashboard/.next/standalone/node_modules/next/dist/compiled/content-disposition/index.js +6 -0
  346. package/dashboard/.next/standalone/node_modules/next/dist/compiled/content-disposition/package.json +1 -0
  347. package/dashboard/.next/standalone/node_modules/next/dist/compiled/cookie/index.js +7 -0
  348. package/dashboard/.next/standalone/node_modules/next/dist/compiled/cookie/package.json +1 -0
  349. package/dashboard/.next/standalone/node_modules/next/dist/compiled/cross-spawn/index.js +1 -0
  350. package/dashboard/.next/standalone/node_modules/next/dist/compiled/cross-spawn/package.json +1 -0
  351. package/dashboard/.next/standalone/node_modules/next/dist/compiled/debug/index.js +1 -0
  352. package/dashboard/.next/standalone/node_modules/next/dist/compiled/debug/package.json +1 -0
  353. package/dashboard/.next/standalone/node_modules/next/dist/compiled/edge-runtime/index.js +1 -0
  354. package/dashboard/.next/standalone/node_modules/next/dist/compiled/edge-runtime/package.json +1 -0
  355. package/dashboard/.next/standalone/node_modules/next/dist/compiled/find-up/index.js +1 -0
  356. package/dashboard/.next/standalone/node_modules/next/dist/compiled/find-up/package.json +1 -0
  357. package/dashboard/.next/standalone/node_modules/next/dist/compiled/fresh/index.js +8 -0
  358. package/dashboard/.next/standalone/node_modules/next/dist/compiled/fresh/package.json +1 -0
  359. package/dashboard/.next/standalone/node_modules/next/dist/compiled/hash.js/sha256/256.js +1 -0
  360. package/dashboard/.next/standalone/node_modules/next/dist/compiled/hash.js/sha256/package.json +1 -0
  361. package/dashboard/.next/standalone/node_modules/next/dist/compiled/httpxy/index.js +1 -0
  362. package/dashboard/.next/standalone/node_modules/next/dist/compiled/httpxy/package.json +1 -0
  363. package/dashboard/.next/standalone/node_modules/next/dist/compiled/image-detector/detector.js +1 -0
  364. package/dashboard/.next/standalone/node_modules/next/dist/compiled/image-size/index.js +1 -0
  365. package/dashboard/.next/standalone/node_modules/next/dist/compiled/image-size/package.json +1 -0
  366. package/dashboard/.next/standalone/node_modules/next/dist/compiled/ipaddr.js/ipaddr.js +1 -0
  367. package/dashboard/.next/standalone/node_modules/next/dist/compiled/ipaddr.js/package.json +1 -0
  368. package/dashboard/.next/standalone/node_modules/next/dist/compiled/is-animated/index.js +1 -0
  369. package/dashboard/.next/standalone/node_modules/next/dist/compiled/is-animated/package.json +1 -0
  370. package/dashboard/.next/standalone/node_modules/next/dist/compiled/is-docker/index.js +1 -0
  371. package/dashboard/.next/standalone/node_modules/next/dist/compiled/is-docker/package.json +1 -0
  372. package/dashboard/.next/standalone/node_modules/next/dist/compiled/is-wsl/index.js +1 -0
  373. package/dashboard/.next/standalone/node_modules/next/dist/compiled/is-wsl/package.json +1 -0
  374. package/dashboard/.next/standalone/node_modules/next/dist/compiled/jsonwebtoken/index.js +11 -0
  375. package/dashboard/.next/standalone/node_modules/next/dist/compiled/jsonwebtoken/package.json +1 -0
  376. package/dashboard/.next/standalone/node_modules/next/dist/compiled/nanoid/index.cjs +1 -0
  377. package/dashboard/.next/standalone/node_modules/next/dist/compiled/nanoid/package.json +1 -0
  378. package/dashboard/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +327 -0
  379. package/dashboard/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +327 -0
  380. package/dashboard/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +8 -0
  381. package/dashboard/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +20 -0
  382. package/dashboard/.next/standalone/node_modules/next/dist/compiled/p-limit/index.js +1 -0
  383. package/dashboard/.next/standalone/node_modules/next/dist/compiled/p-limit/package.json +1 -0
  384. package/dashboard/.next/standalone/node_modules/next/dist/compiled/p-queue/index.js +1 -0
  385. package/dashboard/.next/standalone/node_modules/next/dist/compiled/p-queue/package.json +1 -0
  386. package/dashboard/.next/standalone/node_modules/next/dist/compiled/path-browserify/index.js +1 -0
  387. package/dashboard/.next/standalone/node_modules/next/dist/compiled/path-browserify/package.json +1 -0
  388. package/dashboard/.next/standalone/node_modules/next/dist/compiled/path-to-regexp/index.js +1 -0
  389. package/dashboard/.next/standalone/node_modules/next/dist/compiled/path-to-regexp/package.json +1 -0
  390. package/dashboard/.next/standalone/node_modules/next/dist/compiled/picomatch/index.js +1 -0
  391. package/dashboard/.next/standalone/node_modules/next/dist/compiled/picomatch/package.json +1 -0
  392. package/dashboard/.next/standalone/node_modules/next/dist/compiled/react-is/cjs/react-is.development.js +133 -0
  393. package/dashboard/.next/standalone/node_modules/next/dist/compiled/react-is/cjs/react-is.production.js +130 -0
  394. package/dashboard/.next/standalone/node_modules/next/dist/compiled/react-is/index.js +7 -0
  395. package/dashboard/.next/standalone/node_modules/next/dist/compiled/react-is/package.json +26 -0
  396. package/dashboard/.next/standalone/node_modules/next/dist/compiled/regenerator-runtime/package.json +19 -0
  397. package/dashboard/.next/standalone/node_modules/next/dist/compiled/regenerator-runtime/runtime.js +729 -0
  398. package/dashboard/.next/standalone/node_modules/next/dist/compiled/semver/index.js +1 -0
  399. package/dashboard/.next/standalone/node_modules/next/dist/compiled/semver/package.json +1 -0
  400. package/dashboard/.next/standalone/node_modules/next/dist/compiled/send/index.js +70 -0
  401. package/dashboard/.next/standalone/node_modules/next/dist/compiled/send/package.json +1 -0
  402. package/dashboard/.next/standalone/node_modules/next/dist/compiled/source-map/package.json +1 -0
  403. package/dashboard/.next/standalone/node_modules/next/dist/compiled/source-map/source-map.js +1 -0
  404. package/dashboard/.next/standalone/node_modules/next/dist/compiled/stacktrace-parser/package.json +1 -0
  405. package/dashboard/.next/standalone/node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js +1 -0
  406. package/dashboard/.next/standalone/node_modules/next/dist/compiled/string-hash/index.js +1 -0
  407. package/dashboard/.next/standalone/node_modules/next/dist/compiled/string-hash/package.json +1 -0
  408. package/dashboard/.next/standalone/node_modules/next/dist/compiled/strip-ansi/index.js +1 -0
  409. package/dashboard/.next/standalone/node_modules/next/dist/compiled/strip-ansi/package.json +1 -0
  410. package/dashboard/.next/standalone/node_modules/next/dist/compiled/superstruct/index.cjs +1 -0
  411. package/dashboard/.next/standalone/node_modules/next/dist/compiled/superstruct/package.json +1 -0
  412. package/dashboard/.next/standalone/node_modules/next/dist/compiled/tar/index.min.js +1 -0
  413. package/dashboard/.next/standalone/node_modules/next/dist/compiled/tar/package.json +1 -0
  414. package/dashboard/.next/standalone/node_modules/next/dist/compiled/text-table/index.js +1 -0
  415. package/dashboard/.next/standalone/node_modules/next/dist/compiled/text-table/package.json +1 -0
  416. package/dashboard/.next/standalone/node_modules/next/dist/compiled/watchpack/package.json +1 -0
  417. package/dashboard/.next/standalone/node_modules/next/dist/compiled/watchpack/watchpack.js +1 -0
  418. package/dashboard/.next/standalone/node_modules/next/dist/compiled/write-file-atomic/index.js +1 -0
  419. package/dashboard/.next/standalone/node_modules/next/dist/compiled/write-file-atomic/package.json +1 -0
  420. package/dashboard/.next/standalone/node_modules/next/dist/compiled/ws/index.js +1 -0
  421. package/dashboard/.next/standalone/node_modules/next/dist/compiled/ws/package.json +1 -0
  422. package/dashboard/.next/standalone/node_modules/next/dist/compiled/zod/index.cjs +1 -0
  423. package/dashboard/.next/standalone/node_modules/next/dist/compiled/zod/package.json +1 -0
  424. package/dashboard/.next/standalone/node_modules/next/dist/compiled/zod-validation-error/index.js +1 -0
  425. package/dashboard/.next/standalone/node_modules/next/dist/compiled/zod-validation-error/package.json +1 -0
  426. package/dashboard/.next/standalone/node_modules/next/dist/experimental/testmode/context.js +57 -0
  427. package/dashboard/.next/standalone/node_modules/next/dist/experimental/testmode/fetch.js +150 -0
  428. package/dashboard/.next/standalone/node_modules/next/dist/experimental/testmode/httpget.js +33 -0
  429. package/dashboard/.next/standalone/node_modules/next/dist/experimental/testmode/server-edge.js +32 -0
  430. package/dashboard/.next/standalone/node_modules/next/dist/experimental/testmode/server.js +73 -0
  431. package/dashboard/.next/standalone/node_modules/next/dist/export/helpers/create-incremental-cache.js +66 -0
  432. package/dashboard/.next/standalone/node_modules/next/dist/export/utils.js +37 -0
  433. package/dashboard/.next/standalone/node_modules/next/dist/lib/batcher.js +65 -0
  434. package/dashboard/.next/standalone/node_modules/next/dist/lib/build-custom-route.js +46 -0
  435. package/dashboard/.next/standalone/node_modules/next/dist/lib/bundler.js +168 -0
  436. package/dashboard/.next/standalone/node_modules/next/dist/lib/client-and-server-references.js +54 -0
  437. package/dashboard/.next/standalone/node_modules/next/dist/lib/coalesced-function.js +39 -0
  438. package/dashboard/.next/standalone/node_modules/next/dist/lib/compile-error.js +14 -0
  439. package/dashboard/.next/standalone/node_modules/next/dist/lib/constants.js +420 -0
  440. package/dashboard/.next/standalone/node_modules/next/dist/lib/create-client-router-filter.js +83 -0
  441. package/dashboard/.next/standalone/node_modules/next/dist/lib/default-transpiled-packages.json +1 -0
  442. package/dashboard/.next/standalone/node_modules/next/dist/lib/detect-typo.js +51 -0
  443. package/dashboard/.next/standalone/node_modules/next/dist/lib/dist-dir.js +88 -0
  444. package/dashboard/.next/standalone/node_modules/next/dist/lib/download-swc.js +175 -0
  445. package/dashboard/.next/standalone/node_modules/next/dist/lib/fallback.js +88 -0
  446. package/dashboard/.next/standalone/node_modules/next/dist/lib/file-exists.js +53 -0
  447. package/dashboard/.next/standalone/node_modules/next/dist/lib/find-config.js +102 -0
  448. package/dashboard/.next/standalone/node_modules/next/dist/lib/find-pages-dir.js +57 -0
  449. package/dashboard/.next/standalone/node_modules/next/dist/lib/find-root.js +280 -0
  450. package/dashboard/.next/standalone/node_modules/next/dist/lib/format-cli-help-output.js +84 -0
  451. package/dashboard/.next/standalone/node_modules/next/dist/lib/format-dynamic-import-path.js +43 -0
  452. package/dashboard/.next/standalone/node_modules/next/dist/lib/format-server-error.js +75 -0
  453. package/dashboard/.next/standalone/node_modules/next/dist/lib/framework/boundary-components.js +62 -0
  454. package/dashboard/.next/standalone/node_modules/next/dist/lib/framework/boundary-constants.js +36 -0
  455. package/dashboard/.next/standalone/node_modules/next/dist/lib/fs/rename.js +87 -0
  456. package/dashboard/.next/standalone/node_modules/next/dist/lib/fs/write-atomic.js +28 -0
  457. package/dashboard/.next/standalone/node_modules/next/dist/lib/generate-interception-routes-rewrites.js +52 -0
  458. package/dashboard/.next/standalone/node_modules/next/dist/lib/get-files-in-dir.js +33 -0
  459. package/dashboard/.next/standalone/node_modules/next/dist/lib/get-network-host.js +44 -0
  460. package/dashboard/.next/standalone/node_modules/next/dist/lib/get-package-version.js +118 -0
  461. package/dashboard/.next/standalone/node_modules/next/dist/lib/get-project-dir.js +51 -0
  462. package/dashboard/.next/standalone/node_modules/next/dist/lib/git-worktree.js +74 -0
  463. package/dashboard/.next/standalone/node_modules/next/dist/lib/has-necessary-dependencies.js +49 -0
  464. package/dashboard/.next/standalone/node_modules/next/dist/lib/helpers/get-cache-directory.js +62 -0
  465. package/dashboard/.next/standalone/node_modules/next/dist/lib/helpers/get-npx-command.js +29 -0
  466. package/dashboard/.next/standalone/node_modules/next/dist/lib/helpers/get-online.js +50 -0
  467. package/dashboard/.next/standalone/node_modules/next/dist/lib/helpers/get-pkg-manager.js +65 -0
  468. package/dashboard/.next/standalone/node_modules/next/dist/lib/helpers/get-registry.js +41 -0
  469. package/dashboard/.next/standalone/node_modules/next/dist/lib/helpers/get-reserved-port.js +116 -0
  470. package/dashboard/.next/standalone/node_modules/next/dist/lib/helpers/git.js +104 -0
  471. package/dashboard/.next/standalone/node_modules/next/dist/lib/helpers/install.js +83 -0
  472. package/dashboard/.next/standalone/node_modules/next/dist/lib/import-next-warning.js +50 -0
  473. package/dashboard/.next/standalone/node_modules/next/dist/lib/inline-static-env.js +108 -0
  474. package/dashboard/.next/standalone/node_modules/next/dist/lib/install-dependencies.js +40 -0
  475. package/dashboard/.next/standalone/node_modules/next/dist/lib/interop-default.js +16 -0
  476. package/dashboard/.next/standalone/node_modules/next/dist/lib/is-api-route.js +15 -0
  477. package/dashboard/.next/standalone/node_modules/next/dist/lib/is-app-page-route.js +15 -0
  478. package/dashboard/.next/standalone/node_modules/next/dist/lib/is-app-route-route.js +15 -0
  479. package/dashboard/.next/standalone/node_modules/next/dist/lib/is-edge-runtime.js +16 -0
  480. package/dashboard/.next/standalone/node_modules/next/dist/lib/is-error.js +66 -0
  481. package/dashboard/.next/standalone/node_modules/next/dist/lib/is-interception-route-rewrite.js +18 -0
  482. package/dashboard/.next/standalone/node_modules/next/dist/lib/is-internal-component.js +36 -0
  483. package/dashboard/.next/standalone/node_modules/next/dist/lib/is-serializable-props.js +82 -0
  484. package/dashboard/.next/standalone/node_modules/next/dist/lib/known-edge-safe-packages.json +1 -0
  485. package/dashboard/.next/standalone/node_modules/next/dist/lib/load-custom-routes.js +594 -0
  486. package/dashboard/.next/standalone/node_modules/next/dist/lib/memory/gc-observer.js +53 -0
  487. package/dashboard/.next/standalone/node_modules/next/dist/lib/memory/shutdown.js +29 -0
  488. package/dashboard/.next/standalone/node_modules/next/dist/lib/memory/startup.js +47 -0
  489. package/dashboard/.next/standalone/node_modules/next/dist/lib/memory/trace.js +109 -0
  490. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/constants.js +40 -0
  491. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/default-metadata.js +82 -0
  492. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/generate/icon-mark.js +22 -0
  493. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/generate/utils.js +52 -0
  494. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/get-metadata-route.js +162 -0
  495. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/index.js +18 -0
  496. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/is-metadata-route.js +221 -0
  497. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/metadata-context.js +18 -0
  498. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/metadata-elements.js +1498 -0
  499. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/metadata-parallel.js +175 -0
  500. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/metadata-resolution-primitives.js +467 -0
  501. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/metadata.js +174 -0
  502. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/resolve-metadata-parallel.js +632 -0
  503. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/resolve-metadata.js +485 -0
  504. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/resolvers/resolve-basics.js +232 -0
  505. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/resolvers/resolve-icons.js +56 -0
  506. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/resolvers/resolve-opengraph.js +199 -0
  507. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/resolvers/resolve-title.js +40 -0
  508. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/resolvers/resolve-url.js +135 -0
  509. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/types/alternative-urls-types.js +7 -0
  510. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/types/extra-types.js +9 -0
  511. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/types/icons.js +6 -0
  512. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/types/manifest-types.js +6 -0
  513. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/types/metadata-interface.js +18 -0
  514. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/types/metadata-types.js +10 -0
  515. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/types/opengraph-types.js +6 -0
  516. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/types/resolvers.js +6 -0
  517. package/dashboard/.next/standalone/node_modules/next/dist/lib/metadata/types/twitter-types.js +7 -0
  518. package/dashboard/.next/standalone/node_modules/next/dist/lib/mime-type.js +20 -0
  519. package/dashboard/.next/standalone/node_modules/next/dist/lib/mkcert.js +188 -0
  520. package/dashboard/.next/standalone/node_modules/next/dist/lib/multi-file-writer.js +75 -0
  521. package/dashboard/.next/standalone/node_modules/next/dist/lib/needs-experimental-react.js +16 -0
  522. package/dashboard/.next/standalone/node_modules/next/dist/lib/non-nullable.js +15 -0
  523. package/dashboard/.next/standalone/node_modules/next/dist/lib/normalize-path.js +21 -0
  524. package/dashboard/.next/standalone/node_modules/next/dist/lib/oxford-comma-list.js +15 -0
  525. package/dashboard/.next/standalone/node_modules/next/dist/lib/page-types.js +18 -0
  526. package/dashboard/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +181 -0
  527. package/dashboard/.next/standalone/node_modules/next/dist/lib/pick.js +19 -0
  528. package/dashboard/.next/standalone/node_modules/next/dist/lib/picocolors.js +187 -0
  529. package/dashboard/.next/standalone/node_modules/next/dist/lib/pretty-bytes.js +70 -0
  530. package/dashboard/.next/standalone/node_modules/next/dist/lib/profiles-dir.js +45 -0
  531. package/dashboard/.next/standalone/node_modules/next/dist/lib/realpath.js +20 -0
  532. package/dashboard/.next/standalone/node_modules/next/dist/lib/recursive-copy.js +76 -0
  533. package/dashboard/.next/standalone/node_modules/next/dist/lib/recursive-delete.js +176 -0
  534. package/dashboard/.next/standalone/node_modules/next/dist/lib/recursive-readdir.js +124 -0
  535. package/dashboard/.next/standalone/node_modules/next/dist/lib/redirect-status.js +46 -0
  536. package/dashboard/.next/standalone/node_modules/next/dist/lib/require-instrumentation-client.js +32 -0
  537. package/dashboard/.next/standalone/node_modules/next/dist/lib/resolve-build-paths.js +178 -0
  538. package/dashboard/.next/standalone/node_modules/next/dist/lib/resolve-from.js +57 -0
  539. package/dashboard/.next/standalone/node_modules/next/dist/lib/route-pattern-normalizer.js +107 -0
  540. package/dashboard/.next/standalone/node_modules/next/dist/lib/scheduler.js +64 -0
  541. package/dashboard/.next/standalone/node_modules/next/dist/lib/semver-noop.js +18 -0
  542. package/dashboard/.next/standalone/node_modules/next/dist/lib/server-external-packages.jsonc +103 -0
  543. package/dashboard/.next/standalone/node_modules/next/dist/lib/setup-exception-listeners.js +11 -0
  544. package/dashboard/.next/standalone/node_modules/next/dist/lib/static-env.js +88 -0
  545. package/dashboard/.next/standalone/node_modules/next/dist/lib/try-to-parse-path.js +67 -0
  546. package/dashboard/.next/standalone/node_modules/next/dist/lib/turbopack-cache-seed.js +171 -0
  547. package/dashboard/.next/standalone/node_modules/next/dist/lib/turbopack-warning.js +185 -0
  548. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/diagnosticFormatter.js +243 -0
  549. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/getTypeScriptConfiguration.js +61 -0
  550. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/getTypeScriptIntent.js +52 -0
  551. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/loadTsConfig.js +181 -0
  552. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/missingDependencyError.js +22 -0
  553. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/runTypeCheck.js +141 -0
  554. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/runTypeCheckCli.js +52 -0
  555. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/runTypeScriptCli.js +244 -0
  556. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/type-paths.js +51 -0
  557. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/writeAppTypeDeclarations.js +77 -0
  558. package/dashboard/.next/standalone/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js +395 -0
  559. package/dashboard/.next/standalone/node_modules/next/dist/lib/url.js +75 -0
  560. package/dashboard/.next/standalone/node_modules/next/dist/lib/verify-partytown-setup.js +100 -0
  561. package/dashboard/.next/standalone/node_modules/next/dist/lib/verify-root-layout.js +165 -0
  562. package/dashboard/.next/standalone/node_modules/next/dist/lib/verify-typescript-setup.js +271 -0
  563. package/dashboard/.next/standalone/node_modules/next/dist/lib/wait.js +19 -0
  564. package/dashboard/.next/standalone/node_modules/next/dist/lib/warn-missing-react-dependencies.js +33 -0
  565. package/dashboard/.next/standalone/node_modules/next/dist/lib/with-promise-cache.js +24 -0
  566. package/dashboard/.next/standalone/node_modules/next/dist/lib/worker.js +230 -0
  567. package/dashboard/.next/standalone/node_modules/next/dist/server/ReactDOMServerPages.js +16 -0
  568. package/dashboard/.next/standalone/node_modules/next/dist/server/accept-header.js +120 -0
  569. package/dashboard/.next/standalone/node_modules/next/dist/server/after/after-context.js +158 -0
  570. package/dashboard/.next/standalone/node_modules/next/dist/server/after/after.js +24 -0
  571. package/dashboard/.next/standalone/node_modules/next/dist/server/after/awaiter.js +70 -0
  572. package/dashboard/.next/standalone/node_modules/next/dist/server/after/builtin-request-context.js +38 -0
  573. package/dashboard/.next/standalone/node_modules/next/dist/server/after/index.js +21 -0
  574. package/dashboard/.next/standalone/node_modules/next/dist/server/after/run-with-after.js +35 -0
  575. package/dashboard/.next/standalone/node_modules/next/dist/server/api-utils/get-cookie-parser.js +22 -0
  576. package/dashboard/.next/standalone/node_modules/next/dist/server/api-utils/index.js +208 -0
  577. package/dashboard/.next/standalone/node_modules/next/dist/server/api-utils/node/api-resolver.js +355 -0
  578. package/dashboard/.next/standalone/node_modules/next/dist/server/api-utils/node/parse-body.js +67 -0
  579. package/dashboard/.next/standalone/node_modules/next/dist/server/api-utils/node/try-get-preview-data.js +89 -0
  580. package/dashboard/.next/standalone/node_modules/next/dist/server/api-utils/web.js +17 -0
  581. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/action-async-storage-instance.js +14 -0
  582. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/action-async-storage.external.js +13 -0
  583. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/action-handler.js +1088 -0
  584. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js +14 -0
  585. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/after-task-async-storage.external.js +13 -0
  586. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/app-render-prerender-utils.js +308 -0
  587. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/app-render-render-utils.js +72 -0
  588. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/app-render-scheduling.js +176 -0
  589. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/app-render.js +6632 -0
  590. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/async-local-storage.js +81 -0
  591. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/blocking-route-messages.js +230 -0
  592. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/cache-signal.js +207 -0
  593. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/collect-segment-data.js +1003 -0
  594. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/console-async-storage-instance.js +14 -0
  595. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/console-async-storage.external.js +13 -0
  596. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/create-component-styles-and-scripts.js +39 -0
  597. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/create-component-tree.js +782 -0
  598. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/create-error-handler.js +196 -0
  599. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/create-transport-tree-from-loader-tree.js +190 -0
  600. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/csrf-protection.js +86 -0
  601. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/debug-channel-server.js +47 -0
  602. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/debug-channel-server.node.js +60 -0
  603. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/debug-channel-server.web.js +56 -0
  604. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dev-validation-error-delivery.js +28 -0
  605. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dev-validation-events.js +26 -0
  606. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dev-validation-scheduler.js +86 -0
  607. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dev-validation-worker-globals.js +41 -0
  608. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dev-validation-worker-snapshot.js +81 -0
  609. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js +14 -0
  610. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js +36 -0
  611. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dynamic-rendering-client.js +124 -0
  612. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dynamic-rendering-validation.js +814 -0
  613. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/dynamic-rendering.js +334 -0
  614. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/encryption-utils-server.js +114 -0
  615. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/encryption-utils.js +89 -0
  616. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/encryption.js +248 -0
  617. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/entry-base.js +260 -0
  618. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/flight-render-result.js +28 -0
  619. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/get-asset-query-string.js +29 -0
  620. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/get-css-inlined-link-tags.js +45 -0
  621. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/get-layer-assets.js +69 -0
  622. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/get-preloadable-fonts.js +39 -0
  623. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +32 -0
  624. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/get-short-dynamic-param-type.js +25 -0
  625. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/has-loading-component-in-tree.js +19 -0
  626. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/instant-test-bootstrap.js +20 -0
  627. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js +31 -0
  628. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/instant-validation/boundary-impl.js +118 -0
  629. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js +38 -0
  630. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/instant-validation/instant-config.js +233 -0
  631. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/instant-validation/instant-samples.js +383 -0
  632. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/instant-validation/instant-validation-error.js +33 -0
  633. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/instant-validation/instant-validation.js +873 -0
  634. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/instant-validation/stream-utils.js +88 -0
  635. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/interop-default.js +17 -0
  636. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/make-get-server-inserted-html.js +91 -0
  637. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/manifests-singleton.js +399 -0
  638. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/metadata-insertion/create-server-inserted-metadata.js +29 -0
  639. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/module-loading/instrument-module-getter.js +32 -0
  640. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/module-loading/track-dynamic-import.js +49 -0
  641. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js +32 -0
  642. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js +62 -0
  643. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/parse-and-validate-flight-router-state.js +37 -0
  644. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/postponed-state.js +266 -0
  645. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/prospective-render-utils.js +70 -0
  646. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/react-large-shell-error.js +17 -0
  647. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/react-server.node.js +39 -0
  648. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/render-css-resource.js +57 -0
  649. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/render-in-browser.js +27 -0
  650. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/required-scripts.js +72 -0
  651. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/rsc/preloads.js +74 -0
  652. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/rsc/taint.js +75 -0
  653. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/segment-config/ensure-static.js +206 -0
  654. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/segment-explorer-path.js +128 -0
  655. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/server-inserted-html.js +77 -0
  656. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/staged-rendering.js +316 -0
  657. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/stale-time.js +101 -0
  658. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/stream-ops.js +155 -0
  659. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/stream-ops.node.js +848 -0
  660. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/stream-ops.web.js +233 -0
  661. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/strip-flight-headers.js +18 -0
  662. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/sync-io-messages.js +59 -0
  663. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/types.js +66 -0
  664. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/use-flight-response.js +204 -0
  665. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/vary-params.js +262 -0
  666. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/wait-for-response.js +36 -0
  667. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/walk-tree-with-flight-router-state.js +235 -0
  668. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/work-async-storage-instance.js +14 -0
  669. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/work-async-storage.external.js +13 -0
  670. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js +14 -0
  671. package/dashboard/.next/standalone/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js +260 -0
  672. package/dashboard/.next/standalone/node_modules/next/dist/server/async-storage/draft-mode-provider.js +58 -0
  673. package/dashboard/.next/standalone/node_modules/next/dist/server/async-storage/request-store.js +202 -0
  674. package/dashboard/.next/standalone/node_modules/next/dist/server/async-storage/with-store.js +6 -0
  675. package/dashboard/.next/standalone/node_modules/next/dist/server/async-storage/work-store.js +96 -0
  676. package/dashboard/.next/standalone/node_modules/next/dist/server/base-http/helpers.js +36 -0
  677. package/dashboard/.next/standalone/node_modules/next/dist/server/base-http/index.js +54 -0
  678. package/dashboard/.next/standalone/node_modules/next/dist/server/base-http/node.js +143 -0
  679. package/dashboard/.next/standalone/node_modules/next/dist/server/base-http/web.js +116 -0
  680. package/dashboard/.next/standalone/node_modules/next/dist/server/base-server.js +2181 -0
  681. package/dashboard/.next/standalone/node_modules/next/dist/server/body-streams.js +122 -0
  682. package/dashboard/.next/standalone/node_modules/next/dist/server/cache-dir.js +26 -0
  683. package/dashboard/.next/standalone/node_modules/next/dist/server/capsize-font-metrics.json +181516 -0
  684. package/dashboard/.next/standalone/node_modules/next/dist/server/ci-info.js +41 -0
  685. package/dashboard/.next/standalone/node_modules/next/dist/server/client-component-renderer-logger.js +171 -0
  686. package/dashboard/.next/standalone/node_modules/next/dist/server/config-schema.js +852 -0
  687. package/dashboard/.next/standalone/node_modules/next/dist/server/config-shared.js +417 -0
  688. package/dashboard/.next/standalone/node_modules/next/dist/server/config-utils.js +185 -0
  689. package/dashboard/.next/standalone/node_modules/next/dist/server/config.js +1658 -0
  690. package/dashboard/.next/standalone/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js +96 -0
  691. package/dashboard/.next/standalone/node_modules/next/dist/server/crypto-utils.js +70 -0
  692. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/browser-logs/file-logger.js +186 -0
  693. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/browser-logs/receive-logs.js +610 -0
  694. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/browser-logs/source-map.js +222 -0
  695. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/debug-channel.js +108 -0
  696. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/dev-indicator-server-state.js +15 -0
  697. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/dev-validation-worker-pool.js +233 -0
  698. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/dev-validation-worker.js +308 -0
  699. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/get-source-map-from-file.js +80 -0
  700. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/hot-middleware.js +302 -0
  701. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-rspack.js +171 -0
  702. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-shared-utils.js +56 -0
  703. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +1894 -0
  704. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-types.js +63 -0
  705. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1386 -0
  706. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/log-requests.js +152 -0
  707. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/messages.js +66 -0
  708. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/middleware-turbopack.js +406 -0
  709. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/middleware-webpack.js +487 -0
  710. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/node-stack-frames.js +64 -0
  711. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/on-demand-entry-handler.js +773 -0
  712. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/parse-version-info.js +108 -0
  713. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/require-cache.js +109 -0
  714. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/runtime-error-state.js +220 -0
  715. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/serialized-errors.js +63 -0
  716. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/server-action-logger.js +37 -0
  717. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/static-paths-worker.js +107 -0
  718. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/turbopack-utils.js +711 -0
  719. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/use-cache-probe-pool.js +178 -0
  720. package/dashboard/.next/standalone/node_modules/next/dist/server/dev/use-cache-probe-worker.js +181 -0
  721. package/dashboard/.next/standalone/node_modules/next/dist/server/dynamic-rendering-utils.js +528 -0
  722. package/dashboard/.next/standalone/node_modules/next/dist/server/font-utils.js +43 -0
  723. package/dashboard/.next/standalone/node_modules/next/dist/server/get-app-route-from-entrypoint.js +30 -0
  724. package/dashboard/.next/standalone/node_modules/next/dist/server/get-page-files.js +40 -0
  725. package/dashboard/.next/standalone/node_modules/next/dist/server/get-route-from-entrypoint.js +35 -0
  726. package/dashboard/.next/standalone/node_modules/next/dist/server/image-optimizer/detect-content-type.js +229 -0
  727. package/dashboard/.next/standalone/node_modules/next/dist/server/image-optimizer/extract-etag.js +53 -0
  728. package/dashboard/.next/standalone/node_modules/next/dist/server/image-optimizer/get-image-size.js +25 -0
  729. package/dashboard/.next/standalone/node_modules/next/dist/server/image-optimizer/get-max-age.js +41 -0
  730. package/dashboard/.next/standalone/node_modules/next/dist/server/image-optimizer/get-previously-cached-image-or-null.js +22 -0
  731. package/dashboard/.next/standalone/node_modules/next/dist/server/image-optimizer/image-error.js +23 -0
  732. package/dashboard/.next/standalone/node_modules/next/dist/server/image-optimizer/image-type.js +86 -0
  733. package/dashboard/.next/standalone/node_modules/next/dist/server/image-optimizer/transform.js +227 -0
  734. package/dashboard/.next/standalone/node_modules/next/dist/server/image-optimizer.js +878 -0
  735. package/dashboard/.next/standalone/node_modules/next/dist/server/instrumentation/types.js +6 -0
  736. package/dashboard/.next/standalone/node_modules/next/dist/server/instrumentation/utils.js +21 -0
  737. package/dashboard/.next/standalone/node_modules/next/dist/server/internal-utils.js +39 -0
  738. package/dashboard/.next/standalone/node_modules/next/dist/server/is-private-ip.js +36 -0
  739. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/app-dir-module.js +59 -0
  740. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +145 -0
  741. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/async-callback-set.js +29 -0
  742. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/cache-control.js +22 -0
  743. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/cache-handlers/default.external.js +18 -0
  744. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/cache-handlers/default.js +192 -0
  745. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/cache-handlers/types.js +8 -0
  746. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/chrome-devtools-workspace.js +112 -0
  747. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/clone-response.js +77 -0
  748. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/cpu-profile.js +56 -0
  749. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/decode-query-path-parameter.js +26 -0
  750. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/dedupe-fetch.js +120 -0
  751. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/dev-bundler-service.js +110 -0
  752. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/disk-lru-cache.external.js +63 -0
  753. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/encode-header-safe.js +44 -0
  754. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/etag.js +56 -0
  755. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/experimental/create-env-definitions.js +48 -0
  756. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/find-page-file.js +147 -0
  757. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/fix-mojibake.js +25 -0
  758. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/format-hostname.js +16 -0
  759. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/generate-agent-files.js +303 -0
  760. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/i18n-provider.js +125 -0
  761. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/implicit-tags.js +87 -0
  762. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +500 -0
  763. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/index.js +556 -0
  764. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js +55 -0
  765. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js +81 -0
  766. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js +55 -0
  767. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/install-code-frame.js +22 -0
  768. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/is-ipv6.js +41 -0
  769. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/is-non-html-sec-fetch-dest.js +38 -0
  770. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/is-rsc-request.js +18 -0
  771. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/lazy-module.js +76 -0
  772. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/lazy-result.js +46 -0
  773. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/lru-cache.js +187 -0
  774. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/match-next-data-pathname.js +20 -0
  775. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/mock-request.js +345 -0
  776. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/module-loader/module-loader.js +8 -0
  777. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/module-loader/node-module-loader.js +21 -0
  778. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/module-loader/route-module-loader.js +22 -0
  779. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/node-fs-methods.js +42 -0
  780. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/params-utils.js +52 -0
  781. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/parse-stack.js +46 -0
  782. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/patch-fetch-symbol.js +13 -0
  783. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/patch-fetch.js +1029 -0
  784. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/patch-set-header.js +45 -0
  785. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/postponed-request-body.js +60 -0
  786. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/release-compression-stream.js +24 -0
  787. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/render-server.js +149 -0
  788. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/route-cache-key.js +77 -0
  789. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-server.js +826 -0
  790. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/block-cross-site-dev.js +108 -0
  791. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/build-data-route.js +71 -0
  792. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/build-prefetch-segment-data-route.js +50 -0
  793. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/cache-life-type-utils.js +181 -0
  794. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/decode-path-params.js +38 -0
  795. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/filesystem.js +793 -0
  796. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js +214 -0
  797. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js +110 -0
  798. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/normalize-catchall-routes.js +320 -0
  799. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/proxy-request.js +128 -0
  800. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +652 -0
  801. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/root-params-type-utils.js +61 -0
  802. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/route-types-utils.js +326 -0
  803. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/router-server-context.js +26 -0
  804. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/strict-route-matching-config.js +28 -0
  805. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/typegen.js +938 -0
  806. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/router-utils/types.js +6 -0
  807. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/server-action-request-meta.js +53 -0
  808. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/server-ipc/utils.js +83 -0
  809. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/source-maps.js +241 -0
  810. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/start-server.js +550 -0
  811. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/streaming-metadata.js +27 -0
  812. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/to-route.js +37 -0
  813. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/trace/constants.js +260 -0
  814. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/trace/local-span-recorder.js +385 -0
  815. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/trace/request-insights-identity.js +37 -0
  816. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/trace/request-insights.js +308 -0
  817. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/trace/span-store.js +69 -0
  818. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/trace/tracer.js +408 -0
  819. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/trace/utils.js +16 -0
  820. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/types.js +6 -0
  821. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/utils.js +343 -0
  822. package/dashboard/.next/standalone/node_modules/next/dist/server/lib/worker-utils.js +32 -0
  823. package/dashboard/.next/standalone/node_modules/next/dist/server/load-components.js +190 -0
  824. package/dashboard/.next/standalone/node_modules/next/dist/server/load-default-error-components.js +41 -0
  825. package/dashboard/.next/standalone/node_modules/next/dist/server/load-manifest.external.js +116 -0
  826. package/dashboard/.next/standalone/node_modules/next/dist/server/match-bundle.js +25 -0
  827. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/get-mcp-middleware.js +51 -0
  828. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/get-or-create-mcp-server.js +51 -0
  829. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/mcp-telemetry-tracker.js +82 -0
  830. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/compile-route.js +86 -0
  831. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/get-compilation-issues.js +68 -0
  832. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/get-errors.js +114 -0
  833. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/get-logs.js +67 -0
  834. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/get-page-metadata.js +188 -0
  835. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/get-project-metadata.js +59 -0
  836. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/get-request-insights.js +57 -0
  837. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/get-routes.js +136 -0
  838. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/get-server-action-by-id.js +121 -0
  839. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/next-instance-error-state.js +31 -0
  840. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/utils/browser-communication.js +82 -0
  841. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/utils/format-compilation-issues.js +72 -0
  842. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/utils/format-errors.js +137 -0
  843. package/dashboard/.next/standalone/node_modules/next/dist/server/mcp/tools/utils/resolve-path-to-route.js +49 -0
  844. package/dashboard/.next/standalone/node_modules/next/dist/server/next-server.js +1452 -0
  845. package/dashboard/.next/standalone/node_modules/next/dist/server/next-typescript.js +13 -0
  846. package/dashboard/.next/standalone/node_modules/next/dist/server/next.js +473 -0
  847. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-baseline.js +25 -0
  848. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/console-dim.external.js +300 -0
  849. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/console-exit.js +49 -0
  850. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/console-file.js +56 -0
  851. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/date.js +52 -0
  852. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/error-inspect.js +8 -0
  853. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js +630 -0
  854. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/global-behaviors.js +29 -0
  855. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/io-utils.js +103 -0
  856. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/node-crypto.js +103 -0
  857. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/process-error-handlers.js +161 -0
  858. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/random.js +28 -0
  859. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js +507 -0
  860. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment-extensions/web-crypto.js +45 -0
  861. package/dashboard/.next/standalone/node_modules/next/dist/server/node-environment.js +19 -0
  862. package/dashboard/.next/standalone/node_modules/next/dist/server/node-polyfill-crypto.js +21 -0
  863. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/absolute-filename-normalizer.js +33 -0
  864. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/app/app-bundle-path-normalizer.js +54 -0
  865. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/app/app-filename-normalizer.js +22 -0
  866. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/app/app-page-normalizer.js +40 -0
  867. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/app/app-pathname-normalizer.js +55 -0
  868. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/app/index.js +42 -0
  869. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/pages/index.js +44 -0
  870. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/pages/pages-bundle-path-normalizer.js +55 -0
  871. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/pages/pages-filename-normalizer.js +22 -0
  872. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/pages/pages-page-normalizer.js +19 -0
  873. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/built/pages/pages-pathname-normalizer.js +19 -0
  874. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/locale-route-normalizer.js +26 -0
  875. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/normalizer.js +6 -0
  876. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/normalizers.js +23 -0
  877. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/prefixing-normalizer.js +26 -0
  878. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/request/base-path.js +21 -0
  879. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/request/next-data.js +34 -0
  880. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/request/pathname-normalizer.js +6 -0
  881. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/request/prefix.js +35 -0
  882. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/request/rsc.js +19 -0
  883. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/request/segment-prefix-rsc.js +33 -0
  884. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/request/suffix.js +27 -0
  885. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/underscore-normalizer.js +17 -0
  886. package/dashboard/.next/standalone/node_modules/next/dist/server/normalizers/wrap-normalizer-fn.js +17 -0
  887. package/dashboard/.next/standalone/node_modules/next/dist/server/og/cache-image-response.js +336 -0
  888. package/dashboard/.next/standalone/node_modules/next/dist/server/og/image-response.js +72 -0
  889. package/dashboard/.next/standalone/node_modules/next/dist/server/patch-error-inspect.js +515 -0
  890. package/dashboard/.next/standalone/node_modules/next/dist/server/pipe-readable.js +224 -0
  891. package/dashboard/.next/standalone/node_modules/next/dist/server/post-process.js +39 -0
  892. package/dashboard/.next/standalone/node_modules/next/dist/server/render-result.js +234 -0
  893. package/dashboard/.next/standalone/node_modules/next/dist/server/render.js +1004 -0
  894. package/dashboard/.next/standalone/node_modules/next/dist/server/request/cache-stages.js +250 -0
  895. package/dashboard/.next/standalone/node_modules/next/dist/server/request/connection.js +104 -0
  896. package/dashboard/.next/standalone/node_modules/next/dist/server/request/cookies.js +204 -0
  897. package/dashboard/.next/standalone/node_modules/next/dist/server/request/draft-mode.js +192 -0
  898. package/dashboard/.next/standalone/node_modules/next/dist/server/request/fallback-params.js +109 -0
  899. package/dashboard/.next/standalone/node_modules/next/dist/server/request/headers.js +201 -0
  900. package/dashboard/.next/standalone/node_modules/next/dist/server/request/io.js +87 -0
  901. package/dashboard/.next/standalone/node_modules/next/dist/server/request/params.js +500 -0
  902. package/dashboard/.next/standalone/node_modules/next/dist/server/request/pathname.js +89 -0
  903. package/dashboard/.next/standalone/node_modules/next/dist/server/request/root-params.js +146 -0
  904. package/dashboard/.next/standalone/node_modules/next/dist/server/request/search-params.js +505 -0
  905. package/dashboard/.next/standalone/node_modules/next/dist/server/request/utils.js +77 -0
  906. package/dashboard/.next/standalone/node_modules/next/dist/server/request-meta.js +55 -0
  907. package/dashboard/.next/standalone/node_modules/next/dist/server/require-hook.js +82 -0
  908. package/dashboard/.next/standalone/node_modules/next/dist/server/require.js +109 -0
  909. package/dashboard/.next/standalone/node_modules/next/dist/server/response-cache/index.js +361 -0
  910. package/dashboard/.next/standalone/node_modules/next/dist/server/response-cache/types.js +41 -0
  911. package/dashboard/.next/standalone/node_modules/next/dist/server/response-cache/utils.js +100 -0
  912. package/dashboard/.next/standalone/node_modules/next/dist/server/response-cache/web.js +104 -0
  913. package/dashboard/.next/standalone/node_modules/next/dist/server/resume-data-cache/cache-store.js +119 -0
  914. package/dashboard/.next/standalone/node_modules/next/dist/server/resume-data-cache/resume-data-cache.js +144 -0
  915. package/dashboard/.next/standalone/node_modules/next/dist/server/revalidation-utils.js +158 -0
  916. package/dashboard/.next/standalone/node_modules/next/dist/server/route-definitions/app-page-route-definition.js +16 -0
  917. package/dashboard/.next/standalone/node_modules/next/dist/server/route-definitions/app-route-route-definition.js +6 -0
  918. package/dashboard/.next/standalone/node_modules/next/dist/server/route-definitions/locale-route-definition.js +6 -0
  919. package/dashboard/.next/standalone/node_modules/next/dist/server/route-definitions/pages-api-route-definition.js +6 -0
  920. package/dashboard/.next/standalone/node_modules/next/dist/server/route-definitions/pages-route-definition.js +6 -0
  921. package/dashboard/.next/standalone/node_modules/next/dist/server/route-definitions/route-definition.js +6 -0
  922. package/dashboard/.next/standalone/node_modules/next/dist/server/route-kind.js +32 -0
  923. package/dashboard/.next/standalone/node_modules/next/dist/server/route-matches/app-page-route-match.js +6 -0
  924. package/dashboard/.next/standalone/node_modules/next/dist/server/route-matches/app-route-route-match.js +6 -0
  925. package/dashboard/.next/standalone/node_modules/next/dist/server/route-matches/locale-route-match.js +6 -0
  926. package/dashboard/.next/standalone/node_modules/next/dist/server/route-matches/pages-api-route-match.js +16 -0
  927. package/dashboard/.next/standalone/node_modules/next/dist/server/route-matches/pages-route-match.js +6 -0
  928. package/dashboard/.next/standalone/node_modules/next/dist/server/route-matches/route-match.js +6 -0
  929. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/dev-render-context.js +23 -0
  930. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/helpers/prerender-manifest-matcher.js +52 -0
  931. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/module.compiled.js +36 -0
  932. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/module.js +188 -0
  933. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/module.render.js +39 -0
  934. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/normalize-request-url.js +62 -0
  935. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/parse-request-headers.js +58 -0
  936. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/app-router-context.js +4 -0
  937. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/entrypoints.js +87 -0
  938. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/head-manager-context.js +4 -0
  939. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/hooks-client-context.js +4 -0
  940. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/image-config-context.js +4 -0
  941. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/router-context.js +4 -0
  942. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/server-inserted-html.js +4 -0
  943. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/entrypoints.js +136 -0
  944. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtime.js +4 -0
  945. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-dom.js +4 -0
  946. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime.js +4 -0
  947. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js +4 -0
  948. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-server.js +4 -0
  949. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-static.js +4 -0
  950. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server.js +4 -0
  951. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-static.js +4 -0
  952. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react.js +4 -0
  953. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/entrypoints.js +121 -0
  954. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime.js +4 -0
  955. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom-server.js +4 -0
  956. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom.js +4 -0
  957. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime.js +4 -0
  958. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js +4 -0
  959. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.js +4 -0
  960. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client.js +4 -0
  961. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js +4 -0
  962. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-route/helpers/auto-implement-methods.js +81 -0
  963. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-route/helpers/clean-url.js +24 -0
  964. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js +29 -0
  965. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-route/helpers/is-static-gen-enabled.js +15 -0
  966. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-route/helpers/parsed-url-query-to-params.js +20 -0
  967. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-route/module.compiled.js +36 -0
  968. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-route/module.js +915 -0
  969. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/app-route/shared-modules.js +56 -0
  970. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/checks.js +45 -0
  971. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/builtin/_error.js +100 -0
  972. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/module.compiled.js +20 -0
  973. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/module.js +92 -0
  974. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/module.render.js +20 -0
  975. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/pages-handler.js +582 -0
  976. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/app-router-context.js +4 -0
  977. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/entrypoints.js +102 -0
  978. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/head-manager-context.js +4 -0
  979. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/hooks-client-context.js +4 -0
  980. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/html-context.js +4 -0
  981. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/image-config-context.js +4 -0
  982. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable-context.js +4 -0
  983. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable.js +4 -0
  984. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/router-context.js +4 -0
  985. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages/vendored/contexts/server-inserted-html.js +4 -0
  986. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages-api/module.compiled.js +20 -0
  987. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/pages-api/module.js +54 -0
  988. package/dashboard/.next/standalone/node_modules/next/dist/server/route-modules/route-module.js +777 -0
  989. package/dashboard/.next/standalone/node_modules/next/dist/server/runtime-reacts.external.js +46 -0
  990. package/dashboard/.next/standalone/node_modules/next/dist/server/send-payload.js +88 -0
  991. package/dashboard/.next/standalone/node_modules/next/dist/server/send-response.js +70 -0
  992. package/dashboard/.next/standalone/node_modules/next/dist/server/serve-static.js +62 -0
  993. package/dashboard/.next/standalone/node_modules/next/dist/server/server-route-utils.js +30 -0
  994. package/dashboard/.next/standalone/node_modules/next/dist/server/server-utils.js +340 -0
  995. package/dashboard/.next/standalone/node_modules/next/dist/server/setup-http-agent-env.js +27 -0
  996. package/dashboard/.next/standalone/node_modules/next/dist/server/stream-utils/encoded-tags.js +122 -0
  997. package/dashboard/.next/standalone/node_modules/next/dist/server/stream-utils/node-buffered-transform-stream.js +51 -0
  998. package/dashboard/.next/standalone/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +935 -0
  999. package/dashboard/.next/standalone/node_modules/next/dist/server/stream-utils/uint8array-helpers.js +74 -0
  1000. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/constant.js +100 -0
  1001. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/index.js +199 -0
  1002. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/rules/client-boundary.js +100 -0
  1003. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/rules/config.js +561 -0
  1004. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/rules/entry.js +149 -0
  1005. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/rules/error.js +38 -0
  1006. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/rules/metadata.js +234 -0
  1007. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/rules/server-boundary.js +115 -0
  1008. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/rules/server.js +79 -0
  1009. package/dashboard/.next/standalone/node_modules/next/dist/server/typescript/utils.js +212 -0
  1010. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/cache-life-profile.js +60 -0
  1011. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/cache-life.js +79 -0
  1012. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/cache-tag.js +46 -0
  1013. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/clone-cache-entry.js +28 -0
  1014. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/constants.js +40 -0
  1015. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/handlers.js +265 -0
  1016. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/tiered-cache-handler.js +147 -0
  1017. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-errors.js +58 -0
  1018. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-messages.js +190 -0
  1019. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-probe-globals.js +39 -0
  1020. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-probe-scheduler.js +117 -0
  1021. package/dashboard/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +2689 -0
  1022. package/dashboard/.next/standalone/node_modules/next/dist/server/utils.js +73 -0
  1023. package/dashboard/.next/standalone/node_modules/next/dist/server/web/adapter.js +466 -0
  1024. package/dashboard/.next/standalone/node_modules/next/dist/server/web/edge-route-module-wrapper.js +135 -0
  1025. package/dashboard/.next/standalone/node_modules/next/dist/server/web/error.js +54 -0
  1026. package/dashboard/.next/standalone/node_modules/next/dist/server/web/exports/index.js +56 -0
  1027. package/dashboard/.next/standalone/node_modules/next/dist/server/web/forward-trace-context.js +102 -0
  1028. package/dashboard/.next/standalone/node_modules/next/dist/server/web/get-edge-preview-props.js +23 -0
  1029. package/dashboard/.next/standalone/node_modules/next/dist/server/web/globals.js +116 -0
  1030. package/dashboard/.next/standalone/node_modules/next/dist/server/web/http.js +39 -0
  1031. package/dashboard/.next/standalone/node_modules/next/dist/server/web/internal-edge-wait-until.js +64 -0
  1032. package/dashboard/.next/standalone/node_modules/next/dist/server/web/next-url.js +195 -0
  1033. package/dashboard/.next/standalone/node_modules/next/dist/server/web/sandbox/context.js +444 -0
  1034. package/dashboard/.next/standalone/node_modules/next/dist/server/web/sandbox/fetch-inline-assets.js +35 -0
  1035. package/dashboard/.next/standalone/node_modules/next/dist/server/web/sandbox/index.js +28 -0
  1036. package/dashboard/.next/standalone/node_modules/next/dist/server/web/sandbox/resource-managers.js +123 -0
  1037. package/dashboard/.next/standalone/node_modules/next/dist/server/web/sandbox/sandbox.js +133 -0
  1038. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/adapters/headers.js +288 -0
  1039. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/adapters/next-request.js +138 -0
  1040. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js +30 -0
  1041. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +221 -0
  1042. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/cookies.js +29 -0
  1043. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/fetch-event.js +90 -0
  1044. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/image-response.js +18 -0
  1045. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/request.js +99 -0
  1046. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/response.js +128 -0
  1047. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/revalidate.js +188 -0
  1048. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/unstable-cache.js +299 -0
  1049. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/unstable-no-store.js +50 -0
  1050. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/url-pattern.js +13 -0
  1051. package/dashboard/.next/standalone/node_modules/next/dist/server/web/spec-extension/user-agent.js +46 -0
  1052. package/dashboard/.next/standalone/node_modules/next/dist/server/web/types.js +6 -0
  1053. package/dashboard/.next/standalone/node_modules/next/dist/server/web/utils.js +147 -0
  1054. package/dashboard/.next/standalone/node_modules/next/dist/server/web/web-on-close.js +79 -0
  1055. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/action-revalidation-kind.js +31 -0
  1056. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js +50 -0
  1057. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/app-router-types.js +169 -0
  1058. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/constants.js +458 -0
  1059. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/deep-freeze.js +30 -0
  1060. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/deployment-id.js +63 -0
  1061. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/dset.js +34 -0
  1062. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/encode-uri-path.js +15 -0
  1063. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/entry-constants.js +36 -0
  1064. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/error-source.js +36 -0
  1065. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/errors/code-frame.js +21 -0
  1066. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/errors/constants.js +19 -0
  1067. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/errors/empty-generate-static-params-error.js +27 -0
  1068. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/errors/ensure-static-gsp-errors.js +30 -0
  1069. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/errors/hard-deprecated-config-error.js +20 -0
  1070. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/escape-regexp.js +22 -0
  1071. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/get-hostname.js +23 -0
  1072. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/hash.js +42 -0
  1073. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +18 -0
  1074. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/head.js +164 -0
  1075. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js +60 -0
  1076. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/html-context.shared-runtime.js +36 -0
  1077. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/htmlescape.js +52 -0
  1078. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +25 -0
  1079. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/i18n/get-locale-redirect.js +59 -0
  1080. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +54 -0
  1081. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/image-blur-svg.js +22 -0
  1082. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/image-config-context.shared-runtime.js +19 -0
  1083. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/image-config.js +128 -0
  1084. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/instant-messages.js +35 -0
  1085. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/invariant-error.js +18 -0
  1086. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/is-plain-object.js +42 -0
  1087. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/is-thenable.js +20 -0
  1088. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/isomorphic/path.js +14 -0
  1089. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js +37 -0
  1090. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/lazy-dynamic/react-browser-bailout.js +45 -0
  1091. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/loadable-context.shared-runtime.js +19 -0
  1092. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/loadable.shared-runtime.js +246 -0
  1093. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/magic-identifier.js +198 -0
  1094. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/match-local-pattern.js +46 -0
  1095. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/match-remote-pattern.js +59 -0
  1096. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/modern-browserslist-target.js +15 -0
  1097. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/no-fallback-error.external.js +18 -0
  1098. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/normalized-asset-prefix.js +28 -0
  1099. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/page-path/absolute-path-to-page.js +26 -0
  1100. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js +18 -0
  1101. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +18 -0
  1102. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/page-path/get-page-paths.js +40 -0
  1103. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/page-path/normalize-data-path.js +23 -0
  1104. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/page-path/normalize-page-path.js +26 -0
  1105. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js +19 -0
  1106. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/page-path/remove-page-path-tail.js +20 -0
  1107. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/promise-with-resolvers.js +26 -0
  1108. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/request-insights.js +30 -0
  1109. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/adapters.js +139 -0
  1110. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/routes/app.js +146 -0
  1111. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/add-locale.js +28 -0
  1112. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +20 -0
  1113. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js +20 -0
  1114. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/app-paths.js +84 -0
  1115. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/as-path-to-search-params.js +17 -0
  1116. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js +70 -0
  1117. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js +16 -0
  1118. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js +27 -0
  1119. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/format-url.js +111 -0
  1120. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +166 -0
  1121. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js +52 -0
  1122. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/get-route-from-asset-path.js +25 -0
  1123. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +90 -0
  1124. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/html-bots.js +17 -0
  1125. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/index.js +30 -0
  1126. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/interception-prefix-from-param-type.js +33 -0
  1127. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +151 -0
  1128. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/is-bot.js +57 -0
  1129. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +26 -0
  1130. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/middleware-route-matcher.js +31 -0
  1131. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +30 -0
  1132. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/parse-path.js +33 -0
  1133. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js +39 -0
  1134. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/parse-url.js +38 -0
  1135. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +20 -0
  1136. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/path-match.js +49 -0
  1137. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +289 -0
  1138. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/querystring.js +110 -0
  1139. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/relativize-url.js +40 -0
  1140. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js +39 -0
  1141. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +22 -0
  1142. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/resolve-param-value.js +112 -0
  1143. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +113 -0
  1144. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +41 -0
  1145. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/route-regex.js +256 -0
  1146. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +200 -0
  1147. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +18 -0
  1148. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/rsc-transport.js +108 -0
  1149. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/segment-cache/segment-value-encoding.js +86 -0
  1150. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/segment-cache/vary-params-decoding.js +87 -0
  1151. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/segment.js +90 -0
  1152. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/server-inserted-html.shared-runtime.js +35 -0
  1153. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/server-reference-info.js +68 -0
  1154. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/side-effect.js +63 -0
  1155. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/size-limit.js +40 -0
  1156. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/turbopack/internal-error.js +48 -0
  1157. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/utils/reflect-utils.js +69 -0
  1158. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/utils/warn-once.js +22 -0
  1159. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/utils.js +207 -0
  1160. package/dashboard/.next/standalone/node_modules/next/dist/shared/lib/zod.js +97 -0
  1161. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/agent-name.js +20 -0
  1162. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +91 -0
  1163. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/detached-flush.js +49 -0
  1164. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/events/build.js +186 -0
  1165. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/events/index.js +41 -0
  1166. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/events/plugins.js +51 -0
  1167. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +55 -0
  1168. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/events/version.js +68 -0
  1169. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/flush-telemetry.js +19 -0
  1170. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/post-telemetry-payload.js +44 -0
  1171. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/project-id.js +48 -0
  1172. package/dashboard/.next/standalone/node_modules/next/dist/telemetry/storage.js +317 -0
  1173. package/dashboard/.next/standalone/node_modules/next/dist/trace/index.js +58 -0
  1174. package/dashboard/.next/standalone/node_modules/next/dist/trace/report/index.js +40 -0
  1175. package/dashboard/.next/standalone/node_modules/next/dist/trace/report/to-json-build.js +42 -0
  1176. package/dashboard/.next/standalone/node_modules/next/dist/trace/report/to-json.js +215 -0
  1177. package/dashboard/.next/standalone/node_modules/next/dist/trace/report/to-telemetry.js +36 -0
  1178. package/dashboard/.next/standalone/node_modules/next/dist/trace/shared.js +39 -0
  1179. package/dashboard/.next/standalone/node_modules/next/dist/trace/trace.js +216 -0
  1180. package/dashboard/.next/standalone/node_modules/next/package.json +140 -0
  1181. package/dashboard/.next/standalone/node_modules/react/cjs/react-compiler-runtime.production.js +16 -0
  1182. package/dashboard/.next/standalone/node_modules/react/cjs/react-jsx-dev-runtime.production.js +14 -0
  1183. package/dashboard/.next/standalone/node_modules/react/cjs/react-jsx-runtime.production.js +34 -0
  1184. package/dashboard/.next/standalone/node_modules/react/cjs/react.production.js +565 -0
  1185. package/dashboard/.next/standalone/node_modules/react/compiler-runtime.js +14 -0
  1186. package/dashboard/.next/standalone/node_modules/react/index.js +7 -0
  1187. package/dashboard/.next/standalone/node_modules/react/jsx-dev-runtime.js +7 -0
  1188. package/dashboard/.next/standalone/node_modules/react/jsx-runtime.js +7 -0
  1189. package/dashboard/.next/standalone/node_modules/react/package.json +51 -0
  1190. package/dashboard/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +6978 -0
  1191. package/dashboard/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +7072 -0
  1192. package/dashboard/.next/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +7846 -0
  1193. package/dashboard/.next/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +7955 -0
  1194. package/dashboard/.next/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +8134 -0
  1195. package/dashboard/.next/standalone/node_modules/react-dom/cjs/react-dom.production.js +229 -0
  1196. package/dashboard/.next/standalone/node_modules/react-dom/index.js +38 -0
  1197. package/dashboard/.next/standalone/node_modules/react-dom/package.json +117 -0
  1198. package/dashboard/.next/standalone/node_modules/react-dom/server.browser.js +16 -0
  1199. package/dashboard/.next/standalone/node_modules/react-dom/server.edge.js +17 -0
  1200. package/dashboard/.next/standalone/node_modules/react-dom/server.node.js +18 -0
  1201. package/dashboard/.next/standalone/node_modules/react-dom/static.node.js +14 -0
  1202. package/dashboard/.next/standalone/node_modules/semver/classes/comparator.js +143 -0
  1203. package/dashboard/.next/standalone/node_modules/semver/classes/range.js +577 -0
  1204. package/dashboard/.next/standalone/node_modules/semver/classes/semver.js +350 -0
  1205. package/dashboard/.next/standalone/node_modules/semver/functions/clean.js +8 -0
  1206. package/dashboard/.next/standalone/node_modules/semver/functions/cmp.js +54 -0
  1207. package/dashboard/.next/standalone/node_modules/semver/functions/coerce.js +62 -0
  1208. package/dashboard/.next/standalone/node_modules/semver/functions/compare-build.js +9 -0
  1209. package/dashboard/.next/standalone/node_modules/semver/functions/compare-loose.js +5 -0
  1210. package/dashboard/.next/standalone/node_modules/semver/functions/compare.js +7 -0
  1211. package/dashboard/.next/standalone/node_modules/semver/functions/diff.js +60 -0
  1212. package/dashboard/.next/standalone/node_modules/semver/functions/eq.js +5 -0
  1213. package/dashboard/.next/standalone/node_modules/semver/functions/gt.js +5 -0
  1214. package/dashboard/.next/standalone/node_modules/semver/functions/gte.js +5 -0
  1215. package/dashboard/.next/standalone/node_modules/semver/functions/inc.js +21 -0
  1216. package/dashboard/.next/standalone/node_modules/semver/functions/lt.js +5 -0
  1217. package/dashboard/.next/standalone/node_modules/semver/functions/lte.js +5 -0
  1218. package/dashboard/.next/standalone/node_modules/semver/functions/major.js +5 -0
  1219. package/dashboard/.next/standalone/node_modules/semver/functions/minor.js +5 -0
  1220. package/dashboard/.next/standalone/node_modules/semver/functions/neq.js +5 -0
  1221. package/dashboard/.next/standalone/node_modules/semver/functions/parse.js +18 -0
  1222. package/dashboard/.next/standalone/node_modules/semver/functions/patch.js +5 -0
  1223. package/dashboard/.next/standalone/node_modules/semver/functions/prerelease.js +8 -0
  1224. package/dashboard/.next/standalone/node_modules/semver/functions/rcompare.js +5 -0
  1225. package/dashboard/.next/standalone/node_modules/semver/functions/rsort.js +5 -0
  1226. package/dashboard/.next/standalone/node_modules/semver/functions/satisfies.js +12 -0
  1227. package/dashboard/.next/standalone/node_modules/semver/functions/sort.js +5 -0
  1228. package/dashboard/.next/standalone/node_modules/semver/functions/truncate.js +48 -0
  1229. package/dashboard/.next/standalone/node_modules/semver/functions/valid.js +8 -0
  1230. package/dashboard/.next/standalone/node_modules/semver/index.js +93 -0
  1231. package/dashboard/.next/standalone/node_modules/semver/internal/constants.js +37 -0
  1232. package/dashboard/.next/standalone/node_modules/semver/internal/debug.js +11 -0
  1233. package/dashboard/.next/standalone/node_modules/semver/internal/identifiers.js +29 -0
  1234. package/dashboard/.next/standalone/node_modules/semver/internal/lrucache.js +42 -0
  1235. package/dashboard/.next/standalone/node_modules/semver/internal/parse-options.js +17 -0
  1236. package/dashboard/.next/standalone/node_modules/semver/internal/re.js +223 -0
  1237. package/dashboard/.next/standalone/node_modules/semver/package.json +78 -0
  1238. package/dashboard/.next/standalone/node_modules/semver/ranges/gtr.js +6 -0
  1239. package/dashboard/.next/standalone/node_modules/semver/ranges/intersects.js +9 -0
  1240. package/dashboard/.next/standalone/node_modules/semver/ranges/ltr.js +6 -0
  1241. package/dashboard/.next/standalone/node_modules/semver/ranges/max-satisfying.js +27 -0
  1242. package/dashboard/.next/standalone/node_modules/semver/ranges/min-satisfying.js +26 -0
  1243. package/dashboard/.next/standalone/node_modules/semver/ranges/min-version.js +63 -0
  1244. package/dashboard/.next/standalone/node_modules/semver/ranges/outside.js +82 -0
  1245. package/dashboard/.next/standalone/node_modules/semver/ranges/simplify.js +49 -0
  1246. package/dashboard/.next/standalone/node_modules/semver/ranges/subset.js +249 -0
  1247. package/dashboard/.next/standalone/node_modules/semver/ranges/to-comparators.js +10 -0
  1248. package/dashboard/.next/standalone/node_modules/semver/ranges/valid.js +13 -0
  1249. package/dashboard/.next/standalone/node_modules/styled-jsx/dist/index/index.js +499 -0
  1250. package/dashboard/.next/standalone/node_modules/styled-jsx/index.js +1 -0
  1251. package/dashboard/.next/standalone/node_modules/styled-jsx/package.json +132 -0
  1252. package/dashboard/.next/standalone/node_modules/styled-jsx/style.js +1 -0
  1253. package/dashboard/.next/standalone/package.json +1 -0
  1254. package/dist/adapters/claude-code.js +351 -0
  1255. package/dist/adapters/codex.js +565 -0
  1256. package/dist/adapters/eve.js +173 -0
  1257. package/dist/checks.js +142 -0
  1258. package/dist/cli.js +471 -0
  1259. package/dist/collector.js +180 -0
  1260. package/dist/db.js +171 -0
  1261. package/dist/fingerprint.js +57 -0
  1262. package/dist/pricing-snapshot.json +886 -0
  1263. package/dist/pricing.js +70 -0
  1264. package/dist/profiles.js +84 -0
  1265. package/dist/queries.js +352 -0
  1266. package/dist/setup.js +264 -0
  1267. package/dist/types.js +3 -0
  1268. package/dist/update.js +50 -0
  1269. package/dist/util.js +107 -0
  1270. package/package.json +53 -4
  1271. package/skills/summarize-run/SKILL.md +22 -0
  1272. package/skills/unharness/SKILL.md +18 -0
  1273. package/src/adapters/claude-code.ts +352 -0
  1274. package/src/adapters/codex.ts +488 -0
  1275. package/src/adapters/eve.ts +180 -0
  1276. package/src/checks.ts +134 -0
  1277. package/src/cli.ts +439 -0
  1278. package/src/collector.ts +178 -0
  1279. package/src/db.ts +182 -0
  1280. package/src/fingerprint.ts +60 -0
  1281. package/src/pricing-snapshot.json +886 -0
  1282. package/src/pricing.ts +83 -0
  1283. package/src/profiles.ts +92 -0
  1284. package/src/queries.ts +422 -0
  1285. package/src/setup.ts +255 -0
  1286. package/src/types.ts +153 -0
  1287. package/src/update.ts +44 -0
  1288. package/src/util.ts +105 -0
@@ -0,0 +1,2671 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ 0 && (module.exports = {
6
+ EntryStatus: null,
7
+ MetadataOnlyRequestTree: null,
8
+ attemptToFulfillDynamicSegmentFromBFCache: null,
9
+ attemptToUpgradeSegmentFromBFCache: null,
10
+ bufferPrefetchResponseBody: null,
11
+ canNewFetchStrategyProvideMoreContent: null,
12
+ convertFlightRouterStateToRouteTree: null,
13
+ convertRootFlightRouterStateToRouteTree: null,
14
+ convertRouteTreeToFlightRouterState: null,
15
+ createDetachedSegmentCacheEntry: null,
16
+ createMetadataRouteTree: null,
17
+ createRootRouteTree: null,
18
+ deprecated_requestOptimisticRouteCacheEntry: null,
19
+ doesRouteStructureMatch: null,
20
+ fetchRouteOnCacheMiss: null,
21
+ fetchSegmentPrefetchesUsingRuntimeRequest: null,
22
+ fetchSegmentPrefetchesUsingStaticRequest: null,
23
+ fulfillRouteCacheEntry: null,
24
+ getCurrentRouteCacheVersion: null,
25
+ getCurrentSegmentCacheVersion: null,
26
+ getHeadRequestKey: null,
27
+ getStaleTimeMs: null,
28
+ invalidateEntirePrefetchCache: null,
29
+ invalidateRouteCacheEntries: null,
30
+ invalidateSegmentCacheEntries: null,
31
+ overwriteRevalidatingSegmentCacheEntry: null,
32
+ pingInvalidationListeners: null,
33
+ readOrCreateRevalidatingSegmentEntry: null,
34
+ readOrCreateRouteCacheEntry: null,
35
+ readOrCreateSegmentCacheEntry: null,
36
+ readRouteCacheEntry: null,
37
+ readSegmentCacheEntryForNavigation: null,
38
+ rebaseInactiveRouteTree: null,
39
+ resolveStaleAt: null,
40
+ segmentCacheMap: null,
41
+ spawnStaticStageCacheWrite: null,
42
+ stripIsPartialByte: null,
43
+ upgradeToPendingSegment: null,
44
+ upsertSegmentEntry: null,
45
+ waitForSegmentCacheEntry: null,
46
+ writeRouteIntoCache: null,
47
+ writeRuntimePrefetchStreamIntoCache: null
48
+ });
49
+ function _export(target, all) {
50
+ for(var name in all)Object.defineProperty(target, name, {
51
+ enumerable: true,
52
+ get: all[name]
53
+ });
54
+ }
55
+ _export(exports, {
56
+ EntryStatus: function() {
57
+ return _cachemap.EntryStatus;
58
+ },
59
+ MetadataOnlyRequestTree: function() {
60
+ return MetadataOnlyRequestTree;
61
+ },
62
+ attemptToFulfillDynamicSegmentFromBFCache: function() {
63
+ return attemptToFulfillDynamicSegmentFromBFCache;
64
+ },
65
+ attemptToUpgradeSegmentFromBFCache: function() {
66
+ return attemptToUpgradeSegmentFromBFCache;
67
+ },
68
+ bufferPrefetchResponseBody: function() {
69
+ return bufferPrefetchResponseBody;
70
+ },
71
+ canNewFetchStrategyProvideMoreContent: function() {
72
+ return canNewFetchStrategyProvideMoreContent;
73
+ },
74
+ convertFlightRouterStateToRouteTree: function() {
75
+ return convertFlightRouterStateToRouteTree;
76
+ },
77
+ convertRootFlightRouterStateToRouteTree: function() {
78
+ return convertRootFlightRouterStateToRouteTree;
79
+ },
80
+ convertRouteTreeToFlightRouterState: function() {
81
+ return convertRouteTreeToFlightRouterState;
82
+ },
83
+ createDetachedSegmentCacheEntry: function() {
84
+ return createDetachedSegmentCacheEntry;
85
+ },
86
+ createMetadataRouteTree: function() {
87
+ return createMetadataRouteTree;
88
+ },
89
+ createRootRouteTree: function() {
90
+ return createRootRouteTree;
91
+ },
92
+ deprecated_requestOptimisticRouteCacheEntry: function() {
93
+ return deprecated_requestOptimisticRouteCacheEntry;
94
+ },
95
+ doesRouteStructureMatch: function() {
96
+ return doesRouteStructureMatch;
97
+ },
98
+ fetchRouteOnCacheMiss: function() {
99
+ return fetchRouteOnCacheMiss;
100
+ },
101
+ fetchSegmentPrefetchesUsingRuntimeRequest: function() {
102
+ return fetchSegmentPrefetchesUsingRuntimeRequest;
103
+ },
104
+ fetchSegmentPrefetchesUsingStaticRequest: function() {
105
+ return fetchSegmentPrefetchesUsingStaticRequest;
106
+ },
107
+ fulfillRouteCacheEntry: function() {
108
+ return fulfillRouteCacheEntry;
109
+ },
110
+ getCurrentRouteCacheVersion: function() {
111
+ return getCurrentRouteCacheVersion;
112
+ },
113
+ getCurrentSegmentCacheVersion: function() {
114
+ return getCurrentSegmentCacheVersion;
115
+ },
116
+ getHeadRequestKey: function() {
117
+ return getHeadRequestKey;
118
+ },
119
+ getStaleTimeMs: function() {
120
+ return getStaleTimeMs;
121
+ },
122
+ invalidateEntirePrefetchCache: function() {
123
+ return invalidateEntirePrefetchCache;
124
+ },
125
+ invalidateRouteCacheEntries: function() {
126
+ return invalidateRouteCacheEntries;
127
+ },
128
+ invalidateSegmentCacheEntries: function() {
129
+ return invalidateSegmentCacheEntries;
130
+ },
131
+ overwriteRevalidatingSegmentCacheEntry: function() {
132
+ return overwriteRevalidatingSegmentCacheEntry;
133
+ },
134
+ pingInvalidationListeners: function() {
135
+ return pingInvalidationListeners;
136
+ },
137
+ readOrCreateRevalidatingSegmentEntry: function() {
138
+ return readOrCreateRevalidatingSegmentEntry;
139
+ },
140
+ readOrCreateRouteCacheEntry: function() {
141
+ return readOrCreateRouteCacheEntry;
142
+ },
143
+ readOrCreateSegmentCacheEntry: function() {
144
+ return readOrCreateSegmentCacheEntry;
145
+ },
146
+ readRouteCacheEntry: function() {
147
+ return readRouteCacheEntry;
148
+ },
149
+ readSegmentCacheEntryForNavigation: function() {
150
+ return readSegmentCacheEntryForNavigation;
151
+ },
152
+ rebaseInactiveRouteTree: function() {
153
+ return rebaseInactiveRouteTree;
154
+ },
155
+ resolveStaleAt: function() {
156
+ return resolveStaleAt;
157
+ },
158
+ segmentCacheMap: function() {
159
+ return segmentCacheMap;
160
+ },
161
+ spawnStaticStageCacheWrite: function() {
162
+ return spawnStaticStageCacheWrite;
163
+ },
164
+ stripIsPartialByte: function() {
165
+ return stripIsPartialByte;
166
+ },
167
+ upgradeToPendingSegment: function() {
168
+ return upgradeToPendingSegment;
169
+ },
170
+ upsertSegmentEntry: function() {
171
+ return upsertSegmentEntry;
172
+ },
173
+ waitForSegmentCacheEntry: function() {
174
+ return waitForSegmentCacheEntry;
175
+ },
176
+ writeRouteIntoCache: function() {
177
+ return writeRouteIntoCache;
178
+ },
179
+ writeRuntimePrefetchStreamIntoCache: function() {
180
+ return writeRuntimePrefetchStreamIntoCache;
181
+ }
182
+ });
183
+ const _approutertypes = require("../../../shared/lib/app-router-types");
184
+ const _varyparamsdecoding = require("../../../shared/lib/segment-cache/vary-params-decoding");
185
+ const _rsctransport = require("../../../shared/lib/rsc-transport");
186
+ const _approuterheaders = require("../app-router-headers");
187
+ const _fetchserverresponse = require("../router-reducer/fetch-server-response");
188
+ const _fetch = require("./fetch");
189
+ const _scheduler = require("./scheduler");
190
+ const _varypath = require("./vary-path");
191
+ const _createhreffromurl = require("../router-reducer/create-href-from-url");
192
+ const _cachekey = require("./cache-key");
193
+ const _routeparams = require("../../route-params");
194
+ const _cachemap = require("./cache-map");
195
+ const _segmentvalueencoding = require("../../../shared/lib/segment-cache/segment-value-encoding");
196
+ const _flightdatahelpers = require("../../flight-data-helpers");
197
+ const _navigatereducer = require("../router-reducer/reducers/navigate-reducer");
198
+ const _links = require("../links");
199
+ const _types = require("./types");
200
+ const _promisewithresolvers = require("../../../shared/lib/promise-with-resolvers");
201
+ const _bfcache = require("./bfcache");
202
+ const _optimisticroutes = require("./optimistic-routes");
203
+ const _decodeserverresponse = require("./decode-server-response");
204
+ const _navigationbuildid = require("../../navigation-build-id");
205
+ const _constants = require("../../../lib/constants");
206
+ function getStaleTimeMs(staleTimeSeconds) {
207
+ return Math.max(staleTimeSeconds, 30) * 1000;
208
+ }
209
+ // How long a rejected cache entry blocks re-fetching before it may be
210
+ // retried (its staleAt is set this far in the future).
211
+ const REJECTION_BACKOFF_MS = 10 * 1000;
212
+ /**
213
+ * The staleAt to reject entries with when a prefetch fails: if we're
214
+ * offline, expire immediately (-1) so the entry is re-fetched once the
215
+ * scheduler is re-pinged after connectivity is restored; otherwise apply a
216
+ * short backoff. (Unlike navigations and server actions, prefetches don't
217
+ * await `waitForConnection`.)
218
+ */ function getPrefetchErrorStaleAt(error) {
219
+ if (process.env.__NEXT_USE_OFFLINE) {
220
+ const { checkOfflineError } = require('../offline');
221
+ if (checkOfflineError(error)) {
222
+ return -1;
223
+ }
224
+ }
225
+ return Date.now() + REJECTION_BACKOFF_MS;
226
+ }
227
+ function createRootRouteTree(tree, head) {
228
+ return {
229
+ tree,
230
+ head
231
+ };
232
+ }
233
+ function doesRouteStructureMatch(currentTree, nextTree) {
234
+ // The request key includes the param names and types, but not the values.
235
+ if (currentTree.requestKey !== nextTree.requestKey) {
236
+ return false;
237
+ }
238
+ // The root request key is always empty (even for global Not Found), so we
239
+ // have to compare the root segment directly.
240
+ return nextTree.requestKey !== _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY || currentTree.segment === nextTree.segment;
241
+ }
242
+ const isOutputExportMode = process.env.NODE_ENV === 'production' && process.env.__NEXT_CONFIG_OUTPUT === 'export';
243
+ const MetadataOnlyRequestTree = [
244
+ '',
245
+ {},
246
+ null,
247
+ 'metadata-only'
248
+ ];
249
+ const routeCacheMap = (0, _cachemap.createCacheMap)();
250
+ const segmentCacheMap = (0, _cachemap.createCacheMap)();
251
+ // All invalidation listeners for the whole cache are tracked in single set.
252
+ // Since we don't yet support tag or path-based invalidation, there's no point
253
+ // tracking them any more granularly than this. Once we add granular
254
+ // invalidation, that may change, though generally the model is to just notify
255
+ // the listeners and allow the caller to poll the prefetch cache with a new
256
+ // prefetch task if desired.
257
+ let invalidationListeners = null;
258
+ // Incrementing counters used to track cache invalidations. Route and segment
259
+ // caches have separate versions so they can be invalidated independently.
260
+ // Invalidation does not eagerly evict anything from the cache; entries are
261
+ // lazily evicted when read.
262
+ let currentRouteCacheVersion = 0;
263
+ let currentSegmentCacheVersion = 0;
264
+ function getCurrentRouteCacheVersion() {
265
+ return currentRouteCacheVersion;
266
+ }
267
+ function getCurrentSegmentCacheVersion() {
268
+ return currentSegmentCacheVersion;
269
+ }
270
+ function invalidateEntirePrefetchCache(nextUrl, root) {
271
+ currentRouteCacheVersion++;
272
+ currentSegmentCacheVersion++;
273
+ (0, _links.pingVisibleLinks)(nextUrl, root);
274
+ pingInvalidationListeners(nextUrl, root);
275
+ }
276
+ function invalidateRouteCacheEntries(nextUrl, root) {
277
+ currentRouteCacheVersion++;
278
+ (0, _links.pingVisibleLinks)(nextUrl, root);
279
+ pingInvalidationListeners(nextUrl, root);
280
+ }
281
+ function invalidateSegmentCacheEntries(nextUrl, root) {
282
+ currentSegmentCacheVersion++;
283
+ (0, _links.pingVisibleLinks)(nextUrl, root);
284
+ pingInvalidationListeners(nextUrl, root);
285
+ }
286
+ function attachInvalidationListener(task) {
287
+ // This function is called whenever a prefetch task reads a cache entry. If
288
+ // the task has an onInvalidate function associated with it — i.e. the one
289
+ // optionally passed to router.prefetch(onInvalidate) — then we attach that
290
+ // listener to the every cache entry that the task reads. Then, if an entry
291
+ // is invalidated, we call the function.
292
+ if (task.onInvalidate !== null) {
293
+ if (invalidationListeners === null) {
294
+ invalidationListeners = new Set([
295
+ task
296
+ ]);
297
+ } else {
298
+ invalidationListeners.add(task);
299
+ }
300
+ }
301
+ }
302
+ function notifyInvalidationListener(task) {
303
+ const onInvalidate = task.onInvalidate;
304
+ if (onInvalidate !== null) {
305
+ // Clear the callback from the task object to guarantee it's not called more
306
+ // than once.
307
+ task.onInvalidate = null;
308
+ // This is a user-space function, so we must wrap in try/catch.
309
+ try {
310
+ onInvalidate();
311
+ } catch (error) {
312
+ if (typeof reportError === 'function') {
313
+ reportError(error);
314
+ } else {
315
+ console.error(error);
316
+ }
317
+ }
318
+ }
319
+ }
320
+ function pingInvalidationListeners(nextUrl, root) {
321
+ // The rough equivalent of pingVisibleLinks, but for onInvalidate callbacks.
322
+ // This is called when the Next-Url or the base tree changes, since those
323
+ // may affect the result of a prefetch task. It's also called after a
324
+ // cache invalidation.
325
+ if (invalidationListeners !== null) {
326
+ const tasks = invalidationListeners;
327
+ invalidationListeners = null;
328
+ for (const task of tasks){
329
+ if ((0, _scheduler.isPrefetchTaskDirty)(task, nextUrl, root)) {
330
+ notifyInvalidationListener(task);
331
+ }
332
+ }
333
+ }
334
+ }
335
+ function readRouteCacheEntry(now, key) {
336
+ const varyPath = (0, _varypath.getRouteVaryPath)(key.pathname, key.search, key.nextUrl);
337
+ const isRevalidation = false;
338
+ const existingEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentRouteCacheVersion(), routeCacheMap, varyPath, isRevalidation, false);
339
+ if (existingEntry !== null) {
340
+ return existingEntry;
341
+ }
342
+ // No cache hit. Attempt to construct from template using the new
343
+ // optimistic routing mechanism (pattern-based matching).
344
+ if (process.env.__NEXT_OPTIMISTIC_ROUTING) {
345
+ return (0, _optimisticroutes.matchKnownRoute)(now, key.pathname, key.search);
346
+ }
347
+ return null;
348
+ }
349
+ function readSegmentCacheEntryForNavigation(now, // The map the navigation is bound to: a locked navigation's driving-task
350
+ // map, or the shared map otherwise.
351
+ map, varyPath, restrictToShell = false) {
352
+ const isRevalidation = false;
353
+ let lookupVaryPath = varyPath;
354
+ if (process.env.__NEXT_EXPOSE_TESTING_API && restrictToShell) {
355
+ // Instant Navigation Testing API: we're navigating to a link that 1) has
356
+ // Partial Prefetching enabled, and 2) does not have a prefetch prop set.
357
+ // Only the shell may render, not anything that varies on concrete route
358
+ // params.
359
+ lookupVaryPath = (0, _varypath.getShellSegmentVaryPath)(varyPath);
360
+ }
361
+ // Prefer a Fulfilled entry (e.g. a cached shell) over a more-specific
362
+ // Pending/Rejected one so it renders immediately instead of blocking on an
363
+ // in-flight entry.
364
+ const fulfilled = (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, lookupVaryPath, isRevalidation, true);
365
+ if (fulfilled !== null) {
366
+ return fulfilled;
367
+ }
368
+ return (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, lookupVaryPath, isRevalidation, false);
369
+ }
370
+ function readRevalidatingSegmentCacheEntry(now, map, varyPath) {
371
+ const isRevalidation = true;
372
+ return (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, varyPath, isRevalidation, false);
373
+ }
374
+ function waitForSegmentCacheEntry(pendingEntry) {
375
+ // Because the entry is pending, there's already a in-progress request.
376
+ // Attach a promise to the entry that will resolve when the server responds.
377
+ let promiseWithResolvers = pendingEntry.promise;
378
+ if (promiseWithResolvers === null) {
379
+ promiseWithResolvers = pendingEntry.promise = (0, _promisewithresolvers.createPromiseWithResolvers)();
380
+ } else {
381
+ // There's already a promise we can use
382
+ }
383
+ return promiseWithResolvers.promise;
384
+ }
385
+ function createDetachedRouteCacheEntry() {
386
+ return {
387
+ canonicalUrl: null,
388
+ status: _cachemap.EntryStatus.Empty,
389
+ blockedTasks: null,
390
+ root: null,
391
+ // This is initialized to true because we don't know yet whether the route
392
+ // could be intercepted. It's only set to false once we receive a response
393
+ // from the server.
394
+ couldBeIntercepted: true,
395
+ // Similarly, we don't yet know if the route supports PPR.
396
+ supportsPerSegmentPrefetching: false,
397
+ predictedFrom: null,
398
+ renderedSearch: null,
399
+ // Map-related fields
400
+ ref: null,
401
+ size: 0,
402
+ // Since this is an empty entry, there's no reason to ever evict it. It will
403
+ // be updated when the data is populated.
404
+ staleAt: Infinity,
405
+ version: getCurrentRouteCacheVersion()
406
+ };
407
+ }
408
+ function readOrCreateRouteCacheEntry(now, task, key) {
409
+ attachInvalidationListener(task);
410
+ const existingEntry = readRouteCacheEntry(now, key);
411
+ if (existingEntry !== null) {
412
+ return existingEntry;
413
+ }
414
+ // Create a pending entry and add it to the cache.
415
+ const pendingEntry = createDetachedRouteCacheEntry();
416
+ const varyPath = (0, _varypath.getRouteVaryPath)(key.pathname, key.search, key.nextUrl);
417
+ const isRevalidation = false;
418
+ (0, _cachemap.setInCacheMap)(routeCacheMap, varyPath, pendingEntry, isRevalidation);
419
+ return pendingEntry;
420
+ }
421
+ function deprecated_requestOptimisticRouteCacheEntry(now, requestedUrl, nextUrl) {
422
+ // This function is called during a navigation when there was no matching
423
+ // route tree in the prefetch cache. Before de-opting to a blocking,
424
+ // unprefetched navigation, we will first attempt to construct an "optimistic"
425
+ // route tree by checking the cache for similar routes.
426
+ //
427
+ // Check if there's a route with the same pathname, but with different
428
+ // search params. We can then base our optimistic route tree on this entry.
429
+ //
430
+ // Conceptually, we are simulating what would happen if we did perform a
431
+ // prefetch the requested URL, under the assumption that the server will
432
+ // not redirect or rewrite the request in a different manner than the
433
+ // base route tree. This assumption might not hold, in which case we'll have
434
+ // to recover when we perform the dynamic navigation request. However, this
435
+ // is what would happen if a route were dynamically rewritten/redirected
436
+ // in between the prefetch and the navigation. So the logic needs to exist
437
+ // to handle this case regardless.
438
+ // Look for a route with the same pathname, but with an empty search string.
439
+ // TODO: There's nothing inherently special about the empty search string;
440
+ // it's chosen somewhat arbitrarily, with the rationale that it's the most
441
+ // likely one to exist. But we should update this to match _any_ search
442
+ // string. The plan is to generalize this logic alongside other improvements
443
+ // related to "fallback" cache entries.
444
+ const requestedSearch = requestedUrl.search;
445
+ if (requestedSearch === '') {
446
+ // The caller would have already checked if a route with an empty search
447
+ // string is in the cache. So we can bail out here.
448
+ return null;
449
+ }
450
+ const urlWithoutSearchParams = new URL(requestedUrl);
451
+ urlWithoutSearchParams.search = '';
452
+ const routeWithNoSearchParams = readRouteCacheEntry(now, (0, _cachekey.createCacheKey)(urlWithoutSearchParams.href, nextUrl));
453
+ if (routeWithNoSearchParams === null || routeWithNoSearchParams.status !== _cachemap.EntryStatus.Fulfilled) {
454
+ // Bail out of constructing an optimistic route tree. This will result in
455
+ // a blocking, unprefetched navigation.
456
+ return null;
457
+ }
458
+ // Now we have a base route tree we can "patch" with our optimistic values.
459
+ // Optimistically assume that redirects for the requested pathname do
460
+ // not vary on the search string. Therefore, if the base route was
461
+ // redirected to a different search string, then the optimistic route
462
+ // should be redirected to the same search string. Otherwise, we use
463
+ // the requested search string.
464
+ const canonicalUrlForRouteWithNoSearchParams = new URL(routeWithNoSearchParams.canonicalUrl, requestedUrl.origin);
465
+ const optimisticCanonicalSearch = canonicalUrlForRouteWithNoSearchParams.search !== '' ? canonicalUrlForRouteWithNoSearchParams.search : requestedSearch;
466
+ // Similarly, optimistically assume that rewrites for the requested
467
+ // pathname do not vary on the search string. Therefore, if the base
468
+ // route was rewritten to a different search string, then the optimistic
469
+ // route should be rewritten to the same search string. Otherwise, we use
470
+ // the requested search string.
471
+ const optimisticRenderedSearch = routeWithNoSearchParams.renderedSearch !== '' ? routeWithNoSearchParams.renderedSearch : (0, _routeparams.normalizeRenderedSearch)(requestedSearch);
472
+ const optimisticUrl = new URL(routeWithNoSearchParams.canonicalUrl, location.origin);
473
+ optimisticUrl.search = optimisticCanonicalSearch;
474
+ const optimisticCanonicalUrl = (0, _createhreffromurl.createHrefFromUrl)(optimisticUrl);
475
+ const optimisticRouteTree = deprecated_createOptimisticRouteTree(routeWithNoSearchParams.root.tree, optimisticRenderedSearch);
476
+ const baseMetadataTree = routeWithNoSearchParams.root.head;
477
+ const optimisticMetadataTree = createMetadataRouteTree((0, _varypath.cloneVaryPathWithNewSearchParams)(baseMetadataTree.varyPath, optimisticRenderedSearch), baseMetadataTree.prefetchHints, null);
478
+ // Clone the base route tree, and override the relevant fields with our
479
+ // optimistic values.
480
+ const optimisticEntry = {
481
+ canonicalUrl: optimisticCanonicalUrl,
482
+ status: _cachemap.EntryStatus.Fulfilled,
483
+ // This isn't cloned because it's instance-specific
484
+ blockedTasks: null,
485
+ root: createRootRouteTree(optimisticRouteTree, optimisticMetadataTree),
486
+ couldBeIntercepted: routeWithNoSearchParams.couldBeIntercepted,
487
+ supportsPerSegmentPrefetching: routeWithNoSearchParams.supportsPerSegmentPrefetching,
488
+ predictedFrom: null,
489
+ // Override the rendered search with the optimistic value.
490
+ renderedSearch: optimisticRenderedSearch,
491
+ // Map-related fields
492
+ ref: null,
493
+ size: 0,
494
+ staleAt: routeWithNoSearchParams.staleAt,
495
+ version: routeWithNoSearchParams.version
496
+ };
497
+ // Do not insert this entry into the cache. It only exists so we can
498
+ // perform the current navigation. Just return it to the caller.
499
+ return optimisticEntry;
500
+ }
501
+ function deprecated_createOptimisticRouteTree(tree, newRenderedSearch) {
502
+ // Create a new route tree that identical to the original one except for
503
+ // the rendered search string, which is contained in the vary path.
504
+ let clonedSlots = null;
505
+ const originalSlots = tree.slots;
506
+ if (originalSlots !== null) {
507
+ clonedSlots = new Map();
508
+ for (const [parallelRouteKey, childTree] of originalSlots){
509
+ clonedSlots.set(parallelRouteKey, deprecated_createOptimisticRouteTree(childTree, newRenderedSearch));
510
+ }
511
+ }
512
+ // The shell vary path Fallbacks search params, so it's unaffected by the
513
+ // new rendered search and can be reused as-is.
514
+ return {
515
+ requestKey: tree.requestKey,
516
+ segment: tree.segment,
517
+ shellVaryPath: tree.shellVaryPath,
518
+ refreshState: tree.refreshState,
519
+ // Optimistic trees are structure-only. (The input tree comes from the
520
+ // route cache, which never carries render output.)
521
+ data: null,
522
+ varyPath: (0, _varypath.cloneVaryPathWithNewSearchParams)(tree.varyPath, newRenderedSearch),
523
+ slots: clonedSlots,
524
+ prefetchHints: tree.prefetchHints
525
+ };
526
+ }
527
+ function readOrCreateSegmentCacheEntry(now, // The map the calling task operates in (`PrefetchTask.segmentCacheMap`,
528
+ // captured when the task was scheduled).
529
+ map, fetchStrategy, tree) {
530
+ const existingEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, tree.varyPath, false, false);
531
+ if (existingEntry !== null) {
532
+ return existingEntry;
533
+ }
534
+ return insertEmptySegmentCacheEntry(now, map, fetchStrategy, tree);
535
+ }
536
+ /**
537
+ * Creates an empty segment cache entry and inserts it into the cache, keyed
538
+ * at the vary path a request made with the given fetch strategy is stored
539
+ * under. The stale time is set to a default value; the actual stale time will
540
+ * be set when the entry is fulfilled with data from the server response.
541
+ */ function insertEmptySegmentCacheEntry(now, map, fetchStrategy, tree) {
542
+ const varyPathForRequest = (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
543
+ const emptyEntry = createDetachedSegmentCacheEntry(now);
544
+ const isRevalidation = false;
545
+ (0, _cachemap.setInCacheMap)(map, varyPathForRequest, emptyEntry, isRevalidation);
546
+ return emptyEntry;
547
+ }
548
+ function readOrCreateRevalidatingSegmentEntry(now, // The map the calling task operates in (`PrefetchTask.segmentCacheMap`).
549
+ map, fetchStrategy, tree) {
550
+ // This function is called when we've already confirmed that a particular
551
+ // segment is cached, but we want to perform another request anyway in case it
552
+ // returns more complete and/or fresher data than we already have. The logic
553
+ // for deciding whether to replace the existing entry is handled elsewhere;
554
+ // this function just handles retrieving a cache entry that we can use to
555
+ // track the revalidation.
556
+ //
557
+ // The reason revalidations are stored in the cache is because we need to be
558
+ // able to dedupe multiple revalidation requests. The reason they have to be
559
+ // handled specially is because we shouldn't overwrite a "normal" entry if
560
+ // one exists at the same keypath. So, for each internal cache location, there
561
+ // is a special "revalidation" slot that is used solely for this purpose.
562
+ //
563
+ // You can think of it as if all the revalidation entries were stored in a
564
+ // separate cache map from the canonical entries, and then transfered to the
565
+ // canonical cache map once the request is complete — this isn't how it's
566
+ // actually implemented, since it's more efficient to store them in the same
567
+ // data structure as the normal entries, but that's how it's modeled
568
+ // conceptually.
569
+ // TODO: Once we implement Fallback behavior for params, where an entry is
570
+ // re-keyed based on response information, we'll need to account for the
571
+ // possibility that the keypath of the previous entry is more generic than
572
+ // the keypath of the revalidating entry. In other words, the server could
573
+ // return a less generic entry upon revalidation. For now, though, this isn't
574
+ // a concern because the keypath is based solely on the prefetch strategy,
575
+ // not on data contained in the response.
576
+ const existingEntry = readRevalidatingSegmentCacheEntry(now, map, tree.varyPath);
577
+ if (existingEntry !== null) {
578
+ return existingEntry;
579
+ }
580
+ // Create a pending entry and add it to the cache. The stale time is set to a
581
+ // default value; the actual stale time will be set when the entry is
582
+ // fulfilled with data from the server response.
583
+ const varyPathForRequest = (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
584
+ const pendingEntry = createDetachedSegmentCacheEntry(now);
585
+ const isRevalidation = true;
586
+ (0, _cachemap.setInCacheMap)(map, varyPathForRequest, pendingEntry, isRevalidation);
587
+ return pendingEntry;
588
+ }
589
+ function overwriteRevalidatingSegmentCacheEntry(now, // The map the calling task operates in (`PrefetchTask.segmentCacheMap`).
590
+ map, fetchStrategy, tree) {
591
+ // This function is called when we've already decided to replace an existing
592
+ // revalidation entry. Create a new entry and write it into the cache,
593
+ // overwriting the previous value. The stale time is set to a default value;
594
+ // the actual stale time will be set when the entry is fulfilled with data
595
+ // from the server response.
596
+ const varyPathForRequest = (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
597
+ const pendingEntry = createDetachedSegmentCacheEntry(now);
598
+ const isRevalidation = true;
599
+ (0, _cachemap.setInCacheMap)(map, varyPathForRequest, pendingEntry, isRevalidation);
600
+ return pendingEntry;
601
+ }
602
+ /**
603
+ * Whether an existing cache entry is preferred over an incoming candidate —
604
+ * i.e. the candidate does NOT supersede it. (On an exact tie — same fetch
605
+ * strategy, same partialness — this returns false, so the candidate replaces
606
+ * the existing entry.) This is the precedence rule used both when deciding
607
+ * whether an upsert may replace the entry at its own keypath, and when
608
+ * deciding whether an entry at a more specific keypath may be evicted because
609
+ * it shadows a just-inserted candidate (see `evictShadowingSegmentEntries`).
610
+ *
611
+ * Note that "less/more specific" in the comments below refers to fetch
612
+ * strategy content tiers (how much content a strategy can produce), not the
613
+ * vary-path specificity the eviction docs are concerned with.
614
+ */ function isExistingSegmentEntryPreferred(existingEntry, candidateEntry) {
615
+ if (existingEntry.status === _cachemap.EntryStatus.Empty) {
616
+ // An Empty entry is a placeholder that carries no data, and its
617
+ // fetchStrategy is a spawn-time default, not a fact about any content —
618
+ // it must never win a precedence comparison. (Without this, a candidate
619
+ // fetched at a tier below the placeholder's default would be discarded
620
+ // in favor of an entry with nothing in it.)
621
+ return false;
622
+ }
623
+ return(// We fetched the new segment using a different, less specific fetch
624
+ // strategy than the segment we already have in the cache, so it can't
625
+ // have more content.
626
+ candidateEntry.fetchStrategy !== existingEntry.fetchStrategy && !canNewFetchStrategyProvideMoreContent(existingEntry.fetchStrategy, candidateEntry.fetchStrategy) || // The existing entry isn't partial, but the new one is.
627
+ // (TODO: can this be true if `candidateEntry.fetchStrategy >= existingEntry.fetchStrategy`?)
628
+ !existingEntry.isPartial && candidateEntry.isPartial);
629
+ }
630
+ function upsertSegmentEntry(now, // The map the whole upsert (existing-entry read, insert, shadow eviction)
631
+ // operates in. Prefetch response-write paths pass the spawning task's map
632
+ // (`PrefetchTask.segmentCacheMap`), so a response that lands after a
633
+ // testing-lock scope boundary still writes into the map its entries
634
+ // live in.
635
+ map, varyPath, candidateEntry, // The fully concrete vary path a read for this segment position resolves
636
+ // against (all concrete param values, i.e. `tree.varyPath`) — the most
637
+ // specific path a read would use. Note this is the opposite of the
638
+ // generalized keying path that `getSegmentVaryPathForRequest` computes.
639
+ // Used to detect and evict stale entries at more specific keypaths that
640
+ // would otherwise shadow the candidate. Pass null when there's no request
641
+ // context; the shadow check is skipped.
642
+ lookupVaryPath) {
643
+ // We have a new entry that has not yet been inserted into the cache. Before
644
+ // we do so, we need to confirm whether it takes precedence over the existing
645
+ // entry (if one exists).
646
+ // TODO: We should not upsert an entry if its key was invalidated in the time
647
+ // since the request was made. We can do that by passing the "owner" entry to
648
+ // this function and confirming it's the same as `existingEntry`.
649
+ if ((0, _cachemap.isValueExpired)(now, getCurrentSegmentCacheVersion(), candidateEntry)) {
650
+ // The entry is expired. We cannot upsert it.
651
+ return null;
652
+ }
653
+ const existingEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, varyPath, false, false);
654
+ if (existingEntry !== null) {
655
+ // Don't replace a more specific segment with a less-specific one. A case where this
656
+ // might happen is if the existing segment was fetched via
657
+ // `<Link prefetch={true}>`.
658
+ if (isExistingSegmentEntryPreferred(existingEntry, candidateEntry)) {
659
+ // The candidate does not supersede the existing entry. Leave the
660
+ // existing entry in place and discard the candidate by not inserting it.
661
+ //
662
+ // We must not mutate the candidate here (e.g. downgrade it to Rejected or
663
+ // null out its `rsc`). The caller does not transfer exclusive ownership
664
+ // of it: it may already have been fulfilled, resolving its promise to a
665
+ // waiter that holds the entry and reads `rsc` off it later. A navigation
666
+ // seed is such a waiter, via `waitForSegmentCacheEntry`. Nulling `rsc`
667
+ // after the fact resolves that read to `null`, so the waiter loses the
668
+ // data it was about to render. Declining to insert it is enough: the
669
+ // existing entry stays canonical, and the candidate keeps its valid (if
670
+ // less complete) data for any waiter that already took it.
671
+ return null;
672
+ }
673
+ // Ping any tasks blocked on the existing entry before replacing it so they
674
+ // re-run and pick up the new entry. Without this, tasks waiting on the
675
+ // existing Empty/Pending entry would be stranded — the new fulfilled
676
+ // candidate has no blockedTasks of its own.
677
+ if (existingEntry.status === _cachemap.EntryStatus.Empty || existingEntry.status === _cachemap.EntryStatus.Pending) {
678
+ pingBlockedTasks(existingEntry);
679
+ }
680
+ // Replace the existing entry by writing the candidate over its keypath
681
+ // below (the same mechanism `overwriteRevalidatingSegmentCacheEntry`
682
+ // uses). We intentionally do NOT call `deleteFromCacheMap` first: deleting
683
+ // vacates the canonical slot, and `deleteMapEntry` promotes a pending
684
+ // Revalidation-slot entry into the vacated slot — which the immediate
685
+ // insert below would then silently overwrite. The in-flight revalidation
686
+ // would vanish from the map, so the next scheduler pass would find an
687
+ // empty revalidation slot and spawn a duplicate request instead of
688
+ // deduping against it. Replacing in place never vacates the slot, so
689
+ // promotion never runs and the pending revalidating entry stays in its
690
+ // Revalidation slot where `readOrCreateRevalidatingSegmentEntry`'s dedupe
691
+ // finds it.
692
+ //
693
+ // The displaced entry's map/LRU accounting is handled by the replacement
694
+ // itself: `setMapEntryValue` drops the displaced value's `ref` and
695
+ // `updateLruSize` swaps its size for the candidate's, which is exactly
696
+ // what delete-then-insert did.
697
+ }
698
+ const isRevalidation = false;
699
+ (0, _cachemap.setInCacheMap)(map, varyPath, candidateEntry, isRevalidation);
700
+ if (lookupVaryPath !== null) {
701
+ evictShadowingSegmentEntries(now, map, lookupVaryPath, candidateEntry);
702
+ }
703
+ return candidateEntry;
704
+ }
705
+ /**
706
+ * Evicts stale entries at more specific keypaths that shadow a just-inserted
707
+ * candidate entry.
708
+ *
709
+ * A response can be written to the cache at a MORE GENERIC vary path than the
710
+ * path the request was issued against — for example, the server may report
711
+ * that a segment doesn't vary on a param, so the entry is re-keyed with that
712
+ * param as Fallback. Meanwhile, an older, less useful entry can exist at a
713
+ * more specific path within the same fallback chain — for example, a partial
714
+ * shell entry keyed with root params concrete (see
715
+ * `getShellSegmentVaryPath`). Because segment lookup is
716
+ * most-specific-match-wins, every subsequent read at the concrete request
717
+ * path keeps returning the stale specific entry, and the more complete
718
+ * generic entry is unreachable from that URL. That both wastes the completed
719
+ * request and can loop: a prefetch task that revalidated the segment reads
720
+ * back the same stale entry, decides it needs to revalidate again, and
721
+ * repeats forever.
722
+ *
723
+ * The upsert is the one moment we know the ordering between the two entries:
724
+ * the candidate was produced by a request for this segment position, and
725
+ * `lookupVaryPath` is the fully concrete path a read for that position
726
+ * resolves against, so any entry that a read at that path would return in the
727
+ * candidate's stead is directly comparable to it. If such an entry is settled
728
+ * and the candidate supersedes it — under the same precedence rules the
729
+ * upsert applies at its own keypath — we know we never want to match against
730
+ * it again, so delete it, making the candidate reachable.
731
+ *
732
+ * Pending entries are never evicted here: they're owned by an in-flight
733
+ * request that will settle them. Empty entries ARE evictable — they're
734
+ * unclaimed placeholders with nothing in them, so they must not shadow real
735
+ * data; their blocked tasks are pinged so they re-run against the candidate.
736
+ */ function evictShadowingSegmentEntries(now, map, lookupVaryPath, candidateEntry) {
737
+ // There can in principle be multiple shadowing entries at successively less
738
+ // specific keypaths, so loop until the read returns the candidate (or an
739
+ // entry we don't supersede). Each iteration re-reads and re-checks from
740
+ // scratch (in part because `deleteFromCacheMap` can promote a settled
741
+ // Revalidation-slot value into the just-vacated slot, surfacing a new entry
742
+ // at the same keypath). Each iteration deletes an entry from the map, so
743
+ // the loop terminates naturally; the bound is defensive, and 32 is far
744
+ // beyond any real fallback chain, which is bounded by the vary
745
+ // path's length.
746
+ for(let i = 0; i < 32; i++){
747
+ const shadowEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, lookupVaryPath, false, false);
748
+ if (shadowEntry === null || shadowEntry === candidateEntry) {
749
+ // The candidate is reachable from the lookup path (or the read missed
750
+ // entirely, e.g. because the candidate expired). Done.
751
+ return;
752
+ }
753
+ if (shadowEntry.status === _cachemap.EntryStatus.Pending) {
754
+ // A Pending entry may not be evicted: it's held by an in-flight
755
+ // request and will settle on its own. (An Empty shadow entry, by
756
+ // contrast, is an unclaimed placeholder with nothing in it — never
757
+ // preferred over the candidate, per isExistingSegmentEntryPreferred —
758
+ // so it falls through to the eviction below, waking any tasks blocked
759
+ // on it so they re-run and find the candidate.)
760
+ return;
761
+ }
762
+ if (isExistingSegmentEntryPreferred(shadowEntry, candidateEntry)) {
763
+ // The shadowing entry is preferred over the candidate (e.g. it's a
764
+ // complete entry fetched with a more specific strategy). Leave it —
765
+ // reads at this path should keep matching it.
766
+ return;
767
+ }
768
+ // The candidate supersedes the shadowing entry. Evict it. Settled entries
769
+ // shouldn't have blocked tasks (Fulfilled always has `blockedTasks:
770
+ // null`, and Rejected entries were pinged at rejection), but an Empty
771
+ // entry may have them — ping before deleting, matching the upsert-evict
772
+ // pattern above.
773
+ pingBlockedTasks(shadowEntry);
774
+ (0, _cachemap.deleteFromCacheMap)(shadowEntry);
775
+ }
776
+ }
777
+ function createDetachedSegmentCacheEntry(now) {
778
+ // Default stale time for pending segment cache entries. The actual stale time
779
+ // is set when the entry is fulfilled with data from the server response.
780
+ const staleAt = now + 30 * 1000;
781
+ const emptyEntry = {
782
+ status: _cachemap.EntryStatus.Empty,
783
+ blockedTasks: null,
784
+ // Default to assuming the fetch strategy will be PPR. This will be updated
785
+ // when a fetch is actually initiated.
786
+ fetchStrategy: _types.FetchStrategy.PPR,
787
+ rsc: null,
788
+ isPartial: true,
789
+ isUpgradeableISRFallback: false,
790
+ promise: null,
791
+ // Map-related fields
792
+ ref: null,
793
+ size: 0,
794
+ staleAt,
795
+ version: 0
796
+ };
797
+ return emptyEntry;
798
+ }
799
+ function upgradeToPendingSegment(emptyEntry, fetchStrategy) {
800
+ const pendingEntry = emptyEntry;
801
+ pendingEntry.status = _cachemap.EntryStatus.Pending;
802
+ pendingEntry.fetchStrategy = fetchStrategy;
803
+ if (fetchStrategy === _types.FetchStrategy.Full) {
804
+ // The Pending-Full convention: pre-set isPartial to false before any
805
+ // data exists. Normally partiality is absolute — anything unresolved in
806
+ // the entry's output makes it true, and a pending entry has no output at
807
+ // all — but a Full response is a complete navigation payload, so this
808
+ // segment may already be omitted from navigation requests that happen
809
+ // while the data is still in flight. That "may be omitted" signal is
810
+ // exactly what isPartial: false means to a navigation, so this
811
+ // deliberately breaks the absolute definition for the pending window.
812
+ pendingEntry.isPartial = false;
813
+ }
814
+ // Set the version here, since this is right before the request is initiated.
815
+ // The next time the segment cache version is incremented, the entry will
816
+ // effectively be evicted. This happens before initiating the request, rather
817
+ // than when receiving the response, because it's guaranteed to happen
818
+ // before the data is read on the server.
819
+ pendingEntry.version = getCurrentSegmentCacheVersion();
820
+ return pendingEntry;
821
+ }
822
+ function attemptToFulfillDynamicSegmentFromBFCache(now, segment, tree) {
823
+ // Attempts to fulfill an empty segment cache entry using data from the
824
+ // bfcache. This is only valid during a Full prefetch (i.e. one that includes
825
+ // dynamic data), because the bfcache stores data from navigations which
826
+ // always include dynamic data.
827
+ // We always use the canonical vary path when checking the bfcache. This is
828
+ // the same operation we'd use to access the cache during a
829
+ // regular navigation.
830
+ const varyPath = tree.varyPath;
831
+ // Read from the BFCache without expiring it (pass -1). We check freshness
832
+ // ourselves using navigatedAt, because the BFCache's staleAt may have been
833
+ // overridden by a per-page unstable_dynamicStaleTime and can't be used to
834
+ // derive the original request time.
835
+ const bfcacheEntry = (0, _bfcache.readFromBFCache)(varyPath);
836
+ if (bfcacheEntry !== null) {
837
+ // The stale time for dynamic prefetches (default: 5 mins) is different
838
+ // from the stale time for regular navigations (default: 0 secs). Use
839
+ // navigatedAt to compute the correct expiry for prefetch purposes.
840
+ const dynamicPrefetchStaleAt = bfcacheEntry.navigatedAt + _navigatereducer.STATIC_STALETIME_MS;
841
+ if (now > dynamicPrefetchStaleAt) {
842
+ return null;
843
+ }
844
+ const pendingSegment = upgradeToPendingSegment(segment, _types.FetchStrategy.Full);
845
+ const isPartial = false;
846
+ return fulfillSegmentCacheEntry(pendingSegment, bfcacheEntry.rsc, dynamicPrefetchStaleAt, isPartial, bfcacheEntry.varyParams, // bfcache data is concrete, never an ISR fallback.
847
+ false, _types.FetchStrategy.Full);
848
+ }
849
+ return null;
850
+ }
851
+ function attemptToUpgradeSegmentFromBFCache(now, // The map the calling task operates in (`PrefetchTask.segmentCacheMap`).
852
+ map, tree) {
853
+ const varyPath = tree.varyPath;
854
+ const bfcacheEntry = (0, _bfcache.readFromBFCache)(varyPath);
855
+ if (bfcacheEntry !== null) {
856
+ const dynamicPrefetchStaleAt = bfcacheEntry.navigatedAt + _navigatereducer.STATIC_STALETIME_MS;
857
+ if (now > dynamicPrefetchStaleAt) {
858
+ return null;
859
+ }
860
+ const pendingSegment = upgradeToPendingSegment(createDetachedSegmentCacheEntry(now), _types.FetchStrategy.Full);
861
+ const isPartial = false;
862
+ const newEntry = fulfillSegmentCacheEntry(pendingSegment, bfcacheEntry.rsc, dynamicPrefetchStaleAt, isPartial, bfcacheEntry.varyParams, // bfcache data is concrete, never an ISR fallback.
863
+ false, _types.FetchStrategy.Full);
864
+ const segmentVaryPath = (0, _varypath.getSegmentVaryPathForRequest)(_types.FetchStrategy.Full, tree);
865
+ const upserted = upsertSegmentEntry(now, map, segmentVaryPath, newEntry, // The concrete lookup path this BFCache upgrade applies to. (In
866
+ // practice a Full request path is already fully concrete, so nothing
867
+ // can shadow the new entry and the shadow check is a no-op.)
868
+ tree.varyPath);
869
+ if (upserted !== null && upserted.status === _cachemap.EntryStatus.Fulfilled) {
870
+ return upserted;
871
+ }
872
+ }
873
+ return null;
874
+ }
875
+ function pingBlockedTasks(entry) {
876
+ const blockedTasks = entry.blockedTasks;
877
+ if (blockedTasks !== null) {
878
+ for (const task of blockedTasks){
879
+ (0, _scheduler.pingPrefetchTask)(task);
880
+ }
881
+ entry.blockedTasks = null;
882
+ }
883
+ }
884
+ function getHeadRequestKey(pageRequestKey) {
885
+ return pageRequestKey + _segmentvalueencoding.HEAD_REQUEST_KEY;
886
+ }
887
+ function createMetadataRouteTree(metadataVaryPath, // The route root's prefetch hints. The head has no node of its own on the
888
+ // wire, so the route-level hint that applies to it is copied from the root.
889
+ rootPrefetchHints, // The head's payload, with the same lifetimes as a segment node's `data`
890
+ // (see RouteTree): null in the route cache, the response's decoded
891
+ // head on a navigation seed, a CacheNode on the router state.
892
+ data) {
893
+ // The head is a one-node tree beside the route tree (see RootRouteTree). It
894
+ // has no position in the route tree, but it's fetched, cached, compared, and
895
+ // rendered like a segment, so it is a RouteTree node like any other.
896
+ const metadata = {
897
+ // The first entry of the head's vary path (see getHeadRequestKey). The
898
+ // server knows nothing of this key; it is always asked for
899
+ // HEAD_REQUEST_KEY, which is why the segment stays the bare marker.
900
+ requestKey: metadataVaryPath.value,
901
+ segment: _segmentvalueencoding.HEAD_REQUEST_KEY,
902
+ shellVaryPath: (0, _varypath.getShellSegmentVaryPath)(metadataVaryPath),
903
+ refreshState: null,
904
+ data,
905
+ varyPath: metadataVaryPath,
906
+ slots: null,
907
+ // Only the static-attempt bits apply to the head: it's a route-level
908
+ // fact ("static per-segment responses may exist for this route"), and
909
+ // it's what lets a shell-tier cached head attempt a static head fetch
910
+ // before deopting to a runtime request (see the shell-tier eligibility
911
+ // check in pingSegmentBundle). The other bits describe tree structure
912
+ // the head doesn't participate in.
913
+ prefetchHints: rootPrefetchHints & _approutertypes.StaticAttemptHints
914
+ };
915
+ return metadata;
916
+ }
917
+ /**
918
+ * Returns an equivalent tree with `data: null` at every node, cloning only
919
+ * the subtrees that carry data. Called when a tree is stored in the route
920
+ * cache: route cache entries live indefinitely, so retaining render output
921
+ * there would pin RSC payloads in memory outside the segment cache's eviction
922
+ * control. See the lifecycle note on RouteTree.
923
+ */ function stripDataFromRouteTree(tree) {
924
+ let clonedSlots = null;
925
+ const slots = tree.slots;
926
+ if (slots !== null) {
927
+ for (const [parallelRouteKey, childTree] of slots){
928
+ const strippedChild = stripDataFromRouteTree(childTree);
929
+ if (strippedChild !== childTree && clonedSlots === null) {
930
+ // Sound cast: any copied value that isn't overwritten below is one
931
+ // where stripDataFromRouteTree returned the child unchanged, which
932
+ // means that subtree carries no data.
933
+ clonedSlots = new Map(slots);
934
+ }
935
+ if (clonedSlots !== null) {
936
+ clonedSlots.set(parallelRouteKey, strippedChild);
937
+ }
938
+ }
939
+ }
940
+ if (tree.data === null && clonedSlots === null) {
941
+ // Neither this node nor any descendant carries data. Reuse it as-is.
942
+ // This is the common case for trees that never carried render output
943
+ // (e.g. route tree prefetch responses). Sound cast for the same reason.
944
+ return tree;
945
+ }
946
+ // Sound cast: clonedSlots is null here only if every child subtree was
947
+ // verified data-free by the loop above.
948
+ const strippedSlots = clonedSlots ?? slots;
949
+ return {
950
+ requestKey: tree.requestKey,
951
+ segment: tree.segment,
952
+ shellVaryPath: tree.shellVaryPath,
953
+ refreshState: tree.refreshState,
954
+ data: null,
955
+ varyPath: tree.varyPath,
956
+ slots: strippedSlots,
957
+ prefetchHints: tree.prefetchHints
958
+ };
959
+ }
960
+ function fulfillRouteCacheEntry(now, entry, root, couldBeIntercepted, canonicalUrl, renderedSearch, supportsPerSegmentPrefetching) {
961
+ const tree = root.tree;
962
+ const fulfilledEntry = entry;
963
+ fulfilledEntry.status = _cachemap.EntryStatus.Fulfilled;
964
+ fulfilledEntry.root = createRootRouteTree(stripDataFromRouteTree(tree), stripDataFromRouteTree(root.head));
965
+ // Route structure is essentially static — it only changes on deploy.
966
+ // Always use the static stale time.
967
+ // NOTE: An exception is rewrites/redirects in middleware or proxy, which can
968
+ // change routes dynamically. We have other strategies for handling those.
969
+ //
970
+ // If the route tree has stale inlining hints (e.g. the initial RSC payload
971
+ // for a build-time static page, generated before collectPrefetchHints ran),
972
+ // immediately expire the entry so it gets re-fetched with correct hints.
973
+ // The segment data itself is still valid — only the route tree (which
974
+ // contains the hint bits) needs to be re-fetched.
975
+ if (tree.prefetchHints & _approutertypes.PrefetchHint.InliningHintsStale) {
976
+ fulfilledEntry.staleAt = -1;
977
+ } else {
978
+ fulfilledEntry.staleAt = now + _navigatereducer.STATIC_STALETIME_MS;
979
+ }
980
+ fulfilledEntry.couldBeIntercepted = couldBeIntercepted;
981
+ fulfilledEntry.canonicalUrl = canonicalUrl;
982
+ fulfilledEntry.renderedSearch = renderedSearch;
983
+ fulfilledEntry.supportsPerSegmentPrefetching = supportsPerSegmentPrefetching;
984
+ pingBlockedTasks(entry);
985
+ return fulfilledEntry;
986
+ }
987
+ function writeRouteIntoCache(now, pathname, search, nextUrl, root, couldBeIntercepted, canonicalUrl, renderedSearch, supportsPerSegmentPrefetching) {
988
+ const pendingEntry = createDetachedRouteCacheEntry();
989
+ const fulfilledEntry = fulfillRouteCacheEntry(now, pendingEntry, root, couldBeIntercepted, canonicalUrl, renderedSearch, supportsPerSegmentPrefetching);
990
+ const varyPath = (0, _varypath.getFulfilledRouteVaryPath)(pathname, search, nextUrl, couldBeIntercepted);
991
+ const isRevalidation = false;
992
+ (0, _cachemap.setInCacheMap)(routeCacheMap, varyPath, fulfilledEntry, isRevalidation);
993
+ return fulfilledEntry;
994
+ }
995
+ function fulfillSegmentCacheEntry(segmentCacheEntry, rsc, staleAt, isPartial, varyParams, // Only static (per-segment PPR) responses can be ISR fallbacks; all other
996
+ // callers pass false. Always assigned (even when false) so that re-fulfilling
997
+ // a previously-fallback entry with a concrete response clears the flag and
998
+ // ends the retry loop.
999
+ isUpgradeableISRFallback, // The strategy tier describing the CONTENT this entry is fulfilled with —
1000
+ // which comes from the response, not the tier the entry was requested at.
1001
+ // Usually the two agree, but when a response's shell payload IS the full
1002
+ // response (no shell/full split), shell-spawned entries are fulfilled with
1003
+ // full-tier content and recorded as such (see the promotion in
1004
+ // writeSegmentDataIntoCache). Always assigned, replacing
1005
+ // the spawn-time strategy set by upgradeToPendingSegment; the write walks'
1006
+ // matching and keying decisions all happen against the spawn-time
1007
+ // strategy, before fulfillment, so they are unaffected. See
1008
+ // SegmentCacheEntryShared['fetchStrategy'].
1009
+ fetchStrategy) {
1010
+ const fulfilledEntry = segmentCacheEntry;
1011
+ fulfilledEntry.status = _cachemap.EntryStatus.Fulfilled;
1012
+ fulfilledEntry.rsc = rsc;
1013
+ fulfilledEntry.staleAt = staleAt;
1014
+ fulfilledEntry.isPartial = isPartial;
1015
+ fulfilledEntry.varyParams = varyParams;
1016
+ fulfilledEntry.isUpgradeableISRFallback = isUpgradeableISRFallback;
1017
+ fulfilledEntry.fetchStrategy = fetchStrategy;
1018
+ // Resolve any listeners that were waiting for this data.
1019
+ if (segmentCacheEntry.promise !== null) {
1020
+ segmentCacheEntry.promise.resolve(fulfilledEntry);
1021
+ // Free the promise for garbage collection.
1022
+ fulfilledEntry.promise = null;
1023
+ }
1024
+ pingBlockedTasks(segmentCacheEntry);
1025
+ return fulfilledEntry;
1026
+ }
1027
+ function rejectRouteCacheEntry(entry, staleAt) {
1028
+ const rejectedEntry = entry;
1029
+ rejectedEntry.status = _cachemap.EntryStatus.Rejected;
1030
+ rejectedEntry.staleAt = staleAt;
1031
+ pingBlockedTasks(entry);
1032
+ }
1033
+ function rejectSegmentCacheEntry(entry, staleAt) {
1034
+ const rejectedEntry = entry;
1035
+ rejectedEntry.status = _cachemap.EntryStatus.Rejected;
1036
+ rejectedEntry.staleAt = staleAt;
1037
+ if (entry.promise !== null) {
1038
+ // NOTE: We don't currently propagate the reason the prefetch was canceled
1039
+ // but we could by accepting a `reason` argument.
1040
+ entry.promise.resolve(null);
1041
+ entry.promise = null;
1042
+ }
1043
+ pingBlockedTasks(entry);
1044
+ }
1045
+ function convertRootFlightRouterStateToRouteTree(flightRouterState, renderedSearch, acc) {
1046
+ return convertFlightRouterStateToRouteTree(flightRouterState, _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY, null, renderedSearch, acc);
1047
+ }
1048
+ function rebaseInactiveRouteTree(treeToRebase) {
1049
+ // A parallel route slot that the target route doesn't provide keeps the
1050
+ // slot already active on the current route, under the new parent. The slot
1051
+ // sits at the same route position, so its request keys and vary paths are
1052
+ // unchanged: copy the structure and drop the payloads, which belong to the
1053
+ // previous render and are reused separately by render-tree.
1054
+ let slots = null;
1055
+ if (treeToRebase.slots !== null) {
1056
+ slots = new Map();
1057
+ for (const [parallelRouteKey, child] of treeToRebase.slots){
1058
+ slots.set(parallelRouteKey, rebaseInactiveRouteTree(child));
1059
+ }
1060
+ }
1061
+ return {
1062
+ requestKey: treeToRebase.requestKey,
1063
+ segment: treeToRebase.segment,
1064
+ varyPath: treeToRebase.varyPath,
1065
+ shellVaryPath: treeToRebase.shellVaryPath,
1066
+ refreshState: treeToRebase.refreshState,
1067
+ data: null,
1068
+ slots,
1069
+ prefetchHints: treeToRebase.prefetchHints
1070
+ };
1071
+ }
1072
+ function convertFlightRouterStateToRouteTree(flightRouterState, requestKey, parentPartialVaryPath, parentRenderedSearch, acc) {
1073
+ const originalSegment = flightRouterState[0];
1074
+ // This segment's param (if any) is a root param iff the segment is at or
1075
+ // above the root layout, which the server marks directly.
1076
+ const isRootParam = ((flightRouterState[4] ?? 0) & _approutertypes.PrefetchHint.IsRootLayoutOrAbove) !== 0;
1077
+ // If the FlightRouterState has a refresh state, then this segment is part of
1078
+ // an inactive parallel route. It has a different rendered search query than
1079
+ // the outer parent route. In order to construct the inactive route correctly,
1080
+ // we must restore the query that was originally used to render it.
1081
+ const compressedRefreshState = flightRouterState[2] ?? null;
1082
+ const refreshState = compressedRefreshState !== null ? {
1083
+ canonicalUrl: compressedRefreshState[0],
1084
+ renderedSearch: compressedRefreshState[1]
1085
+ } : null;
1086
+ // Use the incoming search params, even if the response has no new data for
1087
+ // this segment. The base tree may still have the previous URL's. History
1088
+ // restores pass in their saved search params instead.
1089
+ const renderedSearch = refreshState !== null ? refreshState.renderedSearch : parentRenderedSearch;
1090
+ const tree = (0, _decodeserverresponse.createRouteTreeNode)(originalSegment, isRootParam, requestKey, parentPartialVaryPath, renderedSearch, refreshState, acc);
1091
+ const partialVaryPath = (0, _varypath.getPartialVaryPath)(tree.varyPath);
1092
+ let slots = null;
1093
+ const parallelRoutes = flightRouterState[1];
1094
+ for(let parallelRouteKey in parallelRoutes){
1095
+ const childRouterState = parallelRoutes[parallelRouteKey];
1096
+ const childSegment = childRouterState[0];
1097
+ // TODO: Eventually, the param values will not be included in the response
1098
+ // from the server. We'll instead fill them in on the client by parsing
1099
+ // the URL. This is where we'll do that.
1100
+ const childRequestKeyPart = (0, _segmentvalueencoding.createSegmentRequestKeyPart)(childSegment);
1101
+ const childRequestKey = (0, _segmentvalueencoding.appendSegmentRequestKeyPart)(requestKey, parallelRouteKey, childRequestKeyPart);
1102
+ const childTree = convertFlightRouterStateToRouteTree(childRouterState, childRequestKey, partialVaryPath, renderedSearch, acc);
1103
+ if (slots === null) {
1104
+ slots = new Map();
1105
+ }
1106
+ slots.set(parallelRouteKey, childTree);
1107
+ }
1108
+ tree.slots = slots;
1109
+ tree.prefetchHints = flightRouterState[4] ?? 0;
1110
+ return tree;
1111
+ }
1112
+ function convertRouteTreeToFlightRouterState(routeTree) {
1113
+ const parallelRoutes = {};
1114
+ const slots = routeTree.slots;
1115
+ if (slots !== null) {
1116
+ for (const [parallelRouteKey, childTree] of slots){
1117
+ parallelRoutes[parallelRouteKey] = convertRouteTreeToFlightRouterState(childTree);
1118
+ }
1119
+ }
1120
+ const flightRouterState = [
1121
+ routeTree.segment,
1122
+ parallelRoutes,
1123
+ null,
1124
+ null
1125
+ ];
1126
+ if (routeTree.prefetchHints !== 0) {
1127
+ flightRouterState[4] = routeTree.prefetchHints;
1128
+ }
1129
+ return flightRouterState;
1130
+ }
1131
+ async function fetchRouteOnCacheMiss(entry, key) {
1132
+ // This function is allowed to use async/await because it contains the actual
1133
+ // fetch that gets issued on a cache miss. Notice it writes the result to the
1134
+ // cache entry directly, rather than return data that is then written by
1135
+ // the caller.
1136
+ const pathname = key.pathname;
1137
+ const search = key.search;
1138
+ const nextUrl = key.nextUrl;
1139
+ const segmentPath = '/_tree';
1140
+ const headers = {
1141
+ [_approuterheaders.RSC_HEADER]: '1',
1142
+ [_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER]: '1',
1143
+ [_approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: segmentPath
1144
+ };
1145
+ if (nextUrl !== null) {
1146
+ headers[_approuterheaders.NEXT_URL] = nextUrl;
1147
+ }
1148
+ try {
1149
+ const url = new URL(pathname + search, location.origin);
1150
+ let response;
1151
+ let urlAfterRedirects;
1152
+ if (isOutputExportMode) {
1153
+ // In output: "export" mode, we can't use headers to request a particular
1154
+ // segment. Instead, we encode the extra request information into the URL.
1155
+ // This is not part of the "public" interface of the app; it's an internal
1156
+ // Next.js implementation detail that the app developer should not need to
1157
+ // concern themselves with.
1158
+ //
1159
+ // For example, to request a segment:
1160
+ //
1161
+ // Path passed to <Link>: /path/to/page
1162
+ // Path passed to fetch: /path/to/page/__next-segments/_tree
1163
+ //
1164
+ // (This is not the exact protocol, just an illustration.)
1165
+ //
1166
+ // Before we do that, though, we need to account for redirects. Even in
1167
+ // output: "export" mode, a proxy might redirect the page to a different
1168
+ // location, but we shouldn't assume or expect that they also redirect all
1169
+ // the segment files, too.
1170
+ //
1171
+ // To check whether the page is redirected, previously we perform a range
1172
+ // request of 64 bytes of the HTML document to check if the target page
1173
+ // is part of this app (by checking if build id matches). Only if the target
1174
+ // page is part of this app do we determine the final canonical URL.
1175
+ //
1176
+ // However, as mentioned in https://github.com/vercel/next.js/pull/85903,
1177
+ // some popular static hosting providers (like Cloudflare Pages or Render.com)
1178
+ // do not support range requests, in the worst case, the entire HTML instead
1179
+ // of 64 bytes could be returned, which is wasteful.
1180
+ //
1181
+ // So instead, we drops the check for build id here, and simply perform
1182
+ // a HEAD request to rejects 1xx/4xx/5xx responses, and then determine the
1183
+ // final URL after redirects.
1184
+ //
1185
+ // NOTE: We could embed the route tree into the HTML document, to avoid
1186
+ // a second request. We're not doing that currently because it would make
1187
+ // the HTML document larger and affect normal page loads.
1188
+ const headResponse = await (0, _fetch.fetch)(url, {
1189
+ method: 'HEAD'
1190
+ });
1191
+ if (headResponse.status < 200 || headResponse.status >= 400) {
1192
+ // The target page responded w/o a successful status code
1193
+ // Could be a WAF serving a 403, or a 5xx from a backend
1194
+ //
1195
+ // Note that we can't use headResponse.ok here, because
1196
+ // Response#ok returns `false` with 3xx responses.
1197
+ rejectRouteCacheEntry(entry, Date.now() + REJECTION_BACKOFF_MS);
1198
+ return null;
1199
+ }
1200
+ urlAfterRedirects = headResponse.redirected ? new URL(headResponse.url) : url;
1201
+ response = await fetchPrefetchResponse(addSegmentPathToUrlInOutputExportMode(urlAfterRedirects, segmentPath), headers);
1202
+ } else {
1203
+ // "Server" mode. We can use request headers instead of the pathname.
1204
+ // TODO: The eventual plan is to get rid of our custom request headers and
1205
+ // encode everything into the URL, using a similar strategy to the
1206
+ // "output: export" block above.
1207
+ response = await fetchPrefetchResponse(url, headers);
1208
+ urlAfterRedirects = response !== null && response.redirected ? new URL(response.url) : url;
1209
+ }
1210
+ if (!response || !response.ok || !response.body) {
1211
+ // Server responded with an error, or with a miss. We should still cache
1212
+ // the response, but we can try again after 10 seconds.
1213
+ rejectRouteCacheEntry(entry, Date.now() + REJECTION_BACKOFF_MS);
1214
+ return null;
1215
+ }
1216
+ // TODO: The canonical URL is the href without the origin. I think
1217
+ // historically the reason for this is because the initial canonical URL
1218
+ // gets passed as a prop to the top-level React component, which means it
1219
+ // needs to be computed during SSR. If it were to include the origin, it
1220
+ // would need to always be same as location.origin on the client, to prevent
1221
+ // a hydration mismatch. To sidestep this complexity, we omit the origin.
1222
+ //
1223
+ // However, since this is neither a native URL object nor a fully qualified
1224
+ // URL string, we need to be careful about how we use it. To prevent subtle
1225
+ // mistakes, we should create a special type for it, instead of just string.
1226
+ // Or, we should just use a (readonly) URL object instead. The type of the
1227
+ // prop that we pass to seed the initial state does not need to be the same
1228
+ // type as the state itself.
1229
+ const canonicalUrl = (0, _createhreffromurl.createHrefFromUrl)(urlAfterRedirects);
1230
+ // Check whether the response varies based on the Next-Url header.
1231
+ const varyHeader = response.headers.get('vary');
1232
+ const couldBeIntercepted = varyHeader !== null && varyHeader.includes(_approuterheaders.NEXT_URL);
1233
+ // TODO: The `closed` promise was originally used to track when a streaming
1234
+ // network connection closes, so the scheduler could limit concurrent
1235
+ // connections. Now that prefetch responses are buffered, `closed` is
1236
+ // resolved immediately after buffering — before the outer function even
1237
+ // returns. This mechanism is only still meaningful for dynamic (Full)
1238
+ // prefetches, which use incremental streaming. Consider removing the
1239
+ // `closed` plumbing for buffered prefetch paths.
1240
+ const closed = (0, _promisewithresolvers.createPromiseWithResolvers)();
1241
+ // Note this doesn't imply PPR is enabled for the route: fully static
1242
+ // routes serve from the per-segment cache too. What it does tell us is
1243
+ // that per-segment prefetching is supported, which is what the route
1244
+ // entry records below.
1245
+ const supportsPerSegmentPrefetching = wasServedFromPerSegmentCache(response);
1246
+ // Decode the response. Routes that support per-segment prefetching
1247
+ // respond from static storage; other routes respond with a live render
1248
+ // (see the isRouteTreePrefetchRequest branch in
1249
+ // walk-tree-with-flight-router-state). Both are
1250
+ // NavigationFlightResponses carrying a buildId and a structure-only
1251
+ // transport tree — which is all this flow reads — so one decode path
1252
+ // serves both.
1253
+ const buffer = await bufferPrefetchResponseBody(response.body);
1254
+ closed.resolve();
1255
+ (0, _cachemap.setSizeInCacheMap)(entry, buffer.byteLength);
1256
+ const serverData = await (0, _fetchserverresponse.decodeBufferedStage)(buffer, headers);
1257
+ if ((response.headers.get(_constants.NEXT_NAV_DEPLOYMENT_ID_HEADER) ?? serverData.b) !== (0, _navigationbuildid.getNavigationBuildId)()) {
1258
+ // The server build does not match the client. Treat as a 404. During
1259
+ // an actual navigation, the router will trigger an MPA navigation.
1260
+ // TODO: We should cache the fact that this is an MPA navigation.
1261
+ rejectRouteCacheEntry(entry, Date.now() + REJECTION_BACKOFF_MS);
1262
+ return null;
1263
+ }
1264
+ const transportData = serverData.t;
1265
+ if (transportData === undefined || serverData.n !== undefined) {
1266
+ // The response carries no route tree (e.g. it's an MPA navigation), so
1267
+ // there's nothing to cache.
1268
+ rejectRouteCacheEntry(entry, Date.now() + REJECTION_BACKOFF_MS);
1269
+ return null;
1270
+ }
1271
+ // Get the params that were used to render the target page. These may
1272
+ // be different from the params in the request URL, if the page
1273
+ // was rewritten. The rendered pathname is also used to fill in the param
1274
+ // values the server omitted from the response (omitting them keeps the
1275
+ // response cacheable across param values).
1276
+ const renderedPathname = (0, _routeparams.getRenderedPathname)(response);
1277
+ const renderedSearch = (0, _routeparams.getRenderedSearch)(response);
1278
+ // Decode the server-sent tree into the RouteTree format used by the
1279
+ // client cache.
1280
+ //
1281
+ // During this traversal, we accumulate additional data into this
1282
+ // "accumulator" object.
1283
+ const acc = {
1284
+ metadataVaryPath: null,
1285
+ treeDivergedFromBase: false
1286
+ };
1287
+ const routeTree = (0, _decodeserverresponse.decodeTransportTreeIntoRouteTree)(transportData.t, null, // The tree is structure-only (no data nodes), so there are no vary
1288
+ // params to decode...
1289
+ null, // ...and no partiality either; the conservative value is never read.
1290
+ true, renderedPathname, renderedSearch, acc);
1291
+ const metadataVaryPath = acc.metadataVaryPath;
1292
+ if (metadataVaryPath === null) {
1293
+ rejectRouteCacheEntry(entry, Date.now() + REJECTION_BACKOFF_MS);
1294
+ return null;
1295
+ }
1296
+ (0, _optimisticroutes.discoverKnownRoute)(Date.now(), pathname, search, nextUrl, entry, {
1297
+ tree: routeTree,
1298
+ head: createMetadataRouteTree(metadataVaryPath, routeTree.prefetchHints, null)
1299
+ }, couldBeIntercepted, canonicalUrl, renderedSearch, supportsPerSegmentPrefetching, false // hasDynamicRewrite
1300
+ );
1301
+ if (!couldBeIntercepted) {
1302
+ // This route will never be intercepted. So we can use this entry for all
1303
+ // requests to this route, regardless of the Next-Url header. This works
1304
+ // because when reading the cache we always check for a valid
1305
+ // non-intercepted entry first.
1306
+ // Re-key the entry. The `set` implementation handles removing it from
1307
+ // its previous position in the cache. We don't need to do anything to
1308
+ // update the LRU, because the entry is already in it.
1309
+ // TODO: Treat this as an upsert — should check if an entry already
1310
+ // exists at the new keypath, and if so, whether we should keep that
1311
+ // one instead.
1312
+ const fulfilledVaryPath = (0, _varypath.getFulfilledRouteVaryPath)(pathname, search, nextUrl, couldBeIntercepted);
1313
+ const isRevalidation = false;
1314
+ (0, _cachemap.setInCacheMap)(routeCacheMap, fulfilledVaryPath, entry, isRevalidation);
1315
+ }
1316
+ // Return a promise that resolves when the network connection closes, so
1317
+ // the scheduler can track the number of concurrent network connections.
1318
+ return {
1319
+ value: null,
1320
+ closed: closed.promise
1321
+ };
1322
+ } catch (error) {
1323
+ // Either the connection itself failed, or something bad happened while
1324
+ // decoding the response.
1325
+ rejectRouteCacheEntry(entry, getPrefetchErrorStaleAt(error));
1326
+ return null;
1327
+ }
1328
+ }
1329
+ // When a static (per-segment PPR) prefetch receives an upgradeable fallback
1330
+ // shell, the localized retry loop re-issues the same fetch after this delay to
1331
+ // pick up the concrete version once the server's background regeneration
1332
+ // finishes.
1333
+ const FALLBACK_RETRY_DELAY_MS = 2000;
1334
+ // Maximum number of fallback retries per task, to avoid looping indefinitely
1335
+ // if the server keeps returning a fallback (e.g. misconfiguration).
1336
+ const MAX_FALLBACK_RETRIES = 3;
1337
+ async function fetchSegmentPrefetchesUsingStaticRequest(task, route, routeKey, tree, // The pending cache entries this task spawned for the bundle, keyed by
1338
+ // segment request key. The response fulfills them when it arrives.
1339
+ spawnedEntries, // Which walk spawned the bundle's entries. The request on the wire is
1340
+ // identical either way; this only decides which payload of the response
1341
+ // fulfills the entries.
1342
+ fetchStrategy) {
1343
+ // This function is allowed to use async/await because it contains the actual
1344
+ // fetch that gets issued on a cache miss. Notice it writes the result to the
1345
+ // cache entry directly, rather than return data that is then written by
1346
+ // the caller.
1347
+ //
1348
+ // Segment fetches are non-blocking so we don't need to ping the scheduler
1349
+ // on completion.
1350
+ let isUpgradeableISRFallback;
1351
+ try {
1352
+ isUpgradeableISRFallback = await fetchAndWritePerSegmentPrefetchResponse(task, route, routeKey, tree, spawnedEntries, fetchStrategy, // Write the response even if it's an upgradeable fallback shell — the
1353
+ // fallback content is better than nothing while the retry loop waits
1354
+ // for the concrete version.
1355
+ false);
1356
+ } catch (error) {
1357
+ // The connection failed, or the response couldn't be decoded. Reject the
1358
+ // pending entries so they don't stay Pending forever, and get retried
1359
+ // once the entry expires.
1360
+ rejectSegmentEntriesIfStillPending(spawnedEntries, getPrefetchErrorStaleAt(error));
1361
+ return null;
1362
+ }
1363
+ if (isUpgradeableISRFallback === null) {
1364
+ // The response was fetched but isn't usable yet (server error/miss, empty
1365
+ // data, or a build-id mismatch — the server may be transiently unready).
1366
+ // Reject with a short backoff so the entries are retried soon.
1367
+ rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + REJECTION_BACKOFF_MS);
1368
+ return null;
1369
+ }
1370
+ return {
1371
+ value: null,
1372
+ // The response is fully buffered before it's decoded, so the network
1373
+ // connection is already closed by the time the fetch returns. See TODO
1374
+ // in fetchRouteOnCacheMiss about removing `closed` for buffered
1375
+ // prefetch paths.
1376
+ closed: Promise.resolve()
1377
+ };
1378
+ }
1379
+ /**
1380
+ * Issues a single segment-bundle prefetch request, validates and decodes the
1381
+ * response, and writes every payload of it into the cache — the full
1382
+ * payload, and, when the response carries a shell byte boundary, a second
1383
+ * decode of the same bytes truncated at that boundary, the segments'
1384
+ * shell-stage variant — through the shared payload-write orchestration
1385
+ * (writeResponsePayloadsIntoCache), which owns which payload fulfills the
1386
+ * spawned entries and the tier each payload is written at.
1387
+ *
1388
+ * Returns whether the response was an upgradeable ISR fallback shell (the
1389
+ * page hadn't been prerendered with concrete params yet), or `null` if the
1390
+ * response was fetched but isn't usable yet (server error/miss, empty data,
1391
+ * or a build-id mismatch — the server may be transiently unready, so it's
1392
+ * worth retrying; nothing is written and no entries are rejected). THROWS if
1393
+ * the connection failed or the response couldn't be decoded; re-issuing the
1394
+ * identical request won't fix that, so callers should give up rather
1395
+ * than retry.
1396
+ *
1397
+ * When the response is an upgradeable fallback shell, this also starts the
1398
+ * task's localized fallback-retry loop (at most one per task, ever), BEFORE
1399
+ * writing the fallback content — see the comment on the transition below.
1400
+ *
1401
+ * Calling this again with the same arguments reproduces the exact same
1402
+ * request. The retry loop uses that to re-issue the request until the server
1403
+ * has the concrete version, passing `discardFallbackResponse` so a response
1404
+ * that is STILL a fallback isn't pointlessly re-written over the identical
1405
+ * fallback content the initial fetch already cached. (The retry's entries
1406
+ * are already settled, so its writes are all detached upserts.)
1407
+ */ async function fetchAndWritePerSegmentPrefetchResponse(task, route, routeKey, tree, spawnedEntries, fetchStrategy, // When true, a response that is still an upgradeable fallback shell is
1408
+ // discarded instead of written (the fallback-retry loop's re-issued
1409
+ // requests).
1410
+ discardFallbackResponse) {
1411
+ // Use the canonical URL to request the segment, not the original URL. These
1412
+ // are usually the same, but the canonical URL will be different if the route
1413
+ // tree response was redirected. To avoid an extra waterfall on every segment
1414
+ // request, we pass the redirected URL instead of the original one.
1415
+ const url = new URL(route.canonicalUrl, location.origin);
1416
+ const nextUrl = routeKey.nextUrl;
1417
+ let normalizedRequestKey;
1418
+ if (tree.segment === _segmentvalueencoding.HEAD_REQUEST_KEY) {
1419
+ // The head's request key is its client cache identity; the server only
1420
+ // knows the head by its bare marker, which is also the head node's
1421
+ // segment (see createMetadataRouteTree).
1422
+ normalizedRequestKey = _segmentvalueencoding.HEAD_REQUEST_KEY;
1423
+ } else if (tree.requestKey === _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY) {
1424
+ // The root segment is a special case. To simplify the server-side
1425
+ // handling of these requests, we encode the root segment path as
1426
+ // `_index` instead of as an empty string. This should be treated as
1427
+ // an implementation detail and not as a stable part of the protocol.
1428
+ // It just needs to match the equivalent logic that happens when
1429
+ // prerendering the responses. It should not leak outside of Next.js.
1430
+ normalizedRequestKey = '/_index';
1431
+ } else {
1432
+ normalizedRequestKey = tree.requestKey;
1433
+ }
1434
+ const headers = {
1435
+ [_approuterheaders.RSC_HEADER]: '1',
1436
+ [_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER]: '1',
1437
+ [_approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: normalizedRequestKey
1438
+ };
1439
+ if (nextUrl !== null) {
1440
+ headers[_approuterheaders.NEXT_URL] = nextUrl;
1441
+ }
1442
+ const requestUrl = isOutputExportMode ? addSegmentPathToUrlInOutputExportMode(url, normalizedRequestKey) : url;
1443
+ const response = await fetchPrefetchResponse(requestUrl, headers);
1444
+ if (!response || !response.ok || // Theoretically this check should never fail, because we only issue
1445
+ // requests for segments once we've verified that the route supports PPR.
1446
+ !wasServedFromPerSegmentCache(response) || !response.body) {
1447
+ // Server responded with an error or a miss — fetched but not usable.
1448
+ return null;
1449
+ }
1450
+ const buffer = await bufferPrefetchResponseBody(response.body);
1451
+ // Parse the response. Always a PrefetchFlightResponse. A connection drop
1452
+ // or malformed stream throws here, which propagates to the caller as a
1453
+ // non-retryable failure.
1454
+ const serverResponse = await (0, _fetchserverresponse.decodeBufferedStage)(buffer, headers);
1455
+ if (serverResponse.t === undefined) {
1456
+ // The response carries no segment data at all — not usable.
1457
+ // writeServerResponseIntoCache checks this again, but this fetch-layer
1458
+ // copy is deliberate: it must run before the fallback-retry loop is
1459
+ // started and before the payload writes below, neither of which should
1460
+ // happen for an empty response.
1461
+ return null;
1462
+ }
1463
+ if ((response.headers.get(_constants.NEXT_NAV_DEPLOYMENT_ID_HEADER) ?? serverResponse.b) !== (0, _navigationbuildid.getNavigationBuildId)()) {
1464
+ // The server build does not match the client. Treat as a 404. During
1465
+ // an actual navigation, the router will trigger an MPA navigation.
1466
+ return null;
1467
+ }
1468
+ // True if the server served an upgradeable fallback shell (the page hadn't
1469
+ // been prerendered with concrete params yet, but the route can be
1470
+ // upgraded once the server's background regeneration finishes).
1471
+ const isUpgradeableISRFallback = serverResponse.f === true;
1472
+ if (isUpgradeableISRFallback) {
1473
+ if (discardFallbackResponse) {
1474
+ // Still a fallback — the server hasn't finished regenerating. Don't
1475
+ // write it; the retry loop will re-issue the request.
1476
+ return true;
1477
+ }
1478
+ // Drive a localized retry loop to pick up the concrete version once the
1479
+ // server's background regeneration finishes. Only the first fallback
1480
+ // response per task starts a loop (`fallbackRetryStatus === Empty`);
1481
+ // once it leaves Empty, no second loop is started — sibling bundle
1482
+ // responses that also got a fallback don't, and neither does a re-hover.
1483
+ //
1484
+ // The transition to Pending must happen BEFORE the fallback content is
1485
+ // written below: fulfilling an entry pings the tasks blocked on it, and
1486
+ // a scheduler pass that ran before the transition would observe a
1487
+ // fulfilled fallback entry with the retry gate still Empty and spawn a
1488
+ // duplicate revalidation request (see isUpgradeableISRFallbackRetry in
1489
+ // pingSegmentBundle in scheduler.ts).
1490
+ if (task.fallbackRetryStatus === _cachemap.EntryStatus.Empty && !task.isCanceled) {
1491
+ task.fallbackRetryStatus = _cachemap.EntryStatus.Pending;
1492
+ // Fire-and-forget: the loop drives itself via timers and pings the
1493
+ // task on success.
1494
+ void retryUpgradeableFallbackPrefetch(task, route, routeKey, tree, spawnedEntries, fetchStrategy);
1495
+ }
1496
+ }
1497
+ // Extract the shell payload, if the response carries a distinct one
1498
+ // (positive shell byte offset): decode the buffered bytes a SECOND time,
1499
+ // truncated at the boundary. The truncation is what produces the shell
1500
+ // variant: each segment's param-dependent rows land past the boundary and
1501
+ // decode as still-pending, which renders as the param fallback. It also
1502
+ // rewinds the response's signals — `needsRuntimeRequest` and `isPartial`
1503
+ // fulfillments past the boundary read as pending in this decode, so a
1504
+ // post-shell runtime-data access doesn't mark the shell variant itself as
1505
+ // needing a runtime request.
1506
+ // (A 0 offset means the response carries no shell: the server emits a
1507
+ // fulfilled 0 when the page wasn't staged at all — see the `a` resolution
1508
+ // in collect-segment-data — and 0 is also the default read of an
1509
+ // unfulfilled `a`, which would be a Next.js bug since the full buffer is
1510
+ // present. Both read the same here: no shell, and the scheduler skips the
1511
+ // affected segments rather than falling back to a runtime request — see
1512
+ // the no-shell handling in writeResponsePayloadsIntoCache. Failing in that
1513
+ // direction costs a shell prefetch but never leaks post-shell content into
1514
+ // shell positions. 0 can double as "none" on the wire precisely because
1515
+ // it's never a valid offset — see the `a` field doc on
1516
+ // NavigationFlightResponse.)
1517
+ const shellOffset = serverResponse.a !== undefined ? (0, _rsctransport.readFulfilledValue)(serverResponse.a, 0) : 0;
1518
+ let shellResponse;
1519
+ if (shellOffset === null) {
1520
+ shellResponse = serverResponse;
1521
+ } else if (shellOffset === 0) {
1522
+ shellResponse = null;
1523
+ } else {
1524
+ try {
1525
+ shellResponse = await (0, _fetchserverresponse.decodeBufferedStage)(buffer.subarray(0, shellOffset), headers);
1526
+ } catch {
1527
+ // The truncated prefix couldn't be decoded. Treat it as if no shell
1528
+ // exists; the full payload is still usable. (For a StaticShell-spawned
1529
+ // bundle this means the spawned entries are rejected — the scheduler
1530
+ // then skips them rather than issuing a runtime substitute; see the
1531
+ // no-shell handling in writeResponsePayloadsIntoCache.)
1532
+ shellResponse = null;
1533
+ }
1534
+ }
1535
+ // The pathname the page was rendered for, derived the same way the route
1536
+ // tree fetch derives it (the rewritten-path header when the request was
1537
+ // rewritten, the request URL otherwise) so the vary paths computed from
1538
+ // this response's decoded tree agree with the ones on the route entry's
1539
+ // tree. In output: "export" mode the response URL has the segment filename
1540
+ // appended to the pathname, so derive it from the page URL instead
1541
+ // (rewrites don't exist on a static host).
1542
+ const renderedPathname = isOutputExportMode ? (0, _routeparams.getPathnameFromRequestURL)(url) : (0, _routeparams.getRenderedPathname)(response);
1543
+ // Write the payloads into the cache. Each payload is decoded like any
1544
+ // other server response — a root-anchored tree plus an optional head, with
1545
+ // no base overlay (the response covers its own spine) — and written
1546
+ // through the same path as a live-render response. Notes on the
1547
+ // arguments:
1548
+ // - Dynamic segments the server sent without a param value (`k: null`) are
1549
+ // parsed from the rendered pathname, and the rendered search is the one
1550
+ // the route tree was built with, so the decoded tree's vary paths agree
1551
+ // with the ones on the route entry's tree.
1552
+ // - The build id was already verified above, so none is passed.
1553
+ // - The response-level staleness is only a fallback, for segments that
1554
+ // don't carry their own staleTime (per-segment responses normally
1555
+ // always do).
1556
+ // - Response-level partiality is unused for per-segment writes — each
1557
+ // segment (and the head) carries its own partiality via the staged
1558
+ // promise encoding, which the decode reads in preference to the
1559
+ // response-level value — so the conservative value (true) is passed.
1560
+ // - The head is keyed at the route's own metadata vary path: the head has
1561
+ // no tree position, so the decode could only derive a vary path for it
1562
+ // from a page node in the payload's own tree. A per-segment response
1563
+ // carries only the spine from the root to the requested segment, so any
1564
+ // response whose terminal isn't a page has no page node to key the head
1565
+ // from; the standalone head response is one such case.
1566
+ const now = Date.now();
1567
+ const metadataVaryPath = route.root.head.varyPath;
1568
+ writeResponsePayloadsIntoCache(now, fetchStrategy, serverResponse, shellResponse, null, // The payloads are root-anchored (no base tree), so there's no
1569
+ // prediction to diverge from.
1570
+ null, renderedPathname, route.renderedSearch, undefined, now + _navigatereducer.STATIC_STALETIME_MS, true, metadataVaryPath, spawnedEntries, buffer.byteLength, task.segmentCacheMap);
1571
+ return isUpgradeableISRFallback;
1572
+ }
1573
+ /**
1574
+ * Reads a stale-at time from the staleTime async iterable of a fully-buffered
1575
+ * response — stage decodes, which go through
1576
+ * `bufferPrefetchResponseBody`. Drains synchronously via
1577
+ * `readFulfilledStaleTimeSeconds` (see decode-server-response). A missing
1578
+ * iterable, or a truncated shell decode whose value landed past the
1579
+ * boundary, reads as absent and falls back to the static stale time.
1580
+ *
1581
+ * For the one response kind that isn't buffered when read — a dynamic `Full`
1582
+ * response (fetchStrategy.Full with Partial Prefetching disabled) — use
1583
+ * `resolveStaleAt` instead, since its values aren't materialized synchronously.
1584
+ */ function readFulfilledStaleAt(now, staleTime) {
1585
+ if (staleTime === undefined) {
1586
+ return now + _navigatereducer.STATIC_STALETIME_MS;
1587
+ }
1588
+ const staleTimeSeconds = (0, _decodeserverresponse.readFulfilledStaleTimeSeconds)(staleTime);
1589
+ if (staleTimeSeconds === null) {
1590
+ return now + _navigatereducer.STATIC_STALETIME_MS;
1591
+ }
1592
+ return now + getStaleTimeMs(staleTimeSeconds);
1593
+ }
1594
+ /**
1595
+ * The localized retry loop for an upgradeable fallback shell. Re-issues the
1596
+ * exact same segment-bundle request up to MAX_FALLBACK_RETRIES times,
1597
+ * FALLBACK_RETRY_DELAY_MS apart, until the server returns the concrete
1598
+ * (upgraded) version. The fetch writes the upgraded response through the
1599
+ * same payload writes as the initial fetch, so every slot the initial fetch
1600
+ * wrote — including the shell paths, even when the upgraded response is
1601
+ * fully static (shell === full) — is upgraded; the spawned entries were
1602
+ * already settled by the initial fetch, so every write is a detached upsert
1603
+ * that replaces the fallback. On success the loop pings the task, so the
1604
+ * task's *other* fallback segments get re-attempted. If every attempt is
1605
+ * still a fallback (or fails), it gives up.
1606
+ *
1607
+ * A loop runs at most once per task, ever (fetchAndWritePerSegmentPrefetchResponse
1608
+ * gates on `fallbackRetryStatus === Empty`, set to `Pending` before this runs
1609
+ * and never reset to `Empty`). The sleep timer is never `clearTimeout`-ed, so
1610
+ * the awaited sleep always settles; the loop simply checks `isCanceled` after
1611
+ * waking and bails if the task was canceled in the meantime. On success the
1612
+ * status becomes `Fulfilled`; on any non-success exit (exhausted retries,
1613
+ * fetch error, or cancel) it becomes `Rejected`.
1614
+ */ async function retryUpgradeableFallbackPrefetch(task, route, routeKey, tree, spawnedEntries, // The strategy the initial fetch wrote its payloads with.
1615
+ fetchStrategy) {
1616
+ for(let attempt = 0; attempt < MAX_FALLBACK_RETRIES; attempt++){
1617
+ await new Promise((resolve)=>setTimeout(resolve, FALLBACK_RETRY_DELAY_MS));
1618
+ if (task.isCanceled) {
1619
+ break;
1620
+ }
1621
+ let isUpgradeableISRFallback;
1622
+ try {
1623
+ isUpgradeableISRFallback = await fetchAndWritePerSegmentPrefetchResponse(task, route, routeKey, tree, spawnedEntries, fetchStrategy, // A response that is still a fallback shell is discarded rather than
1624
+ // pointlessly re-written over the identical fallback content the
1625
+ // initial fetch already cached.
1626
+ true);
1627
+ } catch {
1628
+ break;
1629
+ }
1630
+ if (task.isCanceled) {
1631
+ break;
1632
+ }
1633
+ if (isUpgradeableISRFallback === null) {
1634
+ continue;
1635
+ }
1636
+ if (isUpgradeableISRFallback) {
1637
+ continue;
1638
+ }
1639
+ // Success: the server returned the concrete (upgraded) version, and the
1640
+ // fetch wrote it into the cache. The task's other fallback segments are
1641
+ // now allowed to revalidate.
1642
+ task.fallbackRetryStatus = _cachemap.EntryStatus.Fulfilled;
1643
+ (0, _scheduler.pingPrefetchTask)(task);
1644
+ return;
1645
+ }
1646
+ // The loop finished without success (exhausted its retries, broke out on a
1647
+ // fetch error, or the task was canceled). It won't run again for this task.
1648
+ task.fallbackRetryStatus = _cachemap.EntryStatus.Rejected;
1649
+ }
1650
+ async function fetchSegmentPrefetchesUsingRuntimeRequest(task, route, fetchStrategy, requestTree, spawnedEntries) {
1651
+ const key = task.key;
1652
+ const url = new URL(route.canonicalUrl, location.origin);
1653
+ const nextUrl = key.nextUrl;
1654
+ // When the request tree was derived from a predicted route entry, pass the
1655
+ // node it was predicted from to the write path so the prediction can be
1656
+ // disabled if the server's rendered tree diverges from it. For an entry
1657
+ // the server resolved this is null: a divergence from it says nothing
1658
+ // about route prediction, and its unfulfilled entries take the usual
1659
+ // backoff.
1660
+ let dynamicRequestTree;
1661
+ let predictedFrom;
1662
+ if (spawnedEntries.size === 1 && spawnedEntries.has(route.root.head.requestKey)) {
1663
+ // Only the head is pending, so ask the server for metadata only: it skips
1664
+ // the segments and renders just the head. The stub is not derived from
1665
+ // the route entry, so divergence from it carries no signal.
1666
+ dynamicRequestTree = MetadataOnlyRequestTree;
1667
+ predictedFrom = null;
1668
+ } else {
1669
+ dynamicRequestTree = requestTree;
1670
+ predictedFrom = route.predictedFrom;
1671
+ }
1672
+ const headers = {
1673
+ [_approuterheaders.RSC_HEADER]: '1',
1674
+ [_approuterheaders.NEXT_ROUTER_STATE_TREE_HEADER]: (0, _flightdatahelpers.prepareFlightRouterStateForRequest)(dynamicRequestTree)
1675
+ };
1676
+ if (nextUrl !== null) {
1677
+ headers[_approuterheaders.NEXT_URL] = nextUrl;
1678
+ }
1679
+ switch(fetchStrategy){
1680
+ case _types.FetchStrategy.Full:
1681
+ {
1682
+ break;
1683
+ }
1684
+ case _types.FetchStrategy.PPRRuntime:
1685
+ {
1686
+ headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = '2';
1687
+ break;
1688
+ }
1689
+ case _types.FetchStrategy.RuntimeShell:
1690
+ {
1691
+ headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = '3';
1692
+ break;
1693
+ }
1694
+ case _types.FetchStrategy.LoadingBoundary:
1695
+ {
1696
+ headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = '1';
1697
+ break;
1698
+ }
1699
+ default:
1700
+ {
1701
+ fetchStrategy;
1702
+ }
1703
+ }
1704
+ try {
1705
+ const response = await fetchPrefetchResponse(url, headers);
1706
+ if (!response || !response.ok || !response.body) {
1707
+ // Server responded with an error, or with a miss. We should still cache
1708
+ // the response, but we can try again after 10 seconds.
1709
+ rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + REJECTION_BACKOFF_MS);
1710
+ return null;
1711
+ }
1712
+ const renderedSearch = (0, _routeparams.getRenderedSearch)(response);
1713
+ if (renderedSearch !== route.renderedSearch) {
1714
+ // The search params that were used to render the target page are
1715
+ // different from the search params in the request URL. This only happens
1716
+ // when there's a dynamic rewrite in between the tree prefetch and the
1717
+ // data prefetch.
1718
+ // TODO: For now, since this is an edge case, we reject the prefetch, but
1719
+ // the proper way to handle this is to evict the stale route tree entry
1720
+ // then fill the cache with the new response.
1721
+ rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + REJECTION_BACKOFF_MS);
1722
+ return null;
1723
+ }
1724
+ // Track when the network connection closes. Only meaningful for Full
1725
+ // (dynamic) prefetches which use incremental streaming. For buffered
1726
+ // paths, this is resolved immediately — see TODO in fetchRouteOnCacheMiss.
1727
+ const closed = (0, _promisewithresolvers.createPromiseWithResolvers)();
1728
+ let fulfilledEntries = null;
1729
+ let bufferedResponseSize = null;
1730
+ let serverDataPromise;
1731
+ if (fetchStrategy === _types.FetchStrategy.Full) {
1732
+ // Full prefetches are dynamic responses stored in the prefetch cache.
1733
+ // They don't carry vary params or other cache metadata, so there's no
1734
+ // need to buffer them. Use the incremental version to allow data to be
1735
+ // processed as it arrives.
1736
+ const prefetchStream = createIncrementalPrefetchResponseStream(response.body, closed.resolve, function onResponseSizeUpdate(totalBytesReceivedSoFar) {
1737
+ // When processing a dynamic response, we don't know how large each
1738
+ // individual segment is, so approximate by assigning each segment
1739
+ // the average of the total response size.
1740
+ if (fulfilledEntries === null) {
1741
+ // Haven't received enough data yet to know which segments
1742
+ // were included.
1743
+ return;
1744
+ }
1745
+ const averageSize = totalBytesReceivedSoFar / fulfilledEntries.length;
1746
+ for (const entry of fulfilledEntries){
1747
+ (0, _cachemap.setSizeInCacheMap)(entry, averageSize);
1748
+ }
1749
+ });
1750
+ serverDataPromise = (0, _fetchserverresponse.createFromNextReadableStream)(prefetchStream, headers, {
1751
+ allowPartialStream: true
1752
+ });
1753
+ } else {
1754
+ const buffer = await bufferPrefetchResponseBody(response.body);
1755
+ closed.resolve();
1756
+ bufferedResponseSize = buffer.byteLength;
1757
+ serverDataPromise = (0, _fetchserverresponse.decodeBufferedStage)(buffer, headers);
1758
+ }
1759
+ const [serverData, cacheData] = await Promise.all([
1760
+ serverDataPromise,
1761
+ response.cacheData
1762
+ ]);
1763
+ const now = Date.now();
1764
+ const staleAt = await resolveStaleAt(now, serverData.s, response);
1765
+ const buildId = response.headers.get(_constants.NEXT_NAV_DEPLOYMENT_ID_HEADER) ?? serverData.b;
1766
+ // Extract the response's shell-stage payload, when it carries one. No
1767
+ // shell can be extracted without cache metadata (only present when
1768
+ // Cached Navigations is enabled); for responses without a distinct
1769
+ // shell stage the extraction is a no-op anyway
1770
+ // (`resolveShellStageResponse` returns null), so the null check just
1771
+ // short-circuits that case.
1772
+ const shellResponse = cacheData !== null ? await (0, _fetchserverresponse.resolveShellStageResponse)(cacheData, serverData, headers) : null;
1773
+ // Runtime prefetch responses (PPRRuntime and RuntimeShell requests) are
1774
+ // partial when the server marks the response as '~' (Partial).
1775
+ // Full/LoadingBoundary prefetch responses are always complete.
1776
+ const isFullResponsePartial = (fetchStrategy === _types.FetchStrategy.PPRRuntime || fetchStrategy === _types.FetchStrategy.RuntimeShell) && (cacheData?.isResponsePartial ?? false);
1777
+ // Aside from writing the data into the cache, this also returns the
1778
+ // entries that were fulfilled, so we can streamingly update their sizes
1779
+ // in the LRU as more data comes in (Full responses, which stream).
1780
+ fulfilledEntries = writeResponsePayloadsIntoCache(now, fetchStrategy, serverData, shellResponse, dynamicRequestTree, predictedFrom, // Navigation responses always include the param values in the tree, so
1781
+ // there's no pathname to parse them from (nor a need to).
1782
+ null, renderedSearch, buildId, staleAt, isFullResponsePartial, null, spawnedEntries, bufferedResponseSize, task.segmentCacheMap);
1783
+ // Return a promise that resolves when the network connection closes, so
1784
+ // the scheduler can track the number of concurrent network connections.
1785
+ return {
1786
+ value: null,
1787
+ closed: closed.promise
1788
+ };
1789
+ } catch (error) {
1790
+ rejectSegmentEntriesIfStillPending(spawnedEntries, getPrefetchErrorStaleAt(error));
1791
+ return null;
1792
+ }
1793
+ }
1794
+ function rejectSegmentEntriesIfStillPending(entries, staleAt) {
1795
+ for (const entry of entries.values()){
1796
+ if (entry.status === _cachemap.EntryStatus.Pending) {
1797
+ rejectSegmentCacheEntry(entry, staleAt);
1798
+ }
1799
+ }
1800
+ }
1801
+ /**
1802
+ * Writes a prefetch response's payloads into the cache: the full payload,
1803
+ * plus its shell payload when the response carries one. This is the write
1804
+ * orchestration shared by the prefetch response kinds — per-segment
1805
+ * static responses (fetchAndWritePerSegmentPrefetchResponse) and
1806
+ * live-render responses (fetchSegmentPrefetchesUsingRuntimeRequest, and the
1807
+ * embedded runtime prefetch stream via writeRuntimePrefetchStreamIntoCache)
1808
+ * — which differ in how they obtain their payloads but not in what must
1809
+ * happen to them.
1810
+ *
1811
+ * Returns the entries the fulfilling payload's write produced content into
1812
+ * (so the streaming caller can keep updating their LRU sizes as bytes
1813
+ * arrive), or null if nothing entered the cache.
1814
+ */ function writeResponsePayloadsIntoCache(now, // The strategy of the request that produced the response. Decides which
1815
+ // payload fulfills the spawned entries and their keying, and identifies
1816
+ // the response family: PPR/StaticShell are per-segment static responses,
1817
+ // everything else a live-render response.
1818
+ fetchStrategy, fullPayload, // The response's shell payload: null (the response carries no shell),
1819
+ // `fullPayload` itself (the shell IS the full response), or a distinct
1820
+ // stage decode truncated at the shell byte boundary.
1821
+ shellPayload, // The next five are threaded through to every write; see
1822
+ // writeServerResponseIntoCache for their meaning.
1823
+ baseTree, predictedFrom, renderedPathname, renderedSearch, buildId, // Response-level staleness of the full payload. The shell payload's own
1824
+ // staleness is read off the shell decode below (a shell payload is always
1825
+ // fully buffered).
1826
+ staleAt, // Whether anything in the full payload is not fully resolved (dynamic or runtime holes, anything suspended). Shell-tier
1827
+ // writes don't consume it: a shell payload is partial by construction.
1828
+ // (Per-segment payloads encode partiality per node and ignore the
1829
+ // response-level value entirely.)
1830
+ isFullResponsePartial, metadataVaryPath, // The pending entries this response fulfills. Null when the caller owns
1831
+ // none (the embedded runtime prefetch stream), in which case every write
1832
+ // is a detached upsert.
1833
+ spawnedEntries, // The response's size in bytes, distributed across the entries the
1834
+ // fulfilling payload's write produced; null when unknown (streamed Full
1835
+ // responses — the caller sizes those incrementally as bytes
1836
+ // arrive instead).
1837
+ responseByteLength, // The map the work that spawned this response's request is bound to. See
1838
+ // writeServerResponseIntoCache.
1839
+ map) {
1840
+ let fulfilledEntries;
1841
+ if (shellPayload === null || // `FetchStrategy.LoadingBoundary` is not used in Cache Components,
1842
+ // and we only recover shells in Cache Components.
1843
+ fetchStrategy === _types.FetchStrategy.LoadingBoundary) {
1844
+ if (fetchStrategy === _types.FetchStrategy.StaticShell) {
1845
+ // A static shell was requested but the response carries no shell (its
1846
+ // shell byte offset read as 0 — a bug in Next.js itself — or the
1847
+ // shell prefix couldn't be decoded). The full payload is still
1848
+ // usable, so it's written detached at the concrete tier; the spawned
1849
+ // entries are rejected so the task isn't stranded blocking on them.
1850
+ // Note the scheduler does NOT fall back to a runtime request for
1851
+ // rejected segments — it skips them outright (see the Rejected case
1852
+ // in pingSegmentBundle in scheduler.ts), so these segments get no
1853
+ // shell prefetch and no runtime substitute until the rejection's
1854
+ // backoff expires.
1855
+ writeServerResponseIntoCache(now, _types.FetchStrategy.PPR, fullPayload, baseTree, predictedFrom, renderedPathname, renderedSearch, buildId, staleAt, isFullResponsePartial, metadataVaryPath, null, null, map);
1856
+ if (spawnedEntries !== null) {
1857
+ rejectSegmentEntriesIfStillPending(spawnedEntries, now + REJECTION_BACKOFF_MS);
1858
+ }
1859
+ return null;
1860
+ }
1861
+ // This request either:
1862
+ // - didn't allow recovering a shell (no staged rendering),
1863
+ // - or was a (runtime) shell request (that was NOT served by a fully static prerender)
1864
+ // so we already have a shell without recovering anything.
1865
+ // In either case, we don't have anything to consider other than the request itself,
1866
+ // so the payload simply fulfills the spawned entries at the request's own keying.
1867
+ fulfilledEntries = writeServerResponseIntoCache(now, fetchStrategy, fullPayload, baseTree, predictedFrom, renderedPathname, renderedSearch, buildId, staleAt, isFullResponsePartial, metadataVaryPath, spawnedEntries, null, map);
1868
+ } else if (shellPayload === fullPayload) {
1869
+ // The shell IS the full response (reference-equal — a page with nothing
1870
+ // below its shell). One payload fulfills the spawned entries, recording
1871
+ // the strategy that describes the CONTENT — the full payload's tier.
1872
+ // The content tier also drives the entries' keying: content that isn't
1873
+ // shell-grade is param-independent only on the server's vary-params
1874
+ // evidence, so it must not be parked in the shell slot on the strength
1875
+ // of the missing split alone (see the keying derivation in
1876
+ // writeSegmentDataIntoCache).
1877
+ let contentFetchStrategy;
1878
+ switch(fetchStrategy){
1879
+ case _types.FetchStrategy.StaticShell:
1880
+ {
1881
+ // a StaticShell always uses a PPR-tier request, so we need to fulfill
1882
+ // the spawned shell entries at the PPR tier.
1883
+ contentFetchStrategy = _types.FetchStrategy.PPR;
1884
+ break;
1885
+ }
1886
+ case _types.FetchStrategy.RuntimeShell:
1887
+ {
1888
+ // a runtime shell request is not normally rewindable, but fully static pages
1889
+ // the server will return a static prerender result, which *is* rewindable.
1890
+ contentFetchStrategy = _types.FetchStrategy.PPRRuntime;
1891
+ break;
1892
+ }
1893
+ case _types.FetchStrategy.PPR:
1894
+ case _types.FetchStrategy.PPRRuntime:
1895
+ case _types.FetchStrategy.Full:
1896
+ {
1897
+ // No shell was requested, so we don't need to override the fetch strategy.
1898
+ contentFetchStrategy = null;
1899
+ }
1900
+ }
1901
+ fulfilledEntries = writeServerResponseIntoCache(now, fetchStrategy, fullPayload, baseTree, predictedFrom, renderedPathname, renderedSearch, buildId, staleAt, isFullResponsePartial, metadataVaryPath, spawnedEntries, contentFetchStrategy, map);
1902
+ } else {
1903
+ // The shell is a strict prefix of the response. Write both payloads.
1904
+ // The payload matching the tier the spawned entries were requested at
1905
+ // fulfills them; the other is written detached (no owned entries —
1906
+ // every write is an upsert). Fulfilling a spawned shell entry with the
1907
+ // concrete payload would store content that doesn't match the entry's
1908
+ // shell vary path — wrong for every later read at that key, and
1909
+ // immediately observable during a navigation, where a pending entry can
1910
+ // be rendered as a promise that resolves to its eventual value.
1911
+ //
1912
+ // The full payload is written first. The order is not observable: the
1913
+ // two writes key at different tiers, upsert precedence between a full
1914
+ // payload and its own shell payload is order-independent (the full
1915
+ // payload always wins the comparison — a shell segment is never
1916
+ // complete where its full counterpart is partial, see
1917
+ // readFulfilledIsPartial), and fulfillment pings only enqueue scheduler
1918
+ // work that runs after this synchronous block. Full-first is preferred
1919
+ // so the shell write's precedence checks and shadow eviction compare
1920
+ // against the fresh concrete entry rather than whatever stale entry
1921
+ // preceded it.
1922
+ let responseFetchStrategy;
1923
+ let shellFetchStrategy;
1924
+ switch(fetchStrategy){
1925
+ case _types.FetchStrategy.StaticShell:
1926
+ case _types.FetchStrategy.PPR:
1927
+ {
1928
+ // Static request.
1929
+ // a StaticShell fetch strategy performs a request that returns
1930
+ // a PPR-tier response that can be rewound to a StaticShell response,
1931
+ // So we upgrade the full response's strategy to `PPR`.
1932
+ // (A static response's tier may be raised if we know that a static request
1933
+ // would satisfy a runtime request -- see `recordedFetchStrategy` in
1934
+ // `writeSegmentDataIntoCache`)
1935
+ responseFetchStrategy = _types.FetchStrategy.PPR;
1936
+ shellFetchStrategy = _types.FetchStrategy.StaticShell;
1937
+ break;
1938
+ }
1939
+ case _types.FetchStrategy.RuntimeShell:
1940
+ {
1941
+ // A runtime shell request is normally not rewindable -- it only produces
1942
+ // the shell itself. However, if a page is fully static, a runtime shell
1943
+ // will return a static prerender, i.e. the static content with an embedded shell.
1944
+ // The page is static, so we can treat the content as runtime-complete.
1945
+ responseFetchStrategy = _types.FetchStrategy.PPRRuntime;
1946
+ shellFetchStrategy = _types.FetchStrategy.RuntimeShell;
1947
+ break;
1948
+ }
1949
+ case _types.FetchStrategy.PPRRuntime:
1950
+ {
1951
+ // A runtime prefetch response can be rewound into a runtime shell.
1952
+ // (This may also be a fully static response, same as RuntimeShell above,
1953
+ // in which case we also know that the shell is equivalent to a runtime shell)
1954
+ responseFetchStrategy = _types.FetchStrategy.PPRRuntime;
1955
+ shellFetchStrategy = _types.FetchStrategy.RuntimeShell;
1956
+ break;
1957
+ }
1958
+ case _types.FetchStrategy.Full:
1959
+ {
1960
+ // Navigation responses can be rewound into a *static* app shell.
1961
+ // On PPF routes they also contain a runtime prefetch stream which will give us
1962
+ // a runtime shell/prefetch, but that's handled separately from the main response.
1963
+ // (see `writeRuntimePrefetchStreamIntoCache`)
1964
+ responseFetchStrategy = _types.FetchStrategy.Full;
1965
+ shellFetchStrategy = _types.FetchStrategy.StaticShell;
1966
+ break;
1967
+ }
1968
+ }
1969
+ // We have to fulfill the correct pending entries depending on what was requested:
1970
+ // - If we originally needed a shell but and got more content, the spawned entries
1971
+ // should be fulfilled using the shell.
1972
+ // - If we needed a speculative or full request but rewound it into a shell,
1973
+ // the spawned entries should be fulfilled using the full response.
1974
+ const wasShellRequested = fetchStrategy === _types.FetchStrategy.StaticShell || fetchStrategy === _types.FetchStrategy.RuntimeShell;
1975
+ const fullFulfilledEntries = writeServerResponseIntoCache(now, responseFetchStrategy, fullPayload, baseTree, predictedFrom, renderedPathname, renderedSearch, buildId, staleAt, isFullResponsePartial, metadataVaryPath, wasShellRequested ? null : spawnedEntries, null, map);
1976
+ const shellFulfilledEntries = writeServerResponseIntoCache(now, shellFetchStrategy, shellPayload, baseTree, predictedFrom, renderedPathname, renderedSearch, buildId, // The shell payload carries its own staleness, independent of the
1977
+ // full payload's. Shell decodes are fully buffered, so it's read
1978
+ // synchronously; when absent (per-segment responses carry staleTime
1979
+ // per node instead) this falls back to the same static stale time the
1980
+ // per-segment writes use as their response-level fallback.
1981
+ readFulfilledStaleAt(now, shellPayload.s), // A shell payload is a strict subset of the full response, so it does
1982
+ // not represent the entire UI of the target page — it's partial
1983
+ // by construction.
1984
+ true, metadataVaryPath, wasShellRequested ? spawnedEntries : null, null, map);
1985
+ fulfilledEntries = wasShellRequested ? shellFulfilledEntries : fullFulfilledEntries;
1986
+ }
1987
+ // Entries created by a detached write aren't sized: one wire response is
1988
+ // only charged to the LRU once, to the entries it fulfilled.
1989
+ if (responseByteLength !== null && fulfilledEntries !== null && fulfilledEntries.length > 0) {
1990
+ const averageSize = responseByteLength / fulfilledEntries.length;
1991
+ for (const entry of fulfilledEntries){
1992
+ (0, _cachemap.setSizeInCacheMap)(entry, averageSize);
1993
+ }
1994
+ }
1995
+ return fulfilledEntries;
1996
+ }
1997
+ /**
1998
+ * Writes a decoded server response into the segment cache: decodes the
1999
+ * response's transport tree into a RouteTree — overlaid on `baseTree` when
2000
+ * the response is an overlay over existing client state, root-anchored when
2001
+ * it covers its own spine (per-segment prefetch payloads) — then writes
2002
+ * every rendered segment, plus the head, into the cache. Fulfills the
2003
+ * entries in `spawnedEntries` that the response covers; rejects the rest, so
2004
+ * a task blocked on them isn't stranded. Returns the entries the write
2005
+ * produced content into — fulfilled spawned entries plus installed detached
2006
+ * upserts — for LRU size accounting, or null if nothing entered the cache.
2007
+ *
2008
+ * Serves every response kind: live-render prefetch responses (runtime
2009
+ * prefetches, and Full/LoadingBoundary prefetches in the
2010
+ * non-Partial-Prefetching regime), prerender stage decodes (shell-stage
2011
+ * extraction, cached navigations, the initial payload), embedded runtime
2012
+ * prefetch streams, and the payloads of per-segment prefetch responses.
2013
+ */ function writeServerResponseIntoCache(now, fetchStrategy, // The decoded response payload to write. For a per-segment prefetch
2014
+ // response this is one of its payloads: the full response, or the
2015
+ // truncated shell decode.
2016
+ response, // The base router state the response overlays. Null when the response's
2017
+ // tree is root-anchored (per-segment prefetch payloads).
2018
+ baseTree, // Non-null when `baseTree` was predicted: the node in the known route tree
2019
+ // whose pattern it was predicted from (see matchKnownRoute). The
2020
+ // prediction assumes the URL's rewrite (if any) behaves statically; if the
2021
+ // server's rendered tree diverges from the base, that prediction failed —
2022
+ // the rewrite behaves dynamically, so the params baked into the request
2023
+ // are wrong. The node is marked so the shape is never predicted again, and
2024
+ // the entries that could not be fulfilled are rejected with immediate
2025
+ // expiration so the task retries right away — against the server-resolved
2026
+ // route this time. The response data is still written into the cache: it's
2027
+ // real data keyed by what the server actually rendered, useful regardless
2028
+ // of whether the prediction matched.
2029
+ predictedFrom, // The pathname the response was rendered for, used to resolve dynamic
2030
+ // segments the server sent without a param value (`k: null`). Null for
2031
+ // responses that always carry concrete values (navigation responses).
2032
+ renderedPathname, renderedSearch, buildId, // Response-level staleness; a segment (or the head) with its own
2033
+ // staleTime overrides it.
2034
+ staleAt, // Whether anything in the response is not fully resolved: dynamic holes, runtime holes, anything suspended.
2035
+ // Threaded into the decode, where each segment's (and the head's)
2036
+ // partiality is resolved from it and the wire form (see
2037
+ // createNavigationSeed). Per-segment prefetch responses encode
2038
+ // partiality per node, so their writes pass the conservative value
2039
+ // (true), which is never read.
2040
+ isResponsePartial, // Where to key the head; see createNavigationSeed.
2041
+ metadataVaryPath, spawnedEntries, // The strategy tier describing the CONTENT of the payload being written,
2042
+ // when it differs from `fetchStrategy` (which drives matching and
2043
+ // keying); null when they agree. See the param docs on
2044
+ // writeSegmentDataIntoCache.
2045
+ contentFetchStrategy, // The map the work that spawned this response's request is bound to: the
2046
+ // spawning task's `PrefetchTask.segmentCacheMap` for prefetches, the
2047
+ // navigation's map for navigation-side writes. Binding the write to the
2048
+ // requesting work means a response that lands after a testing-lock scope
2049
+ // boundary still writes into the map its entries live in.
2050
+ map) {
2051
+ // Which layer owns the buildId check differs by flow. The route and
2052
+ // segment fetch layers check it themselves (see fetchRouteOnCacheMiss and
2053
+ // fetchAndWritePerSegmentPrefetchResponse) because they need the early-out
2054
+ // before side effects this layer can't undo — starting the fallback-retry
2055
+ // loop, writing the second (shell) payload — and then pass no buildId
2056
+ // here. This check owns it for the flows that don't: live-render prefetch
2057
+ // responses and navigation static-stage writes, which pass their
2058
+ // buildId through.
2059
+ if (buildId && buildId !== (0, _navigationbuildid.getNavigationBuildId)()) {
2060
+ // The server build does not match the client. Treat as a 404. During
2061
+ // an actual navigation, the router will trigger an MPA navigation.
2062
+ if (spawnedEntries !== null) {
2063
+ rejectSegmentEntriesIfStillPending(spawnedEntries, now + REJECTION_BACKOFF_MS);
2064
+ }
2065
+ return null;
2066
+ }
2067
+ const transportData = response.t;
2068
+ if (transportData === undefined) {
2069
+ // The response carries no tree. Settle anything we own so a task blocked
2070
+ // on it isn't stranded.
2071
+ if (spawnedEntries !== null) {
2072
+ rejectSegmentEntriesIfStillPending(spawnedEntries, now + REJECTION_BACKOFF_MS);
2073
+ }
2074
+ return null;
2075
+ }
2076
+ const navigationSeed = (0, _decodeserverresponse.createNavigationSeed)(now, baseTree, transportData, // Root params are emitted once at the top level of the response; the
2077
+ // decode unions them into the head's and each segment's own set. For
2078
+ // per-segment prefetch responses this must be read from the payload
2079
+ // being written: a truncated shell decode rewinds the response's
2080
+ // late-resolving values to the shell stage.
2081
+ response.r ?? null, // The decode resolves each segment's partiality from this and the wire:
2082
+ // boolean-form nodes resolve to this response-level value; staged
2083
+ // (promise-form) nodes encode partiality per node and ignore it.
2084
+ isResponsePartial, renderedPathname, renderedSearch, metadataVaryPath, // Only navigations consume the seed's dynamicStaleAt; cache writes pass
2085
+ // unknown to use the default.
2086
+ _bfcache.UnknownDynamicStaleTime);
2087
+ const requiresRuntimeCompleteness = (navigationSeed.root.tree.prefetchHints & _approutertypes.PrefetchHint.SubtreeHasPartialPrefetching) !== 0;
2088
+ const treeDivergedFromPrediction = predictedFrom !== null && navigationSeed.treeDivergedFromBase;
2089
+ if (treeDivergedFromPrediction) {
2090
+ predictedFrom.hasDynamicRewrite = true;
2091
+ }
2092
+ // Only static (per-segment) responses can be ISR fallbacks (`f`). A
2093
+ // present `u` means the response carries a stage-scoped runtime-data
2094
+ // verdict — per-segment prefetch responses always emit one, and so does
2095
+ // any prerendered page payload, which embeds the prerender's runtime-data
2096
+ // probe; live renders emit none. A response without one decodes to a null
2097
+ // verdict, and its entries record their request's own strategy unrefined
2098
+ // (see writeSegmentDataIntoCache).
2099
+ // `u` is deliberately read here, off THIS decode's thenable status, rather
2100
+ // than normalized where the response is fetched: the read scopes it to the
2101
+ // payload being written — a truncated shell decode reads a post-shell
2102
+ // runtime access as pending, i.e. `false`, because the shell variant
2103
+ // itself doesn't need that data. The read is load-bearing in one direction
2104
+ // only: a false `true` costs a wasted runtime request; a false `false`
2105
+ // would record too high a tier and skip a runtime request that had more
2106
+ // content. A rejected row (an aborted prerender errors rows that were
2107
+ // still pending at the abort) must therefore read as `true`, matching the
2108
+ // server's own read of the page payload's flag (see the `u` read in
2109
+ // collect-segment-data.tsx).
2110
+ const isUpgradeableISRFallback = response.f === true;
2111
+ const responseNeedsRuntimeRequest = response.u !== undefined ? (0, _rsctransport.readFulfilledValue)(response.u, false, /* rejectedValue */ true) : null;
2112
+ const routeTree = navigationSeed.root.tree;
2113
+ // The route tree carries the render output of every segment the response
2114
+ // included, so a single traversal from the root writes all of it into
2115
+ // the cache.
2116
+ const writtenEntries = [];
2117
+ writeTreeDataIntoCache(now, map, fetchStrategy, routeTree, staleAt, spawnedEntries, contentFetchStrategy, isUpgradeableISRFallback, requiresRuntimeCompleteness, responseNeedsRuntimeRequest, writtenEntries);
2118
+ const metadataTree = navigationSeed.root.head;
2119
+ const headData = metadataTree.data;
2120
+ if (headData !== null && headData.rsc !== null) {
2121
+ // The head follows the same stale-time rules as a segment.
2122
+ const headStaleAt = headData.staleTimeSeconds !== null ? now + getStaleTimeMs(headData.staleTimeSeconds) : staleAt;
2123
+ // A head has no loading boundary. Match the scheduler, which spawns
2124
+ // LoadingBoundary head entries using the concrete Full strategy (see the
2125
+ // head's runtime fetch in pingRootRouteTree).
2126
+ const headFetchStrategy = fetchStrategy === _types.FetchStrategy.LoadingBoundary ? _types.FetchStrategy.Full : fetchStrategy;
2127
+ const writtenHeadEntry = writeSegmentDataIntoCache(now, map, headFetchStrategy, headData.rsc, // The decode already resolved the head's partiality from the wire
2128
+ // form and the response-level value — see the head read in
2129
+ // createNavigationSeed.
2130
+ headData.isPartial, headStaleAt, headData.varyParams, metadataTree, spawnedEntries, contentFetchStrategy, isUpgradeableISRFallback, requiresRuntimeCompleteness, responseNeedsRuntimeRequest);
2131
+ if (writtenHeadEntry !== null) {
2132
+ writtenEntries.push(writtenHeadEntry);
2133
+ }
2134
+ }
2135
+ // Any entry that's still pending was intentionally not rendered by the
2136
+ // server, because it was inside the loading boundary. Mark them as rejected
2137
+ // so we know not to fetch them again.
2138
+ // TODO: If PPR is enabled on some routes but not others, then it's possible
2139
+ // that a different page is able to do a per-segment prefetch of one of the
2140
+ // segments we're marking as rejected here. We should mark on the segment
2141
+ // somehow that the reason for the rejection is because of a non-PPR prefetch.
2142
+ // That way a per-segment prefetch knows to disregard the rejection.
2143
+ if (spawnedEntries !== null) {
2144
+ rejectSegmentEntriesIfStillPending(spawnedEntries, // When the response diverged from the prediction, the leftover entries
2145
+ // can never be fulfilled — their keys were derived from the wrong
2146
+ // tree. Reject with an immediate expiration instead of the usual
2147
+ // backoff so the task retries right away. The prediction was disabled
2148
+ // above, so the retry resolves the route on the server instead of
2149
+ // predicting it again.
2150
+ treeDivergedFromPrediction ? -1 : now + REJECTION_BACKOFF_MS);
2151
+ }
2152
+ return writtenEntries.length > 0 ? writtenEntries : null;
2153
+ }
2154
+ function writeTreeDataIntoCache(now, map, fetchStrategy, tree, staleAt, spawnedEntries, contentFetchStrategy, isUpgradeableISRFallback, requiresRuntimeCompleteness, responseNeedsRuntimeRequest, // Accumulates the entries the walk wrote content into (fulfilled spawned
2155
+ // entries and installed detached upserts), for LRU size accounting.
2156
+ writtenEntries) {
2157
+ // Writes the render output embedded in the route tree into the
2158
+ // prefetch cache.
2159
+ const data = tree.data;
2160
+ if (data !== null && data.rsc !== null) {
2161
+ // A segment carries its own staleTime only in per-segment prefetch
2162
+ // responses; everywhere else the response-level staleness governs.
2163
+ const entryStaleAt = data.staleTimeSeconds !== null ? now + getStaleTimeMs(data.staleTimeSeconds) : staleAt;
2164
+ const writtenEntry = writeSegmentDataIntoCache(now, map, fetchStrategy, data.rsc, data.isPartial, entryStaleAt, data.varyParams, tree, spawnedEntries, contentFetchStrategy, isUpgradeableISRFallback, requiresRuntimeCompleteness, responseNeedsRuntimeRequest);
2165
+ if (writtenEntry !== null) {
2166
+ writtenEntries.push(writtenEntry);
2167
+ }
2168
+ } else {
2169
+ // Either the response carried no information for this segment (no data
2170
+ // object — e.g. the identity spine of a per-segment prefetch response,
2171
+ // or a slot reused from the base tree), or it acknowledged the position
2172
+ // without rendering it (a data object with a null rsc — an intermediate
2173
+ // position on the path to a rendered subtree). Nothing to write either
2174
+ // way, but the children may have output, so keep descending.
2175
+ }
2176
+ // Recursively write the child data into the cache.
2177
+ const slots = tree.slots;
2178
+ if (slots !== null) {
2179
+ for (const childTree of slots.values()){
2180
+ writeTreeDataIntoCache(now, map, fetchStrategy, childTree, staleAt, spawnedEntries, contentFetchStrategy, isUpgradeableISRFallback, requiresRuntimeCompleteness, responseNeedsRuntimeRequest, writtenEntries);
2181
+ }
2182
+ }
2183
+ }
2184
+ /**
2185
+ * Writes one segment's render output into the cache: fulfills the entry at
2186
+ * the same tree position if this task owns one, otherwise creates one (or
2187
+ * upserts a detached one). Shared by every response kind; responses that
2188
+ * carry a runtime-data verdict (per-segment prefetch responses and
2189
+ * prerendered page payloads) additionally refine the tier the entry
2190
+ * records — see `recordedFetchStrategy` below.
2191
+ *
2192
+ * Returns the entry this write produced content into — the fulfilled spawned
2193
+ * entry, or the detached entry the upsert installed — so the caller can
2194
+ * charge the response's size to it. Null when nothing entered the cache (the
2195
+ * upsert declined a detached candidate).
2196
+ */ function writeSegmentDataIntoCache(now, map, fetchStrategy, rsc, isPartial, staleAt, segmentVaryParams, tree, spawnedEntries, // The strategy tier describing the CONTENT of the payload this write came
2197
+ // from, when it differs from the write's own `fetchStrategy` (which
2198
+ // drives matching and keying); null when they agree. It differs only for
2199
+ // the coincident-shell case: a write that fulfills shell-keyed entries
2200
+ // with a payload that IS the full response passes the full payload's tier
2201
+ // — see writeResponsePayloadsIntoCache.
2202
+ contentFetchStrategy, // Whether the response is an upgradeable fallback shell. Always false for
2203
+ // live-render responses — they are never ISR fallbacks.
2204
+ isUpgradeableISRFallback, // The response's runtime-data verdict: whether the render that produced
2205
+ // this payload accessed runtime data (page-global; combined with the
2206
+ // segment's own `isPartial` to decide the tier the entry records below).
2207
+ // Null when the response carries no verdict (`u`) — live renders emit
2208
+ // none; per-segment prefetch responses and prerendered page payloads
2209
+ // (including the truncated initial payload) do — in which case the entry
2210
+ // records the payload's tier unrefined.
2211
+ requiresRuntimeCompleteness, responseNeedsRuntimeRequest) {
2212
+ // The strategy tier recorded on the entry — the tier of the content that
2213
+ // actually satisfied it, which spans both axes: shell-vs-concrete AND
2214
+ // static-vs-runtime. The payload's content tier (`fetchStrategy`, unless
2215
+ // the caller passed a distinct `contentFetchStrategy`), refined by the
2216
+ // response's runtime-data verdict when it carries one:
2217
+ //
2218
+ // A runtime prefetch can only provide more content than this entry if the
2219
+ // render accessed runtime data AND this particular segment has holes — a
2220
+ // fully static segment gains nothing from a runtime request no matter
2221
+ // what the page accessed. When this payload fully satisfied the segment —
2222
+ // no runtime request needed — the content is as complete as a RUNTIME
2223
+ // response of the same variant would have been, so it records that
2224
+ // runtime tier. That's what lets the scheduler decide "would a runtime
2225
+ // request return more?" by comparing tiers alone, with no separate signal
2226
+ // to consult. Otherwise the content is only as complete as the static
2227
+ // tier it was requested at, so a follow-up runtime request can still
2228
+ // supersede it.
2229
+ let recordedFetchStrategy;
2230
+ if (responseNeedsRuntimeRequest === null) {
2231
+ // The response carries no verdict — a live render's, or the synthesized
2232
+ // initial-payload subset's (see create-initial-router-state): record
2233
+ // the payload's tier as-is. A verdict is honored wherever it appears:
2234
+ // prerendered page payloads carry one too (the prerender's runtime-data
2235
+ // probe), and refining on it is correct — a prerendered response whose
2236
+ // verdict is `false` is genuinely runtime-complete content.
2237
+ recordedFetchStrategy = contentFetchStrategy ?? fetchStrategy;
2238
+ } else if (responseNeedsRuntimeRequest && isPartial) {
2239
+ // A runtime request would provide more than this payload, so no runtime
2240
+ // tier is recorded — but the entry must still honor the payload's
2241
+ // CONTENT grade. In the coincident-shell case the payload that satisfied
2242
+ // a shell-keyed entry IS the full response, whose content grades at the
2243
+ // concrete static tier (`contentFetchStrategy`, PPR — the verdict only
2244
+ // rides static-family responses, so no higher grade can appear here).
2245
+ // The verdict is consistent with that grade: it says the runtime tiers
2246
+ // would provide more, which they would over PPR just as over the shell
2247
+ // tier.
2248
+ recordedFetchStrategy = contentFetchStrategy ?? fetchStrategy;
2249
+ } else {
2250
+ const payloadFetchStrategy = contentFetchStrategy ?? fetchStrategy;
2251
+ if (requiresRuntimeCompleteness) {
2252
+ // The verdict says this payload does not need a runtime request.
2253
+ // If we requested it at a static tier, raise the recorded tier up to the
2254
+ // runtime tier of the same variant.
2255
+ // This also makes the verdict a noop for Full payloads, which matters because
2256
+ // the Full flow decodes incrementally, and synchronously reading `response.u`
2257
+ // is only sound for a buffered payload.
2258
+ recordedFetchStrategy = payloadFetchStrategy === _types.FetchStrategy.StaticShell ? _types.FetchStrategy.RuntimeShell : payloadFetchStrategy === _types.FetchStrategy.PPR ? _types.FetchStrategy.PPRRuntime : payloadFetchStrategy;
2259
+ } else {
2260
+ // Only upgrade static segments to their runtime equivalents if the route
2261
+ // can use runtime requests. Otherwise, when re-using a shell segment across
2262
+ // params, `pingSegmentBundle` for a PPR strategy would see a `ShellRuntime`
2263
+ // shell entry and incorrectly decide that a new PPR request would not
2264
+ // provide more content.
2265
+ recordedFetchStrategy = payloadFetchStrategy;
2266
+ }
2267
+ }
2268
+ // Decide whether to re-key the entry under a more generic vary path based on
2269
+ // which params the segment actually depends on.
2270
+ //
2271
+ // Skip re-keying for Full prefetches: as of today, `varyParams` tracking only
2272
+ // works within the static stage portion of a response. A Full prefetch
2273
+ // response covers all stages, and we can't track params during the dynamic
2274
+ // stage without dead-locking the Flight stream, so the server-reported set is
2275
+ // incomplete and can't be trusted for the full response. Re-keying with an
2276
+ // untrustworthy set could replace concrete params with Fallback and let
2277
+ // unrelated URLs read each other's content from the cache.
2278
+ //
2279
+ // Key the entry by which params the server said this segment depends on
2280
+ // (judged by the payload's CONTENT: contentFetchStrategy differs from
2281
+ // fetchStrategy exactly when a shell request's response turned out to
2282
+ // carry more — the coincident case). Reusing one copy across param values
2283
+ // is the point of the shell, but it requires knowing the content doesn't
2284
+ // depend on those params, and the server's report is the direct evidence
2285
+ // of that.
2286
+ //
2287
+ // Without that report, assume every param varies — a response without a
2288
+ // shell/full split is also what a page fully prerendered at concrete
2289
+ // params looks like, and keying that at the shell path would serve one
2290
+ // slug's content to every sibling. The exception is a shell variant,
2291
+ // which reduces param-dependent content to param fallbacks, so it really
2292
+ // is good for any value of them (its request path below IS the shell
2293
+ // vary path).
2294
+ const payloadStrategy = contentFetchStrategy ?? fetchStrategy;
2295
+ let fulfilledVaryPath = null;
2296
+ // The dependency source the entry records, so a navigation that renders
2297
+ // its content can tell which params that content read. It is the same
2298
+ // evidence the key derivation below trusts, under the same condition, with
2299
+ // the same correction; otherwise null, and consumers assume every param.
2300
+ let recordedVaryParams = null;
2301
+ if (process.env.__NEXT_VARY_PARAMS && payloadStrategy !== _types.FetchStrategy.Full && segmentVaryParams !== null) {
2302
+ // Read the reported set now, when the key is chosen. The payload is fully
2303
+ // buffered by the time it's written, so the source has settled; a read of
2304
+ // null means the report is unavailable and every param varies.
2305
+ let varyParams = (0, _varyparamsdecoding.readVaryParams)(segmentVaryParams);
2306
+ if (varyParams !== null) {
2307
+ if (payloadStrategy === _types.FetchStrategy.RuntimeShell && varyParams.has(_varyparamsdecoding.SEARCH_PARAMS_VARY_ID)) {
2308
+ // SPECIAL CASE: for a RuntimeShell payload, the search params entry
2309
+ // is dropped from the server's vary evidence before deriving the
2310
+ // key, so the search component of the resulting path is marked as
2311
+ // the fallback. This exists ONLY because of a known compromise in
2312
+ // how the server reports search params: accessing `searchParams`
2313
+ // records a dependency on them at access time, even when the render
2314
+ // suspends on that access and cuts the content at the param
2315
+ // fallback. A shell render's page and head segments therefore report
2316
+ // the search params while the emitted bytes contain no
2317
+ // search-dependent content.
2318
+ // Trusting that report would key shell-grade content at a concrete
2319
+ // search value, where shell-restricted reads (which generalize every
2320
+ // non-root param — see getShellSegmentVaryPath) can never find it. A
2321
+ // RuntimeShell payload's search-dependent content is reduced to
2322
+ // fallbacks by construction, so its key must not vary on search
2323
+ // regardless of the over-reported evidence. Every other component of
2324
+ // the evidence is still honored as-is.
2325
+ //
2326
+ // Nothing else should rely on this branch; for every other payload
2327
+ // grade — and every other param — the server's evidence
2328
+ // is authoritative.
2329
+ //
2330
+ // TODO: Reconsider special-casing this on the server instead: don't
2331
+ // report a param access that never resolved past the fallback cut in
2332
+ // the emitted stage. A shell payload's evidence would then be
2333
+ // accurate, and this branch could be deleted.
2334
+ varyParams = new Set(varyParams);
2335
+ varyParams.delete(_varyparamsdecoding.SEARCH_PARAMS_VARY_ID);
2336
+ recordedVaryParams = (0, _varyparamsdecoding.createVaryParams)(varyParams);
2337
+ } else {
2338
+ recordedVaryParams = segmentVaryParams;
2339
+ }
2340
+ fulfilledVaryPath = (0, _varypath.getFulfilledSegmentVaryPath)(tree.varyPath, varyParams);
2341
+ }
2342
+ }
2343
+ // The canonical path to (re-)key the entry at. When the derivation above
2344
+ // produced a path, use that; otherwise fall back to the payload's own
2345
+ // keying (this is load-bearing for entries spawned as revalidations:
2346
+ // without the re-key they'd stay in their Revalidation slot forever,
2347
+ // invisible to canonical reads, and the partial entry that prompted the
2348
+ // revalidation would keep serving navigations). Full responses are
2349
+ // excluded, matching the varyParams re-key: they're spawned as canonical
2350
+ // entries at their final path, and their vary tracking can't be trusted
2351
+ // for re-keying (see the fulfilledVaryPath derivation above).
2352
+ const canonicalVaryPath = fulfilledVaryPath !== null ? fulfilledVaryPath : payloadStrategy !== _types.FetchStrategy.Full ? (0, _varypath.getSegmentVaryPathForRequest)(payloadStrategy, tree) : null;
2353
+ // We should only write into cache entries that are owned by us. Or create
2354
+ // a new one and write into that. We must never write over an entry that was
2355
+ // created by a different task, because that causes data races.
2356
+ //
2357
+ // The status check matters for the fallback-retry loop, which re-writes a
2358
+ // response over entries the initial fetch already settled: those writes
2359
+ // must fall through to the detached path below.
2360
+ const ownedEntry = spawnedEntries !== null ? spawnedEntries.get(tree.requestKey) : undefined;
2361
+ const isOwned = ownedEntry !== undefined && ownedEntry.status === _cachemap.EntryStatus.Pending;
2362
+ let fulfilledEntry;
2363
+ let insertVaryPath;
2364
+ if (isOwned) {
2365
+ // We own this entry — fulfill it directly.
2366
+ fulfilledEntry = fulfillSegmentCacheEntry(ownedEntry, rsc, staleAt, isPartial, recordedVaryParams, isUpgradeableISRFallback, recordedFetchStrategy);
2367
+ // Re-key the fulfilled entry at its canonical path. Owned Full entries
2368
+ // are the exception (canonicalVaryPath is null): they were spawned as
2369
+ // canonical entries at their final path, so no re-key happens.
2370
+ insertVaryPath = canonicalVaryPath;
2371
+ } else {
2372
+ // We don't own an entry for this segment. Create a detached one and
2373
+ // attempt to insert it at the canonical path — or, for a Full response
2374
+ // (which has no canonical re-key), at the request's own path.
2375
+ fulfilledEntry = fulfillSegmentCacheEntry(upgradeToPendingSegment(createDetachedSegmentCacheEntry(now), fetchStrategy), rsc, staleAt, isPartial, recordedVaryParams, isUpgradeableISRFallback, recordedFetchStrategy);
2376
+ insertVaryPath = canonicalVaryPath !== null ? canonicalVaryPath : (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
2377
+ }
2378
+ if (insertVaryPath !== null) {
2379
+ // Insert through the upsert so the usual precedence rules apply — an
2380
+ // existing entry with more complete content is never downgraded, and a
2381
+ // shadowed Empty/Pending entry's blocked tasks are pinged. (In the
2382
+ // common case the slot already holds the entry we just fulfilled, which
2383
+ // the upsert replaces in place; but the re-key is load-bearing for
2384
+ // entries whose spawn path differs from the canonical path — e.g.
2385
+ // spawned revalidations, which would otherwise stay in their
2386
+ // Revalidation slot forever, invisible to canonical reads, while the
2387
+ // partial entry that prompted the revalidation kept serving
2388
+ // navigations.)
2389
+ //
2390
+ // The concrete lookup path (tree.varyPath) is passed so that when the
2391
+ // canonical path is more generic, any stale settled entry — or unclaimed
2392
+ // Empty placeholder — at a more specific path that would shadow the
2393
+ // fulfilled entry is evicted. Without this, a shadowed re-keyed entry is
2394
+ // unreachable at the concrete read path: the scheduler would keep
2395
+ // re-reading the stale entry and, for a revalidation, respawn it
2396
+ // forever. See evictShadowingSegmentEntries.
2397
+ const installedEntry = upsertSegmentEntry(now, map, insertVaryPath, fulfilledEntry, tree.varyPath);
2398
+ if (installedEntry === null && !isOwned) {
2399
+ // The upsert declined the detached candidate (an existing entry took
2400
+ // precedence, or the candidate was already expired), so no cache slot
2401
+ // holds this write's content — nothing for the caller to charge to
2402
+ // the LRU. (An owned entry is returned regardless: it was fulfilled
2403
+ // above and stays live for waiters that hold it, whether or not the
2404
+ // re-key installed it.)
2405
+ return null;
2406
+ }
2407
+ }
2408
+ return fulfilledEntry;
2409
+ }
2410
+ async function fetchPrefetchResponse(url, headers) {
2411
+ const fetchPriority = 'low';
2412
+ // When issuing a prefetch request, don't immediately decode the response; we
2413
+ // use the lower level `createFromResponse` API instead because we need to do
2414
+ // some extra processing of the response stream. See
2415
+ // `bufferPrefetchResponseBody` for more details.
2416
+ const shouldImmediatelyDecode = false;
2417
+ const response = await (0, _fetchserverresponse.createFetch)(url, headers, fetchPriority, shouldImmediatelyDecode);
2418
+ if (!response.ok) {
2419
+ return null;
2420
+ }
2421
+ // Check the content type
2422
+ if (isOutputExportMode) {
2423
+ // In output: "export" mode, we relaxed about the content type, since it's
2424
+ // not Next.js that's serving the response. If the status is OK, assume the
2425
+ // response is valid. If it's not a valid response, the Flight client won't
2426
+ // be able to decode it, and we'll treat it as a miss.
2427
+ } else {
2428
+ const contentType = response.headers.get('content-type');
2429
+ const isFlightResponse = contentType && contentType.startsWith(_approuterheaders.RSC_CONTENT_TYPE_HEADER);
2430
+ if (!isFlightResponse) {
2431
+ return null;
2432
+ }
2433
+ }
2434
+ return response;
2435
+ }
2436
+ /**
2437
+ * Whether the response was served from the per-segment-capable static
2438
+ * prerender, rather than the old prefetching flow. If this fails, it implies
2439
+ * that PPR is disabled on the route.
2440
+ */ function wasServedFromPerSegmentCache(response) {
2441
+ return response.headers.get(_approuterheaders.NEXT_DID_POSTPONE_HEADER) === '2' || // In output: "export" mode, we can't rely on response headers. But if we
2442
+ // receive a well-formed response, we can assume it's a static response,
2443
+ // because all data is static in this mode.
2444
+ isOutputExportMode;
2445
+ }
2446
+ async function bufferPrefetchResponseBody(body, byteLimit) {
2447
+ // Read the response from the network, optionally truncating at byteLimit.
2448
+ const reader = body.getReader();
2449
+ const chunks = [];
2450
+ let size = 0;
2451
+ while(true){
2452
+ const { done, value } = await reader.read();
2453
+ if (done) break;
2454
+ if (byteLimit !== undefined && size + value.byteLength >= byteLimit) {
2455
+ const remaining = byteLimit - size;
2456
+ if (remaining > 0) {
2457
+ chunks.push(value.byteLength > remaining ? value.subarray(0, remaining) : value);
2458
+ size += remaining;
2459
+ }
2460
+ reader.cancel();
2461
+ break;
2462
+ }
2463
+ chunks.push(value);
2464
+ size += value.byteLength;
2465
+ }
2466
+ // Concatenate into a single chunk so that Flight's processBinaryChunk
2467
+ // processes all rows synchronously in one call. Multiple chunks would not
2468
+ // be sufficient: even though reader.read() resolves as a microtask for
2469
+ // already-enqueued data, the `await` continuation from
2470
+ // createFromReadableStream can interleave between chunks. If the root
2471
+ // model row isn't the first row (e.g. outlined values come first), the
2472
+ // PromiseResolveThenableJob from `await` can cause the root to initialize
2473
+ // eagerly, scheduling the continuation before remaining chunks (including
2474
+ // promise value rows) are processed. A single chunk avoids this.
2475
+ if (chunks.length === 1) {
2476
+ return chunks[0];
2477
+ } else if (chunks.length > 1) {
2478
+ const buffer = new Uint8Array(size);
2479
+ let offset = 0;
2480
+ for (const chunk of chunks){
2481
+ buffer.set(chunk, offset);
2482
+ offset += chunk.byteLength;
2483
+ }
2484
+ return buffer;
2485
+ } else {
2486
+ return new Uint8Array(0);
2487
+ }
2488
+ }
2489
+ /**
2490
+ * Creates a streaming (non-buffered) prefetch response stream for dynamic/Full
2491
+ * prefetches. These are essentially dynamic responses that get stored in the
2492
+ * prefetch cache — they don't carry vary params or other cache metadata that
2493
+ * requires synchronous thenable resolution, so there's no need to buffer them.
2494
+ * They should continue to stream so consumers can process data as it arrives.
2495
+ */ function createIncrementalPrefetchResponseStream(originalFlightStream, onStreamClose, onResponseSizeUpdate) {
2496
+ // While processing the original stream, we incrementally update the size
2497
+ // of the cache entry in the LRU.
2498
+ let totalByteLength = 0;
2499
+ const reader = originalFlightStream.getReader();
2500
+ return new ReadableStream({
2501
+ async pull (controller) {
2502
+ while(true){
2503
+ const { done, value } = await reader.read();
2504
+ if (!done) {
2505
+ // Pass to the target stream and keep consuming the Flight response
2506
+ // from the server.
2507
+ controller.enqueue(value);
2508
+ // Incrementally update the size of the cache entry in the LRU.
2509
+ totalByteLength += value.byteLength;
2510
+ onResponseSizeUpdate(totalByteLength);
2511
+ continue;
2512
+ }
2513
+ controller.close();
2514
+ onStreamClose();
2515
+ return;
2516
+ }
2517
+ }
2518
+ });
2519
+ }
2520
+ function addSegmentPathToUrlInOutputExportMode(url, segmentPath) {
2521
+ if (isOutputExportMode) {
2522
+ // In output: "export" mode, we cannot use a header to encode the segment
2523
+ // path. Instead, we append it to the end of the pathname.
2524
+ const staticUrl = new URL(url);
2525
+ const routeDir = staticUrl.pathname.endsWith('/') ? staticUrl.pathname.slice(0, -1) : staticUrl.pathname;
2526
+ const staticExportFilename = (0, _segmentvalueencoding.convertSegmentPathToStaticExportFilename)(segmentPath);
2527
+ staticUrl.pathname = `${routeDir}/${staticExportFilename}`;
2528
+ return staticUrl;
2529
+ }
2530
+ return url;
2531
+ }
2532
+ function canNewFetchStrategyProvideMoreContent(currentStrategy, newStrategy) {
2533
+ return currentStrategy < newStrategy;
2534
+ }
2535
+ function getStaleAtFromHeader(now, response) {
2536
+ const staleTimeSeconds = parseInt(response.headers.get(_approuterheaders.NEXT_ROUTER_STALE_TIME_HEADER) ?? '', 10);
2537
+ const staleTimeMs = !isNaN(staleTimeSeconds) ? getStaleTimeMs(staleTimeSeconds) : _navigatereducer.STATIC_STALETIME_MS;
2538
+ return now + staleTimeMs;
2539
+ }
2540
+ async function resolveStaleAt(now, staleTimeIterable, response) {
2541
+ if (staleTimeIterable !== undefined) {
2542
+ // Iterate the async iterable and take the last yielded value. The server
2543
+ // yields updated staleTime values during the render; the last one is the
2544
+ // final staleTime.
2545
+ let staleTimeSeconds;
2546
+ for await (const value of staleTimeIterable){
2547
+ staleTimeSeconds = value;
2548
+ }
2549
+ if (staleTimeSeconds !== undefined) {
2550
+ const staleTimeMs = isNaN(staleTimeSeconds) ? _navigatereducer.STATIC_STALETIME_MS : getStaleTimeMs(staleTimeSeconds);
2551
+ return now + staleTimeMs;
2552
+ }
2553
+ }
2554
+ if (response !== undefined) {
2555
+ return getStaleAtFromHeader(now, response);
2556
+ }
2557
+ return now + _navigatereducer.STATIC_STALETIME_MS;
2558
+ }
2559
+ function spawnStaticStageCacheWrite(now, response, isResponsePartial, // The navigation response's headers, used to derive the buildId for the
2560
+ // write-layer build check (the deployment header, falling back to the
2561
+ // response's `b` field). Null for the initial payload, which arrived in
2562
+ // the HTML document and has no build-id check.
2563
+ responseHeaders, baseTree, renderedSearch, // The map the work that spawned this response's request is bound to. See
2564
+ // writeServerResponseIntoCache.
2565
+ map) {
2566
+ const buildId = responseHeaders !== null ? responseHeaders.get(_constants.NEXT_NAV_DEPLOYMENT_ID_HEADER) ?? response.b : undefined;
2567
+ resolveStaleAt(now, response.s).then((staleAt)=>{
2568
+ // TODO: This entire write is legacy and will be deleted in a future
2569
+ // PR: caching is organized around the conceptual shell vs not-shell
2570
+ // distinction, not around the static vs runtime render stages, so a
2571
+ // static-stage write has no place in the model. It's kept only until
2572
+ // its removal PR lands — do not extend it (e.g. with shell
2573
+ // extraction).
2574
+ writeServerResponseIntoCache(now, _types.FetchStrategy.PPR, response, baseTree, // The base tree is the navigation's current tree, not a prediction;
2575
+ // divergence from it carries no signal.
2576
+ null, // Navigation responses always include the param values in the tree,
2577
+ // so there's no pathname to parse them from (nor a need to).
2578
+ null, renderedSearch, buildId, staleAt, isResponsePartial, null, // No owned entries; every write is a detached upsert.
2579
+ null, null, map);
2580
+ }).catch(()=>{
2581
+ // The static stage processing failed. Not fatal — the render
2582
+ // completed normally, we just won't write into the cache.
2583
+ });
2584
+ }
2585
+ async function writeRuntimePrefetchStreamIntoCache(now, runtimePrefetchStream, baseTree, renderedSearch, // The map the work that spawned this response's request is bound to. See
2586
+ // writeServerResponseIntoCache.
2587
+ map) {
2588
+ const { stream, isPartial } = await stripIsPartialByte(runtimePrefetchStream);
2589
+ const buffer = await bufferPrefetchResponseBody(stream);
2590
+ const serverData = await (0, _fetchserverresponse.decodeBufferedStage)(buffer, undefined);
2591
+ // Extract the shell payload, when the response carries one. Same wire
2592
+ // convention as the other live-render responses (see
2593
+ // resolveShellStageResponse): `a` absent means the render wasn't staged —
2594
+ // no shell exists; `null` means the shell IS the full response; a number
2595
+ // is the byte boundary of a distinct shell prefix, which is re-decoded
2596
+ // from a truncated copy of the buffer. An unreadable `a` — pending or
2597
+ // rejected, which only an aborted render produces — conservatively reads
2598
+ // as no shell: the full payload is still written, there's just no shell
2599
+ // stage to extract from it.
2600
+ let shellResponse = null;
2601
+ if (serverData.a !== undefined) {
2602
+ const shellByteLength = (0, _rsctransport.readFulfilledValue)(serverData.a, undefined);
2603
+ if (shellByteLength === null) {
2604
+ shellResponse = serverData;
2605
+ } else if (shellByteLength !== undefined) {
2606
+ try {
2607
+ shellResponse = await (0, _fetchserverresponse.decodeBufferedStage)(buffer.subarray(0, shellByteLength), undefined);
2608
+ } catch {
2609
+ // The truncated prefix couldn't be decoded. Treat it as if no shell
2610
+ // exists; the full payload is still usable.
2611
+ shellResponse = null;
2612
+ }
2613
+ }
2614
+ }
2615
+ writeResponsePayloadsIntoCache(now, // A runtime prefetch stream is by definition a runtime prefetch.
2616
+ _types.FetchStrategy.PPRRuntime, serverData, shellResponse, baseTree, // The base tree is the navigation's current tree, not a prediction;
2617
+ // divergence from it carries no signal.
2618
+ null, // Navigation responses always include the param values in the tree, so
2619
+ // there's no pathname to parse them from (nor a need to).
2620
+ null, renderedSearch, serverData.b, // The response is fully buffered, so staleTime is read synchronously.
2621
+ readFulfilledStaleAt(now, serverData.s), isPartial, null, // This flow owns no pending entries; every write is a detached upsert.
2622
+ null, // Detached writes aren't sized; see writeResponsePayloadsIntoCache.
2623
+ null, map);
2624
+ }
2625
+ async function stripIsPartialByte(stream) {
2626
+ // When there is no recognized marker byte, the fallback depends on whether
2627
+ // Cached Navigations is enabled. When enabled, dynamic navigation responses
2628
+ // don't have a marker but may contain dynamic holes, so they are treated as
2629
+ // partial. When disabled, unmarked responses are treated as non-partial.
2630
+ const defaultIsPartial = !!process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS;
2631
+ const reader = stream.getReader();
2632
+ const { done, value } = await reader.read();
2633
+ if (done || !value || value.byteLength === 0) {
2634
+ return {
2635
+ stream: new ReadableStream({
2636
+ start: (c)=>c.close()
2637
+ }),
2638
+ isPartial: defaultIsPartial
2639
+ };
2640
+ }
2641
+ const firstByte = value[0];
2642
+ const hasMarker = firstByte === 0x23 || firstByte === 0x7e;
2643
+ const isPartial = hasMarker ? firstByte === 0x7e : defaultIsPartial;
2644
+ const remainder = hasMarker ? value.byteLength > 1 ? value.subarray(1) : null : value;
2645
+ return {
2646
+ isPartial,
2647
+ stream: new ReadableStream({
2648
+ start (controller) {
2649
+ if (remainder) {
2650
+ controller.enqueue(remainder);
2651
+ }
2652
+ },
2653
+ async pull (controller) {
2654
+ const result = await reader.read();
2655
+ if (result.done) {
2656
+ controller.close();
2657
+ } else {
2658
+ controller.enqueue(result.value);
2659
+ }
2660
+ }
2661
+ })
2662
+ };
2663
+ }
2664
+
2665
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
2666
+ Object.defineProperty(exports.default, '__esModule', { value: true });
2667
+ Object.assign(exports.default, exports);
2668
+ module.exports = exports.default;
2669
+ }
2670
+
2671
+ //# sourceMappingURL=cache.js.map