qalita 2.5.2__py3-none-any.whl → 2.5.4__py3-none-any.whl

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 (1326) hide show
  1. qalita/__main__.py +43 -20
  2. qalita/_frontend/.next/static/X4_AlYMbCyee-ZVLjCYMg/_buildManifest.js +11 -0
  3. qalita/_frontend/.next/static/X4_AlYMbCyee-ZVLjCYMg/_ssgManifest.js +1 -0
  4. qalita/_frontend/.next/static/chunks/023d923a37d494fc.js +1 -0
  5. qalita/_frontend/.next/static/chunks/0f84739db4a8acc7.js +1 -0
  6. qalita/_frontend/.next/static/chunks/1107bdca1eff6d34.css +1 -0
  7. qalita/_frontend/.next/static/chunks/247eb132b7f7b574.js +1 -0
  8. qalita/_frontend/.next/static/chunks/4b0c5de8d4cc313f.js +1 -0
  9. qalita/_frontend/.next/static/chunks/6c99da4248e4fcfc.js +1 -0
  10. qalita/_frontend/.next/static/chunks/a6dad97d9634a72d.js +1 -0
  11. qalita/_frontend/.next/static/chunks/bb29c2be4df20a40.js +1 -0
  12. qalita/_frontend/.next/static/chunks/bba035711c7e37a2.js +4 -0
  13. qalita/_frontend/.next/static/chunks/c903f9580a4b6572.js +2 -0
  14. qalita/_frontend/.next/static/chunks/cbd55ab9639e1e66.js +1 -0
  15. qalita/_frontend/.next/static/chunks/e393fec0d8ba175d.js +3 -0
  16. qalita/_frontend/.next/static/chunks/ff1a16fafef87110.js +1 -0
  17. qalita/_frontend/.next/static/chunks/turbopack-1ad58da399056f41.js +3 -0
  18. qalita/_frontend/node_modules/@img/colour/color.cjs +1594 -0
  19. qalita/_frontend/node_modules/@img/colour/index.cjs +1 -0
  20. qalita/_frontend/node_modules/@img/colour/package.json +45 -0
  21. qalita/_frontend/node_modules/@img/sharp-libvips-linux-x64/README.md +46 -0
  22. qalita/_frontend/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  23. qalita/_frontend/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +1 -0
  24. qalita/_frontend/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  25. qalita/_frontend/node_modules/@img/sharp-libvips-linux-x64/package.json +42 -0
  26. qalita/_frontend/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +46 -0
  27. qalita/_frontend/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  28. qalita/_frontend/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
  29. qalita/_frontend/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  30. qalita/_frontend/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
  31. qalita/_frontend/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  32. qalita/_frontend/node_modules/@img/sharp-linux-x64/package.json +46 -0
  33. qalita/_frontend/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  34. qalita/_frontend/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
  35. qalita/_frontend/node_modules/@next/env/dist/index.js +1 -0
  36. qalita/_frontend/node_modules/@next/env/package.json +36 -0
  37. qalita/_frontend/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +6 -0
  38. qalita/_frontend/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +38 -0
  39. qalita/_frontend/node_modules/@swc/helpers/package.json +471 -0
  40. qalita/_frontend/node_modules/client-only/index.js +0 -0
  41. qalita/_frontend/node_modules/client-only/package.json +19 -0
  42. qalita/_frontend/node_modules/detect-libc/lib/detect-libc.js +313 -0
  43. qalita/_frontend/node_modules/detect-libc/lib/elf.js +39 -0
  44. qalita/_frontend/node_modules/detect-libc/lib/filesystem.js +51 -0
  45. qalita/_frontend/node_modules/detect-libc/lib/process.js +24 -0
  46. qalita/_frontend/node_modules/detect-libc/package.json +44 -0
  47. qalita/_frontend/node_modules/next/dist/build/adapter/build-complete.js +993 -0
  48. qalita/_frontend/node_modules/next/dist/build/after-production-compile.js +95 -0
  49. qalita/_frontend/node_modules/next/dist/build/analysis/extract-const-value.js +205 -0
  50. qalita/_frontend/node_modules/next/dist/build/analysis/get-page-static-info.js +601 -0
  51. qalita/_frontend/node_modules/next/dist/build/analysis/parse-module.js +20 -0
  52. qalita/_frontend/node_modules/next/dist/build/babel/loader/get-config.js +429 -0
  53. qalita/_frontend/node_modules/next/dist/build/babel/loader/index.js +56 -0
  54. qalita/_frontend/node_modules/next/dist/build/babel/loader/transform.js +103 -0
  55. qalita/_frontend/node_modules/next/dist/build/babel/loader/util.js +20 -0
  56. qalita/_frontend/node_modules/next/dist/build/babel/plugins/commonjs.js +42 -0
  57. qalita/_frontend/node_modules/next/dist/build/babel/plugins/jsx-pragma.js +74 -0
  58. qalita/_frontend/node_modules/next/dist/build/babel/plugins/next-font-unsupported.js +36 -0
  59. qalita/_frontend/node_modules/next/dist/build/babel/plugins/next-page-config.js +104 -0
  60. qalita/_frontend/node_modules/next/dist/build/babel/plugins/next-page-disallow-re-export-all-exports.js +29 -0
  61. qalita/_frontend/node_modules/next/dist/build/babel/plugins/next-ssg-transform.js +345 -0
  62. qalita/_frontend/node_modules/next/dist/build/babel/plugins/optimize-hook-destructuring.js +60 -0
  63. qalita/_frontend/node_modules/next/dist/build/babel/plugins/react-loadable-plugin.js +145 -0
  64. qalita/_frontend/node_modules/next/dist/build/babel/preset.js +250 -0
  65. qalita/_frontend/node_modules/next/dist/build/build-context.js +58 -0
  66. qalita/_frontend/node_modules/next/dist/build/collect-build-traces.js +536 -0
  67. qalita/_frontend/node_modules/next/dist/build/compiler.js +88 -0
  68. qalita/_frontend/node_modules/next/dist/build/create-compiler-aliases.js +436 -0
  69. qalita/_frontend/node_modules/next/dist/build/define-env.js +228 -0
  70. qalita/_frontend/node_modules/next/dist/build/deployment-id.js +18 -0
  71. qalita/_frontend/node_modules/next/dist/build/duration-to-string.js +99 -0
  72. qalita/_frontend/node_modules/next/dist/build/entries.js +798 -0
  73. qalita/_frontend/node_modules/next/dist/build/generate-build-id.js +31 -0
  74. qalita/_frontend/node_modules/next/dist/build/get-babel-config-file.js +35 -0
  75. qalita/_frontend/node_modules/next/dist/build/get-babel-loader-config.js +109 -0
  76. qalita/_frontend/node_modules/next/dist/build/get-static-info-including-layouts.js +81 -0
  77. qalita/_frontend/node_modules/next/dist/build/handle-entrypoints.js +176 -0
  78. qalita/_frontend/node_modules/next/dist/build/handle-externals.js +290 -0
  79. qalita/_frontend/node_modules/next/dist/build/index.js +2728 -0
  80. qalita/_frontend/node_modules/next/dist/build/is-writeable.js +26 -0
  81. qalita/_frontend/node_modules/next/dist/build/jest/__mocks__/empty.js +10 -0
  82. qalita/_frontend/node_modules/next/dist/build/jest/__mocks__/fileMock.js +15 -0
  83. qalita/_frontend/node_modules/next/dist/build/jest/__mocks__/nextFontMock.js +20 -0
  84. qalita/_frontend/node_modules/next/dist/build/jest/__mocks__/styleMock.js +10 -0
  85. qalita/_frontend/node_modules/next/dist/build/jest/jest.js +227 -0
  86. qalita/_frontend/node_modules/next/dist/build/jest/object-proxy.js +50 -0
  87. qalita/_frontend/node_modules/next/dist/build/load-entrypoint.js +30 -0
  88. qalita/_frontend/node_modules/next/dist/build/load-jsconfig.js +162 -0
  89. qalita/_frontend/node_modules/next/dist/build/lockfile.js +160 -0
  90. qalita/_frontend/node_modules/next/dist/build/manifests/formatter/format-manifest.js +19 -0
  91. qalita/_frontend/node_modules/next/dist/build/next-config-ts/require-hook.js +85 -0
  92. qalita/_frontend/node_modules/next/dist/build/next-config-ts/transpile-config.js +172 -0
  93. qalita/_frontend/node_modules/next/dist/build/next-dir-paths.js +37 -0
  94. qalita/_frontend/node_modules/next/dist/build/normalize-catchall-routes.js +76 -0
  95. qalita/_frontend/node_modules/next/dist/build/output/format.js +84 -0
  96. qalita/_frontend/node_modules/next/dist/build/output/index.js +186 -0
  97. qalita/_frontend/node_modules/next/dist/build/output/log.js +138 -0
  98. qalita/_frontend/node_modules/next/dist/build/output/store.js +204 -0
  99. qalita/_frontend/node_modules/next/dist/build/page-extensions-type.js +6 -0
  100. qalita/_frontend/node_modules/next/dist/build/polyfills/fetch/index.js +6 -0
  101. qalita/_frontend/node_modules/next/dist/build/polyfills/fetch/whatwg-fetch.js +7 -0
  102. qalita/_frontend/node_modules/next/dist/build/polyfills/object-assign.js +6 -0
  103. qalita/_frontend/node_modules/next/dist/build/polyfills/object.assign/auto.js +4 -0
  104. qalita/_frontend/node_modules/next/dist/build/polyfills/object.assign/implementation.js +4 -0
  105. qalita/_frontend/node_modules/next/dist/build/polyfills/object.assign/index.js +19 -0
  106. qalita/_frontend/node_modules/next/dist/build/polyfills/object.assign/polyfill.js +6 -0
  107. qalita/_frontend/node_modules/next/dist/build/polyfills/object.assign/shim.js +6 -0
  108. qalita/_frontend/node_modules/next/dist/build/polyfills/polyfill-module.js +1 -0
  109. qalita/_frontend/node_modules/next/dist/build/polyfills/polyfill-nomodule.js +1 -0
  110. qalita/_frontend/node_modules/next/dist/build/polyfills/process.js +5 -0
  111. qalita/_frontend/node_modules/next/dist/build/preview-key-utils.js +91 -0
  112. qalita/_frontend/node_modules/next/dist/build/progress.js +151 -0
  113. qalita/_frontend/node_modules/next/dist/build/rendering-mode.js +26 -0
  114. qalita/_frontend/node_modules/next/dist/build/segment-config/app/app-segment-config.js +145 -0
  115. qalita/_frontend/node_modules/next/dist/build/segment-config/app/app-segments.js +213 -0
  116. qalita/_frontend/node_modules/next/dist/build/segment-config/app/collect-root-param-keys.js +52 -0
  117. qalita/_frontend/node_modules/next/dist/build/segment-config/middleware/middleware-config.js +121 -0
  118. qalita/_frontend/node_modules/next/dist/build/segment-config/pages/pages-segment-config.js +62 -0
  119. qalita/_frontend/node_modules/next/dist/build/sort-by-page-exts.js +30 -0
  120. qalita/_frontend/node_modules/next/dist/build/spinner.js +138 -0
  121. qalita/_frontend/node_modules/next/dist/build/static-paths/app.js +823 -0
  122. qalita/_frontend/node_modules/next/dist/build/static-paths/pages.js +169 -0
  123. qalita/_frontend/node_modules/next/dist/build/static-paths/types.js +6 -0
  124. qalita/_frontend/node_modules/next/dist/build/static-paths/utils.js +47 -0
  125. qalita/_frontend/node_modules/next/dist/build/swc/helpers.js +15 -0
  126. qalita/_frontend/node_modules/next/dist/build/swc/index.js +1267 -0
  127. qalita/_frontend/node_modules/next/dist/build/swc/install-bindings.js +30 -0
  128. qalita/_frontend/node_modules/next/dist/build/swc/jest-transformer.js +75 -0
  129. qalita/_frontend/node_modules/next/dist/build/swc/options.js +386 -0
  130. qalita/_frontend/node_modules/next/dist/build/swc/types.js +6 -0
  131. qalita/_frontend/node_modules/next/dist/build/templates/app-page.js +1064 -0
  132. qalita/_frontend/node_modules/next/dist/build/templates/app-route.js +422 -0
  133. qalita/_frontend/node_modules/next/dist/build/templates/edge-app-route.js +88 -0
  134. qalita/_frontend/node_modules/next/dist/build/templates/edge-ssr-app.js +313 -0
  135. qalita/_frontend/node_modules/next/dist/build/templates/edge-ssr.js +329 -0
  136. qalita/_frontend/node_modules/next/dist/build/templates/helpers.js +36 -0
  137. qalita/_frontend/node_modules/next/dist/build/templates/middleware.js +114 -0
  138. qalita/_frontend/node_modules/next/dist/build/templates/pages-api.js +194 -0
  139. qalita/_frontend/node_modules/next/dist/build/templates/pages-edge-api.js +38 -0
  140. qalita/_frontend/node_modules/next/dist/build/templates/pages.js +155 -0
  141. qalita/_frontend/node_modules/next/dist/build/turbopack-build/impl.js +243 -0
  142. qalita/_frontend/node_modules/next/dist/build/turbopack-build/index.js +85 -0
  143. qalita/_frontend/node_modules/next/dist/build/turborepo-access-trace/env.js +29 -0
  144. qalita/_frontend/node_modules/next/dist/build/turborepo-access-trace/helpers.js +104 -0
  145. qalita/_frontend/node_modules/next/dist/build/turborepo-access-trace/index.js +30 -0
  146. qalita/_frontend/node_modules/next/dist/build/turborepo-access-trace/result.js +51 -0
  147. qalita/_frontend/node_modules/next/dist/build/turborepo-access-trace/tcp.js +41 -0
  148. qalita/_frontend/node_modules/next/dist/build/turborepo-access-trace/types.js +8 -0
  149. qalita/_frontend/node_modules/next/dist/build/type-check.js +152 -0
  150. qalita/_frontend/node_modules/next/dist/build/utils.js +1220 -0
  151. qalita/_frontend/node_modules/next/dist/build/webpack/alias/react-dom-server-experimental.js +32 -0
  152. qalita/_frontend/node_modules/next/dist/build/webpack/alias/react-dom-server.js +32 -0
  153. qalita/_frontend/node_modules/next/dist/build/webpack/cache-invalidation.js +91 -0
  154. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/base.js +82 -0
  155. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/index.js +562 -0
  156. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/loaders/client.js +49 -0
  157. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/loaders/file-resolve.js +21 -0
  158. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js +37 -0
  159. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/loaders/global.js +65 -0
  160. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/loaders/index.js +22 -0
  161. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/loaders/modules.js +86 -0
  162. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/loaders/next-font.js +62 -0
  163. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/messages.js +45 -0
  164. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js +190 -0
  165. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/images/index.js +42 -0
  166. qalita/_frontend/node_modules/next/dist/build/webpack/config/blocks/images/messages.js +16 -0
  167. qalita/_frontend/node_modules/next/dist/build/webpack/config/helpers.js +78 -0
  168. qalita/_frontend/node_modules/next/dist/build/webpack/config/index.js +46 -0
  169. qalita/_frontend/node_modules/next/dist/build/webpack/config/utils.js +13 -0
  170. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/CssSyntaxError.js +32 -0
  171. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/camelcase.js +93 -0
  172. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js +287 -0
  173. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/plugins/index.js +36 -0
  174. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/plugins/postcss-icss-parser.js +105 -0
  175. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/plugins/postcss-import-parser.js +220 -0
  176. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/plugins/postcss-url-parser.js +307 -0
  177. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/runtime/api.js +83 -0
  178. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/runtime/getUrl.js +23 -0
  179. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/css-loader/src/utils.js +459 -0
  180. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/devtool/devtool-style-inject.js +129 -0
  181. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/empty-loader.js +14 -0
  182. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/error-loader.js +36 -0
  183. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/get-module-build-info.js +15 -0
  184. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/codegen.js +156 -0
  185. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/index.js +27 -0
  186. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/interface.js +17 -0
  187. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/loader.js +429 -0
  188. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/minify.js +94 -0
  189. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/utils.js +58 -0
  190. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/metadata/discover.js +122 -0
  191. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/metadata/resolve-route-data.js +171 -0
  192. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/metadata/types.js +7 -0
  193. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/modularize-import-loader.js +39 -0
  194. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-app-loader/create-app-route-code.js +65 -0
  195. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js +747 -0
  196. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-barrel-loader.js +268 -0
  197. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js +37 -0
  198. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js +54 -0
  199. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-edge-function-loader.js +52 -0
  200. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-edge-ssr-loader/index.js +100 -0
  201. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-error-browser-binary-loader.js +21 -0
  202. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js +32 -0
  203. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js +45 -0
  204. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js +49 -0
  205. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-css-loader.js +56 -0
  206. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper.js +33 -0
  207. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-loader/action-validate.js +27 -0
  208. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper.js +13 -0
  209. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js +211 -0
  210. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-loader/module-proxy.js +14 -0
  211. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-loader/server-reference.js +13 -0
  212. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-loader/track-dynamic-import.js +13 -0
  213. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-flight-server-reference-proxy-loader.js +29 -0
  214. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js +133 -0
  215. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-font-loader/postcss-next-font.js +169 -0
  216. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-image-loader/blur.js +73 -0
  217. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-image-loader/index.js +80 -0
  218. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-invalid-import-error-loader.js +28 -0
  219. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-metadata-image-loader.js +158 -0
  220. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-metadata-route-loader.js +342 -0
  221. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-middleware-asset-loader.js +46 -0
  222. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-middleware-loader.js +59 -0
  223. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-middleware-wasm-loader.js +46 -0
  224. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-root-params-loader.js +164 -0
  225. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-route-loader/index.js +141 -0
  226. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-style-loader/index.js +220 -0
  227. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoLinkTag.js +61 -0
  228. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoStyleTag.js +221 -0
  229. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-style-loader/runtime/isEqualLocals.js +27 -0
  230. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js +241 -0
  231. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/Error.js +40 -0
  232. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/Warning.js +35 -0
  233. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js +125 -0
  234. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/utils.js +86 -0
  235. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/index.js +101 -0
  236. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/lib/file-protocol.js +78 -0
  237. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/lib/join-function.js +190 -0
  238. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss.js +92 -0
  239. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/lib/value-processor.js +97 -0
  240. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/utils.js +100 -0
  241. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/build-manifest-plugin-utils.js +79 -0
  242. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/build-manifest-plugin.js +183 -0
  243. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/copy-file-plugin.js +67 -0
  244. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/css-chunking-plugin.js +277 -0
  245. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js +92 -0
  246. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/devtools-ignore-list-plugin.js +78 -0
  247. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/eval-source-map-dev-tool-plugin.js +191 -0
  248. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/flight-client-entry-plugin.js +793 -0
  249. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/flight-manifest-plugin.js +420 -0
  250. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/force-complete-runtime.js +42 -0
  251. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/jsconfig-paths-plugin.js +219 -0
  252. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/memory-with-gc-cache-plugin.js +114 -0
  253. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/middleware-plugin.js +611 -0
  254. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/mini-css-extract-plugin.js +24 -0
  255. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/minify-webpack-plugin/src/index.js +188 -0
  256. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/next-font-manifest-plugin.js +120 -0
  257. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js +542 -0
  258. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/next-types-plugin/index.js +428 -0
  259. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/next-types-plugin/shared.js +14 -0
  260. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +57 -0
  261. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/optional-peer-dependency-resolve-plugin.js +45 -0
  262. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/pages-manifest-plugin.js +146 -0
  263. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/profiling-plugin.js +282 -0
  264. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/react-loadable-plugin.js +169 -0
  265. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js +97 -0
  266. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/rspack-profiling-plugin.js +62 -0
  267. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/slow-module-detection-plugin.js +190 -0
  268. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/subresource-integrity-plugin.js +62 -0
  269. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/telemetry-plugin/telemetry-plugin.js +188 -0
  270. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/telemetry-plugin/update-telemetry-loader-context-from-swc.js +28 -0
  271. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/telemetry-plugin/use-cache-tracker-utils.js +43 -0
  272. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/getModuleTrace.js +89 -0
  273. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/index.js +43 -0
  274. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parse-dynamic-code-evaluation-error.js +19 -0
  275. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseBabel.js +29 -0
  276. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseCss.js +29 -0
  277. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +26 -0
  278. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextFontError.js +33 -0
  279. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextInvalidImportError.js +26 -0
  280. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.js +166 -0
  281. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseScss.js +42 -0
  282. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/simpleWebpackError.js +18 -0
  283. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/webpackModuleError.js +138 -0
  284. qalita/_frontend/node_modules/next/dist/build/webpack/stringify-request.js +15 -0
  285. qalita/_frontend/node_modules/next/dist/build/webpack/utils.js +109 -0
  286. qalita/_frontend/node_modules/next/dist/build/webpack-build/impl.js +380 -0
  287. qalita/_frontend/node_modules/next/dist/build/webpack-build/index.js +179 -0
  288. qalita/_frontend/node_modules/next/dist/build/webpack-config-rules/resolve.js +55 -0
  289. qalita/_frontend/node_modules/next/dist/build/webpack-config.js +2311 -0
  290. qalita/_frontend/node_modules/next/dist/build/worker.js +35 -0
  291. qalita/_frontend/node_modules/next/dist/build/write-build-id.js +19 -0
  292. qalita/_frontend/node_modules/next/dist/cli/next-test.js +171 -0
  293. qalita/_frontend/node_modules/next/dist/client/add-base-path.js +24 -0
  294. qalita/_frontend/node_modules/next/dist/client/app-build-id.js +49 -0
  295. qalita/_frontend/node_modules/next/dist/client/app-call-server.js +34 -0
  296. qalita/_frontend/node_modules/next/dist/client/app-find-source-map-url.js +38 -0
  297. qalita/_frontend/node_modules/next/dist/client/assign-location.js +29 -0
  298. qalita/_frontend/node_modules/next/dist/client/components/app-router-announcer.js +78 -0
  299. qalita/_frontend/node_modules/next/dist/client/components/app-router-headers.js +123 -0
  300. qalita/_frontend/node_modules/next/dist/client/components/app-router-instance.js +327 -0
  301. qalita/_frontend/node_modules/next/dist/client/components/app-router-utils.js +62 -0
  302. qalita/_frontend/node_modules/next/dist/client/components/app-router.js +515 -0
  303. qalita/_frontend/node_modules/next/dist/client/components/builtin/default.js +35 -0
  304. qalita/_frontend/node_modules/next/dist/client/components/builtin/global-error.js +82 -0
  305. qalita/_frontend/node_modules/next/dist/client/components/dev-root-http-access-fallback-boundary.js +52 -0
  306. qalita/_frontend/node_modules/next/dist/client/components/error-boundary.js +134 -0
  307. qalita/_frontend/node_modules/next/dist/client/components/errors/graceful-degrade-boundary.js +86 -0
  308. qalita/_frontend/node_modules/next/dist/client/components/errors/root-error-boundary.js +41 -0
  309. qalita/_frontend/node_modules/next/dist/client/components/forbidden.js +48 -0
  310. qalita/_frontend/node_modules/next/dist/client/components/handle-isr-error.js +31 -0
  311. qalita/_frontend/node_modules/next/dist/client/components/hooks-server-context.js +42 -0
  312. qalita/_frontend/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js +125 -0
  313. qalita/_frontend/node_modules/next/dist/client/components/http-access-fallback/http-access-fallback.js +72 -0
  314. qalita/_frontend/node_modules/next/dist/client/components/is-next-router-error.js +23 -0
  315. qalita/_frontend/node_modules/next/dist/client/components/links.js +292 -0
  316. qalita/_frontend/node_modules/next/dist/client/components/match-segments.js +32 -0
  317. qalita/_frontend/node_modules/next/dist/client/components/nav-failure-handler.js +61 -0
  318. qalita/_frontend/node_modules/next/dist/client/components/navigation-devtools.js +128 -0
  319. qalita/_frontend/node_modules/next/dist/client/components/navigation-untracked.js +65 -0
  320. qalita/_frontend/node_modules/next/dist/client/components/navigation.js +197 -0
  321. qalita/_frontend/node_modules/next/dist/client/components/navigation.react-server.js +72 -0
  322. qalita/_frontend/node_modules/next/dist/client/components/not-found.js +42 -0
  323. qalita/_frontend/node_modules/next/dist/client/components/readonly-url-search-params.js +41 -0
  324. qalita/_frontend/node_modules/next/dist/client/components/redirect-boundary.js +107 -0
  325. qalita/_frontend/node_modules/next/dist/client/components/redirect-error.js +52 -0
  326. qalita/_frontend/node_modules/next/dist/client/components/redirect-status-code.js +24 -0
  327. qalita/_frontend/node_modules/next/dist/client/components/redirect.js +91 -0
  328. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/apply-flight-data.js +53 -0
  329. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/apply-router-state-patch-to-tree.js +105 -0
  330. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/compute-changed-path.js +128 -0
  331. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js +21 -0
  332. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/create-initial-router-state.js +78 -0
  333. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/create-router-cache-key.js +32 -0
  334. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +352 -0
  335. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fill-cache-with-new-subtree-data.js +110 -0
  336. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.js +131 -0
  337. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/handle-mutable.js +66 -0
  338. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/handle-segment-mismatch.js +25 -0
  339. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/invalidate-cache-by-router-state.js +32 -0
  340. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/is-navigating-to-new-root-layout.js +51 -0
  341. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js +875 -0
  342. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/find-head-in-cache.js +64 -0
  343. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/has-interception-route-in-current-tree.js +38 -0
  344. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/hmr-refresh-reducer.js +95 -0
  345. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js +165 -0
  346. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/refresh-reducer.js +105 -0
  347. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js +63 -0
  348. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/server-action-reducer.js +279 -0
  349. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/server-patch-reducer.js +65 -0
  350. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/refetch-inactive-parallel-segments.js +104 -0
  351. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js +62 -0
  352. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/router-reducer.js +66 -0
  353. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js +60 -0
  354. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/cache-key.js +28 -0
  355. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/cache-map.js +310 -0
  356. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/cache.js +1419 -0
  357. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/lru.js +141 -0
  358. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/navigation.js +416 -0
  359. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/prefetch.js +31 -0
  360. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/scheduler.js +1150 -0
  361. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/types.js +69 -0
  362. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/vary-path.js +216 -0
  363. qalita/_frontend/node_modules/next/dist/client/components/static-generation-bailout.js +42 -0
  364. qalita/_frontend/node_modules/next/dist/client/components/unauthorized.js +49 -0
  365. qalita/_frontend/node_modules/next/dist/client/components/unrecognized-action-error.js +39 -0
  366. qalita/_frontend/node_modules/next/dist/client/components/unresolved-thenable.js +23 -0
  367. qalita/_frontend/node_modules/next/dist/client/components/unstable-rethrow.browser.js +28 -0
  368. qalita/_frontend/node_modules/next/dist/client/components/unstable-rethrow.js +25 -0
  369. qalita/_frontend/node_modules/next/dist/client/components/unstable-rethrow.server.js +32 -0
  370. qalita/_frontend/node_modules/next/dist/client/components/use-action-queue.js +102 -0
  371. qalita/_frontend/node_modules/next/dist/client/dev/debug-channel.js +72 -0
  372. qalita/_frontend/node_modules/next/dist/client/flight-data-helpers.js +219 -0
  373. qalita/_frontend/node_modules/next/dist/client/has-base-path.js +23 -0
  374. qalita/_frontend/node_modules/next/dist/client/lib/console.js +177 -0
  375. qalita/_frontend/node_modules/next/dist/client/normalize-trailing-slash.js +36 -0
  376. qalita/_frontend/node_modules/next/dist/client/remove-base-path.js +32 -0
  377. qalita/_frontend/node_modules/next/dist/client/route-params.js +230 -0
  378. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js +339 -0
  379. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/cookies/package.json +1 -0
  380. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/ponyfill/index.js +46 -0
  381. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/ponyfill/package.json +1 -0
  382. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/primitives/abort-controller.js.text.js +1 -0
  383. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/primitives/console.js.text.js +1 -0
  384. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/primitives/events.js.text.js +1 -0
  385. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/primitives/index.js +5 -0
  386. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/primitives/load.js +18713 -0
  387. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/primitives/package.json +1 -0
  388. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/primitives/stream.js +44 -0
  389. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/primitives/timers.js.text.js +1 -0
  390. qalita/_frontend/node_modules/next/dist/compiled/@edge-runtime/primitives/url.js.text.js +1 -0
  391. qalita/_frontend/node_modules/next/dist/compiled/@hapi/accept/index.js +1 -0
  392. qalita/_frontend/node_modules/next/dist/compiled/@hapi/accept/package.json +1 -0
  393. qalita/_frontend/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/index.js +1 -0
  394. qalita/_frontend/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/package.json +1 -0
  395. qalita/_frontend/node_modules/next/dist/compiled/@napi-rs/triples/index.js +1 -0
  396. qalita/_frontend/node_modules/next/dist/compiled/@napi-rs/triples/package.json +1 -0
  397. qalita/_frontend/node_modules/next/dist/compiled/@opentelemetry/api/index.js +1 -0
  398. qalita/_frontend/node_modules/next/dist/compiled/@opentelemetry/api/package.json +1 -0
  399. qalita/_frontend/node_modules/next/dist/compiled/async-retry/index.js +1 -0
  400. qalita/_frontend/node_modules/next/dist/compiled/async-retry/package.json +1 -0
  401. qalita/_frontend/node_modules/next/dist/compiled/async-sema/index.js +1 -0
  402. qalita/_frontend/node_modules/next/dist/compiled/async-sema/package.json +1 -0
  403. qalita/_frontend/node_modules/next/dist/compiled/babel/code-frame.js +1 -0
  404. qalita/_frontend/node_modules/next/dist/compiled/babel/package.json +1 -0
  405. qalita/_frontend/node_modules/next/dist/compiled/babel-code-frame/index.js +1 -0
  406. qalita/_frontend/node_modules/next/dist/compiled/babel-code-frame/package.json +1 -0
  407. qalita/_frontend/node_modules/next/dist/compiled/busboy/index.js +1 -0
  408. qalita/_frontend/node_modules/next/dist/compiled/busboy/package.json +1 -0
  409. qalita/_frontend/node_modules/next/dist/compiled/bytes/index.js +8 -0
  410. qalita/_frontend/node_modules/next/dist/compiled/bytes/package.json +1 -0
  411. qalita/_frontend/node_modules/next/dist/compiled/ci-info/index.js +1 -0
  412. qalita/_frontend/node_modules/next/dist/compiled/ci-info/package.json +1 -0
  413. qalita/_frontend/node_modules/next/dist/compiled/commander/index.js +1 -0
  414. qalita/_frontend/node_modules/next/dist/compiled/commander/package.json +1 -0
  415. qalita/_frontend/node_modules/next/dist/compiled/comment-json/index.js +7 -0
  416. qalita/_frontend/node_modules/next/dist/compiled/comment-json/package.json +1 -0
  417. qalita/_frontend/node_modules/next/dist/compiled/compression/index.js +58 -0
  418. qalita/_frontend/node_modules/next/dist/compiled/compression/package.json +1 -0
  419. qalita/_frontend/node_modules/next/dist/compiled/conf/index.js +15 -0
  420. qalita/_frontend/node_modules/next/dist/compiled/conf/package.json +1 -0
  421. qalita/_frontend/node_modules/next/dist/compiled/content-disposition/index.js +6 -0
  422. qalita/_frontend/node_modules/next/dist/compiled/content-disposition/package.json +1 -0
  423. qalita/_frontend/node_modules/next/dist/compiled/cookie/index.js +7 -0
  424. qalita/_frontend/node_modules/next/dist/compiled/cookie/package.json +1 -0
  425. qalita/_frontend/node_modules/next/dist/compiled/cross-spawn/index.js +1 -0
  426. qalita/_frontend/node_modules/next/dist/compiled/cross-spawn/package.json +1 -0
  427. qalita/_frontend/node_modules/next/dist/compiled/debug/index.js +1 -0
  428. qalita/_frontend/node_modules/next/dist/compiled/debug/package.json +1 -0
  429. qalita/_frontend/node_modules/next/dist/compiled/edge-runtime/index.js +1 -0
  430. qalita/_frontend/node_modules/next/dist/compiled/edge-runtime/package.json +1 -0
  431. qalita/_frontend/node_modules/next/dist/compiled/find-up/index.js +1 -0
  432. qalita/_frontend/node_modules/next/dist/compiled/find-up/package.json +1 -0
  433. qalita/_frontend/node_modules/next/dist/compiled/fresh/index.js +8 -0
  434. qalita/_frontend/node_modules/next/dist/compiled/fresh/package.json +1 -0
  435. qalita/_frontend/node_modules/next/dist/compiled/http-proxy/index.js +34 -0
  436. qalita/_frontend/node_modules/next/dist/compiled/http-proxy/package.json +1 -0
  437. qalita/_frontend/node_modules/next/dist/compiled/image-detector/detector.js +1 -0
  438. qalita/_frontend/node_modules/next/dist/compiled/image-size/index.js +1 -0
  439. qalita/_frontend/node_modules/next/dist/compiled/image-size/package.json +1 -0
  440. qalita/_frontend/node_modules/next/dist/compiled/ipaddr.js/ipaddr.js +1 -0
  441. qalita/_frontend/node_modules/next/dist/compiled/ipaddr.js/package.json +1 -0
  442. qalita/_frontend/node_modules/next/dist/compiled/is-animated/index.js +1 -0
  443. qalita/_frontend/node_modules/next/dist/compiled/is-animated/package.json +1 -0
  444. qalita/_frontend/node_modules/next/dist/compiled/is-docker/index.js +1 -0
  445. qalita/_frontend/node_modules/next/dist/compiled/is-docker/package.json +1 -0
  446. qalita/_frontend/node_modules/next/dist/compiled/is-wsl/index.js +1 -0
  447. qalita/_frontend/node_modules/next/dist/compiled/is-wsl/package.json +1 -0
  448. qalita/_frontend/node_modules/next/dist/compiled/jsonwebtoken/index.js +11 -0
  449. qalita/_frontend/node_modules/next/dist/compiled/jsonwebtoken/package.json +1 -0
  450. qalita/_frontend/node_modules/next/dist/compiled/nanoid/index.cjs +1 -0
  451. qalita/_frontend/node_modules/next/dist/compiled/nanoid/package.json +1 -0
  452. qalita/_frontend/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +24 -0
  453. qalita/_frontend/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +24 -0
  454. qalita/_frontend/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +6 -0
  455. qalita/_frontend/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +20 -0
  456. qalita/_frontend/node_modules/next/dist/compiled/p-limit/index.js +1 -0
  457. qalita/_frontend/node_modules/next/dist/compiled/p-limit/package.json +1 -0
  458. qalita/_frontend/node_modules/next/dist/compiled/p-queue/index.js +1 -0
  459. qalita/_frontend/node_modules/next/dist/compiled/p-queue/package.json +1 -0
  460. qalita/_frontend/node_modules/next/dist/compiled/path-browserify/index.js +1 -0
  461. qalita/_frontend/node_modules/next/dist/compiled/path-browserify/package.json +1 -0
  462. qalita/_frontend/node_modules/next/dist/compiled/path-to-regexp/index.js +1 -0
  463. qalita/_frontend/node_modules/next/dist/compiled/path-to-regexp/package.json +1 -0
  464. qalita/_frontend/node_modules/next/dist/compiled/picomatch/index.js +1 -0
  465. qalita/_frontend/node_modules/next/dist/compiled/picomatch/package.json +1 -0
  466. qalita/_frontend/node_modules/next/dist/compiled/react-is/cjs/react-is.development.js +133 -0
  467. qalita/_frontend/node_modules/next/dist/compiled/react-is/cjs/react-is.production.js +130 -0
  468. qalita/_frontend/node_modules/next/dist/compiled/react-is/index.js +7 -0
  469. qalita/_frontend/node_modules/next/dist/compiled/react-is/package.json +26 -0
  470. qalita/_frontend/node_modules/next/dist/compiled/regenerator-runtime/package.json +19 -0
  471. qalita/_frontend/node_modules/next/dist/compiled/regenerator-runtime/runtime.js +729 -0
  472. qalita/_frontend/node_modules/next/dist/compiled/semver/index.js +1 -0
  473. qalita/_frontend/node_modules/next/dist/compiled/semver/package.json +1 -0
  474. qalita/_frontend/node_modules/next/dist/compiled/send/index.js +70 -0
  475. qalita/_frontend/node_modules/next/dist/compiled/send/package.json +1 -0
  476. qalita/_frontend/node_modules/next/dist/compiled/source-map/package.json +1 -0
  477. qalita/_frontend/node_modules/next/dist/compiled/source-map/source-map.js +1 -0
  478. qalita/_frontend/node_modules/next/dist/compiled/stacktrace-parser/package.json +1 -0
  479. qalita/_frontend/node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js +1 -0
  480. qalita/_frontend/node_modules/next/dist/compiled/string-hash/index.js +1 -0
  481. qalita/_frontend/node_modules/next/dist/compiled/string-hash/package.json +1 -0
  482. qalita/_frontend/node_modules/next/dist/compiled/strip-ansi/index.js +1 -0
  483. qalita/_frontend/node_modules/next/dist/compiled/strip-ansi/package.json +1 -0
  484. qalita/_frontend/node_modules/next/dist/compiled/superstruct/index.cjs +1 -0
  485. qalita/_frontend/node_modules/next/dist/compiled/superstruct/package.json +1 -0
  486. qalita/_frontend/node_modules/next/dist/compiled/tar/index.js +1 -0
  487. qalita/_frontend/node_modules/next/dist/compiled/tar/package.json +1 -0
  488. qalita/_frontend/node_modules/next/dist/compiled/text-table/index.js +1 -0
  489. qalita/_frontend/node_modules/next/dist/compiled/text-table/package.json +1 -0
  490. qalita/_frontend/node_modules/next/dist/compiled/watchpack/package.json +1 -0
  491. qalita/_frontend/node_modules/next/dist/compiled/watchpack/watchpack.js +1 -0
  492. qalita/_frontend/node_modules/next/dist/compiled/ws/index.js +1 -0
  493. qalita/_frontend/node_modules/next/dist/compiled/ws/package.json +1 -0
  494. qalita/_frontend/node_modules/next/dist/compiled/zod/index.cjs +1 -0
  495. qalita/_frontend/node_modules/next/dist/compiled/zod/package.json +1 -0
  496. qalita/_frontend/node_modules/next/dist/compiled/zod-validation-error/index.js +1 -0
  497. qalita/_frontend/node_modules/next/dist/compiled/zod-validation-error/package.json +1 -0
  498. qalita/_frontend/node_modules/next/dist/experimental/testmode/context.js +57 -0
  499. qalita/_frontend/node_modules/next/dist/experimental/testmode/fetch.js +142 -0
  500. qalita/_frontend/node_modules/next/dist/experimental/testmode/httpget.js +26 -0
  501. qalita/_frontend/node_modules/next/dist/experimental/testmode/server-edge.js +32 -0
  502. qalita/_frontend/node_modules/next/dist/experimental/testmode/server.js +62 -0
  503. qalita/_frontend/node_modules/next/dist/export/helpers/create-incremental-cache.js +61 -0
  504. qalita/_frontend/node_modules/next/dist/lib/batcher.js +65 -0
  505. qalita/_frontend/node_modules/next/dist/lib/build-custom-route.js +46 -0
  506. qalita/_frontend/node_modules/next/dist/lib/bundler.js +97 -0
  507. qalita/_frontend/node_modules/next/dist/lib/client-and-server-references.js +54 -0
  508. qalita/_frontend/node_modules/next/dist/lib/coalesced-function.js +39 -0
  509. qalita/_frontend/node_modules/next/dist/lib/compile-error.js +14 -0
  510. qalita/_frontend/node_modules/next/dist/lib/constants.js +410 -0
  511. qalita/_frontend/node_modules/next/dist/lib/create-client-router-filter.js +67 -0
  512. qalita/_frontend/node_modules/next/dist/lib/detached-promise.js +32 -0
  513. qalita/_frontend/node_modules/next/dist/lib/detect-typo.js +51 -0
  514. qalita/_frontend/node_modules/next/dist/lib/download-swc.js +183 -0
  515. qalita/_frontend/node_modules/next/dist/lib/error-telemetry-utils.js +42 -0
  516. qalita/_frontend/node_modules/next/dist/lib/fallback.js +100 -0
  517. qalita/_frontend/node_modules/next/dist/lib/fatal-error.js +14 -0
  518. qalita/_frontend/node_modules/next/dist/lib/file-exists.js +53 -0
  519. qalita/_frontend/node_modules/next/dist/lib/find-config.js +102 -0
  520. qalita/_frontend/node_modules/next/dist/lib/find-pages-dir.js +65 -0
  521. qalita/_frontend/node_modules/next/dist/lib/find-root.js +122 -0
  522. qalita/_frontend/node_modules/next/dist/lib/format-cli-help-output.js +84 -0
  523. qalita/_frontend/node_modules/next/dist/lib/format-dynamic-import-path.js +24 -0
  524. qalita/_frontend/node_modules/next/dist/lib/format-server-error.js +74 -0
  525. qalita/_frontend/node_modules/next/dist/lib/framework/boundary-components.js +62 -0
  526. qalita/_frontend/node_modules/next/dist/lib/framework/boundary-constants.js +36 -0
  527. qalita/_frontend/node_modules/next/dist/lib/fs/rename.js +87 -0
  528. qalita/_frontend/node_modules/next/dist/lib/fs/write-atomic.js +28 -0
  529. qalita/_frontend/node_modules/next/dist/lib/generate-interception-routes-rewrites.js +70 -0
  530. qalita/_frontend/node_modules/next/dist/lib/get-files-in-dir.js +33 -0
  531. qalita/_frontend/node_modules/next/dist/lib/get-network-host.js +44 -0
  532. qalita/_frontend/node_modules/next/dist/lib/get-package-version.js +118 -0
  533. qalita/_frontend/node_modules/next/dist/lib/get-project-dir.js +51 -0
  534. qalita/_frontend/node_modules/next/dist/lib/has-necessary-dependencies.js +49 -0
  535. qalita/_frontend/node_modules/next/dist/lib/helpers/get-cache-directory.js +66 -0
  536. qalita/_frontend/node_modules/next/dist/lib/helpers/get-npx-command.js +29 -0
  537. qalita/_frontend/node_modules/next/dist/lib/helpers/get-online.js +50 -0
  538. qalita/_frontend/node_modules/next/dist/lib/helpers/get-pkg-manager.js +63 -0
  539. qalita/_frontend/node_modules/next/dist/lib/helpers/get-registry.js +45 -0
  540. qalita/_frontend/node_modules/next/dist/lib/helpers/get-reserved-port.js +116 -0
  541. qalita/_frontend/node_modules/next/dist/lib/helpers/install.js +83 -0
  542. qalita/_frontend/node_modules/next/dist/lib/import-next-warning.js +50 -0
  543. qalita/_frontend/node_modules/next/dist/lib/inline-static-env.js +112 -0
  544. qalita/_frontend/node_modules/next/dist/lib/install-dependencies.js +40 -0
  545. qalita/_frontend/node_modules/next/dist/lib/interop-default.js +15 -0
  546. qalita/_frontend/node_modules/next/dist/lib/is-api-route.js +15 -0
  547. qalita/_frontend/node_modules/next/dist/lib/is-app-page-route.js +15 -0
  548. qalita/_frontend/node_modules/next/dist/lib/is-app-route-route.js +15 -0
  549. qalita/_frontend/node_modules/next/dist/lib/is-edge-runtime.js +16 -0
  550. qalita/_frontend/node_modules/next/dist/lib/is-error.js +78 -0
  551. qalita/_frontend/node_modules/next/dist/lib/is-internal-component.js +36 -0
  552. qalita/_frontend/node_modules/next/dist/lib/is-serializable-props.js +106 -0
  553. qalita/_frontend/node_modules/next/dist/lib/load-custom-routes.js +550 -0
  554. qalita/_frontend/node_modules/next/dist/lib/memory/gc-observer.js +53 -0
  555. qalita/_frontend/node_modules/next/dist/lib/memory/shutdown.js +29 -0
  556. qalita/_frontend/node_modules/next/dist/lib/memory/startup.js +47 -0
  557. qalita/_frontend/node_modules/next/dist/lib/memory/trace.js +109 -0
  558. qalita/_frontend/node_modules/next/dist/lib/metadata/constants.js +40 -0
  559. qalita/_frontend/node_modules/next/dist/lib/metadata/default-metadata.js +82 -0
  560. qalita/_frontend/node_modules/next/dist/lib/metadata/generate/alternate.js +55 -0
  561. qalita/_frontend/node_modules/next/dist/lib/metadata/generate/basic.js +307 -0
  562. qalita/_frontend/node_modules/next/dist/lib/metadata/generate/icon-mark.js +22 -0
  563. qalita/_frontend/node_modules/next/dist/lib/metadata/generate/icons.js +64 -0
  564. qalita/_frontend/node_modules/next/dist/lib/metadata/generate/meta.js +123 -0
  565. qalita/_frontend/node_modules/next/dist/lib/metadata/generate/opengraph.js +478 -0
  566. qalita/_frontend/node_modules/next/dist/lib/metadata/generate/utils.js +52 -0
  567. qalita/_frontend/node_modules/next/dist/lib/metadata/get-metadata-route.js +114 -0
  568. qalita/_frontend/node_modules/next/dist/lib/metadata/is-metadata-route.js +221 -0
  569. qalita/_frontend/node_modules/next/dist/lib/metadata/metadata-context.js +18 -0
  570. qalita/_frontend/node_modules/next/dist/lib/metadata/metadata.js +237 -0
  571. qalita/_frontend/node_modules/next/dist/lib/metadata/resolve-metadata.js +859 -0
  572. qalita/_frontend/node_modules/next/dist/lib/metadata/resolvers/resolve-basics.js +232 -0
  573. qalita/_frontend/node_modules/next/dist/lib/metadata/resolvers/resolve-icons.js +56 -0
  574. qalita/_frontend/node_modules/next/dist/lib/metadata/resolvers/resolve-opengraph.js +199 -0
  575. qalita/_frontend/node_modules/next/dist/lib/metadata/resolvers/resolve-title.js +40 -0
  576. qalita/_frontend/node_modules/next/dist/lib/metadata/resolvers/resolve-url.js +135 -0
  577. qalita/_frontend/node_modules/next/dist/lib/metadata/types/alternative-urls-types.js +7 -0
  578. qalita/_frontend/node_modules/next/dist/lib/metadata/types/extra-types.js +9 -0
  579. qalita/_frontend/node_modules/next/dist/lib/metadata/types/icons.js +6 -0
  580. qalita/_frontend/node_modules/next/dist/lib/metadata/types/manifest-types.js +6 -0
  581. qalita/_frontend/node_modules/next/dist/lib/metadata/types/metadata-interface.js +18 -0
  582. qalita/_frontend/node_modules/next/dist/lib/metadata/types/metadata-types.js +10 -0
  583. qalita/_frontend/node_modules/next/dist/lib/metadata/types/opengraph-types.js +6 -0
  584. qalita/_frontend/node_modules/next/dist/lib/metadata/types/resolvers.js +6 -0
  585. qalita/_frontend/node_modules/next/dist/lib/metadata/types/twitter-types.js +7 -0
  586. qalita/_frontend/node_modules/next/dist/lib/mime-type.js +20 -0
  587. qalita/_frontend/node_modules/next/dist/lib/mkcert.js +204 -0
  588. qalita/_frontend/node_modules/next/dist/lib/multi-file-writer.js +75 -0
  589. qalita/_frontend/node_modules/next/dist/lib/needs-experimental-react.js +16 -0
  590. qalita/_frontend/node_modules/next/dist/lib/non-nullable.js +15 -0
  591. qalita/_frontend/node_modules/next/dist/lib/normalize-path.js +21 -0
  592. qalita/_frontend/node_modules/next/dist/lib/oxford-comma-list.js +15 -0
  593. qalita/_frontend/node_modules/next/dist/lib/page-types.js +18 -0
  594. qalita/_frontend/node_modules/next/dist/lib/patch-incorrect-lockfile.js +185 -0
  595. qalita/_frontend/node_modules/next/dist/lib/pick.js +19 -0
  596. qalita/_frontend/node_modules/next/dist/lib/picocolors.js +177 -0
  597. qalita/_frontend/node_modules/next/dist/lib/pretty-bytes.js +74 -0
  598. qalita/_frontend/node_modules/next/dist/lib/realpath.js +20 -0
  599. qalita/_frontend/node_modules/next/dist/lib/recursive-copy.js +76 -0
  600. qalita/_frontend/node_modules/next/dist/lib/recursive-delete.js +137 -0
  601. qalita/_frontend/node_modules/next/dist/lib/recursive-readdir.js +124 -0
  602. qalita/_frontend/node_modules/next/dist/lib/redirect-status.js +46 -0
  603. qalita/_frontend/node_modules/next/dist/lib/require-instrumentation-client.js +26 -0
  604. qalita/_frontend/node_modules/next/dist/lib/resolve-build-paths.js +181 -0
  605. qalita/_frontend/node_modules/next/dist/lib/resolve-from.js +65 -0
  606. qalita/_frontend/node_modules/next/dist/lib/route-pattern-normalizer.js +107 -0
  607. qalita/_frontend/node_modules/next/dist/lib/scheduler.js +64 -0
  608. qalita/_frontend/node_modules/next/dist/lib/semver-noop.js +18 -0
  609. qalita/_frontend/node_modules/next/dist/lib/setup-exception-listeners.js +11 -0
  610. qalita/_frontend/node_modules/next/dist/lib/static-env.js +92 -0
  611. qalita/_frontend/node_modules/next/dist/lib/try-to-parse-path.js +68 -0
  612. qalita/_frontend/node_modules/next/dist/lib/turbopack-warning.js +188 -0
  613. qalita/_frontend/node_modules/next/dist/lib/typescript/diagnosticFormatter.js +240 -0
  614. qalita/_frontend/node_modules/next/dist/lib/typescript/getTypeScriptConfiguration.js +73 -0
  615. qalita/_frontend/node_modules/next/dist/lib/typescript/getTypeScriptIntent.js +52 -0
  616. qalita/_frontend/node_modules/next/dist/lib/typescript/missingDependencyError.js +27 -0
  617. qalita/_frontend/node_modules/next/dist/lib/typescript/runTypeCheck.js +95 -0
  618. qalita/_frontend/node_modules/next/dist/lib/typescript/writeAppTypeDeclarations.js +65 -0
  619. qalita/_frontend/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js +405 -0
  620. qalita/_frontend/node_modules/next/dist/lib/url.js +75 -0
  621. qalita/_frontend/node_modules/next/dist/lib/verify-partytown-setup.js +115 -0
  622. qalita/_frontend/node_modules/next/dist/lib/verify-root-layout.js +165 -0
  623. qalita/_frontend/node_modules/next/dist/lib/verify-typescript-setup.js +170 -0
  624. qalita/_frontend/node_modules/next/dist/lib/wait.js +19 -0
  625. qalita/_frontend/node_modules/next/dist/lib/with-promise-cache.js +24 -0
  626. qalita/_frontend/node_modules/next/dist/lib/worker.js +215 -0
  627. qalita/_frontend/node_modules/next/dist/next-devtools/server/shared.js +61 -0
  628. qalita/_frontend/node_modules/next/dist/server/ReactDOMServerPages.js +16 -0
  629. qalita/_frontend/node_modules/next/dist/server/accept-header.js +132 -0
  630. qalita/_frontend/node_modules/next/dist/server/after/after-context.js +140 -0
  631. qalita/_frontend/node_modules/next/dist/server/after/after.js +26 -0
  632. qalita/_frontend/node_modules/next/dist/server/after/awaiter.js +74 -0
  633. qalita/_frontend/node_modules/next/dist/server/after/builtin-request-context.js +38 -0
  634. qalita/_frontend/node_modules/next/dist/server/after/index.js +21 -0
  635. qalita/_frontend/node_modules/next/dist/server/after/run-with-after.js +35 -0
  636. qalita/_frontend/node_modules/next/dist/server/api-utils/get-cookie-parser.js +22 -0
  637. qalita/_frontend/node_modules/next/dist/server/api-utils/index.js +201 -0
  638. qalita/_frontend/node_modules/next/dist/server/api-utils/node/api-resolver.js +395 -0
  639. qalita/_frontend/node_modules/next/dist/server/api-utils/node/parse-body.js +79 -0
  640. qalita/_frontend/node_modules/next/dist/server/api-utils/node/try-get-preview-data.js +86 -0
  641. qalita/_frontend/node_modules/next/dist/server/api-utils/web.js +17 -0
  642. qalita/_frontend/node_modules/next/dist/server/app-render/action-async-storage-instance.js +14 -0
  643. qalita/_frontend/node_modules/next/dist/server/app-render/action-async-storage.external.js +13 -0
  644. qalita/_frontend/node_modules/next/dist/server/app-render/action-handler.js +916 -0
  645. qalita/_frontend/node_modules/next/dist/server/app-render/action-utils.js +90 -0
  646. qalita/_frontend/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js +14 -0
  647. qalita/_frontend/node_modules/next/dist/server/app-render/after-task-async-storage.external.js +13 -0
  648. qalita/_frontend/node_modules/next/dist/server/app-render/app-render-prerender-utils.js +228 -0
  649. qalita/_frontend/node_modules/next/dist/server/app-render/app-render-render-utils.js +91 -0
  650. qalita/_frontend/node_modules/next/dist/server/app-render/app-render.js +3470 -0
  651. qalita/_frontend/node_modules/next/dist/server/app-render/async-local-storage.js +76 -0
  652. qalita/_frontend/node_modules/next/dist/server/app-render/cache-signal.js +181 -0
  653. qalita/_frontend/node_modules/next/dist/server/app-render/collect-segment-data.js +270 -0
  654. qalita/_frontend/node_modules/next/dist/server/app-render/console-async-storage-instance.js +14 -0
  655. qalita/_frontend/node_modules/next/dist/server/app-render/console-async-storage.external.js +13 -0
  656. qalita/_frontend/node_modules/next/dist/server/app-render/create-component-styles-and-scripts.js +33 -0
  657. qalita/_frontend/node_modules/next/dist/server/app-render/create-component-tree.js +754 -0
  658. qalita/_frontend/node_modules/next/dist/server/app-render/create-error-handler.js +220 -0
  659. qalita/_frontend/node_modules/next/dist/server/app-render/create-flight-router-state-from-loader-tree.js +76 -0
  660. qalita/_frontend/node_modules/next/dist/server/app-render/csrf-protection.js +75 -0
  661. qalita/_frontend/node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js +14 -0
  662. qalita/_frontend/node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js +13 -0
  663. qalita/_frontend/node_modules/next/dist/server/app-render/dynamic-rendering.js +715 -0
  664. qalita/_frontend/node_modules/next/dist/server/app-render/encryption-utils-server.js +114 -0
  665. qalita/_frontend/node_modules/next/dist/server/app-render/encryption-utils.js +198 -0
  666. qalita/_frontend/node_modules/next/dist/server/app-render/encryption.js +237 -0
  667. qalita/_frontend/node_modules/next/dist/server/app-render/entry-base.js +237 -0
  668. qalita/_frontend/node_modules/next/dist/server/app-render/flight-render-result.js +27 -0
  669. qalita/_frontend/node_modules/next/dist/server/app-render/get-asset-query-string.js +29 -0
  670. qalita/_frontend/node_modules/next/dist/server/app-render/get-css-inlined-link-tags.js +48 -0
  671. qalita/_frontend/node_modules/next/dist/server/app-render/get-layer-assets.js +65 -0
  672. qalita/_frontend/node_modules/next/dist/server/app-render/get-preloadable-fonts.js +39 -0
  673. qalita/_frontend/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +44 -0
  674. qalita/_frontend/node_modules/next/dist/server/app-render/get-short-dynamic-param-type.js +25 -0
  675. qalita/_frontend/node_modules/next/dist/server/app-render/has-loading-component-in-tree.js +19 -0
  676. qalita/_frontend/node_modules/next/dist/server/app-render/interop-default.js +17 -0
  677. qalita/_frontend/node_modules/next/dist/server/app-render/make-get-server-inserted-html.js +92 -0
  678. qalita/_frontend/node_modules/next/dist/server/app-render/metadata-insertion/create-server-inserted-metadata.js +28 -0
  679. qalita/_frontend/node_modules/next/dist/server/app-render/module-loading/track-dynamic-import.js +57 -0
  680. qalita/_frontend/node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js +32 -0
  681. qalita/_frontend/node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js +66 -0
  682. qalita/_frontend/node_modules/next/dist/server/app-render/parse-and-validate-flight-router-state.js +49 -0
  683. qalita/_frontend/node_modules/next/dist/server/app-render/postponed-state.js +156 -0
  684. qalita/_frontend/node_modules/next/dist/server/app-render/prospective-render-utils.js +56 -0
  685. qalita/_frontend/node_modules/next/dist/server/app-render/react-large-shell-error.js +17 -0
  686. qalita/_frontend/node_modules/next/dist/server/app-render/react-server.node.js +39 -0
  687. qalita/_frontend/node_modules/next/dist/server/app-render/render-css-resource.js +52 -0
  688. qalita/_frontend/node_modules/next/dist/server/app-render/required-scripts.js +76 -0
  689. qalita/_frontend/node_modules/next/dist/server/app-render/rsc/postpone.js +18 -0
  690. qalita/_frontend/node_modules/next/dist/server/app-render/rsc/preloads.js +74 -0
  691. qalita/_frontend/node_modules/next/dist/server/app-render/rsc/taint.js +79 -0
  692. qalita/_frontend/node_modules/next/dist/server/app-render/segment-explorer-path.js +103 -0
  693. qalita/_frontend/node_modules/next/dist/server/app-render/server-inserted-html.js +77 -0
  694. qalita/_frontend/node_modules/next/dist/server/app-render/staged-rendering.js +127 -0
  695. qalita/_frontend/node_modules/next/dist/server/app-render/staged-validation.js +32 -0
  696. qalita/_frontend/node_modules/next/dist/server/app-render/strip-flight-headers.js +18 -0
  697. qalita/_frontend/node_modules/next/dist/server/app-render/types.js +59 -0
  698. qalita/_frontend/node_modules/next/dist/server/app-render/use-flight-response.js +165 -0
  699. qalita/_frontend/node_modules/next/dist/server/app-render/walk-tree-with-flight-router-state.js +185 -0
  700. qalita/_frontend/node_modules/next/dist/server/app-render/work-async-storage-instance.js +14 -0
  701. qalita/_frontend/node_modules/next/dist/server/app-render/work-async-storage.external.js +13 -0
  702. qalita/_frontend/node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js +14 -0
  703. qalita/_frontend/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js +252 -0
  704. qalita/_frontend/node_modules/next/dist/server/async-storage/draft-mode-provider.js +62 -0
  705. qalita/_frontend/node_modules/next/dist/server/async-storage/request-store.js +144 -0
  706. qalita/_frontend/node_modules/next/dist/server/async-storage/with-store.js +6 -0
  707. qalita/_frontend/node_modules/next/dist/server/async-storage/work-store.js +93 -0
  708. qalita/_frontend/node_modules/next/dist/server/base-http/helpers.js +36 -0
  709. qalita/_frontend/node_modules/next/dist/server/base-http/index.js +54 -0
  710. qalita/_frontend/node_modules/next/dist/server/base-http/node.js +147 -0
  711. qalita/_frontend/node_modules/next/dist/server/base-http/web.js +124 -0
  712. qalita/_frontend/node_modules/next/dist/server/base-server.js +1833 -0
  713. qalita/_frontend/node_modules/next/dist/server/body-streams.js +114 -0
  714. qalita/_frontend/node_modules/next/dist/server/cache-dir.js +26 -0
  715. qalita/_frontend/node_modules/next/dist/server/ci-info.js +41 -0
  716. qalita/_frontend/node_modules/next/dist/server/client-component-renderer-logger.js +70 -0
  717. qalita/_frontend/node_modules/next/dist/server/config-schema.js +623 -0
  718. qalita/_frontend/node_modules/next/dist/server/config-shared.js +224 -0
  719. qalita/_frontend/node_modules/next/dist/server/config-utils.js +185 -0
  720. qalita/_frontend/node_modules/next/dist/server/config.js +1461 -0
  721. qalita/_frontend/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js +96 -0
  722. qalita/_frontend/node_modules/next/dist/server/crypto-utils.js +70 -0
  723. qalita/_frontend/node_modules/next/dist/server/dev/browser-logs/file-logger.js +183 -0
  724. qalita/_frontend/node_modules/next/dist/server/dev/browser-logs/receive-logs.js +512 -0
  725. qalita/_frontend/node_modules/next/dist/server/dev/browser-logs/source-map.js +225 -0
  726. qalita/_frontend/node_modules/next/dist/server/dev/debug-channel.js +87 -0
  727. qalita/_frontend/node_modules/next/dist/server/dev/dev-indicator-server-state.js +15 -0
  728. qalita/_frontend/node_modules/next/dist/server/dev/get-source-map-from-file.js +100 -0
  729. qalita/_frontend/node_modules/next/dist/server/dev/hot-middleware.js +274 -0
  730. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-shared-utils.js +56 -0
  731. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +1235 -0
  732. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-types.js +57 -0
  733. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1377 -0
  734. qalita/_frontend/node_modules/next/dist/server/dev/log-requests.js +133 -0
  735. qalita/_frontend/node_modules/next/dist/server/dev/messages.js +64 -0
  736. qalita/_frontend/node_modules/next/dist/server/dev/middleware-turbopack.js +393 -0
  737. qalita/_frontend/node_modules/next/dist/server/dev/middleware-webpack.js +473 -0
  738. qalita/_frontend/node_modules/next/dist/server/dev/node-stack-frames.js +72 -0
  739. qalita/_frontend/node_modules/next/dist/server/dev/on-demand-entry-handler.js +704 -0
  740. qalita/_frontend/node_modules/next/dist/server/dev/parse-version-info.js +108 -0
  741. qalita/_frontend/node_modules/next/dist/server/dev/require-cache.js +49 -0
  742. qalita/_frontend/node_modules/next/dist/server/dev/static-paths-worker.js +93 -0
  743. qalita/_frontend/node_modules/next/dist/server/dev/turbopack-utils.js +696 -0
  744. qalita/_frontend/node_modules/next/dist/server/dynamic-rendering-utils.js +86 -0
  745. qalita/_frontend/node_modules/next/dist/server/font-utils.js +43 -0
  746. qalita/_frontend/node_modules/next/dist/server/get-app-route-from-entrypoint.js +30 -0
  747. qalita/_frontend/node_modules/next/dist/server/get-page-files.js +23 -0
  748. qalita/_frontend/node_modules/next/dist/server/get-route-from-entrypoint.js +35 -0
  749. qalita/_frontend/node_modules/next/dist/server/htmlescape.js +37 -0
  750. qalita/_frontend/node_modules/next/dist/server/image-optimizer.js +1067 -0
  751. qalita/_frontend/node_modules/next/dist/server/instrumentation/types.js +6 -0
  752. qalita/_frontend/node_modules/next/dist/server/instrumentation/utils.js +21 -0
  753. qalita/_frontend/node_modules/next/dist/server/internal-utils.js +39 -0
  754. qalita/_frontend/node_modules/next/dist/server/is-private-ip.js +36 -0
  755. qalita/_frontend/node_modules/next/dist/server/lib/app-dir-module.js +59 -0
  756. qalita/_frontend/node_modules/next/dist/server/lib/app-info-log.js +154 -0
  757. qalita/_frontend/node_modules/next/dist/server/lib/async-callback-set.js +29 -0
  758. qalita/_frontend/node_modules/next/dist/server/lib/cache-control.js +22 -0
  759. qalita/_frontend/node_modules/next/dist/server/lib/cache-handlers/default.external.js +18 -0
  760. qalita/_frontend/node_modules/next/dist/server/lib/cache-handlers/default.js +160 -0
  761. qalita/_frontend/node_modules/next/dist/server/lib/cache-handlers/types.js +8 -0
  762. qalita/_frontend/node_modules/next/dist/server/lib/chrome-devtools-workspace.js +116 -0
  763. qalita/_frontend/node_modules/next/dist/server/lib/clone-response.js +77 -0
  764. qalita/_frontend/node_modules/next/dist/server/lib/cpu-profile.js +28 -0
  765. qalita/_frontend/node_modules/next/dist/server/lib/decode-query-path-parameter.js +26 -0
  766. qalita/_frontend/node_modules/next/dist/server/lib/dedupe-fetch.js +163 -0
  767. qalita/_frontend/node_modules/next/dist/server/lib/dev-bundler-service.js +99 -0
  768. qalita/_frontend/node_modules/next/dist/server/lib/etag.js +56 -0
  769. qalita/_frontend/node_modules/next/dist/server/lib/experimental/create-env-definitions.js +48 -0
  770. qalita/_frontend/node_modules/next/dist/server/lib/experimental/ppr.js +47 -0
  771. qalita/_frontend/node_modules/next/dist/server/lib/find-page-file.js +127 -0
  772. qalita/_frontend/node_modules/next/dist/server/lib/fix-mojibake.js +25 -0
  773. qalita/_frontend/node_modules/next/dist/server/lib/format-hostname.js +16 -0
  774. qalita/_frontend/node_modules/next/dist/server/lib/i18n-provider.js +129 -0
  775. qalita/_frontend/node_modules/next/dist/server/lib/implicit-tags.js +77 -0
  776. qalita/_frontend/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +333 -0
  777. qalita/_frontend/node_modules/next/dist/server/lib/incremental-cache/index.js +479 -0
  778. qalita/_frontend/node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js +40 -0
  779. qalita/_frontend/node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js +73 -0
  780. qalita/_frontend/node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js +55 -0
  781. qalita/_frontend/node_modules/next/dist/server/lib/is-ipv6.js +41 -0
  782. qalita/_frontend/node_modules/next/dist/server/lib/lazy-result.js +46 -0
  783. qalita/_frontend/node_modules/next/dist/server/lib/lru-cache.js +177 -0
  784. qalita/_frontend/node_modules/next/dist/server/lib/match-next-data-pathname.js +18 -0
  785. qalita/_frontend/node_modules/next/dist/server/lib/mock-request.js +416 -0
  786. qalita/_frontend/node_modules/next/dist/server/lib/module-loader/module-loader.js +8 -0
  787. qalita/_frontend/node_modules/next/dist/server/lib/module-loader/node-module-loader.js +25 -0
  788. qalita/_frontend/node_modules/next/dist/server/lib/module-loader/route-module-loader.js +26 -0
  789. qalita/_frontend/node_modules/next/dist/server/lib/node-fs-methods.js +28 -0
  790. qalita/_frontend/node_modules/next/dist/server/lib/parse-stack.js +46 -0
  791. qalita/_frontend/node_modules/next/dist/server/lib/patch-fetch.js +945 -0
  792. qalita/_frontend/node_modules/next/dist/server/lib/patch-set-header.js +38 -0
  793. qalita/_frontend/node_modules/next/dist/server/lib/render-server.js +152 -0
  794. qalita/_frontend/node_modules/next/dist/server/lib/router-server.js +658 -0
  795. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/block-cross-site.js +76 -0
  796. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/build-data-route.js +48 -0
  797. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/build-prefetch-segment-data-route.js +71 -0
  798. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/cache-life-type-utils.js +211 -0
  799. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/decode-path-params.js +42 -0
  800. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/filesystem.js +595 -0
  801. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js +89 -0
  802. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js +96 -0
  803. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/is-postpone.js +16 -0
  804. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/proxy-request.js +118 -0
  805. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +604 -0
  806. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/route-types-utils.js +286 -0
  807. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/router-server-context.js +26 -0
  808. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/typegen.js +613 -0
  809. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/types.js +6 -0
  810. qalita/_frontend/node_modules/next/dist/server/lib/server-action-request-meta.js +53 -0
  811. qalita/_frontend/node_modules/next/dist/server/lib/server-ipc/utils.js +80 -0
  812. qalita/_frontend/node_modules/next/dist/server/lib/source-maps.js +196 -0
  813. qalita/_frontend/node_modules/next/dist/server/lib/start-server.js +460 -0
  814. qalita/_frontend/node_modules/next/dist/server/lib/streaming-metadata.js +38 -0
  815. qalita/_frontend/node_modules/next/dist/server/lib/to-route.js +37 -0
  816. qalita/_frontend/node_modules/next/dist/server/lib/trace/constants.js +203 -0
  817. qalita/_frontend/node_modules/next/dist/server/lib/trace/tracer.js +266 -0
  818. qalita/_frontend/node_modules/next/dist/server/lib/trace/utils.js +16 -0
  819. qalita/_frontend/node_modules/next/dist/server/lib/types.js +6 -0
  820. qalita/_frontend/node_modules/next/dist/server/lib/utils.js +249 -0
  821. qalita/_frontend/node_modules/next/dist/server/lib/worker-utils.js +36 -0
  822. qalita/_frontend/node_modules/next/dist/server/load-components.js +183 -0
  823. qalita/_frontend/node_modules/next/dist/server/load-default-error-components.js +41 -0
  824. qalita/_frontend/node_modules/next/dist/server/load-manifest.external.js +97 -0
  825. qalita/_frontend/node_modules/next/dist/server/match-bundle.js +25 -0
  826. qalita/_frontend/node_modules/next/dist/server/mcp/get-mcp-middleware.js +49 -0
  827. qalita/_frontend/node_modules/next/dist/server/mcp/get-or-create-mcp-server.js +41 -0
  828. qalita/_frontend/node_modules/next/dist/server/mcp/mcp-telemetry-tracker.js +82 -0
  829. qalita/_frontend/node_modules/next/dist/server/mcp/tools/get-errors.js +107 -0
  830. qalita/_frontend/node_modules/next/dist/server/mcp/tools/get-logs.js +61 -0
  831. qalita/_frontend/node_modules/next/dist/server/mcp/tools/get-page-metadata.js +180 -0
  832. qalita/_frontend/node_modules/next/dist/server/mcp/tools/get-project-metadata.js +55 -0
  833. qalita/_frontend/node_modules/next/dist/server/mcp/tools/get-routes.js +171 -0
  834. qalita/_frontend/node_modules/next/dist/server/mcp/tools/get-server-action-by-id.js +113 -0
  835. qalita/_frontend/node_modules/next/dist/server/mcp/tools/next-instance-error-state.js +31 -0
  836. qalita/_frontend/node_modules/next/dist/server/mcp/tools/utils/browser-communication.js +90 -0
  837. qalita/_frontend/node_modules/next/dist/server/mcp/tools/utils/format-errors.js +147 -0
  838. qalita/_frontend/node_modules/next/dist/server/next-server.js +1458 -0
  839. qalita/_frontend/node_modules/next/dist/server/next-typescript.js +13 -0
  840. qalita/_frontend/node_modules/next/dist/server/next.js +452 -0
  841. qalita/_frontend/node_modules/next/dist/server/node-environment-baseline.js +25 -0
  842. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/console-dim.external.js +246 -0
  843. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/console-exit.js +49 -0
  844. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/console-file.js +56 -0
  845. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/date.js +52 -0
  846. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/error-inspect.js +8 -0
  847. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/global-behaviors.js +33 -0
  848. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/node-crypto.js +103 -0
  849. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/random.js +28 -0
  850. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.js +489 -0
  851. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/utils.js +129 -0
  852. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/web-crypto.js +45 -0
  853. qalita/_frontend/node_modules/next/dist/server/node-environment.js +18 -0
  854. qalita/_frontend/node_modules/next/dist/server/node-polyfill-crypto.js +21 -0
  855. qalita/_frontend/node_modules/next/dist/server/normalizers/absolute-filename-normalizer.js +33 -0
  856. qalita/_frontend/node_modules/next/dist/server/normalizers/built/app/app-bundle-path-normalizer.js +54 -0
  857. qalita/_frontend/node_modules/next/dist/server/normalizers/built/app/app-filename-normalizer.js +22 -0
  858. qalita/_frontend/node_modules/next/dist/server/normalizers/built/app/app-page-normalizer.js +40 -0
  859. qalita/_frontend/node_modules/next/dist/server/normalizers/built/app/app-pathname-normalizer.js +55 -0
  860. qalita/_frontend/node_modules/next/dist/server/normalizers/built/app/index.js +42 -0
  861. qalita/_frontend/node_modules/next/dist/server/normalizers/built/pages/index.js +44 -0
  862. qalita/_frontend/node_modules/next/dist/server/normalizers/built/pages/pages-bundle-path-normalizer.js +55 -0
  863. qalita/_frontend/node_modules/next/dist/server/normalizers/built/pages/pages-filename-normalizer.js +22 -0
  864. qalita/_frontend/node_modules/next/dist/server/normalizers/built/pages/pages-page-normalizer.js +19 -0
  865. qalita/_frontend/node_modules/next/dist/server/normalizers/built/pages/pages-pathname-normalizer.js +19 -0
  866. qalita/_frontend/node_modules/next/dist/server/normalizers/locale-route-normalizer.js +26 -0
  867. qalita/_frontend/node_modules/next/dist/server/normalizers/normalizer.js +6 -0
  868. qalita/_frontend/node_modules/next/dist/server/normalizers/normalizers.js +23 -0
  869. qalita/_frontend/node_modules/next/dist/server/normalizers/prefixing-normalizer.js +26 -0
  870. qalita/_frontend/node_modules/next/dist/server/normalizers/request/base-path.js +25 -0
  871. qalita/_frontend/node_modules/next/dist/server/normalizers/request/next-data.js +38 -0
  872. qalita/_frontend/node_modules/next/dist/server/normalizers/request/pathname-normalizer.js +6 -0
  873. qalita/_frontend/node_modules/next/dist/server/normalizers/request/prefetch-rsc.js +31 -0
  874. qalita/_frontend/node_modules/next/dist/server/normalizers/request/prefix.js +39 -0
  875. qalita/_frontend/node_modules/next/dist/server/normalizers/request/rsc.js +19 -0
  876. qalita/_frontend/node_modules/next/dist/server/normalizers/request/segment-prefix-rsc.js +32 -0
  877. qalita/_frontend/node_modules/next/dist/server/normalizers/request/suffix.js +27 -0
  878. qalita/_frontend/node_modules/next/dist/server/normalizers/underscore-normalizer.js +17 -0
  879. qalita/_frontend/node_modules/next/dist/server/normalizers/wrap-normalizer-fn.js +17 -0
  880. qalita/_frontend/node_modules/next/dist/server/og/image-response.js +53 -0
  881. qalita/_frontend/node_modules/next/dist/server/patch-error-inspect.js +433 -0
  882. qalita/_frontend/node_modules/next/dist/server/pipe-readable.js +140 -0
  883. qalita/_frontend/node_modules/next/dist/server/post-process.js +39 -0
  884. qalita/_frontend/node_modules/next/dist/server/render-result.js +195 -0
  885. qalita/_frontend/node_modules/next/dist/server/render.js +1138 -0
  886. qalita/_frontend/node_modules/next/dist/server/request/connection.js +111 -0
  887. qalita/_frontend/node_modules/next/dist/server/request/cookies.js +220 -0
  888. qalita/_frontend/node_modules/next/dist/server/request/draft-mode.js +207 -0
  889. qalita/_frontend/node_modules/next/dist/server/request/fallback-params.js +112 -0
  890. qalita/_frontend/node_modules/next/dist/server/request/headers.js +219 -0
  891. qalita/_frontend/node_modules/next/dist/server/request/params.js +415 -0
  892. qalita/_frontend/node_modules/next/dist/server/request/pathname.js +104 -0
  893. qalita/_frontend/node_modules/next/dist/server/request/root-params.js +157 -0
  894. qalita/_frontend/node_modules/next/dist/server/request/search-params.js +432 -0
  895. qalita/_frontend/node_modules/next/dist/server/request/utils.js +51 -0
  896. qalita/_frontend/node_modules/next/dist/server/request-meta.js +55 -0
  897. qalita/_frontend/node_modules/next/dist/server/require-hook.js +71 -0
  898. qalita/_frontend/node_modules/next/dist/server/require.js +109 -0
  899. qalita/_frontend/node_modules/next/dist/server/response-cache/index.js +211 -0
  900. qalita/_frontend/node_modules/next/dist/server/response-cache/types.js +41 -0
  901. qalita/_frontend/node_modules/next/dist/server/response-cache/utils.js +103 -0
  902. qalita/_frontend/node_modules/next/dist/server/response-cache/web.js +101 -0
  903. qalita/_frontend/node_modules/next/dist/server/resume-data-cache/cache-store.js +84 -0
  904. qalita/_frontend/node_modules/next/dist/server/resume-data-cache/resume-data-cache.js +96 -0
  905. qalita/_frontend/node_modules/next/dist/server/revalidation-utils.js +152 -0
  906. qalita/_frontend/node_modules/next/dist/server/route-definitions/app-page-route-definition.js +16 -0
  907. qalita/_frontend/node_modules/next/dist/server/route-definitions/app-route-route-definition.js +6 -0
  908. qalita/_frontend/node_modules/next/dist/server/route-definitions/locale-route-definition.js +6 -0
  909. qalita/_frontend/node_modules/next/dist/server/route-definitions/pages-api-route-definition.js +6 -0
  910. qalita/_frontend/node_modules/next/dist/server/route-definitions/pages-route-definition.js +6 -0
  911. qalita/_frontend/node_modules/next/dist/server/route-definitions/route-definition.js +6 -0
  912. qalita/_frontend/node_modules/next/dist/server/route-kind.js +32 -0
  913. qalita/_frontend/node_modules/next/dist/server/route-matcher-managers/default-route-matcher-manager.js +239 -0
  914. qalita/_frontend/node_modules/next/dist/server/route-matcher-managers/dev-route-matcher-manager.js +120 -0
  915. qalita/_frontend/node_modules/next/dist/server/route-matcher-managers/route-matcher-manager.js +6 -0
  916. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/app-page-route-matcher-provider.js +55 -0
  917. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/app-route-route-matcher-provider.js +43 -0
  918. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/dev/dev-app-page-route-matcher-provider.js +90 -0
  919. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/dev/dev-app-route-route-matcher-provider.js +112 -0
  920. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/dev/dev-pages-api-route-matcher-provider.js +77 -0
  921. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/dev/dev-pages-route-matcher-provider.js +77 -0
  922. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/dev/file-cache-route-matcher-provider.js +28 -0
  923. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/batched-file-reader.js +106 -0
  924. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/default-file-reader.js +42 -0
  925. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/file-reader.js +6 -0
  926. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/helpers/cached-route-matcher-provider.js +30 -0
  927. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/manifest-loader.js +6 -0
  928. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/node-manifest-loader.js +34 -0
  929. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/server-manifest-loader.js +20 -0
  930. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/manifest-route-matcher-provider.js +21 -0
  931. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/pages-api-route-matcher-provider.js +55 -0
  932. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/pages-route-matcher-provider.js +64 -0
  933. qalita/_frontend/node_modules/next/dist/server/route-matcher-providers/route-matcher-provider.js +6 -0
  934. qalita/_frontend/node_modules/next/dist/server/route-matchers/app-page-route-matcher.js +18 -0
  935. qalita/_frontend/node_modules/next/dist/server/route-matchers/app-route-route-matcher.js +15 -0
  936. qalita/_frontend/node_modules/next/dist/server/route-matchers/locale-route-matcher.js +68 -0
  937. qalita/_frontend/node_modules/next/dist/server/route-matchers/pages-api-route-matcher.js +30 -0
  938. qalita/_frontend/node_modules/next/dist/server/route-matchers/pages-route-matcher.js +30 -0
  939. qalita/_frontend/node_modules/next/dist/server/route-matchers/route-matcher.js +54 -0
  940. qalita/_frontend/node_modules/next/dist/server/route-matches/app-page-route-match.js +6 -0
  941. qalita/_frontend/node_modules/next/dist/server/route-matches/app-route-route-match.js +6 -0
  942. qalita/_frontend/node_modules/next/dist/server/route-matches/locale-route-match.js +6 -0
  943. qalita/_frontend/node_modules/next/dist/server/route-matches/pages-api-route-match.js +16 -0
  944. qalita/_frontend/node_modules/next/dist/server/route-matches/pages-route-match.js +6 -0
  945. qalita/_frontend/node_modules/next/dist/server/route-matches/route-match.js +6 -0
  946. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/helpers/prerender-manifest-matcher.js +48 -0
  947. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/module.compiled.js +36 -0
  948. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/module.js +132 -0
  949. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/module.render.js +24 -0
  950. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/app-router-context.js +4 -0
  951. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/entrypoints.js +87 -0
  952. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/head-manager-context.js +4 -0
  953. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/hooks-client-context.js +4 -0
  954. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/image-config-context.js +4 -0
  955. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/router-context.js +4 -0
  956. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/server-inserted-html.js +4 -0
  957. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/entrypoints.js +140 -0
  958. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtime.js +4 -0
  959. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-dom.js +4 -0
  960. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime.js +4 -0
  961. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js +4 -0
  962. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-server.js +4 -0
  963. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-static.js +4 -0
  964. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server.js +4 -0
  965. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-static.js +4 -0
  966. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react.js +4 -0
  967. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/entrypoints.js +125 -0
  968. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime.js +4 -0
  969. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom-server.js +4 -0
  970. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom.js +4 -0
  971. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime.js +4 -0
  972. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js +4 -0
  973. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.js +4 -0
  974. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client.js +4 -0
  975. qalita/_frontend/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js +4 -0
  976. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/helpers/auto-implement-methods.js +85 -0
  977. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/helpers/clean-url.js +24 -0
  978. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js +29 -0
  979. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/helpers/is-static-gen-enabled.js +15 -0
  980. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/helpers/parsed-url-query-to-params.js +20 -0
  981. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/module.compiled.js +36 -0
  982. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/module.js +889 -0
  983. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/shared-modules.js +56 -0
  984. qalita/_frontend/node_modules/next/dist/server/route-modules/checks.js +45 -0
  985. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/builtin/_error.js +100 -0
  986. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/module.compiled.js +20 -0
  987. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/module.js +92 -0
  988. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/module.render.js +24 -0
  989. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/pages-handler.js +519 -0
  990. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/app-router-context.js +4 -0
  991. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/entrypoints.js +102 -0
  992. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/head-manager-context.js +4 -0
  993. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/hooks-client-context.js +4 -0
  994. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/html-context.js +4 -0
  995. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/image-config-context.js +4 -0
  996. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable-context.js +4 -0
  997. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable.js +4 -0
  998. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/router-context.js +4 -0
  999. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/vendored/contexts/server-inserted-html.js +4 -0
  1000. qalita/_frontend/node_modules/next/dist/server/route-modules/pages-api/module.compiled.js +20 -0
  1001. qalita/_frontend/node_modules/next/dist/server/route-modules/pages-api/module.js +58 -0
  1002. qalita/_frontend/node_modules/next/dist/server/route-modules/route-module.js +533 -0
  1003. qalita/_frontend/node_modules/next/dist/server/runtime-reacts.external.js +46 -0
  1004. qalita/_frontend/node_modules/next/dist/server/send-payload.js +88 -0
  1005. qalita/_frontend/node_modules/next/dist/server/send-response.js +70 -0
  1006. qalita/_frontend/node_modules/next/dist/server/serve-static.js +66 -0
  1007. qalita/_frontend/node_modules/next/dist/server/server-route-utils.js +30 -0
  1008. qalita/_frontend/node_modules/next/dist/server/server-utils.js +323 -0
  1009. qalita/_frontend/node_modules/next/dist/server/setup-http-agent-env.js +31 -0
  1010. qalita/_frontend/node_modules/next/dist/server/stream-utils/encoded-tags.js +114 -0
  1011. qalita/_frontend/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +713 -0
  1012. qalita/_frontend/node_modules/next/dist/server/stream-utils/uint8array-helpers.js +69 -0
  1013. qalita/_frontend/node_modules/next/dist/server/typescript/constant.js +97 -0
  1014. qalita/_frontend/node_modules/next/dist/server/typescript/index.js +199 -0
  1015. qalita/_frontend/node_modules/next/dist/server/typescript/rules/client-boundary.js +97 -0
  1016. qalita/_frontend/node_modules/next/dist/server/typescript/rules/config.js +457 -0
  1017. qalita/_frontend/node_modules/next/dist/server/typescript/rules/entry.js +149 -0
  1018. qalita/_frontend/node_modules/next/dist/server/typescript/rules/error.js +38 -0
  1019. qalita/_frontend/node_modules/next/dist/server/typescript/rules/metadata.js +234 -0
  1020. qalita/_frontend/node_modules/next/dist/server/typescript/rules/server-boundary.js +115 -0
  1021. qalita/_frontend/node_modules/next/dist/server/typescript/rules/server.js +79 -0
  1022. qalita/_frontend/node_modules/next/dist/server/typescript/utils.js +212 -0
  1023. qalita/_frontend/node_modules/next/dist/server/use-cache/cache-life.js +161 -0
  1024. qalita/_frontend/node_modules/next/dist/server/use-cache/cache-tag.js +50 -0
  1025. qalita/_frontend/node_modules/next/dist/server/use-cache/constants.js +28 -0
  1026. qalita/_frontend/node_modules/next/dist/server/use-cache/handlers.js +121 -0
  1027. qalita/_frontend/node_modules/next/dist/server/use-cache/use-cache-errors.js +36 -0
  1028. qalita/_frontend/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1291 -0
  1029. qalita/_frontend/node_modules/next/dist/server/utils.js +73 -0
  1030. qalita/_frontend/node_modules/next/dist/server/web/adapter.js +388 -0
  1031. qalita/_frontend/node_modules/next/dist/server/web/edge-route-module-wrapper.js +120 -0
  1032. qalita/_frontend/node_modules/next/dist/server/web/error.js +54 -0
  1033. qalita/_frontend/node_modules/next/dist/server/web/exports/index.js +56 -0
  1034. qalita/_frontend/node_modules/next/dist/server/web/get-edge-preview-props.js +23 -0
  1035. qalita/_frontend/node_modules/next/dist/server/web/globals.js +128 -0
  1036. qalita/_frontend/node_modules/next/dist/server/web/http.js +39 -0
  1037. qalita/_frontend/node_modules/next/dist/server/web/internal-edge-wait-until.js +64 -0
  1038. qalita/_frontend/node_modules/next/dist/server/web/next-url.js +195 -0
  1039. qalita/_frontend/node_modules/next/dist/server/web/sandbox/context.js +463 -0
  1040. qalita/_frontend/node_modules/next/dist/server/web/sandbox/fetch-inline-assets.js +35 -0
  1041. qalita/_frontend/node_modules/next/dist/server/web/sandbox/index.js +28 -0
  1042. qalita/_frontend/node_modules/next/dist/server/web/sandbox/resource-managers.js +88 -0
  1043. qalita/_frontend/node_modules/next/dist/server/web/sandbox/sandbox.js +134 -0
  1044. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/adapters/headers.js +192 -0
  1045. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/adapters/next-request.js +142 -0
  1046. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js +30 -0
  1047. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +210 -0
  1048. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/cookies.js +29 -0
  1049. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/fetch-event.js +98 -0
  1050. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/image-response.js +22 -0
  1051. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/request.js +99 -0
  1052. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/response.js +136 -0
  1053. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/revalidate.js +202 -0
  1054. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/unstable-cache.js +284 -0
  1055. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/unstable-no-store.js +49 -0
  1056. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/url-pattern.js +14 -0
  1057. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/user-agent.js +46 -0
  1058. qalita/_frontend/node_modules/next/dist/server/web/types.js +6 -0
  1059. qalita/_frontend/node_modules/next/dist/server/web/utils.js +151 -0
  1060. qalita/_frontend/node_modules/next/dist/server/web/web-on-close.js +87 -0
  1061. qalita/_frontend/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js +50 -0
  1062. qalita/_frontend/node_modules/next/dist/shared/lib/app-router-types.js +27 -0
  1063. qalita/_frontend/node_modules/next/dist/shared/lib/constants.js +443 -0
  1064. qalita/_frontend/node_modules/next/dist/shared/lib/deep-freeze.js +30 -0
  1065. qalita/_frontend/node_modules/next/dist/shared/lib/dset.js +34 -0
  1066. qalita/_frontend/node_modules/next/dist/shared/lib/encode-uri-path.js +15 -0
  1067. qalita/_frontend/node_modules/next/dist/shared/lib/entry-constants.js +36 -0
  1068. qalita/_frontend/node_modules/next/dist/shared/lib/error-source.js +36 -0
  1069. qalita/_frontend/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +39 -0
  1070. qalita/_frontend/node_modules/next/dist/shared/lib/errors/constants.js +19 -0
  1071. qalita/_frontend/node_modules/next/dist/shared/lib/errors/empty-generate-static-params-error.js +24 -0
  1072. qalita/_frontend/node_modules/next/dist/shared/lib/errors/hard-deprecated-config-error.js +20 -0
  1073. qalita/_frontend/node_modules/next/dist/shared/lib/escape-regexp.js +22 -0
  1074. qalita/_frontend/node_modules/next/dist/shared/lib/get-hostname.js +23 -0
  1075. qalita/_frontend/node_modules/next/dist/shared/lib/hash.js +42 -0
  1076. qalita/_frontend/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +18 -0
  1077. qalita/_frontend/node_modules/next/dist/shared/lib/head.js +163 -0
  1078. qalita/_frontend/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js +55 -0
  1079. qalita/_frontend/node_modules/next/dist/shared/lib/html-context.shared-runtime.js +40 -0
  1080. qalita/_frontend/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +25 -0
  1081. qalita/_frontend/node_modules/next/dist/shared/lib/i18n/get-locale-redirect.js +59 -0
  1082. qalita/_frontend/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +54 -0
  1083. qalita/_frontend/node_modules/next/dist/shared/lib/image-blur-svg.js +22 -0
  1084. qalita/_frontend/node_modules/next/dist/shared/lib/image-config-context.shared-runtime.js +19 -0
  1085. qalita/_frontend/node_modules/next/dist/shared/lib/image-config.js +74 -0
  1086. qalita/_frontend/node_modules/next/dist/shared/lib/invariant-error.js +18 -0
  1087. qalita/_frontend/node_modules/next/dist/shared/lib/is-internal.js +39 -0
  1088. qalita/_frontend/node_modules/next/dist/shared/lib/is-plain-object.js +42 -0
  1089. qalita/_frontend/node_modules/next/dist/shared/lib/is-thenable.js +20 -0
  1090. qalita/_frontend/node_modules/next/dist/shared/lib/isomorphic/path.js +14 -0
  1091. qalita/_frontend/node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js +37 -0
  1092. qalita/_frontend/node_modules/next/dist/shared/lib/loadable-context.shared-runtime.js +19 -0
  1093. qalita/_frontend/node_modules/next/dist/shared/lib/loadable.shared-runtime.js +246 -0
  1094. qalita/_frontend/node_modules/next/dist/shared/lib/magic-identifier.js +218 -0
  1095. qalita/_frontend/node_modules/next/dist/shared/lib/match-local-pattern.js +46 -0
  1096. qalita/_frontend/node_modules/next/dist/shared/lib/match-remote-pattern.js +63 -0
  1097. qalita/_frontend/node_modules/next/dist/shared/lib/modern-browserslist-target.js +15 -0
  1098. qalita/_frontend/node_modules/next/dist/shared/lib/no-fallback-error.external.js +18 -0
  1099. qalita/_frontend/node_modules/next/dist/shared/lib/normalized-asset-prefix.js +28 -0
  1100. qalita/_frontend/node_modules/next/dist/shared/lib/page-path/absolute-path-to-page.js +26 -0
  1101. qalita/_frontend/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js +18 -0
  1102. qalita/_frontend/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +18 -0
  1103. qalita/_frontend/node_modules/next/dist/shared/lib/page-path/get-page-paths.js +40 -0
  1104. qalita/_frontend/node_modules/next/dist/shared/lib/page-path/normalize-data-path.js +23 -0
  1105. qalita/_frontend/node_modules/next/dist/shared/lib/page-path/normalize-page-path.js +26 -0
  1106. qalita/_frontend/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js +19 -0
  1107. qalita/_frontend/node_modules/next/dist/shared/lib/page-path/remove-page-path-tail.js +20 -0
  1108. qalita/_frontend/node_modules/next/dist/shared/lib/promise-with-resolvers.js +26 -0
  1109. qalita/_frontend/node_modules/next/dist/shared/lib/router/adapters.js +136 -0
  1110. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/add-locale.js +28 -0
  1111. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +20 -0
  1112. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js +20 -0
  1113. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/app-paths.js +51 -0
  1114. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/as-path-to-search-params.js +17 -0
  1115. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js +24 -0
  1116. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js +16 -0
  1117. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js +27 -0
  1118. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/format-url.js +111 -0
  1119. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +196 -0
  1120. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js +52 -0
  1121. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-route-from-asset-path.js +25 -0
  1122. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +90 -0
  1123. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/html-bots.js +17 -0
  1124. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/index.js +30 -0
  1125. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +108 -0
  1126. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/is-bot.js +57 -0
  1127. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +26 -0
  1128. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/middleware-route-matcher.js +31 -0
  1129. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +29 -0
  1130. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/parse-path.js +33 -0
  1131. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js +36 -0
  1132. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/parse-url.js +32 -0
  1133. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +20 -0
  1134. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/path-match.js +49 -0
  1135. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +292 -0
  1136. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/querystring.js +79 -0
  1137. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/relativize-url.js +40 -0
  1138. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js +39 -0
  1139. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +21 -0
  1140. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +113 -0
  1141. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +45 -0
  1142. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/route-regex.js +256 -0
  1143. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +244 -0
  1144. qalita/_frontend/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +18 -0
  1145. qalita/_frontend/node_modules/next/dist/shared/lib/segment-cache/output-export-prefetch-encoding.js +73 -0
  1146. qalita/_frontend/node_modules/next/dist/shared/lib/segment-cache/segment-value-encoding.js +99 -0
  1147. qalita/_frontend/node_modules/next/dist/shared/lib/segment.js +97 -0
  1148. qalita/_frontend/node_modules/next/dist/shared/lib/server-inserted-html.shared-runtime.js +35 -0
  1149. qalita/_frontend/node_modules/next/dist/shared/lib/server-reference-info.js +52 -0
  1150. qalita/_frontend/node_modules/next/dist/shared/lib/side-effect.js +63 -0
  1151. qalita/_frontend/node_modules/next/dist/shared/lib/turbopack/internal-error.js +53 -0
  1152. qalita/_frontend/node_modules/next/dist/shared/lib/turbopack/utils.js +278 -0
  1153. qalita/_frontend/node_modules/next/dist/shared/lib/utils/warn-once.js +22 -0
  1154. qalita/_frontend/node_modules/next/dist/shared/lib/utils.js +207 -0
  1155. qalita/_frontend/node_modules/next/dist/shared/lib/zod.js +101 -0
  1156. qalita/_frontend/node_modules/next/dist/telemetry/anonymous-meta.js +89 -0
  1157. qalita/_frontend/node_modules/next/dist/telemetry/detached-flush.js +56 -0
  1158. qalita/_frontend/node_modules/next/dist/telemetry/events/build.js +163 -0
  1159. qalita/_frontend/node_modules/next/dist/telemetry/events/index.js +41 -0
  1160. qalita/_frontend/node_modules/next/dist/telemetry/events/plugins.js +51 -0
  1161. qalita/_frontend/node_modules/next/dist/telemetry/events/swc-load-failure.js +55 -0
  1162. qalita/_frontend/node_modules/next/dist/telemetry/events/version.js +66 -0
  1163. qalita/_frontend/node_modules/next/dist/telemetry/flush-telemetry.js +19 -0
  1164. qalita/_frontend/node_modules/next/dist/telemetry/post-telemetry-payload.js +48 -0
  1165. qalita/_frontend/node_modules/next/dist/telemetry/project-id.js +48 -0
  1166. qalita/_frontend/node_modules/next/dist/telemetry/storage.js +301 -0
  1167. qalita/_frontend/node_modules/next/dist/trace/index.js +54 -0
  1168. qalita/_frontend/node_modules/next/dist/trace/report/index.js +37 -0
  1169. qalita/_frontend/node_modules/next/dist/trace/report/to-json-build.js +137 -0
  1170. qalita/_frontend/node_modules/next/dist/trace/report/to-json.js +151 -0
  1171. qalita/_frontend/node_modules/next/dist/trace/report/to-telemetry.js +36 -0
  1172. qalita/_frontend/node_modules/next/dist/trace/shared.js +39 -0
  1173. qalita/_frontend/node_modules/next/dist/trace/trace.js +197 -0
  1174. qalita/_frontend/node_modules/next/package.json +378 -0
  1175. qalita/_frontend/node_modules/react/cjs/react-compiler-runtime.production.js +16 -0
  1176. qalita/_frontend/node_modules/react/cjs/react-jsx-dev-runtime.production.js +14 -0
  1177. qalita/_frontend/node_modules/react/cjs/react-jsx-runtime.production.js +34 -0
  1178. qalita/_frontend/node_modules/react/cjs/react.production.js +542 -0
  1179. qalita/_frontend/node_modules/react/compiler-runtime.js +14 -0
  1180. qalita/_frontend/node_modules/react/index.js +7 -0
  1181. qalita/_frontend/node_modules/react/jsx-dev-runtime.js +7 -0
  1182. qalita/_frontend/node_modules/react/jsx-runtime.js +7 -0
  1183. qalita/_frontend/node_modules/react/package.json +51 -0
  1184. qalita/_frontend/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +6603 -0
  1185. qalita/_frontend/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +6692 -0
  1186. qalita/_frontend/node_modules/react-dom/cjs/react-dom-server.browser.production.js +7410 -0
  1187. qalita/_frontend/node_modules/react-dom/cjs/react-dom-server.edge.production.js +7512 -0
  1188. qalita/_frontend/node_modules/react-dom/cjs/react-dom-server.node.production.js +7707 -0
  1189. qalita/_frontend/node_modules/react-dom/cjs/react-dom.production.js +210 -0
  1190. qalita/_frontend/node_modules/react-dom/index.js +38 -0
  1191. qalita/_frontend/node_modules/react-dom/package.json +117 -0
  1192. qalita/_frontend/node_modules/react-dom/server.browser.js +16 -0
  1193. qalita/_frontend/node_modules/react-dom/server.edge.js +17 -0
  1194. qalita/_frontend/node_modules/react-dom/server.node.js +18 -0
  1195. qalita/_frontend/node_modules/react-dom/static.node.js +14 -0
  1196. qalita/_frontend/node_modules/semver/classes/comparator.js +143 -0
  1197. qalita/_frontend/node_modules/semver/classes/range.js +557 -0
  1198. qalita/_frontend/node_modules/semver/classes/semver.js +333 -0
  1199. qalita/_frontend/node_modules/semver/functions/cmp.js +54 -0
  1200. qalita/_frontend/node_modules/semver/functions/coerce.js +62 -0
  1201. qalita/_frontend/node_modules/semver/functions/compare.js +7 -0
  1202. qalita/_frontend/node_modules/semver/functions/eq.js +5 -0
  1203. qalita/_frontend/node_modules/semver/functions/gt.js +5 -0
  1204. qalita/_frontend/node_modules/semver/functions/gte.js +5 -0
  1205. qalita/_frontend/node_modules/semver/functions/lt.js +5 -0
  1206. qalita/_frontend/node_modules/semver/functions/lte.js +5 -0
  1207. qalita/_frontend/node_modules/semver/functions/neq.js +5 -0
  1208. qalita/_frontend/node_modules/semver/functions/parse.js +18 -0
  1209. qalita/_frontend/node_modules/semver/functions/satisfies.js +12 -0
  1210. qalita/_frontend/node_modules/semver/internal/constants.js +37 -0
  1211. qalita/_frontend/node_modules/semver/internal/debug.js +11 -0
  1212. qalita/_frontend/node_modules/semver/internal/identifiers.js +29 -0
  1213. qalita/_frontend/node_modules/semver/internal/lrucache.js +42 -0
  1214. qalita/_frontend/node_modules/semver/internal/parse-options.js +17 -0
  1215. qalita/_frontend/node_modules/semver/internal/re.js +223 -0
  1216. qalita/_frontend/node_modules/semver/package.json +78 -0
  1217. qalita/_frontend/node_modules/sharp/lib/channel.js +177 -0
  1218. qalita/_frontend/node_modules/sharp/lib/colour.js +195 -0
  1219. qalita/_frontend/node_modules/sharp/lib/composite.js +212 -0
  1220. qalita/_frontend/node_modules/sharp/lib/constructor.js +499 -0
  1221. qalita/_frontend/node_modules/sharp/lib/index.js +16 -0
  1222. qalita/_frontend/node_modules/sharp/lib/input.js +809 -0
  1223. qalita/_frontend/node_modules/sharp/lib/is.js +143 -0
  1224. qalita/_frontend/node_modules/sharp/lib/libvips.js +207 -0
  1225. qalita/_frontend/node_modules/sharp/lib/operation.js +1016 -0
  1226. qalita/_frontend/node_modules/sharp/lib/output.js +1666 -0
  1227. qalita/_frontend/node_modules/sharp/lib/resize.js +595 -0
  1228. qalita/_frontend/node_modules/sharp/lib/sharp.js +121 -0
  1229. qalita/_frontend/node_modules/sharp/lib/utility.js +291 -0
  1230. qalita/_frontend/node_modules/sharp/package.json +202 -0
  1231. qalita/_frontend/node_modules/styled-jsx/dist/index/index.js +499 -0
  1232. qalita/_frontend/node_modules/styled-jsx/index.js +1 -0
  1233. qalita/_frontend/node_modules/styled-jsx/package.json +132 -0
  1234. qalita/_frontend/node_modules/styled-jsx/style.js +1 -0
  1235. qalita/_frontend/node_modules/typescript/lib/_tsc.js +133818 -0
  1236. qalita/_frontend/node_modules/typescript/lib/_tsserver.js +659 -0
  1237. qalita/_frontend/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  1238. qalita/_frontend/node_modules/typescript/lib/tsc.js +8 -0
  1239. qalita/_frontend/node_modules/typescript/lib/tsserver.js +8 -0
  1240. qalita/_frontend/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  1241. qalita/_frontend/node_modules/typescript/lib/typescript.js +200276 -0
  1242. qalita/_frontend/node_modules/typescript/lib/typingsInstaller.js +8 -0
  1243. qalita/_frontend/node_modules/typescript/lib/watchGuard.js +53 -0
  1244. qalita/_frontend/node_modules/typescript/package.json +120 -0
  1245. qalita/_frontend/package.json +28 -0
  1246. qalita/_frontend/public/chatgpt.svg +3 -0
  1247. qalita/_frontend/public/claude.png +0 -0
  1248. qalita/_frontend/public/favicon.ico +0 -0
  1249. qalita/_frontend/public/gemini.png +0 -0
  1250. qalita/_frontend/public/logo-no-slogan.png +0 -0
  1251. qalita/_frontend/public/logo-white-no-slogan.svg +11 -0
  1252. qalita/_frontend/public/mistral.svg +1 -0
  1253. qalita/_frontend/public/noise.webp +0 -0
  1254. qalita/_frontend/public/ollama.png +0 -0
  1255. qalita/_frontend/public/platform.png +0 -0
  1256. qalita/_frontend/public/sources-logos/alloy-db.png +0 -0
  1257. qalita/_frontend/public/sources-logos/amazon-athena.png +0 -0
  1258. qalita/_frontend/public/sources-logos/amazon-rds.png +0 -0
  1259. qalita/_frontend/public/sources-logos/api.svg +2 -0
  1260. qalita/_frontend/public/sources-logos/avro.svg +20 -0
  1261. qalita/_frontend/public/sources-logos/azure-database-mysql.png +0 -0
  1262. qalita/_frontend/public/sources-logos/azure-database-postgresql.png +0 -0
  1263. qalita/_frontend/public/sources-logos/azure-sql-database.png +0 -0
  1264. qalita/_frontend/public/sources-logos/azure-sql-managed-instance.png +0 -0
  1265. qalita/_frontend/public/sources-logos/azure-synapse-analytics.png +0 -0
  1266. qalita/_frontend/public/sources-logos/azure_blob.svg +1 -0
  1267. qalita/_frontend/public/sources-logos/bigquery.png +0 -0
  1268. qalita/_frontend/public/sources-logos/cassandra.svg +254 -0
  1269. qalita/_frontend/public/sources-logos/clickhouse.png +0 -0
  1270. qalita/_frontend/public/sources-logos/cloud-sql.png +0 -0
  1271. qalita/_frontend/public/sources-logos/cockroach-db.png +0 -0
  1272. qalita/_frontend/public/sources-logos/csv.svg +1 -0
  1273. qalita/_frontend/public/sources-logos/database.svg +3 -0
  1274. qalita/_frontend/public/sources-logos/databricks.png +0 -0
  1275. qalita/_frontend/public/sources-logos/duckdb.png +0 -0
  1276. qalita/_frontend/public/sources-logos/elasticsearch.svg +1 -0
  1277. qalita/_frontend/public/sources-logos/excel.svg +1 -0
  1278. qalita/_frontend/public/sources-logos/file.svg +1 -0
  1279. qalita/_frontend/public/sources-logos/folder.svg +6 -0
  1280. qalita/_frontend/public/sources-logos/gcs.png +0 -0
  1281. qalita/_frontend/public/sources-logos/hdfs.svg +1 -0
  1282. qalita/_frontend/public/sources-logos/ibm-db2.png +0 -0
  1283. qalita/_frontend/public/sources-logos/json.png +0 -0
  1284. qalita/_frontend/public/sources-logos/maria-db.png +0 -0
  1285. qalita/_frontend/public/sources-logos/mongodb.svg +1 -0
  1286. qalita/_frontend/public/sources-logos/mssql.svg +1 -0
  1287. qalita/_frontend/public/sources-logos/mysql.svg +7 -0
  1288. qalita/_frontend/public/sources-logos/oracle.svg +4 -0
  1289. qalita/_frontend/public/sources-logos/parquet.svg +16 -0
  1290. qalita/_frontend/public/sources-logos/picture.png +0 -0
  1291. qalita/_frontend/public/sources-logos/postgresql.svg +22 -0
  1292. qalita/_frontend/public/sources-logos/questdb.png +0 -0
  1293. qalita/_frontend/public/sources-logos/redshift.png +0 -0
  1294. qalita/_frontend/public/sources-logos/s3.svg +34 -0
  1295. qalita/_frontend/public/sources-logos/sap-hana.png +0 -0
  1296. qalita/_frontend/public/sources-logos/sftp.png +0 -0
  1297. qalita/_frontend/public/sources-logos/single-store.png +0 -0
  1298. qalita/_frontend/public/sources-logos/snowflake.png +0 -0
  1299. qalita/_frontend/public/sources-logos/sqlite.svg +104 -0
  1300. qalita/_frontend/public/sources-logos/sqlserver.png +0 -0
  1301. qalita/_frontend/public/sources-logos/starburst.png +0 -0
  1302. qalita/_frontend/public/sources-logos/stream.png +0 -0
  1303. qalita/_frontend/public/sources-logos/teradata.png +0 -0
  1304. qalita/_frontend/public/sources-logos/timescale.png +0 -0
  1305. qalita/_frontend/public/sources-logos/xls.svg +1 -0
  1306. qalita/_frontend/public/sources-logos/xlsx.svg +1 -0
  1307. qalita/_frontend/public/sources-logos/yugabyte-db.png +0 -0
  1308. qalita/_frontend/public/studio-logo.svg +10 -0
  1309. qalita/_frontend/public/studio.ico +0 -0
  1310. qalita/_frontend/public/studio.png +0 -0
  1311. qalita/_frontend/server.js +38 -0
  1312. qalita/commands/pack.py +95 -23
  1313. qalita/commands/source.py +11 -6
  1314. qalita/commands/worker.py +72 -24
  1315. qalita/internal/request.py +4 -1
  1316. qalita/internal/utils.py +215 -9
  1317. qalita/web/blueprints/context.py +5 -3
  1318. qalita/web/blueprints/dashboard.py +17 -6
  1319. qalita/web/blueprints/sources.py +28 -8
  1320. qalita/web/blueprints/workers.py +21 -7
  1321. {qalita-2.5.2.dist-info → qalita-2.5.4.dist-info}/METADATA +2 -2
  1322. qalita-2.5.4.dist-info/RECORD +1334 -0
  1323. qalita-2.5.2.dist-info/RECORD +0 -24
  1324. {qalita-2.5.2.dist-info → qalita-2.5.4.dist-info}/WHEEL +0 -0
  1325. {qalita-2.5.2.dist-info → qalita-2.5.4.dist-info}/entry_points.txt +0 -0
  1326. {qalita-2.5.2.dist-info → qalita-2.5.4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,3470 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderToHTMLOrFlight", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return renderToHTMLOrFlight;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _workasyncstorageexternal = require("../app-render/work-async-storage.external");
13
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
14
+ const _renderresult = /*#__PURE__*/ _interop_require_default(require("../render-result"));
15
+ const _nodewebstreamshelper = require("../stream-utils/node-web-streams-helper");
16
+ const _internalutils = require("../internal-utils");
17
+ const _approuterheaders = require("../../client/components/app-router-headers");
18
+ const _metadatacontext = require("../../lib/metadata/metadata-context");
19
+ const _requeststore = require("../async-storage/request-store");
20
+ const _workstore = require("../async-storage/work-store");
21
+ const _httpaccessfallback = require("../../client/components/http-access-fallback/http-access-fallback");
22
+ const _redirect = require("../../client/components/redirect");
23
+ const _redirecterror = require("../../client/components/redirect-error");
24
+ const _implicittags = require("../lib/implicit-tags");
25
+ const _constants = require("../lib/trace/constants");
26
+ const _tracer = require("../lib/trace/tracer");
27
+ const _flightrenderresult = require("./flight-render-result");
28
+ const _createerrorhandler = require("./create-error-handler");
29
+ const _getshortdynamicparamtype = require("./get-short-dynamic-param-type");
30
+ const _getsegmentparam = require("../../shared/lib/router/utils/get-segment-param");
31
+ const _getscriptnoncefromheader = require("./get-script-nonce-from-header");
32
+ const _parseandvalidateflightrouterstate = require("./parse-and-validate-flight-router-state");
33
+ const _createflightrouterstatefromloadertree = require("./create-flight-router-state-from-loader-tree");
34
+ const _actionhandler = require("./action-handler");
35
+ const _bailouttocsr = require("../../shared/lib/lazy-dynamic/bailout-to-csr");
36
+ const _log = require("../../build/output/log");
37
+ const _requestcookies = require("../web/spec-extension/adapters/request-cookies");
38
+ const _serverinsertedhtml = require("./server-inserted-html");
39
+ const _requiredscripts = require("./required-scripts");
40
+ const _addpathprefix = require("../../shared/lib/router/utils/add-path-prefix");
41
+ const _makegetserverinsertedhtml = require("./make-get-server-inserted-html");
42
+ const _walktreewithflightrouterstate = require("./walk-tree-with-flight-router-state");
43
+ const _createcomponenttree = require("./create-component-tree");
44
+ const _getassetquerystring = require("./get-asset-query-string");
45
+ const _encryptionutils = require("./encryption-utils");
46
+ const _postponedstate = require("./postponed-state");
47
+ const _hooksservercontext = require("../../client/components/hooks-server-context");
48
+ const _useflightresponse = require("./use-flight-response");
49
+ const _staticgenerationbailout = require("../../client/components/static-generation-bailout");
50
+ const _formatservererror = require("../../lib/format-server-error");
51
+ const _dynamicrendering = require("./dynamic-rendering");
52
+ const _clientcomponentrendererlogger = require("../client-component-renderer-logger");
53
+ const _actionutils = require("./action-utils");
54
+ const _helpers = require("../base-http/helpers");
55
+ const _parserelativeurl = require("../../shared/lib/router/utils/parse-relative-url");
56
+ const _approuter = /*#__PURE__*/ _interop_require_default(require("../../client/components/app-router"));
57
+ const _serveractionrequestmeta = require("../lib/server-action-request-meta");
58
+ const _createinitialrouterstate = require("../../client/components/router-reducer/create-initial-router-state");
59
+ const _approuterinstance = require("../../client/components/app-router-instance");
60
+ const _utils = require("../instrumentation/utils");
61
+ const _segment = require("../../shared/lib/segment");
62
+ const _apprenderprerenderutils = require("./app-render-prerender-utils");
63
+ const _prospectiverenderutils = require("./prospective-render-utils");
64
+ const _apprenderrenderutils = require("./app-render-render-utils");
65
+ const _scheduler = require("../../lib/scheduler");
66
+ const _workunitasyncstorageexternal = require("./work-unit-async-storage.external");
67
+ const _consoleasyncstorageexternal = require("./console-async-storage.external");
68
+ const _cachesignal = require("./cache-signal");
69
+ const _utils1 = require("../lib/trace/utils");
70
+ const _invarianterror = require("../../shared/lib/invariant-error");
71
+ const _constants1 = require("../../lib/constants");
72
+ const _createcomponentstylesandscripts = require("./create-component-styles-and-scripts");
73
+ const _parseloadertree = require("../../shared/lib/router/utils/parse-loader-tree");
74
+ const _resumedatacache = require("../resume-data-cache/resume-data-cache");
75
+ const _iserror = /*#__PURE__*/ _interop_require_default(require("../../lib/is-error"));
76
+ const _createserverinsertedmetadata = require("./metadata-insertion/create-server-inserted-metadata");
77
+ const _serverutils = require("../server-utils");
78
+ const _revalidationutils = require("../revalidation-utils");
79
+ const _trackmoduleloadingexternal = require("./module-loading/track-module-loading.external");
80
+ const _reactlargeshellerror = require("./react-large-shell-error");
81
+ const _segmentexplorerpath = require("./segment-explorer-path");
82
+ const _requestmeta = require("../request-meta");
83
+ const _getdynamicparam = require("../../shared/lib/router/utils/get-dynamic-param");
84
+ const _promisewithresolvers = require("../../shared/lib/promise-with-resolvers");
85
+ const _imageconfigcontextsharedruntime = require("../../shared/lib/image-config-context.shared-runtime");
86
+ const _imageconfig = require("../../shared/lib/image-config");
87
+ const _stagedrendering = require("./staged-rendering");
88
+ const _stagedvalidation = require("./staged-validation");
89
+ const _warnonce = require("../../shared/lib/utils/warn-once");
90
+ function _interop_require_default(obj) {
91
+ return obj && obj.__esModule ? obj : {
92
+ default: obj
93
+ };
94
+ }
95
+ function _getRequireWildcardCache(nodeInterop) {
96
+ if (typeof WeakMap !== "function") return null;
97
+ var cacheBabelInterop = new WeakMap();
98
+ var cacheNodeInterop = new WeakMap();
99
+ return (_getRequireWildcardCache = function(nodeInterop) {
100
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
101
+ })(nodeInterop);
102
+ }
103
+ function _interop_require_wildcard(obj, nodeInterop) {
104
+ if (!nodeInterop && obj && obj.__esModule) {
105
+ return obj;
106
+ }
107
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
108
+ return {
109
+ default: obj
110
+ };
111
+ }
112
+ var cache = _getRequireWildcardCache(nodeInterop);
113
+ if (cache && cache.has(obj)) {
114
+ return cache.get(obj);
115
+ }
116
+ var newObj = {
117
+ __proto__: null
118
+ };
119
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
120
+ for(var key in obj){
121
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
122
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
123
+ if (desc && (desc.get || desc.set)) {
124
+ Object.defineProperty(newObj, key, desc);
125
+ } else {
126
+ newObj[key] = obj[key];
127
+ }
128
+ }
129
+ }
130
+ newObj.default = obj;
131
+ if (cache) {
132
+ cache.set(obj, newObj);
133
+ }
134
+ return newObj;
135
+ }
136
+ const flightDataPathHeadKey = 'h';
137
+ const getFlightViewportKey = (requestId)=>requestId + 'v';
138
+ const getFlightMetadataKey = (requestId)=>requestId + 'm';
139
+ const filterStackFrame = process.env.NODE_ENV !== 'production' ? require('../lib/source-maps').filterStackFrameDEV : undefined;
140
+ function parseRequestHeaders(headers, options) {
141
+ // runtime prefetch requests are *not* treated as prefetch requests
142
+ // (TODO: this is confusing, we should refactor this to express this better)
143
+ const isPrefetchRequest = headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] === '1';
144
+ const isRuntimePrefetchRequest = headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] === '2';
145
+ const isHmrRefresh = headers[_approuterheaders.NEXT_HMR_REFRESH_HEADER] !== undefined;
146
+ const isRSCRequest = headers[_approuterheaders.RSC_HEADER] !== undefined;
147
+ const shouldProvideFlightRouterState = isRSCRequest && (!isPrefetchRequest || !options.isRoutePPREnabled);
148
+ const flightRouterState = shouldProvideFlightRouterState ? (0, _parseandvalidateflightrouterstate.parseAndValidateFlightRouterState)(headers[_approuterheaders.NEXT_ROUTER_STATE_TREE_HEADER]) : undefined;
149
+ // Checks if this is a prefetch of the Route Tree by the Segment Cache
150
+ const isRouteTreePrefetchRequest = headers[_approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER] === '/_tree';
151
+ const csp = headers['content-security-policy'] || headers['content-security-policy-report-only'];
152
+ const nonce = typeof csp === 'string' ? (0, _getscriptnoncefromheader.getScriptNonceFromHeader)(csp) : undefined;
153
+ const previouslyRevalidatedTags = (0, _serverutils.getPreviouslyRevalidatedTags)(headers, options.previewModeId);
154
+ let requestId;
155
+ let htmlRequestId;
156
+ if (process.env.NODE_ENV !== 'production') {
157
+ // The request IDs are only used in development mode to send debug
158
+ // information to the matching client (identified by the HTML request ID
159
+ // that was sent to the client with the HTML document) for the current
160
+ // request (identified by the request ID, as defined by the client).
161
+ requestId = typeof headers[_approuterheaders.NEXT_REQUEST_ID_HEADER] === 'string' ? headers[_approuterheaders.NEXT_REQUEST_ID_HEADER] : undefined;
162
+ htmlRequestId = typeof headers[_approuterheaders.NEXT_HTML_REQUEST_ID_HEADER] === 'string' ? headers[_approuterheaders.NEXT_HTML_REQUEST_ID_HEADER] : undefined;
163
+ }
164
+ return {
165
+ flightRouterState,
166
+ isPrefetchRequest,
167
+ isRuntimePrefetchRequest,
168
+ isRouteTreePrefetchRequest,
169
+ isHmrRefresh,
170
+ isRSCRequest,
171
+ nonce,
172
+ previouslyRevalidatedTags,
173
+ requestId,
174
+ htmlRequestId
175
+ };
176
+ }
177
+ function createNotFoundLoaderTree(loaderTree) {
178
+ const components = loaderTree[2];
179
+ const hasGlobalNotFound = !!components['global-not-found'];
180
+ const notFoundTreeComponents = hasGlobalNotFound ? {
181
+ layout: components['global-not-found'],
182
+ page: [
183
+ ()=>null,
184
+ 'next/dist/client/components/builtin/empty-stub'
185
+ ]
186
+ } : {
187
+ page: components['not-found']
188
+ };
189
+ return [
190
+ '',
191
+ {
192
+ children: [
193
+ _segment.PAGE_SEGMENT_KEY,
194
+ {},
195
+ notFoundTreeComponents
196
+ ]
197
+ },
198
+ // When global-not-found is present, skip layout from components
199
+ hasGlobalNotFound ? components : {}
200
+ ];
201
+ }
202
+ /**
203
+ * Returns a function that parses the dynamic segment and return the associated value.
204
+ */ function makeGetDynamicParamFromSegment(interpolatedParams, fallbackRouteParams) {
205
+ return function getDynamicParamFromSegment(// [slug] / [[slug]] / [...slug]
206
+ segment) {
207
+ const segmentParam = (0, _getsegmentparam.getSegmentParam)(segment);
208
+ if (!segmentParam) {
209
+ return null;
210
+ }
211
+ const segmentKey = segmentParam.param;
212
+ const dynamicParamType = _getshortdynamicparamtype.dynamicParamTypes[segmentParam.type];
213
+ return (0, _getdynamicparam.getDynamicParam)(interpolatedParams, segmentKey, dynamicParamType, fallbackRouteParams);
214
+ };
215
+ }
216
+ function NonIndex({ createElement, pagePath, statusCode, isPossibleServerAction }) {
217
+ const is404Page = pagePath === '/404';
218
+ const isInvalidStatusCode = typeof statusCode === 'number' && statusCode > 400;
219
+ // Only render noindex for page request, skip for server actions
220
+ // TODO: is this correct if `isPossibleServerAction` is a false positive?
221
+ if (!isPossibleServerAction && (is404Page || isInvalidStatusCode)) {
222
+ return createElement('meta', {
223
+ name: 'robots',
224
+ content: 'noindex'
225
+ });
226
+ }
227
+ return null;
228
+ }
229
+ /**
230
+ * This is used by server actions & client-side navigations to generate RSC data from a client-side request.
231
+ * This function is only called on "dynamic" requests (ie, there wasn't already a static response).
232
+ * It uses request headers (namely `next-router-state-tree`) to determine where to start rendering.
233
+ */ async function generateDynamicRSCPayload(ctx, options) {
234
+ // Flight data that is going to be passed to the browser.
235
+ // Currently a single item array but in the future multiple patches might be combined in a single request.
236
+ // We initialize `flightData` to an empty string because the client router knows how to tolerate
237
+ // it (treating it as an MPA navigation). The only time this function wouldn't generate flight data
238
+ // is for server actions, if the server action handler instructs this function to skip it. When the server
239
+ // action reducer sees a falsy value, it'll simply resolve the action with no data.
240
+ let flightData = '';
241
+ const { componentMod: { routeModule: { userland: { loaderTree } }, createElement, createMetadataComponents, Fragment }, getDynamicParamFromSegment, query, requestId, flightRouterState, workStore, url } = ctx;
242
+ const serveStreamingMetadata = !!ctx.renderOpts.serveStreamingMetadata;
243
+ if (!(options == null ? void 0 : options.skipFlight)) {
244
+ const preloadCallbacks = [];
245
+ const { Viewport, Metadata, MetadataOutlet } = createMetadataComponents({
246
+ tree: loaderTree,
247
+ parsedQuery: query,
248
+ pathname: url.pathname,
249
+ metadataContext: (0, _metadatacontext.createMetadataContext)(ctx.renderOpts),
250
+ getDynamicParamFromSegment,
251
+ workStore,
252
+ serveStreamingMetadata
253
+ });
254
+ flightData = (await (0, _walktreewithflightrouterstate.walkTreeWithFlightRouterState)({
255
+ ctx,
256
+ loaderTreeToFilter: loaderTree,
257
+ parentParams: {},
258
+ flightRouterState,
259
+ // For flight, render metadata inside leaf page
260
+ rscHead: createElement(Fragment, {
261
+ key: flightDataPathHeadKey
262
+ }, createElement(NonIndex, {
263
+ createElement,
264
+ pagePath: ctx.pagePath,
265
+ statusCode: ctx.res.statusCode,
266
+ isPossibleServerAction: ctx.isPossibleServerAction
267
+ }), createElement(Viewport, {
268
+ key: getFlightViewportKey(requestId)
269
+ }), createElement(Metadata, {
270
+ key: getFlightMetadataKey(requestId)
271
+ })),
272
+ injectedCSS: new Set(),
273
+ injectedJS: new Set(),
274
+ injectedFontPreloadTags: new Set(),
275
+ rootLayoutIncluded: false,
276
+ preloadCallbacks,
277
+ MetadataOutlet
278
+ })).map((path)=>path.slice(1)) // remove the '' (root) segment
279
+ ;
280
+ }
281
+ // If we have an action result, then this is a server action response.
282
+ // We can rely on this because `ActionResult` will always be a promise, even if
283
+ // the result is falsey.
284
+ if (options == null ? void 0 : options.actionResult) {
285
+ return {
286
+ a: options.actionResult,
287
+ f: flightData,
288
+ b: ctx.sharedContext.buildId
289
+ };
290
+ }
291
+ // Otherwise, it's a regular RSC response.
292
+ const baseResponse = {
293
+ b: ctx.sharedContext.buildId,
294
+ f: flightData,
295
+ S: workStore.isStaticGeneration
296
+ };
297
+ // For runtime prefetches, we encode the stale time and isPartial flag in the response body
298
+ // rather than relying on response headers. Both of these values will be transformed
299
+ // by a transform stream before being sent to the client.
300
+ if ((options == null ? void 0 : options.runtimePrefetchSentinel) !== undefined) {
301
+ return {
302
+ ...baseResponse,
303
+ rp: [
304
+ options.runtimePrefetchSentinel
305
+ ]
306
+ };
307
+ }
308
+ return baseResponse;
309
+ }
310
+ function createErrorContext(ctx, renderSource) {
311
+ return {
312
+ routerKind: 'App Router',
313
+ routePath: ctx.pagePath,
314
+ // TODO: is this correct if `isPossibleServerAction` is a false positive?
315
+ routeType: ctx.isPossibleServerAction ? 'action' : 'render',
316
+ renderSource,
317
+ revalidateReason: (0, _utils.getRevalidateReason)(ctx.workStore)
318
+ };
319
+ }
320
+ /**
321
+ * Produces a RenderResult containing the Flight data for the given request. See
322
+ * `generateDynamicRSCPayload` for information on the contents of the render result.
323
+ */ async function generateDynamicFlightRenderResult(req, ctx, requestStore, options) {
324
+ const { clientReferenceManifest, componentMod: { renderToReadableStream }, htmlRequestId, renderOpts, requestId, workStore } = ctx;
325
+ const { dev = false, onInstrumentationRequestError, setReactDebugChannel } = renderOpts;
326
+ function onFlightDataRenderError(err) {
327
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'react-server-components-payload'));
328
+ }
329
+ const onError = (0, _createerrorhandler.createFlightReactServerErrorHandler)(dev, onFlightDataRenderError);
330
+ const debugChannel = setReactDebugChannel && createDebugChannel();
331
+ if (debugChannel) {
332
+ setReactDebugChannel(debugChannel.clientSide, htmlRequestId, requestId);
333
+ }
334
+ // For app dir, use the bundled version of Flight server renderer (renderToReadableStream)
335
+ // which contains the subset React.
336
+ const rscPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, generateDynamicRSCPayload, ctx, options);
337
+ const flightReadableStream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, renderToReadableStream, rscPayload, clientReferenceManifest.clientModules, {
338
+ onError,
339
+ temporaryReferences: options == null ? void 0 : options.temporaryReferences,
340
+ filterStackFrame,
341
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
342
+ });
343
+ return new _flightrenderresult.FlightRenderResult(flightReadableStream, {
344
+ fetchMetrics: workStore.fetchMetrics
345
+ });
346
+ }
347
+ async function stagedRenderToReadableStreamWithoutCachesInDev(ctx, requestStore, getPayload, clientReferenceManifest, options) {
348
+ const { componentMod: { renderToReadableStream } } = ctx;
349
+ // We're rendering while bypassing caches,
350
+ // so we have no hope of showing a useful runtime stage.
351
+ // But we still want things like `params` to show up in devtools correctly,
352
+ // which relies on mechanisms we've set up for staged rendering,
353
+ // so we do a 2-task version (Static -> Dynamic) instead.
354
+ const stageController = new _stagedrendering.StagedRenderingController();
355
+ const environmentName = ()=>{
356
+ const currentStage = stageController.currentStage;
357
+ switch(currentStage){
358
+ case _stagedrendering.RenderStage.Static:
359
+ return 'Prerender';
360
+ case _stagedrendering.RenderStage.Runtime:
361
+ case _stagedrendering.RenderStage.Dynamic:
362
+ return 'Server';
363
+ default:
364
+ currentStage;
365
+ throw Object.defineProperty(new _invarianterror.InvariantError(`Invalid render stage: ${currentStage}`), "__NEXT_ERROR_CODE", {
366
+ value: "E881",
367
+ enumerable: false,
368
+ configurable: true
369
+ });
370
+ }
371
+ };
372
+ requestStore.stagedRendering = stageController;
373
+ requestStore.asyncApiPromises = createAsyncApiPromisesInDev(stageController, requestStore.cookies, requestStore.mutableCookies, requestStore.headers);
374
+ const rscPayload = await getPayload(requestStore);
375
+ return await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _apprenderrenderutils.scheduleInSequentialTasks, ()=>{
376
+ return renderToReadableStream(rscPayload, clientReferenceManifest.clientModules, {
377
+ ...options,
378
+ environmentName
379
+ });
380
+ }, ()=>{
381
+ stageController.advanceStage(_stagedrendering.RenderStage.Dynamic);
382
+ });
383
+ }
384
+ /**
385
+ * Fork of `generateDynamicFlightRenderResult` that renders using `renderWithRestartOnCacheMissInDev`
386
+ * to ensure correct separation of environments Prerender/Server (for use in Cache Components)
387
+ */ async function generateDynamicFlightRenderResultWithStagesInDev(req, ctx, initialRequestStore, createRequestStore) {
388
+ const { htmlRequestId, renderOpts, requestId, workStore, componentMod: { createElement } } = ctx;
389
+ const { dev = false, onInstrumentationRequestError, setReactDebugChannel, setCacheStatus, clientReferenceManifest } = renderOpts;
390
+ function onFlightDataRenderError(err) {
391
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'react-server-components-payload'));
392
+ }
393
+ const onError = (0, _createerrorhandler.createFlightReactServerErrorHandler)(dev, onFlightDataRenderError);
394
+ const getPayload = async (requestStore)=>{
395
+ const payload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, generateDynamicRSCPayload, ctx, undefined);
396
+ if (isBypassingCachesInDev(renderOpts, requestStore)) {
397
+ // Mark the RSC payload to indicate that caches were bypassed in dev.
398
+ // This lets the client know not to cache anything based on this render.
399
+ payload._bypassCachesInDev = createElement(WarnForBypassCachesInDev, {
400
+ route: workStore.route
401
+ });
402
+ }
403
+ return payload;
404
+ };
405
+ let debugChannel;
406
+ let stream;
407
+ if (// We only do this flow if we can safely recreate the store from scratch
408
+ // (which is not the case for renders after an action)
409
+ createRequestStore && // We only do this flow if we're not bypassing caches in dev using
410
+ // "disable cache" in devtools or a hard refresh (cache-control: "no-store")
411
+ !isBypassingCachesInDev(renderOpts, initialRequestStore)) {
412
+ // Before we kick off the render, we set the cache status back to it's initial state
413
+ // in case a previous render bypassed the cache.
414
+ if (setCacheStatus) {
415
+ setCacheStatus('ready', htmlRequestId);
416
+ }
417
+ const result = await renderWithRestartOnCacheMissInDev(ctx, initialRequestStore, createRequestStore, getPayload, onError);
418
+ debugChannel = result.debugChannel;
419
+ stream = result.stream;
420
+ } else {
421
+ // We're either bypassing caches or we can't restart the render.
422
+ // Do a dynamic render, but with (basic) environment labels.
423
+ assertClientReferenceManifest(clientReferenceManifest);
424
+ // Set cache status to bypass when specifically bypassing caches in dev
425
+ if (setCacheStatus) {
426
+ setCacheStatus('bypass', htmlRequestId);
427
+ }
428
+ debugChannel = setReactDebugChannel && createDebugChannel();
429
+ stream = await stagedRenderToReadableStreamWithoutCachesInDev(ctx, initialRequestStore, getPayload, clientReferenceManifest, {
430
+ onError: onError,
431
+ filterStackFrame,
432
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
433
+ });
434
+ }
435
+ if (debugChannel && setReactDebugChannel) {
436
+ setReactDebugChannel(debugChannel.clientSide, htmlRequestId, requestId);
437
+ }
438
+ return new _flightrenderresult.FlightRenderResult(stream, {
439
+ fetchMetrics: workStore.fetchMetrics
440
+ });
441
+ }
442
+ async function generateRuntimePrefetchResult(req, ctx, requestStore) {
443
+ const { workStore } = ctx;
444
+ const renderOpts = ctx.renderOpts;
445
+ function onFlightDataRenderError(err) {
446
+ return renderOpts.onInstrumentationRequestError == null ? void 0 : renderOpts.onInstrumentationRequestError.call(renderOpts, err, req, // TODO(runtime-ppr): should we use a different value?
447
+ createErrorContext(ctx, 'react-server-components-payload'));
448
+ }
449
+ const onError = (0, _createerrorhandler.createFlightReactServerErrorHandler)(false, onFlightDataRenderError);
450
+ const metadata = {};
451
+ // Generate a random sentinel that will be used as a placeholder in the payload
452
+ // and later replaced by the transform stream
453
+ const runtimePrefetchSentinel = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
454
+ const generatePayload = ()=>generateDynamicRSCPayload(ctx, {
455
+ runtimePrefetchSentinel
456
+ });
457
+ const { componentMod: { routeModule: { userland: { loaderTree } } }, getDynamicParamFromSegment } = ctx;
458
+ const rootParams = (0, _createcomponenttree.getRootParams)(loaderTree, getDynamicParamFromSegment);
459
+ // We need to share caches between the prospective prerender and the final prerender,
460
+ // but we're not going to persist this anywhere.
461
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
462
+ // We're not resuming an existing render.
463
+ const renderResumeDataCache = null;
464
+ await prospectiveRuntimeServerPrerender(ctx, generatePayload, prerenderResumeDataCache, renderResumeDataCache, rootParams, requestStore.headers, requestStore.cookies, requestStore.draftMode);
465
+ const response = await finalRuntimeServerPrerender(ctx, generatePayload, prerenderResumeDataCache, renderResumeDataCache, rootParams, requestStore.headers, requestStore.cookies, requestStore.draftMode, onError, runtimePrefetchSentinel);
466
+ applyMetadataFromPrerenderResult(response, metadata, workStore);
467
+ metadata.fetchMetrics = ctx.workStore.fetchMetrics;
468
+ return new _flightrenderresult.FlightRenderResult(response.result.prelude, metadata);
469
+ }
470
+ async function prospectiveRuntimeServerPrerender(ctx, getPayload, prerenderResumeDataCache, renderResumeDataCache, rootParams, headers, cookies, draftMode) {
471
+ const { implicitTags, renderOpts, workStore } = ctx;
472
+ const { clientReferenceManifest, ComponentMod } = renderOpts;
473
+ assertClientReferenceManifest(clientReferenceManifest);
474
+ // Prerender controller represents the lifetime of the prerender.
475
+ // It will be aborted when a Task is complete or a synchronously aborting
476
+ // API is called. Notably during cache-filling renders this does not actually
477
+ // terminate the render itself which will continue until all caches are filled
478
+ const initialServerPrerenderController = new AbortController();
479
+ // This controller represents the lifetime of the React render call. Notably
480
+ // during the cache-filling render it is different from the prerender controller
481
+ // because we don't want to end the react render until all caches are filled.
482
+ const initialServerRenderController = new AbortController();
483
+ // The cacheSignal helps us track whether caches are still filling or we are ready
484
+ // to cut the render off.
485
+ const cacheSignal = new _cachesignal.CacheSignal();
486
+ const initialServerPrerenderStore = {
487
+ type: 'prerender-runtime',
488
+ phase: 'render',
489
+ rootParams,
490
+ implicitTags,
491
+ renderSignal: initialServerRenderController.signal,
492
+ controller: initialServerPrerenderController,
493
+ // During the initial prerender we need to track all cache reads to ensure
494
+ // we render long enough to fill every cache it is possible to visit during
495
+ // the final prerender.
496
+ cacheSignal,
497
+ // We only need to track dynamic accesses during the final prerender.
498
+ dynamicTracking: null,
499
+ // Runtime prefetches are never cached server-side, only client-side,
500
+ // so we set `expire` and `revalidate` to their minimum values just in case.
501
+ revalidate: 1,
502
+ expire: 0,
503
+ stale: _constants1.INFINITE_CACHE,
504
+ tags: [
505
+ ...implicitTags.tags
506
+ ],
507
+ renderResumeDataCache,
508
+ prerenderResumeDataCache,
509
+ hmrRefreshHash: undefined,
510
+ // We only need task sequencing in the final prerender.
511
+ runtimeStagePromise: null,
512
+ // These are not present in regular prerenders, but allowed in a runtime prerender.
513
+ headers,
514
+ cookies,
515
+ draftMode
516
+ };
517
+ // We're not going to use the result of this render because the only time it could be used
518
+ // is if it completes in a microtask and that's likely very rare for any non-trivial app
519
+ const initialServerPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPrerenderStore, getPayload);
520
+ const pendingInitialServerResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPrerenderStore, ComponentMod.prerender, initialServerPayload, clientReferenceManifest.clientModules, {
521
+ filterStackFrame,
522
+ onError: (err)=>{
523
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
524
+ if (digest) {
525
+ return digest;
526
+ }
527
+ if (initialServerPrerenderController.signal.aborted) {
528
+ // The render aborted before this error was handled which indicates
529
+ // the error is caused by unfinished components within the render
530
+ return;
531
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
532
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
533
+ }
534
+ },
535
+ // We don't want to stop rendering until the cacheSignal is complete so we pass
536
+ // a different signal to this render call than is used by dynamic APIs to signify
537
+ // transitioning out of the prerender environment
538
+ signal: initialServerRenderController.signal
539
+ });
540
+ // Wait for all caches to be finished filling and for async imports to resolve
541
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
542
+ await cacheSignal.cacheReady();
543
+ initialServerRenderController.abort();
544
+ initialServerPrerenderController.abort();
545
+ // We don't need to continue the prerender process if we already
546
+ // detected invalid dynamic usage in the initial prerender phase.
547
+ if (workStore.invalidDynamicUsageError) {
548
+ throw workStore.invalidDynamicUsageError;
549
+ }
550
+ try {
551
+ return await (0, _apprenderprerenderutils.createReactServerPrerenderResult)(pendingInitialServerResult);
552
+ } catch (err) {
553
+ if (initialServerRenderController.signal.aborted || initialServerPrerenderController.signal.aborted) {
554
+ // These are expected errors that might error the prerender. we ignore them.
555
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
556
+ // We don't normally log these errors because we are going to retry anyway but
557
+ // it can be useful for debugging Next.js itself to get visibility here when needed
558
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
559
+ }
560
+ return null;
561
+ }
562
+ }
563
+ /**
564
+ * Updates the runtime prefetch metadata in the RSC payload as it streams:
565
+ * "rp":[<sentinel>] -> "rp":[<isPartial>,<staleTime>]
566
+ *
567
+ * We use a transform stream to do this to avoid needing to trigger an additional render.
568
+ * A random sentinel number guarantees no collision with user data.
569
+ */ function createRuntimePrefetchTransformStream(sentinel, isPartial, staleTime) {
570
+ const encoder = new TextEncoder();
571
+ // Search for: [<sentinel>]
572
+ // Replace with: [<isPartial>,<staleTime>]
573
+ const search = encoder.encode(`[${sentinel}]`);
574
+ const first = search[0];
575
+ const replace = encoder.encode(`[${isPartial},${staleTime}]`);
576
+ const searchLen = search.length;
577
+ let currentChunk = null;
578
+ let found = false;
579
+ function processChunk(controller, nextChunk) {
580
+ if (found) {
581
+ if (nextChunk) {
582
+ controller.enqueue(nextChunk);
583
+ }
584
+ return;
585
+ }
586
+ if (currentChunk) {
587
+ // We can't search past the index that can contain a full match
588
+ let exclusiveUpperBound = currentChunk.length - (searchLen - 1);
589
+ if (nextChunk) {
590
+ // If we have any overflow bytes we can search up to the chunk's final byte
591
+ exclusiveUpperBound += Math.min(nextChunk.length, searchLen - 1);
592
+ }
593
+ if (exclusiveUpperBound < 1) {
594
+ // we can't match the current chunk.
595
+ controller.enqueue(currentChunk);
596
+ currentChunk = nextChunk // advance so we don't process this chunk again
597
+ ;
598
+ return;
599
+ }
600
+ let currentIndex = currentChunk.indexOf(first);
601
+ // check the current candidate match if it is within the bounds of our search space for the currentChunk
602
+ candidateLoop: while(-1 < currentIndex && currentIndex < exclusiveUpperBound){
603
+ // We already know index 0 matches because we used indexOf to find the candidateIndex so we start at index 1
604
+ let matchIndex = 1;
605
+ while(matchIndex < searchLen){
606
+ const candidateIndex = currentIndex + matchIndex;
607
+ const candidateValue = candidateIndex < currentChunk.length ? currentChunk[candidateIndex] : nextChunk[candidateIndex - currentChunk.length];
608
+ if (candidateValue !== search[matchIndex]) {
609
+ // No match, reset and continue the search from the next position
610
+ currentIndex = currentChunk.indexOf(first, currentIndex + 1);
611
+ continue candidateLoop;
612
+ }
613
+ matchIndex++;
614
+ }
615
+ // We found a complete match. currentIndex is our starting point to replace the value.
616
+ found = true;
617
+ // enqueue everything up to the match
618
+ controller.enqueue(currentChunk.subarray(0, currentIndex));
619
+ // enqueue the replacement value
620
+ controller.enqueue(replace);
621
+ // If there are bytes in the currentChunk after the match enqueue them
622
+ if (currentIndex + searchLen < currentChunk.length) {
623
+ controller.enqueue(currentChunk.slice(currentIndex + searchLen));
624
+ }
625
+ // If we have a next chunk we enqueue it now
626
+ if (nextChunk) {
627
+ // if replacement spills over to the next chunk we first exclude the replaced bytes
628
+ const overflowBytes = currentIndex + searchLen - currentChunk.length;
629
+ const truncatedChunk = overflowBytes > 0 ? nextChunk.subarray(overflowBytes) : nextChunk;
630
+ controller.enqueue(truncatedChunk);
631
+ }
632
+ // We are now in found mode and don't need to track currentChunk anymore
633
+ currentChunk = null;
634
+ return;
635
+ }
636
+ // No match found in this chunk, emit it and wait for the next one
637
+ controller.enqueue(currentChunk);
638
+ }
639
+ // Advance to the next chunk
640
+ currentChunk = nextChunk;
641
+ }
642
+ return new TransformStream({
643
+ transform (chunk, controller) {
644
+ processChunk(controller, chunk);
645
+ },
646
+ flush (controller) {
647
+ processChunk(controller, null);
648
+ }
649
+ });
650
+ }
651
+ async function finalRuntimeServerPrerender(ctx, getPayload, prerenderResumeDataCache, renderResumeDataCache, rootParams, headers, cookies, draftMode, onError, runtimePrefetchSentinel) {
652
+ const { implicitTags, renderOpts } = ctx;
653
+ const { clientReferenceManifest, ComponentMod, experimental, isDebugDynamicAccesses } = renderOpts;
654
+ assertClientReferenceManifest(clientReferenceManifest);
655
+ const selectStaleTime = createSelectStaleTime(experimental);
656
+ let serverIsDynamic = false;
657
+ const finalServerController = new AbortController();
658
+ const serverDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(isDebugDynamicAccesses);
659
+ const { promise: runtimeStagePromise, resolve: resolveBlockedRuntimeAPIs } = (0, _promisewithresolvers.createPromiseWithResolvers)();
660
+ const finalServerPrerenderStore = {
661
+ type: 'prerender-runtime',
662
+ phase: 'render',
663
+ rootParams,
664
+ implicitTags,
665
+ renderSignal: finalServerController.signal,
666
+ controller: finalServerController,
667
+ // All caches we could read must already be filled so no tracking is necessary
668
+ cacheSignal: null,
669
+ dynamicTracking: serverDynamicTracking,
670
+ // Runtime prefetches are never cached server-side, only client-side,
671
+ // so we set `expire` and `revalidate` to their minimum values just in case.
672
+ revalidate: 1,
673
+ expire: 0,
674
+ stale: _constants1.INFINITE_CACHE,
675
+ tags: [
676
+ ...implicitTags.tags
677
+ ],
678
+ prerenderResumeDataCache,
679
+ renderResumeDataCache,
680
+ hmrRefreshHash: undefined,
681
+ // Used to separate the "Static" stage from the "Runtime" stage.
682
+ runtimeStagePromise,
683
+ // These are not present in regular prerenders, but allowed in a runtime prerender.
684
+ headers,
685
+ cookies,
686
+ draftMode
687
+ };
688
+ const finalRSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalServerPrerenderStore, getPayload);
689
+ let prerenderIsPending = true;
690
+ const result = await (0, _apprenderprerenderutils.prerenderAndAbortInSequentialTasksWithStages)(async ()=>{
691
+ // Static stage
692
+ const prerenderResult = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalServerPrerenderStore, ComponentMod.prerender, finalRSCPayload, clientReferenceManifest.clientModules, {
693
+ filterStackFrame,
694
+ onError,
695
+ signal: finalServerController.signal
696
+ });
697
+ prerenderIsPending = false;
698
+ return prerenderResult;
699
+ }, ()=>{
700
+ // Advance to the runtime stage.
701
+ //
702
+ // We make runtime APIs hang during the first task (above), and unblock them in the following task (here).
703
+ // This makes sure that, at this point, we'll have finished all the static parts (what we'd prerender statically).
704
+ // We know that they don't contain any incorrect sync IO, because that'd have caused a build error.
705
+ // After we unblock Runtime APIs, if we encounter sync IO (e.g. `await cookies(); Date.now()`),
706
+ // we'll abort, but we'll produce at least as much output as a static prerender would.
707
+ resolveBlockedRuntimeAPIs();
708
+ }, ()=>{
709
+ // Abort.
710
+ if (finalServerController.signal.aborted) {
711
+ // If the server controller is already aborted we must have called something
712
+ // that required aborting the prerender synchronously such as with new Date()
713
+ serverIsDynamic = true;
714
+ return;
715
+ }
716
+ if (prerenderIsPending) {
717
+ // If prerenderIsPending then we have blocked for longer than a Task and we assume
718
+ // there is something unfinished.
719
+ serverIsDynamic = true;
720
+ }
721
+ finalServerController.abort();
722
+ });
723
+ // Update the RSC payload stream to replace the sentinel with actual values.
724
+ // React has already serialized the payload with the sentinel, so we need to transform the stream.
725
+ const collectedStale = selectStaleTime(finalServerPrerenderStore.stale);
726
+ result.prelude = result.prelude.pipeThrough(createRuntimePrefetchTransformStream(runtimePrefetchSentinel, serverIsDynamic, collectedStale));
727
+ return {
728
+ result,
729
+ // TODO(runtime-ppr): do we need to produce a digest map here?
730
+ // digestErrorsMap: ...,
731
+ dynamicAccess: serverDynamicTracking,
732
+ isPartial: serverIsDynamic,
733
+ collectedRevalidate: finalServerPrerenderStore.revalidate,
734
+ collectedExpire: finalServerPrerenderStore.expire,
735
+ collectedStale,
736
+ collectedTags: finalServerPrerenderStore.tags
737
+ };
738
+ }
739
+ /**
740
+ * Crawlers will inadvertently think the canonicalUrl in the RSC payload should be crawled
741
+ * when our intention is to just seed the router state with the current URL.
742
+ * This function splits up the pathname so that we can later join it on
743
+ * when we're ready to consume the path.
744
+ */ function prepareInitialCanonicalUrl(url) {
745
+ return (url.pathname + url.search).split('/');
746
+ }
747
+ function getRenderedSearch(query) {
748
+ // Inlined implementation of querystring.encode, which is not available in
749
+ // the Edge runtime.
750
+ const pairs = [];
751
+ for(const key in query){
752
+ const value = query[key];
753
+ if (value == null) continue;
754
+ if (Array.isArray(value)) {
755
+ for (const v of value){
756
+ pairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(v))}`);
757
+ }
758
+ } else {
759
+ pairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
760
+ }
761
+ }
762
+ // The result should match the format of a web URL's `search` property, since
763
+ // this is the format that's stored in the App Router state.
764
+ // TODO: We're a bit inconsistent about this. The x-nextjs-rewritten-query
765
+ // header omits the leading question mark. Should refactor to always do
766
+ // that instead.
767
+ if (pairs.length === 0) {
768
+ // If the search string is empty, return an empty string.
769
+ return '';
770
+ }
771
+ // Prepend '?' to the search params string.
772
+ return '?' + pairs.join('&');
773
+ }
774
+ // This is the data necessary to render <AppRouter /> when no SSR errors are encountered
775
+ async function getRSCPayload(tree, ctx, is404) {
776
+ const injectedCSS = new Set();
777
+ const injectedJS = new Set();
778
+ const injectedFontPreloadTags = new Set();
779
+ let missingSlots;
780
+ // We only track missing parallel slots in development
781
+ if (process.env.NODE_ENV === 'development') {
782
+ missingSlots = new Set();
783
+ }
784
+ const { getDynamicParamFromSegment, query, appUsingSizeAdjustment, componentMod: { createMetadataComponents, createElement, Fragment }, url, workStore } = ctx;
785
+ const initialTree = (0, _createflightrouterstatefromloadertree.createFlightRouterStateFromLoaderTree)(tree, getDynamicParamFromSegment, query);
786
+ const serveStreamingMetadata = !!ctx.renderOpts.serveStreamingMetadata;
787
+ const hasGlobalNotFound = !!tree[2]['global-not-found'];
788
+ const { Viewport, Metadata, MetadataOutlet } = createMetadataComponents({
789
+ tree,
790
+ // When it's using global-not-found, metadata errorType is undefined, which will retrieve the
791
+ // metadata from the page.
792
+ // When it's using not-found, metadata errorType is 'not-found', which will retrieve the
793
+ // metadata from the not-found.js boundary.
794
+ // TODO: remove this condition and keep it undefined when global-not-found is stabilized.
795
+ errorType: is404 && !hasGlobalNotFound ? 'not-found' : undefined,
796
+ parsedQuery: query,
797
+ pathname: url.pathname,
798
+ metadataContext: (0, _metadatacontext.createMetadataContext)(ctx.renderOpts),
799
+ getDynamicParamFromSegment,
800
+ workStore,
801
+ serveStreamingMetadata
802
+ });
803
+ const preloadCallbacks = [];
804
+ const seedData = await (0, _createcomponenttree.createComponentTree)({
805
+ ctx,
806
+ loaderTree: tree,
807
+ parentParams: {},
808
+ injectedCSS,
809
+ injectedJS,
810
+ injectedFontPreloadTags,
811
+ rootLayoutIncluded: false,
812
+ missingSlots,
813
+ preloadCallbacks,
814
+ authInterrupts: ctx.renderOpts.experimental.authInterrupts,
815
+ MetadataOutlet
816
+ });
817
+ // When the `vary` response header is present with `Next-URL`, that means there's a chance
818
+ // it could respond differently if there's an interception route. We provide this information
819
+ // to `AppRouter` so that it can properly seed the prefetch cache with a prefix, if needed.
820
+ const varyHeader = ctx.res.getHeader('vary');
821
+ const couldBeIntercepted = typeof varyHeader === 'string' && varyHeader.includes(_approuterheaders.NEXT_URL);
822
+ const initialHead = createElement(Fragment, {
823
+ key: flightDataPathHeadKey
824
+ }, createElement(NonIndex, {
825
+ createElement,
826
+ pagePath: ctx.pagePath,
827
+ statusCode: ctx.res.statusCode,
828
+ isPossibleServerAction: ctx.isPossibleServerAction
829
+ }), createElement(Viewport, null), createElement(Metadata, null), appUsingSizeAdjustment ? createElement('meta', {
830
+ name: 'next-size-adjust',
831
+ content: ''
832
+ }) : null);
833
+ const { GlobalError, styles: globalErrorStyles } = await getGlobalErrorStyles(tree, ctx);
834
+ // Assume the head we're rendering contains only partial data if PPR is
835
+ // enabled and this is a statically generated response. This is used by the
836
+ // client Segment Cache after a prefetch to determine if it can skip the
837
+ // second request to fill in the dynamic data.
838
+ //
839
+ // See similar comment in create-component-tree.tsx for more context.
840
+ const isPossiblyPartialHead = workStore.isStaticGeneration && ctx.renderOpts.experimental.isRoutePPREnabled === true;
841
+ return {
842
+ // See the comment above the `Preloads` component (below) for why this is part of the payload
843
+ P: createElement(Preloads, {
844
+ preloadCallbacks: preloadCallbacks
845
+ }),
846
+ b: ctx.sharedContext.buildId,
847
+ c: prepareInitialCanonicalUrl(url),
848
+ q: getRenderedSearch(query),
849
+ i: !!couldBeIntercepted,
850
+ f: [
851
+ [
852
+ initialTree,
853
+ seedData,
854
+ initialHead,
855
+ isPossiblyPartialHead
856
+ ]
857
+ ],
858
+ m: missingSlots,
859
+ G: [
860
+ GlobalError,
861
+ globalErrorStyles
862
+ ],
863
+ S: workStore.isStaticGeneration
864
+ };
865
+ }
866
+ /**
867
+ * Preload calls (such as `ReactDOM.preloadStyle` and `ReactDOM.preloadFont`) need to be called during rendering
868
+ * in order to create the appropriate preload tags in the DOM, otherwise they're a no-op. Since we invoke
869
+ * renderToReadableStream with a function that returns component props rather than a component itself, we use
870
+ * this component to "render " the preload calls.
871
+ */ function Preloads({ preloadCallbacks }) {
872
+ preloadCallbacks.forEach((preloadFn)=>preloadFn());
873
+ return null;
874
+ }
875
+ // This is the data necessary to render <AppRouter /> when an error state is triggered
876
+ async function getErrorRSCPayload(tree, ctx, ssrError, errorType) {
877
+ const { getDynamicParamFromSegment, query, componentMod: { createMetadataComponents, createElement, Fragment }, url, workStore } = ctx;
878
+ const serveStreamingMetadata = !!ctx.renderOpts.serveStreamingMetadata;
879
+ const { Viewport, Metadata } = createMetadataComponents({
880
+ tree,
881
+ parsedQuery: query,
882
+ pathname: url.pathname,
883
+ metadataContext: (0, _metadatacontext.createMetadataContext)(ctx.renderOpts),
884
+ errorType,
885
+ getDynamicParamFromSegment,
886
+ workStore,
887
+ serveStreamingMetadata: serveStreamingMetadata
888
+ });
889
+ const initialHead = createElement(Fragment, {
890
+ key: flightDataPathHeadKey
891
+ }, createElement(NonIndex, {
892
+ createElement,
893
+ pagePath: ctx.pagePath,
894
+ statusCode: ctx.res.statusCode,
895
+ isPossibleServerAction: ctx.isPossibleServerAction
896
+ }), createElement(Viewport, null), process.env.NODE_ENV === 'development' && createElement('meta', {
897
+ name: 'next-error',
898
+ content: 'not-found'
899
+ }), createElement(Metadata, null));
900
+ const initialTree = (0, _createflightrouterstatefromloadertree.createFlightRouterStateFromLoaderTree)(tree, getDynamicParamFromSegment, query);
901
+ let err = undefined;
902
+ if (ssrError) {
903
+ err = (0, _iserror.default)(ssrError) ? ssrError : Object.defineProperty(new Error(ssrError + ''), "__NEXT_ERROR_CODE", {
904
+ value: "E394",
905
+ enumerable: false,
906
+ configurable: true
907
+ });
908
+ }
909
+ // For metadata notFound error there's no global not found boundary on top
910
+ // so we create a not found page with AppRouter
911
+ const seedData = [
912
+ createElement('html', {
913
+ id: '__next_error__'
914
+ }, createElement('head', null), createElement('body', null, process.env.NODE_ENV !== 'production' && err ? createElement('template', {
915
+ 'data-next-error-message': err.message,
916
+ 'data-next-error-digest': 'digest' in err ? err.digest : '',
917
+ 'data-next-error-stack': err.stack
918
+ }) : null)),
919
+ {},
920
+ null,
921
+ false,
922
+ false
923
+ ];
924
+ const { GlobalError, styles: globalErrorStyles } = await getGlobalErrorStyles(tree, ctx);
925
+ const isPossiblyPartialHead = workStore.isStaticGeneration && ctx.renderOpts.experimental.isRoutePPREnabled === true;
926
+ return {
927
+ b: ctx.sharedContext.buildId,
928
+ c: prepareInitialCanonicalUrl(url),
929
+ q: getRenderedSearch(query),
930
+ m: undefined,
931
+ i: false,
932
+ f: [
933
+ [
934
+ initialTree,
935
+ seedData,
936
+ initialHead,
937
+ isPossiblyPartialHead
938
+ ]
939
+ ],
940
+ G: [
941
+ GlobalError,
942
+ globalErrorStyles
943
+ ],
944
+ S: workStore.isStaticGeneration
945
+ };
946
+ }
947
+ function assertClientReferenceManifest(clientReferenceManifest) {
948
+ if (!clientReferenceManifest) {
949
+ throw Object.defineProperty(new _invarianterror.InvariantError('Expected clientReferenceManifest to be defined.'), "__NEXT_ERROR_CODE", {
950
+ value: "E692",
951
+ enumerable: false,
952
+ configurable: true
953
+ });
954
+ }
955
+ }
956
+ // This component must run in an SSR context. It will render the RSC root component
957
+ function App({ reactServerStream, reactDebugStream, preinitScripts, clientReferenceManifest, ServerInsertedHTMLProvider, nonce, images }) {
958
+ preinitScripts();
959
+ const response = _react.use((0, _useflightresponse.useFlightStream)(reactServerStream, reactDebugStream, clientReferenceManifest, nonce));
960
+ const initialState = (0, _createinitialrouterstate.createInitialRouterState)({
961
+ // This is not used during hydration, so we don't have to pass a
962
+ // real timestamp.
963
+ navigatedAt: -1,
964
+ initialFlightData: response.f,
965
+ initialCanonicalUrlParts: response.c,
966
+ initialRenderedSearch: response.q,
967
+ initialParallelRoutes: new Map(),
968
+ // location is not initialized in the SSR render
969
+ // it's set to window.location during hydration
970
+ location: null
971
+ });
972
+ const actionQueue = (0, _approuterinstance.createMutableActionQueue)(initialState, null);
973
+ const { HeadManagerContext } = require('../../shared/lib/head-manager-context.shared-runtime');
974
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(HeadManagerContext.Provider, {
975
+ value: {
976
+ appDir: true,
977
+ nonce
978
+ },
979
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_imageconfigcontextsharedruntime.ImageConfigContext.Provider, {
980
+ value: images ?? _imageconfig.imageConfigDefault,
981
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(ServerInsertedHTMLProvider, {
982
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_approuter.default, {
983
+ actionQueue: actionQueue,
984
+ globalErrorState: response.G
985
+ })
986
+ })
987
+ })
988
+ });
989
+ /* eslint-enable @next/internal/no-ambiguous-jsx -- React Client */ }
990
+ // @TODO our error stream should be probably just use the same root component. But it was previously
991
+ // different I don't want to figure out if that is meaningful at this time so just keeping the behavior
992
+ // consistent for now.
993
+ function ErrorApp({ reactServerStream, reactDebugStream, preinitScripts, clientReferenceManifest, ServerInsertedHTMLProvider, nonce, images }) {
994
+ /* eslint-disable @next/internal/no-ambiguous-jsx -- React Client */ preinitScripts();
995
+ const response = _react.use((0, _useflightresponse.useFlightStream)(reactServerStream, reactDebugStream, clientReferenceManifest, nonce));
996
+ const initialState = (0, _createinitialrouterstate.createInitialRouterState)({
997
+ // This is not used during hydration, so we don't have to pass a
998
+ // real timestamp.
999
+ navigatedAt: -1,
1000
+ initialFlightData: response.f,
1001
+ initialCanonicalUrlParts: response.c,
1002
+ initialRenderedSearch: response.q,
1003
+ initialParallelRoutes: new Map(),
1004
+ // location is not initialized in the SSR render
1005
+ // it's set to window.location during hydration
1006
+ location: null
1007
+ });
1008
+ const actionQueue = (0, _approuterinstance.createMutableActionQueue)(initialState, null);
1009
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_imageconfigcontextsharedruntime.ImageConfigContext.Provider, {
1010
+ value: images ?? _imageconfig.imageConfigDefault,
1011
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(ServerInsertedHTMLProvider, {
1012
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_approuter.default, {
1013
+ actionQueue: actionQueue,
1014
+ globalErrorState: response.G
1015
+ })
1016
+ })
1017
+ });
1018
+ /* eslint-enable @next/internal/no-ambiguous-jsx -- React Client */ }
1019
+ async function renderToHTMLOrFlightImpl(req, res, url, pagePath, query, renderOpts, workStore, parsedRequestHeaders, postponedState, serverComponentsHmrCache, sharedContext, interpolatedParams, fallbackRouteParams) {
1020
+ const isNotFoundPath = pagePath === '/404';
1021
+ if (isNotFoundPath) {
1022
+ res.statusCode = 404;
1023
+ }
1024
+ // A unique request timestamp used by development to ensure that it's
1025
+ // consistent and won't change during this request. This is important to
1026
+ // avoid that resources can be deduped by React Float if the same resource is
1027
+ // rendered or preloaded multiple times: `<link href="a.css?v={Date.now()}"/>`.
1028
+ const requestTimestamp = Date.now();
1029
+ const { clientReferenceManifest, serverActionsManifest, ComponentMod, nextFontManifest, serverActions, assetPrefix = '', enableTainting, cacheComponents } = renderOpts;
1030
+ // We need to expose the bundled `require` API globally for
1031
+ // react-server-dom-webpack. This is a hack until we find a better way.
1032
+ if (ComponentMod.__next_app__) {
1033
+ const instrumented = (0, _clientcomponentrendererlogger.wrapClientComponentLoader)(ComponentMod);
1034
+ // When we are prerendering if there is a cacheSignal for tracking
1035
+ // cache reads we track calls to `loadChunk` and `require`. This allows us
1036
+ // to treat chunk/module loading with similar semantics as cache reads to avoid
1037
+ // module loading from causing a prerender to abort too early.
1038
+ const shouldTrackModuleLoading = ()=>{
1039
+ if (!cacheComponents) {
1040
+ return false;
1041
+ }
1042
+ if (renderOpts.dev) {
1043
+ return true;
1044
+ }
1045
+ const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
1046
+ if (!workUnitStore) {
1047
+ return false;
1048
+ }
1049
+ switch(workUnitStore.type){
1050
+ case 'prerender':
1051
+ case 'prerender-client':
1052
+ case 'prerender-runtime':
1053
+ case 'cache':
1054
+ case 'private-cache':
1055
+ return true;
1056
+ case 'prerender-ppr':
1057
+ case 'prerender-legacy':
1058
+ case 'request':
1059
+ case 'unstable-cache':
1060
+ return false;
1061
+ default:
1062
+ workUnitStore;
1063
+ }
1064
+ };
1065
+ const __next_require__ = (...args)=>{
1066
+ const exportsOrPromise = instrumented.require(...args);
1067
+ if (shouldTrackModuleLoading()) {
1068
+ // requiring an async module returns a promise.
1069
+ (0, _trackmoduleloadingexternal.trackPendingImport)(exportsOrPromise);
1070
+ }
1071
+ return exportsOrPromise;
1072
+ };
1073
+ // @ts-expect-error
1074
+ globalThis.__next_require__ = __next_require__;
1075
+ const __next_chunk_load__ = (...args)=>{
1076
+ const loadingChunk = instrumented.loadChunk(...args);
1077
+ if (shouldTrackModuleLoading()) {
1078
+ (0, _trackmoduleloadingexternal.trackPendingChunkLoad)(loadingChunk);
1079
+ }
1080
+ return loadingChunk;
1081
+ };
1082
+ // @ts-expect-error
1083
+ globalThis.__next_chunk_load__ = __next_chunk_load__;
1084
+ }
1085
+ if (process.env.NODE_ENV === 'development' && renderOpts.setIsrStatus && !cacheComponents) {
1086
+ // Reset the ISR status at start of request.
1087
+ const { pathname } = new URL(req.url || '/', 'http://n');
1088
+ renderOpts.setIsrStatus(pathname, // Only pages using the Node runtime can use ISR, Edge is always dynamic.
1089
+ process.env.NEXT_RUNTIME === 'edge' ? false : undefined);
1090
+ }
1091
+ if (// The type check here ensures that `req` is correctly typed, and the
1092
+ // environment variable check provides dead code elimination.
1093
+ process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextRequest)(req)) {
1094
+ res.onClose(()=>{
1095
+ // We stop tracking fetch metrics when the response closes, since we
1096
+ // report them at that time.
1097
+ workStore.shouldTrackFetchMetrics = false;
1098
+ });
1099
+ req.originalRequest.on('end', ()=>{
1100
+ if ('performance' in globalThis) {
1101
+ const metrics = (0, _clientcomponentrendererlogger.getClientComponentLoaderMetrics)({
1102
+ reset: true
1103
+ });
1104
+ if (metrics) {
1105
+ (0, _tracer.getTracer)().startSpan(_constants.NextNodeServerSpan.clientComponentLoading, {
1106
+ startTime: metrics.clientComponentLoadStart,
1107
+ attributes: {
1108
+ 'next.clientComponentLoadCount': metrics.clientComponentLoadCount,
1109
+ 'next.span_type': _constants.NextNodeServerSpan.clientComponentLoading
1110
+ }
1111
+ }).end(metrics.clientComponentLoadStart + metrics.clientComponentLoadTimes);
1112
+ }
1113
+ }
1114
+ });
1115
+ }
1116
+ const metadata = {
1117
+ statusCode: isNotFoundPath ? 404 : undefined
1118
+ };
1119
+ const appUsingSizeAdjustment = !!(nextFontManifest == null ? void 0 : nextFontManifest.appUsingSizeAdjust);
1120
+ assertClientReferenceManifest(clientReferenceManifest);
1121
+ const serverModuleMap = (0, _actionutils.createServerModuleMap)({
1122
+ serverActionsManifest
1123
+ });
1124
+ (0, _encryptionutils.setReferenceManifestsSingleton)({
1125
+ page: workStore.page,
1126
+ clientReferenceManifest,
1127
+ serverActionsManifest,
1128
+ serverModuleMap
1129
+ });
1130
+ ComponentMod.patchFetch();
1131
+ // Pull out the hooks/references from the component.
1132
+ const { routeModule: { userland: { loaderTree } }, taintObjectReference } = ComponentMod;
1133
+ if (enableTainting) {
1134
+ taintObjectReference('Do not pass process.env to Client Components since it will leak sensitive data', process.env);
1135
+ }
1136
+ workStore.fetchMetrics = [];
1137
+ metadata.fetchMetrics = workStore.fetchMetrics;
1138
+ // don't modify original query object
1139
+ query = {
1140
+ ...query
1141
+ };
1142
+ (0, _internalutils.stripInternalQueries)(query);
1143
+ const { isStaticGeneration } = workStore;
1144
+ let requestId;
1145
+ let htmlRequestId;
1146
+ const { flightRouterState, isPrefetchRequest, isRuntimePrefetchRequest, isRSCRequest, isHmrRefresh, nonce } = parsedRequestHeaders;
1147
+ if (parsedRequestHeaders.requestId) {
1148
+ // If the client has provided a request ID (in development mode), we use it.
1149
+ requestId = parsedRequestHeaders.requestId;
1150
+ } else {
1151
+ // Otherwise we generate a new request ID.
1152
+ if (isStaticGeneration) {
1153
+ requestId = Buffer.from(await crypto.subtle.digest('SHA-1', Buffer.from(req.url))).toString('hex');
1154
+ } else if (process.env.NEXT_RUNTIME === 'edge') {
1155
+ requestId = crypto.randomUUID();
1156
+ } else {
1157
+ requestId = require('next/dist/compiled/nanoid').nanoid();
1158
+ }
1159
+ }
1160
+ // If the client has provided an HTML request ID, we use it to associate the
1161
+ // request with the HTML document from which it originated, which is used to
1162
+ // send debug information to the associated WebSocket client. Otherwise, this
1163
+ // is the request for the HTML document, so we use the request ID also as the
1164
+ // HTML request ID.
1165
+ htmlRequestId = parsedRequestHeaders.htmlRequestId || requestId;
1166
+ const getDynamicParamFromSegment = makeGetDynamicParamFromSegment(interpolatedParams, fallbackRouteParams);
1167
+ const isPossibleActionRequest = (0, _serveractionrequestmeta.getIsPossibleServerAction)(req);
1168
+ const implicitTags = await (0, _implicittags.getImplicitTags)(workStore.page, url, fallbackRouteParams);
1169
+ const ctx = {
1170
+ componentMod: ComponentMod,
1171
+ url,
1172
+ renderOpts,
1173
+ workStore,
1174
+ parsedRequestHeaders,
1175
+ getDynamicParamFromSegment,
1176
+ query,
1177
+ isPrefetch: isPrefetchRequest,
1178
+ isPossibleServerAction: isPossibleActionRequest,
1179
+ requestTimestamp,
1180
+ appUsingSizeAdjustment,
1181
+ flightRouterState,
1182
+ requestId,
1183
+ htmlRequestId,
1184
+ pagePath,
1185
+ clientReferenceManifest,
1186
+ assetPrefix,
1187
+ isNotFoundPath,
1188
+ nonce,
1189
+ res,
1190
+ sharedContext,
1191
+ implicitTags
1192
+ };
1193
+ (0, _tracer.getTracer)().setRootSpanAttribute('next.route', pagePath);
1194
+ if (isStaticGeneration) {
1195
+ // We're either building or revalidating. In either case we need to
1196
+ // prerender our page rather than render it.
1197
+ const prerenderToStreamWithTracing = (0, _tracer.getTracer)().wrap(_constants.AppRenderSpan.getBodyResult, {
1198
+ spanName: `prerender route (app) ${pagePath}`,
1199
+ attributes: {
1200
+ 'next.route': pagePath
1201
+ }
1202
+ }, prerenderToStream);
1203
+ const response = await prerenderToStreamWithTracing(req, res, ctx, metadata, loaderTree, fallbackRouteParams);
1204
+ // If we're debugging partial prerendering, print all the dynamic API accesses
1205
+ // that occurred during the render.
1206
+ // @TODO move into renderToStream function
1207
+ if (response.dynamicAccess && (0, _dynamicrendering.accessedDynamicData)(response.dynamicAccess) && renderOpts.isDebugDynamicAccesses) {
1208
+ (0, _log.warn)('The following dynamic usage was detected:');
1209
+ for (const access of (0, _dynamicrendering.formatDynamicAPIAccesses)(response.dynamicAccess)){
1210
+ (0, _log.warn)(access);
1211
+ }
1212
+ }
1213
+ // If we encountered any unexpected errors during build we fail the
1214
+ // prerendering phase and the build.
1215
+ if (workStore.invalidDynamicUsageError) {
1216
+ (0, _dynamicrendering.logDisallowedDynamicError)(workStore, workStore.invalidDynamicUsageError);
1217
+ throw new _staticgenerationbailout.StaticGenBailoutError();
1218
+ }
1219
+ if (response.digestErrorsMap.size) {
1220
+ const buildFailingError = response.digestErrorsMap.values().next().value;
1221
+ if (buildFailingError) throw buildFailingError;
1222
+ }
1223
+ // Pick first userland SSR error, which is also not a RSC error.
1224
+ if (response.ssrErrors.length) {
1225
+ const buildFailingError = response.ssrErrors.find((err)=>(0, _createerrorhandler.isUserLandError)(err));
1226
+ if (buildFailingError) throw buildFailingError;
1227
+ }
1228
+ const options = {
1229
+ metadata,
1230
+ contentType: _constants1.HTML_CONTENT_TYPE_HEADER
1231
+ };
1232
+ // If we have pending revalidates, wait until they are all resolved.
1233
+ if (workStore.pendingRevalidates || workStore.pendingRevalidateWrites || workStore.pendingRevalidatedTags) {
1234
+ const pendingPromise = (0, _revalidationutils.executeRevalidates)(workStore).finally(()=>{
1235
+ if (process.env.NEXT_PRIVATE_DEBUG_CACHE) {
1236
+ console.log('pending revalidates promise finished for:', url);
1237
+ }
1238
+ });
1239
+ if (renderOpts.waitUntil) {
1240
+ renderOpts.waitUntil(pendingPromise);
1241
+ } else {
1242
+ options.waitUntil = pendingPromise;
1243
+ }
1244
+ }
1245
+ applyMetadataFromPrerenderResult(response, metadata, workStore);
1246
+ if (response.renderResumeDataCache) {
1247
+ metadata.renderResumeDataCache = response.renderResumeDataCache;
1248
+ }
1249
+ return new _renderresult.default(await (0, _nodewebstreamshelper.streamToString)(response.stream), options);
1250
+ } else {
1251
+ // We're rendering dynamically
1252
+ const renderResumeDataCache = renderOpts.renderResumeDataCache ?? (postponedState == null ? void 0 : postponedState.renderResumeDataCache) ?? null;
1253
+ const rootParams = (0, _createcomponenttree.getRootParams)(loaderTree, ctx.getDynamicParamFromSegment);
1254
+ const devFallbackParams = (0, _requestmeta.getRequestMeta)(req, 'devFallbackParams') || null;
1255
+ const createRequestStore = _requeststore.createRequestStoreForRender.bind(null, req, res, url, rootParams, implicitTags, renderOpts.onUpdateCookies, renderOpts.previewProps, isHmrRefresh, serverComponentsHmrCache, renderResumeDataCache, devFallbackParams);
1256
+ const requestStore = createRequestStore();
1257
+ if (process.env.NODE_ENV === 'development' && renderOpts.setIsrStatus && !cacheComponents && // Only pages using the Node runtime can use ISR, so we only need to
1258
+ // update the status for those.
1259
+ // The type check here ensures that `req` is correctly typed, and the
1260
+ // environment variable check provides dead code elimination.
1261
+ process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextRequest)(req)) {
1262
+ const setIsrStatus = renderOpts.setIsrStatus;
1263
+ req.originalRequest.on('end', ()=>{
1264
+ const { pathname } = new URL(req.url || '/', 'http://n');
1265
+ const isStatic = !requestStore.usedDynamic && !workStore.forceDynamic;
1266
+ setIsrStatus(pathname, isStatic);
1267
+ });
1268
+ }
1269
+ if (isRSCRequest) {
1270
+ if (isRuntimePrefetchRequest) {
1271
+ return generateRuntimePrefetchResult(req, ctx, requestStore);
1272
+ } else {
1273
+ if (process.env.NODE_ENV === 'development' && process.env.NEXT_RUNTIME !== 'edge' && cacheComponents) {
1274
+ return generateDynamicFlightRenderResultWithStagesInDev(req, ctx, requestStore, createRequestStore);
1275
+ } else {
1276
+ return generateDynamicFlightRenderResult(req, ctx, requestStore);
1277
+ }
1278
+ }
1279
+ }
1280
+ const renderToStreamWithTracing = (0, _tracer.getTracer)().wrap(_constants.AppRenderSpan.getBodyResult, {
1281
+ spanName: `render route (app) ${pagePath}`,
1282
+ attributes: {
1283
+ 'next.route': pagePath
1284
+ }
1285
+ }, renderToStream);
1286
+ let didExecuteServerAction = false;
1287
+ let formState = null;
1288
+ if (isPossibleActionRequest) {
1289
+ // For action requests, we don't want to use the resume data cache.
1290
+ requestStore.renderResumeDataCache = null;
1291
+ // For action requests, we handle them differently with a special render result.
1292
+ const actionRequestResult = await (0, _actionhandler.handleAction)({
1293
+ req,
1294
+ res,
1295
+ ComponentMod,
1296
+ serverModuleMap,
1297
+ generateFlight: generateDynamicFlightRenderResult,
1298
+ workStore,
1299
+ requestStore,
1300
+ serverActions,
1301
+ ctx,
1302
+ metadata
1303
+ });
1304
+ if (actionRequestResult) {
1305
+ if (actionRequestResult.type === 'not-found') {
1306
+ const notFoundLoaderTree = createNotFoundLoaderTree(loaderTree);
1307
+ res.statusCode = 404;
1308
+ metadata.statusCode = 404;
1309
+ const stream = await renderToStreamWithTracing(requestStore, req, res, ctx, notFoundLoaderTree, formState, postponedState, metadata, undefined, devFallbackParams);
1310
+ return new _renderresult.default(stream, {
1311
+ metadata,
1312
+ contentType: _constants1.HTML_CONTENT_TYPE_HEADER
1313
+ });
1314
+ } else if (actionRequestResult.type === 'done') {
1315
+ if (actionRequestResult.result) {
1316
+ actionRequestResult.result.assignMetadata(metadata);
1317
+ return actionRequestResult.result;
1318
+ } else if (actionRequestResult.formState) {
1319
+ formState = actionRequestResult.formState;
1320
+ }
1321
+ }
1322
+ }
1323
+ didExecuteServerAction = true;
1324
+ // Restore the resume data cache
1325
+ requestStore.renderResumeDataCache = renderResumeDataCache;
1326
+ }
1327
+ const options = {
1328
+ metadata,
1329
+ contentType: _constants1.HTML_CONTENT_TYPE_HEADER
1330
+ };
1331
+ const stream = await renderToStreamWithTracing(// NOTE: in Cache Components (dev), if the render is restarted, it will use a different requestStore
1332
+ // than the one that we're passing in here.
1333
+ requestStore, req, res, ctx, loaderTree, formState, postponedState, metadata, // If we're rendering HTML after an action, we don't want restartable-render behavior
1334
+ // because the result should be dynamic, like it is in prod.
1335
+ // Also, the request store might have been mutated by the action (e.g. enabling draftMode)
1336
+ // and we currently we don't copy changes over when creating a new store,
1337
+ // so the restarted render wouldn't be correct.
1338
+ didExecuteServerAction ? undefined : createRequestStore, devFallbackParams);
1339
+ // Invalid dynamic usages should only error the request in development.
1340
+ // In production, it's better to produce a result.
1341
+ // (the dynamic error will still be thrown inside the component tree, but it's catchable by error boundaries)
1342
+ if (workStore.invalidDynamicUsageError && workStore.dev) {
1343
+ throw workStore.invalidDynamicUsageError;
1344
+ }
1345
+ // If we have pending revalidates, wait until they are all resolved.
1346
+ if (workStore.pendingRevalidates || workStore.pendingRevalidateWrites || workStore.pendingRevalidatedTags) {
1347
+ const pendingPromise = (0, _revalidationutils.executeRevalidates)(workStore).finally(()=>{
1348
+ if (process.env.NEXT_PRIVATE_DEBUG_CACHE) {
1349
+ console.log('pending revalidates promise finished for:', url);
1350
+ }
1351
+ });
1352
+ if (renderOpts.waitUntil) {
1353
+ renderOpts.waitUntil(pendingPromise);
1354
+ } else {
1355
+ options.waitUntil = pendingPromise;
1356
+ }
1357
+ }
1358
+ // Create the new render result for the response.
1359
+ return new _renderresult.default(stream, options);
1360
+ }
1361
+ }
1362
+ const renderToHTMLOrFlight = (req, res, pagePath, query, fallbackRouteParams, renderOpts, serverComponentsHmrCache, sharedContext)=>{
1363
+ var _renderOpts_previewProps;
1364
+ if (!req.url) {
1365
+ throw Object.defineProperty(new Error('Invalid URL'), "__NEXT_ERROR_CODE", {
1366
+ value: "E182",
1367
+ enumerable: false,
1368
+ configurable: true
1369
+ });
1370
+ }
1371
+ const url = (0, _parserelativeurl.parseRelativeUrl)(req.url, undefined, false);
1372
+ // We read these values from the request object as, in certain cases,
1373
+ // base-server will strip them to opt into different rendering behavior.
1374
+ const parsedRequestHeaders = parseRequestHeaders(req.headers, {
1375
+ isRoutePPREnabled: renderOpts.experimental.isRoutePPREnabled === true,
1376
+ previewModeId: (_renderOpts_previewProps = renderOpts.previewProps) == null ? void 0 : _renderOpts_previewProps.previewModeId
1377
+ });
1378
+ const { isPrefetchRequest, previouslyRevalidatedTags, nonce } = parsedRequestHeaders;
1379
+ let interpolatedParams;
1380
+ let postponedState = null;
1381
+ // If provided, the postpone state should be parsed so it can be provided to
1382
+ // React.
1383
+ if (typeof renderOpts.postponed === 'string') {
1384
+ if (fallbackRouteParams) {
1385
+ throw Object.defineProperty(new _invarianterror.InvariantError('postponed state should not be provided when fallback params are provided'), "__NEXT_ERROR_CODE", {
1386
+ value: "E592",
1387
+ enumerable: false,
1388
+ configurable: true
1389
+ });
1390
+ }
1391
+ interpolatedParams = (0, _getdynamicparam.interpolateParallelRouteParams)(renderOpts.ComponentMod.routeModule.userland.loaderTree, renderOpts.params ?? {}, pagePath, fallbackRouteParams);
1392
+ postponedState = (0, _postponedstate.parsePostponedState)(renderOpts.postponed, interpolatedParams);
1393
+ } else {
1394
+ interpolatedParams = (0, _getdynamicparam.interpolateParallelRouteParams)(renderOpts.ComponentMod.routeModule.userland.loaderTree, renderOpts.params ?? {}, pagePath, fallbackRouteParams);
1395
+ }
1396
+ if ((postponedState == null ? void 0 : postponedState.renderResumeDataCache) && renderOpts.renderResumeDataCache) {
1397
+ throw Object.defineProperty(new _invarianterror.InvariantError('postponed state and dev warmup immutable resume data cache should not be provided together'), "__NEXT_ERROR_CODE", {
1398
+ value: "E589",
1399
+ enumerable: false,
1400
+ configurable: true
1401
+ });
1402
+ }
1403
+ const workStore = (0, _workstore.createWorkStore)({
1404
+ page: renderOpts.routeModule.definition.page,
1405
+ renderOpts,
1406
+ // @TODO move to workUnitStore of type Request
1407
+ isPrefetchRequest,
1408
+ buildId: sharedContext.buildId,
1409
+ previouslyRevalidatedTags,
1410
+ nonce
1411
+ });
1412
+ return _workasyncstorageexternal.workAsyncStorage.run(workStore, // The function to run
1413
+ renderToHTMLOrFlightImpl, // all of it's args
1414
+ req, res, url, pagePath, query, renderOpts, workStore, parsedRequestHeaders, postponedState, serverComponentsHmrCache, sharedContext, interpolatedParams, fallbackRouteParams);
1415
+ };
1416
+ function applyMetadataFromPrerenderResult(response, metadata, workStore) {
1417
+ if (response.collectedTags) {
1418
+ metadata.fetchTags = response.collectedTags.join(',');
1419
+ }
1420
+ // Let the client router know how long to keep the cached entry around.
1421
+ const staleHeader = String(response.collectedStale);
1422
+ metadata.headers ??= {};
1423
+ metadata.headers[_approuterheaders.NEXT_ROUTER_STALE_TIME_HEADER] = staleHeader;
1424
+ // If force static is specifically set to false, we should not revalidate
1425
+ // the page.
1426
+ if (workStore.forceStatic === false || response.collectedRevalidate === 0) {
1427
+ metadata.cacheControl = {
1428
+ revalidate: 0,
1429
+ expire: undefined
1430
+ };
1431
+ } else {
1432
+ // Copy the cache control value onto the render result metadata.
1433
+ metadata.cacheControl = {
1434
+ revalidate: response.collectedRevalidate >= _constants1.INFINITE_CACHE ? false : response.collectedRevalidate,
1435
+ expire: response.collectedExpire >= _constants1.INFINITE_CACHE ? undefined : response.collectedExpire
1436
+ };
1437
+ }
1438
+ // provide bailout info for debugging
1439
+ if (metadata.cacheControl.revalidate === 0) {
1440
+ metadata.staticBailoutInfo = {
1441
+ description: workStore.dynamicUsageDescription,
1442
+ stack: workStore.dynamicUsageStack
1443
+ };
1444
+ }
1445
+ }
1446
+ async function renderToStream(requestStore, req, res, ctx, tree, formState, postponedState, metadata, createRequestStore, devFallbackParams) {
1447
+ /* eslint-disable @next/internal/no-ambiguous-jsx -- React Client */ const { assetPrefix, htmlRequestId, nonce, pagePath, renderOpts, requestId, workStore } = ctx;
1448
+ const { basePath, buildManifest, clientReferenceManifest, ComponentMod: { createElement, renderToReadableStream: serverRenderToReadableStream }, crossOrigin, dev = false, experimental, nextExport = false, onInstrumentationRequestError, page, reactMaxHeadersLength, setReactDebugChannel, shouldWaitOnAllReady, subresourceIntegrityManifest, supportsDynamicResponse, cacheComponents } = renderOpts;
1449
+ assertClientReferenceManifest(clientReferenceManifest);
1450
+ const { ServerInsertedHTMLProvider, renderServerInsertedHTML } = (0, _serverinsertedhtml.createServerInsertedHTML)();
1451
+ const getServerInsertedMetadata = (0, _createserverinsertedmetadata.createServerInsertedMetadata)(nonce);
1452
+ const tracingMetadata = (0, _utils1.getTracedMetadata)((0, _tracer.getTracer)().getTracePropagationData(), experimental.clientTraceMetadata);
1453
+ const polyfills = buildManifest.polyfillFiles.filter((polyfill)=>polyfill.endsWith('.js') && !polyfill.endsWith('.module.js')).map((polyfill)=>({
1454
+ src: `${assetPrefix}/_next/${polyfill}${(0, _getassetquerystring.getAssetQueryString)(ctx, false)}`,
1455
+ integrity: subresourceIntegrityManifest == null ? void 0 : subresourceIntegrityManifest[polyfill],
1456
+ crossOrigin,
1457
+ noModule: true,
1458
+ nonce
1459
+ }));
1460
+ const [preinitScripts, bootstrapScript] = (0, _requiredscripts.getRequiredScripts)(buildManifest, // Why is assetPrefix optional on renderOpts?
1461
+ // @TODO make it default empty string on renderOpts and get rid of it from ctx
1462
+ assetPrefix, crossOrigin, subresourceIntegrityManifest, (0, _getassetquerystring.getAssetQueryString)(ctx, true), nonce, page);
1463
+ // In development mode, set the request ID as a global variable, before the
1464
+ // bootstrap script is executed, which depends on it during hydration.
1465
+ const bootstrapScriptContent = process.env.NODE_ENV !== 'production' ? `self.__next_r=${JSON.stringify(requestId)}` : undefined;
1466
+ const reactServerErrorsByDigest = new Map();
1467
+ const silenceLogger = false;
1468
+ function onHTMLRenderRSCError(err) {
1469
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'react-server-components'));
1470
+ }
1471
+ const serverComponentsErrorHandler = (0, _createerrorhandler.createHTMLReactServerErrorHandler)(dev, nextExport, reactServerErrorsByDigest, silenceLogger, onHTMLRenderRSCError);
1472
+ function onHTMLRenderSSRError(err) {
1473
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'server-rendering'));
1474
+ }
1475
+ const allCapturedErrors = [];
1476
+ const htmlRendererErrorHandler = (0, _createerrorhandler.createHTMLErrorHandler)(dev, nextExport, reactServerErrorsByDigest, allCapturedErrors, silenceLogger, onHTMLRenderSSRError);
1477
+ let reactServerResult = null;
1478
+ let reactDebugStream;
1479
+ const setHeader = res.setHeader.bind(res);
1480
+ const appendHeader = res.appendHeader.bind(res);
1481
+ try {
1482
+ if (// We only want this behavior when we have React's dev builds available
1483
+ process.env.NODE_ENV === 'development' && // We only want this behavior when running `next dev`
1484
+ dev && // Edge routes never prerender so we don't have a Prerender environment for anything in edge runtime
1485
+ process.env.NEXT_RUNTIME !== 'edge' && // We only have a Prerender environment for projects opted into cacheComponents
1486
+ cacheComponents) {
1487
+ const [resolveValidation, validationOutlet] = createValidationOutlet();
1488
+ let debugChannel;
1489
+ const getPayload = async (// eslint-disable-next-line @typescript-eslint/no-shadow
1490
+ requestStore)=>{
1491
+ const payload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, getRSCPayload, tree, ctx, res.statusCode === 404);
1492
+ // Placing the validation outlet in the payload is safe
1493
+ // even if we end up discarding a render and restarting,
1494
+ // because we're not going to wait for the stream to complete,
1495
+ // so leaving the validation unresolved is fine.
1496
+ payload._validation = validationOutlet;
1497
+ if (isBypassingCachesInDev(renderOpts, requestStore)) {
1498
+ // Mark the RSC payload to indicate that caches were bypassed in dev.
1499
+ // This lets the client know not to cache anything based on this render.
1500
+ if (renderOpts.setCacheStatus) {
1501
+ // we know this is available when cacheComponents is enabled, but typeguard to be safe
1502
+ renderOpts.setCacheStatus('bypass', htmlRequestId);
1503
+ }
1504
+ payload._bypassCachesInDev = createElement(WarnForBypassCachesInDev, {
1505
+ route: workStore.route
1506
+ });
1507
+ }
1508
+ return payload;
1509
+ };
1510
+ if (// We only do this flow if we can safely recreate the store from scratch
1511
+ // (which is not the case for renders after an action)
1512
+ createRequestStore && // We only do this flow if we're not bypassing caches in dev using
1513
+ // "disable cache" in devtools or a hard refresh (cache-control: "no-store")
1514
+ !isBypassingCachesInDev(renderOpts, requestStore)) {
1515
+ const { stream: serverStream, debugChannel: returnedDebugChannel, requestStore: finalRequestStore } = await renderWithRestartOnCacheMissInDev(ctx, requestStore, createRequestStore, getPayload, serverComponentsErrorHandler);
1516
+ reactServerResult = new _apprenderprerenderutils.ReactServerResult(serverStream);
1517
+ requestStore = finalRequestStore;
1518
+ debugChannel = returnedDebugChannel;
1519
+ } else {
1520
+ // We're either bypassing caches or we can't restart the render.
1521
+ // Do a dynamic render, but with (basic) environment labels.
1522
+ debugChannel = setReactDebugChannel && createDebugChannel();
1523
+ const serverStream = await stagedRenderToReadableStreamWithoutCachesInDev(ctx, requestStore, getPayload, clientReferenceManifest, {
1524
+ onError: serverComponentsErrorHandler,
1525
+ filterStackFrame,
1526
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
1527
+ });
1528
+ reactServerResult = new _apprenderprerenderutils.ReactServerResult(serverStream);
1529
+ }
1530
+ if (debugChannel && setReactDebugChannel) {
1531
+ const [readableSsr, readableBrowser] = debugChannel.clientSide.readable.tee();
1532
+ reactDebugStream = readableSsr;
1533
+ setReactDebugChannel({
1534
+ readable: readableBrowser
1535
+ }, htmlRequestId, requestId);
1536
+ }
1537
+ // TODO(restart-on-cache-miss):
1538
+ // This can probably be optimized to do less work,
1539
+ // because we've already made sure that we have warm caches.
1540
+ _consoleasyncstorageexternal.consoleAsyncStorage.run({
1541
+ dim: true
1542
+ }, spawnDynamicValidationInDev, resolveValidation, tree, ctx, res.statusCode === 404, clientReferenceManifest, requestStore, devFallbackParams);
1543
+ } else {
1544
+ // This is a dynamic render. We don't do dynamic tracking because we're not prerendering
1545
+ const RSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, getRSCPayload, tree, ctx, res.statusCode === 404);
1546
+ const debugChannel = setReactDebugChannel && createDebugChannel();
1547
+ if (debugChannel) {
1548
+ const [readableSsr, readableBrowser] = debugChannel.clientSide.readable.tee();
1549
+ reactDebugStream = readableSsr;
1550
+ setReactDebugChannel({
1551
+ readable: readableBrowser
1552
+ }, htmlRequestId, requestId);
1553
+ }
1554
+ reactServerResult = new _apprenderprerenderutils.ReactServerResult(_workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, serverRenderToReadableStream, RSCPayload, clientReferenceManifest.clientModules, {
1555
+ filterStackFrame,
1556
+ onError: serverComponentsErrorHandler,
1557
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
1558
+ }));
1559
+ }
1560
+ // React doesn't start rendering synchronously but we want the RSC render to have a chance to start
1561
+ // before we begin SSR rendering because we want to capture any available preload headers so we tick
1562
+ // one task before continuing
1563
+ await (0, _scheduler.waitAtLeastOneReactRenderTask)();
1564
+ // If provided, the postpone state should be parsed as JSON so it can be
1565
+ // provided to React.
1566
+ if (typeof renderOpts.postponed === 'string') {
1567
+ if ((postponedState == null ? void 0 : postponedState.type) === _postponedstate.DynamicState.DATA) {
1568
+ // We have a complete HTML Document in the prerender but we need to
1569
+ // still include the new server component render because it was not included
1570
+ // in the static prelude.
1571
+ const inlinedReactServerDataStream = (0, _useflightresponse.createInlinedDataReadableStream)(reactServerResult.tee(), nonce, formState);
1572
+ return (0, _nodewebstreamshelper.chainStreams)(inlinedReactServerDataStream, (0, _nodewebstreamshelper.createDocumentClosingStream)());
1573
+ } else if (postponedState) {
1574
+ // We assume we have dynamic HTML requiring a resume render to complete
1575
+ const { postponed, preludeState } = (0, _postponedstate.getPostponedFromState)(postponedState);
1576
+ const resume = require('react-dom/server').resume;
1577
+ const htmlStream = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, resume, /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
1578
+ reactServerStream: reactServerResult.tee(),
1579
+ reactDebugStream: reactDebugStream,
1580
+ preinitScripts: preinitScripts,
1581
+ clientReferenceManifest: clientReferenceManifest,
1582
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
1583
+ nonce: nonce,
1584
+ images: ctx.renderOpts.images
1585
+ }), postponed, {
1586
+ onError: htmlRendererErrorHandler,
1587
+ nonce
1588
+ });
1589
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
1590
+ polyfills,
1591
+ renderServerInsertedHTML,
1592
+ serverCapturedErrors: allCapturedErrors,
1593
+ basePath,
1594
+ tracingMetadata: tracingMetadata
1595
+ });
1596
+ return await (0, _nodewebstreamshelper.continueDynamicHTMLResume)(htmlStream, {
1597
+ // If the prelude is empty (i.e. is no static shell), we should wait for initial HTML to be rendered
1598
+ // to avoid injecting RSC data too early.
1599
+ // If we have a non-empty-prelude (i.e. a static HTML shell), then it's already been sent separately,
1600
+ // so we shouldn't wait for any HTML to be emitted from the resume before sending RSC data.
1601
+ delayDataUntilFirstHtmlChunk: preludeState === _postponedstate.DynamicHTMLPreludeState.Empty,
1602
+ inlinedDataStream: (0, _useflightresponse.createInlinedDataReadableStream)(reactServerResult.consume(), nonce, formState),
1603
+ getServerInsertedHTML,
1604
+ getServerInsertedMetadata
1605
+ });
1606
+ }
1607
+ }
1608
+ // This is a regular dynamic render
1609
+ const renderToReadableStream = require('react-dom/server').renderToReadableStream;
1610
+ const htmlStream = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, renderToReadableStream, /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
1611
+ reactServerStream: reactServerResult.tee(),
1612
+ reactDebugStream: reactDebugStream,
1613
+ preinitScripts: preinitScripts,
1614
+ clientReferenceManifest: clientReferenceManifest,
1615
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
1616
+ nonce: nonce,
1617
+ images: ctx.renderOpts.images
1618
+ }), {
1619
+ onError: htmlRendererErrorHandler,
1620
+ nonce,
1621
+ onHeaders: (headers)=>{
1622
+ headers.forEach((value, key)=>{
1623
+ appendHeader(key, value);
1624
+ });
1625
+ },
1626
+ maxHeadersLength: reactMaxHeadersLength,
1627
+ bootstrapScriptContent,
1628
+ bootstrapScripts: [
1629
+ bootstrapScript
1630
+ ],
1631
+ formState
1632
+ });
1633
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
1634
+ polyfills,
1635
+ renderServerInsertedHTML,
1636
+ serverCapturedErrors: allCapturedErrors,
1637
+ basePath,
1638
+ tracingMetadata: tracingMetadata
1639
+ });
1640
+ /**
1641
+ * Rules of Static & Dynamic HTML:
1642
+ *
1643
+ * 1.) We must generate static HTML unless the caller explicitly opts
1644
+ * in to dynamic HTML support.
1645
+ *
1646
+ * 2.) If dynamic HTML support is requested, we must honor that request
1647
+ * or throw an error. It is the sole responsibility of the caller to
1648
+ * ensure they aren't e.g. requesting dynamic HTML for a static page.
1649
+ *
1650
+ * 3.) If `shouldWaitOnAllReady` is true, which indicates we need to
1651
+ * resolve all suspenses and generate a full HTML. e.g. when it's a
1652
+ * html limited bot requests, we produce the full HTML content.
1653
+ *
1654
+ * These rules help ensure that other existing features like request caching,
1655
+ * coalescing, and ISR continue working as intended.
1656
+ */ const generateStaticHTML = supportsDynamicResponse !== true || !!shouldWaitOnAllReady;
1657
+ return await (0, _nodewebstreamshelper.continueFizzStream)(htmlStream, {
1658
+ inlinedDataStream: (0, _useflightresponse.createInlinedDataReadableStream)(reactServerResult.consume(), nonce, formState),
1659
+ isStaticGeneration: generateStaticHTML,
1660
+ isBuildTimePrerendering: ctx.workStore.isBuildTimePrerendering === true,
1661
+ buildId: ctx.workStore.buildId,
1662
+ getServerInsertedHTML,
1663
+ getServerInsertedMetadata,
1664
+ validateRootLayout: dev
1665
+ });
1666
+ } catch (err) {
1667
+ if ((0, _staticgenerationbailout.isStaticGenBailoutError)(err) || typeof err === 'object' && err !== null && 'message' in err && typeof err.message === 'string' && err.message.includes('https://nextjs.org/docs/advanced-features/static-html-export')) {
1668
+ // Ensure that "next dev" prints the red error overlay
1669
+ throw err;
1670
+ }
1671
+ // If a bailout made it to this point, it means it wasn't wrapped inside
1672
+ // a suspense boundary.
1673
+ const shouldBailoutToCSR = (0, _bailouttocsr.isBailoutToCSRError)(err);
1674
+ if (shouldBailoutToCSR) {
1675
+ const stack = (0, _formatservererror.getStackWithoutErrorMessage)(err);
1676
+ (0, _log.error)(`${err.reason} should be wrapped in a suspense boundary at page "${pagePath}". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\n${stack}`);
1677
+ throw err;
1678
+ }
1679
+ let errorType;
1680
+ if ((0, _httpaccessfallback.isHTTPAccessFallbackError)(err)) {
1681
+ res.statusCode = (0, _httpaccessfallback.getAccessFallbackHTTPStatus)(err);
1682
+ metadata.statusCode = res.statusCode;
1683
+ errorType = (0, _httpaccessfallback.getAccessFallbackErrorTypeByStatus)(res.statusCode);
1684
+ } else if ((0, _redirecterror.isRedirectError)(err)) {
1685
+ errorType = 'redirect';
1686
+ res.statusCode = (0, _redirect.getRedirectStatusCodeFromError)(err);
1687
+ metadata.statusCode = res.statusCode;
1688
+ const redirectUrl = (0, _addpathprefix.addPathPrefix)((0, _redirect.getURLFromRedirectError)(err), basePath);
1689
+ // If there were mutable cookies set, we need to set them on the
1690
+ // response.
1691
+ const headers = new Headers();
1692
+ if ((0, _requestcookies.appendMutableCookies)(headers, requestStore.mutableCookies)) {
1693
+ setHeader('set-cookie', Array.from(headers.values()));
1694
+ }
1695
+ setHeader('location', redirectUrl);
1696
+ } else if (!shouldBailoutToCSR) {
1697
+ res.statusCode = 500;
1698
+ metadata.statusCode = res.statusCode;
1699
+ }
1700
+ const [errorPreinitScripts, errorBootstrapScript] = (0, _requiredscripts.getRequiredScripts)(buildManifest, assetPrefix, crossOrigin, subresourceIntegrityManifest, (0, _getassetquerystring.getAssetQueryString)(ctx, false), nonce, '/_not-found/page');
1701
+ const errorRSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, getErrorRSCPayload, tree, ctx, reactServerErrorsByDigest.has(err.digest) ? null : err, errorType);
1702
+ const errorServerStream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, serverRenderToReadableStream, errorRSCPayload, clientReferenceManifest.clientModules, {
1703
+ filterStackFrame,
1704
+ onError: serverComponentsErrorHandler
1705
+ });
1706
+ if (reactServerResult === null) {
1707
+ // We errored when we did not have an RSC stream to read from. This is not just a render
1708
+ // error, we need to throw early
1709
+ throw err;
1710
+ }
1711
+ try {
1712
+ const fizzStream = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _nodewebstreamshelper.renderToInitialFizzStream, {
1713
+ ReactDOMServer: require('react-dom/server'),
1714
+ element: /*#__PURE__*/ (0, _jsxruntime.jsx)(ErrorApp, {
1715
+ reactServerStream: errorServerStream,
1716
+ reactDebugStream: undefined,
1717
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
1718
+ preinitScripts: errorPreinitScripts,
1719
+ clientReferenceManifest: clientReferenceManifest,
1720
+ nonce: nonce,
1721
+ images: ctx.renderOpts.images
1722
+ }),
1723
+ streamOptions: {
1724
+ nonce,
1725
+ bootstrapScriptContent,
1726
+ // Include hydration scripts in the HTML
1727
+ bootstrapScripts: [
1728
+ errorBootstrapScript
1729
+ ],
1730
+ formState
1731
+ }
1732
+ });
1733
+ /**
1734
+ * Rules of Static & Dynamic HTML:
1735
+ *
1736
+ * 1.) We must generate static HTML unless the caller explicitly opts
1737
+ * in to dynamic HTML support.
1738
+ *
1739
+ * 2.) If dynamic HTML support is requested, we must honor that request
1740
+ * or throw an error. It is the sole responsibility of the caller to
1741
+ * ensure they aren't e.g. requesting dynamic HTML for a static page.
1742
+ * 3.) If `shouldWaitOnAllReady` is true, which indicates we need to
1743
+ * resolve all suspenses and generate a full HTML. e.g. when it's a
1744
+ * html limited bot requests, we produce the full HTML content.
1745
+ *
1746
+ * These rules help ensure that other existing features like request caching,
1747
+ * coalescing, and ISR continue working as intended.
1748
+ */ const generateStaticHTML = supportsDynamicResponse !== true || !!shouldWaitOnAllReady;
1749
+ return await (0, _nodewebstreamshelper.continueFizzStream)(fizzStream, {
1750
+ inlinedDataStream: (0, _useflightresponse.createInlinedDataReadableStream)(// This is intentionally using the readable datastream from the
1751
+ // main render rather than the flight data from the error page
1752
+ // render
1753
+ reactServerResult.consume(), nonce, formState),
1754
+ isStaticGeneration: generateStaticHTML,
1755
+ isBuildTimePrerendering: ctx.workStore.isBuildTimePrerendering === true,
1756
+ buildId: ctx.workStore.buildId,
1757
+ getServerInsertedHTML: (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
1758
+ polyfills,
1759
+ renderServerInsertedHTML,
1760
+ serverCapturedErrors: [],
1761
+ basePath,
1762
+ tracingMetadata: tracingMetadata
1763
+ }),
1764
+ getServerInsertedMetadata,
1765
+ validateRootLayout: dev
1766
+ });
1767
+ } catch (finalErr) {
1768
+ if (process.env.NODE_ENV === 'development' && (0, _httpaccessfallback.isHTTPAccessFallbackError)(finalErr)) {
1769
+ const { bailOnRootNotFound } = require('../../client/components/dev-root-http-access-fallback-boundary');
1770
+ bailOnRootNotFound();
1771
+ }
1772
+ throw finalErr;
1773
+ }
1774
+ }
1775
+ /* eslint-enable @next/internal/no-ambiguous-jsx */ }
1776
+ async function renderWithRestartOnCacheMissInDev(ctx, initialRequestStore, createRequestStore, getPayload, onError) {
1777
+ const { htmlRequestId, renderOpts, componentMod: { routeModule: { userland: { loaderTree } } } } = ctx;
1778
+ const { clientReferenceManifest, ComponentMod, setCacheStatus, setReactDebugChannel } = renderOpts;
1779
+ assertClientReferenceManifest(clientReferenceManifest);
1780
+ const hasRuntimePrefetch = await (0, _stagedvalidation.anySegmentHasRuntimePrefetchEnabled)(loaderTree);
1781
+ // If the render is restarted, we'll recreate a fresh request store
1782
+ let requestStore = initialRequestStore;
1783
+ const environmentName = ()=>{
1784
+ const currentStage = requestStore.stagedRendering.currentStage;
1785
+ switch(currentStage){
1786
+ case _stagedrendering.RenderStage.Static:
1787
+ return 'Prerender';
1788
+ case _stagedrendering.RenderStage.Runtime:
1789
+ return hasRuntimePrefetch ? 'Prefetch' : 'Prefetchable';
1790
+ case _stagedrendering.RenderStage.Dynamic:
1791
+ return 'Server';
1792
+ default:
1793
+ currentStage;
1794
+ throw Object.defineProperty(new _invarianterror.InvariantError(`Invalid render stage: ${currentStage}`), "__NEXT_ERROR_CODE", {
1795
+ value: "E881",
1796
+ enumerable: false,
1797
+ configurable: true
1798
+ });
1799
+ }
1800
+ };
1801
+ //===============================================
1802
+ // Initial render
1803
+ //===============================================
1804
+ // Try to render the page and see if there's any cache misses.
1805
+ // If there are, wait for caches to finish and restart the render.
1806
+ // This render might end up being used as a prospective render (if there's cache misses),
1807
+ // so we need to set it up for filling caches.
1808
+ const cacheSignal = new _cachesignal.CacheSignal();
1809
+ // If we encounter async modules that delay rendering, we'll also need to restart.
1810
+ // TODO(restart-on-cache-miss): technically, we only need to wait for pending *server* modules here,
1811
+ // but `trackPendingModules` doesn't distinguish between client and server.
1812
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
1813
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
1814
+ const initialReactController = new AbortController();
1815
+ const initialDataController = new AbortController() // Controls hanging promises we create
1816
+ ;
1817
+ const initialStageController = new _stagedrendering.StagedRenderingController(initialDataController.signal);
1818
+ requestStore.prerenderResumeDataCache = prerenderResumeDataCache;
1819
+ // `getRenderResumeDataCache` will fall back to using `prerenderResumeDataCache` as `renderResumeDataCache`,
1820
+ // so not having a resume data cache won't break any expectations in case we don't need to restart.
1821
+ requestStore.renderResumeDataCache = null;
1822
+ requestStore.stagedRendering = initialStageController;
1823
+ requestStore.asyncApiPromises = createAsyncApiPromisesInDev(initialStageController, requestStore.cookies, requestStore.mutableCookies, requestStore.headers);
1824
+ requestStore.cacheSignal = cacheSignal;
1825
+ let debugChannel = setReactDebugChannel && createDebugChannel();
1826
+ const initialRscPayload = await getPayload(requestStore);
1827
+ const maybeInitialServerStream = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, ()=>(0, _apprenderrenderutils.pipelineInSequentialTasks)(()=>{
1828
+ // Static stage
1829
+ const stream = ComponentMod.renderToReadableStream(initialRscPayload, clientReferenceManifest.clientModules, {
1830
+ onError,
1831
+ environmentName,
1832
+ filterStackFrame,
1833
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide,
1834
+ signal: initialReactController.signal
1835
+ });
1836
+ // If we abort the render, we want to reject the stage-dependent promises as well.
1837
+ // Note that we want to install this listener after the render is started
1838
+ // so that it runs after react is finished running its abort code.
1839
+ initialReactController.signal.addEventListener('abort', ()=>{
1840
+ initialDataController.abort(initialReactController.signal.reason);
1841
+ });
1842
+ return stream;
1843
+ }, (stream)=>{
1844
+ // Runtime stage
1845
+ initialStageController.advanceStage(_stagedrendering.RenderStage.Runtime);
1846
+ // If we had a cache miss in the static stage, we'll have to disard this stream
1847
+ // and render again once the caches are warm.
1848
+ if (cacheSignal.hasPendingReads()) {
1849
+ return null;
1850
+ }
1851
+ // If there's no cache misses, we'll continue rendering,
1852
+ // and see if there's any cache misses in the runtime stage.
1853
+ return stream;
1854
+ }, async (maybeStream)=>{
1855
+ // Dynamic stage
1856
+ // If we had cache misses in either of the previous stages,
1857
+ // then we'll only use this render for filling caches.
1858
+ // We won't advance the stage, and thus leave dynamic APIs hanging,
1859
+ // because they won't be cached anyway, so it'd be wasted work.
1860
+ if (maybeStream === null || cacheSignal.hasPendingReads()) {
1861
+ return null;
1862
+ }
1863
+ // If there's no cache misses, we'll use this render, so let it advance to the dynamic stage.
1864
+ initialStageController.advanceStage(_stagedrendering.RenderStage.Dynamic);
1865
+ return maybeStream;
1866
+ }));
1867
+ if (maybeInitialServerStream !== null) {
1868
+ // No cache misses. We can use the stream as is.
1869
+ return {
1870
+ stream: maybeInitialServerStream,
1871
+ debugChannel,
1872
+ requestStore
1873
+ };
1874
+ }
1875
+ if (process.env.NODE_ENV === 'development' && setCacheStatus) {
1876
+ setCacheStatus('filling', htmlRequestId);
1877
+ }
1878
+ // Cache miss. We will use the initial render to fill caches, and discard its result.
1879
+ // Then, we can render again with warm caches.
1880
+ // TODO(restart-on-cache-miss):
1881
+ // This might end up waiting for more caches than strictly necessary,
1882
+ // because we can't abort the render yet, and we'll let runtime/dynamic APIs resolve.
1883
+ // Ideally we'd only wait for caches that are needed in the static stage.
1884
+ // This will be optimized in the future by not allowing runtime/dynamic APIs to resolve.
1885
+ await cacheSignal.cacheReady();
1886
+ initialReactController.abort();
1887
+ //===============================================
1888
+ // Final render (restarted)
1889
+ //===============================================
1890
+ // The initial render acted as a prospective render to warm the caches.
1891
+ requestStore = createRequestStore();
1892
+ const finalStageController = new _stagedrendering.StagedRenderingController();
1893
+ // We've filled the caches, so now we can render as usual,
1894
+ // without any cache-filling mechanics.
1895
+ requestStore.prerenderResumeDataCache = null;
1896
+ requestStore.renderResumeDataCache = (0, _resumedatacache.createRenderResumeDataCache)(prerenderResumeDataCache);
1897
+ requestStore.stagedRendering = finalStageController;
1898
+ requestStore.cacheSignal = null;
1899
+ requestStore.asyncApiPromises = createAsyncApiPromisesInDev(finalStageController, requestStore.cookies, requestStore.mutableCookies, requestStore.headers);
1900
+ // The initial render already wrote to its debug channel.
1901
+ // We're not using it, so we need to create a new one.
1902
+ debugChannel = setReactDebugChannel && createDebugChannel();
1903
+ const finalRscPayload = await getPayload(requestStore);
1904
+ const finalServerStream = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, ()=>(0, _apprenderrenderutils.pipelineInSequentialTasks)(()=>{
1905
+ // Static stage
1906
+ return ComponentMod.renderToReadableStream(finalRscPayload, clientReferenceManifest.clientModules, {
1907
+ onError,
1908
+ environmentName,
1909
+ filterStackFrame,
1910
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
1911
+ });
1912
+ }, (stream)=>{
1913
+ // Runtime stage
1914
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Runtime);
1915
+ return stream;
1916
+ }, (stream)=>{
1917
+ // Dynamic stage
1918
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Dynamic);
1919
+ return stream;
1920
+ }));
1921
+ if (process.env.NODE_ENV === 'development' && setCacheStatus) {
1922
+ setCacheStatus('filled', htmlRequestId);
1923
+ }
1924
+ return {
1925
+ stream: finalServerStream,
1926
+ debugChannel,
1927
+ requestStore
1928
+ };
1929
+ }
1930
+ function createAsyncApiPromisesInDev(stagedRendering, cookies, mutableCookies, headers) {
1931
+ return {
1932
+ // Runtime APIs
1933
+ cookies: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, 'cookies', cookies),
1934
+ mutableCookies: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, 'cookies', mutableCookies),
1935
+ headers: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, 'headers', headers),
1936
+ // These are not used directly, but we chain other `params`/`searchParams` promises off of them.
1937
+ sharedParamsParent: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, undefined, '<internal params>'),
1938
+ sharedSearchParamsParent: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, undefined, '<internal searchParams>'),
1939
+ connection: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Dynamic, 'connection', undefined)
1940
+ };
1941
+ }
1942
+ function createDebugChannel() {
1943
+ if (process.env.NODE_ENV === 'production') {
1944
+ return undefined;
1945
+ }
1946
+ let readableController;
1947
+ const clientSideReadable = new ReadableStream({
1948
+ start (controller) {
1949
+ readableController = controller;
1950
+ }
1951
+ });
1952
+ return {
1953
+ serverSide: {
1954
+ writable: new WritableStream({
1955
+ write (chunk) {
1956
+ readableController == null ? void 0 : readableController.enqueue(chunk);
1957
+ },
1958
+ close () {
1959
+ readableController == null ? void 0 : readableController.close();
1960
+ },
1961
+ abort (err) {
1962
+ readableController == null ? void 0 : readableController.error(err);
1963
+ }
1964
+ })
1965
+ },
1966
+ clientSide: {
1967
+ readable: clientSideReadable
1968
+ }
1969
+ };
1970
+ }
1971
+ function createValidationOutlet() {
1972
+ let resolveValidation;
1973
+ let outlet = new Promise((resolve)=>{
1974
+ resolveValidation = resolve;
1975
+ });
1976
+ return [
1977
+ resolveValidation,
1978
+ outlet
1979
+ ];
1980
+ }
1981
+ /**
1982
+ * This function is a fork of prerenderToStream cacheComponents branch.
1983
+ * While it doesn't return a stream we want it to have identical
1984
+ * prerender semantics to prerenderToStream and should update it
1985
+ * in conjunction with any changes to that function.
1986
+ */ async function spawnDynamicValidationInDev(resolveValidation, tree, ctx, isNotFound, clientReferenceManifest, requestStore, fallbackRouteParams) {
1987
+ var _requestStore_cookies_get;
1988
+ const { componentMod: ComponentMod, getDynamicParamFromSegment, implicitTags, nonce, renderOpts, workStore } = ctx;
1989
+ const { allowEmptyStaticShell = false } = renderOpts;
1990
+ // These values are placeholder values for this validating render
1991
+ // that are provided during the actual prerenderToStream.
1992
+ const preinitScripts = ()=>{};
1993
+ const { ServerInsertedHTMLProvider } = (0, _serverinsertedhtml.createServerInsertedHTML)();
1994
+ const rootParams = (0, _createcomponenttree.getRootParams)(ComponentMod.routeModule.userland.loaderTree, getDynamicParamFromSegment);
1995
+ const hmrRefreshHash = (_requestStore_cookies_get = requestStore.cookies.get(_approuterheaders.NEXT_HMR_REFRESH_HASH_COOKIE)) == null ? void 0 : _requestStore_cookies_get.value;
1996
+ // The prerender controller represents the lifetime of the prerender. It will
1997
+ // be aborted when a task is complete or a synchronously aborting API is
1998
+ // called. Notably, during prospective prerenders, this does not actually
1999
+ // terminate the prerender itself, which will continue until all caches are
2000
+ // filled.
2001
+ const initialServerPrerenderController = new AbortController();
2002
+ // This controller is used to abort the React prerender.
2003
+ const initialServerReactController = new AbortController();
2004
+ // This controller represents the lifetime of the React prerender. Its signal
2005
+ // can be used for any I/O operation to abort the I/O and/or to reject, when
2006
+ // prerendering aborts. This includes our own hanging promises for accessing
2007
+ // request data, and for fetch calls. It might be replaced in the future by
2008
+ // React.cacheSignal(). It's aborted after the React controller, so that no
2009
+ // pending I/O can register abort listeners that are called before React's
2010
+ // abort listener is called. This ensures that pending I/O is not rejected too
2011
+ // early when aborting the prerender. Notably, during the prospective
2012
+ // prerender, it is different from the prerender controller because we don't
2013
+ // want to end the React prerender until all caches are filled.
2014
+ const initialServerRenderController = new AbortController();
2015
+ // The cacheSignal helps us track whether caches are still filling or we are
2016
+ // ready to cut the render off.
2017
+ const cacheSignal = new _cachesignal.CacheSignal();
2018
+ const { createElement } = ComponentMod;
2019
+ // The resume data cache here should use a fresh instance as it's
2020
+ // performing a fresh prerender. If we get to implementing the
2021
+ // prerendering of an already prerendered page, we should use the passed
2022
+ // resume data cache instead.
2023
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
2024
+ const initialServerPayloadPrerenderStore = {
2025
+ type: 'prerender',
2026
+ phase: 'render',
2027
+ rootParams,
2028
+ fallbackRouteParams,
2029
+ implicitTags,
2030
+ // While this render signal isn't going to be used to abort a React render while getting the RSC payload
2031
+ // various request data APIs bind to this controller to reject after completion.
2032
+ renderSignal: initialServerRenderController.signal,
2033
+ // When we generate the RSC payload we might abort this controller due to sync IO
2034
+ // but we don't actually care about sync IO in this phase so we use a throw away controller
2035
+ // that isn't connected to anything
2036
+ controller: new AbortController(),
2037
+ // During the initial prerender we need to track all cache reads to ensure
2038
+ // we render long enough to fill every cache it is possible to visit during
2039
+ // the final prerender.
2040
+ cacheSignal,
2041
+ dynamicTracking: null,
2042
+ allowEmptyStaticShell,
2043
+ revalidate: _constants1.INFINITE_CACHE,
2044
+ expire: _constants1.INFINITE_CACHE,
2045
+ stale: _constants1.INFINITE_CACHE,
2046
+ tags: [
2047
+ ...implicitTags.tags
2048
+ ],
2049
+ prerenderResumeDataCache,
2050
+ renderResumeDataCache: null,
2051
+ hmrRefreshHash
2052
+ };
2053
+ // We're not going to use the result of this render because the only time it could be used
2054
+ // is if it completes in a microtask and that's likely very rare for any non-trivial app
2055
+ const initialServerPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPayloadPrerenderStore, getRSCPayload, tree, ctx, isNotFound);
2056
+ const initialServerPrerenderStore = {
2057
+ type: 'prerender',
2058
+ phase: 'render',
2059
+ rootParams,
2060
+ fallbackRouteParams,
2061
+ implicitTags,
2062
+ renderSignal: initialServerRenderController.signal,
2063
+ controller: initialServerPrerenderController,
2064
+ // During the initial prerender we need to track all cache reads to ensure
2065
+ // we render long enough to fill every cache it is possible to visit during
2066
+ // the final prerender.
2067
+ cacheSignal,
2068
+ dynamicTracking: null,
2069
+ allowEmptyStaticShell,
2070
+ revalidate: _constants1.INFINITE_CACHE,
2071
+ expire: _constants1.INFINITE_CACHE,
2072
+ stale: _constants1.INFINITE_CACHE,
2073
+ tags: [
2074
+ ...implicitTags.tags
2075
+ ],
2076
+ prerenderResumeDataCache,
2077
+ renderResumeDataCache: null,
2078
+ hmrRefreshHash
2079
+ };
2080
+ const pendingInitialServerResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPrerenderStore, ComponentMod.prerender, initialServerPayload, clientReferenceManifest.clientModules, {
2081
+ filterStackFrame,
2082
+ onError: (err)=>{
2083
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
2084
+ if (digest) {
2085
+ return digest;
2086
+ }
2087
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
2088
+ // TODO: Aggregate
2089
+ console.error(err);
2090
+ return undefined;
2091
+ }
2092
+ if (initialServerPrerenderController.signal.aborted) {
2093
+ // The render aborted before this error was handled which indicates
2094
+ // the error is caused by unfinished components within the render
2095
+ return;
2096
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2097
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
2098
+ }
2099
+ },
2100
+ // We don't want to stop rendering until the cacheSignal is complete so we pass
2101
+ // a different signal to this render call than is used by dynamic APIs to signify
2102
+ // transitioning out of the prerender environment
2103
+ signal: initialServerReactController.signal
2104
+ });
2105
+ // The listener to abort our own render controller must be added after React
2106
+ // has added its listener, to ensure that pending I/O is not aborted/rejected
2107
+ // too early.
2108
+ initialServerReactController.signal.addEventListener('abort', ()=>{
2109
+ initialServerRenderController.abort();
2110
+ }, {
2111
+ once: true
2112
+ });
2113
+ // Wait for all caches to be finished filling and for async imports to resolve
2114
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
2115
+ await cacheSignal.cacheReady();
2116
+ initialServerReactController.abort();
2117
+ // We don't need to continue the prerender process if we already
2118
+ // detected invalid dynamic usage in the initial prerender phase.
2119
+ const { invalidDynamicUsageError } = workStore;
2120
+ if (invalidDynamicUsageError) {
2121
+ resolveValidation(createElement(LogSafely, {
2122
+ fn: ()=>{
2123
+ console.error(invalidDynamicUsageError);
2124
+ }
2125
+ }));
2126
+ return;
2127
+ }
2128
+ let initialServerResult;
2129
+ try {
2130
+ initialServerResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResult)(pendingInitialServerResult);
2131
+ } catch (err) {
2132
+ if (initialServerReactController.signal.aborted || initialServerPrerenderController.signal.aborted) {
2133
+ // These are expected errors that might error the prerender. we ignore them.
2134
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2135
+ // We don't normally log these errors because we are going to retry anyway but
2136
+ // it can be useful for debugging Next.js itself to get visibility here when needed
2137
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
2138
+ }
2139
+ }
2140
+ if (initialServerResult) {
2141
+ const initialClientPrerenderController = new AbortController();
2142
+ const initialClientReactController = new AbortController();
2143
+ const initialClientRenderController = new AbortController();
2144
+ const initialClientPrerenderStore = {
2145
+ type: 'prerender-client',
2146
+ phase: 'render',
2147
+ rootParams,
2148
+ fallbackRouteParams,
2149
+ implicitTags,
2150
+ renderSignal: initialClientRenderController.signal,
2151
+ controller: initialClientPrerenderController,
2152
+ // For HTML Generation the only cache tracked activity
2153
+ // is module loading, which has it's own cache signal
2154
+ cacheSignal: null,
2155
+ dynamicTracking: null,
2156
+ allowEmptyStaticShell,
2157
+ revalidate: _constants1.INFINITE_CACHE,
2158
+ expire: _constants1.INFINITE_CACHE,
2159
+ stale: _constants1.INFINITE_CACHE,
2160
+ tags: [
2161
+ ...implicitTags.tags
2162
+ ],
2163
+ prerenderResumeDataCache,
2164
+ renderResumeDataCache: null,
2165
+ hmrRefreshHash: undefined
2166
+ };
2167
+ const prerender = require('react-dom/static').prerender;
2168
+ const pendingInitialClientResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialClientPrerenderStore, prerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx -- React Client
2169
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
2170
+ reactServerStream: initialServerResult.asUnclosingStream(),
2171
+ reactDebugStream: undefined,
2172
+ preinitScripts: preinitScripts,
2173
+ clientReferenceManifest: clientReferenceManifest,
2174
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
2175
+ nonce: nonce,
2176
+ images: ctx.renderOpts.images
2177
+ }), {
2178
+ signal: initialClientReactController.signal,
2179
+ onError: (err)=>{
2180
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
2181
+ if (digest) {
2182
+ return digest;
2183
+ }
2184
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
2185
+ // TODO: Aggregate
2186
+ console.error(err);
2187
+ return undefined;
2188
+ }
2189
+ if (initialClientReactController.signal.aborted) {
2190
+ // These are expected errors that might error the prerender. we ignore them.
2191
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2192
+ // We don't normally log these errors because we are going to retry anyway but
2193
+ // it can be useful for debugging Next.js itself to get visibility here when needed
2194
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
2195
+ }
2196
+ }
2197
+ });
2198
+ // The listener to abort our own render controller must be added after React
2199
+ // has added its listener, to ensure that pending I/O is not
2200
+ // aborted/rejected too early.
2201
+ initialClientReactController.signal.addEventListener('abort', ()=>{
2202
+ initialClientRenderController.abort();
2203
+ }, {
2204
+ once: true
2205
+ });
2206
+ pendingInitialClientResult.catch((err)=>{
2207
+ if (initialClientReactController.signal.aborted || (0, _dynamicrendering.isPrerenderInterruptedError)(err)) {
2208
+ // These are expected errors that might error the prerender. we ignore them.
2209
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2210
+ // We don't normally log these errors because we are going to retry anyway but
2211
+ // it can be useful for debugging Next.js itself to get visibility here when needed
2212
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
2213
+ }
2214
+ });
2215
+ // This is mostly needed for dynamic `import()`s in client components.
2216
+ // Promises passed to client were already awaited above (assuming that they came from cached functions)
2217
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
2218
+ await cacheSignal.cacheReady();
2219
+ initialClientReactController.abort();
2220
+ }
2221
+ const finalServerReactController = new AbortController();
2222
+ const finalServerRenderController = new AbortController();
2223
+ const finalServerPayloadPrerenderStore = {
2224
+ type: 'prerender',
2225
+ phase: 'render',
2226
+ rootParams,
2227
+ fallbackRouteParams,
2228
+ implicitTags,
2229
+ // While this render signal isn't going to be used to abort a React render while getting the RSC payload
2230
+ // various request data APIs bind to this controller to reject after completion.
2231
+ renderSignal: finalServerRenderController.signal,
2232
+ // When we generate the RSC payload we might abort this controller due to sync IO
2233
+ // but we don't actually care about sync IO in this phase so we use a throw away controller
2234
+ // that isn't connected to anything
2235
+ controller: new AbortController(),
2236
+ // All caches we could read must already be filled so no tracking is necessary
2237
+ cacheSignal: null,
2238
+ dynamicTracking: null,
2239
+ allowEmptyStaticShell,
2240
+ revalidate: _constants1.INFINITE_CACHE,
2241
+ expire: _constants1.INFINITE_CACHE,
2242
+ stale: _constants1.INFINITE_CACHE,
2243
+ tags: [
2244
+ ...implicitTags.tags
2245
+ ],
2246
+ prerenderResumeDataCache,
2247
+ renderResumeDataCache: null,
2248
+ hmrRefreshHash
2249
+ };
2250
+ const finalAttemptRSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalServerPayloadPrerenderStore, getRSCPayload, tree, ctx, isNotFound);
2251
+ const serverDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(false // isDebugDynamicAccesses
2252
+ );
2253
+ const finalServerPrerenderStore = {
2254
+ type: 'prerender',
2255
+ phase: 'render',
2256
+ rootParams,
2257
+ fallbackRouteParams,
2258
+ implicitTags,
2259
+ renderSignal: finalServerRenderController.signal,
2260
+ controller: finalServerReactController,
2261
+ // All caches we could read must already be filled so no tracking is necessary
2262
+ cacheSignal: null,
2263
+ dynamicTracking: serverDynamicTracking,
2264
+ allowEmptyStaticShell,
2265
+ revalidate: _constants1.INFINITE_CACHE,
2266
+ expire: _constants1.INFINITE_CACHE,
2267
+ stale: _constants1.INFINITE_CACHE,
2268
+ tags: [
2269
+ ...implicitTags.tags
2270
+ ],
2271
+ prerenderResumeDataCache,
2272
+ renderResumeDataCache: null,
2273
+ hmrRefreshHash
2274
+ };
2275
+ const reactServerResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResult)((0, _apprenderprerenderutils.prerenderAndAbortInSequentialTasks)(async ()=>{
2276
+ const pendingPrerenderResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(// The store to scope
2277
+ finalServerPrerenderStore, // The function to run
2278
+ ComponentMod.prerender, // ... the arguments for the function to run
2279
+ finalAttemptRSCPayload, clientReferenceManifest.clientModules, {
2280
+ filterStackFrame,
2281
+ onError: (err)=>{
2282
+ if (finalServerReactController.signal.aborted && (0, _dynamicrendering.isPrerenderInterruptedError)(err)) {
2283
+ return err.digest;
2284
+ }
2285
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
2286
+ // TODO: Aggregate
2287
+ console.error(err);
2288
+ return undefined;
2289
+ }
2290
+ return (0, _createerrorhandler.getDigestForWellKnownError)(err);
2291
+ },
2292
+ signal: finalServerReactController.signal
2293
+ });
2294
+ // The listener to abort our own render controller must be added after
2295
+ // React has added its listener, to ensure that pending I/O is not
2296
+ // aborted/rejected too early.
2297
+ finalServerReactController.signal.addEventListener('abort', ()=>{
2298
+ finalServerRenderController.abort();
2299
+ }, {
2300
+ once: true
2301
+ });
2302
+ return pendingPrerenderResult;
2303
+ }, ()=>{
2304
+ finalServerReactController.abort();
2305
+ }));
2306
+ const clientDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(false //isDebugDynamicAccesses
2307
+ );
2308
+ const finalClientReactController = new AbortController();
2309
+ const finalClientRenderController = new AbortController();
2310
+ const finalClientPrerenderStore = {
2311
+ type: 'prerender-client',
2312
+ phase: 'render',
2313
+ rootParams,
2314
+ fallbackRouteParams,
2315
+ implicitTags,
2316
+ renderSignal: finalClientRenderController.signal,
2317
+ controller: finalClientReactController,
2318
+ // No APIs require a cacheSignal through the workUnitStore during the HTML prerender
2319
+ cacheSignal: null,
2320
+ dynamicTracking: clientDynamicTracking,
2321
+ allowEmptyStaticShell,
2322
+ revalidate: _constants1.INFINITE_CACHE,
2323
+ expire: _constants1.INFINITE_CACHE,
2324
+ stale: _constants1.INFINITE_CACHE,
2325
+ tags: [
2326
+ ...implicitTags.tags
2327
+ ],
2328
+ prerenderResumeDataCache,
2329
+ renderResumeDataCache: null,
2330
+ hmrRefreshHash
2331
+ };
2332
+ let dynamicValidation = (0, _dynamicrendering.createDynamicValidationState)();
2333
+ try {
2334
+ const prerender = require('react-dom/static').prerender;
2335
+ let { prelude: unprocessedPrelude } = await (0, _apprenderprerenderutils.prerenderAndAbortInSequentialTasks)(()=>{
2336
+ const pendingFinalClientResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalClientPrerenderStore, prerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx -- React Client
2337
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
2338
+ reactServerStream: reactServerResult.asUnclosingStream(),
2339
+ reactDebugStream: undefined,
2340
+ preinitScripts: preinitScripts,
2341
+ clientReferenceManifest: clientReferenceManifest,
2342
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
2343
+ nonce: nonce,
2344
+ images: ctx.renderOpts.images
2345
+ }), {
2346
+ signal: finalClientReactController.signal,
2347
+ onError: (err, errorInfo)=>{
2348
+ if ((0, _dynamicrendering.isPrerenderInterruptedError)(err) || finalClientReactController.signal.aborted) {
2349
+ const componentStack = errorInfo.componentStack;
2350
+ if (typeof componentStack === 'string') {
2351
+ (0, _dynamicrendering.trackAllowedDynamicAccess)(workStore, componentStack, dynamicValidation, clientDynamicTracking);
2352
+ }
2353
+ return;
2354
+ }
2355
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
2356
+ // TODO: Aggregate
2357
+ console.error(err);
2358
+ return undefined;
2359
+ }
2360
+ return (0, _createerrorhandler.getDigestForWellKnownError)(err);
2361
+ }
2362
+ });
2363
+ // The listener to abort our own render controller must be added after
2364
+ // React has added its listener, to ensure that pending I/O is not
2365
+ // aborted/rejected too early.
2366
+ finalClientReactController.signal.addEventListener('abort', ()=>{
2367
+ finalClientRenderController.abort();
2368
+ }, {
2369
+ once: true
2370
+ });
2371
+ return pendingFinalClientResult;
2372
+ }, ()=>{
2373
+ finalClientReactController.abort();
2374
+ });
2375
+ const { preludeIsEmpty } = await (0, _apprenderprerenderutils.processPrelude)(unprocessedPrelude);
2376
+ resolveValidation(createElement(LogSafely, {
2377
+ fn: _dynamicrendering.throwIfDisallowedDynamic.bind(null, workStore, preludeIsEmpty ? _dynamicrendering.PreludeState.Empty : _dynamicrendering.PreludeState.Full, dynamicValidation, serverDynamicTracking)
2378
+ }));
2379
+ } catch (thrownValue) {
2380
+ // Even if the root errors we still want to report any cache components errors
2381
+ // that were discovered before the root errored.
2382
+ let loggingFunction = _dynamicrendering.throwIfDisallowedDynamic.bind(null, workStore, _dynamicrendering.PreludeState.Errored, dynamicValidation, serverDynamicTracking);
2383
+ if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2384
+ // We don't normally log these errors because we are going to retry anyway but
2385
+ // it can be useful for debugging Next.js itself to get visibility here when needed
2386
+ const originalLoggingFunction = loggingFunction;
2387
+ loggingFunction = ()=>{
2388
+ console.error('During dynamic validation the root of the page errored. The next logged error is the thrown value. It may be a duplicate of errors reported during the normal development mode render.');
2389
+ console.error(thrownValue);
2390
+ originalLoggingFunction();
2391
+ };
2392
+ }
2393
+ resolveValidation(createElement(LogSafely, {
2394
+ fn: loggingFunction
2395
+ }));
2396
+ }
2397
+ }
2398
+ async function LogSafely({ fn }) {
2399
+ try {
2400
+ await fn();
2401
+ } catch {}
2402
+ return null;
2403
+ }
2404
+ /**
2405
+ * Determines whether we should generate static flight data.
2406
+ */ function shouldGenerateStaticFlightData(workStore) {
2407
+ const { isStaticGeneration } = workStore;
2408
+ if (!isStaticGeneration) return false;
2409
+ return true;
2410
+ }
2411
+ async function prerenderToStream(req, res, ctx, metadata, tree, fallbackRouteParams) {
2412
+ // When prerendering formState is always null. We still include it
2413
+ // because some shared APIs expect a formState value and this is slightly
2414
+ // more explicit than making it an optional function argument
2415
+ const formState = null;
2416
+ const { assetPrefix, getDynamicParamFromSegment, implicitTags, nonce, pagePath, renderOpts, workStore } = ctx;
2417
+ const { allowEmptyStaticShell = false, basePath, buildManifest, clientReferenceManifest, ComponentMod, crossOrigin, dev = false, experimental, isDebugDynamicAccesses, nextExport = false, onInstrumentationRequestError, page, reactMaxHeadersLength, subresourceIntegrityManifest, cacheComponents } = renderOpts;
2418
+ assertClientReferenceManifest(clientReferenceManifest);
2419
+ const rootParams = (0, _createcomponenttree.getRootParams)(tree, getDynamicParamFromSegment);
2420
+ const { ServerInsertedHTMLProvider, renderServerInsertedHTML } = (0, _serverinsertedhtml.createServerInsertedHTML)();
2421
+ const getServerInsertedMetadata = (0, _createserverinsertedmetadata.createServerInsertedMetadata)(nonce);
2422
+ const tracingMetadata = (0, _utils1.getTracedMetadata)((0, _tracer.getTracer)().getTracePropagationData(), experimental.clientTraceMetadata);
2423
+ const polyfills = buildManifest.polyfillFiles.filter((polyfill)=>polyfill.endsWith('.js') && !polyfill.endsWith('.module.js')).map((polyfill)=>({
2424
+ src: `${assetPrefix}/_next/${polyfill}${(0, _getassetquerystring.getAssetQueryString)(ctx, false)}`,
2425
+ integrity: subresourceIntegrityManifest == null ? void 0 : subresourceIntegrityManifest[polyfill],
2426
+ crossOrigin,
2427
+ noModule: true,
2428
+ nonce
2429
+ }));
2430
+ const [preinitScripts, bootstrapScript] = (0, _requiredscripts.getRequiredScripts)(buildManifest, // Why is assetPrefix optional on renderOpts?
2431
+ // @TODO make it default empty string on renderOpts and get rid of it from ctx
2432
+ assetPrefix, crossOrigin, subresourceIntegrityManifest, (0, _getassetquerystring.getAssetQueryString)(ctx, true), nonce, page);
2433
+ const reactServerErrorsByDigest = new Map();
2434
+ // We don't report errors during prerendering through our instrumentation hooks
2435
+ const silenceLogger = !!experimental.isRoutePPREnabled;
2436
+ function onHTMLRenderRSCError(err) {
2437
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'react-server-components'));
2438
+ }
2439
+ const serverComponentsErrorHandler = (0, _createerrorhandler.createHTMLReactServerErrorHandler)(dev, nextExport, reactServerErrorsByDigest, silenceLogger, onHTMLRenderRSCError);
2440
+ function onHTMLRenderSSRError(err) {
2441
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'server-rendering'));
2442
+ }
2443
+ const allCapturedErrors = [];
2444
+ const htmlRendererErrorHandler = (0, _createerrorhandler.createHTMLErrorHandler)(dev, nextExport, reactServerErrorsByDigest, allCapturedErrors, silenceLogger, onHTMLRenderSSRError);
2445
+ let reactServerPrerenderResult = null;
2446
+ const setMetadataHeader = (name)=>{
2447
+ metadata.headers ??= {};
2448
+ metadata.headers[name] = res.getHeader(name);
2449
+ };
2450
+ const setHeader = (name, value)=>{
2451
+ res.setHeader(name, value);
2452
+ setMetadataHeader(name);
2453
+ return res;
2454
+ };
2455
+ const appendHeader = (name, value)=>{
2456
+ if (Array.isArray(value)) {
2457
+ value.forEach((item)=>{
2458
+ res.appendHeader(name, item);
2459
+ });
2460
+ } else {
2461
+ res.appendHeader(name, value);
2462
+ }
2463
+ setMetadataHeader(name);
2464
+ };
2465
+ const selectStaleTime = createSelectStaleTime(experimental);
2466
+ let prerenderStore = null;
2467
+ try {
2468
+ if (cacheComponents) {
2469
+ /**
2470
+ * cacheComponents with PPR
2471
+ *
2472
+ * The general approach is to render the RSC stream first allowing any cache reads to resolve.
2473
+ * Once we have settled all cache reads we restart the render and abort after a single Task.
2474
+ *
2475
+ * Unlike with the non PPR case we can't synchronously abort the render when a dynamic API is used
2476
+ * during the initial render because we need to ensure all caches can be filled as part of the initial Task
2477
+ * and a synchronous abort might prevent us from filling all caches.
2478
+ *
2479
+ * Once the render is complete we allow the SSR render to finish and use a combination of the postponed state
2480
+ * and the reactServerIsDynamic value to determine how to treat the resulting render
2481
+ */ // The prerender controller represents the lifetime of the prerender. It
2482
+ // will be aborted when a task is complete or a synchronously aborting API
2483
+ // is called. Notably, during prospective prerenders, this does not
2484
+ // actually terminate the prerender itself, which will continue until all
2485
+ // caches are filled.
2486
+ const initialServerPrerenderController = new AbortController();
2487
+ // This controller is used to abort the React prerender.
2488
+ const initialServerReactController = new AbortController();
2489
+ // This controller represents the lifetime of the React prerender. Its
2490
+ // signal can be used for any I/O operation to abort the I/O and/or to
2491
+ // reject, when prerendering aborts. This includes our own hanging
2492
+ // promises for accessing request data, and for fetch calls. It might be
2493
+ // replaced in the future by React.cacheSignal(). It's aborted after the
2494
+ // React controller, so that no pending I/O can register abort listeners
2495
+ // that are called before React's abort listener is called. This ensures
2496
+ // that pending I/O is not rejected too early when aborting the prerender.
2497
+ // Notably, during the prospective prerender, it is different from the
2498
+ // prerender controller because we don't want to end the React prerender
2499
+ // until all caches are filled.
2500
+ const initialServerRenderController = new AbortController();
2501
+ // The cacheSignal helps us track whether caches are still filling or we are ready
2502
+ // to cut the render off.
2503
+ const cacheSignal = new _cachesignal.CacheSignal();
2504
+ let resumeDataCache;
2505
+ let renderResumeDataCache = null;
2506
+ let prerenderResumeDataCache = null;
2507
+ if (renderOpts.renderResumeDataCache) {
2508
+ // If a prefilled immutable render resume data cache is provided, e.g.
2509
+ // when prerendering an optional fallback shell after having prerendered
2510
+ // pages with defined params, we use this instead of a prerender resume
2511
+ // data cache.
2512
+ resumeDataCache = renderResumeDataCache = renderOpts.renderResumeDataCache;
2513
+ } else {
2514
+ // Otherwise we create a new mutable prerender resume data cache.
2515
+ resumeDataCache = prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
2516
+ }
2517
+ const initialServerPayloadPrerenderStore = {
2518
+ type: 'prerender',
2519
+ phase: 'render',
2520
+ rootParams,
2521
+ fallbackRouteParams,
2522
+ implicitTags,
2523
+ // While this render signal isn't going to be used to abort a React render while getting the RSC payload
2524
+ // various request data APIs bind to this controller to reject after completion.
2525
+ renderSignal: initialServerRenderController.signal,
2526
+ // When we generate the RSC payload we might abort this controller due to sync IO
2527
+ // but we don't actually care about sync IO in this phase so we use a throw away controller
2528
+ // that isn't connected to anything
2529
+ controller: new AbortController(),
2530
+ // During the initial prerender we need to track all cache reads to ensure
2531
+ // we render long enough to fill every cache it is possible to visit during
2532
+ // the final prerender.
2533
+ cacheSignal,
2534
+ dynamicTracking: null,
2535
+ allowEmptyStaticShell,
2536
+ revalidate: _constants1.INFINITE_CACHE,
2537
+ expire: _constants1.INFINITE_CACHE,
2538
+ stale: _constants1.INFINITE_CACHE,
2539
+ tags: [
2540
+ ...implicitTags.tags
2541
+ ],
2542
+ prerenderResumeDataCache,
2543
+ renderResumeDataCache,
2544
+ hmrRefreshHash: undefined
2545
+ };
2546
+ // We're not going to use the result of this render because the only time it could be used
2547
+ // is if it completes in a microtask and that's likely very rare for any non-trivial app
2548
+ const initialServerPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPayloadPrerenderStore, getRSCPayload, tree, ctx, res.statusCode === 404);
2549
+ const initialServerPrerenderStore = prerenderStore = {
2550
+ type: 'prerender',
2551
+ phase: 'render',
2552
+ rootParams,
2553
+ fallbackRouteParams,
2554
+ implicitTags,
2555
+ renderSignal: initialServerRenderController.signal,
2556
+ controller: initialServerPrerenderController,
2557
+ // During the initial prerender we need to track all cache reads to ensure
2558
+ // we render long enough to fill every cache it is possible to visit during
2559
+ // the final prerender.
2560
+ cacheSignal,
2561
+ dynamicTracking: null,
2562
+ allowEmptyStaticShell,
2563
+ revalidate: _constants1.INFINITE_CACHE,
2564
+ expire: _constants1.INFINITE_CACHE,
2565
+ stale: _constants1.INFINITE_CACHE,
2566
+ tags: [
2567
+ ...implicitTags.tags
2568
+ ],
2569
+ prerenderResumeDataCache,
2570
+ renderResumeDataCache,
2571
+ hmrRefreshHash: undefined
2572
+ };
2573
+ const pendingInitialServerResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPrerenderStore, ComponentMod.prerender, initialServerPayload, clientReferenceManifest.clientModules, {
2574
+ filterStackFrame,
2575
+ onError: (err)=>{
2576
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
2577
+ if (digest) {
2578
+ return digest;
2579
+ }
2580
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
2581
+ // TODO: Aggregate
2582
+ console.error(err);
2583
+ return undefined;
2584
+ }
2585
+ if (initialServerPrerenderController.signal.aborted) {
2586
+ // The render aborted before this error was handled which indicates
2587
+ // the error is caused by unfinished components within the render
2588
+ return;
2589
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2590
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
2591
+ }
2592
+ },
2593
+ // We don't want to stop rendering until the cacheSignal is complete so we pass
2594
+ // a different signal to this render call than is used by dynamic APIs to signify
2595
+ // transitioning out of the prerender environment
2596
+ signal: initialServerReactController.signal
2597
+ });
2598
+ // The listener to abort our own render controller must be added after
2599
+ // React has added its listener, to ensure that pending I/O is not
2600
+ // aborted/rejected too early.
2601
+ initialServerReactController.signal.addEventListener('abort', ()=>{
2602
+ initialServerRenderController.abort();
2603
+ initialServerPrerenderController.abort();
2604
+ }, {
2605
+ once: true
2606
+ });
2607
+ // Wait for all caches to be finished filling and for async imports to resolve
2608
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
2609
+ await cacheSignal.cacheReady();
2610
+ initialServerReactController.abort();
2611
+ // We don't need to continue the prerender process if we already
2612
+ // detected invalid dynamic usage in the initial prerender phase.
2613
+ if (workStore.invalidDynamicUsageError) {
2614
+ (0, _dynamicrendering.logDisallowedDynamicError)(workStore, workStore.invalidDynamicUsageError);
2615
+ throw new _staticgenerationbailout.StaticGenBailoutError();
2616
+ }
2617
+ let initialServerResult;
2618
+ try {
2619
+ initialServerResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResult)(pendingInitialServerResult);
2620
+ } catch (err) {
2621
+ if (initialServerReactController.signal.aborted || initialServerPrerenderController.signal.aborted) {
2622
+ // These are expected errors that might error the prerender. we ignore them.
2623
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2624
+ // We don't normally log these errors because we are going to retry anyway but
2625
+ // it can be useful for debugging Next.js itself to get visibility here when needed
2626
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
2627
+ }
2628
+ }
2629
+ if (initialServerResult) {
2630
+ const initialClientPrerenderController = new AbortController();
2631
+ const initialClientReactController = new AbortController();
2632
+ const initialClientRenderController = new AbortController();
2633
+ const initialClientPrerenderStore = {
2634
+ type: 'prerender-client',
2635
+ phase: 'render',
2636
+ rootParams,
2637
+ fallbackRouteParams,
2638
+ implicitTags,
2639
+ renderSignal: initialClientRenderController.signal,
2640
+ controller: initialClientPrerenderController,
2641
+ // For HTML Generation the only cache tracked activity
2642
+ // is module loading, which has it's own cache signal
2643
+ cacheSignal: null,
2644
+ dynamicTracking: null,
2645
+ allowEmptyStaticShell,
2646
+ revalidate: _constants1.INFINITE_CACHE,
2647
+ expire: _constants1.INFINITE_CACHE,
2648
+ stale: _constants1.INFINITE_CACHE,
2649
+ tags: [
2650
+ ...implicitTags.tags
2651
+ ],
2652
+ prerenderResumeDataCache,
2653
+ renderResumeDataCache,
2654
+ hmrRefreshHash: undefined
2655
+ };
2656
+ const prerender = require('react-dom/static').prerender;
2657
+ const pendingInitialClientResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialClientPrerenderStore, prerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx
2658
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
2659
+ reactServerStream: initialServerResult.asUnclosingStream(),
2660
+ reactDebugStream: undefined,
2661
+ preinitScripts: preinitScripts,
2662
+ clientReferenceManifest: clientReferenceManifest,
2663
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
2664
+ nonce: nonce,
2665
+ images: ctx.renderOpts.images
2666
+ }), {
2667
+ signal: initialClientReactController.signal,
2668
+ onError: (err)=>{
2669
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
2670
+ if (digest) {
2671
+ return digest;
2672
+ }
2673
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
2674
+ // TODO: Aggregate
2675
+ console.error(err);
2676
+ return undefined;
2677
+ }
2678
+ if (initialClientReactController.signal.aborted) {
2679
+ // These are expected errors that might error the prerender. we ignore them.
2680
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2681
+ // We don't normally log these errors because we are going to retry anyway but
2682
+ // it can be useful for debugging Next.js itself to get visibility here when needed
2683
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
2684
+ }
2685
+ },
2686
+ bootstrapScripts: [
2687
+ bootstrapScript
2688
+ ]
2689
+ });
2690
+ // The listener to abort our own render controller must be added after
2691
+ // React has added its listener, to ensure that pending I/O is not
2692
+ // aborted/rejected too early.
2693
+ initialClientReactController.signal.addEventListener('abort', ()=>{
2694
+ initialClientRenderController.abort();
2695
+ }, {
2696
+ once: true
2697
+ });
2698
+ pendingInitialClientResult.catch((err)=>{
2699
+ if (initialClientReactController.signal.aborted || (0, _dynamicrendering.isPrerenderInterruptedError)(err)) {
2700
+ // These are expected errors that might error the prerender. we ignore them.
2701
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2702
+ // We don't normally log these errors because we are going to retry anyway but
2703
+ // it can be useful for debugging Next.js itself to get visibility here when needed
2704
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route);
2705
+ }
2706
+ });
2707
+ // This is mostly needed for dynamic `import()`s in client components.
2708
+ // Promises passed to client were already awaited above (assuming that they came from cached functions)
2709
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
2710
+ await cacheSignal.cacheReady();
2711
+ initialClientReactController.abort();
2712
+ }
2713
+ const finalServerReactController = new AbortController();
2714
+ const finalServerRenderController = new AbortController();
2715
+ const finalServerPayloadPrerenderStore = {
2716
+ type: 'prerender',
2717
+ phase: 'render',
2718
+ rootParams,
2719
+ fallbackRouteParams,
2720
+ implicitTags,
2721
+ // While this render signal isn't going to be used to abort a React render while getting the RSC payload
2722
+ // various request data APIs bind to this controller to reject after completion.
2723
+ renderSignal: finalServerRenderController.signal,
2724
+ // When we generate the RSC payload we might abort this controller due to sync IO
2725
+ // but we don't actually care about sync IO in this phase so we use a throw away controller
2726
+ // that isn't connected to anything
2727
+ controller: new AbortController(),
2728
+ // All caches we could read must already be filled so no tracking is necessary
2729
+ cacheSignal: null,
2730
+ dynamicTracking: null,
2731
+ allowEmptyStaticShell,
2732
+ revalidate: _constants1.INFINITE_CACHE,
2733
+ expire: _constants1.INFINITE_CACHE,
2734
+ stale: _constants1.INFINITE_CACHE,
2735
+ tags: [
2736
+ ...implicitTags.tags
2737
+ ],
2738
+ prerenderResumeDataCache,
2739
+ renderResumeDataCache,
2740
+ hmrRefreshHash: undefined
2741
+ };
2742
+ const finalAttemptRSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalServerPayloadPrerenderStore, getRSCPayload, tree, ctx, res.statusCode === 404);
2743
+ const serverDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(isDebugDynamicAccesses);
2744
+ let serverIsDynamic = false;
2745
+ const finalServerPrerenderStore = prerenderStore = {
2746
+ type: 'prerender',
2747
+ phase: 'render',
2748
+ rootParams,
2749
+ fallbackRouteParams,
2750
+ implicitTags,
2751
+ renderSignal: finalServerRenderController.signal,
2752
+ controller: finalServerReactController,
2753
+ // All caches we could read must already be filled so no tracking is necessary
2754
+ cacheSignal: null,
2755
+ dynamicTracking: serverDynamicTracking,
2756
+ allowEmptyStaticShell,
2757
+ revalidate: _constants1.INFINITE_CACHE,
2758
+ expire: _constants1.INFINITE_CACHE,
2759
+ stale: _constants1.INFINITE_CACHE,
2760
+ tags: [
2761
+ ...implicitTags.tags
2762
+ ],
2763
+ prerenderResumeDataCache,
2764
+ renderResumeDataCache,
2765
+ hmrRefreshHash: undefined
2766
+ };
2767
+ let prerenderIsPending = true;
2768
+ const reactServerResult = reactServerPrerenderResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResult)((0, _apprenderprerenderutils.prerenderAndAbortInSequentialTasks)(async ()=>{
2769
+ const pendingPrerenderResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(// The store to scope
2770
+ finalServerPrerenderStore, // The function to run
2771
+ ComponentMod.prerender, // ... the arguments for the function to run
2772
+ finalAttemptRSCPayload, clientReferenceManifest.clientModules, {
2773
+ filterStackFrame,
2774
+ onError: (err)=>{
2775
+ return serverComponentsErrorHandler(err);
2776
+ },
2777
+ signal: finalServerReactController.signal
2778
+ });
2779
+ // The listener to abort our own render controller must be added
2780
+ // after React has added its listener, to ensure that pending I/O
2781
+ // is not aborted/rejected too early.
2782
+ finalServerReactController.signal.addEventListener('abort', ()=>{
2783
+ finalServerRenderController.abort();
2784
+ }, {
2785
+ once: true
2786
+ });
2787
+ const prerenderResult = await pendingPrerenderResult;
2788
+ prerenderIsPending = false;
2789
+ return prerenderResult;
2790
+ }, ()=>{
2791
+ if (finalServerReactController.signal.aborted) {
2792
+ // If the server controller is already aborted we must have called something
2793
+ // that required aborting the prerender synchronously such as with new Date()
2794
+ serverIsDynamic = true;
2795
+ return;
2796
+ }
2797
+ if (prerenderIsPending) {
2798
+ // If prerenderIsPending then we have blocked for longer than a Task and we assume
2799
+ // there is something unfinished.
2800
+ serverIsDynamic = true;
2801
+ }
2802
+ finalServerReactController.abort();
2803
+ }));
2804
+ const clientDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(isDebugDynamicAccesses);
2805
+ const finalClientReactController = new AbortController();
2806
+ const finalClientRenderController = new AbortController();
2807
+ const finalClientPrerenderStore = {
2808
+ type: 'prerender-client',
2809
+ phase: 'render',
2810
+ rootParams,
2811
+ fallbackRouteParams,
2812
+ implicitTags,
2813
+ renderSignal: finalClientRenderController.signal,
2814
+ controller: finalClientReactController,
2815
+ // No APIs require a cacheSignal through the workUnitStore during the HTML prerender
2816
+ cacheSignal: null,
2817
+ dynamicTracking: clientDynamicTracking,
2818
+ allowEmptyStaticShell,
2819
+ revalidate: _constants1.INFINITE_CACHE,
2820
+ expire: _constants1.INFINITE_CACHE,
2821
+ stale: _constants1.INFINITE_CACHE,
2822
+ tags: [
2823
+ ...implicitTags.tags
2824
+ ],
2825
+ prerenderResumeDataCache,
2826
+ renderResumeDataCache,
2827
+ hmrRefreshHash: undefined
2828
+ };
2829
+ let dynamicValidation = (0, _dynamicrendering.createDynamicValidationState)();
2830
+ const prerender = require('react-dom/static').prerender;
2831
+ let { prelude: unprocessedPrelude, postponed } = await (0, _apprenderprerenderutils.prerenderAndAbortInSequentialTasks)(()=>{
2832
+ const pendingFinalClientResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalClientPrerenderStore, prerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx
2833
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
2834
+ reactServerStream: reactServerResult.asUnclosingStream(),
2835
+ reactDebugStream: undefined,
2836
+ preinitScripts: preinitScripts,
2837
+ clientReferenceManifest: clientReferenceManifest,
2838
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
2839
+ nonce: nonce,
2840
+ images: ctx.renderOpts.images
2841
+ }), {
2842
+ signal: finalClientReactController.signal,
2843
+ onError: (err, errorInfo)=>{
2844
+ if ((0, _dynamicrendering.isPrerenderInterruptedError)(err) || finalClientReactController.signal.aborted) {
2845
+ const componentStack = errorInfo.componentStack;
2846
+ if (typeof componentStack === 'string') {
2847
+ (0, _dynamicrendering.trackAllowedDynamicAccess)(workStore, componentStack, dynamicValidation, clientDynamicTracking);
2848
+ }
2849
+ return;
2850
+ }
2851
+ return htmlRendererErrorHandler(err, errorInfo);
2852
+ },
2853
+ onHeaders: (headers)=>{
2854
+ headers.forEach((value, key)=>{
2855
+ appendHeader(key, value);
2856
+ });
2857
+ },
2858
+ maxHeadersLength: reactMaxHeadersLength,
2859
+ bootstrapScripts: [
2860
+ bootstrapScript
2861
+ ]
2862
+ });
2863
+ // The listener to abort our own render controller must be added
2864
+ // after React has added its listener, to ensure that pending I/O is
2865
+ // not aborted/rejected too early.
2866
+ finalClientReactController.signal.addEventListener('abort', ()=>{
2867
+ finalClientRenderController.abort();
2868
+ }, {
2869
+ once: true
2870
+ });
2871
+ return pendingFinalClientResult;
2872
+ }, ()=>{
2873
+ finalClientReactController.abort();
2874
+ });
2875
+ const { prelude, preludeIsEmpty } = await (0, _apprenderprerenderutils.processPrelude)(unprocessedPrelude);
2876
+ // If we've disabled throwing on empty static shell, then we don't need to
2877
+ // track any dynamic access that occurs above the suspense boundary because
2878
+ // we'll do so in the route shell.
2879
+ if (!allowEmptyStaticShell) {
2880
+ (0, _dynamicrendering.throwIfDisallowedDynamic)(workStore, preludeIsEmpty ? _dynamicrendering.PreludeState.Empty : _dynamicrendering.PreludeState.Full, dynamicValidation, serverDynamicTracking);
2881
+ }
2882
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
2883
+ polyfills,
2884
+ renderServerInsertedHTML,
2885
+ serverCapturedErrors: allCapturedErrors,
2886
+ basePath,
2887
+ tracingMetadata: tracingMetadata
2888
+ });
2889
+ const flightData = await (0, _nodewebstreamshelper.streamToBuffer)(reactServerResult.asStream());
2890
+ metadata.flightData = flightData;
2891
+ metadata.segmentData = await collectSegmentData(flightData, finalServerPrerenderStore, ComponentMod, renderOpts);
2892
+ if (serverIsDynamic) {
2893
+ // Dynamic case
2894
+ // We will always need to perform a "resume" render of some kind when this route is accessed
2895
+ // because the RSC data itself is dynamic. We determine if there are any HTML holes or not
2896
+ // but generally this is a "partial" prerender in that there will be a per-request compute
2897
+ // concatenated to the static shell.
2898
+ if (postponed != null) {
2899
+ // Dynamic HTML case
2900
+ metadata.postponed = await (0, _postponedstate.getDynamicHTMLPostponedState)(postponed, preludeIsEmpty ? _postponedstate.DynamicHTMLPreludeState.Empty : _postponedstate.DynamicHTMLPreludeState.Full, fallbackRouteParams, resumeDataCache, cacheComponents);
2901
+ } else {
2902
+ // Dynamic Data case
2903
+ metadata.postponed = await (0, _postponedstate.getDynamicDataPostponedState)(resumeDataCache, cacheComponents);
2904
+ }
2905
+ reactServerResult.consume();
2906
+ return {
2907
+ digestErrorsMap: reactServerErrorsByDigest,
2908
+ ssrErrors: allCapturedErrors,
2909
+ stream: await (0, _nodewebstreamshelper.continueDynamicPrerender)(prelude, {
2910
+ getServerInsertedHTML,
2911
+ getServerInsertedMetadata
2912
+ }),
2913
+ dynamicAccess: (0, _dynamicrendering.consumeDynamicAccess)(serverDynamicTracking, clientDynamicTracking),
2914
+ // TODO: Should this include the SSR pass?
2915
+ collectedRevalidate: finalServerPrerenderStore.revalidate,
2916
+ collectedExpire: finalServerPrerenderStore.expire,
2917
+ collectedStale: selectStaleTime(finalServerPrerenderStore.stale),
2918
+ collectedTags: finalServerPrerenderStore.tags,
2919
+ renderResumeDataCache: (0, _resumedatacache.createRenderResumeDataCache)(resumeDataCache)
2920
+ };
2921
+ } else {
2922
+ // Static case
2923
+ // We will not perform resumption per request. The result can be served statically to the requestor
2924
+ // and if there was anything dynamic it will only be rendered in the browser.
2925
+ if (workStore.forceDynamic) {
2926
+ throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError('Invariant: a Page with `dynamic = "force-dynamic"` did not trigger the dynamic pathway. This is a bug in Next.js'), "__NEXT_ERROR_CODE", {
2927
+ value: "E598",
2928
+ enumerable: false,
2929
+ configurable: true
2930
+ });
2931
+ }
2932
+ let htmlStream = prelude;
2933
+ if (postponed != null) {
2934
+ // We postponed but nothing dynamic was used. We resume the render now and immediately abort it
2935
+ // so we can set all the postponed boundaries to client render mode before we store the HTML response
2936
+ const resume = require('react-dom/server').resume;
2937
+ // We don't actually want to render anything so we just pass a stream
2938
+ // that never resolves. The resume call is going to abort immediately anyway
2939
+ const foreverStream = new ReadableStream();
2940
+ const resumeStream = await resume(// eslint-disable-next-line @next/internal/no-ambiguous-jsx
2941
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
2942
+ reactServerStream: foreverStream,
2943
+ reactDebugStream: undefined,
2944
+ preinitScripts: ()=>{},
2945
+ clientReferenceManifest: clientReferenceManifest,
2946
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
2947
+ nonce: nonce,
2948
+ images: ctx.renderOpts.images
2949
+ }), JSON.parse(JSON.stringify(postponed)), {
2950
+ signal: (0, _dynamicrendering.createRenderInBrowserAbortSignal)(),
2951
+ onError: htmlRendererErrorHandler,
2952
+ nonce
2953
+ });
2954
+ // First we write everything from the prerender, then we write everything from the aborted resume render
2955
+ htmlStream = (0, _nodewebstreamshelper.chainStreams)(prelude, resumeStream);
2956
+ }
2957
+ let finalStream;
2958
+ const hasFallbackRouteParams = fallbackRouteParams && fallbackRouteParams.size > 0;
2959
+ if (hasFallbackRouteParams) {
2960
+ // This is a "static fallback" prerender: although the page didn't
2961
+ // access any runtime params in a Server Component, it may have
2962
+ // accessed a runtime param in a client segment.
2963
+ //
2964
+ // TODO: If there were no client segments, we can use the fully static
2965
+ // path instead.
2966
+ //
2967
+ // Rather than use a dynamic server resume to fill in the params,
2968
+ // we can rely on the client to parse the params from the URL and use
2969
+ // that to hydrate the page.
2970
+ //
2971
+ // Send an empty InitialRSCPayload to the server component renderer
2972
+ // The data will be fetched by the client instead.
2973
+ // TODO: In the future, rather than defer the entire hydration payload
2974
+ // to be fetched by the client, we should only defer the client
2975
+ // segments, since those are the only ones whose data is not complete.
2976
+ const emptyReactServerResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResultFromRender)(ComponentMod.renderToReadableStream([], clientReferenceManifest.clientModules, {
2977
+ filterStackFrame,
2978
+ onError: serverComponentsErrorHandler
2979
+ }));
2980
+ finalStream = await (0, _nodewebstreamshelper.continueStaticFallbackPrerender)(htmlStream, {
2981
+ inlinedDataStream: (0, _useflightresponse.createInlinedDataReadableStream)(emptyReactServerResult.consumeAsStream(), nonce, formState),
2982
+ getServerInsertedHTML,
2983
+ getServerInsertedMetadata,
2984
+ isBuildTimePrerendering: ctx.workStore.isBuildTimePrerendering === true,
2985
+ buildId: ctx.workStore.buildId
2986
+ });
2987
+ } else {
2988
+ // Normal static prerender case, no fallback param handling needed
2989
+ finalStream = await (0, _nodewebstreamshelper.continueStaticPrerender)(htmlStream, {
2990
+ inlinedDataStream: (0, _useflightresponse.createInlinedDataReadableStream)(reactServerResult.consumeAsStream(), nonce, formState),
2991
+ getServerInsertedHTML,
2992
+ getServerInsertedMetadata,
2993
+ isBuildTimePrerendering: ctx.workStore.isBuildTimePrerendering === true,
2994
+ buildId: ctx.workStore.buildId
2995
+ });
2996
+ }
2997
+ return {
2998
+ digestErrorsMap: reactServerErrorsByDigest,
2999
+ ssrErrors: allCapturedErrors,
3000
+ stream: finalStream,
3001
+ dynamicAccess: (0, _dynamicrendering.consumeDynamicAccess)(serverDynamicTracking, clientDynamicTracking),
3002
+ // TODO: Should this include the SSR pass?
3003
+ collectedRevalidate: finalServerPrerenderStore.revalidate,
3004
+ collectedExpire: finalServerPrerenderStore.expire,
3005
+ collectedStale: selectStaleTime(finalServerPrerenderStore.stale),
3006
+ collectedTags: finalServerPrerenderStore.tags,
3007
+ renderResumeDataCache: (0, _resumedatacache.createRenderResumeDataCache)(resumeDataCache)
3008
+ };
3009
+ }
3010
+ } else if (experimental.isRoutePPREnabled) {
3011
+ // We're statically generating with PPR and need to do dynamic tracking
3012
+ let dynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(isDebugDynamicAccesses);
3013
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
3014
+ const reactServerPrerenderStore = prerenderStore = {
3015
+ type: 'prerender-ppr',
3016
+ phase: 'render',
3017
+ rootParams,
3018
+ fallbackRouteParams,
3019
+ implicitTags,
3020
+ dynamicTracking,
3021
+ revalidate: _constants1.INFINITE_CACHE,
3022
+ expire: _constants1.INFINITE_CACHE,
3023
+ stale: _constants1.INFINITE_CACHE,
3024
+ tags: [
3025
+ ...implicitTags.tags
3026
+ ],
3027
+ prerenderResumeDataCache
3028
+ };
3029
+ const RSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(reactServerPrerenderStore, getRSCPayload, tree, ctx, res.statusCode === 404);
3030
+ const reactServerResult = reactServerPrerenderResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResultFromRender)(_workunitasyncstorageexternal.workUnitAsyncStorage.run(reactServerPrerenderStore, ComponentMod.renderToReadableStream, // ... the arguments for the function to run
3031
+ RSCPayload, clientReferenceManifest.clientModules, {
3032
+ filterStackFrame,
3033
+ onError: serverComponentsErrorHandler
3034
+ }));
3035
+ const ssrPrerenderStore = {
3036
+ type: 'prerender-ppr',
3037
+ phase: 'render',
3038
+ rootParams,
3039
+ fallbackRouteParams,
3040
+ implicitTags,
3041
+ dynamicTracking,
3042
+ revalidate: _constants1.INFINITE_CACHE,
3043
+ expire: _constants1.INFINITE_CACHE,
3044
+ stale: _constants1.INFINITE_CACHE,
3045
+ tags: [
3046
+ ...implicitTags.tags
3047
+ ],
3048
+ prerenderResumeDataCache
3049
+ };
3050
+ const prerender = require('react-dom/static').prerender;
3051
+ const { prelude: unprocessedPrelude, postponed } = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(ssrPrerenderStore, prerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx
3052
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
3053
+ reactServerStream: reactServerResult.asUnclosingStream(),
3054
+ reactDebugStream: undefined,
3055
+ preinitScripts: preinitScripts,
3056
+ clientReferenceManifest: clientReferenceManifest,
3057
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
3058
+ nonce: nonce,
3059
+ images: ctx.renderOpts.images
3060
+ }), {
3061
+ onError: htmlRendererErrorHandler,
3062
+ onHeaders: (headers)=>{
3063
+ headers.forEach((value, key)=>{
3064
+ appendHeader(key, value);
3065
+ });
3066
+ },
3067
+ maxHeadersLength: reactMaxHeadersLength,
3068
+ bootstrapScripts: [
3069
+ bootstrapScript
3070
+ ]
3071
+ });
3072
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
3073
+ polyfills,
3074
+ renderServerInsertedHTML,
3075
+ serverCapturedErrors: allCapturedErrors,
3076
+ basePath,
3077
+ tracingMetadata: tracingMetadata
3078
+ });
3079
+ // After awaiting here we've waited for the entire RSC render to complete. Crucially this means
3080
+ // that when we detect whether we've used dynamic APIs below we know we'll have picked up even
3081
+ // parts of the React Server render that might not be used in the SSR render.
3082
+ const flightData = await (0, _nodewebstreamshelper.streamToBuffer)(reactServerResult.asStream());
3083
+ if (shouldGenerateStaticFlightData(workStore)) {
3084
+ metadata.flightData = flightData;
3085
+ metadata.segmentData = await collectSegmentData(flightData, ssrPrerenderStore, ComponentMod, renderOpts);
3086
+ }
3087
+ const { prelude, preludeIsEmpty } = await (0, _apprenderprerenderutils.processPrelude)(unprocessedPrelude);
3088
+ /**
3089
+ * When prerendering there are three outcomes to consider
3090
+ *
3091
+ * Dynamic HTML: The prerender has dynamic holes (caused by using Next.js Dynamic Rendering APIs)
3092
+ * We will need to resume this result when requests are handled and we don't include
3093
+ * any server inserted HTML or inlined flight data in the static HTML
3094
+ *
3095
+ * Dynamic Data: The prerender has no dynamic holes but dynamic APIs were used. We will not
3096
+ * resume this render when requests are handled but we will generate new inlined
3097
+ * flight data since it is dynamic and differences may end up reconciling on the client
3098
+ *
3099
+ * Static: The prerender has no dynamic holes and no dynamic APIs were used. We statically encode
3100
+ * all server inserted HTML and flight data
3101
+ */ // First we check if we have any dynamic holes in our HTML prerender
3102
+ if ((0, _dynamicrendering.accessedDynamicData)(dynamicTracking.dynamicAccesses)) {
3103
+ if (postponed != null) {
3104
+ // Dynamic HTML case.
3105
+ metadata.postponed = await (0, _postponedstate.getDynamicHTMLPostponedState)(postponed, preludeIsEmpty ? _postponedstate.DynamicHTMLPreludeState.Empty : _postponedstate.DynamicHTMLPreludeState.Full, fallbackRouteParams, prerenderResumeDataCache, cacheComponents);
3106
+ } else {
3107
+ // Dynamic Data case.
3108
+ metadata.postponed = await (0, _postponedstate.getDynamicDataPostponedState)(prerenderResumeDataCache, cacheComponents);
3109
+ }
3110
+ // Regardless of whether this is the Dynamic HTML or Dynamic Data case we need to ensure we include
3111
+ // server inserted html in the static response because the html that is part of the prerender may depend on it
3112
+ // It is possible in the set of stream transforms for Dynamic HTML vs Dynamic Data may differ but currently both states
3113
+ // require the same set so we unify the code path here
3114
+ reactServerResult.consume();
3115
+ return {
3116
+ digestErrorsMap: reactServerErrorsByDigest,
3117
+ ssrErrors: allCapturedErrors,
3118
+ stream: await (0, _nodewebstreamshelper.continueDynamicPrerender)(prelude, {
3119
+ getServerInsertedHTML,
3120
+ getServerInsertedMetadata
3121
+ }),
3122
+ dynamicAccess: dynamicTracking.dynamicAccesses,
3123
+ // TODO: Should this include the SSR pass?
3124
+ collectedRevalidate: reactServerPrerenderStore.revalidate,
3125
+ collectedExpire: reactServerPrerenderStore.expire,
3126
+ collectedStale: selectStaleTime(reactServerPrerenderStore.stale),
3127
+ collectedTags: reactServerPrerenderStore.tags
3128
+ };
3129
+ } else if (fallbackRouteParams && fallbackRouteParams.size > 0) {
3130
+ // Rendering the fallback case.
3131
+ metadata.postponed = await (0, _postponedstate.getDynamicDataPostponedState)(prerenderResumeDataCache, cacheComponents);
3132
+ return {
3133
+ digestErrorsMap: reactServerErrorsByDigest,
3134
+ ssrErrors: allCapturedErrors,
3135
+ stream: await (0, _nodewebstreamshelper.continueDynamicPrerender)(prelude, {
3136
+ getServerInsertedHTML,
3137
+ getServerInsertedMetadata
3138
+ }),
3139
+ dynamicAccess: dynamicTracking.dynamicAccesses,
3140
+ // TODO: Should this include the SSR pass?
3141
+ collectedRevalidate: reactServerPrerenderStore.revalidate,
3142
+ collectedExpire: reactServerPrerenderStore.expire,
3143
+ collectedStale: selectStaleTime(reactServerPrerenderStore.stale),
3144
+ collectedTags: reactServerPrerenderStore.tags
3145
+ };
3146
+ } else {
3147
+ // Static case
3148
+ // We still have not used any dynamic APIs. At this point we can produce an entirely static prerender response
3149
+ if (workStore.forceDynamic) {
3150
+ throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError('Invariant: a Page with `dynamic = "force-dynamic"` did not trigger the dynamic pathway. This is a bug in Next.js'), "__NEXT_ERROR_CODE", {
3151
+ value: "E598",
3152
+ enumerable: false,
3153
+ configurable: true
3154
+ });
3155
+ }
3156
+ let htmlStream = prelude;
3157
+ if (postponed != null) {
3158
+ // We postponed but nothing dynamic was used. We resume the render now and immediately abort it
3159
+ // so we can set all the postponed boundaries to client render mode before we store the HTML response
3160
+ const resume = require('react-dom/server').resume;
3161
+ // We don't actually want to render anything so we just pass a stream
3162
+ // that never resolves. The resume call is going to abort immediately anyway
3163
+ const foreverStream = new ReadableStream();
3164
+ const resumeStream = await resume(// eslint-disable-next-line @next/internal/no-ambiguous-jsx
3165
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
3166
+ reactServerStream: foreverStream,
3167
+ reactDebugStream: undefined,
3168
+ preinitScripts: ()=>{},
3169
+ clientReferenceManifest: clientReferenceManifest,
3170
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
3171
+ nonce: nonce,
3172
+ images: ctx.renderOpts.images
3173
+ }), JSON.parse(JSON.stringify(postponed)), {
3174
+ signal: (0, _dynamicrendering.createRenderInBrowserAbortSignal)(),
3175
+ onError: htmlRendererErrorHandler,
3176
+ nonce
3177
+ });
3178
+ // First we write everything from the prerender, then we write everything from the aborted resume render
3179
+ htmlStream = (0, _nodewebstreamshelper.chainStreams)(prelude, resumeStream);
3180
+ }
3181
+ return {
3182
+ digestErrorsMap: reactServerErrorsByDigest,
3183
+ ssrErrors: allCapturedErrors,
3184
+ stream: await (0, _nodewebstreamshelper.continueStaticPrerender)(htmlStream, {
3185
+ inlinedDataStream: (0, _useflightresponse.createInlinedDataReadableStream)(reactServerResult.consumeAsStream(), nonce, formState),
3186
+ getServerInsertedHTML,
3187
+ getServerInsertedMetadata,
3188
+ isBuildTimePrerendering: ctx.workStore.isBuildTimePrerendering === true,
3189
+ buildId: ctx.workStore.buildId
3190
+ }),
3191
+ dynamicAccess: dynamicTracking.dynamicAccesses,
3192
+ // TODO: Should this include the SSR pass?
3193
+ collectedRevalidate: reactServerPrerenderStore.revalidate,
3194
+ collectedExpire: reactServerPrerenderStore.expire,
3195
+ collectedStale: selectStaleTime(reactServerPrerenderStore.stale),
3196
+ collectedTags: reactServerPrerenderStore.tags
3197
+ };
3198
+ }
3199
+ } else {
3200
+ const prerenderLegacyStore = prerenderStore = {
3201
+ type: 'prerender-legacy',
3202
+ phase: 'render',
3203
+ rootParams,
3204
+ implicitTags,
3205
+ revalidate: _constants1.INFINITE_CACHE,
3206
+ expire: _constants1.INFINITE_CACHE,
3207
+ stale: _constants1.INFINITE_CACHE,
3208
+ tags: [
3209
+ ...implicitTags.tags
3210
+ ]
3211
+ };
3212
+ // This is a regular static generation. We don't do dynamic tracking because we rely on
3213
+ // the old-school dynamic error handling to bail out of static generation
3214
+ const RSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, getRSCPayload, tree, ctx, res.statusCode === 404);
3215
+ const reactServerResult = reactServerPrerenderResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResultFromRender)(_workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, ComponentMod.renderToReadableStream, RSCPayload, clientReferenceManifest.clientModules, {
3216
+ filterStackFrame,
3217
+ onError: serverComponentsErrorHandler
3218
+ }));
3219
+ const renderToReadableStream = require('react-dom/server').renderToReadableStream;
3220
+ const htmlStream = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, renderToReadableStream, // eslint-disable-next-line @next/internal/no-ambiguous-jsx
3221
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
3222
+ reactServerStream: reactServerResult.asUnclosingStream(),
3223
+ reactDebugStream: undefined,
3224
+ preinitScripts: preinitScripts,
3225
+ clientReferenceManifest: clientReferenceManifest,
3226
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
3227
+ nonce: nonce,
3228
+ images: ctx.renderOpts.images
3229
+ }), {
3230
+ onError: htmlRendererErrorHandler,
3231
+ nonce,
3232
+ bootstrapScripts: [
3233
+ bootstrapScript
3234
+ ]
3235
+ });
3236
+ if (shouldGenerateStaticFlightData(workStore)) {
3237
+ const flightData = await (0, _nodewebstreamshelper.streamToBuffer)(reactServerResult.asStream());
3238
+ metadata.flightData = flightData;
3239
+ metadata.segmentData = await collectSegmentData(flightData, prerenderLegacyStore, ComponentMod, renderOpts);
3240
+ }
3241
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
3242
+ polyfills,
3243
+ renderServerInsertedHTML,
3244
+ serverCapturedErrors: allCapturedErrors,
3245
+ basePath,
3246
+ tracingMetadata: tracingMetadata
3247
+ });
3248
+ return {
3249
+ digestErrorsMap: reactServerErrorsByDigest,
3250
+ ssrErrors: allCapturedErrors,
3251
+ stream: await (0, _nodewebstreamshelper.continueFizzStream)(htmlStream, {
3252
+ inlinedDataStream: (0, _useflightresponse.createInlinedDataReadableStream)(reactServerResult.consumeAsStream(), nonce, formState),
3253
+ isStaticGeneration: true,
3254
+ isBuildTimePrerendering: ctx.workStore.isBuildTimePrerendering === true,
3255
+ buildId: ctx.workStore.buildId,
3256
+ getServerInsertedHTML,
3257
+ getServerInsertedMetadata
3258
+ }),
3259
+ // TODO: Should this include the SSR pass?
3260
+ collectedRevalidate: prerenderLegacyStore.revalidate,
3261
+ collectedExpire: prerenderLegacyStore.expire,
3262
+ collectedStale: selectStaleTime(prerenderLegacyStore.stale),
3263
+ collectedTags: prerenderLegacyStore.tags
3264
+ };
3265
+ }
3266
+ } catch (err) {
3267
+ if ((0, _staticgenerationbailout.isStaticGenBailoutError)(err) || typeof err === 'object' && err !== null && 'message' in err && typeof err.message === 'string' && err.message.includes('https://nextjs.org/docs/advanced-features/static-html-export')) {
3268
+ // Ensure that "next dev" prints the red error overlay
3269
+ throw err;
3270
+ }
3271
+ // If this is a static generation error, we need to throw it so that it
3272
+ // can be handled by the caller if we're in static generation mode.
3273
+ if ((0, _hooksservercontext.isDynamicServerError)(err)) {
3274
+ throw err;
3275
+ }
3276
+ // If a bailout made it to this point, it means it wasn't wrapped inside
3277
+ // a suspense boundary.
3278
+ const shouldBailoutToCSR = (0, _bailouttocsr.isBailoutToCSRError)(err);
3279
+ if (shouldBailoutToCSR) {
3280
+ const stack = (0, _formatservererror.getStackWithoutErrorMessage)(err);
3281
+ (0, _log.error)(`${err.reason} should be wrapped in a suspense boundary at page "${pagePath}". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\n${stack}`);
3282
+ throw err;
3283
+ }
3284
+ // If we errored when we did not have an RSC stream to read from. This is
3285
+ // not just a render error, we need to throw early.
3286
+ if (reactServerPrerenderResult === null) {
3287
+ throw err;
3288
+ }
3289
+ let errorType;
3290
+ if ((0, _httpaccessfallback.isHTTPAccessFallbackError)(err)) {
3291
+ res.statusCode = (0, _httpaccessfallback.getAccessFallbackHTTPStatus)(err);
3292
+ metadata.statusCode = res.statusCode;
3293
+ errorType = (0, _httpaccessfallback.getAccessFallbackErrorTypeByStatus)(res.statusCode);
3294
+ } else if ((0, _redirecterror.isRedirectError)(err)) {
3295
+ errorType = 'redirect';
3296
+ res.statusCode = (0, _redirect.getRedirectStatusCodeFromError)(err);
3297
+ metadata.statusCode = res.statusCode;
3298
+ const redirectUrl = (0, _addpathprefix.addPathPrefix)((0, _redirect.getURLFromRedirectError)(err), basePath);
3299
+ setHeader('location', redirectUrl);
3300
+ } else if (!shouldBailoutToCSR) {
3301
+ res.statusCode = 500;
3302
+ metadata.statusCode = res.statusCode;
3303
+ }
3304
+ const [errorPreinitScripts, errorBootstrapScript] = (0, _requiredscripts.getRequiredScripts)(buildManifest, assetPrefix, crossOrigin, subresourceIntegrityManifest, (0, _getassetquerystring.getAssetQueryString)(ctx, false), nonce, '/_not-found/page');
3305
+ const prerenderLegacyStore = prerenderStore = {
3306
+ type: 'prerender-legacy',
3307
+ phase: 'render',
3308
+ rootParams,
3309
+ implicitTags: implicitTags,
3310
+ revalidate: typeof (prerenderStore == null ? void 0 : prerenderStore.revalidate) !== 'undefined' ? prerenderStore.revalidate : _constants1.INFINITE_CACHE,
3311
+ expire: typeof (prerenderStore == null ? void 0 : prerenderStore.expire) !== 'undefined' ? prerenderStore.expire : _constants1.INFINITE_CACHE,
3312
+ stale: typeof (prerenderStore == null ? void 0 : prerenderStore.stale) !== 'undefined' ? prerenderStore.stale : _constants1.INFINITE_CACHE,
3313
+ tags: [
3314
+ ...(prerenderStore == null ? void 0 : prerenderStore.tags) || implicitTags.tags
3315
+ ]
3316
+ };
3317
+ const errorRSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, getErrorRSCPayload, tree, ctx, reactServerErrorsByDigest.has(err.digest) ? undefined : err, errorType);
3318
+ const errorServerStream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, ComponentMod.renderToReadableStream, errorRSCPayload, clientReferenceManifest.clientModules, {
3319
+ filterStackFrame,
3320
+ onError: serverComponentsErrorHandler
3321
+ });
3322
+ try {
3323
+ // TODO we should use the same prerender semantics that we initially rendered
3324
+ // with in this case too. The only reason why this is ok atm is because it's essentially
3325
+ // an empty page and no user code runs.
3326
+ const fizzStream = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, _nodewebstreamshelper.renderToInitialFizzStream, {
3327
+ ReactDOMServer: require('react-dom/server'),
3328
+ element: // eslint-disable-next-line @next/internal/no-ambiguous-jsx
3329
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(ErrorApp, {
3330
+ reactServerStream: errorServerStream,
3331
+ reactDebugStream: undefined,
3332
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
3333
+ preinitScripts: errorPreinitScripts,
3334
+ clientReferenceManifest: clientReferenceManifest,
3335
+ nonce: nonce,
3336
+ images: ctx.renderOpts.images
3337
+ }),
3338
+ streamOptions: {
3339
+ nonce,
3340
+ // Include hydration scripts in the HTML
3341
+ bootstrapScripts: [
3342
+ errorBootstrapScript
3343
+ ],
3344
+ formState
3345
+ }
3346
+ });
3347
+ if (shouldGenerateStaticFlightData(workStore)) {
3348
+ const flightData = await (0, _nodewebstreamshelper.streamToBuffer)(reactServerPrerenderResult.asStream());
3349
+ metadata.flightData = flightData;
3350
+ metadata.segmentData = await collectSegmentData(flightData, prerenderLegacyStore, ComponentMod, renderOpts);
3351
+ }
3352
+ // This is intentionally using the readable datastream from the main
3353
+ // render rather than the flight data from the error page render
3354
+ const flightStream = reactServerPrerenderResult.consumeAsStream();
3355
+ return {
3356
+ // Returning the error that was thrown so it can be used to handle
3357
+ // the response in the caller.
3358
+ digestErrorsMap: reactServerErrorsByDigest,
3359
+ ssrErrors: allCapturedErrors,
3360
+ stream: await (0, _nodewebstreamshelper.continueFizzStream)(fizzStream, {
3361
+ inlinedDataStream: (0, _useflightresponse.createInlinedDataReadableStream)(flightStream, nonce, formState),
3362
+ isStaticGeneration: true,
3363
+ isBuildTimePrerendering: ctx.workStore.isBuildTimePrerendering === true,
3364
+ buildId: ctx.workStore.buildId,
3365
+ getServerInsertedHTML: (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
3366
+ polyfills,
3367
+ renderServerInsertedHTML,
3368
+ serverCapturedErrors: [],
3369
+ basePath,
3370
+ tracingMetadata: tracingMetadata
3371
+ }),
3372
+ getServerInsertedMetadata,
3373
+ validateRootLayout: dev
3374
+ }),
3375
+ dynamicAccess: null,
3376
+ collectedRevalidate: prerenderStore !== null ? prerenderStore.revalidate : _constants1.INFINITE_CACHE,
3377
+ collectedExpire: prerenderStore !== null ? prerenderStore.expire : _constants1.INFINITE_CACHE,
3378
+ collectedStale: selectStaleTime(prerenderStore !== null ? prerenderStore.stale : _constants1.INFINITE_CACHE),
3379
+ collectedTags: prerenderStore !== null ? prerenderStore.tags : null
3380
+ };
3381
+ } catch (finalErr) {
3382
+ if (process.env.NODE_ENV === 'development' && (0, _httpaccessfallback.isHTTPAccessFallbackError)(finalErr)) {
3383
+ const { bailOnRootNotFound } = require('../../client/components/dev-root-http-access-fallback-boundary');
3384
+ bailOnRootNotFound();
3385
+ }
3386
+ throw finalErr;
3387
+ }
3388
+ }
3389
+ }
3390
+ const getGlobalErrorStyles = async (tree, ctx)=>{
3391
+ const { modules: { 'global-error': globalErrorModule } } = (0, _parseloadertree.parseLoaderTree)(tree);
3392
+ const { componentMod: { createElement } } = ctx;
3393
+ const GlobalErrorComponent = ctx.componentMod.GlobalError;
3394
+ let globalErrorStyles;
3395
+ if (globalErrorModule) {
3396
+ const [, styles] = await (0, _createcomponentstylesandscripts.createComponentStylesAndScripts)({
3397
+ ctx,
3398
+ filePath: globalErrorModule[1],
3399
+ getComponent: globalErrorModule[0],
3400
+ injectedCSS: new Set(),
3401
+ injectedJS: new Set()
3402
+ });
3403
+ globalErrorStyles = styles;
3404
+ }
3405
+ if (ctx.renderOpts.dev) {
3406
+ const dir = (process.env.NEXT_RUNTIME === 'edge' ? process.env.__NEXT_EDGE_PROJECT_DIR : ctx.renderOpts.dir) || '';
3407
+ const globalErrorModulePath = (0, _segmentexplorerpath.normalizeConventionFilePath)(dir, globalErrorModule == null ? void 0 : globalErrorModule[1]);
3408
+ if (globalErrorModulePath) {
3409
+ const SegmentViewNode = ctx.componentMod.SegmentViewNode;
3410
+ globalErrorStyles = // This will be rendered next to GlobalError component under ErrorBoundary,
3411
+ // it requires a key to avoid React warning about duplicate keys.
3412
+ createElement(SegmentViewNode, {
3413
+ key: 'ge-svn',
3414
+ type: 'global-error',
3415
+ pagePath: globalErrorModulePath
3416
+ }, globalErrorStyles);
3417
+ }
3418
+ }
3419
+ return {
3420
+ GlobalError: GlobalErrorComponent,
3421
+ styles: globalErrorStyles
3422
+ };
3423
+ };
3424
+ function createSelectStaleTime(experimental) {
3425
+ return (stale)=>{
3426
+ var _experimental_staleTimes;
3427
+ return stale === _constants1.INFINITE_CACHE && typeof ((_experimental_staleTimes = experimental.staleTimes) == null ? void 0 : _experimental_staleTimes.static) === 'number' ? experimental.staleTimes.static : stale;
3428
+ };
3429
+ }
3430
+ async function collectSegmentData(fullPageDataBuffer, prerenderStore, ComponentMod, renderOpts) {
3431
+ // Per-segment prefetch data
3432
+ //
3433
+ // All of the segments for a page are generated simultaneously, including
3434
+ // during revalidations. This is to ensure consistency, because it's
3435
+ // possible for a mismatch between a layout and page segment can cause the
3436
+ // client to error during rendering. We want to preserve the ability of the
3437
+ // client to recover from such a mismatch by re-requesting all the segments
3438
+ // to get a consistent view of the page.
3439
+ //
3440
+ // For performance, we reuse the Flight output that was created when
3441
+ // generating the initial page HTML. The Flight stream for the whole page is
3442
+ // decomposed into a separate stream per segment.
3443
+ const clientReferenceManifest = renderOpts.clientReferenceManifest;
3444
+ if (!clientReferenceManifest) {
3445
+ return;
3446
+ }
3447
+ // Manifest passed to the Flight client for reading the full-page Flight
3448
+ // stream. Based off similar code in use-cache-wrapper.ts.
3449
+ const isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge';
3450
+ const serverConsumerManifest = {
3451
+ // moduleLoading must be null because we don't want to trigger preloads of ClientReferences
3452
+ // to be added to the consumer. Instead, we'll wait for any ClientReference to be emitted
3453
+ // which themselves will handle the preloading.
3454
+ moduleLoading: null,
3455
+ moduleMap: isEdgeRuntime ? clientReferenceManifest.edgeRscModuleMapping : clientReferenceManifest.rscModuleMapping,
3456
+ serverModuleMap: (0, _encryptionutils.getServerModuleMap)()
3457
+ };
3458
+ const selectStaleTime = createSelectStaleTime(renderOpts.experimental);
3459
+ const staleTime = selectStaleTime(prerenderStore.stale);
3460
+ return await ComponentMod.collectSegmentData(renderOpts.cacheComponents, fullPageDataBuffer, staleTime, clientReferenceManifest.clientModules, serverConsumerManifest);
3461
+ }
3462
+ function isBypassingCachesInDev(renderOpts, requestStore) {
3463
+ return process.env.NODE_ENV === 'development' && !!renderOpts.dev && requestStore.headers.get('cache-control') === 'no-cache';
3464
+ }
3465
+ function WarnForBypassCachesInDev({ route }) {
3466
+ (0, _warnonce.warnOnce)(`Route ${route} is rendering with server caches disabled. For this navigation, Component Metadata in React DevTools will not accurately reflect what is statically prerenderable and runtime prefetchable. See more info here: https://nextjs.org/docs/messages/cache-bypass-in-dev`);
3467
+ return null;
3468
+ }
3469
+
3470
+ //# sourceMappingURL=app-render.js.map